1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[42724],{7862:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var s=a(27980),l=a(36618),r=a(74356);let i=()=>{let[e,t]=(0,s.useState)(!1);return{downloadImageWithMask:(0,s.useCallback)(async e=>{let{src:a,isMask:s=!1,gradientColor:i=[{position:.5,color:"rgba(0, 0, 0, 0.5)"}],direction:n=180,maskOpacity:o=1,imgName:c,maxBytes:d=460800}=e;t(!0);try{let e=window.devicePixelRatio||1,t=new Image;t.crossOrigin="anonymous",await new Promise((e,s)=>{t.onload=e,t.onerror=s,t.src=a});let u=document.createElement("canvas");u.width=t.naturalWidth*e,u.height=t.naturalHeight*e;let m=u.getContext("2d",{alpha:!0});if(!m)throw Error("Canvas context not supported");if(m.scale(e,e),m.drawImage(t,0,0,t.naturalWidth,t.naturalHeight),s&&i){m.save(),m.globalAlpha=o;let e=(n+90)%360*(Math.PI/180),a=t.naturalWidth/2+Math.cos(e)*t.naturalWidth/2,s=t.naturalHeight/2+Math.sin(e)*t.naturalHeight/2,l=t.naturalWidth/2-Math.cos(e)*t.naturalWidth/2,r=t.naturalHeight/2-Math.sin(e)*t.naturalHeight/2,c=m.createLinearGradient(a,s,l,r);try{i.forEach(e=>{let{position:t,color:a}=e;!Number.isNaN(t)&&Number.isFinite(t)&&t>=0&&t<=1&&c.addColorStop(t,a)})}catch(e){c.addColorStop(0,"rgba(0,0,0,0.5)"),c.addColorStop(1,"transparent")}m.fillStyle=c,m.fillRect(0,0,t.naturalWidth,t.naturalHeight),m.restore()}let h=await new Promise(e=>{u.toBlob(t=>e(t),"image/png",1)});if(h.size>d){let e=await (0,l.default)(new File([h],"".concat(c.split(".")[0],".png"),{type:"image/png"}),{maxSizeMB:d/1048576,useWebWorker:!0}),t=URL.createObjectURL(e);await (0,r.PE)(t,"".concat(c.split(".")[0],".png")),URL.revokeObjectURL(t)}else await (0,r.PE)(u.toDataURL("image/png",1),"".concat(c.split(".")[0],".png"))}catch(e){}finally{t(!1)}},[]),loading:e}}},20408:(e,t,a)=>{"use strict";a.d(t,{default:()=>p});var s=a(63616),l=a(27980),r=a(8057),i=a(85776),n=a(19256),o=a(71082),c=a(75338),d=a(95420),u=a(6294),m=a(10170),h=a(54867),g=a(51461),x=a(8784);function p(e){let{imgSrc:t,contentPosition:a="top",className:p,clickCb:f}=e,b=(0,i.c)("flux-ai.uiForm.display"),j=(0,u.rd)(),v=(0,u.a8)(),[w,C]=(0,l.useState)(!1),y=(0,h.A)(e=>e.updateImageObj),_=(0,x.A)(e=>e.userInfo),N=(0,g.A)(e=>e.setOpen),k=(0,m.A)(e=>e.setShareImageObj),A=[{title:b("imageToImage"),type:"image",href:"/flux-ai-image-generator",icon:(0,s.jsx)(c.A,{})},{title:b("imageToVideo"),type:"video",href:"/image-to-video",icon:(0,s.jsx)(d.A,{})}];return(0,s.jsxs)(o.AM,{open:w,onOpenChange:C,children:[(0,s.jsx)(o.Wv,{asChild:!0,children:(0,s.jsxs)("button",{type:"button",className:(0,n.cn)("mr-auto flex h-10 min-h-10 items-center gap-1 rounded-lg bg-white/5 px-2",p),children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-nowrap",children:b("imageTransform")}),(0,s.jsx)(r.A,{className:(0,n.cn)("size-5 shrink-0 rotate-0 text-white/40 transition-transform duration-150",w&&"-rotate-180")})]})}),(0,s.jsxs)(o.hl,{side:a,className:"z-50 flex w-fit flex-col gap-3 rounded-lg border-none bg-[#202122] p-3 text-center text-base leading-4 font-normal",children:[(0,s.jsx)(o.xT.i3,{className:"fill-card-black"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3",children:A.map(e=>(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",onClick:()=>(e=>{let a=v.includes(e);if(!_&&"/flux-ai-image-generator"===e)return void N(!0);a||y(null),"/flux-ai-image-generator"===e||"/image-to-video"===e?(k({id:Date.now().toString(),src:t,touchCount:0,type:"/image-to-video"===e?"image-to-video":"image-to-image"}),(0,l.startTransition)(()=>{if("/image-to-video"===e)return void j.push("".concat(e));a||j.push(e)})):j.push(e),C(!1),f&&f()})(e.href),onMouseEnter:()=>{var t;return t=e.href,void j.prefetch(t)},className:"flex items-center gap-2 text-sm opacity-70 hover:opacity-100",children:[(0,s.jsx)("span",{children:e.icon}),(0,s.jsx)("span",{className:"text-nowrap",children:e.title})]})},e.href))})]})]})}},23422:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var s=a(27980),l=a(74356),r=a(38607),i=a(7496),n=a(82358);function o(e){let{imgUrl:t,customImgName:a,watermarkUrl:o="/images/watermark.png",shouldAddWatermark:c=!1,alwaysAddWatermark:d=!1}=e,[u,m]=(t.split("/").pop()||"image.png").split("."),h=(null==m?void 0:m.toLowerCase())==="jpeg"?"jpg":m,{convertAndDownload:g}=(0,n.A)(),x=(0,i.A)(e=>
1e.isOn),p=(0,s.useRef)(u),[f,b]=(0,s.useState)(!1),[j,v]=(0,s.useState)(h),[w,C]=(0,s.useState)("1"),y=async()=>{if(t)try{b(!0);let e=t,s=a||p.current;if("1"!==w&&(e=await (0,r.oU)(e,Number(w)),s="".concat(s,"_").concat(w,"x_scaled")),d||c&&x){e=await (0,r.Qm)(e,o),await (0,r.bi)(e,"".concat(s,".").concat(m));return}if(j===h)return void await (0,l.PE)(e,"".concat(s,".").concat(m));await g({imageUrl:e,imageName:s,type:j})}catch(e){b(!1)}finally{b(!1)}};return(0,s.useEffect)(()=>{if(t){let[e,a]=(t.split("/").pop()||"image.png").split("."),s=(null==a?void 0:a.toLowerCase())==="jpeg"?"jpg":a;p.current=e,v(s),C("1"),b(!1)}},[t]),{onDownload:y,isLoading:f,imageType:j,setImageType:v,scale:w,setScale:C}}},24350:(e,t,a)=>{"use strict";a.d(t,{RL:()=>r.RL,aI:()=>s.a,sW:()=>l.s,t5:()=>r.t5});var s=a(67606),l=a(72190);a(24411);var r=a(28720)},24411:(e,t,a)=>{"use strict";a.d(t,{E:()=>m});var s=a(63616),l=a(27980),r=a(23911),i=a(85776),n=a(19256),o=a(82358),c=a(66996),d=a(16080),u=a(28720);function m(e){let{onUseImage:t,onDownload:a,imgName:m,imgExt:h,downloadLoading:g,btnDisabled:x}=e,p=(0,i.c)("ui.image-form.display"),f=(null==h?void 0:h.toLowerCase())==="jpeg"?"jpg":h,[b,j]=(0,l.useState)(f);return(0,s.jsxs)(u.RL,{className:"backdrop-blur-0 absolute bottom-2 left-1/2 -translate-x-1/2 border-none bg-transparent lg:px-2",children:[(0,s.jsx)(u.t5,{children:(0,s.jsx)("button",{type:"button",onClick:t,className:"rounded-lg bg-gradient-main px-3 py-2 text-xs text-nowrap text-white lg:text-sm",children:p("use-image")})}),(0,s.jsxs)(u.t5,{className:"h-9 rounded-lg border border-light-gray-2 bg-background-color px-2 py-1",children:[(0,s.jsx)(d.A,{value:b,onChange:e=>j(e),options:o.B.map(e=>({name:e,value:e})),className:"h-full border-none"}),(0,s.jsx)("button",{type:"button",onClick:()=>a(b,m,h),disabled:g||x,className:(0,n.cn)("flex-center aspect-square h-full rounded",x&&"cursor-not-allowed opacity-40"),children:g?(0,s.jsx)(c.A,{className:"size-5"}):(0,s.jsx)(r.A,{className:"size-5",strokeWidth:1})})]})]})}},28720:(e,t,a)=>{"use strict";a.d(t,{RL:()=>m,em:()=>g,ql:()=>h,t5:()=>u});var s=a(63616),l=a(27980),r=a(82256),i=a(61767),n=a(85776),o=a(19256),c=a(71082),d=a(74019);function u(e){let{children:t,className:a}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex items-center gap-2 px-1 py-1 lg:px-2",a),children:t})}function m(e){let{children:t,className:a}=e;return(0,s.jsx)("div",{className:(0,o.cn)("z-40 flex h-9 rounded-lg border border-light-gray-2 bg-black/50 px-1 py-1 text-sm backdrop-blur lg:px-3",a),children:t})}function h(e){let{content:t,btnDisabled:a}=e,i=(0,n.c)("ui.image-form.display"),[u,m]=(0,l.useState)(!1);return(0,s.jsxs)("div",{className:"flex items-center justify-between lg:w-auto lg:justify-center",children:[(0,s.jsx)("div",{className:"flex-center size-7 rounded text-sm hover:bg-white/20",children:(0,s.jsx)(d.default,{content:t})}),(0,s.jsxs)(c.AM,{open:u,onOpenChange:m,children:[(0,s.jsx)(c.Wv,{asChild:!0,children:(0,s.jsxs)("button",{type:"button",onClick:()=>m(!u),className:(0,o.cn)("flex flex-1 items-center gap-1 rounded p-1 px-2 hover:bg-white/20"),disabled:a,children:[i("prompt"),(0,s.jsx)(r.A,{className:"size-3.5"})]})}),(0,s.jsx)(c.hl,{side:"bottom",className:"max-h-60 overflow-auto border-light-gray-2 bg-[var(--c-bg)] p-3 text-sm shadow-md",sideOffset:12,children:t})]})]})}function g(e){let{children:t,side:a="bottom",className:r}=e,[n,d]=(0,l.useState)(!1);return(0,s.jsxs)(c.AM,{open:n,onOpenChange:d,children:[(0,s.jsx)(c.Wv,{asChild:!0,children:(0,s.jsx)("button",{type:"button",onClick:()=>d(!n),className:(0,o.cn)("flex size-5 items-center justify-center rounded hover:bg-white/20",r),children:(0,s.jsx)(i.A,{className:"size-4",strokeWidth:3})})}),(0,s.jsx)(c.hl,{side:a,className:"h-fit max-h-[240px] w-fit max-w-60 overflow-auto border-light-gray-2 bg-[var(--c-bg)] p-3 text-sm shadow-md",sideOffset:8,children:t})]})}},30445:e=>{e.exports={"wheel-and-hamster":"loading_wheel-and-hamster__Jdg9Z",wheel:"loading_wheel__irsBA",hamster:"loading_hamster__M8Dxy",spoke:"loading_spoke__A_DgS",hamster__head:"loading_hamster__head__cz_EA",hamsterHead:"loading_hamsterHead__djcQA",hamster__ear:"loading_hamster__ear__eLth8",hamsterEar:"loading_hamsterEar__NaGPG",hamster__eye:"loading_hamster__eye__5lOE4",hamsterEye:"loading_hamsterEye__YBg7G",hamster__nose:"loading_hamster__nose__ZxYDi",hamster__body:"loading_hamster__body__F_zIq",hamsterBody:"loading_hamsterBody__CE_2z",hamster__limb__fr:"loading_hamster__limb__fr__aCzAY",hamster__limb__fl:"loading_hamster__limb__fl__LFW__",hamsterFRLimb:"loading_hamsterFRLimb__fg_Tx",hamsterFLLimb:"loading_hamsterFLLimb__jdtRO",hamster__limb__br:"loading_hamster__limb__br__e_EH8",hamster__limb__bl:"loading_hamster__limb__bl__bKQCe",hamsterBRLimb:"loading_hamsterBRLimb__23rv8",hamsterBLLimb:"loading_hamsterBLLimb__gS_n8",hamster__tail:"loading_hamster__tail__zeoCu",hamsterTail:"loading_hamsterTail__pu4zF"}},42724:(e,t,a)=>{"use strict";a.d(t,{es:()=>T});
1var s=a(63616),l=a(54867),r=a(57933),i=a(77138),n=a(98611),o=a(24350);function c(e){let{imageObj:t}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.sW,{imageObj:t,imgSrc:t.src,onNav:()=>{},btnDisabled:!1}),(0,s.jsx)(n.default,{firstImage:t.src,secondImage:t.originalImg||"",initialSliderPercentage:99,slideMode:"drag",className:"max-h-full max-w-full"},t.id),(0,s.jsx)(o.aI,{imageObj:t,imgSrc:t.src,imgName:t.name})]})}var d=a(19256);function u(e){let{children:t,formType:a}=e;return(0,s.jsx)("div",{className:(0,d.cn)("group/img-display relative flex h-full min-h-[366px] w-full flex-col items-center justify-between rounded-2xl border border-light-gray-2 [background-image:var(--c-display-bg)] py-5 lg:h-[611px]","local-history"===a&&"lg:h-[387px]","image-dialog"===a&&"lg:h-[436px]"),children:t})}var m=a(50808),h=a(85776);function g(){let e=(0,h.c)("ui.image-form.display");return(0,s.jsxs)("div",{className:"flex aspect-square size-full flex-col items-center justify-center gap-3 text-white opacity-40",children:[(0,s.jsx)(m.A,{className:"size-10"}),e("noImage")]})}var x=a(30445),p=a.n(x);function f(){return(0,s.jsxs)("div",{"aria-label":"Orange and tan hamster running in a metal wheel",role:"img",className:p()["wheel-and-hamster"],children:[(0,s.jsx)("div",{className:p().wheel}),(0,s.jsx)("div",{className:p().hamster,children:(0,s.jsxs)("div",{className:p().hamster__body,children:[(0,s.jsxs)("div",{className:p().hamster__head,children:[(0,s.jsx)("div",{className:p().hamster__ear}),(0,s.jsx)("div",{className:p().hamster__eye}),(0,s.jsx)("div",{className:p().hamster__nose})]}),(0,s.jsx)("div",{className:"".concat(p().hamster__limb," ").concat(p().hamster__limb__fr)}),(0,s.jsx)("div",{className:"".concat(p().hamster__limb," ").concat(p().hamster__limb__fl)}),(0,s.jsx)("div",{className:"".concat(p().hamster__limb," ").concat(p().hamster__limb__br)}),(0,s.jsx)("div",{className:"".concat(p().hamster__limb," ").concat(p().hamster__limb__bl)}),(0,s.jsx)("div",{className:p().hamster__tail})]})}),(0,s.jsx)("div",{className:p().spoke})]})}function b(){return(0,s.jsx)("div",{className:"m-auto",children:(0,s.jsx)(f,{})})}var j=a(27980),v=a(35122),w=a(23911),C=a(7862),y=a(62196),_=a(94756),N=a(94853),k=a(66996);function A(e){let{imgSrc:t,imgName:a}=e,l=(0,h.c)("new-year.display"),[r,i]=(0,j.useState)(!1),[n,c]=(0,j.useState)(!1),d=(0,j.useRef)(null),[u,m]=(0,j.useState)({width:"100%",height:"100%"}),g=(0,j.useRef)(!1),{downloadImageWithMask:x,loading:p}=(0,C.A)();return(0,s.jsxs)("div",{className:"relative flex size-full flex-col items-center",children:[(0,s.jsxs)(o.RL,{className:"w-fit",children:[(0,s.jsxs)(o.t5,{children:[(0,s.jsx)("span",{className:"text-xs text-nowrap lg:text-sm",children:l("preview")}),(0,s.jsx)(N.A,{checked:r,onCheckedChange:i})]}),(0,s.jsxs)(o.t5,{children:[(0,s.jsx)(y.S,{checked:n,onCheckedChange:e=>{c(e),g.current=!!e},className:"rounded-full"}),(0,s.jsx)("span",{className:"text-xs text-nowrap lg:text-sm",children:l("mask")}),(0,s.jsx)(_.TooltipProvider,{children:(0,s.jsxs)(_.m_,{delayDuration:150,children:[(0,s.jsx)(_.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",children:(0,s.jsx)(v.A,{className:"size-4 text-white/40 hover:text-white"})})}),(0,s.jsxs)(_.ZI,{side:"bottom",className:"isolate w-[361px] space-y-3 rounded border-main-gray bg-card-black p-3 text-white/70",children:[(0,s.jsx)("p",{children:l("mask-tips")}),(0,s.jsx)("img",{src:"/images/new-year/mask-tips.webp",alt:"mask-tips",className:"h-[287px] w-[178px] rounded-lg"})]})]})})]}),(0,s.jsx)(o.t5,{children:(0,s.jsx)("button",{type:"button",onClick:()=>{x({src:t,imgName:a,isMask:g.current,maskOpacity:.9,gradientColor:[{position:.14,color:"rgba(243,85,67,1)"},{position:1,color:"rgba(243,85,67,0)"}]})},disabled:p,children:p?(0,s.jsx)(k.A,{className:"size-4"}):(0,s.jsx)(w.A,{className:"size-4"})})})]}),(0,s.jsx)("div",{className:"flex flex-1 items-center justify-center p-3",children:r?(0,s.jsxs)("div",{className:"relative h-[574px] w-fit -translate-y-7 scale-[90%] overflow-hidden rounded-3xl px-5 pt-[89px]",children:[(0,s.jsx)("img",{src:"https://c.topshort.org/fluxai/newyear_redpacket/Preview/phone.webp",alt:"phone",className:"absolute inset-0 size-full"}),(0,s.jsx)("img",{src:"https://c.topshort.org/fluxai/newyear_redpacket/Preview/redpacket.png",alt:"preview",className:"absolute top-0 left-0 z-20 h-[574px] w-[265px]"}),(0,s.jsxs)("div",{className:"relative h-[300px] w-[226px] overflow-hidden rounded-6",children:[(0,s.jsx)("img",{src:t,alt:l("red-packet-title"),className:"size-full"}),n&&(0,s.jsx)("div",{className:"absolute inset-0 z-10 size-full bg-gradient-red-packet opacity-90"}),r&&(0,s.jsxs)("div",{className:"absolute inset-0 z-30 flex flex-col items-center gap-[11px] pt-[58px] text-center text-sm text-[17px] leading-[21px] font-medium text-[#FFE2B1]",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("img",{src:"/images/logo.png",alt:"logo",className:"size-[18px] shrink-0 rounded bg-black/70"}),(0,s.jsx)("span",{children:l("red-packet-title")})]}),(0,s.jsx)("div",{children:l("red-packet-description")})]})]})]}):(0,s.jsxs)("div",{style:u,className:"relative flex size-full items-center justify-center overflow-hidden rounded-lg",children:[(0,s.jsx)("img",{ref:d,onLoad:()=>{d.current&&m({width:d.current.width,height:d.current.height})},src:t,alt:l("red-packet-title"),className:"max-h-[500px]"}),n&&(0,s.jsx)("div",{className:"absolute inset-0 z-10 size-full bg-gradient-red-packet opacity-90"})]})})]})}var z=a(67606),L=a(24411),I=a(72190),M=a(46464),S=a(69327);function R(){let e=(0,l.A)(e=>e.updateImageObj);return(0,s.jsx)("button",{type:"button",onClick:()=>e(null),className:"absolute top-3 right-3 z-10 hidden size-8 items-center justify-center rounded-lg bg-black text-white/70 backdrop-blur lg:flex",children:(0,s.jsx)(S.A,{className:"size-4"})})}function O(e){let{imageObj:t,formType:a,onConfirm:l,onConfirmUrl:r}=e,{onDownload:i,onNav:n,handleUseImage:o,downloadLoading:c}=(0,M.u)(t,l,r),u=t.src,{imgName:m,imgExt:h}
1=function(e){let[t,a]=(e.split("/").pop()||"image.png").split(".");return{imgName:t,imgExt:a||"png"}}(u),g=!t;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("img",{src:u,alt:"img",loading:"eager",decoding:"async",className:(0,d.cn)("absolute-center absolute max-h-[351px] max-w-full rounded lg:max-h-[575px]","local-history"===a&&"max-h-[310px] lg:max-h-[310px]","image-dialog"===a&&"lg:max-h-[390px]")},u),(0,s.jsx)(R,{}),"local-history"!==a&&"image-dialog"!==a&&(0,s.jsx)(I.s,{imageObj:t,imgSrc:u,onNav:n,btnDisabled:g}),"local-history"!==a&&"image-dialog"!==a&&(0,s.jsx)(z.a,{imageObj:t,imgSrc:u,imgName:m}),("local-history"===a||"image-dialog"===a)&&(0,s.jsx)(L.E,{onUseImage:o,onDownload:i,imgName:m,imgExt:h,downloadLoading:c,btnDisabled:g})]})}function T(e){let{onConfirm:t,onConfirmUrl:a}=e,n=(0,r.gZ)(),o=(0,l.A)(e=>e.imageObj),d=o?"loading"===o?"loading":"image-dialog"===n?"image-dialog":"inpainting"===o.type?"inpainting":"compare-two"===o.type?"compare":"new-year-cover"===o.type||"new-year-cover"===n?"new-year-cover":"single":"empty",m=o&&"object"==typeof o?o:null;return(0,s.jsx)("div",{id:"ImageDisplay",className:"flex w-full flex-col gap-px rounded-2xl",children:(0,s.jsxs)(u,{formType:n,children:["loading"===d&&(0,s.jsx)(b,{}),"empty"===d&&(0,s.jsx)(g,{}),("single"===d||"image-dialog"===d)&&m&&(0,s.jsx)(O,{imageObj:m,formType:n,onConfirm:t,onConfirmUrl:a}),"compare"===d&&m&&(0,s.jsx)(c,{imageObj:m,formType:n}),"new-year-cover"===d&&m&&(0,s.jsx)(A,{imgSrc:m.src,imgName:m.name}),"inpainting"===d&&m&&(0,s.jsx)(i.T,{})]})})}},46464:(e,t,a)=>{"use strict";a.d(t,{u:()=>n,y:()=>u});var s=a(27980),l=a(74356),r=a(82358),i=a(6294);function n(e,t,a){let n=(0,i.rd)(),{convertAndDownload:o}=(0,r.A)(),[c,d]=(0,s.useState)(!1);return{onNav:()=>{e&&"object"==typeof e&&n.push("/image/".concat(e.id))},onDownload:async(t,a,s)=>{if(e&&"object"==typeof e&&e.src)try{d(!0);let r=(null==s?void 0:s.toLowerCase())==="jpeg"?"jpg":s;if(t===r)return void(0,l.PE)(e.src,"".concat(a,".").concat(s));await o({imageUrl:e.src,imageName:a,type:t})}catch(e){}finally{d(!1)}},handleUseImage:async()=>{if(e&&"object"==typeof e&&e.src&&e.name){let s=await (0,l.TL)(e.src);if(a)return void a(e.src);null==t||t(s)}},downloadLoading:c}}var o=a(881),c=a(38607),d=a(54867);function u(){let e=(0,d.A)(e=>e.setLayerImageObj),t=(0,d.A)(e=>e.updateImageObj),a=(0,d.A)(e=>e.layerMaskDataUrl),l=(0,d.A)(e=>e.setLayerMaskDataUrl);return{setImageInpainting:a=>{let l=(0,o.Ak)();e({id:l,originalImg:a}),(0,s.startTransition)(()=>{t({id:l,originalImg:a,src:a,name:a.split("/").pop(),resolution:"1:1",prompt:"",type:"inpainting",credit:0})})},getImageInpaintingFile:async()=>a?await (0,c.bX)(a):null,clearImageInpainting:()=>{e(null),l(null)},hasMaskLayer:()=>!!a}}},54867:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var s=a(88172);let l={imageFormSrc:null,layerImageObj:null,layerMaskDataUrl:null,imageObj:null,uploadImageObj:null},r=(0,s.vt)(e=>({...l,updateImageObj:t=>e({imageObj:t}),setImageFormSrc:t=>e({imageFormSrc:t}),setUploadImageObj:t=>e({uploadImageObj:t}),setLayerImageObj:t=>e({layerImageObj:t}),setLayerMaskDataUrl:t=>e({layerMaskDataUrl:t}),resetDefault:()=>e({...l})}))},62196:(e,t,a)=>{"use strict";a.d(t,{S:()=>c});var s=a(63616),l=a(27980),r=a(55721),i=a(50119),n=a(97511),o=a(19256);let c=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsxs)(r.bL,{ref:t,className:(0,o.cn)("group peer relative h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=indeterminate]:border-white data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...l,children:[(0,s.jsx)(i.A,{className:"absolute left-0 top-0 hidden size-5 -translate-x-[15%] -translate-y-[15%] -rotate-45 text-white group-disabled:block"}),(0,s.jsxs)(r.C1,{className:(0,o.cn)("relative flex items-center justify-center text-current"),children:[(0,s.jsx)(n.A,{className:"size-0 group-data-[state=checked]:size-4"}),(0,s.jsx)(i.A,{className:"absolute top-1/2 size-0 -translate-y-1/2 text-white group-data-[state=indeterminate]:size-4"})]})]})});c.displayName=r.bL.displayName},65300:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var s=a(63616),l=a(27980),r=a(23911),i=a(71844),n=a(19256),o=a(23422),c=a(82358),d=a(68552),u=a(51461),m=a(8784),h=a(66996),g=a(45727),x=a(16080);function p(e){let{imgSrc:t,imgName:a,className:p,showScale:f=!0,styleVersion:b}=e,j=(0,m.A)(e=>e.userInfo),v=(0,u.A)(e=>e.setOpen),w=(0,d.A)(e=>e.setData),C=(0,d.A)(e=>e.setOpen),y=!!(null==j?void 0:j.isPay),{onDownload:_,imageType:N,setImageType:k,scale:A,setScale:z,isLoading:L}=(0,o.A)({imgUrl:t,shouldAddWatermark:!0,watermarkUrl:"/images/watermark.png",customImgName:a});return(0,s.jsxs)("div",{className:(0,n.cn)("flex h-[38px] items-center gap-1 rounded-lg bg-white/5 p-1 pl-2","bg-transparent"===b&&"bg-transparent",p),children:[(0,s.jsx)(g.A,{className:"mr-1"}),f&&(0,s.jsx)(x.A,{value:A,onChange:e=>z(e),options:i.K2,className:(0,n.cn)("h-[29px] rounded-lg","bg-transparent"===b&&"bg-transparent"),styleType:"flux-kontext"}),(0,s.jsx)(x.A,{value:N,onChange:e=>k(e),options:c.B.map(e=>({name:e,value:e})),className:(0,n.cn)("h-[29px] rounded-lg","bg-transparent"===b&&"bg-transparent"),styleType:"flux-kontext"}),(0,s.jsx)("button",{type:"button",disabled:L,className:"flex size-[29px] shrink-0 items-center justify-center disabled:cursor-not-allowed",onClick:()=>j?y?void _():void(w({type:"image",src:t,name:a}),(0,l.startTransition)(()=>{C(!0)})):void v(!0),children:L?(0,s.jsx)(h.A,{className:"size-4"}):(0,s.jsx)(r.A,{className:"size-4"})})]})}},67606:(e,t,a)=>{"use strict";a.d(t,{a:()=>d});var s=a(63616),l=a(71844),r=a(3356),i=a(14433),n=a(65300),o=a(1455),c=a(28720);
1function d(e){let{imageObj:t,imgSrc:a,imgName:d}=e;return(0,s.jsxs)(c.RL,{className:'absolute bottom-2 left-1/2 hidden -translate-x-1/2 group-hover/img-display:flex [&:has([data-state="open"])]:flex',children:[(0,s.jsx)(c.t5,{className:"hidden lg:flex",children:(0,s.jsxs)("div",{className:"flex w-fit items-center gap-2 text-nowrap",children:[(0,s.jsx)(o.A,{}),(0,s.jsx)("div",{children:t.credit}),(0,s.jsx)("div",{className:"h-2.5 w-px bg-white/40"}),(0,s.jsx)("div",{children:(0,i.Yq)(t.createTime,"YYYY/MM/DD")}),(0,s.jsx)("div",{className:"h-2.5 w-px bg-white/40"}),(0,s.jsx)("div",{children:(0,r.zi)(t.resolution.replace(":","x"),l.kk)})]})}),(0,s.jsx)(c.t5,{children:(0,s.jsx)(n.A,{imgSrc:a,imgName:d,className:"bg-transparent px-0"})}),(0,s.jsx)(c.t5,{className:"pl-0",children:(0,s.jsx)(c.em,{side:"top",className:"lg:hidden",children:(0,s.jsxs)("div",{className:"flex w-fit items-center gap-2 text-nowrap",children:[(0,s.jsx)("div",{children:(0,i.Yq)(t.createTime,"YYYY/MM/DD")}),(0,s.jsx)("div",{className:"h-2.5 w-px bg-white/40"}),(0,s.jsx)("div",{children:(0,r.zi)(t.resolution.replace(":","x"),l.kk)})]})})})]})}},72190:(e,t,a)=>{"use strict";a.d(t,{s:()=>m});var s=a(63616),l=a(85776),r=a(64826),i=a(51144),n=a(20408),o=a(73444),c=a(54867),d=a(57933),u=a(28720);function m(e){let{imageObj:t,imgSrc:a,onNav:m,btnDisabled:h}=e,g=(0,d.gZ)(),x=(0,l.c)("ui.image-form.display"),p=(0,c.A)(e=>e.updateImageObj);return"new-year-cover"===g?null:(0,s.jsxs)(u.RL,{className:'absolute top-2 left-1/2 hidden -translate-x-1/2 group-hover/img-display:flex [&:has([data-state="open"])]:flex',children:[(0,s.jsx)(u.t5,{className:"hidden rounded hover:bg-white/20 lg:flex",children:(0,s.jsx)(n.default,{imgSrc:a,contentPosition:"bottom",className:"bg-transparent px-0"})}),(0,s.jsx)(u.t5,{children:(0,s.jsx)(u.ql,{content:(null==t?void 0:t.prompt)||"",btnDisabled:h})}),(0,s.jsx)(u.t5,{className:"rounded hover:bg-white/20",children:(0,s.jsx)(i.A,{id:(null==t?void 0:t.id)||"",media:"image",defaultIsPublic:(null==t?void 0:t.isPublic)===1},null==t?void 0:t.id)}),(0,s.jsx)(u.t5,{className:"rounded hover:bg-white/20",children:(0,s.jsx)(r.Jf,{mediaType:"image",mediaId:(null==t?void 0:t.id)||"",mediaCollections:(null==t?void 0:t.mediaCollections)||[],selectCallback:e=>{if(!t||"object"!=typeof t)return;let a=t.mediaCollections||[];if(null==a?void 0:a.some(t=>t.collectionId===e.collectionId)){p({...t,mediaCollections:null==a?void 0:a.filter(t=>t.collectionId!==e.collectionId)}),(0,o.Tk)();return}p({...t,mediaCollections:[...t.mediaCollections||[],e]}),(0,o.Tk)()},editCallback:e=>{t&&"object"==typeof t&&(p({...t,mediaCollections:(t.mediaCollections||[]).map(t=>t.collectionId===e.collectionId?{...t,collectionName:e.collectionName}:t)}),(0,o.Tk)())},deleteCallback:e=>{t&&"object"==typeof t&&(p({...t,mediaCollections:(t.mediaCollections||[]).filter(t=>t.collectionId!==e.collectionId)}),(0,o.Tk)())}})}),(0,s.jsx)(u.t5,{className:"rounded hover:bg-white/20",children:(0,s.jsx)("button",{type:"button",onClick:m,disabled:h,className:"text-nowrap",children:x("imageDetail")})}),(0,s.jsx)(u.t5,{className:"pl-0",children:(0,s.jsx)(u.em,{side:"bottom",className:"lg:hidden",children:(0,s.jsx)(n.default,{imgSrc:a,contentPosition:"bottom",className:"px-0"})})})]})}},75338:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var s=a(63616);function l(e){return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:19,viewBox:"0 0 18 19",fill:"none",...e,children:(0,s.jsx)("path",{d:"M3.04688 12.5938C3.86739 12.5938 4.6543 12.9197 5.23449 13.4999C5.81468 14.0801 6.14063 14.867 6.14063 15.6875H4.73438C4.28682 15.6875 3.8576 15.5097 3.54113 15.1932C3.22466 14.8768 3.04688 14.4476 3.04688 14V12.5938ZM8.10938 8.9375C8.55693 8.9375 8.98615 9.11529 9.30262 9.43176C9.61909 9.74822 9.79688 10.1774 9.79688 10.625V14C9.79688 14.4476 9.61909 14.8768 9.30262 15.1932C8.98615 15.5097 8.55693 15.6875 8.10938 15.6875H6.98438C6.98438 14.6432 6.56953 13.6417 5.83111 12.9033C5.09268 12.1648 4.09116 11.75 3.04688 11.75V10.625C3.04688 10.1774 3.22466 9.74822 3.54113 9.43176C3.8576 9.11529 4.28682 8.9375 4.73438 8.9375H8.10938ZM14.5444 12.0577C14.6069 12.0567 14.669 12.0681 14.7271 12.0912C14.7852 12.1142 14.8382 12.1485 14.883 12.1921C14.9279 12.2357 14.9636 12.2877 14.9884 12.3451C15.0131 12.4026 15.0262 12.4643 15.027 12.5268V12.7153C15.0151 13.5138 14.6868 14.275 14.1141 14.8317C13.5414 15.3884 12.7712 15.6949 11.9726 15.6841H11.3291C11.2628 15.6921 11.1955 15.6859 11.1318 15.666C11.068 15.646 11.0092 15.6128 10.9592 15.5685C10.9092 15.5241 10.8692 15.4697 10.8418 15.4088C10.8144 15.3479 10.8003 15.2818 10.8003 15.215C10.8003 15.1482 10.8144 15.0821 10.8418 15.0212C10.8692 14.9603 10.9092 14.9059 10.9592 14.8615C11.0092 14.8172 11.068 14.784 11.1318 14.764C11.1955 14.7441 11.2628 14.7379 11.3291 14.7459H11.9726C12.5193 14.7541 13.0469 14.5449 13.4393 14.1642C13.8317 13.7835 14.0568 13.2625 14.0651 12.7158V12.5268C14.0669 12.4012 14.1183 12.2814 14.2081 12.1935C14.2979 12.1056 14.4187 12.0568 14.5444 12.0577ZM13.4964 3.45312C13.9067 3.45312 14.3001 3.6161 14.5902 3.90619C14.8803 4.19629 15.0433 4.58974 15.0433 5V9.5C15.0433 9.91026 14.8803 10.3037 14.5902 10.5938C14.3001 10.8839 13.9067 11.0469 13.4964 11.0469H10.6839V9.78125C10.684 9.27778 10.4911 8.79342 10.145 8.42776C9.79894 8.0621 9.3259 7.84293 8.82319 7.81531L8.71519 7.8125H7.44956V5C7.44956 4.58974 7.61254 4.19629 7.90263 3.90619C8.19273 3.6161 8.58618 3.45312 8.99644 3.45312H13.4964ZM12.0986 5C12.0634 5 12.0291 5.01093 12.0004 5.03128C11.9717 5.05164 11.95 5.08041 11.9383 5.11362L11.7983 5.54394C11.7547 5.67479 11.6813 5.79367 11.5837 5.89113C11.4862 5.98859 11.3672 6.06193 11.2363 6.10531L10.8054 6.24481L10.797 6.24706C10.7638 6.25871 10.735 6.28039 10.7146 6.30911C10.6943 6.33783 10.6833 6.37217 10.6833 6.40737C10.6833 6.44258 10.6943 6.47692 10.7146 6.50
1564C10.735 6.53436 10.7638 6.55604 10.797 6.56769L11.2273 6.70719C11.3359 6.74319 11.436 6.8 11.5226 6.87369L11.5851 6.93162C11.6666 7.02219 11.751 7.15269 11.7898 7.26913L11.9299 7.69888C11.9415 7.7321 11.9632 7.76089 11.9919 7.78125C12.0206 7.80162 12.055 7.81256 12.0902 7.81256C12.1254 7.81256 12.1597 7.80162 12.1885 7.78125C12.2172 7.76089 12.2389 7.7321 12.2505 7.69888L12.3911 7.26856C12.4341 7.13707 12.5074 7.01752 12.6051 6.91961C12.7028 6.82169 12.8222 6.74815 12.9536 6.70494L13.3834 6.56544C13.4166 6.55379 13.4454 6.53211 13.4658 6.50339C13.4861 6.47467 13.4971 6.44033 13.4971 6.40513C13.4971 6.36992 13.4861 6.33558 13.4658 6.30686C13.4454 6.27814 13.4166 6.25646 13.3834 6.24481L12.9531 6.10531C12.6943 6.01588 12.4918 5.81281 12.4029 5.55406L12.399 5.54394L12.2589 5.11362C12.2473 5.08041 12.2256 5.05164 12.1969 5.03128C12.1682 5.01093 12.1338 5 12.0986 5ZM6.31444 3.53075C6.37847 3.5263 6.44274 3.53507 6.50324 3.55652C6.56374 3.57797 6.61919 3.61164 6.66612 3.65543C6.71306 3.69921 6.75048 3.75219 6.77607 3.81106C6.80166 3.86993 6.81487 3.93343 6.81487 3.99762C6.81487 4.06182 6.80166 4.12532 6.77607 4.18419C6.75048 4.24306 6.71306 4.29604 6.66612 4.33982C6.61919 4.38361 6.56374 4.41728 6.50324 4.43873C6.44274 4.46018 6.37847 4.46895 6.31444 4.4645H5.54269C4.99684 4.45517 4.46964 4.66302 4.07702 5.04235C3.68441 5.42167 3.45853 5.94141 3.44906 6.48725V7.11331C3.44906 7.24124 3.39824 7.36392 3.30779 7.45438C3.21733 7.54484 3.09464 7.59566 2.96672 7.59566C2.83879 7.59566 2.71611 7.54484 2.62565 7.45438C2.53519 7.36392 2.48438 7.24124 2.48438 7.11331V6.48894C2.49067 6.09383 2.57481 5.70384 2.73198 5.34129C2.88914 4.97873 3.11624 4.65072 3.4003 4.37602C3.68435 4.10131 4.01978 3.88531 4.38739 3.74037C4.75501 3.59543 5.14759 3.52439 5.54269 3.53131H6.31444V3.53075Z",fill:"currentColor"})})}},77138:(e,t,a)=>{"use strict";a.d(t,{T:()=>i});var s=a(63616),l=a(97322),r=a(54867);function i(){let e=(0,r.A)(e=>e.layerImageObj),t=(0,r.A)(e=>e.setLayerMaskDataUrl);if(!e)return null;let a=async e=>{t(e)};return(0,s.jsx)("div",{className:"flex size-full grow flex-col",children:(0,s.jsx)(l.A,{image:e.originalImg,onMaskGenerated:a,className:"size-full"})})}},94853:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var s=a(63616),l=a(27980),r=a(19256),i=a(89379);let n=(0,l.forwardRef)((e,t)=>{let{className:a,thumbClassName:l,...n}=e;return(0,s.jsx)(i.d,{className:(0,r.cn)("h-[16px] w-[28px] border border-white/40 !bg-transparent data-[state=checked]:border-white",a),thumbClassName:(0,r.cn)("h-3 w-3 bg-white/40 data-[state=checked]:translate-x-[12px] data-[state=checked]:bg-white data-[state=unchecked]:translate-x-[1px]",l),ref:t,...n})})},95420:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var s=a(63616);function l(e){return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:19,viewBox:"0 0 18 19",fill:"none",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.75 3.5H7.5V4.25H9V14.75H7.5V15.5H9.75V14H14.25C15.0784 14 15.75 13.3284 15.75 12.5V6.5C15.75 5.67157 15.0784 5 14.25 5H9.75V3.5ZM3 6.5C3 5.67157 3.67157 5 4.5 5H8.25V8.74959C7.87346 8.62569 6.97612 8.67818 6.3775 9.87542L6.30881 9.90112C5.29892 10.2784 3.62277 10.9046 4.5025 13.2506H8.25V14H4.5C3.67157 14 3 13.3284 3 12.5V6.5ZM5.25234 7.25059C5.25234 7.6648 4.91656 8.00059 4.50234 8.00059C4.08813 8.00059 3.75234 7.6648 3.75234 7.25059C3.75234 6.83637 4.08813 6.50059 4.50234 6.50059C4.91656 6.50059 5.25234 6.83637 5.25234 7.25059ZM14.0819 9.81499C14.3092 9.67525 14.3092 9.32592 14.0819 9.18618L11.0137 7.29977C10.7864 7.16003 10.5023 7.3347 10.5023 7.61417V11.387C10.5023 11.6665 10.7864 11.8411 11.0137 11.7014L14.0819 9.81499Z",fill:"currentColor"})})}},97322:(e,t,a)=>{"use strict";a.d(t,{A:()=>x});var s=a(63616),l=a(27980),r=a(63484),i=a(79026),n=a(51503),o=a(24943),c=a(19256),d=a(39665),u=a(50119),m=a(73503),h=a(46196);function g(e){let{min:t=0,max:a=10,step:r=1,defaultValue:i,onChange:n,className:o}=e,[d,g]=(0,l.useState)(i||0),x=e=>{g(t=>t+e)};return(0,s.jsxs)("div",{className:(0,c.cn)("flex h-8 w-[264px] items-center gap-1 rounded-full border border-white/10 bg-white/5 px-2",o),children:[(0,s.jsx)("button",{type:"button",onClick:()=>x(-r),children:(0,s.jsx)(u.A,{className:"hover:text-main size-4 text-[#C2C2C2]"})}),(0,s.jsx)(h.A,{value:[d],onValueChange:e=>{g(e[0]),n&&n(e[0])},max:a,step:r,min:t,className:"h-3.5 w-full",rangeClassName:"bg-gradient-main",trackClassName:"bg-[var(--c-light-gray)] border border-light-gray-2 h-full",thumbClassName:(0,
1c.cn)("size-3.5 bg-[#4C4C4C]",d<=(a-t)/2&&"-translate-x-1")}),(0,s.jsx)("button",{type:"button",onClick:()=>x(r),children:(0,s.jsx)(m.A,{className:"hover:text-main size-4 text-[#C2C2C2]"})}),(0,s.jsx)("input",{type:"number",min:t,max:a,step:r,value:d,onChange:e=>{Number(e.target.value)>a||!(Number(e.target.value)<t)&&(g(Number(e.target.value)),n&&n(Number(e.target.value)))},className:"hide-number-input h-7 w-12 rounded-sm bg-[#121212] text-center text-xs text-white/70"})]})}function x(e){let{image:t,className:a,onMaskGenerated:u}=e,m=(0,l.useRef)(null),h=(0,l.useRef)(null),[x,p]=(0,l.useState)(!1),[f,b]=(0,l.useState)("brush"),[j,v]=(0,l.useState)(60),w=(0,l.useRef)(null),C=(0,l.useRef)([]),y=(0,l.useRef)(-1),_=(0,l.useRef)(null),{mousePosition:N,isVisible:k}=function(e){let[t,a]=(0,l.useState)({x:0,y:0}),[s,r]=(0,l.useState)(!1),i=(0,d.dh)(t=>{if(e.current&&e.current.contains(t.target)){let s=e.current.getBoundingClientRect();a({x:t.clientX-s.left,y:t.clientY-s.top}),r(!0)}},16),n=(0,d.YQ)(()=>{r(!1)},16);return(0,l.useEffect)(()=>{let t=e.current;return t&&(t.addEventListener("mousemove",i),t.addEventListener("mouseleave",n)),()=>{t&&(t.removeEventListener("mousemove",i),t.removeEventListener("mouseleave",n))}},[e,i,n]),{mousePosition:t,isVisible:s}}(_),A=()=>{let e=h.current;if(!e||!u)return;let t=e.getContext("2d");if(!t)return;let a=t.getImageData(0,0,e.width,e.height),{data:s}=a;for(let e=0;e<s.length;e+=4){let t=s[e+3];s[e]=255*!!t,s[e+1]=255*!!t,s[e+2]=255*!!t,s[e+3]=255}let l=document.createElement("canvas");l.width=e.width,l.height=e.height;let r=l.getContext("2d");null==r||r.putImageData(a,0,0),u(l.toDataURL())},z=()=>{var e;let t=null==(e=h.current)?void 0:e.getContext("2d");if(!t)return;let a=t.getImageData(0,0,t.canvas.width,t.canvas.height);C.current=C.current.slice(0,y.current+1),C.current.push(a),y.current=y.current+1};(0,l.useEffect)(()=>{let e=new Image;e.src=t,e.onload=()=>{let t=m.current,a=h.current;if(!t||!a)return;t.width=e.width,t.height=e.height,a.width=e.width,a.height=e.height;let s=t.getContext("2d");null==s||s.drawImage(e,0,0);let l=a.getContext("2d");l&&(l.fillStyle="rgba(0,0,0,0)",l.fillRect(0,0,a.width,a.height),z())}},[t]);let L=e=>{var t;p(!0);let a=null==(t=h.current)?void 0:t.getBoundingClientRect();if(a){let t="touches"in e?e.touches[0].clientX:e.clientX,s="touches"in e?e.touches[0].clientY:e.clientY;w.current={x:(t-a.left)*(h.current.width/a.width),y:(s-a.top)*(h.current.height/a.height)}}},I=(0,l.useCallback)(e=>{var t,a;if(!x||!w.current)return;let s=null==(t=h.current)?void 0:t.getContext("2d"),l=null==(a=h.current)?void 0:a.getBoundingClientRect();if(!s||!l)return;let r=h.current.width/l.width,i=h.current.height/l.height,n=(r+i)/2*j,o="touches"in e?e.touches[0].clientX:e.clientX,c="touches"in e?e.touches[0].clientY:e.clientY,d={x:(o-l.left)*r,y:(c-l.top)*i};"brush"===f?(s.globalCompositeOperation="source-over",s.strokeStyle="rgba(0, 0, 0, 1)"):(s.globalCompositeOperation="destination-out",s.strokeStyle="rgba(0, 0, 0, 1)",s.shadowColor="transparent",s.shadowBlur=0),s.lineCap="round",s.lineJoin="round",s.lineWidth=n,s.beginPath(),s.moveTo(w.current.x,w.current.y),s.lineTo(d.x,d.y),s.stroke(),w.current=d},[x,w,f,j]),M=()=>{x&&(p(!1),z(),A())};return(0,s.jsxs)("div",{className:(0,c.cn)("relative flex aspect-square w-full flex-col items-center gap-3 lg:aspect-auto",a),children:[(0,s.jsx)("div",{className:"bg-opacity-60 pointer-events-none absolute z-50 -translate-x-1/2 -translate-y-1/2 rounded-full bg-yellow-400",style:{left:N.x,top:N.y,width:j,height:j,display:k?"block":"none"}}),(0,s.jsxs)("div",{className:"relative size-full",ref:_,children:[(0,s.jsx)("canvas",{ref:m,className:"absolute inset-0 top-1/2 left-1/2 max-h-full max-w-full -translate-x-1/2 -translate-y-1/2"}),(0,s.jsx)("canvas",{ref:h,className:"absolute inset-0 top-1/2 left-1/2 max-h-full max-w-full -translate-x-1/2 -translate-y-1/2",onMouseDown:L,onMouseMove:I,onMouseUp:M,onMouseOut:M,onTouchStart:L,onTouchMove:I,onTouchEnd:M,onTouchCancel:M})]}),(0,s.jsxs)("div",{className:"bottom-4 left-4 z-10 flex w-fit flex-col gap-2 rounded-lg bg-[var(--c-bg)] p-2 lg:flex-row",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{var e;if(y.current<=0)return;y.current=y.current-1;let t=null==(e=h.current)?void 0:e.getContext("2d");t&&(t.putImageData(C.current[y.current],0,0),A())},className:"flex size-8 items-center justify-center rounded hover:border hover:border-white/10 hover:bg-white/5",children:(0,s.jsx)(r.A,{className:"size-5",strokeWidth:1})}),(0,s.jsx)("button",{type:"button",onClick:()=>{var e;if(y.current>=C.current.length-1)return;y.current=y.current+1;let t=null==(e=h.current)?void 0:e.getContext("2d");t&&(t.putImageData(C.current[y.current],0,0),A())},className:"flex size-8 items-center justify-center rounded hover:border hover:border-white/10 hover:bg-white/5",children:(0,s.jsx)(i.A,{className:"size-5",strokeWidth:1})})]}),(0,s.jsxs)("div",{className:"flex h-8 items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 rounded-lg border border-light-gray-2 bg-[var(--c-light-gray)] p-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>
1b("brush"),className:(0,c.cn)("flex size-6 items-center justify-center rounded","brush"===f&&"bg-white/10"),children:(0,s.jsx)(n.A,{className:"size-4",strokeWidth:1})}),(0,s.jsx)("button",{type:"button",onClick:()=>b("eraser"),className:(0,c.cn)("flex size-6 items-center justify-center rounded","eraser"===f&&"bg-white/10"),children:(0,s.jsx)(o.A,{className:"size-4",strokeWidth:1})})]}),(0,s.jsx)(g,{min:1,max:100,step:1,defaultValue:j,onChange:v,className:"border-none bg-transparent"})]})]})]})}},98611:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>o});var s=a(63616),l=a(27980),r=a(38834),i=a(10436),n=a(19256);let o=l.memo(function(e){let{firstImage:t="",secondImage:a="",className:o,firstImageClassName:c,secondImageClassname:d,initialSliderPercentage:u=50,slideMode:m="hover",showHandlebar:h=!0,autoplay:g=!1,autoplayDuration:x=5e3,showTransparentChessboard:p=!1}=e,[f,b]=(0,l.useState)(u),[j,v]=(0,l.useState)(!1),[w,C]=(0,l.useState)({width:" 100%",height:" 100%"}),y=(0,l.useRef)(null),[_,N]=(0,l.useState)(!1),k=(0,l.useRef)(null),A=(0,l.useCallback)(()=>{if(!g)return;let e=Date.now(),t=()=>{let a=(Date.now()-e)%(2*x)/x;b(a<=1?100*a:(2-a)*100),k.current=setTimeout(t,16)};t()},[g,x]),z=(0,l.useCallback)(()=>{k.current&&(clearTimeout(k.current),k.current=null)},[]);(0,l.useEffect)(()=>(A(),()=>z()),[A,z]);let L=(0,l.useCallback)(e=>{"drag"===m&&v(!0)},[m]),I=(0,l.useCallback)(()=>{"drag"===m&&v(!1)},[m]),M=(0,l.useCallback)(e=>{if(y.current&&("hover"===m||"drag"===m&&j)){let t=y.current.getBoundingClientRect(),a=(e-t.left)/t.width*100;requestAnimationFrame(()=>{b(Math.max(0,Math.min(100,a)))})}},[m,j]),S=(0,l.useCallback)(e=>L(e.clientX),[L]),R=(0,l.useCallback)(()=>I(),[I]),O=(0,l.useCallback)(e=>M(e.clientX),[M]),T=(0,l.useCallback)(e=>{g||L(e.touches[0].clientX)},[L,g]),D=(0,l.useCallback)(()=>{g||I()},[I,g]),E=(0,l.useCallback)(e=>{g||M(e.touches[0].clientX)},[M,g]);return(0,s.jsxs)("div",{ref:y,className:(0,n.cn)("h-full w-full cursor-col-resize overflow-hidden",p&&"bg-transparent-chessboard",o),style:{width:w.width,height:w.height,position:"relative"},onMouseMove:O,onMouseLeave:function(){N(!1),"hover"===m&&b(u),"drag"===m&&v(!1),A()},onMouseEnter:function(){N(!0),z()},onMouseDown:S,onMouseUp:R,onTouchStart:T,onTouchEnd:D,onTouchMove:E,children:[(0,s.jsx)(r.N,{initial:!1,children:(0,s.jsx)(i.P.div,{className:"absolute top-0 z-30 m-auto h-full w-px bg-gradient-main",style:{left:"".concat(f,"%"),top:"0",zIndex:40},transition:{duration:0},children:h&&(0,s.jsx)("div",{className:"absolute -right-2.5 top-1/2 z-30 flex h-12 w-3 -translate-x-1 -translate-y-1/2 items-center justify-center bg-gradient-main shadow-lg",children:(0,s.jsx)("div",{className:"h-4 w-4 text-black"})})})}),(0,s.jsx)("div",{className:"pointer-events-none relative z-20 h-full w-full overflow-hidden",children:(0,s.jsx)(r.N,{initial:!1,children:t?(0,s.jsx)(i.P.div,{className:(0,n.cn)("absolute inset-0 z-20 h-full w-full flex-shrink-0 select-none overflow-hidden",c),style:{clipPath:"inset(0 ".concat(100-f,"% 0 0)")},transition:{duration:0},children:(0,s.jsx)("img",{alt:"first image",src:t,onLoad:e=>{C({width:e.currentTarget.width,height:e.currentTarget.height})},className:(0,n.cn)("absolute inset-0 left-1/2 top-1/2 z-20 max-h-full max-w-full flex-shrink-0 -translate-x-1/2 -translate-y-1/2 select-none",c),draggable:!1})}):null})}),(0,s.jsx)(r.N,{initial:!1,children:a?(0,s.jsx)(i.P.img,{className:(0,n.cn)("absolute inset-0 left-1/2 top-1/2 z-[19] max-h-full max-w-full -translate-x-1/2 -translate-y-1/2 select-none",d),alt:"second image",src:a,draggable:!1}):null})]})})}}]);
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.