PageSourceSearch

https://colorize.cc/app/_next/static/chunks/app/(auth)/login/page-23bcf786defa1b00.js

js colorize.cc collected 2026-09-25 14:48:25 UTC 17,785 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4665],{98685:function(e,t,a){Promise.resolve().then(a.bind(a,80762))},80762:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return A}});var r=a(57437),n=a(50495),o=a(2265),s=a(71538),i=a(39343),l=a(37440),c=a(38364);let d=o.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(c.f,{ref:t,className:(0,l.cn)("text-sm font-medium text-black dark:text-white leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...n})});d.displayName=c.f.displayName;let u=i.RV,m=o.createContext({}),f=e=>{let{...t}=e;return(0,r.jsx)(m.Provider,{value:{name:t.name},children:(0,r.jsx)(i.Qr,{...t})})},h=()=>{let e=o.useContext(m),t=o.useContext(x),{getFieldState:a,formState:r}=(0,i.Gc)(),n=a(e.name,r);if(!e)throw Error("useFormField should be used within <FormField>");let{id:s}=t;return{id:s,name:e.name,formItemId:"".concat(s,"-form-item"),formDescriptionId:"".concat(s,"-form-item-description"),formMessageId:"".concat(s,"-form-item-message"),...n}},x=o.createContext({}),g=o.forwardRef((e,t)=>{let{className:a,...n}=e,s=o.useId();return(0,r.jsx)(x.Provider,{value:{id:s},children:(0,r.jsx)("div",{ref:t,className:(0,l.cn)("space-y-2",a),...n})})});g.displayName="FormItem",o.forwardRef((e,t)=>{let{className:a,...n}=e,{error:o,formItemId:s}=h();return(0,r.jsx)(d,{ref:t,className:(0,l.cn)(o&&"text-destructive",a),htmlFor:s,...n})}).displayName="FormLabel";let p=o.forwardRef((e,t)=>{let{...a}=e,{error:n,formItemId:o,formDescriptionId:i,formMessageId:l}=h();return(0,r.jsx)(s.g7,{ref:t,id:o,"aria-describedby":n?"".concat(i," ").concat(l):"".concat(i),"aria-invalid":!!n,...a})});p.displayName="FormControl",o.forwardRef((e,t)=>{let{className:a,...n}=e,{formDescriptionId:o}=h();return(0,r.jsx)("p",{ref:t,id:o,className:(0,l.cn)("text-[0.8rem] text-muted-foreground",a),...n})}).displayName="FormDescription";let b=o.forwardRef((e,t)=>{let{className:a,children:n,...o}=e,{error:s,formMessageId:i}=h(),c=s?String(null==s?void 0:s.message):n;return c?(0,r.jsx)("p",{ref:t,id:i,className:(0,l.cn)("text-[0.8rem] font-medium text-destructive",a),...o,children:c}):null});b.displayName="FormMessage";var v=a(83102),j=a(31014),w=a(41942),N=a(18735),y=a(3274),k=a(27776),_=a(59772),D=a(58354),z=a(42126),C=a(49714),S=a(16961);let I=_.Ry({email:_.Z_().email(),password:_.Z_().optional()});function F(e){let{className:t,...a}=e,{translations:s,setLanguage:c}=(0,D.Z)(),d=(0,i.cI)({resolver:(0,j.F)(I),defaultValues:{email:""}}),[m,h]=o.useState(!1),[x,_]=o.useState(!1),[F,E]=o.useState(!1),[Z,R]=o.useState(!0),[A,P]=o.useState(!1);async function T(e){h(!0),await new Promise(e=>setTimeout(e,1e3)),h(!1),E(!0);try{let t=e.email.toLowerCase().trim();(0,S.z)("login_email_requested",{email:t,method:"email",lang:navigator.language,page:window.location.pathname,referrer:document.referrer,user_agent:navigator.userAgent}),(await z.Z.post("https://colorize.cc/api2/auth/authorize_email",{email:t})).data&&(k.A.success(s.auth_email_title,{description:s.auth_email_description,duration:1e4}),E(!0))}catch(e){k.A.error("Something went wrong.",{description:"Your sign in request failed. Please try again."})}}o.useEffect(()=>{(async()=>{var e;let t=null===(e=localStorage.getItem("token"))||void 0===e?void 0:e.split(" ")[1];if(!t){R(!1);return}try{k.A.info(s.checking_auth);let e=await z.Z.get("https://colorize.cc/api2/auth/validate",{headers:{Authorization:"Bearer ".concat(t)}});"Token is valid"===e.data.message&&(window.location.href="https://colorize.cc/dashboard",k.A.success(s.auth_success))}catch(e){console.error("Token validation failed:",e)}R(!1)})()},[]);let V=(0,N.Nq)({onSuccess:e=>{!function(e){z.Z.post("https://colorize.cc/api2/auth/validate_google_token_new",{token:e}).then(e=>{if("good"===e.data.status){localStorage.setItem("token","Bearer ".concat(e.data.token));let t="";try{t=(0,C.o)(e.data.token).email||"",localStorage.setItem("user_email",t)}catch(e){}(0,S.z)("login_success",{email:t,method:"google",lang:navigator.language,page:window.location.pathname,referrer:document.referrer,user_agent:navigator.userAgent}),setTimeout(()=>{window.location.href="https://colorize.cc/dashboard"},500)}
1else alert("Invalid token, you cant login with Google")}).catch(e=>{console.error("Failed to validate Google token:",e)})}(e.access_token)},onError:()=>{console.error("Google login failed"),_(!1)},flow:"implicit",scope:"email profile openid"});async function G(){_(!0),(0,S.z)("login_oauth_started",{method:"google",lang:navigator.language,page:window.location.pathname,referrer:document.referrer,user_agent:navigator.userAgent}),V()}async function B(){P(!0),(0,S.z)("login_oauth_started",{method:"yandex",lang:navigator.language,page:window.location.pathname,referrer:document.referrer,user_agent:navigator.userAgent}),window.location.href="https://oauth.yandex.com/authorize?response_type=code&client_id=".concat("3f3970483f4641f4aab061b0da9ded8f","&redirect_uri=").concat("https://colorize.cc/yandex_verification")}return Z?(0,r.jsx)("div",{className:(0,l.cn)("flex justify-center items-center",t),...a,children:(0,r.jsx)(y.Z,{className:"h-6 w-6 animate-spin"})}):F?(0,r.jsxs)("div",{className:(0,l.cn)("text-center space-y-4 max-w-md mx-auto",t),...a,children:[(0,r.jsx)("p",{className:"text-base text-left",children:s.logindone}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground text-left",children:s.auth_hint})]}):(0,r.jsxs)("div",{className:(0,l.cn)("grid gap-6",t),...a,children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground text-center",children:s.youlogin}),(0,r.jsx)(u,{...d,children:(0,r.jsx)("form",{onSubmit:d.handleSubmit(T),children:(0,r.jsxs)("div",{className:"grid gap-4",children:[(0,r.jsx)(f,{control:d.control,name:"email",render:e=>{let{field:t}=e;return(0,r.jsxs)(g,{children:[(0,r.jsx)(p,{children:(0,r.jsx)(v.I,{id:"email",placeholder:"[email protected]",type:"email",autoCapitalize:"none",autoComplete:"email",autoCorrect:"off",disabled:m||x||A,...t})}),(0,r.jsx)(b,{})]})}}),(0,r.jsxs)("button",{type:"submit",className:"group/btn relative w-full rounded-lg bg-black px-4 py-3 text-white dark:bg-white dark:text-black",disabled:m||x||A,children:[(0,r.jsxs)("div",{className:"absolute inset-0 h-full w-full transform opacity-0 transition duration-200 group-hover/btn:opacity-100",children:[(0,r.jsx)("div",{className:"absolute -left-px -top-px h-4 w-4 rounded-tl-lg border-l-2 border-t-2 border-black bg-transparent transition-all duration-200 group-hover/btn:-left-4 group-hover/btn:-top-4 dark:border-white"}),(0,r.jsx)("div",{className:"absolute -right-px -top-px h-4 w-4 rounded-tr-lg border-r-2 border-t-2 border-black bg-transparent transition-all duration-200 group-hover/btn:-right-4 group-hover/btn:-top-4 dark:border-white"}),(0,r.jsx)("div",{className:"absolute -bottom-px -left-px h-4 w-4 rounded-bl-lg border-b-2 border-l-2 border-black bg-transparent transition-all duration-200 group-hover/btn:-bottom-4 group-hover/btn:-left-4 dark:border-white"}),(0,r.jsx)("div",{className:"absolute -bottom-px -right-px h-4 w-4 rounded-br-lg border-b-2 border-r-2 border-black bg-transparent transition-all duration-200 group-hover/btn:-bottom-4 group-hover/btn:-right-4 dark:border-white"})]}),m&&(0,r.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin inline"}),(0,r.jsx)("span",{className:"text-sm",children:s.nextthing})]})]})})}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,r.jsx)("span",{className:"w-full border-t"})}),(0,r.jsx)("div",{className:"relative flex justify-center text-xs uppercase",children:(0,r.jsx)("span",{className:"bg-background px-2 text-muted-foreground",children:s.orloginwith})})]}),(0,r.jsxs)("div",{className:"grid gap-4",children:[(0,r.jsxs)("button",{type:"button",className:(0,l.cn)((0,n.d)({variant:"outline"})),onClick:()=>{G()},disabled:m||x||A,children:[x?(0,r.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,r.jsx)(w.ldW,{className:"mr-2 h-4 w-4"})," ","Google"]}),(0,r.jsxs)("button",{type:"button",className:(0,l.cn)((0,n.d)({variant:"outline"}),"w-full"),onClick:B,disabled:m||x||A,children:[A?(0,r.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,r.jsx)(w.iT6,{className:"mr-2 h-4 w-4"})," ","Yandex"]})]})]})}var E=a(70518),Z=a(87138),R=a(82276);function A(){let{translations:e,setLanguage:t}=(0,D.Z)();return(0,r.jsxs)("div",{className:"container flex h-screen w-screen flex-col items-center justify-center",children:[(0,r.jsxs)("div",{className:"absolute top-4 w-full flex justify-between px-4 md:px-8 md:top-8",children:[(0,r.jsx)(Z.default,{href:"https://colorize.cc/",className:(0,l.cn)((0,n.d)({variant:"ghost"})),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Z,{className:"mr-2 h-4 w-4"}),e.backthen]})}),(0,r.jsx)(R.Z,{})]}),(0,r.jsxs)("div",{className:"mx-auto flex w-full flex-col justify-center gap-6 sm:w-[350px]",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 text-center",children:[(0,r.jsx)("div",{className:"mx-auto flex w-full flex-col items-center gap-6 sm:w-[350px]",children:(0,r.jsx)("img",{src:"https://storage.yandexcloud.net/picturize/colorize/logo.svg",className:"h-20 w-20 text-primary"})}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:e.welcome})]}),(0,r.jsx)(F,{}),(0,r.jsx)("p",{className:"px-8 text-center text-sm text-muted-foreground"})]})]})}},82276:function(e,t,a){"use strict";a.d(t,{Z:function(){return i}});var r=a(57437);a(2265);var n=a(58354),o=a(50495),s=a(90837);function i(){let{translations:e,setLanguage:t,language:a}=(0,n.Z)(),i={ru:"\uD83C\uDDF7\uD83C\uDDFA",en:"\uD83C\uDDEC\uD83C\uDDE7",zh:"\uD83C\uDDE8\uD83C\uDDF3",ar:"\uD83C\uDDF8\uD83C\uDDE6",hi:"\uD83C\uDDEE\uD83C\uDDF3",pt:"\uD83C\uDDF5\uD83C\uDDF9"},l=e=>{t(e),localStorage.setItem("languageSelected",e);let a=document.querySelector("#itemthign");a&&a.click()};return(0,r.jsxs)(s.Vq,{children:[(0,r.jsx)(s.hg,{asChild:!0,children:(0,r.jsxs)(o.z,{variant:"outline",children:[e.langlang," ",i[a]]})}),(0,r.jsxs)(s.cZ,{className:"sm:max-w-[425px]",children:[(0,r.jsxs)(s.fK,{children:[(0,r.jsx)(s.$N,{children:e.langselect}),(0,r.jsx)(s.Be,{children:e.changeLanguageDescription})]}),(0,r.jsx)("div",{className:"grid gap-4 py-4",children:(0,r.jsxs)("div",{className:"grid grid-cols-3 items-center gap-4",children:[(0,r.jsxs)(o.z,{variant:"outline",onClick:()=>l("ru"),children:["Русский ",i.ru]}),(0,r.jsxs)(o.z,{variant:"outline",onClick:()=>l("en"),children:["English ",i.en]}),(0,r.jsxs)(o.z,{variant:"outline",onClick:()=>l("zh"),children:["中文 ",i.zh]}),(0,r.jsxs)(o.z,{variant:"outline",onClick:()=>l("ar"),children:["عربى ",i.ar]}),(0,r.jsxs)(o.z,{variant:"outline",onClick:()=>l("hi"),children:["हिंदी ",i.hi]}),(0,r.jsxs)(o.z,{variant:"outline",onClick:()=>l("pt"),children:["Portugu\xeas ",i.pt]})]})}),(0,r.jsx)(s.cN,{children:(0,r.jsx)(s.GG,{asChild:!0,children:(0,r.jsx)(o.z,{id:"itemthign",children:e.close})})})]})]})}},50495:function(e,t,a){"use strict";a.d(t,{d:function(){return l},z:function(){return c}});var r=a(57437),n=a(2265),o=a(71538),s=a(12218),i=a(37440);let l=(0,s.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),c=n.forwardRef((e,t)=>
1{let{className:a,variant:n,size:s,asChild:c=!1,...d}=e,u=c?o.g7:"button";return(0,r.jsx)(u,{className:(0,i.cn)(l({variant:n,size:s,className:a})),ref:t,...d})});c.displayName="Button"},90837:function(e,t,a){"use strict";a.d(t,{$N:function(){return g},Be:function(){return p},GG:function(){return u},Vq:function(){return l},cN:function(){return x},cZ:function(){return f},fK:function(){return h},hg:function(){return c}});var r=a(57437),n=a(2265),o=a(37210),s=a(4867),i=a(37440);let l=o.fC,c=o.xz,d=o.h_,u=o.x8,m=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(o.aV,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...n})});m.displayName=o.aV.displayName;let f=n.forwardRef((e,t)=>{let{className:a,children:n,...l}=e;return(0,r.jsxs)(d,{children:[(0,r.jsx)(m,{}),(0,r.jsxs)(o.VY,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...l,children:[n,(0,r.jsxs)(o.x8,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,r.jsx)(s.Pxu,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});f.displayName=o.VY.displayName;let h=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};h.displayName="DialogHeader";let x=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};x.displayName="DialogFooter";let g=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(o.Dx,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",a),...n})});g.displayName=o.Dx.displayName;let p=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(o.dk,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...n})});p.displayName=o.dk.displayName},83102:function(e,t,a){"use strict";a.d(t,{I:function(){return u}});var r=a(48646),n=a(57437),o=a(2265),s=a(37440),i=a(45282),l=a(49977),c=a(84924);function d(){let e=(0,r._)(["\n        radial-gradient(\n          "," circle at ","px ","px,\n          var(--blue-500),\n          transparent 80%\n        )\n      "]);return d=function(){return e},e}let u=o.forwardRef((e,t)=>{let{className:a,type:r,...u}=e,[m,f]=o.useState(!1),h=(0,i.c)(0),x=(0,i.c)(0);return(0,n.jsx)(l.E.div,{style:{background:(0,c.Y)(d(),m?"100px":"0px",h,x)},onMouseMove:function(e){let{currentTarget:t,clientX:a,clientY:r}=e,{left:n,top:o}=t.getBoundingClientRect();h.set(a-n),x.set(r-o)},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:"p-[2px] rounded-lg transition duration-300 group/input",children:(0,n.jsx)("input",{type:r,className:(0,s.cn)("flex h-10 w-full border-none bg-gray-50 dark:bg-zinc-800 text-black dark:text-white shadow-input rounded-md px-3 py-2 text-sm  file:border-0 file:bg-transparent \n          file:text-sm file:font-medium placeholder:text-neutral-400 dark:placeholder-text-neutral-600 \n          focus-visible:outline-none focus-visible:ring-[2px]  focus-visible:ring-neutral-400 dark:focus-visible:ring-neutral-600\n           disabled:cursor-not-allowed disabled:opacity-50\n           dark:shadow-[0px_0px_1px_1px_var(--neutral-700)]\n           group-hover/input:shadow-none transition duration-400\n           ",a),ref:t,...u})})});u.displayName="Input"},88180:function(e,t,a){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;try{var r;null===(r=window.__colorizeTelemetry)||void 0===r||r.track(e,t,a)}catch(e){}}a.d(t,{r:function(){return r}})},16961:function(e,t,a){"use strict";a.d(t,{z:function(){return s}});var r=a(88180);let n=a(20357).env.NEXT_PUBLIC_EVENTS_API||"https://colorize.cc/api2/events";function o(){try{let e=localStorage.getItem("token");if(!e)return"";let t=(e.startsWith("Bearer ")?e.slice(7):e).split(".");if(3!==t.length)return"";return(JSON.parse(atob(t[1])).email||"").toLowerCase()}catch(e){return""}}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.r)(e,t,o());try{let a=o()||(localStorage.getItem("user_email")||"").toLowerCase();fetch("".concat(n,"/track"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({anon_id:function(){let e="colorize_anon_id",t=localStorage.getItem(e);return t||(t=crypto.randomUUID(),localStorage.setItem(e,t)),t}(),email:a,event_type:e,body:t})}).catch(()=>{})}catch(e){}}},37440:function(e,t,a){"use strict";a.d(t,{Y:function(){return s},cn:function(){return o}});var r=a(44839),n=a(96164);function o(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.m6)((0,r.W)(t))}function s(e){let t="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=a.length;for(let n=0;n<e;n++)t+=a.charAt(Math.floor(Math.random()*r));return t}}},function(e){e.O(0,[8310,7699,2126,4062,7080,1903,2033,8354,2971,7023,1744],function(){return e(e.s=98685)}),_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.