PageSourceSearch

https://studio.com/_next/static/chunks/pages/auth/callback-7fb5be84dcf3361d.js

js studio.com collected 2026-10-09 22:01:28 UTC 21,811 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3620],{46154:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,n=function(e){return"string"==typeof e&&a.test(e)}},55554:(e,t,r)=>{"use strict";r.d(t,{By:()=>i,OC:()=>p,QQ:()=>u,Sk:()=>g,XE:()=>h,kN:()=>d,p5:()=>w,pS:()=>b,qQ:()=>m,vz:()=>n,xm:()=>f});var a=r(55166);let n=e=>!!(e?.quota.enabled&&"off"!==e.quota.mode&&e.quota.enforced&&!e.quota.bypassReason&&e.quota.remaining<=0),i="enrollment_disabled",o=e=>!!e&&"object"==typeof e&&!Array.isArray(e),l=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,c=e=>{let t=[e],r=new Set,a=[];for(;t.length>0&&a.length<16;){let e=t.shift();!o(e)||r.has(e)||(r.add(e),a.push(e),t.push(e.response,e.data,e.detail))}return a},s=(e,t)=>c(e).find(t)||null,u=e=>{let t=c(e?.response).map(e=>e.code).find(e=>"string"==typeof e);return"string"==typeof t?t:(e instanceof Error?e.message:String(e||"")).includes("CREATOR_PREVIEW_LIMIT_REACHED")?"CREATOR_PREVIEW_LIMIT_REACHED":null},d=e=>"CREATOR_PREVIEW_LIMIT_REACHED"===u(e),p=(e,t)=>{if(!d(e))return null;let r=c(e?.response),a=r.find(e=>"CREATOR_PREVIEW_LIMIT_REACHED"===e.code)||r[0]||{},n=Math.max(0,l(a.limit,5)),i=Math.max(0,l(a.used,n)),o=Math.max(0,l(a.remaining,n-i)),s="string"==typeof a.requestId&&a.requestId.trim()?a.requestId:t;return{type:"creator_preview_limit_reached",code:"CREATOR_PREVIEW_LIMIT_REACHED",limit:n,used:i,remaining:o,...s?{requestId:s}:{}}},h=e=>{let t=s(e,e=>o(e.kickoff)||"scheduled"===e.status||"pending_configuration"===e.status||"temporarily_unavailable"===e.status),r=o(t)&&"kickoff"in t?t.kickoff:t;return o(r)?{status:"scheduled"===r.status?"scheduled":"pending_configuration"===r.status?"pending_configuration":"temporarily_unavailable",phase:"upcoming"===r.phase||"live"===r.phase||"recording_processing"===r.phase||"recording_available"===r.phase?r.phase:null,cohortId:"string"==typeof r.cohortId?r.cohortId:null,scheduledAt:"string"==typeof r.scheduledAt?r.scheduledAt:null,endsAt:"string"==typeof r.endsAt?r.endsAt:null,programStartedAt:"string"==typeof r.programStartedAt?r.programStartedAt:null,launchDate:"string"==typeof r.launchDate?r.launchDate:null,timezone:"string"==typeof r.timezone?r.timezone:null,weekday:"number"==typeof r.weekday?r.weekday:null,localTime:"string"==typeof r.localTime?r.localTime:null,meetingUrl:"string"==typeof r.meetingUrl?r.meetingUrl:null,recordingUrl:"string"==typeof r.recordingUrl?r.recordingUrl:null,recordingPublishedAt:"string"==typeof r.recordingPublishedAt?r.recordingPublishedAt:null}:null},g=async e=>{let t=s(await (0,a.fetchDxApiAuthenticated)({path:"/creator-access/self-service/enroll",method:"POST",body:JSON.stringify({attribution:e||null}),isJsonPayload:!0,suppressErrorLogging:!0}),e=>"eligible"in e||"experience"in e)||{};return{experience:"self_service_v1"===t.experience?"self_service_v1":"control",eligible:!0===t.eligible,reason:"string"==typeof t.reason?t.reason:"unknown"}},f=async e=>{let t="string"==typeof e?e.trim():"";return(e=>{let t=(e=>{let t=s(e,e=>o(e.quota));if(!t)throw Error("Creator access response did not include a valid quota payload");return t})(e),r=o(t.quota)?t.quota:{},a=o(t.launchAccess)?t.launchAccess:{},n=Math.max(0,l(r.limit,5)),i=Math.max(0,l(r.used,0)),c=Math.max(0,l(r.reserved,0)),u=Math.max(0,l(r.remaining,n-i-c)),d=r.bypassReason,p="string"==typeof r.mode?r.mode:"off";return{experience:"self_service_v1"===t.experience?"self_service_v1":"control",launchAccess:{allowed:!0===a.allowed,requiredAction:"subscribe"===a.requiredAction?"subscribe":null,reason:"string"==typeof a.reason?a.reason:"studio_plan_required"},quota:{enabled:!0===r.enabled||"enforce"===p,enforced:!0===r.enforced||"enforce"===p,mode:p,limit:n,used:i,reserved:c,remaining:u,bypassReason:"approved"===d||"control"===d||"vip"===d||"subscription"===d?d:null}}})(await (0,a.fetchDxApiAuthenticated)({path:t?`/creator-access/status?appId=${encodeURIComponent(t)}`:"/creator-access/status",method:"GET",isJsonPayload:!0,suppressErrorLogging:!0}))},m=async()=>h(await (0,a.fetchDxApiAuthenticated)({path:"/creator-access/kickoff",method:"GET",isJsonPayload:!0,suppressErrorLogging:!0})),b=async()=>{let e=s(await (0,a.fetchDxApiAuthenticated)({path:"/creator-access/admin/kickoff-cohorts",method:"GET",isJsonPayload:!0}),e=>Array.isArray(e.cohorts));return e&&Array.isArray(e.cohorts)?e.cohorts:[]},w=async(e,t)=>{let r=s(await (0,a.fetchDxApiAuthenticated)({path:`/creator-access/admin/kickoff-cohorts/${encodeURIComponent(e)}/recording`,method:"PATCH",body:JSON.stringify({recordingUrl:t}),isJsonPayload:!0}),e=>o(e.cohort));if(!r||!o(r.cohort))throw Error("The kickoff recording could not be saved");return r.cohort}},69878:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>_,default:()=>I});var a=r(37876),n=r(14232),i=r(89099),o=r(36854),l=r(18559),c=r(96379),s=r(71180),u=r(50424),d=r
1(78312),p=r(8770),h=r(80198);r(98159);var g="_18x7n2c2",f="_18x7n2c4",m=r(70677),b=r(93239),w=r(55554);let y=e=>{let t=(0,u.lO)(e);return t?"newCreatorAuthState"===e&&"creatorJoinCta"!==t.source||t.timestamp&&t.timestamp<Date.now()-18e5?((0,u.z2)(e),null):t.pendingInviteCode?.trim()||null:null},A=e=>{let t=(0,u.lO)(e);return t?!t.timestamp||t.timestamp<Date.now()-18e5?((0,u.z2)(e),null):t:null};var _=!0;let I=()=>{let e=(0,i.useRouter)(),{isHandlingRedirect:t,error:_,authenticatedUserId:I}=(()=>{let[e,t]=(0,n.useState)({isHandlingRedirect:!1,error:null}),[a,o]=(0,n.useState)(null),h=(0,i.useRouter)(),{user:g}=(0,s.GD)(),f=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{if(!h.isReady||f.current)return;let a=h.query.code,n=new URL(window.location.href).searchParams.get("code");if((a||n)&&h.pathname.includes("callback")&&!g&&!e.isHandlingRedirect){f.current=!0;let e=(0,u.lO)("onboardingAuthState"),a=e?.storefrontSlug||("string"==typeof h.query.storefrontSlug?h.query.storefrontSlug:void 0),n=e?.appSlug||("string"==typeof h.query.appSlug?h.query.appSlug:void 0),i=e?.returnPath,s=e?.currentPageIndex;t({isHandlingRedirect:!0,error:null}),(0,c.QW)(a,n).then(async e=>{if("success"===e.type){let c;o(e.value.userId);let h=(e=>{let t=(0,u.lO)(e);return t?"newCreatorAuthState"===e&&"creatorJoinCta"!==t.source||t.timestamp&&t.timestamp<Date.now()-18e5?((0,u.z2)(e),null):t.pendingInviteCode?.trim()||null:null})("newCreatorAuthState"),g=(0,p.Hc)(),f=h||g?.pendingInviteCode?.trim()||null;if(f)try{let{claimInvite:e}=await Promise.resolve().then(r.bind(r,44844));await e(f)}catch{console.error("[useSocialAuthRedirect] Failed to claim invite before redirect")}try{(0,u.z2)("onboardingAuthState")}catch{console.error("[useSocialAuthRedirect] Error clearing storage")}let m=(0,u.lO)("appBuilderAuthState");if(e.metadata?.returnToOnboarding&&e.metadata.returnPath){c=e.metadata.returnPath,void 0!==s&&(c+=c.includes("?")?`&pageIndex=${s}`:`?pageIndex=${s}`),window.location.href=c;return}let b=(0,d.hb)();if(b){window.location.href=b;return}if(m?.pageSource==="DXAppBuilder")return void t({isHandlingRedirect:!1,error:null});if(i){c=i,void 0!==s&&(c+=c.includes("?")?`&pageIndex=${s}`:`?pageIndex=${s}`),window.location.href=c;return}if(a&&n){c=`/apps/${a}/${n}/onboarding`,void 0!==s&&(c+=`?pageIndex=${s}`),window.location.href=c;return}let w=!1;try{w=!!window.sessionStorage.getItem("postAuthRedirect")}catch(e){l.Cp(e,{extra:{context:"Unable to read post-auth redirect during social auth callback"}})}let y=!h&&g?.pendingInviteCode?.trim()&&!w?(0,p.l5)():null;if(y)return void window.location.replace(y);t({isHandlingRedirect:!1,error:null})}else console.error("[useSocialAuthRedirect] Error handling social auth redirect"),t({isHandlingRedirect:!1,error:e.message||"Error completing authentication"})}).catch(()=>{console.error("[useSocialAuthRedirect] Exception handling social auth redirect"),t({isHandlingRedirect:!1,error:"Failed to log in. It's likely you have an old account with the same email. Please log in with your old credentials or contact support."})})}},[h.isReady,h.query,h.pathname,g,e.isHandlingRedirect,h]),{...e,authenticatedUserId:a}})(),{appIdea:S,isSubmitting:v}=(0,h.gM)(),{user:R}=(0,s.As)(),[C,E]=(0,n.useState)(null),[k,P]=(0,n.useState)(null),x=(0,n.useRef)(null),[q,D]=(0,n.useState)(!1),[T,O]=(0,n.useState)(!1),M=(0,n.useRef)(!1),[U,L]=(0,n.useState)(null),[j,z]=(0,n.useState)(!1),[N,J]=(0,n.use
1State)(null),H=R?.userId||I;(0,n.useEffect)(()=>{let t=()=>{let t=(e=>{try{let t=window.location.href;if(!t.includes("?"))return null;let r=t.split("?")[1];if(!r)return null;return r.split("&").reduce((e,t)=>{let[r,a]=t.split("=");return r&&a&&(e[r]=decodeURIComponent(a)),e},{})[e]||null}catch{return null}})("code"),r=e.query.code,a=e.asPath?.split("?")[1]?.split("&").find(e=>e.startsWith("code="))?.split("=")[1],n=!!(t||r||a);D(n),!n&&e.isReady?L("No authentication code detected in URL. If you're stuck here, try signing in again."):n&&L(null)};t();let r=()=>{t()};return window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)},[e.query,e.isReady,e.asPath]);let $=(0,n.useCallback)(async(t,a)=>{if(!M.current&&a)try{let n=y("newCreatorAuthState")||y("joinPageAuthState");if(n)try{let{claimInvite:e}=await Promise.resolve().then(r.bind(r,44844));await e(n),(0,u.z2)("newCreatorAuthState"),(0,u.z2)("joinPageAuthState")}catch{console.error("[Callback Page] Failed to claim invite before DXAppBuilder redirect")}let i=A("appBuilderAuthState");if(i?.buildMode==="deep"){let e=i.appIdea||t;if(!e?.trim())throw Error("Unable to restore the deep-build idea");if((0,u.JA)("pendingAppIdea",{content:e.trim(),creatorSocialLinks:i.creatorSocialLinks,buildMode:"deep",timestamp:Date.now()}),!(0,m.pT)({userId:a}))throw Error("Unable to bind the deep-build handoff");(0,u.z2)("appBuilderAuthState"),M.current=!0,window.location.replace("/dashboard/builder?mode=kickstart&view=loading&new=1&refresh=1");return}let c=(0,m.qO)();if(!c&&"string"==typeof t&&t.trim()){let e=(0,m.O4)({source:"build",appIdea:t.trim()});(0,m.HS)(e)&&(c=e)}if(!c)throw Error("Unable to restore the saved builder handoff");if("creator_landing"===c.source||"creator_start"===c.source)try{let t=await (0,w.Sk)(c.attribution);if(!t.eligible||"self_service_v1"!==t.experience){if(M.current=!0,t.reason===w.By){let t=c.attribution?.vertical==="languages"?"/creator/start/languages?enrollment=unavailable":"/creator/start?enrollment=unavailable";await e.replace(t);return}(0,m.h6)(),window.location.replace("creator_app_exists"===t.reason?"/dashboard":"/creator");return}}catch(r){l.Cp(r,{extra:{context:"Creator prompt OAuth enrollment"}}),M.current=!0;let t="creator_landing"===c.source?"/creator/join/languages":c.attribution?.vertical==="languages"?"/creator/start/languages":"/creator/start";await e.replace(t);return}let s=(0,m.Gx)(a);if(!s)throw Error("Unable to promote the saved builder handoff");if("creator_landing"===c.source||"creator_start"===c.source){let e=c.attribution?.vertical==="languages"?"creator_start_languages":c.source;o.Ay.capture("creator_prompt_first_auth_completed",{entry_point:e,method:"oauth",...c.attribution}),o.Ay.capture("creator_prompt_first_blueprint_handoff",{entry_point:e,auth_state:"authenticated",...c.attribution})}if("build"===c.source){let{builderPath:e}=await (0,b.E)(s);(0,m.Cg)(),M.current=!0,window.location.replace(e);return}M.current=!0,window.location.replace("/dashboard/builder?mode=kickstart&view=loading&new=1&refresh=1")}catch(e){l.Cp(e,{extra:{context:"Prepare OAuth builder handoff"}}),M.current=!0,window.location.replace("/build")}},[e]);return(0,n.useEffect)(()=>{if(t||k||M.current)return;let e=(0,u.lO)("onboardingAuthState");if(e?.returnPath)P(e.returnPath),E("your onboarding process");else{let e=A("newCreatorAuthState");if(e?.pendingAccessCode&&e?.pendingInviteCode?.trim()&&"creatorJoinCta"===e.source){P("/build"),E("your app builder");return}
1e?.pendingAccessCode&&(!e.pendingInviteCode?.trim()||"creatorJoinCta"!==e.source)&&(0,u.z2)("newCreatorAuthState");let r=(()=>{let e=window.sessionStorage.getItem("postAuthRedirect");if(!e)return null;let t="/";if(e.startsWith("/"))t=e;else try{let r=new URL(e,window.location.origin);r.origin===window.location.origin&&(t=(r.pathname||"/")+(r.search||"")+(r.hash||""))}catch{}return window.sessionStorage.removeItem("postAuthRedirect"),t})();if(r){try{let e=r.startsWith("/checkout")?"your checkout":"where you were";E(e)}catch{E("where you were")}P(r);return}let a=A("appBuilderAuthState"),n=a?.buildMode==="deep"?a:(0,m.qO)(),i=S||null,o=n?.pageSource;if(!i&&n?.appIdea&&(i=n.appIdea),"DXAppBuilder"===o&&(i||S)){if(E("your app builder"),!t&&q&&!_&&!v){let e=i||S;e&&H&&$(e,H)}}else if("DXAppBuilder"===o)P("/build"),E("your app builder");else{let e=document.referrer,t=window.location.origin,r=!!e&&!!t&&e.startsWith(t);if(r&&e&&(e.includes("/build")||e.includes("/dashboard/build")||e.includes("/creator")))P(e.includes("/creator")?"/creator":"/build"),E("your app builder");else if("/"===window.sessionStorage.getItem("authSourcePage")){try{window.sessionStorage.removeItem("authSourcePage")}catch{console.error("[Callback Page] Failed to clear authSourcePage")}P("/"),E("home")}else{let t=(0,p.l5)();if(t)console.log("[Callback Page] ✅ PATH 9: Referral join flow detected"),P(t),E("your creator application");else{console.log("[Callback Page] ✅ PATH 10: Default redirect (referrer or homepage)");let t="/";if(r)try{let r=new URL(e);t=(r.pathname||"/")+(r.search||"")+(r.hash||"")}catch(r){l.Cp(r,{extra:{context:"Failed to parse same-origin auth callback referrer",referrer:e}}),console.error("[Callback Page] Failed to parse same-origin referrer URL, defaulting to /",r),t="/"}console.log("[Callback Page] Default return path (sanitized):",t),P(t),E("where you were")}}}}},[t,q,_,S,v,R,H,$]),(0,n.useEffect)(()=>{if(q&&!t&&!_&&k&&!M.current&&!j){O(!0);let t=setTimeout(async()=>{try{if(M.current)return;let t=k||"/";M.current=!0;try{await e.replace(t)}catch{console.error("[Callback Page] Router replace failed, falling back"),window.location.replace(t)}}catch{console.error("[Callback Page] Redirect error"),window.location.href=k||"/"}},800);return()=>clearTimeout(t)}},[q,t,_,k,e,j]),(0,n.useEffect)(()=>{let r=setTimeout(async()=>{if(q&&!t&&!M.current){M.current=!0;try{await e.push(k||"/")}catch{console.error("[Callback Page] Timeout redirect error"),window.location.href=k||"/"}}},3e4);return()=>clearTimeout(r)},[q,t,k,e,R]),(0,n.useEffect)(()=>(x.current&&(clearTimeout(x.current),x.current=null),_&&(x.current=setTimeout(async()=>{M.current=!0;try{await e.push(k||"/")}catch{console.error("[Callback Page] Error redirect error"),window.location.href=k||"/"}},3e3)),()=>{x.current&&(clearTimeout(x.current),x.current=null)}),[_,k,e]),(0,a.jsx)("div",{className:"_18x7n2c0",children:(0,a.jsxs)("div",{className:"_18x7n2c9",children:[(0,a.jsx)("h1",{className:"_18x7n2c1",children:_?"Authentication Error":N?"App Creation Error":j?"Authentication Successful!":T?"Authentication Complete!":"Completing Authentication..."}),_?(0,a.jsx)("p",{className:g,children:_}):N?(0,a.jsx)("p",{className:g,children:N}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"_18x7n2c7"}),(0,a.jsx)("p",{className:"_18x7n2c3",children:j?"Setting up your account and preparing your experience...":T?`Authentication successful! Redirecting you to ${C}...`:C?`Please wait while we sign you in and return you to ${C}...`:"Please wait while we complete your sign in..."}),U&&(0,a.jsx)("p",{className:f,style:{color:"orange"},children:U})]}),(_||N)&&(0,a.jsxs)("p",{className:f,children:["Redirecting you to ",C||"home"," in a few seconds..."]})]})})}},70677:(e,t,r)=>{"use strict";r.d(t,{Cg:()=>y,GU:()=>o,Gx:()=>_,HS:()=>m,Iq:()=>g,O4:()=>f,h6:()=>b,pT:()=>A,qO:()=>w});var a=r(57186),n=r(46154),i=r(50424);let o="appBuilderAuthState",l="pendingAppIdea",c=new Set(["fbclid","gclid","fbc","fbp","studio_meta_campaign_id","studio_meta_adset_id","studio_meta_ad_id","placement","from","cta","vertical","landingPage"]),s=()=>"function"==typeof globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():(0,a.A)(),u=(e,t)=>
1Number.isFinite(e)&&e<=t+6e4&&e>t-18e5,d=e=>"string"==typeof e&&e.trim().length>0,p=e=>e.startsWith("utm_")||c.has(e),h=e=>{if(!e||"object"!=typeof e||Array.isArray(e))return;let t=Object.entries(e).filter(([e,t])=>p(e)&&"string"==typeof t&&t.trim().length>0).slice(0,20).reduce((e,[t,r])=>(e[t]=r.trim().slice(0,500),e),{});return Object.keys(t).length>0?t:void 0},g=(e,t="undefined"!=typeof document?document.cookie:"")=>{try{let r=new URL(e,"https://studio.com"),a={};return r.searchParams.forEach((e,t)=>{p(t)&&(a[t]=e)}),"/creator/start/languages"!==r.pathname||a.vertical||(a.vertical="languages"),"language_vsl"===a.from?a.landingPage="/creator/join/languages":r.pathname.startsWith("/creator/join/")&&(a.landingPage=r.pathname),t.split(";").forEach(e=>{let t=e.indexOf("=");if(t<0)return;let r=e.slice(0,t).trim(),n=e.slice(t+1).trim();"_fbp"===r&&n&&!a.fbp&&(a.fbp=decodeURIComponent(n)),"_fbc"===r&&n&&!a.fbc&&(a.fbc=decodeURIComponent(n))}),h(a)}catch{return}},f=({source:e,appIdea:t,clientRequestId:r=s(),createdAt:a=Date.now(),attribution:i})=>{let o=(0,n.A)(r)?r:s(),l=h(i);return{version:1,source:e,clientRequestId:o,appIdea:t,buildMode:"regular",createdAt:a,autoStart:!0,pageSource:"DXAppBuilder",timestamp:a,autoSubmit:!0,...l?{attribution:l}:{}}},m=e=>{(0,i.JA)(o,e);let t=[];try{t.push(window.localStorage.getItem(o))}catch{}try{t.push(window.sessionStorage.getItem(o))}catch{}return t.some(t=>{if(!t)return!1;try{let r=JSON.parse(t);return r?.version===1&&r.clientRequestId===e.clientRequestId&&r.appIdea===e.appIdea}catch{return!1}})},b=()=>{(0,i.z2)(o),(0,i.z2)(`${o}_direct`)},w=({now:e=Date.now()}={})=>{let t=(0,i.lO)(o);if(((e,t)=>!!e&&"object"==typeof e&&1===e.version&&("creator_landing"===e.source||"creator_start"===e.source||"build"===e.source)&&d(e.clientRequestId)&&(0,n.A)(e.clientRequestId)&&d(e.appIdea)&&"regular"===e.buildMode&&!0===e.autoStart&&(null==e.attribution||!!h(e.attribution))&&u(e.createdAt,t))(t,e))return t;let r=((e,t)=>e&&"object"==typeof e&&"DXAppBuilder"===e.pageSource&&d(e.appIdea)&&"number"==typeof e.timestamp&&u(e.timestamp,t)&&(null==e.buildMode||"regular"===e.buildMode)&&(null==e.mode||"appIdea"===e.mode)?f({source:"build",appIdea:e.appIdea,createdAt:e.timestamp}):null)(t,e);return r&&m(r)?r:(null!=t&&b(),null)},y=()=>{(0,i.z2)(l)},A=({now:e=Date.now(),userId:t}={})=>{let r=(0,i.lO)(l);if(((e,t)=>!!e&&"object"==typeof e&&1===e.version&&("creator_landing"===e.source||"creator_start"===e.source||"build"===e.source)&&d(e.clientRequestId)&&(0,n.A)(e.clientRequestId)&&d(e.content)&&("regular"===e.buildMode||"deep"===e.buildMode)&&!0===e.autoStart&&(null==e.attribution||!!h(e.attribution))&&d(e.userId)&&u(e.createdAt,t))(r,e)&&(!t||r.userId===t))return r;if(r&&"object"==typeof r){let a=null==r.version&&d(r.content)&&"number"==typeof r.timestamp&&u(r.timestamp,e)&&(null==r.buildMode||"regular"===r.buildMode||"deep"===r.buildMode);if(a&&!t)return null;if(a&&t?.trim()){let e={version:1,source:"build",clientRequestId:s(),content:r.content,buildMode:r.buildMode??"regular",createdAt:r.timestamp,promotedAt:r.timestamp,timestamp:r.timestamp,autoStart:!0,userId:t.trim(),...r.creatorSocialLinks?{creatorSocialLinks:r.creatorSocialLinks}:{}};(0,i.JA)(l,e);let a=(0,i.lO)(l);if(a?.version===1&&a.clientRequestId===e.clientRequestId&&a.userId===e.userId)return a}}return null!=r&&y(),null},_=(e,t={})=>{let r=e.trim();if(!r)return null;let a=t.now??Date.now(),n=w({now:a});if(!n)return null;let o={version:1,source:n.source,clientRequestId:n.clientRequestId,content:n.appIdea,buildMode:n.buildMode,createdAt:n.createdAt,promotedAt:a,timestamp:a,autoStart:n.autoStart,userId:r,...n.attribution?{attribution:n.attribution}:{}};(0,i.JA)(l,o);let c=A({now:a,userId:r});return c&&c.clientRequestId===o.clientRequestId?(b(),c):null}},71168:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth/callback",function(){return r(69878)}])},78312:(e,t,r)=>{"use strict";r.d(t,{Hf:()=>u,Ym:()=>c,ZM:()=>d,hb:()=>s});var a=r(44844),n=r(50424);let i="newCreatorAuthState",o="creatorLoginAuthState",l=e=>!!e&&e.startsWith("/")&&!e.startsWith("//"),c=e=>{l(e)&&(0,n.JA)(o,{returnPath:e,timestamp:Date.now()})},s=()=>{let e=(0,n.lO)(o);return e?((0,n.z2)(o),!e.timestamp||e.timestamp<Date.now()-3e5||!l(e.returnPath))?null:e.returnPath:null},u=async e=>{let t=(0,n.lO)(i);if(!t?.pendingAccessCode)return!1;if("creatorJoinCta"!==t.source||t.timestamp&&t.timestamp<Date.now()-18e5)return(0,n.z2)(i),!1;let r=t.pendingInviteCode?.trim();if(!r)return!1;if(e?.isStudioVip){try{localStorage.setItem("vipAccessGranted","true")}catch{}return(0,n.z2)(i),!1}await (0,a.claimInvite)(r);try{localStorage.setItem("vipAccessGranted","true")}catch{}return(0,n.z2)(i),!0},d=()=>{(0,n.z2)(i),(0,n.z2)(o)}},93239:(e,t,r)=>{"use strict";r.d(t,{E:()=>i});var a=r(99590),n=r(50424);let i=async(e,{createAppRequest:t=a.createApp,now:r=Date.now}={})=>{let i=await t({appIdea:e.content,clientRequestId:e.clientRequestId,...e.creatorSocialLinks?{creatorSocialLinks:e.creatorSocialLinks}:{},...e.buildMode?{buildMode:e.buildMode}:{}},{requireAuthentication:!0}
1),o="string"==typeof i?.app?.id?i.app.id.trim():"",l="string"==typeof i?.app?.slug?i.app.slug.trim():"";if(!o||!l)throw Error("App creation returned an invalid response");return(0,n.JA)(`appIdea_${o}`,{content:e.content,clientRequestId:e.clientRequestId,source:e.source,timestamp:r()}),i.canvas_settings&&(0,n.JA)(`canvasSettings_${o}`,i.canvas_settings),i.generation_complete&&(0,n.JA)(`generationComplete_${o}`,!0),{appId:o,appSlug:l,builderPath:`/dashboard/builder?app=${encodeURIComponent(l)}&mode=kickstart&view=loading&refresh=1`}}},98159:()=>{}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=71168)),_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.