PageSourceSearch

https://chattypilot.ai/_next/static/chunks/960-95c065ae1589cd0c.js

js chattypilot.ai collected 2026-10-05 11:55:12 UTC 17,409 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[960],{639:(t,e,a)=>{a.d(e,{Ri:()=>i,TV:()=>s,zs:()=>c});class n{static set(t,e){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("undefined"==typeof document)return;let{expires:n,maxAge:s,domain:i,path:c="/",secure:o,sameSite:r="lax"}=a,l="".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e));n&&(l+="; expires=".concat(n.toUTCString())),s&&(l+="; max-age=".concat(s)),i&&(l+="; domain=".concat(i)),c&&(l+="; path=".concat(c)),o&&(l+="; secure"),r&&(l+="; samesite=".concat(r)),document.cookie=l}static get(t){if("undefined"==typeof document)return null;let e="".concat(encodeURIComponent(t),"=");for(let t of document.cookie.split(";")){let a=t.trim();if(0===a.indexOf(e))return decodeURIComponent(a.substring(e.length))}return null}static remove(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"==typeof document)return;let{domain:a,path:n="/"}=e,s="".concat(encodeURIComponent(t),"=; expires=Thu, 01 Jan 1970 00:00:00 GMT");a&&(s+="; domain=".concat(a)),n&&(s+="; path=".concat(n)),document.cookie=s}static exists(t){return null!==this.get(t)}static getAll(){if("undefined"==typeof document)return{};let t={};for(let e of document.cookie.split(";")){let a=e.trim(),n=a.indexOf("=");if(n<1)continue;let s=a.slice(0,n),i=a.slice(n+1);s&&i&&(t[decodeURIComponent(s)]=decodeURIComponent(i))}return t}}let s=n.set.bind(n),i=n.get.bind(n),c=n.remove.bind(n);n.exists.bind(n)},90960:(t,e,a)=>{a.d(e,{TI:()=>c,uE:()=>u});var n=a(12870),s=a(639),i=a(86e3);function c(t){return t.platform.path.toLowerCase()}let o=["/login","/signup","/verify-otp","/forgot-password","/reset-password"],r=!1;class l{storeToken(t,e){(0,s.TV)("auth_token",t,{path:"/",secure:!0,sameSite:"lax",httpOnly:!1,...e})}getToken(){return(0,s.Ri)("auth_token")}removeToken(){(0,s.zs)("auth_token",{path:"/"})}isAuthenticated(){let t=this.getToken();return null!==t&&""!==t}async healthCheck(){return(await this.client.get("/health-check")).data.success}async getUsers(){return(await this.client.get("/users")).data.responseObject}async getUser(t){return(await this.client.get("/users/".concat(t))).data.responseObject}async getSupportedPlatforms(){return(await this.client.get("/social/platforms",{headers:{"X-Skip-Auth":"true"}})).data.responseObject}async getPlatformInfo(t){return(await this.client.get("/social/".concat(t))).data.responseObject}async getAuthUrl(t,e){return(await this.client.post("/social/".concat(t,"/auth/url"),{redirectUri:e})).data.responseObject}async exchangeToken(t,e,a,n,s){return(await this.client.post("/social/".concat(t,"/auth/token"),{code:e,businessId:s,...a?{redirectUri:a}:{},...(null==n?void 0:n.phoneNumberId)?{phoneNumberId:n.phoneNumberId}:{},...(null==n?void 0:n.wabaId)?{wabaId:n.wabaId}:{},...(null==n?void 0:n.coexistence)?{coexistence:!0}:{}})).data.responseObject}async refreshToken(t,e){return(await this.client.post("/social/".concat(t,"/auth/refresh"),{refreshToken:e})).data.responseObject}async login(t){return(await this.client.post("/auth/login",t)).data.responseObject}async registerUser(t){return(await this.client.post("/auth/registerUser",t)).data.responseObject}async joinWaitlist(t){return(await this.client.post("/waitlist",t,{headers:{"X-Skip-Auth":"true"}})).data.responseObject}async notifyCareerOpening(t){return(await this.client.post("/careers/notify",t,{headers:{"X-Skip-Auth":"true"}})).data.responseObject}async submitInquiry(t){return(await this.client.post("/inquiry",t,{headers:{"X-Skip-Auth":"true"}})).data.responseObject}async deleteAccount(){await this.client.delete("/auth/deleteAccount")}async verifyOtp(t){return(await this.client.post("/auth/verify-otp",t)).data.responseObject}async resendOtp(t){await this.client.post("/auth/resend-otp",t)}async forgotPassword(t){await this.client.post("/auth/forgot-password",t)}async resetPassword(t){await this.client.post("/auth/reset-password",t)}async getAccountProfile(){return(await this.client.get("/auth/me")).data.responseObject}async get2FAStatus(){return(await this.client.get("/auth/2fa/status")).data.responseObject}async toggle2FA(){return(await this.client.post("/auth/2fa/toggle")).data.responseObject}async getUserProfile(t){return(await this.client.get("/social/".concat(t,"/profile"))).data.responseObject}async getConversations(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25;return(await this.client.get("/social/".concat(t,"/conversations"),{params:{limit:e}})).data.responseObject}
1async getMessages(t,e){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:25;return(await this.client.get("/social/".concat(t,"/messages/").concat(e),{params:{limit:a}})).data.responseObject}async sendMessage(t,e){return(await this.client.post("/social/".concat(t,"/send"),e)).data.responseObject}async setupWebhook(t,e,a){return(await this.client.post("/social/".concat(t,"/webhook/setup"),{webhookUrl:e,fields:a})).data.responseObject}async getBusinessInformation(){return(await this.client.get("/business")).data.responseObject}async getBusinessInformationByAccount(t){try{return(await this.client.get("/business/".concat(t))).data.responseObject}catch(t){return null}}async upsertBusinessInformation(t,e){return(await this.client.put("/business/".concat(t),e)).data.responseObject}async deleteBusinessInformation(t){return(await this.client.delete("/business/".concat(t))).data.responseObject}async getContacts(t){let e=new URLSearchParams;(null==t?void 0:t.business_id)&&e.append("business_id",t.business_id.toString()),(null==t?void 0:t.user_account_id)&&e.append("user_account_id",t.user_account_id.toString()),(null==t?void 0:t.platform_id)&&e.append("platform_id",t.platform_id.toString()),(null==t?void 0:t.page)&&e.append("page",t.page.toString()),(null==t?void 0:t.limit)&&e.append("limit",t.limit.toString()),(null==t?void 0:t.search)&&e.append("search",t.search);let a=(await this.client.get("/contact?".concat(e.toString()))).data.responseObject;return{data:a.data.map(t=>({...t,participantName:t.name,participantUsername:t.username,participantProfilePicture:t.profilePictureUrl,lastMessageAt:t.lastInteractionAt,platform:t.platformName.toLowerCase()})),pagination:a.pagination}}async searchContacts(t){return this.getContacts(t)}async getContactById(t,e,a){let n=new URLSearchParams;a&&n.append("business_id",a.toString()),n.append("user_account_id",e.toString());let s=(await this.client.get("/contact/".concat(t,"?").concat(n.toString()))).data.responseObject;return{...s,participantName:s.name,participantUsername:s.username,participantProfilePicture:s.profilePictureUrl,lastMessageAt:s.lastInteractionAt,platform:s.platformName.toLowerCase()}}async getContactsCount(t,e){let a=new URLSearchParams;return e&&a.append("business_id",e.toString()),a.append("user_account_id",t.toString()),(await this.client.get("/contact/count?".concat(a.toString()))).data.responseObject}async getMessagesByContactId(t){let e=new URLSearchParams;return e.append("business_id",t.business_id.toString()),e.append("user_account_id",t.user_account_id.toString()),t.limit&&e.append("limit",t.limit.toString()),{data:(await this.client.get("/contact/".concat(t.contact_id,"/messages?").concat(e.toString()))).data.responseObject}}async sendContactMessage(t){let e=new URLSearchParams;return e.append("business_id",t.business_id.toString()),e.append("user_account_id",t.user_account_id.toString()),(await this.client.post("/contact/".concat(t.contact_id,"/messages?").concat(e.toString()),{content:t.content})).data.responseObject}async updateContactPauseAutomation(t,e,a,n){let s=new URLSearchParams;return s.append("user_account_id",t.toString()),n&&s.append("business_id",n.toString()),(await this.client.patch("/contact/".concat(e,"/pause-automation?").concat(s.toString()),{isPausedAutomation:a})).data.responseObject}async getSocialAccounts(t){return(await this.client.get("/social/accounts?businessId=".concat(t))).data.responseObject}async updateAccountActiveStatus(t,e,a){return(await this.client.patch("/social/accounts/".concat(t,"/active"),{isActive:e,businessId:a})).data.responseObject}async removeUserAccount(t,e){await this.client.delete("/social/accounts/".concat(t,"?businessId=").concat(e))}async getAutomations(t){let e=new URLSearchParams;t&&(void 0!==t.userAccountId&&e.append("userAccountId",t.userAccountId.toString()),void 0!==t.isEnabled&&e.append("isEnabled",t.isEnabled.toString()),t.responseType&&e.append("responseType",t.responseType));let a="/automation".concat(e.toString()?"?".concat(e.toString()):"");return(await this.client.get(a)).data.responseObject}async getAutomationById(t){return(await this.client.get("/automation/".concat(t))).data.responseObject}async createAutomation(t){return(await this.client.post("/automation",t)).data.responseObject}async updateAutomation(t,e){return(await this.client.put("/automation/".concat(t),e)).data.responseObject}async deleteAutomation(t){await this.client.delete("/automation/".concat(t))}async getAutomationsByUserAccountId(t){return(await this.client.get("/automation/account/".concat(t))).data.responseObject}async toggleAutomationStatus(t){return(await this.client.patch("/automation/".concat(t,"/toggle"))).data.responseObject}async getTrainingSources(t){return(await this.client.get("/training".concat(t?"?accountId=".concat(t):""))).data.responseObject}async createTrainingSource(t){return(await this.client.post("/training",t)).data.responseObject}async updateTrainingSource(t,e){return(await this.client.put("/training/".concat(t),e)).data.responseObject}async deleteTrainingSource(t){await this.client.delete("/training/".concat(t))}async trainPendingSources(t){return(await this.client.post("/training/train/".concat(t))).data.responseObject}async uploadTrainingFile(t,e){let a=new FormData;return a.append("accountId",t.toString()),a.append("file",e),(await this.client.post("/training/upload",a,{headers:{"Content-Type":"multipart/form-data"}})).data.responseObject}async searchDocuments(t,e){return(await this.client.post("/training/search",{accountId:t.toString(),query:e})).data.responseObject}
1async getMessageAnalytics(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7;return(await this.client.get("/social/analytics/messages?accountId=".concat(t,"&days=").concat(e))).data.responseObject}async getAiUsageAnalytics(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7;return(await this.client.get("/social/analytics/ai-usage?businessId=".concat(t,"&days=").concat(e))).data.responseObject}async getBillingConfig(){return(await this.client.get("/billing/config")).data.responseObject}async getBalance(){return(await this.client.get("/billing/balance")).data.responseObject}async getTransactions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(await this.client.get("/billing/transactions?limit=".concat(t,"&offset=").concat(e))).data.responseObject}async createPaymentIntent(t){return(await this.client.post("/billing/create-payment-intent",{amount:t})).data.responseObject}async getInvoiceHtml(t){let e=(0,s.Ri)("auth_token");return(await n.A.get("".concat("https://api-ai.chattypilot.ai","/billing/invoices/").concat(t),{responseType:"text",headers:e?{Authorization:"Bearer ".concat(e)}:{}})).data}async getBusinesses(){return(await this.client.get("/business")).data.responseObject}async getBusinessById(t){return(await this.client.get("/business/".concat(t))).data.responseObject}async createBusiness(t){return(await this.client.post("/business",t)).data.responseObject}async updateBusiness(t,e){return(await this.client.put("/business/".concat(t),e)).data.responseObject}async deleteBusiness(t){await this.client.delete("/business/".concat(t))}async getKnowledgeBaseSources(t){return(await this.client.get("/knowledge-base?businessId=".concat(t))).data.responseObject}async getKnowledgeBaseFiles(t){return this.getKnowledgeBaseSources(t)}async uploadKnowledgeBaseFile(t,e){let a=new FormData;return a.append("businessId",t.toString()),a.append("file",e),(await this.client.post("/knowledge-base/upload",a,{headers:{"Content-Type":"multipart/form-data"}})).data.responseObject}async createKnowledgeBaseSource(t){return(await this.client.post("/knowledge-base",t)).data.responseObject}async updateKnowledgeBaseSource(t,e,a){return(await this.client.put("/knowledge-base/".concat(e),{businessId:t,...a})).data.responseObject}async deleteKnowledgeBaseFile(t,e){await this.client.delete("/knowledge-base/".concat(e,"?businessId=").concat(t))}async searchKnowledgeBase(t,e){return(await this.client.post("/knowledge-base/search",{businessId:t,query:e})).data.responseObject}async reindexKnowledgeBase(t,e){return(await this.client.post("/knowledge-base/reindex",{businessId:t,sourceIds:e})).data.responseObject}async getTutorials(t){return(await this.client.get(t?"/tutorials?category=".concat(t):"/tutorials")).data.responseObject}async getTutorial(t){return(await this.client.get("/tutorials/".concat(t))).data.responseObject}async getAiModels(){var t;return null!=(t=(await this.client.get("/ai-models")).data.responseObject)?t:[]}async getChatWidgets(t){let e=(await this.client.get("/chat-widget?businessId=".concat(t))).data.responseObject;return Array.isArray(e)?e:e?[e]:[]}async setupChatWidget(t,e,a,n){return(await this.client.post("/chat-widget",{businessId:t,domain:e,...a?{widgetId:a}:{},...n?{themeColor:n}:{}})).data.responseObject}async verifyChatWidget(t){return(await this.client.post("/chat-widget/verify",{businessId:t})).data.responseObject}async getChatWidgetLeads(t){var e;return null!=(e=(await this.client.get("/chat-widget/leads?businessId=".concat(t))).data.responseObject)?e:[]}async getCampaigns(t){var e;return null!=(e=(await this.client.get("/campaigns?businessId=".concat(t))).data.responseObject)?e:[]}async getCampaign(t,e){return(await this.client.get("/campaigns/".concat(t,"?businessId=").concat(e))).data.responseObject}async getCampaignRecipients(t,e,a){var n,s,i,c;let o=new URLSearchParams({businessId:String(e),page:String(null!=(n=null==a?void 0:a.page)?n:1),limit:String(null!=(s=null==a?void 0:a.limit)?s:50)});return(null==a?void 0:a.status)&&o.set("status",a.status),null!=(c=(await this.client.get("/campaigns/".concat(t,"/recipients?").concat(o.toString()))).data.responseObject)?c:{data:[],pagination:{currentPage:1,totalPages:0,totalItems:0,itemsPerPage:null!=(i=null==a?void 0:a.limit)?i:50,hasNextPage:!1,hasPreviousPage:!1}}}async getCampaignTemplates(t){var e;return null!=(e=(await this.client.get("/campaigns/templates?businessId=".concat(t))).data.responseObject)?e:[]}async createCampaignTemplate(t){var e;return null!=(e=(await this.client.post("/campaigns/templates",t)).data.responseObject)?e:[]}async uploadCampaignTemplateHeader(t,e){var a;let n=new FormData;return n.append("businessId",String(t)),n.append("file",e),null!=(a=(await this.client.post("/campaigns/templates/header-media",n,{timeout:6e4,headers:{"Content-Type":void 0}})).data.responseObject)?a:{headerHandle:""}}async syncCampaignTemplates(t){var e;return null!=(e=(await this.client.post("/campaigns/templates/sync",{businessId:t})).data.responseObject)?e:[]}async getCampaignAudience(t,e){var a,n,s,i;let c=new URLSearchParams({businessId:String(t),page:String(null!=(a=null==e?void 0:e.page)?a:1),limit:String(null!=(n=null==e?void 0:e.limit)?n:50)});return(null==e?void 0:e.search)&&c.set("search",e.search),null!=(i=(await this.client.get("/campaigns/audience?".concat(c.toString()))).data.responseObject)?i:{data:[],pagination:{currentPage:1,totalPages:0,totalItems:0,itemsPerPage:null!=(s=null==e?void 0:e.limit)?s:50,hasNextPage:!1,hasPreviousPage:!1}}}async createCampaign(t){return(await this.client.post("/campaigns",t)).data.responseObject}async importCampaignContactsCsv(t){return(await this.client.post("/campaigns/contacts/import",t)).data.responseObject}constructor(t="https://api-ai.chattypilot.ai"){this.client=n.A.create({baseURL:t,headers:{"Content-Type":"application/json"},timeout:3e4}),this.client.interceptors.request.use(t=>{var e,a;if("undefined"!=typeof FormData&&t.data instanceof FormData){let e=t.headers;e&&"function"==typeof e.delete?e.delete("Content-Type"):e&&delete e["Content-Type"]}let n=i.Ay.language||"en";t.headers["Accept-Language"]=n;let c=(null==(e=t.headers)?void 0:e["X-Skip-Auth"])==="true",o=["/health-check","/social/platforms","/auth/login","/auth/registerUser","/auth/verify-otp","/auth/resend-otp","/auth/forgot-password","/auth/reset-password","/waitlist","/careers/notify","/inquiry"].some(e=>(t.url||"").endsWith(e)),r=(0,s.Ri)("auth_token");return c||o?(null==(a=t.headers)?void 0:a["X-Skip-Auth"])&&delete t.headers["X-Skip-Auth"]:r&&!t.headers.Authorization&&(t.headers.Authorization="Bearer ".concat(r)),t},t=>Promise.reject(t)),this.client.interceptors.response.use(t=>{if(t.data.success)return t;throw Error(t.data.message)},t=>{var e,a,i;let c=n.A.isAxiosError(t),l=c&&!t.response,u=(null==t?void 0:t.code)==="ERR_NETWORK";if((l||u)&&(t.isNetworkError=!0),c&&(null==(e=t.response)?void 0:e.status)===401&&((0,s.zs)("auth_token",{path:"/"}),!o.includes(window.location.pathname)&&(r||(r=!0,window.location.href="/login"))),c&&(null==(i=t.response)||null==(a=i.data)?void 0:a.message))throw Error(t.response.data.message||"Request failed");throw t})}}let u=new l}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.