1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5228],{5297:(e,t,r)=>{r.d(t,{W:()=>n});var a=r(31141);function i(e){return null==e?"null":Array.isArray(e)?"[".concat(e.map(i).join(","),"]"):"object"==typeof e?"{".concat(Object.keys(e).sort().map(t=>"".concat(JSON.stringify(t),":").concat(i(e[t]))).join(","),"}"):JSON.stringify(e)}function n(e){let[t,r]=(0,a.useState)(null),n=i(e),o=(0,a.useRef)(n);o.current=n,(0,a.useEffect)(()=>{if(!t)return;let e=i(t.value)===n,a=t.baselineKey!==n;(e||t.settled&&a)&&r(null)},[t,n]);let s=(0,a.useCallback)((e,t)=>{r({value:e,baselineKey:o.current,settled:!1}),Promise.resolve(t(e)).then(()=>r(t=>t&&i(t.value)===i(e)?{...t,settled:!0}:t),()=>r(t=>t&&i(t.value)===i(e)?null:t))},[]);return[t?t.value:e,s]}},7113:(e,t,r)=>{r.d(t,{I:()=>a});function a(e){if(!e)return"";let t=e.replace(/[0-9]/g,"").split(/[\s_-]+/).flatMap(e=>e.split(/(?=[A-Z])/).filter(Boolean)).filter(e=>e.length>0);return 0===t.length?e.charAt(0).toUpperCase():1===t.length?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[1].charAt(0)).toUpperCase()}},7957:(e,t,r)=>{r.d(t,{$q:()=>x,Dv:()=>f,Js:()=>h});var a=r(29729),i=r(31141),n=r(92487),o=r(68144),s=r(19010),l=r(47855),c=r(8397),d=r(3954),m=r(88655),u=r(37768);let p="data-vt";var g=r(20066);function h(){let{themeId:e,backgroundId:t,supported:r,withinSurface:a,setSurfacePreview:l,commitSurfacePreference:c}=(0,m.ec)(),{isAuthenticated:g}=(0,n.Z)(),h=(0,n.n_)(d.FH.users.updateSurfacePreferences),x=(0,i.useCallback)(e=>{c(e),g&&h(e).finally(()=>l({theme:void 0,background:void 0}))},[c,g,l,h]),f=(0,i.useCallback)((t,r)=>{if(t===e)return;let a=null==r?void 0:r.getBoundingClientRect();!function(e,t){let r="undefined"==typeof document?null:document;if(!r||"function"!=typeof r.startViewTransition||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t();let a=r.documentElement;if(e){let t=Math.hypot(Math.max(e.x,window.innerWidth-e.x),Math.max(e.y,window.innerHeight-e.y));a.style.setProperty("--vt-origin-x","".concat(e.x,"px")),a.style.setProperty("--vt-origin-y","".concat(e.y,"px")),a.style.setProperty("--vt-radius","".concat(t,"px"))}a.setAttribute(p,"surface-theme"),r.startViewTransition(()=>{(0,u.flushSync)(t)}).finished.catch(()=>{}).finally(()=>{a.removeAttribute(p),a.style.removeProperty("--vt-origin-x"),a.style.removeProperty("--vt-origin-y"),a.style.removeProperty("--vt-radius")})}(a?{x:a.left+a.width/2,y:a.top+a.height/2}:null,()=>l({theme:t})),x({theme:t})},[e,l,x]),y=(0,i.useCallback)(e=>{e!==t&&(l({background:e}),x({background:e}))},[t,l,x]),b="dark"===e?"light":"dark";return{themeId:e,backgroundId:t,nextTheme:b,supported:r&&a,setTheme:f,setBackground:y,flipLabel:"light"===b?"Switch to light theme":"Switch to dark theme",FlipIcon:"dark"===e?o.b:s.Z}}function x(e){let{label:t,options:r,value:i,onChange:n}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-1.5 text-[11px] font-satoshi-medium text-ink/50",children:t}),(0,a.jsx)("div",{className:"flex gap-[2px] rounded-[10px] bg-ink/[0.06] p-[3px]",children:r.map(e=>{let t=e.id===i;return(0,a.jsx)("button",{type:"button",onClick:()=>n(e.id),"aria-pressed":t,className:"flex-1 rounded-[7px] px-3 py-1.5 text-xs font-satoshi-medium transition-all duration-150 ".concat(t?"bg-ink/[0.10] text-[var(--color-text-primary)] shadow-sm":"text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]"),children:e.label},e.id)})})]})}function f(e){let{className:t=""}=e,{themeId:r,backgroundId:o,supported:s,setTheme:d,setBackground:m,nextTheme:u,flipLabel:p,FlipIcon:f}=h(),{isAuthenticated:y}=(0,n.Z)(),[b,v]=(0,i.useState)(!1),j=(0,i.useRef)(null),k=(0,i.useRef)(null),w=(0,i.useCallback)(()=>v(!1),[]);if(!s)return null;let N={flip:y?"rounded-l-full rounded-r-none":"rounded-full sm:rounded-l-full sm:rounded-r-none",divider:y?"block":"hidden sm:block",chevron:y?"flex":"hidden sm:flex"};return(0,a.jsxs)("div",{className:"shrink-0 ".concat(t),children:[(0,a.jsxs)("div",{ref:j,className:"inline-flex h-8 items-center rounded-full border border-ink/[0.08] bg-ink/[0.04] backdrop-blur-md transition-colors duration-200 hover:border-ink/[0.16]",children:[(0,a.jsx)("button",{ref:k,type:"button",onClick:()=>d(u,k.current),"aria-label":p,title:p,className:"flex h-8 w-8 items-center justify-center text-ink/60 transition-all duration-200 hover:bg-ink/[0.08] hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ink/25 active:scale-95 ".concat(N.flip),children:(0,a.jsx)(f,{className:"h-[17px] w-[17px]"})}
1),(0,a.jsx)("span",{"aria-hidden":!0,className:"h-3.5 w-px shrink-0 bg-ink/[0.10] ".concat(N.divider)}),(0,a.jsx)("button",{type:"button",onClick:()=>v(e=>!e),"aria-label":"Appearance options","aria-expanded":b,"aria-haspopup":"dialog",className:"h-8 w-7 items-center justify-center rounded-r-full text-ink/50 transition-all duration-200 hover:bg-ink/[0.08] hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ink/25 active:scale-95 ".concat(N.chevron),children:(0,a.jsx)(l.y,{className:"h-3.5 w-3.5 transition-transform duration-200 ".concat(b?"rotate-180":"")})})]}),(0,a.jsxs)(c.$w,{anchorRef:j,open:b,onClose:w,label:"Appearance",align:"end",className:"w-56 space-y-3 p-3",children:[(0,a.jsx)(x,{label:"Theme",options:g.r_,value:r,onChange:e=>d(e)}),(0,a.jsx)(x,{label:"Background",options:g.EA,value:o,onChange:m})]})]})}},8397:(e,t,r)=>{r.d(t,{$w:()=>c,Qg:()=>s,gf:()=>l});var a=r(29729),i=r(31141),n=r(88655);let o="rounded-xl bg-[var(--color-bg-panel)]/95 backdrop-blur-xl shadow-2xl",s="".concat(o," border border-ink/[0.08]"),l="".concat(o," border");function c(e){var t,r;let{anchorRef:o,open:l,onClose:c,label:d,align:m="end",className:u="",children:p}=e,g=(0,n.vp)(),h=(0,i.useRef)(null),[x,f]=(0,i.useState)(null),y=(0,i.useCallback)(()=>{var e,t,r;let a=null==(e=o.current)?void 0:e.getBoundingClientRect();if(!a)return;let i=null!=(r=null==(t=h.current)?void 0:t.offsetWidth)?r:0,n=Math.min(Math.max(8,"end"===m?a.right-i:a.left),Math.max(8,window.innerWidth-i-8));f({top:a.bottom+8,left:n})},[m,o]);return((0,i.useLayoutEffect)(()=>{l?y():f(null)},[l,y]),(0,i.useEffect)(()=>{if(!l)return;let e=()=>y();return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[l,y]),(0,i.useEffect)(()=>{if(!l)return;let e=e=>{var t,r;let a=e.target;(null==(t=h.current)||!t.contains(a))&&(null!=(r=o.current)&&r.contains(a)||c())},t=e=>{"Escape"===e.key&&c()};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[l,c,o]),l&&"undefined"!=typeof document)?g((0,a.jsx)("div",{ref:h,role:"dialog","aria-label":d,style:{top:null!=(t=null==x?void 0:x.top)?t:0,left:null!=(r=null==x?void 0:x.left)?r:0,visibility:x?"visible":"hidden"},className:"fixed z-[100] ".concat(s," ").concat(u),children:p}),document.body):null}},10202:(e,t,r)=>{r.d(t,{E:()=>C});var a=r(29729),i=r(31141),n=r(26148),o=r(8662),s=r(87991),l=r(17561),c=r(93415),d=r(28916),m=r(23135),u=r(5518),p=r(33764),g=r(47855),h=r(92487),x=r(3954),f=r(15952),y=r(95881),b=r(32435),v=r(62897),j=r(78118),k=r(89209),w=r(18383);let N="creator";function T(e,t){return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}let C=e=>{var t,r;let{isOpen:C,onClose:S,initialTab:P="collect"}=e,[F,E]=(0,i.useState)(!1),[L,R]=(0,i.useState)(null),[z,M]=(0,i.useState)("collect"),[D,A]=(0,i.useState)(N),[I,H]=(0,i.useState)(null),[B,_]=(0,i.useState)({hours:"00",minutes:"00",seconds:"00"}),[O,W]=(0,i.useState)(!1),[$,U]=(0,i.useState)(""),[G,q]=(0,i.useState)(!1),[V,J]=(0,i.useState)(null),{showUpgradeModal:Z}=(0,f.v)(),K=(0,h.IT)(x.FH.tokens.getFreeTokenStatus),Y=(0,h.IT)(x.FH.billing.tokenTopups.getTokenTopUpStatus),Q=(0,h.IT)(x.FH.billing.tokenTopups.listTokenPacks),X=(0,h.n_)(x.FH.tokens.collectFreeTokens),ee=(0,h.n_)(x.FH.promoCodes.redeemPromoCode),et=(0,h.y3)(x.FH.billing.tokenTopups.createTokenTopUp),er=(null==Y?void 0:Y.enabled)===!0,ea=er?z:"collect",ei=K?function(e,t){return e===t?"".concat(t):"".concat(e,"-").concat(t)}(K.tokenRange.min,K.tokenRange.max):"",en=null==Q?void 0:Q.find(e=>e.id===D);(0,i.useEffect)(()=>{if(!K||K.canCollect)return;let e=()=>{_(function(e){if(e<=0)return{hours:"00",minutes:"00",seconds:"00"};let t=Math.floor(e/1e3),r=Math.floor(t/3600),a=Math.floor(t%3600/60);return{hours:r.toString().padStart(2,"0"),minutes:a.toString().padStart(2,"0"),seconds:(t%60).toString().padStart(2,"0")}}(K.nextCollectionTime-Date.now()))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[K]),(0,i.useEffect)(()=>
1{void 0===Y||er||"buy"!==z||M("collect")},[z,Y,er]),(0,i.useEffect)(()=>{C&&M(P)},[P,C]),(0,i.useEffect)(()=>{var e;!Q||0===Q.length||Q.some(e=>e.id===D)||A((null!=(e=Q.find(e=>e.id===N))?e:Q[0]).id)},[D,Q]);let eo=async()=>{try{E(!0);let e=await X();R(e.tokensCollected),setTimeout(()=>{S(),R(null)},2e3)}catch(t){var e;E(!1),"COOLDOWN_ACTIVE"===(null==t||null==(e=t.data)?void 0:e.code)?y.oR.custom(e=>(0,a.jsx)(b.Zx,{title:"Not yet available",description:"Please wait for the cooldown to finish.",color:"error",onClose:()=>y.oR.dismiss(e)})):y.oR.custom(e=>(0,a.jsx)(b.Zx,{title:"Collection failed",description:"Something went wrong. Please try again.",color:"error",onClose:()=>y.oR.dismiss(e)}))}},es=async e=>{let t=null;try{if(!er)return void y.oR.custom(e=>(0,a.jsx)(b.Zx,{title:"Checkout unavailable",description:"Token purchases are temporarily unavailable.",color:"error",onClose:()=>y.oR.dismiss(e)}));H(e),t=(0,j.v4)();let r=(0,k.z)(),i=(0,w.cb)(window.location.host),n=(0,w.A_)(window.location.pathname,window.location.search),o=(0,w.ns)({returnCode:i,returnPath:n,type:"token_topup"}),s=(0,w.kc)({returnCode:i,returnPath:n,type:"token_topup"}),l=await r,c=await et({tokenPackId:e,successUrl:o,cancelUrl:s,...(0,k.p)(l)});(0,j.Mz)(t,c.url).leavesCurrentPage?(0,j.t8)(()=>H(null)):H(null)}catch(e){(0,j.x_)(t),console.error("Failed to create token top-up checkout:",e),H(null),y.oR.custom(e=>(0,a.jsx)(b.Zx,{title:"Checkout failed",description:"We could not start card checkout. Please try again.",color:"error",onClose:()=>y.oR.dismiss(e)}))}},el=()=>{E(!1),R(null),M("collect"),A(N),H(null),W(!1),U(""),J(null),S()},ec=async()=>{if($.trim())try{q(!0);let e=await ee({code:$.trim()});J(e.tokensAwarded),U(""),setTimeout(()=>{J(null),W(!1)},3e3)}catch(r){var e;let t=null==r||null==(e=r.data)?void 0:e.code;"INVALID_CODE"===t||"INVALID_FORMAT"===t?y.oR.custom(e=>(0,a.jsx)(b.Zx,{title:"Invalid code",description:"Please check your code and try again.",color:"error",onClose:()=>y.oR.dismiss(e)})):"ALREADY_REDEEMED"===t?y.oR.custom(e=>(0,a.jsx)(b.Zx,{title:"Already redeemed",description:"You've already used this promo code.",color:"error",onClose:()=>y.oR.dismiss(e)})):"CODE_EXPIRED"===t?y.oR.custom(e=>(0,a.jsx)(b.Zx,{title:"Code expired",description:"This promo code has expired.",color:"error",onClose:()=>y.oR.dismiss(e)})):"CODE_INACTIVE"===t?y.oR.custom(e=>(0,a.jsx)(b.Zx,{title:"Code inactive",description:"This promo code is no longer active.",color:"error",onClose:()=>y.oR.dismiss(e)})):y.oR.custom(e=>(0,a.jsx)(b.Zx,{title:"Failed to redeem",description:(0,v.Qf)(r,"mutation").description,color:"error",onClose:()=>y.oR.dismiss(e)}))}finally{q(!1)}};return C?(0,a.jsx)(n.mH,{isOpen:C,onOpenChange:el,isDismissable:!0,children:(0,a.jsx)(n.aF,{className:l.Ve,children:(0,a.jsx)(n.lG,{children:(0,a.jsxs)(l.Lj,{width:"form",className:"max-h-[90dvh] overflow-y-auto",children:[(0,a.jsx)("div",{className:"absolute top-3 right-3 sm:top-4 sm:right-4 z-10",children:(0,a.jsx)(s.J,{theme:"dark",size:"sm",onPress:el})}),(0,a.jsx)("div",{className:"relative px-4 pt-6 pb-5 sm:px-8 sm:pt-8 sm:pb-8",children:null!==L?(0,a.jsxs)("div",{className:"text-center py-6 sm:py-8",children:[(0,a.jsx)("div",{className:"flex justify-center mb-3 sm:mb-4",children:(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(l.wX,{icon:c.m,tone:"quiet"})})}),(0,a.jsxs)(l.L3,{job:"confirm",description:(0,a.jsx)(a.Fragment,{children:"Added to your balance"}),children:["+",L," tokens!"]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex justify-center mb-4 sm:mb-6",children:(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)("div",{className:"relative w-14 h-14 sm:w-16 sm:h-16 rounded-full bg-gradient-to-br from-white/[0.06] to-white/[0.02] border border-[var(--color-border-hairline)] flex items-center justify-center",children:(0,a.jsx)("img",{src:"/crystal.png",alt:"Tokens",className:"w-8 h-8 sm:w-10 sm:h-10 translate-y-[2px]"})})})}),(0,a.jsx)("div",{className:"text-center mb-4 sm:mb-6",children:(0,a.jsx)(l.L3,{job:"confirm",description:(0,a.jsx)(a.Fragment,{children:"buy"===ea?"Choose a pack and pay by card":(null==K?void 0:K.canCollect)?"Get ".concat(ei," free tokens"):"Come back later to collect more"}),children:"buy"===ea?"Buy tokens":(null==K?void 0:K.canCollect)?"Collect free tokens!":"Daily tokens"})}),er&&(0,a.jsx)("div",{className:"mb-4 sm:mb-5 grid grid-cols-2 gap-1 rounded-full border border-ink/10 bg-ink/5 p-1",children:[{id:"collect",label:"Collect"},{id:"buy",label:"Buy"}].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>M(e.id),"aria-pressed":ea===e.id,className:"h-9 rounded-full text-sm font-satoshi-medium transition-colors ".concat(ea===e.id?"bg-ink/12 text-[var(--color-text-primary)] shadow-sm":"text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)]"),children:e.label},e.id))}),"collect"===ea?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:gap-3 mb-4 sm:mb-6",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1.5 sm:gap-2 p-3 sm:p-4 roun
1ded-[20px] bg-ink/5 backdrop-blur-sm border border-ink/10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)("img",{src:"/crystal.png",alt:"Tokens",className:"w-5 h-5 sm:w-7 sm:h-7"}),(0,a.jsx)("span",{className:"text-2xl sm:text-3xl font-satoshi-bold text-[var(--color-text-primary)]",children:null!=(t=null==K?void 0:K.currentBalance)?t:0})]}),(0,a.jsx)("p",{className:"text-[10px] sm:text-xs text-[var(--color-text-tertiary)] font-satoshi-regular",children:"Current Balance"})]}),(0,a.jsx)("div",{className:"flex flex-col items-center justify-center gap-1.5 sm:gap-2 p-3 sm:p-4 rounded-[20px] bg-ink/5 backdrop-blur-sm border border-ink/10",children:(null==K?void 0:K.canCollect)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 sm:gap-1.5",children:[(0,a.jsx)(c.m,{className:"w-4 h-4 sm:w-5 sm:h-5 text-green-400"}),(0,a.jsx)("span",{className:"text-base sm:text-lg font-satoshi-bold text-green-400",children:"Ready!"})]}),(0,a.jsx)("p",{className:"text-[10px] sm:text-xs text-[var(--color-text-tertiary)] font-satoshi-regular",children:"Collect now"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-0.5 sm:gap-1 font-mono",children:[(0,a.jsx)("span",{className:"text-lg sm:text-xl font-bold text-[var(--color-text-primary)]",children:B.hours}),(0,a.jsx)("span",{className:"text-base sm:text-lg text-[var(--color-text-tertiary)]",children:":"}),(0,a.jsx)("span",{className:"text-lg sm:text-xl font-bold text-[var(--color-text-primary)]",children:B.minutes}),(0,a.jsx)("span",{className:"text-base sm:text-lg text-[var(--color-text-tertiary)]",children:":"}),(0,a.jsx)("span",{className:"text-lg sm:text-xl font-bold text-blue-400",children:B.seconds})]}),(0,a.jsx)("p",{className:"text-[10px] sm:text-xs text-[var(--color-text-tertiary)] font-satoshi-regular",children:"Next collection"})]})})]}),(0,a.jsxs)("div",{className:"space-y-2 sm:space-y-3",children:[(null==K?void 0:K.canCollect)&&(0,a.jsx)(o.$,{color:"white",size:"md",className:"w-full text-sm sm:text-base",onClick:eo,iconLeading:c.m,isDisabled:F,children:F?"Collecting...":"Collect ".concat(ei," tokens")}),!(null==K?void 0:K.canCollect)&&(0,a.jsxs)(o.$,{color:"secondary",size:"md",className:"w-full opacity-50 text-sm sm:text-base",isDisabled:!0,iconLeading:d.z,children:["Available in ",B.hours,"h"," ",B.minutes,"m"]}),(0,a.jsx)(o.$,{color:"hairline",size:"md",className:"w-full",onClick:()=>{S(),Z()},iconLeading:m.K,children:"Remove token limits"})]}),(0,a.jsx)("p",{className:"text-center text-[10px] sm:text-xs text-[var(--color-text-quaternary)] mt-3 sm:mt-4 font-satoshi-regular",children:"Free tokens reset every 22h"}),(0,a.jsx)("div",{className:"mt-4 sm:mt-5 pt-4 sm:pt-5 border-t border-ink/10",children:null!==V?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,a.jsx)("div",{className:"w-5 h-5 rounded-full bg-green-500/20 flex items-center justify-center",children:(0,a.jsx)(u.J,{className:"w-3 h-3 text-green-400"})}),(0,a.jsxs)("span",{className:"text-sm font-satoshi-medium text-green-400",children:["+",V," tokens added!"]})]}):O?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:$,onChange:e=>U(e.target.value.toUpperCase()),placeholder:"Enter code",maxLength:5,className:"flex-1 px-4 py-2 text-sm font-mono uppercase tracking-wider bg-ink/5 border border-ink/10 rounded-full text-[var(--color-text-primary)] placeholder:text-[var(--color-text-quaternary)] focus:outline-none focus:border-blue-400/50 focus:ring-1 focus:ring-blue-400/20 transition-colors",onKeyDown:e=>{"Enter"===e.key&&$.trim()&&ec()},autoFocus:!0}),(0,a.jsx)(o.$,{color:"secondary",size:"md",onClick:ec,isDisabled:G||!$.trim(),children:G?"...":"Apply"})]}),(0,a.jsxs)("a",{href:"https://discord.gg/uBdvtUGUTV",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-1.5 text-[11px] text-[var(--color-text-quaternary)] hover:text-[#5865F2] transition-colors group",children:[(0,a.jsx)("svg",{className:"w-3.5 h-3.5 text-[var(--color-text-quaternary)] group-hover:text-[#5865F2] transition-colors",fill:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M20.317 4.492c-1.53-.69-3.17-1.2-4.885-1.49a.075.075 0 0 0-.079.036c-.21.369-.444.85-.608 1.23a18.566 18.566 0 0 0-5.487 0 12.36 12.36 0 0 0-.617-1.23A.077.077 0 0 0 8.562 3c-1.714.29-3.354.8-4.885 1.491a.07.07 0 0 0-.032.027C.533 9.093-.32 13.555.099 17.9
161a.08.08 0 0 0 .031.055 20.03 20.03 0 0 0 5.993 2.98.078.078 0 0 0 .084-.026c.462-.62.874-1.275 1.226-1.963.021-.04.001-.088-.041-.104a13.201 13.201 0 0 1-1.872-.878.075.075 0 0 1-.008-.125c.126-.093.252-.19.372-.287a.075.075 0 0 1 .078-.01c3.927 1.764 8.18 1.764 12.061 0a.075.075 0 0 1 .079.009c.12.098.245.195.372.288a.075.075 0 0 1-.006.125c-.598.344-1.22.635-1.873.877a.075.075 0 0 0-.041.105c.36.687.772 1.341 1.225 1.962a.077.077 0 0 0 .084.028 19.963 19.963 0 0 0 6.002-2.981.076.076 0 0 0 .032-.054c.5-5.094-.838-9.52-3.549-13.442a.06.06 0 0 0-.031-.028zM8.02 15.278c-1.182 0-2.157-1.069-2.157-2.38 0-1.312.956-2.38 2.157-2.38 1.21 0 2.176 1.077 2.157 2.38 0 1.312-.956 2.38-2.157 2.38zm7.975 0c-1.183 0-2.157-1.069-2.157-2.38 0-1.312.955-2.38 2.157-2.38 1.21 0 2.176 1.077 2.157 2.38 0 1.312-.946 2.38-2.157 2.38z"})}),(0,a.jsx)("span",{children:"Get free codes weekly in Discord"}),(0,a.jsx)("span",{className:"opacity-0 group-hover:opacity-100 transition-opacity",children:"â"})]}),(0,a.jsxs)("button",{onClick:()=>{W(!1),U("")},className:"flex items-center justify-center gap-1 w-full text-xs text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors",children:[(0,a.jsx)(p.r,{className:"w-3 h-3"}),"Cancel"]})]}):(0,a.jsxs)("button",{onClick:()=>W(!0),className:"flex items-center justify-center gap-1.5 w-full text-xs text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors py-1",children:[(0,a.jsx)(c.m,{className:"w-3.5 h-3.5"}),"Have a promo code?",(0,a.jsx)(g.y,{className:"w-3 h-3"})]})})]}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-ink/10 bg-ink/5 p-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[11px] font-satoshi-medium uppercase text-[var(--color-text-quaternary)]",children:"Current balance"}),(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/crystal.png",alt:"Tokens",className:"h-6 w-6"}),(0,a.jsx)("span",{className:"text-xl font-satoshi-bold text-[var(--color-text-primary)]",children:null!=(r=null==K?void 0:K.currentBalance)?r:0})]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>M("collect"),className:"rounded-lg px-3 py-2 text-xs font-satoshi-medium text-[var(--color-text-tertiary)] transition-colors hover:bg-ink/8 hover:text-[var(--color-text-primary)]",children:"Collect free"})]}),void 0===Q?(0,a.jsx)("div",{className:"space-y-2",children:[0,1,2].map(e=>(0,a.jsx)("div",{className:"h-28 animate-pulse rounded-lg border border-ink/10 bg-ink/5"},e))}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{role:"radiogroup","aria-label":"Token pack",className:"space-y-2.5",children:Q.map(e=>{let t=e.id,r=D===t,i=!!I;return(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":r,onClick:()=>A(t),disabled:i,className:"w-full rounded-lg border p-4 text-left transition-colors focus:outline-none focus:ring-2 focus:ring-blue-400/40 ".concat(r?"border-blue-400/55 bg-blue-400/10":"border-ink/10 bg-ink/5 hover:border-ink/20 hover:bg-ink/7"," ").concat(i?"cursor-not-allowed opacity-70":"cursor-pointer"),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-base font-satoshi-bold text-[var(--color-text-primary)]",children:e.name}),e.badge&&(0,a.jsx)("span",{className:"rounded-full border border-blue-400/25 bg-blue-400/10 px-2 py-0.5 text-[10px] font-satoshi-medium uppercase text-blue-300",children:e.badge})]}),(0,a.jsx)("p",{className:"mt-1 text-xs font-satoshi-regular text-[var(--color-text-tertiary)]",children:e.description})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-start gap-3 text-right",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-satoshi-bold text-[var(--color-text-primary)]",children:T(e.amount,e.currency)}),(0,a.jsx)("p",{className:"text-[11px] text-[var(--color-text-quaternary)]",children:e.currency})]}),(0,a.jsx)("span",{className:"mt-1 flex h-5 w-5 items-center justify-center rounded-full border transition-colors ".concat(r?"border-blue-300 bg-blue-400 text-white":"border-ink/16 bg-ink/5"),children:r&&(0,a.jsx)(u.J,{className:"h-3 w-3"})})]})]}),(0,a.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/crystal.png",alt:"Tokens",className:"h-6 w-6"}),(0,a.jsxs)("span",{className:"text-sm font-satoshi-medium text-[var(--color-text-secondary)]",children:[e.tokens," tokens"]})]})]},e.id)})}),(0,a.jsx)(o.$,{color:"white",size:"md",className:"mt-3 w-full text-sm sm:text-base",iconLeading:m.K,onClick:()=>es(D),isLoading:!!I,showTextWhileLoading:!0,isDisabled:!!I||!en,children:en?"Continue - ".concat(T(en.amount,en.currency)):"Continue"})]}),(0,a.jsx)("p",{className:"text-center text-[10px] sm:text-xs text-[var(--color-text-quaternary)] font-satoshi-regular",children:"Tokens are credited after card payment confirmation."})]})]})})]})})})}):null}},13102:(e,t,r)=>{r.d(t,{_:()=>o});var a=r(29729),i=r(282),n=r(50928);function o(e){let{children:t,edgeInset:r="1.25rem",className:o}=e;return(0,a.jsxs)("div",{className:(0,i.cx)("relative overflow-hidden rounded-[20px] border border-[var(--color-border-hairline)] bg-ink/[0.02] px-5 py-4",o),children:[(0,a.jsx)(n.AX,{inset:r}),(0,a.jsx)("div",{className:"relative",children:t})]})}},14703:(e,t,r)=>{r.d(t,{SW:()=>s,qs:()=>c});let a=["contemporary","dark romance","billionaire","small town","workplace","sports romance","celebrity/rockstar","second chance","forbidden","marriage of convenience"],i=["boss/employee","best friend's sibling","exes reconnecting","forced proximity","contract arrangement","fake relationship","wedding party","late night encounter","neighbors","enemies to lovers","arranged marriage","brother's best friend","ex's sibling","bodyguard/client"],n=["boss/employee","best friend's sibling","exes reconnecting","forced proximity","contract arrangement","one night stand consequences","forbidden workplace","fake relationship","revenge hookup","wedding party","late night encounter","neighbors","secret affair","power imbalance","enemies to lovers","age gap","arranged marriage","professor/student","mafia/dangerous men","BDSM/dominance","stepbrother/stepsister","dad's best friend","brother's best friend","ex's sibling","therapist/client","best friend's dad","coach/athlete","bodyguard/client","doctor/p
1atient"],o=e=>e[Math.floor(Math.random()*e.length)];function s(e){return"".concat(o(a)," + ").concat(o(e?n:i))}let l=["A burned-out ER nurse who copes with dark humor and cheap whiskey","A centuries-old vampire who runs a late-night bookshop","A ruthless mafia boss with a weakness he can't afford","A shy bookworm named Lily who writes love letters she never sends"];function c(){return o(l)}},19114:(e,t,r)=>{r.d(t,{B:()=>f});var a=r(29729),i=r(31141),n=r(46474),o=r(92487),s=r(95881),l=r(3954),c=r(32435),d=r(62897),m=r(67847),u=r(14703),p=r(27194),g=r(50786),h=r(91959),x=r(35273);function f(e){let{isOpen:t,onClose:r,defaultMode:f="story"}=e,y=(0,n.useRouter)(),b=(0,o.n_)(l.FH.stories.create),v=(0,o.n_)(l.FH.characterEntities.generateFromDescription),j=(0,o.y3)(l.FH.ai.idea_v2.generate),k=(0,o.y3)(l.FH.ai.idea.generateFromTags_v2.generateFromTags),[w,N]=(0,i.useState)(f),[T,C]=(0,i.useState)(""),[S,P]=(0,i.useState)(!1),[F,E]=(0,i.useState)(!1),L=!0===(0,o.IT)(l.FH.ai.idea.ideasFromTags.poolAccess,t?{}:"skip"),R=(0,h.R)({clean:(0,m.v)().isCleanMode}),[z,M]=(0,i.useState)("write"),[D,A]=(0,i.useState)(!1);(0,i.useEffect)(()=>{t&&N(f)},[t,f]);let I=R.reset;(0,i.useEffect)(()=>{t&&(M("write"),I())},[t,I]);let H=(e,t)=>{let r=(0,d.Qf)(e);console.error("[start-something] ".concat(t,":"),r.technicalMessage,e),s.oR.custom(e=>(0,a.jsx)(c.Zx,{title:r.title,description:r.description,color:"error",onClose:()=>s.oR.dismiss(e)})),P(!1)},B=async()=>{let e=T.trim();
1if(e&&!S){if(P(!0),"character"===w){try{let t=await v({description:e});y.push("/characters/create/".concat(t))}catch(e){H(e,"character creation failed")}return}await _(e,D?"pool_edited":void 0)}},_=async(e,t)=>{P(!0);try{let r=await b({idea:e,isSpicy:!(0,m.v)().isCleanMode,writingMode:"director",...t?{ideaOrigin:t}:{}});y.push("/workshop/".concat(r))}catch(e){H(e,"story creation failed")}},O=async()=>{if(!S){if("character"===w)return void C((0,u.qs)());P(!0);try{let e=await j({input:(0,u.SW)(!(0,m.v)().isCleanMode)});C(e.idea),A(!1)}catch(e){H(e,"idea generation failed");return}P(!1)}},W=async e=>{E(!1),P(!0);try{let t=await k({selectedTags:e});C(t.idea)}catch(e){H(e,"idea from tags failed");return}P(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.y,{isOpen:t,onClose:()=>{S||r()},mode:w,onModeChange:N,value:T,onValueChange:e=>{C(e),0===e.trim().length&&A(!1)},onSubmit:B,onSurprise:O,onBrowseIdeas:"story"===w?()=>L?M(R.current?"ideas":"pool"):E(!0):void 0,browseIdeasLabel:L?"Find an idea":void 0,onBackToIdeas:L&&D&&"story"===w&&R.current?()=>M("ideas"):void 0,isBusy:S,pool:L&&"write"!==z?e=>(0,a.jsx)(g.w5,{pool:R,layout:e,step:"ideas"===z?"ideas":"pool",onStepChange:e=>M(e),onBack:()=>M("write"),onStart:e=>void _(e.idea,"pool"),onMakeItYours:e=>{C(e.idea),A(!0),N("story"),M("write")},isStarting:S}):void 0}),F&&(0,a.jsx)(p.x,{onSelect:W,onClose:()=>E(!1),isGenerating:S})]})}},20066:(e,t,r)=>{r.d(t,{$5:()=>c,Ce:()=>n,EA:()=>i,Fd:()=>s,TW:()=>o,ad:()=>l,ap:()=>d,cW:()=>g,ex:()=>x,fG:()=>p,r_:()=>a,tr:()=>h});let a=[{id:"dark",label:"Dark",className:"",tier:"free"},{id:"light",label:"Light",className:"surface-light",tier:"free"}],i=[{id:"gradient",label:"Gradient",tier:"free"},{id:"plain",label:"Plain",tier:"free"}],n="dark",o="gradient",s="nx_surface",l=31536e3;function c(e){if("string"!=typeof e||0===e.length)return null;let[t,r]=e.split(".");return m(t)&&u(r)?{theme:t,background:r}:null}function d(e){return"".concat(e.theme,".").concat(e.background)}function m(e){return a.some(t=>t.id===e)}function u(e){return i.some(t=>t.id===e)}function p(e){return m(e)?e:n}function g(e){return u(e)?e:o}function h(e){var t,r;let i=p(e);return null!=(r=null==(t=a.find(e=>e.id===i))?void 0:t.className)?r:""}function x(){return"undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("color","color-mix(in lab, red, red)")}},23119:(e,t,r)=>{r.d(t,{K:()=>d,m:()=>m});var a=r(29729),i=r(31141),n=r(10202),o=r(15952);let s=new Set,l=new Set,c=e=>(l.add(e),()=>{l.delete(e)});function d(){return(0,i.useSyncExternalStore)(c,()=>s.size>0,()=>!1)}function m(){let{showUpgradeModal:e,oneDoor:t,walletNudge:r}=(0,o.v)(),[c,d]=(0,i.useState)(!1),[m]=(0,i.useState)(()=>Symbol("balance-door"));(0,i.useEffect)(()=>{if(c)return s.add(m),l.forEach(e=>e()),()=>{s.delete(m),l.forEach(e=>e())}},[c,m]);let u=(0,i.useCallback)(()=>{t?e({context:"wallet"}):d(!0)},[t,e]),p=(0,a.jsx)(n.E,{isOpen:c,onClose:()=>d(!1)});return{open:u,isCollectOpen:c,modal:p,nudge:t&&r}}},27194:(e,t,r)=>{r.d(t,{x:()=>y});var a=r(29729),i=r(31141),n=r(26148),o=r(8662),s=r(17561),l=r(46677),c=r(30564),d=r(7075),m=r(32222),u=r(42332),p=r(47855),g=r(39179),h=r(67847);let x=["vibe","spice"];function f(e){return!x.includes(e.category)&&!e.isExplicit}function y(e){let{onSelect:t,onClose:r,isGenerating:y=!1}=e,v=(0,s.KQ)("form-edit"),[j,k]=(0,i.useState)([]),[w,N]=(0,i.useState)([]),[T,C]=(0,i.useState)(""),[S,P]=(0,i.useState)(new Set),{isCleanMode:F}=(0,h.v)(),E=e=>{j.includes(e)?k(j.filter(t=>t!==e)):j.length<5&&k([e,...j]),C("")},L=()=>{j.length>0&&t(j)},R=(0,i.useMemo)(()=>{let e=(0,l.Nn)();return F?Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return!x.includes(t)}).map(e=>{let[t,r]=e;return[t,r.filter(f)]})):e},[F]),z=(0,i.useMemo)(()=>{if(!T.trim())return null;let e=T.toLowerCase();return l.oe.filter(t=>{var r;return(!F||f(t))&&(t.name.toLowerCase().includes(e)||(null==(r=t.description)?void 0:r.toLowerCase().includes(e)))}).sort((e,t)=>(t.popularity||0)-(e.popularity||0))},[T,F]),M=j.map(e=>{if(e.startsWith("custom:")){let t=e.replace("custom:","");return{id:e,name:t,emoji:"â¨",category:"vibe",description:"Custom tag: ".concat(t),relatedTags:[]}}return l.oe.find(t=>
1t.id===e)}).filter(e=>void 0!==e),D=(0,i.useMemo)(()=>{if(0===j.length)return[];let e=M[0],t=new Map,r=new Set;return M.forEach(a=>{a.relatedTags.forEach(i=>{j.includes(i)||(t.set(i,(t.get(i)||0)+1),a.id===(null==e?void 0:e.id)&&r.add(i))})}),Array.from(t.entries()).map(e=>{let[t,a]=e;return{tag:l.oe.find(e=>e.id===t),relevance:a,isFromRecent:r.has(t)}}).filter(e=>e.tag&&(!F||f(e.tag))).sort((e,t)=>e.isFromRecent!==t.isFromRecent?e.isFromRecent?-1:1:e.relevance!==t.relevance?t.relevance-e.relevance:(t.tag.popularity||0)-(e.tag.popularity||0)).slice(0,12).map(e=>e.tag)},[j,M,F]),A=F?["fandom","trope","character","nationality","genre","setting"]:["fandom","trope","vibe","character","nationality","genre","setting","spice"];return(0,a.jsx)(n.mH,{isOpen:!0,onOpenChange:r,isDismissable:!y,children:(0,a.jsx)(n.aF,{className:s.Ve,children:(0,a.jsx)(n.lG,{children:(0,a.jsxs)(s.Lj,{width:v.width,layout:v.layout,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-(--color-border-secondary) px-4 sm:px-6 py-3 sm:py-4 shrink-0",children:[(0,a.jsx)("div",{children:(0,a.jsx)(s.L3,{job:v.title,align:"start",description:"Select tags to generate a personalized story idea",children:"Browse story ideas"})}),(0,a.jsx)("button",{type:"button",onClick:r,disabled:y,className:"text-(--color-text-tertiary) hover:text-(--color-text-secondary) transition-colors disabled:opacity-50",children:(0,a.jsx)(c.X,{className:"w-4 h-4 sm:w-5 sm:h-5"})})]}),(0,a.jsx)("div",{className:"px-6 py-3 shrink-0",children:(0,a.jsxs)("div",{className:"relative group",children:[(0,a.jsx)(d.g,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-(--color-text-quaternary) group-focus-within:text-(--color-fg-brand-primary) transition-colors"}),(0,a.jsx)("input",{type:"text",value:T,onChange:e=>C(e.target.value),placeholder:"Search tags or add custom...",className:"w-full pl-10 pr-4 py-2.5 bg-transparent border-b-2 border-(--color-border-secondary) text-(--color-text-primary) placeholder:text-(--color-text-quaternary) font-satoshi-regular text-sm focus:outline-none focus:border-(--color-fg-brand-primary) transition-all duration-200"})]})}),M.length>0&&(0,a.jsx)("div",{className:"px-6 py-3 shrink-0",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("div",{className:"flex gap-1.5 overflow-x-auto scrollbar-hide min-w-0 flex-1",children:M.map(e=>(0,a.jsxs)("button",{onClick:()=>{var t;return t=e.id,void k(j.filter(e=>e!==t))},className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-[var(--color-bg-brand-secondary)]/20 border border-[var(--color-fg-brand-primary)] text-[var(--color-fg-brand-primary)] hover:bg-[var(--color-bg-brand-secondary)]/30 transition-colors shrink-0",children:[(0,a.jsx)("span",{className:"text-sm",children:e.emoji}),(0,a.jsx)("span",{className:"text-xs font-satoshi-medium whitespace-nowrap",children:e.name}),(0,a.jsx)(m.X,{className:"w-3 h-3"})]},e.id))}),(0,a.jsx)("button",{onClick:()=>k([]),className:"text-xs font-satoshi-medium text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] transition-colors shrink-0",children:"Clear"})]})}),D.length>0&&!T&&(0,a.jsx)("div",{className:"px-4 sm:px-6 pt-3 sm:pt-6 pb-2 sm:pb-4 shrink-0",children:(0,a.jsxs)("div",{className:"relative rounded-lg sm:rounded-xl border border-(--color-border-brand) sm:border-2 bg-linear-to-br from-(--color-bg-brand-secondary)/10 to-(--color-bg-secondary)/30 p-2.5 sm:p-4 shadow-lg",children:[(0,a.jsx)("div",{className:"absolute inset-0 rounded-lg sm:rounded-xl bg-linear-to-br from-(--color-fg-brand-primary)/5 to-transparent pointer-events-none"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-sm sm:text-lg",children:"â¨"}),(0,a.jsx)("h3",{className:"text-xs sm:text-sm font-editors-note bg-clip-text text-transparent",style:{backgroundImage:"linear-gradient(to right, #ffaa40, #9c40ff, #ffaa40, #9c40ff, #ffaa40)",backgroundSize:"300% 100%",animation:"gradient 6s linear infinite"},children:"Suggested for You"})]}),(0,a.jsx)("div",{className:"flex gap-1.5 sm:gap-2 overflow-x-auto scrollbar-hide py-1 sm:py-1.5 -mx-0.5 sm:-mx-1 px-0.5 sm:px-1",children:D.map(e=>(0,a.jsxs)("button",{onClick:()=>E(e.id),disabled:!j.includes(e.id)&&j.length>=5,className:"\n shrink-0 px-2.5 sm:px-3 py-1.5 sm:py-2 rounded-lg border border-(--color-border-secondary)\n flex items-center gap-1.5 sm:gap-2\n disabled:opacity-40 disabled:cursor-not-allowed\n transition-all duration-200\n hover:scale-105\n active:scale-95\n ".concat(j.includes(e.id)?"bg-(--color-bg-brand-secondary)/20 shadow-[inset_0_0_0_2px_var(--color-fg-brand-primary)] scale-105":"bg-(--color-bg-secondary)/30 hover:shadow-[inset_0_0_0_2px_var(--color-border-brand)] hover:bg-(--color-bg-secondary)/50","\n "),children:[(0,a.jsx)("div",{className:"text-base sm:text-lg transition-transform duration-200 ".concat(j.includes(e.id)?"scale-110":""),children:e.emoji}),(0,a.jsx)("div",{className:"text-[11px] sm:text-xs font-satoshi-medium whitespace-nowrap transition-colors ".concat(j.includes(e.id)?"text-(--color-fg-brand-primary)":"text-(--color-text-primary)"),children:e.name}),j.includes(e.id)&&(0,a.jsx)("div",{className:"absolute top-1 right-1 w-3.5 h-3.5 rounded-full bg-[var(--color-fg-brand-primary)] flex items-center justify-center",children:(0,a.jsx)("svg",{className:"w-2 h-2 text-white",f
1ill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})})]},e.id))})]})]})}),(0,a.jsx)("div",{className:"px-6 py-6 overflow-y-auto flex-1",children:z?(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-satoshi-medium text-(--color-text-tertiary) uppercase tracking-wide mb-3",children:["Search Results (",z.length,")"]}),T.trim()&&j.length<5&&(0,a.jsxs)("button",{onClick:()=>{let e=T.trim();e&&j.length<5&&!w.includes(e)&&(N([e,...w]),k(["custom:".concat(e),...j]),C(""))},className:"w-full mb-4 p-3 rounded-lg border-2 border-dashed border-(--color-border-brand) bg-(--color-bg-brand-secondary)/10 hover:bg-(--color-bg-brand-secondary)/20 transition-colors flex items-center justify-center gap-2 group",children:[(0,a.jsx)(u.F,{className:"w-5 h-5 text-(--color-fg-brand-primary)"}),(0,a.jsxs)("span",{className:"text-sm font-satoshi-medium text-(--color-fg-brand-primary)",children:['Add custom tag "',T.trim(),'"']})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:z.map(e=>(0,a.jsx)(b,{tag:e,isSelected:j.includes(e.id),isDisabled:!j.includes(e.id)&&j.length>=5,onClick:()=>E(e.id)},e.id))}),0===z.length&&(0,a.jsx)("div",{className:"text-center py-12",children:(0,a.jsxs)("p",{className:"text-(--color-text-tertiary) font-satoshi-regular",children:['No tags found matching "',T,'"']})})]}):(0,a.jsx)("div",{className:"space-y-4",children:A.map(e=>{let t=R[e],r=S.has(e),i=r?t:t.slice(0,10),n=t.length>10,o=l.m3[e];return(0,a.jsxs)("div",{className:"category-section",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-lg",children:o.emoji}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-satoshi-bold text-[var(--color-text-primary)]",children:o.label}),(0,a.jsx)("p",{className:"text-xs text-[var(--color-text-tertiary)]",children:o.description})]})]}),n&&(0,a.jsxs)("button",{onClick:()=>(e=>{let t=new Set(S);t.has(e)?t.delete(e):t.add(e),P(t)})(e),className:"flex items-center gap-1 text-xs font-satoshi-medium text-[var(--color-fg-brand-primary)] hover:text-[var(--color-fg-brand-secondary)] transition-colors",children:[r?"Show less":"Show all (".concat(t.length,")"),(0,a.jsx)(p.y,{className:"w-4 h-4 transition-transform ".concat(r?"rotate-180":"")})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-2",children:i.map(e=>(0,a.jsx)(b,{tag:e,isSelected:j.includes(e.id),isDisabled:!j.includes(e.id)&&j.length>=5,onClick:()=>E(e.id)},e.id))})]},e)})})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 sm:gap-0 border-t border-(--color-border-secondary) px-6 py-4 shrink-0 bg-(--color-bg-primary) backdrop-blur-sm rounded-b-2xl",children:[(0,a.jsxs)("p",{className:"text-xs sm:text-sm text-(--color-text-tertiary) font-satoshi-regular text-center sm:text-left",children:[(0,a.jsx)("span",{className:"hidden sm:inline",children:0===j.length?"Select at least one tag to generate an idea":5===j.length?"Maximum tags selected":"".concat(j.length,"/5 tags selected")}),(0,a.jsxs)("span",{className:"sm:hidden",children:[j.length,"/5 tags"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 justify-center sm:justify-end",children:[(0,a.jsx)(o.$,{color:v.quiet,size:"md",onClick:r,isDisabled:y,children:"Cancel"}),j.length>0&&!y?(0,a.jsx)(o.$,{color:v.act,size:"md",onClick:L,iconLeading:g.I,children:"Generate Idea"}):(0,a.jsx)(o.$,{color:"primary",size:"md",onClick:L,isDisabled:!0,isLoading:y,iconLeading:g.I,children:"Generate Idea"})]})]})]})})})})}function b(e){let{tag:t,isSelected:r,isDisabled:i,onClick:n}=e;return(0,a.jsxs)("button",{onClick:n,disabled:i,className:"\n relative p-3 rounded-lg border border-(--color-border-secondary) text-center\n flex flex-col items-center gap-1.5\n disabled:opacity-40 disabled:cursor-not-allowed\n transition-all duration-200\n hover:scale-105 hover:-translate-y-0.5\n active:scale-95\n ".concat(r?"bg-(--color-bg-brand-secondary)/20 shadow-[inset_0_0_0_2px_var(--color-fg-brand-primary)] scale-105":"bg-(--color-bg-secondary)/30 hover:shadow-[inset_0_0_0_2px_var(--color-border-brand)] hover:bg-(--color-bg-secondary)/50","\n "),children:[r&&(0,a.jsx)("div",{className:"absolute top-1.5 right-1.5 w-4 h-4 rounded-full bg-[var(--color-fg-brand-primary)] flex items-center justify-center checkmark-appear",children:(0,a.jsx)("svg",{className:"w-2.5 h-2.5 text-white",f
1ill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,a.jsx)("div",{className:"text-2xl transition-transform duration-200 ".concat(r?"scale-110":""),children:t.emoji}),(0,a.jsx)("div",{className:"text-xs font-satoshi-medium leading-tight transition-colors ".concat(r?"text-[var(--color-fg-brand-primary)]":"text-[var(--color-text-primary)]"),children:t.name})]})}},35273:(e,t,r)=>{r.d(t,{y:()=>m});var a=r(29729),i=r(26148),n=r(87991),o=r(50928),s=r(17561),l=r(95709),c=r(77115),d=r(95942);function m(e){let{isOpen:t,onClose:r,pool:m,...u}=e,p=(0,c.d)("sm"),g=(0,c.d)("lg"),h=void 0!==m,x=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Ne,{spread:"card"}),(0,a.jsx)("div",{className:"absolute right-3 top-3 z-10 sm:right-4 sm:top-4",children:(0,a.jsx)(n.J,{theme:"dark",size:"sm",onPress:r})}),h?(0,a.jsx)("div",{className:"relative min-h-0 flex-1",children:m(p&&g?"split":"steps")}):(0,a.jsx)("div",{className:"relative px-4 pb-6 pt-6 sm:px-6 sm:pb-7 sm:pt-7",children:(0,a.jsx)(d.F,{...u})})]});return(0,a.jsx)(i.mH,{placement:p?"center":"sheet",isOpen:t,onOpenChange:e=>!e&&r(),isDismissable:!0,children:(0,a.jsx)(i.aF,{className:p?h?l.HW:void 0:h?void 0:"h-auto max-h-full",children:(0,a.jsx)(i.lG,{"aria-label":h?"Find an idea":"Start something new",className:h?p?"h-full items-stretch":"h-full":void 0,children:p?(0,a.jsx)(s.Lj,{width:h?(0,l.ud)(g):"form",layout:h?"stack":"block",className:h?"h-full":void 0,children:x}):(0,a.jsx)("div",{className:h?"relative flex h-full flex-col overflow-hidden rounded-t-[20px]":"relative overflow-hidden rounded-t-[20px]",children:x})})})})}},44078:(e,t,r)=>{r.d(t,{vm:()=>c,zA:()=>l});var a=r(92487),i=r(3954);let n=["[email protected]","[email protected]"],o=["[email protected]"];function s(e){var t;return null!=(t=null==e?void 0:e.trim().toLowerCase())?t:""}function l(e){return o.includes(s(e))}function c(){let e=(0,a.IT)(i.FH.users.getMyProfile),t=s(null==e?void 0:e.email);return n.includes(t)}},46677:(e,t,r)=>{r.d(t,{Nn:()=>o,k$:()=>n,m3:()=>s,oe:()=>i});let a=["contemporary","college","workplace","forbidden-love","slow-burn"],i=[{id:"harry-potter",name:"Harry Potter",emoji:"â¡",category:"fandom",description:"Wizarding world magic and romance",relatedTags:["draco-malfoy","tom-riddle","marauders","slytherin","gryffindor","hufflepuff","ravenclaw","hogwarts","room-of-requirement","forbidden-love","enemies-to-lovers","fantasy"],popularity:95,tier:1},{id:"anime",name:"Anime",emoji:"\uD83C\uDF65",category:"fandom",description:"Japanese animation-inspired stories",relatedTags:["isekai","naruto","demon-slayer","jujutsu-kaisen","haikyuu","fantasy","contemporary","college","enemies-to-lovers","forbidden-love"],popularity:90,tier:1},{id:"game-of-thrones",name:"Game of Thrones",emoji:"\uD83D\uDC09",category:"fandom",description:"Political intrigue and medieval fantasy",relatedTags:["fantasy","medieval","political-intrigue","arranged-marriage","forbidden-love","enemies-to-lovers","dark-romance"],popularity:85,tier:1},{id:"twilight",name:"Twilight",emoji:"\uD83C\uDF19",category:"fandom",description:"Vampire romance and supernatural drama",relatedTags:["vampire","werewolf","supernatural","forbidden-love","immortal","small-town","paranormal"],popularity:80,tier:1},{id:"star-wars",name:"Star Wars",emoji:"â",category:"fandom",description:"Space opera and galactic adventures",relatedTags:["sci-fi","space","enemies-to-lovers","forbidden-love","political-intrigue","jedi","sith"],popularity:75,tier:1},{id:"fantasy",name:"Fantasy",emoji:"â¨",category:"genre",description:"Magic, mythical creatures, fantastical worlds",relatedTags:["magic","wizard","witch","dragon","fae","elf","medieval","kingdom"],popularity:95,tier:1},{id:"contemporary",name:"Contemporary",emoji:"\uD83C\uDFD9ï¸",category:"genre",description:"Modern-day, realistic settings",relatedTags:["workplace","college","small-town","billionaire","celebrity","neighbor"],popularity:90,tier:1},{id:"paranormal",name:"Paranormal",emoji:"\uD83C\uDF19",category:"genre",description:"Supernatural beings in modern world",relatedTags:["vampire","werewolf","shifter","witch","demon","angel","supernatural"],popularity:88,tier:1},{id:"sci-fi",name:"Sci-Fi",emoji:"\uD83D\uDE80",category:"genre",description:"Space, technology, futuristic settings",relatedTags:["space","alien","cyborg","dystopian","time-travel","ai"],popularity:75},{id:"historical",name:"Historical",emoji:"\uD83D\uDCDC",category:"genre",description:"Perio
1d romance in historical settings",relatedTags:["regency","victorian","medieval","arranged-marriage","nobility","royalty"],popularity:70},{id:"urban-fantasy",name:"Urban Fantasy",emoji:"\uD83C\uDF03",category:"genre",description:"Magic and supernatural in modern cities",relatedTags:["magic","witch","vampire","werewolf","demon","hunter","contemporary"],popularity:85},{id:"enemies-to-lovers",name:"Enemies to Lovers",emoji:"âï¸",category:"trope",description:"Rivals who fall for each other",relatedTags:["tension","banter","rivalry","forbidden-love","slow-burn"],popularity:98},{id:"forced-proximity",name:"Forced Proximity",emoji:"\uD83D\uDEAA",category:"trope",description:"Stuck together in close quarters",relatedTags:["tension","one-bed","roommate","bodyguard","road-trip"],popularity:92},{id:"forbidden-love",name:"Forbidden Love",emoji:"\uD83D\uDEAB",category:"trope",description:"Relationship that breaks the rules",relatedTags:["taboo","secret-relationship","age-gap","boss-employee","teacher-student"],popularity:95},{id:"fake-relationship",name:"Fake Relationship",emoji:"\uD83D\uDC8D",category:"trope",description:"Pretending to date for mutual benefit",relatedTags:["contract","marriage-of-convenience","fake-dating","pretend"],popularity:90},{id:"second-chance",name:"Second Chance",emoji:"\uD83D\uDD04",category:"trope",description:"Exes reconnecting after time apart",relatedTags:["exes","reunion","healing","angst","regret"],popularity:85},{id:"slow-burn",name:"Slow Burn",emoji:"\uD83D\uDD25",category:"trope",description:"Gradual build-up of romantic tension",relatedTags:["tension","pining","friends-to-lovers","angst","longing"],popularity:88},{id:"love-triangle",name:"Love Triangle",emoji:"\uD83D\uDCD0",category:"trope",description:"Two love interests competing",relatedTags:["rivalry","choice","angst","drama","jealousy"],popularity:75},{id:"grumpy-sunshine",name:"Grumpy x Sunshine",emoji:"âï¸",category:"trope",description:"Opposites attract dynamic",relatedTags:["opposites-attract","banter","softening","character-growth"],popularity:87},{id:"friends-to-lovers",name:"Friends to Lovers",emoji:"\uD83D\uDC6B",category:"trope",description:"Best friends falling in love",relatedTags:["slow-burn","pining","realization","comfort","wholesome"],popularity:94},{id:"only-one-bed",name:"Only One Bed",emoji:"\uD83D\uDECFï¸",category:"trope",description:"Forced to share a bed",relatedTags:["forced-proximity","tension","accidental-touch","sexual-tension"],popularity:96},{id:"touch-her-and-die",name:"Touch Her and Die",emoji:"\uD83D\uDDE1ï¸",category:"trope",description:"Extremely protective love interest",relatedTags:["possessive","protective","jealousy","dominant","alpha"],popularity:91},{id:"obsession",name:"Obsession",emoji:"\uD83C\uDFAF",category:"trope",description:"Intense fixation and desire",relatedTags:["dark-romance","possessive","stalker","yandere","intense"],popularity:89},{id:"stalker-romance",name:"Stalker Romance",emoji:"\uD83D\uDC41ï¸",category:"trope",description:"Love interest who stalks",relatedTags:["dark-romance","obsession","possessive","watching","forbidden-love"],popularity:84},{id:"kidnapping",name:"Kidnapping",emoji:"\uD83D\uDD12",category:"trope",description:"Captive/captor romance",relatedTags:["dark-romance","forced-proximity","stockholm-syndrome","dubcon","power-imbalance"],popularity:82},{id:"arranged-marriage",name:"Arranged Marriage",emoji:"\uD83D\uDC90",category:"trope",description:"Forced marriage for alliance",relatedTags:["marriage-of-convenience","slow-burn","enemies-to-lovers","nobility","contract"],popularity:90},{id:"marriage-of-convenience",name:"Marriage of Convenience",emoji:"\uD83D\uDCDD",category:"trope",description:"Marriage for practical reasons",relatedTags:["contract","fake-relationship","slow-burn","forced-proximity"],popularity:88},{id:"rejected-mate",name:"Rejected Mate",emoji:"\uD83D\uDC94",category:"trope",description:"Fated mate rejection and redemption",relatedTags:["fated-mates","werewolf","second-chance","angst","grovel"],popularity:86},{id:"fated-mates",name:"Fated Mates",emoji:"â¨",category:"trope",description:"Destined soulmates",relatedTags:["soulmates","werewolf","shifter","omegaverse","bond","instant-attraction"],popularity:93},{id:"soulmates",name:"Soulmates",emoji:"\uD83D\uDCAB",category:"trope",description:"Destined to be together",relatedTags:["fated-mates","instant-connection","bond","meant-to-be"],popularity:87},{id:"secret-identity",name:"Secret Identity",emoji:"\uD83C\uDFAD",category:"trope",description:"Hidden identity revealed",relatedTags:["secret","reveal","betrayal","angst","trust-issues"],popularity:83},{id:"accidental-pregnancy",name:"Accidental Pregnancy",emoji:"\uD83C\uDF7C",category:"trope",description:"Unexpected pregnancy brings them together",relatedTags:["baby","surprise","responsibility","family","protective"],popularity:85},{id:"brother-best-friend",name:"Brother's Best Friend",emoji:"\uD83D\uDEAB",category:"trope",description:"Forbidden attraction to brother's friend",relatedTags:["forbidden-love","age-gap","protective","secret-relationship"],popularity:92},{id:"roommates",name:"Roommates",emoji:"\uD83C\uDFE0",category:"trope",description:"Living together leads to romance",relatedTags:["forced-proximity","friends-to-lovers","tension","domestic"],popularity:89},{id:"alpha",name:"Alpha",emoji:"\uD83D\uDC3A",category:"character",description:"Dominant alpha character",relatedTags:["omegaverse","werewolf","shifter","possessive","protective","dominant"],popularity:92},{id:"omega",name:"Omega",emoji:"\uD83C\uDF38",category:"character",description:"Omega character in omegaverse",relatedTags:["omegaverse","heat","mating","bonding","breeding"],popularity:88},{id:"vampire",name:"Vampire",emoji:"\uD83E\uDDDB",category:"character",description:"Immortal blood-drinker",relatedTags:["immortal","supernatural","paranormal","blood","dark","forbidden-love"],popularity:90},{id:"werewolf",name:"Werewolf",emoji:"\uD83D\uDC3A",category:"character",description:"Shapeshifter wolf",relatedTags:["shifter","pack","mate","supernatural","paranormal","alpha"],popularity:89},{id:"dragon-shifter",name:"Dragon Shifter",emoji:"\uD83D\uDC09",category:"character",description:"Dragon that can shift to human",relatedTags:["shifter","dragon","fantasy","mate","treasure","fire"],popularity:85},{id:"fae",name:"Fae",emoji:"\uD83E\uDDDA",category:"character",description:"Fairy/fae folk",relatedTags:["fantasy","magic","court","bargain","trickster","immortal"],popularity:87},{id:"demon",name:"Demon",emoji:"\uD83D\uDE08",category:"character",description:"Demonic entity",relatedTags:["supernatural","dar
1k","forbidden-love","deal","temptation"],popularity:82},{id:"alien",name:"Alien",emoji:"\uD83D\uDC7D",category:"character",description:"Extraterrestrial being",relatedTags:["sci-fi","space","different-biology","cultural-difference","mate"],popularity:78},{id:"billionaire",name:"Billionaire",emoji:"\uD83D\uDC8E",category:"character",description:"Wealthy, powerful character",relatedTags:["contemporary","power-imbalance","workplace","luxury","dominant"],popularity:88},{id:"mafia",name:"Mafia",emoji:"\uD83D\uDD2B",category:"character",description:"Organized crime member",relatedTags:["dark-romance","dangerous","forbidden-love","protective","possessive"],popularity:86},...[["american","American","\uD83C\uDDFA\uD83C\uDDF8",95],["japanese","Japanese","\uD83C\uDDEF\uD83C\uDDF5",94],["korean","Korean","\uD83C\uDDF0\uD83C\uDDF7",93],["british","British","\uD83C\uDDEC\uD83C\uDDE7",92],["french","French","\uD83C\uDDEB\uD83C\uDDF7",91],["italian","Italian","\uD83C\uDDEE\uD83C\uDDF9",90],["spanish","Spanish","\uD83C\uDDEA\uD83C\uDDF8",89],["mexican","Mexican","\uD83C\uDDF2\uD83C\uDDFD",88],["brazilian","Brazilian","\uD83C\uDDE7\uD83C\uDDF7",87],["indian","Indian","\uD83C\uDDEE\uD83C\uDDF3",86],["chinese","Chinese","\uD83C\uDDE8\uD83C\uDDF3",85],["turkish","Turkish","\uD83C\uDDF9\uD83C\uDDF7",84],["ukrainian","Ukrainian","\uD83C\uDDFA\uD83C\uDDE6",83],["russian","Russian","\uD83C\uDDF7\uD83C\uDDFA",82],["greek","Greek","\uD83C\uDDEC\uD83C\uDDF7",81],["irish","Irish","\uD83C\uDDEE\uD83C\uDDEA",80],["german","German","\uD83C\uDDE9\uD83C\uDDEA",79],["canadian","Canadian","\uD83C\uDDE8\uD83C\uDDE6",78],["australian","Australian","\uD83C\uDDE6\uD83C\uDDFA",77],["swedish","Swedish","\uD83C\uDDF8\uD83C\uDDEA",76],["polish","Polish","\uD83C\uDDF5\uD83C\uDDF1",75],["filipino","Filipino","\uD83C\uDDF5\uD83C\uDDED",74],["thai","Thai","\uD83C\uDDF9\uD83C\uDDED",73],["colombian","Colombian","\uD83C\uDDE8\uD83C\uDDF4",72]].map(e=>{let[t,r,i,n]=e;return function(e,t,r,i){return{id:"nationality-".concat(e),name:t,emoji:r,category:"nationality",description:"".concat(t," character background"),relatedTags:[...a],popularity:i}}(t,r,i,n)}),{id:"college",name:"College",emoji:"\uD83C\uDF93",category:"setting",description:"University/college campus",relatedTags:["contemporary","young-adult","new-adult","dorm","roommate","professor-student"],popularity:90},{id:"workplace",name:"Workplace",emoji:"\uD83D\uDCBC",category:"setting",description:"Office/work environment",relatedTags:["contemporary","boss-employee","coworker","power-imbalance","forbidden-love"],popularity:92},{id:"small-town",name:"Small Town",emoji:"\uD83C\uDFE1",category:"setting",description:"Cozy small-town setting",relatedTags:["contemporary","neighbor","community","second-chance","healing"],popularity:85},{id:"hogwarts",name:"Hogwarts",emoji:"\uD83C\uDFF0",category:"setting",description:"Magical school (Harry Potter)",relatedTags:["harry-potter","magic","school","wizard","witch","fantasy"],popularity:88},{id:"space",name:"Space",emoji:"\uD83C\uDF0C",category:"setting",description:"Outer space/spaceship",relatedTags:["sci-fi","alien","exploration","crew","isolation"],popularity:75},{id:"medieval",name:"Medieval",emoji:"âï¸",category:"setting",description:"Medieval/fantasy kingdom",relatedTags:["fantasy","historical","royalty","knight","kingdom","castle"],popularity:80},{id:"dark-romance",name:"Dark Romance",emoji:"\uD83D\uDDA4",category:"vibe",description:"Morally gray, intense romance",relatedTags:["obsession","possessive","anti-hero","forbidden-love","angst"],popularity:93},{id:"wholesome",name:"Wholesome",emoji:"\uD83D\uDCAB",category:"vibe",description:"Sweet, heartwarming stories",relatedTags:["fluffy","healing","comfort","soft","found-family"],popularity:78},{id:"spicy",name:"Spicy",emoji:"\uD83C\uDF36ï¸",category:"vibe",description:"Steamy, passionate romance",relatedTags:["steamy","passionate","sexual-tension","heat","desire"],popularity:95},{id:"angsty",name:"Angsty",emoji:"\uD83D\uDC94",category:"vibe",description:"Emotional pain and conflict",relatedTags:["angst","heartbreak","miscommunication","pining","emotional"],popularity:85},{id:"secret-sacrifice",name:"Secret Sacrifice",emoji:"\uD83E\uDD2B",category:"vibe",description:"He's been secretly helping/sacrificing for her",relatedTags:["hidden-devotion","angst","reveal","emotional"],popularity:92},{id:"hidden-devotion",name:"Hidden Devotion",emoji:"\uD83D\uDC9D",category:"vibe",description:"Quiet acts of love she doesn't know about",relatedTags:["secret-sacrifice","pining","angst","reveal"],popularity:90},{id:"grovel",name:"Grovel",emoji:"\uD83E\uDDCE",category:"vibe",description:"He has to beg for forgiveness",relatedTags:["redemption","angst","second-chance","emotional"],popularity:91},{id:"pining",name:"Pining",emoji:"\uD83D\uDCAD",category:"vibe",description:"Yearning for someone you can't have",relatedTags:["slow-burn","unrequited","angst","longing"],popularity:89},{id:"betrayal",name:"Betrayal",emoji:"\uD83D\uDDE1ï¸",category:"vibe",description:"Trust broken, relationship threatened",relatedTags:["angst","reveal","secrets","redemption"],popularity:88},{id:"redemption",name:"Redemption",emoji:"\uD83C\uDF05",category:"vibe",description:"Seeking forgiveness and change",relatedTags:["grovel","second-chance","morally-gray","healing"],popularity:89},{id:"found-family",name:"Found Family",emoji:"\uD83C\uDFE0",category:"vibe",description:"Chosen family bonds at stake",relatedTags:["protective","healing","wholesome","loyalty"],popularity:86},{id:"protector",name:"Protector",emoji:"\uD83D\uDEE1ï¸",category:"vibe",description:"Fierce protection, putting themselves in danger",relatedTags:["possessive","touch-her-and-die","sacrifice","danger"],popularity:90},{id:"unrequited",name:"Unrequited",emoji:"\uD83D\uDC94",category:"vibe",description:"Loving someone who doesn't know or reciprocate",relatedTags:["pining","angst","slow-burn","heartbreak"],popularity:85},{id:"sacrifice",name:"Sacrifice",emoji:"â°ï¸",category:"vibe",description:"Giving up something important for them",relatedTags:["secret-sacrifice","protector","angst","emotional"],popularity:87},{id:"jealousy",name:"Jealousy",emoji:"\uD83D\uDE20",category:"vibe",description:"Possessive jealousy that reveals feelings",relatedTags:["possessive","reveal","tension","love-triangle"],popularity:88},{id:"heartbreak",name:"Heartbreak",emoji:"\uD83D\uDC94",category:"vibe",description:"Past pain that shaped them",relatedTags:["angst","second-chance","healing","emotional"],popularity:84},{id:"healing",name:"Healing",emoji:"\uD83E\uDE79",category:"vibe",description:"Recovering from trauma together",relatedTags:["hurt-comfort","wholesome","found-family","emotional"],popularity:86},{id:"revenge",name:"Revenge",emoji:"\uD83D\uDD25",category:"vibe",description:"Seeking vengeance that c
1onflicts with love",relatedTags:["enemies-to-lovers","betrayal","dark-romance","morally-gray"],popularity:85},{id:"confession",name:"Confession",emoji:"\uD83D\uDC8C",category:"vibe",description:"Finally revealing hidden feelings",relatedTags:["reveal","pining","slow-burn","emotional"],popularity:87},{id:"protective-secret",name:"Protective Secret",emoji:"\uD83D\uDD10",category:"vibe",description:"Keeping secrets to protect them",relatedTags:["secret-sacrifice","angst","protector","reveal"],popularity:86},{id:"bdsm",name:"BDSM",emoji:"âï¸",category:"vibe",description:"Dominant/submissive dynamics",relatedTags:["dominant","submissive","power-exchange","kink","control"],popularity:87,isExplicit:!0},{id:"public-sex",name:"Public Sex",emoji:"\uD83C\uDF03",category:"vibe",description:"Sex in public or semi-public places",relatedTags:["exhibitionism","risk","voyeurism","thrill","forbidden"],popularity:86},{id:"exhibitionism",name:"Exhibitionism",emoji:"\uD83D\uDC40",category:"vibe",description:"Being watched during sex",relatedTags:["public-sex","voyeurism","showing-off","kink"],popularity:83},{id:"voyeurism",name:"Voyeurism",emoji:"\uD83D\uDD2D",category:"vibe",description:"Watching others during intimate moments",relatedTags:["exhibitionism","public-sex","watching","kink"],popularity:81},{id:"degradation",name:"Degradation",emoji:"\uD83D\uDDE3ï¸",category:"vibe",description:"Humiliation and degrading talk",relatedTags:["bdsm","dominant","submissive","dirty-talk","kink"],popularity:84},{id:"incest",name:"Incest",emoji:"\uD83D\uDEAB",category:"vibe",description:"Forbidden family taboo",relatedTags:["taboo","forbidden-love","secret-relationship","dark-romance","power-imbalance"],popularity:88,isExplicit:!0},{id:"taboo",name:"Taboo",emoji:"â",category:"vibe",description:"Forbidden, rule-breaking desire",relatedTags:["forbidden-love","incest","age-gap","secret-relationship","dark-romance"],popularity:91,isExplicit:!0},{id:"extreme",name:"Extreme",emoji:"\uD83D\uDD25",category:"vibe",description:"Intense, boundary-pushing romance",relatedTags:["dark-romance","brutal","punishment","bdsm","rough-sex"],popularity:87,isExplicit:!0},{id:"brutal",name:"Brutal",emoji:"\uD83D\uDCA5",category:"vibe",description:"Harsh, dangerous intensity",relatedTags:["dark-romance","extreme","rough-sex","punishment","mafia"],popularity:86,isExplicit:!0},{id:"punishment",name:"Punishment",emoji:"â",category:"vibe",description:"Discipline and consequence dynamics",relatedTags:["bdsm","spanking","power-exchange","dominant","brutal"],popularity:87,isExplicit:!0},{id:"praise-kink",name:"Praise Kink",emoji:"\uD83D\uDCAC",category:"vibe",description:"Arousal from praise and compliments",relatedTags:["validation","affirmation","good-girl","kink"],popularity:88},{id:"daddy-kink",name:"Daddy Kink",emoji:"\uD83D\uDC68",category:"vibe",description:"Daddy dom/little girl dynamic",relatedTags:["age-gap","dominant","caretaker","power-exchange","ddlg"],popularity:87},{id:"mommy-kink",name:"Mommy Kink",emoji:"\uD83D\uDC69",category:"vibe",description:"Mommy dom/caretaker dynamic",relatedTags:["dominant","caretaker","power-exchange","praise-kink","bdsm"],popularity:87},{id:"size-kink",name:"Size Kink",emoji:"\uD83D\uDCCF",category:"spice",description:"Size difference arousal",relatedTags:["size-difference","height-difference","manhandling","dominated"],popularity:91},{id:"primal-play",name:"Primal Play",emoji:"\uD83D\uDC3E",category:"spice",description:"Chase, hunt, animalistic sex",relatedTags:["chase","hunt","predator-prey","rough","werewolf","alpha"],popularity:85},{id:"bondage",name:"Bondage",emoji:"\uD83E\uDEA2",category:"spice",description:"Restraints and rope play",relatedTags:["bdsm","restraints","rope","control","helpless"],popularity:86},{id:"rough-sex",name:"Rough Sex",emoji:"\uD83D\uDCA5",category:"spice",description:"Aggressive, intense sex",relatedTags:["manhandling","passionate","intense","dominant","primal"],popularity:92,isExplicit:!0},{id:"hate-sex",name:"Hate Sex",emoji:"\uD83D\uDE24",category:"spice",description:"Angry, antagonistic sex",relatedTags:["enemies-to-lovers","anger","tension","rough","passion"],popularity:88,isExplicit:!0},{id:"dubcon",name:"Dubious Consent",emoji:"â ï¸",category:"vibe",description:"Questionable consent scenarios",relatedTags:["dark-romance","coercion","reluctance","power-imbalance"],popularity:79,isExplicit:!0},{id:"creampie",name:"Creampie",emoji:"\uD83D\uDCA6",category:"spice",description:"Internal ejaculation focus",relatedTags:["breeding","cum","messy","claiming"],popularity:89,isExplicit:!0},{id:"edging",name:"Edging",emoji:"â³",category:"spice",description:"Orgasm denial and control",relatedTags:["bdsm","control","dominant","teasing","torture"],popularity:83,isExplicit:!0}
1,{id:"overstimulation",name:"Overstimulation",emoji:"\uD83C\uDF0A",category:"spice",description:"Multiple or forced orgasms",relatedTags:["bdsm","control","dominant","intense","overwhelming"],popularity:85,isExplicit:!0},{id:"choking",name:"Choking",emoji:"\uD83E\uDD1A",category:"spice",description:"Breath play during sex",relatedTags:["bdsm","dominant","rough","control","kink"],popularity:87,isExplicit:!0},{id:"dirty-talk",name:"Dirty Talk",emoji:"\uD83D\uDC8B",category:"spice",description:"Explicit verbal communication",relatedTags:["filthy","degradation","praise","communication"],popularity:90,isExplicit:!0},{id:"multiple-partners",name:"Multiple Partners",emoji:"\uD83D\uDC65",category:"vibe",description:"Threesomes or group sex",relatedTags:["threesome","reverse-harem","sharing","group","mmf","mfm"],popularity:82},{id:"spanking",name:"Spanking",emoji:"â",category:"spice",description:"Impact play and punishment",relatedTags:["bdsm","dominant","discipline","punishment","pain-play"],popularity:88},{id:"oral-fixation",name:"Oral Fixation",emoji:"\uD83D\uDC45",category:"spice",description:"Focus on oral pleasure",relatedTags:["oral","blowjob","cunnilingus","face-sitting","worship"],popularity:91},{id:"anal",name:"Anal",emoji:"\uD83C\uDF51",category:"spice",description:"Anal sex and play",relatedTags:["taboo","preparation","stretching","first-time","forbidden"],popularity:84},{id:"double-penetration",name:"Double Penetration",emoji:"â¡",category:"spice",description:"Simultaneous penetration",relatedTags:["multiple-partners","threesome","intense","stretched","full"],popularity:80},{id:"toys",name:"Sex Toys",emoji:"\uD83C\uDF80",category:"spice",description:"Vibrators, dildos, and more",relatedTags:["vibrator","remote-control","public-play","teasing","orgasm"],popularity:86},{id:"blindfold",name:"Blindfold",emoji:"\uD83C\uDFAD",category:"spice",description:"Sensory deprivation",relatedTags:["bdsm","trust","heightened-senses","control","surprise"],popularity:85},{id:"begging",name:"Begging",emoji:"\uD83D\uDE4F",category:"spice",description:"Desperate pleas for pleasure",relatedTags:["desperation","denial","power-exchange","dominant","teasing"],popularity:89},{id:"squirting",name:"Squirting",emoji:"\uD83D\uDCA7",category:"spice",description:"Female ejaculation",relatedTags:["orgasm","intense","messy","overstimulation","pleasure"],popularity:87},{id:"cnc",name:"CNC",emoji:"\uD83C\uDFB2",category:"vibe",description:"Consensual non-consent roleplay",relatedTags:["dark-romance","dubcon","roleplay","resistance","fantasy"],popularity:81},{id:"somnophilia",name:"Somnophilia",emoji:"\uD83D\uDE34",category:"spice",description:"Sleep play with consent",relatedTags:["sleeping","waking-up","surprise","consent","trust"],popularity:78},{id:"sex-pollen",name:"Sex Pollen",emoji:"\uD83C\uDF3A",category:"vibe",description:"Aphrodisiac-induced desperation",relatedTags:["fuck-or-die","desperation","loss-of-control","intense","need"],popularity:83},{id:"virgin",name:"Virgin",emoji:"\uD83C\uDF1F",category:"vibe",description:"First time experience",relatedTags:["inexperienced","corruption","teaching","gentle","nervous"],popularity:86},{id:"corruption",name:"Corruption",emoji:"\uD83D\uDE07",category:"vibe",description:"Innocent to experienced",relatedTags:["virgin","teaching","seduction","awakening","forbidden"],popularity:85},{id:"mirror-sex",name:"Mirror Sex",emoji:"\uD83E\uDE9E",category:"spice",description:"Watching in mirror",relatedTags:["watching","visual","exhibitionism","self-awareness","hot"],popularity:84},{id:"phone-sex",name:"Phone Sex",emoji:"\uD83D\uDCF1",category:"spice",description:"Dirty talk over phone",relatedTags:["dirty-talk","long-distance","voice","audio","teasing"],popularity:79},{id:"shower-sex",name:"Shower Sex",emoji:"\uD83D\uDEBF",category:"spice",description:"Water and steam",relatedTags:["wet","slippery","steamy","spontaneous","domestic"],popularity:87},{id:"car-sex",name:"Car Sex",emoji:"\uD83D\uDE97",category:"spice",description:"Cramped and risky",relatedTags:["public","risky","spontaneous","teenage","forbidden"],popularity:85},{id:"morning-sex",name:"Morning Sex",emoji:"\uD83C\uDF05",category:"spice",description:"Lazy morning intimacy",relatedTags:["sleepy","soft","domestic","intimate","slow"],popularity:82},{id:"makeup-sex",name:"Makeup Sex",emoji:"\uD83D\uDCA2",category:"vibe",description:"After fighting",relatedTags:["anger","passion","reconciliation","intense","emotions"],popularity:86},{id:"against-wall",name:"Against Wall",emoji:"\uD83E\uDDF1",category:"spice",description:"Pinned and taken",relatedTags:["dominant","strength","desperate","rough","manhandling"],popularity:90},{id:"desk-sex",name:"Desk Sex",emoji:"\uD83D\uDDA5ï¸",category:"spice",description:"Office desk quickie",relatedTags:["workplace","risky","boss-employee","forbidden","urgent"],popularity:88},{id:"teasing",name:"Teasing",emoji:"\uD83D\uDE0F",category:"vibe",description:"Slow seduction",relatedTags:["anticipation","denial","buildup","frustration","playful"],popularity:89},{id:"face-sitting",name:"Face Sitting",emoji:"\uD83E\uDE91",category:"spice",description:"Oral with dominance",relatedTags:["oral","dominant","worship","pleasure","smothering"],popularity:83},{id:"body-worship",name:"Body Worship",emoji:"\uD83D\uDE4C",category:"spice",description:"Adoration and devotion",relatedTags:["praise","reverence","kissing","touching","worship"],popularity:84},{id:"lactation",name:"Lactation",emoji:"\uD83C\uDF7C",category:"spice",description:"Breast milk kink",relatedTags:["pregnancy","breasts","nursing","taboo","nurturing"],popularity:74},{id:"mating-press",name:"Mating Press",emoji:"\uD83D\uDD25",category:"spice",description:"Deep breeding position",relatedTags:["breeding","deep","intense","primal","claiming"],popularity:88},{id:"thigh-riding",name:"Thigh Riding",emoji:"\uD83E\uDDB5",category:"spice",description:"Grinding on thigh",relatedTags:["desperate","friction","teasing","dominant","clothed"],popularity:87},{id:"clothed-sex",name:"Clothed Sex",emoji:"\uD83D\uDC54",category:"spice",description:"Parti
1ally or fully clothed",relatedTags:["urgent","desperate","risky","public","quick"],popularity:85},{id:"lingerie",name:"Lingerie",emoji:"\uD83D\uDC59",category:"spice",description:"Sexy underwear",relatedTags:["visual","seduction","tease","anticipation","revealing"],popularity:86},{id:"knife-play",name:"Knife Play",emoji:"\uD83D\uDD2A",category:"vibe",description:"Edge play with blades",relatedTags:["dark-romance","bdsm","danger","fear-play","trust"],popularity:76},{id:"blood-play",name:"Blood Play",emoji:"\uD83E\uDE78",category:"vibe",description:"Vampire biting or cutting",relatedTags:["vampire","dark-romance","biting","marking","taboo"],popularity:77},{id:"temperature-play",name:"Temperature Play",emoji:"\uD83E\uDDCA",category:"spice",description:"Ice and heat",relatedTags:["bdsm","sensory","teasing","torture","sensation"],popularity:80},{id:"glory-hole",name:"Glory Hole",emoji:"\uD83D\uDD73ï¸",category:"spice",description:"Anonymous encounters",relatedTags:["anonymous","public","oral","risky","voyeurism"],popularity:73},{id:"slytherin",name:"Slytherin",emoji:"\uD83D\uDC0D",category:"fandom",description:"Slytherin house (Harry Potter)",relatedTags:["harry-potter","hogwarts","ambitious","cunning","dark-academia"],popularity:85},{id:"gryffindor",name:"Gryffindor",emoji:"\uD83E\uDD81",category:"fandom",description:"Gryffindor house (Harry Potter)",relatedTags:["harry-potter","hogwarts","brave","hero","opposites-attract"],popularity:83},{id:"hufflepuff",name:"Hufflepuff",emoji:"\uD83E\uDDA1",category:"fandom",description:"Hufflepuff house (Harry Potter)",relatedTags:["harry-potter","hogwarts","loyal","kind","grumpy-sunshine"],popularity:79},{id:"ravenclaw",name:"Ravenclaw",emoji:"\uD83E\uDD85",category:"fandom",description:"Ravenclaw house (Harry Potter)",relatedTags:["harry-potter","hogwarts","intelligent","witty","banter"],popularity:78},{id:"marauders",name:"Marauders Era",emoji:"\uD83C\uDF19",category:"fandom",description:"1970s Hogwarts (James, Sirius, Remus)",relatedTags:["harry-potter","hogwarts","friendship","angst","tragedy","werewolf"],popularity:91},{id:"death-eater",name:"Death Eater",emoji:"\uD83D\uDC80",category:"fandom",description:"Dark wizard followers of Voldemort",relatedTags:["harry-potter","dark-romance","forbidden-love","enemies-to-lovers","obsession"],popularity:86},{id:"draco-malfoy",name:"Draco Malfoy",emoji:"\uD83C\uDF4F",category:"fandom",description:"Slytherin prince archetype",relatedTags:["harry-potter","slytherin","enemies-to-lovers","redemption","angst","rich"],popularity:93},{id:"severus-snape",name:"Severus Snape",emoji:"\uD83E\uDDEA",category:"fandom",description:"Potions master, morally gray",relatedTags:["harry-potter","age-gap","teacher-student","dark","obsession","angst"],popularity:84},{id:"tom-riddle",name:"Tom Riddle",emoji:"\uD83D\uDC0D",category:"fandom",description:"Young Voldemort",relatedTags:["harry-potter","dark-romance","obsession","time-travel","morally-gray","manipulation"],popularity:89},{id:"fred-weasley",name:"Fred Weasley",emoji:"\uD83C\uDF86",category:"fandom",description:"Prankster twin",relatedTags:["harry-potter","gryffindor","playful","friends-to-lovers","wholesome","angst"],popularity:82},{id:"george-weasley",name:"George Weasley",emoji:"â¨",category:"fandom",description:"Prankster twin",relatedTags:["harry-potter","gryffindor","playful","friends-to-lovers","wholesome","angst"],popularity:81},{id:"sirius-black",name:"Sirius Black",emoji:"\uD83D\uDC3E",category:"fandom",description:"Rebel from noble family",relatedTags:["harry-potter","marauders","bad-boy","tragic","protective","angst"],popularity:87},{id:"remus-lupin",name:"Remus Lupin",emoji:"\uD83C\uDF15",category:"fandom",description:"Werewolf professor",relatedTags:["harry-potter","marauders","werewolf","teacher-student","gentle","angst"],popularity:86},{id:"veritaserum",name:"Veritaserum",emoji:"\uD83D\uDCA7",category:"fandom",description:"Truth serum (HP)",relatedTags:["harry-potter","truth-reveal","confession","secrets","angst"],popularity:79},{id:"amortentia",name:"Amortentia",emoji:"\uD83D\uDC95",category:"fandom",description:"Love potion (HP)",relatedTags:["harry-potter","potion","soulmates","reveal","confession"],popularity:80}
1,{id:"polyjuice",name:"Polyjuice Potion",emoji:"\uD83E\uDDC9",category:"fandom",description:"Identity swap potion (HP)",relatedTags:["harry-potter","identity-swap","secret-identity","deception","reveal"],popularity:76},{id:"yule-ball",name:"Yule Ball",emoji:"\uD83D\uDC83",category:"fandom",description:"Hogwarts formal dance",relatedTags:["harry-potter","hogwarts","formal","dancing","romance","jealousy"],popularity:81},{id:"triwizard",name:"Triwizard Tournament",emoji:"\uD83C\uDFC6",category:"fandom",description:"Magical competition (HP)",relatedTags:["harry-potter","hogwarts","competition","danger","protective"],popularity:77},{id:"dark-mark",name:"Dark Mark",emoji:"â ï¸",category:"fandom",description:"Death Eater tattoo (HP)",relatedTags:["harry-potter","death-eater","dark","forbidden-love","angst"],popularity:78},{id:"patronus",name:"Patronus",emoji:"\uD83E\uDD8C",category:"fandom",description:"Protective spell (HP)",relatedTags:["harry-potter","magic","soulmates","protection","reveal"],popularity:82},{id:"horcrux",name:"Horcrux",emoji:"\uD83D\uDC8E",category:"fandom",description:"Soul container (HP)",relatedTags:["harry-potter","dark-magic","soul-bond","obsession","dark"],popularity:75},{id:"room-of-requirement",name:"Room of Requirement",emoji:"\uD83D\uDEAA",category:"fandom",description:"Secret magical room (HP)",relatedTags:["harry-potter","hogwarts","secret","hidden","forced-proximity"],popularity:80},{id:"quidditch",name:"Quidditch",emoji:"\uD83E\uDDF9",category:"fandom",description:"Magical flying sport (HP)",relatedTags:["harry-potter","hogwarts","sports","rivalry","competition"],popularity:79},{id:"ministry-of-magic",name:"Ministry of Magic",emoji:"\uD83C\uDFDBï¸",category:"fandom",description:"Wizarding government (HP)",relatedTags:["harry-potter","workplace","political","power","adult"],popularity:74},{id:"isekai",name:"Isekai",emoji:"\uD83D\uDEAA",category:"fandom",description:"Transported to another world (anime)",relatedTags:["anime","fantasy","overpowered","reincarnation","game-world"],popularity:83},{id:"omegaverse",name:"Omegaverse",emoji:"\uD83D\uDD3A",category:"fandom",description:"Alpha/Beta/Omega dynamics",relatedTags:["alpha","omega","heat","mating","bonding","breeding"],popularity:90},{id:"acotar",name:"ACOTAR",emoji:"\uD83C\uDF39",category:"fandom",description:"A Court of Thorns and Roses",relatedTags:["fantasy","fae","mates","spicy","enemies-to-lovers","dark-romance"],popularity:94},{id:"fourth-wing",name:"Fourth Wing",emoji:"\uD83D\uDC09",category:"fandom",description:"Dragons and war college romance",relatedTags:["dragon","enemies-to-lovers","spicy","fantasy","military","bonding"],popularity:92},{id:"from-blood-and-ash",name:"From Blood and Ash",emoji:"\uD83D\uDDE1ï¸",category:"fandom",description:"Vampire fantasy romance",relatedTags:["vampire","fantasy","forbidden-love","spicy","protective","royalty"],popularity:88},{id:"shadow-and-bone",name:"Shadow and Bone",emoji:"âï¸",category:"fandom",description:"Grishaverse magic and romance",relatedTags:["fantasy","magic","love-triangle","enemies-to-lovers","dark"],popularity:84},{id:"bridgerton",name:"Bridgerton",emoji:"\uD83D\uDC90",category:"fandom",description:"Regency romance drama",relatedTags:["historical","regency","spicy","arranged-marriage","nobility","scandal"],popularity:89},{id:"the-witcher",name:"The Witcher",emoji:"\uD83D\uDC3A",category:"fandom",description:"Monster hunter fantasy",relatedTags:["fantasy","monster","magic","soulmates","dark","adventure"],popularity:83},{id:"supernatural",name:"Supernatural",emoji:"\uD83D\uDC7B",category:"fandom",description:"Demon hunters and angels",relatedTags:["paranormal","demon","angel","hunter","road-trip","dark"],popularity:86},{id:"percy-jackson",name:"Percy Jackson",emoji:"\uD83D\uDD31",category:"fandom",description:"Greek mythology demigods",relatedTags:["fantasy","mythology","gods","young-adult","adventure","camp"],popularity:82},{id:"lotr",name:"LOTR",emoji:"\uD83D\uDC8D",category:"fandom",description:"Lord of the Rings",relatedTags:["fantasy","elf","magic","medieval","adventure","immortal"],popularity:79},{id:"mha",name:"My Hero Academia",emoji:"\uD83D\uDCA5",category:"fandom",description:"Superhero anime",relatedTags:["anime","superhero","school","powers","training","rivalry"],popularity:91},{id:"aot",name:"Attack on Titan",emoji:"âï¸",category:"fandom",description:"Dark action anime",relatedTags:["anime","dark","military","survival","enemies-to-lovers","angst"],popularity:87},{id:"naruto",name:"Naruto",emoji:"\uD83C\uDF65",category:"fandom",description:"Ninja anime",relatedTags:["anime","ninja","rivalry","slow-burn","training","bonds"],popularity:89},{id:"demon-slayer",name:"Demon Slayer",emoji:"â¡",category:"fandom",description:"Demon hunting anime",relatedTags:["anime","demon","swords","revenge","training","dark"],popularity:86},{id:"jujutsu-kaisen",name:"Jujutsu Kaisen",emoji:"\uD83D\uDC79",category:"fandom",description:"Curse fighting anime",relatedTags:["anime","supernatural","school","powers","dark","rivalry"],popularity:88},{id:"haikyuu",name:"Haikyuu",emoji:"\uD83C\uDFD0",category:"fandom",description:"Volleyball sports anime",relatedTags:["anime","sports","school","rivalry","teamwork","slice-of-life"],popularity:84},{id:"bl",name:"BL/Yaoi",emoji:"\uD83D\uDC99",category:"fandom",description:"Boys love romance",relatedTags:["mlm","romance","anime","spicy","school","forbidden-love"],popularity:85},{id:"gl",name:"GL/Yuri",emoji:"\uD83D\uDC96",category:"fandom",description:"Girls love romance",relatedTags:["wlw","romance","anime","spicy","school","forbidden-love"],popularity:80},{id:"kdrama",name:"K-Drama",emoji:"\uD83C\uDFAC",category:"fandom",description:"Korean drama romance",relatedTags:["romance","contemporary","slow-burn","workplace","ceo","contracts"],popularity:87},{id:"marvel",name:"Marvel",emoji:"\uD83E\uDDB8",category:"fandom",description:"Marvel superheroes",relatedTags:["superhero","powers","sci-fi","team","action","enemies-to-lovers"],popularity:82},{id:"baldurs-gate",name:"Baldur's Gate 3",emoji:"\uD83C\uDFB2",category:"fandom",description:"Fantasy RPG romance",relatedTags:["fantasy","magic","vampire","demon","elf","adventure"],popularity:86},{id:"dragon-age",name:"Dragon Age",emoji:"\uD83D\uDC32",category:"fandom",description:"Fantasy RPG world",relatedTags:["fantasy","magic","elf","demon","romance","adventure"],popularity:81},{id:"mass-effect",name:"Mass Effect",emoji:"\uD83D\uDE80",category:"fandom",description:"Space opera RPG",relatedTags:["sci-fi","space","alien","romance","adventure","crew"],popularity:79},{id:"hazbin-hotel",name:"Hazbin Hotel",emoji:"\uD83D\uDE08",category:"fandom",description:"Hell redemption anime",relatedTags:["demon","hell","dark-romance","enemies-to-lovers","spicy","musical"],popularity:85},{id:"age-gap",name:"Age Gap",emoji:"\uD83D\uDCC5",category:"trope",description:"Significant age difference",relatedTags:["forbidden-love","taboo","power-imbalance","experienced"],popularity:88},{id:"reverse-harem",name:"Reverse Harem",emoji:"\uD83D\uDC65",category:"trope",description:"One woman, multiple love interests",relatedTags:["polyamory","sharing","possessive","jealousy"],popularity:82},{id:"breeding",name:"Breeding",emoji:"\uD83E\uDD5A",category:"spice",description:"Breeding/pregnancy kink",relatedTags:["omegaverse","pregnancy","heat","mating","primal"],popularity:85},{id:"monster",name:"Monster",emoji:"\uD83D\uDC19",category:"character",description:"Non-human monster romance",relatedTags:["fantasy","paranormal","tentacles","orc","different-anatomy"],popularity:80}];function n(e){return i.find(t=>
1t.id===e)}function o(e){let t={fandom:[],genre:[],trope:[],character:[],nationality:[],setting:[],vibe:[],spice:[]};return i.forEach(e=>{t[e.category].push(e)}),Object.keys(t).forEach(r=>{t[r]=t[r].sort((e,t)=>(t.popularity||0)-(e.popularity||0)).slice(0,e)}),t}let s={fandom:{emoji:"\uD83C\uDFF0",label:"Fandoms",description:"Popular fictional universes"},trope:{emoji:"\uD83D\uDC95",label:"Romance Tropes",description:"Classic story dynamics"},vibe:{emoji:"\uD83D\uDD25",label:"Vibes",description:"Story mood and intensity"},character:{emoji:"\uD83C\uDFAD",label:"Character Types",description:"Archetypes and species"},nationality:{emoji:"\uD83C\uDF0D",label:"Nationalities",description:"Character backgrounds"},genre:{emoji:"\uD83D\uDCDA",label:"Genres",description:"Story categories"},setting:{emoji:"\uD83D\uDCCD",label:"Settings",description:"Story locations"},spice:{emoji:"\uD83C\uDF36ï¸",label:"Spice",description:"Explicit scene elements"}}},50786:(e,t,r)=>{r.d(t,{w5:()=>j});var a=r(29729),i=r(31141),n=r(30564),o=r(7075),s=r(39179),l=r(80408),c=r(5518),d=r(42829),m=r(48224),u=r(16093),p=r(74488),g=r(90478),h=r(8662),x=r(6295),f=r(84327),y=r(13102),b=r(91790),v=r(282);function j(e){return"split"===e.layout?(0,a.jsx)(M,{...e}):(0,a.jsx)(D,{...e})}function k(e){return e.picks.length>0?"Find ideas \xb7 ".concat(e.picks.length):"Surprise me"}function w(e){let{children:t,brand:r=!1}=e;return(0,a.jsx)("span",{className:(0,v.cx)("inline-flex items-center gap-1.5 text-[11px] font-satoshi-medium uppercase tracking-[0.06em]",r?"text-[var(--color-fg-brand-primary)]":"text-[var(--color-text-quaternary)]"),children:t})}function N(e){let{id:t,on:r,removable:i=!1,onPress:o}=e,s=(0,b.wm)(t);return(0,a.jsx)(h.$,{size:"sm",shape:"pill",color:r?"selected":"hairline","aria-pressed":r,iconLeading:(0,a.jsx)("span",{"aria-hidden":!0,className:"text-[13px] leading-none",children:s.emoji}),iconTrailing:i?n.X:void 0,onClick:o,children:s.name})}function T(e){let{title:t,tags:r,picked:i,expanded:n,onExpand:o,onToggle:s}=e,l=n?r:r.slice(0,b.xR),c=r.length-l.length;return(0,a.jsxs)("section",{"aria-label":t,className:"flex flex-col gap-2.5",children:[(0,a.jsxs)("div",{className:"flex min-h-5 items-center justify-between gap-3",children:[(0,a.jsx)(w,{children:t}),(c>0||n)&&(0,a.jsx)(h.$,{color:"link-gray",size:"sm",onClick:o,children:n?"Less":"+".concat(c," more")})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.map(e=>(0,a.jsx)(N,{id:e.id,on:i.has(e.id),onPress:()=>s(e.id)},e.id))})]})}function C(e){let{pool:t}=e,{clean:r,picks:l,query:c}=t,d=c.trim(),m=(0,i.useMemo)(()=>new Set(l),[l]),u=(0,i.useMemo)(()=>(0,b.Z8)(l,{clean:r}),[l,r]),p=(0,i.useMemo)(()=>(0,b.IF)(d,{clean:r}),[d,r]),x=(0,i.useMemo)(()=>(0,b.P6)(r),[r]),f=(0,i.useMemo)(()=>(0,b.BZ)(r),[r]),y=d.length>=2&&!p.some(e=>e.name.toLowerCase()===d.toLowerCase())&&!m.has("".concat(b.g2).concat(d));return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("header",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("h2",{className:"font-editors-note text-[26px] leading-tight text-balance text-[var(--color-text-primary)] sm:text-[30px]",children:["What are you ",(0,a.jsx)(g.U,{children:"in the mood for?"})]}),(0,a.jsx)("p",{className:"text-sm font-satoshi-regular text-[var(--color-text-tertiary)]",children:"Pick a few and we'll write two ideas â or none, and we'll surprise you."})]}),(0,a.jsxs)("div",{className:"flex h-11 items-center gap-2 rounded-full border border-ink/10 bg-ink/[0.04] pl-4 pr-1 transition-colors focus-within:border-[var(--color-border-brand)]",children:[(0,a.jsx)(o.g,{"aria-hidden":!0,className:"size-4 shrink-0 text-[var(--color-text-quaternary)]"}),(0,a.jsx)("label",{htmlFor:"idea-pool-search",className:"sr-only",children:"Search tags"}),(0,a.jsx)("input",{id:"idea-pool-search",type:"text",value:c,onChange:e=>t.setQuery(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),y?t.addCustom(d):p[0]&&!m.has(p[0].id)&&t.toggle(p[0].id))},autoComplete:"off",spellCheck:!1,placeholder:"Search tags, or add your own",className:"h-full min-w-0 flex-1 bg-transparent text-[15px] font-satoshi-regular text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-quaternary)]"}),d.length>0&&(0,a.jsx)(h.$,{color:"tertiary",size:"sm",shape:"pill",iconLeading:n.X,"aria-label":"Clear search",onClick:()=>t.setQuery("")})]}),l.length>0&&(0,a.jsxs)("section",{"aria-label":"Picked",className:"flex flex-col gap-2.5",children:[(0,a.jsxs)("div",{className:"flex min-h-5 items-center justify-between gap-3",children:[(0,a.jsxs)(w,{children:["Picked \xb7 ",l.length]}),(0,a.jsx)(h.$,{color:"link-gray",size:"sm",onClick:t.clearPicks,children:"Clear"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.map(e=>(0,a.jsx)(N,{id:e,on:!0,removable:!0,onPress:()=>t.toggle(e)},e))})]}),u.length>0&&0===d.length&&(0,a.jsxs)("section",{"aria-label":"Goes well with",className:"flex flex-col gap-2.5",children:[(0,a.jsxs)(w,{brand:!0,children:[(0,a.jsx)(s.I,{"aria-hidden":!0,
1className:"size-3"}),"Goes well with"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:u.map(e=>(0,a.jsx)(N,{id:e.id,on:!1,onPress:()=>t.toggle(e.id)},e.id))})]}),d.length>0?(0,a.jsxs)("section",{"aria-label":"Results",className:"flex flex-col gap-2.5",children:[(0,a.jsx)(w,{children:p.length>0?"Results":"No tag by that name"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[p.map(e=>(0,a.jsx)(N,{id:e.id,on:m.has(e.id),onPress:()=>t.toggle(e.id)},e.id)),y&&(0,a.jsxs)(h.$,{size:"sm",shape:"pill",color:"hairline",iconLeading:(0,a.jsx)("span",{"aria-hidden":!0,className:"text-[13px] leading-none",children:"â¨"}),onClick:()=>t.addCustom(d),children:["Add â",d,"â"]})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(T,{title:"Popular",tags:x,picked:m,expanded:!!t.expanded.popular,onExpand:()=>t.toggleSection("popular"),onToggle:t.toggle}),f.map(e=>(0,a.jsx)(T,{title:e.title,tags:e.tags,picked:m,expanded:!!t.expanded[e.id],onExpand:()=>t.toggleSection(e.id),onToggle:t.toggle},e.id))]})]})}function S(e){let{tags:t,surprise:r,stale:i,onChange:n}=e;return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[r&&(0,a.jsx)(w,{children:"Surprise mix"}),t.map(e=>{let t=(0,b.wm)(e);return(0,a.jsxs)("span",{className:"inline-flex h-7 items-center gap-1.5 rounded-full border border-ink/10 bg-ink/[0.05] px-2.5 text-xs font-satoshi-medium text-[var(--color-text-secondary)]",children:[(0,a.jsx)("span",{"aria-hidden":!0,children:t.emoji}),t.name]},e)}),n&&(0,a.jsx)(h.$,{color:"hairline",size:"sm",shape:"pill",iconLeading:l.$,onClick:n,className:"h-7 gap-1.5 px-2.5 py-0 text-xs *:data-icon:!size-3.5",children:"Change"}),i&&(0,a.jsx)("span",{className:"text-xs text-[var(--color-text-tertiary)]",children:"\xb7 written before your picks changed"})]})}function P(e){let{idea:t,index:r,chosen:i,disabled:n,onChoose:o,onMakeItYours:s}=e,l=[t.leadName,t.otherName].filter(Boolean).join(" & "),m=(0,a.jsxs)(y._,{className:(0,v.cx)("px-5 pb-5 pt-4 transition-colors",i?"border-transparent bg-ink/[0.04]":"hover:bg-ink/[0.04]"),children:[(0,a.jsx)("button",{type:"button","aria-pressed":i,"aria-label":"Choose â".concat(t.title,"â"),disabled:n,onClick:o,className:"absolute -inset-x-5 -top-4 -bottom-5 z-[1] cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-border-brand)] disabled:cursor-default"}),(0,a.jsxs)("div",{className:"mb-2.5 flex items-center gap-2.5",children:[(0,a.jsx)("span",{className:"min-w-3.5 font-editors-note text-[15px] leading-none text-[var(--color-text-tertiary)]",children:0===r?"I":"II"}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-[11.5px] font-satoshi-medium uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]",children:l}),(0,a.jsx)("span",{"aria-hidden":!0,className:(0,v.cx)("grid size-6 shrink-0 place-items-center rounded-full border",i?"border-transparent bg-[var(--color-fg-selected)] text-[var(--color-bg-primary)]":"border-ink/15"),children:i&&(0,a.jsx)(c.J,{className:"size-3.5"})})]}),(0,a.jsx)("h3",{className:"font-editors-note text-[21px] leading-snug text-balance text-[var(--color-text-primary)]",children:t.title}),(0,a.jsx)("p",{className:(0,v.cx)("mt-1.5 text-sm leading-relaxed font-satoshi-regular",i?"text-[var(--color-text-primary)]":"text-[var(--color-text-secondary)]"),children:t.idea}),i&&(0,a.jsx)("div",{className:"relative z-[2] mt-4",children:(0,a.jsx)(h.$,{color:"hairline",size:"sm",shape:"pill",iconLeading:d.s,onClick:s,children:"Make it yours"})})]});return i?(0,a.jsx)(f.T,{radius:"20px",children:m}):m}function F(e){let{index:t}=e,r="animate-shimmer rounded bg-linear-to-r from-ink/5 via-ink/15 to-ink/5 bg-[length:200%_100%]";return(0,a.jsxs)(y._,{className:"px-5 pb-6 pt-4",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2.5",children:[(0,a.jsx)("span",{className:"min-w-3.5 font-editors-note text-[15px] leading-none text-[var(--color-text-tertiary)]",children:0===t?"I":"II"}),(0,a.jsx)("div",{className:(0,v.cx)(r,"h-2.5 w-24")})]}
1),(0,a.jsx)("div",{className:(0,v.cx)(r,"mb-3 h-5 w-3/5")}),(0,a.jsx)("div",{className:"flex flex-col gap-2.5",children:["w-full","w-[96%]","w-[90%]","w-[55%]"].map(e=>(0,a.jsx)("div",{className:(0,v.cx)(r,"h-3",e)},e))})]})}function E(e){let{index:t}=e;return(0,a.jsxs)("div",{className:"flex min-h-40 flex-col gap-3 rounded-[20px] border border-dashed border-ink/10 px-5 py-4",children:[(0,a.jsx)("span",{className:"font-editors-note text-[15px] leading-none text-[var(--color-text-quaternary)]",children:0===t?"I":"II"}),(0,a.jsx)("div",{className:"h-2 w-2/5 rounded bg-ink/[0.04]"}),(0,a.jsx)("div",{className:"h-3.5 w-3/4 rounded bg-ink/[0.04]"}),(0,a.jsx)("div",{className:"h-2 w-full rounded bg-ink/[0.04]"}),(0,a.jsx)("div",{className:"h-2 w-[88%] rounded bg-ink/[0.04]"})]})}function L(e){let{pool:t}=e;return t.pulls.length<2?null:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs tabular-nums text-[var(--color-text-tertiary)]",children:[(0,a.jsx)(h.$,{color:"hairline",size:"sm",shape:"pill",iconLeading:m.J,"aria-label":"Earlier ideas",isDisabled:t.index<=0||t.writing,onClick:()=>t.page(-1)}),(0,a.jsxs)("span",{children:[t.index+1," of ",t.pulls.length]}),(0,a.jsx)(h.$,{color:"hairline",size:"sm",shape:"pill",iconLeading:u.c,"aria-label":"Later ideas",isDisabled:t.index>=t.pulls.length-1||t.writing,onClick:()=>t.page(1)})]})}function R(e){let{pool:t,onMakeItYours:r,onChange:i}=e,{current:n,pending:o,writing:s,keepPairWhileWriting:l,error:c,chosen:d}=t,m=s&&!l,u=m?o:n,p=!i&&!!n&&!s&&!t.currentMatchesPicks,g=m?"Writing two for youâ¦":l?"Writing two moreâ¦":n?null===d?"Choose the one you want to read. You can make it yours before it starts.":null:c?null:"Two ideas land here, each with a title, the couple, and the moment it opens on. Nothing is written until you ask.";return(0,a.jsxs)("div",{className:"flex flex-col gap-3.5",children:[u&&(0,a.jsx)(S,{tags:u.tags,surprise:u.surprise,stale:p,onChange:i}),c&&!s&&(0,a.jsxs)(y._,{children:[(0,a.jsx)("p",{className:"text-sm font-satoshi-medium text-[var(--color-text-primary)]",children:c}),(0,a.jsx)("p",{className:"mt-1 text-sm text-[var(--color-text-tertiary)]",children:"Ask again, or go back and write the idea yourself."})]}),m?(0,a.jsxs)("div",{className:"flex flex-col gap-3","aria-busy":!0,children:[(0,a.jsx)(F,{index:0}),(0,a.jsx)(F,{index:1})]}):n?(0,a.jsx)("div",{role:"group","aria-label":"Two ideas",className:"flex flex-col gap-3",children:n.ideas.map((e,i)=>(0,a.jsx)(P,{idea:e,index:i,chosen:d===i,disabled:s,onChoose:()=>t.choose(i),onMakeItYours:()=>r(e)},"".concat(t.index,"-").concat(i)))}):c?null:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(E,{index:0}),(0,a.jsx)(E,{index:1})]}),g&&(0,a.jsx)("p",{"aria-live":"polite",className:"px-0.5 text-[13px] leading-relaxed text-[var(--color-text-tertiary)]",children:g})]})}function z(e){let{pool:t,onStart:r,isStarting:i,act:n}=e,o=t.chosenIdea;return(0,a.jsx)(h.$,{color:"white",...n?x.z:{shape:"pill",size:"lg",className:"h-12 min-w-0 flex-1"},isDisabled:!o||t.writing||i,isLoading:i,showTextWhileLoading:!0,onClick:()=>o&&r(o),children:"Start this story"})}function M(e){let{pool:t,onBack:r,onStart:i,onMakeItYours:n,isStarting:o=!1}=e,{current:l,writing:c}=t,d=!!l&&t.currentMatchesPicks&&!l.surprise;return(0,a.jsxs)("div",{className:"relative grid h-full min-h-0 grid-cols-[minmax(0,1fr)_minmax(20rem,27.5rem)]",children:[(0,a.jsxs)("div",{className:"min-h-0 overflow-y-auto px-8 pb-10 pt-5",children:[(0,a.jsx)(h.$,{color:"link-gray",size:"sm",iconLeading:m.J,onClick:r,children:"Back to writing"}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(C,{pool:t})})]}),(0,a.jsxs)("aside",{"aria-label":"Your ideas",className:"flex min-h-0 flex-col border-l border-ink/[0.08]",children:[(0,a.jsxs)("div",{className:"flex h-16 shrink-0 items-center justify-between gap-3 pl-6 pr-16",children:[(0,a.jsx)(w,{children:"Your ideas"}),(0,a.jsx)(L,{pool:t})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 pb-5",children:(0,a.jsx)(R,{pool:t,onMakeItYours:n})}),(0,a.jsx)("div",{className:"flex shrink-0 gap-2.5 border-t border-ink/[0.08] px-6 pb-6 pt-4",children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.$,{color:"hairline",shape:"pill",size:"lg",className:"h-12 min-w-0 flex-1",iconLeading:d?p.p:s.I,isDisabled:c,onClick:()=>void t.pull(),children:d?"More ideas":k(t)}),(0,a.jsx)(z,{pool:t,onStart:i,isStarting:o,act:!1})]}):(0,a.jsx)(h.$,{color:"white",...x.z,iconLeading:s.I,isDisabled:c,onClick:()=>void t.pull(),children:c?"Writingâ¦":k(t)})})]})]})}function D(e){let{pool:t,step:r,onStepChange:i,onBack:n,onStart:
1o,onMakeItYours:l,isStarting:c=!1}=e,d=()=>i("pool");return(0,a.jsxs)("div",{className:"relative flex h-full min-h-0 flex-col",children:[(0,a.jsx)("div",{className:"flex min-h-14 shrink-0 items-center pl-3 pr-16 pt-2 sm:pl-5",children:(0,a.jsx)(h.$,{color:"link-gray",size:"sm",iconLeading:m.J,onClick:"pool"===r?n:d,children:"pool"===r?"Back to writing":"Change picks"})}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 pb-6 sm:px-7",children:"pool"===r?(0,a.jsx)(C,{pool:t}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("header",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("h2",{className:"font-editors-note text-[26px] leading-tight text-balance text-[var(--color-text-primary)] sm:text-[30px]",children:["Two ideas, ",(0,a.jsx)(g.U,{children:"written for you"})]}),(0,a.jsx)("p",{className:"text-sm font-satoshi-regular text-[var(--color-text-tertiary)]",children:"Pick the one you want to read â or make it yours first."})]}),(0,a.jsx)(R,{pool:t,onMakeItYours:l,onChange:d}),(t.current||t.writing)&&(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)(h.$,{color:"hairline",size:"sm",shape:"pill",iconLeading:p.p,isDisabled:t.writing,onClick:()=>void t.pull(),children:"More ideas"}),(0,a.jsx)(L,{pool:t})]})]})}),(0,a.jsx)("div",{className:"shrink-0 border-t border-ink/[0.08] px-5 pb-5 pt-3.5 sm:px-6",children:"pool"===r?(0,a.jsx)(h.$,{color:"white",...x.z,iconLeading:t.alreadyWritten&&!t.writing?u.c:s.I,onClick:()=>{let e=t.writing&&!!t.pending&&!t.pending.surprise&&(0,b.D)(t.pending.tags,t.picks);t.alreadyWritten&&!t.writing?t.showLatest():e||t.pull(),i("ideas")},children:t.alreadyWritten&&!t.writing?"Show my ideas":k(t)}):(0,a.jsx)(z,{pool:t,onStart:o,isStarting:c,act:!0})})]})}},55228:(e,t,r)=>{r.d(t,{n:()=>R});var a=r(29729),i=r(31141),n=r(49529),o=r.n(n),s=r(91852),l=r(42332),c=r(27346),d=r(17306),m=r(37651),u=r(40344),p=r(87787),g=r(8662),h=r(29392),x=r(77398),f=r(3954),y=r(60828),b=r(91277),v=r(68852),j=r(99248),k=r(19114),w=r(15952),N=r(7113),T=r(23119),C=r(26148),S=r(7957),P=r(20066),F=r(50928),E=r(87991),L=r(17561);let R=function(){var e,t,r,n,R,z;let{presentation:M="popover"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{signOut:D}=(0,h.BG)(),A=(0,x.IT)(f.FH.users.getMyProfile),[I,H]=(0,i.useState)(!1),[B,_]=(0,i.useState)(!1),[O,W]=(0,i.useState)(!1),[$,U]=(0,i.useState)(!1),{showUpgradeModal:G,oneDoor:q}=(0,w.v)(),V=(0,x.IT)(f.FH.ai.images.engineAccess.getPremiumImageBalance,{}),J=(0,T.m)(),Z=(0,S.Js)(),K=()=>{U(!1),setTimeout(()=>{G()},200)},Y=()=>{U(!1),setTimeout(()=>{J.open()},200)},Q=async()=>{H(!0),await D(),window.location.href="/"},X=e=>new Date(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),ee=(0,a.jsx)(a.Fragment,{children:(null==A?void 0:A.hasActiveSubscription)?(0,a.jsx)("div",{className:"relative w-8 h-8 sm:w-9 sm:h-9 rounded-full p-[2px]",style:{backgroundImage:"linear-gradient(to right, #ffaa40, #9c40ff, #ffaa40, #9c40ff, #ffaa40)",backgroundSize:"300% 100%",animation:"gradient 6s linear infinite"},children:(0,a.jsx)("div",{className:"w-full h-full rounded-full bg-[var(--color-bg-primary)] p-[2px] flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-full h-full rounded-full bg-[var(--color-bg-secondary)] border border-[var(--color-border-secondary)] flex items-center justify-center hover:border-[var(--color-border-primary)] transition-all shadow-xs overflow-hidden",children:(null==A?void 0:A.avatarUrl)?(0,a.jsx)("img",{src:A.avatarUrl,alt:A.name||"User",className:"w-full h-full rounded-full object-cover"}):(0,a.jsx)("span",{className:"text-[10px] sm:text-xs font-editors-note text-white select-none",children:(0,N.I)((null==A?void 0:A.username)||(null==A?void 0:A.name))||(0,a.jsx)(s.f,{className:"w-3 h-3 sm:w-3.5 sm:h-3.5 text-[var(--color-text-tertiary)]"})})})})}):(0,a.jsx)("div",{className:"w-8 h-8 sm:w-9 sm:h-9 rounded-full bg-[var(--color-bg-secondary)] border border-[var(--color-border-secondary)] flex items-center justify-center hover:border-[var(--color-border-primary)] transition-all shadow-xs overflow-hidden",children:(null==A?void 0:A.avatarUrl)?(0,a.jsx)("img",{src:A.avatarUrl,alt:A.name||"User",className:"w-full h-full rounded-full object-cover"}):(0,a.jsx)("span",{className:"text-xs sm:text-sm font-editors-note text-white select-none",children:(0,N.I)((null==A?void 0:A.username)||(null==A?void 0:A.name))||(0,a.jsx)(s.f,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-[var(--color-text-tertiary)]"})})})}),et=[{key:"new",icon:l.F,label:"New Story",onPress:()=>{U(!1),setTimeout(()=>{W(!0)},200)}},{key:"profile",icon:s.f,label:"Edit Profile",onPress:()=>{U(!1),setTimeout(()=>{_(!0)},300)}},{key:"library",icon:c.B,label:"Library",href:"/library"},{key:"chats",icon:d.z,label:"Chats",href:"/chats"},{key:"characters",icon:m.y,label:"Characters",href:"/characters"}],er=(0,a.jsx)("div",{className:"w-11 h-11 rounded-full bg-[var(--color-bg-secondary)] border border-[var(--color-border-secondary)] flex items-center justify-center overflow-hidden shrink-0",children:(null==A?void 0:A.avatarUrl)?(0,a.jsx)("img",{src:A.avatarUrl,alt:A.name||"User",className:"w-full h-full rounded-full object-cover"}):(0,a.jsx)("span",{className:"text-sm font-editors-note text-[var(--color-text-primary)] select-none",children:(0,N.I)((null==A?void 0:A.username)||(null==A?void 0:A.name))||(0,a.jsx)(s.f,{className:"w-5 h-5 text-[var(--color-text-tertiary)]"})})}),ea=(null==A?void 0:A.hasActiveSubscription)?(0,a.jsx)("div",{className:"relative inline-block rounded-full p-[1.5px] shrink-0",style:{backgroundImage:"linear-gradient(to right, #ffaa40, #9c40ff, #ffaa40, #9c40ff, #ffaa40)",backgroundSize:"300% 100%",animation:"gradient 6s linear infinite"},children:(0,a.jsx)("div",{className:"px-1.5 py-0.5 rounded-full bg-[var(--color-bg-primary)] flex items-center justify-center",children:(0,a.jsx)("span",{className:"text-[10px] font-satoshi-bold text-white leading-none",children:"PRO"})})}):null,ei="rounded-[18px] border border-ink/10 bg-ink/[0.03]",en=(0,a.jsxs)("div",{className:"relative flex flex-col gap-5 px-4 pb-6 pt-6",children:[(0,a.jsxs)("header",{className:"flex items-center gap-3 pr-10",children:[er,(0,a.jsx)("div",{className:"min-w-0 flex-1",children:(0,a.jsxs)(L.L3,{job:"form",align:"start",description:(0,a.jsx)(a.Fragment,{children:null==A?void 0:A.email}),children:["@",(null==A?void 0:A.username)||(null==A?void 0:A.name)||"User"]})}),ea]}),Z.supported&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 p-3 ".concat(ei),children:[(0,a.jsx)(S.$q,{label:"Theme",options:P.r_,value:Z.themeId,onChange:e=>Z.setTheme(e)}
1),(0,a.jsx)(S.$q,{label:"Background",options:P.EA,value:Z.backgroundId,onChange:Z.setBackground})]}),(null==A?void 0:A.hasActiveSubscription)?A.subscription?(0,a.jsxs)("div",{className:"flex flex-col gap-1.5 px-4 py-3 text-sm ".concat(ei),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-satoshi-regular text-[var(--color-text-tertiary)]",children:"Status"}),(0,a.jsx)("span",{className:"font-satoshi-medium capitalize ".concat(A.subscription.cancelAtPeriodEnd?"text-[var(--color-text-warning-primary)]":"text-[var(--color-fg-brand-primary)]"),children:A.subscription.cancelAtPeriodEnd?"Expires Soon":A.subscription.status})]}),"number"==typeof A.subscription.currentPeriodEnd&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-satoshi-regular text-[var(--color-text-tertiary)]",children:A.subscription.cancelAtPeriodEnd?"Expires":"Renews"}),(0,a.jsx)("span",{className:"font-satoshi-medium text-[var(--color-text-secondary)]",children:X(A.subscription.currentPeriodEnd)})]}),V&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-satoshi-regular text-[var(--color-text-tertiary)]",children:"Premium images"}),(0,a.jsx)("span",{className:"font-satoshi-medium tabular-nums text-[var(--color-text-secondary)]",children:V.available})]}),q&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-satoshi-regular text-[var(--color-text-tertiary)]",children:"Plan & balance"}),(0,a.jsx)(g.$,{color:"link-color",size:"sm",onClick:Y,className:"h-auto text-xs underline underline-offset-2",children:"Open"})]})]}):null:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)(y.$,{onPress:Y,className:"flex items-center gap-3 px-4 py-3 text-left outline-none transition-colors hover:bg-ink/[0.06] active:bg-ink/[0.06] focus-visible:ring-2 focus-visible:ring-ink/25 ".concat(ei),children:[(0,a.jsx)("img",{src:"/crystal.png",alt:"",className:"size-5 shrink-0"}),(0,a.jsx)("span",{className:"flex-1 text-[15px] font-satoshi-medium text-[var(--color-text-primary)]",children:"Tokens"}),(0,a.jsx)("span",{className:"text-lg font-satoshi-bold tabular-nums text-[var(--color-text-primary)]",children:null!=(R=null==A||null==(e=A.tokens)?void 0:e.toLocaleString())?R:0})]}),(0,a.jsx)(g.$,{color:"gradient-border",size:"md",iconLeading:u.D,onClick:K,className:"w-full",children:"Upgrade to Pro"})]}),(0,a.jsx)("div",{className:"overflow-hidden ".concat(ei),children:et.map((e,t)=>{let r=e.icon,i="flex h-12 w-full items-center gap-3 px-4 text-left outline-none transition-colors hover:bg-ink/[0.06] active:bg-ink/[0.06] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ink/25".concat(t>0?" border-t border-[var(--color-border-hairline)]":""),n=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r,{className:"size-[18px] shrink-0 text-[var(--color-text-tertiary)]"}),(0,a.jsx)("span",{className:"text-[15px] font-satoshi-medium text-[var(--color-text-primary)]",children:e.label})]});return e.href?(0,a.jsx)(o(),{href:e.href,className:i,onClick:()=>U(!1),children:n},e.key):(0,a.jsx)(y.$,{onPress:e.onPress,className:i,children:n},e.key)})}),(0,a.jsx)(g.$,{color:"link-gray",size:"sm",iconLeading:p.O,onClick:Q,isDisabled:I,className:"self-center",children:I?"Signing out...":"Sign out"})]}),eo=(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"relative p-4 border-b border-[var(--color-border-secondary)]",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-11 h-11 rounded-full bg-[var(--color-bg-secondary)] border border-[var(--color-border-secondary)] flex items-center justify-center overflow-hidden",children:(null==A?void 0:A.avatarUrl)?(0,a.jsx)("img",{src:A.avatarUrl,alt:A.name||"User",className:"w-full h-full rounded-full object-cover"}):(0,a.jsx)("span",{className:"text-sm font-editors-note text-white select-none",children:(0,N.I)((null==A?void 0:A.username)||(null==A?void 0:A.name))||(0,a.jsx)(s.f,{className:"w-5 h-5 text-[var(--color-text-tertiary)]"})})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("h3",{className:"text-sm font-satoshi-medium text-[var(--color-text-primary)] truncate",children:["@",(null==A?void 0:A.username)||(null==A?void 0:A.name)||"User"]}),(0,a.jsx)("p",{className:"text-xs font-satoshi-regular text-[var(--color-text-tertiary)] truncate",children:null==A?void 0:A.email})]}),ea]})})}),es=(0,a.jsxs)(a.Fragment,{children:[!(null==A?void 0:A.hasActiveSubscription)&&(0,a.jsx)("div",{className:"relative p-3 border-b border-[var(--color-border-secondary)]",children:(0,a.jsxs)("button",{onClick:Y,className:"w-full flex items-center justify-between p-2.5 rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border-secondary)] hover:border-[var(--color-border-primary)] hover:bg-[var(--color-bg-tertiary)] transition-all cursor-pointer group",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-7 h-7 rounded-full bg-gradient-to-br from-blue-500/20 to-blue-600/20 border border-blue-400/30 flex items-center justify-center group-hover:scale-105 transition-transform",children:(0,a.jsx)("img",{src:"/crystal.png",alt:"Tokens",className:"w-4 h-4 translate-y-[0.5px]"})}),(0,a.jsx)("span",{className:"text-xs font-satoshi-medium text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)] transition-colors",children:"Tokens"})]}),(0,a.jsx)("span",{className:"text-lg font-satoshi-bold text-[var(--color-text-primary)]",children:null!=(z=null==A||null==(t=A.tokens)?void 0:t.toLocaleStr
1ing())?z:0})]})}),(null==A?void 0:A.hasActiveSubscription)&&(0,a.jsx)("div",{className:"relative p-3 border-b border-[var(--color-border-secondary)]",children:(0,a.jsxs)("div",{className:"space-y-1.5 text-xs",children:[A.subscription&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-satoshi-regular text-[var(--color-text-tertiary)]",children:"Status"}),(0,a.jsx)("span",{className:"font-satoshi-medium capitalize ".concat(A.subscription.cancelAtPeriodEnd?"text-[var(--color-text-warning-primary)]":"text-[var(--color-fg-brand-primary)]"),children:A.subscription.cancelAtPeriodEnd?"Expires Soon":A.subscription.status})]}),(null==(r=A.subscription)?void 0:r.currentPeriodEnd)&&"number"==typeof A.subscription.currentPeriodEnd&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-satoshi-regular text-[var(--color-text-tertiary)]",children:(null==(n=A.subscription)?void 0:n.cancelAtPeriodEnd)?"Expires":"Renews"}),(0,a.jsx)("span",{className:"font-satoshi-medium text-[var(--color-text-secondary)]",children:X(A.subscription.currentPeriodEnd)})]}),V&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-satoshi-regular text-[var(--color-text-tertiary)]",children:"Premium images"}),(0,a.jsx)("span",{className:"font-satoshi-medium tabular-nums text-[var(--color-text-secondary)]",children:V.available})]}),q&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-satoshi-regular text-[var(--color-text-tertiary)]",children:"Plan & balance"}),(0,a.jsx)(g.$,{color:"link-color",size:"sm",onClick:Y,className:"h-auto text-xs underline underline-offset-2",children:"Open"})]})]})}),(0,a.jsxs)("div",{className:"relative p-2.5 space-y-1.5",children:[!(null==A?void 0:A.hasActiveSubscription)&&(0,a.jsx)(g.$,{color:"gradient-border",size:"sm",className:"w-full justify-start text-xs h-9",iconLeading:u.D,onClick:K,children:"Upgrade to Pro"}),et.map(e=>(0,a.jsx)(g.$,{color:"tertiary",size:"sm",className:"w-full justify-start text-xs h-8",iconLeading:e.icon,...e.href?{href:e.href}:{onClick:e.onPress},children:e.label},e.key)),(0,a.jsx)(g.$,{color:"tertiary",size:"sm",className:"w-full justify-start text-xs h-8",iconLeading:p.O,onClick:Q,disabled:I,children:I?"Signing out...":"Sign Out"})]})]});return(0,a.jsxs)(a.Fragment,{children:["sheet"===M?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.$,{onPress:()=>U(!0),"aria-label":"Account",className:"relative cursor-pointer outline-none group flex-shrink-0",children:ee}),(0,a.jsx)(C.mH,{placement:"sheet",isOpen:$,onOpenChange:U,isDismissable:!0,children:(0,a.jsx)(C.aF,{className:"h-auto max-h-full",children:(0,a.jsx)(C.lG,{"aria-label":"Account",children:(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-t-[20px]",children:[(0,a.jsx)(F.Ne,{spread:"card"}),(0,a.jsx)("div",{className:"absolute right-3 top-3 z-10",children:(0,a.jsx)(E.J,{theme:"dark",size:"sm",onPress:()=>U(!1)})}),en]})})})})]}):(0,a.jsxs)(b.zM,{isOpen:$,onOpenChange:U,children:[(0,a.jsx)(y.$,{className:"relative cursor-pointer outline-none group flex-shrink-0",children:ee}),(0,a.jsx)(v.A,{placement:"bottom end",offset:12,className:e=>{let{isEntering:t,isExiting:r}=e;return"\n origin-top-right z-50\n ".concat(t&&"duration-200 ease-out animate-in fade-in zoom-in-95","\n ").concat(r&&"duration-150 ease-in animate-out fade-out zoom-out-95","\n ")},children:(0,a.jsx)(b.lG,{className:"outline-none",children:(0,a.jsxs)("div",{className:"w-72 bg-[var(--color-bg-primary)] border border-[var(--color-border-secondary)] rounded-xl shadow-2xl overflow-hidden",children:[eo,es]})})})]}),J.modal,(0,a.jsx)(k.B,{isOpen:O,onClose:()=>W(!1)}),(0,a.jsx)(j.U,{isOpen:B,onClose:()=>_(!1)})]})}},61794:(e,t,r)=>{r.d(t,{y:()=>m});var a=r(29729),i=r(92487),n=r(26079),o=r(95881),s=r(32435),l=r(15952),c=r(3954),d=r(62897);function m(e){let t=(0,i.y3)(e),{showUpgradeModal:r}=(0,l.v)(),m=(0,i.n_)(c.FH.flashDeals.activate);return async function(){for(var e=arguments.length,i=Array(e),l=0;l<e;l++)i[l]=arguments[l];try{return await t(...i)}catch(i){if(i instanceof n.ik){let e=i.data;if("object"==typeof e&&null!==e&&"code"in e&&"INSUFFICIENT_TOKENS"===e.code)throw await m({source:"tokens"}).catch(()=>{}),r(void 0,{auto:!0}),i;if("string"==typeof e&&(e.includes("Not authenticated")||e.includes("Unauthenticated")))throw i}if(i instanceof Error&&i.message.includes("Insufficient tokens"))throw await m({source:"tokens"}).catch(()=>{}),r(void 0,{auto:!0}),i;if(i instanceof Error&&(i.message.includes("Not authenticated")||i.message.includes("Unauthenticated"))||(0,d.OC)(i))throw i;let{title:e,description:t}=(0,d.Qf)(i,"action");throw o.oR.custom(r=>(0,a.jsx)(s.Zx,{title:e,description:t,color:"error",onClose:()=>o.oR.dismiss(r)})),console.error("Convex Action Error:",i),i}}}},77115:(e,t,r)=>{r.d(t,{d:()=>n});var a=r(31141);let i={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},n=e=>{let[t,r]=(0,a.useState)(window.matchMedia("(min-width: ".concat(i[e],")")).matches);return(0,a.useEffect)(()=>{let t=window.matchMedia("(min-width: ".concat(i[e],")"));r(t.matches);let a=e=>r(e.matches);return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e]),t}},77398:(e,t,r)=>{r.d(t,{Pm:()=>i.P,Wh:()=>n.W,IT:()=>a.IT}),r(61794),r(35553),r(31141);var a=r(92487),i=r(80998);r(26806);var n=r(5297);r(78292)},78292:(e,t,r)=>{r.d(t,{R:()=>o});var a=r(31141);let i="nx:scroll:",n=0;function o(e){let{key:t,ready:r,itemCount:o,loadMore:s,canLoadMore:l=!1}=e,c=(0,a.useRef)(void 0),d=(0,a.useRef)(!1),m=(0,a.useRef)(!1),u=(0,a.useRef)(0),p=(0,a.useRef)(o);p.current=o;let g=(0,a.useRef)(t);g.current=t,void 0===c.current&&(c.current=!function(){if(Date.now()-n<2e3)return!0;let[e]=performance.getEntriesByType("navigation");return(null==e?void 0:e.type)==="back_forward"}()?null:function(e){try{let t=sessionStorage.getItem(i+e);if(!t)return null;let r=JSON.parse(t);
1if("number"!=typeof(null==r?void 0:r.y)||"number"!=typeof(null==r?void 0:r.t)||Date.now()-r.t>18e5)return null;return r}catch(e){return null}}(t),u.current=Date.now()),(0,a.useEffect)(()=>{let e=0,t=()=>{e=0;let t=Math.round(window.scrollY);if(!(t<40)){var r=g.current,a={y:t,count:p.current,h:document.documentElement.scrollHeight,t:Date.now()};try{sessionStorage.setItem(i+r,JSON.stringify(a))}catch(e){}}},r=()=>{e||(e=requestAnimationFrame(t))};return window.addEventListener("scroll",r,{passive:!0}),window.addEventListener("pagehide",t),()=>{window.removeEventListener("scroll",r),window.removeEventListener("pagehide",t),e&&cancelAnimationFrame(e)}},[]),(0,a.useEffect)(()=>{if(!c.current||m.current)return;let e=()=>{c.current=null},t=["wheel","touchstart","keydown"];return t.forEach(t=>window.addEventListener(t,e,{passive:!0,once:!0})),()=>t.forEach(t=>window.removeEventListener(t,e))},[]),(0,a.useEffect)(()=>{let e=c.current;if(!e||m.current||!r)return;if(o<e.count&&l&&s&&!d.current){d.current=!0,s(e.count-o);return}if(o<e.count&&l)return;let t=0,a=0,i=()=>{if(t=0,!c.current||m.current)return;let r=Date.now(),n=document.documentElement.scrollHeight,o=r-u.current>5e3;if(!a){if(!(e.h?n>=e.h:n-window.innerHeight>=e.y)&&!o){t=requestAnimationFrame(i);return}if(n-window.innerHeight<e.y){m.current=!0;return}window.scrollTo({top:e.y,behavior:"instant"}),a=r,t=requestAnimationFrame(i);return}if(Math.abs(window.scrollY-e.y)>2&&window.scrollTo({top:e.y,behavior:"instant"}),r-a>600){m.current=!0;return}t=requestAnimationFrame(i)};return t=requestAnimationFrame(i),()=>{t&&cancelAnimationFrame(t)}},[r,o,l,s])}window.addEventListener("popstate",()=>{n=Date.now()},{capture:!0})},80998:(e,t,r)=>{r.d(t,{P:()=>i});var a=r(31141);function i(e){let{remoteValue:t,onSave:r,delay:i=500}=e,n=null!=t?t:"",[o,s]=(0,a.useState)(n),[l,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(!1),u=(0,a.useRef)(!0),p=(0,a.useRef)(null),g=(0,a.useRef)(n),h=(0,a.useRef)(n),x=(0,a.useRef)(r),f=(0,a.useRef)(!1),y=(0,a.useRef)(null);x.current=r;let b=(0,a.useCallback)(()=>{p.current&&(clearTimeout(p.current),p.current=null)},[]),v=(0,a.useCallback)(function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=f.current||null!==y.current;return e&&u.current&&c(t),t},[]),j=(0,a.useCallback)(e=>{g.current=e,u.current&&s(e)},[]),k=(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.current,t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(b(),h.current===e){y.current=null,f.current=!1,v(t);return}if(y.current===e&&!f.current)return void v(t);y.current=e,f.current=!1,v(t);try{await x.current(e)}catch(r){throw y.current===e&&h.current!==e&&(y.current=null),g.current===e&&h.current!==e&&(f.current=!0),v(t),r}},[b,v]),w=(0,a.useCallback)(e=>{b(),p.current=setTimeout(()=>{k(e).catch(()=>{})},i)},[b,i,k]),N=(0,a.useCallback)(e=>{g.current=e,u.current&&s(e),f.current=!0,v(),w(e)},[w,v]),T=(0,a.useCallback)(e=>{N(e.target.value)},[N]),C=(0,a.useCallback)(()=>{u.current&&m(!0)},[]),S=(0,a.useCallback)(async()=>{if(!f.current){b(),v();return}await k(g.current)},[b,k,v]),P=(0,a.useCallback)(()=>{let e=()=>{u.current&&m(!1)};if(f.current)return void k(g.current).catch(()=>{}).finally(e);b(),e()},[b,k]);return(0,a.useEffect)(()=>{h.current=n,y.current===n&&(y.current=null),d||f.current||null!==y.current||g.current===n||(g.current=n,u.current&&s(n)),v()},[d,n,v]),(0,a.useEffect)(()=>(u.current=!0,()=>{f.current?k(g.current,!1).catch(()=>{}):b(),u.current=!1}),[b,k]),{inputProps:{value:o,onChange:T,onFocus:C,onBlur:P},controlProps:{value:o,onChange:N,onFocus:C,onBlur:P},value:o,setValue:j,flush:S,isDirty:l,isFocused:d}}},81146:(e,t,r)=>{r.d(t,{p:()=>l});var a=r(29729),i=r(27346),n=r(37651),o=r(66149);let s=[{value:"story",label:"Story",icon:i.B},{value:"character",label:"Chat",icon:n.y}];function l(e){let{mode:t,onModeChange:r,disabled:i=!1,className:n="",variant:l="solid"}=e,c="glass"===l;return(0,a.jsx)("div",{className:"relative inline-flex ".concat(n),children:(0,a.jsx)("div",{className:"relative rounded-full transition-all duration-300 ".concat(c?"border border-ink/10 p-0":"bg-[var(--color-border-secondary)] p-[2px]"),children:(0,a.jsxs)("div",{className:"relative flex h-11 w-[210px] items-center gap-1 rounded-full px-1 py-1 ".concat(c?"bg-ink/[0.04] backdrop-blur-md":"bg-[var(--color-bg-primary)] backdrop-blur-xl"),children:[(0,a.jsx)(o.P.div,{layout:!0,transition:{type:"spring",stiffness:400,damping:30},className:"absolute inset-y-1 rounded-full ".concat(c?"bg-ink/[0.10] shadow-[inset_0_1px_0_rgb(255_255_255/0.08)]":"bg-[var(--color-bg-secondary)] shadow-lg"," ").concat("character"===t?"left-[calc(50%+2px)] right-1":"left-1 right-[calc(50%+2px)]")}),s.map(e=>{let n=e.icon,o=t===e.value;return(0,a.jsxs)("button",{type:"button","aria-pressed":o,disabled:i,onClick:()=>r(e.value),className:"relative z-10 flex h-full flex-1 items-center justify-center gap-1.5 rounded-full text-xs font-satoshi-medium transition-all duration-200 ".concat(o?"scale-100 text-[var(--color-text-primary)]":"scale-95 text-[var(--color-text-quaternary)] hover:text-[var(--color-text-secondary)]"," ").concat(i?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[(0,a.jsx)(n,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:e.label})]},e.value)})]})})})}},87833:(e,t,r)=>{r.d(t,{u:()=>
1o});var a=r(31141),i=r(62897);let n=["image/jpeg","image/png","image/webp","image/gif"];function o(e){var t,r;let{onUpload:o,maxSizeBytes:s=0xa00000,acceptedTypes:l=n}=e,c=(0,a.useRef)(null),[d,m]=(0,a.useState)(!1),[u,p]=(0,a.useState)(null),g=(0,a.useRef)(0),h=(0,a.useCallback)(e=>{g.current+=1,p({message:e,key:g.current})},[]),x=(0,a.useCallback)(()=>{var e;null==(e=c.current)||e.click()},[]),f=(0,a.useCallback)(()=>{p(null)},[]),y=(0,a.useCallback)(async e=>{var t;let r=null==(t=e.target.files)?void 0:t[0];if(!r)return;if(e.target.value="",!l.includes(r.type))return void h("Please select a valid image (JPEG, PNG, WebP, or GIF)");let a=Math.round(s/1048576);if(r.size>s)return void h("Image must be less than ".concat(a,"MB"));p(null),m(!0);try{let e=await new Promise((e,t)=>{let a=new FileReader;a.onload=()=>{e(a.result.split(",")[1])},a.onerror=()=>t(Error("Failed to read file")),a.readAsDataURL(r)});await o(e,r.type)}catch(e){h((0,i.Qf)(e,"action").description)}finally{m(!1)}},[l,s,o,h]),b=l.join(","),v=(0,a.useCallback)(()=>({ref:c,type:"file",accept:b,onChange:y,className:"hidden"}),[b,y]);return{triggerFileSelect:x,handleFileSelect:y,isUploading:d,error:null!=(t=null==u?void 0:u.message)?t:null,errorKey:null!=(r=null==u?void 0:u.key)?r:0,clearError:f,getInputProps:v}}},88655:(e,t,r)=>{r.d(t,{SurfaceThemeProvider:()=>u,vp:()=>p,ec:()=>m});var a=r(29729),i=r(31141),n=r(37768),o=r(92487),s=r(3954),l=r(20066);function c(e){if("undefined"==typeof document)return;let t=window.location.hostname,r="";t.includes("novelx.ai")?r="; Domain=.novelx.ai":t.includes("novelx.cc")&&(r="; Domain=.novelx.cc"),document.cookie="".concat(l.Fd,"=").concat(encodeURIComponent((0,l.ap)(e)),"; max-age=").concat(l.ad,"; path=/").concat(r,"; SameSite=Lax")}let d=(0,i.createContext)({themeId:l.Ce,backgroundId:l.TW,className:"",supported:!0,withinSurface:!1,setSurfacePreview:()=>{},commitSurfacePreference:()=>{}});function m(){return(0,i.useContext)(d)}function u(e){var t,r,n,m,u,p;let{theme:g,background:h,children:x}=e,f=(0,o.IT)(s.FH.users.getMyProfile),y=(0,o.n_)(s.FH.users.updateSurfacePreferences),[b,v]=(0,i.useState)({}),[j,k]=(0,i.useState)({}),w=(0,i.useRef)(j);w.current=j;let N=(0,i.useRef)(!1),T=(0,l.fG)(null!=(n=null!=(r=null!=(t=b.theme)?t:j.theme)?r:null==f?void 0:f.surfaceTheme)?n:g),C=(0,l.cW)(null!=(p=null!=(u=null!=(m=b.background)?m:j.background)?u:null==f?void 0:f.surfaceBackground)?p:h),[S,P]=(0,i.useState)(!0);(0,i.useLayoutEffect)(()=>{(0,l.ex)()||P(!1)},[]);let F=S?T:l.Ce,E=(0,i.useCallback)(e=>{v(t=>({...t,...e}))},[]),L=(0,i.useCallback)(e=>{var t,r,a,i;let n=w.current;c({theme:(0,l.fG)(null!=(r=null!=(t=e.theme)?t:n.theme)?r:F),background:(0,l.cW)(null!=(i=null!=(a=e.background)?a:n.background)?i:C)}),k({...n,...e})},[F,C]);return(0,i.useEffect)(()=>{if(!f)return;let e=w.current;if(void 0!==e.theme||void 0!==e.background){N.current||(N.current=!0,y({...void 0!==e.theme?{theme:e.theme}:{},...void 0!==e.background?{background:e.background}:{}}));return}if(f.hasSurfacePreference)return void c({theme:f.surfaceTheme,background:f.surfaceBackground});let t=function(){var e;if("undefined"==typeof document)return null;
1let t=null==(e=document.cookie.split("; ").find(e=>e.startsWith("".concat(l.Fd,"="))))?void 0:e.slice(l.Fd.length+1);if(!t)return null;try{return(0,l.$5)(decodeURIComponent(t))}catch(e){return null}}();t&&(t.theme!==l.Ce||t.background!==l.TW)&&y({theme:t.theme,background:t.background})},[f,y]),(0,a.jsx)(d.Provider,{value:{themeId:F,backgroundId:C,className:(0,l.tr)(F),supported:S,withinSurface:!0,setSurfacePreview:E,commitSurfacePreference:L},children:x})}function p(){let{className:e}=m();return(0,i.useCallback)((t,r,i)=>(0,n.createPortal)(e?(0,a.jsx)("div",{className:e,children:t}):t,r,i),[e])}},91790:(e,t,r)=>{r.d(t,{BZ:()=>d,D:()=>x,FV:()=>h,IF:()=>p,P6:()=>m,Z8:()=>u,g2:()=>i,wm:()=>g,xR:()=>n});var a=r(46677);let i="custom:",n=10,o=[{id:"trope",title:"Tropes"},{id:"vibe",title:"Vibes"},{id:"fandom",title:"Worlds you know"},{id:"character",title:"What he is"},{id:"genre",title:"Genre"},{id:"setting",title:"Where"},{id:"spice",title:"Spice"}],s=["vibe","spice"],l=e=>t=>!e||function(e){return!s.includes(e.category)&&!e.isExplicit}(t),c=(e,t)=>{var r,a;return(null!=(r=t.popularity)?r:0)-(null!=(a=e.popularity)?a:0)};function d(e){return o.map(t=>{var r;return{...t,tags:(r=t.id,a.oe.filter(t=>t.category===r&&l(e)(t)).sort(c))}}).filter(e=>e.tags.length>0)}function m(e){return a.oe.filter(t=>"nationality"!==t.category&&l(e)(t)).sort(c).slice(0,14)}function u(e,t){let{clean:r,limit:i=12}=t,n=e.map(e=>(0,a.k$)(e)).filter(e=>!!e);if(0===n.length)return[];let o=n[0],s=new Map,c=new Set;for(let t of n)for(let r of t.relatedTags){var d;e.includes(r)||(s.set(r,(null!=(d=s.get(r))?d:0)+1),t.id===o.id&&c.add(r))}return Array.from(s.entries()).map(e=>{let[t,r]=e;return{tag:(0,a.k$)(t),relevance:r,isFromRecent:c.has(t)}}).filter(e=>!!e.tag&&l(r)(e.tag)).sort((e,t)=>{var r,a;return e.isFromRecent!==t.isFromRecent?e.isFromRecent?-1:1:e.relevance!==t.relevance?t.relevance-e.relevance:(null!=(r=t.tag.popularity)?r:0)-(null!=(a=e.tag.popularity)?a:0)}).slice(0,i).map(e=>e.tag)}function p(e,t){let{clean:r,limit:i=24}=t,n=e.trim().toLowerCase();return 0===n.length?[]:a.oe.filter(e=>l(r)(e)&&(e.name.toLowerCase().includes(n)||e.id.includes(n))).sort(c).slice(0,i)}function g(e){if(e.startsWith(i))return{id:e,name:e.slice(i.length),emoji:"â¨"};let t=(0,a.k$)(e);return t?{id:e,name:t.name,emoji:t.emoji}:{id:e,name:e,emoji:"â¨"}}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.random,r=m(e),i=r[Math.floor(t()*r.length)],n=i.relatedTags.map(e=>(0,a.k$)(e)).filter(t=>!!t&&"nationality"!==t.category&&l(e)(t)).sort(c).slice(0,6),o=n[Math.floor(t()*Math.max(n.length,1))];return o?[i.id,o.id]:[i.id]}function x(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}},91959:(e,t,r)=>{r.d(t,{R:()=>l});var a=r(31141),i=r(92487),n=r(26079),o=r(3954),s=r(91790);function l(e){var t,r,l;let{clean:c,writer:d}=e,m=(0,i.y3)(o.FH.ai.idea.ideasFromTags.generateIdeasFromTags),u=null!=d?d:m,[p,g]=(0,a.useState)([]),[h,x]=(0,a.useState)(""),[f,y]=(0,a.useState)({}),[b,v]=(0,a.useState)([]),[j,k]=(0,a.useState)(-1),[w,N]=(0,a.useState)(null),[T,C]=(0,a.useState)(null),[S,P]=(0,a.useState)(null),F=(0,a.useRef)(0),E=(0,a.useRef)([]),L=null!=(t=b[j])?t:null,R=null!==w,z=(0,a.useCallback)(e=>{g(t=>t.includes(e)?t.filter(t=>t!==e):[e,...t]),x("")},[]),M=(0,a.useCallback)(e=>{let t=e.trim();if(t.length<2)return;let r="".concat(s.g2).concat(t);g(e=>e.includes(r)?e:[r,...e]),x("")},[]),D=(0,a.useCallback)(()=>g([]),[]),A=(0,a.useCallback)(e=>{y(t=>({...t,[e]:!t[e]}))},[]),I=(0,a.useCallback)(async()=>{let e=0===p.length,t=e?(0,s.FV)(c):p.slice(),r=++F.current,a=L?L.ideas.flatMap(e=>[e.leadName,e.otherName]).filter(Boolean):void 0;N({tags:t,surprise:e}),C(null),P(null);try{let i=await u({selectedTags:t,count:2,surface:"web_door",...a&&a.length>0?{avoidNames:a}:{}});if(F.current!==r)return;let n=i.ideas.slice(0,2).map(e=>({idea:e.idea,title:e.title,leadName:e.leadName,otherName:e.otherName})),o=E.current.length;E.current=[...E.current,{tags:t,surprise:e,ideas:n}],v(E.current),k(o)}catch(e){if(F.current!==r)return;console.error("[idea-pool] generateIdeasFromTags failed:",e),C(function(e){if(e instanceof n.ik){let t=e.data;if("string"==typeof t&&t.length>0)return t;if(t&&"object"==typeof t&&"string"==typeof t.message)return t.message}return"The writer is out of reach right now. Try again in a moment."}(e))}finally{F.current===r&&N(null)}},[c,L,u,p]),H=(0,a.useCallback)(e=>{R||(k(t=>Math.max(0,Math.min(b.length-1,t+e))),P(null))},[b.length,R]),B=(0,a.useCallback)(e=>{!R&&(null==L?void 0:L.ideas[e])&&P(e)},[L,R]),_=(0,a.useCallback)(()=>{F.current+=1,E.current=[],g([]),x(""),y({}),v([]),k(-1),N(null),C(null),P(null)},[]),O=null!=(r=b[b.length-1])?r:null,W=p.length>0&&!!O&&!O.surprise&&(0,s.D)(O.tags,p),$=!!L&&(L.surprise?0===p.length:(0,s.D)(L.tags,p)),U=R&&
1!!L&&!!w&&!w.surprise&&(0,s.D)(L.tags,w.tags),G=null!==S&&null!=(l=null==L?void 0:L.ideas[S])?l:null;return(0,a.useMemo)(()=>({clean:c,picks:p,query:h,setQuery:x,expanded:f,pulls:b,index:j,current:L,pending:w,writing:R,error:T,chosen:S,chosenIdea:G,alreadyWritten:W,currentMatchesPicks:$,keepPairWhileWriting:U,toggle:z,addCustom:M,clearPicks:D,toggleSection:A,pull:I,page:H,choose:B,showLatest:()=>{k(b.length-1),P(null)},reset:_}),[M,W,B,S,G,c,D,L,$,T,f,j,U,H,w,p,I,b,h,_,z,A,R])}},95709:(e,t,r)=>{r.d(t,{HW:()=>d,XR:()=>u,ud:()=>m});var a=r(29729),i=r(26148),n=r(50928),o=r(87991),s=r(17561),l=r(77115),c=r(50786);let d="h-[min(46rem,calc(var(--visual-viewport-height,100dvh)-4rem))]",m=e=>e?"workbench":"wide";function u(e){let{isOpen:t,onClose:r,pool:u,step:p,onStepChange:g,onStart:h,onMakeItYours:x,isStarting:f=!1}=e,y=(0,l.d)("sm"),b=(0,l.d)("lg"),v=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Ne,{spread:"card"}),(0,a.jsx)("div",{className:"absolute right-3 top-3 z-10 sm:right-4 sm:top-4",children:(0,a.jsx)(o.J,{theme:"dark",size:"sm",onPress:r})}),(0,a.jsx)("div",{className:"relative min-h-0 flex-1",children:(0,a.jsx)(c.w5,{pool:u,layout:y&&b?"split":"steps",step:p,onStepChange:g,onBack:r,onStart:h,onMakeItYours:x,isStarting:f})})]});return(0,a.jsx)(i.mH,{placement:y?"center":"sheet",isOpen:t,onOpenChange:e=>!e&&r(),isDismissable:!0,children:(0,a.jsx)(i.aF,{className:y?d:void 0,children:(0,a.jsx)(i.lG,{"aria-label":"Find an idea",className:y?"h-full items-stretch":"h-full",children:y?(0,a.jsx)(s.Lj,{width:m(b),layout:"stack",className:"h-full",children:v}):(0,a.jsx)("div",{className:"relative flex h-full flex-col overflow-hidden rounded-t-[20px]",children:v})})})})}},95942:(e,t,r)=>{r.d(t,{F:()=>m});var a=r(29729),i=r(48224),n=r(39179),o=r(75923),s=r(63199),l=r(8662),c=r(81146);let d={story:{subtitle:"One or two lines is plenty. You can change everything later.",placeholder:"E.g., Penthouse 42. He's waiting. 'You came.' One night. No names tomorrowâ¦",submitLabel:"Start this story"},character:{subtitle:"Describe who they are â a name helps, if you have one.",placeholder:"A dangerous man named Viktor who runs the city's underworld but can't stop thinking about the woman who got awayâ¦",submitLabel:"Bring them to life"}};function m(e){let{mode:t,onModeChange:r,value:m,onValueChange:u,onSubmit:p,onSurprise:g,onBrowseIdeas:h,browseIdeasLabel:x="Browse ideas",onBackToIdeas:f,isBusy:y=!1,minLength:b=10}=e,v=d[t],j=m.trim().length>=b&&!y;return(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[f&&(0,a.jsx)("div",{className:"-mb-2",children:(0,a.jsx)(l.$,{color:"link-gray",size:"sm",iconLeading:i.J,onClick:f,isDisabled:y,children:"Back to the ideas"})}),(0,a.jsxs)("header",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("h2",{className:"font-editors-note text-[26px] leading-tight text-[var(--color-text-primary)] sm:text-[30px]",children:"Start something new"}),(0,a.jsx)("p",{className:"text-sm font-satoshi-regular text-[var(--color-text-tertiary)]",children:v.subtitle})]}),(0,a.jsx)(c.p,{mode:t,onModeChange:r,disabled:y,variant:"glass"}),(0,a.jsxs)("div",{className:"rounded-[18px] border border-ink/10 bg-ink/[0.03] p-4 transition-colors focus-within:border-[var(--color-border-brand)] sm:p-5",children:[(0,a.jsx)("label",{htmlFor:"start-something-input",className:"sr-only",children:"story"===t?"Describe your story idea":"Describe your character"}),(0,a.jsx)("textarea",{id:"start-something-input",value:m,onChange:e=>u(e.target.value),placeholder:v.placeholder,disabled:y,rows:4,className:"w-full resize-none bg-transparent text-[15px] leading-relaxed font-satoshi-regular text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-quaternary)] disabled:opacity-60"}),(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-1",children:[g&&(0,a.jsx)(l.$,{color:"tertiary",size:"sm",iconLeading:n.I,onClick:g,isDisabled:y,children:"Surprise me"}),h&&(0,a.jsx)(l.$,{color:"tertiary",size:"sm",iconLeading:o.i,onClick:h,isDisabled:y,children:x}),(0,a.jsx)(l.$,{color:"white",shape:"pill",size:"md",className:"ml-auto",iconLeading:s.Q,"aria-label":v.submitLabel,onClick:p,isDisabled:!j})]})]})]})}},99248:(e,t,r)=>{r.d(t,{U:()=>C});var a=r(29729),i=r(31141),n=r(77573),o=r(66149),s=r(26148),l=r(8662),c=r(17561),d=r(87991),m=r(60828),u=r(5518),p=r(91852),g=r(63699),h=r(92487),x=r(3954),f=r(95881),y=r(32435),b=r(7113),v=r(62897),j=r(44078),k=r(87833);let w=e=>{let{className:t}=e;
1return(0,a.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})},N=e=>{let{className:t}=e;return(0,a.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.jsx)("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"})})};function T(e){let{currentUsername:t,usernameChangedAt:r}=e,[s,l]=(0,i.useState)(!1),[c,d]=(0,i.useState)(""),[m,p]=(0,i.useState)(!1),[g,b]=(0,i.useState)(!1),j=(0,i.useRef)(null),k=(0,h.n_)(x.FH.users.changeUsername),[w,N]=(0,i.useState)("");(0,i.useEffect)(()=>{if(!s)return;let e=setTimeout(()=>N(c),300);return()=>clearTimeout(e)},[c,s]);let T=s&&w.length>=3&&w!==t,C=(0,h.IT)(x.FH.users.checkUsernameAvailability,T?{username:w}:"skip"),{inCooldown:S,daysRemaining:P}=function(e){if(!e)return{inCooldown:!1,daysRemaining:0};let t=Date.now()-e;return t>=2592e6?{inCooldown:!1,daysRemaining:0}:{inCooldown:!0,daysRemaining:Math.ceil((2592e6-t)/864e5)}}(r),F=c!==w,E=c===t,L=c.length>0&&c.length<3,R=!L&&!E&&!F&&(null==C?void 0:C.available)===!0,z=!L&&!E&&!F&&(null==C?void 0:C.available)===!1,M=!L&&!E&&(F||T&&void 0===C),D=R&&!m,A=(0,i.useCallback)(()=>{if(S){b(!0),setTimeout(()=>b(!1),2500);return}d(t),N(t),l(!0),requestAnimationFrame(()=>{var e,t;null==(e=j.current)||e.focus(),null==(t=j.current)||t.select()})},[t,S]),I=(0,i.useCallback)(()=>{l(!1),d(""),N("")},[]),H=(0,i.useCallback)(async()=>{if(D){p(!0);try{await k({username:c}),l(!1),f.oR.custom(e=>(0,a.jsx)(y.Zx,{title:"Username updated",description:"You're now @".concat(c),color:"success",onClose:()=>f.oR.dismiss(e)}))}catch(e){f.oR.custom(t=>(0,a.jsx)(y.Zx,{title:"Couldn't change username",description:(0,v.Qf)(e).description,color:"error",onClose:()=>f.oR.dismiss(t)}))}finally{p(!1)}}},[D,c,k]),B=(0,i.useCallback)(e=>{"Enter"===e.key&&D?(e.preventDefault(),H()):"Escape"===e.key&&(e.preventDefault(),I())},[D,H,I]),_=(0,i.useCallback)(e=>{d(e.target.value.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,20))},[]);return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(n.N,{mode:"wait",initial:!1,children:s?(0,a.jsxs)(o.P.div,{initial:{opacity:0,y:-2},animate:{opacity:1,y:0},exit:{opacity:0,y:-2},transition:{duration:.15},className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"text-sm text-ink/25 font-satoshi-regular select-none",children:"@"}),(0,a.jsx)("input",{ref:j,type:"text",value:c,onChange:_,onKeyDown:B,onBlur:()=>{m||I()},className:"bg-transparent text-sm text-ink font-satoshi-regular outline-none min-w-0 placeholder:text-ink/20 caret-[var(--color-brand-400)]",style:{width:"".concat(Math.max(c.length+1,5),"ch")},placeholder:"username",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1}),(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,a.jsxs)(n.N,{mode:"wait",children:[M&&(0,a.jsx)(o.P.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.1},children:(0,a.jsx)("div",{className:"w-3 h-3 border border-ink/20 border-t-ink/60 rounded-full animate-spin"})},"checking"),R&&(0,a.jsx)(o.P.div,{initial:{opacity:0,scale:.5}
1,animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:500,damping:25},children:(0,a.jsx)("div",{className:"w-3 h-3 rounded-full bg-emerald-400"})},"available"),(z||L)&&!E&&c.length>0&&(0,a.jsx)(o.P.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:500,damping:25},children:(0,a.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-400"})},"error")]}),D&&(0,a.jsx)(o.P.button,{type:"button",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:500,damping:25},onMouseDown:e=>{e.preventDefault(),H()},className:"w-5 h-5 rounded-full bg-emerald-500/20 flex items-center justify-center hover:bg-emerald-500/30 transition-colors",children:(0,a.jsx)(u.J,{className:"w-3 h-3 text-emerald-400",strokeWidth:3})}),m&&(0,a.jsx)("div",{className:"w-5 h-5 flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-3 h-3 border border-ink/20 border-t-emerald-400 rounded-full animate-spin"})})]})]},"edit"):(0,a.jsxs)(o.P.button,{type:"button",onClick:A,initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"group flex items-center gap-1 cursor-pointer rounded-md -mx-1 px-1 py-0.5 hover:bg-ink/[0.04] transition-colors",children:[(0,a.jsxs)("span",{className:"text-sm text-ink/40 group-hover:text-ink/55 transition-colors font-satoshi-regular",children:["@",t]}),(0,a.jsx)("svg",{"aria-hidden":"true",className:"w-2.5 h-2.5 text-ink/30 group-hover:text-ink/55 transition-colors flex-shrink-0",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M8.5 1.5l2 2M1 11l.7-2.8L8.5 1.5l2 2-6.8 6.7L1 11z"})})]},"display")}),(0,a.jsxs)(n.N,{children:[s&&L&&(0,a.jsx)(o.P.p,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"text-[11px] text-red-400/70 mt-0.5 font-satoshi-regular",children:"3 characters minimum"}),s&&z&&(0,a.jsx)(o.P.p,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"text-[11px] text-red-400/70 mt-0.5 font-satoshi-regular",children:"Already taken"})]}),(0,a.jsx)(n.N,{children:g&&(0,a.jsx)(o.P.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2},className:"absolute top-full left-0 mt-1.5 px-2.5 py-1.5 rounded-lg bg-ink/[0.08] border border-ink/[0.08] backdrop-blur-sm whitespace-nowrap z-10",children:(0,a.jsxs)("p",{className:"text-[11px] text-ink/50 font-satoshi-regular",children:["You can change again in ",P," day",1===P?"":"s"]})})})]})}function C(e){let{isOpen:t,onClose:r}=e,v=(0,c.KQ)("form-edit"),C=(0,h.IT)(x.FH.profiles.getMyProfileSettings),S=(0,h.n_)(x.FH.profiles.updateMyProfile),P=(0,h.y3)(x.FH.avatarUpload.uploadAvatar),F=(0,h.y3)(x.FH.avatarUpload.removeAvatar),E=(0,j.vm)(),[L,R]=(0,i.useState)(!1),{triggerFileSelect:z,isUploading:M,error:D,errorKey:A,getInputProps:I}=(0,k.u)({onUpload:async(e,t)=>{await P({imageData:e,mimeType:t})}});(0,i.useEffect)(()=>{D&&f.oR.custom(e=>(0,a.jsx)(y.Zx,{title:"Upload failed",description:D,color:"error",onClose:()=>f.oR.dismiss(e)}))},[A]);let[H,B]=(0,i.useState)(""),[_,O]=(0,i.useState)(!0),[W,$]=(0,i.useState)(""),[U,G]=(0,i.useState)(""),[q,V]=(0,i.useState)(""),[J,Z]=(0,i.useState)(!1),[K,Y]=(0,i.useState)(!1),[Q,X]=(0,i.useState)(!1),ee=(0,i.useRef)(!1);(0,i.useEffect)(()=>{if(C&&!ee.current){var e,t,r,a,i,n;B(C.bio),O(C.isProfilePublic),$(null!=(a=null==(e=C.socialLinks)?void 0:e.twitter)?a:""),G(null!=(i=null==(t=C.socialLinks)?void 0:t.instagram)?i:""),V(null!=(n=null==(r=C.socialLinks)?void 0:r.website)?n:""),ee.current=!0}},[C]),(0,i.useEffect)(()=>{if(C){var e,t,r,a,i,n;X(H!==C.bio||_!==C.isProfilePublic||W!==(null!=(a=null==(e=C.socialLinks)?void 0:e.twitter)?a:"")||U!==(null!=(i=null==(t=C.socialLinks)?void 0:t.instagram)?i:"")||q!==(null!=(n=null==(r=C.socialLinks)?void 0:r.website)?n:""))}},[H,_,W,U,q,C]);let et=async()=>{Z(!0);try{await S({bio:H.trim(),isProfilePublic:_,socialLinks:{twitter:W.trim()||void 0,instagram:U.trim()||void 0,website:q.trim()||void 0}}),Y(!0),setTimeout(()=>{er()},1200)}catch(e){console.error("Failed to update profile:",e),f.oR.custom(e=>(0,a.jsx)(y.Zx,{title:"Failed to save",description:"Please try again.",color:"error",onClose:()=>f.oR.dismiss(e)})),Z(!1)}},er=()=>{Z(!1),Y(!1),ee.current=!1,r()},ea=async()=>{R(!0);try{await F()}catch(e){f.oR.custom(e=>(0,a.jsx)(y.Zx,{title:"Failed to remove",description:"Please try again.",color:"error",onClose:()=>f.oR.dismiss(e)}))}finally{R(!1)}},ei=M||L;if(!t)return null;let en=H.length,eo=(null==C?void 0:C.name)||(null==C?void 0:C.username)||"You",es=null==C?void 0:C.avatarUrl;return(0,a.jsx)(s.mH,{isOpen:t,onOpenChange:er,isDismissable:!0,children:(0,a.jsx)(s.aF,{className:c.Ve,children:(0,a.jsx)(s.lG,{children:(0,a.jsxs)(c.Lj,{width:v.width,layout:v.layout,children:[(0,a.jsx)("div",{className:"absolute top-3 right-3 sm:top-4 sm:right-4 z-10",children:(0,a.jsx)(d.J,{theme:"dark",size:"sm",onPress:er})}),(0,a.jsx)("div",{className:"relative flex-1 overflow-y-auto",children:(0,a.jsx)(n.N,{mode:"wait",children:K?(0,a.jsxs)(o.P.div,{initial:{opacity:0,y:10}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex flex-col items-center justify-center py-12 px-6 sm:py-16 sm:px-8",children:[(0,a.jsx)(o.P.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:400,damping:20,delay:.1},className:"relative mb-6",children:(0,a.jsx)(c.wX,{icon:u.J,tone:"quiet"})}),(0,a.jsx)(c.L3,{job:"confirm",description:(0,a.jsx)(a.Fragment,{children:"Your profile is ready for readers"}),children:"Looking good"})]},"success"):(0,a.jsxs)(o.P.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"px-5 pt-14 pb-5 sm:px-8 sm:pt-14 sm:pb-8",children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsxs)("div",{className:"relative p-6 pb-4 rounded-2xl bg-gradient-to-br from-ink/[0.08] to-ink/[0.02] border border-ink/[0.08]",children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1.5 flex-shrink-0",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("div",{className:"relative w-14 h-14 rounded-full bg-gradient-to-br from-purple-500 to-indigo-600 flex items-center justify-center overflow-hidden group",children:[es?(0,a.jsx)("img",{src:es,alt:"",className:"w-full h-full rounded-full object-cover"}):(0,a.jsx)("span",{className:"text-lg font-editors-note text-white select-none",children:(0,b.I)((null==C?void 0:C.username)||(null==C?void 0:C.name))||(0,a.jsx)(p.f,{className:"w-6 h-6 text-ink/60"})}),!E&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("button",{type:"button",onClick:z,disabled:ei,"aria-label":es?"Change photo":"Add a photo",className:"absolute inset-0 rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center cursor-pointer",children:(0,a.jsx)(g.E,{className:"w-5 h-5 text-white"})})}),ei&&(0,a.jsx)("div",{className:"absolute inset-0 rounded-full bg-black/60 flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-5 h-5 border-2 border-ink/30 border-t-white rounded-full animate-spin"})})]}),!E&&!ei&&(0,a.jsx)(m.$,{onPress:z,"aria-label":es?"Change photo":"Add a photo",className:"absolute -bottom-1 -right-1 flex size-6 items-center justify-center rounded-full border border-ink/15 bg-[var(--color-bg-primary)] text-ink/70 outline-none transition-colors hover:text-ink focus-visible:ring-2 focus-visible:ring-ink/25 before:absolute before:-inset-2 before:content-['']",children:(0,a.jsx)(g.E,{className:"size-3.5"})})]}),!E&&!(null==C?void 0:C.avatarUrl)&&(0,a.jsx)(m.$,{onPress:z,isDisabled:ei,className:"text-[10px] text-ink/30 hover:text-ink/60 transition-colors cursor-pointer outline-none focus-visible:underline",children:"Add photo"}),!E&&(null==C?void 0:C.avatarUrl)&&(0,a.jsx)("button",{type:"button",onClick:ea,disabled:ei,className:"text-[10px] text-ink/30 hover:text-ink/60 transition-colors cursor-pointer",children:"Remove"}),!E&&(0,a.jsx)("input",{...I()})]}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"text-lg font-satoshi-medium text-white truncate",children:eo}),(0,a.jsx)(T,{currentUsername:(null==C?void 0:C.username)||"username",usernameChangedAt:null==C?void 0:C.usernameChangedAt})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-4 pt-4 border-t border-ink/[0.06]",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-ink/[0.06] flex items-center justify-center transition-opacity ".concat(W?"opacity-100":"opacity-30"),children:(0,a.jsx)(w,{className:"w-3.5 h-3.5 text-ink/50"})}),(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-ink/[0.06] flex items-center justify-center transition-opacity ".concat(U?"opacity-100":"opacity-30"),children:(0,a.jsx)(N,{className:"w-3.5 h-3.5 text-ink/50"})})]}),(0,a.jsx)("div",{className:"absolute top-4 right-4",children:(0,a.jsx)(o.P.div,{animate:{backgroundColor:_?"rgba(52, 211, 153, 0.15)":"rgba(255, 255, 255, 0.06)",borderColor:_?"rgba(52, 211, 153, 0.3)":"rgba(255, 255, 255, 0.1)"},className:"px-2.5 py-1 rounded-full border text-xs font-satoshi-medium",children:(0,a.jsx)("span",{className:_?"text-emerald-400":"text-ink/40",children:_?"Public":"Private"})})})]})}),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("label",{className:"text-sm font-satoshi-medium text-ink/60",children:"Bio"}),(0,a.jsxs)("span",{className:"text-xs tabular-nums ".concat(en>450?"text-amber-400":"text-ink/30"),children:[en,"/",500]})]}),(0,a.jsx)("textarea",{value:H,onChange:e=>B(e.target.value),maxLength:500,rows:3,placeholder:"Tell your readers about yourself...",className:"w-full px-4 py-3.5 rounded-xl bg-ink/[0.04] border border-ink/[0.08] text-ink placeholder:text-ink/25 font-satoshi-regular text-sm resize-none focus:outline-none focus:bg-ink/[0.06] focus:border-ink/[0.12] transition-all leading-relaxed"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-4 mb-6 border-y border-ink/[0.06]",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-satoshi-medium text-white",children:"Public profile"}),(0,a.jsxs)("p",{className:"text-xs text-ink/40 mt-0.5",children:["Visible at /u/",(null==C?void 0:C.username)||"you"]})]}),(0,a.jsx)("button",{onClick:()=>O(!_),className:"\n relative w-11 h-6 rounded-full transition-all duration-300 ease-out\n ".concat(_?"bg-[var(--color-brand-500)]":"bg-ink/10","\n "),children:(0,a.jsx)(o.P.span,{layout:!0,transition:{type:"spring",stiffness:500,damping:30},className:"\n absolute top-1 w-4 h-4 rounded-full shadow-lg\n ".concat(_?"left-6 bg-white":"left-1 bg-ink/50","\n ")})})]}),(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("label",{className:"text-sm font-satoshi-medium text-white block mb-4",children:"Social links"}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 group",children:[(0,a.jsx)("div",{className:"w-9 h-9 rounded-full bg-ink/[0.04] border border-ink/[0.08] flex items-center justify-center group-focus-within:border-ink/[0.15] transition-colors",children:(0,a.jsx)(w,{className:"w-4 h-4 text-ink/40 group-focus-within:text-ink/60 transition-colors"})}),(0,a.jsx)("input",{type:"text",value:W,onChange:e=>$(e.target.value),placeholder:"X username",className:"flex-1 px-0 py-2 bg-transparent border-0 border-b border-ink/[0.06] text-ink placeholder:text-ink/25 font-satoshi-regular text-sm focus:outline-none focus:border-ink/[0.15] transition-colors"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 group",children:[(0,a.jsx)("div",{className:"w-9 h-9 rounded-full bg-ink/[0.04] border border-ink/[0.08] flex items-center justify-center group-focus-within:border-ink/[0.15] transition-colors",children:(0,a.jsx)(N,{className:"w-4 h-4 text-ink/40 group-focus-within:text-ink/60 transition-colors"})}),(0,a.jsx)("input",{type:"text",value:U,onChange:e=>G(e.target.value),placeholder:"Instagram username",className:"flex-1 px-0 py-2 bg-transparent border-0 border-b border-ink/[0.06] text-ink placeholder:text-ink/25 font-satoshi-regular text-sm focus:outline-none focus:border-ink/[0.15] transition-colors"})]})]})]}
1),(0,a.jsx)(l.$,{color:v.act,size:"md",className:"w-full",onClick:et,isDisabled:!Q||J,isLoading:J,children:Q?"Save changes":"No changes"})]},"form")})})]})})})})}}}]);
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.