PageSourceSearch

https://pika.style/_next/static/chunks/330.7b3e24bea72b6487.js

js pika.style collected 2026-10-03 21:22:18 UTC 8,217 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[330],{80330:(e,a,s)=>{s.r(a),s.d(a,{default:()=>N});var r=s(75038),l=s(76430),t=s(34530),i=s(45609),n=s.n(i),o=s(46001),d=s.n(o),c=s(88061),g=s(19977),u=s(72651),m=s(43887),x=s(42530),h=s(1433),p=s(2272),y=s(52218),f=s(22112),w=s(74954);let j={google:(0,r.jsxs)("svg",{viewBox:"0 0 48 48",className:"w-5 h-5","aria-hidden":"true",children:[(0,r.jsx)("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3C33.7 32.7 29.2 36 24 36c-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.8 1.2 7.9 3.1l5.7-5.7C34 6.1 29.3 4 24 4 12.9 4 4 12.9 4 24s8.9 20 20 20 20-8.9 20-20c0-1.2-.1-2.3-.4-3.5z"}),(0,r.jsx)("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8C14.7 15.1 19 12 24 12c3.1 0 5.8 1.2 7.9 3.1l5.7-5.7C34 6.1 29.3 4 24 4 16.3 4 9.7 8.3 6.3 14.7z"}),(0,r.jsx)("path",{fill:"#4CAF50",d:"M24 44c5.2 0 9.9-2 13.4-5.2l-6.2-5.2C29.2 35.1 26.7 36 24 36c-5.2 0-9.6-3.3-11.3-7.9l-6.5 5C9.5 39.6 16.2 44 24 44z"}),(0,r.jsx)("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3c-.8 2.2-2.2 4.2-4.1 5.6l6.2 5.2C37 39.2 44 34 44 24c0-1.2-.1-2.3-.4-3.5z"})]}),github:(0,r.jsx)(y.A,{size:20,weight:"fill"})},b="flex items-center justify-center gap-2 w-full px-4 py-2 rounded-xl border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800 text-base font-medium text-gray-900 dark:text-white duration-100 cursor-pointer",k="font-normal text-base text-gray-700 dark:text-gray-400 hover:underline cursor-pointer",v=({label:e})=>(0,r.jsxs)("div",{className:"flex items-center gap-3 my-5 text-sm text-gray-500 dark:text-gray-400",children:[(0,r.jsx)("div",{className:"h-px flex-1 bg-gray-200 dark:bg-gray-800"}),e,(0,r.jsx)("div",{className:"h-px flex-1 bg-gray-200 dark:bg-gray-800"})]});function N({show:e,checkout:a}){let[s,i]=(0,l.useState)("Login"),o=(0,l.useRef)(),[y,C]=(0,l.useState)({name:"",email:"",password:"",error:null,loading:!1}),[P,E]=(0,l.useState)(null),[L]=(0,l.useState)(m.SV),{c_SetSession:S,c_SetModals:R}=(0,l.useContext)(p.A),z=a||("Signup"===s?{id:"pro",isYearly:!0}:null);(0,l.useEffect)(()=>{i(e||"Login"),setTimeout(()=>{o?.current&&o?.current.focus()},50)},[e]);let M=()=>{R(e=>e?.filter(e=>"signupModal"!==e.id))},A=e=>{i(e),setTimeout(()=>o?.current?.focus(),50)},F=async(e,a)=>{if(!z){h.oR.success(a),M();return}let s=h.oR.loading("Taking you to checkout…"),r=await (0,x.dT)(z,e);r.redirected||((0,h.oR)(r.message,{id:s}),M())},T=async e=>{E(e);let{error:a}=await (0,m.cm)({provider:e,checkout:z});a&&(E(null),h.oR.error(a.message||"Couldn't reach the provider, please try again"))},_=async()=>{E("passkey");let{data:e,error:a}=await (0,g.U)().auth.signInWithPasskey();if(a){E(null);let e=(0,m.oM)(a,"sign-in");e&&(console.log("Passkey sign-in error",a),h.oR.error(e));return}e?.user&&((0,u.vq)("logged_in",{key:e.user.email||"",provider:"passkey"}),await F(e.user,"Logged in successfully")),E(null)},H=({withPasskey:e})=>(0,r.jsxs)("div",{className:"space-y-3",children:[m.zN.map(({id:e,label:a})=>(0,r.jsxs)(t.$n,{type:"button",className:b,onClick:()=>T(e),disabled:!!P||y.loading,children:[P===e?(0,r.jsx)("div",{className:"w-5 h-5",children:c.Nl}):j[e],"Continue with ",a]},e)),e&&L?(0,r.jsxs)(t.$n,{type:"button",className:b,onClick:_,disabled:!!P||y.loading,children:["passkey"===P?(0,r.jsx)("div",{className:"w-5 h-5",children:c.Nl}):(0,r.jsx)(f.A,{size:20}),"Sign in with a passkey"]}):""]}),D=e=>(0,r.jsx)(t.$n,{type:"submit",className:"flex items-center justify-center w-full px-4 py-2 text-lg font-medium text-white md:text-xl bg-linear-to-br from-red-400 to-pink-600 rounded-xl mt-5",onClick:V,disabled:y.loading||!!P,children:y.loading?(0,r.jsx)("div",{className:"w-7 h-7",children:c.Nl}):(0,r.jsx)("div",{className:"flex items-center",children:e})}),V=async()=>{if(!y.email||!y.password)return void h.oR.error("Please enter valid email and password");C(e=>({...e,loading:!0}));let e=(0,g.U)();if("Login"===s){let{data:{user:a},error:s}=await e.auth.signInWithPassword({email:y.email,password:y.password});if(s?.message){h.oR.error(s?.message||"Error logging you in, please try again"),C(e=>({...e,loading:!1}));return}a&&((0,u.vq)("logged_in",{key:a?.email||""}),await F(a,"Logged in successfully")),C(e=>({...e,loading:!1}))}if("Signup"===s){if(y?.name===""||!y.name.length){h.oR.error("Please enter your full name"),C(e=>({...e,loading:!1}));return}let{data:{user:a,session:s},error:r}=await e.auth.signUp({email:y.email,password:y.password,options:{data:{name:y.name}}});if(r?.message){h.oR.error(r?.message||"Error creating your account, please try again"),C(e=>({...e,loading:!1}));return}a&&(S(a),await (0,m.yV)({user:a,name:y?.name}),s?await F(a,"Welcome to Pika!"):((0,m.TH)({provider:"email",checkout:z}),h.oR.success("Check your inbox to confirm your email. We'll take you to checkout once you're back.",{duration:8e3}),M())),C(e=>({...e,loading:!1}))}},W="Login"==s?z?"Log in to continue":"Login":"Create your account";return(0,r.jsxs)("div",{className:"grid grid-cols-1 w-full border border-gray-200 dark:border-gray-800 rounded-2xl relative dark:bg-black",children:[(0,r.jsxs)("div",{className:d()("border-b-2 py-2 md:py-4 flex flex-col items-center justify-center font-inter","border-gray-300 dark:border-gray-800"),children:[(0,r.jsx)("h3",{className:"text-base md:text-lg text-gray-500 dark:text-gray-400",children:W}),z?(0,r.jsxs)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Then checkout: ",(0,r.jsx)("span",{className:"font-semibold text-gray-800 dark:text-gray-200",children:(0,x.MM)(z)})]}):""]}),(0,r.jsx)("div",{className:"flex flex-col w-full",children:(0,r.jsx)("div",{className:"w-full mx-auto flex items-center justify-center p-5 lg:px-10 lg:py-8 relative",children:(0,r.jsx)("div",{className:"relative w-full",children:"Login"==s?(0,r.jsxs)("div",{className:"w-full",children:[H({withPasskey:!0}),(0,r.jsx)(v,{label:"or log in with email"}),(0,r.jsxs)("form",{className:"w-full",onSubmit:e=>{e.preventDefault()},children:[(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(t.pd,{passref:o,id:"loginEmail",label:"Email",type:"email",placeholder:"Enter your email",onChange:e=>C(a=>({...a,email:e.target.value}))}),(0,r.jsx)(t.pd,{id:"loginPassword",label:"Password",type:"password",placeholder:"Enter password",onChange:e=>C(a=>({...a,password:e.target.value}))}),y?.error?(0,r.jsx)("div",{className:"text-red-400",children:y?.error}):""]}
1),D(z?"Log in and continue →":"Login →"),(0,r.jsxs)("div",{className:"mt-5 text-center flex items-center justify-center flex-col space-y-2",children:[(0,r.jsx)(n(),{href:"/reset-password",className:"font-normal text-base text-gray-700 dark:text-gray-400 hover:underline",onClick:M,children:"Forgot password?"}),z?(0,r.jsx)("button",{type:"button",className:k,onClick:()=>A("Signup"),children:"New to Pika? Create an account"}):(0,r.jsx)(t.$n,{className:k,href:"/pricing",as:"a",children:"Create an account"})]})]})]}):"Signup"==s?(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex flex-col md:hidden items-center justify-center text-lg text-center py-10 opacity-90",children:[(0,r.jsx)(w.A,{size:32,weight:"light",className:"mb-2 opacity-50"}),"Please open Pika.style on desktop to create an account"]}),(0,r.jsxs)("div",{className:"hidden md:block",children:[H({withPasskey:!1}),(0,r.jsx)(v,{label:"or sign up with email"})]}),(0,r.jsxs)("form",{className:"hidden md:block",onSubmit:e=>{e.preventDefault()},children:[(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(t.pd,{passref:o,id:"registerName",label:"Name",placeholder:"Enter your full name",onChange:e=>C(a=>({...a,name:e.target.value}))}),(0,r.jsx)(t.pd,{id:"registerEmail",label:"Email",type:"email",placeholder:"Enter your email",onChange:e=>C(a=>({...a,email:e.target.value}))}),(0,r.jsx)(t.pd,{id:"registerPassword",label:"Password",type:"password",placeholder:"Enter a secret password that only your cat knows",onChange:e=>C(a=>({...a,password:e.target.value}))})]}),D("Continue to checkout →"),(0,r.jsx)("div",{className:"mt-5 text-center",children:(0,r.jsx)("button",{type:"button",className:k,onClick:()=>A("Login"),children:"Already have an account? Log in"})})]})]}):void 0})})})]})}}}]);

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.