PageSourceSearch

https://spawnlabs.ai/_next/static/chunks/21613-5bc5686a20c678a8.js

js spawnlabs.ai collected 2026-10-05 12:56:35 UTC 12,489 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[21613],{46809:(e,s,a)=>{"use strict";a.d(s,{A:()=>i,O:()=>u});var l=a(95155),r=a(12115),t=a(26111);let n=(0,r.createContext)(),i=()=>{let e=(0,r.useContext)(n);if(!e)throw Error("useAuth must be used within an AuthProvider");return e};function c(e,s){try{localStorage.setItem(e,s)}catch(e){}}function o(e){var s;let a=null==e||null==(s=e.response)?void 0:s.status;return 401===a||403===a}function d(e){try{localStorage.removeItem(e)}catch(e){}}let u=e=>{let{children:s}=e,[a,i]=(0,r.useState)(null),[u,h]=(0,r.useState)(!0),[m,p]=(0,r.useState)(!1),[f,x]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{let e=e=>{i(e),p(!0),c("user",JSON.stringify(e)),(0,t.Np)(),t.p.getDefault().then(x).catch(()=>{})};for(let s=0;;s++)try{e(await t.R2.me());break}catch(l){let a=null;try{let{user:s}=await t.R2.refresh();e(s||await t.R2.me());break}catch(e){a=e}if(!o(l)&&!o(a)&&s<8){let e=function(){try{return JSON.parse(localStorage.getItem("user")||"null")}catch(e){return null}}();e&&(i(e),p(!0),h(!1)),await new Promise(e=>setTimeout(e,Math.min(1500*2**s,2e4)));continue}d("access_token"),d("user"),i(null),p(!1);break}h(!1)})()},[]);let j=(0,r.useCallback)(async e=>{try{let s=await t.R2.login(e);return i(s.user),p(!0),{success:!0,user:s.user}}catch(e){var s,a;return{success:!1,error:(null==e||null==(a=e.response)||null==(s=a.data)?void 0:s.detail)||(null==e?void 0:e.message)||"Login failed"}}},[]),v=(0,r.useCallback)(async e=>{try{let s=await t.R2.register(e);return i(s.user),p(!0),{success:!0,user:s.user,claimed_workspace_id:s.claimed_workspace_id||null}}catch(e){var s,a;return{success:!1,error:(null==e||null==(a=e.response)||null==(s=a.data)?void 0:s.detail)||(null==e?void 0:e.message)||"Registration failed"}}},[]),w=r.useRef(!1),g=(0,r.useCallback)(async()=>{w.current=!0,await t.R2.logout(),d("access_token"),d("user"),d("workspaces_cache"),d("workspaces_cache_version"),d("active_workspace_id"),d("spawn_last_model"),i(null),p(!1),x(null)},[]),N=(0,r.useCallback)(async()=>{try{let e=await t.R2.me();return i(e),p(!0),c("user",JSON.stringify(e)),e}catch(e){return null}},[]),b=(0,r.useCallback)(async e=>{i(s=>s?{...s,default_model:e}:s);try{await t.R2.setDefaultModel(e);try{let e=await t.R2.me();i(e),c("user",JSON.stringify(e))}catch(e){}return{success:!0}}catch(e){var s,l;return i(a),{success:!1,error:(null==e||null==(l=e.response)||null==(s=l.data)?void 0:s.detail)||(null==e?void 0:e.message)||"Failed"}}},[a]),k=(0,r.useCallback)(async()=>{try{let e=await t.R2.me();i(e),p(!0)}catch(e){if(!o(e))return;d("access_token"),d("user"),i(null),p(!1)}},[]),_=(0,r.useMemo)(()=>({user:a,loading:u,isAuthenticated:m,defaultAgent:f,loggingOut:w,login:j,register:v,logout:g,updateUser:N,checkAuthStatus:k,setDefaultModel:b}),[a,u,m,f,j,v,g,N,k,b]);return(0,l.jsx)(n.Provider,{value:_,children:s})}},49970:(e,s,a)=>{"use strict";a.d(s,{default:()=>z});var l=a(95155),r=a(12115),t=a(20063),n=a(15239),i=a(52619),c=a.n(i);a(73349);var o=a(39291),d=a(40102),u=a(48514),h=a(85874),m=a(61256),p=a(29397);a(57356);var f=a(63366),x=a(33931);function j(e){let{className:s,...a}=e;return(0,l.jsx)(f.bL,{"data-slot":"avatar",className:(0,x.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),...a})}function v(e){let{className:s,...a}=e;return(0,l.jsx)(f._V,{"data-slot":"avatar-image",className:(0,x.cn)("aspect-square size-full",s),...a})}function w(e){let{className:s,...a}=e;return(0,l.jsx)(f.H4,{"data-slot":"avatar-fallback",className:(0,x.cn)("bg-muted flex size-full items-center justify-center rounded-full",s),...a})}var g=a(20177),N=a(46809),b=a(43212),k=a(6631),_=a(53500),y=a(95704);function z(e){let{showSearch:s=!1}=e;(0,t.useRouter)();let{user:a,isAuthenticated:i,logout:f}=(0,N.A)(),{balance:x,loading:z}=(0,b.I)(),{isUnlimited:S}=(0,k.h)(),[C,A]=(0,r.useState)(!1);(0,r.useRef)(null);let L=y.env.NEXT_PUBLIC_AUTH_URL||"https://auth.spawnlabs.ai",R=async()=>{try{await f(),window.location.href="".concat(L,"/login?logged_out=1")}catch(e){}},H=e=>{if(!e)return"U";let s=e.split(" ");return s.length>=2?(s[0][0]+s[s.length-1][0]).toUpperCase():e[0].toUpperCase()},M=(null==x?void 0:x.available_credits)||0,B=(null==x?void 0:x.total_credits)||0;null==x||x.available_usd;let U=B>0?Math.min(M/B*100,100):0,E=e=>
1e?Math.round(e).toLocaleString():"0";return(0,l.jsx)("nav",{className:"spawn-nav fixed top-0 left-0 right-0 z-50",style:{animation:"fadeSlideDown 0.4s ease-out both"},children:(0,l.jsx)("div",{className:"spawn-nav-container",children:(0,l.jsxs)("div",{className:"spawn-nav-content",children:[(0,l.jsxs)("div",{className:"spawn-nav-left",children:[(0,l.jsx)("div",{className:"spawn-logo-section",children:(0,l.jsxs)(c(),{href:"/",children:[(0,l.jsx)(n.default,{src:_.default,alt:"Spawn Logo",width:28,height:28,className:"spawn-logo-image"}),(0,l.jsx)("span",{className:"spawn-logo-text",children:"Spawnlabs"})]})}),(0,l.jsx)("div",{className:"spawn-nav-links",children:[{title:"Enterprise",link:"/enterprise"},{title:"Blog",link:"/blog"}].map(e=>(0,l.jsx)(c(),{href:e.link,className:"spawn-nav-link",children:e.title},e.title))})]}),(0,l.jsx)("div",{className:"spawn-nav-actions",children:i&&a?(0,l.jsxs)(g.rI,{children:[(0,l.jsx)(g.ty,{asChild:!0,children:(0,l.jsx)("button",{className:"spawn-user-menu-trigger",children:(0,l.jsxs)(j,{className:"spawn-user-avatar spawn-user-avatar-lg",children:[(0,l.jsx)(v,{src:a.profile_picture||a.avatar_url,alt:a.first_name||a.name||a.email}),(0,l.jsx)(w,{className:"spawn-user-avatar-fallback",children:H(a.first_name||a.last_name||a.email)})]})})}),(0,l.jsxs)(g.SQ,{align:"end",className:"spawn-user-dropdown",children:[(0,l.jsxs)("div",{className:"sud-user-header",children:[(0,l.jsxs)(j,{className:"sud-avatar",children:[(0,l.jsx)(v,{src:a.profile_picture||a.avatar_url,alt:a.first_name||a.name||a.email}),(0,l.jsx)(w,{className:"sud-avatar-fallback",children:H(a.first_name||a.last_name||a.email)})]}),(0,l.jsxs)("div",{className:"sud-user-info",children:[(0,l.jsx)("span",{className:"sud-user-name",children:(null==a?void 0:a.username)||(null==a?void 0:a.first_name)||(null==a?void 0:a.name)||"User"}),(0,l.jsx)("span",{className:"sud-user-email",children:(null==a?void 0:a.email)||""})]})]}),(0,l.jsxs)("div",{className:"sud-usage-section",children:[(0,l.jsxs)("div",{className:"sud-usage-row",children:[(0,l.jsx)("span",{className:"sud-usage-label",children:"Credits"}),(0,l.jsx)("span",{className:"sud-usage-value",children:z?"...":S?"Unlimited":"".concat(E(M)," / ").concat(E(B))})]}),!S&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"sud-progress-bar",children:(0,l.jsx)("div",{className:"sud-progress-fill",style:{width:"".concat(U,"%")}})})})]}),(0,l.jsx)(g.mB,{className:"sud-sep"}),(0,l.jsx)(c(),{href:"/new",children:(0,l.jsxs)(g._2,{className:"sud-item",children:[(0,l.jsx)(p.n,{icon:o.A,size:18,strokeWidth:2.2}),(0,l.jsx)("span",{children:"Spawn Anything"})]})}),(0,l.jsx)(c(),{href:"/library",children:(0,l.jsxs)(g._2,{className:"sud-item",children:[(0,l.jsx)(p.n,{icon:d.A,size:18,strokeWidth:2.2}),(0,l.jsx)("span",{children:"Library"})]})}),(0,l.jsx)(c(),{href:"/skills",children:(0,l.jsxs)(g._2,{className:"sud-item",children:[(0,l.jsx)(p.n,{icon:u.A,size:18,strokeWidth:2.2}),(0,l.jsx)("span",{children:"Memory & Skills"})]})}),(0,l.jsx)(c(),{href:"/settings",children:(0,l.jsxs)(g._2,{className:"sud-item",children:[(0,l.jsx)(p.n,{icon:h.A,size:18,strokeWidth:2.2}),(0,l.jsx)("span",{children:"Account settings"})]})}),(0,l.jsxs)(g._2,{onClick:R,className:"sud-item sud-logout",children:[(0,l.jsx)(p.n,{icon:m.A,size:18,strokeWidth:2.2}),(0,l.jsx)("span",{children:"Log out"})]})]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("a",{href:"https://auth.spawnlabs.ai/login",className:"spawn-btn-ghost",children:"Login"}),(0,l.jsxs)("a",{href:"/request-access",className:"spawn-btn-primary spawn-btn-swap",children:[(0,l.jsx)("span",{className:"spawn-btn-swap-default",children:"Request Access"}),(0,l.jsx)("span",{className:"spawn-btn-swap-hover",children:"Start Spawning"})]})]})})]})})})}},73349:()=>{},84310:(e,s,a)=>{"use strict";a.d(s,{A:()=>h});var l=a(95155),r=a(52619),t=a.n(r),n=a(15239),i=a(53500);let c=[{label:"Case studies",href:"/case-studies"},{label:"Book a demo",href:"/demo"}],o=[{label:"About",href:"/about"},{label:"Blog",href:"/blog"},{label:"Enterprise",href:"/enterprise"},{label:"Careers",href:"/careers"},{label:"Security",href:"/security"}],d=[{label:"Privacy",href:"/privacy"},{label:"Terms",href:"/terms"}],u=[{label:"X",href:"https://x.com/tryspawnlabs",icon:(0,l.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":"true",children:(0,l.jsx)("path",{d:"M17.53 3H21l-7.39 8.45L22 21h-6.56l-5.14-6.37L4.5 21H1.03l7.92-9.05L1.33 3H8.1l4.64 5.85L17.53 3Zm-1.15 16.02h1.92L6.87 4.87H4.82l11.56 14.15Z"})})},{label:"LinkedIn",href:"https://www.linkedin.com/company/spawnlabs",icon:(0,l.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,l.jsx)("path",{d:"M6.94 5a2 2 0 1 1-4-.002A2 2 0 0 1 6.94 5ZM7 8.48H3V21h4V8.48Zm6.32 0H9.34V21h3.94v-6.57c0-3.66 4.77-4 4.77 0V21H22v-7.93c0-6.17-7.06-5.94-8.72-2.91l.04-1.68Z"})})},{label:"GitHub",href:"https://github.com/spawnlabs",icon:(0,l.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,l.jsx)("path",{d:"M12 2C6.48 2 2 6.58 2 12.23c0 4.52 2.87 8.35 6.84 9.7.5.1.68-.22.68-.49 0-.24-.01-.88-.01-1.72-2.78.62-3.37-1.37-3.37-1.37-.45-1.18-1.11-1.49-1.11-1.49-.91-.63.07-.62.07-.62 1 .07 1.53 1.05 1.53 1.05.9 1.56 2.35 1.11 2.92.85.09-.66.35-1.11.63-1.37-2.22-.26-4.56-1.13-4.56-5.04 0-1.11.39-2.02 1.03-2.73-.1-.26-.45-1.3.1-2.71 0 0 .84-.28 2.75 1.04A9.42 9.42 0 0 1 12 6.83c.85 0 1.7.12 2.5.34 1.91-1.32 2.75-1.04 2.75-1.04.55 1.41.2 2.45.1 2.71.64.71 1.03 1.62 1.03 2.73 0 3.92-2.35 4.78-4.58 5.03.36.32.68.94.68 1.9 0 1.37-.01 2.48-.01 2.81 0 .27.18.59.69.49C19.14 20.58 22 16.75 22 12.23 22 6.58 17.52 2 12 2Z"})})}];function h(){let e=new Date().getFullYear();return(0,l.jsxs)("footer",{className:"z-footer","data-nosnippet":!0,children:[(0,l.jsx)("span",{className:"z-footer-mark z-footer-mark--a","aria-hidden":"true"}),(0,l.jsx)("span",{className:"z-footer-mark z-footer-mark--b","aria-hidden":"true"}),(0,l.jsx)("span",{className:"z-footer-mark z-footer-mark--c","aria-hidden":"true"}),(0,l.jsxs)("div",{className:"z-footer-callout",children:[(0,l.jsx)("span",{className:"z-footer-callout-k","data-nosnippet":!0,children:"//"}),(0,l.jsxs)("span",{className:"z-footer-callout-t",children:["Digitize your ",(0,l.jsx)("em",{children:"abilities"}),"."]})]}),(0,l.jsxs)("div",{className:"z-footer-top",children:[(0,l.jsxs)("div",{className:"z-footer-brand",children:[(0,l.jsxs)(t(),{href:"/",className:"z-footer-logo",children:[(0,l.jsx)(n.default,{src:i.default,alt:"Spawn Labs",width:28,height:28}),(0,l.jsx)("span",{children:"Spawnlabs"})]}),(0,l.jsx)("p",{className:"z-footer-tag",children:"Digitize your abilities."}),(0,l.jsx)("div",{className:"z-footer-socials",children:u.map(e=>(0,l.jsx)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer","aria-label":e.label,className:"z-footer-social",children:e.icon},e.label))})]}),(0,l.jsx)("div",{className:"z-footer-columns",children:[{heading:"Product",links:c},{heading:"Company",links:o}].map((e,s)=>(0,l.jsxs)("div",{className:"z-footer-col",children:[(0,l.jsxs)("h4",{children:[(0,l.jsxs)("span",{className:"z-footer-col-k",children:[String(s+1).padStart(2,"0")," //"]}),(0,l.jsx)("span",{className:"z-footer-col-t",children:e.heading})]}),e.links.map(e=>(0,l.jsx)(t(),{href:e.href,children:e.label},e.href))]},e.heading))})]}),(0,l.jsxs)("div",{className:"z-footer-bottom",children:[(0,l.jsx)("div",{className:"z-footer-left",children:(0,l.jsxs)("span",{className:"z-footer-status",children:[(0,l.jsx)("span",{className:"z-footer-status-dot"}),"All systems operational"]})}),(0,l.jsxs)("div",{className:"z-footer-right",children:[(0,l.jsxs)("span",{children:["\xa9 ",e," Spawnlabs"]}),d.map(e=>(0,l.jsxs)("span",{className:"z-footer-legal-wrap",children:[(0,l.jsx)("span",{className:"z-footer-dot",children:"\xb7"}),(0,l.jsx)(t(),{href:e.href,children:e.label})]},e.href)),(0,l.jsx)("span",{className:"z-footer-dot",children:"\xb7"}),(0,l.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"})]})]}),(0,l.jsx)("div",{className:"z-footer-watermark","aria-hidden":"true",children:"Spawnlabs"})]})}},89995:()=>{}}]);

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.