UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 2.21 kB
import{a as e,fn as t,i as n,n as r,o as i,r as a,t as o}from"./ErrorBlock-CuwX01Wv.js";import{D as s,F as c,c as l,j as u,m as d,s as f,u as p,w as m,x as h}from"./web-BWdORzMO.js";import{p as g}from"./userStore-BExk_Pfb.js";import{t as _}from"./logo-icon-B2VRCvVq.js";var v=d(`<div class="flex items-center justify-center h-full">`),y=d(`<div class="text-center max-w-sm mx-auto"><img alt="Lucid CMS Logo"class="h-10 mx-auto mb-6"><h1 class=mb-1></h1><p>`),b=d(`<div class="text-center max-w-sm mx-auto"><img alt="Lucid CMS Logo"class="h-10 mx-auto mb-6"><h1 class=mb-1></h1><p></p><div class="mt-8 flex justify-center">`),x=()=>{let d=g(),[x,S]=c(!1),C=u(()=>new URLSearchParams(d.search).get(`token`)),w=i.account.useVerifyEmailChangeConfirm({queryParams:{location:{token:C()}},enabled:()=>C()!==null}),T=i.account.useConfirmEmailChange({onSuccess:()=>{S(!0)}}),E=u(()=>C()===null||w.isError);return s(m,{get children(){return[s(h,{get when(){return l(()=>C()!==null)()&&w.isLoading},get children(){var e=v();return f(e,s(n,{size:`sm`})),e}}),s(h,{get when(){return E()},get children(){return s(o,{get content(){return{image:e,title:t()(`auth.email.change.token.invalid.title`),description:t()(`auth.email.change.token.invalid.description`)}},get link(){return{text:t()(`common.back.to.login`),href:`/lucid/login`}}})}}),s(h,{get when(){return x()},get children(){var e=y(),n=e.firstChild,i=n.nextSibling,a=i.nextSibling;return p(n,`src`,_),f(i,()=>t()(`routes.auth.email.change.confirmed.title`)),f(a,()=>t()(`routes.auth.email.change.confirmed.description`)),f(e,s(r,{theme:`primary`,size:`medium`,href:`/lucid/login`,classes:`mt-8`,get children(){return t()(`common.back.to.login`)}}),null),e}}),s(h,{get when(){return w.isSuccess},get children(){var e=b(),n=e.firstChild,r=n.nextSibling,i=r.nextSibling,o=i.nextSibling;return p(n,`src`,_),f(r,()=>t()(`routes.auth.email.change.confirm.title`)),f(i,()=>t()(`routes.auth.email.change.confirm.description`)),f(o,s(a,{theme:`primary`,size:`medium`,type:`button`,get loading(){return T.action.isPending},onClick:()=>{let e=C();e&&T.action.mutate({token:e})},get children(){return t()(`auth.email.change.confirm.action`)}})),e}})]}})};export{x as default};