PageSourceSearch

https://ayari.io/_next/static/chunks/8220-e2a945345a1e51ed.js

js ayari.io collected 2026-10-09 02:01:43 UTC 7,690 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="194298ad-95c3-47c9-8628-1c37c39a2ff8",e._sentryDebugIdIdentifier="sentry-dbid-194298ad-95c3-47c9-8628-1c37c39a2ff8")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8220],{12409:(e,t,a)=>{a.d(t,{R:()=>s});let r=new Map,s={getItem(e){try{return window.localStorage.getItem(e)}catch(a){var t;return null!=(t=r.get(e))?t:null}},setItem(e,t){try{window.localStorage.setItem(e,t)}catch(a){r.set(e,t)}},removeItem(e){try{window.localStorage.removeItem(e)}catch(t){r.delete(e)}}}},46525:(e,t,a)=>{a.d(t,{X:()=>i});var r=a(89678);let s={google:["email","calendar"],outlook:["email","calendar"],notion:["workspace"]},i={list:async()=>r.u.request("/api/data/service-configs"),update:async(e,t)=>r.u.request("/api/data/service-configs",{method:"POST",body:JSON.stringify({service:e,...t})}),getProviders:async()=>{var e,t,a,s;let i=await r.u.request("/api/oauth/services/providers");return{email:(null==(e=i.email)?void 0:e.map(e=>e.id))||[],calendar:(null==(t=i.calendar)?void 0:t.map(e=>e.id))||[],invoice:(null==(a=i.invoice)?void 0:a.map(e=>e.id))||[],workspace:(null==(s=i.workspace)?void 0:s.map(e=>e.id))||[]}},getProvidersDetail:async()=>r.u.request("/api/oauth/services/providers"),getUserServices:async()=>{let e=await r.u.request("/api/data/service-configs"),t={};return e.forEach(e=>{(s[e.provider]||[]).forEach(a=>{t[a]||(t[a]=[]),t[a].push({provider:e.provider,enabled:e.enabled,config:e.config,created_at:e.created_at})})}),t},save:async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.u.request("/api/data/service-configs",{method:"POST",body:JSON.stringify({service_type:e,provider:t,config:a,enabled:!0})})},delete:async(e,t)=>{try{return await r.u.request("/api/data/service-configs/".concat(e,"?provider=").concat(t),{method:"DELETE"}),!0}catch(a){return console.error("Error deleting ".concat(e,"/").concat(t," service:"),a),!1}}}},48482:(e,t,a)=>{a.d(t,{i:()=>s});var r=a(89678);let s={getOnboardingStatus:async()=>r.u.request("/api/user/onboarding-status"),activateOnboarding:async()=>r.u.request("/api/user/onboarding/activate",{method:"POST"})}},58220:(e,t,a)=>{a.d(t,{iw:()=>h.i,uE:()=>r.u,xK:()=>i,GY:()=>l,Xe:()=>c,lx:()=>n,Ax:()=>d.A,gu:()=>o,XU:()=>u.X});var r=a(89678),s=a(73561);let i={list:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=new URLSearchParams({limit:e.toString(),offset:t.toString()});return r.u.request("/api/data/conversations?".concat(a))},get:async e=>r.u.request("/api/data/conversations/".concat(e)),create:async(e,t)=>{let a=(0,s.y5)(),i={...t||{},...a?{workspace:a}:{}};return r.u.request("/api/data/conversations",{method:"POST",body:JSON.stringify({title:e||"New Conversation",...Object.keys(i).length?{metadata:i}:{}})})},update:async(e,t)=>r.u.request("/api/data/conversations/".concat(e),{method:"PATCH",body:JSON.stringify(t)}),delete:async e=>r.u.request("/api/data/conversations/".concat(e),{method:"DELETE"}),generateTitle:async e=>r.u.request("/api/data/conversations/".concat(e,"/generate-title"),{method:"POST"})},n={list:async e=>r.u.request("/api/data/conversations/".concat(e,"/messages")),create:async(e,t)=>r.u.request("/api/data/conversations/".concat(e,"/messages"),{method:"POST",body:JSON.stringify(t)})},o={get:async()=>r.u.request("/api/data/profile"),update:async e=>r.u.request("/api/data/profile",{method:"PATCH",body:JSON.stringify(e)})},c={usage:async()=>r.u.request("/api/entitlements/usage"),checkModel:async e=>r.u.request("/api/entitlements/can-use-model",{method:"POST",body:JSON.stringify({model_id:e})}),check:async e=>r.u.request("/api/entitlements/check",{method:"POST",body:JSON.stringify(e)})};var u=a(46525);let l={send:async e=>r.u.request("/api/v2/emails/send",{method:"POST",body:JSON.stringify(e)})};a(95704);var d=a(61100),h=a(96524);a(48482)},61100:(e,t,a)=>{a.d(t,{A:()=>s});var r=a(89678);let s={getUrl:async(e,t)=>r.u.request("/api/oauth/url/".concat(e,"/").concat(t)),getStatus:async()=>r.u.request("/api/oauth/status"),refreshAll:async()=>r.u.request("/api/oauth/refresh-all",{method:"POST"})}},73561:(e,t,a)=>{a.d(t,{Az:()=>c,Mu:()=>n,y5:()=>o});var r=a(25959),s=a(12409);let i="ayari:active-workspace",n=(0,r.v)(e=>({activeWorkspace:function(){let e=s.R.getItem(i);return"google"===e||"outlook"===e?e:null}(),setWorkspace:t=>{t?s.R.setItem(i,t):s.R.removeItem(i),e({activeWorkspace:t})}}));function o(){return n.getState().activeWorkspace}let c={google:"Gmail",outlook:"Outlook"}},89678:(e,t,a)=>{a.d(t,{L:()=>i,u:()=>o});var r=a(73561),s=a(95704);
1class i extends Error{get isNonRetryable(){return this.status>=400&&this.status<500&&429!==this.status}get isRateLimited(){return 429===this.status}get isServerError(){return this.status>=500}constructor(e,t,a){super(e),this.name="APIError",this.status=t,this.retryAfter=a}}class n{setTokenProvider(e){this.tokenProvider=e}setAuthProvider(e){this.authProvider=e}async getToken(){return this.tokenProvider?this.tokenProvider():null}async request(e,t){let a=await this.getToken();if(!a)throw Error("Not authenticated. Please sign in.");let s="".concat(this.baseURL).concat(e),n=(0,r.y5)(),o=async e=>fetch(s,{...t,headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json","X-Auth-Provider":this.authProvider,...n?{"X-Ayari-Workspace":n}:{},...null==t?void 0:t.headers}});try{let e=await o(a);if(401===e.status&&this.tokenProvider){let t=await this.tokenProvider();if(t&&t!==a&&(e=await o(t)),401===e.status)throw Error("Session expired. Please sign in again.")}if(204===e.status)return null;if(429===e.status){let t=parseInt(e.headers.get("Retry-After")||"60",10);throw new i("Rate limit exceeded. Please wait before trying again.",429,t)}if(e.status>=400&&e.status<500){let t=e.headers.get("content-type"),a="API error: ".concat(e.status);if(null==t?void 0:t.includes("application/json"))try{let t=await e.json();a=t.detail||t.error||a}catch(e){}throw new i(a,e.status)}let t=e.headers.get("content-type");if(!(null==t?void 0:t.includes("application/json"))){if(!e.ok)throw new i("API error: ".concat(e.status," ").concat(e.statusText),e.status);return null}let r=await e.json();if(!e.ok)throw new i(r.detail||r.error||"API request failed",e.status);return r}catch(e){if(e instanceof i||e instanceof Error)throw e;throw Error("Failed to connect to server. Please check your connection.")}}constructor(){this.tokenProvider=null,this.baseURL="https://api.ayari.io",this.authProvider="true"===s.env.NEXT_PUBLIC_USE_CLERK_AUTH?"clerk":"supabase"}}let o=new n},96524:(e,t,a)=>{a.d(t,{U:()=>s,i:()=>i});var r=a(89678);let s=[{value:"too_expensive",label:"Too expensive"},{value:"not_using",label:"Not using it enough"},{value:"missing_features",label:"Missing features I need"},{value:"switching_provider",label:"Switching to another service"},{value:"technical_issues",label:"Technical issues"},{value:"other",label:"Other reason"}],i={getSubscription:async()=>r.u.request("/api/data/account/subscription"),cancelSubscription:async e=>r.u.request("/api/data/account/cancel-subscription",{method:"POST",body:JSON.stringify(e)}),requestRefund:async e=>r.u.request("/api/data/account/request-refund",{method:"POST",body:JSON.stringify(e)}),canDeleteAccount:async()=>r.u.request("/api/data/account/can-delete"),deleteAccount:async e=>r.u.request("/api/data/account",{method:"DELETE",body:JSON.stringify(e)})}}}]);

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.