1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[679],{16930:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var l=a(37876),r=a(14232),n=a(15039),s=a.n(n),i=a(85717),o=a(48230),c=a.n(o);let d=e=>{let{characterTags:t,handleUpdateTags:a,editable:n,hoverToEdit:o}=e,[d,u]=(0,r.useState)(""),m=s()("w-full rounded-lg outline-none","disabled:opacity-[0.35] disabled:pointer-events-none",{"px-3 py-2 text-sm":!o,"pointer-events-none":!1===n,"bg-white text-input-subtle-shadow high-res-border dark:bg-neutral-800 dark:text-white":!o,"focus:ring-4 focus:ring-gray-100 dark:focus:ring-neutral-900":!o,"!py-1.5 !p-2 !-my-1.5 !-m-2 bg-transparent rounded-lg dark:text-neutral-400 transition-all":o,"!text-[13px] !leading-[24px]":o,"high-res-ring dark:focus:text-neutral-300 dark:hover:text-neutral-300":n&&o});return(0,l.jsx)("div",{className:"relative w-full",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:s()({"mt-2 mb-2.5":null==t?void 0:t.length}),children:null==t?void 0:t.map((e,r)=>(0,l.jsx)("span",{children:(0,l.jsx)(c(),{href:{pathname:"/explore",query:{tag:e.name}},onClick:e=>{n&&e.preventDefault()},children:(0,l.jsxs)("div",{className:"inline-flex py-[3px] px-[7px] rounded-[4px] text-xs font-medium leading-4 dark:bg-neutral-700 dark:text-neutral-200 focus:outline-none focus:shadow-outline space-x-1.5 mr-1.5 mb-1",children:[(0,l.jsx)("span",{className:"select-none",children:e.name}),n?(0,l.jsx)("button",{onClick:l=>((e,l)=>{e.preventDefault(),e.stopPropagation(),n&&a(t.filter(e=>e.name!==l.name))})(l,e),type:"button",className:"text-zinc-500 outline-none hover:text-zinc-300 focus:text-zinc-300 transition-[0.15s]","aria-label":"Remove tag",children:"â"}):null]})})},"selected-item-".concat(r)))}),n?(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("input",{value:d,onChange:e=>u(e.target.value),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&(e.preventDefault(),n&&(a([...t,{name:d}]),u("")))},className:m,placeholder:"Add tag...",disabled:!n,style:{width:o?"calc(100% + 16px)":"100%"}}),(0,l.jsx)("div",{children:d?(0,l.jsx)("div",{className:"absolute top-0 right-0 bottom-0 flex items-center justify-center",style:{width:o?24:40},children:(0,l.jsxs)("div",{className:"flex flex-col items-center pt-1",children:[(0,l.jsx)(i.Ltv,{className:"e-icon",width:"12",height:"12"}),(0,l.jsx)("div",{className:"text-[8px] font-display",children:"Add"})]})}):null})]}):null]})})}},25397:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var l=a(37876),r=a(14232),n=a(15039),s=a.n(n),i=a(30892);let o=r.forwardRef((e,t)=>{let{id:a,size:n="sm",label:o,labelSize:c="md",value:d,onChange:u,className:m,containerClassName:h,hasError:p=!1,optional:x=!1,placeholder:g="",type:v="text",disabled:f=!1,required:b=!1,editable:y,hoverToEdit:j=!1,min:w,step:N,...A}=e,k=s()("w-24 rounded-lg z-40 text-center","outline-none","disabled:opacity-[0.35] disabled:pointer-events-none",{"border-red-200 focus:ring-red-200":p,"px-8 py-2 text-sm":"sm"===n,"px-8 py-4 text-md":"lg"===n,"pointer-events-none":!1===y,"bg-white text-input-subtle-shadow high-res-border dark:bg-neutral-800 dark:text-white":!j,"focus:ring-4 focus:ring-gray-100 dark:focus:ring-neutral-900":!j,"!py-1.5 !-my-1.5 !-m-2 bg-transparent rounded-lg dark:text-neutral-400 transition-all":j,"!text-[13px] !leading-[24px]":j,"high-res-ring dark:focus:text-neutral-300 dark:hover:text-neutral-300":y&&j}),C=s()(k,m),[R,E]=r.useState(!1);return r.useEffect(()=>{let e=setTimeout(()=>{null!==d&&d<18?E(!0):E(!1)},1e3);return()=>clearTimeout(e)},[d]),(0,l.jsxs)("div",{className:h,children:[o||x?(0,l.jsxs)("div",{className:"flex items-center justify-between space-x-[5px] mb-3",children:[o&&(0,l.jsx)(i.A,{id:a,className:"mb-0",size:c,children:o}),x&&(0,l.jsx)("span",{className:"text-xs font-normal text-zinc-300",children:"optional"})]}):null,(0,l.jsxs)("div",{className:"flex items-center relative w-fit",children:[(0,l.jsx)("button",{onClick:e=>{e.preventDefault(),y&&null!==d&&d>18&&u(d-1)},className:s()("absolute left-0 top-0 bottom-0 focus:outline-none flex items-center justify-center z-50",{"pb-1 w-4":j,"pb-0.5 w-8":!j,"focus:text-neutral-300":y,"pointer-events-none":!y}),children:"-"}),(0,l.jsx)("input",{id:a,value:null!=d?d:void 0,placeholder:"",onChange:e=>{y&&u(e.target.value?Number(e.target.value):null)},className:C,autoComplete:"off",type:"number",ref:t,min:w,step:N,disabled:f,required:b,...A}),(0,l.jsx)("button",{onClick:e=>{e.preventDefault(),y&&null!==d&&u(d+1)},className:s()("absolute right-0 top-0 bottom-0 focus:outline-none flex items-center justify-center z-50",{"pb-1 w-4":j,"pb-0.5 w-8":!j,"focus:text-neutral-300":y,"pointer-events-none":!y}),children:"+"})]}),R&&(0,l.jsx)("div",{className:"text-red-500 text-xs mt-2",children:"Age must be 18 or older"})]})})},28006:(e,t,a)=>{"use strict";a.d(t,{A:()=>
1o});var l=a(37876);a(14232);var r=a(15039),n=a.n(r),s=a(30892),i=a(85717);let o=e=>{let{id:t,size:a="sm",label:r,labelSize:o="md",value:c,onChange:d,className:u,containerClassName:m,hasError:h=!1,optional:p=!1,disabled:x=!1,required:g=!1,options:v,style:f,...b}=e,y=n()("w-full rounded-lg outline-none","disabled:opacity-[0.35] disabled:pointer-events-none",{"border-red-200 focus:ring-red-200":h,"px-2 py-1.5 text-xs rounded-md":"xs"===a,"px-3 py-2 text-sm":"sm"===a,"px-3 py-4 text-md":"lg"===a,"pointer-events-none":x,"bg-neutral-900 dark:bg-neutral-900 text-neutral-50 dark:text-neutral-50 focus:ring-0 focus:outline-none":!x}),j=n()(y,u);return(0,l.jsxs)("div",{className:m,children:[r||p?(0,l.jsxs)("div",{className:"flex items-center justify-between space-x-[5px] mb-3",children:[r&&(0,l.jsx)(s.A,{id:t,className:"mb-0",size:o,children:r}),p&&(0,l.jsx)("span",{className:"text-xs font-normal text-zinc-300",children:"optional"})]}):null,(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("select",{id:t,value:c,onChange:e=>d(e.target.value),className:"".concat(j," appearance-none"),style:f,disabled:x,required:g,...b,children:v.map(e=>(0,l.jsx)("option",{value:e.value,disabled:e.disabled,children:e.label},e.value))}),(0,l.jsx)("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-neutral-700",children:(0,l.jsx)(i.yQN,{className:"e-icon",width:"14",height:"14"})})]})]})}},28597:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let l={month:"long",day:"numeric",timeZone:"UTC"},r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;if(!e)return"";let a="string"==typeof e?new Date(e):e;return!(a instanceof Date)||Number.isNaN(a.getTime())?"":new Intl.DateTimeFormat("en-US",{...l,...t}).format(a)}},29219:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var l=a(37876),r=a(14232),n=a(40385),s=a(28006);let i={public:"Anyone can chat with your AI and see its profile.",obfuscated:"Anyone can chat with your AI but no one can see its profile.",private:"No one can chat with your AI or see its profile."},o=e=>{let{isPrivate:t,setIsPrivate:a,isObfuscated:o,setIsObfuscated:c,setCharacter:d,setIsChanged:u}=e,{user:m}=(0,n.AX)(),h=(null==m?void 0:m.plan)&&"FREE"!==m.plan,p=t?"private":o?"obfuscated":"public",x=(0,r.useMemo)(()=>[{value:"public",label:"Public"},{value:"obfuscated",label:h?"Obfuscated":"Obfuscated (Premium)",disabled:!h},{value:"private",label:h?"Private":"Private (Premium)",disabled:!h}],[h]);return(0,l.jsxs)("div",{children:[(0,l.jsx)(s.A,{id:"visibility",value:p,onChange:e=>{if(("obfuscated"===e||"private"===e)&&!h)return;let t="private"===e,l="obfuscated"===e;d?(d(e=>({...e,isObfuscated:l,isPrivate:t})),null==u||u(!0)):(null==c||c(l),null==a||a(t))},options:x,size:"sm"}),(0,l.jsx)("p",{className:"mt-2 text-xs text-neutral-500 leading-relaxed",children:i[p]})]})}},41234:()=>{},43882:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/characters/new",function(){return a(79334)}])},63051:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var l=a(37876),r=a(14232),n=a(85717),s=a(89099),i=a(77328),o=a.n(i);let c=e=>{let{title:t,children:a,scrollId:i,suppressSchema:c=!1}=e,d=(0,s.useRouter)(),[u,m]=(0,r.useState)(!1),[h,p]=(0,r.useState)(!1),x=async e=>{e.stopPropagation();try{let e=d.pathname;await navigator.clipboard.writeText("".concat(window.location.origin).concat(e,"#").concat(i)),m(!0),setTimeout(()=>m(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},g=()=>{p(!h)};(0,r.useEffect)(()=>{if(window.location.hash==="#".concat(i)){let e=document.getElementById(i);e&&e.scrollIntoView()}},[i]);let v=e=>Array.isArray(e)?e.map(v).join(" "):r.isValidElement(e)&&e.props.children?r.Children.toArray(e.props.children).map(v).join(" "):(null==e?void 0:e.toString())||"",f=v(a).replace(/\s+/g," ");return(0,l.jsxs)(l.Fragment,{children:[c?null:(0,l.jsx)(o(),{children:(0,l.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"Question",name:t,acceptedA
1nswer:{"@type":"Answer",text:f}})}})}),(0,l.jsxs)("div",{id:i,role:"button",tabIndex:0,onClick:g,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),g())},"aria-expanded":h,className:"relative flex flex-col items-start text-left py-8 w-full cursor-pointer",children:[(0,l.jsxs)("div",{className:"text-2xl w-full flex items-center justify-between ".concat(h?"pb-5":""),children:[(0,l.jsx)("h4",{className:"text-left font-display",children:t}),(0,l.jsx)("div",{className:"w-4 h-4 ",children:h?(0,l.jsx)(n.rXn,{className:"e-icon text-neutral-600",width:"16",height:"16"}):(0,l.jsx)(n.yQN,{className:"e-icon text-neutral-600",width:"16",height:"16"})})]}),(0,l.jsxs)("div",{className:"w-full",style:{maxHeight:h?"1000px":"0",overflow:"hidden"},children:[(0,l.jsx)("div",{className:"w-full space-y-5 e-serif text-[16px] leading-loose",onClick:e=>{e.target.closest("a")&&e.stopPropagation()},children:a}),(0,l.jsxs)("div",{className:"mt-2 flex items-center justify-end w-full relative",children:[(0,l.jsx)("button",{className:"ml-auto bg-transparent border-none cursor-pointer text-neutral-700 text-xs",onClick:x,children:"Copy link"}),u&&(0,l.jsx)("div",{className:"absolute bottom-4 right-0 px-1.5 bg-black text-white rounded whitespace-nowrap",children:"Copied link!"})]})]})]})]})}},68426:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var l=a(37876);a(14232);let r=e=>{let{id:t,state:a,setState:r,item:n,type:s}=e,i=(null==a?void 0:a.id)===(null==n?void 0:n.id);return(0,l.jsxs)("label",{htmlFor:"".concat(t,"_").concat(null==n?void 0:n.id),className:"grow basis-0 px-3 high-res-border rounded-lg flex items-center justify-between cursor-pointer py-2 ".concat(i?"bg-purple-600 border-purple-600":""),onClick:()=>{(null==a?void 0:a.id)===(null==n?void 0:n.id)?r(null):r(n)},children:[(0,l.jsx)("div",{className:"text-xs font-normal leading-relaxed select-none ".concat(i?"text-white":"text-neutral-300"),children:n.name}),(0,l.jsx)("div",{className:"cursor-pointer w-4 min-w-[16px] h-4 min-h-[16px] high-res-border rounded-full relative outline-none flex items-center justify-center ".concat(i?"!border-neutral-100 bg-neutral-100":"border-gray-300"),children:i&&(0,l.jsx)("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"e-icon text-purple-600",style:{transform:"translateY(0.5px)"},children:(0,l.jsx)("path",{d:"M20 6 9 17l-5-5",stroke:"#000",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round"})})})]})}},77138:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});let l=["00000000000000000"]},79334:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>ev,default:()=>ef});var l=a(37876),r=a(14232),n=a(89099),s=a(30892),i=a(12721),o=a(50290),c=a(12993),d=a(85717),u=a(57186),m=a(40004),h=a(25397),p=a(16930),x=a(48230),g=a.n(x),v=a(65038),f=a(7111),b=a(78816),y=a(18583),j=a(28597),w=a(3711);let N=e=>{let{characterTags:t,handleUpdateTags:a}=e,n=(0,f.Ay)(),s=(0,y.gR)(n),[i,c]=(0,r.useState)(!1);if(s!==y.Kh.ENTRY)return null;let d=(0,b.CW)(n.entryTag),u=t.some(e=>(0,b.CW)(e.name)===d),m="".concat(w.JM,"/marketing/contests/").concat(n.id,"/simple.jpg"),h=n.buttonBackground||"from-purple-900 via-purple-800 to-purple-800";return(0,l.jsxs)("div",{className:"mt-6 rounded-xl overflow-hidden bg-gradient-to-r ".concat(h),children:[i?null:(0,l.jsxs)("div",{className:"relative w-full h-32 overflow-hidden",children:[(0,l.jsx)(v.A,{src:m,alt:n.theme,fill:!0,className:"object-cover",onError:()=>c(!0)}),(0,l.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"})]}),(0,l.jsxs)("div",{className:"px-4 pb-4 pt-3",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-3 mb-3",children:[(0,l.jsx)("span",{className:"text-2xl",children:n.emoji}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"font-softly text-lg text-white",children:n.name}),(0,l.jsxs)("p",{className:"text-xs text-white/70",children:["Entry period ends"," ",(0,j.A)(n.entryEndAt,{month:"long",day:"numeric",year:"numeric"})]})]})]}),u?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"text-sm text-green-200 bg-green-900/30 p-3 rounded-lg flex items-center space-x-2",children:[(0,l.jsx)("span",{children:"â
"}),(0,l.jsx)("span",{children:"This character will be entered in the contest!"})]}),(0,l.jsx)("div",{className:"pt-1 text-center",children:(0,l.jsx)(g(),{href:"/contests/".concat(n.stub),target:"_blank",className:"text-xs text-white/70 hover:text-white transition-colors",children:"View Contest Details"})})]}):(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("p",{className:"text-sm text-white/80",children:["Enter your character in the ",n.theme," contest and compete for prizes!"]}),(0,l.jsx)(o.A,{level:"premium",onClick:()=>{u||a([...t,{name:n.entryTag}])},size:"medium",className:"w-full",children:"Enter Contest"}),(0,l.jsx)("div",{className:"pt-1 text-center",children:(0,l.jsx)(g(),{href:"/contests/".concat(n.stub),target:"_blank",className:"text-xs text-white/70 hover:text-white transition-colors",children:"View Contest Details"})})]})]})]})};var A=a(86396),k=a(40385),C=a(3122),R=a(68426),E=a(96391),S=a(29219),I=a(50773),T=a(19677),U=a(43080),D=a(58358),M=a(10388),P=a(72351);let F=e=>{let{text:t,removeHtml:a=!1}=e,[n,s]=(0,r.useState)(0),i=async e=>{try{a&&(e=(0,M.X)(e));let t=await T.K.post("/tokens",{text:e});s(t.data.tokens)}catch(e){console.error("Error fetching token count:",e)}},o=(0,r.useCallback)(((e,t)=>{let a;return function(){for(var l=arguments.length,r=Array(l),n=0;n<l;n++)r[n]=arguments[n];clearTimeout(a),a=setTimeout(()=>e(...r),t)}})(i,300),[]);return(0,r.useEffect)(()=>{t?o(t):s(0)},[t,o]),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(P.A,{tooltipText:"Tokens are what AI sees, instead of letters and numbers. Keep the number of tokens short for optimal results.",children:(0,l.jsxs)("div",{className:"relative mt-2 text-xs font-light text-neutral-600",children:["Tokens: ",n]})}),(0,l.jsx)("div",{className:"mt-2 text-xs font-light ".concat((e=>e>500?"text-red-600":e>200?"text-yellow-600":"text-neutral-600")(n)),children:(e=>e>500?"Long input degrades character memory":e>200?"Shorter input improves character memory":"")(n)})]})};
1var L=a(93864),_=a(68579),W=a(76968),O=a(30738),z=a(24189),q=a(40695),K=a(29270),G=a(77138),Y=a(10875),V=a(97027),H=a(79828),J=a(80352),B=a(35264),X=a(54287),Q=a(42232),$=a(66856);let Z=e=>"number"!=typeof e||Number.isNaN(e)?null:e<0?0:e>1?1:e;var ee=a(15039),et=a.n(ee),ea=a(14664),el=a(63727),er=a(73377),en=a(27904);let es="inline-flex min-h-[38px] items-center justify-center rounded-full bg-purple-700/60 px-6 text-sm font-semibold text-purple-50",ei=L.Fx[q.AvatarStatus.UNDER_REVIEW],eo=L.Fx[q.AvatarStatus.REJECTED],ec=e=>{let{onClick:t,label:a,disabled:r,children:n}=e;return(0,l.jsx)("button",{type:"button",onClick:r?void 0:t,"aria-label":a,title:a,className:"flex h-9 w-9 items-center justify-center rounded-full border border-neutral-700 bg-black/60 text-neutral-100 transition hover:border-neutral-500 hover:bg-black/80 ".concat(r?"opacity-50 cursor-not-allowed hover:border-neutral-700 hover:bg-black/60":""),disabled:r,children:n})},ed=e=>{let{onAdd:t}=e;return(0,l.jsx)("div",{className:"w-full",children:(0,l.jsxs)("button",{type:"button",onClick:t,className:"w-full aspect-square min-h-[270px] rounded-[18px] border border-neutral-800 bg-neutral-950 transition-colors hover:border-neutral-600 hover:bg-neutral-900 flex flex-col items-center justify-center gap-4 text-center px-8 cursor-pointer select-none",children:[(0,l.jsx)("div",{className:"flex items-center justify-center w-14 h-14 rounded-full bg-neutral-800",children:(0,l.jsx)(d.fN2,{width:28,height:28,className:"e-icon text-neutral-400"})}),(0,l.jsx)("span",{className:et()(es,"mt-4"),children:"Add avatar"})]})})},eu=e=>{var t;let{card:a,isFirst:r,isLast:n,onRemove:s,onMoveUp:i,onMoveDown:o,isLoading:c,isDragging:u=!1}=e,m=a.status===q.AvatarStatus.REJECTED,h=!m&&(a.requiresManualReview||a.status===q.AvatarStatus.UNDER_REVIEW),p=!!i,x=!!o;return(0,l.jsxs)("div",{className:et()("space-y-3 transition",{"opacity-80":u}),children:[(0,l.jsxs)("div",{className:et()("relative overflow-hidden rounded-[18px] border border-neutral-800 bg-neutral-950 shadow-[0_18px_40px_-30px_rgba(0,0,0,0.7)]",{"cursor-grab active:cursor-grabbing":!c}),children:[(0,l.jsx)("div",{className:"relative w-full aspect-[3/4]",children:(0,l.jsx)(v.A,{src:a.previewUrl,alt:"Avatar preview",fill:!0,className:et()("object-cover transition rounded-[inherit]",h?er.ZX:null,m?er.ES:null),sizes:"(max-width: 768px) 100vw, 320px"})}),h?(0,l.jsx)(er.lL,{}):null,m?(0,l.jsx)(er.zE,{}):null,(0,l.jsxs)("div",{className:"absolute top-3 left-3 flex flex-col gap-2 pointer-events-none",children:[m?(0,l.jsx)(en.F,{color:en.C.Danger,children:eo}):null,h?(0,l.jsx)(en.F,{color:en.C.Warning,children:ei}):null]}),(0,l.jsx)("div",{className:"absolute top-3 right-3 flex items-center gap-2",children:(0,l.jsx)(ec,{onClick:s,label:"Remove avatar",disabled:c,children:(0,l.jsx)(d.X,{width:18,height:18,className:"e-icon"})})}),p||x?(0,l.jsxs)("div",{className:"absolute bottom-3 left-3 flex items-center gap-2",children:[p?(0,l.jsx)(ec,{onClick:()=>{!c&&i&&i()},label:"Move earlier",disabled:c||r||!i,children:(0,l.jsx)(d.DoI,{width:18,height:18,className:"e-icon"})}):null,x?(0,l.jsx)(ec,{onClick:()=>{!c&&o&&o()},label:"Move later",disabled:c||n||!o,children:(0,l.jsx)(d.yd$,{width:18,height:18,className:"e-icon"})}):null]}):null]}),m&&a.rejectionCopy?(0,l.jsxs)("div",{className:"rounded-2xl border border-neutral-800 bg-neutral-900 p-4 text-xs leading-relaxed text-neutral-300 space-y-2",children:[(0,l.jsx)("p",{className:"font-semibold text-neutral-100 text-sm",children:null!=(t=a.rejectionCopy.title)?t:"We couldn't approve this avatar."}),a.rejectionCopy.description?(0,l.jsxs)("p",{children:[a.rejectionCopy.description," ",(0,l.jsx)(g(),{href:L.MA,className:"underline",children:"Read the guidelines"}),"."]}):null]}):null]})},em=e=>{let{id:t,disabled:a=!1,children:r}=e,{attributes:n,listeners:s,setNodeRef:i,transform:o,transition:c,isDragging:d}=(0,X.gl)({id:t,disabled:a}),u={transform:el.Ks.Transform.toString(o),transition:c};return(0,l.jsx)("div",{ref:i,style:u,className:et()("w-full",{"z-30":d}),...n,...s,children:r(d)})},eh=e=>{let{cards:t,onAdd:a,onRemovePrimary:n,onRemoveSecondary:s,onReorder:i,isLoading:o}=e,c=(0,ea.FR)((0,ea.MS)(ea.AN,{activationConstraint:{distance:6}})),u=(0,r.useMemo)(()=>t.map(e=>e.id),[t]),m=(0,r.useCallback)(e=>{let{active:a,over:l}=e;if(!l||a.id===l.id)return;let r=t.findIndex(e=>e.id===a.id),n=t.findIndex(e=>e.id===l.id);-1!==r&&-1!==n&&i(r,n)},[t,i]);return t.length?(0,l.jsx)(ea.Mp,{sensors:c,collisionDetection:ea.fp,onDragEnd:m,children:(0,l.jsx)(X.gB,{items:u,strategy:X.kL,children:(0,l.jsx)("div",{className:"space-y-6",children:(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-6 md:grid-cols-2 xl:grid-cols-2",children:[t.map((e,a)=>{let r=0===a,c=a===t.length-1,d=e.isPrimary&&!e.additionalId?n:e.additionalId?()=>s(e.additionalId):n,u=r?void 0:()=>i(a,a-1),m=c?void 0:()=>i(a,a+1);return(0,l.jsx)(em,{id:e.id,disabled:o,children:t=>(0,l.jsx)(eu,{card:e,isFirst:r,isLast:c,onRemove:d,onMoveUp:u,onMoveDown:m,isLoading:o,isDragging:t})},e.id)}),(0,l.jsx)("div",{className:"w-full",children:(0,l.jsxs)("button",{type:"button",onClick:a,className:"flex h-full w-full min-h-[260px] flex-col items-center justify-center gap-4 roun
1ded-[18px] border border-dashed border-neutral-700 bg-neutral-950 px-6 text-center transition-colors hover:border-neutral-500 hover:bg-neutral-900",children:[(0,l.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-neutral-800",children:(0,l.jsx)(d.fN2,{width:24,height:24,className:"e-icon text-neutral-400"})}),(0,l.jsx)("span",{className:es,children:"Add avatar"})]})})]})})})}):(0,l.jsx)(ed,{onAdd:a})};var ep=a(70375),ex=a(63051),eg=a(74555),ev=!0;let ef=e=>{var t;let{isFWB:a,requiresAuth:x}=e,v=(0,n.useRouter)(),j=(0,r.useRef)(!1),M=(0,r.useRef)(null),{user:P,isAdmin:ee,isOmega:et}=(0,k.Jd)(),{addUpperCenterToast:ea}=(0,W.Y)(),{givenName:el,setGivenName:er,age:en,setAge:es,title:ei,setTitle:eo,titleError:ec,setTitleError:ed,titleErrorSeverity:eu,setTitleErrorSeverity:em,description:ev,setDescription:ef,appearance:eb,setAppearance:ey,personality:ej,setPersonality:ew,firstMessage:eN,setFirstMessage:eA,messageExamples:ek,setMessageExamples:eC,scenario:eR,setScenario:eE,creatorNotes:eS,setCreatorNotes:eI,isPrivate:eT,setIsPrivate:eU,isObfuscated:eD,setIsObfuscated:eM,avatarFile:eP,setAvatarFile:eF,avatarUploadId:eL,setAvatarUploadId:e_,avatarUploadStatus:eW,setAvatarUploadStatus:eO,avatarManualReviewMessage:ez,setAvatarManualReviewMessage:eq,avatarReviewDecision:eK,setAvatarReviewDecision:eG,avatarRejectionReason:eY,setAvatarRejectionReason:eV,avatarStyle:eH,setAvatarStyle:eJ,gender:eB,setGender:eX,voice:eQ,setVoice:e$,characterTags:eZ,setCharacterTags:e0,avatarPrompt:e1,setAvatarPrompt:e2,descriptionPrompt:e3,setDescriptionPrompt:e5,descriptionKey:e8,setDescriptionKey:e4,appearanceKey:e7,setAppearanceKey:e6,personalityKey:e9,setPersonalityKey:te,scenarioKey:tt,setScenarioKey:ta,firstMessageKey:tl,setFirstMessageKey:tr,messageExamplesKey:tn,setMessageExamplesKey:ts,creatorNotesKey:ti,formError:to,avatarError:tc,setAvatarError:td,isUploadMode:tu,setIsUploadMode:tm,isLoading:th,isSuccess:tp,handleUpdateTags:tx,avatarSource:tg,setAvatarSource:tv,avatarImageGeneration:tf,setAvatarImageGeneration:tb,avatarResolvedNSFW:ty,setAvatarResolvedNSFW:tj,creatorAvatars:tw,setCreatorAvatars:tN}=(0,D.R)(),tA=(0,r.useRef)(new Set);(0,r.useEffect)(()=>()=>{tA.current.forEach(e=>{URL.revokeObjectURL(e)}),tA.current.clear()},[]);let tk=(0,r.useCallback)((e,t)=>{},[]),tC=(0,r.useCallback)(e=>{let t={id:(0,u.A)(),...e};return t.isObjectUrl&&tA.current.add(t.previewUrl),tN(e=>{let a=[...e,t];return tk(ty,a),a}),t},[ty,tN,tk,tA]),tR=(0,r.useCallback)(e=>{tN(t=>{let a=t.find(t=>t.id===e),l=t.filter(t=>t.id!==e);return(null==a?void 0:a.isObjectUrl)&&(URL.revokeObjectURL(a.previewUrl),tA.current.delete(a.previewUrl)),tk(ty,l),l})},[tN,tk,ty,tA]),{handleAvatarFileDrop:tE}=(()=>{let{user:e,isAdmin:t}=(0,k.Jd)(),{setGivenName:a,setDescription:l,setAppearance:r,setPersonality:n,setFirstMessage:s,setMessageExamples:i,setScenario:o,setCreatorNotes:c,setAvatarFile:d,setAvatarUploadId:m,setAvatarUploadStatus:h,setAvatarManualReviewMessage:p,setAvatarReviewDecision:x,setAvatarRejectionReason:g,setAvatarSource:v,setAvatarImageGeneration:f,setAvatarStyle:b,setCharacterTags:y,setDescriptionKey:j,setAppearanceKey:w,setPersonalityKey:N,setScenarioKey:A,setFirstMessageKey:C,setMessageExamplesKey:R,setCreatorNotesKey:E,setAvatarError:S,setIsUploadMode:I,handleUpdateTags:T}=(0,D.R)(),U=async(e,t)=>{if(e&&e.size<=z.MN){var y,k,U,D,M,P;d(e),m(null!=(k=null==t?void 0:t.avatarId)?k:null),h(null!=(U=null==t?void 0:t.status)?U:null),p(null!=(D=null==t?void 0:t.manualReviewMessage)?D:null),x(null!=(M=null==t?void 0:t.reviewDecision)?M:null),g(null!=(P=null==t?void 0:t.rejectionReason)?P:null),f(null),v(q.AvatarSource.USER),b(null),I(!1),S(null);let F=new FormData;if(F.append("cardFile",e),"png"===(null==(y=e.name.split(".").pop())?void 0:y.toLowerCase())){let e=await fetch("/api/characters/cards/parse",{method:"POST",body:F}),t=await e.json();t.name&&a(t.name),t.description&&(l(t.description),setTimeout(()=>j((0,u.A)()),0)),t.appearance&&(r(t.appearance),setTimeout(()=>w((0,u.A)()),0)),t.personality&&(n(t.personality),setTimeout(()=>N((0,u.A)()),0)),t.scenario&&(o(t.scenario),setTimeout(()=>A((0,u.A)()),0)),t.first_mes&&(s(t.first_mes),setTimeout(()=>C((0,u.A)()),0)),t.mes_example&&(i(t.mes_example),setTimeout(()=>R((0,u.A)()),0)),t.creator_notes&&(c(t.creator_notes),setTimeout(()=>E((0,u.A)()),0)),t.tags&&Array.isArray(t.tags)&&T(t.tags.map(e=>({name:e})))}}else m(null),h(null),p(null),x(null),g(null),S("File size should be less than ".concat(z.Kx,"MB. Upgrade your plan for larger uploads."))};return{handleAvatarFileChange:async e=>{let t=e.target.files?e.target.files[0]:null;await U(t)},handleAvatarFileDrop:async(e,t)=>{await U(e,t)}}})(),tS=(0,r.useCallback)(()=>{eF(null),e_(null),eO(null),eq(null),eG(null),eV(null),tb(null),tv(void 0),eJ(null),tj(null)},[eF,e_,eO,eq,eG,eV,tb,tv,eJ,tj]),tI=(0,r.useCallback)(e=>{tS(),tb(e),tv(q.AvatarSource.GENERATED),td(null),e.style&&eJ((0,B.YV)(e.style))},[tS,tb,tv,td,eJ]),tT=(0,r.useRef)(!1);(0,r.useEffect)(()=>
1{if(!v.isReady||tT.current)return;let e=v.query.fromImage;"string"==typeof e&&e&&(tT.current=!0,(async()=>{try{var t;let{data:a}=await T.K.get("/images/generations/".concat(e)),l=null!=(t=null==a?void 0:a.image)?t:a;(null==l?void 0:l.id)&&tI(l)}catch(e){}})())},[v.isReady,v.query.fromImage,tI]),(0,r.useEffect)(()=>{0===tw.length&&tA.current.size>0&&(tA.current.forEach(e=>{URL.revokeObjectURL(e)}),tA.current.clear())},[tw.length]),(0,r.useEffect)(()=>{tk(ty,tw)},[tw,ty,tk]);let tU=(0,r.useMemo)(()=>!!(eL||tf||eP),[eL,tf,eP]),tD=(0,r.useCallback)(e=>{tR(e)},[tR]),tM=(0,r.useCallback)(async()=>{let[e,...t]=tw;if(tS(),e){var a,l,r,n,s,i,o,c,d,u;tN(t),e.isObjectUrl&&(URL.revokeObjectURL(e.previewUrl),tA.current.delete(e.previewUrl)),"upload"===e.kind?(await tE(null!=(a=e.file)?a:null,{avatarId:null!=(l=e.avatarId)?l:null,status:null!=(r=e.status)?r:null,manualReviewMessage:null!=(n=e.manualReviewMessage)?n:null,reviewDecision:null!=(s=e.reviewDecision)?s:null,rejectionReason:null!=(i=e.rejectionReason)?i:null}),tj(null!=(o=e.resolvedNSFW)?o:null),tk(null!=(c=e.resolvedNSFW)?c:null,t)):"library"===e.kind||"generated"===e.kind?(e.imageGeneration?tI(e.imageGeneration):tb(null),tj(null!=(d=e.resolvedNSFW)?d:null),tk(null!=(u=e.resolvedNSFW)?u:null,t)):tk(null,t)}else tN([]),tk(null,[])},[tw,tE,tI,tN,tA,tS,tb,tj,tk]),{voices:tP}=(0,C.N)(),[tF,tL]=(0,r.useState)(J.eK.style),t_=(0,r.useMemo)(()=>eP?URL.createObjectURL(eP):null,[eP]);(0,r.useEffect)(()=>{if(t_)return()=>{URL.revokeObjectURL(t_)}},[t_]);let tW=(0,r.useMemo)(()=>(null==tf?void 0:tf.falImageUrl)?tf.falImageUrl:(null==tf?void 0:tf.s3Key)?"".concat(w.JM,"/").concat(tf.s3Key):t_,[tf,t_]),tO=(0,r.useMemo)(()=>!!(tW&&tW===t_),[tW,t_]),tz=(0,r.useCallback)(()=>{var e;let t,a;if(!tU)return null;let l=null,r="",n=!1;return eL?(t="upload",a="uploaded",r=tW||"",n=tO,l=eP):eP&&tf?(t="generated",a="generated",r=tW||"",n=tO,l=eP):(null==tf?void 0:tf.s3Key)?(t="library",a="generated",r="".concat(w.JM,"/").concat(tf.s3Key)):tW?(t="library",a="generated",r=tW,n=tO):(t="library",a="generated"),{id:"primary-".concat((0,u.A)()),kind:t,attachType:a,avatarId:eL,imageGeneration:tf,imageGenerationId:null!=(e=null==tf?void 0:tf.id)?e:null,file:l,previewUrl:r,status:null!=eW?eW:null,manualReviewMessage:null!=ez?ez:null,reviewDecision:null!=eK?eK:null,rejectionReason:null!=eY?eY:null,requiresManualReview:eW===q.AvatarStatus.UNDER_REVIEW||!!ez,resolvedNSFW:ty,isObjectUrl:n}},[tU,eL,eP,tf,eW,ez,eK,eY,ty,tW,tO]),tq=(0,r.useCallback)(e=>{var t,a,l,r,n,s,i,o,c,d,u,m,h,p;tS(),"upload"===e.kind?(eF(null!=(t=e.file)?t:null),e_(null!=(a=e.avatarId)?a:null),eO(null!=(l=e.status)?l:null),eq(null!=(r=e.manualReviewMessage)?r:null),eG(null!=(n=e.reviewDecision)?n:null),eV(null!=(s=e.rejectionReason)?s:null),tv(q.AvatarSource.USER)):(eO(null!=(o=e.status)?o:null),eq(null!=(c=e.manualReviewMessage)?c:null),eG(null!=(d=e.reviewDecision)?d:null),eV(null!=(u=e.rejectionReason)?u:null),tv(q.AvatarSource.GENERATED),tb(null!=(m=e.imageGeneration)?m:null),(null==(i=e.imageGeneration)?void 0:i.style)&&eJ(e.imageGeneration.style),"generated"===e.kind&&eF(null!=(h=e.file)?h:null)),tj(null!=(p=e.resolvedNSFW)?p:null),td(null)},[tS,eF,e_,eO,eq,eG,eV,tv,tb,eJ,tj,td]),tK=(0,r.useCallback)((e,t)=>{var a,l;if(e===t)return;if(e>0&&t>0)return void tN(a=>{let l=e-1,r=t-1;if(l<0||l>=a.length||r<0||r>=a.length)return a;let n=(0,X.be)(a,l,r);return tk(ty,n),n});if(e>0&&0===t){let t=tw[e-1];(null==t?void 0:t.isObjectUrl)&&(URL.revokeObjectURL(t.previewUrl),tA.current.delete(t.previewUrl))}let r=tz(),n=[];if(r&&n.push(r),n.push(...tw),!n.length||e<0||e>=n.length||t<0||t>=n.length)return;let s=(0,X.be)(n,e,t),i=null!=(a=s[0])?a:null,o=s.slice(1);i?tq(i):tS(),tN(o),tk(null!=(l=null==i?void 0:i.resolvedNSFW)?l:null,o)},[tw,tz,tq,tS,tN,tk,ty,tA]);(0,r.useEffect)(()=>{tm("upload"===v.query.mode)},[v.query.mode]),(0,r.useEffect)(()=>{if(!v.isReady||j.current)return;let e=v.query.contest;if("string"!=typeof e)return;let t=(0,f.Ab)(e);if(!t||(0,y.Ay)(t)!==y.Kh.ENTRY)return;j.current=!0,M.current=t.entryTag;let a=(0,b.CW)(t.entryTag);eZ.some(e=>(0,b.CW)(e.name)===a)||(tx([...eZ,{name:t.entryTag}]),ea("Added the ".concat(t.entryTag," tag. This character will be entered in the contest.")))},[v.isReady,v.query.contest,eZ,tx]),(0,r.useEffect)(()=>
1{if(ei.trim().length>0){let e=(0,Y.RX)(ei);e.isValid||e.level!==Y.H$.BLOCKED?e.isValid||e.level!==Y.H$.RESTRICTED?(ed(null),em(Q.x.ERROR)):(ed(e.reason||"This title has restrictions."),em(Q.x.WARNING)):(ed(e.reason||"This title is not allowed."),em(Q.x.ERROR))}else ed(null),em(Q.x.ERROR)},[ei,ed,em]);let{generateCharacter:tG,isGenerating:tY}=(()=>{let[e,t]=(0,r.useState)(!1),{setGivenName:a,setAge:l}=(0,D.R)(),{addToast:n}=(0,W.Y)();return{generateCharacter:(0,r.useCallback)(async r=>{if(!e){t(!0);try{let e=.33>Math.random()?"male":"female",t=(0,_.Hcw)({gender:e}),n=(0,_.F2r)(),s="".concat(t," ").concat(n);a(t);let i=.7>Math.random()?Math.floor(10*Math.random())+20:.2>Math.random()?Math.floor(2*Math.random())+18:Math.floor(21*Math.random())+30;l(i);let o=e.toUpperCase(),c=(await T.K.post("/characters/generate/title",{customPrompt:{topic:r,givenName:t,fullName:s,age:i,gender:o}})).data.title,d=(await T.K.post("/characters/generate/description",{customPrompt:{topic:r,givenName:t,fullName:s,age:i,gender:o,title:c}})).data.description,u=Promise.all([T.K.post("/characters/generate/appearance",{customPrompt:{topic:r,givenName:t,fullName:s,age:i,gender:o,title:c,description:d}}),T.K.post("/characters/generate/personality",{customPrompt:{topic:r,givenName:t,fullName:s,age:i,gender:o,title:c,description:d}})]),[m,h]=await u,p=m.data.appearance,x=h.data.personality,g=Promise.all([T.K.post("/characters/generate/scenario",{customPrompt:{topic:r,givenName:t,fullName:s,age:i,gender:o,title:c,description:d,appearance:p,personality:x}}),T.K.post("/characters/generate/message-examples",{customPrompt:{topic:r,givenName:t,fullName:s,age:i,gender:o,title:c,description:d,appearance:p,personality:x}})]),[v,f]=await g,b=v.data.scenario,y=f.data.messageExamples;(await T.K.post("/characters/generate/first-message",{customPrompt:{topic:r,givenName:t,fullName:s,age:i,gender:o,title:c,description:d,appearance:p,personality:x,scenario:b,messageExamples:y}})).data.firstMessage}catch(e){console.error("Error generating character:",e),n("Something unexpected happened. Please try again.",{duration:5e3,type:"error"})}finally{t(!1)}}},[e,a,l,n]),isGenerating:e}})(),{generateImage:tV,isGenerating:tH}=(0,O.N)(),tJ=(0,L.H0)(eY,eK),tB=(0,r.useMemo)(()=>{let e=[];
1if(tW){let t=eW===q.AvatarStatus.UNDER_REVIEW||eK===q.AvatarReviewDecision.MANUAL_REVIEW_AI_PHOTO||eK===q.AvatarReviewDecision.MANUAL_REVIEW_REAL_PHOTO||!!ez;e.push({id:"primary",previewUrl:tW,isPrimary:!0,status:null!=eW?eW:null,manualReviewMessage:null!=ez?ez:null,reviewDecision:null!=eK?eK:null,rejectionReason:null!=eY?eY:null,rejectionCopy:tJ,requiresManualReview:t})}return tw.forEach((t,a)=>{var l,r,n,s,i,o;if(!t.previewUrl)return;let c=(0,L.H0)(null!=(l=t.rejectionReason)?l:null,null!=(r=t.reviewDecision)?r:null),d=!!t.requiresManualReview||t.status===q.AvatarStatus.UNDER_REVIEW||!!t.manualReviewMessage;e.push({id:t.id,previewUrl:t.previewUrl,isPrimary:!1,status:null!=(n=t.status)?n:null,manualReviewMessage:null!=(s=t.manualReviewMessage)?s:null,reviewDecision:null!=(i=t.reviewDecision)?i:null,rejectionReason:null!=(o=t.rejectionReason)?o:null,rejectionCopy:c,requiresManualReview:d,additionalId:t.id,additionalIndex:a})}),e},[tw,ez,tJ,eY,eK,eW,tW]),[tX,tQ]=(0,r.useState)(!1),[t$,tZ]=(0,r.useState)(x),[t0,t1]=(0,r.useState)(!1),t2=(0,r.useCallback)(e=>{null==e||e.preventDefault(),null==e||e.stopPropagation(),tQ(!0)},[]),t3=(0,r.useCallback)(()=>tQ(!1),[]);(0,r.useCallback)(async()=>{await tG(e3)},[tG,e3]);let t5=(0,r.useCallback)(async()=>{let e=null,t=null;return(await tV({prompt:e1,setFile:t=>{e=t},setError:e=>{e&&ea(e,{type:"error"})},style:tF,onSuccess:e=>{t=e},onInsufficientCredits:()=>t1(!0)}),e&&t)?{file:e,image:t,style:tF}:null},[e1,tF,tV,ea]),{handleSubmit:t8}=(()=>{let e=(0,n.useRouter)(),{givenName:t,setGivenName:a,age:l,setAge:r,title:s,setTitle:i,description:o,setDescription:c,appearance:d,setAppearance:u,personality:m,setPersonality:h,firstMessage:p,setFirstMessage:x,messageExamples:g,setMessageExamples:v,scenario:f,setScenario:b,creatorNotes:y,setCreatorNotes:j,isNSFWDescription:N,setIsNSFWDescription:A,isPrivate:k,setIsPrivate:C,isObfuscated:R,setIsObfuscated:E,avatarFile:S,avatarUploadId:I,avatarUploadStatus:U,avatarManualReviewMessage:M,avatarReviewDecision:P,avatarSource:F,setAvatarFile:L,setAvatarUploadId:_,setAvatarUploadStatus:W,setAvatarManualReviewMessage:O,setAvatarReviewDecision:z,setAvatarRejectionReason:q,avatarStyle:H,setAvatarStyle:J,gender:B,setGender:X,voice:Q,setVoice:$,characterTags:Z,setCharacterTags:ee,avatarImageGeneration:et,setAvatarImageGeneration:ea,avatarResolvedNSFW:el,setAvatarResolvedNSFW:er,creatorAvatars:en,setCreatorAvatars:es,setButtonText:ei,setFormError:eo,setIsLoading:ec,setIsSuccess:ed}=(0,D.R)();return{handleSubmit:async n=>{if(n.preventDefault(),ec(!0),eo(null),ei("Creating character..."),!(I||et||S||en.length>0)){ec(!1),eo("Your character needs at least one avatar. Use the image generator above to create one.");return}if(!t){ec(!1),eo("Please provide a name.");return}if(K.A.map(e=>e.toLowerCase()).includes(t.toLowerCase())){ec(!1),eo('The name "'.concat(t,'" is not allowed. Please choose a different name. Attempts to circumvent this restriction will result in account suspension.'));return}if(G.A.map(e=>e.toLowerCase()).includes(t.toLowerCase())){ec(!1),eo("Creating this type of character is not permitted on ".concat(w.yy,". Attempts to circumvent this restriction may affect your account standing."));return}if(!l){ec(!1),eo("Please provide an age.");return}if(s.trim().length>0){let e=(0,Y.RX)(s);if(!e.isValid&&e.level===Y.H$.BLOCKED){ec(!1),eo(e.reason||"This title is not allowed.");return}}try{let n=[],w=new Set,M=new Set,P=e=>{e&&(w.has(e)||(w.add(e),n.push({type:"uploaded",avatarId:e})))},K=e=>{e&&(M.has(e)||(M.add(e),n.push({type:"generated",imageGenerationId:e})))};
1I&&P(I),(null==et?void 0:et.id)&&K(et.id),en.forEach(e=>{"uploaded"===e.attachType?P(e.avatarId):"generated"===e.attachType&&K(e.imageGenerationId)});let G=new FormData,Y=!!I,el=!!(null==et?void 0:et.id);!Y&&!el&&S&&(G.append("avatarFile",S),F&&G.append("avatarSource",F)),G.append("givenName",t),l&&G.append("age",l.toString()),G.append("title",s),G.append("description",o),G.append("appearance",d),G.append("personality",m),G.append("scenario",f),G.append("firstMessage",p),G.append("messageExamples",g),G.append("creatorNotes",y),G.append("isNSFWDescription",N.toString()),G.append("isPrivate",k.toString()),G.append("isObfuscated",R.toString()),(null==H?void 0:H.id)&&G.append("avatarStyle",H.id),(null==B?void 0:B.id)&&G.append("gender",B.id),(null==Q?void 0:Q.id)&&G.append("voiceId",Q.id),G.append("characterTags",JSON.stringify(Z));let eu=await T.K.post("/characters",G,{headers:{"Content-Type":"multipart/form-data"},validateStatus:()=>!0});if(eu.status>=200&&eu.status<300){let t=eu.data;if(!(null==t?void 0:t.id))throw Error("Character response missing identifier.");if(n.length>0)try{ei("Attaching avatars..."),await T.K.post("/characters/".concat(t.id,"/avatars/attach/batch"),{attachments:n})}catch(e){var U,D;throw Error((null==e||null==(D=e.response)||null==(U=D.data)?void 0:U.message)||(null==e?void 0:e.message)||"Failed to attach avatar to character.")}ec(!1),eo(""),ed(!0),a(""),r(null),i(""),c(""),u(""),h(""),x(""),v(""),b(""),j(""),A(!1),C(!1),E(!1),L(null),_(null),W(null),O(null),z(null),q(null),ea(null),er(null),es([]),J(null),X(null),$(null),ee([]),setTimeout(()=>{e.push(V.J.character.profile({charId:t.id})),setTimeout(()=>ed(!1),2500)},2500)}else{let e=eu.data;throw Error((null==e?void 0:e.error)||(null==e?void 0:e.message)||"Failed to create character.")}}catch(e){ec(!1),ei(""),e instanceof Error&&e.message?eo(e.message):eo("Something unexpected occurred, please try again later.")}finally{ec(!1)}}}})();(0,r.useEffect)(()=>{if((null==P?void 0:P.id)&&(U.LQ||ee||a||U.Vb)){let e=new I.EventSourcePolyfill("".concat(T.Z,"/characters/generate/stream/").concat(P.id),{withCredentials:!0});return e.onmessage=e=>{let t=JSON.parse(e.data);U.LQ&&console.log("New message:",t),"title"===t.field?eo(t.content):"description"===t.field?(ef(t.content),setTimeout(()=>e4((0,u.A)()),0)):"appearance"===t.field?(ey(t.content),setTimeout(()=>e6((0,u.A)()),0)):"personality"===t.field?(ew(t.content),setTimeout(()=>te((0,u.A)()),0)):"scenario"===t.field?(eE(t.content),setTimeout(()=>ta((0,u.A)()),0)):"firstMessage"===t.field?(eA(t.content),setTimeout(()=>tr((0,u.A)()),0)):"messageExamples"===t.field?(Array.isArray(t.content)?eC("<START><br />".concat(t.content.join("<br /><START><br />"))):eC(t.content),setTimeout(()=>ts((0,u.A)()),0)):"tags"===t.field&&e0(e=>{let a=t.content?t.content.map(e=>({name:e})):[],l=M.current;return l&&e.some(e=>(0,b.CW)(e.name)===(0,b.CW)(l))&&!a.some(e=>(0,b.CW)(e.name)===(0,b.CW)(l))&&a.push({name:l}),a})},e.onerror=t=>{console.error("EventSource failed:",t),e.close()},()=>{e.close()}}},[null==P?void 0:P.id,U.LQ,ee,a,U.Vb]);let t4=(0,r.useCallback)(async e=>{var t,a,l,r,n,s,i;let o=e.kind===$.YC.Upload?(e=>{if(!(null==e?void 0:e.nudity))return null;let t=Z(e.nudity.explicit),a=Z(e.nudity.sexualActivity);return null===t&&null===a?null:(null!=t?t:0)>=.5||(null!=a?a:0)>=.5})(e.moderation):null;if(tU){if(e.kind===$.YC.Upload){let t=URL.createObjectURL(e.file);tC({kind:"upload",attachType:"uploaded",avatarId:e.avatarId,file:e.file,previewUrl:t,status:e.status,manualReviewMessage:null!=(r=e.manualReviewMessage)?r:null,reviewDecision:null!=(n=e.reviewDecision)?n:null,rejectionReason:null!=(s=e.rejectionReason)?s:null,requiresManualReview:!!e.requiresManualReview||e.status===q.AvatarStatus.UNDER_REVIEW,resolvedNSFW:o,isObjectUrl:!0})}else if(e.kind===$.YC.Library)(null==(i=e.image)?void 0:i.s3Key)&&tC({kind:"library",attachType:"generated",imageGeneration:e.image,imageGenerationId:e.image.id,previewUrl:"".concat(w.JM,"/").concat(e.image.s3Key),status:q.AvatarStatus.APPROVED,manualReviewMessage:null,reviewDecision:null,rejectionReason:null,requiresManualReview:!1,resolvedNSFW:null,isObjectUrl:!1});else if(e.kind===$.YC.Generated){let{file:t,image:a}=e.result;(null==a?void 0:a.s3Key)&&tC({kind:"generated",attachType:"generated",imageGeneration:a,imageGenerationId:a.id,file:t,previewUrl:"".concat(w.JM,"/").concat(a.s3Key),status:q.AvatarStatus.APPROVED,manualReviewMessage:null,reviewDecision:null,rejectionReason:null,requiresManualReview:!1,resolvedNSFW:o,isObjectUrl:!1})}}else if(e.kind===$.YC.Upload)tS(),await tE(e.file,{avatarId:e.avatarId,status:e.status,manualReviewMessage:null!=(t=e.manualReviewMessage)?t:null,reviewDecision:null!=(a=e.reviewDecision)?a:null,rejectionReason:null!=(l=e.rejectionReason)?l:null}),tj(null!=o?o:null),tk(null!=o?o:null,tw);else if(e.kind===$.YC.Library)tI(e.image),tj(null),tk(null,tw);else if(e.kind===$.YC.Generated){let{file:t,image:a,style:l}=e.result;tS(),eF(t),tv(q.AvatarSource.GENERATED),tb(a),td(null),eJ(l),tj(null!=o?o:null),tk(null!=o?o:null,tw)}return t3(),!0},[tC,tw,t3,tE,tI,tU,tS,td,eF,tb,tj,tv,eJ,tk]);return(0,r.useEffect)(()=>{tZ(x)},[x]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"pt-10 md:pt-20 px-5 md:px-0 max-w-[408px] mx-auto",children:[(0,l.jsx)("h1",{className:"font-softly text-4xl text-neutral-200 mb-16 -ml-[3px] whitespace-nowrap",children:tu?"Upload AI":"Character Creator"}),(0,l.jsxs)("form",{onSubmit:t8,className:"pb-32",children:[(0,l.jsx)("div",{className:"space-y-3 mb-8",children:(0,l.jsxs)("div",{children:[tu?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.A,{className:"mb-3",children:"Upload Character File"}),(0,l.jsx)(s.A,{size:"sm",className:"mb-5",children:"You can upload PNG v1 and v2 files."})]}):null,(0,l.jsx)(eh,{cards:tB,onAdd:t2,onRemovePrimary:tM,onRemoveSecondary:tD,onReorder:tK,isLoading:th})]})}),(0,l.jsx)("div",{className:"pb-2 transition-all duration-300 overflow-hidden ".concat(tc?"mb-6 max-h-20":"max-h-0"),children:tc&&(0,l.jsx)("div",{className:"text-red-500 text-xs",id:"avatar-error",children:tc})}),tu?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"char-designer-row",children:(0,l.jsx)(i.A,{id:"givenName",value:el,onChange:er,label:"Name",placeholder:"Character name",hasError:!!to})}),(0,l.jsx)("div",{className:"char-designer-row",children:(0,l.jsx)(h.A,{id:"age",value:en,onChange:es,label:"Age",placeholder:"Age",min:"18",step:"1",hasError:!!to,editable:!0})}),(0,l.jsxs)("div",{className:"char-designer-row",children:[(0,l.jsx)(s.A,{className:"mb-3",children:"Gender"}),(0,l.jsxs)("div",{className:"char-designer-row grid grid-cols-3 gap-3",children:[(0,l.jsx)(R.A,{id:"gender",state:eB,setState:eX,item:{id:"MALE",name:"Male"},type:"gender"}),(0,l.jsx)(R.A,{id:"gender",state:eB,setState:eX,item:{id:"FEMALE",name:"Female"},type:"gender"}),(0,l.jsx)(R.A,{id:"gender",state:eB,setState:eX,item:{id:"OTHER",name:"Other"},type:"gender"})]})]}),(0,l.jsxs)("div",{className:"char-designer-row",children:[(0,l.jsx)(i.A,{id:"title",value:ei,onChange:eo,label:"Title",placeholder:"Occupation / relationship to user",hasError:!!to||!!ec}),(0,l.jsx)(Q.A,{message:ec,severity:eu})]}),(0,l.jsx)("h2",{className:"font-softly text-3xl mt-32 mb-2 -ml-[3px]",children:"Character Description"}),(0,l.jsx)(s.A,{size:"sm",className:"mb-10",children:"Important: All individuals mentioned anywhere in the Character profile must be labeled with an explicit age over 18."}),(0,l.jsxs)("div",{className:"char-designer-row",children:[(0,l.jsx)(m.A,{editable:!0,id:"description",initialContent:ev,handleUpdate:ef,label:"Description",placeholder:"Character overview",hasError:!!to,className:"min-h-[140px]"},e8),(0,l.jsx)(F,{text:ev,removeHtml:!0})]}),(0,l.jsxs)("div",{className:"char-designer-row",children:[(0,l.jsx)(m.A,{editable:!0,id:"appearance",initialContent:eb,handleUpdate:ey,label:"Appearance",placeholder:"Physical attributes and preferred outfits",hasError:!!to,className:"min-h-[140px]"},e7),(0,l.jsx)(F,{text:eb,removeHtml:!0})]}),(0,l.jsxs)("div",{className:"char-designer-row",children:[(0,l.jsx)(m.A,{editable:!0,id:"personality",initialContent:ej,handleUpdate:ew,label:"Personality",placeholder:"Emotional, mental and interpersonal attributes",hasError:!!to,className:"min-h-[140px]"},e9),(0,l.jsx)(F,{text:ej,removeHtml:!0})]}),(0,l.jsxs)("div",{className:"char-designer-row rounded-xl high-res-border p-3.5 space-y-2",children:[(0,l.jsx)(s.A,{children:"Description Formatting"}),(0,l.jsx)("div",{className:"!text-neutral-500 text-xs leading-[22px]",children:"Don't use fancy formatting. Plain text works best."}),(0,l.jsx)("div",{className:"!text-neutral-500 text-xs leading-[22px]",children:"Longer character descriptions result in poorer character memory."}),(0,l.jsx)("div",{className:"!text-neutral-500 text-xs leading-[22px]",children:"Use {{user}} and {{char}} to replace text with your and your character's name."})]}),(0,l.jsx)("h2",{className:"font-softly text-3xl mt-32 mb-10 -ml-[3px]",children:"Chat Settings"}),(0,l.jsxs)("div",{className:"char-designer-row",children:[(0,l.jsx)(s.A,{className:"mb-1.5",children:"Scenario"}),(0,l.jsx)(s.A,{size:"sm",className:"mb-3",children:"This is how the roleplay begins."}),(0,l.jsx)(m.A,{editable:!0,id:"scenario",initialContent:eR,handleUpdate:eE,label:"",placeholder:"Where is the character meeting user?",hasError:!!to,className:"min-h-[140px]"},tt),(0,l.jsx)(F,{text:eR,removeHtml:!0})]}),(0,l.jsxs)("div",{className:"char-designer-row",children:[(0,l.jsx)(m.A,{editable:!0,id:"firstMessage",initialContent:eN,handleUpdate:eA,label:"First Message",placeholder:"What's the first thing the character says to user?",hasError:!!to,className:"min-h-[140px]"},tl),(0,l.jsx)(F,{text:eN,removeHtml:!0})]}),(0,l.jsxs)("div",{className:"char-designer-row",children:[(0,l.jsx)(s.A,{className:"mb-1.5",children:"Message Examples"}),(0,l.jsx)(s.A,{size:"sm",className:"mb-3",children:"Include samples of how your AI talks."}),(0,l.jsx)(m.A,{editable:!0,id:"messageExamples",initialContent:ek,handleUpdate:eC,label:"",placeholder:"Customize tone, manner of speech, spellings, etc.",hasError:!!to,className:"min-h-[140px]"},tn),(0,l.jsx)(F,{text:ek,removeHtml:!0})]}),(0,l.jsxs)("div",{className:"rounded-xl high-res-border p-3.5 space-y-2",children:[(0,l.jsx)(s.A,{children:"Chat Formatting"}),(0,l.jsx)("div",{className:"!text-neutral-500 text-xs leading-[22px]",children:"Don't use quotes for dialogue - plain text works best."}),(0,l.jsx)("div",{className:"!text-neutral-500 text-xs leading-[22px]",children:"Wrap character actions and scene exposition in asterisks to change its text color."}),(0,l.jsx)("div",{className:"!text-neutral-500 text-xs leading-[22px]",children:"Example:"}),(0,l.jsxs)("div",{className:"!text-neutral-500 text-xs leading-[22px]",children:[(0,l.jsx)("span",{className:"text-zinc-400 dark:text-fuchsia-800",children:"*"}),(0,l.jsx)("span",{className:"text-zinc-400 dark:text-fuchsia-500",children:"He held my hand gently"}),(0,l.jsx)("span",{className:"text-zinc-400 dark:text-fuchsia-800",children:"*"})," ",(0,l.jsx)("span",{className:"text-zinc-600 dark:text-neutral-200",children:"I'm so glad you're here"})]})]}),(0,l.jsxs)("div",{className:"mt-32 mb-32",children:[(0,l.jsx)("h2",{className:"font-softly text-3xl mt-32 mb-10",children:"AI Voice"}),(0,l.jsx)(E.A,{value:null!=(t=null==eQ?void 0:eQ.id)?t:null,onChange:e=>{if(e){let t=tP.find(t=>
1t.id===e);e$(null!=t?t:null)}else e$(null)}})]}),(0,l.jsxs)("div",{className:"mb-32",children:[(0,l.jsx)("h2",{className:"font-softly text-3xl mt-32 mb-1.5 -ml-[3px]",children:"Tags"}),(0,l.jsx)(s.A,{size:"sm",className:"mb-3",children:'Press "Enter" to save each tag.'}),(0,l.jsx)(p.A,{editable:!0,characterTags:eZ,handleUpdateTags:tx}),(0,l.jsx)(N,{characterTags:eZ,handleUpdateTags:tx})]}),(0,l.jsx)("div",{className:"pt-4",children:(0,l.jsxs)("div",{className:"mb-32",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,l.jsx)("h2",{className:"font-softly text-3xl",children:"Visibility"}),(null==P?void 0:P.plan)==="FREE"?(0,l.jsx)(g(),{href:"/plans",target:"_blank",children:(0,l.jsxs)("div",{className:"text-xs w-fit",style:{background:"linear-gradient(to right, #bdc3c7 0%, #505357 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:["Upgrade to ",w.yy," premium"]})}):(0,l.jsx)("div",{})]}),(0,l.jsx)(S.A,{isPrivate:eT,setIsPrivate:eU,isObfuscated:eD,setIsObfuscated:eM})]})})]}),(0,l.jsxs)("div",{className:"pt-8",children:[tu?null:(0,l.jsx)("div",{className:"pt-3 pb-3.5 px-4 mb-32 text-zinc-600 dark:text-neutral-400 high-res-border dark:bg-neutral-950 rounded-xl space-y-3 select-none",children:(0,l.jsxs)("div",{className:"text-xs leading-relaxed space-y-3",children:[(0,l.jsx)("div",{className:"font-softly text-2xl",children:"Community Guidelines"}),(0,l.jsxs)("div",{children:[w.yy," cares about providing a safe, healthy, and long-lasting community for you to explore new frontiers of AI companionship."]}),(0,l.jsxs)("div",{children:["We've outlined a few important rules below, but you must read and adhere to our full"," ",(0,l.jsx)(g(),{href:"/community-guidelines",target:"_blank",className:"underline",children:"Community Guidelines"}),"."]}),(0,l.jsxs)("ul",{className:"text-[11.5px] space-y-2 text-zinc-400 dark:text-neutral-300",children:[(0,l.jsx)("li",{children:"All scenarios must be consensual. Scenarios must not include mental or physical coercion, or feature influence based on age- or position-based authority."}),(0,l.jsx)("li",{children:"Your character must be over the age of 18, must not resemble a child, and must not be able to transform to resemble a child (e.g., wildcard, shapeshifter, god mod)."}),(0,l.jsx)("li",{children:"Scenarios must not include children or pregnancy. Ageplay and breeding is prohibited. All mentioned individuals must be labeled with their own specific age."}),(0,l.jsx)("li",{children:'Scenarios must not include educational institutions primarily catering to underage minors (e.g., high school, private school, academy). No mention of "school", "teacher", or "student" is permitted unless specified to be related to a university.'}),(0,l.jsx)("li",{children:"No beastiality. Characters of non-human species must be humanoid."})]}),(0,l.jsx)("div",{children:"Failure to adhere to our full Community Guidelines for public and private characters will result in character termination and account suspension without warning."}),(0,l.jsx)("div",{children:"Thank you for helping us keep our community's interests and its safety in the highest regard."}),(0,l.jsx)("div",{children:(0,l.jsx)(g(),{href:"/community-guidelines",target:"_blank",children:(0,l.jsxs)("div",{className:"flex items-center space-x-[2px] text-white hover:opacity-[0.8] transition-all",children:[(0,l.jsx)("span",{children:"Read our full Community Guidelines"}),(0,l.jsx)(d.c_$,{className:"e-icon",width:"12",height:"12",style:{transform:"translateY(1px)"}})]})})})]})}),(0,l.jsx)("div",{className:"flex justify-center text-xs text-center text-zinc-500 dark:text-neutral-400 px-4 leading-[1.5]",children:"All characters are reviewed before becoming publicly visible."}),(0,l.jsx)("div",{className:"pb-2 transition-all duration-300 overflow-hidden ".concat(to?"mb-14 max-h-20":"max-h-0"),children:to&&(0,l.jsx)("div",{className:"text-red-500 text-sm",id:"form-error",children:to})}),tu?null:(0,l.jsx)(o.A,{type:"submit",level:"premium",size:"medium",className:"w-full mt-2 mb-32 py-3.5",disabled:th||tp,isLoading:th,hasLoadingChildren:!0,children:th?(0,l.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,l.jsx)(c.A,{}),(0,l.jsxs)("span",{className:"flex items-center",children:[(0,l.jsx)("span",{children:"Creating character"}),(0,l.jsx)(A.A,{})]})]}):tp?(0,l.jsx)("span",{className:"pr-1",children:"\uD83C\uDF89 Character created!"}):"Create character"})]})]}),(0,l.jsxs)("div",{className:"e-highlight text-[13px] leading-[28px] text-neutral-50 pt-24 pb-12",children:[(0,l.jsx)("div",{className:"mb-2.5 text-4xl md:text-5xl font-extralight font-softly text-neutral-100",children:"Frequently Asked Questions"}),(0,l.jsx)(ex.A,{title:"How do I create an AI character on Erogen?",scrollId:"how-to-create",children:(0,l.jsx)("p",{children:"Start by giving your character a name, age, and gender, then write a description that captures who they are. Add details about their appearance and personality, set up an opening scenario and first message, and choose a voice. You can also generate or upload an avatar image using our built-in AI image generator. Once you're happy with the result, submit your character and they'll be ready to chat with after a brief review."})}),(0,l.jsx)("hr",{className:"high-res-border-t"}),(0,l.jsx)(ex.A,{title:"What can I customize when designing my AI companion?",scrollId:"what-can-i-customize",children:(0,l.jsx)("p",{children:"You can define their name, age, gender, occupation, and relationship to you. Write detailed descriptions covering their personality traits, physical appearance, and backstory. Set the opening scenario and first message to establish the tone of your roleplay. Add message examples to shape how they speak â their vocabulary, tone, and mannerisms. Choose from a selection of AI voices, add tags for discoverability, and set visibility to public or private."})}),(0,l.jsx)("hr",{className:"high-res-border-t"}),(0,l.jsx)(ex.A,{title:"Do I need technical skills to make a custom AI chatbot?",scrollId:"technical-skills-needed",children:(0,l.jsx)("p",{children:"Not at all. Erogen's character creator is designed for everyone. You write in plain text â no coding, no prompt engineering required. Just describe your character the way you'd describe them to a friend: who they are, what they look like, how they talk. The platform handles all the AI configuration behind the scenes."})}),(0,l.jsx)("hr",{className:"high-res-border-t"}),(0,l.jsx)(ex.A,{title:"Can I generate an AI avatar for my character?",scrollId:"generate-avatar",children:(0,l.jsx)("p",{children:"Yes. Erogen includes a built-in AI image generator that creates character avatars from text descriptions. Choose from multiple art styles â including realistic, anime, and illustrated o
1ptions â and describe what your character looks like. You can generate multiple images and pick the ones that best represent your character."})}),(0,l.jsx)("hr",{className:"high-res-border-t"}),(0,l.jsx)(ex.A,{title:"What makes a good AI character description?",scrollId:"good-character-description",children:(0,l.jsx)("p",{children:"The best character descriptions are specific and concise. Focus on the traits that make your character unique: their personality quirks, how they speak, what they care about, and how they relate to the user. Use plain text rather than fancy formatting. Include message examples that demonstrate your character's voice, vocabulary, and mannerisms â these have a big impact on how naturally your AI companion speaks."})}),(0,l.jsx)("hr",{className:"high-res-border-t"}),(0,l.jsx)(ex.A,{title:"Can I create NSFW or immersive AI characters?",scrollId:"nsfw-characters",children:(0,l.jsxs)("p",{children:["Yes â Erogen is built for immersive AI companionship, including romantic and intimate roleplay. You can create characters for adult scenarios and intimate conversations. All characters must comply with our"," ",(0,l.jsx)(g(),{href:"/community-guidelines",className:"text-purple-500",children:"Community Guidelines"}),", which require that all characters be over 18 and that all scenarios be consensual. Characters go through a review process before becoming publicly visible."]})}),(0,l.jsx)("hr",{className:"high-res-border-t"}),(0,l.jsx)(ex.A,{title:"What is the difference between public and private characters?",scrollId:"public-vs-private",children:(0,l.jsxs)("p",{children:["Public characters appear on Erogen's explore page where anyone can discover and chat with them. Private characters are only visible to you â perfect for personal companions you don't want to share."," ",(0,l.jsx)(g(),{href:"/plans",className:"text-purple-500",children:"Premium subscribers"})," ","can create private characters, while free users can create public ones."]})}),(0,l.jsx)("hr",{className:"high-res-border-t"}),(0,l.jsx)(ex.A,{title:"Can I edit my AI character after creating them?",scrollId:"edit-after-creating",children:(0,l.jsx)("p",{children:"Yes. You can return to your character's profile at any time to update their description, personality, appearance, scenario, first message, message examples, voice, tags, and visibility settings. You can also add, remove, or reorder avatar images. Changes take effect immediately in new conversations."})})]})]}),(0,l.jsx)(H.A,{open:t$,onClose:()=>tZ(!1),redirectPath:"/characters/new".concat((()=>{let e=new URLSearchParams;"string"==typeof v.query.mode&&e.set("mode",v.query.mode),"string"==typeof v.query.contest&&e.set("contest",v.query.contest);let t=e.toString();return t?"?".concat(t):""})())}),(0,l.jsx)($.Ay,{open:tX,onClose:t3,onSelect:t4,generationOptions:{prompt:e1,onPromptChange:e2,style:tF,onStyleChange:tL,onSubmit:t5,isSubmitting:tH},initialTab:$.r4.Generate,hideUpload:!w.oJ}),(0,l.jsx)(eg.A,{surface:"character_creator",open:t0,onClose:()=>t1(!1),userPlan:P.plan||q.Plan.FREE}),(0,l.jsx)(ep.A,{})]})}},79828:(e,t,a)=>{"use strict";a.d(t,{A:()=>x});var l=a(37876),r=a(14232),n=a(89099),s=a(48230),i=a.n(s),o=a(78645),c=a(50290),d=a(12721),u=a(30892),m=a(40385),h=a(19677),p=a(17432);let x=e=>{let{open:t,onClose:a,redirectPath:s,onLoginSuccess:x}=e,g=(0,n.useRouter)(),[v,f]=(0,r.useState)(""),[b,y]=(0,r.useState)(""),[j,w]=(0,r.useState)(null),[N,A]=(0,r.useState)(!1),k=(0,r.useRef)(null),{setUser:C}=(0,m.Jd)();(0,r.useEffect)(()=>{if(t){var e;null==(e=k.current)||e.focus()}},[t]);let R=async e=>{e.preventDefault();try{A(!0);let e=await h.K.post("/login",{email:v,password:b});C(e.data.user),a(),x&&x(),s&&g.push((0,p.rU)(s))}catch(e){w("Your credentials are incorrect. Please try again.")}finally{A(!1)}};return(0,l.jsxs)(o.A,{open:t,onClose:a,modalClassName:"md:max-w-md w-full md:w-fit",disableBackdropClose:!0,showCloseButton:!0,children:[(0,l.jsx)(c.A,{type:"button",onClick:()=>{g.push((0,p.qj)("/sign-up",null!=s?s:(0,p.aW)(g.asPath)))},size:"small",level:"secondary",className:"absolute top-5 right-14 flex items-center md:hidden",children:"Create account"}),(0,l.jsxs)("div",{className:"md:py-4 w-full min-h-[100vh] md:min-
1h-0 max-w-sm mx-auto md:max-w-auto md:w-96 flex flex-col justify-center md:block",children:[(0,l.jsx)("h1",{className:"mb-8 md:mb-8 font-softly font-light text-neutral-100 text-4xl",children:"Sign in"}),(0,l.jsxs)("form",{onSubmit:R,className:"space-y-8",noValidate:!0,children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(u.A,{htmlFor:"email",className:"text-md mb-3 block font-medium text-zinc-900 dark:text-neutral-300",children:"Email"}),(0,l.jsx)(d.A,{id:"email",value:v,ref:k,onChange:e=>{f(e),w(null)},name:"email",type:"email",autoComplete:"email",className:"text-md w-full rounded-lg px-3 py-4 text-input-subtle-shadow high-res-border focus:outline-none focus:ring-4 focus:ring-gray-100 ".concat(j?"border-red-200 focus:ring-red-200":""),required:!0})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(u.A,{htmlFor:"password",className:"text-md mb-3 block font-medium text-zinc-900 dark:text-neutral-300",children:"Password"}),(0,l.jsx)(d.A,{id:"password",value:b,onChange:e=>{y(e),w(null)},name:"password",type:"password",autoComplete:"current-password",className:"text-md w-full rounded-lg px-3 py-4 text-input-subtle-shadow high-res-border focus:outline-none focus:ring-4 focus:ring-gray-100 ".concat(j?"border-red-200 focus:ring-red-200":"")})]}),(0,l.jsxs)("div",{className:"pt-2",children:[(0,l.jsx)("div",{className:"pb-2 transition-all duration-300 overflow-hidden ".concat(j?"mb-6 max-h-20":"max-h-0"),children:j&&(0,l.jsx)("div",{className:"text-red-500 text-sm",id:"form-error",children:j})}),(0,l.jsx)(c.A,{type:"submit",size:"large",className:"w-full",disabled:N,isLoading:N,level:"primary",children:"Sign in"})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pt-2 md:justify-between",children:[(0,l.jsx)(i(),{href:(0,p.qj)("/sign-up",null!=s?s:(0,p.aW)(g.asPath)),className:"text-center text-sm text-zinc-900 dark:text-neutral-500 hidden md:block",children:"Create account"}),(0,l.jsx)(i(),{href:(0,p.qj)("/forgot-password",null!=s?s:(0,p.aW)(g.asPath)),className:"text-center text-sm text-zinc-900 dark:text-neutral-500 mx-auto md:mx-0",children:"Forgot password"})]})]})]})]})}},96391:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var l=a(37876),r=a(14232),n=a(3122),s=a(28006);let i=e=>{let{value:t,onChange:a}=e,{voices:i}=(0,n.N)(),o=(0,r.useMemo)(()=>[{value:"",label:"No voice"},...i.map(e=>({value:e.id,label:"".concat(e.name," â ").concat(e.title)}))],[i]),c=(0,r.useMemo)(()=>i.find(e=>e.id===t),[i,t]);return(0,l.jsxs)("div",{children:[(0,l.jsx)(s.A,{id:"voice",value:null!=t?t:"",onChange:e=>a(e||null),options:o,size:"sm"}),(null==c?void 0:c.description)?(0,l.jsx)("p",{className:"mt-2 text-xs text-neutral-500 leading-relaxed",children:c.description}):null]})}}},e=>{e.O(0,[5352,6361,3619,4587,2227,5711,9305,4287,9049,7466,4869,7204,875,5135,3353,5026,636,6593,8792],()=>e(e.s=43882)),_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.