1import{u as V,a as J,b as O,p as T,c as U,d,r as s,t as W,e as $,M as A,f as m,U as c,j as e,i as _,g as a,R as l}from"../index-Dwetrij8.js";import{M as I}from"./MainTitle-B3c4Npag.js";import{u as S}from"./useTemplateGroup-C3aSnZU4.js";import{u as q}from"./useGtm-DvTbcLBc.js";import{M as f}from"./Make-ByMv-1MR.js";import"./DesktopDatePicker-BESuwI15.js";import"./SpinningCloseButton-CQPlIYPD.js";import"./formik.esm-cOkzu3uw.js";import"./Select-BsXXMHGB.js";import"./formControlState-Dq1zat_P.js";import"./useFormControl-ZOwGqPGW.js";import"./FormControl-BM1PFFQX.js";import"./toString-C63FsKp6.js";import"./InputAdornment-Dnb7DI2X.js";import"./Popper-B97I9QVI.js";import"./DialogActions-y8M4IQB6.js";import"./Chip-DOt-CgUZ.js";import"./CommonPlayer-CxCXGOoi.js";import"./HTMLPlayer-CEZfrkX4.js";import"./usePlayerControls-D3iGMt8B.js";import"./Placeholder-B9xWL5SE.js";import"./Skeleton-BiSdax8J.js";import"./useInterval-3ZyebxBn.js";import"./PlayArrow-Cv_4rKZr.js";import"./fmvrUtils-DxEo81M1.js";import"./videoPlayerUtils-DZt4m5bj.js";import"./useShares-yMeVTW2D.js";import"./useAlgoliaEvents-Cy4zmkx1.js";import"./ShareEmailForm-ClAOfZbU.js";import"./array-2ALxcZCy.js";import"./RadioGroup-B3qJChr7.js";import"./SwitchBase-2VAX1WHo.js";import"./DialogContent-ETFc59Zc.js";import"./dialogTitleClasses-eCg3njAL.js";import"./LoadingButton-CseS_rl8.js";import"./composeClasses-RkmlhA83.js";import"./CircularProgress-D0Z_FAki.js";import"./FacebookShareButton-Bf8kHnbT.js";import"./useClipboard-DpDVsUND.js";import"./StarringYouCards-C0N-AXgg.js";import"./StarringYou-kifIV-Qz.js";import"./StraightUpPresenter-CGcrZmxB.js";import"./LazyLoad-Cx7e_tku.js";import"./useFaceOrg-zeYwp4wH.js";import"./app-store-badge-CSnJTNRf.js";const Ut=h=>{const{loadTemplateGroup:g,templateGroup:r,clearTemplateGroup:k}=S(),{loadMake:M,make:t,clearMake:E}=V(),{trackVirtualPageView:j}=q(),{currentUser:i}=J(),{history:x,location:P,query:{slug:n,id:p}}=O(),b=T(null,["location","state","referrer"],h),{setLastEcard:w}=U(),{func:R,isNotFinished:y,isFinished:G}=d(M),{func:L,isNotFinished:F}=d(g),o=F||y;s.useEffect(()=>{!t||o||(j({name:"make-preview","template-short-name":t.template.name,"template-id":t.template.id}),W(i,{content_name:"eCard Preview"}),$(t,A))},[t,o]),s.useEffect(()=>(L(n),()=>k()),[n]),s.useEffect(()=>
1(R(p).catch(()=>x.push({pathname:m.page404Path(),state:{referrer:P.pathname}})),()=>{c.isPaid(i)&&E()}),[p]),s.useEffect(()=>{t&&r&&w(t,r)},[t,r]);const N=()=>{if(c.notRegistered(i)&&a.isDraft(t))return e.jsx(l,{to:m.loginPath()});if(c.isRegistered(i)){if(a.isDraft(t)&&a.isRecipient(t))return e.jsx(l,{to:m.unauthorizedPath()});if(a.isLive(t)&&a.isOwner(t))return e.jsx(l,{to:m.makeViewPath(n,p)})}return e.jsx(f,{joinable:!0,loading:o,make:t,templateGroup:r})};if(!G)return null;const v=()=>{const D=["January","February","March","April","May","June","July","August","September","October","November","December"],u=new Date(t.createdOn);return` eCard - ${D[u.getMonth()]} ${u.getDate()}, ${u.getFullYear()}`},C=t.template.name+v();return e.jsxs(e.Fragment,{children:[_(b)?N():e.jsx(f,{joinable:!0,loading:o,make:t,templateGroup:r}),e.jsx(I,{title:`Funny eCards - Send Custom Greeting Cards Online w/ JibJab! - ${C}`})]})};export{Ut as default};
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.