PageSourceSearch

https://agenticflow.ai/_next/static/chunks/app/layout-f0a22d3f9eba37ae.js

js agenticflow.ai collected 2026-09-25 18:33:19 UTC 30,106 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[63185],{65591:function(e,t,r){Promise.resolve().then(r.t.bind(r,85528,23)),Promise.resolve().then(r.t.bind(r,7791,23)),Promise.resolve().then(r.t.bind(r,15221,23)),Promise.resolve().then(r.t.bind(r,10371,23)),Promise.resolve().then(r.bind(r,87656)),Promise.resolve().then(r.bind(r,27247)),Promise.resolve().then(r.bind(r,7001)),Promise.resolve().then(r.bind(r,41011))},87656:function(e,t,r){"use strict";r.d(t,{default:function(){return S}});var n=r(30607);(0,r(12116).S)({enabled:!1,autoSessionTracking:!1,dsn:"http://[email protected]/2",debug:!0,environment:"production"});var i=r(50949),a=r(15488),o=r(84692),s=r(4992),u=r(84283);let l=e=>{let{...t}=e,{theme:r="system"}=(0,s.F)();return(0,n.jsx)(u.x7,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var c=r(5454),d=r(18126),f=r(42721),p=r(40269);let m=i.memo(function(e){let{children:t}=e;(0,f.wH)();let{user:r}=(0,a.jj)(),o=(0,f.Hj)({options:{enabled:!!r}}),s=(0,f.P)({options:{onSuccess:()=>{o.refetch()}}});return i.useEffect(()=>{if(!r||!o.isFetched||o.isRefetching||o.isError)return;let e=o.data;if(0===e.length)s.mutate({name:"".concat(r.name,"'s Workspace")});else{let t=p.U2("workspace").id,r=e.find(e=>e.id===t);r?((0,d.kv)(e=>{e.isLoaded=!0,e.workspace=r,e.buckets=[]}),(0,d.U9)(r.id)):((0,d.kv)(t=>{t.isLoaded=!0,t.workspace=e[0],t.buckets=[]}),(0,d.U9)(e[0].id))}},[o.isFetched,o.isRefetching]),(0,n.jsx)(i.Fragment,{children:t})});var w=r(61952);let g=(0,i.createContext)(null);function _(e){let{children:t}=e,[r,a]=(0,i.useState)(null),[o,s]=(0,i.useState)(null),[u,l]=(0,i.useState)(!1),c=(0,i.useCallback)(()=>{var e;return(null===(e=window.Rewardful)||void 0===e?void 0:e.referral)?window.Rewardful.referral:r},[r]);return(0,i.useEffect)(()=>{let e=()=>{window.rewardful&&"function"==typeof window.rewardful&&window.rewardful("ready",()=>{window.Rewardful&&(a(window.Rewardful.referral||null),s(window.Rewardful.affiliate||null),l(!0))})};e();let t=setTimeout(e,1e3),r=setInterval(()=>{window.Rewardful&&(a(window.Rewardful.referral||null),s(window.Rewardful.affiliate||null),l(!0),clearInterval(r))},500);return setTimeout(()=>{clearInterval(r),l(!0)},5e3),()=>{clearTimeout(t),clearInterval(r)}},[]),(0,n.jsx)(g.Provider,{value:{referral:r,affiliate:o,isReady:u,getReferralId:c},children:t})}let h=i.createContext({selectedProject:null,setSelectedProject:()=>{}});function y(e){let{children:t}=e,[r,a]=i.useState(null);return(0,n.jsx)(h.Provider,{value:{selectedProject:r,setSelectedProject:e=>{a(e),p.cW("project",{id:(null==e?void 0:e.id)||""})}},children:t})}var v=r(86422);function b(){return window.innerWidth<640?100:20}function x(){for(let e of[".intercom-launcher",".intercom-lightweight-app-launcher",'[id*="intercom"][role="button"]','button[class*="intercom"]']){let t=document.querySelector(e);if(t){t.getAttribute("aria-label")||t.setAttribute("aria-label","Open support chat"),t.getAttribute("title")||t.setAttribute("title","Open support chat");break}}}function k(e){let{children:t}=e;return(0,i.useEffect)(()=>{window.Intercom=window.Intercom||function(){(window.Intercom.q=window.Intercom.q||[]).push(arguments)},window.Intercom("boot",{app_id:"iu156hbu",vertical_padding:b()});let e=new MutationObserver(()=>{x()});e.observe(document.body,{childList:!0,subtree:!0}),x();let t=()=>{window.Intercom("update",{vertical_padding:b()})};return window.addEventListener("resize",t),()=>{e.disconnect(),window.removeEventListener("resize",t),window.Intercom("shutdown")}},[]),(0,n.jsx)(n.Fragment,{children:t})}var S=function(e){let{children:t,initialSession:r}=e,[s,u]=i.useState(!1);return(i.useEffect(()=>{p.S1().then(()=>{u(!0)})},[]),s)?(0,n.jsx)(o.QueryClientProvider,{client:w.E,children:(0,n.jsx)(v.bK,{accessToken:r.accessToken,children:(0,n.jsx)(a.eA,{initialSession:r,children:(0,n.jsx)(_,{children:(0,n.jsx)(m,{children:(0,n.jsx)(y,{children:(0,n.jsxs)(c.pn,{children:[(0,n.jsx)(k,{children:t}),(0,n.jsx)(l,{})]})})})})})})}):null}},27247:function(e,t,r){"use strict";r.d(t,{Scripts:function(){return s}});var n=r(30607),i=r(35267),a=r(50949);let o={"@context":"https://schema.org","@type":"Organization",name:"AgenticFlow",url:"https://agenticflow.com",logo:"https://agenticflow.com/logo.png",description:"A no-code AI platform that helps you build agents that handle sales, marketing, and creative tasks around the clock.",sameAs:["https://twitter.com/agenticflow","https://linkedin.com/company/agenticflow","https://github.com/agenticflow"]};function s(){return(0,n.jsxs)(a.Fragment,{children:[(0,n.jsx)(i.default,{src:"https://r.wdfl.co/rw.js","data-rewardful":"4f85ed"}),(0,n.jsx)(i.default,{id:"rewardful-queue",strategy:"beforeInteractive",children:"(function(w,r){w._rwq=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)}})(window,'rewardful');"}),(0,n.jsx)(i.default,{id:"organization-schema",type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(o)}}),(0,n.jsx)(i.default,{src:"https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.js"}),(0,n.jsx)(i.default,{id:"clarity-script",dangerouslySetInnerHTML:{__html:'!function(e,t,n,c,r,a,s){e[n]=e[n]||function(){(e[n].q=e[n].q||[]).push(arguments)},(a=t.createElement(c)).async=1,a.src="https://www.clarity.ms/tag/mdrmp1eexu",(s=t.getElementsByTagName(c)[0]).parentNode.insertBefore(a,s)}(window,document,"clarity","script");'}}),(0,n.jsx)(i.default,{src:"https://www.googletagmanager.com/gtag/js?i
1d=G-KP6MLM53LE",async:!0}),(0,n.jsx)(i.default,{id:"google-analytics-script",dangerouslySetInnerHTML:{__html:'function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-KP6MLM53LE");'}}),(0,n.jsx)(i.default,{src:"https://cdn.amplitude.com/libs/analytics-browser-2.11.1-min.js.gz",strategy:"afterInteractive"}),(0,n.jsx)(i.default,{src:"https://cdn.amplitude.com/libs/plugin-session-replay-browser-1.8.0-min.js.gz",strategy:"afterInteractive"}),(0,n.jsx)(i.default,{id:"amplitude-js",strategy:"beforeInteractive",src:"https://cdn.amplitude.com/script/".concat("89cf0cd891f5136b22e43f9d782abd56",".js")}),(0,n.jsx)(i.default,{id:"amplitude-init",strategy:"beforeInteractive",dangerouslySetInnerHTML:{__html:"\n              // window.amplitude.add(window.sessionReplay.plugin({sampleRate: 1}));\n              window.amplitude.init('".concat("89cf0cd891f5136b22e43f9d782abd56","', undefined, {\n                fetchRemoteConfig: true,\n                defaultTracking: {\n                  pageViews: true,\n                  sessions: true,\n                  formInteractions: true,\n                  fileDownloads: true,\n                }\n              });\n            ")}}),(0,n.jsx)(i.default,{id:"intercom-settings",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:'\n              window.intercomSettings = {\n                api_base: "https://api-iam.intercom.io",\n                app_id: "'.concat("iu156hbu",'",\n              };\n            ')}}),(0,n.jsx)(i.default,{id:"intercom-widget-loader",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:"\n              (function(){var w=window;var ic=w.Intercom;if(typeof ic===\"function\"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/".concat("iu156hbu","';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};
1if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();\n            ")}})]})}},84408:function(e,t,r){"use strict";r.r(t),r.d(t,{Button:function(){return d},buttonVariants:function(){return c}});var n=r(30607),i=r(50949),a=r(5753),o=r(80371),s=r(3618);let u={"alert-circle":"View alert details",braces:"Toggle code mode",check:"Confirm","chevron-down":"Expand","chevron-left":"Previous","chevron-right":"Next","chevron-up":"Collapse",close:"Close",copy:"Copy","corner-down-right":"Connect",edit:"Edit","more-horizontal":"Open menu","more-vertical":"Open menu",minus:"Remove","pen-line":"Edit",play:"Run",plus:"Add",refresh:"Refresh","rotate-ccw":"Retry",search:"Search",settings:"Open settings","square-pen":"Edit",trash:"Delete",undo:"Undo",x:"Close"};function l(e){return e.trim().replace(/\s+/g,"-").replace(/_/g,"-").replace(/^i-/,"").replace(/^icon-/,"").replace(/^lucide-/,"").replace(/^Lucide/,"").replace(/Icon$/,"").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/-{2,}/g,"-").toLowerCase()}let c=(0,o.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),d=i.forwardRef((e,t)=>
1{let{className:r,variant:o,size:d,asChild:f=!1,children:p,...m}=e,w=f?a.g7:"button",g={...m};if(!f&&!m["aria-label"]&&!m["aria-labelledby"]&&!m.title&&!(function e(t){return null==t||"boolean"==typeof t?"":"string"==typeof t||"number"==typeof t?String(t):Array.isArray(t)?t.map(e).join(""):i.isValidElement(t)?e(t.props.children):""})(p).trim()){let e=function(e){let t=function e(t){if(null==t||"boolean"==typeof t)return null;if(Array.isArray(t)){for(let r of t){let t=e(r);if(t)return t}return null}if(!i.isValidElement(t))return null;let r=t.props;if("string"==typeof r["data-lucide"]&&r["data-lucide"].trim())return l(r["data-lucide"]);let n=function(e){if(!e)return null;let t=e.split(/\s+/).map(e=>e.trim()).find(e=>e.startsWith("lucide-")||e.includes("lucide-"));return t?l(t.split(":").pop()||t):null}(r.className);if(n)return n;let a=t.type;if("string"!=typeof a){let e=a.displayName||a.name;if(e)return l(e)}return e(r.children)}(e);if(!t)return null;for(let[e,r]of Object.entries(u))if(t===e||t.startsWith("".concat(e,"-")))return r;return t.split("-").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}(p);e&&(g["aria-label"]=e,g.title=e)}return(0,n.jsx)(w,{className:(0,s.cn)(c({variant:o,size:d,className:r})),ref:t,...g,children:p})});d.displayName="Button"},7001:function(e,t,r){"use strict";r.d(t,{CookieBanner:function(){return c}});var n=r(30607),i=r(50949),a=r(17404),o=r(92923),s=r(84408),u=r(3618);let l="agenticflow_cookie_consent";function c(){let[e,t]=(0,i.useState)(!1),r=(0,o.usePathname)();(0,i.useEffect)(()=>{"true"!==localStorage.getItem(l)&&t(!0)},[]);let c=r.includes("/embed")||r.includes("/preview");return!e||c?null:(0,n.jsx)("div",{className:(0,u.cn)("fixed bottom-0 left-0 right-0 z-50 w-full border-t bg-background p-4 shadow-lg","md:bottom-4 md:right-4 md:left-auto md:max-w-sm md:rounded-lg md:border md:border-t-0","transition-transform duration-300 ease-in-out",e?"translate-y-0":"translate-y-full md:translate-y-[calc(100%+1rem)]"),children:(0,n.jsxs)("div",{className:"flex flex-col items-start gap-3",children:[(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:['By clicking "Got it", you agree that AgenticFlow can store cookies on your device and disclose information in accordance with our'," ",(0,n.jsx)(a.default,{href:"https://docs.agenticflow.ai/policies/cookies-policy",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-primary underline underline-offset-4 hover:text-primary/90",children:"Cookies Policy"}),"."]}),(0,n.jsx)(s.Button,{onClick:()=>{localStorage.setItem(l,"true"),t(!1)},size:"sm",className:"w-full md:w-auto md:self-end",children:"Got it"})]})})}},5454:function(e,t,r){"use strict";r.d(t,{NM:function(){return c},_v:function(){return d},aJ:function(){return l},pn:function(){return s},u:function(){return u}});var n=r(30607),i=r(50949),a=r(60299),o=r(3618);let s=a.zt,u=a.fC,l=a.xz,c=a.h_,d=i.forwardRef((e,t)=>{let{className:r,sideOffset:i=4,...s}=e;return(0,n.jsx)(a.VY,{ref:t,sideOffset:i,className:(0,o.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...s})});d.displayName=a.VY.displayName},82023:function(e,t,r){"use strict";r.d(t,{Am:function(){return p},pm:function(){return m},xG:function(){return i}});var n,i,a=r(50949);(n=i||(i={})).SUCCESS="success",n.ERROR="error",n.WARNING="warning",n.INFO="info",n.LOADING="loading";let o=0,s=new Map,u=e=>{if(s.has(e))return;let t=setTimeout(()=>{s.delete(e),f({type:"REMOVE_TOAST",toastId:e})},1e6);s.set(e,t)},l=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:r}=t;
1return r?u(r):e.toasts.forEach(e=>{u(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},c=[],d={toasts:[]};function f(e){d=l(d,e),c.forEach(e=>{e(d)})}function p(e){let{...t}=e,r=(o=(o+1)%Number.MAX_SAFE_INTEGER).toString(),n=()=>f({type:"DISMISS_TOAST",toastId:r});return f({type:"ADD_TOAST",toast:{...t,id:r,open:!0,onOpenChange:e=>{e||n()}}}),{id:r,dismiss:n,update:e=>f({type:"UPDATE_TOAST",toast:{...e,id:r}})}}function m(){let[e,t]=a.useState(d);return a.useEffect(()=>(c.push(t),()=>{let e=c.indexOf(t);e>-1&&c.splice(e,1)}),[e]),{...e,toast:p,dismiss:e=>f({type:"DISMISS_TOAST",toastId:e})}}},15993:function(e,t,r){"use strict";r.d(t,{R:function(){return a}});var n=r(50949),i=r(41011);function a(){let e=n.useContext(i.sessionContext);if(!e)throw Error("useSessionActions must be used within a SessionProvider");let t=e[1],r=e=>{t(t=>{t.user={...t.user,...e}})},a=async()=>{try{let e=await fetch("/api/users/me",{headers:{Authorization:"Bearer ".concat(localStorage.getItem("accessToken"))}});if(!e.ok)throw Error("Failed to fetch user data");let t=await e.json();t&&r(t)}catch(e){console.error("Failed to refresh user credits:",e instanceof Error?e.message:"Unknown error")}};return{actionLogin:()=>{let e=localStorage.getItem("redirectAfterLogin"),t=e||window.location.href;e&&localStorage.removeItem("redirectAfterLogin"),window.location.href="/api/auth/login?returnTo=".concat(encodeURIComponent(t))},actionLogout:e=>{window.localStorage.removeItem("accessToken"),window.location.href=e?"/api/auth/logout?returnTo=".concat(encodeURIComponent(e)):"/api/auth/logout"},actionChangeUser:r,actionRefreshCredits:a}}},77171:function(e,t,r){"use strict";r.d(t,{T:function(){return o},j:function(){return a}});var n=r(50949),i=r(41011);function a(){let e=n.useContext(i.sessionContext);if(!e)throw Error("useSessionState must be used within a SessionProvider");return e[0]}function o(){let e=n.useContext(i.sessionContext);if(!e||"authenticated"!==e[0].status)throw Error("useSessionAuthenticated must be used within a SessionProvider");return{accessToken:e[0].accessToken,status:"authenticated",user:e[0].user}}},15488:function(e,t,r){"use strict";r.d(t,{eA:function(){return a.SessionProvider},Rc:function(){return n.R},Th:function(){return i.T},jj:function(){return i.j}});var n=r(15993),i=r(77171),a=r(41011),o=r(29799);o.Ry({id:o.Z_(),name:o.Z_(),email:o.Z_().email().nullable(),image:o.Z_().url(),free_credits:o.Rx().catch(()=>0),daily_free_credits:o.Rx().catch(()=>0),daily_free_credits_expiration:o.Z_().nullable().catch(()=>null),monthly_credits:o.Rx().catch(()=>0),monthly_credit_expiration:o.Z_().nullable().catch(()=>null),premium_plan_expiration:o.Z_().nullable().catch(()=>null)})},41011:function(e,t,r){"use strict";r.r(t),r.d(t,{SessionProvider:function(){return l},sessionContext:function(){return u}});var n=r(30607);r(45789);var i=(0,r(85555).$)("f9924a27d3a0c6f841f4ffb0d6d65abaa497a0f7"),a=r(29098),o=r(50949),s=r(85120);let u=o.createContext(null);function l(e){let{children:t,initialSession:r}=e,l=o.useRef(null),[c,d]=(0,s.x)({status:"authenticating",user:null,accessToken:null});return o.useEffect(function(){if(r.accessToken&&r.user){if(window.localStorage.setItem("accessToken",r.accessToken),d(e=>{e.status="authenticated",e.user=r.user,e.accessToken=r.accessToken}),window.amplitude){window.amplitude.setUserId(r.user.id);let e=new window.amplitude.Identify;e.set("email",r.user.email),e.set("name",r.user.name),window.amplitude.identify(e),window.amplitude.track("Session Initialized")}try{window.clarity&&"function"==typeof window.clarity?(console.log("Setting Clarity userID:",r.user.id),window.clarity("identify",r.user.id,null,null,r.user.name)):console.warn("Clarity not available or not a function")}catch(e){console.error("Error setting Clarity userID:",e)}}else{window.localStorage.removeItem("accessToken"),d(e=>{e.status="unauthenticated",e.user=null,e.accessToken=null}),window.amplitude&&(window.amplitude.setUserId(null),window.amplitude.reset());try{window.clarity&&"function"==typeof window.clarity?(console.log("Clearing Clarity userID"),window.clarity("identify",null)):console.warn("Clarity n
1ot available or not a function")}catch(e){console.error("Error clearing Clarity userID:",e)}}},[]),o.useEffect(()=>{let e=e=>{e.detail&&d(t=>{"authenticated"===t.status&&t.user&&(t.user={...t.user,...e.detail})})};return window.addEventListener("update-session",e),()=>{window.removeEventListener("update-session",e)}},[d]),o.useEffect(function(){if(l.current&&clearTimeout(l.current),"authenticated"===c.status){let e=(0,a.o)(c.accessToken).exp;if("number"==typeof e){let t=Date.now()/1e3;l.current=setTimeout(async()=>{let e=await i();e?(d(t=>{t.accessToken=e}),window.localStorage.setItem("accessToken",e)):(d(e=>{e.status="unauthenticated",e.user=null,e.accessToken=null}),window.localStorage.removeItem("accessToken"))},(e-t-60)*1e3)}}},[c.status]),(0,n.jsx)(u.Provider,{value:[c,d],children:t})}},18126:function(e,t,r){"use strict";r.d(t,{U9:function(){return d},kv:function(){return c}});var n=r(27506),i=r(56489),a=r(7734),o=r(61952),s=r(40269),u=r(62166),l=r(29799);function c(e){o.E.setQueryData(n.g1,t=>(0,u.Uy)(t,e))}async function d(e){let t=o.E.getQueryData((0,n.E6)()),r=null==t?void 0:t.find(t=>t.id===e);if(!r)throw Error("Workspace not found");s.cW("workspace",{id:r.id}),c(e=>{e.isSwitching=!0});let[u,d]=await Promise.all([a.Z.GET("/v1/credits/workspaces/{workspace_id}/buckets",{params:{path:{workspace_id:r.id},query:{include_expired:!1,limit:100,offset:0}}}).then(e=>e.data),a.Z.GET("/v1/workspaces/{workspace_id}/subscriptions",{params:{path:{workspace_id:r.id}}}).then(e=>e.data)]),f=l.IX(i.vl).parse(u),p=l.IX(i.iR).nullable().parse(d);c(e=>{e.workspace=r,e.buckets=f,e.subscriptions=p,e.isSwitching=!1})}},27506:function(e,t,r){"use strict";r.d(t,{E6:function(){return i},dH:function(){return a},g1:function(){return n}});let n=["state","workspace"],i=()=>["workspaces"],a=e=>["workspaces",e,"subscription"]},42721:function(e,t,r){"use strict";r.d(t,{P:function(){return s.P},wH:function(){return o},Hj:function(){return s.Hj}});var n=r(89695),i=r(27506);let a={isLoaded:!1,isSwitching:!1,workspace:null,buckets:[],subscription:[]};function o(){let{data:e}=(0,n.useQuery)({queryKey:i.g1,queryFn:()=>a,initialData:a,enabled:!1});return e}var s=r(63547)},63547:function(e,t,r){"use strict";r.d(t,{Hj:function(){return d},P:function(){return f},WF:function(){return p}});var n=r(56489),i=r(7734),a=r(89695),o=r(71991),s=r(29799),u=r(66028),l=r(27506),c=r(82023);function d(e){return(0,a.useQuery)({...null==e?void 0:e.options,queryKey:(0,l.E6)(),queryFn:async()=>{let e=await i.Z.GET("/v1/workspaces/",{params:{query:{limit:100,offset:0}}});return s.IX(n.TN).parse(e.data)},initialData:[]})}function f(e){let{isShowToast:t=!0,options:r}=e,{toast:a}=(0,c.pm)();return(0,o.useMutation)({...r,mutationFn:async e=>{let{name:t}=e,r=await i.Z.POST("/v1/workspaces/",{body:{name:t}});return n.TN.parse(r.data)},onSuccess:(e,n,i)=>{var o;null==r||null===(o=r.onSuccess)||void 0===o||o.call(r,e,n,i),t&&a({title:"Workspace created successfully",description:"Workspace ".concat(e.name," has been created.")})},onError:(e,t,n)=>{var i;null==r||null===(i=r.onError)||void 0===i||i.call(r,e,t,n)}})}function p(e){let{workspaceId:t,options:r}=e;return(0,a.useQuery)({...r,queryKey:(0,l.dH)(t),queryFn:async()=>{let e=await i.Z.GET("/v1/workspaces/{workspace_id}/subscriptions",{params:{path:{workspace_id:t}}});try{return s.IX(n.iR).parse(e.data)}catch(e){throw e instanceof u.jm&&console.error("Zod validation error:",e.errors),e}},initialData:[]})}},56489:function(e,t,r){"use strict";r.d(t,{TN:function(){return a},iR:function(){return f},vl:function(){return d}});var n=r(29799);let i=n.Ry({workspace_id:n.Z_(),user_id:n.Z_(),user_name:n.Z_(),user_email:n.Z_().nullable(),user_image:n.Z_().nullable(),role:n.Z_(),joined_at:n.Z_()}),a=n.Ry({id:n.Z_(),name:n.Z_(),users:n.IX(i),created_at:n.Z_(),updated_at:n.Z_().nullable(),created_by:n.Z_().nullable()}),o=n.Km(["monthly","quarterly","annual","lifetime"]),s=n.Km(["active","canceled","expired"]),u=n.Ry({id:n.Z_().uuid(),tier_id:n.Z_().uuid(),feature_key:n.Z_().nullable(),feature_value:n.IM(n.Yj()).nullable(),created_at:n.Z_(),updated_at:n.Z_().nullable()}),l=n.Ry({id:n.Z_().uuid(),name:n.Z_(),description:n.Z_(),created_at:n.Z_(),updated_at:n.Z_().nullable(),is_active:n.O7().default(!0),features:n.IX(u)}),c=n.Ry({id:n.Z_().uuid(),tier_id:n.Z_().uuid(),name:n.Z_(),description:n.Z_(),billing_period:o,price:n.Rx(),currency:n.Z_(),provider_price_id:n.Z_().nullable(),created_at:n.Z_(),updated_at:n.Z_().nullable(),is_active:n.O7().default(!0),tier:l}),d=n.Ry({id:n.Z_().uuid(),workspace_id:n.Z_().uuid(),source_id:n.Z_().uuid(),source_type:n.Km(["subscription","daily","system","topup"]),initial_credits:n.Rx(),remaining_credits:n.Rx(),expires_at:n.Z_().nullable(),created_at:n.Z_(),updated_at:n.Z_().nullable()}),f=n.Ry({id:n.Z_().uuid(),workspace_id:n.Z_().uuid(),plan_id:n.Z_().uuid(),status:s,provider_subscription_id:n.Z_().nullable(),current_period_start:n.Z_(),current_period_end:n.Z_(),next_credit_bucket_date:n.Z_(),cancel_at_period_end:n.O7().default(!1),created_at:n.Z_(),updated_at:n.Z_().nullable(),plan:c})},3618:function(e,t,r){"use strict";r.d(t,{cn:function(){return a}});var n=r(42422),i=r(40668);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.m6)((0,n.W)(t))}},40269:function(e,t,r){"use strict";r.d(t,{U2:function(){return f},S1:function(){return d},cW:function(){return p}});var n=r(67661),i=r(29799);let a=i.Ry({workspace:i.Ry({id:i.Z_()}),project:i.Ry({id:i.Z_().nullable()})}),o={workspace:{id:""},project:{id:null}},s="root";function u(e){a.parse(e),localStorage.setItem(s,JSON.stringify(e))}function l(){let e=localStorage.getItem(s),t=e?JSON.parse(e):void 0;if(a.safeParse(t).success)return t}let c=o;async function d(){try{!function(){n.kg.log("persisted state: check need to migrate");try{let i=window.localStorage.getItem("old-root");
1if(!l()&&i){var e,t,r;n.kg.info("persisted state: migrating legacy storage");let s=(e=JSON.parse(i),{workspace:{id:(null===(t=e.workspace)||void 0===t?void 0:t.id)||o.workspace.id},project:{id:(null===(r=e.project)||void 0===r?void 0:r.id)||o.project.id}}),l=a.safeParse(s);l.success?(u(s),n.kg.info("persisted state: migrated legacy storage")):n.kg.error("persisted state: legacy data failed validation",{message:l.error})}else n.kg.info("persisted state: no migration needed")}catch(e){n.kg.error(e,{message:"persisted state: error migrating legacy storage"})}}();let e=l();e||(n.kg.info("persisted state: initializing default storage"),u(o)),c=e||o,n.kg.log("persisted state: initialized")}catch(e){return n.kg.error("persisted state: failed to load root state from storage",{message:e}),o}}function f(e){return c[e]}function p(e,t){u(c={...c,[e]:t})}},75508:function(e,t,r){"use strict";r.d(t,{P:function(){return g},Ft:function(){return w},Hj:function(){return m}});var n=r(61952),i=r(7734),a=r(1094),o=r(29799);let s=o.Ry({workspace_id:o.Z_(),user_id:o.Z_(),user_name:o.Z_(),user_email:o.Z_().nullable(),user_image:o.Z_().nullable(),role:o.Km(["owner","admin","member"]),joined_at:o.Z_()}),u=o.Ry({id:o.Z_(),name:o.Z_(),created_at:o.Z_(),updated_at:o.Z_().nullable(),created_by:o.Z_().nullable(),users:o.IX(s)}),l=o.Ry({name:o.Z_()});class c extends a.R{}c.mapper=e=>({id:e.id,name:e.name,createdAt:e.created_at,updatedAt:e.updated_at,createdBy:e.created_by,users:e.users.map(e=>({workspaceId:e.workspace_id,userId:e.user_id,userName:e.user_name,userEmail:e.user_email,userImage:e.user_image,role:e.role,joinedAt:e.joined_at}))}),c.findAll=async()=>{let e=await i.Z.GET("/v1/workspaces/",{params:{query:{limit:100,offset:0}}});return c.validateResponse({validator:o.IX(u),data:e.data}).map(e=>c.mapper(e))},c.create=async e=>{let t=c.validatePayload({validator:l,payload:e}),r=await i.Z.POST("/v1/workspaces/",{body:t}),n=c.validateResponse({validator:u,data:r.data});return c.mapper(n)};var d=r(89695),f=r(71991);let p="workspaces";function m(e){let{options:t}=e,{preferCache:r,...i}=null!=t?t:{};return(0,d.useQuery)({...i,queryKey:[p],queryFn:()=>{if(r){let e=n.E.getQueryData([p]);if(e)return Promise.resolve(e)}return c.findAll()}})}function w(e){let{options:t}=e;return(0,f.useMutation)({...t,mutationFn:()=>c.findAll(),onSuccess:(e,r,i)=>{var a;null==t||null===(a=t.onSuccess)||void 0===a||a.call(t,e,r,i),n.E.setQueryData([p],e)}})}function g(e){let{options:t}=e;return(0,f.useMutation)({...t,mutationFn:e=>c.create(e),onSuccess:(e,r,i)=>{var a;null==t||null===(a=t.onSuccess)||void 0===a||a.call(t,e,r,i),n.E.invalidateQueries({queryKey:[p]})}})}},86422:function(e,t,r){"use strict";r.d(t,{vk:function(){return Z},bK:function(){return S},Th:function(){return k},Fe:function(){return x}});var n=r(30607),i=r(67661),a=r(40269),o=r(1106),s=r(61952),u=r(7734),l=r(1094),c=r(29799);let d=c.Ry({id:c.Z_(),name:c.Z_(),email:c.Z_().email().nullable(),image:c.Z_().url(),free_credits:c.Rx().catch(()=>0),daily_free_credits:c.Rx().catch(()=>0),daily_free_credits_expiration:c.Z_().nullable().optional(),monthly_credits:c.Rx().catch(()=>0),monthly_credit_expiration:c.Z_().nullable().optional(),premium_plan_expiration:c.Z_().nullable().optional()});class f extends l.R{}f.mapper=e=>{var t,r,n;return{id:e.id,name:e.name,email:e.email,image:e.image,freeCredits:e.free_credits,dailyFreeCredits:e.daily_free_credits,dailyFreeCreditsExpiration:null!==(t=e.daily_free_credits_expiration)&&void 0!==t?t:null,monthlyCredits:e.monthly_credits,monthlyCreditExpiration:null!==(r=e.monthly_credit_expiration)&&void 0!==r?r:null,premiumPlanExpiration:null!==(n=e.premium_plan_expiration)&&void 0!==n?n:null}},f.find=async()=>{let e=await u.Z.GET("/v1/users/me",{});try{let t=f.validateResponse({validator:d,data:e.data});return f.mapper(t)}catch(e){return null}};var p=r(71991),m=r(75508),w=r(50949),g=r(31079),_=r(76135),h=r(17596);let y={isExecuting:!0,isLoggingIn:!1,user:null,workspace:null,project:null},v=()=>(0,g.M)()((0,h.n)(e=>({...y,setExecuting:t=>{e(e=>({...e,isExecuting:t}))},setSession:t=>{if(t&&t.workspace){var r;a.cW("workspace",{id:t.workspace.id}),a.cW("project",{id:(null===(r=t.project)||void 0===r?void 0:r.id)||null}),e(e=>({...e,...t}))}else e({isLoggingIn:!1,user:null,workspace:null,project:null})},reset:()=>{e(y)}}))),b=w.createContext(null);function x(e){let t=w.useContext(b);if(!t)throw Error("Missing SessionStoreProvider");return(0,_.o)(t,e)}function k(e){let t=w.useContext(b);if(!t)throw Error("Missing SessionStoreProvider");return(0,_.o)(t,e)}function S(e){let t=w.useRef(null);return null===t.current&&(t.current=v()),(0,n.jsx)(b.Provider,{value:t.current,children:(0,n.jsx)(j,{...e})})}function j(e){let{children:t,accessToken:r}=e,[u,l]=w.useState(!1),{setExecuting:c,setSession:d}=x(e=>e),g=function(e){let{options:t}=e;return(0,p.useMutation)({...t,mutationFn:()=>f.find(),onSuccess:(e,r,n)=>{var i;null==t||null===(i=t.onSuccess)||void 0===i||i.call(t,e,r,n),s.E.setQueryData(["user"],e)}})}({}),_=(0,m.Ft)({}),h=(0,o.hF)({}),y=(0,m.P)({});w.useEffect(()=>{u?r?v():c(!1):l(!0)},[u,r]);let v=async()=>{c(!0);try{let e=await g.mutateAsync();if(!e){c(!1);return}let t=await _.mutateAsync(),r=t.find(e=>e.id===a.U2("workspace").id);if(!r){let n=t[0];if(!n&&!(n=await y.mutateAsync({name:"".concat(e.name,"'s Workspace")},{onError(e){i.kg.error("Error creating workspace",{error:e})}})))return;r=n}let n=await h.mutateAsync({workspaceId:r.id}),o=n.find(e=>e.id===a.U2("project").id)||null;!o&&n[0]&&(o=n[0]),d({isLoggingIn:!0,user:e,workspace:r,project:o})}catch(e){}finally{c(!1)}};return(0,n.jsx)(w.Fragment,{children:t})}function Z(e){let{isLoggingIn:t}=x(e=>e);return t?e.children:null}},10371:function(){}},function(e){e.O(0,[17293,96104,29799,30678,24479,61729,9285,57728,41510,98286,78932,1106,31992,80288,1744],function(){return e(e.s=65591)}),_N_E=e.O()}]);

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.