1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="a70993df-c358-0b7a-783b-6d2d40fa5543")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,236597,e=>{"use strict";let t=(0,e.i(369547).default)("bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);e.s(["Bookmark",0,t],236597)},136646,e=>{"use strict";let t=(0,e.i(369547).default)("flame",[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]);e.s(["Flame",0,t],136646)},273551,e=>{"use strict";let t=(0,e.i(369547).default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);e.s(["SlidersHorizontal",0,t],273551)},396555,e=>{"use strict";let t=(0,e.i(369547).default)("square-split-horizontal",[["path",{d:"M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3",key:"lubmu8"}],["path",{d:"M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3",key:"1ag34g"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);e.s(["SplitSquareHorizontal",0,t],396555)},185849,e=>{"use strict";let t=(0,e.i(369547).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],185849)},680955,e=>{"use strict";var t=e.i(391398),i=e.i(261576),a=e.i(191788),s=e.i(190077),n=e.i(430559),r=e.i(868462),l=e.i(322138),o=e.i(770084),d=e.i(947710),c=e.i(579881),m=e.i(453840),h=e.i(687072),x=e.i(918324),p=e.i(835707),u=e.i(450095),g=e.i(127630),b=e.i(639131),f=e.i(436254),w=e.i(396555),y=e.i(928964),j=e.i(273551),v=e.i(93608),N=e.i(506683),z=e.i(188478),k=e.i(871138),_=e.i(236597),S=e.i(117690),C=e.i(185849),I=e.i(136646),E=e.i(675878),P=e.i(198311),M=e.i(498817),T=e.i(533879);e.i(670944);var A=e.i(515344),R=e.i(234044),D=e.i(22799),L=e.i(469647),O=e.i(914666),$=e.i(819099),q=e.i(473410),F=e.i(511204),W=e.i(919715);let U="quick-edit-selected-model",H="quick-edit-selected-model-default-version",B="gpt-image-2-edit-default",G="gpt-image-2-edit",Q="gpt-image-2-5-flare-edit",K=new Set(["nano-banana-2","nano-banana-pro","gpt-image-2-edit",Q]),Y=new Set(["gpt-image-2-edit",Q]),V=new Set(["low","medium","high"]),X="1K",Z={low:W.GPT2_CREDITS_BY_QUALITY_TIER.low["1K"],medium:W.GPT2_CREDITS_BY_QUALITY_TIER.medium["1K"],high:W.GPT2_CREDITS_BY_QUALITY_TIER.high["1K"]},J={"1:1":[1,1],"16:9":[16,9],"9:16":[9,16],"4:3":[4,3],"3:4":[3,4],"3:2":[3,2],"2:3":[2,3],"21:9":[21,9]},ee={"1K":1024,"2K":2048,"4K":3840},et={"nano-banana-2":100,"nano-banana-pro":190,"gpt-image-2-edit":45,[Q]:30},ei=(...e)=>e.filter(Boolean).join(" "),ea=e=>{let t=Math.max(0,Math.ceil(e)),i=Math.floor(t/60),a=String(t%60).padStart(2,"0");return`${i}:${a}`},es=()=>{let e=localStorage.getItem(U);return localStorage.getItem(H)===B||(localStorage.setItem(H,B),e&&"nano-banana-2"!==e)?K.has(e)?e:G:(localStorage.setItem(U,G),G)},en=e=>Math.max(16,16*Math.floor(e/16)),er=e=>Math.max(16,16*Math.ceil(e/16));function el(e){let s,n,r,l,o=(0,i.c)(12),{src:d,alt:c,className:m,isFreeUser:h,isAuthenticated:x}=e,p=a.default.useRef(null),[u,g]=a.default.useState(null);o[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{let e=p.current;e&&g({width:e.offsetWidth,height:e.offsetHeight,left:e.offsetLeft,top:e.offsetTop})},o[0]=s):s=o[0];let b=s;return o[1]!==c||o[2]!==m||o[3]!==d?(n=(0,t.jsx)("img",{ref:p,src:d,alt:c,className:m,onLoad:b}),o[1]=c,o[2]=m,o[3]=d,o[4]=n):n=o[4],o[5]!==u||o[6]!==x||o[7]!==h?(r=h&&x&&u&&(0,t.jsx)("div",{className:"absolute overflow-hidden rounded-lg pointer-events-none opacity-70",style:{width:u.width,height:u.height,left:u.left,top:u.top},children:(0,t.jsx)(F.default,{className:"rounded-lg",compact:!0})}),o[5]=u,o[6]=x,o[7]=h,o[8]=r):r=o[8],o[9]!==n||o[10]!==r?(l=(0,t.jsxs)(t.Fragment,{children:[n,r]}),o[9]=n,o[10]=r,o[11]=l):l=o[11],l}let eo={style:{label:"Style",icon:S.Palette,items:[{id:"miniature-figurine",title:"Miniature Figurine",description:"Transform into a painted tabletop game piece",image:"/EditWithAIExamples/PresetsQuickImageEditModal/Miniature.
2jpeg",prompt:"transform the subject into a painted tabletop miniature figurine like Warhammer, matte painted plastic finish, front view slightly from above, solid neutral background, soft uniform studio lighting, full body visible centered in frame"},{id:"cartoon-character",title:"Cartoon Character",description:"Transform into a Pixar/Disney style character",image:"/EditWithAIExamples/PresetsQuickImageEditModal/CartoonCharacter.jpeg",prompt:"transform the subject into a stylized 3D cartoon character like Pixar or Disney, smooth rounded forms, expressive features, front view slightly from above, solid neutral background, soft uniform studio lighting, full body visible centered in frame"},{id:"low-poly",title:"Low Poly",description:"Transform into a simplified retro game asset",image:"/EditWithAIExamples/PresetsQuickImageEditModal/LowPoly.jpeg",prompt:"transform the subject into low poly 3D game asset style, simplified geometric shapes, flat shading, clean hard edges, front view slightly from above, solid neutral background, soft uniform lighting, full body visible centered in frame"},{id:"chibi-style",title:"Chibi Style",description:"Transform into a cute chibi with big head",image:"/EditWithAIExamples/PresetsQuickImageEditModal/Chibi.jpeg",prompt:"transform the subject into chibi style, oversized cute head, small compact body, adorable kawaii proportions, front view slightly from above, solid neutral background, soft uniform studio lighting, full body visible centered in frame"},{id:"hand-painted",title:"Hand-Painted",description:"Transform into stylized painted game art",image:"/EditWithAIExamples/PresetsQuickImageEditModal/HandPainted.jpeg",prompt:"transform the subject to have hand-painted stylized texture style like World of Warcraft, visible artistic brushwork, front view slightly from above, solid neutral background, soft uniform studio lighting, full body visible centered in frame"},{id:"clay-sculpture",title:"Clay Sculpture",description:"Transform into a gray matte clay sculpture",image:"/EditWithAIExamples/PresetsQuickImageEditModal/Clay.jpeg",prompt:"transform the subject into a gray clay sculpture, smooth matte surface, monochrome sculptural forms, front view slightly from above, solid neutral background, soft uniform studio lighting, full body visible centered in frame"}]},pose:{label:"Pose",icon:C.User,items:[{id:"t-pose",title:"T-Pose",description:"Change pose to arms extended horizontally",image:"/EditWithAIExamples/PresetsQuickImageEditModal/T-Pose.jpeg",prompt:"change the subject's pose to T-pose with arms extended straight out horizontally to the sides, standing upright, front facing view, symmetrical stance, solid neutral background, soft uniform lighting, full body visible centered"},{id:"a-pose",title:"A-Pose",description:"Change pose to arms at 45 degrees",image:"/EditWithAIExamples/PresetsQuickImageEditModal/A-Pose.jpeg",prompt:"change the subject's pose to A-pose with arms relaxed at 45 degrees from body, standing naturally, front facing view, shoulders relaxed, solid neutral background, soft uniform lighting, full body visible centered"},{id:"neutral-standing",title:"Neutral Standing",description:"Change to a relaxed natural standing pose",image:"/EditWithAIExamples/PresetsQuickImageEditModal/NeutralPose.jpeg",prompt:"change the subject to a neutral relaxed standing pose, arms resting naturally at sides, front facing view, balanced weight, solid neutral background, soft uniform lighting, full body visible centered"},{id:"symmetrical",title:"Make Symmetrical",description:"Adjust to make left and right sides match",image:"/EditWithAIExamples/PresetsQuickImageEditModal/Symetrical.jpeg",prompt:"adjust the subject to be perfectly symmetrical, mirror left and right sides evenly, front facing view, balanced composition, maintain current background and lighting"}]}},ed=e=>{let s,n,l,o,c,m,h,x,p,u,g,b,f,w,y,j,v,N,z,k,C,I,E,M=(0,i.c)(40),{onClose:T,onSelect:A}=e,[R,D]=(0,a.useState)("style"),L=eo[R];M[0]===Symbol.for("react.memo_cache_sentinel")?(s={opacity:0},n={opacity:1},l={opacity:0},o={duration:.15},M[0]=s,M[1]=n,M[2]=l,M[3]=o):(s=M[0],n=M[1],l=M[2],o=M[3]),M[4]===Symbol.for("react.memo_cache_sentinel")?(c={opacity:0,scale:.95,y:10},m={opacity:1,scale:1,y:0},h={opacity:0,scale:.98,y:5},x={duration:.2,ease:"easeOut"},M[4]=c,M[5]=m,M[6]=h,M[7]=x):(c=M[4],m=M[5],h=M[6],x=M[7]),M[8]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(_.Bookmark,{className:"w-4 h-4 text-indigo-400"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-white",children:"Presets"})]}),M[8]=p):p=M[8],M[9]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(d.Sparkles,{className:"w-3 h-3 text-indigo-400"}),M[9]=u):u=M[9],M[10]===Symbol.for("react.memo_cache_sentinel")?(g=(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[p,(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-indigo-500/10 border border-indigo-500/20",children:[u,(0,t.jsxs)("span",{className:"text-xs text-indigo-300",children:["Best with ",(0,t.jsx)("span",{className:"font-semibold",children:"Nano Banana Pro"})," model"]})]})]}),M[10]=g):g=M[10],M[11]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)(r.X,{className:"w-4 h-4"}),M[11]=b):b=M[11],M[12]!==T?(f=(0,t.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-800/50 flex-shrink-0",children:[g,(0,t.jsx)("button",{onClick:T,className:"p-1.5 rounded-lg text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors",children:b})]}),M[12]=T,M[13]=f):f=M[13],M[14]===Symbol.for("react.memo_cache_sentinel")?(w=Object.entries(eo),M[14]=w):w=M[14],M[15]!==R?(y=(0,t.jsx)("div",{className:"md:w-40 flex-shrink-0 md:border-r border-b md:border-b-0 border-zinc-800/50 py-2 flex flex-row md:flex-col gap-0.5 overflow-x-auto md:overflow-x-visible px-2 md:px-0",children:w.map(e=>{let[i,a]=e,s=a.icon,n=R===i;return(0,t.jsxs)("button",{onClick:()=>D(i),className:ei("flex items-center gap-2 md:gap-2.5 px-3 md:px-4 py-2 md:py-2.5 text-left transition-all duration-150 md:mx-2 rounded-lg whitespace-nowrap",n?"bg-zinc-800 text-white":"text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50"),children:[(0,t.jsx)(s,{className:ei("w-4 h-4 flex-shrink-0",n&&"text-indigo-400")}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a.label})]},i)})}),M[15]=R,M[16]=y):y=M[16];let O="style"===R&&"Transform your image into...",$="pose"===R&&"Change pose to...";if(M[17]!==O||M[18]!==$?(j=(0,t.jsx)("div",{className:"mb-5",children:(0,t.jsxs)("h3",{className:"text-lg font-semibold text-white",children:[O,$]})}),M[17]=O,M[18]=$,M[19]=j):j=M[19],M[20]!==L.items||M[21]!==A){let e;M[23]!==A?(e=e=>(0,t.jsxs)(P.motion.button,{whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},onClick:()=>A(e),className:"group text-left rounded-xl bg-zinc-800/40 border border-zinc-700/40 hover:bg-zinc-800 hover:border-indigo-500/30 transition-all duration-200 overflow-hidden",children:[(0,t.jsxs)("div",{className:"aspect-square bg-zinc-900 overflow-hidden",children:[(0,t.jsx)("img",{src:e.image,alt:e.title,className:"w-full h-full object-contain opacity-80 group-hover:opacity-100 group-hover:scale-105 transition-all duration-300",onError:em}),(0,t.jsx)("div",{className:"hidden w-full h-full items-center justify-center bg-zinc-800",children:(0,t.jsx)(S.Palette,{className:"w-8 h-8 text-zinc-600"})})]}),(0,t.jsxs)("div",{className:"p-2.5 md:p-3 h-auto md:h-[84px]",children:[(0,t.jsx)("h4",{className:"text-sm font-semibold text-white group-hover:text-indigo-300 transition-colors mb-1 truncate",children:e.title}),(0,t.jsx)("p",{className:"text-xs text-zinc-500 group-hover:text-zinc-400 transition-colors leading-relaxed line-clamp-2",children:e.description})]})]},e.id),M[23]=A,M[24]=e):e=M[24],v=L.items.map(e),M[20]=L.items,M[21]=A,M[22]=v}else v=M[22];return M[25]!==v?(N=(0,t.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3 items-start",children:v}),M[25]=v,M[26]=N):N=M[26],M[27]!==j||M[28]!==N?(z=(0,t.jsxs)("div",{className:"flex-1 p-4 overflow-y-auto",children:[j,N]}),M[27]=j,M[28]=N,M[29]=z):z=M[29],M[30]!==y||M[31]!==z?(k=(0,t.jsxs)("div",{className:"flex-1 flex flex-col md:flex-row min-h-0",children:[y,z]}),M[30]=y,M[31]=z,M[32]=k):k=M[32],M[33]===Symbol.for("react.memo_cache_sentinel")?(C=(0,t.jsx)("div",{className:"flex-shrink-0 px-5 py-2.5 border-t border-zinc-800/50 bg-zinc-900/80",children:(0,t.jsx)("p",{className:"text-[11px] text-zinc-500 text-center",children:"Select a preset to fill your prompt. You can edit it before generating."})}),M[33]=C):C=M[33],M[34]!==f||M[35]!==k?(I=(0,t.jsxs)(P.motion.div,{initial:c,animate:m,exit:h,transition:x,onClick:ec,className:"relative w-full h-full md:h-[560px] md:max-w-4xl bg-zinc-900 md:rounded-2xl md:border border-zinc-800 flex flex-col overflow-hidden shadow-2xl",children:[f,k,C]}),M[34]=f,M[35]=k,M[36]=I):I=M[36],M[37]!==T||M[38]!==I?(E=(0,t.jsx)(P.motion.div,{initial:s,animate:n,exit:l,transition:o,className:"fixed inset-0 bg-black/70 z-[10001] flex items-center justify-center p-0 md:p-4",onClick:T,children:I}),M[37]=T,M[38]=I,M[39]=E):E=M[39],E};function ec(e){return e.stopPropagation()}function em(e){e.target.style.display="none",e.target.nextSibling.style.display="flex"}e.s(["default",0,({isOpen:e,onClose:i,imageUrl:S,onAccept:C,fromProcessModal:F=!1,parentTaskId:H=null,initialPrompt:B=null,initialModel:ec=null,initialQuality:em=null,presetNote:eh=null,source:ex="unknown"})=>{let[ep,eu]=(0,a.useState)(""),[eg,eb]=(0,a.useState)(!1),[ef,ew]=(0,a.useState)(null),[ey,ej]=(0,a.useState)([]),[ev,eN]=(0,a.useState)(es),[ez,ek]=(0,a.useState)(!1),[e_,eS]=(0,a.useState)(!1),[eC,eI]=(0,a.useState)(""),[eE,eP]=(0,a.useState)(S),[eM,eT]=(0,a.useState)(!1),[eA,eR]=(0,a.useState)(!1),[eD,eL]=(0,a.useState)(null),[eO,e$]=(0,a.useState)(0),[eq,eF]=(0,a.useState)("low"),[eW,eU]=(0,a.useState)("edit"),[eH,eB]=(0,a.useState)(1),[eG,eQ]=(0,a.useState)(6),[eK,eY]=(0,a.useState)("regular"),[eV,eX]=(0,a.useState)(""),[eZ,eJ]=(0,a.useState)(!1),[e0,e1]=(0,a.useState)(50),[e2,e5]=(0,a.useState)(!1),[e3,e4]=(0,a.useState)(null),e8=(0,a.useRef)(null),e9=(0,a.useRef)(!1),{isFreeUser:e6,isAuthenticated:e7}=(0,$.useAccount)(),te=(0,a.useRef)(null),tt=(0,a.useRef)(null),ti=(0,a.useRef)(null),ta=(0,a.useRef)(null),[ts,tn]=(0,a.useState)({top:0,left:0,width:0}),tr=(0,a.useRef)(null),tl=(0,a.useRef)(null),to=(0,a.useRef)(!1);(0,a.useEffect)(()=>{e&&(e8.current={id:(0,s.v4)(),openedAt:Date.now(),generations:0,downloads:0,ended:!1},(0,L.track)("quick_edit_opened",{source:ex,edit_session_id:e8.current.id,has_preset_prompt:"string"==typeof B&&B.trim().length>0,has_parent_task:!!H}))},[e]);let td=()=>({source:ex,edit_session_id:e8.current?.id??null,generation_count:e8.current?.generations??0,seconds_open:e8.current?Math.round((Date.now()-e8.current.openedAt)/1e3):null}),tc=(e,t={})=>{(0,L.track)("quick_edit_result_used",{...td(),action:e,...t})},tm=()=>{let e=e8.current;e&&!e.ended&&(e.ended=!0,tc("closed",{had_result:ey.length>0,closed_while_generating:eg,downloaded:e.downloads>0})),i()};(0,a.useEffect)(()=>
2{if(!e)return;let t=e=>{if("Escape"===e.key&&!ez){if(e2)return void e5(!1);if(eM)return void eT(!1);tm()}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,i,ez,eM,e2,ey.length,eg]),(0,a.useEffect)(()=>{let e=e=>{let t=tt.current?.contains(e.target),i=ta.current?.contains(e.target);t||i||eT(!1)};if(eM)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[eM]),(0,a.useEffect)(()=>{e?(eP(S),"string"==typeof B&&B.trim()&&eu(B),ec&&K.has(ec)&&eN(ec),em&&V.has(em)&&eF(em)):(tr.current&&(clearInterval(tr.current),tr.current=null),tl.current=null,to.current=!1,eu(""),eb(!1),ew(null),ej([]),eN(es()),ek(!1),eS(!1),eF("low"),eU("edit"),eB(1),eQ(6),eY("regular"),eX(""),eJ(!1),e1(50),e5(!1),e4(null),e9.current=!1,eL(null),e$(0))},[e,S,B,ec,em]),(0,a.useEffect)(()=>{if(!eg||!eD?.startedAt)return void e$(0);let e=()=>{e$(Math.floor((Date.now()-eD.startedAt)/1e3))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[eg,eD?.startedAt]),(0,a.useEffect)(()=>{e6&&e7&&"high"===eq&&eF("low")},[eq,e6,e7]),(0,a.useMemo)(()=>{let e=localStorage.getItem("secure_token")||null;return e?{Authorization:`Token ${e}`}:{}},[]);let th=async(e,t)=>{let i=await fetch(e),a=await i.blob();return new Promise(i=>{let s=new Image;s.onload=()=>{let e=document.createElement("canvas"),a=e.getContext("2d"),n=s.width,r=s.height;if(n<600||r<600){let e=Math.max(600/n,600/r);n=Math.round(n*e),r=Math.round(r*e)}if(n>1500||r>1500){let e=Math.min(1500/n,1500/r);n=Math.round(n*e),r=Math.round(r*e)}e.width=n,e.height=r,a.fillStyle="#FFFFFF",a.fillRect(0,0,e.width,e.height),a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(s,0,0,n,r);let l=.85,o=n*r;o>1e6?l=.75:o>5e5&&(l=.8),e.toBlob(e=>{i(new File([e],t.replace(/\.(png|webp|gif)$/i,".jpg"),{type:"image/jpeg"}))},"image/jpeg",l)},s.onerror=()=>i(new File([a],t,{type:a.type||"image/png"})),s.crossOrigin="anonymous",s.src=e})},tx=(0,a.useCallback)(()=>{tr.current&&(clearInterval(tr.current),tr.current=null),tl.current=null,to.current=!1,eL(null),eb(!1)},[]),tp=(0,a.useCallback)(async(e,t)=>{try{let{data:i}=await n.default.get(`${R.serverURL}/image-tools/status/${e}/`,{headers:t});if("completed"===i.status){let e=i.image_url||i.thumbnail_url;if(e){let t=e.startsWith("http")?e:`${R.serverURL}${e}`;ej([t]),tx()}else ew("Edit completed but no image URL returned."),tx();return!0}if("failed"===i.status)return ew(i.error||"Image edit failed. Please try again."),tx(),!0;return!1}catch(e){if(console.error("[QuickImageEditModal] Polling error:",e),e?.response?.status===404)return ew("Edit task not found. It may have expired."),tx(),!0;return!1}},[tx]),tu=(0,a.useCallback)(async(e,t)=>{try{let{data:i}=await n.default.get(`${R.serverURL}/image-tools/batch-status/${e}/`,{headers:t});if("completed"===i.status||"partially_completed"===i.status){let e=i.image_urls||[];if(e.length>0){let t=e.map(e=>e.startsWith("http")?e:`${R.serverURL}${e}`);ej(t),tx()}else ew("Edit completed but no images returned."),tx();return!0}if("failed"===i.status)return ew(i.error||"Image edit failed. Please try again."),tx(),!0;return!1}catch(e){if(console.error("[QuickImageEditModal] Batch polling error:",e),e?.response?.status===404)return ew("Edit tasks not found. They may have expired."),tx(),!0;return!1}},[tx]),tg=(0,a.useCallback)((e,t)=>{tr.current&&(clearInterval(tr.current),tr.current=null),tl.current=e,to.current=!0,eb(!0),tr.current=setInterval(async()=>{await tp(e,t)&&tx()},2500),tp(e,t)},[tp,tx]),tb=(0,a.useCallback)((e,t)=>{tr.current&&(clearInterval(tr.current),tr.current=null),tl.current=e,to.current=!0,eb(!0),tr.current=setInterval(async()=>{await tu(e,t)&&tx()},2500),tu(e,t)},[tu,tx]);(0,a.useEffect)(()=>()=>{tr.current&&(clearInterval(tr.current),tr.current=null)},[]);let tf={"nano-banana-2":{name:"Nano Banana 2",shortDesc:"Fast",cost:W.NANO_BANANA_2_CREDITS_BY_RESOLUTION["1K"],time:"~30s",tooltip:"Powered by Gemini 3.1 Flash. Fast, versatile editing with great quality. Best for quick iterations and general-purpose edits."}
2,"nano-banana-pro":{name:"Nano Banana Pro",shortDesc:"Pro",cost:(0,W.geminiProCredits)("1K"),time:"~90s",isPro:!0,tooltip:"Premium model powered by Gemini 3 Pro. Highest quality output with exceptional detail preservation. Recommended for final production work."},"gpt-image-2-edit":{name:"GPT Image 2",shortDesc:"Best Quality",cost:Z.low,time:"~60s",isNew:!0,tooltip:"OpenAI's GPT Image 2. The best image editing model on the market with exceptional detail and prompt adherence. Low quality is fast; step up to Medium or High for detail-critical edits."},[Q]:{name:"GPT Image 2.5 Flare",shortDesc:"Fast + Faithful",cost:Z.low,time:"~45s",isNew:!0,tooltip:"OpenAI's GPT Image 2.5 Flare. Same quality tier as GPT Image 2 at up to 50% lower latency, with better detail preservation - the best pick when the image should stay recognisably the same."}},tw=tf[ev]||tf[G],ty=Y.has(ev)?Z[eq]||Z.low:tw.cost,tj=+ty,tv=eD?.estimatedSeconds??("delight"===eW?60:et[ev]),tN=tv>0,tz=tN?Math.max(tv-eO,0):0,tk=tN&&eO>=tv,t_=tN&&!tk&&tz<=10,tS=tN?Math.min(98,eO/tv*100):null,tC=eD?.imageCount||1,tI=eD?.modelName||("delight"===eW?"Lighting Restoration":tw.name),tE=eD?.mode==="delight"?"Restoring lighting...":"Editing your image...",tP=tN?tk?"No action needed. Your edit is still running, and we'll keep checking automatically.":`${tI} usually takes about ${ea(tv)}. We'll keep checking for the result.`:`${tI} usually returns results almost immediately. Still checking for the result.`,tM=tk?"Still working...":t_?"Almost there...":tN?ea(tz):"Soon",tT=({generationMode:e,model:t,quality:i,credits:a})=>{let s=e8.current;s&&(s.generations+=1);let n="edit"===e,r=ep.trim();(0,L.track)("quick_edit_generated",{...td(),mode:e,model:t,quality:i,credits:a,preset_id:n?e3?.id??null:null,preset_category:n?e3?.category??null:null,preset_prompt_edited:n&&e3?r!==e3?.prompt?.trim():null,used_initial_prompt:n&&"string"==typeof B&&r===B.trim(),prompt_improved:n&&e9.current,prompt_length:n?r.length:null,from_previous_result:eE!==S})},tA=async()=>{if(to.current)return;if(ew(null),eJ(!1),!ep.trim())return void ew("Please enter a prompt");let e=Y.has(ev)?eq:null,t=tf[ev]||tf[G],i=(et[ev]??et[G])+25+0;to.current=!0,eL({mode:"edit",model:ev,modelName:t.name,imageCount:1,estimatedSeconds:i,startedAt:Date.now()}),e$(0),eb(!0),ej([]);try{let t={"Idempotency-Key":(0,s.v4)()},i=localStorage.getItem("secure_token");i&&(t.Authorization=`Token ${i}`);let a=new FormData;if(a.append("prompt",ep.trim()),a.append("num_images",String(1)),a.append("output_format","jpeg"),Y.has(ev)){a.append("quality",e||"low");let t=await new Promise(e=>{if(!eE)return void e(null);let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.crossOrigin="anonymous",t.src=eE}),i=((e,t=X,i="auto")=>{let a,s,n=ee[t]||ee[X];if("auto"===i&&e?.width&&e?.height){let t=e.width/e.height;t>=1?(a=n,s=Math.round(n/t)):(s=n,a=Math.round(n*t))}else if(J[i]){let[e,t]=J[i],r=e/t;r>=1?(a=n,s=Math.round(n/r)):(s=n,a=Math.round(n*r))}if(!a||!s)return null;if(a>3840&&(s=Math.round(3840*s/a),a=3840),s>3840&&(a=Math.round(3840*a/s),s=3840),a*s>8294400){let e=Math.sqrt(8294400/(a*s));a=Math.round(a*e),s=Math.round(s*e)}if(a*s<655360){let e=Math.sqrt(655360/(a*s));a=Math.round(a*e),s=Math.round(s*e)}if((a=en(a))*(s=en(s))<655360&&(a=er(a),s=er(s)),a*s<655360){let e=Math.sqrt(655360/(a*s));a=er(a*e),s=er(s*e)}return{width:a,height:s}})(t,X,"auto");i&&(a.append("width",i.width),a.append("height",i.height))}let r=await th(eE,`quick-edit-${Date.now()}.png`);a.append("image",r),H&&a.append("parent_task_id",H);let l={"nano-banana-2":`${R.serverURL}/image-tools/edit-infsh-nano-banana-2-async/`,"nano-banana-pro":`${R.serverURL}/image-tools/edit-infsh-gemini-pro-async/`,"gpt-image-2-edit":`${R.serverURL}/image-tools/edit-infsh-gpt2-async/`,[Q]:`${R.serverURL}/image-tools/edit-infsh-gpt25-flare-async/`},{data:o}=await n.default.post(l[ev]||l["nano-banana-2"],a,{headers:t});if(100===o.code&&(o.task_id||o.task_ids)&&"pending"===o.status)if(tT({generationMode:"edit",model:ev,quality:e,credits:tj}),o.base_task_id&&o.task_ids?.length>1)tb(o.base_task_id,t);else{let e=o.task_id||o.task_ids?.[0];tg(e,t)}else throw Error(o.message||"Failed to start edit task")}catch(e){ew(e.response?.data?.message||e.message||"Failed to generate"),to.current=!1,eL(null),eb(!1)}},tR=async()=>
2{if(!to.current){ew(null),to.current=!0,eL({mode:"delight",model:"delight",modelName:"Lighting Restoration",imageCount:1,estimatedSeconds:60,startedAt:Date.now()}),e$(0),eb(!0),ej([]),eJ(!1),e1(50);try{let e={"Idempotency-Key":(0,s.v4)()},t=localStorage.getItem("secure_token");t&&(e.Authorization=`Token ${t}`);let i=new FormData;i.append("guidance_scale",String(eH)),i.append("num_inference_steps",String(eG)),i.append("acceleration",eK),i.append("output_format","png"),i.append("num_images","1"),eV.trim()&&i.append("seed",eV.trim());let a=await th(eE,`delight-${Date.now()}.png`);i.append("image",a),H&&i.append("parent_task_id",H);let{data:r}=await n.default.post(`${R.serverURL}/image-tools/restore-lighting-async/`,i,{headers:e});if(100===r.code&&(r.task_id||r.task_ids)&&"pending"===r.status){let t=r.task_id||r.task_ids?.[0];tT({generationMode:"delight",model:"lighting_restoration",quality:null,credits:null}),tg(t,e)}else throw Error(r.message||"Failed to start lighting restoration task")}catch(e){ew(e.response?.data?.message||e.message||"Failed to restore lighting"),to.current=!1,eL(null),eb(!1)}}},tD=(0,a.useCallback)(async()=>{if(ep.trim()&&S){eS(!0);try{let e=localStorage.getItem("secure_token"),t=e?{Authorization:`Token ${e}`}:{},i=new FormData;i.append("edit_prompt",ep.trim());let a=await th(S,`quick-edit-${Date.now()}.jpg`);i.append("images",a);let{data:s}=await n.default.post(`${R.serverURL}/image-tools/expand-edit-prompt/`,i,{headers:t});100===s.code&&s.data?.improved_prompt&&(eu(s.data.improved_prompt),e9.current=!0)}catch(e){console.error("Error improving prompt:",e)}finally{eS(!1)}}},[ep,S]),tL=async e=>{try{let t=await fetch(e),i=await t.blob(),a=ep.trim().slice(0,50).replace(/[^a-zA-Z0-9\s-]/g,"").replace(/\s+/g,"-").toLowerCase(),s=a?`${a}-${Date.now()}.png`:`edited-image-${Date.now()}.png`,n=URL.createObjectURL(i),r=document.createElement("a");r.href=n,r.download=s,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),e8.current&&(e8.current.downloads+=1),tc("downloaded",{mode:eW})}catch(e){console.error("Download failed:",e),(0,D.notify)("Failed to download image","error")}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.AnimatePresence,{mode:"wait",children:e&&(0,t.jsx)(P.motion.div,{ref:te,initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 bg-black/80 z-[9999] flex items-center justify-center p-0 md:p-6",onClick:tm,onKeyDown:e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&e.stopPropagation()},children:(0,t.jsxs)(P.motion.div,{initial:{opacity:0,scale:.96,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:5},transition:{duration:.2,ease:"easeOut"},onClick:e=>e.stopPropagation(),className:"relative w-full h-full md:max-w-[1600px] md:h-[90vh] md:max-h-[960px] bg-zinc-900 md:rounded-2xl md:border border-zinc-800 flex flex-col lg:flex-row overflow-hidden shadow-2xl",children:[(0,t.jsxs)("div",{className:"order-2 lg:order-none w-full lg:w-[340px] flex-shrink-0 border-t lg:border-t-0 lg:border-r border-zinc-800/50 flex flex-col max-h-[55dvh] md:max-h-[50dvh] lg:max-h-none bg-zinc-900/80",children:[(0,t.jsx)("div",{className:"flex-shrink-0 border-b border-zinc-800/50",children:(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(q.InstantTooltip,{title:"Edit Mode",description:"Use AI to modify your image with natural language prompts. Change poses, swap styles, add or remove objects, transform characters - describe any change and the AI will apply it.",side:"bottom",align:"start",children:(0,t.jsxs)("button",{onClick:()=>eU("edit"),className:ei("flex-1 py-3 px-4 text-sm font-medium transition-all duration-200 flex items-center justify-center gap-2 relative","edit"===eW?"text-white":"text-zinc-500 hover:text-zinc-300 hover:bg-zinc-800/50"),children:[(0,t.jsx)(f.Pencil,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Edit"}),"edit"===eW&&(0,t.jsx)(P.motion.div,{layoutId:"mode-indicator",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-white",transition:{type:"spring",stiffness:500,damping:30}})]})}),(0,t.jsx)(q.InstantTooltip,{title:"Restore Lighting",description:"Remove harsh shadows, light spots, and uneven lighting from your image. Creates uniform, neutral illumination ideal for 3D model generation. No prompt needed - the AI automatically normalizes the lighting.",side:"bottom",align:"end",children:(0,t.jsxs)("button",{onClick:()=>eU("delight"),className:ei("flex-1 py-3 px-4 text-sm font-medium transition-all duration-200 flex items-center justify-center gap-2 relative","delight"===eW?"text-white":"text-zinc-500 hover:text-zinc-300 hover:bg-zinc-800/50"),children:[(0,t.jsx)(b.Sun,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Delight"}),"delight"===eW&&(0,t.jsx)(P.motion.div,{layoutId:"mode-indicator",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-white",transition:{type:"spring",stiffness:500,damping:30}})]})})]})}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto flex flex-col gap-6 p-5",children:["edit"===eW&&(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0 gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-col min-h-[180px] flex-1",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 mb-2.5 text-sm font-semibold text-zinc-300 flex-shrink-0",children:[(0,t.jsx)(y.Type,{className:"h-4 w-4"})," Describe Changes",(0,t.jsx)("span",{className:"ml-auto px-2 py-0.5 rounded-md text-[10px] font-bold uppercase tracking-wide bg-indigo-500/10 text-indigo-400 border border-indigo-500/30",children:"Required"})]}),eh&&0===ey.length&&(0,t.jsxs)("div",{className:"mb-2.5 flex items-start gap-2 rounded-lg border border-amber-500/25 bg-amber-500/5 px-3 py-2 flex-shrink-0",children:[(0,t.jsx)(d.Sparkles,{className:"h-3.5 w-3.5 flex-shrink-0 mt-0.5 text-amber-400/90"}),(0,t.jsx)("p",{className:"text-[11px] leading-snug text-amber-200/90",children:eh})]}),(0,t.jsxs)("div",{className:"relative flex-1 flex flex-col min-h-0",children:[(0,t.jsx)("textarea",{value:ep,onChange:e=>eu(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),e.stopPropagation(),ep.trim()&&!eg&&tA())},placeholder:"e.g. turn into a 3D stylized tabletop figurine, change to T-pose, make it a robot, remove the sword, change style to...",disabled:e_,style:{scrollbarWidth:"none",msOverflowStyle:"none"},className:ei("w-full flex-1 min-h-[140px] px-4 pt-3 pb-12 rounded-xl border text-sm resize-none font-mono transition-colors duration-200","[&::-webkit-scrollbar]:hidden",e_?"opacity-60":"bg-zinc-800/50 border-zinc-700/50 hover:bg-zinc-800 hover:border-zinc-600","text-white placeholder:text-zinc-500 focus:outline-none focus:bg-zinc-800 focus:border-zinc-500"),maxLength:500}),(0,t.jsxs)(P.motion.div,{className:"absolute bottom-3 right-2.5 flex gap-1.5",layout:!0,transition:{type:"spring",stiffness:500,damping:30},children:[(0,t.jsx)(q.InstantTooltip,{title:"Presets",description:"Choose from ready-made prompts for common edits like style changes, pose adjustments, and cleanup operations.",side:"top",align:"end",children:(0,t.jsxs)("button",{onClick:()=>e5(!0),className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg bg-zinc-800/80 backdrop-blur-md border border-zinc-700 shadow-sm transition-all duration-200 text-zinc-300 hover:bg-zinc-700 hover:border-zinc-600 hover:text-indigo-400",children:[(0,t.jsx)(_.Bookmark,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"Presets"})]})}),(0,t.jsx)(q.InstantTooltip,{title:"AI Prompt Improvement",description:"Enhance your prompt using AI. Analyzes your source image and edit description to create a more detailed, effective prompt for better results.",side:"top",align:"end",children:(0,t.jsx)("button",{onClick:tD,disabled:e_||!ep.trim(),className:ei("p-1.5 rounded-lg bg-zinc-800/80 backdrop-blur-md border border-zinc-700 shadow-sm transition-all duration-200",e_||!ep.trim()?"text-zinc-600 cursor-not-allowed":"text-zinc-300 hover:bg-zinc-700 hover:border-zinc-600 hover:text-indigo-400"),children:e_?(0,t.jsx)(l.L
2oader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(d.Sparkles,{className:"h-3.5 w-3.5"})})})]})]})]}),(0,t.jsxs)("div",{className:"flex-shrink-0",ref:tt,children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 mb-2.5 text-sm font-semibold text-zinc-300",children:[(0,t.jsx)(v.Cpu,{className:"h-4 w-4"})," Model",(0,t.jsxs)("span",{className:"px-2 py-0.5 text-[9px] font-bold rounded-md border uppercase backdrop-blur-sm flex items-center gap-1 bg-gradient-to-r from-orange-500/10 to-red-500/10 border-orange-500/30 text-orange-300",children:["UPDATED",(0,t.jsx)(I.Flame,{className:"h-2.5 w-2.5",strokeWidth:2.5})]})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(q.InstantTooltip,{title:tw.name,description:tw.tooltip,side:"right",align:"start",children:(0,t.jsxs)("button",{ref:ti,onClick:()=>eT(!eM),className:ei("w-full px-4 py-2.5 rounded-xl border text-sm text-left flex items-center justify-between transition-colors duration-200","bg-zinc-800/50 border-zinc-700/50 hover:bg-zinc-800 hover:border-zinc-600"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-white font-semibold",children:tw.name}),tw.isNew&&(0,t.jsx)("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-400 border border-emerald-500/30",children:"NEW"}),tw.isPro&&(0,t.jsx)("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:"PRO"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-xs text-zinc-500",children:[ty," cr"]}),(0,t.jsx)(x.ChevronDown,{className:`w-4 h-4 text-zinc-400 transition-transform duration-200 ${eM?"rotate-180":""}`})]})]})}),eM&&(0,t.jsx)("div",{ref:ta,className:"absolute bottom-full left-0 right-0 mb-1 bg-zinc-900 border border-zinc-700 rounded-xl shadow-2xl z-[10000] py-1",children:Object.entries(tf).map(([e,i])=>{let a=i.isPro&&e6&&e7;return(0,t.jsx)(q.InstantTooltip,{title:i.name,description:i.tooltip,side:"right",align:"center",children:(0,t.jsxs)("button",{onClick:()=>!a&&void(eN(e),localStorage.setItem(U,e),eT(!1)),disabled:a,className:ei("w-full px-4 py-2.5 text-left flex items-center justify-between transition-colors",a?"opacity-40 cursor-not-allowed":ev===e?"bg-zinc-800":"hover:bg-zinc-800/50"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:ei("text-sm font-semibold",ev===e?"text-white":"text-zinc-300"),children:i.name}),i.isNew&&(0,t.jsx)("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-400 border border-emerald-500/30",children:"NEW"}),i.isPro&&(0,t.jsx)("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:"PRO"}),a&&(0,t.jsx)(p.Lock,{className:"w-3 h-3 text-zinc-500"}),ev===e&&!a&&(0,t.jsx)(o.Check,{className:"w-3.5 h-3.5 text-indigo-400"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[(0,t.jsxs)("span",{children:[i.cost," cr"]}),(0,t.jsx)("span",{children:"·"}),(0,t.jsx)("span",{children:i.time})]})]})},e)})})]})]}),Y.has(ev)&&(0,t.jsxs)("div",{className:"flex-shrink-0",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 mb-2.5 text-sm font-semibold text-zinc-300",children:[(0,t.jsx)(d.Sparkles,{className:"h-4 w-4"})," Quality"]}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",children:[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}].map(e=>{let i=eq===e.value,a="high"===e.value&&e6&&e7,s=Z[e.value];return(0,t.jsx)(q.InstantTooltip,{title:a?"High Quality · Premium":`${e.label} Quality`,description:a?"Upgrade to use High quality for GPT Image 2 edits.":`${e.label} quality costs ${s} credits per image.`,side:"top",align:"center",children:(0,t.jsxs)("button",{onClick:()=>{var t;"high"===(t=e.value)&&e6&&e7?(0,D.notify)({title:"Premium Quality",subtitle:"Upgrade to use High quality"},"warning"):eF(t)},disabled:a,className:ei("py-2.5 rounded-xl text-sm font-semibold border-2 transition-all duration-200 flex items-center justify-center gap-1.5",a?"text-zinc-700 cursor-not-allowed bg-zinc-800/30 border-zinc-800":i?"bg-zinc-100 text-zinc-900 border-zinc-100":"bg-zinc-800/50 text-zinc-300 border-zinc-700 hover:bg-zinc-700 hover:border-zinc-500"),children:[(0,t.jsx)("span",{children:e.label}),a&&(0,t.jsx)(p.Lock,{className:"w-3 h-3"})]})},e.value)})})]})]}),"delight"===eW&&(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0 gap-6",children:[(0,t.jsx)("div",{className:"flex-shrink-0 relative overflow-hidden backdrop-blur-md border rounded-xl p-3 shadow-lg bg-indigo-500/10 border-indigo-500/30",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"p-2 rounded-lg bg-indigo-500/20",children:(0,t.jsx)(b.Sun,{className:"w-4 h-4 text-indigo-400"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-zinc-100 mb-1",children:"Lighting Restoration"}),(0,t.jsx)("p",{className:"text-xs text-zinc-400 leading-relaxed",children:"Optional step to normalize lighting. Prevents harsh shadows from baking into 3D textures."})]})]})}),(0,t.jsxs)("div",{className:"flex-shrink-0 space-y-2.5",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm font-semibold text-zinc-300",children:[(0,t.jsx)(j.SlidersHorizontal,{className:"h-4 w-4"})," Guidance Scale"]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("input",{type:"range",min:"0.5",max:"3",step:"0.1",value:eH,onChange:e=>eB(parseFloat(e.target.value)),className:` 3 w-full h-2 rounded-full appearance-none cursor-pointer 4 bg-zinc-700 5 [&::-webkit-slider-thumb]:appearance-none 6 [&::-webkit-slider-thumb]:w-4 7 [&::-webkit-slider-thumb]:h-4 8 [&::-webkit-slider-thumb]:rounded-full 9 [&::-webkit-slider-thumb]:bg-gradient-to-r 10 [&::-webkit-slider-thumb]:from-indigo-500 11 [&::-webkit-slider-thumb]:to-purple-500 12 [&::-webkit-slider-thumb]:shadow-md 13 [&::-webkit-slider-thumb]:shadow-indigo-500/25 14 [&::-webkit-slider-thumb]:transition-transform 15 [&::-webkit-slider-thumb]:hover:scale-110 16 `}),(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs",children:[(0,t.jsx)("span",{className:"text-zinc-500",children:"0.5"}),(0,t.jsx)("span",{className:"px-2 py-0.5 rounded-md font-bold bg-zinc-800/50 text-white text-xs",children:eH.toFixed(1)}),(0,t.jsx)("span",{className:"text-zinc-500",children:"3.0"})]})]})]}),(0,t.jsxs)("div",{className:"flex-shrink-0 space-y-2.5",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm font-semibold text-zinc-300",children:[(0,t.jsx)(j.SlidersHorizontal,{className:"h-4 w-4"})," Quality Steps"]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("input",{type:"range",min:"4",max:"20",step:"1",value:eG,onChange:e=>eQ(parseInt(e.target.value)),className:` 17 w-full h-2 rounded-full appearance-none cursor-pointer 18 bg-zinc-700 19 [&::-webkit-slider-thumb]:appearance-none 20 [&::-webkit-slider-thumb]:w-4 21 [&::-webkit-slider-thumb]:h-4 22 [&::-webkit-slider-thumb]:rounded-full 23 [&::-webkit-slider-thumb]:bg-gradient-to-r 24 [&::-webkit-slider-thumb]:from-indigo-500 25 [&::-webkit-slider-thumb]:to-purple-500 26 [&::-webkit-slider-thumb]:shadow-md 27 [&::-webkit-slider-thumb]:shadow-indigo-500/25 28 [&::-webkit-slider-thumb]:transition-transform 29 [&::-webkit-slider-thumb]:hover:scale-110 30 `}),(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs",children:[(0,t.jsx)("span",{className:"text-zinc-500",children:"4"}),(0,t.jsx)("span",{className:"px-2 py-0.5 rounded-md font-bold bg-zinc-800/50 text-white text-xs",children:eG}),(0,t.jsx)("span",{className:"text-zinc-500",children:"20"})]})]})]}),(0,t.jsxs)("div",{className:"flex-shrink-0",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 mb-2.5 text-sm font-semibold text-zinc-300",children:[(0,t.jsx)(v.Cpu,{className:"h-4 w-4"})," Speed Mode"]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsx)("button",{onClick:()=>eY("regular"),className:ei("py-2.5 px-3 rounded-xl text-sm font-semibold border-2 transition-all duration-200","regular"===eK?"bg-zinc-100 text-zinc-900 border-zinc-100":"bg-zinc-800/50 text-zinc-300 border-zinc-700 hover:bg-zinc-700 hover:border-zinc-500"),children:"Regular"}),(0,t.jsx)("button",{onClick:()=>eY("none"),className:ei("py-2.5 px-3 rounded-xl text-sm font-semibold border-2 transition-all duration-200","
30none"===eK?"bg-zinc-100 text-zinc-900 border-zinc-100":"bg-zinc-800/50 text-zinc-300 border-zinc-700 hover:bg-zinc-700 hover:border-zinc-500"),children:"Quality"})]})]}),(0,t.jsxs)("div",{className:"flex-shrink-0",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 mb-2.5 text-sm font-semibold text-zinc-300",children:[(0,t.jsx)(N.Hash,{className:"h-4 w-4"})," Seed",(0,t.jsx)("span",{className:"ml-auto px-2 py-0.5 rounded-md text-[10px] font-bold uppercase tracking-wide bg-zinc-800 text-zinc-400 border border-zinc-700",children:"Optional"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-400",children:(0,t.jsx)(N.Hash,{className:"h-4 w-4"})}),(0,t.jsx)("input",{type:"text",value:eV,onChange:e=>eX(e.target.value.replace(/\D/g,"")),placeholder:"Random",className:ei("w-full pl-10 pr-4 py-2.5 rounded-xl border text-sm font-medium transition-all duration-200","bg-zinc-800/50 border-zinc-700/50 hover:bg-zinc-800 hover:border-zinc-600","text-white placeholder:text-zinc-500 focus:outline-none focus:bg-zinc-800 focus:border-zinc-500")})]}),(0,t.jsx)("button",{onClick:()=>eX(String(Math.floor(1e5*Math.random()))),className:"p-2.5 rounded-xl bg-zinc-800/50 hover:bg-zinc-800 border border-zinc-700/50 text-zinc-300 transition-all duration-200",title:"Randomize seed",children:"ð²"})]})]})]}),ef&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5 p-3 bg-red-900/30 border border-red-700/30 rounded-xl text-xs text-red-300 min-w-0 overflow-hidden max-h-24",children:[(0,t.jsx)(E.AlertCircle,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5 text-red-400/80"}),(0,t.jsx)("span",{className:"break-words min-w-0 line-clamp-4",style:{overflowWrap:"anywhere"},children:ef})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-amber-500/5 border border-amber-500/20",children:[(0,t.jsx)(d.Sparkles,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5 text-amber-400/70"}),(0,t.jsx)("p",{className:"text-[11px] leading-relaxed text-amber-200/70",children:"Try selecting a different model. Some may be experiencing high demand."})]})]})]}),(0,t.jsx)("div",{className:"flex-shrink-0 p-5 border-t border-zinc-700/30",children:"edit"===eW?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3 text-xs",children:[(0,t.jsxs)("span",{className:"text-zinc-400",children:[(0,t.jsx)("span",{className:"font-semibold text-zinc-200",children:1})," ","image"," à ",(0,t.jsx)("span",{className:"font-semibold text-zinc-200",children:ty})," credits"]}),(0,t.jsxs)("span",{className:"font-semibold text-zinc-200",children:["Total: ",tj]})]}),(0,t.jsx)("button",{onClick:tA,disabled:!ep.trim()||eg||e_,className:ei("w-full py-3 rounded-xl text-sm font-semibold transition-all duration-200 flex items-center justify-center gap-2 shadow-sm",!ep.trim()||eg||e_?"bg-zinc-800 text-zinc-600 cursor-not-allowed border border-zinc-700":"bg-zinc-100 text-zinc-900 hover:bg-zinc-200 border border-zinc-100 hover:shadow-md"),children:eg?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Loader2,{className:"w-4 h-4 animate-spin"}),(0,t.jsx)("span",{children:"Generating..."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.ArrowRight,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Generate"})]})}),(0,t.jsxs)("div",{className:"hidden md:flex items-center justify-center gap-1.5 text-[11px] text-zinc-400 mt-3",children:[(0,t.jsx)(v.Cpu,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:"Press"}),(0,t.jsx)("kbd",{className:"px-1.5 py-0.5 bg-zinc-800 text-zinc-300 rounded-md text-[9px] font-mono border border-zinc-700",children:"Ctrl"}),(0,t.jsx)("span",{className:"text-zinc-600",children:"+"}),(0,t.jsx)("kbd",{className:"px-1.5 py-0.5 bg-zinc-800 text-zinc-300 rounded-md text-[9px] font-mono border border-zinc-700",children:"Enter"}),(0,t.jsx)("span",{children:"to generate"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3 text-xs",children:[(0,t.jsxs)("span",{className:"text-zinc-400",children:[(0,t.jsx)("span",{className:"font-semibold text-zinc-200",children:"1"})," image à ",(0,t.jsx)("span",{className:"font-semibold text-zinc-200",children:"2"})," credits"]}),(0,t.jsx)("span",{className:"font-semibold text-zinc-200",children:"Total: 2"})]}),(0,t.jsx)("button",{onClick:tR,disabled:eg,className:ei("w-full py-3 rounded-xl text-sm font-semibold transition-all duration-200 flex items-center justify-center gap-2 shadow-sm",eg?"bg-zinc-800 text-zinc-600 cursor-not-allowed border border-zinc-700":"bg-zinc-100 text-zinc-900 hover:bg-zinc-200 border border-zinc-100 hover:shadow-md"),children:eg?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.L
30oader2,{className:"w-4 h-4 animate-spin"}),(0,t.jsx)("span",{children:"Processing..."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.Sun,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Restore Lighting"})]})})]})})]}),(0,t.jsxs)("div",{className:"order-1 lg:order-none flex-1 flex flex-col min-h-0 relative",style:{backgroundColor:"#0a0a0b",backgroundImage:` 31 linear-gradient(rgba(63, 63, 70, 0.15) 1px, transparent 1px), 32 linear-gradient(90deg, rgba(63, 63, 70, 0.15) 1px, transparent 1px) 33 `,backgroundSize:"40px 40px"},children:[(0,t.jsx)("div",{className:"flex items-center justify-end px-4 lg:px-5 py-2 border-b border-zinc-800/50 flex-shrink-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(q.InstantTooltip,{title:"Video Tutorial",description:"Watch a quick video guide on how to use the image editing features effectively. Learn tips and tricks for better results.",side:"bottom",align:"end",children:(0,t.jsxs)("button",{onClick:()=>window.open("https://www.youtube.com/watch?v=VlqPwMZKVTY","_blank"),className:"hidden sm:flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors",children:[(0,t.jsx)(g.ExternalLink,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:"Guide"})]})}),ey.length>0&&(0,t.jsx)(q.InstantTooltip,{title:"Clear Results",description:"Clear the generated images and start fresh with a new prompt.",side:"bottom",align:"end",children:(0,t.jsxs)("button",{onClick:()=>{ej([]),eJ(!1)},className:"hidden sm:flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors",children:[(0,t.jsx)(k.RotateCcw,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:"Clear Results"})]})}),(0,t.jsx)(q.InstantTooltip,{title:"Close",description:"Close this modal. You can also press Escape to close.",side:"bottom",align:"end",children:(0,t.jsx)("button",{onClick:tm,className:"p-2 rounded-lg text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors",children:(0,t.jsx)(r.X,{className:"w-4 h-4"})})})]})}),(0,t.jsxs)("div",{className:"flex-1 p-3 lg:p-4 overflow-auto min-h-0 relative",children:[(0,t.jsx)(M.AnimatePresence,{children:0===ey.length&&!eg&&!eA&&!ep.trim()&&"edit"===eW&&(0,t.jsx)(P.motion.img,{src:"/DescribeYourChanges.png",alt:"Describe your changes",className:"absolute top-24 left-3 w-32 h-auto opacity-50 pointer-events-none z-10",initial:{opacity:0,x:-20,scale:.9},animate:{opacity:.5,x:0,scale:1},exit:{opacity:0,x:-10,scale:.95},transition:{duration:.3,ease:"easeOut"}})}),0===ey.length&&!eg&&(0,t.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,t.jsx)(M.AnimatePresence,{mode:"wait",children:eA&&"edit"===eW?(0,t.jsxs)(P.motion.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9,filter:"blur(8px)"},transition:{duration:.3,ease:"easeOut"},className:"w-full h-full flex items-center justify-center",children:[(0,t.jsxs)("div",{className:"relative hidden lg:block",style:{width:"1000px",height:"560px"},children:[(0,t.jsxs)("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",style:{zIndex:0},children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:"line-left",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#52525b",stopOpacity:"0.7"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#3f3f46",stopOpacity:"0.2"})]}),(0,t.jsxs)("linearGradient",{id:"line-right",x1:"100%",y1:"0%",x2:"0%",y2:"0%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#52525b",stopOpacity:"0.7"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#3f3f46",stopOpacity:"0.2"})]})]}),(0,t.jsx)("path",{d:"M 500 250 C 380 250, 300 150, 220 130",fill:"none",stroke:"url(#line-left)",strokeWidth:"1.5",strokeLinecap:"round"}),(0,t.jsx)("circle",{r:"2.5",fill:"#71717a",children:(0,t.jsx)("animateMotion",{dur:"2.5s",repeatCount:"indefinite",path:"M 500 250 C 380 250, 300 150, 220 130"})}),(0,t.jsx)("path",{d:"M 500 310 C 380 310, 300 410, 220 430",fill:"none",stroke:"url
33(#line-left)",strokeWidth:"1.5",strokeLinecap:"round"}),(0,t.jsx)("circle",{r:"2.5",fill:"#71717a",children:(0,t.jsx)("animateMotion",{dur:"2.8s",repeatCount:"indefinite",path:"M 500 310 C 380 310, 300 410, 220 430"})}),(0,t.jsx)("path",{d:"M 500 250 C 620 250, 700 150, 780 130",fill:"none",stroke:"url(#line-right)",strokeWidth:"1.5",strokeLinecap:"round"}),(0,t.jsx)("circle",{r:"2.5",fill:"#71717a",children:(0,t.jsx)("animateMotion",{dur:"2.3s",repeatCount:"indefinite",path:"M 500 250 C 620 250, 700 150, 780 130"})}),(0,t.jsx)("path",{d:"M 500 310 C 620 310, 700 410, 780 430",fill:"none",stroke:"url(#line-right)",strokeWidth:"1.5",strokeLinecap:"round"}),(0,t.jsx)("circle",{r:"2.5",fill:"#71717a",children:(0,t.jsx)("animateMotion",{dur:"2.6s",repeatCount:"indefinite",path:"M 500 310 C 620 310, 700 410, 780 430"})})]}),(0,t.jsx)("div",{className:"absolute z-20 px-3 py-2.5 bg-zinc-900 rounded-xl shadow-xl shadow-black/50 w-[120px]",style:{left:"300px",top:"170px",transform:"translate(-50%, -50%)"},children:(0,t.jsx)("p",{className:"text-xs text-white font-medium leading-relaxed",children:'"change the orc to be a human"'})}),(0,t.jsx)("div",{className:"absolute z-20 px-3 py-2.5 bg-zinc-900 rounded-xl shadow-xl shadow-black/50 w-[120px]",style:{left:"300px",top:"390px",transform:"translate(-50%, -50%)"},children:(0,t.jsx)("p",{className:"text-xs text-white font-medium leading-relaxed",children:'"remove the axe and make it t pose"'})}),(0,t.jsx)("div",{className:"absolute z-20 px-3 py-2.5 bg-zinc-900 rounded-xl shadow-xl shadow-black/50 w-[120px]",style:{left:"700px",top:"170px",transform:"translate(-50%, -50%)"},children:(0,t.jsx)("p",{className:"text-xs text-white font-medium leading-relaxed",children:'"return just the axe centered front view"'})}),(0,t.jsx)("div",{className:"absolute z-20 px-3 py-2.5 bg-zinc-900 rounded-xl shadow-xl shadow-black/50 w-[120px]",style:{left:"700px",top:"390px",transform:"translate(-50%, -50%)"},children:(0,t.jsx)("p",{className:"text-xs text-white font-medium leading-relaxed",children:'"turn it into a hand drawn line sketch"'})}),(0,t.jsxs)("div",{className:"absolute z-10",style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)"},children:[(0,t.jsx)("img",{src:"/ExampleArrow.png",alt:"Example",className:"absolute -top-14 left-1/2 -translate-x-1/2 w-28 h-auto opacity-70 pointer-events-none"}),(0,t.jsx)("div",{className:"absolute -inset-10 bg-zinc-700/10 rounded-full blur-2xl"}),(0,t.jsx)(P.motion.div,{className:"absolute -inset-4 rounded-2xl border border-zinc-600/30",animate:{scale:[1,1.05,1],opacity:[.4,.2,.4]},transition:{duration:2.5,repeat:1/0,ease:"easeInOut"}}),(0,t.jsx)("div",{className:"relative bg-zinc-900 p-2.5 rounded-xl border border-zinc-700 shadow-2xl shadow-black/50",children:(0,t.jsx)("img",{src:"/EditWithAIExamples/Orc/Source.jpeg",alt:"Example Source",className:"w-36 h-36 lg:w-44 lg:h-44 object-cover rounded-lg"})}),(0,t.jsxs)("button",{onClick:()=>eR(!1),className:"absolute -bottom-12 left-1/2 -translate-x-1/2 flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-zinc-900 border border-zinc-800 text-xs text-zinc-500 hover:text-zinc-300 hover:border-zinc-700 transition-all whitespace-nowrap",children:[(0,t.jsx)(d.Sparkles,{className:"w-3 h-3"}),"Hide example"]})]}),(0,t.jsxs)(P.motion.button,{whileHover:{scale:1.03,y:-3},whileTap:{scale:.98},onClick:()=>eu("change the orc to be a human"),className:"absolute z-10 group",style:{left:"20px",top:"20px"},children:[(0,t.jsx)("span",{className:"block text-xs text-zinc-400 font-medium mb-1.5 text-center",children:"Adjust Anything"}),(0,t.jsx)("div",{className:"bg-zinc-900/95 backdrop-blur-sm border border-zinc-700/60 rounded-xl p-2 hover:border-zinc-500 hover:bg-zinc-800/95 transition-all",children:(0,t.jsx)("div",{className:"w-[180px] aspect-square rounded-lg bg-zinc-800 border border-zinc-700/50 overflow-hidden",children:(0,t.jsx)("img",{src:"/EditWithAIExamples/Orc/change_the_orc_to_be_a_human.jpeg",alt:"Example result",className:"w-full h-full object-cover opacity-80 group-hover:opacity-100 transition-opacity"})})})]}),(0,t.jsxs)(P.motion.button,{whileHover:{scale:1.03,y:-3},whileTap:{scale:.98},onClick:()=>eu("remove the axe and make it t pose front"),className:"absolute z-10 group",style:{left:"20px",bottom:"20px"},children:[(0,t.jsx)("span",{className:"block text-xs text-zinc-400 font-medium mb-1.5 text-center",children:"Change Poses"}),(0,t.jsx)("div",{className:"bg-zinc-900/95 backdrop-blur-sm border border-zinc-700/60 rounded-xl p-2 hover:border-zinc-500 hover:bg-zinc-800/95 transition-all",children:(0,t.jsx)("div",{className:"w-[180px] aspect-square rounded-lg bg-zinc-800 border border-zinc-700/50 overflow-hidden",children:(0,t.jsx)("img",{src:"/EditWithAIExamples/Orc/remove_the_axe_and_make_it_t_pose_front.jpeg",alt:"Example result",className:"w-full h-full object-cover opacity-80 group-hover:opacity-100 transition-opacity"})})})]}),(0,t.jsxs)(P.motion.button,{whileHover:{scale:1.03,y:-3},whileTap:{scale:.98},onClick:()=>eu("return just the axe centered front view"),className:"absolute z-10 group",style:{right:"20px",top:"20px"},children:[(0,t.jsx)("span",{className:"block text-xs text-zinc-400 font-medium mb-1.5 text-center",children:"Add/Remove Objects"}),(0,t.jsx)("div",{className:"bg-zinc-900/95 backdrop-blur-sm border border-zinc-700/60 rounded-xl p-2 hover:border-zinc-500 hover:bg-zinc-800/95 transition-all",children:(0,t.jsx)("div",{className:"w-[180px] aspect-square rounded-lg bg-zinc-800 border border-zinc-700/50 overflow-hidden",children:(0,t.jsx)("img",{src:"/EditWithAIExamples/Orc/return_just_the_axe_centered_front_view.jpeg",alt:"Example result",className:"w-full h-full object-cover opacity-80 group-hover:opacity-100 transition-opacity"})})})]}),(0,t.jsxs)(P.motion.button,{whileHover:{scale:1.03,y:-3},whileTap:{scale:.98},onClick:()=>eu("turn it into a hand drawn line sketch"),className:"absolute z-10 group",style:{right:"20px",bottom:"20px"},children:[(0,t.jsx)("span",{className:"block text-xs text-zinc-400 font-medium mb-1.5 text-center",children:"Change Style"}),(0,t.jsx)("div",{className:"bg-zinc-900/95 backdrop-blur-sm border border-zinc-700/60 rounded-xl p-2 hover:border-zinc-500 hover:bg-zinc-800/95 transition-all",children:(0,t.jsx)("div",{className:"w-[180px] aspect-square rounded-lg bg-zinc-800 border border-zinc-700/50 overflow-hidden",children:(0,t.jsx)("img",{src:"/EditWithAIExamples/Orc/turn_it_into_a_hand_drawn_line_sketch.jpeg",alt:"Example result",className:"w-full h-full object-cover opacity-80 group-hover:opacity-100 transition-opacity"})})})]})]}),(0,t.jsxs)("div",{className:"lg:hidden flex flex-col items-center gap-4 px-4 py-2 w-full max-w-md",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"bg-zinc-900 p-2 rounded-xl border border-zinc-700 shadow-xl",children:(0,t.jsx)("img",{src:"/EditWithAIExamples/Orc/Source.jpeg",alt:"Example Source",className:"w-24 h-24 object-cover rounded-lg"})}),(0,t.jsx)("span",{className:"absolute -top-2 left-1/2 -translate-x-1/2 text-[10px] font-bold text-zinc-400 uppercase tracking-wide bg-zinc-900 px-2",children:"Source"})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2 w-full",children:[{img:"/EditWithAIExamples/Orc/change_the_orc_to_be_a_human.jpeg",label:"Adjust Anything",prompt:"change the orc to be a human"},{img:"/EditWithAIExamples/Orc/remove_the_axe_and_make_it_t_pose_front.jpeg",label:"Change Poses",prompt:"remove the axe and make it t pose front"},{img:"/EditWithAIExamples/Orc/return_just_the_axe_centered_front_view.jpeg",label:"Add/Remove",prompt:"return just the axe centered front view"},{img:"/EditWithAIExamples/Orc/turn_it_into_a_hand_drawn_line_sketch.jpeg",label:"Change Style",prompt:"turn it into a hand drawn line sketch"}].map((e,i)=>(0,t.jsxs)("button",{onClick:()=>eu(e.prompt),className:"group text-left rounded-xl bg-zinc-800/40 border border-zinc-700/40 hover:bg-zinc-800 hover:border-zinc-600 transition-all overflow-hidden",children:[(0,t.jsx)("div",{className:"aspect-square bg-zinc-900 overflow-hidden",children:(0,t.jsx)("img",{src:e.img,alt:e.label,className:"w-full h-full object-cover opacity-80 group-hover:opacity-100 transition-opacity"})}),(0,t.jsx)("div",{className:"p-2",children:(0,t.jsx)("span",{className:"text-[11px] font-semibold text-zinc-300",children:e.label})})]},i))}),(0,t.jsxs)("button",{onClick:()=>eR(!1),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-zinc-900 border border-zinc-800 text-xs text-zinc-500 hover:text-zinc-300 transition-all",children:[(0,t.jsx)(d.Sparkles,{className:"w-3 h-3"}),"Hide example"]})]})]},"example"):"edit"===eW?(0,t.jsxs)(P.motion.div,{initial:{opacity:0,y:20}
33,animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.4,ease:"easeOut"},className:"flex flex-col items-center justify-center text-center max-w-lg px-4 md:px-6",children:[(0,t.jsx)(q.InstantTooltip,{title:"Source Image",description:"Click to view the source image at full size.",side:"top",align:"center",children:(0,t.jsxs)(P.motion.button,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{delay:.1,type:"spring",stiffness:200,damping:20},whileHover:{scale:1.03},whileTap:{scale:.98},onClick:()=>{eI(eE),ek(!0)},className:"relative mb-3 md:mb-6 group cursor-pointer",children:[(0,t.jsx)("div",{className:"absolute -inset-3 bg-zinc-700/20 rounded-2xl blur-xl group-hover:bg-indigo-500/10 transition-colors"}),(0,t.jsxs)("div",{className:"relative rounded-xl overflow-hidden border-2 border-zinc-700 shadow-2xl shadow-black/50 group-hover:border-indigo-500/50 transition-colors",children:[eE&&(0,t.jsx)("img",{src:eE,alt:"Source",className:"max-w-20 max-h-20 md:max-w-32 md:max-h-32 w-auto h-auto object-contain"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-white text-xs font-medium",children:[(0,t.jsx)(u.Eye,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"View Full Size"})]})})]}),(0,t.jsx)(P.motion.div,{className:"absolute -bottom-2 -right-2 w-6 h-6 md:w-8 md:h-8 rounded-lg bg-zinc-800 border border-zinc-600 flex items-center justify-center shadow-lg",initial:{scale:0},animate:{scale:1},transition:{delay:.3,type:"spring"},children:(0,t.jsx)(c.Wand2,{className:"w-3 h-3 md:w-4 md:h-4 text-zinc-300"})})]})}),(0,t.jsx)(P.motion.h3,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.15},className:"text-sm md:text-lg font-semibold text-white mb-1 md:mb-2",children:"Ready to edit"}),(0,t.jsxs)(P.motion.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2},className:"hidden md:block text-sm text-zinc-300 leading-relaxed mb-5",children:["Use AI to edit your image before 3D generation. Just describe any change you want - swap poses, adjust styles, add or remove objects. The only limit is your ",(0,t.jsx)("em",{className:"text-white not-italic font-medium",children:"imagination"}),"."]}),(0,t.jsx)(P.motion.p,{initial:{opacity:0}
33,animate:{opacity:1},transition:{delay:.2},className:"md:hidden text-xs text-zinc-400 mb-3",children:"Describe any change in the sidebar below"}),(0,t.jsxs)(P.motion.button,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.25},whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>eR(!0),className:"hidden md:flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-zinc-900 border border-zinc-800 text-xs text-zinc-500 hover:text-zinc-300 hover:border-zinc-700 transition-all",children:[(0,t.jsx)(d.Sparkles,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:"View examples"})]})]},"simple-edit"):(0,t.jsxs)(P.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.4,ease:"easeOut"},className:"flex flex-col items-center justify-center text-center max-w-2xl px-6",children:[(0,t.jsxs)(P.motion.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:{delay:.1,type:"spring",stiffness:200,damping:20},className:"flex items-center gap-6 mb-6",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute -inset-2 bg-zinc-700/20 rounded-2xl blur-xl"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("span",{className:"absolute -top-6 left-1/2 -translate-x-1/2 text-xs font-medium text-zinc-500 uppercase tracking-wide",children:"Before"}),(0,t.jsx)("div",{className:"rounded-xl overflow-hidden border-2 border-zinc-700 shadow-2xl shadow-black/50",children:(0,t.jsx)("img",{src:"/DelightImage/OriginalImage.jpg",alt:"Before",className:"w-24 h-24 md:w-40 md:h-40 lg:w-48 lg:h-48 object-cover"})})]})]}),(0,t.jsxs)(P.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.3},className:"flex flex-col items-center gap-1.5 md:gap-2",children:[(0,t.jsx)("div",{className:"w-8 md:w-12 h-0.5 bg-gradient-to-r from-zinc-700 via-zinc-500 to-zinc-700"}),(0,t.jsx)(b.Sun,{className:"w-4 h-4 md:w-5 md:h-5 text-zinc-500"}),(0,t.jsx)("div",{className:"w-8 md:w-12 h-0.5 bg-gradient-to-r from-zinc-700 via-zinc-500 to-zinc-700"})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute -inset-2 bg-indigo-500/10 rounded-2xl blur-xl"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("span",{className:"absolute -top-6 left-1/2 -translate-x-1/2 text-xs font-medium text-indigo-400 uppercase tracking-wide",children:"After"}),(0,t.jsx)("div",{className:"rounded-xl overflow-hidden border-2 border-indigo-500/30 shadow-2xl shadow-indigo-500/10",children:(0,t.jsx)("img",{src:"/DelightImage/Lighting_Restored_Image.jpg",alt:"After",className:"w-24 h-24 md:w-40 md:h-40 lg:w-48 lg:h-48 object-cover"})})]})]})]}),(0,t.jsx)(P.motion.h3,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.15},className:"text-sm md:text-lg font-semibold text-white mb-1 md:mb-2",children:"Restore Lighting"}),(0,t.jsx)(P.motion.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2},className:"hidden md:block text-sm text-zinc-400 leading-relaxed max-w-md",children:"Remove harsh shadows and normalize lighting before 3D generation. This prevents lighting artifacts from being baked into your model's texture."}),(0,t.jsx)(P.motion.p,{initial:{opacity:0}
33,animate:{opacity:1},transition:{delay:.2},className:"md:hidden text-xs text-zinc-400",children:"Removes harsh shadows and normalizes lighting"})]},"simple-delight")})}),eg&&(0,t.jsxs)("div",{className:"absolute inset-0 z-20 flex items-center justify-center overflow-hidden",children:[eE&&(0,t.jsx)("img",{src:eE,alt:"",className:"absolute inset-0 m-auto max-w-[88%] max-h-[88%] object-contain rounded-2xl scale-[1.02] opacity-70",style:{filter:"blur(7px) brightness(0.52)"}}),(0,t.jsx)("div",{className:"absolute inset-0 bg-black/45"}),(0,t.jsxs)(P.motion.div,{initial:{opacity:0,scale:.96,y:8},animate:{opacity:1,scale:1,y:0},transition:{duration:.25,ease:"easeOut"},className:`relative z-10 flex flex-col items-center text-center px-6 ${A.GeistSans.className}`,children:[(0,t.jsx)(T.GridLoader,{color:"#a5b4fc",size:12,margin:3,speedMultiplier:.9}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-1.5",children:[(0,t.jsx)(M.AnimatePresence,{mode:"wait",initial:!1,children:(0,t.jsx)(P.motion.span,{initial:{opacity:0,scale:.92,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:-2},transition:{type:"spring",stiffness:380,damping:24,mass:.6},className:"text-[13px] font-medium text-indigo-200/90 tracking-wide",children:tE},tE)}),(0,t.jsx)("span",{className:"text-[11px] text-zinc-400/80",style:{textShadow:"0 1px 4px rgba(0,0,0,0.5)"},children:tC>1?`${tC} images queued`:eD?.mode==="delight"?"Normalizing shadows and highlights":"Preparing a new edited image"})]})]}),(0,t.jsxs)(P.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut",delay:.05},className:`absolute bottom-4 right-4 left-4 sm:left-auto sm:w-64 z-10 text-right ${A.GeistSans.className}`,children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-end gap-1.5",style:{textShadow:"0 1px 5px rgba(0,0,0,0.7)"},children:[(0,t.jsx)("span",{className:ei("font-semibold tabular-nums text-white/90",t_||tk?"text-xs":"text-sm"),children:tM}),(0,t.jsx)("span",{className:"text-[9px] font-medium uppercase tracking-[0.14em] text-zinc-400/80",children:tk?"checking":t_?"finishing":tN?"estimated":"now"})]}),null!==tS&&(0,t.jsx)("div",{className:"ml-auto mt-1.5 h-0.5 w-32 overflow-hidden rounded-full bg-white/15",children:(0,t.jsx)(P.motion.div,{className:"h-full rounded-full bg-indigo-200/80",initial:{width:"0%"},animate:{width:`${tS}%`},transition:{duration:.35,ease:"easeOut"}})}),(0,t.jsx)("p",{className:"ml-auto mt-1.5 max-w-64 text-[10px] leading-snug text-zinc-400/80",style:{textShadow:"0 1px 5px rgba(0,0,0,0.7)"},children:tP})]})]}),ey.length>0&&!eg&&(0,t.jsx)("div",{className:`h-full grid gap-3 ${(e=>{switch(e){case 1:return"grid-cols-1";case 2:default:return"grid-cols-2";case 3:return"grid-cols-3";case 4:return"grid-cols-2 grid-rows-2"}})(ey.length)}`,children:ey.map((e,a)=>(0,t.jsxs)("div",{className:"group relative rounded-xl overflow-hidden border border-zinc-700/40 bg-zinc-900/50 flex items-center justify-center",children:[(0,t.jsx)("div",{className:"relative w-full h-full flex items-center justify-center p-2",children:"delight"===eW&&eZ?(0,t.jsx)("div",{className:"relative rounded-lg shadow-xl overflow-hidden cursor-ew-resize select-none",style:{maxWidth:"90%",maxHeight:"90%"},onPointerDown:e=>{let t=e.currentTarget.getBoundingClientRect(),i=e=>{e1(Math.max(0,Math.min(100,(e-t.left)/t.width*100)))};i(e.clientX);let a=e=>i(e.clientX),s=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",s)},children:(0,t.jsxs)("div",{className:"relative pointer-events-none",children:[(0,t.jsx)("div",{className:"bg-zinc-900",children:(0,t.jsx)("img",{src:e,alt:"After",className:"max-w-[70vw] max-h-[60vh] object-contain",draggable:!1})}),(0,t.jsx)("div",{className:"absolute inset-0",style:{clipPath:`polygon(0 0, ${e0}% 0, ${e0}% 100%, 0 100%)`},children:(0,t.jsx)("img",{src:eE,alt:"Before",className:"max-w-[70vw] max-h-[60vh] object-contain bg-zinc-900",draggable:!1})}),(0,t.jsx)("div",{className:"absolute top-0 bottom-0 w-0.5 bg-white/90 shadow-md pointer-events-none",style:{left:`${e0}%`},children:(0,t.jsxs)("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-6 h-6 bg-white/90 rounded-full border-2 border-indigo-500 shadow-lg pointer-events-none",children:[(0,t.jsx)("div",{className:"w-0.5 h-3 bg-indigo-600 rounded-full absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2"}),(0,t.jsx)("div",{className:"h-0.5 w-3 bg-indigo-600 rounded-full absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2"})]})}),(0,t.jsx)("div",{className:"absolute top-3 left-3 px-3 py-1 bg-black/70 text-white rounded-full text-sm font-medium shadow-md pointer-events-none",children:"Before"}),(0,t.jsx)("div",{className:"absolute top-3 right-3 px-3 py-1 bg-indigo-600/90 text-white rounded-full text-sm font-medium shadow-md pointer-events-none",children:"After"})]})}):(0,t.jsx)(el,{src:e,alt:`Result ${a+1}`,className:"max-w-full max-h-full object-contain rounded-lg",isFreeUser:e6,isAuthenticated:e7})}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 translate-y-0 md:translate-y-full md:group-hover:translate-y-0 transition-transform duration-200 ease-out",children:[(0,t.jsx)("div",{className:"h-8 bg-gradient-to-t from-black/90 to-transparent"}),(0,t.jsxs)("div",{className:"bg-black/90 backdrop-blur-sm px-3 py-2.5 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!F&&(0,t.jsx)(q.InstantTooltip,{title:"Use for 3D Generation",description:"Select this edited image as your source for Image-to-3D generation. The modal will close and this image will be used to create your 3D model.",side:"top",align:"start",children:(0,t.jsxs)("button",{onClick:()=>{e8.current&&(e8.current.ended=!0),tc("accepted",{mode:eW}),"function"==typeof C&&C(e),i()},className:"flex items-center gap-1.5 px-3.5 py-2 bg-white text-black text-xs font-semibold rounded-md hover:bg-zinc-200 transition-colors shadow-md",children:[(0,t.jsx)(z.ArrowRight,{className:"w-4 h-4"}),"Use for 3D Generation"]})}),F&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-emerald-500/20 text-emerald-400 text-xs font-medium rounded-md border border-emerald-500/30",children:[(0,t.jsx)(o.Check,{className:"w-3.5 h-3.5"}),"Saved to Dashboard"]}),"delight"===eW&&(0,t.jsx)(q.InstantTooltip,{title:eZ?"Exit Compare Mode":"Compare to Source",description:eZ?"Exit the comparison view and return to the normal result view.":"Toggle a before/after comparison slider to see the lighting restoration difference. Drag the slider to reveal the original image underneath.",side:"top",align:"start",children:(0,t.jsxs)("button",{onClick:()=>eJ(!eZ),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${eZ?"bg-indigo-500 text-white hover:bg-indigo-400":"bg-zinc-700 text-zinc-200 hover:bg-zinc-600"}`,children:[(0,t.jsx)(w.SplitSquareHorizontal,{className:"w-3.5 h-3.5"}),eZ?"Exit Compare":"Compare to Input"]})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(q.InstantTooltip,{title:e6&&e7?"Continue Editing · Premium":"Continue Editing",description:e6&&e7?"Upgrade to chain edits, refine details, and combine multiple changes step by step.":"Chain another edit on top of this result. The generated image becomes your new source, allowing you to refine details, add more changes, or combine multiple edits step by step for precise control.",side:"top",align:"center",children:(0,t.jsx)("button",{onClick:()=>{e6&&e7?(0,D.notify)({title:"Premium Feature",subtitle:"Upgrade to chain edits on your results"},"warning"):(tc("edit_further",{mode:eW}),eP(e),ej([]),e4(null),e9.current=!1,eu(""),ew(null),eU("edit"),eJ(!1),(0,D.notify)({title:"Image loaded",subtitle:"Ap
33ply new edits to this variation"},"success"))},className:ei("p-2 rounded-md transition-colors relative",e6&&e7?"text-zinc-600 hover:text-zinc-400 cursor-not-allowed":"text-zinc-400 hover:text-white hover:bg-zinc-800"),children:(0,t.jsx)(c.Wand2,{className:"w-4 h-4"})})}),(0,t.jsx)(q.InstantTooltip,{title:e6&&e7?"Expand Preview · Premium":"Expand Preview",description:e6&&e7?"Upgrade to view full-resolution results and inspect fine details.":"Open full-resolution view in a dedicated viewer. Zoom in to inspect fine details, check for artifacts, and evaluate the quality before applying or downloading.",side:"top",align:"center",children:(0,t.jsx)("button",{onClick:()=>{e6&&e7?(0,D.notify)({title:"Premium Feature",subtitle:"Upgrade to view full-resolution results"},"warning"):(eI(e),ek(!0))},className:ei("p-2 rounded-md transition-colors relative",e6&&e7?"text-zinc-600 hover:text-zinc-400 cursor-not-allowed":"text-zinc-400 hover:text-white hover:bg-zinc-800"),children:(0,t.jsx)(m.Maximize2,{className:"w-4 h-4"})})}),(0,t.jsx)(q.InstantTooltip,{title:e6&&e7?"Download · Premium":"Download Image",description:e6&&e7?"Upgrade to download full-resolution results to your device.":"Save the full-resolution PNG directly to your device. The filename includes your prompt for easy organization. Use downloaded images in external tools or as references.",side:"top",align:"end",children:(0,t.jsx)("button",{onClick:()=>{e6&&e7?(0,D.notify)({title:"Premium Feature",subtitle:"Upgrade to download full-resolution images"},"warning"):tL(e)},className:ei("p-2 rounded-md transition-colors relative",e6&&e7?"text-zinc-600 hover:text-zinc-400 cursor-not-allowed":"text-zinc-400 hover:text-white hover:bg-zinc-800"),children:(0,t.jsx)(h.Download,{className:"w-4 h-4"})})})]})]})]}),(0,t.jsxs)("div",{className:"absolute top-2 left-2 text-[10px] font-bold text-white bg-black/60 backdrop-blur-sm px-2 py-0.5 rounded",children:["#",a+1]})]},a))})]})]})]})})}),(0,t.jsx)(O.default,{isOpen:ez,onClose:()=>{ek(!1),eI("")},imageUrl:eC||eE,title:eC?"Generated Image":"Source Image"}),(0,t.jsx)(M.AnimatePresence,{children:e2&&(0,t.jsx)(ed,{onClose:()=>e5(!1),onSelect:e=>{let t=Object.entries(eo).find(([,t])=>t.items.some(t=>t.id===e.id))?.[0]??null;e4({id:e.id,category:t,prompt:e.prompt}),e9.current=!1,eu(e.prompt),e5(!1),(0,D.notify)({title:"Preset applied",subtitle:e.title},"success")}})})]})}])}]); 34 35//# debugId=a70993df-c358-0b7a-783b-6d2d40fa5543 36//# sourceMappingURL=3rucc_3_e28xp.js.map
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.