PageSourceSearch

https://www.wyattworks.ai/_next/static/chunks/16vh5_ulo6-dh.js?dpl=dpl_6behjDta9ipsu7VwPwFScP3xXxh2

js wyattworks.ai collected 2026-10-05 13:24:07 UTC 38,625 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="a50b6dff-202f-87ad-7120-154310ae1ccf")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,534167,e=>{"use strict";class t{max;m;constructor(e=100){this.max=e,this.m=new Map}get(e){let t=this.m.get(e);return void 0!==t&&(this.m.delete(e),this.m.set(e,t)),t}set(e,t){this.m.has(e)&&this.m.delete(e),this.m.set(e,t),this.m.size>this.max&&this.m.delete(this.m.keys().next().value)}clear(){this.m.clear()}}let r=0;class n extends Error{status;code;retryAfterSeconds;details;constructor(e,t,r,n){super(r),this.status=e,this.code=t,this.name="CoworkApiError",this.retryAfterSeconds=n?.retryAfterSeconds,this.details=n?.details}}let i=new Set(["check-slug","discoverable"]);class a{baseDomain;environment;resolveBaseUrlFn;getSessionToken;getAuthHeaders;workspaceId;baseUrlOverride;requestTimeoutMs;uploadTimeoutMs;etags=new t(100);sessionCacheEpoch=r;constructor(e){this.baseDomain=e.baseDomain,this.environment=e.environment,this.resolveBaseUrlFn=e.resolveBaseUrl,this.getSessionToken=e.getSessionToken,this.getAuthHeaders=e.getAuthHeaders,this.workspaceId=e.workspaceId,this.baseUrlOverride=e.baseUrl,this.requestTimeoutMs=Math.max(1,e.requestTimeoutMs??3e4),this.uploadTimeoutMs=Math.max(1,e.uploadTimeoutMs??3e5)}setWorkspace(e){this.ensureCurrentSessionCache(),this.workspaceId=e}ensureCurrentSessionCache(){this.sessionCacheEpoch!==r&&(this.workspaceId=void 0,this.etags.clear(),this.sessionCacheEpoch=r)}getBaseUrl(e){if(this.baseUrlOverride)return this.baseUrlOverride;let t=e||this.workspaceId;if(this.resolveBaseUrlFn){if(!t)throw Error("No workspace set - call setWorkspace() first");return this.resolveBaseUrlFn(t)}if(this.baseDomain.includes("localhost"))return`http://${this.baseDomain}`;if(!t)throw Error("No workspace set - call setWorkspace() first");throw Error(`No config-backed data plane resolver configured for workspace "${t}"`)}async buildHeaders({contentType:e="application/json",accept:t,forceRefresh:r=!1,ifNoneMatch:n,idempotencyKey:i}
2){let a=await this.getSessionToken(r),o={};return e&&(o["Content-Type"]=e),t&&(o.Accept=t),a&&(o.Authorization=`Bearer ${a}`),this.getAuthHeaders&&Object.assign(o,await this.getAuthHeaders()),n&&(o["If-None-Match"]=n),i&&(o["Idempotency-Key"]=i),o}apiUrl(e){return this.ensureCurrentSessionCache(),`${this.getBaseUrl(function(e){let t=/^\/workspaces\/([^/?#]+)/.exec(e);if(t)try{let e=decodeURIComponent(t[1]);return i.has(e)?void 0:e}catch{return i.has(t[1])?void 0:t[1]}}(e))}/api/v1${e}`}async send(e){let t=this.apiUrl(e.path),r=async(r=!1)=>fetch(t,{method:e.method,headers:await this.buildHeaders({contentType:e.contentType,accept:e.accept,forceRefresh:r,ifNoneMatch:e.ifNoneMatch,idempotencyKey:e.idempotencyKey}),credentials:"include",body:e.body,keepalive:e.keepalive,cache:e.cache,signal:e.signal}),n=await r(!1);return 401!==n.status||!1===e.retryOnUnauthorized?n:r(!0)}async parseApiError(e){let t=await e.json().catch(()=>null),r=e.headers.get("retry-after"),i=r?Number.parseInt(r,10):NaN;return new n(e.status,t?.error?.code??"unknown",t?.error?.message??e.statusText,{retryAfterSeconds:Number.isFinite(i)?i:void 0,details:t?.error?.details})}withRequestDeadline(e,t,r=this.requestTimeoutMs){let n=new AbortController;return new Promise((i,a)=>{let o=!1,s=t=>{o||(o=!0,clearTimeout(u),e?.removeEventListener("abort",l),t())},l=()=>{let t=e?.reason??Object.assign(Error("Request aborted"),{name:"AbortError"});n.abort(t),s(()=>a(t))},u=setTimeout(()=>{let e=Object.assign(Error(`Request timed out after ${r}ms`),{name:"TimeoutError"});n.abort(e),s(()=>a(e))},r);e?.aborted?l():(e?.addEventListener("abort",l,{once:!0}),t(n.signal).then(e=>s(()=>i(e)),e=>s(()=>a(e))))})}async request(e,t,r,n){return this.withRequestDeadline(n?.signal,async i=>{this.ensureCurrentSessionCache();let a="GET"===e?this.etags.get(t):void 0,o=await this.send({method:e,path:t,body:r?JSON.stringify(r):void 0,keepalive:n?.keepalive,cache:n?.cache,signal:i,ifNoneMatch:a?.etag,idempotencyKey:n?.idempotencyKey});if(304===o.status){if(a)return a.body;let o=await this.send({method:e,path:t,body:r?JSON.stringify(r):void 0,keepalive:n?.keepalive,cache:n?.cache,signal:i,idempotencyKey:n?.idempotencyKey});if(!o.ok)throw await this.parseApiError(o);if(204===o.status)return;let s=await o.json(),l=o.headers.get("ETag");return l&&this.etags.set(t,{etag:l,body:s}),s}if(!o.ok)throw await this.parseApiError(o);if(204===o.status)return;let s=await o.json(),l=o.headers.get("ETag");return l&&"GET"===e&&this.etags.set(t,{etag:l,body:s}),s})}async get(e,t){return this.request("GET",e,void 0,t)}async getList(e,t){return this.request("GET",e,void 0,t)}async getData(e,t){return(await this.get(e,t)).data}async post(e,t,r){return this.request("POST",e,t,r)}async postBinary(e,t,r,n){return this.withRequestDeadline(n?.signal,async i=>{let a=await this.send({method:"POST",path:e,body:t,contentType:r,keepalive:n?.keepalive,cache:n?.cache,signal:i,idempotencyKey:n?.idempotencyKey});if(!a.ok)throw await this.parseApiError(a);if(204!==a.status)return await a.json()})}async postList(e,t,r){return this.request("POST",e,t,r)}async put(e,t,r){return this.request("PUT",e,t,r)}async patch(e,t,r){return this.request("PATCH",e,t,r)}async delete(e,t){await this.request("DELETE",e,void 0,t)}async deleteWithResponse(e,t){return this.request("DELETE",e,void 0,t)}async streamRaw(e,t,r){return this.send({method:"POST",path:e,body:JSON.stringify(t),contentType:"application/json",accept:"text/event-stream",signal:r?.signal??void 0})}async streamRawGet(e,t){return this.send({method:"GET",path:e,accept:"text/event-stream",signal:t?.signal??void 0})}async upload(e,t,r){return this.withRequestDeadline(r?.signal,async r=>{let n=await this.send({method:"POST",path:e,body:t,contentType:!1,signal:r});if(!n.ok)throw await this.parseApiError(n);return n.json()},this.uploadTimeoutMs)}async downloadBlob(e,t){let r=await this.send({method:"GET",path:e,accept:"image/*",signal:t?.signal});if(!r.ok)throw await this.parseApiError(r);return r.blob()}async *stream(e,t){let r=await this.send({method:"POST",path:e,body:JSON.stringify(t),contentType:"application/json",accept:"text/event-stream"});if(!r.ok)throw await this.parseApiError(r);let n=r.body?.getReader();if(!n)throw Error("No response body");let i=new TextDecoder,a="";for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=(a+=i.decode(t,{stream:!0})).split("\n");for(let e of(a=r.pop()||"",r))if(e.startsWith("data: ")){let t=e.slice(6).trim();if("[DONE]"===t)return;try{let e=JSON.parse(t);yield e}catch{}}}}}e.s(["CoworkApiError",0,n,"CoworkClient",0,a,"resetCoworkClientSessionCaches",0,function(){r+=1}])},580107,e=>{"use strict";var t=e.i(982472),r=e.i(73263),n=t.createContext(void 0);e.s(["QueryClientProvider",0,({client:e,children:i})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(n.Provider,{value:e,children:i})),"useQueryClient",0,e=>{let r=t.useContext(n);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r}])},826895,e=>{"use strict";var t=e.i(999e3),r=e.i(390850);let n="wyatt.signupAttribution",i="wyatt.signupAttribution.landingEvent";function a(){try{return window.sessionStorage}catch{return null}}function o(e){if("string"!=typeof e)return!1;let t=Date.parse(e),r=Date.now()-t;return Number.isFinite(t)&&r>=0&&r<=18e5}function s(){let e=a();if(e)try{e.removeItem(n)}catch{}}function l(){if(!(0,t.hasAnalyticsConsent)())return s(),null;let e=a();if(!e)return null;try{let t=e.getItem(n);if(!t)return null;let r=JSON.parse(t);if(!(r&&"object"==typeof r&&"string"==typeof r.page_key&&"string"==typeof r.cta_id&&"string"==typeof r.landing_event_id&&"string"==typeof r.captured_at&&(void 0===r.experiment_variant||"string"==typeof r.experiment_variant)&&o(r.captured_at)))return s(),null;return r}catch{return s(),null}}window.addEventListener(r.COOKIE_CONSENT_CHANGED_EVENT,e=>{if("necessary"===e.detail){s();try{a()?.removeItem(i)}catch{}}}),e.s(["consumeSignupAttributionProperties",0,function(){let e,t=((e=l())&&s(),e);return t?{page_key:t.page_key,cta_id:t.cta_id,landing_event_id:t.landing_event_id,...t.experiment_variant?{experiment_variant:t.experiment_variant}:{}}:{}},"getLandingEventId",0,function(e){if(!(0,t.hasAnalyticsConsent)())return;let r=a();if(r)try{let t=JSON.parse(r.getItem(i)||"null");if(!(t&&"object"==typeof t&&"string"==typeof t.page_key&&"string"==typeof t.landing_event_id&&o(t.captured_at))||t.page_key!==e)return void r.removeItem(i);return t.landing_event_id}catch{r.removeItem(i);return}},"getSignupAttributionProperties",0,function(){let e=l();return e?{page_key:e.page_key,cta_id:e.cta_id,landing_event_id:e.landing_event_id,...e.experiment_variant?{experiment_variant:e.experiment_variant}:{}}:{}},"signupCompletionAttributionProperties",0,function(e){return e.landing_event_id?e:{landing_event_id_missing_reason:"direct_signup"}},"storeLandingEvent",0,function(e,r){if(!(0,t.hasAnalyticsConsent)())return;let n=a();if(n)try{n.setItem(i,JSON.stringify({page_key:e,landing_event_id:r,captured_at:new Date().toISOString()}))}catch{}},"storeSignupAttribution",0,function(e){if(!(0,t.hasAnalyticsConsent)())return void s();let r={page_key:e.page_key,cta_id:e.cta_id,landing_event_id:e.landing_event_id,..."string"==typeof e.experiment_variant&&e.experiment_variant.length>0?{experiment_variant:e.experiment_variant}:{},captured_at:new Date().toISOString()},i=a();if(i)try{i.setItem(n,JSON.stringify(r))}catch{}}])},667229,e=>{"use strict";function t(){if(globalThis.crypto?.randomUUID)return globalThis.crypto.randomUUID();let e=Array.from({length:16}
2,()=>Math.floor(256*Math.random()));e[6]=15&e[6]|64,e[8]=63&e[8]|128;let t=e.map(e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}e.s(["createAnalyticsEventId",0,function(e){return`${e}:${t()}`},"createOpaqueAnalyticsId",0,t])},837879,e=>{"use strict";var t=e.i(416635),r=e.i(999e3),n=e.i(137262),i=e.i(944651);let a="[Wyatt:Ads]",o=null,s=null,l=null,u=0;function c(){try{(0,i.setMetaAdvancedMatching)(o?{em:o.emailHash}:null)}catch(e){console.error(a,"Meta ad identity update failed",e)}try{(0,n.updateGtmUserData)(s?{sha256_email_address:s}:null)}catch(e){console.error(a,"Google ad identity update failed",e)}}async function d(e,n={}){let i,h;if(!(0,r.hasAnalyticsConsent)())return void p();let f=(0,t.normalizeEmailForAdTracking)(e.email),m=(0,t.normalizeEmailForGoogleAdTracking)(e.email);if(!f||!m){n.authoritative&&p();return}n.authoritative&&o&&l!==f&&p();let g=++u;try{i=await (0,t.sha256Hex)(f),h=m===f?i:await (0,t.sha256Hex)(m)}catch(e){console.error(a,"ad tracking identity hashing failed",e);return}g===u&&(0,r.hasAnalyticsConsent)()&&(o?.emailHash!==i||s!==h)&&(o={emailHash:i},s=h,l=f,c())}function p(){u+=1,o=null,s=null,l=null,c()}e.s(["clearAdTrackingIdentity",0,p,"setAdTrackingIdentity",0,d])},711334,e=>{"use strict";let t="/onboarding",r=["/invite/","/join/","/share/"],n=/^\/workspaces\/[^/]+\/?$/,i="https://wyatt.invalid",a=new Set(["/","/login","/registration","/logout","/recovery","/verification","/error"]),o=["/api/","/login/","/registration/","/recovery/","/verification/","/logout/"];function s(e){if(!e)return null;let t=e.trim();if(!t||!t.startsWith("/")||t.startsWith("//"))return null;try{let e=new URL(t,i);if(e.origin!==i||a.has(e.pathname)||o.some(t=>e.pathname.startsWith(t)))return null;return`${e.pathname}${e.search}${e.hash}`}catch{return null}}e.s(["POST_AUTH_REDIRECT_COOKIE",0,"wyatt_post_auth_redirect","POST_AUTH_REDIRECT_COOKIE_MAX_AGE_SECONDS",0,600,"buildOnboardingRedirectPath",0,function(e){let r=s(e);return r&&"/home"!==r?`${t}?next=${encodeURIComponent(r)}`:t},"encodePostAuthRedirectCookieValue",0,function(e){return encodeURIComponent(e)},"isJoinFlowRedirect",0,function(e){let t=s(e);if(!t)return!1;let{pathname:a}=new URL(t,i);return r.some(e=>a.startsWith(e))||n.test(a)},"normalizePostAuthRedirect",0,s])},499317,e=>{"use strict";var t=e.i(667229);let r={HOME:"/home",LOGIN:"/login",ONBOARDING:"/onboarding",ONBOARDING_SETUP:"/onboarding/setup",JOIN_WORKSPACE:"/join-workspace",DOCUMENTS:"/documents",AUTH_CALLBACK:"/auth/callback"};e.s(["AppRoutes",0,r,"buildOnboardingSetupRoute",0,function(e,n,i){let a=new URLSearchParams({workspace:e,onboarding_flow_id:i?.flowId??(0,t.createOpaqueAnalyticsId)(),onboarding_flow_started_at:String(i?.flowStartedAtMs??Date.now()),onboarding_path:i?.path??"unknown",onboarding_source:i?.source??"direct",entry_reason:i?.entryReason??"direct"});return n&&n!==r.HOME&&a.set("next",n),`${r.ONBOARDING_SETUP}?${a.toString()}`}])},94028,e=>{"use strict";function t(e){if("string"!=typeof e)return null;let t=e.trim();return t.length>0?t:null}function r(e,r){let n=t(e);if(!n||n&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n))return null;let i=t(r);return i&&0===n.localeCompare(i,void 0,{sensitivity:"accent"})?null:n}function n(e){return"string"==typeof e?t(e):null}function i(e){return!e||"object"!=typeof e||Array.isArray(e)?null:e}function a(e){let r=t(e);return r?r.split("@")[0]?.trim()||null:null}function o(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function s(e){return e?e.split(/\s+/)[0]?.trim()||null:null}function l(e){let n=t(e.email),i=r(e.firstName,n),l=r(e.lastName,n),u=r(e.fullName,n),c=[i,l].filter(Boolean).join(" ").trim(),d=u??(c.length>0?c:null),p=r(e.fallbackName,n),h=a(n),f=function(e){let t=a(e);if(!t)return null;let r=t.split(/[._-]+/).filter(e=>e.length>0);return 0===r.length||r.some(e=>/\d/.test(e))?null:1===r.length?{first:o(r[0]),last:null}:{first:o(r[0]),last:r.slice(1).map(o).join(" ")}}(e.email),m=f?[f.first,f.last].filter(Boolean).join(" "):null,g=e=>!!e&&!!h&&0===e.localeCompare(h,void 0,{sensitivity:"accent"}),y=e=>g(e)&&/[._-]/.test(h??""),w=g(d)&&m?m:d,v=g(p)&&m?m:p,_=(i&&!y(i)?i:null)??(d&&!y(d)?s(d):null)??(p&&!y(p)?s(p):null),A=_??s(w)??s(v)??f?.first??null,b=l??f?.last??null,E=A??w??v??h??"User",k=w??m??A??v??h??"User";return{firstName:A,lastName:b,fullName:w??m,emailLocalPart:h,compactName:E,fullDisplayName:k,hasExplicitName:!!_}}e.s(["buildDisplayName",0,l,"buildDisplayNameFromKratosTraits",0,function(e,t){let r=i(e?.name),a=i(t?.name);return l({email:n(e?.email),firstName:n(e?.first_name)??n(r?.first)??n(t?.first_name)??n(a?.first),lastName:n(e?.last_name)??n(r?.last)??n(t?.last_name)??n(a?.last),fullName:n(e?.full_name)??n(t?.full_name),fallbackName:n(e?.display_name)??n(e?.name)??n(t?.display_name)??n(t?.name)})},"resolveGreetingFirstName",0,function(e){if(!1===e.hasExplicitName)return null;let t=l(e);return!0===e.hasExplicitName||t.hasExplicitName?t.firstName:null}])},596598,305763,122835,e=>{"use strict";let t;function r(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function n(e,t){let n;return(i,a)=>(()=>
2{if(n)return n;let i=indexedDB.open(e);return i.onupgradeneeded=()=>i.result.createObjectStore(t),(n=r(i)).then(e=>{e.onclose=()=>n=void 0},()=>{}),n})().then(e=>a(e.transaction(t,i).objectStore(t)))}function i(){return t||(t=n("keyval-store","keyval")),t}e.s(["createStore",0,n,"del",0,function(e,t=i()){return t("readwrite",t=>(t.delete(e),r(t.transaction)))},"get",0,function(e,t=i()){return t("readonly",t=>r(t.get(e)))},"set",0,function(e,t,n=i()){return n("readwrite",n=>(n.put(t,e),r(n.transaction)))}],596598),e.i(680433);var a={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=a;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function s(){}e.s(["timeoutManager",0,o],305763),e.s(["createAsyncStoragePersister",0,({storage:e,key:t="REACT_QUERY_OFFLINE_CACHE",throttleTime:r=1e3,serialize:n=JSON.stringify,deserialize:i=JSON.parse,retry:a})=>{if(e){let l=async r=>{try{let i=await n(r);await e.setItem(t,i);return}catch(e){return e}};return{persistClient:function(e,{interval:t=1e3,onError:r=s}={}){if("function"!=typeof e)throw Error("argument is not function.");let n=0,i=null,a=!1,l=!1;return async(...s)=>{if(i=s,!l){for(l=!0;a;)await new Promise(e=>o.setTimeout(e,t));for(;Date.now()<n;)await new Promise(e=>o.setTimeout(e,n-Date.now()));l=!1,a=!0;try{await e(...i)}catch(e){try{r(e)}catch{}}n=Date.now()+t,a=!1}}}(async e=>{let t=e,r=await l(t),n=0;for(;r&&t;)n++,(t=await a?.({persistedClient:t,error:r,errorCount:n}))&&(r=await l(t))},{interval:r}),restoreClient:async()=>{let r=await e.getItem(t);if(r)return await i(r)},removeClient:()=>e.removeItem(t)}}return{persistClient:s,restoreClient:()=>Promise.resolve(void 0),removeClient:s}}],122835)},809152,e=>{"use strict";let t="wyatt-db";e.s(["DB_QUERY_KEY_ROOT",0,t,"dbQueryKey",0,function(e,r){return[t,e,...r]}])},910791,e=>{"use strict";var t=e.i(596598),r=e.i(122835),n=e.i(809152);let i="__codex_uint8_array__",a=new Set,o=!1,s=(0,t.createStore)("cowork-cache","cowork-query-cache"),l=(0,r.createAsyncStoragePersister)({storage:{getItem:async e=>s?await (0,t.get)(e,s)??null:null,setItem:async(e,r)=>{if(!s||o)return;let n=(0,t.set)(e,r,s);a.add(n);try{await n}finally{a.delete(n)}},removeItem:async e=>{s&&await (0,t.del)(e,s)}},key:"COWORK_QUERY_CACHE",throttleTime:2e3,serialize:function(e){return JSON.stringify({...e,_v:"5"},(e,t)=>t instanceof Uint8Array?{[i]:function(e){if(0===e.length)return"";let t="";return e.forEach(e=>{t+=String.fromCharCode(e)}),btoa(t)}(t)}:t)},deserialize:e=>(function(e){let t=JSON.parse(e,(e,t)=>t&&"object"==typeof t&&i in t&&"string"==typeof t[i]?function(e){if(!e)return new Uint8Array;let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return r}(t[i]):t);if("5"===t._v)return t})(e)});async function u(){o=!0,await Promise.all(a),await l.removeClient()}e.s(["MAX_AGE_MS",0,864e5,"clearQueryCache",0,u,"queryPersister",0,l,"shouldPersistQuery",0,function(e){if("success"!==e.state.status||void 0===e.state.data||null===e.state.data)return!1;let t=e.queryKey[0];if("string"!=typeof t)return!1;let r=(e,t)=>"string"==typeof e&&e.length>0&&!t.includes(e);if(t===n.DB_QUERY_KEY_ROOT){let[,t,n]=e.queryKey,i=e.queryKey.at(-1),a={comments:[6],conversations:[4],dashboards:[4],databases:[4],documents:[4],folders:[4],messages:[5],notifications:[4],pdfs:[4],tasks:[4,5],whiteboards:[4]}[String(t)];return!!a?.includes(e.queryKey.length)&&!!r(i,["no-user","anon","anonymous"])&&e.queryKey.length>=3&&r(t,[])&&r(n,["none","no-workspace"])&&e.queryKey.slice(3).every(e=>"string"==typeof e&&e.length>0)}if("table-page"===t||"document-crdt-bootstrap"===t||"whiteboard-bootstrap"===t){let[,t,n,i]=e.queryKey;return 4===e.queryKey.length&&r(t,["none"])&&r(n,["no-workspace","auto","none"])&&r(i,["no-user","anon"])}if("tasks"===t){let[,t,n,i,a]=e.queryKey;return"list"===t&&5===e.queryKey.length&&r(n,["none","no-workspace"])&&r(i,["none","no-user","anon"])&&"object"==typeof a&&null!==a&&!Array.isArray(a)}if("skills"===t){let[,t,n,i,a]=e.queryKey;return"list"===t?4===e.queryKey.length&&r(n,["none","no-workspace"])&&r(i,["none","no-user","anon"]):"detail"===t&&5===e.queryKey.length&&r(n,["none"])&&r(i,["none","no-workspace"])&&r(a,["none","no-user","anon"])}if("conversations"===t){let[,t,n,i,a]=e.queryKey;return"list"===t?4===e.queryKey.length&&r(n,["none","no-workspace"])&&r(i,["no-user","anon"]):"detail"===t&&5===e.queryKey.length&&r(n,["none"])&&r(i,["none","no-workspace"])&&r(a,["no-user","anon"])}if("conversation-messages"===t){let[,t,n,i,a]=e.queryKey;return"list"===t&&5===e.queryKey.length&&r(n,["none"])&&r(i,["none","no-workspace"])&&r(a,["no-user","anon"])}if("dashboards"===t){let[,t,n,i,a]=e.queryKey;return"list"===t?4===e.queryKey.length&&r(n,["none","no-workspace"])&&r(i,["no-user","anon"]):"detail"===t&&5===e.queryKey.length&&r(n,["none"])&&r(i,["none","no-workspace"])&&r(a,["no-user","anon"])}if("dashboard-charts"===t){let[,t,n,i,a,o]=e.queryKey;return"detail"!==t?4===e.queryKey.length&&r(t,["none","no-workspace"])&&r(n,["none"])&&r(i,["no-user","anon"]):6===e.queryKey.length&&r(n,["none"])&&r(i,["none","no-workspace"])&&r(a,["none"])&&r(o,["no-user","anon"])}return!1}])},495238,273569,315108,518089,750204,e=>{"use strict";var t=e.i(405680),r=e.i(982472),n=e.i(580107),i=e.i(221745),a=e.i(837879),o=e.i(999e3),s=e.i(390850),l=e.i(826895);let u="wyatt.pendingOAuthEvent",c="wyatt.completedOAuthSignupIdentity",d="wyatt.anal
2ytics.establishedOAuthSessions";function p(e){if(!(0,o.hasAnalyticsConsent)()){try{window.sessionStorage.removeItem(u)}catch{}return}try{let t=h(),r=t?Date.parse(t.flowExpiresAt):NaN,n=Date.parse(e.flowIssuedAt),i=t?.callbackFailed===!0&&t.provider===e.provider&&Number.isFinite(r)&&Number.isFinite(n)&&n>=Date.parse(t.flowIssuedAt)&&n<=r;window.sessionStorage.setItem(u,JSON.stringify({...e,...i?{identityWindowIssuedAt:t.identityWindowIssuedAt??t.flowIssuedAt}:{}}))}catch{}}function h(){var e=window.sessionStorage.getItem(u);if(!e)return null;try{let t=JSON.parse(e);if("google"!==t.provider&&"apple"!==t.provider||"login"!==t.intent&&"signup"!==t.intent||"login"!==t.source&&"registration"!==t.source||void 0!==t.signupValuePropositionVariant&&"control"!==t.signupValuePropositionVariant&&"test"!==t.signupValuePropositionVariant||"string"!=typeof t.flowIssuedAt||"string"!=typeof t.flowExpiresAt||void 0!==t.identityWindowIssuedAt&&"string"!=typeof t.identityWindowIssuedAt||void 0!==t.callbackFailed&&"boolean"!=typeof t.callbackFailed)return null;return t}catch{return null}}function f(){try{let e=h();return window.sessionStorage.removeItem(u),e}catch{return null}}function m(e,t,r){let n=Date.parse(e.flowIssuedAt),i=Date.parse(e.flowExpiresAt);return!!Number.isFinite(n)&&!!Number.isFinite(i)&&!(i<n)&&(!!t?.some(({method:e,completed_at:t})=>{if("oidc"!==e||!t)return!1;let r=Date.parse(t);return Number.isFinite(r)&&r>=n&&r<=i})||g(e,r))}function g(e,t){if(!t)return!1;let r=Date.parse(t),n=Date.parse(e.identityWindowIssuedAt??e.flowIssuedAt),i=Date.parse(e.flowExpiresAt);return Number.isFinite(r)&&Number.isFinite(n)&&Number.isFinite(i)&&i>=n&&r>=n&&r<=i}function y(e){if(!(0,o.hasAnalyticsConsent)())return!1;try{if(window.localStorage.getItem(c)===e)return!1;window.localStorage.setItem(c,e)}catch{}return!0}function w(e){return[e.provider,e.flowIssuedAt,e.flowExpiresAt].join(":")}function v(e){if(!(0,o.hasAnalyticsConsent)())return!1;let t=w(e);try{let e=window.localStorage.getItem(d),r=e?JSON.parse(e):[],n=Array.isArray(r)?r.filter(e=>"string"==typeof e):[];if(n.includes(t))return!1;window.localStorage.setItem(d,JSON.stringify([...n,t].slice(-20)))}catch{return!1}return!0}async function _(e){let t=w(e);return"u">typeof navigator&&navigator.locks?navigator.locks.request(`${d}:${t}`,()=>v(e)):v(e)}async function A(e,t){return!!t&&!!g(e,t)&&("u">typeof navigator&&navigator.locks?navigator.locks.request(`${c}:${t}`,()=>y(t)):y(t))}e.s(["claimNewOAuthIdentity",0,A,"claimOAuthSessionEstablished",0,_,"consumePendingOAuthEvent",0,f,"isPendingOAuthCompletion",0,m,"markPendingOAuthCallbackFailure",0,function(){try{let e=h();if(!e||e.callbackFailed)return null;return window.sessionStorage.setItem(u,JSON.stringify({...e,callbackFailed:!0})),e}catch{return null}},"markPendingOAuthEvent",0,p],273569);let b="wyatt:last-google-account";function E(e){if(e?.email&&e.email.includes("@"))try{window.localStorage.setItem(b,JSON.stringify(e))}catch{}}e.s(["getLastGoogleAccount",0,function(){try{let e=window.localStorage.getItem(b);if(!e)return null;let t=JSON.parse(e);if("string"!=typeof t?.email||!t.email.includes("@"))return null;return{email:t.email,..."string"==typeof t.name&&t.name?{name:t.name}:{},..."string"==typeof t.picture&&t.picture.startsWith("https://")?{picture:t.picture}:{}}}catch{return null}},"rememberLastGoogleAccount",0,E],315108);let k=["email","google","apple"],C="wyatt:last-used-auth-method";function O(e){try{window.localStorage.setItem(C,e)}catch{}}e.s(["getLastUsedAuthMethod",0,function(){try{let e=window.localStorage.getItem(C);return k.find(t=>t===e)??null}catch{return null}},"setLastUsedAuthMethod",0,O],518089);var S=e.i(711334),T=e.i(499317);let I="wyatt_ory_session_exchange_init";function N(e,t){let r=new URL(T.AppRoutes.AUTH_CALLBACK,e),n=(0,S.normalizePostAuthRedirect)(t);return n&&r.searchParams.set("next",n),r.toString()}function P(e){if("u"<typeof document)return;let t="https:"===window.location.protocol?"; Secure":"";if(!e){document.cookie=`${I}=; Path=/; Max-Age=0; SameSite=Lax${t}`;return}document.cookie=`${I}=${encodeURIComponent(e)}; Path=/; Max-Age=600; SameSite=Lax${t}`}var x=e.i(94028),R=e.i(534167),D=e.i(910791);
2class U extends Error{status;errorId;reason;constructor({message:e,status:t,errorId:r,reason:n}){super(e),this.name="KratosFlowError",this.status=t,this.errorId=r,this.reason=n}}class $ extends Error{constructor(e){super(e),this.name="OidcBrowserFlowRequiredError"}}async function K(e){!function(e){if("u"<typeof document)return;let t="https:"===window.location.protocol?"; Secure":"",r=(0,S.normalizePostAuthRedirect)(e);if(!r){document.cookie=`${S.POST_AUTH_REDIRECT_COOKIE}=; Path=/; Max-Age=0; SameSite=Lax${t}`;return}let n=(0,S.encodePostAuthRedirectCookieValue)(r);document.cookie=`${S.POST_AUTH_REDIRECT_COOKIE}=${n}; Path=/; Max-Age=${S.POST_AUTH_REDIRECT_COOKIE_MAX_AGE_SECONDS}; SameSite=Lax${t}`}(e);let t=await fetch("/api/v1/auth/login/browser",{credentials:"include",headers:{Accept:"application/json"}});if(!t.ok)throw await q("Failed to create login flow",t);return t.json()}async function j(e){let t=await fetch(`/api/v1/auth/login/flows?id=${e}`,{credentials:"include",headers:{Accept:"application/json"}});if(!t.ok)throw await q("Failed to get login flow",t);return t.json()}async function q(e,t){let r=await t.json().catch(()=>null),n=r?.error?.id,i=r?.error?.reason;return new U({message:r?.error?.message||i||`${e}: ${t.status}`,status:t.status,errorId:n,reason:i})}async function F(e,t){let r=new URLSearchParams({return_session_token_exchange_code:"true",return_to:e}),n=await fetch(`/api/v1/auth/login/api?${r.toString()}`,{credentials:"include",headers:{Accept:"application/json"},signal:t});if(!n.ok)throw await q("Failed to create OIDC login flow",n);let i=await n.json();if(!i.session_token_exchange_code?.trim())throw new $("Kratos did not return a session token exchange init code");return i}async function L(e,t,r){let n=await fetch(`/api/v1/auth/login/submit?flow=${encodeURIComponent(e)}`,{method:"POST",credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({method:"oidc",provider:t,...r&&Object.keys(r).length>0?{upstream_parameters:r}:{}})});if(422===n.status)return{redirectBrowserTo:(await n.json()).redirect_browser_to};if(n.ok){let e=await n.json().catch(()=>null);return{authenticated:e?.authenticated??!0}}throw await q("Failed to submit OIDC login flow",n)}async function M(e){let t=await fetch(`/api/v1/auth/registration/flows?id=${e}`,{credentials:"include",headers:{Accept:"application/json"}});if(!t.ok)throw Error(`Failed to get registration flow: ${t.status}`);return t.json()}async function V(){try{let e=await fetch("/api/v1/auth/sessions/whoami",{credentials:"include",headers:{Accept:"application/json"}});if(!e.ok)return null;let t=await e.json().catch(()=>null);return t?.identity?t:null}catch{return null}}async function H(){let e=await fetch("/api/v1/auth/sessions/extend",{method:"POST",credentials:"include",headers:{Accept:"application/json"}});if(!e.ok)throw Error(`Failed to extend session: ${e.status}`)}async function B(){let e=await fetch("/api/v1/auth/logout/browser",{method:"POST",credentials:"include",headers:{Accept:"application/json"}});if(!e.ok)throw Error(`Failed to log out: ${e.status}`);let t=await e.json().catch(()=>null);return t?.redirect_to||"/login"}function G(e){let t=e.find(e=>"csrf_token"===e.attributes.name&&"default"===e.group);return t?.attributes.value}function J(e,t){return e.find(e=>(function(e,t){if("oidc"!==e.group)return!1;let r=t.trim().toLowerCase(),n=e.attributes.value?.trim().toLowerCase();if(n===r||n?.startsWith(`${r}-`))return!0;let i=e.meta.label?.context,a="string"==typeof i?.provider_id?i.provider_id.trim().toLowerCase():void 0;return!!(a===r||a?.startsWith(`${r}-`))||("string"==typeof i?.provider?i.provider.trim().toLowerCase():void 0)===r})(e,t))}function W(e){return e?.attributes.value?.trim()||void 0}function Q(e){return e.filter(e=>"oidc"===e.group).map(e=>W(e)).filter(e=>!!e)}async function z(e,t){let r=await fetch(e,{method:"POST",credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)});if(r.ok){let e=await r.json().catch(()=>null);return e&&"ui"in e&&e.ui?{kind:"code_sent",flow:e}:{kind:"authenticated",redirectTo:e&&"redirect_to"in e&&"string"==typeof e.redirect_to?e.redirect_to:void 0}}
2if(400===r.status||422===r.status){let e=await r.json().catch(()=>null);if(e&&e.ui)return e.ui.nodes.some(e=>"code"===e.group)&&![...e.ui.messages||[],...e.ui.nodes.flatMap(e=>e.messages||[])].some(e=>"error"===e.type)?{kind:"code_sent",flow:e}:{kind:"validation_error",flow:e}}return 410===r.status?{kind:"flow_expired"}:{kind:"error",error:await q("Failed to submit code flow",r)}}async function Y(e){return z("/api/v1/auth/login/code",{email:e.email.trim()})}function X(e){let t=Date.parse(e.expires_at),r=Date.parse(e.issued_at)+6e5;return Number.isFinite(t)&&Number.isFinite(r)&&Math.min(t,r)-Date.now()>3e4}e.s(["KratosFlowError",0,U,"OidcBrowserFlowRequiredError",0,$,"createLoginFlow",0,K,"createOidcLoginApiFlow",0,F,"extendActiveSession",0,H,"getCsrfToken",0,G,"getLoginFlow",0,j,"getOidcProviderNode",0,J,"getOidcProviderSubmitValue",0,W,"getRegistrationFlow",0,M,"listOidcProviderValues",0,Q,"performLogout",0,B,"startLoginOrRegistrationCode",0,Y,"submitLoginOidcApiFlow",0,L,"submitLoginOrRegistrationCode",0,function(e){let t={code:e.code};return e.email?.trim()&&(t.identifier=e.email.trim()),e.csrfToken&&(t.csrf_token=e.csrfToken),z(`/api/v1/auth/login/code/submit?flow=${encodeURIComponent(e.flowId)}`,t)},"whoami",0,V],750204);let Z=(0,r.createContext)({user:null,session:null,isLoading:!0,prepareOAuthSignIn:async()=>{},signInWithGoogle:async()=>{},signInWithOAuth:async()=>{},signOut:async()=>{},refresh:async()=>{}});function ee(e){return e?.forceAccountSelection?{prompt:"select_account"}:e?.loginHint?{login_hint:e.loginHint}:void 0}e.s(["AuthProvider",0,function({children:e}){let u=(0,n.useQueryClient)(),[c,d]=(0,r.useState)(null),[h,g]=(0,r.useState)(null),[y,w]=(0,r.useState)(!0),v=(0,r.useRef)(!1),b=(0,r.useRef)(0),k=(0,r.useRef)(null),C=(0,r.useRef)(null),S=(0,r.useCallback)(async()=>{try{let e=await V();g(e);let t=e?function(e){let t,r,n,i,{traits:a,metadata_public:o}=e.identity,s=(0,x.buildDisplayNameFromKratosTraits)(a,o),l=a.picture||o?.picture||void 0,u="string"==typeof o?.bio?o.bio:"string"==typeof a.bio?a.bio:void 0;return{id:e.identity.id,email:a.email,user_metadata:{full_name:s.fullDisplayName,name:s.compactName,display_name:s.compactName,first_name:s.firstName??void 0,last_name:s.lastName??void 0,has_explicit_name:s.hasExplicitName,avatar_url:l,bio:u,profile_name_complete:(t=a.name&&"object"==typeof a.name&&!Array.isArray(a.name)?a.name:{},r=o?.name&&"object"==typeof o.name&&!Array.isArray(o.name)?o.name:{},n=[a.first_name,t.first,o?.first_name,r.first].find(e=>"string"==typeof e&&e.trim()),i=[a.last_name,t.last,o?.last_name,r.last].find(e=>"string"==typeof e&&e.trim()),!!(n&&i))}}}(e):null;if(d(t),t){let r=Date.now();r-b.current>=36e5&&(b.current=r,H().catch(e=>{b.current=0,(0,i.captureClientException)(e instanceof Error?e:Error("Failed to extend active Ory session"),{source:"auth_client",component:"AuthProvider",action:"extend_active_session"})})),v.current=!0,(0,i.identifyUser)(t.id,{email:t.email,name:t.user_metadata.full_name||t.user_metadata.display_name||t.user_metadata.name}),await (0,a.setAdTrackingIdentity)({email:t.email},{authoritative:!0});let n=f(),o=n&&m(n,e?.authentication_methods,e?.identity.created_at);if(n&&o){("google"===n.provider||"apple"===n.provider)&&O(n.provider),"google"===n.provider&&t.email&&E({email:t.email,name:t.user_metadata.full_name||t.user_metadata.display_name,picture:t.user_metadata.avatar_url});try{let t=(0,l.consumeSignupAttributionProperties)(),r=n.signupValuePropositionVariant?{signup_value_proposition_variant:n.signupValuePropositionVariant}:{},a=await _(n),o=await A(n,e?.identity.created_at);a&&(0,i.trackEvent)("signup_session_established",{provider:n.provider,source:n.source,...t,...r}),o?await (0,i.trackConversionEvent)("signup_completed",{provider:n.provider,source:"oauth_callback",...(0,l.signupCompletionAttributionProperties)(t),...r}):(0,i.trackSignInEvent)({provider:n.provider,source:"oauth_callback"})}catch(e){(0,i.captureClientException)(e instanceof Error?e:Error("Failed to track OAuth outcome"),{source:"auth_client",component:"AuthProvider",action:"track_oauth_outcome",provider:n.provider})}}else n?.intent==="signup"&&("google"===n.provider||"apple"===n.provider)&&(0,i.trackEvent)("signup_step_failed",{provider:n.provider,source:n.source,step:"session_resolution",error_category:"session_mismatch",retriable:!1,...(0,l.consumeSignupAttributionProperties)(),...n.signupValuePropositionVariant?{signup_value_proposition_variant:n.signupValuePropositionVariant}:{}})}else v.current&&((0,i.resetUser)(),v.current=!1),(0,a.clearAdTrackingIdentity)()}catch{g(null),d(null),v.current&&((0,i.resetUser)(),v.current=!1),(0,a.clearAdTrackingIdentity)()}finally{w(!1)}},[]);(0,r.useEffect)(()=>{S()},[S]),(0,r.useEffect)(()=>
2{if(!h)return;let e=()=>{"visible"===document.visibilityState&&S()},t=window.setInterval(e,864e5);return window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{window.clearInterval(t),window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}},[S,h]),(0,r.useEffect)(()=>{if(!c)return;let e=()=>{(0,o.hasAnalyticsConsent)()&&((0,i.identifyUser)(c.id,{email:c.email,name:c.user_metadata.full_name||c.user_metadata.display_name||c.user_metadata.name}),(0,a.setAdTrackingIdentity)({email:c.email},{authoritative:!0}))};return window.addEventListener(s.COOKIE_CONSENT_CHANGED_EVENT,e),()=>{window.removeEventListener(s.COOKIE_CONSENT_CHANGED_EVENT,e)}},[c]);let I=(0,r.useCallback)((e,t={})=>{let r=k.current,n=r?Date.now()-r.startedAt:0;if(r?.callbackUrl===e&&(r.flow?X(r.flow):n<=(t.maxPendingAgeMs??1/0)))return r.promise;r?.abort();let i=new AbortController,a=Date.now(),o=!1,s=window.setTimeout(()=>{o=!0,i.abort()},1e4),l=F(e,i.signal).catch(e=>{if(o)throw Error("Timed out creating the OIDC login flow");throw e}).finally(()=>{window.clearTimeout(s)}),u={abort:()=>i.abort(),callbackUrl:e,promise:l,startedAt:a};return k.current=u,u.promise.then(e=>{k.current===u&&(u.flow=e)},()=>{k.current===u&&(k.current=null)}),u.promise},[]),j=(0,r.useCallback)(async e=>{let t=N(window.location.origin,e?.redirectTo);await I(t)},[I]),q=(0,r.useCallback)(async(e,t)=>{let r;try{let n=N(window.location.origin,t?.redirectTo);try{let i=I(n,{maxPendingAgeMs:2e3}),a=await i;if(X(a)||(k.current?.promise===i&&(k.current=null),i=I(n,{maxPendingAgeMs:2e3}),a=await i),!X(a))throw Error("Ory returned an expired OIDC login flow");k.current?.promise===i&&(k.current=null),r=Q(a.ui.nodes);let o=J(a.ui.nodes,e);if(!o)throw Error(`OAuth provider "${e}" is not configured in the login flow`);let s=W(o);if(!s)throw Error(`OAuth provider "${e}" is missing a submit value`);p({provider:e,intent:t?.intent??"login",source:"login",...t?.signupValuePropositionVariant?{signupValuePropositionVariant:t.signupValuePropositionVariant}:{},flowIssuedAt:a.issued_at,flowExpiresAt:a.expires_at}),P(a.session_token_exchange_code);let l=await L(a.id,s,ee(t));if(l.redirectBrowserTo)return void window.location.assign(l.redirectBrowserTo);if(l.authenticated){P(null),window.location.assign(t?.redirectTo||T.AppRoutes.HOME);return}throw new $(`OAuth provider "${e}" did not return a redirect target`)}catch(e){if(!(e instanceof $)&&(!(e instanceof U)||"self_service_flow_return_to_forbidden"!==e.errorId))throw e}P(null);let i=await K(t?.redirectTo);r=Q(i.ui.nodes);let a=J(i.ui.nodes,e);if(!a)throw Error(`OAuth provider "${e}" is not configured in the login flow`);let o=W(a);if(!o)throw Error(`OAuth provider "${e}" is missing a submit value`);p({provider:e,intent:t?.intent??"login",source:"login",...t?.signupValuePropositionVariant?{signupValuePropositionVariant:t.signupValuePropositionVariant}:{},flowIssuedAt:i.issued_at,flowExpiresAt:i.expires_at}),function({action:e,csrfToken:t,providerValue:r,upstreamParameters:n}){let i=document.createElement("form");i.method="POST",i.action=e;let a=(e,t)=>{let r=document.createElement("input");r.type="hidden",r.name=e,r.value=t,i.appendChild(r)};for(let[e,i]of(t&&a("csrf_token",t),a("provider",r),Object.entries(n??{})))i&&a(`upstream_parameters.${e}`,i);document.body.appendChild(i),i.submit()}({action:i.ui.action,csrfToken:G(i.ui.nodes),providerValue:o,upstreamParameters:ee(t)})}catch(a){f();let n=a instanceof Error?a:Error(`Failed to start ${e} sign-in`);throw(0,i.captureClientException)(n,{source:"auth_client",component:"AuthProvider",action:"sign_in_with_oauth",provider:e,redirect_to:t?.redirectTo,available_oidc_providers:r}),n}},[I]),M=(0,r.useCallback)(async(e,t)=>{if(C.current)return C.current;let r=q(e,t);C.current=r;try{await r}finally{C.current===r&&(C.current=null)}},[q]),z=(0,r.useCallback)(async e=>{await M("google",e)},[M]),Y=(0,r.useCallback)(async()=>{(0,o.hasAnalyticsConsent)()&&(0,i.trackEvent)("user_signed_out",{}),d(null),g(null),(0,i.resetUser)(),v.current=!1,(0,a.clearAdTrackingIdentity)(),u.clear(),(0,R.resetCoworkClientSessionCaches)(),await (0,D.clearQueryCache)();try{let e=await B();window.location.href=e}catch{window.location.href="/login"}},[u]);return(0,t.jsx)(Z.Provider,{value:{user:c,session:h,isLoading:y,prepareOAuthSignIn:j,signInWithGoogle:z,signInWithOAuth:M,signOut:Y,refresh:S},children:e})},"useAuth",0,function(){let e=(0,r.useContext)(Z);if(!e)throw Error("useAuth must be used within an AuthProvider");return e}],495238)},478539,e=>{"use strict";e.i(495238),e.s([])}]);
3
4//# debugId=a50b6dff-202f-87ad-7120-154310ae1ccf

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.