PageSourceSearch

https://mytattooideas.ai/_next/static/chunks/7547-242ec8ffed43cbba.js?dpl=dpl_38BFcddfYt2nCo5X1aQ7FDeJEjEE

js mytattooideas.ai collected 2026-10-05 13:10:04 UTC 54,543 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7547],{40573:(e,t,a)=>{"use strict";a.d(t,{HeroGenerator:()=>K});var l=a(45172),s=a(72440),i=a(70611),r=a(34828),n=a(21312),o=a(13533),c=a(58956);function d({value:e,onChange:t,options:a,loading:i=!1,dark:d=!1,label:u="Preferred Style",placeholder:m="Select a style"}){let[p,h]=(0,s.useState)(!1),g=a.find(t=>t.slug===e||t.title===e),x=e=>{t(e.slug),h(!1)};return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:(0,n.cn)("text-sm font-medium",d?"text-white/70":"text-neutral-700"),children:u}),(0,l.jsxs)(c.rI,{open:p,onOpenChange:h,children:[(0,l.jsx)(c.ty,{asChild:!0,children:(0,l.jsxs)("button",{type:"button",title:g?.title,className:(0,n.cn)("w-full border px-3 py-3 text-xs focus:outline-none focus:ring-2 focus:ring-purple-500 flex items-center justify-between gap-1.5",d?"border-white/20 bg-white/10 text-white hover:bg-white/15":"border-neutral-300 bg-white text-black hover:bg-neutral-50"),children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:g?.image?(0,l.jsx)(o.default,{src:g.image,alt:g.title,width:16,height:16,className:"object-contain max-w-full max-h-full"}):(0,l.jsx)(r.default,{name:"RiInkBottleLine",className:(0,n.cn)("h-4 w-4",d?"text-white/60":"text-neutral-500")})}),(0,l.jsx)("span",{className:(0,n.cn)("truncate leading-tight",g?"":d?"text-white/50":"text-neutral-500"),children:g?g.title:m})]}),(0,l.jsx)(r.default,{name:"RiArrowDownSLine",className:(0,n.cn)("h-4 w-4 flex-shrink-0 transition-transform",p&&"rotate-180",d?"text-white/60":"text-neutral-500")})]})}),(0,l.jsx)(c.SQ,{className:"w-[360px] max-h-[400px] overflow-y-auto p-3 !z-[9999]",side:"bottom",align:"start",sideOffset:4,children:i?(0,l.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,l.jsx)(r.default,{name:"RiLoader4Line",className:"h-6 w-6 animate-spin text-purple-500"}),(0,l.jsx)("span",{className:"ml-2 text-sm text-neutral-600",children:"Loading styles..."})]}):0===a.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-neutral-500",children:[(0,l.jsx)(r.default,{name:"RiEmotionSadLine",className:"h-8 w-8 mb-2"}),(0,l.jsx)("p",{className:"text-sm",children:"No styles available"})]}):(0,l.jsx)("div",{className:"grid grid-cols-3 gap-2",children:a.map(t=>(0,l.jsxs)("button",{type:"button",onClick:()=>x(t),className:(0,n.cn)("relative group overflow-hidden border-2 transition-all hover:scale-[1.02]",e===t.slug||e===t.title?"border-purple-500 ring-2 ring-purple-500/20":"border-neutral-200 hover:border-purple-300"),children:[(0,l.jsxs)("div",{className:"aspect-square bg-gradient-to-br from-neutral-50 to-neutral-100 relative",children:[t.image?(0,l.jsx)(o.default,{src:t.image,alt:t.title,fill:!0,className:"object-contain p-2"}):(0,l.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,l.jsx)(r.default,{name:"RiImageLine",className:"h-12 w-12 text-neutral-300"})}),t.isPro&&(0,l.jsxs)("div",{className:"absolute top-2 right-2 px-2 py-0.5 bg-gradient-to-r from-purple-500 to-purple-600 text-white text-xs font-semibold flex items-center gap-1",children:[(0,l.jsx)(r.default,{name:"RiVipCrownLine",className:"h-3 w-3"}),(0,l.jsx)("span",{children:"PRO"})]}),(e===t.slug||e===t.title)&&(0,l.jsx)("div",{className:"absolute top-2 left-2 w-6 h-6 bg-purple-500 flex items-center justify-center",children:(0,l.jsx)(r.default,{name:"RiCheckLine",className:"h-4 w-4 text-white"})})]}),(0,l.jsx)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/90 via-black/70 to-transparent pt-8 pb-2 px-3",children:(0,l.jsx)("p",{className:"text-white text-sm font-medium line-clamp-2 leading-tight",children:t.title})})]},t.id))})})]})]})}var u=a(77378);let m={"black-grey-realism":"/imgs/styles/thumbs/black-grey-realism.webp","neo-traditional":"/imgs/styles/thumbs/neo-traditional.webp","american-traditional":"/imgs/styles/thumbs/american-traditional.webp","fine-line":"/imgs/styles/thumbs/fine-line.webp",irezumi:"/imgs/styles/thumbs/irezumi.webp","dark-art-sketch":"/imgs/styles/thumbs/dark-art-sketch.webp",watercolor:"/imgs/styles/thumbs/watercolor.webp",blackwork:"/imgs/styles/thumbs/blackwork.webp",geometric:"/imgs/styles/thumbs/geometric.webp",surrealism:"/imgs/styles/thumbs/surrealism.webp",biomechanical:"/imgs/styles/thumbs/biomechanical.webp",engraving:"/imgs/styles/thumbs/engraving.webp"};
1function p({value:e,onChange:t,dark:a,label:s="Style"}){let i=u.dp.map(e=>{let t=e.slug;return{id:e.slug,title:e.label,slug:t,image:m[t]??"/imgs/styles/thumbs/black-grey-realism.webp",isPro:!1}});return(0,l.jsx)(d,{value:e,onChange:e=>t?.(e),options:i,loading:!1,dark:a,label:s,placeholder:"Choose your preferred style"})}var h=a(60017);let g={"full-sleeve":"/imgs/body-parts/thumbs/full-sleeve.webp","upper-arm":"/imgs/body-parts/thumbs/upper-arm.webp",forearm:"/imgs/body-parts/thumbs/forearm.webp","inner-forearm":"/imgs/body-parts/thumbs/inner-forearm.webp","upper-back":"/imgs/body-parts/thumbs/upper-back.webp",spine:"/imgs/body-parts/thumbs/spine.webp",chest:"/imgs/body-parts/thumbs/chest.webp",sternum:"/imgs/body-parts/thumbs/sternum.webp",ribs:"/imgs/body-parts/thumbs/ribs.webp","leg-sleeve":"/imgs/body-parts/thumbs/leg-sleeve.webp",thigh:"/imgs/body-parts/thumbs/thigh.webp",calf:"/imgs/body-parts/thumbs/calf.webp"},x={"full-sleeve":"/imgs/body-parts/full-sleeve.png","upper-arm":"/imgs/body-parts/upper-arm.png",forearm:"/imgs/body-parts/forearm.png","inner-forearm":"/imgs/body-parts/inner-forearm.png","upper-back":"/imgs/body-parts/upper-back.png",spine:"/imgs/body-parts/spine.png",chest:"/imgs/body-parts/chest.png",sternum:"/imgs/body-parts/sternum.png",ribs:"/imgs/body-parts/ribs.png","leg-sleeve":"/imgs/body-parts/leg-sleeve.png",thigh:"/imgs/body-parts/thigh.png",calf:"/imgs/body-parts/calf.png"},f="/imgs/placeholders/body-default.png";function b({value:e,onChange:t,dark:a,label:s="Placement"}){let i=u.cB.map(e=>({id:e.id,title:e.label,slug:e.id,image:g[e.id]??x[e.id]??f,fallbackImage:x[e.id]??f,isPro:!1}));return(0,l.jsx)(h.N,{value:e,onChange:e=>t?.(e),options:i,loading:!1,dark:a,label:s,placeholder:"Choose placement area"})}var w=a(96376);let y={queuing:{label:"Queueing",color:"bg-blue-100 text-blue-700",icon:"RiTimeLine"},rendering:{label:"Rendering",color:"bg-purple-100 text-purple-700",icon:"RiLoader4Line"},uploading:{label:"Uploading",color:"bg-indigo-100 text-indigo-700",icon:"RiUploadLine"},success:{label:"Done",color:"bg-green-100 text-green-700",icon:"RiCheckLine"},failed:{label:"Failed",color:"bg-red-100 text-red-700",icon:"RiErrorWarningLine"}};function v({tasks:e,onRetry:t,onDownload:a,maxVisible:i=3,compact:r=!1,thumbnailOnly:o=!1,placeholderImages:c,onSelectImage:d,fetchImageDataUrl:u}){let[m,p]=(0,s.useState)(!1),h=m?e:e.slice(0,i);if(o){let e=h.filter(e=>e.imageUrl).map(e=>({id:e.id,url:e.imageUrl})),t=e.length>0?e:(c??[]).map((e,t)=>({id:`placeholder-${t}`,url:e}));return(0,l.jsx)("div",{className:"flex gap-3 pt-4 border-t border-gray-200",children:t.map(e=>(0,l.jsx)("button",{type:"button",onClick:()=>d?.(e.url),className:"relative w-16 h-16 bg-[#f5f5f5] border border-gray-200 hover:border-purple-400 transition-colors",children:(0,l.jsx)(w.ImageWithFallback,{src:e.url,alt:"Generated concept",fill:!0,className:"object-cover",sizes:"64px",fetchImageDataUrl:u,loadingLabel:"Loading thumbnail…",loadingVariant:"minimal"})},e.id))})}return 0===e.length?null:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("h3",{className:"text-sm font-semibold text-gray-700",children:["Recent Generations (",e.length,")"]}),e.length>i&&(0,l.jsx)("button",{onClick:()=>p(!m),className:"text-xs text-purple-600 hover:text-purple-700 font-medium",children:m?"Show Less":`Show All (${e.length})`})]}),(0,l.jsx)("div",{className:(0,n.cn)("space-y-2",r&&"space-y-1.5"),children:h.map(e=>(0,l.jsx)(j,{task:e,onRetry:t,onDownload:a,compact:r,fetchImageDataUrl:u},e.id))})]})}function j({task:e,onRetry:t,onDownload:a,compact:s,fetchImageDataUrl:i}){let o=y[e.status],c="queuing"===e.status||"rendering"===e.status||"uploading"===e.status;return(0,l.jsxs)("div",{className:(0,n.cn)("flex gap-3 p-3 bg-white rounded-lg border border-gray-200 hover:border-gray-300 transition-colors",s&&"p-2"),children:[(0,l.jsx)("div",{className:(0,n.cn)("relative flex-shrink-0 rounded-md overflow-hidden bg-gray-100",s?"w-12 h-12":"w-16 h-16"),children:e.imageUrl&&"success"===e.status?(0,l.jsx)(w.ImageWithFallback,{src:e.imageUrl,alt:e.prompt,fill:!0,className:"object-cover",sizes:s?"48px":"64px",fetchImageDataUrl:i,loadingLabel:"Loading preview…",loadingVariant:s?"minimal"
1:"full"}):(0,l.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:c?(0,l.jsx)("div",{className:"animate-spin",children:(0,l.jsx)(r.default,{name:o.icon,className:"h-5 w-5 text-purple-600"})}):(0,l.jsx)(r.default,{name:o.icon,className:(0,n.cn)("h-5 w-5","failed"===e.status?"text-red-500":"text-gray-400")})})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0 space-y-1",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,l.jsx)("p",{className:(0,n.cn)("text-sm text-gray-700 font-medium truncate",s&&"text-xs"),children:e.prompt}),(0,l.jsx)("span",{className:(0,n.cn)("flex-shrink-0 px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wider",o.color),children:o.label})]}),e.error&&(0,l.jsx)("p",{className:"text-xs text-red-600 line-clamp-1",children:e.error}),"success"===e.status&&e.imageUrl&&(0,l.jsx)("div",{className:"flex gap-2 mt-2",children:a&&(0,l.jsxs)("button",{onClick:()=>a(e.id,e.imageUrl),className:"text-xs text-purple-600 hover:text-purple-700 font-medium flex items-center gap-1",children:[(0,l.jsx)(r.default,{name:"RiDownloadLine",className:"h-3 w-3"}),"Download"]})}),"failed"===e.status&&t&&(0,l.jsxs)("button",{onClick:()=>t(e.id),className:"text-xs text-purple-600 hover:text-purple-700 font-medium flex items-center gap-1 mt-1",children:[(0,l.jsx)(r.default,{name:"RiRefreshLine",className:"h-3 w-3"}),"Retry"]}),!s&&(0,l.jsx)("p",{className:"text-[10px] text-gray-500",children:new Date(e.createdAt).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})]})]})}var k=a(98894),N=a(31121),C=a(93743),R=a(91136);let S={square:{container:"w-full max-w-[520px] mx-auto",aspect:"aspect-square"},portrait:{container:"w-full max-w-[560px] mx-auto",aspect:"aspect-[3/4]"},landscape:{container:"w-full max-w-3xl mx-auto",aspect:"aspect-[16/9]"}};function P({previewUrl:e,baseImageUrl:t=null,fallbackImage:a,size:n="square",activeTask:o,lastGeneratedAt:d,onDownload:u,onEditPrompt:m,onRemix:p,onFavorite:h,onShare:g,taskId:x,taskQueue:f,currentTaskId:b,onApplyEdit:y,isEditPending:v,editError:j,fetchImageDataUrl:P,isPending:L=!1,className:T="",defaultStyleSlug:U,defaultStyleLabel:I,defaultBodyPart:E,defaultTheme:D,defaultCustomText:M}){let[$,A]=(0,s.useState)(!1),[_,F]=(0,s.useState)(!1),[z,B]=(0,s.use
1State)(""),[O,G]=(0,s.useState)(null),[q,W]=(0,s.useState)(!1),[V,H]=(0,s.useState)(!1),[Q,Y]=(0,s.useState)("line"),[J,K]=(0,s.useState)(!1),[Z,X]=(0,s.useState)(null),ee=S[n],et=e??t??a,[ea,el]=(0,s.useState)(et),[es,ei]=(0,s.useState)(null),er=!!e,en=z.trim().length>0,eo=(0,k.useRouter)(),ec=(0,k.useParams)(),ed=ec?.locale,eu=Array.isArray(ed)?ed[0]:"string"==typeof ed?ed:"en",em=b&&f?.find(e=>e.id===b)||x&&f?.find(e=>e.id===x)||f?.find(e=>"success"===e.status&&e.imageUrl)||null;(0,s.useEffect)(()=>{if(d&&er&&!L&&!o){K(!0);let e=window.setTimeout(()=>K(!1),8e3);return()=>window.clearTimeout(e)}J&&(!er||L||o)&&K(!1)},[d,er,L,o,J]);let ep=(0,s.useCallback)(()=>{K(!1)},[]);(0,s.useEffect)(()=>{if(el(et),e){let e=new window.Image;e.crossOrigin="anonymous",e.onload=()=>{let t=document.createElement("canvas");t.width=e.width,t.height=e.height;let a=t.getContext("2d");if(!a)return;a.drawImage(e,0,0);let l=a.getImageData(0,0,e.width,e.height).data,s=e.width,i=e.height,r=0,n=0,o=!1;for(let t=0;t<e.height;t++)for(let a=0;a<e.width;a++){let c=(t*e.width+a)*4,d=l[c],u=l[c+1],m=l[c+2];(d<236||u<236||m<236)&&(o=!0,a<s&&(s=a),a>r&&(r=a),t<i&&(i=t),t>n&&(n=t))}o?ei({bounds:{x:s,y:i,width:r-s+1,height:n-i+1},originalWidth:e.width,originalHeight:e.height}):ei(null)},e.onerror=()=>{ei(null)},e.src=et}else ei(null)},[et,e]);let eh=()=>{er&&y&&!v&&!q&&(F(!0),B(""),G(null),m?.())},eg=async()=>{if(!y)return;let e=z.trim();if(!e)return void G("Please enter refinement instructions");W(!0),G(null);try{let t=y(e);F(!1),B(""),await t}catch(t){G(t instanceof Error?t.message:"Submission failed. Please try again."),F(!0),B(e)}finally{W(!1)}},ex=e??t??null,ef=(0,s.useMemo)(()=>(f??[]).filter(e=>"placement"===e.type&&"success"===e.status&&e.imageUrl),[f]),eb=em?.styleSlug??U??void 0,ew=em?.styleLabel??I??function(e){if(e)return e.split(/[-_\s]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}(em?.styleSlug??U),ey=em?.bodyPart??E??void 0,ev=em?.theme??D??void 0,ej=em?.customText??M??void 0,ek=(0,s.useMemo)(()=>{if(!ef.length)return null;let e=[...ef].sort((e,t)=>(t.createdAt??0)-(e.createdAt??0));return e[0]?.imageUrl??null},[ef]),eN=e=>{er&&ex&&(Y(e),H(!0))},eC=e=>{let[t,a]=e.split(","),l=t.match(/data:(.*?);/),s=l?.[1]??"image/png",i=atob(a),r=new Uint8Array(i.length);for(let e=0;e<i.length;e+=1)r[e]=i.charCodeAt(e);return new Blob([r],{type:s})},eR=e=>!e||/^https?:\/\//i.test(e)?e:new URL(e,window.location.origin).toString(),eS=(e,t)=>{let a=document.createElement("a");a.href=e,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(e)},eP=async(e,t,a)=>{if(e){X(t);try{let t=eR(e),l=await fetch(`/api/proxy-image?url=${encodeURIComponent(t)}`,{cache:"no-store"});if(!l.ok)throw Error("proxy fetch failed");let s=await l.json(),i=s?.data?.dataUrl;if(!i)throw Error("missing image payload");let r=eC(i),n=window.URL.createObjectURL(r);eS(n,a),N.oR.success("Download started"),u?.(t)}catch(e){console.error("download failed",e),N.oR.error("Download failed. Please right-click the image to save.")}finally{X(null)}}},eL=()=>
1{if(!ex)return;let e=new URLSearchParams;e.set("image",ex),em?.id&&e.set("taskId",em.id),eb&&e.set("style",eb),ew&&e.set("styleLabel",ew),ey&&e.set("bodyPart",ey),ev&&e.set("theme",ev),ej&&e.set("customText",ej),eo.push(`/${eu}/ai-tattoo-designs-preview-generator?${e.toString()}`)},eT=J&&er&&!o&&!L,eU=null!==Z,eI=!er&&!ek||eU;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:T,children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4 pb-3 gap-4 border-b border-gray-200",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[y&&(0,l.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>{ep(),eh()},disabled:!er||!!o||v||q,className:`min-h-[44px] transition-all duration-300 ${eT?"bg-gradient-to-r from-purple-600 to-violet-600 text-white border-purple-600 animate-[glow_3s_ease-in-out_infinite]":"hover:bg-purple-50 hover:border-purple-300 hover:text-purple-700"}`,children:[(0,l.jsx)(r.default,{name:"RiEditLine"}),(0,l.jsx)("span",{className:"hidden sm:inline",children:"Refine with AI Remix"}),(0,l.jsx)("span",{className:"sm:hidden",children:"Refine"})]}),p&&(0,l.jsxs)(i.$,{variant:"outline",size:"sm",onClick:p,disabled:!er||!!o,className:"hover:bg-blue-50 hover:border-blue-300 hover:text-blue-700 transition-all duration-200",children:[(0,l.jsx)(r.default,{name:"RiRefreshLine"}),"Remix"]}),(0,l.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>eN("line"),disabled:!er||!!o||!ex,className:`transition-all duration-200 ${V&&"line"===Q?"bg-slate-900 text-white border-slate-700":"hover:bg-slate-50 hover:border-slate-300 hover:text-slate-700"}`,children:[(0,l.jsx)(r.default,{name:"RiContrastDropLine"}),"Line Preview"]}),(0,l.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>eN("dotwork"),disabled:!er||!!o||!ex,className:`transition-all duration-200 ${V&&"dotwork"===Q?"bg-slate-900 text-white border-slate-700":"hover:bg-slate-50 hover:border-slate-300 hover:text-slate-700"}`,children:[(0,l.jsx)(r.default,{name:"RiFocus3Line"}),"Dotwork Preview"]}),(0,l.jsxs)(c.rI,{children:[(0,l.jsx)(c.ty,{asChild:!0,children:(0,l.jsxs)(i.$,{variant:"outline",size:"sm",disabled:eI,className:"hover:bg-indigo-50 hover:border-indigo-300 hover:text-indigo-700 transition-all duration-200",children:[(0,l.jsx)(r.default,{name:"RiDownloadLine"}),eU?"Preparing":"Download"]})}),(0,l.jsxs)(c.SQ,{align:"end",className:"w-56",children:[(0,l.jsx)(c.lp,{children:"Download options"}),(0,l.jsxs)(c._2,{onClick:()=>{let l=e||t||a;l&&eP(l,"concept","tattoo-concept.png")},disabled:!er||"concept"===Z,children:[(0,l.jsx)(r.default,{name:"RiImageLine",className:"mr-2 h-4 w-4"}),"concept"===Z?"Preparing download...":"Download concept image"]}),(0,l.jsxs)(c._2,{onClick:()=>{ek&&eP(ek,"body","body-placement.png")},disabled:!ek||"body"===Z,children:[(0,l.jsx)(r.default,{name:"RiUserLine",className:"mr-2 h-4 w-4"}),"body"===Z?"Preparing download...":"Download body preview"]}),(0,l.jsx)(c.mB,{}),(0,l.jsxs)(c._2,{onClick:()=>{},disabled:!0,children:[(0,l.jsx)(r.default,{name:"RiZoomInLine",className:"mr-2 h-4 w-4"}),"detail"===Z?"Preparing download...":"Download detail crop"]})]})]}),(0,l.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>{ep(),eL()},disabled:!ex||!er||!!o,className:`min-h-[44px] transition-all duration-300 ${eT?"bg-gradient-to-r from-purple-600 to-violet-600 text-white border-purple-600 animate-[glow_3s_ease-in-out_infinite]":"hover:bg-emerald-50 hover:border-emerald-300 hover:text-emerald-700"}`,children:[(0,l.jsx)(r.default,{name:"RiBodyScanLine"}),(0,l.jsx)("span",{className:"hidden sm:inline",children:"Body Preview"}),(0,l.jsx)("span",{className:"sm:hidden",children:"Preview"})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[h&&(0,l.jsxs)("button",{onClick:()=>{A(!$),h?.()},disabled:!er,className:"flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-red-500 transition-all duration-200 hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100","aria-label":"Add to favorites",children:[(0,l.jsx)(r.default,{name:$?"RiHeartFill":"RiHeartLine",className:`h-5 w-5 transition-colors ${$?"text-red-500":""}`}),(0,l.jsx)("span",{className:"hidden sm:inline",children:"Favorite"})]}),g&&(0,l.jsxs)("button",{onClick:g,disabled:!er,className:"flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-purple-600 transition-all duration-200 hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100","aria-label":"Share design",children:[(0,l.jsx)(r.default,{name:"RiShareLine",className:"h-5 w-5"}),(0,l.jsx)("span",{className:"sr-only",children:"Share"})]})]})]}),(0,l.jsx)("div",{className:ee.container,children:(0,l.jsxs)("div",{className:`relative ${ee.as
1pect} w-full bg-white overflow-hidden border-2 border-gray-200`,children:[ea&&(0,l.jsx)(w.ImageWithFallback,{src:ea,alt:"Tattoo design preview",fill:!0,className:"object-contain",loading:"eager",fetchPriority:"high",priority:!0,fetchImageDataUrl:P,loadingLabel:"Preparing preview…",errorLabel:"Preview unavailable",loadingVariant:L||o&&"success"!==o.status?"minimal":"none",sizes:"(max-width: 768px) 100vw, 50vw"},ea),(L||o&&"success"!==o.status)&&(0,l.jsxs)("div",{className:"absolute inset-0 bg-white/85 backdrop-blur-sm flex flex-col items-center justify-center gap-5",children:[(0,l.jsxs)("div",{className:"relative flex h-20 w-20 items-center justify-center",children:[(0,l.jsx)("span",{className:"absolute inline-block h-16 w-16 bg-neutral-800/80 animate-pulse"}),(0,l.jsx)("span",{className:"absolute -top-4 right-2 inline-block h-8 w-8 bg-neutral-700/70 animate-bounce"}),(0,l.jsx)("span",{className:"absolute bottom-0 left-2 inline-block h-5 w-5 bg-neutral-900/60 animate-ping"})]}),(0,l.jsx)("div",{className:"text-center text-sm font-semibold tracking-wide text-neutral-700 uppercase",children:"Rendering tattoo..."}),(0,l.jsx)("p",{className:"text-xs text-neutral-500",children:o?.status==="rendering"?"Rendering":o?.status==="uploading"?"Uploading":"Queued"})]}),er&&d&&!o&&!L&&(0,l.jsxs)("div",{className:"absolute top-3 left-3 bg-green-500/90 text-white text-xs px-2 py-1 flex items-center gap-1 border-2 border-green-600",children:[(0,l.jsx)(r.default,{name:"RiCheckLine",className:"h-3 w-3"}),(0,l.jsxs)("span",{children:["Generated ",new Date(d).toLocaleTimeString()]})]})]})})]}),(0,l.jsx)(C.lG,{open:_,onOpenChange:e=>{e?(G(null),B("")):q||(G(null),B("")),F(e)},children:(0,l.jsxs)(C.Cf,{className:"sm:max-w-md",children:[(0,l.jsxs)(C.c7,{children:[(0,l.jsx)(C.L3,{children:"Refine this tattoo"}),(0,l.jsx)(C.rr,{children:"Describe the adjustments you would like to see and we will generate a new variant from the current concept image."})]}),(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)("textarea",{rows:5,value:z,onChange:e=>B(e.target.value),placeholder:"Example: add negative space, make the lines thinner, soften the shading",className:"w-full border-2 border-gray-200 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-purple-500",disabled:q||!er||!!o}),(O||j)&&(0,l.jsx)("p",{className:"text-sm text-red-600",children:O??j})]}),(0,l.jsxs)(C.Es,{className:"flex justify-end gap-2",children:[(0,l.jsx)(i.$,{variant:"outline",onClick:()=>{q||F(!1)},disabled:q,children:"Cancel"}),(0,l.jsx)(i.$,{onClick:eg,disabled:q||!en||!er||!!o,className:"bg-purple-600 hover:bg-purple-700 text-white",children:q?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.default,{name:"RiLoader4Line",className:"animate-spin"}),"Submitting…"]}):"Apply refinement"})]})]})}),(0,l.jsx)(R.P,{open:V,mode:Q,sourceImage:ex??void 0,trimInfo:es??void 0,onOpenChange:H,onNavigatePanel:e=>{Y(e),H(!0)}})]})}var L=a(55304);let T="black-grey-realism",U="forearm",I="standard",E={"black-grey-realism":"Black and grey realism style, graphite pencil drawing texture, smooth shading, high contrast lighting, photorealistic illustration","fine-line":"Minimalist fine line style, single needle aesthetic, extremely delicate and thin continuous lines, minimal shading, airy composition","engraving-etching":"Vintage woodcut engraving style, intricate cross-hatching shading, medieval illustration aesthetic, bold monochrome lines","dark-art-sketch":"Dark art sketch style, chaotic scratchy charcoal lines, grunge texture, rough unfinished look, creepy atmosphere","american-traditional":"American Traditional (Old School) flash style, bold uniform black outlines, limited flat color palette (red, yellow, green), vintage aesthetic","neo-traditional":"Neo-traditional illustration style, varying line weights, sophisticated color palette, Art Nouveau decorative elements, soft shading",irezumi:"Japanese Irezumi style, Ukiyo-e traditional art, bold wind bars and waves background, fluid motion, flat dimensional design",watercolor:"Watercolor painting style, vibrant paint splatters and drips, soft pastel edges, lack of outlines, dreamy artistic wash","new-school":"New School graffiti style, exaggerated cartoon proportions, vibrant neon colors, bubble shapes, 3D shading effects",geometric:"Sacred geometry style, mathematical precision, symmetrical mandala patterns, fine lines combined with shapes",dotwork:"Intricate dotwork (stippling) style, shading created entirely by small dots, grain texture, gradient density",blackwork:"Heavy Blackwork style, large areas of solid black fill, high contrast negative space patterns, bold graphical shapes","trash-polka":"Trash Polka style, collage of realistic elements and abstract brush strokes, exclusive black and red color scheme, chaotic typography",biomechanical:"Biome
1chanical art style, H.R. Giger aesthetic, fusion of organic flesh and metallic machine parts, 3D depth",anime:"Anime Manga panel style, cel-shaded character design, bold expressiveness, line art consistent with Japanese animation",chicano:"Chicano art style, smooth black and grey shading, fine lettering, lowrider culture aesthetic, clown masks and religious iconography","cyber-sigilism":"Cyber Sigilism / Neo-tribal style, aggressive sharp spiky lines, Y2K futuristic aesthetic, chrome texture, jagged edges",ignorant:"Ignorant tattoo style, naive doodle aesthetic, intentionally rough linework, childish drawing, humorous and simple",tribal:"Polynesian Tribal style, intricate repetitive patterns, spearheads and shark teeth motifs, bold black ink, cultural symmetry"},D={"full-sleeve":{prompt:"Full sleeve tattoo stencil, long vertical rectangular panel, complex detailed layout.",aspectRatio:"9:16"},"upper-arm":{prompt:"Vertical oval composition, teardrop shape layout.",aspectRatio:"3:4"},forearm:{prompt:"Vertical narrow composition, elongated layout.",aspectRatio:"9:16"},"inner-forearm":{prompt:"Vertical narrow composition, straight alignment.",aspectRatio:"9:16"},"upper-back":{prompt:"Large vertical rectangular composition, poster layout with central focal point.",aspectRatio:"2:3"},spine:{prompt:"Extremely long and thin vertical line composition, column layout.",aspectRatio:"9:16"},chest:{prompt:"Wide horizontal symmetrical composition, wingspan layout.",aspectRatio:"16:9"},sternum:{prompt:"Inverted triangle composition, chandelier shape, ornamental drape.",aspectRatio:"1:1"},ribs:{prompt:"Curved vertical composition, S-shape flow.",aspectRatio:"9:16"},"leg-sleeve":{prompt:"Long vertical rectangular panel, detailed tapestry layout.",aspectRatio:"9:16"},thigh:{prompt:"Large vertical oval composition, broad canvas layout.",aspectRatio:"3:4"},calf:{prompt:"Vertical narrow composition, diamond-like vertical flow.",aspectRatio:"9:16"},hand:{prompt:"Diamond shape composition, centralized compact design.",aspectRatio:"1:1"},neck:{prompt:"Small C-shape curved design, minimalist layout.",aspectRatio:"1:1"},clavicle:{prompt:"Horizontal curved line composition, script layout.",aspectRatio:"3:2"},"lower-back":{prompt:"Wide horizontal symmetrical composition, ornamental arch.",aspectRatio:"16:9"},ankle:{prompt:"Horizontal strip design, seamless band layout.",aspectRatio:"16:9"}},M={simple:"Minimalist design, simple clean lines, strong negative space, less detail, outline focused, easy to tattoo, not cluttered.",standard:"Balanced detail, standard tattoo flash style, clear focal point with moderate shading.",intricate:"Highly detailed, intricate patterns, hyper-detailed texturing, dense composition, elaborate background elements, filling the entire space."};function $(e){return e&&E[e]?e:T}function A(e){let t=e.trim();return t?[",",";",":"].some(e=>t.endsWith(e))?t:`${t},`:""}var _=a(88402),F=a(94739);let z={"us-national":{label:"USA \xb7 National Average",hourlyMin:150,hourlyMax:220,sessionHours:3}},B={wrist:"small",ankle:"small",finger:"small","behind-ear":"small",forearm:"medium","inner-forearm":"medium",calf:"medium",thigh:"large",chest:"large",back:"full","full-back":"full",shoulder:"medium",bicep:"medium","full-sleeve":"full","half-sleeve":"large",ribs:"large",neck:"small"};var O=a(60077),G=a.n(O);function q(e){let t=u.cB[0]?.id??"forearm";if(!e)return t;let a=e.toLowerCase().replace(/\s+(placement|body|area|section|panel)$/g,"").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),l=u.cB.find(t=>t.id===e||t.id===a);if(l)return l.id;let s=u.cB.find(e=>a.includes(e.id));return s?.id??t}function W(e){return e.split(/[-_\s]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}let V=[{slug:"simple",label:"Simple"},{slug:"intricate",label:"Standard"},{slug:"ornate",label:"Detailed"}],H=["cat","wolf face","dragon","phoenix","lotus flower","skull","rose cluster","snake","tiger head","compass","owl","koi fish","cherry blossom","mandala","lion","stag","dahlia","butterfly","eagle","shark"],Q=["phoenix","tiger","dragon","wolf","mermaid","lion","owl","stag","snake","butterfly","koi","cat","skull","compass","rose","lotus","peony","dagger","hawk","octopus"],Y=["breathing fire","with constellations","playing with flowers","with swirling smoke","emerging from water","with shattered glass","holding a lantern","wrapped in roses","surrounded by waves","with glowing eyes","with geometric aura","with swirling leaves","with dripping ink","with lightning bolts","carved in stone","with a crown","howling at the moon","with cosmic dust","floating among clouds","guarding a crystal"];function J(e){switch(e){case"waiting":case"queued":default:return"queuing";case"rendering":case"running":return"rendering";case"uploading":return"uploading";case"success":return"success";case"failed":return"failed"}}function K({generator:e,fallbackImage:t,initialStyleSlug:a=null,initialBodyPart:i=null,initialTheme:r=null,initialCustomText:n=null,initialComplexity:o=null,customPromptBuilder:c,styleOptionsOverride:d,bodyOptionsOverride:m,hideComplexity:p,hideCustomTextToggle:h}){let{userCredits:g,refreshCredits:x,trialCredits:f,openTrialDialog:b,setTrialBalance:w,triggerTrialUpsell:y,setShowSignModal:v}=(0,_.U)(),j=!f?.loading&&f?.identity==="anon"&&f?.claimed&&"number"==typeof f.balance?f.balance:null,k="number"==typeof g?.left_credits?g.left_credits:j,C=!f?.loading&&f?.identity==="anon"&&f?.eligible&&!f?.claimed,R=(0,s.useMemo)(()=>!f?.loading&&(f?.identity!=="user"||"number"==typeof g?.left_credits),[f?.identity,f?.loading,g?.left_credits])&&!C&&(k??0)<=0,S=(0,s.useCallback)(()=>{y()},[y]),P=e.fields?.find(e=>"subject"===e.id)??e.fields?.find(e=>!e.type||"text"===e.type),$=P?.id,O=i?q(i):void 0,G=(0,s.useMemo)(()=>d?.length?d.map(e=>({slug:e.value,label:e.label,featureKeywords:[]})):u.dp,[d]),V=(0,s.useCallback)(e=>G.find(t=>
1t.slug===e)??G[0]??(0,u.UQ)(e),[G]),[K,X]=(0,s.useState)(()=>{let t={};return e.fields?.forEach(e=>{if("color"!==e.id){if("placement"===e.id||"bodyPart"===e.id){t[e.id]=m?e.value||m[0]?.value||"":q(e.value);return}t[e.id]=e.value||""}}),t.customText||(t.customText=""),t.placement||(t.placement=m?m[0]?.value||"":q()),t.bodyPart||(t.bodyPart=t.placement),O&&(t.placement=O,t.bodyPart=O),a?t.style=a:!t.style&&G[0]?.slug&&(t.style=G[0].slug),n&&(t.customText=n),r&&$&&(t[$]=r),o&&(t.complexity=o),t.complexity||(t.complexity="intricate"),t}),[ee,et]=(0,s.useState)(!!h||!!n),[el,es]=(0,s.useState)([]),[ei,er]=(0,s.useState)(!1),[en,eo]=(0,s.useState)(null),[ec,ed]=(0,s.useState)(null),[eu,em]=(0,s.useState)(null),[ep,eh]=(0,s.useState)(!1),[eg,ex]=(0,s.useState)(null),[ef,eb]=(0,s.useState)(!1),[ew,ey]=(0,s.useState)(!1),ev=(0,s.useCallback)((e,t)=>{X(a=>({...a,[e]:t}))},[]);(0,s.useEffect)(()=>{if(!$)return;let e=e=>{ev($,e.detail?.value??""),requestAnimationFrame(()=>{let e=document.querySelector("input[data-generator-sub
1ject]");if(e){e.focus();let t=e.value.length;e.setSelectionRange(t,t)}})};return window.addEventListener("prefill-generator-subject",e),()=>{window.removeEventListener("prefill-generator-subject",e)}},[$,ev]),(0,s.useEffect)(()=>{K.customText&&!ee&&et(!0)},[K.customText,ee]);let ej=(0,s.useCallback)(()=>{et(e=>(e&&X(e=>({...e,customText:""})),!e))},[X]),ek=(0,s.useCallback)(e=>{ev("customText",e.slice(0,30))},[ev]),eN=(0,s.useCallback)(async()=>{let t=e.fields?.find(e=>"subject"===e.id)||e.fields?.find(e=>!e.type||"text"===e.type),a=t?K[t.id]:"";if(!a?.trim())return;if(R){S(),N.oR.info("You're out of credits. Upgrade to keep generating.");return}if(C){b("claim"),N.oR.info("Claim your 6 trial credits to start generating.");return}if(ew&&g?.is_pro!==!0){v(!0),N.oR.info("Pro generations require a paid plan. Please subscribe to continue.");return}let l=K.style||G[0]?.slug,s=K.complexity||"intricate",i=K.bodyPart||K.placement,r=m?i||m[0]?.value||"":q(i),n=K.customText?.trim()||"",o=V(l)??G[0],{finalPrompt:d,aspectRatio:u}=(c??function(e){var t,a,l;let s=e.theme?.trim();if(!s)throw Error("Prompt theme is required");let i=function(e,t){let a=e.trim(),l=(t??"").replace(/["“”]/g,"'").trim();return l?`${a} with text "${l}"`:a}(s,e.customText),r=(a=e.style)&&E[a]?a:T,n=(t=e.complexity)&&M[t]?t:I,o=function(e){let t=D[U];if(!e)return{slug:U,...t};let a=D[e];return a?{slug:e,...a}:{slug:U,...t}}(e.bodyPart),c=E[r]??E[l=null,T],d=D[o.slug]?.prompt??o.prompt,u=M[n]??"",m=[A(c),`tattoo design of ${i}`,d,u,"Centered on a plain white background, surrounded by ample white space (uncropped), flat 2D vector art style, clean bold lines, high contrast black ink on paper, professional tattoo flash, no skin texture, no body parts, no photorealistic shading, stencil ready.",""].filter(Boolean);return{finalPrompt:m.map((e,t)=>{let a=e.trim();return a?t===m.length-1?a.endsWith(".")?a:`${a}.`:a.endsWith(",")?a:A(a):""}).join(" ").replace(/\s+,/g,",").replace(/,\./g,".").trim(),aspectRatio:o.aspectRatio||"1:1"}})({theme:a,style:o.slug,bodyPart:r,complexity:s,customText:n});if(!d?.trim()){er(!1),eb(!1),ex("Prompt build failed");return}let p=!!c,h={theme:a,style:o.slug,bodyPart:r,complexity:s,aspectRatio:u,imageCount:1,outputFormat:"png",customText:n||void 0,pro:ew&&g?.is_pro===!0,customPrompt:p?d:void 0};er(!0),eb(!0),em(null),ex(null);let j=null;try{let e=await (0,L.eV)(h);if(j=e.taskId,"number"==typeof e.remainingCredits&&(w(e.remainingCredits),e.remainingCredits<=0&&y()),!j)throw Error("Invalid task identifier from nanobanana");let t=j,l={id:t,status:"queuing",prompt:n?`${a} (text: "${n}")`:a,createdAt:Date.now(),type:"concept",fullPrompt:d,aspectRatio:u,styleSlug:o.slug,styleLabel:o.label??W(o.slug),bodyPart:r,theme:a,customText:n||void 0};es(e=>[l,...e]),eb(!1);let s=await (async()=>{for(let e=0;e<60;e+=1){let e=await (0,L.g$)(t),a=J(e.state);if(es(l=>l.map(l=>l.id===t?{...l,status:a,imageUrl:"success"===a&&e.resultUrls?.[0]||l.imageUrl,error:"failed"===a?e.param?.message||"Task failed":l.error}:l)),"success"===a){let a=e.resultUrls?.[0];return a&&eo(a),em(t),ed(Date.now()),e}if("failed"===a)return e;await new Promise(e=>setTimeout(e,5e3))}throw Error("Task polling timeout")})();if("success"!==s.state)throw Error(s.param?.message||"Concept generation failed");x?.()}catch(t){console.error("Generation error:",t);let e="Generation failed. Please try again soon.";if(t instanceof Error&&"INSUFFICIENT_CREDITS"===t.message?(f?.claimed?S():b("claim"),N.oR.error("You are out of credits. Subscribe for more attempts.",{action:{label:"View plans",onClick:()=>{window.location.href="/pricing"}}})):N.oR.info("Queue is busy. Please try again in a moment."),j){let a=t instanceof Error?t.message:e;es(e=>e.map(e=>e.id===j?{...e,status:"failed",error:a}:e))}else es(l=>[{id:`failed-${Date.now()}`,status:"failed",prompt:a,createdAt:Date.now(),error:t instanceof Error?t.message:e},...l]);eb(!1)}finally{er(!1),eb(!1)}},[K,e.fields,x,w,C,y,b,f?.claimed,R,S,m,c,G,V,v,ew,g?.is_pro]),eC=(0,s.useCallback)((e,t)=>{if(!g?.is_pro)return void S();let a=document.createElement("a");a.href=t,a.download=`tattoo-${e}.png`,document.body.appendChild(a),a.click(),document.body.removeChild(a)},[S,g?.is_pro]),eR=(0,s.useCallback)(e=>{el.find(t=>
1t.id===e)&&eN()},[el,eN]),eS=(0,s.useCallback)(()=>{let e=document.querySelector("input[data-generator-subject]");e?.focus()},[]),eP=(0,s.useCallback)(()=>{eN()},[eN]),eL=(0,s.useCallback)(()=>{console.log("Add to favorites - to be implemented")},[]),eT=(0,s.useCallback)(()=>{console.log("Share design - to be implemented")},[]),eU=el.find(e=>"queuing"===e.status||"rendering"===e.status||"uploading"===e.status),eI=(0,s.useCallback)(e=>{es(t=>[e,...t])},[]),eE=(0,s.useCallback)((e,t)=>{es(a=>a.map(a=>a.id===e?{...a,...t}:a))},[]),eD=(0,s.useCallback)((e,t)=>{em(e),eo(t),ed(Date.now())},[]),eM=(0,s.useCallback)(async e=>{if(!e)throw Error("Missing image source");if(e.startsWith("data:"))return e;let t=e;e.startsWith("/")&&(t=new URL(e,window.location.origin).toString());let a=await fetch(`/api/proxy-image?url=${encodeURIComponent(t)}`,{cache:"no-store"});if(!a.ok)throw Error("Failed to load base image");let l=await a.json();if(l?.code!==0||!l?.data?.dataUrl)throw Error(l?.message||"Image proxy failed");return l.data.dataUrl},[]),e$=(0,s.useCallback)(async e=>{let t=e.trim();if(!t)return;let a=en||el.find(e=>"success"===e.status&&e.imageUrl)?.imageUrl;if(!a)return void ex("No generated image found. Create a concept first.");if(R){S(),N.oR.info("You're out of credits. Upgrade to continue editing.");return}if(C){b("claim"),N.oR.info("Claim your 6 trial credits to continue editing.");return}eh(!0),ex(null);let l=null,s=eu&&el.find(e=>e.id===eu)||el.find(e=>e.imageUrl===a),i=`temp-${Date.now()}`,r=i;eI({id:i,status:"rendering",prompt:t,createdAt:Date.now(),type:"concept",sourceTaskId:s?.id,fullPrompt:t,aspectRatio:s?.aspectRatio,styleSlug:s?.styleSlug,styleLabel:s?.styleLabel,bodyPart:s?.bodyPart,theme:s?.theme,customText:s?.customText,refineInstruction:t});try{let e=await eM(a),i={prompt:t,baseImage:e,placementImage:e,imageSize:"1:1",outputFormat:"png",editSteps:40,guidanceScale:180,aspectRatio:s?.aspectRatio,taskType:"refine",sourceTaskId:s?.id,refineInstruction:t},n=await (0,L.SI)(i);if(l=n.taskId,"number"==typeof n.remainingCredits&&(w(n.remainingCredits),n.remainingCredits<=0&&(y(),N.oR.info("Trial credits are exhausted. Subscribe to continue editing designs.",{action:{label:"View plans",onClick:()=>{window.location.href="/pricing"}}}))),!l)throw Error("Invalid edit task identifier");eE(r,{id:l,status:"rendering",prompt:t,sourceTaskId:s?.id,fullPrompt:t,aspectRatio:s?.aspectRatio,styleSlug:s?.styleSlug,styleLabel:s?.styleLabel,bodyPart:s?.bodyPart,theme:s?.theme,customText:s?.customText,refineInstruction:t}),r=l;let o=await (async()=>{for(let e=0;e<60;e+=1){let e=await (0,L.g$)(l),t=J(e.state);if(eE(l,{status:t,imageUrl:"success"===t&&e.resultUrls?.[0]||void 0,error:"failed"===t?e.param?.message||"Generation failed. Please try again soon.":void 0}),"success"===t){let t=e.resultUrls?.[0];return t&&eD(l,t),e}if("failed"===t)return e;await new Promise(e=>setTimeout(e,5e3))}throw Error("Task polling timeout")})();if("success"!==o.state)throw Error(o.param?.message||"Edit generation failed")}catch(l){let e="Generation failed. Please try again soon.",t=l instanceof Error&&"INSUFFICIENT_CREDITS"===l.message,a=l instanceof Error?l.message:e;throw t?(f?.claimed?y():b("claim"),ex("Not enough credits to continue editing."),N.oR.error("You are out of credits. Subscribe for more attempts.",{action:{label:"View plans",onClick:()=>{window.location.href="/pricing"}}})):(ex(a||e),N.oR.error(e)),eE(r,{status:"failed",error:a||e}),Error(a)}finally{eh(!1)}},[en,eu,el,eM,eI,eE,eD,w,y,b,f?.claimed,R,S,C]),eA=el.find(e=>"success"===e.status),e_=el.find(e=>"success"===e.status&&e.id&&!e.id.startsWith("line-")&&!e.id.startsWith("dotwork-")),eF=t??"/imgs/placeholders/tattoo-default.png",ez=a?(0,u.UQ)(a):void 0,eB=ez?.label??(a?W(a):void 0),eO=en||eA?.imageUrl||null,eG=[eF,"/imgs/showcases/linework-placeholder.png"],eq=eu?el.find(e=>
1e.id===eu):e_??eA,eW=en||eq?.imageUrl||null,eV=eW&&eq?()=>eC(eq.id,eW):void 0,eH=(0,s.useCallback)(e=>{eo(e);let t=el.find(t=>t.imageUrl===e);em(t?.id??null),ex(null)},[el]),eQ=eq??eA??null,eY=!!eQ&&("success"===eQ.status||!!eQ.imageUrl),eJ=eQ?.bodyPart??K.bodyPart??K.placement??O,eK=K.complexity??"intricate",eZ=eJ?B[eJ.toLowerCase()]??"medium":"medium",eX=z["us-national"],e0=function(e){switch(e){case"simple":return .85;case"ornate":return 1.25;default:return 1}}(eK),e1=eY&&eX?(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(F.TattooCostEstimator,{title:"Estimated Tattoo Cost",locationPreset:eX,coverageLevel:eZ,styleMultiplier:e0})}):null,e2=(0,s.useCallback)(()=>{if(!$)return;let e=function(e){if(.5>Math.random()&&H.length>0){let t=H.filter(t=>t!==e);return 0===t.length?H[Math.floor(Math.random()*H.length)]??"":t[Math.floor(Math.random()*t.length)]??""}if(0===Q.length||0===Y.length)return H[Math.floor(Math.random()*H.length)]??"";let t=Q[Math.floor(Math.random()*Q.length)]??"",a=Y[Math.floor(Math.random()*Y.length)]??"",l=0;for(;(`${t} ${a}`===e||a.toLowerCase().includes(t.toLowerCase()))&&l<5;)t=Q[Math.floor(Math.random()*Q.length)]??t,a=Y[Math.floor(Math.random()*Y.length)]??a,l+=1;return`${t} ${a}`.trim()}(K[$]);e&&ev($,e)},[$,K,ev]);return(0,l.jsx)("section",{id:"generator",className:"bg-white border-b border-gray-200 scroll-mt-28",children:(0,l.jsxs)("div",{className:"flex flex-col xl:flex-row w-full",children:[(0,l.jsx)(Z,{generator:e,formData:K,updateField:ev,onGenerate:eN,isGenerating:ei,activeTask:eU,isCustomTextEnabled:ee,onToggleCustomText:ej,onCustomTextChange:ek,availableCredits:k,costEstimator:e1,isOutOfCredits:R,onUpsell:S,subjectFieldId:$??void 0,onRandomSubject:$?e2:void 0,useProModel:ew,setUseProModel:ey,userIsPro:g?.is_pro===!0,showComplexity:!p&&"AI Tattoo Font Generator"!==e.title,showCustomTextToggle:!h&&"AI Tattoo Font Generator"!==e.title,styleOptionsOverride:d,bodyOptionsOverride:m}),(0,l.jsx)(ea,{imageUrl:eO,baseImageUrl:eO,fallbackImage:eF,activeTask:eU,lastGeneratedAt:ec,taskQueue:el,taskId:eq?.id??null,onRetry:eR,onDownloadTask:eC,onDownloadCurrent:eV,placeholderThumbnails:eG,onSelectThumbnail:eH,onEditPrompt:eS,onRemix:eP,onFavorite:eL,onShare:eT,onApplyEdit:e$,isEditPending:ep,editError:eg,fetchImageDataUrl:eM,isPending:ef&&!eU,defaultStyleSlug:a??void 0,defaultStyleLabel:eB,defaultBodyPart:O??void 0,defaultTheme:r??void 0,defaultCustomText:n??void 0})]})})}function Z({generator:e,formData:t,updateField:a,onGenerate:o,isGenerating:c,activeTask:d,isCustomTextEnabled:u,onToggleCustomText:m,onCustomTextChange:p,availableCredits:h,costEstimator:g,isOutOfCredits:x,onUpsell:f,subjectFieldId:b,onRandomSubject:w,useProModel:y,setUseProModel:v,userIsPro:j,showComplexity:k=!0,showCustomTextToggle:N=!0,styleOptionsOverride:C,bodyOptionsOverride:R}){let S=e.actions?.primaryButton?.title??"Generate Concept";return(0,l.jsxs)("div",{className:"relative w-full md:w-96 border-r border-gray-200 bg-white p-6 md:p-8",children:[x&&(0,l.jsxs)("div",{className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-6 bg-white/40 backdrop-blur-md px-6 text-center border-2 border-purple-600",children:[(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)("h3",{className:"text-3xl font-bold tracking-tight text-black",children:"Go Pro Unlimited"}),(0,l.jsx)("p",{className:"text-lg leading-relaxed text-neutral-700",children:"Create unlimited tattoos with full access to every premium feature."})]}),(0,l.jsx)(i.$,{className:"w-full bg-purple-600 hover:bg-purple-500 text-white text-sm font-semibold tracking-wide uppercase",onClick:f,children:"View plans"}),(0,l.jsxs)("p",{className:"text-xs text-neutral-600",children:["or"," ",(0,l.jsx)(G(),{href:"/pricing",className:"font-medium text-neutral-700 underline underline-offset-2",children:"see pricing details"})]})]}),(0,l.jsxs)("div",{className:(0,n.cn)("space-y-6",x?"pointer-events-none":""),children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-sm font-semibold text-purple-600 uppercase tracking-wide mb-2",children:"My Tattoo Ideas AI Workspace"}),(0,l.jsxs)("div",{className:"text-sm text-gray-600",children:["Available Credits:",(0,l.jsx)("span",{className:"ml-1 font-bold text-black",children:h??"--"})]}),(0,l.jsx)("div",{className:"mb-6"})]}),(0,l.jsxs)("div",{className:"space-y-4",children:[e.fields?.map(i=>"color"===i.id?null:(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(ee,{field:i,value:t[i.id]||"",onChange:e=>a(i.id,e),showRandomize:i.id===b&&!!w,onRandomize:i.id===b?w:void 0,styleOptionsOverride:C,bodyOptionsOverride:R}),"subject"===i.id&&N&&(0,l.jsx)(X,{label:e.actions?.addText||"Add Text",badge:e.actions?.addTextBadge,value:t.customText||"",isOpen:u,onToggle:m,onChange:p,maxLength:30})]}
1,i.id)),k&&(0,l.jsx)(et,{value:t.complexity||"intricate",onChange:e=>a("complexity",e)}),(0,l.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700",children:[(0,l.jsx)("input",{type:"checkbox",className:"h-4 w-4",checked:y,onChange:e=>{let t=e.target.checked;if(t&&!j)return void f();v(t)}}),(0,l.jsx)("span",{children:"Use Pro (higher quality, may take longer)"})]})]}),(0,l.jsxs)(i.$,{size:"lg",className:"w-full btn-gradient-purple px-4 py-3 text-base font-semibold text-white disabled:opacity-50 disabled:cursor-not-allowed min-h-[44px]",onClick:o,disabled:c||!!d||x,children:[e.actions?.primaryButton?.icon&&(0,l.jsx)(r.default,{name:e.actions.primaryButton.icon,className:"mr-2 h-5 w-5"}),c||d?"Generating…":(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"hidden sm:inline",children:S}),(0,l.jsx)("span",{className:"sm:hidden",children:"Generate"})]})]}),!x&&null!==h&&h<=0&&(0,l.jsx)("p",{className:"text-xs text-red-500",children:"Credits exhausted. Please top up to continue generating."}),g]})]})}function X({label:e,badge:t,value:a,isOpen:s,onToggle:i,onChange:n,maxLength:o=30}){return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("button",{type:"button",onClick:i,className:"inline-flex items-center gap-2 border border-dashed border-purple-300 px-3 py-2 text-sm font-medium text-purple-600 hover:border-purple-400 hover:text-purple-700 transition-colors",children:[(0,l.jsx)(r.default,{name:"RiTextLine",className:"h-4 w-4"}),s?"Remove Text":e]}),t&&(0,l.jsx)("span",{className:"bg-purple-100 px-2 py-0.5 text-xs font-medium text-purple-700",children:t})]}),(0,l.jsx)("p",{className:"text-xs text-neutral-500",children:s?"We will append this lettering after your subject.":"Optionally add lettering to include in the design prompt."}),s&&(0,l.jsxs)("div",{className:"space-y-2 border-2 border-neutral-200 bg-neutral-50 p-3",children:[(0,l.jsxs)("label",{className:"text-xs font-semibold text-neutral-600",children:["Custom Text (max ",o," characters)"]}),(0,l.jsx)("input",{type:"text",value:a,maxLength:o,onChange:e=>n(e.target.value),placeholder:'e.g. "judycat"',className:"w-full border-2 border-neutral-200 bg-white px-3 py-2 text-sm text-neutral-900 placeholder:text-neutral-400 focus:outline-none focus:ring-2 focus:ring-purple-500"}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-neutral-500",children:[(0,l.jsxs)("span",{children:['Appears as `with text "',a||"...",'"` in the prompt.']}),(0,l.jsxs)("span",{children:[a.length,"/",o]})]})]})]})}function ee({field:e,value:t,onChange:a,dark:s,showRandomize:i,onRandomize:o,styleOptionsOverride:c,bodyOptionsOverride:d}){if("style"===e.id)return c?.length?(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:(0,n.cn)("text-sm font-medium",s?"text-white/70":"text-gray-700"),children:e.label}),(0,l.jsx)("select",{className:(0,n.cn)("w-full border px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-purple-500",s?"border-white/20 bg-white/10 text-white placeholder:text-white/50":"border-neutral-300 bg-white text-black placeholder:text-neutral-500"),value:t,onChange:e=>a(e.target.value),children:c.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]}):(0,l.jsx)(p,{value:t,onChange:a,dark:s,label:e.label});if("placement"===e.id||"bodyPart"===e.id)return d?.length?(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:(0,n.cn)("text-sm font-medium",s?"text-white/70":"text-gray-700"),children:e.label}),(0,l.jsx)("select",{className:(0,n.cn)("w-full border px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-purple-500",s?"border-white/20 bg-white/10 text-white placeholder:text-white/50":"border-neutral-300 bg-white text-black placeholder:text-neutral-500"),value:t,onChange:e=>a(e.target.value),children:d.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]}):(0,l.jsx)(b,{value:t,onChange:a,dark:s,label:e.label});let u=!!(i&&o),m=!!e.icon;return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:(0,n.cn)("text-sm font-medium",s?"text-white/70":"text-gray-700"),children:e.label}),(0,l.jsxs)("div",{className:"relative",children:[e.icon&&(0,l.jsx)(r.default,{name:e.icon,className:(0,n.cn)("pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2",s?"text-white/60":"text-gray-500")}),(0,l.jsx)("input",{type:"text",value:t,onChange:e=>a(e.target.value),placeholder:e.placeholder,"data-generator-subject":"subject"===e.id||void 0,className:(0,n.cn)("w-full border px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-purple-500",s?"border-white/20 bg-white/10 text-white placeholder:text-white/50":"border-neutral-300 bg-white text-black placeholder:text-neutral-500",m?"pl-10":"",u?"pr-12":"")}),u&&o&&(0,l.jsx)("button",{type:"button",onClick:o,"aria-label":"Surprise me",className:(0,n.cn)("absolute right-3 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center transition-all",s?"bg-white/20 text-white hover:bg-white/30":"bg-gradient-to-br from-purple-500 to-violet-600 text-white hover:from-purple-600 hover:to-violet-700"),children:(0,l.jsx)(r.default,{name:"RiDice6Line",className:"h-4 w-4"})})]})]})}
1function et({value:e,onChange:t}){return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-neutral-700",children:"Detail Level"}),(0,l.jsx)("div",{className:"grid gap-2 sm:grid-cols-3",children:V.map(a=>{let s=e===a.slug;return(0,l.jsx)("button",{type:"button",onClick:()=>t(a.slug),className:(0,n.cn)("border px-4 py-2.5 text-center transition-all",s?"border-purple-500 bg-purple-50":"border-neutral-200 hover:border-purple-300 hover:bg-purple-50/50"),children:(0,l.jsx)("div",{className:"text-sm font-semibold text-neutral-900",children:a.label})},a.slug)})})]})}function ea({imageUrl:e,baseImageUrl:t,fallbackImage:a,activeTask:s,lastGeneratedAt:i,taskQueue:r,taskId:n,onRetry:o,onDownloadTask:c,onDownloadCurrent:d,placeholderThumbnails:u,onSelectThumbnail:m,onEditPrompt:p,onRemix:h,onFavorite:g,onShare:x,onApplyEdit:f,isEditPending:b,editError:w,fetchImageDataUrl:y,isPending:j=!1,defaultStyleSlug:k,defaultStyleLabel:N,defaultBodyPart:C,defaultTheme:R,defaultCustomText:S}){return(0,l.jsx)("div",{className:"flex-1 bg-white p-6 md:p-8",children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(P,{previewUrl:e??null,baseImageUrl:t??null,fallbackImage:a??"/cdn-cgi/image/width=800,q=80,format=auto/imgs/placeholders/tattoo-default.png",size:"portrait",activeTask:s,lastGeneratedAt:i,taskId:n??void 0,onDownload:d?()=>d():void 0,onEditPrompt:p,onRemix:h,onFavorite:g,onShare:x,taskQueue:r,currentTaskId:n??null,onApplyEdit:f,isEditPending:b,editError:w,fetchImageDataUrl:y,isPending:j,defaultStyleSlug:k,defaultStyleLabel:N,defaultBodyPart:C,defaultTheme:R,defaultCustomText:S}),(0,l.jsx)(v,{tasks:r,onRetry:o,onDownload:c,maxVisible:6,thumbnailOnly:!0,placeholderImages:u,onSelectImage:m,fetchImageDataUrl:y})]})})}},49003:e=>{e.exports=function({client_id:e,auto_select:t=!1,cancel_on_tap_outside:a=!1,context:l="signin",...s},i){if(!e)throw Error("client_id is required");if("undefined"!=typeof window&&window.document){let r=["signin","signup","use"].includes(l)?l:"signin",n=document.createElement("script");n.src="https://accounts.google.com/gsi/client",n.async=!0,n.defer=!0,document.head.appendChild(n),window.onload=function(){window.google.accounts.id.initialize({client_id:e,callback:i,auto_select:t,cancel_on_tap_outside:a,context:r,...s}),window.google.accounts.id.prompt()}}}},94739:(e,t,a)=>{"use strict";a.d(t,{TattooCostEstimator:()=>u});var l=a(45172),s=a(72440),i=a(60077),r=a.n(i);let n=[.15,.2],o={small:2,medium:4,large:6,full:10},c={small:1,medium:1,large:1,full:1};function d(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}function u({title:e,locationPreset:t,coverageLevel:a,styleMultiplier:i=1,tipRateRange:u=n,adjustHref:m=null,layout:p="compact",showLocationChips:h=!1}){let g=Math.max(o[a]??o.medium,t.sessionHours),x=i*(c[a]??c.medium),{sessionCostMin:f,sessionCostMax:b,totalCost:w,tipRange:y,sessionsCount:v}=(0,s.useMemo)(()=>{let e=t.hourlyMin,a=t.hourlyMax,l=Math.round(e*g*x),s=Math.round(a*g*x),i=Math.round(l*u[0]),r=Math.round(s*u[1]);return{sessionCostMin:l,sessionCostMax:s,totalCost:Math.round((l+s)/2+(i+r)/2),tipRange:[i,r],sessionsCount:Math.max(1,Math.round(g/t.sessionHours))}},[t,g,x,u]);return(0,l.jsxs)("div",{className:"rounded-xl border border-neutral-200 bg-white p-4 shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-neutral-900",children:e}),h?(0,l.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(0,l.jsx)("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-neutral-600",children:t.label}),(0,l.jsx)("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-neutral-600",children:"Avg. Artist Experience"})]}):null]}),m?(0,l.jsx)(r(),{href:m,className:"text-xs font-semibold uppercase tracking-wide text-purple-600 hover:text-purple-700",children:"Adjust ↗"}):(0,l.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Calc coming soon"})]}),(0,l.jsxs)("div",{className:"mt-4 grid gap-4 text-sm text-neutral-700",children:[(0,l.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,l.jsx)("p",{className:"text-xs uppercase tracking-wide text-neutral-500",children:"Session Cost"}),(0,l.jsxs)("p",{className:"font-semibold text-neutral-900",children:[d(f)," – ",d(b)]})]}),(0,l.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,l.jsx)("p",{className:"text-xs uppercase tracking-wide text-neutral-500",children:"Total Est. Cost"}),(0,l.jsx)("p",{className:"font-semibold text-purple-600",children:d(w)})]}),(0,l.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,l.jsx)("p",{className:"text-xs uppercase tracking-wide text-neutral-500",children:"Sessions"}),(0,l.jsxs)("p",{className:"font-semibold text-neutral-900",children:[v," ",1===v?"session":"sessions"]})]}),"detailed"===p&&(0,l.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,l.jsxs)("p",{className:"text-xs uppercase tracking-wide text-neutral-500",children:["Tip (",Math.round(100*u[0]),"–",Math.round(100*u[1]),"%)"]}),(0,l.jsxs)("p",{className:"font-semibold text-neutral-900",children:[d(y[0])," – ",d(y[1])]})]})]})]})}}}]);

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.