PageSourceSearch

https://telli.sh/_next/static/chunks/2147-6160ca2a531c444e.js

js telli.sh collected 2026-09-24 15:11:47 UTC 8,828 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7cb21e35-5db2-43d6-af46-4ae343d0b7c2",e._sentryDebugIdIdentifier="sentry-dbid-7cb21e35-5db2-43d6-af46-4ae343d0b7c2")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2147],{3604:(e,t,r)=>{r.d(t,{b:()=>a,w:()=>o});let i=[];function o(e){return i.push(e),()=>{let t=i.indexOf(e);t>=0&&i.splice(t,1)}}function a(){for(let e of i)try{e()}catch(e){console.warn("[logout-cleanup] Cleanup error:",e)}}},46320:(e,t,r)=>{r.d(t,{_:()=>o});var i=r(41463);function o(){if("true"===i.env.NEXT_PUBLIC_AUTH_DISABLED)return!0;let e=new URLSearchParams(window.location.search),t=e.get("auth_disabled"),r=e.get("callbackUrl");if(!t&&r)try{t=new URL(r,window.location.origin).searchParams.get("auth_disabled")}catch{t=null}return"true"===t?(window.localStorage.setItem("tellish:auth-disabled","true"),!0):"false"===t?(window.localStorage.removeItem("tellish:auth-disabled"),!1):"true"===window.localStorage.getItem("tellish:auth-disabled")}},82147:(e,t,r)=>{r.d(t,{n:()=>_});var i=r(1934),o=r(26486),a=r(97209),s=r(3604),n=r(34193),l=r(11932),d=r(40795),u=r(46320);let c="tellish:signup-intent",g=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","fbclid"],_=(0,i.v)((e,t)=>((0,a.th)(()=>t().logout()),{token:null,user:null,isLoading:!1,isChecked:!1,login:async(t,r)=>{e({isLoading:!0});let i=`${(0,o.pc)()}/auth/login`;try{let a=await (0,o.Zq)(i,{method:"POST",body:JSON.stringify({email:t.trim(),password:r})}),s=await a.json();if(!a.ok)return(0,n.sx)("login_failure",{method:"password",reason:"api_rejected",status:a.status}),e({isLoading:!1}),{ok:!1,error:(0,o.uz)(s.detail)||"Login failed"};let l=s.user;if(!l)return(0,n.sx)("login_failure",{method:"password",reason:"invalid_response"}),e({isLoading:!1}),{ok:!1,error:"Invalid login response"};let d=await (0,o.Zq)(`${(0,o.pc)()}/auth/me`);if(!d.ok)return(0,n.sx)("login_failure",{method:"password",reason:"cookie_verification_failed",status:d.status}),e({isLoading:!1}),{ok:!1,error:"로그인 응답은 성공했으나 인증이 되지 않습니다. 브라우저 접속 URL과 NEXT_PUBLIC_API_URL 호스트가 일치하는지 확인하세요. (예: 127.0.0.1:3000 접속 시 http://127.0.0.1:8000)"};return e({token:"cookie",user:l,isLoading:!1,isChecked:!0}),(0,n.sx)("login_success",{method:"password",plan:l.plan??"unknown"}),{ok:!0}}catch(r){let t=(0,o.lV)(r);return console.error("[useAuthStore.login] Failed to fetch",{url:i,message:t,cause:r.cause}),(0,n.sx)("login_failure",{method:"password",reason:"network_or_client_error"}),e({isLoading:!1}),{ok:!1,error:t}}},register:async(t,r,i)=>{e({isLoading:!0});try{let a={email:t.trim(),password:r};i&&(i.terms||i.privacy||i.voice_data)&&(a.consents={terms:i.terms??!1,privacy:i.privacy??!1,voice_data:i.voice_data??!1});let s=await (0,o.Zq)(`${(0,o.pc)()}/auth/register`,{method:"POST",body:JSON.stringify(a)}),l=await s.json();if(!s.ok)return(0,n.sx)("signup_failure",{method:"password",reason:"api_rejected",status:s.status}),e({isLoading:!1}),{ok:!1,error:(0,o.uz)(l.detail)||"Registration failed"};let d=l.user;if(!d)return(0,n.sx)("signup_failure",{method:"password",reason:"invalid_response"}),e({isLoading:!1}),{ok:!1,error:"Invalid registration response"};let u=await (0,o.Zq)(`${(0,o.pc)()}/auth/me`);if(!u.ok)return(0,n.sx)("signup_failure",{method:"password",reason:"cookie_verification_failed",status:u.status}),e({isLoading:!1}),{ok:!1,error:"회원가입 응답은 성공했으나 인증이 되지 않습니다. 브라우저 접속 URL과 NEXT_PUBLIC_API_URL 호스트가 일치하는지 확인하세요."};return e({token:"cookie",user:d,isLoading:!1,isChecked:!0}),(0,n.sx)("signup_complete",{method:"password",plan:d.plan??"unknown"}),{ok:!0}}catch(t){return(0,n.sx)("signup_failure",{method:"password",reason:"network_or_client_error"}),e({isLoading:!1}),{ok:!1,error:(0,o.lV)(t)}}},logout:()=>{(0,s.b)(),(0,o.Zq)(`${(0,o.pc)()}/auth/logout`,{method:"POST",body:JSON.stringify({})}).catch(()=>{}),e({token:null,user:null})},setUser:t=>e({user:t}),setTokenAndUser:(t,r,i)=>
1{e({token:"cookie",user:r})},refreshToken:async()=>(0,o.J1)(),fetchMe:async()=>{try{let t=await (0,o.Zq)(`${(0,o.pc)()}/auth/me`);if(401===t.status&&await (0,o.J1)()){let t=await (0,o.Zq)(`${(0,o.pc)()}/auth/me`);if(t.ok){let r=await t.json();return e({token:"cookie",user:r,isChecked:!0}),!0}}if(!t.ok)return e({token:null,user:null,isChecked:!0}),!1;let r=await t.json();return e({token:"cookie",user:r,isChecked:!0}),!0}catch{return e({token:null,user:null,isChecked:!0}),!1}},init:()=>{(0,u._)()?e({token:"disabled",user:{id:"local-dev-user",email:"[email protected]",display_name:"Local Dev",auth_provider:"local",plan:"pro+",is_master:!0,onboarding_completed:!0,linked_providers:[]},isChecked:!0}):t().user?e({isChecked:!0}):t().fetchMe()},requestMagicLink:async e=>{try{let t=await (0,o.Zq)(`${(0,o.pc)()}/auth/magic-link`,{method:"POST",body:JSON.stringify({email:e.trim()})}),r=await t.json();if(!t.ok)return{ok:!1,error:(0,o.uz)(r.detail)||"Failed to send magic link"};return{ok:!0}}catch(e){return{ok:!1,error:(0,o.lV)(e)}}},verifyMagicCode:async(t,r)=>{e({isLoading:!0});try{let i=await (0,o.Zq)(`${(0,o.pc)()}/auth/magic-link/code`,{method:"POST",body:JSON.stringify({email:t.trim(),code:r})}),a=await i.json();if(!i.ok)return(0,n.sx)("login_failure",{method:"magic_code",reason:"api_rejected",status:i.status}),e({isLoading:!1}),{ok:!1,error:(0,o.uz)(a.detail)||"Invalid code"};let s=a.user;if(!s)return(0,n.sx)("login_failure",{method:"magic_code",reason:"invalid_response"}),e({isLoading:!1}),{ok:!1,error:"Invalid response"};return e({token:"cookie",user:s,isLoading:!1,isChecked:!0}),(0,n.sx)("login_success",{method:"magic_code",plan:s.plan??"unknown"}),{ok:!0}}catch(t){return(0,n.sx)("login_failure",{method:"magic_code",reason:"network_or_client_error"}),e({isLoading:!1}),{ok:!1,error:(0,o.lV)(t)}}},registerInitiate:async(e,t)=>{try{let r={email:e.trim()};t&&(r.callback_url=t);let i=await (0,o.Zq)(`${(0,o.pc)()}/auth/register/initiate`,{method:"POST",body:JSON.stringify(r)}),a=await i.json();if(!i.ok)return(0,n.sx)("signup_failure",{method:"email_code",stage:"initiate",reason:"api_rejected",status:i.status}),{ok:!1,error:(0,o.uz)(a.detail)||"Failed to initiate registration"};let s=function(e){if(!e)return{};let t={callback_path:e};try{let r=new URL(e,"https://telli.sh"),[i]=r.pathname.replace(/^\/+/,"").split("/");for(let e of(Object.assign(t,(0,l.i)(r.searchParams)),g)){let i=r.searchParams.get(e);i&&(t[e]=i)}(0,d.d9)(i)&&(t.locale=i)}catch{}return t}(t);return window.sessionStorage.setItem(c,JSON.stringify(s)),(0,n.sx)("signup_start",{method:"email_code",...s}),{ok:!0}}catch(e){return(0,n.sx)("signup_failure",{method:"email_code",stage:"initiate",reason:"network_or_client_error"}),{ok:!1,error:(0,o.lV)(e)}}},registerVerifyCode:async(e,t)=>{try{let r=await (0,o.Zq)(`${(0,o.pc)()}/auth/register/verify-code`,{method:"POST",body:JSON.stringify({email:e.trim(),code:t})}),i=await r.json();if(!r.ok)return(0,n.sx)("signup_failure",{method:"email_code",stage:"verify",reason:"api_rejected",status:r.status}),{ok:!1,error:(0,o.uz)(i.detail)||"Invalid code"};return{ok:!0,token:i.token}}catch(e){return(0,n.sx)("signup_failure",{method:"email_code",stage:"verify",reason:"network_or_client_error"}),{ok:!1,error:(0,o.lV)(e)}}},registerVerifyStatus:async e=>{try{let t=await (0,o.Zq)(`${(0,o.pc)()}/auth/register/verify-status?email=${encodeURIComponent(e.trim())}`);if(!t.ok)return{verified:!1};return await t.json()}catch{return{verified:!1}}},registerComplete:async(t,r,i,a,s)=>{e({isLoading:!0});try{let l={token:t,password:r};i&&(l.display_name=i),a&&(l.consents=a),s&&(l.bio=s);let d=await (0,o.Zq)(`${(0,o.pc)()}/auth/register/complete`,{method:"POST",body:JSON.stringify(l)}),u=await d.json();if(!d.ok)return(0,n.sx)("signup_failure",{method:"email_code",stage:"complete",reason:"api_rejected",status:d.status}),e({isLoading:!1}),{ok:!1,error:(0,o.uz)(u.detail)||"Registration failed"};let g=u.user;if(!g)return(0,n.sx)("signup_failure",{method:"email_code",stage:"complete",reason:"invalid_response"}),e({isLoading:!1}),{ok:!1,error:"Invalid registration response"};
1return e({token:"cookie",user:g,isLoading:!1,isChecked:!0}),(0,n.sx)("signup_complete",{method:"email_code",plan:g.plan??"unknown",...function(){let e=window.sessionStorage.getItem(c);if(window.sessionStorage.removeItem(c),!e)return{};try{return JSON.parse(e)}catch{return{}}}()}),{ok:!0}}catch(t){return(0,n.sx)("signup_failure",{method:"email_code",stage:"complete",reason:"network_or_client_error"}),e({isLoading:!1}),{ok:!1,error:(0,o.lV)(t)}}}}))}}]);

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.