Chunte HF Staff commited on
Commit
9c83038
Β·
verified Β·
1 Parent(s): 0be043a

Upload 41 files

Browse files
assets/index-CAxRJOrS.css ADDED
@@ -0,0 +1 @@
 
 
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-\[5px\]{bottom:5px}.left-5{left:1.25rem}.left-\[107px\]{left:107px}.left-\[calc\(100\%\+4px\)\]{left:calc(100% + 4px)}.right-\[20px\]{right:20px}.top-1\/2{top:50%}.top-\[20px\]{top:20px}.top-\[27px\]{top:27px}.top-\[5px\]{top:5px}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[100\]{z-index:100}.mx-4{margin-left:1rem;margin-right:1rem}.mb-1{margin-bottom:.25rem}.mb-4{margin-bottom:1rem}.mt-0\.5{margin-top:.125rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-5{height:1.25rem}.h-\[14px\]{height:14px}.h-\[29px\]{height:29px}.h-\[36px\]{height:36px}.h-\[47\.291px\]{height:47.291px}.h-full{height:100%}.min-h-\[29px\]{min-height:29px}.w-5{width:1.25rem}.w-\[14px\]{width:14px}.w-\[29px\]{width:29px}.w-\[340px\]{width:340px}.w-\[34px\]{width:34px}.w-\[78px\]{width:78px}.w-\[96\.5px\]{width:96.5px}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\[480px\]{max-width:480px}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-3{gap:.75rem}.gap-\[14px\]{gap:14px}.gap-\[2px\]{gap:2px}.gap-\[3px\]{gap:3px}.gap-\[4\.5px\]{gap:4.5px}.gap-\[4px\]{gap:4px}.gap-\[5px\]{gap:5px}.gap-\[9px\]{gap:9px}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.rounded{border-radius:.25rem}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.rounded-\[5px\]{border-radius:5px}.rounded-\[6px\]{border-radius:6px}.rounded-\[7px\]{border-radius:7px}.rounded-\[8px\]{border-radius:8px}.rounded-\[99px\]{border-radius:99px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[\#3e4044\]{--tw-border-opacity: 1;border-color:rgb(62 64 68 / var(--tw-border-opacity, 1))}.border-\[\#3faee6\]{--tw-border-opacity: 1;border-color:rgb(63 174 230 / var(--tw-border-opacity, 1))}.border-\[\#5865f2\]{--tw-border-opacity: 1;border-color:rgb(88 101 242 / var(--tw-border-opacity, 1))}.border-\[\#D7DCE2\]{--tw-border-opacity: 1;border-color:rgb(215 220 226 / var(--tw-border-opacity, 1))}.border-\[\#F8F9FA\]{--tw-border-opacity: 1;border-color:rgb(248 249 250 / var(--tw-border-opacity, 1))}.border-\[\#ebebeb\]{--tw-border-opacity: 1;border-color:rgb(235 235 235 / var(--tw-border-opacity, 1))}.border-\[\#ed4245\]{--tw-border-opacity: 1;border-color:rgb(237 66 69 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.bg-\[\#1e1f22\]{--tw-bg-opacity: 1;background-color:rgb(30 31 34 / var(--tw-bg-opacity, 1))}.bg-\[\#2b2d31\]{--tw-bg-opacity: 1;background-color:rgb(43 45 49 / var(--tw-bg-opacity, 1))}.bg-\[\#3faee6\]{--tw-bg-opacity: 1;background-color:rgb(63 174 230 / var(--tw-bg-opacity, 1))}.bg-\[\#5865f2\]{--tw-bg-opacity: 1;background-color:rgb(88 101 242 / var(--tw-bg-opacity, 1))}.bg-\[\#EDF0F2\]{--tw-bg-opacity: 1;background-color:rgb(237 240 242 / var(--tw-bg-opacity, 1))}.bg-\[\#F8F9FB\]{--tw-bg-opacity: 1;background-color:rgb(248 249 251 / var(--tw-bg-opacity, 1))}.bg-\[\#ed4245\]{--tw-bg-opacity: 1;background-color:rgb(237 66 69 / var(--tw-bg-opacity, 1))}.bg-\[\#f8f9fa\]{--tw-bg-opacity: 1;background-color:rgb(248 249 250 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.bg-opacity-10{--tw-bg-opacity: .1}.bg-opacity-50{--tw-bg-opacity: .5}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-4{padding:1rem}.p-\[10px\]{padding:10px}.p-\[3\.6px\]{padding:3.6px}.p-\[4px\]{padding:4px}.p-\[5px\]{padding:5px}.p-\[9px\]{padding:9px}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[12px\]{padding-left:12px;padding-right:12px}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[5px\]{padding-top:5px;padding-bottom:5px}.pr-\[4px\]{padding-right:4px}.text-center{text-align:center}.font-\[\'Inter\'\]{font-family:Inter}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[18px\]{font-size:18px}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.text-\[\#545865\]{--tw-text-opacity: 1;color:rgb(84 88 101 / var(--tw-text-opacity, 1))}.text-\[\#999999\]{--tw-text-opacity: 1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.placeholder-\[\#999999\]::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(153 153 153 / var(--tw-placeholder-opacity, 1))}.placeholder-\[\#999999\]::placeholder{--tw-placeholder-opacity: 1;color:rgb(153 153 153 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[background\,padding\,min-width\]{transition-property:background,padding,min-width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[background\]{transition-property:background;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[opacity\,transform\]{transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@font-face{font-family:Bison;src:url(/fonts/Bison-Bold.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap}body{margin:0;font-family:Inter,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{width:100vw;height:100vh;overflow:hidden}.dotted-background{background-image:radial-gradient(circle,#d1d5db 1.25px,transparent 1.25px);background-size:28.75px 28.75px;background-position:0 0}.sidebar-container img,.sidebar-container svg,.layout-selector img,.layout-selector svg,.huggy-menu img,.huggy-menu svg{-webkit-user-drag:none;user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:auto}.huggy-menu *::-webkit-scrollbar{width:6px}.huggy-menu *::-webkit-scrollbar-track{background:transparent}.huggy-menu *::-webkit-scrollbar-thumb{background:#b8b8b8;border-radius:3px}.huggy-menu *::-webkit-scrollbar-thumb:hover{background:#999}.huggy-menu *{scrollbar-width:thin;scrollbar-color:#b8b8b8 transparent}@keyframes layerFadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes layerPulse{0%,to{opacity:1}50%{opacity:.6}}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.skeleton-shimmer{background:linear-gradient(90deg,#f0f0f0,#e0e0e0,#f0f0f0 40%,#f0f0f0);background-size:1000px 100%;animation:shimmer 2s infinite linear;border-radius:4px}.skeleton-shimmer-dark{background:linear-gradient(90deg,#2a2a2a,#3a3a3a,#2a2a2a 40%,#2a2a2a);background-size:1000px 100%;animation:shimmer 2s infinite linear;border-radius:4px}.hover\:bg-\[\#3e4044\]:hover{--tw-bg-opacity: 1;background-color:rgb(62 64 68 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#4752c4\]:hover{--tw-bg-opacity: 1;background-color:rgb(71 82 196 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#d13438\]:hover{--tw-bg-opacity: 1;background-color:rgb(209 52 56 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#e9ecef\]:hover{--tw-bg-opacity: 1;background-color:rgb(233 236 239 / var(--tw-bg-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:right-\[22px\]{right:22px}.lg\:top-\[30px\]{top:30px}.lg\:h-4{height:1rem}.lg\:h-\[32px\]{height:32px}.lg\:h-\[40px\]{height:40px}.lg\:min-h-\[32px\]{min-height:32px}.lg\:w-4{width:1rem}.lg\:w-\[32px\]{width:32px}.lg\:w-\[38px\]{width:38px}.lg\:w-\[87px\]{width:87px}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:gap-\[10px\]{gap:10px}.lg\:gap-\[15px\]{gap:15px}.lg\:gap-\[5px\]{gap:5px}.lg\:p-\[10px\]{padding:10px}.lg\:p-\[4px\]{padding:4px}.lg\:p-\[5px\]{padding:5px}.lg\:px-\[13px\]{padding-left:13px;padding-right:13px}.lg\:pr-\[5px\]{padding-right:5px}.lg\:text-\[16px\]{font-size:16px}}
assets/index-CE0TzriE.js ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{r as u,a as nt,g as it}from"./react-vendor-DzFEYc3-.js";import{T as ot,K as ae,R as ue,I as Xe,S as st,L as rt,a as at}from"./konva-vendor-CFBUcegD.js";(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))a(d);new MutationObserver(d=>{for(const i of d)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&a(r)}).observe(document,{childList:!0,subtree:!0});function n(d){const i={};return d.integrity&&(i.integrity=d.integrity),d.referrerPolicy&&(i.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?i.credentials="include":d.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(d){if(d.ep)return;d.ep=!0;const i=n(d);fetch(d.href,i)}})();var je={exports:{}},Se={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var lt=u,ct=Symbol.for("react.element"),dt=Symbol.for("react.fragment"),ut=Object.prototype.hasOwnProperty,gt=lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ht={key:!0,ref:!0,__self:!0,__source:!0};function Ye(e,o,n){var a,d={},i=null,r=null;n!==void 0&&(i=""+n),o.key!==void 0&&(i=""+o.key),o.ref!==void 0&&(r=o.ref);for(a in o)ut.call(o,a)&&!ht.hasOwnProperty(a)&&(d[a]=o[a]);if(e&&e.defaultProps)for(a in o=e.defaultProps,o)d[a]===void 0&&(d[a]=o[a]);return{$$typeof:ct,type:e,key:i,ref:r,props:d,_owner:gt.current}}Se.Fragment=dt;Se.jsx=Ye;Se.jsxs=Ye;je.exports=Se;var t=je.exports,Ue,Pe=nt;Ue=Pe.createRoot,Pe.hydrateRoot;function pt({selected:e=!1}){return t.jsx("div",{style:{position:"relative",width:"32px",height:"32px"},children:t.jsx("img",{alt:"Layout",style:{display:"block",width:"100%",height:"100%"},src:e?"/assets/sidebar icons/icon-Layout-selected.svg":"/assets/sidebar icons/icon-Layout-default.svg"})})}function xt(){return t.jsx("div",{style:{width:"32px",height:"32px",position:"relative"},children:t.jsx("img",{alt:"Huggy",style:{display:"block",width:"100%",height:"100%"},src:"/assets/sidebar icons/icon-addHuggy.svg"})})}function ft({selected:e=!1}){return t.jsx("div",{style:{position:"relative",width:"32px",height:"32px"},children:t.jsx("img",{alt:"Image",style:{display:"block",width:"100%",height:"100%"},src:e?"/assets/sidebar icons/icon-addImage-selected.svg":"/assets/sidebar icons/icon-addImage-default.svg"})})}function mt({selected:e=!1}){return t.jsx("div",{style:{position:"relative",width:"32px",height:"32px"},children:t.jsx("img",{alt:"Text",style:{display:"block",width:"100%",height:"100%"},src:e?"/assets/sidebar icons/icon-addText-selected.svg":"/assets/sidebar icons/icon-addText-default.svg"})})}const Ge={seriousCollab:{id:"seriousCollab",name:"Serious Collab",thumbnail:"/assets/layouts/sCollab_thumbnail.png",objects:[{id:"hf-logo",type:"image",x:716.18,y:235.81,width:220.16,height:204.39,rotation:0,zIndex:1,src:"/assets/layouts/HF logo.png",name:"HF Logo"},{id:"logo-placeholder",type:"image",x:241.94,y:210.44,width:262.31,height:255.13,rotation:0,zIndex:2,src:"/assets/layouts/logo_placehoder.png",name:"Logo Placeholder"},{id:"x-icon",type:"image",x:619.01,y:329.12,width:16.76,height:16.76,rotation:0,zIndex:3,src:"/assets/layouts/collabX.svg",name:"X Icon"}]},funCollab:{id:"funCollab",name:"Fun Collab",thumbnail:"/assets/layouts/fCollab_thumbnail.png",objects:[{id:"title-text",type:"text",x:124,y:81.58,width:945.2583618164062,height:140,rotation:0,zIndex:1,text:"Pretty Short Title",fontSize:111.43,fontFamily:"Inter",fill:"#8a97ba",bold:!0,italic:!1,align:"center"},{id:"logo-placeholder",type:"image",x:278.6,y:232.76,width:311.73,height:306.01,rotation:351.366,zIndex:3,src:"/assets/layouts/logo_placehoder.png",name:"Logo Placeholder"},{id:"huggy-hand",type:"image",x:444.31341928814203,y:195.24545949041132,width:249.0715804458829,height:249.0715804458829,rotation:0,zIndex:2,src:"/assets/layouts/fCollab_huggy_hand_asset.png",name:"Huggy Hand"},{id:"huggy-group",type:"image",x:540.8452299149437,y:66.99999999999994,width:536.0247700850559,height:524.6602873270689,rotation:0,zIndex:4,src:"/assets/layouts/fCollab_huggy_asset.png",name:"Huggy Group"}]},sandwich:{id:"sandwich",name:"Sandwich",thumbnail:"/assets/layouts/sandwitch_thumbnail.png",objects:[{id:"title-text",type:"text",x:112.57,y:51.67,width:1050,height:190,rotation:0,zIndex:1,text:"Pretty short title",fontSize:161.62,fontFamily:"Bison",fill:"#8a97ba",bold:!0,italic:!1,align:"left",isFixedSize:!0},{id:"description-text",type:"text",x:92.5,y:503.48,width:1015,height:107,rotation:0,zIndex:2,text:"supportive description",fontSize:89.05,fontFamily:"Inter",fill:"#8a97ba",bold:!1,italic:!1,align:"center",isFixedSize:!0},{id:"singing-huggy",type:"image",x:336.34,y:130,width:565,height:389,rotation:0,zIndex:3,src:"/assets/layouts/snadwithc_huggy_asset.png",name:"Singing Huggy"}]},docs:{id:"docs",name:"Docs",thumbnail:"/assets/layouts/docs_thumbnail.png",objects:[{id:"docs-huggy-logo",type:"image",x:466,y:145.67,width:268,height:268,rotation:0,zIndex:1,src:"/assets/layouts/docsHFLogo.png",name:"Docs HF Logo"},{id:"title-text",type:"text",x:237.9214782714844,y:329.67,width:724.1570434570312,height:115.93,rotation:0,zIndex:2,text:"Transformers",fontSize:105.93,fontFamily:"Source Sans 3",fill:"#121212",bold:!0,italic:!1,align:"center",isFixedSize:!0,fontWeight:"black"},{id:"subtitle-text",type:"text",x:379.6729888916016,y:441.535,width:440.6540222167969,height:63.93,rotation:0,zIndex:3,text:"Documentation",fontSize:53.93,fontFamily:"IBM Plex Mono",fill:"#747474",bold:!1,italic:!1,align:"center",isFixedSize:!0}]},academiaHub:{id:"academiaHub",name:"Academia Hub",thumbnail:"/assets/layouts/academia_thumbnail.png",objects:[{id:"welcome-academia-hub",type:"image",x:342.0207815174148,y:96.80554723334625,width:515.9584369651704,height:68.45097665871741,rotation:0,zIndex:0,src:"/assets/layouts/welcome_academia_hub.png",name:"Welcome Academia Hub"},{id:"hf-logo",type:"image",x:750.0004969914753,y:259.12208128610206,width:259.950483451221,height:241.33030211026127,rotation:0,zIndex:1,src:"/assets/layouts/HF logo.png",name:"HF Logo"},{id:"logo-placeholder",type:"image",x:190.04901955730372,y:226.16684979465253,width:309.718438018213,height:301.24076509315995,rotation:0,zIndex:2,src:"/assets/layouts/logo_placehoder.png",name:"Logo Placeholder"},{id:"x-icon",type:"image",x:635.2685362494915,y:369.29640728007695,width:19.789108387729218,height:19.78910838772924,rotation:0,zIndex:3,src:"/assets/layouts/collabX.svg",name:"X Icon"}]}};function Oe(e){return Ge[e]}function yt(){return Object.values(Ge)}function wt({onSelectLayout:e}){const o=yt(),[n,a]=u.useState(new Set(o.map(i=>i.id))),d=i=>{a(r=>{const h=new Set(r);return h.delete(i),h})};return t.jsx("div",{className:"layout-selector absolute left-[calc(100%+4px)] top-[5px] bg-[#f8f9fa] border border-[#3faee6] rounded-[10px] p-[5px] shadow-lg inline-block",onDragStart:i=>{i.preventDefault(),i.stopPropagation()},onDrag:i=>{i.preventDefault(),i.stopPropagation()},onDragOver:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("div",{className:"flex gap-0",children:o.slice(0,2).map(i=>t.jsxs("button",{onClick:()=>e(i.id),onDragStart:r=>r.preventDefault(),className:"flex flex-col items-center gap-[5px] p-[10px] rounded-[5px] hover:bg-[#e9ecef] transition-colors flex-1",children:[t.jsxs("div",{className:"w-[96.5px] h-[47.291px] rounded-[5px] flex items-center justify-center overflow-hidden relative",onDragStart:r=>r.preventDefault(),children:[n.has(i.id)&&t.jsx("div",{className:"absolute inset-0 skeleton-shimmer"}),t.jsx("img",{src:i.thumbnail,alt:i.name,className:`w-full h-full object-cover transition-opacity duration-200 ${n.has(i.id)?"opacity-0":"opacity-100"}`,onLoad:()=>d(i.id),draggable:!1})]}),t.jsx("p",{className:"text-[14px] font-normal text-[#545865] text-center",children:i.name})]},i.id))}),t.jsx("div",{className:"flex gap-0",children:o.slice(2,4).map(i=>t.jsxs("button",{onClick:()=>e(i.id),onDragStart:r=>r.preventDefault(),className:"flex flex-col items-center gap-[5px] p-[10px] rounded-[5px] hover:bg-[#e9ecef] transition-colors flex-1",children:[t.jsxs("div",{className:"w-[96.5px] h-[47.291px] rounded-[5px] flex items-center justify-center overflow-hidden relative",onDragStart:r=>r.preventDefault(),children:[n.has(i.id)&&t.jsx("div",{className:"absolute inset-0 skeleton-shimmer"}),t.jsx("img",{src:i.thumbnail,alt:i.name,className:`w-full h-full object-cover transition-opacity duration-200 ${n.has(i.id)?"opacity-0":"opacity-100"}`,onLoad:()=>d(i.id),draggable:!1})]}),t.jsx("p",{className:"text-[14px] font-normal text-[#545865] text-center",children:i.name})]},i.id))}),t.jsx("div",{className:"flex gap-0",children:o.slice(4,6).map(i=>t.jsxs("button",{onClick:()=>e(i.id),onDragStart:r=>r.preventDefault(),className:"flex flex-col items-center gap-[5px] p-[10px] rounded-[5px] hover:bg-[#e9ecef] transition-colors flex-1",children:[t.jsxs("div",{className:"w-[96.5px] h-[47.291px] rounded-[5px] flex items-center justify-center overflow-hidden relative",onDragStart:r=>r.preventDefault(),children:[n.has(i.id)&&t.jsx("div",{className:"absolute inset-0 skeleton-shimmer"}),t.jsx("img",{src:i.thumbnail,alt:i.name,className:`w-full h-full object-cover transition-opacity duration-200 ${n.has(i.id)?"opacity-0":"opacity-100"}`,onLoad:()=>d(i.id),draggable:!1})]}),t.jsx("p",{className:"text-[14px] font-normal text-[#545865] text-center",children:i.name})]},i.id))})]})})}const R="https://huggingface.co/datasets/Chunte/Huggy/resolve/main",vt=[{id:"acedemic-huggy",name:"Acedemic Huggy",thumbnail:`${R}/modern%20Huggies/Acedemic%20Huggy.png`,category:"modern",tags:["acedemic","academic","education","modern"]},{id:"back-of-huggy",name:"Back of a Huggy",thumbnail:`${R}/modern%20Huggies/Back%20of%20a%20Huggy.png`,category:"modern",tags:["back","modern"]},{id:"d-huggy",name:"D Huggy",thumbnail:`${R}/modern%20Huggies/D%20Huggy.png`,category:"modern",tags:["d","letter","modern"]},{id:"dragon-huggy",name:"Dragon Huggy",thumbnail:`${R}/modern%20Huggies/Dragon%20Huggy.png`,category:"modern",tags:["dragon","fantasy","modern"]},{id:"game-jam-huggy",name:"Game Jam Huggy",thumbnail:`${R}/modern%20Huggies/Game%20Jam%20Huggy.png`,category:"modern",tags:["game","jam","gaming","modern"]},{id:"huggy-chef",name:"Huggy Chef",thumbnail:`${R}/modern%20Huggies/Huggy%20Chef.png`,category:"modern",tags:["chef","cooking","food","modern"]},{id:"huggy-hi",name:"Huggy Hi",thumbnail:`${R}/modern%20Huggies/Huggy%20Hi.png`,category:"modern",tags:["hi","hello","greeting","wave","modern"]},{id:"huggy-lab",name:"Huggy Lab",thumbnail:`${R}/modern%20Huggies/Huggy%20Lab.png`,category:"modern",tags:["lab","laboratory","science","modern"]},{id:"huggy-medic",name:"Huggy Medic",thumbnail:`${R}/modern%20Huggies/Huggy%20Medic.png`,category:"modern",tags:["medic","medical","doctor","health","modern"]},{id:"huggy-okay",name:"Huggy Okay",thumbnail:`${R}/modern%20Huggies/Huggy%20Okay.png`,category:"modern",tags:["okay","ok","thumbs up","modern"]},{id:"huggy-sunny-hello",name:"Huggy Sunny hello",thumbnail:`${R}/modern%20Huggies/Huggy%20Sunny%20hello.png`,category:"modern",tags:["sunny","hello","greeting","summer","modern"]},{id:"huggy-sunny",name:"Huggy Sunny",thumbnail:`${R}/modern%20Huggies/Huggy%20Sunny.png`,category:"modern",tags:["sunny","summer","sun","modern"]},{id:"huggy-yolk",name:"Huggy Yolk",thumbnail:`${R}/modern%20Huggies/Huggy%20Yolk.png`,category:"modern",tags:["yolk","egg","food","modern"]},{id:"huggy-blink-okay",name:"Huggy blink Okay",thumbnail:`${R}/modern%20Huggies/Huggy%20blink%20Okay.png`,category:"modern",tags:["blink","okay","wink","modern"]},{id:"huggy-the-pooh-meme",name:"Huggy the Pooh meme",thumbnail:`${R}/modern%20Huggies/Huggy%20the%20Pooh%20meme.png`,category:"modern",tags:["pooh","meme","funny","modern"]},{id:"idefics-huggy",name:"IDEFICS Huggy",thumbnail:`${R}/modern%20Huggies/IDEFICS%20Huggy.png`,category:"modern",tags:["idefics","vision","multimodal","ai","modern"]},{id:"karaoke-huggy",name:"Karaoke Huggy",thumbnail:`${R}/modern%20Huggies/Karaoke%20Huggy.png`,category:"modern",tags:["karaoke","singing","music","modern"]},{id:"lora-huggy",name:"Lora Huggy",thumbnail:`${R}/modern%20Huggies/Lora%20Huggy.png`,category:"modern",tags:["lora","ai","model","modern"]},{id:"optimum-huggy",name:"Optimum Huggy",thumbnail:`${R}/modern%20Huggies/Optimum%20Huggy.png`,category:"modern",tags:["optimum","optimization","ai","modern"]},{id:"robot-huggy",name:"Robot Huggy",thumbnail:`${R}/modern%20Huggies/Robot%20Huggy.png`,category:"modern",tags:["robot","automation","ai","modern"]},{id:"snake-huggy",name:"Snake Huggy",thumbnail:`${R}/modern%20Huggies/Snake%20Huggy.png`,category:"modern",tags:["snake","python","code","modern"]},{id:"super-huggy",name:"Super Huggy",thumbnail:`${R}/modern%20Huggies/Super%20Huggy.png`,category:"modern",tags:["super","hero","superhero","modern"]},{id:"text-generation-wizard-huggy",name:"Text Generation Wizard Huggy",thumbnail:`${R}/modern%20Huggies/Text%20Generation%20Wizard%20Huggy.png`,category:"modern",tags:["text","generation","wizard","nlp","ai","modern"]},{id:"transformer-agent-huggy",name:"Transformer Agent Huggy",thumbnail:`${R}/modern%20Huggies/Transformer%20Agent%20Huggy.png`,category:"modern",tags:["transformer","agent","ai","nlp","modern"]},{id:"wine-huggy",name:"Wine Huggy",thumbnail:`${R}/modern%20Huggies/Wine%20Huggy.png`,category:"modern",tags:["wine","drink","celebration","modern"]},{id:"computer-vision-huggy",name:"computer vision Huggy",thumbnail:`${R}/modern%20Huggies/computer%20vision%20Huggy.png`,category:"modern",tags:["computer","vision","cv","ai","model","modern"]}],bt=[{id:"catching-huggy",name:"Catching Huggy",thumbnail:`${R}/Outlined%20Huggies/Catching%20Huggy.png`,category:"outlined",tags:["catching","catch","outlined"]},{id:"comic-huggy",name:"Comic Huggy",thumbnail:`${R}/Outlined%20Huggies/Comic%20Huggy.png`,category:"outlined",tags:["comic","cartoon","outlined"]},{id:"curious-huggy",name:"Curious Huggy",thumbnail:`${R}/Outlined%20Huggies/Curious%20Huggy.png`,category:"outlined",tags:["curious","wondering","thinking","outlined"]},{id:"diffusor-guide-huggy",name:"Diffusor guide Huggy",thumbnail:`${R}/Outlined%20Huggies/Diffusor%20guide%20Huggy.png`,category:"outlined",tags:["diffusor","diffusion","guide","ai","outlined"]},{id:"fishing-huggy",name:"Fishing Huggy",thumbnail:`${R}/Outlined%20Huggies/Fishing%20Huggy.png`,category:"outlined",tags:["fishing","fish","outdoor","outlined"]},{id:"gpu-huggy",name:"GPU Huggy",thumbnail:`${R}/Outlined%20Huggies/GPU%20Huggy.png`,category:"outlined",tags:["gpu","graphics","computing","hardware","outlined"]},{id:"global-huggy",name:"Global Huggy",thumbnail:`${R}/Outlined%20Huggies/Global%20Huggy.png`,category:"outlined",tags:["global","world","international","outlined"]},{id:"greeting-huggy-left",name:"Greeting Huggy left",thumbnail:`${R}/Outlined%20Huggies/Greeting%20Huggy%20left.png`,category:"outlined",tags:["greeting","hello","wave","left","outlined"]},{id:"greeting-huggy-right",name:"Greeting Huggy right",thumbnail:`${R}/Outlined%20Huggies/Greeting%20Huggy%20right.png`,category:"outlined",tags:["greeting","hello","wave","right","outlined"]},{id:"growing-model-huggy",name:"Growing model Huggy",thumbnail:`${R}/Outlined%20Huggies/Growing%20model%20Huggy.png`,category:"outlined",tags:["growing","model","ai","growth","outlined"]},{id:"guide-huggy",name:"Guide Huggy",thumbnail:`${R}/Outlined%20Huggies/Guide%20Huggy.png`,category:"outlined",tags:["guide","help","tutorial","outlined"]},{id:"loving-modelndataset-huggy",name:"Loving modelndataset Huggy",thumbnail:`${R}/Outlined%20Huggies/Loving%20modelndataset%20Huggy.png`,category:"outlined",tags:["loving","model","dataset","heart","outlined"]},{id:"manager-huggy",name:"Manager Huggy",thumbnail:`${R}/Outlined%20Huggies/Manager%20Huggy.png`,category:"outlined",tags:["manager","management","business","outlined"]},{id:"paper-huggy",name:"Paper Huggy",thumbnail:`${R}/Outlined%20Huggies/Paper%20Huggy.png`,category:"outlined",tags:["paper","research","document","outlined"]},{id:"rocket-huggy",name:"Rocket Huggy",thumbnail:`${R}/Outlined%20Huggies/Rocket%20Huggy.png`,category:"outlined",tags:["rocket","space","launch","fast","outlined"]},{id:"scan-huggy",name:"Scan Huggy",thumbnail:`${R}/Outlined%20Huggies/Scan%20Huggy.png`,category:"outlined",tags:["scan","search","find","outlined"]},{id:"violinist-huggy",name:"Violinist Huggy",thumbnail:`${R}/Outlined%20Huggies/Violinist%20Huggy.png`,category:"outlined",tags:["violinist","violin","music","classical","outlined"]},{id:"xray-huggy",name:"X-ray Huggy",thumbnail:`${R}/Outlined%20Huggies/X-ray%20Huggy.png`,category:"outlined",tags:["xray","x-ray","medical","scan","outlined"]}],We=[...vt,...bt];function St(e){if(!e.trim())return We;const o=e.toLowerCase().trim();return We.filter(n=>!!(n.name.toLowerCase().replace("huggy","").trim().includes(o)||n.name.toLowerCase().includes(o)||n.category.toLowerCase().includes(o)||n.tags&&n.tags.some(d=>d.toLowerCase().includes(o))))}const Be=12,_e=6;function kt({onSelectHuggy:e,onClose:o}){const[n,a]=u.useState(""),[d,i]=u.useState(Be),[r,h]=u.useState(new Set),y=u.useRef(null),m=u.useMemo(()=>St(n),[n]),x=m.slice(0,d),v=d<m.length;u.useEffect(()=>{const p=y.current;if(!p||!v)return;const F=setTimeout(()=>{const{scrollHeight:_,clientHeight:Z}=p;_<=Z&&v&&i(q=>Math.min(q+_e,m.length))},100);return()=>clearTimeout(F)},[d,v,m.length]),u.useEffect(()=>{const p=y.current;if(!p)return;const A=()=>{const{scrollTop:F,scrollHeight:_,clientHeight:Z}=p;(F+Z)/_>.8&&v&&i(V=>Math.min(V+_e,m.length))};return p.addEventListener("scroll",A),()=>p.removeEventListener("scroll",A)},[v,m.length]);const D=p=>{e(p),o()},C=p=>{h(A=>{const F=new Set(A);return F.delete(p),F})},O=p=>{h(A=>new Set(A).add(p))},L=p=>{a(p.target.value),i(Be)};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"fixed inset-0 z-10",onClick:o}),t.jsxs("div",{className:"huggy-menu fixed left-[107px] top-[20px] z-20 w-[340px] bg-[#f8f9fa] border border-[#3faee6] rounded-[10px] flex flex-col overflow-hidden shadow-lg",onDragStart:p=>{p.preventDefault(),p.stopPropagation()},onDrag:p=>{p.preventDefault(),p.stopPropagation()},onDragOver:p=>{p.preventDefault(),p.stopPropagation()},children:[t.jsx("div",{className:"border-b border-[#ebebeb] p-[5px]",children:t.jsx("input",{type:"text",placeholder:"Search Huggy",value:n,onChange:L,className:"w-full bg-transparent border-none outline-none text-[14px] text-[#999999] font-['Inter'] placeholder-[#999999]",autoFocus:!0})}),t.jsx("div",{ref:y,className:"overflow-y-auto p-[5px]",style:{maxHeight:"430px"},children:m.length===0?t.jsx("div",{className:"text-center text-[#999999] text-[14px] py-8",children:"No Huggys found"}):t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-[5px] p-[5px]",children:x.map(p=>t.jsxs("button",{onClick:()=>D(p),onDragStart:A=>A.preventDefault(),className:"relative w-full aspect-square rounded-[5px] overflow-hidden hover:bg-[#e9ecef] transition-colors cursor-pointer border-none p-0",title:p.name,children:[r.has(p.id)&&t.jsx("div",{className:"absolute inset-0 skeleton-shimmer"}),t.jsx("img",{src:p.thumbnail,alt:p.name,className:`w-full h-full object-cover transition-opacity duration-200 ${r.has(p.id)?"opacity-0":"opacity-100"}`,loading:"lazy",onLoadStart:()=>O(p.id),onLoad:()=>C(p.id),onError:()=>C(p.id),draggable:!1})]},p.id))})}),t.jsx("div",{className:"border-t border-[#ebebeb] p-[5px] text-center",children:t.jsxs("p",{className:"text-[#999999] text-[12px]",children:["Showing ",x.length," of ",m.length," Huggys"]})})]})]})}function Ht({onLayoutClick:e,onHuggyClick:o,onImageClick:n,onTextClick:a,onSelectLayout:d,onSelectHuggy:i,activeButton:r}){return t.jsx("div",{className:"fixed left-5 top-1/2 -translate-y-1/2 z-50",onDragStart:h=>{h.preventDefault(),h.stopPropagation()},onDrag:h=>{h.preventDefault(),h.stopPropagation()},onDragOver:h=>{h.preventDefault(),h.stopPropagation()},children:t.jsxs("div",{className:"sidebar-container bg-[#f8f9fa] border border-[#D7DCE2] rounded-[12px] p-[5px] flex flex-col gap-[14px] lg:gap-[15px] w-[78px] lg:w-[87px] relative",children:[t.jsxs("button",{onClick:e,className:`flex flex-col items-center gap-[3px] px-[12px] lg:px-[13px] py-[5px] rounded-[7px] transition-colors ${r==="layout"?"bg-[#3faee6]":"hover:bg-[#e9ecef]"}`,children:[t.jsx("div",{className:"w-[29px] lg:w-[32px] h-[29px] lg:h-[32px] flex items-center justify-center",children:t.jsx(pt,{selected:r==="layout"})}),t.jsx("p",{className:`text-[14px] lg:text-[16px] font-normal ${r==="layout"?"text-white":"text-[#545865]"}`,children:"Layout"})]}),t.jsxs("button",{onClick:o,className:`flex flex-col items-center gap-[3px] px-[12px] lg:px-[13px] py-[5px] rounded-[7px] transition-colors ${r==="huggy"?"bg-[#3faee6]":"hover:bg-[#e9ecef]"}`,children:[t.jsx("div",{className:"w-[29px] lg:w-[32px] h-[29px] lg:h-[32px] flex items-center justify-center",children:t.jsx(xt,{})}),t.jsx("p",{className:`text-[14px] lg:text-[16px] font-normal ${r==="huggy"?"text-white":"text-[#545865]"}`,children:"Huggy"})]}),t.jsxs("button",{onClick:n,className:`flex flex-col items-center gap-[3px] px-[12px] lg:px-[13px] py-[5px] rounded-[7px] transition-colors ${r==="image"?"bg-[#3faee6]":"hover:bg-[#e9ecef]"}`,children:[t.jsx("div",{className:"w-[29px] lg:w-[32px] h-[29px] lg:h-[32px] flex items-center justify-center",children:t.jsx(ft,{selected:r==="image"})}),t.jsx("p",{className:`text-[14px] lg:text-[16px] font-normal ${r==="image"?"text-white":"text-[#545865]"}`,children:"Image"})]}),t.jsxs("button",{onClick:a,className:`flex flex-col items-center gap-[3px] px-[12px] lg:px-[13px] py-[5px] rounded-[7px] transition-colors ${r==="text"?"bg-[#3faee6]":"hover:bg-[#e9ecef]"}`,children:[t.jsx("div",{className:"w-[29px] lg:w-[32px] h-[29px] lg:h-[32px] flex items-center justify-center",children:t.jsx(mt,{selected:r==="text"})}),t.jsx("p",{className:`text-[14px] lg:text-[16px] font-normal ${r==="text"?"text-white":"text-[#545865]"}`,children:"Text"})]}),r==="layout"&&t.jsx(wt,{onSelectLayout:d}),r==="huggy"&&t.jsx(kt,{onSelectHuggy:i,onClose:()=>o()}),r==="text"&&t.jsx("div",{className:"text-hint absolute left-[calc(100%+4px)] bottom-[5px] bg-[#3faee6] rounded-[10px] p-[9px] lg:p-[10px] w-max",children:t.jsxs("p",{className:"text-white text-[14px] lg:text-[16px] font-normal leading-normal",children:["Click anywhere on the",t.jsx("br",{}),"canvas to add texts"]})})]})})}/**
10
+ * @license lucide-react v0.344.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */var Ct={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
15
+ * @license lucide-react v0.344.0 - ISC
16
+ *
17
+ * This source code is licensed under the ISC license.
18
+ * See the LICENSE file in the root directory of this source tree.
19
+ */const zt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),ge=(e,o)=>{const n=u.forwardRef(({color:a="currentColor",size:d=24,strokeWidth:i=2,absoluteStrokeWidth:r,className:h="",children:y,...m},x)=>u.createElement("svg",{ref:x,...Ct,width:d,height:d,stroke:a,strokeWidth:r?Number(i)*24/Number(d):i,className:["lucide",`lucide-${zt(e)}`,h].join(" "),...m},[...o.map(([v,D])=>u.createElement(v,D)),...Array.isArray(y)?y:[y]]));return n.displayName=`${e}`,n};/**
20
+ * @license lucide-react v0.344.0 - ISC
21
+ *
22
+ * This source code is licensed under the ISC license.
23
+ * See the LICENSE file in the root directory of this source tree.
24
+ */const It=ge("Bold",[["path",{d:"M14 12a4 4 0 0 0 0-8H6v8",key:"v2sylx"}],["path",{d:"M15 20a4 4 0 0 0 0-8H6v8Z",key:"1ef5ya"}]]);/**
25
+ * @license lucide-react v0.344.0 - ISC
26
+ *
27
+ * This source code is licensed under the ISC license.
28
+ * See the LICENSE file in the root directory of this source tree.
29
+ */const $t=ge("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
30
+ * @license lucide-react v0.344.0 - ISC
31
+ *
32
+ * This source code is licensed under the ISC license.
33
+ * See the LICENSE file in the root directory of this source tree.
34
+ */const Mt=ge("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
35
+ * @license lucide-react v0.344.0 - ISC
36
+ *
37
+ * This source code is licensed under the ISC license.
38
+ * See the LICENSE file in the root directory of this source tree.
39
+ */const Ft=ge("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
40
+ * @license lucide-react v0.344.0 - ISC
41
+ *
42
+ * This source code is licensed under the ISC license.
43
+ * See the LICENSE file in the root directory of this source tree.
44
+ */const Lt=ge("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
45
+ * @license lucide-react v0.344.0 - ISC
46
+ *
47
+ * This source code is licensed under the ISC license.
48
+ * See the LICENSE file in the root directory of this source tree.
49
+ */const Dt=ge("Pipette",[["path",{d:"m2 22 1-1h3l9-9",key:"1sre89"}],["path",{d:"M3 21v-3l9-9",key:"hpe2y6"}],["path",{d:"m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z",key:"196du1"}]]);/**
50
+ * @license lucide-react v0.344.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const Et=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Rt({onExport:e,isExporting:o=!1,currentLayout:n,canvasSize:a}){const d=p=>{switch(p){case"1200x675":return"Twitter";case"linkedin":return"LinkedIn";case"hf":return"HF";default:return"Twitter"}},i=()=>{const p=d(a);return n?`${n}_${p}`:`thumbnail_${p}`},[r,h]=u.useState(i()),[y,m]=u.useState(!1),[x,v]=u.useState(0),[D,C]=u.useState(!1),O=u.useRef(null);u.useEffect(()=>{h(i())},[n,a]),u.useEffect(()=>{O.current&&v(O.current.offsetWidth)},[r]);const L=()=>{o||e(r)};return t.jsxs("div",{className:"fixed top-[27px] lg:top-[30px] right-[20px] lg:right-[22px] z-50 p-[4px] lg:p-[5px] inline-flex items-stretch gap-[4px] lg:gap-[5px]",style:{backgroundColor:"#262933",borderRadius:"10px",boxShadow:"0px 0px 0px 0px rgba(0,0,0,0), 0px 0px 0px 0px rgba(0,0,0,0.03), 0px 0px 6.417px 0px rgba(0,0,0,0.09), 0px 0px 4.583px 0px rgba(0,0,0,0.15), 0px 0px 2.75px 0px rgba(0,0,0,0.17), 0px 16.847px 21.059px -4.212px rgba(14,13,13,0.1), 0px 8.423px 8.423px -4.212px rgba(0,0,0,0.04)",opacity:o?.5:1,transition:"all 0.2s ease-in-out",width:"fit-content"},children:[t.jsx("button",{onClick:L,disabled:o,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:"flex items-center justify-center rounded-[5px] w-[29px] lg:w-[32px] aspect-square flex-shrink-0 border-none p-0",style:{backgroundColor:D?"#0d6ecc":"#1888ff",cursor:o?"not-allowed":"pointer"},children:o?t.jsx(Lt,{className:"w-[14px] lg:w-4 h-[14px] lg:h-4",color:"white",style:{animation:"spin 1s linear infinite"}}):t.jsx(Mt,{className:"w-[14px] lg:w-4 h-[14px] lg:h-4",color:"white"})}),t.jsxs("div",{className:"flex items-center gap-[2px] pr-[4px] lg:pr-[5px] min-h-[29px] lg:min-h-[32px]",children:[t.jsx("span",{ref:O,className:"absolute invisible whitespace-pre text-[14px] lg:text-[16px] font-normal p-[4px] lg:p-[5px]",style:{fontFamily:"Inter, sans-serif"},children:r||"thumbnail_name"}),t.jsx("input",{type:"text",value:r,onChange:p=>h(p.target.value),onFocus:()=>m(!0),onBlur:()=>m(!1),disabled:o,placeholder:"thumbnail_name",className:"bg-white/5 text-white text-[14px] lg:text-[16px] font-normal outline-none border-none p-[4px] lg:p-[5px] rounded",style:{fontFamily:"Inter, sans-serif",width:`${x}px`,cursor:o?"not-allowed":"text",opacity:y?1:.5,transition:"opacity 0.2s"},onClick:p=>p.stopPropagation()}),t.jsx("span",{className:"text-white text-[14px] lg:text-[16px] font-normal",style:{fontFamily:"Inter, sans-serif"},children:".png"})]})]})}function Nt({children:e}){return t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:t.jsx("div",{className:"canvas-container",style:{display:"flex",flexDirection:"column",gap:"10px"},children:e})})}const Tt={"1200x675":{width:1200,height:675,label:"1200Γ—675"},linkedin:{width:1200,height:627,label:"LinkedIn"},hf:{width:1160,height:580,label:"HF Custom"}};function me(e){return Tt[e]}function Ke(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}function Le(e){return[...e].sort((o,n)=>o.zIndex-n.zIndex)}function De(e){return e.length===0?1:Math.max(...e.map(o=>o.zIndex))+1}function Ae(e,o,n){return`${n==="black"?"900":e?"bold":"normal"} ${o?"italic":""}`.trim()}function Pt({object:e,isSelected:o,onSelect:n,onDragStart:a,onDragMove:d,onDragEnd:i,onTransformEnd:r,onEditingChange:h,onMouseEnter:y,onMouseLeave:m,shapeRef:x}){const v=u.useRef(null);u.useEffect(()=>{if(e.text===""&&o&&!e.isFixedSize&&!e.isEditing){const L=setTimeout(()=>{h(e.id,!0)},100);return()=>clearTimeout(L)}},[e.text,o,e.isFixedSize,e.isEditing,e.id,h]);const D=L=>{if(!e.isEditing){const p=L.target.getStage(),A=p==null?void 0:p.getPointerPosition();if(A){const F=A.x-e.x,_=A.y-e.y;h(e.id,!0,F,_)}else h(e.id,!0)}},C=()=>{if(!e.isFixedSize||!e.text)return e.fontSize;try{const L=new ae.Text({text:e.text||"M",fontSize:e.fontSize,fontFamily:e.fontFamily,fontStyle:Ae(e.bold,e.italic,e.fontWeight),width:e.width,height:e.height});let p=e.fontSize;const A=e.width,F=e.height;for(;p>10;){L.fontSize(p);const _=L.measureSize(e.text||"M");if(_.width<=A&&_.height<=F)break;p-=1}return L.destroy(),p}catch(L){return console.error("Error calculating fit font size:",L),e.fontSize}},O=e.isFixedSize?C():e.fontSize;return t.jsx(ot,{id:e.id,ref:L=>{typeof x=="function"?x(L):x&&(x.current=L),v.current=L},x:e.x,y:e.y,width:e.width,height:e.height,text:e.text,fontSize:O,fontFamily:e.fontFamily,fill:e.fill,fontStyle:Ae(e.bold,e.italic,e.fontWeight),align:e.align||"left",verticalAlign:"top",rotation:e.rotation,padding:0,lineHeight:1,draggable:!0,onClick:L=>n(L),onTap:L=>n(L),onDblClick:D,onDblTap:D,onDragStart:a,onDragMove:d,onDragEnd:i,onTransformEnd:r,onMouseEnter:y,onMouseLeave:m,opacity:e.isEditing?0:1,listening:!e.isEditing})}function Ot({object:e,isSelected:o,onSelect:n,onDragStart:a,onDragMove:d,onDragEnd:i,onTransformEnd:r,onEditingChange:h,onMouseEnter:y,onMouseLeave:m,shapeRef:x}){switch(e.type){case"rect":return t.jsx(ue,{id:e.id,ref:v=>{typeof x=="function"?x(v):x&&(x.current=v)},x:e.x,y:e.y,width:e.width,height:e.height,fill:e.fill,stroke:e.stroke,strokeWidth:e.strokeWidth,rotation:e.rotation,draggable:!0,onClick:v=>n(v),onTap:v=>n(v),onDragStart:a,onDragMove:d,onDragEnd:i,onTransformEnd:r,onMouseEnter:y,onMouseLeave:m});case"image":case"huggy":return t.jsx(Wt,{object:e,onSelect:n,onDragStart:a,onDragMove:d,onDragEnd:i,onTransformEnd:r,onMouseEnter:y,onMouseLeave:m,shapeRef:x});case"text":return t.jsx(Pt,{object:e,isSelected:o,onSelect:n,onDragStart:a,onDragMove:d,onDragEnd:i,onTransformEnd:r,onEditingChange:h||(()=>{}),onMouseEnter:y,onMouseLeave:m,shapeRef:x});case"logoPlaceholder":return t.jsx(Bt,{object:e,onSelect:n,onDragStart:a,onDragMove:d,onDragEnd:i,onTransformEnd:r,onMouseEnter:y,onMouseLeave:m,shapeRef:x});default:return null}}function Wt({object:e,onSelect:o,onDragStart:n,onDragMove:a,onDragEnd:d,onTransformEnd:i,onMouseEnter:r,onMouseLeave:h,shapeRef:y}){const[m,x]=u.useState(null),v=u.useRef(null),D=u.useRef(null);return u.useEffect(()=>{const C=new window.Image;return C.src=e.type==="image"||e.type==="huggy"?e.src:"",C.crossOrigin="anonymous",C.onload=()=>{x(C),v.current=C,setTimeout(()=>{if(D.current){const O=D.current.getLayer();O&&O.batchDraw()}},10)},()=>{v.current=null}},[e]),t.jsx(t.Fragment,{children:m&&t.jsx(Xe,{id:e.id,ref:C=>{D.current=C,typeof y=="function"?y(C):y&&(y.current=C)},x:e.x,y:e.y,width:e.width,height:e.height,image:m,rotation:e.rotation,draggable:!0,onClick:C=>o(C),onTap:C=>o(C),onDragStart:n,onDragMove:a,onDragEnd:d,onTransformEnd:i,onMouseEnter:r,onMouseLeave:h})})}function Bt({object:e,onSelect:o,onDragStart:n,onDragMove:a,onDragEnd:d,onTransformEnd:i,onMouseEnter:r,onMouseLeave:h,shapeRef:y}){const m=u.useRef(null);return u.useEffect(()=>{m.current&&e.type==="logoPlaceholder"&&(m.current.cache(),m.current.filters([ae.Filters.Blur]),m.current.blurRadius(e.blurRadius))},[e]),e.type!=="logoPlaceholder"?null:t.jsx(ue,{id:e.id,ref:x=>{m.current=x,typeof y=="function"?y(x):y&&(y.current=x)},x:e.x,y:e.y,width:e.width,height:e.height,fill:"rgba(255, 255, 255, 0.3)",stroke:"rgba(200, 200, 200, 0.5)",strokeWidth:2,rotation:e.rotation,draggable:!0,onClick:x=>o(x),onTap:x=>o(x),onDragStart:n,onDragMove:a,onDragEnd:d,onTransformEnd:i,onMouseEnter:r,onMouseLeave:h})}var de=u,_t=function(o,n,a){const d=de.useRef("loading"),i=de.useRef(),[r,h]=de.useState(0),y=de.useRef(),m=de.useRef(),x=de.useRef();return(y.current!==o||m.current!==n||x.current!==a)&&(d.current="loading",i.current=void 0,y.current=o,m.current=n,x.current=a),de.useLayoutEffect(function(){if(!o)return;var v=document.createElement("img");function D(){v.decode().catch(()=>{}).finally(()=>{d.current="loaded",i.current=v,h(Math.random())})}function C(){d.current="failed",i.current=void 0,h(Math.random())}return v.addEventListener("load",D),v.addEventListener("error",C),n&&(v.crossOrigin=n),a&&(v.referrerPolicy=a),v.src=o,function(){v.removeEventListener("load",D),v.removeEventListener("error",C)}},[o,n,a]),[i.current,d.current]};const At=it(_t);function Ee(e,o,n){return`${n==="black"?"900":e?"bold":"normal"} ${o?"italic":""}`.trim()}function Xt(e,o,n,a,d,i,r){if(!e||o<=0)return 0;try{const h=new ae.Text({text:e,fontSize:n,fontFamily:a,fontStyle:Ee(d,i,r)});let y=0,m=1/0;for(let x=0;x<=e.length;x++){const v=e.substring(0,x);h.text(v);const D=h.width(),C=Math.abs(D-o);C<m&&(m=C,y=x)}return h.destroy(),y}catch(h){return console.error("Error calculating cursor position:",h),e.length}}function jt({canvasSize:e,bgColor:o,objects:n,selectedIds:a,onSelect:d,onObjectsChange:i,textCreationMode:r=!1,onTextCreate:h,stageRef:y,transformerRef:m}){const x=u.useRef(null),v=y||x,D=u.useRef(null),C=m||D,O=u.useRef(new Map),L=u.useRef(null),p=u.useRef(null),[A,F]=u.useState(!1),[_,Z]=u.useState(null),q=u.useRef(null),V=u.useRef(null),T=u.useRef(null),P=u.useRef(new Map),[$,G]=u.useState(null),[W,J]=u.useState(!1),[U,ne]=u.useState({vertical:!1,horizontal:!1}),K=me(e),ee=e==="1200x675"?"twitter":e==="linkedin"?"LinkedIn":"HF",B=o==="seriousLight"?`/assets/backgrounds/bg_sLight_${ee}.png`:o==="light"?`/assets/backgrounds/bg_Light_${ee}.png`:`/assets/backgrounds/bg_dark_${ee}.png`,[j]=At(B,"anonymous");u.useEffect(()=>{(async()=>{if(document.fonts)try{if(await Promise.all([document.fonts.load("bold 100px Bison"),document.fonts.load("bold 100px Inter"),document.fonts.load('400 50px "IBM Plex Mono"')]),await document.fonts.ready,await new Promise(c=>setTimeout(c,50)),F(!0),v.current){const c=v.current.getLayers()[0];c&&c.batchDraw()}}catch(c){console.error("Font loading error:",c),F(!0)}else F(!0)})()},[]),u.useEffect(()=>{if(A&&v.current){const s=v.current.getLayers()[0];s&&s.batchDraw()}},[n,A]);const N=n.find(s=>s.type==="text"&&s.isEditing),ye=Le(n);u.useEffect(()=>{if(!C.current)return;const s=(c=0)=>{if(a.length>0){const l=a.map(g=>O.current.get(g)).filter(g=>g!==void 0);if(l.length>0){C.current.nodes(l),C.current.show(),C.current.forceUpdate();const g=C.current.getLayer();g&&g.batchDraw()}else if(c<10){const g=Math.min(50*(c+1),100);setTimeout(()=>s(c+1),g)}}else C.current.nodes([])};s(0)},[a,n]);const ke=(s,c=!1)=>{c?a.includes(s)?d(a.filter(l=>l!==s)):d([...a,s]):d([s])},oe=u.useRef(null),He=s=>{const c=s.target;oe.current={x:c.x(),y:c.y()},a.length>1&&(P.current.clear(),a.forEach(g=>{const H=O.current.get(g);H&&P.current.set(g,{x:H.x(),y:H.y()})}))},Ce=s=>{const c=s.target,l=s.evt.shiftKey,g=a.length>1;if(l&&!g&&oe.current){const H=oe.current,w=c.x(),S=c.y(),M=Math.abs(w-H.x),I=Math.abs(S-H.y);M>I?c.y(H.y):c.x(H.x)}{const w=K.width/2,S=K.height/2;if(a.length>1){const I=a.map(E=>O.current.get(E)).filter(E=>E!==void 0);if(I.length===a.length&&I.length>1){let E=1/0,X=1/0,Y=-1/0,Q=-1/0;I.forEach(re=>{const Je=re.width(),Ze=re.height(),Ve=re.x(),Qe=re.y(),Ne=Ve,Te=Qe,et=Ne+Je,tt=Te+Ze;E=Math.min(E,Ne),X=Math.min(X,Te),Y=Math.max(Y,et),Q=Math.max(Q,tt)});const te=Y-E,se=Q-X,ie=E+te/2,pe=X+se/2;let le=0,ce=0,xe=!1,fe=!1;l||(Math.abs(ie-w)<10&&(le=w-ie,xe=!0),Math.abs(pe-S)<10&&(ce=S-pe,fe=!0)),xe||fe?(I.forEach(re=>{le!==0&&re.x(re.x()+le),ce!==0&&re.y(re.y()+ce)}),ne({vertical:xe,horizontal:fe})):ne({vertical:!1,horizontal:!1})}}else{const I=c.width(),E=c.height(),X=c.x(),Y=c.y(),Q=X+I/2,te=Y+E/2;let se=X,ie=Y,pe=!1,le=!1,ce=!1;if(l&&oe.current){const xe=Math.abs(X-oe.current.x),fe=Math.abs(Y-oe.current.y);ce=xe>fe}Math.abs(Q-w)<10&&(!l||ce)&&(se=w-I/2,pe=!0),Math.abs(te-S)<10&&(!l||!ce)&&(ie=S-E/2,le=!0),pe||le?(c.x(se),c.y(ie),ne({vertical:pe,horizontal:le})):ne({vertical:!1,horizontal:!1})}}},ze=s=>c=>{const l=c.target;if(oe.current=null,P.current.clear(),ne({vertical:!1,horizontal:!1}),a.length>1&&a.includes(s))T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{const H=n.map(w=>{if(a.includes(w.id)){const S=O.current.get(w.id);if(S)return{...w,x:S.x(),y:S.y()}}return w});i(H),T.current=null},10);else{const H=n.map(w=>w.id===s?{...w,x:l.x(),y:l.y()}:w);i(H)}},Ie=s=>c=>{const l=c.target,g=l.scaleX(),H=l.scaleY();if(a.length>1)V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{const S=n.map(M=>{if(a.includes(M.id)){const I=O.current.get(M.id);if(I){const E=I.scaleX(),X=I.scaleY();I.scaleX(1),I.scaleY(1);const Y={...M,x:I.x(),y:I.y(),width:Math.max(5,I.width()*E),height:Math.max(5,I.height()*X),rotation:I.rotation()};if(M.type==="text"){const Q=Math.min(E,X),te=Math.max(10,M.fontSize*Q);return{...Y,fontSize:te,isFixedSize:!0}}return Y}}return M});i(S),V.current=null},10);else{l.scaleX(1),l.scaleY(1);const S=n.map(M=>{if(M.id===s){const I={...M,x:l.x(),y:l.y(),width:Math.max(5,l.width()*g),height:Math.max(5,l.height()*H),rotation:l.rotation()};if(M.type==="text"){const E=Math.min(g,H),X=Math.max(10,M.fontSize*E);return{...I,fontSize:X,isFixedSize:!0}}return I}return M});i(S)}},we=(s,c,l,g)=>{const H=n.map(w=>w.id===s&&w.type==="text"?{...w,text:c,width:l,height:g}:w);i(H)},he=(s,c,l,g)=>{if(!c){const w=n.find(S=>S.id===s&&S.type==="text");if(w&&w.text.trim()===""){const S=n.filter(M=>M.id!==s);i(S);return}}const H=n.map(w=>w.id===s&&w.type==="text"?{...w,isEditing:c,isFixedSize:c?w.isFixedSize:!0}:w);if(i(H),c&&l!==void 0&&g!==void 0){const w=n.find(S=>S.id===s&&S.type==="text");if(w){const S=Xt(w.text,l,w.fontSize,w.fontFamily,w.bold,w.italic,w.fontWeight);p.current=S}}else c&&(p.current=null)};u.useEffect(()=>{if(N&&L.current)if(L.current.focus(),p.current!==null){const s=p.current;L.current.setSelectionRange(s,s),p.current=null}else{const s=L.current.value.length;L.current.setSelectionRange(s,s)}},[N==null?void 0:N.id]);const $e=s=>{if(!N)return;const c=s.target.value;try{const l=new ae.Text({text:c||"M",fontSize:N.fontSize,fontFamily:N.fontFamily,fontStyle:Ee(N.bold,N.italic,N.fontWeight)}),g=Math.max(100,l.width()+20),H=Math.max(40,l.height()+10);l.destroy(),we(N.id,c,g,H)}catch(l){console.error("Error in textarea change:",l),we(N.id,c,N.width,N.height)}},ve=()=>{N&&he(N.id,!1)},be=N?(()=>{if(!N||!v.current)return{top:0,left:0};const l=v.current.container().getBoundingClientRect();return{top:l.top+N.y,left:l.left+N.x}})():{top:0,left:0},Me=s=>{if(!s.isFixedSize||!s.text)return s.fontSize;try{const c=new ae.Text({text:s.text,fontSize:s.fontSize,fontFamily:s.fontFamily,fontStyle:Ee(s.bold,s.italic,s.fontWeight),width:s.width,height:s.height});let l=s.fontSize;const g=s.width,H=s.height;for(;l>10;){c.fontSize(l);const w=c.measureSize(s.text);if(w.width<=g&&w.height<=H)break;l-=1}return c.destroy(),l}catch{return s.fontSize}},b=s=>{if(s.target!==s.target.getStage()||r)return;const c=s.target.getStage(),l=c==null?void 0:c.getPointerPosition();l&&(q.current=l,Z({x:l.x,y:l.y,width:0,height:0}))},f=s=>{if(!q.current)return;const c=s.target.getStage(),l=c==null?void 0:c.getPointerPosition();if(l){const g=q.current;Z({x:Math.min(g.x,l.x),y:Math.min(g.y,l.y),width:Math.abs(l.x-g.x),height:Math.abs(l.y-g.y)})}},k=s=>{if(!q.current)return;if(_&&(_.width>5||_.height>5)){const l=[];n.forEach(g=>{const H={x:g.x,y:g.y,width:g.width,height:g.height};!(_.x>H.x+H.width||_.x+_.width<H.x||_.y>H.y+H.height||_.y+_.height<H.y)&&l.push(g.id)}),l.length>0?d(l):d([])}else s.target===s.target.getStage()&&d([]);q.current=null,Z(null)};return t.jsxs("div",{onMouseEnter:()=>J(!0),onMouseLeave:()=>J(!1),style:{width:K.width,height:K.height,backgroundImage:j?`url(${B})`:"none",backgroundColor:j?"transparent":"#ffffff",backgroundSize:"cover",backgroundPosition:"center",border:"1px solid #EBEBEB",borderRadius:W?"0px":"10px",boxShadow:"0 4px 6px -2px rgba(5, 32, 81, 0.04), 0 12px 16px -4px rgba(5, 32, 81, 0.09)",overflow:"hidden",transition:"width 0.15s ease-in-out, height 0.15s ease-in-out, border-radius 0.15s ease-in-out"},children:[t.jsx(st,{ref:v,width:K.width,height:K.height,onMouseDown:b,onMouseMove:f,onMouseUp:k,onClick:s=>{if(s.target===s.target.getStage()&&r&&h){const c=s.target.getStage(),l=c==null?void 0:c.getPointerPosition();l&&h(l.x,l.y)}},style:{cursor:r?"text":"default"},children:t.jsxs(rt,{children:[j?t.jsx(Xe,{x:0,y:0,width:K.width,height:K.height,image:j,listening:!1}):t.jsx(ue,{x:0,y:0,width:K.width,height:K.height,fill:"#ffffff",listening:!1}),ye.map(s=>t.jsx(Ot,{object:s,isSelected:a.includes(s.id),onSelect:c=>{var g;const l=((g=c==null?void 0:c.evt)==null?void 0:g.shiftKey)||!1;ke(s.id,l)},onDragStart:He,onDragMove:Ce,onDragEnd:ze(s.id),onTransformEnd:Ie(s.id),onEditingChange:he,onMouseEnter:()=>G(s.id),onMouseLeave:()=>G(null),shapeRef:c=>{c?O.current.set(s.id,c):O.current.delete(s.id)}},s.id)),_&&t.jsx(ue,{x:_.x,y:_.y,width:_.width,height:_.height,fill:"rgba(63, 174, 230, 0.1)",stroke:"#3faee6",strokeWidth:1,dash:[5,5],listening:!1}),U.vertical&&t.jsx(ue,{x:K.width/2,y:0,width:1,height:K.height,fill:"#FF6B6B",listening:!1,opacity:.8}),U.horizontal&&t.jsx(ue,{x:0,y:K.height/2,width:K.width,height:1,fill:"#FF6B6B",listening:!1,opacity:.8}),$&&!a.includes($)&&(()=>{const s=O.current.get($);if(s){const c=s.getClientRect();return t.jsx(ue,{x:c.x,y:c.y,width:c.width,height:c.height,stroke:"#3faee6",strokeWidth:1,dash:[4,4],listening:!1,opacity:.5})}return null})(),t.jsx(at,{ref:C,keepRatio:!0,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!0,anchorSize:8,anchorCornerRadius:2,borderStroke:"#3faee6",borderStrokeWidth:2,anchorStroke:"#3faee6",anchorFill:"#ffffff",anchorStrokeWidth:2,boundBoxFunc:(s,c)=>c.width<5||c.height<5?s:c})]})}),N&&t.jsx("textarea",{ref:L,value:N.text,onChange:$e,onBlur:ve,onKeyDown:s=>{s.key==="Escape"&&ve()},style:{position:"fixed",top:`${be.top}px`,left:`${be.left}px`,width:`${N.width}px`,height:`${N.height}px`,fontSize:`${N.isFixedSize?Me(N):N.fontSize}px`,fontFamily:N.fontFamily,fontWeight:N.bold?"bold":"normal",fontStyle:N.italic?"italic":"normal",color:N.fill,background:"transparent",border:"none",borderRadius:"0",padding:"0",margin:"0",resize:"none",outline:"none",overflow:"hidden",lineHeight:"1",verticalAlign:"top",zIndex:999,pointerEvents:"auto",boxSizing:"border-box"}})]})}function Yt(){return t.jsx("div",{style:{width:"18px",height:"18px",borderRadius:"999px",border:"1px solid #e5e9ed",background:"linear-gradient(180deg, #ffffff 27.928%, #e7e9f5 100%)",overflow:"hidden"}})}function Ut(){return t.jsx("div",{style:{width:"18px",height:"18px",borderRadius:"999px",border:"1px solid #e5e9ed",background:"linear-gradient(135deg, rgba(232, 199, 255, 0.8) 0%, rgba(173, 216, 255, 0.8) 100%)",overflow:"hidden"}})}function Gt(){return t.jsx("div",{style:{width:"18px",height:"18px",borderRadius:"999px",border:"1px solid #e5e9ed",background:"linear-gradient(130.786deg, rgba(147, 28, 186, 1) 15.907%, rgba(26, 26, 48, 1) 52.739%, rgba(4, 107, 226, 1) 90.547%)",overflow:"hidden"}})}function Kt({bgColor:e,onChange:o}){const[n,a]=u.useState(null);return t.jsxs("div",{className:"flex items-center gap-[9px] lg:gap-[10px]",children:[t.jsx("span",{className:"text-[#999999] text-[14px] lg:text-[16px] font-normal",style:{fontFamily:"Inter, sans-serif"},children:"Background color:"}),t.jsxs("div",{className:"flex items-center gap-[4.5px] lg:gap-[5px] h-[36px] lg:h-[40px] p-[3.6px] lg:p-[4px] bg-[#EDF0F2] border border-[#F8F9FA] rounded-[99px]",children:[t.jsx("button",{onClick:()=>o("seriousLight"),onMouseEnter:()=>a("seriousLight"),onMouseLeave:()=>a(null),className:"flex items-center justify-center w-[34px] lg:w-[38px] h-[29px] lg:h-[32px] p-[9px] lg:p-[10px] border-none rounded-[99px] cursor-pointer transition-[background] duration-150 ease-in-out",style:{background:e==="seriousLight"?"#DEE2E7":n==="seriousLight"?"#f0f2f4":"transparent"},title:"Serious Light background",children:t.jsx(Yt,{})}),t.jsx("button",{onClick:()=>o("light"),onMouseEnter:()=>a("light"),onMouseLeave:()=>a(null),className:"flex items-center justify-center w-[34px] lg:w-[38px] h-[29px] lg:h-[32px] p-[9px] lg:p-[10px] border-none rounded-[99px] cursor-pointer transition-[background] duration-150 ease-in-out",style:{background:e==="light"?"#DEE2E7":n==="light"?"#f0f2f4":"transparent"},title:"Light background with gradients",children:t.jsx(Ut,{})}),t.jsx("button",{onClick:()=>o("dark"),onMouseEnter:()=>a("dark"),onMouseLeave:()=>a(null),className:"flex items-center justify-center w-[34px] lg:w-[38px] h-[29px] lg:h-[32px] p-[9px] lg:p-[10px] border-none rounded-[99px] cursor-pointer transition-[background] duration-150 ease-in-out",style:{background:e==="dark"?"#DEE2E7":n==="dark"?"#f0f2f4":"transparent"},title:"Dark background",children:t.jsx(Gt,{})})]})]})}function qt({selected:e=!1}){return t.jsx("div",{style:{position:"relative",width:"16px",height:"16px"},children:t.jsx("div",{style:{position:"absolute",inset:"4.17%",width:"calc(100% - 8.34%)",height:"calc(100% - 8.34%)"},children:t.jsx("img",{alt:"X",style:{display:"block",maxWidth:"none",width:"100%",height:"100%"},src:e?"/assets/sizes/Property 1=selected.svg":"/assets/sizes/Property 1=Default.svg"})})})}function Jt({selected:e=!1}){const o=e?"/assets/sizes/Property 1=selected-1.svg":"/assets/sizes/Property 1=Default-1.svg";return t.jsx("div",{style:{position:"relative",width:"16px",height:"16px"},children:t.jsx("img",{alt:"LinkedIn",style:{display:"block",width:"100%",height:"100%"},src:o})})}function Zt({selected:e=!1}){const o=e?"/assets/sizes/Property 1=selected-2.svg":"/assets/sizes/Property 1=Default-2.svg";return t.jsx("div",{style:{position:"relative",width:"16px",height:"16px"},children:t.jsx("img",{alt:"HF",style:{display:"block",width:"100%",height:"100%"},src:o})})}const Vt={"1200x675":"1200x675",linkedin:"1200x627",hf:"1160x580"};function Qt({canvasSize:e,onChange:o}){const[n,a]=u.useState(null),[d,i]=u.useState(window.innerWidth>=1024);u.useEffect(()=>{const h=()=>{i(window.innerWidth>=1024)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[]);const r=(h,y,m)=>{const x=e===h,v=n===h;return t.jsxs("button",{onClick:()=>o(h),onMouseEnter:()=>a(h),onMouseLeave:()=>a(null),className:"flex items-center border-none rounded-[99px] cursor-pointer overflow-hidden transition-[background,padding,min-width] duration-150 ease-in-out",style:{justifyContent:x?"flex-start":"center",gap:"4.5px",height:d?"32px":"29px",minWidth:d?"38px":"34px",paddingLeft:x?d?"10px":"9px":d?"9px":"8px",paddingRight:x?d?"10px":"9px":d?"9px":"8px",background:x?"#DEE2E7":v?"#f0f2f4":"transparent"},title:m,children:[t.jsx(y,{selected:x}),t.jsx("span",{className:"whitespace-nowrap overflow-hidden transition-[opacity,transform] duration-150 ease-in-out",style:{color:"#32343d",fontSize:d?"16px":"14px",fontWeight:"normal",fontFamily:"Inter, sans-serif",opacity:x?.6:0,transform:x?"translateX(0)":"translateX(-10px)",width:x?"auto":"0"},children:Vt[h]})]})};return t.jsxs("div",{className:"flex items-center gap-[9px] lg:gap-[10px]",children:[t.jsx("span",{className:"text-[#999999] text-[14px] lg:text-[16px] font-normal",style:{fontFamily:"Inter, sans-serif"},children:"Size:"}),t.jsxs("div",{className:"flex items-center gap-[4.5px] lg:gap-[5px] h-[36px] lg:h-[40px] p-[3.6px] lg:p-[4px] bg-[#EDF0F2] border border-[#F8F9FA] rounded-[99px]",children:[r("1200x675",qt,"1200Γ—675 (Default)"),r("linkedin",Jt,"LinkedIn size (1200x627)"),r("hf",Zt,"HF custom size (1160x580)")]})]})}function en({canvasSize:e,bgColor:o,onCanvasSizeChange:n,onBgColorChange:a}){return t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"10px",transition:"all 0.15s ease-in-out"},children:[t.jsx(Kt,{bgColor:o,onChange:a}),t.jsx(Qt,{canvasSize:e,onChange:n})]})}function tn({onKeep:e,onReplace:o,onCancel:n}){return t.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black bg-opacity-50 backdrop-blur-sm",onClick:n,children:t.jsxs("div",{className:"bg-[#2b2d31] rounded-[12px] shadow-2xl max-w-[480px] w-full mx-4 overflow-hidden",onClick:a=>a.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[#3e4044]",children:[t.jsx("h2",{className:"text-white text-[18px] font-semibold",children:"Switch Layout"}),t.jsx("button",{onClick:n,className:"text-gray-400 hover:text-white transition-colors p-1 hover:bg-[#3e4044] rounded",children:t.jsx(Et,{size:20})})]}),t.jsxs("div",{className:"px-6 py-5",children:[t.jsx("p",{className:"text-gray-300 text-[15px] leading-relaxed mb-4",children:"You have custom objects on the canvas. What would you like to do?"}),t.jsxs("div",{className:"space-y-3",children:[t.jsx("div",{className:"bg-[#1e1f22] rounded-[8px] p-4 border border-[#3e4044]",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"w-5 h-5 rounded-full border-2 border-[#5865f2] flex-shrink-0 mt-0.5"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-medium text-[14px] mb-1",children:"Keep my objects"}),t.jsx("p",{className:"text-gray-400 text-[13px]",children:"Add the new layout objects alongside your existing work"})]})]})}),t.jsx("div",{className:"bg-[#1e1f22] rounded-[8px] p-4 border border-[#3e4044]",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"w-5 h-5 rounded-full border-2 border-[#ed4245] flex-shrink-0 mt-0.5"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-medium text-[14px] mb-1",children:"Replace everything"}),t.jsx("p",{className:"text-gray-400 text-[13px]",children:"Remove all objects and load a fresh layout"})]})]})})]})]}),t.jsxs("div",{className:"px-6 py-4 bg-[#1e1f22] flex items-center justify-end gap-3",children:[t.jsx("button",{onClick:n,className:"px-4 py-2 rounded-[6px] text-white text-[14px] font-medium hover:bg-[#3e4044] transition-colors",children:"Cancel"}),t.jsx("button",{onClick:o,className:"px-4 py-2 rounded-[6px] bg-[#ed4245] text-white text-[14px] font-medium hover:bg-[#d13438] transition-colors",children:"Replace"}),t.jsx("button",{onClick:e,className:"px-4 py-2 rounded-[6px] bg-[#5865f2] text-white text-[14px] font-medium hover:bg-[#4752c4] transition-colors",children:"Keep"})]})]})})}function Fe(e){const o=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,a=parseInt(e.slice(5,7),16)/255,d=Math.max(o,n,a),i=Math.min(o,n,a),r=d-i;let h=0;r!==0&&(d===o?h=((n-a)/r+(n<a?6:0))/6:d===n?h=((a-o)/r+2)/6:h=((o-n)/r+4)/6);const y=d===0?0:r/d,m=d;return{h:h*360,s:y*100,v:m*100}}function nn(e,o,n){e=e/360,o=o/100,n=n/100;const a=Math.floor(e*6),d=e*6-a,i=n*(1-o),r=n*(1-d*o),h=n*(1-(1-d)*o);let y=0,m=0,x=0;switch(a%6){case 0:y=n,m=h,x=i;break;case 1:y=r,m=n,x=i;break;case 2:y=i,m=n,x=h;break;case 3:y=i,m=r,x=n;break;case 4:y=h,m=i,x=n;break;case 5:y=n,m=i,x=r;break}const v=D=>{const C=Math.round(D*255).toString(16);return C.length===1?"0"+C:C};return`#${v(y)}${v(m)}${v(x)}`}function on({color:e,onChange:o}){const n=Fe(e),[a,d]=u.useState(n.h),[i,r]=u.useState(n.s),[h,y]=u.useState(n.v),[m,x]=u.useState(e.toUpperCase()),v=u.useRef(null),D=u.useRef(null),C=u.useRef(null),[O,L]=u.useState(!1),[p,A]=u.useState(!1),[F,_]=u.useState(!1),[Z,q]=u.useState(!1);u.useEffect(()=>{if(!Z){const z=nn(a,i,h);x(z.toUpperCase()),o(z)}},[a,i,h,o,Z]);const V=z=>{L(!0),T(z)},T=z=>{if(!v.current)return;const B=v.current.getBoundingClientRect(),j=Math.max(0,Math.min(z.clientX-B.left,B.width)),N=Math.max(0,Math.min(z.clientY-B.top,B.height));r(j/B.width*100),y(100-N/B.height*100)},P=z=>{A(!0),$(z)},$=z=>{if(!D.current)return;const B=D.current.getBoundingClientRect(),j=Math.max(0,Math.min(z.clientX-B.left,B.width));d(j/B.width*360)},G=z=>{_(!0),W(z)},W=z=>{if(!C.current)return;const B=C.current.getBoundingClientRect(),j=Math.max(0,Math.min(z.clientX-B.left,B.width));r(j/B.width*100)};u.useEffect(()=>{const z=j=>{O&&T(j),p&&$(j),F&&W(j)},B=()=>{L(!1),A(!1),_(!1)};if(O||p||F)return document.addEventListener("mousemove",z),document.addEventListener("mouseup",B),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",B)}},[O,p,F]);const J=z=>{q(!0);let B=z.target.value.toUpperCase();if(B.startsWith("#")||(B="#"+B),x(B),/^#[0-9A-F]{6}$/i.test(B)){const j=Fe(B);d(j.h),r(j.s),y(j.v),o(B),q(!1)}},U=async()=>{if(!window.EyeDropper){alert("EyeDropper API is not supported in your browser. Please use Chrome or Edge.");return}try{const j=(await new window.EyeDropper().open()).sRGBHex,N=Fe(j);d(N.h),r(N.s),y(N.v),x(j.toUpperCase()),o(j)}catch{}},ne=i/100*100,K=(1-h/100)*100,ee=a/360*100;return t.jsxs("div",{onMouseDown:z=>z.stopPropagation(),onClick:z=>z.stopPropagation(),style:{position:"absolute",bottom:"calc(100% + 8px)",right:0,width:"280px",backgroundColor:"#252525",border:"1px solid #1b1b1b",borderRadius:"8px",padding:"16px",boxShadow:"0 4px 6px -2px rgba(0, 0, 0, 0.1), 0 12px 16px -4px rgba(0, 0, 0, 0.17)",zIndex:1e3},children:[t.jsx("div",{ref:v,onMouseDown:V,style:{position:"relative",width:"100%",height:"112px",borderRadius:"8px",marginBottom:"16px",cursor:"crosshair",background:`
55
+ linear-gradient(to bottom, transparent, black),
56
+ linear-gradient(to right, white, transparent),
57
+ hsl(${a}, 100%, 50%)
58
+ `},children:t.jsx("div",{style:{position:"absolute",left:`${ne}%`,top:`${K}%`,width:"12px",height:"12px",border:"2px solid white",borderRadius:"50%",transform:"translate(-50%, -50%)",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.3)",pointerEvents:"none"}})}),t.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:"16px"},children:[t.jsx("button",{onClick:U,title:"Pick color from screen",style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:"rgba(255, 255, 255, 0.05)",border:"1px solid rgba(255, 255, 255, 0.1)",flexShrink:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:t.jsx(Dt,{size:14,color:"white"})}),t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"8px"},children:[t.jsx("div",{ref:D,onMouseDown:P,style:{position:"relative",width:"100%",height:"12px",borderRadius:"100px",background:"linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)",cursor:"pointer"},children:t.jsx("div",{style:{position:"absolute",left:`${ee}%`,top:"50%",width:"12px",height:"12px",border:"2px solid white",borderRadius:"50%",transform:"translate(-50%, -50%)",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.3)",pointerEvents:"none"}})}),t.jsx("div",{ref:C,onMouseDown:G,style:{position:"relative",width:"100%",height:"12px",borderRadius:"100px",background:`linear-gradient(to right, white, hsl(${a}, 100%, 50%))`,cursor:"pointer"},children:t.jsx("div",{style:{position:"absolute",left:`${i}%`,top:"50%",width:"12px",height:"12px",border:"2px solid white",borderRadius:"50%",transform:"translate(-50%, -50%)",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.3)",pointerEvents:"none"}})})]})]}),t.jsxs("div",{style:{display:"flex",gap:"4px"},children:[t.jsx("div",{style:{padding:"8px",borderRadius:"8px",color:"#eeeeee",fontSize:"14px",fontFamily:"Inter, sans-serif",opacity:.8,width:"72px",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"},children:"Hex"}),t.jsx("input",{type:"text",value:m,onChange:J,onBlur:()=>q(!1),onKeyDown:z=>z.stopPropagation(),onKeyUp:z=>z.stopPropagation(),onKeyPress:z=>z.stopPropagation(),maxLength:7,style:{flex:1,padding:"8px 4px",backgroundColor:"#1b1b1b",border:"none",borderRadius:"6px",color:"#eeeeee",fontSize:"12px",fontFamily:"Inter, sans-serif",fontWeight:500,textAlign:"center",outline:"none"},onClick:z=>z.stopPropagation(),onMouseDown:z=>z.stopPropagation()})]})]})}function sn({fontFamily:e,fill:o,bold:n,italic:a,canvasWidth:d,canvasHeight:i,scale:r=1,onFontFamilyChange:h,onFillChange:y,onBoldToggle:m,onItalicToggle:x,fontWeight:v="normal"}){const[D,C]=u.useState(!1),[O,L]=u.useState(!1),[p,A]=u.useState("down"),[F,_]=u.useState(window.innerWidth>=1024),Z=u.useRef(null),q=["Inter","IBM Plex Mono","Bison","Source Sans 3"],V={Inter:{bold:!0,italic:!0,black:!1},"IBM Plex Mono":{bold:!0,italic:!0,black:!1},Bison:{bold:!1,italic:!1,black:!1},"Source Sans 3":{bold:!0,italic:!0,black:!0}},T=V[e].bold,P=V[e].italic,$=V[e].black;u.useEffect(()=>{const z=()=>{_(window.innerWidth>=1024)};return window.addEventListener("resize",z),()=>window.removeEventListener("resize",z)},[]),u.useEffect(()=>{if(D&&Z.current){const z=Z.current.getBoundingClientRect(),B=q.length*40+8,j=window.innerHeight-z.bottom,N=z.top;j<B&&N>j?A("up"):A("down")}},[D,q.length]);const G=d*r,W=i*r,J=80*r,U=`calc((100vw - ${G}px) / 2)`,ne=`calc((100vh - ${W}px - ${J}px) / 2 - 10px - 44px)`,K=F?"4px":"3.6px",ee=F?"4px":"3.6px";return t.jsx("div",{className:"text-toolbar",onMouseDown:z=>{z.stopPropagation()},onClick:z=>{z.stopPropagation()},style:{position:"fixed",right:U,bottom:ne,zIndex:100,backgroundColor:"#27272A",borderRadius:F?"8px":"7px",padding:K,boxShadow:"0 4px 6px -2px rgba(0, 0, 0, 0.1), 0 12px 16px -4px rgba(0, 0, 0, 0.17)",transition:"right 0.15s ease-in-out, bottom 0.15s ease-in-out"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:ee},children:[t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("button",{ref:Z,onClick:()=>{C(!D),L(!1)},style:{display:"flex",alignItems:"center",gap:F?"20px":"18px",padding:F?"8px":"7px",backgroundColor:"rgba(255, 255, 255, 0.05)",border:"none",borderRadius:"4px",color:"white",fontSize:F?"16px":"14px",fontFamily:"Source Sans Pro, sans-serif",cursor:"pointer",whiteSpace:"nowrap"},children:[e,t.jsx($t,{size:F?14:13,style:{transform:D&&p==="up"?"rotate(180deg)":"none",transition:"transform 0.15s ease-in-out"}})]}),D&&t.jsx("div",{style:{position:"absolute",...p==="down"?{top:F?"calc(100% + 4px)":"calc(100% + 3.6px)"}:{bottom:F?"calc(100% + 4px)":"calc(100% + 3.6px)"},left:0,backgroundColor:"#27272A",border:"1px solid #09090B",borderRadius:F?"8px":"7px",padding:F?"4px":"3.6px",minWidth:F?"160px":"144px",zIndex:1e3},children:q.map(z=>t.jsx("button",{onClick:()=>{h(z),C(!1)},style:{display:"block",width:"100%",padding:F?"8px 12px":"7px 11px",backgroundColor:e===z?"rgba(255, 255, 255, 0.1)":"transparent",border:"none",borderRadius:"4px",color:"white",fontSize:F?"14px":"13px",fontFamily:z,textAlign:"left",cursor:"pointer"},onMouseEnter:B=>{e!==z&&(B.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.05)")},onMouseLeave:B=>{e!==z&&(B.currentTarget.style.backgroundColor="transparent")},children:z},z))})]}),t.jsx("div",{style:{width:"1px",height:F?"18px":"16px",backgroundColor:"rgba(255, 255, 255, 0.2)"}}),t.jsxs("div",{style:{position:"relative"},children:[t.jsx("button",{onClick:()=>{L(!O),C(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:F?"10px":"9px",backgroundColor:"transparent",border:"none",borderRadius:"99px",cursor:"pointer"},children:t.jsx("div",{style:{width:F?"16px":"14px",height:F?"16px":"14px",borderRadius:"999px",backgroundColor:o,border:"1px solid #e5e9ed"}})}),O&&t.jsx(on,{color:o,onChange:y})]}),t.jsxs("button",{onClick:T?()=>{m(),C(!1),L(!1)}:void 0,disabled:!T,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:F?"8px":"7px",backgroundColor:n||v==="black"?"rgba(255, 255, 255, 0.1)":"transparent",border:"none",borderRadius:"4px",cursor:T?"pointer":"not-allowed",color:"white",opacity:T?1:.3},children:[t.jsx(It,{size:F?20:18}),$&&v==="black"&&t.jsx("div",{style:{position:"absolute",bottom:"2px",right:"2px",width:F?"6px":"5px",height:F?"6px":"5px",borderRadius:"50%",backgroundColor:"#3faee6"}})]}),t.jsx("button",{onClick:P?()=>{x(),C(!1),L(!1)}:void 0,disabled:!P,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:F?"8px":"7px",backgroundColor:a?"rgba(255, 255, 255, 0.1)":"transparent",border:"none",borderRadius:"4px",cursor:P?"pointer":"not-allowed",color:"white",opacity:P?1:.3},children:t.jsx(Ft,{size:F?20:18})})]})})}const rn=50;function an(){const[e,o]=u.useState([]),[n,a]=u.useState([]),[d,i]=u.useState("1200x675"),[r,h]=u.useState("seriousLight"),y=u.useRef([[]]),m=u.useRef(0),x=u.useRef(!1),v=u.useRef(!1),D=u.useCallback(T=>{o(T),!x.current&&setTimeout(()=>{if(v.current)return;m.current<y.current.length-1&&(y.current=y.current.slice(0,m.current+1));const P=J=>J.map(U=>{if(U.type==="text"){const{isEditing:ne,isFixedSize:K,...ee}=U;return ee}return U}),$=P(T),G=y.current[m.current]?P(y.current[m.current]):[];if(JSON.stringify(G)!==JSON.stringify($)){const J=JSON.parse(JSON.stringify($));console.log("Recording history:",{textObjects:J.filter(U=>U.type==="text").map(U=>({text:U.text,width:U.width,height:U.height,fontSize:U.fontSize}))}),y.current.push(J),m.current++,y.current.length>rn&&(y.current.shift(),m.current--)}},0)},[]),C=u.useCallback(()=>{if(m.current>0){x.current=!0,m.current--;const P=JSON.parse(JSON.stringify(y.current[m.current])).map($=>{if($.type==="text"&&$.text)try{const G=require("konva").default,W=new G.Text({text:$.text,fontSize:$.fontSize,fontFamily:$.fontFamily,fontStyle:`${$.bold?"bold":"normal"} ${$.italic?"italic":""}`}),J=Math.max(100,W.width()+20),U=Math.max(40,W.height()+10);return console.log("UNDO - Recalculating text:",{text:$.text,oldWidth:$.width,oldHeight:$.height,newWidth:J,newHeight:U,fontSize:$.fontSize,fontFamily:$.fontFamily}),W.destroy(),{...$,width:J,height:U,isEditing:!1}}catch(G){return console.error("Error recalculating text dimensions:",G),$}return $});o(P),a([]),setTimeout(()=>{x.current=!1},0)}},[]),O=u.useCallback(()=>{if(m.current<y.current.length-1){x.current=!0,m.current++;const P=JSON.parse(JSON.stringify(y.current[m.current])).map($=>{if($.type==="text"&&$.text)try{const G=require("konva").default,W=new G.Text({text:$.text,fontSize:$.fontSize,fontFamily:$.fontFamily,fontStyle:`${$.bold?"bold":"normal"} ${$.italic?"italic":""}`}),J=Math.max(100,W.width()+20),U=Math.max(40,W.height()+10);return W.destroy(),{...$,width:J,height:U,isEditing:!1}}catch(G){return console.error("Error recalculating text dimensions:",G),$}return $});o(P),a([]),setTimeout(()=>{x.current=!1},0)}},[]),L=T=>{const P={...T,id:Ke(),zIndex:De(e)};D([...e,P]),a([P.id])},p=()=>{n.length>0&&(D(e.filter(T=>!n.includes(T.id))),a([]))},A=T=>{n.length>0&&D(e.map(P=>n.includes(P.id)?{...P,...T}:P))},F=T=>{const P=De(e);D(e.map($=>$.id===T?{...$,zIndex:P}:$))},_=T=>{const P=Math.min(...e.map($=>$.zIndex));D(e.map($=>$.id===T?{...$,zIndex:P-1}:$))},Z=T=>{const P=e.find(W=>W.id===T);if(!P)return;const $=e.filter(W=>W.zIndex>P.zIndex);if($.length===0)return;const G=Math.min(...$.map(W=>W.zIndex));D(e.map(W=>W.id===T?{...W,zIndex:G+.5}:W))},q=T=>{const P=e.find(W=>W.id===T);if(!P)return;const $=e.filter(W=>W.zIndex<P.zIndex);if($.length===0)return;const G=Math.max(...$.map(W=>W.zIndex));D(e.map(W=>W.id===T?{...W,zIndex:G-.5}:W))},V=u.useCallback(T=>{v.current=T},[]);return{objects:e,selectedIds:n,canvasSize:d,bgColor:r,setObjects:D,setSelectedIds:a,setCanvasSize:i,setBgColor:h,addObject:L,deleteSelected:p,updateSelected:A,bringToFront:F,sendToBack:_,moveForward:Z,moveBackward:q,undo:C,redo:O,setSkipHistoryRecording:V}}function ln(e,o){const[n,a]=u.useState(1),[d,i]=u.useState(!0);return u.useEffect(()=>{const r=()=>{const h=window.innerWidth,y=window.innerHeight,m=187,x=200,v=h-m,D=y-x,C=v/e,O=D/o,L=Math.min(C,O,1),p=L>=1;a(L),i(p)};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e,o]),{scale:n,canFit:d}}function qe(e,o,n,a){const d=e.map(i=>{const r=" ";let h=[`${r}{`,`${r} id: '${i.id}',`,`${r} type: '${i.type}',`,`${r} x: ${i.x},`,`${r} y: ${i.y},`,`${r} width: ${i.width},`,`${r} height: ${i.height},`,`${r} rotation: ${i.rotation},`,`${r} zIndex: ${i.zIndex},`];return i.type==="text"?(h.push(`${r} text: '${i.text}',`),h.push(`${r} fontSize: ${i.fontSize},`),h.push(`${r} fontFamily: '${i.fontFamily}',`),h.push(`${r} fill: '${i.fill}',`),h.push(`${r} bold: ${i.bold},`),h.push(`${r} italic: ${i.italic},`),i.align&&h.push(`${r} align: '${i.align}',`),i.isFixedSize&&h.push(`${r} isFixedSize: ${i.isFixedSize},`),i.fontWeight&&i.fontWeight!=="normal"&&h.push(`${r} fontWeight: '${i.fontWeight}',`)):i.type==="image"||i.type==="huggy"?(h.push(`${r} src: '${i.src}',`),h.push(`${r} name: '${i.name||"Untitled"}',`)):i.type==="rect"&&(h.push(`${r} fill: '${i.fill}',`),i.stroke&&h.push(`${r} stroke: '${i.stroke}',`),i.strokeWidth!==void 0&&h.push(`${r} strokeWidth: ${i.strokeWidth},`)),h.push(`${r}},`),h.join(`
59
+ `)}).join(`
60
+ `);return` ${o}: {
61
+ id: '${o}',
62
+ name: '${n}',
63
+ thumbnail: '${a}',
64
+ objects: [
65
+ ${d}
66
+ ],
67
+ },`}function cn(e){console.group("πŸ“ Canvas Objects Export"),console.log(`Total objects: ${e.length}`),console.log("Object types:",e.map(n=>n.type).join(", ")),console.group("πŸ” Individual Objects"),e.forEach((n,a)=>{console.group(`${a+1}. ${n.type.toUpperCase()}: ${n.id}`),console.log("Position:",{x:n.x,y:n.y}),console.log("Size:",{width:n.width,height:n.height}),console.log("Rotation:",n.rotation),console.log("Z-Index:",n.zIndex),n.type==="text"?(console.log("Text:",n.text),console.log("Font:",`${n.fontSize}px ${n.fontFamily}`),console.log("Color:",n.fill),console.log("Styles:",{bold:n.bold,italic:n.italic,fontWeight:n.fontWeight})):n.type==="image"||n.type==="huggy"?(console.log("Source:",n.src),console.log("Name:",n.name)):n.type==="rect"&&(console.log("Fill:",n.fill),n.stroke&&console.log("Stroke:",n.stroke)),console.log("Full object:",n),console.groupEnd()}),console.groupEnd(),console.group("πŸ“‹ Ready for layouts.ts"),console.log("Use the following format:");const o=qe(e,"myNewLayout","My New Layout","/assets/layouts/myNewLayout_thumbnail.png");console.log(o),console.groupEnd(),console.groupEnd()}function dn(e){return JSON.stringify(e,null,2)}function un(){const{objects:e,selectedIds:o,canvasSize:n,bgColor:a,setObjects:d,setSelectedIds:i,setCanvasSize:r,setBgColor:h,addObject:y,deleteSelected:m,undo:x,redo:v,setSkipHistoryRecording:D}=an(),[C,O]=u.useState(!1),[L,p]=u.useState(null),[A,F]=u.useState(!1),[_,Z]=u.useState(!1),[q,V]=u.useState(!1),[T,P]=u.useState(null),[$,G]=u.useState(null),W=u.useRef(null),J=u.useRef(null),U=u.useRef(null),ne=b=>{const f=b.some(k=>k.type==="text"&&k.isEditing);D(f),d(b)},K=b=>{r(b)},ee=me(n),{scale:z}=ln(ee.width,ee.height),B=()=>{console.log("Layout clicked"),p(L==="layout"?null:"layout"),O(!1)},j=()=>{console.log("Huggy clicked"),p(L==="huggy"?null:"huggy"),O(!1)},N=()=>{var b;console.log("Image clicked"),(b=W.current)==null||b.click()},ye=()=>{L==="text"?(O(!1),p(null)):(O(!0),p("text"))},ke=b=>{if(!Oe(b))return;e.some(s=>!s.isFromLayout)?(P(b),V(!0)):oe(b,!1)},oe=(b,f)=>{const k=Oe(b);if(!k)return;const s=e.length>0?Math.max(...e.map(l=>l.zIndex)):0,c=k.objects.map(l=>{const g={...l,id:`${l.id}-${Date.now()}`,isFromLayout:!0,zIndex:f?l.zIndex-s-100:l.zIndex};if(l.type==="text"&&l.text)try{const H=new ae.Text({text:l.text,fontSize:l.fontSize,fontFamily:l.fontFamily,fontStyle:`${l.bold?"bold":"normal"} ${l.italic?"italic":""}`}),w=Math.max(100,H.width()+20),S=Math.max(40,H.height()+10);return H.destroy(),{...g,width:Math.max(l.width,w),height:Math.max(l.height,S)}}catch(H){return console.error("Error recalculating layout text dimensions:",H),g}return g});d(f?[...c,...e]:c),G(b),i([]),p(null)},He=()=>{T&&oe(T,!0),V(!1),P(null)},Ce=()=>{T&&oe(T,!1),V(!1),P(null)},ze=()=>{V(!1),P(null)},Ie=b=>{const f=me(n),k=200,s=Math.floor(Math.random()*200)-100,c=Math.floor(Math.random()*200)-100,l=f.width/2-k/2,g=f.height/2-k/2;y({type:"image",x:l+s,y:g+c,width:k,height:k,src:b.thumbnail,rotation:0,isFromLayout:!1}),p(null)},we=(b,f)=>{y({type:"text",x:b,y:f,width:100,height:80,rotation:0,text:"",fontSize:68,fontFamily:"Inter",fill:"#000000",bold:!1,italic:!1,isFixedSize:!1,isEditing:!1}),O(!1),p(null)},he=(b,f,k)=>{if(!["image/png","image/jpeg","image/jpg","image/webp"].includes(b.type)){alert("Please upload a valid image file (PNG, JPG, or WebP)");return}const c=10*1024*1024;if(b.size>c){alert("File size must be less than 10MB");return}const l=new FileReader;l.onload=g=>{var S;const H=(S=g.target)==null?void 0:S.result,w=new Image;w.onload=()=>{const M=me(n);let I=w.width,E=w.height;const X=Math.max(M.width,M.height),Y=Math.max(I,E);if(Y>X){const ie=X*.5/Y;I=I*ie,E=E*ie}let Q,te;if(f!==void 0&&k!==void 0)Q=f-I/2,te=k-E/2;else{const se=Math.floor(Math.random()*200)-100,ie=Math.floor(Math.random()*200)-100;Q=M.width/2-I/2+se,te=M.height/2-E/2+ie}y({type:"image",x:Q,y:te,width:I,height:E,src:H,rotation:0,isFromLayout:!1})},w.src=H},l.readAsDataURL(b)},$e=b=>{var k;const f=(k=b.target.files)==null?void 0:k[0];f&&he(f),b.target.value=""},ve=b=>{const f=b.target;f.closest(".sidebar-container")||f.closest(".layout-selector")||f.closest(".huggy-menu")||b.dataTransfer.types.includes("Files")&&(b.preventDefault(),F(!0))},Re=b=>{b.preventDefault(),F(!1)},be=b=>{var s;b.preventDefault(),F(!1);const f=b.target;if(f.closest(".sidebar-container")||f.closest(".layout-selector")||f.closest(".huggy-menu"))return;const k=(s=b.dataTransfer.files)==null?void 0:s[0];if(k){const c=document.querySelector(".canvas-container");if(c){const l=c.querySelector(".konvajs-content");if(l){const g=l.getBoundingClientRect(),H=b.clientX-g.left,w=b.clientY-g.top;if(H>=0&&H<=g.width&&w>=0&&w<=g.height){he(k,H,w);return}}}he(k)}},Me=async b=>{if(!J.current){console.error("Stage ref not available");return}Z(!0);try{const f=o;i([]),await new Promise(g=>setTimeout(g,50));const k=J.current,s=window.devicePixelRatio||1,c=k.toDataURL({mimeType:"image/png",quality:1,pixelRatio:s}),l=document.createElement("a");l.download=`${b}.png`,l.href=c,document.body.appendChild(l),l.click(),document.body.removeChild(l),i(f)}catch(f){console.error("Error exporting canvas:",f),alert("Failed to export canvas. Please try again.")}finally{Z(!1)}};return u.useEffect(()=>{const b=f=>{const k=document.querySelector(".canvas-container"),s=document.querySelector(".text-toolbar"),c=k&&k.contains(f.target),l=s&&s.contains(f.target);!c&&!l&&o.length>0&&i([])};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[o,i]),u.useEffect(()=>{const b=f=>{if(!L)return;const k=document.querySelector(".sidebar-container"),s=document.querySelector(".layout-selector"),c=document.querySelector(".huggy-menu"),l=document.querySelector(".text-hint"),g=document.querySelector(".canvas-container");if(g&&g.contains(f.target)&&C)return;const w=k&&!k.contains(f.target),S=!s||!s.contains(f.target),M=!c||!c.contains(f.target),I=!l||!l.contains(f.target);w&&S&&M&&I&&(p(null),O(!1))};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[L,C]),u.useEffect(()=>(window.exportCanvas={log:()=>cn(e),asLayout:(b,f,k)=>{const s=qe(e,b,f,k);return console.log("πŸ“‹ Copy this to layouts.ts:"),console.log(s),s},asJSON:()=>{const b=dn(e);return console.log("πŸ“‹ JSON Export:"),console.log(b),b},objects:()=>e,info:()=>({objectCount:e.length,canvasSize:n,dimensions:ee,bgColor:a,selectedIds:o})},e.length===0&&(console.log("🎨 Canvas Export Utilities loaded! Use these commands:"),console.log(" β€’ exportCanvas.log() - View all objects in detail"),console.log(" β€’ exportCanvas.asLayout(id, name, thumbnail) - Export as layout definition"),console.log(" β€’ exportCanvas.asJSON() - Export as JSON"),console.log(" β€’ exportCanvas.objects() - Get raw objects array"),console.log(" β€’ exportCanvas.info() - Get canvas info")),()=>{delete window.exportCanvas}),[e,n,ee,a,o]),u.useEffect(()=>{const b=f=>{const k=e.some(s=>s.type==="text"&&s.isEditing);if((f.ctrlKey||f.metaKey)&&f.key.toLowerCase()==="z"&&!f.shiftKey&&!k){f.preventDefault(),x();return}if((f.ctrlKey||f.metaKey)&&(f.key.toLowerCase()==="z"&&f.shiftKey||f.key.toLowerCase()==="y")&&!k){f.preventDefault(),v();return}if(!k&&o.length>0&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(f.key)){f.preventDefault();const s=f.shiftKey?10:1,c=e.map(l=>{if(o.includes(l.id)){let g=l.x,H=l.y;switch(f.key){case"ArrowUp":H-=s;break;case"ArrowDown":H+=s;break;case"ArrowLeft":g-=s;break;case"ArrowRight":g+=s;break}return{...l,x:g,y:H}}return l});d(c);return}if((f.key==="Delete"||f.key==="Backspace")&&o.length>0&&!k&&(f.preventDefault(),m()),(f.ctrlKey||f.metaKey)&&f.key.toLowerCase()==="d"&&o.length>0&&!k){f.preventDefault();const s=e.filter(g=>o.includes(g.id)),c=20,l=s.map(g=>({...g,id:Ke(),x:g.x+c,y:g.y+c,zIndex:De(e),isFromLayout:!1}));d([...e,...l]),i(l.map(g=>g.id))}if(o.length>0&&!k){if(f.key==="]"){f.preventDefault();const s=Le(e),c=s.map((g,H)=>o.includes(g.id)?H:-1).filter(g=>g!==-1);if(Math.max(...c)<s.length-1){const g=[...s];for(let w=c.length-1;w>=0;w--){const S=c[w];S<s.length-1&&([g[S],g[S+1]]=[g[S+1],g[S]])}const H=g.map((w,S)=>({...w,zIndex:S}));d(H)}return}if(f.key==="["){f.preventDefault();const s=Le(e),c=s.map((g,H)=>o.includes(g.id)?H:-1).filter(g=>g!==-1);if(Math.min(...c)>0){const g=[...s];for(let w=0;w<c.length;w++){const S=c[w];S>0&&([g[S],g[S-1]]=[g[S-1],g[S]])}const H=g.map((w,S)=>({...w,zIndex:S}));d(H)}return}}if(f.key==="t"||f.key==="T"){const s=f.target;s.tagName!=="INPUT"&&s.tagName!=="TEXTAREA"&&ye()}};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[o,m,e,d,x,v]),t.jsxs("div",{className:"w-full h-full bg-[#F8F9FB] relative dotted-background",style:{overflow:"visible"},onDragOver:ve,onDragLeave:Re,onDrop:be,children:[t.jsx("input",{ref:W,type:"file",accept:"image/png,image/jpeg,image/jpg,image/webp",onChange:$e,style:{display:"none"}}),A&&t.jsx("div",{className:"absolute inset-0 z-50 bg-blue-500 bg-opacity-10 border-4 border-dashed border-blue-500 flex items-center justify-center pointer-events-none",children:t.jsx("div",{className:"bg-white rounded-lg shadow-lg px-8 py-6",children:t.jsx("p",{className:"text-xl font-semibold text-gray-800",children:"Drop your image anywhere to upload"})})}),t.jsx(Ht,{onLayoutClick:B,onHuggyClick:j,onImageClick:N,onTextClick:ye,onSelectLayout:ke,onSelectHuggy:Ie,activeButton:L}),t.jsx(Rt,{onExport:Me,isExporting:_,currentLayout:$,canvasSize:n}),t.jsxs(Nt,{children:[t.jsx(en,{canvasSize:n,bgColor:a,onCanvasSizeChange:K,onBgColorChange:h}),t.jsx(jt,{canvasSize:n,bgColor:a,objects:e,selectedIds:o,onSelect:i,onObjectsChange:ne,textCreationMode:C,onTextCreate:we,stageRef:J,transformerRef:U})]}),q&&t.jsx(tn,{onKeep:He,onReplace:Ce,onCancel:ze}),(()=>{const b=e.filter(S=>S.type==="text"&&(o.includes(S.id)||S.isEditing===!0));if(!(C||b.length>0))return null;const k=b[0],s=(k==null?void 0:k.fontFamily)||"Inter",c=(k==null?void 0:k.fill)||"#000000",l=(k==null?void 0:k.bold)??!1,g=(k==null?void 0:k.italic)??!1,H=(k==null?void 0:k.fontWeight)||"normal",w=me(n);return t.jsx(sn,{fontFamily:s,fontSize:(k==null?void 0:k.fontSize)||68,fill:c,bold:l,italic:g,fontWeight:H,canvasWidth:w.width,canvasHeight:w.height,scale:z,onFontFamilyChange:S=>{const M=e.map(I=>{if(I.type==="text"&&b.some(E=>E.id===I.id))try{const E=new ae.Text({text:I.text||"M",fontSize:I.fontSize,fontFamily:S,fontStyle:`${I.bold?"bold":"normal"} ${I.italic?"italic":""}`}),X=Math.max(100,E.width()+20),Y=Math.max(40,E.height()+10);return E.destroy(),{...I,fontFamily:S,width:X,height:Y}}catch(E){return console.error("Error recalculating text size:",E),{...I,fontFamily:S}}return I});d(M)},onFillChange:S=>{const M=e.map(I=>I.type==="text"&&b.some(E=>E.id===I.id)?{...I,fill:S}:I);d(M)},onBoldToggle:()=>{const S=e.map(M=>{if(M.type==="text"&&b.some(I=>I.id===M.id)){const I=M.fontFamily==="Source Sans 3",E=M.fontWeight||"normal";let X=M.bold,Y="normal";I?E==="normal"&&!M.bold?(X=!0,Y="bold"):E==="bold"||M.bold&&E==="normal"?(X=!0,Y="black"):(X=!1,Y="normal"):(X=!M.bold,Y=X?"bold":"normal");try{const Q=Y==="black"?"900":Y==="bold"?"bold":"normal",te=new ae.Text({text:M.text||"M",fontSize:M.fontSize,fontFamily:M.fontFamily,fontStyle:`${M.italic?"italic":"normal"}`,fontVariant:Q}),se=Math.max(100,te.width()+20),ie=Math.max(40,te.height()+10);return te.destroy(),{...M,bold:X,fontWeight:Y,width:se,height:ie}}catch(Q){return console.error("Error recalculating text size:",Q),{...M,bold:X,fontWeight:Y}}}return M});d(S)},onItalicToggle:()=>{const S=e.map(M=>{if(M.type==="text"&&b.some(I=>I.id===M.id)){const I=!M.italic;try{const E=new ae.Text({text:M.text||"M",fontSize:M.fontSize,fontFamily:M.fontFamily,fontStyle:`${M.bold?"bold":"normal"} ${I?"italic":""}`}),X=Math.max(100,E.width()+20),Y=Math.max(40,E.height()+10);return E.destroy(),{...M,italic:I,width:X,height:Y}}catch(E){return console.error("Error recalculating text size:",E),{...M,italic:I}}}return M});d(S)}})})()]})}Ue(document.getElementById("root")).render(t.jsx(u.StrictMode,{children:t.jsx(un,{})}));
assets/konva-vendor-CFBUcegD.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/react-vendor-DzFEYc3-.js ADDED
The diff for this file is too large to render. See raw diff
 
fonts/Bison-Bold.ttf ADDED
Binary file (28 kB). View file
 
index.html CHANGED
@@ -10,8 +10,17 @@
10
  <link rel="preconnect" href="https://fonts.googleapis.com">
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
12
  <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@400;700&family=Source+Sans+3:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&display=swap" rel="stylesheet">
13
- <script type="module" crossorigin src="/assets/index-UgHUO9ec.js"></script>
14
- <link rel="stylesheet" crossorigin href="/assets/index-Do7FlRwO.css">
 
 
 
 
 
 
 
 
 
15
  </head>
16
  <body>
17
  <div id="root"></div>
 
10
  <link rel="preconnect" href="https://fonts.googleapis.com">
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
12
  <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@400;700&family=Source+Sans+3:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&display=swap" rel="stylesheet">
13
+
14
+ <!-- Preload Bison font -->
15
+ <link rel="preload" href="/fonts/Bison-Bold.ttf" as="font" type="font/ttf" crossorigin>
16
+
17
+ <!-- Preconnect to Hugging Face CDN for faster Huggy image loading -->
18
+ <link rel="preconnect" href="https://datasets-server.huggingface.co" crossorigin>
19
+ <link rel="dns-prefetch" href="https://datasets-server.huggingface.co">
20
+ <script type="module" crossorigin src="/assets/index-CE0TzriE.js"></script>
21
+ <link rel="modulepreload" crossorigin href="/assets/react-vendor-DzFEYc3-.js">
22
+ <link rel="modulepreload" crossorigin href="/assets/konva-vendor-CFBUcegD.js">
23
+ <link rel="stylesheet" crossorigin href="/assets/index-CAxRJOrS.css">
24
  </head>
25
  <body>
26
  <div id="root"></div>