PageSourceSearch

https://thegradix.vercel.app/_next/static/chunks/app/page-a90d686a42b692b6.js

js thegradix.vercel.app collected 2026-10-03 07:52:10 UTC 89,053 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{61:(e,t,a)=>{Promise.resolve().then(a.bind(a,4649))},4649:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>eQ});var l=a(5155),s=a(2115),r=a(3463),i=a(9795);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,i.QP)((0,r.$)(t))}function o(e,t){let a;return function(){for(var l=arguments.length,s=Array(l),r=0;r<l;r++)s[r]=arguments[r];clearTimeout(a),a=setTimeout(()=>e.apply(this,s),t)}}let c=s.forwardRef((e,t)=>{let{className:a,type:s,...r}=e;return(0,l.jsx)("input",{type:s,className:n("flex h-10 w-full rounded-xl border border-primary/10 bg-foreground/5 px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-none focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm hover:border-primary/20 transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]",a),ref:t,...r})});c.displayName="Input";var d=a(6967),x=a(3545),h=a(98),m=a(8684),u=a(5686),g=a(4159),f=a(992),p=a(1781),b=a(9201),v=a(272),j=a(9828),y=a(4857),w=a(3920),N=a(1757),C=a(2502),k=a(8058),A=a(8619),M=a(3243),S=a(1637),z=a(3473),I=a(1556),R=a(5900);let P=s.forwardRef((e,t)=>{let{className:a,label:s,valueSubtext:r,...i}=e;return(0,l.jsxs)("div",{className:"relative overflow-hidden",children:[(0,l.jsx)("label",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-foreground text-sm font-medium z-10",children:s}),(0,l.jsxs)(R.bL,{ref:t,className:n("relative flex w-full touch-none select-none items-center overflow-clip z-10",a),...i,children:[(0,l.jsx)(R.CC,{className:"relative h-10 w-full grow rounded-xl border border-foreground
1/10 bg-foreground/5 hover:border-primary/20 transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]",children:(0,l.jsx)(R.Q6,{className:"absolute h-full hidden"})}),(0,l.jsx)(R.zi,{className:"block h-8 w-2 rounded-full bg-foreground/20 shadow transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 cursor-grab active:cursor-grabbing hover:bg-foreground/30 transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]"})]}),(0,l.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-foreground/80 text-sm font-medium",children:r?"".concat(i.value).concat(r):i.value})]})});P.displayName=R.bL.displayName;var F=a(2714),D=a(1719),E=a(1902),T=a(8867);let L=F.bL,B=F.YJ,U=F.WT,W=s.forwardRef((e,t)=>{let{className:a,children:s,...r}=e;return(0,l.jsxs)(F.l9,{ref:t,className:n("flex h-10 w-full items-center justify-between rounded-2xl bg-foreground/5 px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-none focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 border border-primary/10 hover:border-primary/20 transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]",a),...r,children:[s,(0,l.jsx)(F.In,{asChild:!0,children:(0,l.jsx)(D.A,{className:"h-4 w-4 opacity-50"})})]})});W.displayName=F.l9.displayName;let V=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(F.PP,{ref:t,className:n("flex cursor-default items-center justify-center py-1",a),...s,children:(0,l.jsx)(E.A,{className:"h-4 w-4"})})});V.displayName=F.PP.displayName;let O=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(F.wn,{ref:t,className:n("flex cursor-default items-center justify-center py-1",a),...s,children:(0,l.jsx)(D.A,{className:"h-4 w-4"})})});O.displayName=F.wn.displayName;let H=s.forwardRef((e,t)=>{let{className:a,children:s,position:r="popper",...i}=e;return(0,l.jsx)(F.ZL,{children:(0,l.jsxs)(F.UC,{ref:t,className:n("relative z-50 max-h-72 min-w-[8rem] overflow-hidden rounded-2xl border border-primary/10 bg-background/50 backdrop-blur-md text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:r,...i,children:[(0,l.jsx)(V,{}),(0,l.jsx)(F.LM,{className:n("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,l.jsx)(O,{})]})})});H.displayName=F.UC.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(F.JU,{ref:t,className:n("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...s})}).displayName=F.JU.displayName;let G=s.forwardRef((e,t)=>{let{className:a,children:s,...r}=e;return(0,l.jsxs)(F.q7,{ref:t,className:n("relative flex w-full cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-foreground
1/5 focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 transition-all duration-300",a),...r,children:[(0,l.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,l.jsx)(F.VF,{children:(0,l.jsx)(T.A,{className:"h-4 w-4"})})}),(0,l.jsx)(F.p4,{children:s})]})});G.displayName=F.q7.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(F.wv,{ref:t,className:n("-mx-1 my-1 h-px bg-muted",a),...s})}).displayName=F.wv.displayName;var X=a(6251),Y=a(8217);let q=Y.bL,Z=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(Y.B8,{ref:t,className:n("inline-flex items-center justify-center rounded-xl bg-transparent text-muted-foreground",a),...s})});Z.displayName=Y.B8.displayName;let _=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(Y.l9,{ref:t,className:n("inline-flex items-center justify-center whitespace-nowrap rounded-xl px-3 py-1.5 text-sm font-medium ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-foreground
1/15 data-[state=active]:hover:bg-foreground/15 data-[state=active]:text-foreground tracking-tight data-[state=active]:shadow-xs hover:bg-foreground/15 transition-all duration-300 border border-transparent",a),...s})});_.displayName=Y.l9.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(Y.UC,{ref:t,className:n("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...s})}).displayName=Y.UC.displayName;var J=a(532);let K=J.bL,Q=J.l9,$=s.forwardRef((e,t)=>{let{className:a,align:s="center",sideOffset:r=4,...i}=e;return(0,l.jsx)(J.ZL,{children:(0,l.jsx)(J.UC,{ref:t,align:s,sideOffset:r,className:n("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})})});$.displayName=J.UC.displayName;let ee=["#001220","#FF6600","#002B50","#FFB366","#004080","#FF8000","#0066CC","#000000","#66A3FF"],et=["#0D1319","#0D151A","#0D161C","#0D171D","#0D191F","#1A160D","#1A130D","#1A110D","#0D0D0D"],ea=[{name:"Bricolage Grotesque",variable:!0,weights:[200,300,400,500,600,700,800]},{name:"Geist",variable:!0,weights:[100,200,300,400,500,600,700,800,900]},{name:"Inter",variable:!0,weights:[100,200,300,400,500,600,700,800,900]},{name:"Manrope",variable:!0,weights:[200,300,400,500,600,700,800]},{name:"Montserrat",variable:!0,weights:[100,200,300,400,500,600,700,800,900]},{name:"Onest",variable:!0,weights:[100,200,300,400,500,600,700,800,900]},{name:"Poppins",variable:!1,weights:[100,200,300,400,500,600,700,800,900]},{name:"Space Grotesk",variable:!0,weights:[300,400,500,600,700]},{name:"DM Serif Display",variable:!1,weights:[400]},{name:"Instrument Serif",variable:!1,weights:[400]},{name:"Lora",variable:!0,weights:[400,500,600,700]},{name:"Ms Madi",variable:!1,weights:[400]},{name:"Space Mono",variable:!1,weights:[400,700]}],el=[{name:"16:9",width:1920,height:1080,category:""},{name:"3:2",width:1920,height:1280,category:""},{name:"4:3",width:1920,height:1440,category:""},{name:"5:4",width:1920,height:1536,category:""},{name:"1:1",width:1920,height:1920,category:""},{name:"4:5",width:1080,height:1350,category:""},{name:"3:4",width:1080,height:1440,category:""},{name:"2:3",width:1080,height:1620,category:""},{name:"9:16",width:1080,height:1920,category:""},{name:"iPhone 15",width:1179,height:2556,category:"Mobile Devices"},{name:"iPhone 15 Pro",width:1179,height:2556,category:"Mobile Devices"},{name:"iPhone 15 Pro Max",width:1290,height:2796,category:"Mobile Devices"},{name:"Android (S)",width:720,height:1520,category:"Mobile Devices"},{name:"Android (M)",width:1080,height:2400,category:"Mobile Devices"},{name:"Android (L)",width:1440,height:3200,category:"Mobile Devices"},{name:'iPad Pro 12.9"',width:2048,height:2732,category:"Tablets"},{name:"iPad Air",width:1668,height:2388,category:"Tablets"},{name:"Samsung Tab S7",width:2560,height:1600,category:"Tablets"},{name:"2K (QHD)",width:2560,height:1440,category:"Desktop & Monitors"},{name:"Full HD",width:1920,height:1080,category:"Desktop & Monitors"},{name:"4K UHD",width:3840,height:2160,category:"Desktop & Monitors"},{name:"Open Graph",width:1200,height:630,category:"Metadata"},{name:"Story/Reels",width:1080,height:1920,category:"Facebook"},{name:"Event Cover",width:1920,height:1005,category:"Facebook"},{name:"Square Post",width:1080,height:1080,category:"Instagram"},{name:"Portrait Post",width:1080,height:1350,category:"Instagram"},{name:"Story/Reels",width:1080,height:1920,category:"Instagram"},{name:"Post Image",width:1600,height:900,category:"Twitter"},{name:"Header",width:1500,height:500,category:"Twitter"},{name:"Post",width:1200,height:627,category:"LinkedIn"},{name:"Banner",width:1584,height:396,category:"LinkedIn"}],es={src:"/_next/static/media/logobg3.32cecb1e.png",height:500,width:500,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAPFBMVEVMaXEAKHEApfEAcMYARJUAcssAetAAE1UAjeQAbMIAdMwAdMgAo/AALXkAOIQAMX8AUKMAasAAWrEAk+Ws7jkDAAAAFHRSTlMAOEC6xzkjCg+rnXKLl6tSoYtSqajsWNgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAA4SURBVHicRYtBDoAgDMAqTLaBisL//0p2wZ6aJoWNtpSaAqPm+XbAXOSJctxZ6hni1+chFLPyvywqzAEdoPNKbwAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8};var er=a(5565);let ei=s.forwardRef((e,t)=>
1{let{className:a,...s}=e;return(0,l.jsx)("textarea",{className:n("flex min-h-8 w-full rounded-xl border border-primary/10 bg-foreground/5 px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-none focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm no-scrollbar",a),ref:t,...s})});ei.displayName="Textarea",a(490);var en=a(4128);let eo=(0,a(9827).v)((e,t)=>({colors:ee,backgroundColors:et,activeColor:null,circles:ee.map(e=>({color:e,cx:100*Math.random(),cy:100*Math.random()})),previousCircles:[],numCircles:ee.length,text:"✨ Elysium Designs ✨",htmlContent:"<p>Elysium Designs ✨</p>",fontSize:10,blur:600,fontWeight:600,letterSpacing:-.02,opacity:100,fontFamily:"Instrument Serif",activeTab:"design",grainIntensity:25,backgroundColor:"#001220",lineHeight:1,textColor:"#f1f1f1",activeColorPicker:"#f1f1f1",activeColorType:"text",resolution:{width:1920,height:1080},saturation:100,contrast:100,brightness:100,backgroundImage:null,isItalic:!1,isUnderline:!1,isStrikethrough:!1,isDownloading:!1,isGenerating:!1,isUploading:!1,textShadow:{color:"#f5f5f5",blur:24,offsetX:0,offsetY:0},textPosition:{x:0,y:0},sizeMode:"text",logoImage:null,textAlign:"center",setCircles:t=>{e({circles:t.map((e,a)=>{if(t.some((t,l)=>a!==l&&20>Math.sqrt(Math.pow(e.cx-t.cx,2)+Math.pow(e.cy-t.cy,2)))){let l=0,s=e.cx,r=e.cy;for(;l<10&&(s=100*Math.random(),r=100*Math.random(),t.some((e,t)=>a!==t&&20>Math.sqrt(Math.pow(s-e.cx,2)+Math.pow(r-e.cy,2))));)l++;return{...e,cx:s,cy:r}}return e})})},setPreviousCircles:t=>e({previousCircles:t}),setActiveColor:t=>e({activeColor:t}),updateColor:(a,l)=>{let{circles:s}=t(),r=[...s];r[l]={...r[l],color:a},e({circles:r})},setText:t=>e({text:t}),setHtmlContent:t=>e({htmlContent:t}),setFontSize:o(t=>e({fontSize:t}),100),setFontWeight:t=>e({fontWeight:t}),setFontFamily:t=>e({fontFamily:t}),setBackgroundColor:t=>e({backgroundColor:t}),setTextColor:t=>e({textColor:t}),generateNewPalette:()=>{let{circles:a}=t();e({previousCircles:a,circles:a.map(e=>({...e,cx:100*Math.random(),cy:100*Math.random()}))})},setActiveTab:t=>e({activeTab:t}),setLetterSpacing:o(t=>e({letterSpacing:t}),100),setOpacity:t=>e({opacity:t}),setLineHeight:o(t=>e({lineHeight:t}),100),setBlur:o(t=>e({blur:t}),100),setSaturation:o(t=>e({saturation:t}),100),setContrast:o(t=>e({contrast:t}),100),setBrightness:o(t=>e({brightness:t}),100),setGrainIntensity:o(t=>e({grainIntensity:t}),100),setTextShadow:a=>e({textShadow:"function"==typeof a?a(t().textShadow):a}),setIsItalic:t=>e({isItalic:t}),setIsUnderline:t=>e({isUnderline:t}),setIsStrikethrough:t=>e({isStrikethrough:t}),setResolution:t=>e({resolution:t}),setBackgroundImage:t=>e({backgroundImage:t}),setIsUploading:t=>e({isUploading:t}),setNumCircles:t=>e({numCircles:t}),setActiveColorPicker:t=>e({activeColorPicker:t}),setActiveColorType:t=>e({activeColorType:t}),setIsDownloading:t=>e({isDownloading:t}),setTextPosition:t=>e({textPosition:t}),setTextMode:t=>e({sizeMode:t}),setLogoImage:t=>e({logoImage:t}),setTextAlign:t=>e({textAlign:t}),isCopying:!1,setIsCopying:t=>e({isCopying:t}),resetPalette:()=>{let{circles:a}=t(),l=ee.map((e,t)=>{var l,s,r,i;return{color:e,cx:null!==(r=null===(l=a[t])||void 0===l?void 0:l.cx)&&void 0!==r?r:100*Math.random(),cy:null!==(i=null===(s=a[t])||void 0===s?void 0:s.cy)&&void 0!==i?i:100*Math.random()}});e({textColor:"#f1f1f1",backgroundColor:"#001220",circles:l.map((e,t)=>{if(l.some((a,l)=>t!==l&&20>Math.sqrt(Math.pow(e.cx-a.cx,2)+Math.pow(e.cy-a.cy,2)))){let a=0,s=e.cx,r=e.cy;for(;a<10&&(s=100*Math.random(),r=100*Math.random(),l.some((e,a)=>t!==a&&20>Math.sqrt(Math.pow(s-e.cx,2)+Math.pow(r-e.cy,2))));)a++;return{...e,cx:s,cy:r}}return e}),numCircles:ee.length})}}));function ec(){let e=(0,s.useRef)(null),t=(0,s.useRef)(null),a=(0,s.useRef)(null),r=eo(),i=(0,s.useMemo)(()=>o(e=>e(),16),[]),n=(0,s.useMemo)(()=>({blur:r.blur,brightness:r.brightness,contrast:r.contrast,saturation:r.saturation,backgroundColor:r.backgroundColor,backgroundImage:r.backgroundImage,circles:r.circles,text:r.text,fontSize:r.fontSize,fontWeight:r.fontWeight,letterSpacing:r.letterSpacing,opacity:r.opacity,fontFamily:r.fontFamily,lineHeight:r.lineHeight,textColor:r.textColor,isItalic:r.isItalic,isUnderline:r.isUnderline,isStrikethrough:r.isStrikethrough,grainIntensity:r.grainIntensity,textShadow:r.textShadow,textPosition:r.textPosition,sizeMode:r.sizeMode,logoImage:r.logoImage,resolution:r.resolution,textAlign:r.textAlign}),[r.blur,r.brightness,r.contrast,r.saturation,r.backgroundColor,r.backgroundImage,r.cir
1cles,r.text,r.fontSize,r.fontWeight,r.letterSpacing,r.opacity,r.fontFamily,r.lineHeight,r.textColor,r.isItalic,r.isUnderline,r.isStrikethrough,r.grainIntensity,r.textShadow,r.textPosition,r.sizeMode,r.logoImage,r.resolution,r.textAlign]);(0,s.useEffect)(()=>{t.current||(t.current=document.createElement("canvas"),a.current=document.createElement("canvas")),[t,a].forEach(e=>{e.current&&(e.current.width=n.resolution.width,e.current.height=n.resolution.height)})},[n.resolution.width,n.resolution.height]),(0,s.useEffect)(()=>{if(!a.current)return;let e=a.current.getContext("2d");if(e.clearRect(0,0,n.resolution.width,n.resolution.height),e.fillStyle=n.backgroundColor,e.fillRect(0,0,n.resolution.width,n.resolution.height),n.backgroundImage){let t=new Image;t.src=n.backgroundImage,t.onload=()=>{let a=Math.max(n.resolution.width/t.width,n.resolution.height/t.height),l=t.width*a,s=t.height*a,r=(n.resolution.width-l)/2,o=(n.resolution.height-s)/2;e.drawImage(t,r,o,l,s),i(c)}}else n.circles.forEach(t=>{(function(e){let t=["circle","blob","wave","organic"];t[Math.floor(Math.random()*t.length)]})(t.color),function(e,t,a){let l=new Path2D,s=a.cx/100*e.canvas.width,r=a.cy/100*e.canvas.height,i=.3*Math.min(e.canvas.width,e.canvas.height);l.moveTo(s+i,r);for(let e=1;e<=6;e++){let t=2*e*Math.PI/6,a=i*(1+(Math.random()-.5)*.4),n=s+a*Math.cos(t),o=r+a*Math.sin(t),c=(e-1)*2*Math.PI/6,d=i*(1.2+.4*Math.random()),x=s+d*Math.cos(c+Math.PI/6),h=r+d*Math.sin(c+Math.PI/6),m=s+d*Math.cos(t-Math.PI/6),u=r+d*Math.sin(t-Math.PI/6);l.bezierCurveTo(x,h,m,u,n,o)}l.closePath(),e.fillStyle=a.color,e.fill(l)}(e,0,t)}),i(c)},[n.backgroundColor,n.circles,n.backgroundImage,n.resolution.width,n.resolution.height]),(0,s.useEffect)(()=>{i(c)},[n.blur,n.brightness,n.contrast,n.saturation]);let c=(0,s.useCallback)(()=>{if(!e.current||!a.current)return;let t=e.current.getContext("2d",{alpha:!0,willReadFrequently:!1});t.clearRect(0,0,n.resolution.width,n.resolution.height),t.fillStyle=n.backgroundColor,t.fillRect(0,0,n.resolution.width,n.resolution.height);let l=[n.blur>0?"blur(".concat(n.blur/4,"px)"):"","brightness(".concat(n.brightness,"%)"),"contrast(".concat(n.contrast,"%)"),"saturate(".concat(n.saturation,"%)")].filter(Boolean).join(" ");t.filter=l,t.drawImage(a.current,0,0),n.grainIntensity>0&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,a=e.getImageData(0,0,e.canvas.width,e.canvas.height),l=a.data,s=(0,en.fu)();for(let a=0;a<l.length;a+=4){let r=Math.max(-30,Math.min(30,s(1*(a/4%e.canvas.width),1*Math.floor(a/4/e.canvas.width))*(50*t)));l[a]=Math.max(0,l[a]+r),l[a+1]=Math.max(0,l[a+1]+r),l[a+2]=Math.max(0,l[a+2]+r)}e.putImageData(a,0,0)}(t,n.grainIntensity/100)},[n.blur,n.brightness,n.contrast,n.saturation,n.resolution.width,n.resolution.height,n.backgroundColor,n.grainIntensity]);return(0,l.jsx)("canvas",{id:"wallpaper",className:"transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]",ref:e,width:n.resolution.width,height:n.resolution.height,style:{width:"100%",height:"100%",objectFit:"contain",transform:"translate3d(0,0,0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",imageRendering:"-webkit-optimize-contrast",willChange:"transform"}})}var ed=a(814),ex=a(434);let eh=s.forwardRef((e,t)=>{let{className:a,orientation:s="horizontal",decorative:r=!0,...i}=e;return(0,l.jsx)(ex.b,{ref:t,decorative:r,orientation:s,className:n("shrink-0 bg-foreground
1/10","horizontal"===s?"h-[1px] w-full":"h-full w-[1px]",a),...i})});eh.displayName=ex.b.displayName;var em=a(2317);let eu=(0,a(1027).F)("inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm relative cursor-pointer transition-all duration-300 rounded-xl border border-primary/10 bg-foreground/5 hover:bg-primary/10 backdrop-blur-md w-full disabled:opacity-50 disabled:cursor-not-allowed hover:border-primary/20 transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]",{variants:{variant:{default:"text-foreground",accent:"bg-secondary-foreground hover:bg-secondary-foreground/80 text-secondary",destructive:"bg-destructive/50 text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-foreground/10 hover:text-accent-foreground border-none bg-transparent",link:"text-primary underline-offset-4 hover:underline",success:"bg-green-600/50 text-white hover:bg-green-600/90"},size:{default:"px-4 py-2",sm:"px-3 py-1.5",lg:"px-3 py-4",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),eg=s.forwardRef((e,t)=>{let{className:a,variant:s,size:r,asChild:i=!1,...o}=e,c=i?em.DX:"button";return(0,l.jsx)(c,{className:n(eu({variant:s,size:r,className:a})),ref:t,...o})});eg.displayName="Button";var ef=a(743),ep=a(2413);let eb=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(ep.bL,{className:n("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-primary/10",a),...s,ref:t,children:(0,l.jsx)(ep.zi,{className:n("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})});function ev(e){let{value:t,onChange:a,width:r,height:i,className:o}=e,c=(0,s.useRef)(null),[d,x]=(0,s.useState)(!1),[h,m]=(0,s.useState)(!0),u=r/i,g=u>1,f=(e,t)=>{var a;let l=null===(a=c.current)||void 0===a?void 0:a.getBoundingClientRect();if(!l)return{x:0,y:0};let s=(e-l.left)/l.width*2-1,n=(t-l.top)/l.height*2-1,o=r/2*Math.max(-1,Math.min(1,s)),d=i/2*Math.max(-1,Math.min(1,n));if(h){let e=r/2/(l.width/20),t=i/2/(l.height/20);o=Math.round(o/e)*e,d=Math.round(d/t)*t}return{x:o,y:d}},p=e=>{d&&(e.preventDefault(),a(f(e.clientX,e.clientY)))},b=()=>{x(!1)};(0,s.useEffect)(()=>(d&&(window.addEventListener("pointermove",p),window.addEventListener("pointerup",b)),()=>{window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",b)}),[d,h]);let v={left:"".concat((t.x/(r/2)+1)/2*100,"%"),top:"".concat((t.y/(i/2)+1)/2*100,"%")};return(0,l.jsxs)("div",{className:"relative w-full flex flex-col pb-32 lg:pb-0 gap-6 lg:min-h-[20vh] lg:max-h-[35vh] h-full",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,l.jsx)("h4",{className:"text-sm text-muted-foreground",children:"Position"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("label",{htmlFor:"snap-grid",className:"text-xs text-muted-foreground cursor-pointer",children:"Snap to Grid"}),(0,l.jsx)(eb,{checked:h,onCheckedChange:m,id:"snap-grid"})]})]}),(0,l.jsx)("div",{ref:c,className:n("relative rounded-xl bg-secondary border border-primary/10 flex mx-auto scale-95 hover:scale-100 transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)] hover:border-primary/20",o),onPointerDown:e=>{x(!0),a(f(e.clientX,e.clientY))},style:{...g?{width:"100%",height:"".concat(1/u*100,"%"),aspectRatio:u}:{width:"".concat(100*u,"%"),height:"100%",aspectRatio:u},backgroundImage:"radial-gradient(circle at center, hsl(var(--foreground) / 0.1) 1px, transparent 1px)",backgroundSize:"".concat(20,"px ").concat(20,"px")},children:(0,l.jsx)("div",{className:"absolute w-4 h-4 -translate-x-1/2 -translate-y-1/2 roun
1ded-full bg-primary cursor-grab active:cursor-grabbing",style:v})})]})}eb.displayName=ep.bL.displayName;var ej=a(6217);let ey=ej.bL;ej.l9;let ew=ej.ZL;ej.bm;let eN=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(ej.hJ,{ref:t,className:n("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 outline-hidden focus:outline-hidden data-[state=open]:focus:outline-hidden data-[state=closed]:focus:outline-hidden",a),...s})});eN.displayName=ej.hJ.displayName;let eC=s.forwardRef((e,t)=>{let{className:a,children:s,...r}=e;return(0,l.jsxs)(ew,{children:[(0,l.jsx)(eN,{}),(0,l.jsx)(ej.UC,{ref:t,className:n("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border border-primary/10 bg-background/5 p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] backdrop-blur-md",a),...r,children:s})]})});eC.displayName=ej.UC.displayName;let ek=e=>{let{className:t,...a}=e;return(0,l.jsx)("div",{className:n("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};ek.displayName="DialogHeader";let eA=e=>{let{className:t,...a}=e;return(0,l.jsx)("div",{className:n("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};eA.displayName="DialogFooter";let eM=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(ej.hE,{ref:t,className:n("text-lg font-semibold leading-none tracking-tight",a),...s})});eM.displayName=ej.hE.displayName;let eS=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(ej.VY,{ref:t,className:n("text-sm text-muted-foreground",a),...s})});eS.displayName=ej.VY.displayName;var ez=a(3518),eI=a(8485),eR=a(7725),eP=a(2104),eF=a(2410),eD=a(7113);let eE=[{key:"system",icon:eI.A,label:"System theme"},{key:"light",icon:eR.A,label:"Light theme"},{key:"dark",icon:eP.A,label:"Dark theme"}],eT=e=>{let{className:t}=e,{theme:a,setTheme:r}=(0,eD.D)(),[i,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!i)return null;let c=e=>{if(e!==a){if(!document.startViewTransition)return r(e);document.startViewTransition(()=>r(e))}};return(0,l.jsx)("div",{className:n("relative flex h-12 w-full items-center justify-between rounded-2xl border border-primary/10 bg-foreground
1/5 px-1 py-2",t),children:eE.map(e=>{let{key:t,icon:s,label:r}=e,i=a===t;return(0,l.jsxs)("button",{type:"button",className:"relative h-9 w-1/3 rounded-xl cursor-pointer",onClick:()=>c(t),"aria-label":r,children:[i&&(0,l.jsx)(eF.P.div,{layoutId:"activeTheme",className:"absolute inset-0 rounded-xl bg-primary",transition:{type:"spring",duration:.5,bounce:.3}}),(0,l.jsx)(s,{className:n("relative m-auto h-4 w-1/3 transition-colors duration-200",i?"text-primary-foreground":"text-muted-foreground hover:text-foreground")})]},t)})})},eL=e=>(0,l.jsx)("svg",{className:n("size-4",e.className),viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",...e,children:(0,l.jsx)("path",{d:"M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03
1-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z"})});var eB=a(8173),eU=a.n(eB);let eW=e=>(0,l.jsx)("svg",{className:n("size-6",e.className),viewBox:"0 0 1200 1227",xmlns:"http://www.w3.org/2000/svg",fill:"none",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z"})});function eV(e){let{setIsSettingsOpen:t}=e;return(0,l.jsxs)("div",{className:"flex flex-col h-full bg-secondary overflow-y-auto no-scrollbar rounded-2xl relative",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-primary/10 bg-secondary w-full sticky top-0 z-10",children:[(0,l.jsx)(eU(),{href:"https://github.com/shiva-bajpai",target:"_blank",children:(0,l.jsxs)(eg,{variant:"accent",children:[(0,l.jsx)(eL,{className:" size-4"}),"Follow Us"]})}),(0,l.jsx)(eg,{variant:"ghost",size:"icon",onClick:()=>t(!1),className:"rounded-xl",children:(0,l.jsx)(ez.A,{className:"size-4"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 flex-col w-full h-full p-2",children:[(0,l.jsx)(eT,{}
1),(0,l.jsxs)("div",{className:"rounded-2xl bg-foreground/5 p-4 border border-primary/10 flex flex-col justify-between min-h-80",children:[(0,l.jsx)(eF.P.div,{animate:{y:[-5,5]},transition:{duration:2,ease:"easeInOut",repeat:1/0,repeatType:"reverse"},children:(0,l.jsx)(er.default,{src:es,alt:"logo",className:"size-28 my-2",priority:!0,loading:"eager"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("h5",{className:"text-lg font-semibold flex items-center gap-2 tracking-tight",children:["Welcome to Gradix",(0,l.jsx)("span",{className:"text-xs rounded-full bg-primary/10 px-2 py-1 w-fit",children:"BETA"})]}),(0,l.jsx)("p",{className:"text-sm text-foreground tracking-tight",children:"Gradix is a simple gradient generator tool made by designer for designers to create stunning gradients with customizable colors, text, and effects."})]})]}),(0,l.jsxs)(eU(),{href:"https://x.com/intent/tweet?text=Check%20out%20Gradix%20-%20A%20beautiful%20%20gradient%20generator%20tool%0A%0Ahttps%3A%2F%2Fthegradix.vercel.app",target:"_blank",className:"flex flex-col gap-2 justify-between border border-primary/10 rounded-2xl p-4 bg-foreground
1/5 min-h-40",children:[(0,l.jsx)(eW,{className:"size-6"}),(0,l.jsxs)("h5",{className:"font-medium tracking-tight",children:["Enjoying ",(0,l.jsx)("span",{className:"font-bold",children:"Gradix"}),"? Share your experience on X/Twitter"]})]})]})]})}var eO=a(9847);function eH(e){let{children:t,title:a,direction:s="left",className:r,isOpen:i,setIsOpen:o,showHandle:c=!1}=e;return(0,l.jsx)(eO._s.Root,{direction:s,open:i,onOpenChange:o,repositionInputs:!1,children:(0,l.jsxs)(eO._s.Portal,{children:[(0,l.jsx)(eO._s.Overlay,{className:"fixed inset-0 bg-black/40 z-40"}),(0,l.jsxs)(eO._s.Content,{className:n("fixed bottom-0 left-0 right-0 outline-none z-50 bg-secondary",r),children:[c&&(0,l.jsx)("div",{className:"py-2 bg-secondary rounded-t-lg",children:(0,l.jsx)(eO._s.Handle,{})}),(0,l.jsx)(eO._s.Title,{className:"sr-only",children:a}),t]})]})})}function eG(e){let{children:t,id:a}=e,{attributes:s,listeners:r,setNodeRef:i,transform:n}=(0,ef.PM)({id:a}),o=n?{transform:"translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)")}:void 0;return(0,l.jsx)("div",{ref:i,style:o,...r,...s,children:t})}function eX(e){var t,a,r;let{blur:i,setBlur:o,backgroundColor:R,fontSize:F,fontWeight:D,letterSpacing:E,fontFamily:T,opacity:V,lineHeight:O,text:Y,circles:J,textColor:ee,generateNewPalette:et,downloadImage:ea,isDownloading:en,previousCircles:eo,setCircles:ex,setPreviousCircles:em,setActiveTab:eu,activeTab:ep,setText:eb,setFontFamily:ej,setFontSize:ew,setFontWeight:eN,setLetterSpacing:ez,setOpacity:eI,setLineHeight:eR,setBackgroundColor:eP,setActiveColorPicker:eD,handleColorChange:eE,setActiveColorType:eT,setActiveColor:eL,updateColor:eB,fonts:eO,activeColorPicker:eX,setTextColor:eY,resolution:eq,setResolution:eZ,saturation:e_,setSaturation:eJ,contrast:eK,setContrast:eQ,brightness:e$,setBrightness:e0,backgroundImage:e1,setBackgroundImage:e2,isItalic:e5,isUnderline:e4,isStrikethrough:e3,setIsItalic:e6,setIsUnderline:e8,setIsStrikethrough:e7,numCircles:e9,setNumCircles:te,colors:tt,isSafari:ta,textShadow:tl,setTextShadow:ts,grainIntensity:tr,setGrainIntensity:ti,isUploading:tn,setIsUploading:to,textPosition:tc,setTextPosition:td,sizeMode:tx,logoImage:th,setTextMode:tm,setLogoImage:tu,textAlign:tg,setTextAlign:tf,copyImage:tp,isCopying:tb,handlePaletteChange:tv,resetPalette:tj}=e,[ty,tw]=(0,s.useState)({x:0,y:0}),[tN,tC]=(0,s.useState)(!1),[tk,tA]=(0,s.useState)(!1),tM=e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a){let e=new FileReader;e.onloadend=()=>{e2(e.result)},e.readAsDataURL(a)}},tS=e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a){let e=new FileReader;e.onloadend=()=>{tu(e.result)},e.readAsDataURL(a),tm("image")}},tz=(0,s.useMemo)(()=>eO.map(e=>(0,l.jsx)("div",{style:{fontFamily:e.name,position:"absolute",visibility:"hidden",pointerEvents:"none",fontSize:"0px"},"aria-hidden":"true",children:Y},e.name)),[eO,Y]),tI=(0,s.useRef)(null),[tR,tP]=(0,s.useState)(.4),[tF,tD]=(0,s.use
1State)(!1),tE=(0,ef.FR)((0,ef.MS)(ef.cA,{activationConstraint:{distance:0}}),(0,ef.MS)(ef.IG,{activationConstraint:{delay:250,tolerance:5}}));return(0,l.jsxs)("main",{className:"relative flex gap-2 items-center justify-center p-2 h-screen w-full",children:[(0,l.jsx)("div",{"aria-hidden":"true",className:"sr-only",children:tz}),(0,l.jsxs)("aside",{className:"flex flex-col gap-1 w-full max-w-[260px] min-w-[220px] h-full overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2 p-1 border border-primary/10 bg-secondary rounded-2xl",children:[(0,l.jsxs)("button",{className:"flex items-center gap-1 cursor-pointer p-1 hover:bg-foreground/5 transition-all duration-300 rounded-xl",onClick:()=>tD(!0),children:[(0,l.jsx)(er.default,{src:es,alt:"logo",className:"size-8",priority:!0,loading:"eager"}),(0,l.jsx)(d.A,{className:"size-4"})]}),(0,l.jsx)(eU(),{href:"https://x.com/intent/tweet?text=Check%20out%20Gradix%20-%20A%20beautiful%20%20gradient%20generator%20tool%0A%0Ahttps%3A%2F%2Fthegradix.vercel.app",target:"_blank",children:(0,l.jsx)(eg,{variant:"ghost",size:"icon",children:(0,l.jsx)(eW,{className:"size-4 "})})}),(0,l.jsx)(eH,{isOpen:tF,setIsOpen:tD,title:"Settings",className:"w-full max-w-sm bg-transparent p-2 top-0 bottom-0",direction:"left",children:(0,l.jsx)(eV,{setIsSettingsOpen:tD})})]}),(0,l.jsx)(q,{value:ep,onValueChange:e=>eu(e),className:"flex flex-col items-center w-full",children:(0,l.jsx)(Z,{className:"w-full flex items-center gap-1",children:(0,l.jsx)("div",{className:"flex items-center gap-1 w-full",children:[{id:"design",icon:x.A},{id:"effects",icon:h.A}].map(e=>{let{id:t,icon:a}=e;return(0,l.jsxs)(_,{value:t,className:n("flex-1 relative w-full px-4 py-3 cursor-pointer hover:bg-foreground
1/25 transition-all duration-300 rounded-2xl text-foreground border border-primary/10 flex items-center gap-2"),disabled:!!e1&&"colors"===t,children:[(0,l.jsx)(a,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight capitalize",children:t})]},t)})})})}),(0,l.jsxs)("section",{className:"w-full bg-secondary rounded-2xl flex flex-col no-scrollbar overflow-hidden h-full  border border-primary/10 relative",children:[(0,l.jsxs)("div",{className:"flex flex-col overflow-y-auto justify-between no-scrollbar relative h-full gap-2 p-2",children:["design"===ep&&(0,l.jsx)(eF.P.div,{className:"flex flex-col gap-8",initial:{y:10},animate:{y:0},exit:{y:-10},transition:{duration:.2,type:"spring",damping:10,stiffness:100,ease:"cubic-bezier(0.45, 0.05, 0.55, 0.95)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4 w-full",children:[(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsx)(ei,{className:n("resize-none whitespace-pre-wrap","image"===tx&&"opacity-50 cursor-not-allowed"),value:Y,onChange:e=>eb(e.target.value),placeholder:"Enter text",disabled:"image"===tx})}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("div",{className:"flex items-center justify-center",children:(0,l.jsx)("span",{className:"bg-secondary px-2 text-xs text-muted-foreground",children:"or"})}),(0,l.jsxs)("div",{className:"relative flex flex-col gap-2 pt-2",children:[(0,l.jsxs)("label",{className:"px-4 py-2 bg-foreground
1/5 rounded-xl hover:text-foreground/80 text-primary transition-all duration-300 flex items-center gap-2 cursor-pointer justify-center border border-primary/10  ".concat(tn?"opacity-50 cursor-not-allowed":""),children:[(0,l.jsx)(c,{type:"file",accept:"image/*",onChange:async e=>{if(!tn){to(!0);try{await tS(e)}finally{to(!1),e.target.value=""}}},className:"hidden",disabled:tn}),tn?(0,l.jsx)("span",{className:"animate-pulse",children:"Uploading..."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight",children:th?"Change Image":"Upload Image"})]})]}),th&&(0,l.jsxs)(eg,{onClick:()=>{tu(null),tm("text"),ew(10)},variant:"destructive",children:[(0,l.jsx)(u.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight ml-2",children:"Remove Image"})]})]})]}),(0,l.jsx)(eh,{className:"my-2"}),"text"===tx&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Color"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 w-full relative",children:[(0,l.jsxs)(K,{children:[(0,l.jsx)(Q,{asChild:!0,children:(0,l.jsx)("span",{className:"w-6 h-6 rounded-full cursor-pointer aspect-square border border-primary/10 absolute left-2 top-1/2 -translate-y-1/2",style:{backgroundColor:ee}})}),(0,l.jsx)($,{className:"w-auto p-3",align:"start",children:(0,l.jsx)(X.jI,{color:eX,onChange:e=>{eT("text"),eD(e),eE(e)}})})]}),(0,l.jsx)(c,{className:"pl-10",type:"text",value:ee.startsWith("#")?ee:"#".concat(ee),placeholder:"Color",onChange:e=>{eY(e.target.value.startsWith("#")?e.target.value:"#".concat(e.target.value))}})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Font"}),(0,l.jsxs)(L,{value:T,onValueChange:ej,children:[(0,l.jsx)(W,{children:(0,l.jsx)(U,{placeholder:"Select font"})}),(0,l.jsx)(H,{children:(0,l.jsx)(B,{children:eO.map(e=>(0,l.jsx)(G,{value:e.name,children:e.name},e.name))})})]})]})]}),"text"===tx&&(0,l.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Decoration"}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-1",children:[(0,l.jsx)(eg,{onClick:()=>tf("left"),className:n("left"===tg?"bg-primary/20":"bg-background/5"),children:(0,l.jsx)(g.A,{className:"size-4"})}),(0,l.jsx)(eg,{onClick:()=>tf("center"),className:n("center"===tg?"bg-primary/20":"bg-background/5"),children:(0,l.jsx)(f.A,{className:"size-4"})}),(0,l.jsx)(eg,{onClick:()=>tf("right"),className:n("right"===tg?"bg-primary/20":"bg-background/5"),children:(0,l.jsx)(p.A,{className:"size-4"})}),(0,l.jsx)(eg,{onClick:()=>e6(!e5),className:n(e5?"bg-primary/20 ":"bg-background/5"),children:(0,l.jsx)(b.A,{className:"size-4"})}),(0,l.jsx)(eg,{onClick:()=>e8(!e4),className:n(e4?"bg-primary/20 ":"bg-background/5"),children:(0,l.jsx)(v.A,{className:"size-4 mx-auto"})}),(0,l.jsx)(eg,{onClick:()=>e7(!e3),className:n(e3?"bg-primary/20":"bg-background/5"),children:(0,l.jsx)(j.A,{className:"size-4"})})]})]}),(0,l.jsx)(P,{label:"Size",min:"text"===tx?0:10,max:"text"===tx?20:100,step:"text"===tx?.1:1,value:[F],onValueChange:e=>{let[t]=e;return ew(t)},valueSubtext:"text"===tx?"em":"%"}),"text"===tx&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsx)(P,{label:"Weight",min:100,max:900,step:100,value:[D],onValueChange:e=>{let[t]=e;return eN(t)},disabled:!(null===(t=eO.find(e=>e.name===T))||void 0===t?void 0:t.variable),className:n(!(null===(a=eO.find(e=>e.name===T))||void 0===a?void 0:a.variable)&&"cursor-not-allowed")})}),(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsx)(P,{label:"Tracking",min:-.1,max:.1,step:.01,value:[E],onValueChange:e=>{let[t]=e;return ez(t)},valueSubtext:"em"})}),(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsx)(P,{label:"Leading",min:.5,max:2,step:.1,value:[O],onValueChange:e=>{let[t]=e;return eR(t)},valueSubtext:"em"})})]}),(0,l.jsx)(P,{label:"Opacity",min:0,max:100,step:1,value:[V],onValueChange:e=>{let[t]=e;return eI(t)}})]})},ep),"effects"===ep&&(0,l.jsx)(eF.P.div,{className:"flex flex-col gap-8",initial:{y:10},animate:{y:0},exit:{y:-10},transition:{duration:.2,type:"spring",damping:10,stiffness:100,ease:"cubic-bezier(0.45, 0.05, 0.55, 0.95)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(P,{label:"Blur",min:e1?0:400,max:ta?800:1200,step:20,value:[i],valueSubtext:"px",onValueChange:e=>{let[t]=e;return o(t)}}),!ta&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsx)(P,{label:"Grain",min:0,max:100,step:1,value:[tr],onValueChange:e=>{let[t]=e;ti(t)}})})}),(0,l.jsx)(eh,{className:"my-2"}),(0,l.jsx)(P,{label:"Saturation",min:0,max:200,step:1,value:[e_],onValueChange:e=>{let[t]=e;return eJ(t)}}),(0,l.jsx)(P,{label:"Contrast",min:5,max:200,step:1,value:[eK],onValueChange:e=>{let[t]=e;return eQ(t)}}),(0,l.jsx)(P,{label:"Brightness",min:10,max:200,step:1,value:[e$],onValueChange:e=>{let[t]=e;return e0(t)}}),(0,l.jsx)(eh,{className:"my-2"}),(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Glow"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 w-full relative",children:[(0,l.jsxs)(K,{children:[(0,l.jsx)(Q,{asChild:!0,children:(0,l.jsx)("span",{className:"w-6 h-6 rounded-full cursor-pointer aspect-square border border-primary/10 absolute left-2 top-1/2 -translate-y-1/2",style:{backgroundColor:tl.color}})}),(0,l.jsx)($,{className:"w-auto p-3",align:"start",children:(0,l.jsx)(X.jI,{color:tl.color,onChange:e=>ts(t=>({...t,color:e}))})})]}),(0,l.jsx)(c,{className:"pl-10",type:"text",value:tl.color.startsWith("#")?tl.color:"#".concat(tl.color),placeholder:"Glow Color",onChange:e=>{let t=e.target.value.startsWith("#")?e.target.value:"#".concat(e.target.value);ts(e=>({...e,color:t}))}})]}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:(0,l.jsx)(P,{label:"Intensity",min:0,max:100,step:1,value:[tl.blur],onValueChange:e=>{let[t]=e;return ts(e=>({...e,blur:t}))},valueSubtext:"%"})}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:(0,l.jsx)(P,{label:"Offset X",min:-20,max:20,step:1,value:[tl.offsetX],onValueChange:e=>{let[t]=e;return ts(e=>({...e,offsetX:t}))}})}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:(0,l.jsx)(P,{label:"Offset Y",min:-20,max:20,step:1,value:[tl.offsetY],onValueChange:e=>{let[t]=e;return ts(e=>({...e,offsetY:t}))}})})]})},ep)]}),(0,l.jsxs)("div",{className:"flex w-full gap-2 p-2 sticky bottom-0  border-t border-primary/10  z-10",children:[(0,l.jsxs)(eg,{className:"flex items-center w-full",variant:"accent",onClick:ea,disabled:en,children:[(0,l.jsx)(y.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-sm",children:"Download"})]}),(0,l.jsx)(eg,{onClick:tp,disabled:tb,className:"w-fit",children:(0,l.jsx)(w.A,{className:"size-4"})})]})]})]}),(0,l.jsxs)("section",{ref:tI,className:"flex flex-col gap-4 w-full h-full items-center justify-center relative bg-secondary rounded-2xl border border-primary/10 overflow-hidden",children:[(0,l.jsxs)("div",{className:"absolute bottom-4 right-0 left-0 flex items-center gap-2 z-10 justify-center",children:[(0,l.jsxs)(eg,{variant:"accent",className:"w-fit",onClick:()=>
1{if(!localStorage.getItem("generate-warning-seen")){tA(!0);return}tv(),e2(null),0===i&&o(600),tC(!0),setTimeout(()=>{tC(!1)},2e3)},disabled:tN,children:[(0,l.jsx)(N.A,{className:"size-5"}),"Generate"]}),(0,l.jsxs)(eg,{className:"w-fit",onClick:()=>{et(),tC(!0),setTimeout(()=>{tC(!1)},2e3)},disabled:e9>=10,children:[(0,l.jsx)(C.A,{className:"size-5"}),"Shuffle"]}),(0,l.jsx)(eg,{onClick:()=>tP(e=>Math.min(e+.1,2)),className:"w-fit",children:(0,l.jsx)(k.A,{className:"size-5"})}),(0,l.jsx)(eg,{onClick:()=>tP(e=>Math.max(e-.1,.1)),className:"w-fit",children:(0,l.jsx)(A.A,{className:"size-5"})}),(0,l.jsx)(eg,{disabled:0===eo.length,className:"w-fit",onClick:()=>{e2(null),eo.length>0&&(ex(eo),em([]))},children:e1?(0,l.jsx)(u.A,{className:"size-5"}):(0,l.jsx)(M.A,{className:"size-5"})})]}),(0,l.jsx)(ef.Mp,{sensors:tE,onDragEnd:e=>{let{delta:t}=e;t&&tw(e=>({x:e.x+t.x,y:e.y+t.y}))},children:(0,l.jsx)("div",{className:"rounded-2xl overflow-hidden w-full h-full flex items-center justify-center relative ",children:(0,l.jsx)(eG,{id:"preview",children:(0,l.jsx)("div",{className:"relative overflow-hidden rounded-2xl cursor-grab active:cursor-grabbing",style:{height:eq.height*tR,width:eq.width*tR,transform:"translate(".concat(ty.x,"px, ").concat(ty.y,"px)")},children:(0,l.jsx)("div",{id:"wallpaper",style:{width:"".concat(eq.width,"px"),height:"".concat(eq.height,"px"),transform:"scale(".concat(tR,")"),transformOrigin:"top left",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden"},children:tN?(0,l.jsx)("div",{className:"absolute inset-0 bg-background z-50 flex items-center justify-center",children:(0,l.jsx)(N.A,{className:"size-16 text-primary animate-ping"})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ec,{}),(0,l.jsx)("div",{className:"absolute inset-0 flex items-center justify-center z-40",children:"text"===tx?(0,l.jsx)("p",{style:{fontSize:"".concat(F,"em"),fontWeight:D,letterSpacing:"".concat(E,"em"),fontFamily:T,opacity:V/100,lineHeight:O,color:ee,fontStyle:e5?"italic":"normal",textDecoration:"".concat(e4?"underline":""," ").concat(e3?"line-through":"").trim(),textShadow:"".concat(tl.offsetX,"px ").concat(tl.offsetY,"px ").concat(tl.blur,"px ").concat(tl.color),transform:"translate(".concat(tc.x,"px, ").concat(tc.y,"px)"),whiteSpace:"pre-wrap",textWrap:"nowrap",textAlign:tg},className:"transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]",children:Y}):th&&(0,l.jsx)("img",{src:th,className:"transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]",alt:"Logo",style:{maxWidth:"".concat(F,"%"),maxHeight:"".concat(F,"%"),opacity:V/100,transform:"translate(".concat(tc.x,"px, ").concat(tc.y,"px)"),filter:"drop-shadow(".concat(tl.offsetX,"px ").concat(tl.offsetY,"px ").concat(tl.blur,"px ").concat(tl.color,")")}})})]})})})})})})]}),(0,l.jsxs)("aside",{className:"flex flex-col gap-2 w-full max-w-[260px] min-w-[200px] h-full overflow-hidden",children:[(0,l.jsx)("div",{className:"flex flex-col gap-2",children:(0,l.jsxs)(K,{children:[(0,l.jsx)(Q,{asChild:!0,children:(0,l.jsx)(eg,{className:"w-full flex",children:(0,l.jsxs)("div",{className:"flex items-center gap-2 justify-between w-full",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"w-full min-w-4 min-h-4 border border-primary rounded",style:{aspectRatio:"".concat(eq.width,"/").concat(eq.height)}}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("p",{className:"text-sm tracking-tight text-left",children:(null===(r=el.find(e=>e.width===eq.width&&e.height===eq.height))||void 0===r?void 0:r.name)||"Custom"}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground text-left",children:[eq.width,"x",eq.height]})]})]}),(0,l.jsx)(S.A,{className:"size-4 transition-all duration-300"})]})})}),(0,l.jsxs)($,{className:"max-w-lg w-full border border-primary/10 bg-secondary p-0 h-[400px] overflow-y-auto no-scrollbar roun
1ded-2xl",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b border-primary/10 sticky top-0 bg-secondary",children:[(0,l.jsxs)("div",{className:"flex flex-col w-full gap-1 relative",children:[(0,l.jsx)("label",{className:"text-xs text-muted-foreground absolute top-1/2 left-3 -translate-y-1/2",children:"W:"}),(0,l.jsx)(c,{className:"pl-8",type:"number",min:0,max:2560,defaultValue:eq.width,onChange:e=>{let t=parseInt(e.target.value);if(t>2560){ed.oR.error("Maximum width is 2560px");return}e.target.value=t.toString()},id:"width-input"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1 w-full relative",children:[(0,l.jsx)("label",{className:"text-xs text-muted-foreground absolute top-1/2 left-3 -translate-y-1/2",children:"H:"}),(0,l.jsx)(c,{className:"pl-8",type:"number",min:0,max:2560,defaultValue:eq.height,onChange:e=>{let t=parseInt(e.target.value);if(t>2560){ed.oR.error("Maximum height is 2560px");return}e.target.value=t.toString()},id:"height-input"})]}),(0,l.jsx)(eg,{className:"w-fit",variant:"accent",onClick:()=>{let e=parseInt(document.getElementById("width-input").value),t=parseInt(document.getElementById("height-input").value);if(e>2560||t>2560){ed.oR.error("Maximum dimensions are 2560px");return}eZ({width:e,height:t})},children:"Apply"})]}),(0,l.jsx)("div",{className:"flex flex-col gap-6 p-4",children:Array.from(new Set(el.map(e=>e.category))).map(e=>(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:e}),(0,l.jsx)("div",{className:"grid grid-cols-3 gap-2",children:el.filter(t=>t.category===e).map(e=>(0,l.jsx)("div",{onClick:()=>eZ({width:e.width,height:e.height}),className:"flex flex-col items-center gap-4 cursor-pointer bg-foreground
1/5 rounded-xl p-2 border border-primary/10 hover:bg-foreground/10 transition-all duration-300 justify-between",children:(0,l.jsxs)("div",{className:"flex flex-col gap-2 items-center",children:[(0,l.jsx)("p",{className:"tracking-tight text-left font-medium",children:e.name}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["(",e.width,"x",e.height,")"]})]})},e.name))})]},e))})]})]})}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 overflow-y-auto h-full no-scrollbar rounded-2xl bg-secondary border border-primary/10 p-2",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Background"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 relative",children:[(0,l.jsxs)(K,{children:[(0,l.jsx)(Q,{asChild:!0,children:(0,l.jsx)("span",{className:"w-6 h-6 rounded-full cursor-pointer aspect-square border border-primary/10 absolute left-2 top-1/2 -translate-y-1/2",style:{backgroundColor:R}})}),(0,l.jsx)($,{className:"w-auto p-3",align:"start",children:(0,l.jsx)(X.jI,{color:eX,onChange:e=>{eT("background"),eD(e),eP(e)}})})]}),(0,l.jsx)(c,{type:"text",value:R.startsWith("#")?R:"#".concat(R),placeholder:"Background Color",onChange:e=>{eP(e.target.value.startsWith("#")?e.target.value:"#".concat(e.target.value))},className:n("resize-none pl-10",e1&&"opacity-50 cursor-not-allowed"),disabled:!!e1})]})]})}),(0,l.jsx)("div",{className:"flex items-center justify-center",children:(0,l.jsx)("span",{className:"bg-secondary px-2 text-xs text-muted-foreground",children:"or"})}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsxs)("label",{className:"px-4 py-2 bg-foreground
1/5 rounded-xl hover:text-foreground/80 text-primary transition-all duration-300 flex items-center gap-2 cursor-pointer justify-center border border-primary/10 ".concat(tn?"opacity-50 cursor-not-allowed":""),children:[(0,l.jsx)(c,{type:"file",accept:"image/*",onChange:async e=>{if(!tn){to(!0);try{await tM(e)}finally{to(!1),e.target.value=""}}},className:"hidden",disabled:tn},e1?"has-image":"no-image"),tn?(0,l.jsx)("span",{className:"animate-pulse",children:"Uploading..."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight",children:e1?"Change Image":"Upload Image"})]})]}),e1&&(0,l.jsxs)(eg,{onClick:()=>{e2(null),0===i&&o(600)},className:"rounded-xl mt-2 w-full",variant:"destructive",children:[(0,l.jsx)(u.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight",children:"Remove Image"})]})]})]}),!e1&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eh,{className:"my-2"}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 justify-between",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Palette"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(eg,{variant:"ghost",className:"p-0",onClick:()=>{let e={color:tt[J.length%tt.length],cx:100*Math.random(),cy:100*Math.random()};ex([...J,e]),te(J.length+1)},disabled:e9>=10,children:(0,l.jsx)(z.A,{className:"size-4"})}),(0,l.jsx)(eg,{variant:"ghost",className:"p-0",onClick:tj,children:(0,l.jsx)(I.A,{className:"size-4"})})]})]}),J.map((e,t)=>(0,l.jsx)("div",{className:"flex items-start gap-2 relative w-full",children:(0,l.jsx)("div",{className:"flex items-center gap-2 w-full",onClick:()=>{eT("gradient"),eL(t),eD(e.color)},children:(0,l.jsxs)("div",{className:"flex items-center gap-2 relative w-full",children:[(0,l.jsxs)(K,{children:[(0,l.jsx)(Q,{asChild:!0,children:(0,l.jsx)("span",{className:"w-6 h-6 rounded-full cursor-pointer aspect-square border border-primary/10 absolute left-2 top-1/2 -translate-y-1/2",style:{backgroundColor:e.color}})}),(0,l.jsx)($,{className:"w-auto p-3",align:"start",children:(0,l.jsx)(X.jI,{color:eX,onChange:e=>{eD(e),eE(e)}})})]}),(0,l.jsx)(c,{type:"text",value:e.color.startsWith("#")?e.color:"#".concat(e.color),className:"w-full pl-10 pr-4",placeholder:"Color",onChange:e=>{eB(e.target.value.startsWith("#")?e.target.value:"#".concat(e.target.value),t)}}),(0,l.jsx)("button",{className:"absolute right-2 top-1/2 -translate-y-1/2 cursor-pointer",onClick:()=>{ex(J.filter((e,a)=>a!==t)),te(J.length-1)},children:(0,l.jsx)(u.A,{className:"size-4 text-muted-foreground hover:text-destructive transition-all duration-300"})})]})})},t))]})]})]}),(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full bg-secondary rounded-2xl p-4 border border-primary/10",children:(0,l.jsx)(ev,{value:tc,onChange:td,width:eq.width,height:eq.height,className:"max-w-[140px] max-h-[140px]"})})]}),(0,l.jsx)(ey,{open:tk,onOpenChange:tA,children:(0,l.jsxs)(eC,{children:[(0,l.jsxs)(ek,{children:[(0,l.jsx)(eM,{children:"Generate New Colors"}),(0,l.jsx)(eS,{children:"Clicking generate will reset all the colors and create a fresh set of colors."})]}),(0,l.jsxs)(eA,{children:[(0,l.jsx)(eg,{variant:"secondary",onClick:()=>tA(!1),children:"Cancel"}),(0,l.jsx)(eg,{variant:"accent",onClick:()=>{localStorage.setItem("generate-warning-seen","true"),tA(!1),tv(),e2(null),0===i&&o(600),tC(!0),setTimeout(()=>{tC(!1)},2e3)},children:"Generate"})]})]})})]})}var eY=a(3832),eq=a(4834),eZ=a(6703),e_=a(3635);function eJ(e){let{children:t,id:a}=e,{attributes:s,listeners:r,setNodeRef:i,transform:n}=(0,ef.PM)({id:a}),o=n?{transform:"translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)")}:void 0;return(0,l.jsx)("div",{ref:i,style:o,...r,...s,children:t})}function eK(e){var t,a,r;let{blur:i,setBlur:o,backgroundColor:R,fontSize:F,fontWeight:D,letterSpacing:E,fontFamily:T,opacity:V,lineHeight:O,text:Y,circles:J,textColor:et,generateNewPalette:ea,downloadImage:en,isDownloading:eo,previousCircles:ex,setCircles:em,setPreviousCircles:eu,setActiveTab:ep,activeTab:eb,setText:ej,setFontFamily:ew,setFontSize:eN,setFontWeight:ez,setLetterSpacing:eI,setOpacity:eR,setLineHeight:eP,setBackgroun
1dColor:eD,setActiveColorPicker:eE,handleColorChange:eT,setActiveColorType:eL,setActiveColor:eB,updateColor:eU,fonts:eW,activeColorPicker:eO,setTextColor:eG,resolution:eX,setResolution:eK,saturation:eQ,setSaturation:e$,contrast:e0,setContrast:e1,brightness:e2,setBrightness:e5,backgroundImage:e4,setBackgroundImage:e3,isItalic:e6,isUnderline:e8,isStrikethrough:e7,setIsItalic:e9,setIsUnderline:te,setIsStrikethrough:tt,numCircles:ta,setNumCircles:tl,colors:ts,isSafari:tr,textShadow:ti,setTextShadow:tn,grainIntensity:to,setGrainIntensity:tc,isUploading:td,setIsUploading:tx,textPosition:th,setTextPosition:tm,sizeMode:tu,logoImage:tg,setTextMode:tf,setLogoImage:tp,textAlign:tb,setTextAlign:tv,copyImage:tj,isCopying:ty,handlePaletteChange:tw,resetPalette:tN}=e,[tC,tk]=(0,s.useState)({x:0,y:0}),[tA,tM]=(0,s.useState)(.2),tS=(0,s.useRef)(null),[tz,tI]=(0,s.useState)(!1),[tR,tP]=(0,s.useState)(!1),[tF,tD]=(0,s.useState)(!1),[tE,tT]=(0,s.useState)(!1),[tL,tB]=(0,s.useState)(!1),tU=e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a){let e=new FileReader;e.onloadend=()=>{e3(e.result)},e.readAsDataURL(a)}};(0,e_.useGesture)({onPinch:e=>{let{offset:[t],event:a}=e;a.preventDefault(),tM(Math.min(Math.max(.1,t/50),2))},onDrag:e=>{let{delta:[t,a]}=e;tk(e=>({x:e.x+t,y:e.y+a}))}},{target:tS,eventOptions:{passive:!1}});let tW=e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a){let e=new FileReader;e.onloadend=()=>{e3(e.result)},e.readAsDataURL(a)}},tV=(0,s.useMemo)(()=>eW.map(e=>(0,l.jsx)("div",{style:{fontFamily:e.name,position:"absolute",visibility:"hidden",pointerEvents:"none",fontSize:"0px"},"aria-hidden":"true",children:Y},e.name)),[eW,Y]),tO=(0,ef.FR)((0,ef.MS)(ef.cA,{activationConstraint:{distance:0}}),(0,ef.MS)(ef.IG,{activationConstraint:{delay:250,tolerance:5}}));return(0,l.jsxs)("main",{className:"relative flex flex-col gap-2 items-center justify-center h-[100dvh] w-full",children:[(0,l.jsx)("div",{"aria-hidden":"true",className:"sr-only",children:tV}),(0,l.jsxs)("nav",{className:"flex items-center gap-2 px-4 py-4 w-full justify-between",children:[(0,l.jsx)("div",{className:"flex items-center gap-2 justify-between",children:(0,l.jsxs)("div",{className:"flex items-center justify-between group",children:[(0,l.jsxs)("button",{className:"flex items-center gap-1",onClick:()=>tP(!0),children:[(0,l.jsx)(er.default,{src:es,alt:"logo",className:"size-10",priority:!0,loading:"eager"}),(0,l.jsx)(d.A,{className:"size-6"})]}),(0,l.jsx)(eH,{title:"Settings",isOpen:tR,setIsOpen:tP,className:"w-full max-w-[80vw] h-full p-2 bg-transparent",children:(0,l.jsx)(eV,{setIsSettingsOpen:tP})})]})}),(0,l.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,l.jsxs)(eg,{onClick:en,disabled:eo,variant:"accent",children:[(0,l.jsx)(y.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight",children:"Download"})]}),(0,l.jsx)(eg,{onClick:tj,disabled:ty,className:"w-fit",children:(0,l.jsx)(w.A,{className:"size-4"})})]})]}),(0,l.jsxs)("section",{className:"flex flex-col gap-4 w-full h-full items-center justify-center relative touch-none overflow-hidden px-2 ",children:[(0,l.jsx)(ef.Mp,{sensors:tO,onDragEnd:e=>{let{delta:t}=e;t&&tk(e=>({x:e.x+t.x,y:e.y+t.y}))},children:(0,l.jsx)("div",{className:"rounded-2xl overflow-hidden w-full h-full flex items-center justify-center relative cursor-grab active:cursor-grabbing border border-primary/10",ref:tS,children:(0,l.jsx)(eJ,{id:"preview",children:(0,l.jsx)("div",{className:"relative overflow-hidden rounded-2xl",style:{height:eX.height*tA,width:eX.width*tA,transform:"translate(".concat(tC.x,"px, ").concat(tC.y,"px)")},children:(0,l.jsxs)("div",{id:"wallpaper",style:{width:"".concat(eX.width,"px"),height:"".concat(eX.height,"px"),transform:"scale(".concat(tA,")"),transformOrigin:"top left",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden"},children:[tE&&(0,l.jsx)("div",{className:"absolute inset-0 bg-secondary z-50 flex items-center justify-center",children:(0,l.jsx)(N.A,{className:"size-8 text-primary animate-ping"})}),(0,l.jsx)(ec,{}),(0,l.jsx)("div",{className:"absolute inset-0 flex items-center justify-center z-40",children:"text"===tu?(0,l.jsx)("p",{style:{fontSize:"".concat(F,"em"),fontWeight:D,letterSpacing:"".concat(E,"em"),fontFamily:T,opacity:V/100,lineHeight:O,color:et,fontStyle:e6?"italic":"normal",textDecoration:"".concat(e8?"underline":""," ").concat(e7?"line-through":"").trim(),textShadow:"".concat(ti.offsetX,"px ").concat(ti.offsetY,"px ").concat(ti.blur,"px ").concat(ti.color),transform:"translate(".concat(th.x,"px, ").concat(th.y,"px)"),whiteSpace:"pre-wrap",textAlign:tb}
1,className:"transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]",children:Y}):tg&&(0,l.jsx)(er.default,{className:"transition-all duration-300 ease-[cubic-bezier(0.45, 0.05, 0.55, 0.95)]",unoptimized:!0,src:tg,alt:"Logo",style:{maxWidth:"".concat(F,"%"),maxHeight:"".concat(F,"%"),opacity:V/100,transform:"translate(".concat(th.x,"px, ").concat(th.y,"px)"),filter:"drop-shadow(".concat(ti.offsetX,"px ").concat(ti.offsetY,"px ").concat(ti.blur,"px ").concat(ti.color,")")}})})]})})})})}),(0,l.jsxs)("div",{className:"absolute bottom-0 right-0 left-0 flex items-end gap-2 z-10 justify-between px-4 py-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(eg,{variant:"accent",className:"w-fit",onClick:()=>{if(!localStorage.getItem("generate-warning-seen")){tB(!0);return}tw(),e3(null),0===i&&o(600),tT(!0),setTimeout(()=>{tT(!1)},1e3)},disabled:tE,children:[(0,l.jsx)(N.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight",children:"Generate"})]}),(0,l.jsxs)(eg,{className:"w-fit",onClick:()=>{ea(),tT(!0),setTimeout(()=>{tT(!1)},2e3)},disabled:ta>=10,children:[(0,l.jsx)(C.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight",children:"Shuffle"})]}),(0,l.jsx)(eg,{disabled:0===ex.length,className:"w-fit",onClick:()=>{e3(null),ex.length>0&&(em(ex),eu([]))},children:e4?(0,l.jsx)(u.A,{className:"size-4"}):(0,l.jsx)(M.A,{className:"size-4"})})]}),(0,l.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,l.jsx)(eg,{onClick:()=>tM(e=>Math.min(e+.05,2)),className:"w-fit",children:(0,l.jsx)(k.A,{className:"size-4"})}),(0,l.jsx)(eg,{onClick:()=>tM(e=>Math.max(e-.05,.1)),className:"w-fit",children:(0,l.jsx)(A.A,{className:"size-4"})}),(0,l.jsx)(eg,{className:"w-fit",onClick:()=>tI(!0),children:(0,l.jsx)(eY.A,{className:"size-4"})})]}),(0,l.jsx)(eH,{isOpen:tz,setIsOpen:tI,title:"Position",direction:"bottom",showHandle:!0,className:"max-h-[50dvh] rounded-t-xl",children:(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full p-4",children:(0,l.jsx)(ev,{value:th,onChange:tm,width:eX.width,height:eX.height,className:"max-w-[280px] max-h-[280px]"})})})]})]}),(0,l.jsxs)("aside",{className:"flex flex-col gap-2 w-full",children:[(0,l.jsx)("section",{className:"px-2",children:(0,l.jsx)("div",{className:"w-full flex flex-col max-h-[240px] min-h-[180px] rounded-2xl bg-secondary border border-primary/10",children:(0,l.jsx)("div",{className:"flex flex-col overflow-y-auto justify-between no-scrollbar relative h-full gap-2 p-4",children:(0,l.jsxs)(s.Suspense,{fallback:(0,l.jsx)("div",{children:"Loading..."}),children:["design"===eb&&(0,l.jsx)(eF.P.div,{className:"flex flex-col gap-8",initial:{y:10},animate:{y:0},exit:{y:-10},transition:{duration:.2,type:"spring",damping:10,stiffness:100,ease:"cubic-bezier(0.45, 0.05, 0.55, 0.95)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4 w-full",children:[(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsx)(ei,{className:n("resize-none whitespace-pre-wrap","image"===tu&&"opacity-50 cursor-not-allowed"),value:Y,onChange:e=>ej(e.target.value),placeholder:"Enter text",disabled:"image"===tu})}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("div",{className:"absolute inset-x-0 -top-3 flex items-center justify-center",children:(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"or"})}),(0,l.jsxs)("div",{className:"relative flex flex-col gap-2 pt-2",children:[(0,l.jsxs)("label",{className:"px-4 py-2 bg-foreground
1/5 rounded-xl hover:text-foreground/80 text-primary transition-all duration-300 flex items-center gap-2 cursor-pointer justify-center border border-primary/10  ".concat(td?"opacity-50 cursor-not-allowed":""),children:[(0,l.jsx)(c,{type:"file",accept:"image/*",onChange:async e=>{if(!td){tx(!0);try{await tW(e)}finally{tx(!1),e.target.value=""}}},className:"hidden",disabled:td}),td?(0,l.jsx)("span",{className:"animate-pulse",children:"Uploading..."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight",children:tg?"Change Image":"Upload Image"})]})]}),tg&&(0,l.jsxs)(eg,{onClick:()=>{tp(null),tf("text"),eN(10)},variant:"destructive",children:[(0,l.jsx)(u.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight ml-2",children:"Remove Image"})]})]})]}),(0,l.jsx)(eh,{className:"my-2"}),"text"===tu&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Color"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 w-full relative",children:[(0,l.jsxs)(K,{children:[(0,l.jsx)(Q,{asChild:!0,children:(0,l.jsx)("span",{className:"w-6 h-6 rounded-full cursor-pointer aspect-square border border-primary/10 absolute left-2 top-1/2 -translate-y-1/2",style:{backgroundColor:et}})}),(0,l.jsx)($,{className:"w-auto p-3",align:"start",children:(0,l.jsx)(X.jI,{color:eO,onChange:e=>{eL("text"),eE(e),eT(e)}})})]}),(0,l.jsx)(c,{className:"pl-10",type:"text",value:et.startsWith("#")?et:"#".concat(et),placeholder:"Color",onChange:e=>{eG(e.target.value.startsWith("#")?e.target.value:"#".concat(e.target.value))}})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Font"}),(0,l.jsxs)(L,{value:T,onValueChange:ew,children:[(0,l.jsx)(W,{children:(0,l.jsx)(U,{placeholder:"Select font"})}),(0,l.jsx)(H,{children:(0,l.jsx)(B,{children:eW.map(e=>(0,l.jsx)(G,{value:e.name,children:e.name},e.name))})})]})]})]}),(0,l.jsx)(P,{label:"Size",min:"text"===tu?0:10,max:"text"===tu?20:100,step:"text"===tu?.1:1,value:[F],onValueChange:e=>{let[t]=e;return eN(t)},valueSubtext:"text"===tu?"em":"%"}),"text"===tu&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsx)(P,{label:"Weight",min:100,max:900,step:100,value:[D],onValueChange:e=>{let[t]=e;return ez(t)},disabled:!(null===(t=eW.find(e=>e.name===T))||void 0===t?void 0:t.variable),className:n(!(null===(a=eW.find(e=>e.name===T))||void 0===a?void 0:a.variable)&&"cursor-not-allowed")})}),(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsx)(P,{label:"Tracking",min:-.1,max:.1,step:.01,value:[E],onValueChange:e=>{let[t]=e;return eI(t)},valueSubtext:"em"})}),(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsx)(P,{label:"Leading",min:.5,max:2,step:.1,value:[O],onValueChange:e=>{let[t]=e;return eP(t)},valueSubtext:"em"})})]}),(0,l.jsx)(P,{label:"Opacity",min:0,max:100,step:1,value:[V],onValueChange:e=>{let[t]=e;return eR(t)}}),"text"===tu&&(0,l.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Decoration"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar roun
1ded-xl",children:[(0,l.jsx)(eg,{onClick:()=>tv("left"),className:n("left"===tb?"bg-primary/20":"bg-background/5"),children:(0,l.jsx)(g.A,{className:"size-4"})}),(0,l.jsx)(eg,{onClick:()=>tv("center"),className:n("center"===tb?"bg-primary/20":"bg-background/5"),children:(0,l.jsx)(f.A,{className:"size-4"})}),(0,l.jsx)(eg,{onClick:()=>tv("right"),className:n("right"===tb?"bg-primary/20":"bg-background/5"),children:(0,l.jsx)(p.A,{className:"size-4"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar rounded-xl",children:[(0,l.jsx)(eg,{onClick:()=>e9(!e6),className:n(e6?"bg-primary/20 ":"bg-background/5"),children:(0,l.jsx)(b.A,{className:"size-4"})}),(0,l.jsx)(eg,{onClick:()=>te(!e8),className:n(e8?"bg-primary/20 ":"bg-background/5"),children:(0,l.jsx)(v.A,{className:"size-4 mx-auto"})}),(0,l.jsx)(eg,{onClick:()=>tt(!e7),className:n(e7?"bg-primary/20":"bg-background/5"),children:(0,l.jsx)(j.A,{className:"size-4"})})]})]})]})},eb),"effects"===eb&&(0,l.jsx)(eF.P.div,{className:"flex flex-col gap-8",initial:{y:10},animate:{y:0},exit:{y:-10},transition:{duration:.2,type:"spring",damping:10,stiffness:100,ease:"cubic-bezier(0.45, 0.05, 0.55, 0.95)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(P,{label:"Blur",min:e4?0:400,max:tr?800:1200,step:20,value:[i],valueSubtext:"px",onValueChange:e=>{let[t]=e;return o(t)}}),!tr&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsx)(P,{label:"Grain",min:0,max:100,step:1,value:[to],onValueChange:e=>{let[t]=e;tc(t)}})})}),(0,l.jsx)(eh,{className:"my-2"}),(0,l.jsx)(P,{label:"Saturation",min:0,max:200,step:1,value:[eQ],onValueChange:e=>{let[t]=e;return e$(t)}}),(0,l.jsx)(P,{label:"Contrast",min:5,max:200,step:1,value:[e0],onValueChange:e=>{let[t]=e;return e1(t)}}),(0,l.jsx)(P,{label:"Brightness",min:10,max:200,step:1,value:[e2],onValueChange:e=>{let[t]=e;return e5(t)}}),(0,l.jsx)(eh,{className:"my-2"}),(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Glow"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 w-full relative",children:[(0,l.jsxs)(K,{children:[(0,l.jsx)(Q,{asChild:!0,children:(0,l.jsx)("span",{className:"w-6 h-6 rounded-full cursor-pointer aspect-square border border-primary/10 absolute left-2 top-1/2 -translate-y-1/2",style:{backgroundColor:ti.color}})}),(0,l.jsx)($,{className:"w-auto p-3",align:"start",children:(0,l.jsx)(X.jI,{color:ti.color,onChange:e=>tn(t=>({...t,color:e}))})})]}),(0,l.jsx)(c,{className:"pl-10",type:"text",value:ti.color.startsWith("#")?ti.color:"#".concat(ti.color),placeholder:"Glow Color",onChange:e=>{let t=e.target.value.startsWith("#")?e.target.value:"#".concat(e.target.value);tn(e=>({...e,color:t}))}})]}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:(0,l.jsx)(P,{label:"Intensity",min:0,max:100,step:1,value:[ti.blur],onValueChange:e=>{let[t]=e;return tn(e=>({...e,blur:t}))},valueSubtext:"%"})}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:(0,l.jsx)(P,{label:"Offset X",min:-20,max:20,step:1,value:[ti.offsetX],onValueChange:e=>{let[t]=e;return tn(e=>({...e,offsetX:t}))}})}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:(0,l.jsx)(P,{label:"Offset Y",min:-20,max:20,step:1,value:[ti.offsetY],onValueChange:e=>{let[t]=e;return tn(e=>({...e,offsetY:t}))}})})]})},eb),"canvas"===eb&&(0,l.jsxs)(eF.P.div,{className:"flex flex-col gap-8",initial:{y:10},animate:{y:0},exit:{y:-10},transition:{duration:.2,type:"spring",damping:10,stiffness:100,ease:"cubic-bezier(0.45, 0.05, 0.55, 0.95)"},children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(eg,{className:"w-full flex",onClick:()=>tD(!0),children:(0,l.jsxs)("div",{className:"flex items-center gap-2 justify-between w-full",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"w-full min-w-4 min-h-4 border border-primary rounded",style:{aspectRatio:"".concat(eX.width,"/").concat(eX.height)}}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("p",{className:"text-sm tracking-tight text-left",children:(null===(r=el.find(e=>e.width===eX.width&&e.height===eX.height))||void 0===r?void 0:r.name)||"Custom"}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground text-left",children:[eX.width,"x",eX.height]})]})]}),(0,l.jsx)(S.A,{className:"size-4 transition-all duration-300"})]})}),(0,l.jsx)(eH,{isOpen:tF,setIsOpen:tD,title:"Resolution",direction:"bottom",showHandle:!0,className:"rounded-t-xl",children:(0,l.jsxs)("div",{className:"flex flex-col h-full max-h-[85vh]",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b border-primary/10",children:[(0,l.jsxs)("div",{className:"flex flex-col w-full gap-1 relative",children:[(0,l.jsx)("label",{className:"text-xs text-muted-foreground absolute top-1/2 left-3 -translate-y-1/2",children:"W:"}),(0,l.jsx)(c,{className:"pl-8",type:"number",min:0,max:2560,defaultValue:eX.width,onChange:e=>{let t=parseInt(e.target.value);if(t>2560){ed.oR.error("Maximum width is 2560px");return}e.target.value=t.toString()},id:"width-input"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1 w-full relative",children:[(0,l.jsx)("label",{className:"text-xs text-muted-foreground absolute top-1/2 left-3 -translate-y-1/2",children:"H:"}),(0,l.jsx)(c,{className:"pl-8",type:"number",min:0,max:2560,defaultValue:eX.height,onChange:e=>{let t=parseInt(e.target.value);if(t>2560){ed.oR.error("Maximum height is 2560px");return}e.target.value=t.toString()},id:"height-input"})]}),(0,l.jsx)(eg,{className:"w-fit",variant:"accent",onClick:()=>{let e=parseInt(document.getElementById("width-input").value),t=parseInt(document.getElementById("height-input").value);if(e>2560||t>2560){ed.oR.error("Maximum dimensions are 2560px");return}eK({width:e,height:t}),tD(!1)},children:"Apply"})]}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto no-scrollbar",children:(0,l.jsx)("div",{className:"flex flex-col gap-6 p-4 pb-32",children:Array.from(new Set(el.map(e=>e.category))).map(e=>(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:e}),(0,l.jsx)("div",{className:"grid grid-cols-3 gap-2",children:el.filter(t=>t.category===e).map(e=>(0,l.jsx)("div",{onClick:()=>{eK({width:e.width,height:e.height}),tD(!1)},className:"flex flex-col items-center gap-4 cursor-pointer bg-foreground
1/5 rounded-xl p-2 border border-primary/10 hover:bg-foreground/10 transition-all duration-300 min-h-24 justify-center",children:(0,l.jsxs)("div",{className:"flex flex-col gap-2 items-center",children:[(0,l.jsx)("p",{className:"tracking-tight text-center font-medium text-sm",children:e.name}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["(",e.width,"x",e.height,")"]})]})},e.name))})]},e))})})]})})]}),(0,l.jsx)(eh,{className:"my-2"}),(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Background"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 relative",children:[(0,l.jsxs)(K,{children:[(0,l.jsx)(Q,{asChild:!0,children:(0,l.jsx)("span",{className:"w-6 h-6 rounded-full cursor-pointer aspect-square border border-primary/10 absolute left-2 top-1/2 -translate-y-1/2",style:{backgroundColor:R}})}),(0,l.jsx)($,{className:"w-auto p-3",align:"start",children:(0,l.jsx)(X.jI,{color:eO,onChange:e=>{eL("background"),eE(e),eD(e)}})})]}),(0,l.jsx)(c,{type:"text",value:R.startsWith("#")?R:"#".concat(R),placeholder:"Background Color",onChange:e=>{eD(e.target.value.startsWith("#")?e.target.value:"#".concat(e.target.value))},className:n("resize-none pl-10",e4&&"opacity-50 cursor-not-allowed"),disabled:!!e4})]})]})}),(0,l.jsx)("div",{className:"flex items-center justify-center",children:(0,l.jsx)("span",{className:"bg-secondary px-2 text-xs text-muted-foreground",children:"or"})}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsxs)("label",{className:"px-4 py-2 bg-foreground
1/5 rounded-xl hover:text-foreground/80 text-primary transition-all duration-300 flex items-center gap-2 cursor-pointer justify-center border border-primary/10 ".concat(td?"opacity-50 cursor-not-allowed":""),children:[(0,l.jsx)(c,{type:"file",accept:"image/*",onChange:async e=>{if(!td){tx(!0);try{await tU(e)}finally{tx(!1),e.target.value=""}}},className:"hidden",disabled:td},e4?"has-image":"no-image"),td?(0,l.jsx)("span",{className:"animate-pulse",children:"Uploading..."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight",children:e4?"Change Image":"Upload Image"})]})]}),e4&&(0,l.jsxs)(eg,{onClick:()=>{e3(null),0===i&&o(600)},className:"rounded-xl mt-2 w-full",variant:"destructive",children:[(0,l.jsx)(u.A,{className:"size-4"}),(0,l.jsx)("span",{className:"text-xs tracking-tight",children:"Remove Image"})]})]})]}),!e4&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eh,{className:"my-2"}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 justify-between",children:[(0,l.jsx)("label",{className:"text-sm text-muted-foreground",children:"Palette"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(eg,{variant:"ghost",className:"p-0",onClick:()=>{ea()},disabled:ta>=10,children:(0,l.jsx)(eq.A,{className:"size-4"})}),(0,l.jsx)(eg,{variant:"ghost",className:"p-0",onClick:()=>{let e={color:ts[J.length%ts.length],cx:100*Math.random(),cy:100*Math.random()};em([...J,e]),tl(J.length+1)},disabled:ta>=10,children:(0,l.jsx)(z.A,{className:"size-4"})}),(0,l.jsx)(eg,{variant:"ghost",className:"p-0",onClick:tN,disabled:ts===ee,children:(0,l.jsx)(I.A,{className:"size-4"})})]})]}),J.map((e,t)=>(0,l.jsx)("div",{className:"flex items-start gap-2 relative w-full",children:(0,l.jsx)("div",{className:"flex items-center gap-2 w-full",onClick:()=>{eL("gradient"),eB(t),eE(e.color)},children:(0,l.jsxs)("div",{className:"flex items-center gap-2 relative w-full",children:[(0,l.jsxs)(K,{children:[(0,l.jsx)(Q,{asChild:!0,children:(0,l.jsx)("span",{className:"w-6 h-6 rounded-full cursor-pointer aspect-square border border-primary/10 absolute left-2 top-1/2 -translate-y-1/2",style:{backgroundColor:e.color}})}),(0,l.jsx)($,{className:"w-auto p-3",align:"start",children:(0,l.jsx)(X.jI,{color:eO,onChange:e=>{eE(e),eT(e)}})})]}),(0,l.jsx)(c,{type:"text",value:e.color.startsWith("#")?e.color:"#".concat(e.color),className:"w-full pl-10 pr-4",placeholder:"Color",onChange:e=>{eU(e.target.value.startsWith("#")?e.target.value:"#".concat(e.target.value),t)}}),(0,l.jsx)("button",{className:"absolute right-2 top-1/2 -translate-y-1/2 cursor-pointer",onClick:()=>{em(J.filter((e,a)=>a!==t)),tl(J.length-1)},children:(0,l.jsx)(u.A,{className:"size-4 text-muted-foreground hover:text-destructive transition-all duration-300"})})]})})},t))]})]})]},eb)]})})})}),(0,l.jsx)(q,{value:eb,onValueChange:e=>ep(e),className:"flex items-center w-full border-t border-primary/10 bg-secondary",children:(0,l.jsx)(Z,{className:"w-full flex items-center gap-1",children:(0,l.jsx)("div",{className:"flex items-center gap-2 min-w-full p-2 pb-8",children:[{id:"design",icon:x.A},{id:"effects",icon:h.A},{id:"canvas",icon:eZ.A}].map(e=>{let{id:t,icon:a}=e;return(0,l.jsx)(_,{value:t,className:n("flex-1 relative w-full px-4 py-4 cursor-pointer transition-all duration-300 rounded-2xl flex flex-col items-center justify-center",eb===t&&"bg-primary/10 border border-primary/50"),children:(0,l.jsx)(a,{className:"size-4"})},t)})})})})]}),(0,l.jsx)(ey,{open:tL,onOpenChange:tB,children:(0,l.jsxs)(eC,{children:[(0,l.jsxs)(ek,{children:[(0,l.jsx)(eM,{children:"Generate New Colors"}),(0,l.jsx)(eS,{children:"Clicking generate will reset all the colors and create a fresh set of colors."})]}),(0,l.jsxs)(eA,{className:"flex flex-col gap-2",children:[(0,l.jsx)(eg,{variant:"secondary",onClick:()=>tB(!1),children:"Cancel"}),(0,l.jsx)(eg,{variant:"accent",onClick:()=>{localStorage.setItem("generate-warning-seen","true"),tB(!1),tw(),e3(null),0===i&&o(600),tT(!0),setTimeout(()=>{tT(!1)},2e3)},children:"Generate"})]})]})})]})}
1function eQ(){let[e,t]=(0,s.useState)(!1),{isSafari:a,shouldShowPWAPrompt:r,dismissPWAPrompt:i}=function(){let[e,t]=(0,s.useState)(!1),[a,l]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=navigator.userAgent.toLowerCase(),a=/iphone|ipad|ipod/.test(e)&&/safari/.test(e)&&!/crios/.test(e);t(/^((?!chrome|android).)*safari/i.test(e));let s=localStorage.getItem("pwa-prompt-dismissed");!a||s||window.matchMedia("(display-mode: standalone)").matches||l(!0)},[]),{isSafari:e,shouldShowPWAPrompt:a,dismissPWAPrompt:()=>{localStorage.setItem("pwa-prompt-dismissed","true"),l(!1)}}}(),n=eo();(0,s.useEffect)(()=>{let e=()=>{t(window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,s.useEffect)(()=>{let e=ea.find(e=>e.name===n.fontFamily);if(!(null==e?void 0:e.variable)){let t=((null==e?void 0:e.weights)||[]).reduce((e,t)=>Math.abs(t-n.fontWeight)<Math.abs(e-n.fontWeight)?t:e);n.setFontWeight(t)}},[n.fontFamily]),(0,s.useEffect)(()=>{r&&(0,ed.oR)("Install our app for the best experience",{description:"Tap the share button and select 'Add to Home Screen'",duration:1/0,closeButton:!0,onDismiss:i})},[r]);let o=async()=>{try{let e=document.querySelector("#wallpaper canvas");if(!e)return;let t=document.createElement("canvas");t.width=n.resolution.width,t.height=n.resolution.height;let l=t.getContext("2d");if(l.drawImage(e,0,0,n.resolution.width,n.resolution.height),"text"===n.sizeMode){l.save();let e="".concat(n.isItalic?"italic":""," ").concat(n.fontWeight," ").concat(16*n.fontSize,"px ").concat(n.fontFamily);l.font=e,l.fillStyle=n.textColor,l.textAlign=n.textAlign,l.textBaseline="middle",l.globalAlpha=n.opacity/100,n.textShadow.blur>0&&(l.shadowColor=n.textShadow.color,l.shadowBlur=n.textShadow.blur,l.shadowOffsetX=n.textShadow.offsetX,l.shadowOffsetY=n.textShadow.offsetY);let t=n.resolution.width/2+n.textPosition.x;"left"===n.textAlign?t=20+n.textPosition.x:"right"===n.textAlign&&(t=n.resolution.width-20+n.textPosition.x);let a=n.text.split("\n"),s=16*n.fontSize*n.lineHeight,r=a.length*s,i=n.resolution.height/2-r/2+n.textPosition.y;a.forEach((e,a)=>{let r=i+a*s+s/2;if(l.fillText(e,t,r),n.isUnderline||n.isStrikethrough){let a=l.measureText(e),s=a.width,i=r;n.isUnderline&&(i=r+a.actualBoundingBoxDescent+2),n.isStrikethrough&&(i=r);let o=t;"center"===n.textAlign?o=t-s/2:"right"===n.textAlign&&(o=t-s),l.beginPath(),l.strokeStyle=n.textColor,l.lineWidth=Math.max(1,.05*n.fontSize),l.moveTo(o,i),l.lineTo(o+s,i),l.stroke()}}),l.restore()}if("image"===n.sizeMode&&n.logoImage){let e=new Image;await new Promise((t,a)=>{e.onload=t,e.onerror=a,e.src=n.logoImage});let t=.5*n.resolution.width,a=.5*n.resolution.height,s=Math.min(t/e.width,a/e.height),r=e.width*s,i=e.height*s;l.save(),l.globalAlpha=n.opacity/100,l.filter="drop-shadow(".concat(n.textShadow.offsetX,"px ").concat(n.textShadow.offsetY,"px ").concat(n.textShadow.blur,"px ").concat(n.textShadow.color,")"),l.drawImage(e,n.resolution.width/2-r/2+n.textPosition.x,n.resolution.height/2-i/2+n.textPosition.y,r,i),l.restore()}if(a){let e=t.toDataURL("image/png"),a=document.createElement("a");a.href=e,a.download="Gradix-".concat(n.resolution.width,"x").concat(n.resolution.height,".png"),a.click()}else{let e=await new Promise(e=>t.toBlob(t=>e(t),"image/png")),a=URL.createObjectURL(e),l=document.createElement("a");l.href=a,l.download="Gradix-".concat(n.resolution.width,"x").concat(n.resolution.height,".png"),document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)}ed.oR.success("Download will start shortly")}catch(e){console.error(e),ed.oR.error("Failed to download image")}},c=async()=>{try{let e=document.querySelector("#wallpaper canvas");if(!e)return;let t=document.createElement("canvas");t.width=n.resolution.width,t.height=n.resolution.height;let a=t.getContext("2d");if(a.drawImage(e,0,0,n.resolution.width,n.resolution.height),"text"===n.sizeMode){a.save();let e="".concat(n.isItalic?"italic":""," ").concat(n.fontWeight," ").concat(16*n.fontSize,"px ").concat(n.fontFamily);a.font=e,a.fillStyle=n.textColor,a.textAlign=n.textAlign,a.textBaseline="middle",a.globalAlpha=n.opacity/100,n.textShadow.blur>0&&(a.shadowColor=n.textShadow.color,a.shadowBlur=n.textShadow.blur,a.shadowOffsetX=n.textShadow.offsetX,a.shadowOffsetY=n.textShadow.offsetY);let t=n.resolution.width/2+n.textPosition.x;"left"===n.textAlign?t=20+n.textPosition.x:"right"===n.textAlign&&(t=n.resolution.width-20+n.textPosition.x);let l=n.text.split("\n"),s=16*n.fontSize*n.lineHeight,r=l.length*s,i=n.resolution.height/2-r/2+n.textPosition.y;l.forEach((e,l)=>{let r=i+l*s+s/2;if(a.fillText(e,t,r),n.isUnderline||n.isStrikethrough){let l=a.measureText(e),s=l.width,i=r;n.isUnderline&&(i=r+l.actualBoundingBoxDescent+2),n.isStrikethrough&&(i=r);let o=t;"center"===n.textAlign?o=t-s/2:"right"===n.textAlign&&(o=t-s),a.beginPath(),a.strokeStyle=n.textColor,a.lineWidth=Math.max(1,.05*n.fontSize),a.moveTo(o,i),a.lineTo(o+s,i),a.stroke()}}
1),a.restore()}if("image"===n.sizeMode&&n.logoImage){let e=new Image;await new Promise((t,a)=>{e.onload=t,e.onerror=a,e.src=n.logoImage});let t=n.resolution.width*n.fontSize/100,l=n.resolution.height*n.fontSize/100,s=Math.min(t/e.width,l/e.height),r=e.width*s,i=e.height*s;a.save(),a.globalAlpha=n.opacity/100,a.filter="drop-shadow(".concat(n.textShadow.offsetX,"px ").concat(n.textShadow.offsetY,"px ").concat(n.textShadow.blur,"px ").concat(n.textShadow.color,")"),a.drawImage(e,n.resolution.width/2-r/2+n.textPosition.x,n.resolution.height/2-i/2+n.textPosition.y,r,i),a.restore()}try{let e=await new Promise(e=>t.toBlob(t=>e(t),"image/png"));await navigator.clipboard.write([new ClipboardItem({"image/png":e})])}catch(l){console.error(l);let e=t.toDataURL("image/png"),a=document.createElement("textarea");a.value=e,document.body.appendChild(a),a.select();try{document.execCommand("copy"),document.body.removeChild(a)}catch(e){throw document.body.removeChild(a),console.error(e),Error("Failed to copy to clipboard")}}ed.oR.success("Image copied to clipboard")}catch(e){console.error(e),ed.oR.error("Failed to copy image")}};return(0,l.jsx)(e?eK:eX,{...n,fonts:ea,isSafari:a,downloadImage:o,copyImage:c,handleColorChange:e=>{switch(n.activeColorType){case"text":n.setTextColor(e);break;case"background":n.setBackgroundColor(e);break;case"gradient":null!==n.activeColor&&n.updateColor(e,n.activeColor)}},handleImageUpload:e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!a)return;if(a.size>0xa00000){ed.oR.error("Image must be smaller than 10MB");return}if(!a.type.startsWith("image/")){ed.oR.error("Please upload an image file");return}let l=new FileReader;l.onerror=()=>{ed.oR.error("Failed to read image file")},l.onloadend=()=>{let e=new Promise((e,t)=>{let a=new Image;a.onload=()=>{n.backgroundImage=l.result,e(!0)},a.onerror=t,a.src=l.result});ed.oR.promise(e,{loading:"Loading image...",success:"Image uploaded successfully",error:"Failed to load image"})},l.readAsDataURL(a)},handlePaletteChange:()=>{let e=(e,t,a)=>{let l,s,r;let i=e/360,n=a/100,o=t/100*(1-Math.abs(2*n-1)),c=o*(1-Math.abs(6*i%2-1)),d=n-o/2;i<1/6?[l,s,r]=[o,c,0]:i<2/6?[l,s,r]=[c,o,0]:i<.5?[l,s,r]=[0,o,c]:i<4/6?[l,s,r]=[0,c,o]:i<5/6?[l,s,r]=[c,0,o]:[l,s,r]=[o,0,c];let x=e=>{let t=Math.round((e+d)*255).toString(16);return 1===t.length?"0"+t:t};return"#".concat(x(l)).concat(x(s)).concat(x(r))},t=(()=>{let t=[{hueStep:30,count:Math.floor(6*Math.random())+3},{hueStep:120,count:Math.floor(4*Math.random())+3},{hueStep:180,count:Math.floor(4*Math.random())+2},{hueStep:60,count:Math.floor(6*Math.random())+3},{hueStep:90,count:Math.floor(4*Math.random())+3},{hueStep:45,count:Math.floor(5*Math.random())+3}],a=t[Math.floor(Math.random()*t.length)],l=360*Math.random(),s=[{min:70,max:90},{min:40,max:60},{min:85,max:100},{min:55,max:75}],r=[{min:40,max:60},{min:60,max:80},{min:20,max:40},{min:30,max:70}],i=Math.random()>.5?10+20*Math.random():80+15*Math.random(),o=e((l+180)%360,20+40*Math.random(),i);n.setBackgroundColor(o);let c=i<50?95+5*Math.random():5*Math.random(),d=e(0,0,c);n.setTextColor(d);let x=i<50?c-(10+15*Math.random()):c+(10+15*Math.random());n.setTextShadow({color:e(0,0,x),blur:n.textShadow.blur,offsetX:n.textShadow.offsetX,offsetY:n.textShadow.offsetY});let h=s[Math.floor(Math.random()*s.length)],m=r[Math.floor(Math.random()*r.length)];return Array.from({length:a.count},(e,t)=>({h:(l+t*a.hueStep)%360,s:h.min+Math.random()*(h.max-h.min),l:m.min+Math.random()*(m.max-m.min)})).flatMap(e=>{let t=[e];return Math.random()>.3&&t.push({h:(e.h+15-30*Math.random())%360,s:Math.max(20,Math.min(100,e.s+(30*Math.random()-15))),l:Math.max(10,Math.min(90,e.l+(40*Math.random()-20)))}),t}).map(t=>{let{h:a,s:l,l:s}=t;return e(a,l,s)})})();n.setCircles(t.map((e,t)=>{var a,l,s,r;return{color:e,cx:null!==(s=null===(a=n.circles[t])||void 0===a?void 0:a.cx)&&void 0!==s?s:100*Math.random(),cy:null!==(r=null===(l=n.circles[t])||void 0===l?void 0:l.cy)&&void 0!==r?r:100*Math.random()}}))}})}}},e=>{var t=t=>e(e.s=t);e.O(0,[162,811,441,517,358],()=>t(61)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.