forge-edit 0.1.0-beta.16 → 0.1.0-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4525 +1,2 @@
1
- (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-gray-100:oklch(96.7% .003 264.542);--color-gray-700:oklch(37.3% .034 259.733);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-sm:.25rem;--radius-md:.375rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.-top-2{top:calc(var(--spacing) * -2)}.top-0{top:0}.top-\\[1px\\]{top:1px}.top-\\[calc\\(100\\%\\+4px\\)\\]{top:calc(100% + 4px)}.top-\\[calc\\(100\\%\\+8px\\)\\]{top:calc(100% + 8px)}.top-full{top:100%}.left-0{left:0}.left-1\\/2{left:50%}.left-\\[-7px\\]{left:-7px}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-\\[1\\]{z-index:1}.z-\\[2\\]{z-index:2}.z-\\[3\\]{z-index:3}.z-\\[5\\]{z-index:5}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-1{margin-top:var(--spacing)}.mb-0\\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-2\\.5{height:calc(var(--spacing) * 2.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-40{height:calc(var(--spacing) * 40)}.h-\\[30px\\]{height:30px}.h-full{height:100%}.h-px{height:1px}.max-h-24{max-height:calc(var(--spacing) * 24)}.max-h-\\[220px\\]{max-height:220px}.min-h-\\[60px\\]{min-height:60px}.min-h-\\[120px\\]{min-height:120px}.w-2{width:calc(var(--spacing) * 2)}.w-2\\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-7{width:calc(var(--spacing) * 7)}.w-40{width:calc(var(--spacing) * 40)}.w-\\[1px\\]{width:1px}.w-\\[70px\\]{width:70px}.w-full{width:100%}.max-w-\\[50px\\]{max-width:50px}.min-w-4{min-width:calc(var(--spacing) * 4)}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[28px\\]{min-width:28px}.min-w-\\[110px\\]{min-width:110px}.min-w-\\[130px\\]{min-width:130px}.min-w-\\[150px\\]{min-width:150px}.min-w-\\[160px\\]{min-width:160px}.min-w-\\[180px\\]{min-width:180px}.min-w-\\[200px\\]{min-width:200px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.cursor-s-resize{cursor:s-resize}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-\\[4px\\]{gap:4px}.gap-px{gap:1px}:where(.-space-x-px>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(-1px * var(--tw-space-x-reverse));margin-inline-end:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-\\[\\#ccc\\]>:not(:last-child)){border-color:#ccc}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[2px\\]{border-radius:2px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t-\\[3px\\]{border-top-left-radius:3px;border-top-right-radius:3px}.rounded-b-\\[3px\\]{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-7{border-right-style:var(--tw-border-style);border-right-width:7px}.border-r-8{border-right-style:var(--tw-border-style);border-right-width:8px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-7{border-bottom-style:var(--tw-border-style);border-bottom-width:7px}.border-b-8{border-bottom-style:var(--tw-border-style);border-bottom-width:8px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-7{border-left-style:var(--tw-border-style);border-left-width:7px}.border-l-8{border-left-style:var(--tw-border-style);border-left-width:8px}.border-none{--tw-border-style:none;border-style:none}.border-\\[\\#2c2c2c\\]{border-color:#2c2c2c}.border-\\[\\#4a90d9\\]{border-color:#4a90d9}.border-\\[\\#ccc\\]{border-color:#ccc}.border-\\[\\#d1d5db\\]{border-color:#d1d5db}.border-\\[\\#ddd\\]{border-color:#ddd}.border-\\[\\#eee\\]{border-color:#eee}.border-black{border-color:var(--color-black)}.border-r-transparent{border-right-color:#0000}.border-b-\\[\\#ccc\\]{border-bottom-color:#ccc}.border-b-white{border-bottom-color:var(--color-white)}.border-l-transparent{border-left-color:#0000}.bg-\\[\\#1e1e1e\\]{background-color:#1e1e1e}.bg-\\[\\#888\\]{background-color:#888}.bg-\\[\\#e2e8f0\\]{background-color:#e2e8f0}.bg-\\[\\#e5e7eb\\]{background-color:#e5e7eb}.bg-\\[\\#f0f0f0\\]{background-color:#f0f0f0}.bg-\\[\\#f5f5f5\\]{background-color:#f5f5f5}.bg-\\[rgba\\(74\\,144\\,217\\,0\\.4\\)\\]{background-color:#4a90d966}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/30{background-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.bg-white\\/30{background-color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.bg-\\[linear-gradient\\(rgba\\(0\\,0\\,0\\,0\\.05\\)_1px\\,transparent_1px\\)\\,linear-gradient\\(90deg\\,rgba\\(0\\,0\\,0\\,0\\.05\\)_1px\\,transparent_1px\\)\\]{background-image:linear-gradient(#0000000d 1px,#0000 1px),linear-gradient(90deg,#0000000d 1px,#0000 1px)}.bg-\\[size\\:16px_16px\\]{background-size:16px 16px}.fill-current{fill:currentColor}.fill-none{fill:none}.stroke-black{stroke:var(--color-black)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-\\[5px\\]{padding:5px}.p-\\[10px\\]{padding:10px}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-\\[7px\\]{padding-inline:7px}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pb-0\\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:var(--spacing)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.font-serif{font-family:var(--font-serif)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.leading-\\[1\\.4\\]{--tw-leading:1.4;line-height:1.4}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.text-\\[\\#333\\]{color:#333}.text-\\[\\#666\\]{color:#666}.text-black{color:var(--color-black)}.text-gray-700{color:var(--color-gray-700)}.text-white{color:var(--color-white)}.not-italic{font-style:normal}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.shadow-\\[0_2px_6px_rgba\\(0\\,0\\,0\\,0\\.15\\)\\]{--tw-shadow:0 2px 6px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,0\\.15\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[inset_0_1px_3px_rgba\\(0\\,0\\,0\\,0\\.2\\)\\]{--tw-shadow:inset 0 1px 3px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.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,)}.transition-\\[width\\,height\\]{transition-property:width,height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.group-hover\\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-has-\\[\\.is-open\\]\\:hidden:is(:where(.group):has(.is-open) *){display:none}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:bottom-full:before{content:var(--tw-content);bottom:100%}.before\\:left-1\\/2:before{content:var(--tw-content);left:50%}.before\\:-translate-x-1\\/2:before{content:var(--tw-content);--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.before\\:border-x-\\[5px\\]:before{content:var(--tw-content);border-inline-style:var(--tw-border-style);border-inline-width:5px}.before\\:border-t-0:before{content:var(--tw-content);border-top-style:var(--tw-border-style);border-top-width:0}.before\\:border-b-\\[5px\\]:before{content:var(--tw-content);border-bottom-style:var(--tw-border-style);border-bottom-width:5px}.before\\:border-solid:before{content:var(--tw-content);--tw-border-style:solid;border-style:solid}.before\\:border-x-transparent:before{content:var(--tw-content);border-inline-color:#0000}.before\\:border-b-\\[\\#2c2c2c\\]:before{content:var(--tw-content);border-bottom-color:#2c2c2c}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:bottom-full:after{content:var(--tw-content);bottom:100%}.after\\:left-1\\/2:after{content:var(--tw-content);left:50%}.after\\:-translate-x-1\\/2:after{content:var(--tw-content);--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.after\\:translate-y-\\[1px\\]:after{content:var(--tw-content);--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.after\\:border-x-\\[4px\\]:after{content:var(--tw-content);border-inline-style:var(--tw-border-style);border-inline-width:4px}.after\\:border-t-0:after{content:var(--tw-content);border-top-style:var(--tw-border-style);border-top-width:0}.after\\:border-b-\\[4px\\]:after{content:var(--tw-content);border-bottom-style:var(--tw-border-style);border-bottom-width:4px}.after\\:border-solid:after{content:var(--tw-content);--tw-border-style:solid;border-style:solid}.after\\:border-x-transparent:after{content:var(--tw-content);border-inline-color:#0000}.after\\:border-b-\\[\\#1e1e1e\\]:after{content:var(--tw-content);border-bottom-color:#1e1e1e}.last\\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}.last\\:pr-0:last-child{padding-right:0}@media (hover:hover){.hover\\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\\:border-\\[\\#999\\]:hover{border-color:#999}.hover\\:border-\\[\\#aaa\\]:hover{border-color:#aaa}.hover\\:border-black:hover{border-color:var(--color-black)}.hover\\:bg-\\[\\#e6e6e6\\]:hover{background-color:#e6e6e6}.hover\\:bg-\\[\\#f0f0f0\\]:hover{background-color:#f0f0f0}.hover\\:bg-\\[\\#f5f5f5\\]:hover{background-color:#f5f5f5}.hover\\:bg-\\[\\#f9f9f9\\]:hover{background-color:#f9f9f9}.hover\\:bg-black\\/5:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/5:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:translate-y-px:active{--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.active\\:bg-\\[\\#d0d0d0\\]:active{background-color:#d0d0d0}.active\\:bg-\\[\\#e8e8e8\\]:active{background-color:#e8e8e8}.rtl\\:right-0:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){right:0}.rtl\\:left-1\\/2:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){left:50%}.rtl\\:left-auto:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){left:auto}.rtl\\:-translate-x-1\\/2:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}:where(.rtl\\:divide-x-reverse:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-divide-x-reverse:1}.\\[\\&_blockquote\\]\\:my-2 blockquote{margin-block:calc(var(--spacing) * 2)}.\\[\\&_blockquote\\]\\:border-l-4 blockquote{border-left-style:var(--tw-border-style);border-left-width:4px}.\\[\\&_blockquote\\]\\:border-\\[\\#ccc\\] blockquote{border-color:#ccc}.\\[\\&_blockquote\\]\\:pl-4 blockquote{padding-left:calc(var(--spacing) * 4)}.\\[\\&_blockquote\\]\\:italic blockquote{font-style:italic}.\\[\\&_h1\\]\\:text-2xl h1{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.\\[\\&_h1\\]\\:font-bold h1{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\\[\\&_h2\\]\\:text-xl h2{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\\[\\&_h2\\]\\:font-bold h2{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\\[\\&_h3\\]\\:text-lg h3{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\\[\\&_h3\\]\\:font-bold h3{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\\[\\&_pre\\]\\:rounded pre{border-radius:.25rem}.\\[\\&_pre\\]\\:bg-\\[\\#f4f4f4\\] pre{background-color:#f4f4f4}.\\[\\&_pre\\]\\:p-2 pre{padding:calc(var(--spacing) * 2)}.\\[\\&\\.is-active\\]\\:bg-\\[\\#e5e5e5\\].is-active{background-color:#e5e5e5}.\\[\\&\\.is-open\\]\\:block.is-open{display:block}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
- //#region \0rolldown/runtime.js
3
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
4
- if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
5
- get: ((e) => i[e]).bind(null, d),
6
- enumerable: !(s = n(i, d)) || s.enumerable
7
- });
8
- return e;
9
- }, c = (n, r, o) => (o = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
10
- value: n,
11
- enumerable: !0
12
- }) : o, n));
13
- //#endregion
14
- //#region src/components/shared/Hooks/options.js
15
- function l(e) {
16
- return {
17
- type: e.getAttribute("type") || "light",
18
- placeholder: e.getAttribute("placeholder") || "",
19
- width: e.getAttribute("width") || "100%",
20
- height: e.getAttribute("height") || "300px",
21
- lang: e.getAttribute("lang") || "en",
22
- dir: e.getAttribute("dir") || "ltr"
23
- };
24
- }
25
- //#endregion
26
- //#region node_modules/preact/dist/preact.module.js
27
- var u, d, f, p, m, h, g, _, v, y, b, x, S, C, w = {}, T = [], E = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, D = Array.isArray;
28
- function O(e, t) {
29
- for (var n in t) e[n] = t[n];
30
- return e;
31
- }
32
- function ee(e) {
33
- e && e.parentNode && e.parentNode.removeChild(e);
34
- }
35
- function te(e, t, n) {
36
- var r, i, a, o = {};
37
- for (a in t) a == "key" ? r = t[a] : a == "ref" ? i = t[a] : o[a] = t[a];
38
- if (arguments.length > 2 && (o.children = arguments.length > 3 ? u.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) o[a] === void 0 && (o[a] = e.defaultProps[a]);
39
- return k(e, o, r, i, null);
40
- }
41
- function k(e, t, n, r, i) {
42
- var a = {
43
- type: e,
44
- props: t,
45
- key: n,
46
- ref: r,
47
- __k: null,
48
- __: null,
49
- __b: 0,
50
- __e: null,
51
- __c: null,
52
- constructor: void 0,
53
- __v: i ?? ++f,
54
- __i: -1,
55
- __u: 0
56
- };
57
- return i == null && d.vnode != null && d.vnode(a), a;
58
- }
59
- function ne(e) {
60
- return e.children;
61
- }
62
- function re(e, t) {
63
- this.props = e, this.context = t;
64
- }
65
- function A(e, t) {
66
- if (t == null) return e.__ ? A(e.__, e.__i + 1) : null;
67
- for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
68
- return typeof e.type == "function" ? A(e) : null;
69
- }
70
- function ie(e) {
71
- if (e.__P && e.__d) {
72
- var t = e.__v, n = t.__e, r = [], i = [], a = O({}, t);
73
- a.__v = t.__v + 1, d.vnode && d.vnode(a), pe(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? A(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, P(r, a, i), t.__e = t.__ = null, a.__e != n && j(a);
74
- }
75
- }
76
- function j(e) {
77
- if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
78
- if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
79
- }), j(e);
80
- }
81
- function ae(e) {
82
- (!e.__d && (e.__d = !0) && p.push(e) && !M.__r++ || m != d.debounceRendering) && ((m = d.debounceRendering) || h)(M);
83
- }
84
- function M() {
85
- try {
86
- for (var e, t = 1; p.length;) p.length > t && p.sort(g), e = p.shift(), t = p.length, ie(e);
87
- } finally {
88
- p.length = M.__r = 0;
89
- }
90
- }
91
- function oe(e, t, n, r, i, a, o, s, c, l, u) {
92
- var d, f, p, m, h, g, _ = r && r.__k || T, v = t.length;
93
- for (c = se(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || w, p.__i = d, g = pe(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && he(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = ce(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
94
- return n.__e = h, c;
95
- }
96
- function se(e, t, n, r, i) {
97
- var a, o, s, c, l, u = n.length, d = u, f = 0;
98
- for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = k(null, o, null, null, null) : D(o) ? o = e.__k[a] = k(ne, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = k(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = le(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
99
- if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = A(s)), ge(s, s));
100
- return r;
101
- }
102
- function ce(e, t, n) {
103
- var r, i;
104
- if (typeof e.type == "function") {
105
- for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = ce(r[i], t, n));
106
- return t;
107
- }
108
- e.__e != t && (t && e.type && !t.parentNode && (t = A(e)), t = n.insertBefore(e.__e, t || null));
109
- do
110
- t &&= t.nextSibling;
111
- while (t != null && t.nodeType == 8);
112
- return t;
113
- }
114
- function le(e, t, n, r) {
115
- var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && !(2 & l.__u);
116
- if (l === null && s == null || u && s == l.key && c == l.type) return n;
117
- if (r > +!!u) {
118
- for (i = n - 1, a = n + 1; i >= 0 || a < t.length;) if ((l = t[o = i >= 0 ? i-- : a++]) != null && !(2 & l.__u) && s == l.key && c == l.type) return o;
119
- }
120
- return -1;
121
- }
122
- function ue(e, t, n) {
123
- t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || E.test(t) ? n : n + "px";
124
- }
125
- function de(e, t, n, r, i) {
126
- var a, o;
127
- n: if (t == "style") {
128
- if (typeof n == "string") e.style.cssText = n;
129
- else {
130
- if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ue(e.style, t, "");
131
- if (n) for (t in n) r && n[t] == r[t] || ue(e.style, t, n[t]);
132
- }
133
- } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(b, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[y] = r[y] : (n[y] = x, e.addEventListener(t, a ? C : S, a)) : e.removeEventListener(t, a ? C : S, a);
134
- else {
135
- if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
136
- else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
137
- e[t] = n ?? "";
138
- break n;
139
- } catch {}
140
- typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
141
- }
142
- }
143
- function fe(e) {
144
- return function(t) {
145
- if (this.l) {
146
- var n = this.l[t.type + e];
147
- if (t[v] == null) t[v] = x++;
148
- else if (t[v] < n[y]) return;
149
- return n(d.event ? d.event(t) : t);
150
- }
151
- };
152
- }
153
- function pe(e, t, n, r, i, a, o, s, c, l) {
154
- var u, f, p, m, h, g, _, v, y, b, x, S, C, w, E, te, k = t.type;
155
- if (t.constructor !== void 0) return null;
156
- 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = d.__b) && u(t);
157
- n: if (typeof k == "function") {
158
- f = o.length;
159
- try {
160
- if (y = t.props, b = k.prototype && k.prototype.render, x = (u = k.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? v = (p = t.__c = n.__c).__ = p.__E : (b ? t.__c = p = new k(y, S) : (t.__c = p = new re(y, S), p.constructor = k, p.render = _e), x && x.sub(p), p.state || (p.state = {}), p.__n = r, m = p.__d = !0, p.__h = [], p._sb = []), b && p.__s == null && (p.__s = p.state), b && k.getDerivedStateFromProps != null && (p.__s == p.state && (p.__s = O({}, p.__s)), O(p.__s, k.getDerivedStateFromProps(y, p.__s))), h = p.props, g = p.state, p.__v = t, m) b && k.getDerivedStateFromProps == null && p.componentWillMount != null && p.componentWillMount(), b && p.componentDidMount != null && p.__h.push(p.componentDidMount);
161
- else {
162
- if (b && k.getDerivedStateFromProps == null && y !== h && p.componentWillReceiveProps != null && p.componentWillReceiveProps(y, S), t.__v == n.__v || !p.__e && p.shouldComponentUpdate != null && !1 === p.shouldComponentUpdate(y, p.__s, S)) {
163
- t.__v != n.__v && (p.props = y, p.state = p.__s, p.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {
164
- e && (e.__ = t);
165
- }), T.push.apply(p.__h, p._sb), p._sb = [], p.__h.length && o.push(p), s = A(n);
166
- break n;
167
- }
168
- p.componentWillUpdate != null && p.componentWillUpdate(y, p.__s, S), b && p.componentDidUpdate != null && p.__h.push(function() {
169
- p.componentDidUpdate(h, g, _);
170
- });
171
- }
172
- if (p.context = S, p.props = y, p.__P = e, p.__e = !1, C = d.__r, w = 0, b) p.state = p.__s, p.__d = !1, C && C(t), u = p.render(p.props, p.state, p.context), T.push.apply(p.__h, p._sb), p._sb = [];
173
- else do
174
- p.__d = !1, C && C(t), u = p.render(p.props, p.state, p.context), p.state = p.__s;
175
- while (p.__d && ++w < 25);
176
- p.state = p.__s, p.getChildContext != null && (r = O(O({}, r), p.getChildContext())), b && !m && p.getSnapshotBeforeUpdate != null && (_ = p.getSnapshotBeforeUpdate(h, g)), E = u != null && u.type === ne && u.key == null ? me(u.props.children) : u, s = oe(e, D(E) ? E : [E], t, n, r, i, a, o, s, c, l), p.base = t.__e, t.__u &= -161, p.__h.length && o.push(p), v && (p.__E = p.__ = null);
177
- } catch (e) {
178
- if (o.length = f, t.__v = null, c || a != null) {
179
- if (e.then) {
180
- for (t.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling;) s = s.nextSibling;
181
- a != null && (a[a.indexOf(s)] = null), t.__e = s;
182
- } else if (a != null) for (te = a.length; te--;) ee(a[te]);
183
- } else t.__e = n.__e;
184
- t.__k ??= n.__k || [], e.then || N(t), d.__e(e, t, n);
185
- }
186
- } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = F(n.__e, t, n, r, i, a, o, c, l);
187
- return (u = d.diffed) && u(t), 128 & t.__u ? void 0 : s;
188
- }
189
- function N(e) {
190
- e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(N));
191
- }
192
- function P(e, t, n) {
193
- for (var r = 0; r < n.length; r++) he(n[r], n[++r], n[++r]);
194
- d.__c && d.__c(t, e), e.some(function(t) {
195
- try {
196
- e = t.__h, t.__h = [], e.some(function(e) {
197
- e.call(t);
198
- });
199
- } catch (e) {
200
- d.__e(e, t.__v);
201
- }
202
- });
203
- }
204
- function me(e) {
205
- return typeof e != "object" || !e || e.__b > 0 ? e : D(e) ? e.map(me) : e.constructor === void 0 ? O({}, e) : null;
206
- }
207
- function F(e, t, n, r, i, a, o, s, c) {
208
- var l, f, p, m, h, g, _, v = n.props || w, y = t.props, b = t.type;
209
- if (b == "svg" ? i = "http://www.w3.org/2000/svg" : b == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i ||= "http://www.w3.org/1999/xhtml", a != null) {
210
- for (l = 0; l < a.length; l++) if ((h = a[l]) && "setAttribute" in h == !!b && (b ? h.localName == b : h.nodeType == 3)) {
211
- e = h, a[l] = null;
212
- break;
213
- }
214
- }
215
- if (e == null) {
216
- if (b == null) return document.createTextNode(y);
217
- e = document.createElementNS(i, b, y.is && y), s &&= (d.__m && d.__m(t, a), !1), a = null;
218
- }
219
- if (b == null) v === y || s && e.data == y || (e.data = y);
220
- else {
221
- if (a = b == "textarea" && y.defaultValue != null ? null : a && u.call(e.childNodes), !s && a != null) for (v = {}, l = 0; l < e.attributes.length; l++) v[(h = e.attributes[l]).name] = h.value;
222
- for (l in v) h = v[l], l == "dangerouslySetInnerHTML" ? p = h : l == "children" || l in y || l == "value" && "defaultValue" in y || l == "checked" && "defaultChecked" in y || de(e, l, null, h, i);
223
- for (l in y) h = y[l], l == "children" ? m = h : l == "dangerouslySetInnerHTML" ? f = h : l == "value" ? g = h : l == "checked" ? _ = h : s && typeof h != "function" || v[l] === h || de(e, l, h, v[l], i);
224
- if (f) s || p && (f.__html == p.__html || f.__html == e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
225
- else if (p && (e.innerHTML = ""), oe(t.type == "template" ? e.content : e, D(m) ? m : [m], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && A(n, 0), s, c), a != null) for (l = a.length; l--;) ee(a[l]);
226
- s && b != "textarea" || (l = "value", b == "progress" && g == null ? e.removeAttribute("value") : g != null && (g !== e[l] || b == "progress" && !g || b == "option" && g != v[l]) && de(e, l, g, v[l], i), l = "checked", _ != null && _ != e[l] && de(e, l, _, v[l], i));
227
- }
228
- return e;
229
- }
230
- function he(e, t, n) {
231
- try {
232
- if (typeof e == "function") {
233
- var r = typeof e.__u == "function";
234
- r && e.__u(), r && t == null || (e.__u = e(t));
235
- } else e.current = t;
236
- } catch (e) {
237
- d.__e(e, n);
238
- }
239
- }
240
- function ge(e, t, n) {
241
- var r, i;
242
- if (d.unmount && d.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || he(r, null, t)), (r = e.__c) != null) {
243
- if (r.componentWillUnmount) try {
244
- r.componentWillUnmount();
245
- } catch (e) {
246
- d.__e(e, t);
247
- }
248
- r.base = r.__P = r.__n = null;
249
- }
250
- if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && ge(r[i], t, n || typeof e.type != "function");
251
- n || ee(e.__e), e.__c = e.__ = e.__e = void 0;
252
- }
253
- function _e(e, t, n) {
254
- return this.constructor(e, n);
255
- }
256
- function I(e, t, n) {
257
- var r, i, a, o;
258
- t == document && (t = document.documentElement), d.__ && d.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], pe(t, e = (!r && n || t).__k = te(ne, null, [e]), i || w, w, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? u.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), P(a, e, o), e.props.children = null;
259
- }
260
- u = T.slice, d = { __e: function(e, t, n, r) {
261
- for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {
262
- if ((a = i.constructor) && a.getDerivedStateFromError != null && (i.setState(a.getDerivedStateFromError(e)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(e, r || {}), o = i.__d), o) return i.__E = i;
263
- } catch (t) {
264
- e = t;
265
- }
266
- throw e;
267
- } }, f = 0, re.prototype.setState = function(e, t) {
268
- var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = O({}, this.state);
269
- typeof e == "function" && (e = e(O({}, n), this.props)), e && O(n, e), e != null && this.__v && (t && this._sb.push(t), ae(this));
270
- }, re.prototype.forceUpdate = function(e) {
271
- this.__v && (this.__e = !0, e && this.__h.push(e), ae(this));
272
- }, re.prototype.render = ne, p = [], h = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, g = function(e, t) {
273
- return e.__v.__b - t.__v.__b;
274
- }, M.__r = 0, _ = Math.random().toString(8), v = "__d" + _, y = "__a" + _, b = /(PointerCapture)$|Capture$/i, x = 0, S = fe(!1), C = fe(!0);
275
- //#endregion
276
- //#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
277
- var L = 0;
278
- Array.isArray;
279
- function R(e, t, n, r, i, a) {
280
- t ||= {};
281
- var o, s, c = t;
282
- if ("ref" in c) for (s in c = {}, t) s == "ref" ? o = t[s] : c[s] = t[s];
283
- var l = {
284
- type: e,
285
- props: c,
286
- key: n,
287
- ref: o,
288
- __k: null,
289
- __: null,
290
- __b: 0,
291
- __e: null,
292
- __c: null,
293
- constructor: void 0,
294
- __v: --L,
295
- __i: -1,
296
- __u: 0,
297
- __source: i,
298
- __self: a
299
- };
300
- if (typeof e == "function" && (o = e.defaultProps)) for (s in o) c[s] === void 0 && (c[s] = o[s]);
301
- return d.vnode && d.vnode(l), l;
302
- }
303
- //#endregion
304
- //#region src/components/shared/toolbar/Style/Components/StyleToolbar.jsx
305
- function ve() {
306
- let e = "forge-dropdown-item block w-full text-left cursor-pointer whitespace-nowrap px-3 py-1 text-[#333] no-underline transition-colors duration-100 hover:bg-[#f0f0f0]";
307
- return /* @__PURE__ */ R("div", {
308
- className: "forge-toolbar-group forge-toolbar-style flex items-center gap-0.5",
309
- children: /* @__PURE__ */ R("div", {
310
- className: "relative group",
311
- children: [/* @__PURE__ */ R("button", {
312
- type: "button",
313
- className: "forge-toolbar-button group relative flex h-7 cursor-pointer items-center justify-center rounded-[2px] border border-[#ccc] bg-white px-2 text-sm leading-none transition-all duration-150 hover:bg-[#f0f0f0] active:translate-y-px [&.is-active]:bg-[#e5e5e5]",
314
- "data-command": "style",
315
- "aria-label": "Style",
316
- children: [/* @__PURE__ */ R("span", {
317
- className: "forge-icon",
318
- children: "✦"
319
- }), /* @__PURE__ */ R("span", {
320
- className: "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 group-has-[.is-open]:hidden rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]",
321
- "data-i18n": "style",
322
- children: "Style"
323
- })]
324
- }), /* @__PURE__ */ R("div", {
325
- className: "forge-toolbar-dropdown forge-dropdown-style absolute left-0 top-[calc(100%+4px)] z-20 hidden [&.is-open]:block max-h-24 min-w-[110px] overflow-y-auto rounded-[2px] border border-[#ccc] bg-white p-0 shadow-[0_2px_6px_rgba(0,0,0,0.15)] rtl:left-auto rtl:right-0",
326
- role: "list",
327
- "aria-label": "Style",
328
- children: [
329
- /* @__PURE__ */ R("button", {
330
- type: "button",
331
- className: e,
332
- "data-value": "p",
333
- role: "listitem",
334
- children: /* @__PURE__ */ R("p", {
335
- className: "m-0 text-[13px] font-normal leading-[1.4]",
336
- children: "Normal"
337
- })
338
- }),
339
- /* @__PURE__ */ R("button", {
340
- type: "button",
341
- className: e,
342
- "data-value": "blockquote",
343
- role: "listitem",
344
- children: /* @__PURE__ */ R("blockquote", {
345
- className: "m-0 text-[13px] font-normal leading-[1.4]",
346
- children: "Blockquote"
347
- })
348
- }),
349
- /* @__PURE__ */ R("button", {
350
- type: "button",
351
- className: e,
352
- "data-value": "pre",
353
- role: "listitem",
354
- children: /* @__PURE__ */ R("pre", {
355
- className: "m-0 font-mono text-[13px] leading-[1.4]",
356
- children: "Code"
357
- })
358
- }),
359
- /* @__PURE__ */ R("button", {
360
- type: "button",
361
- className: e,
362
- "data-value": "h1",
363
- role: "listitem",
364
- children: /* @__PURE__ */ R("h1", {
365
- className: "m-0 text-[20px] font-normal leading-[1.4]",
366
- children: "Heading 1"
367
- })
368
- }),
369
- /* @__PURE__ */ R("button", {
370
- type: "button",
371
- className: e,
372
- "data-value": "h2",
373
- role: "listitem",
374
- children: /* @__PURE__ */ R("h2", {
375
- className: "m-0 text-[18px] font-normal leading-[1.4]",
376
- children: "Heading 2"
377
- })
378
- }),
379
- /* @__PURE__ */ R("button", {
380
- type: "button",
381
- className: e,
382
- "data-value": "h3",
383
- role: "listitem",
384
- children: /* @__PURE__ */ R("h3", {
385
- className: "m-0 text-[16px] font-normal leading-[1.4]",
386
- children: "Heading 3"
387
- })
388
- }),
389
- /* @__PURE__ */ R("button", {
390
- type: "button",
391
- className: e,
392
- "data-value": "h4",
393
- role: "listitem",
394
- children: /* @__PURE__ */ R("h4", {
395
- className: "m-0 text-[15px] font-normal leading-[1.4]",
396
- children: "Heading 4"
397
- })
398
- }),
399
- /* @__PURE__ */ R("button", {
400
- type: "button",
401
- className: e,
402
- "data-value": "h5",
403
- role: "listitem",
404
- children: /* @__PURE__ */ R("h5", {
405
- className: "m-0 text-[14px] font-normal leading-[1.4]",
406
- children: "Heading 5"
407
- })
408
- }),
409
- /* @__PURE__ */ R("button", {
410
- type: "button",
411
- className: e,
412
- "data-value": "h6",
413
- role: "listitem",
414
- children: /* @__PURE__ */ R("h6", {
415
- className: "m-0 text-[13px] font-normal leading-[1.4]",
416
- children: "Heading 6"
417
- })
418
- })
419
- ]
420
- })]
421
- })
422
- });
423
- }
424
- //#endregion
425
- //#region src/components/shared/toolbar/Style/Components/index.jsx
426
- function z() {
427
- return ve();
428
- }
429
- //#endregion
430
- //#region src/components/shared/toolbar/font/Components/FontToolbar.jsx
431
- function B({ onCommand: e, isBold: t, isUnderline: n }) {
432
- let r = "group relative flex h-7 w-7 items-center justify-center p-0 text-sm leading-none cursor-pointer transition-colors duration-150 active:translate-y-px", i = "bg-white text-[#333] hover:bg-[#f0f0f0]", a = "bg-[#e2e8f0] text-black border-inner shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] font-bold", o = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]";
433
- return /* @__PURE__ */ R("div", {
434
- className: "forge-toolbar-group forge-toolbar-font inline-flex items-center rounded-sm border border-[#ccc] bg-white divide-x divide-[#ccc] rtl:divide-x-reverse",
435
- children: [
436
- /* @__PURE__ */ R("button", {
437
- type: "button",
438
- className: `${r} ${t ? a : i}`,
439
- onClick: () => e("bold"),
440
- "aria-label": "Bold",
441
- children: [/* @__PURE__ */ R("span", {
442
- className: "text-sm font-bold font-serif",
443
- children: "B"
444
- }), /* @__PURE__ */ R("span", {
445
- className: o,
446
- "data-i18n": "bold",
447
- children: "Bold"
448
- })]
449
- }),
450
- /* @__PURE__ */ R("button", {
451
- type: "button",
452
- className: `${r} ${n ? a : i}`,
453
- onClick: () => e("underline"),
454
- "aria-label": "Underline",
455
- children: [/* @__PURE__ */ R("span", {
456
- className: "text-sm font-bold font-serif underline",
457
- children: "U"
458
- }), /* @__PURE__ */ R("span", {
459
- className: o,
460
- "data-i18n": "underline",
461
- children: "Underline"
462
- })]
463
- }),
464
- /* @__PURE__ */ R("button", {
465
- type: "button",
466
- className: `${r} ${i}`,
467
- onClick: () => e("removeFormat"),
468
- "aria-label": "Remove Font Style",
469
- children: [/* @__PURE__ */ R("span", {
470
- className: "inline-block h-4 w-4 text-center text-sm leading-none",
471
- children: /* @__PURE__ */ R("svg", {
472
- viewBox: "0 0 20 20",
473
- className: "block h-4 w-4 fill-none stroke-black",
474
- strokeWidth: "2",
475
- children: /* @__PURE__ */ R("path", { d: "M 4 4 L 16 16 M 16 4 L 4 16" })
476
- })
477
- }), /* @__PURE__ */ R("span", {
478
- className: o,
479
- "data-i18n": "removeFormat",
480
- children: "Remove Font Style"
481
- })]
482
- })
483
- ]
484
- });
485
- }
486
- //#endregion
487
- //#region node_modules/preact/hooks/dist/hooks.module.js
488
- var ye, V, be, H, xe = 0, Se = [], U = d, Ce = U.__b, we = U.__r, Te = U.diffed, Ee = U.__c, De = U.unmount, Oe = U.__;
489
- function W(e, t) {
490
- U.__h && U.__h(V, e, xe || t), xe = 0;
491
- var n = V.__H || (V.__H = {
492
- __: [],
493
- __h: []
494
- });
495
- return e >= n.__.length && n.__.push({}), n.__[e];
496
- }
497
- function G(e) {
498
- return xe = 1, ke(Le, e);
499
- }
500
- function ke(e, t, n) {
501
- var r = W(ye++, 2);
502
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Le(void 0, t), function(e) {
503
- var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
504
- t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
505
- }], r.__c = V, !V.__f)) {
506
- var i = function(e, t, n) {
507
- if (!r.__c.__H) return !0;
508
- var i = !1, o = r.__c.props !== e;
509
- if (r.__c.__H.__.some(function(e) {
510
- if (e.__N) {
511
- i = !0;
512
- var t = e.__[0];
513
- e.__ = e.__N, e.__N = void 0, t !== e.__[0] && (o = !0);
514
- }
515
- }), a) {
516
- var s = a.call(this, e, t, n);
517
- return i ? s || o : s;
518
- }
519
- return !i || o;
520
- };
521
- V.__f = !0;
522
- var a = V.shouldComponentUpdate, o = V.componentWillUpdate;
523
- V.componentWillUpdate = function(e, t, n) {
524
- if (this.__e) {
525
- var r = a;
526
- a = void 0, i(e, t, n), a = r;
527
- }
528
- o && o.call(this, e, t, n);
529
- }, V.shouldComponentUpdate = i;
530
- }
531
- return r.__N || r.__;
532
- }
533
- function K(e, t) {
534
- var n = W(ye++, 3);
535
- !U.__s && Ie(n.__H, t) && (n.__ = e, n.u = t, V.__H.__h.push(n));
536
- }
537
- function q(e) {
538
- return xe = 5, Ae(function() {
539
- return { current: e };
540
- }, []);
541
- }
542
- function Ae(e, t) {
543
- var n = W(ye++, 7);
544
- return Ie(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
545
- }
546
- function je() {
547
- for (var e; e = Se.shift();) {
548
- var t = e.__H;
549
- if (e.__P && t) try {
550
- t.__h.some(Pe), t.__h.some(Fe), t.__h = [];
551
- } catch (n) {
552
- t.__h = [], U.__e(n, e.__v);
553
- }
554
- }
555
- }
556
- U.__b = function(e) {
557
- V = null, Ce && Ce(e);
558
- }, U.__ = function(e, t) {
559
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Oe && Oe(e, t);
560
- }, U.__r = function(e) {
561
- we && we(e), ye = 0;
562
- var t = (V = e.__c).__H;
563
- t && (be === V ? (t.__h = [], V.__h = [], t.__.some(function(e) {
564
- e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
565
- })) : (t.__h.some(Pe), t.__h.some(Fe), t.__h = [], ye = 0)), be = V;
566
- }, U.diffed = function(e) {
567
- Te && Te(e);
568
- var t = e.__c;
569
- t && t.__H && (t.__H.__h.length && (Se.push(t) !== 1 && H === U.requestAnimationFrame || ((H = U.requestAnimationFrame) || Ne)(je)), t.__H.__.some(function(e) {
570
- e.u &&= (e.__H = e.u, void 0);
571
- })), be = V = null;
572
- }, U.__c = function(e, t) {
573
- t.some(function(e) {
574
- try {
575
- e.__h.some(Pe), e.__h = e.__h.filter(function(e) {
576
- return !e.__ || Fe(e);
577
- });
578
- } catch (n) {
579
- t.some(function(e) {
580
- e.__h &&= [];
581
- }), t = [], U.__e(n, e.__v);
582
- }
583
- }), Ee && Ee(e, t);
584
- }, U.unmount = function(e) {
585
- De && De(e);
586
- var t, n = e.__c;
587
- n && n.__H && (n.__H.__.some(function(e) {
588
- try {
589
- Pe(e);
590
- } catch (e) {
591
- t = e;
592
- }
593
- }), n.__H = void 0, t && U.__e(t, n.__v));
594
- };
595
- var Me = typeof requestAnimationFrame == "function";
596
- function Ne(e) {
597
- var t, n = function() {
598
- clearTimeout(r), Me && cancelAnimationFrame(t), setTimeout(e);
599
- }, r = setTimeout(n, 35);
600
- Me && (t = requestAnimationFrame(n));
601
- }
602
- function Pe(e) {
603
- var t = V, n = e.__c;
604
- typeof n == "function" && (e.__c = void 0, n()), V = t;
605
- }
606
- function Fe(e) {
607
- var t = V;
608
- e.__c = e.__(), V = t;
609
- }
610
- function Ie(e, t) {
611
- return !e || e.length !== t.length || t.some(function(t, n) {
612
- return t !== e[n];
613
- });
614
- }
615
- function Le(e, t) {
616
- return typeof t == "function" ? t(e) : t;
617
- }
618
- //#endregion
619
- //#region src/components/shared/toolbar/font/Hooks/boldHandler.jsx
620
- var Re = (e, t, n) => {
621
- if (!e.collapsed) {
622
- if (n) {
623
- let t = e.commonAncestorContainer;
624
- for (t.nodeType === 3 && (t = t.parentNode); t && t.getAttribute && t.getAttribute("contenteditable") !== "true";) {
625
- if (t.style && t.style.fontWeight) {
626
- if (t.style.fontWeight = "", !t.getAttribute("style")) {
627
- let e = t.parentNode;
628
- for (; t.firstChild;) e.insertBefore(t.firstChild, t);
629
- e.removeChild(t);
630
- }
631
- break;
632
- }
633
- t = t.parentNode;
634
- }
635
- } else {
636
- let t = e.extractContents(), n = document.createElement("span");
637
- n.style.fontWeight = "bold", n.appendChild(t), e.insertNode(n);
638
- }
639
- return;
640
- }
641
- if (n) {
642
- let n = e.startContainer, r = n.nodeType === 1 ? n : n.parentNode;
643
- for (; r && r.getAttribute && r.getAttribute("contenteditable") !== "true" && !(r.style && r.style.fontWeight);) r = r.parentNode;
644
- let i = document.createElement("span");
645
- i.innerHTML = "​", r && r.parentNode ? r.nextSibling ? r.parentNode.insertBefore(i, r.nextSibling) : r.parentNode.appendChild(i) : e.insertNode(i);
646
- let a = document.createRange();
647
- a.setStart(i, 1), a.collapse(!0), t.removeAllRanges(), t.addRange(a);
648
- } else {
649
- let n = document.createElement("span");
650
- n.style.fontWeight = "bold", n.innerHTML = "​", e.insertNode(n);
651
- let r = document.createRange();
652
- r.setStart(n, 1), r.collapse(!0), t.removeAllRanges(), t.addRange(r);
653
- }
654
- }, ze = (e, t, n) => {
655
- if (!e.collapsed) {
656
- if (n) {
657
- let t = e.commonAncestorContainer;
658
- for (t.nodeType === 3 && (t = t.parentNode); t && t.getAttribute && t.getAttribute("contenteditable") !== "true";) {
659
- if (t.style && t.style.textDecoration) {
660
- if (t.style.textDecoration = "", !t.getAttribute("style")) {
661
- let e = t.parentNode;
662
- for (; t.firstChild;) e.insertBefore(t.firstChild, t);
663
- e.removeChild(t);
664
- }
665
- break;
666
- }
667
- t = t.parentNode;
668
- }
669
- } else {
670
- let t = e.extractContents(), n = document.createElement("span");
671
- n.style.textDecoration = "underline", n.appendChild(t), e.insertNode(n);
672
- }
673
- return;
674
- }
675
- if (n) {
676
- let n = e.startContainer, r = n.nodeType === 1 ? n : n.parentNode;
677
- for (; r && r.getAttribute && r.getAttribute("contenteditable") !== "true" && !(r.style && r.style.textDecoration);) r = r.parentNode;
678
- let i = document.createElement("span");
679
- i.innerHTML = "​", r && r.parentNode ? r.nextSibling ? r.parentNode.insertBefore(i, r.nextSibling) : r.parentNode.appendChild(i) : e.insertNode(i);
680
- let a = document.createRange();
681
- a.setStart(i, 1), a.collapse(!0), t.removeAllRanges(), t.addRange(a);
682
- } else {
683
- let n = document.createElement("span");
684
- n.style.textDecoration = "underline", n.innerHTML = "​", e.insertNode(n);
685
- let r = document.createRange();
686
- r.setStart(n, 1), r.collapse(!0), t.removeAllRanges(), t.addRange(r);
687
- }
688
- }, Be = (e) => {
689
- let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, null, !1), n;
690
- for (; n = t.nextNode();) n.nodeValue = n.nodeValue.replace(/\u00A0/g, " ");
691
- }, Ve = (e) => {
692
- e.querySelectorAll("span, b, u, strong").forEach((e) => {
693
- let t = e.getAttribute("style") || e.getAttribute("class"), n = [
694
- "B",
695
- "U",
696
- "STRONG"
697
- ].includes(e.tagName);
698
- if (!t && !n) {
699
- let t = e.parentNode;
700
- for (; e.firstChild;) t.insertBefore(e.firstChild, e);
701
- t.removeChild(e);
702
- } else (!e.textContent || e.textContent.replace(/\u200B/g, "").length === 0) && e.remove();
703
- });
704
- }, He = (e, t) => {
705
- if (e.collapsed) return;
706
- let n = e.commonAncestorContainer;
707
- for (n.nodeType === 3 && (n = n.parentNode); n && n.getAttribute && n.getAttribute("contenteditable") !== "true";) {
708
- let e = window.getComputedStyle(n).display;
709
- if (e === "block" || e === "flex" || n.tagName === "PRE") break;
710
- n = n.parentNode;
711
- }
712
- let r = e.extractContents().textContent.replace(/\u00A0/g, " "), i = document.createTextNode(r);
713
- e.insertNode(i), n && n.getAttribute("contenteditable") !== "true" && (Ve(n), Be(n), n.normalize());
714
- let a = document.createRange();
715
- a.selectNodeContents(i), t.removeAllRanges(), t.addRange(a);
716
- };
717
- //#endregion
718
- //#region src/components/shared/toolbar/font/Hooks/fontLogic.jsx
719
- function Ue() {
720
- let [e, t] = G(!1), [n, r] = G(!1), i = () => {
721
- let e = window.getSelection();
722
- if (!e || e.rangeCount === 0) return;
723
- let n = e.anchorNode;
724
- if (!n) return;
725
- n.nodeType === 3 && (n = n.parentNode);
726
- let i = !1, a = !1;
727
- for (; n && n.getAttribute && n.getAttribute("contenteditable") !== "true";) {
728
- let e = window.getComputedStyle(n).fontWeight, t = window.getComputedStyle(n).textDecoration;
729
- (e === "bold" || parseInt(e) >= 700 || n.tagName === "B" || n.tagName === "STRONG") && (i = !0), (t.includes("underline") || n.tagName === "U") && (a = !0), n = n.parentNode;
730
- }
731
- t(i), r(a);
732
- };
733
- return K(() => (document.addEventListener("selectionchange", i), () => document.removeEventListener("selectionchange", i)), []), {
734
- executeCommand: (t) => {
735
- let r = window.getSelection();
736
- if (!r || r.rangeCount === 0) return;
737
- let a = r.getRangeAt(0);
738
- t === "bold" ? Re(a, r, e) : t === "underline" ? ze(a, r, n) : t === "removeFormat" && He(a, r), i();
739
- },
740
- isBold: e,
741
- isUnderline: n
742
- };
743
- }
744
- //#endregion
745
- //#region src/components/shared/toolbar/font/Components/index.jsx
746
- function J() {
747
- let { executeCommand: e, isBold: t, isUnderline: n } = Ue();
748
- return /* @__PURE__ */ R(B, {
749
- onCommand: e,
750
- isBold: t,
751
- isUnderline: n
752
- });
753
- }
754
- //#endregion
755
- //#region src/components/shared/toolbar/FontName/Hooks/fontNameHandler.jsx
756
- function We(e, t) {
757
- let n = document.createElement("span");
758
- n.style.fontFamily = t;
759
- try {
760
- return n.appendChild(e.extractContents()), e.insertNode(n), n;
761
- } catch {
762
- return null;
763
- }
764
- }
765
- function Ge(e) {
766
- let t = e.startContainer, n = e.startOffset, r = t.nodeType === 3 ? t.parentNode : t;
767
- if (!r || r.nodeType !== 1 || r.tagName !== "SPAN" || !r.style || !r.style.fontFamily) return null;
768
- let i = r, a = !1, o = !1, s = null;
769
- return t.nodeType === 3 ? (s = t, a = n === 0 && t === i.firstChild, o = n === t.textContent.length && t === i.lastChild) : t === i && (a = n === 0, o = n === i.childNodes.length), {
770
- fontSpan: i,
771
- textNode: s,
772
- offset: n,
773
- atStart: a,
774
- atEnd: o
775
- };
776
- }
777
- function Ke(e) {
778
- let t = document.createElement("span");
779
- return t.style.fontFamily = e, t.appendChild(document.createTextNode("​")), t;
780
- }
781
- function qe(e, t) {
782
- let n = document.createRange();
783
- n.setStart(e.firstChild, 1), n.collapse(!0), t.removeAllRanges(), t.addRange(n);
784
- }
785
- function Je(e, t, n) {
786
- let r = Ge(e);
787
- if (r) {
788
- let { fontSpan: e, textNode: i, offset: a, atStart: o, atEnd: s } = r;
789
- if (o) {
790
- let r = Ke(n);
791
- e.parentNode.insertBefore(r, e), qe(r, t);
792
- return;
793
- }
794
- if (s) {
795
- let r = Ke(n);
796
- e.nextSibling ? e.parentNode.insertBefore(r, e.nextSibling) : e.parentNode.appendChild(r), qe(r, t);
797
- return;
798
- }
799
- if (i) {
800
- let r = i.splitText(a), o = Ke(n);
801
- e.insertBefore(o, r), qe(o, t);
802
- return;
803
- }
804
- }
805
- let i = Ke(n);
806
- e.insertNode(i), qe(i, t);
807
- }
808
- var Ye = (e, t, n) => {
809
- let r = n || "Arial";
810
- if (!(!e || !t)) {
811
- if (!e.collapsed) {
812
- let n = We(e, r);
813
- if (!n) return;
814
- let i = document.createRange();
815
- i.selectNodeContents(n), t.removeAllRanges(), t.addRange(i);
816
- return;
817
- }
818
- Je(e, t, r);
819
- }
820
- }, Xe = (e) => {
821
- let t = window.getSelection();
822
- if (!t || t.rangeCount === 0) return null;
823
- let n = t.anchorNode;
824
- if (!n || e && !e.contains(n)) return null;
825
- for (n.nodeType === 3 && (n = n.parentNode); n && n !== e;) {
826
- if (n.style && n.style.fontFamily) {
827
- let e = n.style.fontFamily.split(",")[0].replace(/['"]/g, "").trim();
828
- if (e) return e;
829
- }
830
- n = n.parentNode;
831
- }
832
- return null;
833
- };
834
- //#endregion
835
- //#region src/components/shared/toolbar/FontName/Hooks/fontNameLogic.jsx
836
- function Ze(e) {
837
- let [t, n] = G("Arial"), r = q("Arial"), i = q(null), a = () => {
838
- let t = window.getSelection();
839
- if (t && t.rangeCount > 0) {
840
- let n = t.getRangeAt(0), r = e?.current;
841
- r && r.contains(n.commonAncestorContainer) && (i.current = n.cloneRange());
842
- }
843
- }, o = () => {
844
- let t = e?.current;
845
- if (!t) return;
846
- let i = Xe(t);
847
- i && (n(i), r.current = i);
848
- };
849
- return K(() => {
850
- let t = () => {
851
- a(), o();
852
- };
853
- document.addEventListener("selectionchange", t);
854
- let n = e?.current;
855
- if (!n) return () => {
856
- document.removeEventListener("selectionchange", t);
857
- };
858
- let i = (e) => {
859
- if (e.inputType !== "insertText" || !e.data) return;
860
- let t = window.getSelection();
861
- if (!t || t.rangeCount === 0) return;
862
- let n = t.getRangeAt(0), i = n.startContainer;
863
- if (i.nodeType === 3 && (i = i.parentNode), i && i.tagName === "SPAN" && i.style.fontFamily && i.style.fontFamily.replace(/['"]/g, "").toLowerCase() === r.current.toLowerCase()) return;
864
- e.preventDefault();
865
- let a = document.createElement("span");
866
- a.style.fontFamily = r.current, a.textContent = e.data, n.deleteContents(), n.insertNode(a);
867
- let o = document.createRange();
868
- o.setStart(a.firstChild, a.textContent.length), o.collapse(!0), t.removeAllRanges(), t.addRange(o);
869
- };
870
- return n.addEventListener("beforeinput", i), () => {
871
- document.removeEventListener("selectionchange", t), n.removeEventListener("beforeinput", i);
872
- };
873
- }, [e, e?.current]), {
874
- currentFont: t,
875
- applyFont: (t) => {
876
- let o = t || "Arial";
877
- r.current = o, n(o);
878
- let s = e?.current;
879
- if (!s) return;
880
- s.focus();
881
- let c = window.getSelection(), l = null;
882
- if (c && c.rangeCount > 0) {
883
- let e = c.getRangeAt(0);
884
- s.contains(e.commonAncestorContainer) && (l = e);
885
- }
886
- if (!l && i.current && (c.removeAllRanges(), c.addRange(i.current), l = i.current), !l) {
887
- let e = document.createRange();
888
- e.selectNodeContents(s), e.collapse(!1), c.removeAllRanges(), c.addRange(e), l = e;
889
- }
890
- Ye(l, c, o), a();
891
- }
892
- };
893
- }
894
- //#endregion
895
- //#region src/components/shared/toolbar/Hooks/dropdown.js
896
- function Qe(e, t) {
897
- function n() {
898
- t.classList.remove("is-open"), e.classList.remove("is-active"), document.removeEventListener("click", r);
899
- }
900
- function r(r) {
901
- !t.contains(r.target) && !e.contains(r.target) && n();
902
- }
903
- function i(n) {
904
- n.stopPropagation();
905
- let i = t.classList.contains("is-open");
906
- document.querySelectorAll(".forge-toolbar-dropdown.is-open").forEach((e) => {
907
- e.classList.remove("is-open");
908
- }), document.querySelectorAll(".forge-toolbar-button.is-active").forEach((e) => {
909
- e.classList.remove("is-active");
910
- }), i || (t.classList.add("is-open"), e.classList.add("is-active"), document.addEventListener("click", r));
911
- }
912
- return e.addEventListener("click", i), function() {
913
- e.removeEventListener("click", i), document.removeEventListener("click", r);
914
- };
915
- }
916
- //#endregion
917
- //#region src/components/shared/toolbar/FontName/Components/FontNameToolbar.jsx
918
- var $e = [
919
- "Arial",
920
- "Arial Black",
921
- "Comic Sans MS",
922
- "Courier New",
923
- "Helvetica",
924
- "Impact",
925
- "Tahoma",
926
- "Times New Roman",
927
- "Verdana",
928
- "Nunito Sans",
929
- "Segoe UI"
930
- ], Y = 32;
931
- function et({ currentFont: e, applyFont: t }) {
932
- let n = q(null), r = q(null);
933
- K(() => {
934
- if (n.current && r.current) return Qe(n.current, r.current);
935
- }, []);
936
- let i = (e) => {
937
- t(e), r.current && r.current.classList.remove("is-open"), n.current && n.current.classList.remove("is-active");
938
- }, a = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]";
939
- return /* @__PURE__ */ R("div", {
940
- className: "forge-toolbar-group forge-toolbar-fontname relative flex shrink-0 items-center",
941
- children: [/* @__PURE__ */ R("div", {
942
- className: "forge-color-button-group flex h-[30px] items-center overflow-visible rounded border border-[#ccc] bg-white hover:border-[#aaa] hover:bg-[#f9f9f9]",
943
- children: [/* @__PURE__ */ R("button", {
944
- type: "button",
945
- className: "forge-fontname-main group relative flex h-full w-[70px] shrink-0 items-center justify-center cursor-pointer border-none bg-transparent px-2 hover:bg-black/5",
946
- onMouseDown: (e) => e.preventDefault(),
947
- onClick: () => {
948
- n.current && n.current.click();
949
- },
950
- "aria-label": "Current font",
951
- children: [/* @__PURE__ */ R("span", {
952
- className: "forge-current-fontname inline-block max-w-[50px] truncate text-xs text-[#333]",
953
- style: { fontFamily: e },
954
- children: e
955
- }), /* @__PURE__ */ R("span", {
956
- className: a,
957
- "data-i18n": "fontName",
958
- children: "Font Family"
959
- })]
960
- }), /* @__PURE__ */ R("button", {
961
- ref: n,
962
- type: "button",
963
- className: "forge-fontname-dropdown-btn group relative flex h-full shrink-0 items-center justify-center min-w-[18px] cursor-pointer border-l border-[#ccc] bg-transparent px-1 hover:bg-black/5",
964
- onMouseDown: (e) => e.preventDefault(),
965
- "aria-label": "More fonts",
966
- children: [/* @__PURE__ */ R(() => /* @__PURE__ */ R("svg", {
967
- className: "h-2 w-2 fill-current text-[#666]",
968
- viewBox: "0 0 10 6",
969
- xmlns: "http://www.w3.org/2000/svg",
970
- children: /* @__PURE__ */ R("path", { d: "M0 0l5 6 5-6H0z" })
971
- }), {}), /* @__PURE__ */ R("span", {
972
- className: a,
973
- "data-i18n": "moreFont",
974
- children: "More Fonts"
975
- })]
976
- })]
977
- }), /* @__PURE__ */ R("div", {
978
- ref: r,
979
- className: "forge-toolbar-dropdown forge-dropdown-fontname absolute left-0 top-full z-20 hidden mt-1 min-w-[150px] overflow-y-auto rounded border border-[#ccc] bg-white p-1 shadow-md rtl:left-auto rtl:right-0 [&.is-open]:block",
980
- style: { maxHeight: "128px" },
981
- children: $e.map((e) => /* @__PURE__ */ R("button", {
982
- type: "button",
983
- className: "forge-dropdown-item flex w-full cursor-pointer items-center whitespace-nowrap rounded-sm px-2 text-left text-xs text-[#333] hover:bg-[#f0f0f0]",
984
- style: {
985
- fontFamily: e,
986
- height: `${Y}px`
987
- },
988
- onMouseDown: (e) => e.preventDefault(),
989
- onClick: () => i(e),
990
- children: e
991
- }, e))
992
- })]
993
- });
994
- }
995
- //#endregion
996
- //#region src/components/shared/toolbar/FontName/Components/index.jsx
997
- function tt({ editorRef: e }) {
998
- let { currentFont: t, applyFont: n } = Ze(e);
999
- return /* @__PURE__ */ R(et, {
1000
- currentFont: t,
1001
- applyFont: n
1002
- });
1003
- }
1004
- //#endregion
1005
- //#region src/components/shared/toolbar/Color/Components/colorPalette.jsx
1006
- var nt = [
1007
- [
1008
- "#000000",
1009
- "#424242",
1010
- "#636363",
1011
- "#9C9C94",
1012
- "#CEC6CE",
1013
- "#EFEFEF",
1014
- "#F7F7F7",
1015
- "#FFFFFF"
1016
- ],
1017
- [
1018
- "#FF0000",
1019
- "#FF9C00",
1020
- "#FFFF00",
1021
- "#00FF00",
1022
- "#00FFFF",
1023
- "#0000FF",
1024
- "#9C00FF",
1025
- "#FF00FF"
1026
- ],
1027
- [
1028
- "#F7C6CE",
1029
- "#FFE7CE",
1030
- "#FFEFC6",
1031
- "#D6EFD6",
1032
- "#CEDEE7",
1033
- "#CEE7F7",
1034
- "#D6D6E7",
1035
- "#E7D6DE"
1036
- ],
1037
- [
1038
- "#E79C9C",
1039
- "#FFC69C",
1040
- "#FFE79C",
1041
- "#B5D6A5",
1042
- "#A5C6CE",
1043
- "#9CC6EF",
1044
- "#B5A5D6",
1045
- "#D6A5BD"
1046
- ],
1047
- [
1048
- "#E76363",
1049
- "#F7AD6B",
1050
- "#FFD663",
1051
- "#94BD7B",
1052
- "#73A5AD",
1053
- "#6BADDE",
1054
- "#8C7BC6",
1055
- "#C67BA5"
1056
- ],
1057
- [
1058
- "#CE0000",
1059
- "#E79439",
1060
- "#EFC631",
1061
- "#6BA54A",
1062
- "#4A7B8C",
1063
- "#3984C6",
1064
- "#634AA5",
1065
- "#A54A7B"
1066
- ],
1067
- [
1068
- "#9C0000",
1069
- "#B56308",
1070
- "#BD9400",
1071
- "#397B21",
1072
- "#104A5A",
1073
- "#085294",
1074
- "#311873",
1075
- "#731842"
1076
- ],
1077
- [
1078
- "#630000",
1079
- "#7B3900",
1080
- "#846300",
1081
- "#295218",
1082
- "#083139",
1083
- "#003163",
1084
- "#21104A",
1085
- "#4A1031"
1086
- ]
1087
- ];
1088
- function rt({ event: e, onApply: t, currentColor: n }) {
1089
- return /* @__PURE__ */ R("div", {
1090
- className: "forge-color-palette flex flex-col gap-1",
1091
- children: nt.map((r, i) => /* @__PURE__ */ R("div", {
1092
- className: "forge-color-row flex gap-1 justify-between",
1093
- children: r.map((r) => {
1094
- let i = n?.toLowerCase() === r.toLowerCase();
1095
- return /* @__PURE__ */ R("button", {
1096
- type: "button",
1097
- title: r,
1098
- className: `forge-color-button h-4 w-4 cursor-pointer rounded-[2px] border p-0 hover:scale-110 hover:border-black transition-transform ${i ? "border-2 border-black" : "border-[#ccc]"}`,
1099
- style: { backgroundColor: r },
1100
- onMouseDown: (e) => e.preventDefault(),
1101
- onClick: () => t(e, r),
1102
- "aria-label": r,
1103
- "aria-pressed": i
1104
- }, r);
1105
- })
1106
- }, i))
1107
- });
1108
- }
1109
- //#endregion
1110
- //#region src/components/shared/toolbar/Color/Components/ColorToolbar.jsx
1111
- function it({ logic: e }) {
1112
- let { applyColor: t, applyRecentColor: n, resetColor: r, recentForeColor: i, recentBackColor: a } = e, o = q(null), s = q(null), c = q(null), l = q(null);
1113
- K(() => {
1114
- if (o.current && s.current) return Qe(o.current, s.current);
1115
- }, []), K(() => {
1116
- if (c.current && l.current) return Qe(c.current, l.current);
1117
- }, []);
1118
- let u = (e, n) => {
1119
- t(e, n), s.current && s.current.classList.remove("is-open"), o.current && o.current.classList.remove("is-active");
1120
- }, d = (e, n) => {
1121
- t(e, n), l.current && l.current.classList.remove("is-open"), c.current && c.current.classList.remove("is-active");
1122
- }, f = () => {
1123
- r("foreColor"), s.current && s.current.classList.remove("is-open"), o.current && o.current.classList.remove("is-active");
1124
- }, p = () => {
1125
- r("backColor"), l.current && l.current.classList.remove("is-open"), c.current && c.current.classList.remove("is-active");
1126
- }, m = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 group-has-[.is-open]:hidden rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]", h = () => /* @__PURE__ */ R("svg", {
1127
- className: "h-2 w-2 fill-current text-[#666]",
1128
- viewBox: "0 0 10 6",
1129
- xmlns: "http://www.w3.org/2000/svg",
1130
- children: /* @__PURE__ */ R("path", { d: "M0 0l5 6 5-6H0z" })
1131
- });
1132
- return /* @__PURE__ */ R("div", {
1133
- className: "forge-toolbar-group forge-toolbar-color flex items-center gap-1",
1134
- children: [/* @__PURE__ */ R("div", {
1135
- className: "forge-color-item relative flex items-center",
1136
- children: [/* @__PURE__ */ R("div", {
1137
- className: "forge-color-button-group flex h-[30px] items-center overflow-visible rounded border border-[#ccc] bg-white hover:border-[#aaa] hover:bg-[#f9f9f9]",
1138
- children: [/* @__PURE__ */ R("button", {
1139
- type: "button",
1140
- className: "forge-color-main group relative flex h-full items-center justify-center min-w-[28px] cursor-pointer border-none bg-transparent p-0 hover:bg-black/5",
1141
- onMouseDown: (e) => e.preventDefault(),
1142
- onClick: () => n("foreColor"),
1143
- "aria-label": "Apply text color",
1144
- children: [/* @__PURE__ */ R("span", {
1145
- className: "forge-recent-color flex h-5 w-5 items-center justify-center rounded-[2px] border border-[#ccc] text-xs font-bold",
1146
- style: {
1147
- backgroundColor: "transparent",
1148
- color: i
1149
- },
1150
- children: "A"
1151
- }), /* @__PURE__ */ R("span", {
1152
- className: m,
1153
- "data-i18n": "recentColor",
1154
- children: "Recent Color"
1155
- })]
1156
- }), /* @__PURE__ */ R("button", {
1157
- ref: o,
1158
- type: "button",
1159
- className: "forge-color-dropdown-btn group relative flex h-full items-center justify-center min-w-[18px] cursor-pointer border-l border-[#ccc] bg-transparent px-1 hover:bg-black/5",
1160
- onMouseDown: (e) => e.preventDefault(),
1161
- "aria-label": "More text colors",
1162
- children: [/* @__PURE__ */ R(h, {}), /* @__PURE__ */ R("span", {
1163
- className: m,
1164
- "data-i18n": "moreColor",
1165
- children: "More Color"
1166
- })]
1167
- })]
1168
- }), /* @__PURE__ */ R("div", {
1169
- ref: s,
1170
- className: "forge-toolbar-dropdown forge-dropdown-color absolute left-0 top-full z-20 hidden mt-1 max-h-[220px] min-w-[180px] overflow-y-auto rounded border border-[#ccc] bg-white p-2 shadow-md rtl:left-auto rtl:right-0 [&.is-open]:block",
1171
- children: /* @__PURE__ */ R("div", {
1172
- className: "forge-color-section",
1173
- children: [/* @__PURE__ */ R("div", {
1174
- className: "forge-color-section-header mb-1.5 flex items-center justify-between",
1175
- children: [/* @__PURE__ */ R("span", {
1176
- className: "forge-color-title text-xs font-bold text-[#333]",
1177
- children: "Text Color"
1178
- }), /* @__PURE__ */ R("button", {
1179
- type: "button",
1180
- className: "forge-color-reset cursor-pointer rounded border border-[#ccc] bg-[#f5f5f5] px-2 py-0.5 text-[11px] font-medium text-[#333] hover:border-[#999] hover:bg-[#e6e6e6]",
1181
- onMouseDown: (e) => e.preventDefault(),
1182
- onClick: f,
1183
- children: "Reset"
1184
- })]
1185
- }), /* @__PURE__ */ R(rt, {
1186
- event: "foreColor",
1187
- onApply: u
1188
- })]
1189
- })
1190
- })]
1191
- }), /* @__PURE__ */ R("div", {
1192
- className: "forge-color-item relative flex items-center",
1193
- children: [/* @__PURE__ */ R("div", {
1194
- className: "forge-color-button-group flex h-[30px] items-center overflow-visible rounded border border-[#ccc] bg-white hover:border-[#aaa] hover:bg-[#f9f9f9]",
1195
- children: [/* @__PURE__ */ R("button", {
1196
- type: "button",
1197
- className: "forge-color-main group relative flex h-full items-center justify-center min-w-[28px] cursor-pointer border-none bg-transparent p-0 hover:bg-black/5",
1198
- onMouseDown: (e) => e.preventDefault(),
1199
- onClick: () => n("backColor"),
1200
- "aria-label": "Apply background color",
1201
- children: [/* @__PURE__ */ R("span", {
1202
- className: "forge-recent-color flex h-5 w-5 items-center justify-center rounded-[2px] border border-[#ccc] text-xs font-bold",
1203
- style: {
1204
- backgroundColor: a || "#FFFFFF",
1205
- color: "#000"
1206
- },
1207
- children: "A"
1208
- }), /* @__PURE__ */ R("span", {
1209
- className: m,
1210
- "data-i18n": "recentBackColor",
1211
- children: "Recent Background Color"
1212
- })]
1213
- }), /* @__PURE__ */ R("button", {
1214
- ref: c,
1215
- type: "button",
1216
- className: "forge-color-dropdown-btn group relative flex h-full items-center justify-center min-w-[18px] cursor-pointer border-l border-[#ccc] bg-transparent px-1 hover:bg-black/5",
1217
- onMouseDown: (e) => e.preventDefault(),
1218
- "aria-label": "More background colors",
1219
- children: [/* @__PURE__ */ R(h, {}), /* @__PURE__ */ R("span", {
1220
- className: m,
1221
- "data-i18n": "moreBackColor",
1222
- children: "More Background Colors"
1223
- })]
1224
- })]
1225
- }), /* @__PURE__ */ R("div", {
1226
- ref: l,
1227
- className: "forge-toolbar-dropdown forge-dropdown-color absolute left-0 top-full z-20 hidden mt-1 max-h-[220px] min-w-[180px] overflow-y-auto rounded border border-[#ccc] bg-white p-2 shadow-md rtl:left-auto rtl:right-0 [&.is-open]:block",
1228
- children: /* @__PURE__ */ R("div", {
1229
- className: "forge-color-section",
1230
- children: [/* @__PURE__ */ R("div", {
1231
- className: "forge-color-section-header mb-1.5 flex items-center justify-between",
1232
- children: [/* @__PURE__ */ R("span", {
1233
- className: "forge-color-title text-xs font-bold text-[#333]",
1234
- children: "Background Color"
1235
- }), /* @__PURE__ */ R("button", {
1236
- type: "button",
1237
- className: "forge-color-reset cursor-pointer rounded border border-[#ccc] bg-[#f5f5f5] px-2 py-0.5 text-[11px] font-medium text-[#333] hover:border-[#999] hover:bg-[#e6e6e6]",
1238
- onMouseDown: (e) => e.preventDefault(),
1239
- onClick: p,
1240
- children: "White"
1241
- })]
1242
- }), /* @__PURE__ */ R(rt, {
1243
- event: "backColor",
1244
- onApply: d
1245
- })]
1246
- })
1247
- })]
1248
- })]
1249
- });
1250
- }
1251
- //#endregion
1252
- //#region src/components/shared/toolbar/Color/Hooks/colorUtils.jsx
1253
- function at(e) {
1254
- let t = document.createElement("span");
1255
- t.style.color = e, document.body.appendChild(t);
1256
- let n = window.getComputedStyle(t).color;
1257
- return document.body.removeChild(t), n;
1258
- }
1259
- function ot(e, t) {
1260
- let n = e;
1261
- for (; n && n !== document.body;) {
1262
- if (n.nodeType === Node.ELEMENT_NODE && n.tagName === "SPAN" && n.style.color && at(n.style.color) === t) return n;
1263
- n = n.parentElement;
1264
- }
1265
- return null;
1266
- }
1267
- //#endregion
1268
- //#region src/components/shared/toolbar/Color/Hooks/usePenMode.jsx
1269
- function st(e, t) {
1270
- K(() => {
1271
- function n(n) {
1272
- if (n.inputType !== "insertText" || !n.data || !e.current) return;
1273
- let r = n.target;
1274
- if (!r || !r.classList || !r.classList.contains(t)) return;
1275
- let i = window.getSelection();
1276
- if (!i || !i.rangeCount) return;
1277
- let a = i.getRangeAt(0);
1278
- if (!a.collapsed) return;
1279
- let o = at(e.current), s = a.startContainer;
1280
- s.nodeType === Node.TEXT_NODE && (s = s.parentElement);
1281
- let c = ot(s, o);
1282
- if (n.preventDefault(), c) {
1283
- let e = document.createTextNode(n.data);
1284
- a.insertNode(e), a.setStartAfter(e), a.collapse(!0), i.removeAllRanges(), i.addRange(a);
1285
- return;
1286
- }
1287
- let l = document.createElement("span");
1288
- l.style.color = e.current, l.textContent = n.data, a.deleteContents(), a.insertNode(l);
1289
- let u = document.createRange();
1290
- u.selectNodeContents(l), u.collapse(!1), i.removeAllRanges(), i.addRange(u);
1291
- }
1292
- return document.addEventListener("beforeinput", n, !0), () => document.removeEventListener("beforeinput", n, !0);
1293
- }, []);
1294
- }
1295
- //#endregion
1296
- //#region src/components/shared/toolbar/Color/Hooks/foreColorHandler.jsx
1297
- var ct = (e, t, n) => {
1298
- let r = n || "#000000";
1299
- if (!e) return;
1300
- if (!e.collapsed) {
1301
- let n = e.extractContents(), i = document.createElement("span");
1302
- i.style.color = r, i.appendChild(n), e.insertNode(i);
1303
- let a = document.createRange();
1304
- a.selectNodeContents(i), t.removeAllRanges(), t.addRange(a);
1305
- return;
1306
- }
1307
- let i = document.createElement("span");
1308
- i.style.color = r, i.appendChild(document.createTextNode("​")), e.insertNode(i);
1309
- let a = document.createRange();
1310
- a.setStart(i.firstChild, 1), a.collapse(!0), t.removeAllRanges(), t.addRange(a);
1311
- };
1312
- //#endregion
1313
- //#region src/components/shared/toolbar/Color/Hooks/useForeColor.jsx
1314
- function lt(e = "forge-editor__content") {
1315
- let [t, n] = G("#000000"), r = q(null);
1316
- st(r, e);
1317
- let i = (e) => {
1318
- let t = e || "#000000", i = window.getSelection();
1319
- i && i.rangeCount > 0 && ct(i.getRangeAt(0), i, t), r.current = t, n(t);
1320
- };
1321
- return {
1322
- recentForeColor: t,
1323
- applyForeColor: i,
1324
- applyRecentForeColor: () => {
1325
- i(t);
1326
- },
1327
- resetForeColor: () => {
1328
- i("#000000"), r.current = null;
1329
- }
1330
- };
1331
- }
1332
- //#endregion
1333
- //#region src/components/shared/toolbar/Color/Hooks/usePenModeBack.jsx
1334
- function ut(e, t) {
1335
- K(() => {
1336
- let n = (n) => {
1337
- if (!e.current || n.inputType !== "insertText" || !n.data) return;
1338
- let r = window.getSelection();
1339
- if (!r || !r.rangeCount) return;
1340
- let i = r.getRangeAt(0);
1341
- if (!(i.startContainer.nodeType === 1 ? i.startContainer.closest(`.${t}`) : i.startContainer.parentElement?.closest(`.${t}`))) return;
1342
- n.preventDefault();
1343
- let a = document.createElement("span");
1344
- a.style.backgroundColor = e.current, a.textContent = n.data, i.deleteContents(), i.insertNode(a);
1345
- let o = document.createRange();
1346
- o.setStartAfter(a), o.collapse(!0), r.removeAllRanges(), r.addRange(o);
1347
- };
1348
- return document.addEventListener("beforeinput", n, !0), () => {
1349
- document.removeEventListener("beforeinput", n, !0);
1350
- };
1351
- }, [t, e]);
1352
- }
1353
- //#endregion
1354
- //#region src/components/shared/toolbar/Color/Hooks/backColorHandler.jsx
1355
- var dt = (e, t, n) => {
1356
- let r = n || "#FFFFFF";
1357
- if (!e) return;
1358
- if (!e.collapsed) {
1359
- let n = e.extractContents(), i = document.createElement("span");
1360
- i.style.backgroundColor = r, i.appendChild(n), e.insertNode(i);
1361
- let a = document.createRange();
1362
- a.selectNodeContents(i), t.removeAllRanges(), t.addRange(a);
1363
- return;
1364
- }
1365
- let i = document.createElement("span");
1366
- i.style.backgroundColor = r, i.appendChild(document.createTextNode("​")), e.insertNode(i);
1367
- let a = document.createRange();
1368
- a.setStart(i.firstChild, 1), a.collapse(!0), t.removeAllRanges(), t.addRange(a);
1369
- };
1370
- //#endregion
1371
- //#region src/components/shared/toolbar/Color/Hooks/useBackColor.jsx
1372
- function ft(e = "forge-editor__content") {
1373
- let [t, n] = G("#FFFFFF"), r = q(null);
1374
- ut(r, e);
1375
- let i = (e) => {
1376
- let t = e || "#FFFFFF", i = window.getSelection();
1377
- i && i.rangeCount > 0 && dt(i.getRangeAt(0), i, t), r.current = t, n(t);
1378
- };
1379
- return {
1380
- recentBackColor: t,
1381
- applyBackColor: i,
1382
- applyRecentBackColor: () => {
1383
- i(t);
1384
- },
1385
- resetBackColor: () => {
1386
- i("#FFFFFF"), r.current = null;
1387
- }
1388
- };
1389
- }
1390
- //#endregion
1391
- //#region src/components/shared/toolbar/Color/Hooks/colorLogic.jsx
1392
- function pt() {
1393
- let e = lt(), t = ft();
1394
- return {
1395
- applyColor: (n, r) => {
1396
- n === "foreColor" ? e.applyForeColor(r) : n === "backColor" && t.applyBackColor(r);
1397
- },
1398
- applyRecentColor: (n) => {
1399
- n === "foreColor" ? e.applyRecentForeColor() : n === "backColor" && t.applyRecentBackColor();
1400
- },
1401
- resetColor: (n) => {
1402
- n === "foreColor" ? e.resetForeColor() : n === "backColor" && t.resetBackColor();
1403
- },
1404
- recentForeColor: e.recentForeColor,
1405
- recentBackColor: t.recentBackColor
1406
- };
1407
- }
1408
- //#endregion
1409
- //#region src/components/shared/toolbar/Color/Components/index.jsx
1410
- function mt() {
1411
- return /* @__PURE__ */ R(it, { logic: pt() });
1412
- }
1413
- //#endregion
1414
- //#region src/components/shared/toolbar/Paragraph/Components/ParagraphToolbar.jsx
1415
- function ht({ logic: e = {} }) {
1416
- let { saveSelectionRange: t, toggleUnorderedList: n, toggleOrderedList: r, setAlignment: i, outdent: a, indent: o } = e, [s, c] = G(!1), l = q(null);
1417
- K(() => {
1418
- let e = (e) => {
1419
- l.current && !l.current.contains(e.target) && c(!1);
1420
- };
1421
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1422
- }, []);
1423
- let u = (e, n, r = null) => {
1424
- e.preventDefault(), typeof t == "function" && t(), typeof n == "function" && n(r);
1425
- }, d = "forge-toolbar-button group relative flex h-8 items-center justify-center bg-white px-2.5 text-sm transition-all duration-150 hover:bg-[#f5f5f5] active:bg-[#e8e8e8] focus:outline-none", f = "forge-toolbar-icon inline-block h-4 w-4", p = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]", m = "group relative flex h-7 w-7 items-center justify-center rounded hover:bg-gray-100";
1426
- return /* @__PURE__ */ R("div", {
1427
- ref: l,
1428
- className: "forge-toolbar-group forge-toolbar-paragraph relative inline-flex items-center text-black",
1429
- children: [
1430
- /* @__PURE__ */ R("style", { children: "\n .forge-toolbar-paragraph svg * {\n vector-effect: non-scaling-stroke;\n }\n " }),
1431
- /* @__PURE__ */ R("div", {
1432
- className: "inline-flex rounded-md border border-[#d1d5db] bg-white shadow-sm -space-x-px",
1433
- children: [
1434
- /* @__PURE__ */ R("button", {
1435
- type: "button",
1436
- className: d,
1437
- onMouseDown: (e) => u(e, n),
1438
- "aria-label": "Unordered list",
1439
- children: [/* @__PURE__ */ R("span", {
1440
- className: f,
1441
- children: /* @__PURE__ */ R("svg", {
1442
- viewBox: "0 0 20 20",
1443
- className: "block h-4 w-4",
1444
- children: [
1445
- /* @__PURE__ */ R("circle", {
1446
- cx: "3",
1447
- cy: "5",
1448
- r: "1.5",
1449
- fill: "black"
1450
- }),
1451
- /* @__PURE__ */ R("circle", {
1452
- cx: "3",
1453
- cy: "10",
1454
- r: "1.5",
1455
- fill: "black"
1456
- }),
1457
- /* @__PURE__ */ R("circle", {
1458
- cx: "3",
1459
- cy: "15",
1460
- r: "1.5",
1461
- fill: "black"
1462
- }),
1463
- /* @__PURE__ */ R("rect", {
1464
- x: "7",
1465
- y: "4",
1466
- width: "11",
1467
- height: "2",
1468
- rx: "1",
1469
- fill: "black"
1470
- }),
1471
- /* @__PURE__ */ R("rect", {
1472
- x: "7",
1473
- y: "9",
1474
- width: "11",
1475
- height: "2",
1476
- rx: "1",
1477
- fill: "black"
1478
- }),
1479
- /* @__PURE__ */ R("rect", {
1480
- x: "7",
1481
- y: "14",
1482
- width: "11",
1483
- height: "2",
1484
- rx: "1",
1485
- fill: "black"
1486
- })
1487
- ]
1488
- })
1489
- }), /* @__PURE__ */ R("span", {
1490
- className: p,
1491
- "data-i18n": "unorderedList",
1492
- children: "Bullet list"
1493
- })]
1494
- }),
1495
- /* @__PURE__ */ R("div", { className: "w-[1px] bg-[#e5e7eb] my-1" }),
1496
- /* @__PURE__ */ R("button", {
1497
- type: "button",
1498
- className: d,
1499
- onMouseDown: (e) => u(e, r),
1500
- "aria-label": "Ordered list",
1501
- children: [/* @__PURE__ */ R("span", {
1502
- className: f,
1503
- children: /* @__PURE__ */ R("svg", {
1504
- viewBox: "0 0 20 20",
1505
- className: "block h-4 w-4",
1506
- children: [
1507
- /* @__PURE__ */ R("rect", {
1508
- x: "7",
1509
- y: "4",
1510
- width: "11",
1511
- height: "2",
1512
- rx: "1",
1513
- fill: "black"
1514
- }),
1515
- /* @__PURE__ */ R("rect", {
1516
- x: "7",
1517
- y: "9",
1518
- width: "11",
1519
- height: "2",
1520
- rx: "1",
1521
- fill: "black"
1522
- }),
1523
- /* @__PURE__ */ R("rect", {
1524
- x: "7",
1525
- y: "14",
1526
- width: "11",
1527
- height: "2",
1528
- rx: "1",
1529
- fill: "black"
1530
- }),
1531
- /* @__PURE__ */ R("path", {
1532
- d: "M 1.5 4.5 L 3.5 3 L 3.5 10 M 2 10 L 5 10",
1533
- fill: "none",
1534
- stroke: "black",
1535
- strokeWidth: "1.6",
1536
- strokeLinecap: "round",
1537
- strokeLinejoin: "round"
1538
- }),
1539
- /* @__PURE__ */ R("path", {
1540
- d: "M 1.5 14 C 1.5 12.8 4.5 12.8 4.5 14.5 C 4.5 16 1.5 16.5 1.5 18 L 5 18",
1541
- fill: "none",
1542
- stroke: "black",
1543
- strokeWidth: "1.6",
1544
- strokeLinecap: "round",
1545
- strokeLinejoin: "round"
1546
- })
1547
- ]
1548
- })
1549
- }), /* @__PURE__ */ R("span", {
1550
- className: p,
1551
- "data-i18n": "orderedList",
1552
- children: "Numbered list"
1553
- })]
1554
- }),
1555
- /* @__PURE__ */ R("div", { className: "w-[1px] bg-[#e5e7eb] my-1" }),
1556
- /* @__PURE__ */ R("button", {
1557
- type: "button",
1558
- className: `${d} gap-1 pr-1.5`,
1559
- onMouseDown: (e) => {
1560
- e.preventDefault(), typeof t == "function" && t();
1561
- },
1562
- onClick: () => c(!s),
1563
- "aria-label": "Paragraph",
1564
- children: [
1565
- /* @__PURE__ */ R("span", {
1566
- className: f,
1567
- children: /* @__PURE__ */ R("svg", {
1568
- viewBox: "0 0 20 20",
1569
- className: "block h-4 w-4",
1570
- children: [
1571
- /* @__PURE__ */ R("rect", {
1572
- x: "1",
1573
- y: "4",
1574
- width: "18",
1575
- height: "2",
1576
- rx: "1",
1577
- fill: "black"
1578
- }),
1579
- /* @__PURE__ */ R("rect", {
1580
- x: "1",
1581
- y: "9",
1582
- width: "18",
1583
- height: "2",
1584
- rx: "1",
1585
- fill: "black"
1586
- }),
1587
- /* @__PURE__ */ R("rect", {
1588
- x: "1",
1589
- y: "14",
1590
- width: "12",
1591
- height: "2",
1592
- rx: "1",
1593
- fill: "black"
1594
- })
1595
- ]
1596
- })
1597
- }),
1598
- /* @__PURE__ */ R("svg", {
1599
- className: `h-2.5 w-2.5 fill-current text-gray-700 transition-transform ${s ? "rotate-180" : ""}`,
1600
- viewBox: "0 0 20 20",
1601
- children: /* @__PURE__ */ R("path", { d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" })
1602
- }),
1603
- /* @__PURE__ */ R("span", {
1604
- className: p,
1605
- "data-i18n": "paragraph",
1606
- children: "Paragraph options"
1607
- })
1608
- ]
1609
- })
1610
- ]
1611
- }),
1612
- s && /* @__PURE__ */ R("div", {
1613
- className: "forge-toolbar-dropdown absolute left-0 top-full mt-1 z-20 min-w-[130px] rounded-md border border-[#ccc] bg-white p-1 shadow-lg rtl:left-auto rtl:right-0 block",
1614
- role: "list",
1615
- "aria-label": "Paragraph options",
1616
- children: [/* @__PURE__ */ R("div", {
1617
- className: "forge-toolbar-group forge-toolbar-align mb-0.5 flex gap-0.5 border-b border-[#eee] pb-1",
1618
- children: [
1619
- /* @__PURE__ */ R("button", {
1620
- type: "button",
1621
- className: m,
1622
- onMouseDown: (e) => {
1623
- u(e, i, "left"), c(!1);
1624
- },
1625
- "aria-label": "Align left",
1626
- children: [/* @__PURE__ */ R("span", {
1627
- className: f,
1628
- children: /* @__PURE__ */ R("svg", {
1629
- viewBox: "0 0 20 20",
1630
- className: "block h-4 w-4",
1631
- children: [
1632
- /* @__PURE__ */ R("rect", {
1633
- x: "1",
1634
- y: "4",
1635
- width: "18",
1636
- height: "2",
1637
- rx: "1",
1638
- fill: "black"
1639
- }),
1640
- /* @__PURE__ */ R("rect", {
1641
- x: "1",
1642
- y: "9",
1643
- width: "12",
1644
- height: "2",
1645
- rx: "1",
1646
- fill: "black"
1647
- }),
1648
- /* @__PURE__ */ R("rect", {
1649
- x: "1",
1650
- y: "14",
1651
- width: "18",
1652
- height: "2",
1653
- rx: "1",
1654
- fill: "black"
1655
- })
1656
- ]
1657
- })
1658
- }), /* @__PURE__ */ R("span", {
1659
- className: p,
1660
- "data-i18n": "alignLeft",
1661
- children: "Align left"
1662
- })]
1663
- }),
1664
- /* @__PURE__ */ R("button", {
1665
- type: "button",
1666
- className: m,
1667
- onMouseDown: (e) => {
1668
- u(e, i, "center"), c(!1);
1669
- },
1670
- "aria-label": "Align center",
1671
- children: [/* @__PURE__ */ R("span", {
1672
- className: f,
1673
- children: /* @__PURE__ */ R("svg", {
1674
- viewBox: "0 0 20 20",
1675
- className: "block h-4 w-4",
1676
- children: [
1677
- /* @__PURE__ */ R("rect", {
1678
- x: "1",
1679
- y: "4",
1680
- width: "18",
1681
- height: "2",
1682
- rx: "1",
1683
- fill: "black"
1684
- }),
1685
- /* @__PURE__ */ R("rect", {
1686
- x: "4",
1687
- y: "9",
1688
- width: "12",
1689
- height: "2",
1690
- rx: "1",
1691
- fill: "black"
1692
- }),
1693
- /* @__PURE__ */ R("rect", {
1694
- x: "1",
1695
- y: "14",
1696
- width: "18",
1697
- height: "2",
1698
- rx: "1",
1699
- fill: "black"
1700
- })
1701
- ]
1702
- })
1703
- }), /* @__PURE__ */ R("span", {
1704
- className: p,
1705
- "data-i18n": "alignCenter",
1706
- children: "Align center"
1707
- })]
1708
- }),
1709
- /* @__PURE__ */ R("button", {
1710
- type: "button",
1711
- className: m,
1712
- onMouseDown: (e) => {
1713
- u(e, i, "right"), c(!1);
1714
- },
1715
- "aria-label": "Align right",
1716
- children: [/* @__PURE__ */ R("span", {
1717
- className: f,
1718
- children: /* @__PURE__ */ R("svg", {
1719
- viewBox: "0 0 20 20",
1720
- className: "block h-4 w-4",
1721
- children: [
1722
- /* @__PURE__ */ R("rect", {
1723
- x: "1",
1724
- y: "4",
1725
- width: "18",
1726
- height: "2",
1727
- rx: "1",
1728
- fill: "black"
1729
- }),
1730
- /* @__PURE__ */ R("rect", {
1731
- x: "7",
1732
- y: "9",
1733
- width: "12",
1734
- height: "2",
1735
- rx: "1",
1736
- fill: "black"
1737
- }),
1738
- /* @__PURE__ */ R("rect", {
1739
- x: "1",
1740
- y: "14",
1741
- width: "18",
1742
- height: "2",
1743
- rx: "1",
1744
- fill: "black"
1745
- })
1746
- ]
1747
- })
1748
- }), /* @__PURE__ */ R("span", {
1749
- className: p,
1750
- "data-i18n": "alignRight",
1751
- children: "Align right"
1752
- })]
1753
- }),
1754
- /* @__PURE__ */ R("button", {
1755
- type: "button",
1756
- className: m,
1757
- onMouseDown: (e) => {
1758
- u(e, i, "justify"), c(!1);
1759
- },
1760
- "aria-label": "Justify",
1761
- children: [/* @__PURE__ */ R("span", {
1762
- className: f,
1763
- children: /* @__PURE__ */ R("svg", {
1764
- viewBox: "0 0 20 20",
1765
- className: "block h-4 w-4",
1766
- children: [
1767
- /* @__PURE__ */ R("rect", {
1768
- x: "1",
1769
- y: "4",
1770
- width: "18",
1771
- height: "2",
1772
- rx: "1",
1773
- fill: "black"
1774
- }),
1775
- /* @__PURE__ */ R("rect", {
1776
- x: "1",
1777
- y: "9",
1778
- width: "18",
1779
- height: "2",
1780
- rx: "1",
1781
- fill: "black"
1782
- }),
1783
- /* @__PURE__ */ R("rect", {
1784
- x: "1",
1785
- y: "14",
1786
- width: "18",
1787
- height: "2",
1788
- rx: "1",
1789
- fill: "black"
1790
- })
1791
- ]
1792
- })
1793
- }), /* @__PURE__ */ R("span", {
1794
- className: p,
1795
- "data-i18n": "justify",
1796
- children: "Justify"
1797
- })]
1798
- })
1799
- ]
1800
- }), /* @__PURE__ */ R("div", {
1801
- className: "forge-toolbar-group forge-toolbar-list flex gap-0.5 py-0.5",
1802
- children: [/* @__PURE__ */ R("button", {
1803
- type: "button",
1804
- className: m,
1805
- onMouseDown: (e) => {
1806
- u(e, a), c(!1);
1807
- },
1808
- "aria-label": "Outdent",
1809
- children: [/* @__PURE__ */ R("span", {
1810
- className: f,
1811
- children: /* @__PURE__ */ R("svg", {
1812
- viewBox: "0 0 20 20",
1813
- className: "block h-4 w-4",
1814
- fill: "none",
1815
- stroke: "black",
1816
- strokeWidth: "2",
1817
- strokeLinecap: "round",
1818
- strokeLinejoin: "round",
1819
- children: [
1820
- /* @__PURE__ */ R("line", {
1821
- x1: "9",
1822
- y1: "4",
1823
- x2: "19",
1824
- y2: "4"
1825
- }),
1826
- /* @__PURE__ */ R("line", {
1827
- x1: "9",
1828
- y1: "10",
1829
- x2: "19",
1830
- y2: "10"
1831
- }),
1832
- /* @__PURE__ */ R("line", {
1833
- x1: "9",
1834
- y1: "16",
1835
- x2: "19",
1836
- y2: "16"
1837
- }),
1838
- /* @__PURE__ */ R("polyline", { points: "6,8 2,12 6,16" })
1839
- ]
1840
- })
1841
- }), /* @__PURE__ */ R("span", {
1842
- className: p,
1843
- "data-i18n": "outdent",
1844
- children: "Outdent"
1845
- })]
1846
- }), /* @__PURE__ */ R("button", {
1847
- type: "button",
1848
- className: m,
1849
- onMouseDown: (e) => {
1850
- u(e, o), c(!1);
1851
- },
1852
- "aria-label": "Indent",
1853
- children: [/* @__PURE__ */ R("span", {
1854
- className: f,
1855
- children: /* @__PURE__ */ R("svg", {
1856
- viewBox: "0 0 20 20",
1857
- className: "block h-4 w-4",
1858
- fill: "none",
1859
- stroke: "black",
1860
- strokeWidth: "2",
1861
- strokeLinecap: "round",
1862
- strokeLinejoin: "round",
1863
- children: [
1864
- /* @__PURE__ */ R("line", {
1865
- x1: "9",
1866
- y1: "4",
1867
- x2: "19",
1868
- y2: "4"
1869
- }),
1870
- /* @__PURE__ */ R("line", {
1871
- x1: "9",
1872
- y1: "10",
1873
- x2: "19",
1874
- y2: "10"
1875
- }),
1876
- /* @__PURE__ */ R("line", {
1877
- x1: "9",
1878
- y1: "16",
1879
- x2: "19",
1880
- y2: "16"
1881
- }),
1882
- /* @__PURE__ */ R("polyline", { points: "2,8 6,12 2,16" })
1883
- ]
1884
- })
1885
- }), /* @__PURE__ */ R("span", {
1886
- className: p,
1887
- "data-i18n": "indent",
1888
- children: "Indent"
1889
- })]
1890
- })]
1891
- })]
1892
- })
1893
- ]
1894
- });
1895
- }
1896
- //#endregion
1897
- //#region src/components/shared/toolbar/Paragraph/Hooks/paragraphLogic.jsx
1898
- function gt() {
1899
- let e = window.getSelection();
1900
- return e && e.rangeCount > 0 ? e.getRangeAt(0).cloneRange() : null;
1901
- }
1902
- function _t(e) {
1903
- if (!e) return;
1904
- let t = window.getSelection();
1905
- t && (t.removeAllRanges(), t.addRange(e));
1906
- }
1907
- function X(e) {
1908
- if (!e) return;
1909
- e.lastChild && e.lastChild.nodeName === "BR" && e.childNodes.length > 1 && e.removeChild(e.lastChild);
1910
- let t = e;
1911
- for (; t.lastChild && t.lastChild.nodeName !== "BR";) t = t.lastChild;
1912
- let n = document.createRange();
1913
- t.nodeType === 3 ? (n.setStart(t, t.textContent.length), n.collapse(!0)) : t.lastChild && t.lastChild.nodeName === "BR" ? (n.setStart(t, t.childNodes.length - 1), n.collapse(!0)) : (n.selectNodeContents(t), n.collapse(!1));
1914
- let r = window.getSelection();
1915
- r && (r.removeAllRanges(), r.addRange(n));
1916
- }
1917
- function vt(e) {
1918
- if (!e || e.nodeType !== 1) return !1;
1919
- let t = e.tagName.toLowerCase();
1920
- return [
1921
- "p",
1922
- "div",
1923
- "h1",
1924
- "h2",
1925
- "h3",
1926
- "h4",
1927
- "h5",
1928
- "h6",
1929
- "li",
1930
- "blockquote",
1931
- "pre"
1932
- ].includes(t);
1933
- }
1934
- function yt(e) {
1935
- if (!e) return null;
1936
- let t = e.nodeType === 3 ? e.parentNode : e;
1937
- for (; t && t !== document.body && !vt(t);) t = t.parentNode;
1938
- return t && vt(t) ? t : null;
1939
- }
1940
- function bt(e) {
1941
- if (!e) return null;
1942
- let t = e.nodeType === 3 ? e.parentNode : e;
1943
- for (; t && t !== document.body && t.tagName !== "LI";) t = t.parentNode;
1944
- return t && t.tagName === "LI" ? t : null;
1945
- }
1946
- function xt(e) {
1947
- let t = document.createElement(e);
1948
- return t.className = e === "ul" ? "list-disc pl-5 my-2" : "list-decimal pl-5 my-2", t;
1949
- }
1950
- function St(e, t) {
1951
- let n = xt(t), r = document.createElement("li");
1952
- return r.innerHTML = e.innerHTML, n.appendChild(r), e.parentNode.replaceChild(n, e), r;
1953
- }
1954
- function Ct(e) {
1955
- let t = e.parentNode, n = document.createDocumentFragment(), r = Array.from(e.children), i = null;
1956
- return r.forEach((e) => {
1957
- let t = document.createElement("div");
1958
- t.innerHTML = e.innerHTML, n.appendChild(t), i = t;
1959
- }), t.replaceChild(n, e), i;
1960
- }
1961
- function wt(e, t) {
1962
- let n = xt(t);
1963
- return n.innerHTML = e.innerHTML, e.parentNode.replaceChild(n, e), n;
1964
- }
1965
- function Tt() {
1966
- let e = q(null), t = () => {
1967
- e.current = gt();
1968
- }, n = (t) => {
1969
- _t(e.current);
1970
- let n = window.getSelection();
1971
- if (!n || !n.rangeCount) return;
1972
- let r = n.anchorNode;
1973
- if (!r) return;
1974
- r.nodeType === 3 && (r = r.parentNode);
1975
- let i = bt(r);
1976
- if (i) {
1977
- let n = i.parentNode;
1978
- if (n && (n.tagName === "UL" || n.tagName === "OL")) {
1979
- if (n.tagName.toLowerCase() === t) {
1980
- let e = Ct(n);
1981
- e && X(e);
1982
- } else {
1983
- let e = wt(n, t).lastElementChild;
1984
- e && X(e);
1985
- }
1986
- e.current = gt();
1987
- return;
1988
- }
1989
- }
1990
- let a = yt(r);
1991
- if (a) {
1992
- if (a.getAttribute && a.getAttribute("contenteditable") === "true") {
1993
- let e = document.createElement("div");
1994
- e.innerHTML = a.innerHTML, a.innerHTML = "", a.appendChild(e), X(St(e, t));
1995
- } else X(St(a, t));
1996
- e.current = gt();
1997
- }
1998
- };
1999
- return {
2000
- saveSelectionRange: t,
2001
- toggleUnorderedList: () => n("ul"),
2002
- toggleOrderedList: () => n("ol"),
2003
- setAlignment: (t) => {
2004
- _t(e.current);
2005
- let n = window.getSelection();
2006
- if (!n || !n.rangeCount) return;
2007
- let r = n.anchorNode;
2008
- if (!r) return;
2009
- r.nodeType === 3 && (r = r.parentNode);
2010
- let i = r.closest("p, div, h1, h2, h3, h4, h5, h6, li, blockquote, pre");
2011
- i && (i.style.textAlign = t), e.current = gt();
2012
- },
2013
- indent: () => {
2014
- _t(e.current);
2015
- let t = window.getSelection();
2016
- if (!t || !t.rangeCount) return;
2017
- let n = t.anchorNode;
2018
- if (!n) return;
2019
- n.nodeType === 3 && (n = n.parentNode);
2020
- let r = bt(n);
2021
- if (r) {
2022
- let e = r.parentNode;
2023
- if (!e || e.tagName !== "UL" && e.tagName !== "OL") return;
2024
- let t = r.previousElementSibling;
2025
- if (!t || t.tagName !== "LI") return;
2026
- let n = t.querySelector(":scope > ul, :scope > ol");
2027
- n || (n = xt(e.tagName.toLowerCase()), t.appendChild(n)), n.appendChild(r), X(r);
2028
- } else {
2029
- let e = yt(n);
2030
- if (!e) return;
2031
- let t = parseInt(e.style.marginLeft) || 0;
2032
- e.style.marginLeft = t + 20 + "px";
2033
- }
2034
- e.current = gt();
2035
- },
2036
- outdent: () => {
2037
- _t(e.current);
2038
- let t = window.getSelection();
2039
- if (!t || !t.rangeCount) return;
2040
- let n = t.anchorNode;
2041
- if (!n) return;
2042
- n.nodeType === 3 && (n = n.parentNode);
2043
- let r = bt(n);
2044
- if (r) {
2045
- let e = r.parentNode;
2046
- if (!e || e.tagName !== "UL" && e.tagName !== "OL") return;
2047
- let t = e.parentNode;
2048
- if (t && t.tagName === "LI") t.parentNode.insertBefore(r, t.nextSibling), e.children.length === 0 && e.remove(), X(r);
2049
- else {
2050
- let t = document.createElement("div");
2051
- t.innerHTML = r.innerHTML;
2052
- let n = e.parentNode;
2053
- e.children.length === 1 ? n.replaceChild(t, e) : (n.insertBefore(t, e.nextSibling), e.removeChild(r)), X(t);
2054
- }
2055
- } else {
2056
- let e = yt(n);
2057
- if (!e) return;
2058
- let t = parseInt(e.style.marginLeft) || 0;
2059
- e.style.marginLeft = Math.max(0, t - 20) + "px";
2060
- }
2061
- e.current = gt();
2062
- }
2063
- };
2064
- }
2065
- //#endregion
2066
- //#region src/components/shared/toolbar/Paragraph/Components/index.jsx
2067
- function Et() {
2068
- return /* @__PURE__ */ R(ht, { logic: Tt() });
2069
- }
2070
- //#endregion
2071
- //#region src/components/shared/toolbar/Table/Components/TableToolbar.jsx
2072
- var Dt = 10;
2073
- function Ot({ logic: e }) {
2074
- let { insertTable: t } = e, [n, r] = G(1), [i, a] = G(1), [o, s] = G(!1), c = q(null), l = q(null), u = q(null);
2075
- K(() => {
2076
- if (!o) return;
2077
- function e(e) {
2078
- l.current && !l.current.contains(e.target) && c.current && !c.current.contains(e.target) && s(!1);
2079
- }
2080
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2081
- }, [o]);
2082
- let d = (e) => {
2083
- if (!u.current) return;
2084
- let t = u.current.getBoundingClientRect(), n = e.clientX - t.left, i = e.clientY - t.top, o = t.width / Dt, s = Math.min(Math.floor(n / o) + 1, Dt), c = Math.min(Math.floor(i / o) + 1, Dt);
2085
- a(s), r(c);
2086
- }, f = () => {
2087
- r(1), a(1);
2088
- }, p = () => {
2089
- t(n, i), s(!1), r(1), a(1);
2090
- }, m = i / Dt * 100, h = n / Dt * 100;
2091
- return /* @__PURE__ */ R("div", {
2092
- className: "forge-toolbar-group forge-toolbar-table relative flex items-center gap-0.5",
2093
- children: [/* @__PURE__ */ R("button", {
2094
- ref: c,
2095
- type: "button",
2096
- className: "forge-toolbar-button group relative flex h-8 cursor-pointer items-center justify-center rounded-[2px] border border-[#ccc] bg-white px-2 text-sm leading-none transition-all duration-150 hover:bg-[#f0f0f0] active:translate-y-px",
2097
- "aria-label": "Table",
2098
- onClick: () => s(!o),
2099
- children: [/* @__PURE__ */ R("span", {
2100
- className: "forge-toolbar-icon",
2101
- children: "▦"
2102
- }), /* @__PURE__ */ R("span", {
2103
- className: "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]",
2104
- "data-i18n": "table",
2105
- children: "Table"
2106
- })]
2107
- }), /* @__PURE__ */ R("div", {
2108
- ref: l,
2109
- className: `forge-toolbar-dropdown forge-dropdown-table absolute left-0 top-full z-10 mt-1 min-w-[160px] rounded-[3px] border border-[#ccc] bg-white p-2 shadow-[0_2px_6px_rgba(0,0,0,0.15)] rtl:left-auto rtl:right-0 ${o ? "block" : "hidden"}`,
2110
- role: "list",
2111
- "aria-label": "Insert table",
2112
- children: [/* @__PURE__ */ R("div", {
2113
- ref: u,
2114
- className: "note-dimension-picker relative mx-auto h-40 w-40 cursor-pointer overflow-hidden rounded-[3px] border border-[#ccc] bg-[#f5f5f5]",
2115
- onMouseMove: d,
2116
- onMouseLeave: f,
2117
- onClick: p,
2118
- children: [
2119
- /* @__PURE__ */ R("div", { className: "absolute inset-0 z-[5]" }),
2120
- /* @__PURE__ */ R("div", {
2121
- className: "pointer-events-none absolute left-0 top-0 z-[3] border-2 border-[#4a90d9] bg-[rgba(74,144,217,0.4)] transition-[width,height] duration-75 ease-in-out",
2122
- style: {
2123
- width: m + "%",
2124
- height: h + "%"
2125
- }
2126
- }),
2127
- /* @__PURE__ */ R("div", { className: "pointer-events-none absolute inset-0 z-[2] bg-white/30" }),
2128
- /* @__PURE__ */ R("div", { className: "pointer-events-none absolute inset-0 z-[1] bg-[linear-gradient(rgba(0,0,0,0.05)_1px,transparent_1px),linear-gradient(90deg,rgba(0,0,0,0.05)_1px,transparent_1px)] bg-[size:16px_16px]" })
2129
- ]
2130
- }), /* @__PURE__ */ R("div", {
2131
- className: "note-dimension-display px-0 pt-1.5 pb-0.5 text-center text-[13px] font-semibold text-[#333]",
2132
- children: [
2133
- n,
2134
- " x ",
2135
- i
2136
- ]
2137
- })]
2138
- })]
2139
- });
2140
- }
2141
- //#endregion
2142
- //#region src/components/shared/toolbar/Table/Hooks/tableLogic.jsx
2143
- function kt() {
2144
- let e = document.querySelector(".forge-editor__content");
2145
- if (e) {
2146
- e.focus();
2147
- let t = document.createRange(), n = window.getSelection();
2148
- if (n) {
2149
- let r = e.lastChild;
2150
- r ? (t.setStartAfter(r), t.collapse(!0)) : (t.selectNodeContents(e), t.collapse(!1)), n.removeAllRanges(), n.addRange(t);
2151
- }
2152
- }
2153
- }
2154
- function At(e) {
2155
- let t = window.getSelection();
2156
- if (!t || !t.rangeCount) {
2157
- kt(), setTimeout(() => At(e), 50);
2158
- return;
2159
- }
2160
- let n = t.getRangeAt(0);
2161
- n.deleteContents();
2162
- let r = n.createContextualFragment(e), i = r.lastChild;
2163
- n.insertNode(r), i ? (n.setStartAfter(i), n.collapse(!0)) : n.collapse(!1), t.removeAllRanges(), t.addRange(n);
2164
- }
2165
- function jt() {
2166
- return { insertTable: (e, t) => {
2167
- let n = (100 / t).toFixed(2) + "%", r = "<table style=\"width:100%;table-layout:fixed;border-collapse:collapse;border:1px solid #ddd;\">";
2168
- for (let i = 0; i < e; i++) {
2169
- r += "<tr>";
2170
- for (let e = 0; e < t; e++) r += `<td style="border:1px solid #ddd;padding:8px;width:${n};text-align:center;vertical-align:middle;overflow:hidden;word-break:break-word;"><br></td>`;
2171
- r += "</tr>";
2172
- }
2173
- r += "</table><br>", kt(), At(r);
2174
- } };
2175
- }
2176
- //#endregion
2177
- //#region src/components/shared/toolbar/Table/Components/index.jsx
2178
- function Mt() {
2179
- return /* @__PURE__ */ R(Ot, { logic: jt() });
2180
- }
2181
- //#endregion
2182
- //#region src/components/shared/toolbar/Insert/Components/InsertToolbar.jsx
2183
- function Nt({ logic: e }) {
2184
- let { insertLink: t, insertImage: n, insertVideo: r } = e, i = "forge-toolbar-button group relative flex h-8 cursor-pointer items-center justify-center gap-0.5 rounded-[2px] border border-[#ccc] bg-white px-[7px] py-1 text-sm leading-none transition-all duration-150 hover:bg-[#f0f0f0] active:translate-y-px", a = "forge-toolbar-icon inline-block min-w-4 text-center text-sm font-medium leading-none", o = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]";
2185
- return /* @__PURE__ */ R("div", {
2186
- className: "forge-toolbar-group forge-toolbar-insert flex items-center gap-0.5",
2187
- children: [
2188
- /* @__PURE__ */ R("button", {
2189
- type: "button",
2190
- className: i,
2191
- onClick: t,
2192
- "aria-label": "Link",
2193
- children: [/* @__PURE__ */ R("span", {
2194
- className: a,
2195
- children: "🔗"
2196
- }), /* @__PURE__ */ R("span", {
2197
- className: o,
2198
- "data-i18n": "link",
2199
- children: "Link"
2200
- })]
2201
- }),
2202
- /* @__PURE__ */ R("button", {
2203
- type: "button",
2204
- className: i,
2205
- onClick: n,
2206
- "aria-label": "Image",
2207
- children: [/* @__PURE__ */ R("span", {
2208
- className: a,
2209
- children: "🖼"
2210
- }), /* @__PURE__ */ R("span", {
2211
- className: o,
2212
- "data-i18n": "image",
2213
- children: "Image"
2214
- })]
2215
- }),
2216
- /* @__PURE__ */ R("button", {
2217
- type: "button",
2218
- className: i,
2219
- onClick: r,
2220
- "aria-label": "Video",
2221
- children: [/* @__PURE__ */ R("span", {
2222
- className: a,
2223
- children: "▶"
2224
- }), /* @__PURE__ */ R("span", {
2225
- className: o,
2226
- "data-i18n": "video",
2227
- children: "Video"
2228
- })]
2229
- })
2230
- ]
2231
- });
2232
- }
2233
- //#endregion
2234
- //#region src/components/shared/Hooks/sweetAlert.jsx
2235
- var Pt = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2236
- (function(n, r) {
2237
- typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self, n.Sweetalert2 = r());
2238
- })(e, (function() {
2239
- function e(e, t, n) {
2240
- if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
2241
- throw TypeError("Private element is not present on this object");
2242
- }
2243
- function t(e, t) {
2244
- if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
2245
- }
2246
- function n(t, n) {
2247
- return t.get(e(t, n));
2248
- }
2249
- function r(e, n, r) {
2250
- t(e, n), n.set(e, r);
2251
- }
2252
- function i(t, n, r) {
2253
- return t.set(e(t, n), r), r;
2254
- }
2255
- let a = {}, o = () => {
2256
- a.previousActiveElement instanceof HTMLElement ? (a.previousActiveElement.focus(), a.previousActiveElement = null) : document.body && document.body.focus();
2257
- }, s = (e) => new Promise((t) => {
2258
- if (!e) return t();
2259
- let n = window.scrollX, r = window.scrollY;
2260
- a.restoreFocusTimeout = setTimeout(() => {
2261
- o(), t();
2262
- }, 100), window.scrollTo(n, r);
2263
- }), c = "swal2-", l = (/* @__PURE__ */ "container.shown.height-auto.iosfix.popup.modal.no-backdrop.no-transition.toast.toast-shown.show.hide.close.title.html-container.actions.confirm.deny.cancel.footer.icon.icon-content.image.input.file.range.select.radio.checkbox.label.textarea.inputerror.input-label.validation-message.progress-steps.active-progress-step.progress-step.progress-step-line.loader.loading.styled.top.top-start.top-end.top-left.top-right.center.center-start.center-end.center-left.center-right.bottom.bottom-start.bottom-end.bottom-left.bottom-right.grow-row.grow-column.grow-fullscreen.rtl.timer-progress-bar.timer-progress-bar-container.scrollbar-measure.icon-success.icon-warning.icon-info.icon-question.icon-error.draggable.dragging".split(".")).reduce((e, t) => (e[t] = c + t, e), {}), u = [
2264
- "success",
2265
- "warning",
2266
- "info",
2267
- "question",
2268
- "error"
2269
- ].reduce((e, t) => (e[t] = c + t, e), {}), d = "SweetAlert2:", f = (e) => e.charAt(0).toUpperCase() + e.slice(1), p = (e) => {
2270
- console.warn(`${d} ${typeof e == "object" ? e.join(" ") : e}`);
2271
- }, m = (e) => {
2272
- console.error(`${d} ${e}`);
2273
- }, h = [], g = (e) => {
2274
- h.includes(e) || (h.push(e), p(e));
2275
- }, _ = (e, t = null) => {
2276
- g(`"${e}" is deprecated and will be removed in the next major release.${t ? ` Use "${t}" instead.` : ""}`);
2277
- }, v = (e) => typeof e == "function" ? e() : e, y = (e) => e && typeof e.toPromise == "function", b = (e) => y(e) ? e.toPromise() : Promise.resolve(e), x = (e) => e && Promise.resolve(e) === e, S = () => navigator.userAgent.includes("Firefox"), C = () => document.body.querySelector(`.${l.container}`), w = (e) => {
2278
- let t = C();
2279
- return t ? t.querySelector(e) : null;
2280
- }, T = (e) => w(`.${e}`), E = () => T(l.popup), D = () => T(l.icon), O = () => T(l["icon-content"]), ee = () => T(l.title), te = () => T(l["html-container"]), k = () => T(l.image), ne = () => T(l["progress-steps"]), re = () => T(l["validation-message"]), A = () => w(`.${l.actions} .${l.confirm}`), ie = () => w(`.${l.actions} .${l.cancel}`), j = () => w(`.${l.actions} .${l.deny}`), ae = () => T(l["input-label"]), M = () => w(`.${l.loader}`), oe = () => T(l.actions), se = () => T(l.footer), ce = () => T(l["timer-progress-bar"]), le = () => T(l.close), ue = () => {
2281
- let e = E();
2282
- if (!e) return [];
2283
- let t = e.querySelectorAll("[tabindex]:not([tabindex=\"-1\"]):not([tabindex=\"0\"])"), n = Array.from(t).sort((e, t) => {
2284
- let n = parseInt(e.getAttribute("tabindex") || "0"), r = parseInt(t.getAttribute("tabindex") || "0");
2285
- return n > r ? 1 : n < r ? -1 : 0;
2286
- }), r = e.querySelectorAll("\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n"), i = Array.from(r).filter((e) => e.getAttribute("tabindex") !== "-1");
2287
- return [...new Set(n.concat(i))].filter((e) => H(e));
2288
- }, de = () => P(document.body, l.shown) && !P(document.body, l["toast-shown"]) && !P(document.body, l["no-backdrop"]), fe = () => {
2289
- let e = E();
2290
- return e ? P(e, l.toast) : !1;
2291
- }, pe = () => {
2292
- let e = E();
2293
- return e ? e.hasAttribute("data-loading") : !1;
2294
- }, N = (e, t) => {
2295
- if (e.textContent = "", t) {
2296
- let n = new DOMParser().parseFromString(t, "text/html"), r = n.querySelector("head");
2297
- r && Array.from(r.childNodes).forEach((t) => {
2298
- e.appendChild(t);
2299
- });
2300
- let i = n.querySelector("body");
2301
- i && Array.from(i.childNodes).forEach((t) => {
2302
- t instanceof HTMLVideoElement || t instanceof HTMLAudioElement ? e.appendChild(t.cloneNode(!0)) : e.appendChild(t);
2303
- });
2304
- }
2305
- }, P = (e, t) => t ? t.split(/\s+/).every((t) => e.classList.contains(t)) : !1, me = (e, t) => {
2306
- Array.from(e.classList).forEach((n) => {
2307
- !Object.values(l).includes(n) && !Object.values(u).includes(n) && !Object.values(t.showClass || {}).includes(n) && e.classList.remove(n);
2308
- });
2309
- }, F = (e, t, n) => {
2310
- if (me(e, t), !t.customClass) return;
2311
- let r = t.customClass[n];
2312
- if (r) {
2313
- if (typeof r != "string" && !r.forEach) {
2314
- p(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof r}"`);
2315
- return;
2316
- }
2317
- I(e, r);
2318
- }
2319
- }, he = (e, t) => {
2320
- if (!t) return null;
2321
- switch (t) {
2322
- case "select":
2323
- case "textarea":
2324
- case "file": return e.querySelector(`.${l.popup} > .${l[t]}`);
2325
- case "checkbox": return e.querySelector(`.${l.popup} > .${l.checkbox} input`);
2326
- case "radio": return e.querySelector(`.${l.popup} > .${l.radio} input:checked`) || e.querySelector(`.${l.popup} > .${l.radio} input:first-child`);
2327
- case "range": return e.querySelector(`.${l.popup} > .${l.range} input`);
2328
- default: return e.querySelector(`.${l.popup} > .${l.input}`);
2329
- }
2330
- }, ge = (e) => {
2331
- if (e.focus(), e.type !== "file") {
2332
- let t = e.value;
2333
- e.value = "", e.value = t;
2334
- }
2335
- }, _e = (e, t, n) => {
2336
- if (!e || !t) return;
2337
- let r = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : t;
2338
- (Array.isArray(e) ? e : [e]).forEach((e) => {
2339
- r.forEach((t) => {
2340
- n ? e.classList.add(t) : e.classList.remove(t);
2341
- });
2342
- });
2343
- }, I = (e, t) => {
2344
- _e(e, t, !0);
2345
- }, L = (e, t) => {
2346
- _e(e, t, !1);
2347
- }, R = (e, t) => Array.from(e.children).find((e) => e instanceof HTMLElement && P(e, t)), ve = (e, t, n) => {
2348
- n === `${parseInt(`${n}`)}` && (n = parseInt(n)), n || n === 0 ? e.style.setProperty(t, typeof n == "number" ? `${n}px` : n) : e.style.removeProperty(t);
2349
- }, z = (e, t = "flex") => {
2350
- e && (e.style.display = t);
2351
- }, B = (e) => {
2352
- e && (e.style.display = "none");
2353
- }, ye = (e, t = "block") => {
2354
- e && new MutationObserver(() => {
2355
- be(e, e.innerHTML, t);
2356
- }).observe(e, {
2357
- childList: !0,
2358
- subtree: !0
2359
- });
2360
- }, V = (e, t, n, r) => {
2361
- let i = e.querySelector(t);
2362
- i && i.style.setProperty(n, r);
2363
- }, be = (e, t, n = "flex") => {
2364
- t ? z(e, n) : B(e);
2365
- }, H = (e) => !!(e && (e.offsetWidth || e.offsetHeight || e.getClientRects().length)), xe = () => !H(A()) && !H(j()) && !H(ie()), Se = (e) => e.scrollHeight > e.clientHeight, U = (e, t) => {
2366
- let n = e;
2367
- for (; n && n !== t;) {
2368
- if (Se(n)) return !0;
2369
- n = n.parentElement;
2370
- }
2371
- return !1;
2372
- }, Ce = (e) => {
2373
- let t = window.getComputedStyle(e), n = parseFloat(t.getPropertyValue("animation-duration") || "0"), r = parseFloat(t.getPropertyValue("transition-duration") || "0");
2374
- return n > 0 || r > 0;
2375
- }, we = (e, t = !1) => {
2376
- let n = ce();
2377
- n && H(n) && (t && (n.style.transition = "none", n.style.width = "100%"), setTimeout(() => {
2378
- n.style.transition = `width ${e / 1e3}s linear`, n.style.width = "0%";
2379
- }, 10));
2380
- }, Te = () => {
2381
- let e = ce();
2382
- if (!e) return;
2383
- let t = parseInt(window.getComputedStyle(e).width);
2384
- e.style.removeProperty("transition"), e.style.width = "100%";
2385
- let n = t / parseInt(window.getComputedStyle(e).width) * 100;
2386
- e.style.width = `${n}%`;
2387
- }, Ee = () => typeof window > "u" || typeof document > "u", De = `
2388
- <div aria-labelledby="${l.title}" aria-describedby="${l["html-container"]}" class="${l.popup}" tabindex="-1">
2389
- <button type="button" class="${l.close}"></button>
2390
- <ul class="${l["progress-steps"]}"></ul>
2391
- <div class="${l.icon}"></div>
2392
- <img class="${l.image}" />
2393
- <h2 class="${l.title}" id="${l.title}"></h2>
2394
- <div class="${l["html-container"]}" id="${l["html-container"]}"></div>
2395
- <input class="${l.input}" id="${l.input}" />
2396
- <input type="file" class="${l.file}" />
2397
- <div class="${l.range}">
2398
- <input type="range" />
2399
- <output></output>
2400
- </div>
2401
- <select class="${l.select}" id="${l.select}"></select>
2402
- <div class="${l.radio}"></div>
2403
- <label class="${l.checkbox}">
2404
- <input type="checkbox" id="${l.checkbox}" />
2405
- <span class="${l.label}"></span>
2406
- </label>
2407
- <textarea class="${l.textarea}" id="${l.textarea}"></textarea>
2408
- <div class="${l["validation-message"]}" id="${l["validation-message"]}"></div>
2409
- <div class="${l.actions}">
2410
- <div class="${l.loader}"></div>
2411
- <button type="button" class="${l.confirm}"></button>
2412
- <button type="button" class="${l.deny}"></button>
2413
- <button type="button" class="${l.cancel}"></button>
2414
- </div>
2415
- <div class="${l.footer}"></div>
2416
- <div class="${l["timer-progress-bar-container"]}">
2417
- <div class="${l["timer-progress-bar"]}"></div>
2418
- </div>
2419
- </div>
2420
- `.replace(/(^|\n)\s*/g, ""), Oe = () => {
2421
- let e = C();
2422
- return e ? (e.remove(), L([document.documentElement, document.body], [
2423
- l["no-backdrop"],
2424
- l["toast-shown"],
2425
- l["has-column"]
2426
- ]), !0) : !1;
2427
- }, W = () => {
2428
- a.currentInstance && a.currentInstance.resetValidationMessage();
2429
- }, G = () => {
2430
- let e = E();
2431
- if (!e) return;
2432
- let t = R(e, l.input), n = R(e, l.file), r = e.querySelector(`.${l.range} input`), i = e.querySelector(`.${l.range} output`), a = R(e, l.select), o = e.querySelector(`.${l.checkbox} input`), s = R(e, l.textarea);
2433
- t && (t.oninput = W), n && (n.onchange = W), a && (a.onchange = W), o && (o.onchange = W), s && (s.oninput = W), r && i && (r.oninput = () => {
2434
- W(), i.value = r.value;
2435
- }, r.onchange = () => {
2436
- W(), i.value = r.value;
2437
- });
2438
- }, ke = (e) => {
2439
- if (typeof e == "string") {
2440
- let t = document.querySelector(e);
2441
- if (!t) throw Error(`Target element "${e}" not found`);
2442
- return t;
2443
- }
2444
- return e;
2445
- }, K = (e) => {
2446
- let t = E();
2447
- t && (t.setAttribute("role", e.toast ? "alert" : "dialog"), t.setAttribute("aria-live", e.toast ? "polite" : "assertive"), e.toast || t.setAttribute("aria-modal", "true"));
2448
- }, q = (e) => {
2449
- window.getComputedStyle(e).direction === "rtl" && (I(C(), l.rtl), a.isRTL = !0);
2450
- }, Ae = (e) => {
2451
- let t = Oe();
2452
- if (Ee()) {
2453
- m("SweetAlert2 requires document to initialize");
2454
- return;
2455
- }
2456
- let n = document.createElement("div");
2457
- n.className = l.container, t && I(n, l["no-transition"]), N(n, De), n.dataset.swal2Theme = e.theme;
2458
- let r = ke(e.target || "body");
2459
- r.appendChild(n), e.topLayer && (n.setAttribute("popover", ""), n.showPopover()), K(e), q(r), G();
2460
- }, je = (e, t) => {
2461
- e instanceof HTMLElement ? t.appendChild(e) : typeof e == "object" ? Me(e, t) : e && N(t, e);
2462
- }, Me = (e, t) => {
2463
- "jquery" in e ? Ne(t, e) : N(t, e.toString());
2464
- }, Ne = (e, t) => {
2465
- if (e.textContent = "", 0 in t) for (let n = 0; n in t; n++) e.appendChild(t[n].cloneNode(!0));
2466
- else e.appendChild(t.cloneNode(!0));
2467
- }, Pe = (e, t) => {
2468
- let n = oe(), r = M();
2469
- !n || !r || (!t.showConfirmButton && !t.showDenyButton && !t.showCancelButton ? B(n) : z(n), F(n, t, "actions"), Fe(n, r, t), N(r, t.loaderHtml || ""), F(r, t, "loader"));
2470
- };
2471
- function Fe(e, t, n) {
2472
- let r = A(), i = j(), a = ie();
2473
- !r || !i || !a || (Re(r, "confirm", n), Re(i, "deny", n), Re(a, "cancel", n), Ie(r, i, a, n), n.reverseButtons && (n.toast ? (e.insertBefore(a, r), e.insertBefore(i, r)) : (e.insertBefore(a, t), e.insertBefore(i, t), e.insertBefore(r, t))));
2474
- }
2475
- function Ie(e, t, n, r) {
2476
- if (!r.buttonsStyling) {
2477
- L([
2478
- e,
2479
- t,
2480
- n
2481
- ], l.styled);
2482
- return;
2483
- }
2484
- I([
2485
- e,
2486
- t,
2487
- n
2488
- ], l.styled), [
2489
- [
2490
- e,
2491
- "confirm",
2492
- r.confirmButtonColor
2493
- ],
2494
- [
2495
- t,
2496
- "deny",
2497
- r.denyButtonColor
2498
- ],
2499
- [
2500
- n,
2501
- "cancel",
2502
- r.cancelButtonColor
2503
- ]
2504
- ].forEach(([e, t, n]) => {
2505
- n && e.style.setProperty(`--swal2-${t}-button-background-color`, n), Le(e);
2506
- });
2507
- }
2508
- function Le(e) {
2509
- let t = window.getComputedStyle(e);
2510
- if (t.getPropertyValue("--swal2-action-button-focus-box-shadow")) return;
2511
- let n = t.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/, "rgba($1, $2, $3, 0.5)");
2512
- e.style.setProperty("--swal2-action-button-focus-box-shadow", t.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/, ` ${n}`));
2513
- }
2514
- function Re(e, t, n) {
2515
- let r = f(t);
2516
- be(e, n[`show${r}Button`], "inline-block"), N(e, n[`${t}ButtonText`] || ""), e.setAttribute("aria-label", n[`${t}ButtonAriaLabel`] || ""), e.className = l[t], F(e, n, `${t}Button`);
2517
- }
2518
- let ze = (e, t) => {
2519
- let n = le();
2520
- n && (N(n, t.closeButtonHtml || ""), F(n, t, "closeButton"), be(n, t.showCloseButton), n.setAttribute("aria-label", t.closeButtonAriaLabel || ""));
2521
- }, Be = (e, t) => {
2522
- let n = C();
2523
- n && (Ve(n, t.backdrop), He(n, t.position), Ue(n, t.grow), F(n, t, "container"));
2524
- };
2525
- function Ve(e, t) {
2526
- typeof t == "string" ? e.style.background = t : t || I([document.documentElement, document.body], l["no-backdrop"]);
2527
- }
2528
- function He(e, t) {
2529
- t && (t in l ? I(e, l[t]) : (p("The \"position\" parameter is not valid, defaulting to \"center\""), I(e, l.center)));
2530
- }
2531
- function Ue(e, t) {
2532
- t && I(e, l[`grow-${t}`]);
2533
- }
2534
- var J = {
2535
- innerParams: /* @__PURE__ */ new WeakMap(),
2536
- domCache: /* @__PURE__ */ new WeakMap(),
2537
- focusedElement: /* @__PURE__ */ new WeakMap()
2538
- };
2539
- let We = [
2540
- "input",
2541
- "file",
2542
- "range",
2543
- "select",
2544
- "radio",
2545
- "checkbox",
2546
- "textarea"
2547
- ], Ge = (e, t) => {
2548
- let n = E();
2549
- if (!n) return;
2550
- let r = J.innerParams.get(e), i = !r || t.input !== r.input;
2551
- We.forEach((e) => {
2552
- let r = R(n, l[e]);
2553
- r && (Je(e, t.inputAttributes), r.className = l[e], i && B(r));
2554
- }), t.input && (i && Ke(t), Ye(t));
2555
- }, Ke = (e) => {
2556
- if (!e.input) return;
2557
- if (!Y[e.input]) {
2558
- m(`Unexpected type of input! Expected ${Object.keys(Y).join(" | ")}, got "${e.input}"`);
2559
- return;
2560
- }
2561
- let t = Qe(e.input);
2562
- if (!t) return;
2563
- let n = Y[e.input](t, e);
2564
- z(t), e.inputAutoFocus && setTimeout(() => {
2565
- ge(n);
2566
- });
2567
- }, qe = (e) => {
2568
- for (let { name: t } of Array.from(e.attributes)) [
2569
- "id",
2570
- "type",
2571
- "value",
2572
- "style"
2573
- ].includes(t) || e.removeAttribute(t);
2574
- }, Je = (e, t) => {
2575
- let n = E();
2576
- if (!n) return;
2577
- let r = he(n, e);
2578
- if (r) {
2579
- qe(r);
2580
- for (let e in t) r.setAttribute(e, t[e]);
2581
- }
2582
- }, Ye = (e) => {
2583
- if (!e.input) return;
2584
- let t = Qe(e.input);
2585
- t && F(t, e, "input");
2586
- }, Xe = (e, t) => {
2587
- !e.placeholder && t.inputPlaceholder && (e.placeholder = t.inputPlaceholder);
2588
- }, Ze = (e, t, n) => {
2589
- if (n.inputLabel) {
2590
- let r = document.createElement("label"), i = l["input-label"];
2591
- r.setAttribute("for", e.id), r.className = i, typeof n.customClass == "object" && I(r, n.customClass.inputLabel), r.innerText = n.inputLabel, t.insertAdjacentElement("beforebegin", r);
2592
- }
2593
- }, Qe = (e) => {
2594
- let t = E();
2595
- if (t) return R(t, l[e] || l.input);
2596
- }, $e = (e, t) => {
2597
- ["string", "number"].includes(typeof t) ? e.value = `${t}` : x(t) || p(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`);
2598
- }, Y = {};
2599
- Y.text = Y.email = Y.password = Y.number = Y.tel = Y.url = Y.search = Y.date = Y["datetime-local"] = Y.time = Y.week = Y.month = (e, t) => {
2600
- let n = e;
2601
- return $e(n, t.inputValue), Ze(n, n, t), Xe(n, t), n.type = t.input, n;
2602
- }, Y.file = (e, t) => {
2603
- let n = e;
2604
- return Ze(n, n, t), Xe(n, t), n;
2605
- }, Y.range = (e, t) => {
2606
- let n = e, r = n.querySelector("input"), i = n.querySelector("output");
2607
- return r && ($e(r, t.inputValue), r.type = t.input, Ze(r, e, t)), i && $e(i, t.inputValue), e;
2608
- }, Y.select = (e, t) => {
2609
- let n = e;
2610
- if (n.textContent = "", t.inputPlaceholder) {
2611
- let e = document.createElement("option");
2612
- N(e, t.inputPlaceholder), e.value = "", e.disabled = !0, e.selected = !0, n.appendChild(e);
2613
- }
2614
- return Ze(n, n, t), n;
2615
- }, Y.radio = (e) => {
2616
- let t = e;
2617
- return t.textContent = "", e;
2618
- }, Y.checkbox = (e, t) => {
2619
- let n = E();
2620
- if (!n) throw Error("Popup not found");
2621
- let r = he(n, "checkbox");
2622
- if (!r) throw Error("Checkbox input not found");
2623
- r.value = "1", r.checked = !!t.inputValue;
2624
- let i = e.querySelector("span");
2625
- if (i) {
2626
- let e = t.inputPlaceholder || t.inputLabel;
2627
- e && N(i, e);
2628
- }
2629
- return r;
2630
- }, Y.textarea = (e, t) => {
2631
- let n = e;
2632
- $e(n, t.inputValue), Xe(n, t), Ze(n, n, t);
2633
- let r = (e) => parseInt(window.getComputedStyle(e).marginLeft) + parseInt(window.getComputedStyle(e).marginRight);
2634
- return setTimeout(() => {
2635
- if ("MutationObserver" in window) {
2636
- let e = E();
2637
- if (!e) return;
2638
- let i = parseInt(window.getComputedStyle(e).width);
2639
- new MutationObserver(() => {
2640
- if (!document.body.contains(n)) return;
2641
- let e = n.offsetWidth + r(n), a = E();
2642
- a && (e > i ? a.style.width = `${e}px` : ve(a, "width", t.width));
2643
- }).observe(n, {
2644
- attributes: !0,
2645
- attributeFilter: ["style"]
2646
- });
2647
- }
2648
- }), n;
2649
- };
2650
- let et = (e, t) => {
2651
- let n = te();
2652
- n && (ye(n), F(n, t, "htmlContainer"), t.html ? (je(t.html, n), z(n, "block")) : t.text ? (n.textContent = t.text, z(n, "block")) : B(n), Ge(e, t));
2653
- }, tt = (e, t) => {
2654
- let n = se();
2655
- n && (ye(n), be(n, !!t.footer, "block"), t.footer && je(t.footer, n), F(n, t, "footer"));
2656
- }, nt = (e, t) => {
2657
- let n = J.innerParams.get(e), r = D();
2658
- if (r) {
2659
- if (n && t.icon === n.icon) {
2660
- ot(r, t), rt(r, t);
2661
- return;
2662
- }
2663
- if (!t.icon && !t.iconHtml) {
2664
- B(r);
2665
- return;
2666
- }
2667
- if (t.icon && Object.keys(u).indexOf(t.icon) === -1) {
2668
- m(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`), B(r);
2669
- return;
2670
- }
2671
- z(r), ot(r, t), rt(r, t), I(r, t.showClass && t.showClass.icon), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", it);
2672
- }
2673
- }, rt = (e, t) => {
2674
- for (let [n, r] of Object.entries(u)) t.icon !== n && L(e, r);
2675
- I(e, t.icon && u[t.icon]), st(e, t), it(), F(e, t, "icon");
2676
- }, it = () => {
2677
- let e = E();
2678
- if (!e) return;
2679
- let t = window.getComputedStyle(e).getPropertyValue("background-color");
2680
- e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix").forEach((e) => {
2681
- e.style.backgroundColor = t;
2682
- });
2683
- }, at = (e) => `
2684
- ${e.animation ? "<div class=\"swal2-success-circular-line-left\"></div>" : ""}
2685
- <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
2686
- <div class="swal2-success-ring"></div>
2687
- ${e.animation ? "<div class=\"swal2-success-fix\"></div>" : ""}
2688
- ${e.animation ? "<div class=\"swal2-success-circular-line-right\"></div>" : ""}
2689
- `, ot = (e, t) => {
2690
- if (!t.icon && !t.iconHtml) return;
2691
- let n = e.innerHTML, r = "";
2692
- t.iconHtml ? r = ct(t.iconHtml) : t.icon === "success" ? (r = at(t), n = n.replace(/ style=".*?"/g, "")) : t.icon === "error" ? r = "\n <span class=\"swal2-x-mark\">\n <span class=\"swal2-x-mark-line-left\"></span>\n <span class=\"swal2-x-mark-line-right\"></span>\n </span>\n" : t.icon && (r = ct({
2693
- question: "?",
2694
- warning: "!",
2695
- info: "i"
2696
- }[t.icon])), n.trim() !== r.trim() && N(e, r);
2697
- }, st = (e, t) => {
2698
- if (t.iconColor) {
2699
- e.style.color = t.iconColor, e.style.borderColor = t.iconColor;
2700
- for (let n of [
2701
- ".swal2-success-line-tip",
2702
- ".swal2-success-line-long",
2703
- ".swal2-x-mark-line-left",
2704
- ".swal2-x-mark-line-right"
2705
- ]) V(e, n, "background-color", t.iconColor);
2706
- V(e, ".swal2-success-ring", "border-color", t.iconColor);
2707
- }
2708
- }, ct = (e) => `<div class="${l["icon-content"]}">${e}</div>`, lt = (e, t) => {
2709
- let n = k();
2710
- if (n) {
2711
- if (!t.imageUrl) {
2712
- B(n);
2713
- return;
2714
- }
2715
- z(n, ""), n.setAttribute("src", t.imageUrl), n.setAttribute("alt", t.imageAlt || ""), ve(n, "width", t.imageWidth), ve(n, "height", t.imageHeight), n.className = l.image, F(n, t, "image");
2716
- }
2717
- }, ut = !1, dt = 0, ft = 0, pt = 0, mt = 0, ht = (e) => {
2718
- e.addEventListener("mousedown", _t), document.body.addEventListener("mousemove", X), e.addEventListener("mouseup", vt), e.addEventListener("touchstart", _t), document.body.addEventListener("touchmove", X), e.addEventListener("touchend", vt);
2719
- }, gt = (e) => {
2720
- e.removeEventListener("mousedown", _t), document.body.removeEventListener("mousemove", X), e.removeEventListener("mouseup", vt), e.removeEventListener("touchstart", _t), document.body.removeEventListener("touchmove", X), e.removeEventListener("touchend", vt);
2721
- }, _t = (e) => {
2722
- let t = E();
2723
- if (!t) return;
2724
- let n = D();
2725
- if (e.target === t || n && n.contains(e.target)) {
2726
- ut = !0;
2727
- let n = yt(e);
2728
- dt = n.clientX, ft = n.clientY, pt = parseInt(t.style.insetInlineStart) || 0, mt = parseInt(t.style.insetBlockStart) || 0, I(t, "swal2-dragging");
2729
- }
2730
- }, X = (e) => {
2731
- let t = E();
2732
- if (t && ut) {
2733
- let { clientX: n, clientY: r } = yt(e), i = n - dt;
2734
- t.style.insetInlineStart = `${pt + (a.isRTL ? -i : i)}px`, t.style.insetBlockStart = `${mt + (r - ft)}px`;
2735
- }
2736
- }, vt = () => {
2737
- let e = E();
2738
- ut = !1, L(e, "swal2-dragging");
2739
- }, yt = (e) => {
2740
- let t = e.type.startsWith("touch") ? e.touches[0] : e;
2741
- return {
2742
- clientX: t.clientX,
2743
- clientY: t.clientY
2744
- };
2745
- }, bt = (e, t) => {
2746
- let n = C(), r = E();
2747
- if (!(!n || !r)) {
2748
- if (t.toast) {
2749
- ve(n, "width", t.width), r.style.width = "100%";
2750
- let e = M();
2751
- e && r.insertBefore(e, D());
2752
- } else ve(r, "width", t.width);
2753
- ve(r, "padding", t.padding), t.color && (r.style.color = t.color), t.background && (r.style.background = t.background), B(re()), xt(r, t), t.draggable && !t.toast ? (I(r, l.draggable), ht(r)) : (L(r, l.draggable), gt(r));
2754
- }
2755
- }, xt = (e, t) => {
2756
- let n = t.showClass || {};
2757
- e.className = `${l.popup} ${H(e) ? n.popup : ""}`, t.toast ? (I([document.documentElement, document.body], l["toast-shown"]), I(e, l.toast)) : I(e, l.modal), F(e, t, "popup"), typeof t.customClass == "string" && I(e, t.customClass), t.icon && I(e, l[`icon-${t.icon}`]);
2758
- }, St = (e, t) => {
2759
- let n = ne();
2760
- if (!n) return;
2761
- let { progressSteps: r, currentProgressStep: i } = t;
2762
- if (!r || r.length === 0 || i === void 0) {
2763
- B(n);
2764
- return;
2765
- }
2766
- z(n), n.textContent = "", i >= r.length && p("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"), r.forEach((e, a) => {
2767
- let o = Ct(e);
2768
- if (n.appendChild(o), a === i && I(o, l["active-progress-step"]), a !== r.length - 1) {
2769
- let e = wt(t);
2770
- n.appendChild(e);
2771
- }
2772
- });
2773
- }, Ct = (e) => {
2774
- let t = document.createElement("li");
2775
- return I(t, l["progress-step"]), N(t, e), t;
2776
- }, wt = (e) => {
2777
- let t = document.createElement("li");
2778
- return I(t, l["progress-step-line"]), e.progressStepsDistance && ve(t, "width", e.progressStepsDistance), t;
2779
- }, Tt = (e, t) => {
2780
- let n = ee();
2781
- n && (ye(n), be(n, !!(t.title || t.titleText), "block"), t.title && je(t.title, n), t.titleText && (n.innerText = t.titleText), F(n, t, "title"));
2782
- }, Et = (e, t) => {
2783
- var n;
2784
- bt(e, t), Be(e, t), St(e, t), nt(e, t), lt(e, t), Tt(e, t), ze(e, t), et(e, t), Pe(e, t), tt(e, t);
2785
- let r = E();
2786
- typeof t.didRender == "function" && r && t.didRender(r), (n = a.eventEmitter) == null || n.emit("didRender", r);
2787
- }, Dt = () => H(E()), Ot = () => A()?.click(), kt = () => j()?.click(), At = () => ie()?.click(), jt = Object.freeze({
2788
- cancel: "cancel",
2789
- backdrop: "backdrop",
2790
- close: "close",
2791
- esc: "esc",
2792
- timer: "timer"
2793
- }), Mt = (e) => {
2794
- if (e.keydownTarget && e.keydownHandlerAdded && e.keydownHandler) {
2795
- let t = e.keydownHandler;
2796
- e.keydownTarget.removeEventListener("keydown", t, { capture: e.keydownListenerCapture }), e.keydownHandlerAdded = !1;
2797
- }
2798
- }, Nt = (e, t, n) => {
2799
- if (Mt(e), !t.toast) {
2800
- let r = (e) => Lt(t, e, n);
2801
- e.keydownHandler = r;
2802
- let i = t.keydownListenerCapture ? window : E();
2803
- if (i) {
2804
- e.keydownTarget = i, e.keydownListenerCapture = t.keydownListenerCapture;
2805
- let n = r;
2806
- e.keydownTarget.addEventListener("keydown", n, { capture: e.keydownListenerCapture }), e.keydownHandlerAdded = !0;
2807
- }
2808
- }
2809
- }, Pt = (e, t) => {
2810
- var n;
2811
- let r = ue();
2812
- return r.length ? (e += t, e === -2 && (e = r.length - 1), e === r.length ? e = 0 : e === -1 && (e = r.length - 1), r[e].focus(), !(S() && r[e] instanceof HTMLIFrameElement)) : ((n = E()) == null || n.focus(), !0);
2813
- }, Ft = ["ArrowRight", "ArrowDown"], It = ["ArrowLeft", "ArrowUp"], Lt = (e, t, n) => {
2814
- e && (t.isComposing || t.keyCode === 229 || (e.stopKeydownPropagation && t.stopPropagation(), t.key === "Enter" ? Rt(t, e) : t.key === "Tab" ? zt(t) : [...Ft, ...It].includes(t.key) ? Bt(t.key) : t.key === "Escape" && Vt(t, e, n)));
2815
- }, Rt = (e, t) => {
2816
- if (!v(t.allowEnterKey)) return;
2817
- let n = E();
2818
- if (!n || !t.input) return;
2819
- let r = he(n, t.input);
2820
- if (e.target && r && e.target instanceof HTMLElement && e.target.outerHTML === r.outerHTML) {
2821
- if (["textarea", "file"].includes(t.input)) return;
2822
- Ot(), e.preventDefault();
2823
- }
2824
- }, zt = (e) => {
2825
- let t = e.target, n = ue().findIndex((e) => e === t), r = !0;
2826
- r = e.shiftKey ? Pt(n, -1) : Pt(n, 1), e.stopPropagation(), r && e.preventDefault();
2827
- }, Bt = (e) => {
2828
- let t = oe(), n = A(), r = j(), i = ie();
2829
- if (!t || !n || !r || !i) return;
2830
- let a = [
2831
- n,
2832
- r,
2833
- i
2834
- ];
2835
- if (document.activeElement instanceof HTMLElement && !a.includes(document.activeElement)) return;
2836
- let o = Ft.includes(e) ? "nextElementSibling" : "previousElementSibling", s = document.activeElement;
2837
- if (s) {
2838
- for (let e = 0; e < t.children.length; e++) {
2839
- if (s = s[o], !s) return;
2840
- if (s instanceof HTMLButtonElement && H(s)) break;
2841
- }
2842
- s instanceof HTMLButtonElement && s.focus();
2843
- }
2844
- }, Vt = (e, t, n) => {
2845
- e.preventDefault(), v(t.allowEscapeKey) && n(jt.esc);
2846
- };
2847
- var Ht = {
2848
- swalPromiseResolve: /* @__PURE__ */ new WeakMap(),
2849
- swalPromiseReject: /* @__PURE__ */ new WeakMap()
2850
- };
2851
- let Ut = () => {
2852
- let e = C();
2853
- Array.from(document.body.children).forEach((t) => {
2854
- t.contains(e) || (t.hasAttribute("aria-hidden") && t.setAttribute("data-previous-aria-hidden", t.getAttribute("aria-hidden") || ""), t.setAttribute("aria-hidden", "true"));
2855
- });
2856
- }, Wt = () => {
2857
- Array.from(document.body.children).forEach((e) => {
2858
- e.hasAttribute("data-previous-aria-hidden") ? (e.setAttribute("aria-hidden", e.getAttribute("data-previous-aria-hidden") || ""), e.removeAttribute("data-previous-aria-hidden")) : e.removeAttribute("aria-hidden");
2859
- });
2860
- }, Gt = typeof window < "u" && !!window.GestureEvent, Kt = Gt && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, qt = () => {
2861
- if (Gt && !P(document.body, l.iosfix)) {
2862
- let e = document.body.scrollTop;
2863
- document.body.style.top = `${e * -1}px`, I(document.body, l.iosfix), Jt();
2864
- }
2865
- }, Jt = () => {
2866
- let e = C();
2867
- if (!e) return;
2868
- let t;
2869
- e.ontouchstart = (e) => {
2870
- t = Yt(e);
2871
- }, e.ontouchmove = (e) => {
2872
- t && (e.preventDefault(), e.stopPropagation());
2873
- };
2874
- }, Yt = (e) => {
2875
- let t = e.target, n = C(), r = te();
2876
- return !n || !r || Xt(e) || Zt(e) ? !1 : t === n || !Se(n) && t instanceof HTMLElement && !U(t, r) && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" && !(Se(r) && r.contains(t));
2877
- }, Xt = (e) => !!(e.touches && e.touches.length && e.touches[0].touchType === "stylus"), Zt = (e) => e.touches && e.touches.length > 1, Qt = () => {
2878
- if (P(document.body, l.iosfix)) {
2879
- let e = parseInt(document.body.style.top, 10);
2880
- L(document.body, l.iosfix), document.body.style.top = "", document.body.scrollTop = e * -1;
2881
- }
2882
- }, $t = () => {
2883
- let e = document.createElement("div");
2884
- e.className = l["scrollbar-measure"], document.body.appendChild(e);
2885
- let t = e.getBoundingClientRect().width - e.clientWidth;
2886
- return document.body.removeChild(e), t;
2887
- }, en = null, tn = (e) => {
2888
- en === null && (document.body.scrollHeight > window.innerHeight || e === "scroll") && (en = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = `${en + $t()}px`);
2889
- }, nn = () => {
2890
- en !== null && (document.body.style.paddingRight = `${en}px`, en = null);
2891
- };
2892
- function rn(e, t, n, r) {
2893
- fe() ? fn(e, r) : (s(n).then(() => fn(e, r)), Mt(a)), Gt ? (t.setAttribute("style", "display:none !important"), t.removeAttribute("class"), t.innerHTML = "") : t.remove(), de() && (nn(), Qt(), Wt()), an();
2894
- }
2895
- function an() {
2896
- L([document.documentElement, document.body], [
2897
- l.shown,
2898
- l["height-auto"],
2899
- l["no-backdrop"],
2900
- l["toast-shown"]
2901
- ]);
2902
- }
2903
- function Z(e) {
2904
- e = ln(e);
2905
- let t = Ht.swalPromiseResolve.get(this), n = on(this);
2906
- this.isAwaitingPromise ? e.isDismissed || (cn(this), t(e)) : n && t(e);
2907
- }
2908
- let on = (e) => {
2909
- let t = E();
2910
- if (!t) return !1;
2911
- let n = J.innerParams.get(e);
2912
- if (!n || P(t, n.hideClass.popup)) return !1;
2913
- L(t, n.showClass.popup), I(t, n.hideClass.popup);
2914
- let r = C();
2915
- return L(r, n.showClass.backdrop), I(r, n.hideClass.backdrop), un(e, t, n), !0;
2916
- };
2917
- function sn(e) {
2918
- let t = Ht.swalPromiseReject.get(this);
2919
- cn(this), t && t(e);
2920
- }
2921
- let cn = (e) => {
2922
- e.isAwaitingPromise && (delete e.isAwaitingPromise, J.innerParams.get(e) || e._destroy());
2923
- }, ln = (e) => e === void 0 ? {
2924
- isConfirmed: !1,
2925
- isDenied: !1,
2926
- isDismissed: !0
2927
- } : Object.assign({
2928
- isConfirmed: !1,
2929
- isDenied: !1,
2930
- isDismissed: !1
2931
- }, e), un = (e, t, n) => {
2932
- var r;
2933
- let i = C(), o = Ce(t);
2934
- typeof n.willClose == "function" && n.willClose(t), (r = a.eventEmitter) == null || r.emit("willClose", t), o && i ? dn(e, t, i, !!n.returnFocus, n.didClose) : i && rn(e, i, !!n.returnFocus, n.didClose);
2935
- }, dn = (e, t, n, r, i) => {
2936
- a.swalCloseEventFinishedCallback = rn.bind(null, e, n, r, i);
2937
- let o = function(e) {
2938
- if (e.target === t) {
2939
- var n;
2940
- (n = a.swalCloseEventFinishedCallback) == null || n.call(a), delete a.swalCloseEventFinishedCallback, t.removeEventListener("animationend", o), t.removeEventListener("transitionend", o);
2941
- }
2942
- };
2943
- t.addEventListener("animationend", o), t.addEventListener("transitionend", o);
2944
- }, fn = (e, t) => {
2945
- setTimeout(() => {
2946
- var n;
2947
- typeof t == "function" && t.bind(e.params)(), (n = a.eventEmitter) == null || n.emit("didClose"), e._destroy && e._destroy();
2948
- });
2949
- }, pn = (e) => {
2950
- let t = E();
2951
- if (t || new li(), t = E(), !t) return;
2952
- let n = M();
2953
- fe() ? B(D()) : mn(t, e), z(n), t.setAttribute("data-loading", "true"), t.setAttribute("aria-busy", "true"), t.focus();
2954
- }, mn = (e, t) => {
2955
- let n = oe(), r = M();
2956
- !n || !r || (!t && H(A()) && (t = A()), z(n), t && (B(t), r.setAttribute("data-button-to-replace", t.className), n.insertBefore(r, t)), I([e, n], l.loading));
2957
- }, hn = (e, t) => {
2958
- t.input === "select" || t.input === "radio" ? bn(e, t) : [
2959
- "text",
2960
- "email",
2961
- "number",
2962
- "tel",
2963
- "textarea"
2964
- ].some((e) => e === t.input) && (y(t.inputValue) || x(t.inputValue)) && (pn(A()), xn(e, t));
2965
- }, gn = (e, t) => {
2966
- let n = e.getInput();
2967
- if (!n) return null;
2968
- switch (t.input) {
2969
- case "checkbox": return _n(n);
2970
- case "radio": return vn(n);
2971
- case "file": return yn(n);
2972
- default: return t.inputAutoTrim ? n.value.trim() : n.value;
2973
- }
2974
- }, _n = (e) => +!!e.checked, vn = (e) => e.checked ? e.value : null, yn = (e) => e.files && e.files.length ? e.getAttribute("multiple") === null ? e.files[0] : e.files : null, bn = (e, t) => {
2975
- let n = E();
2976
- if (!n) return;
2977
- let r = (e) => {
2978
- t.input === "select" ? Sn(n, wn(e), t) : t.input === "radio" && Cn(n, wn(e), t);
2979
- };
2980
- y(t.inputOptions) || x(t.inputOptions) ? (pn(A()), b(t.inputOptions).then((t) => {
2981
- e.hideLoading(), r(t);
2982
- })) : typeof t.inputOptions == "object" ? r(t.inputOptions) : m(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof t.inputOptions}`);
2983
- }, xn = (e, t) => {
2984
- let n = e.getInput();
2985
- n && (B(n), b(t.inputValue).then((r) => {
2986
- n.value = t.input === "number" ? `${parseFloat(r) || 0}` : `${r}`, z(n), n.focus(), e.hideLoading();
2987
- }).catch((t) => {
2988
- m(`Error in inputValue promise: ${t}`), n.value = "", z(n), n.focus(), e.hideLoading();
2989
- }));
2990
- };
2991
- function Sn(e, t, n) {
2992
- let r = R(e, l.select);
2993
- if (!r) return;
2994
- let i = (e, t, r) => {
2995
- let i = document.createElement("option");
2996
- i.value = r, N(i, t), i.selected = Tn(r, n.inputValue), e.appendChild(i);
2997
- };
2998
- t.forEach((e) => {
2999
- let t = e[0], n = e[1];
3000
- if (Array.isArray(n)) {
3001
- let e = document.createElement("optgroup");
3002
- e.label = t, e.disabled = !1, r.appendChild(e), n.forEach((t) => i(e, t[1], t[0]));
3003
- } else i(r, n, t);
3004
- }), r.focus();
3005
- }
3006
- function Cn(e, t, n) {
3007
- let r = R(e, l.radio);
3008
- if (!r) return;
3009
- t.forEach((e) => {
3010
- let t = e[0], i = e[1], a = document.createElement("input"), o = document.createElement("label");
3011
- a.type = "radio", a.name = l.radio, a.value = t, Tn(t, n.inputValue) && (a.checked = !0);
3012
- let s = document.createElement("span");
3013
- N(s, i), s.className = l.label, o.appendChild(a), o.appendChild(s), r.appendChild(o);
3014
- });
3015
- let i = r.querySelectorAll("input");
3016
- i.length && i[0].focus();
3017
- }
3018
- let wn = (e) => (e instanceof Map ? Array.from(e) : Object.entries(e)).map(([e, t]) => [e, typeof t == "object" ? wn(t) : t]), Tn = (e, t) => !!t && t != null && t.toString() === e.toString(), En = (e) => {
3019
- let t = J.innerParams.get(e);
3020
- e.disableButtons(), t.input ? kn(e, "confirm") : Pn(e, !0);
3021
- }, Dn = (e) => {
3022
- let t = J.innerParams.get(e);
3023
- e.disableButtons(), t.returnInputValueOnDeny ? kn(e, "deny") : jn(e, !1);
3024
- }, On = (e, t) => {
3025
- e.disableButtons(), t(jt.cancel);
3026
- }, kn = (e, t) => {
3027
- let n = J.innerParams.get(e);
3028
- if (!n.input) {
3029
- m(`The "input" parameter is needed to be set when using returnInputValueOn${f(t)}`);
3030
- return;
3031
- }
3032
- let r = e.getInput(), i = gn(e, n);
3033
- n.inputValidator ? An(e, i, t) : r && !r.checkValidity() ? (e.enableButtons(), e.showValidationMessage(n.validationMessage || r.validationMessage)) : t === "deny" ? jn(e, i) : Pn(e, i);
3034
- }, An = (e, t, n) => {
3035
- let r = J.innerParams.get(e);
3036
- e.disableInput(), Promise.resolve().then(() => b(r.inputValidator(t, r.validationMessage))).then((r) => {
3037
- e.enableButtons(), e.enableInput(), r ? e.showValidationMessage(r) : n === "deny" ? jn(e, t) : Pn(e, t);
3038
- });
3039
- }, jn = (e, t) => {
3040
- let n = J.innerParams.get(e);
3041
- n.showLoaderOnDeny && pn(j()), n.preDeny ? (e.isAwaitingPromise = !0, Promise.resolve().then(() => b(n.preDeny(t, n.validationMessage))).then((n) => {
3042
- n === !1 ? (e.hideLoading(), cn(e)) : e.close({
3043
- isDenied: !0,
3044
- value: n === void 0 ? t : n
3045
- });
3046
- }).catch((t) => Nn(e, t))) : e.close({
3047
- isDenied: !0,
3048
- value: t
3049
- });
3050
- }, Mn = (e, t) => {
3051
- e.close({
3052
- isConfirmed: !0,
3053
- value: t
3054
- });
3055
- }, Nn = (e, t) => {
3056
- e.rejectPromise(t);
3057
- }, Pn = (e, t) => {
3058
- let n = J.innerParams.get(e);
3059
- n.showLoaderOnConfirm && pn(), n.preConfirm ? (e.resetValidationMessage(), e.isAwaitingPromise = !0, Promise.resolve().then(() => b(n.preConfirm(t, n.validationMessage))).then((n) => {
3060
- H(re()) || n === !1 ? (e.hideLoading(), cn(e)) : Mn(e, n === void 0 ? t : n);
3061
- }).catch((t) => Nn(e, t))) : Mn(e, t);
3062
- };
3063
- function Fn() {
3064
- let e = J.innerParams.get(this);
3065
- if (!e) return;
3066
- let t = J.domCache.get(this);
3067
- B(t.loader), fe() ? e.icon && z(D()) : In(t), L([t.popup, t.actions], l.loading), t.popup.removeAttribute("aria-busy"), t.popup.removeAttribute("data-loading"), this.enableButtons();
3068
- }
3069
- let In = (e) => {
3070
- let t = e.loader.getAttribute("data-button-to-replace"), n = t ? e.popup.getElementsByClassName(t) : [];
3071
- n.length ? z(n[0], "inline-block") : xe() && B(e.actions);
3072
- };
3073
- function Ln() {
3074
- let e = J.innerParams.get(this), t = J.domCache.get(this);
3075
- return t ? he(t.popup, e.input) : null;
3076
- }
3077
- function Rn(e, t, n) {
3078
- let r = J.domCache.get(e);
3079
- t.forEach((e) => {
3080
- r[e].disabled = n;
3081
- });
3082
- }
3083
- function zn(e, t) {
3084
- let n = E();
3085
- !n || !e || (e.type === "radio" ? n.querySelectorAll(`[name="${l.radio}"]`).forEach((e) => {
3086
- e.disabled = t;
3087
- }) : e.disabled = t);
3088
- }
3089
- function Bn() {
3090
- Rn(this, [
3091
- "confirmButton",
3092
- "denyButton",
3093
- "cancelButton"
3094
- ], !1);
3095
- let e = J.focusedElement.get(this);
3096
- e instanceof HTMLElement && document.activeElement === document.body && e.focus(), J.focusedElement.delete(this);
3097
- }
3098
- function Vn() {
3099
- J.focusedElement.set(this, document.activeElement), Rn(this, [
3100
- "confirmButton",
3101
- "denyButton",
3102
- "cancelButton"
3103
- ], !0);
3104
- }
3105
- function Hn() {
3106
- zn(this.getInput(), !1);
3107
- }
3108
- function Un() {
3109
- zn(this.getInput(), !0);
3110
- }
3111
- function Wn(e) {
3112
- let t = J.domCache.get(this), n = J.innerParams.get(this);
3113
- N(t.validationMessage, e), t.validationMessage.className = l["validation-message"], n.customClass && n.customClass.validationMessage && I(t.validationMessage, n.customClass.validationMessage), z(t.validationMessage);
3114
- let r = this.getInput();
3115
- r && (r.setAttribute("aria-invalid", "true"), r.setAttribute("aria-describedby", l["validation-message"]), ge(r), I(r, l.inputerror));
3116
- }
3117
- function Gn() {
3118
- let e = J.domCache.get(this);
3119
- e.validationMessage && B(e.validationMessage);
3120
- let t = this.getInput();
3121
- t && (t.removeAttribute("aria-invalid"), t.removeAttribute("aria-describedby"), L(t, l.inputerror));
3122
- }
3123
- let Kn = {
3124
- title: "",
3125
- titleText: "",
3126
- text: "",
3127
- html: "",
3128
- footer: "",
3129
- icon: void 0,
3130
- iconColor: void 0,
3131
- iconHtml: void 0,
3132
- template: void 0,
3133
- toast: !1,
3134
- draggable: !1,
3135
- animation: !0,
3136
- theme: "light",
3137
- showClass: {
3138
- popup: "swal2-show",
3139
- backdrop: "swal2-backdrop-show",
3140
- icon: "swal2-icon-show"
3141
- },
3142
- hideClass: {
3143
- popup: "swal2-hide",
3144
- backdrop: "swal2-backdrop-hide",
3145
- icon: "swal2-icon-hide"
3146
- },
3147
- customClass: {},
3148
- target: "body",
3149
- color: void 0,
3150
- backdrop: !0,
3151
- heightAuto: !0,
3152
- allowOutsideClick: !0,
3153
- allowEscapeKey: !0,
3154
- allowEnterKey: !0,
3155
- stopKeydownPropagation: !0,
3156
- keydownListenerCapture: !1,
3157
- showConfirmButton: !0,
3158
- showDenyButton: !1,
3159
- showCancelButton: !1,
3160
- preConfirm: void 0,
3161
- preDeny: void 0,
3162
- confirmButtonText: "OK",
3163
- confirmButtonAriaLabel: "",
3164
- confirmButtonColor: void 0,
3165
- denyButtonText: "No",
3166
- denyButtonAriaLabel: "",
3167
- denyButtonColor: void 0,
3168
- cancelButtonText: "Cancel",
3169
- cancelButtonAriaLabel: "",
3170
- cancelButtonColor: void 0,
3171
- buttonsStyling: !0,
3172
- reverseButtons: !1,
3173
- focusConfirm: !0,
3174
- focusDeny: !1,
3175
- focusCancel: !1,
3176
- returnFocus: !0,
3177
- showCloseButton: !1,
3178
- closeButtonHtml: "&times;",
3179
- closeButtonAriaLabel: "Close this dialog",
3180
- loaderHtml: "",
3181
- showLoaderOnConfirm: !1,
3182
- showLoaderOnDeny: !1,
3183
- imageUrl: void 0,
3184
- imageWidth: void 0,
3185
- imageHeight: void 0,
3186
- imageAlt: "",
3187
- timer: void 0,
3188
- timerProgressBar: !1,
3189
- width: void 0,
3190
- padding: void 0,
3191
- background: void 0,
3192
- input: void 0,
3193
- inputPlaceholder: "",
3194
- inputLabel: "",
3195
- inputValue: "",
3196
- inputOptions: {},
3197
- inputAutoFocus: !0,
3198
- inputAutoTrim: !0,
3199
- inputAttributes: {},
3200
- inputValidator: void 0,
3201
- returnInputValueOnDeny: !1,
3202
- validationMessage: void 0,
3203
- grow: !1,
3204
- position: "center",
3205
- progressSteps: [],
3206
- currentProgressStep: void 0,
3207
- progressStepsDistance: void 0,
3208
- willOpen: void 0,
3209
- didOpen: void 0,
3210
- didRender: void 0,
3211
- willClose: void 0,
3212
- didClose: void 0,
3213
- didDestroy: void 0,
3214
- scrollbarPadding: !0,
3215
- topLayer: !1
3216
- }, qn = /* @__PURE__ */ "allowEscapeKey.allowOutsideClick.background.buttonsStyling.cancelButtonAriaLabel.cancelButtonColor.cancelButtonText.closeButtonAriaLabel.closeButtonHtml.color.confirmButtonAriaLabel.confirmButtonColor.confirmButtonText.currentProgressStep.customClass.denyButtonAriaLabel.denyButtonColor.denyButtonText.didClose.didDestroy.draggable.footer.hideClass.html.icon.iconColor.iconHtml.imageAlt.imageHeight.imageUrl.imageWidth.preConfirm.preDeny.progressSteps.returnFocus.reverseButtons.showCancelButton.showCloseButton.showConfirmButton.showDenyButton.text.title.titleText.theme.willClose".split("."), Jn = { allowEnterKey: void 0 }, Yn = [
3217
- "allowOutsideClick",
3218
- "allowEnterKey",
3219
- "backdrop",
3220
- "draggable",
3221
- "focusConfirm",
3222
- "focusDeny",
3223
- "focusCancel",
3224
- "returnFocus",
3225
- "heightAuto",
3226
- "keydownListenerCapture"
3227
- ], Xn = (e) => Object.prototype.hasOwnProperty.call(Kn, e), Zn = (e) => qn.indexOf(e) !== -1, Qn = (e) => Jn[e], $n = (e) => {
3228
- Xn(e) || p(`Unknown parameter "${e}"`);
3229
- }, er = (e) => {
3230
- Yn.includes(e) && p(`The parameter "${e}" is incompatible with toasts`);
3231
- }, tr = (e) => {
3232
- let t = Qn(e);
3233
- t && _(e, t);
3234
- }, nr = (e) => {
3235
- e.backdrop === !1 && e.allowOutsideClick && p("\"allowOutsideClick\" parameter requires `backdrop` parameter to be set to `true`"), e.theme && ![
3236
- "light",
3237
- "dark",
3238
- "auto",
3239
- "minimal",
3240
- "borderless",
3241
- "bootstrap-4",
3242
- "bootstrap-4-light",
3243
- "bootstrap-4-dark",
3244
- "bootstrap-5",
3245
- "bootstrap-5-light",
3246
- "bootstrap-5-dark",
3247
- "material-ui",
3248
- "material-ui-light",
3249
- "material-ui-dark",
3250
- "embed-iframe",
3251
- "bulma",
3252
- "bulma-light",
3253
- "bulma-dark"
3254
- ].includes(e.theme) && p(`Invalid theme "${e.theme}"`);
3255
- for (let t in e) $n(t), e.toast && er(t), tr(t);
3256
- };
3257
- function rr(e) {
3258
- let t = C(), n = E(), r = J.innerParams.get(this);
3259
- if (!n || P(n, r.hideClass.popup)) {
3260
- p("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");
3261
- return;
3262
- }
3263
- let i = ir(e), a = Object.assign({}, r, i);
3264
- nr(a), t && (t.dataset.swal2Theme = a.theme), Et(this, a), J.innerParams.set(this, a), Object.defineProperties(this, { params: {
3265
- value: Object.assign({}, this.params, e),
3266
- writable: !1,
3267
- enumerable: !0
3268
- } });
3269
- }
3270
- let ir = (e) => {
3271
- let t = {};
3272
- return Object.keys(e).forEach((n) => {
3273
- Zn(n) ? t[n] = e[n] : p(`Invalid parameter to update: ${n}`);
3274
- }), t;
3275
- };
3276
- function ar() {
3277
- var e;
3278
- let t = J.domCache.get(this), n = J.innerParams.get(this);
3279
- if (!n) {
3280
- sr(this);
3281
- return;
3282
- }
3283
- t.popup && a.swalCloseEventFinishedCallback && (a.swalCloseEventFinishedCallback(), delete a.swalCloseEventFinishedCallback), typeof n.didDestroy == "function" && n.didDestroy(), (e = a.eventEmitter) == null || e.emit("didDestroy"), or(this);
3284
- }
3285
- let or = (e) => {
3286
- sr(e), delete e.params, delete a.keydownHandler, delete a.keydownTarget, delete a.currentInstance;
3287
- }, sr = (e) => {
3288
- e.isAwaitingPromise ? (cr(J, e), e.isAwaitingPromise = !0) : (cr(Ht, e), cr(J, e), delete e.isAwaitingPromise, delete e.disableButtons, delete e.enableButtons, delete e.getInput, delete e.disableInput, delete e.enableInput, delete e.hideLoading, delete e.disableLoading, delete e.showValidationMessage, delete e.resetValidationMessage, delete e.close, delete e.closePopup, delete e.closeModal, delete e.closeToast, delete e.rejectPromise, delete e.update, delete e._destroy);
3289
- }, cr = (e, t) => {
3290
- for (let n in e) e[n].delete(t);
3291
- };
3292
- var lr = /*#__PURE__*/ Object.freeze({
3293
- __proto__: null,
3294
- _destroy: ar,
3295
- close: Z,
3296
- closeModal: Z,
3297
- closePopup: Z,
3298
- closeToast: Z,
3299
- disableButtons: Vn,
3300
- disableInput: Un,
3301
- disableLoading: Fn,
3302
- enableButtons: Bn,
3303
- enableInput: Hn,
3304
- getInput: Ln,
3305
- handleAwaitingPromise: cn,
3306
- hideLoading: Fn,
3307
- rejectPromise: sn,
3308
- resetValidationMessage: Gn,
3309
- showValidationMessage: Wn,
3310
- update: rr
3311
- });
3312
- let ur = (e, t, n) => {
3313
- e.toast ? dr(e, t, n) : (mr(t), hr(t), gr(e, t, n));
3314
- }, dr = (e, t, n) => {
3315
- t.popup.onclick = () => {
3316
- e && (fr(e) || e.timer || e.input) || n(jt.close);
3317
- };
3318
- }, fr = (e) => !!(e.showConfirmButton || e.showDenyButton || e.showCancelButton || e.showCloseButton), pr = !1, mr = (e) => {
3319
- e.popup.onmousedown = () => {
3320
- e.container.onmouseup = function(t) {
3321
- e.container.onmouseup = () => {}, t.target === e.container && (pr = !0);
3322
- };
3323
- };
3324
- }, hr = (e) => {
3325
- e.container.onmousedown = (t) => {
3326
- t.target === e.container && t.preventDefault(), e.popup.onmouseup = function(t) {
3327
- e.popup.onmouseup = () => {}, (t.target === e.popup || t.target instanceof HTMLElement && e.popup.contains(t.target)) && (pr = !0);
3328
- };
3329
- };
3330
- }, gr = (e, t, n) => {
3331
- t.container.onclick = (r) => {
3332
- if (pr) {
3333
- pr = !1;
3334
- return;
3335
- }
3336
- r.target === t.container && v(e.allowOutsideClick) && n(jt.backdrop);
3337
- };
3338
- }, _r = (e) => typeof e == "object" && !!e && "jquery" in e, vr = (e) => e instanceof Element || _r(e), yr = (e) => {
3339
- let t = {};
3340
- return typeof e[0] == "object" && !vr(e[0]) ? Object.assign(t, e[0]) : [
3341
- "title",
3342
- "html",
3343
- "icon"
3344
- ].forEach((n, r) => {
3345
- let i = e[r];
3346
- typeof i == "string" || vr(i) ? t[n] = i : i !== void 0 && m(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`);
3347
- }), t;
3348
- };
3349
- function br(...e) {
3350
- return new this(...e);
3351
- }
3352
- function xr(e) {
3353
- class t extends this {
3354
- _main(t, n) {
3355
- return super._main(t, Object.assign({}, e, n));
3356
- }
3357
- }
3358
- return t;
3359
- }
3360
- let Sr = () => a.timeout && a.timeout.getTimerLeft(), Cr = () => {
3361
- if (a.timeout) return Te(), a.timeout.stop();
3362
- }, wr = () => {
3363
- if (a.timeout) {
3364
- let e = a.timeout.start();
3365
- return we(e), e;
3366
- }
3367
- }, Tr = () => {
3368
- let e = a.timeout;
3369
- return e && (e.running ? Cr() : wr());
3370
- }, Er = (e) => {
3371
- if (a.timeout) {
3372
- let t = a.timeout.increase(e);
3373
- return we(t, !0), t;
3374
- }
3375
- }, Dr = () => !!(a.timeout && a.timeout.isRunning()), Or = !1, kr = {};
3376
- function Ar(e = "data-swal-template") {
3377
- kr[e] = this, Or ||= (document.body.addEventListener("click", jr), !0);
3378
- }
3379
- let jr = (e) => {
3380
- for (let t = e.target; t && t !== document; t = t.parentNode) for (let e in kr) {
3381
- let n = t.getAttribute && t.getAttribute(e);
3382
- if (n) {
3383
- kr[e].fire({ template: n });
3384
- return;
3385
- }
3386
- }
3387
- };
3388
- class Mr {
3389
- constructor() {
3390
- this.events = {};
3391
- }
3392
- _getHandlersByEventName(e) {
3393
- return this.events[e] === void 0 && (this.events[e] = []), this.events[e];
3394
- }
3395
- on(e, t) {
3396
- let n = this._getHandlersByEventName(e);
3397
- n.includes(t) || n.push(t);
3398
- }
3399
- once(e, t) {
3400
- let n = (...r) => {
3401
- this.removeListener(e, n), t.apply(this, r);
3402
- };
3403
- this.on(e, n);
3404
- }
3405
- emit(e, ...t) {
3406
- this._getHandlersByEventName(e).forEach((e) => {
3407
- try {
3408
- e.apply(this, t);
3409
- } catch (e) {
3410
- console.error(e);
3411
- }
3412
- });
3413
- }
3414
- removeListener(e, t) {
3415
- let n = this._getHandlersByEventName(e), r = n.indexOf(t);
3416
- r > -1 && n.splice(r, 1);
3417
- }
3418
- removeAllListeners(e) {
3419
- this.events[e] !== void 0 && (this.events[e].length = 0);
3420
- }
3421
- reset() {
3422
- this.events = {};
3423
- }
3424
- }
3425
- a.eventEmitter = new Mr();
3426
- var Nr = /*#__PURE__*/ Object.freeze({
3427
- __proto__: null,
3428
- argsToParams: yr,
3429
- bindClickHandler: Ar,
3430
- clickCancel: At,
3431
- clickConfirm: Ot,
3432
- clickDeny: kt,
3433
- enableLoading: pn,
3434
- fire: br,
3435
- getActions: oe,
3436
- getCancelButton: ie,
3437
- getCloseButton: le,
3438
- getConfirmButton: A,
3439
- getContainer: C,
3440
- getDenyButton: j,
3441
- getFocusableElements: ue,
3442
- getFooter: se,
3443
- getHtmlContainer: te,
3444
- getIcon: D,
3445
- getIconContent: O,
3446
- getImage: k,
3447
- getInputLabel: ae,
3448
- getLoader: M,
3449
- getPopup: E,
3450
- getProgressSteps: ne,
3451
- getTimerLeft: Sr,
3452
- getTimerProgressBar: ce,
3453
- getTitle: ee,
3454
- getValidationMessage: re,
3455
- increaseTimer: Er,
3456
- isDeprecatedParameter: Qn,
3457
- isLoading: pe,
3458
- isTimerRunning: Dr,
3459
- isUpdatableParameter: Zn,
3460
- isValidParameter: Xn,
3461
- isVisible: Dt,
3462
- mixin: xr,
3463
- off: (e, t) => {
3464
- if (a.eventEmitter) {
3465
- if (!e) {
3466
- a.eventEmitter.reset();
3467
- return;
3468
- }
3469
- t ? a.eventEmitter.removeListener(e, t) : a.eventEmitter.removeAllListeners(e);
3470
- }
3471
- },
3472
- on: (e, t) => {
3473
- a.eventEmitter && a.eventEmitter.on(e, t);
3474
- },
3475
- once: (e, t) => {
3476
- a.eventEmitter && a.eventEmitter.once(e, t);
3477
- },
3478
- resumeTimer: wr,
3479
- showLoading: pn,
3480
- stopTimer: Cr,
3481
- toggleTimer: Tr
3482
- });
3483
- class Pr {
3484
- constructor(e, t) {
3485
- this.callback = e, this.remaining = t, this.running = !1, this.start();
3486
- }
3487
- start() {
3488
- return this.running || (this.running = !0, this.started = /* @__PURE__ */ new Date(), this.id = setTimeout(this.callback, this.remaining)), this.remaining;
3489
- }
3490
- stop() {
3491
- return this.started && this.running && (this.running = !1, clearTimeout(this.id), this.remaining -= (/* @__PURE__ */ new Date()).getTime() - this.started.getTime()), this.remaining;
3492
- }
3493
- increase(e) {
3494
- let t = this.running;
3495
- return t && this.stop(), this.remaining += e, t && this.start(), this.remaining;
3496
- }
3497
- getTimerLeft() {
3498
- return this.running && (this.stop(), this.start()), this.remaining;
3499
- }
3500
- isRunning() {
3501
- return this.running;
3502
- }
3503
- }
3504
- let Fr = [
3505
- "swal-title",
3506
- "swal-html",
3507
- "swal-footer"
3508
- ], Ir = (e) => {
3509
- let t = typeof e.template == "string" ? document.querySelector(e.template) : e.template;
3510
- if (!t) return {};
3511
- let n = t.content;
3512
- return Wr(n), Object.assign(Lr(n), Rr(n), zr(n), Br(n), Vr(n), Hr(n), Ur(n, Fr));
3513
- }, Lr = (e) => {
3514
- let t = {};
3515
- return Array.from(e.querySelectorAll("swal-param")).forEach((e) => {
3516
- Gr(e, ["name", "value"]);
3517
- let n = e.getAttribute("name"), r = e.getAttribute("value");
3518
- !n || !r || (n in Kn && typeof Kn[n] == "boolean" ? t[n] = r !== "false" : n in Kn && typeof Kn[n] == "object" ? t[n] = JSON.parse(r) : t[n] = r);
3519
- }), t;
3520
- }, Rr = (e) => {
3521
- let t = {};
3522
- return Array.from(e.querySelectorAll("swal-function-param")).forEach((e) => {
3523
- let n = e.getAttribute("name"), r = e.getAttribute("value");
3524
- !n || !r || (t[n] = Function(`return ${r}`)());
3525
- }), t;
3526
- }, zr = (e) => {
3527
- let t = {};
3528
- return Array.from(e.querySelectorAll("swal-button")).forEach((e) => {
3529
- Gr(e, [
3530
- "type",
3531
- "color",
3532
- "aria-label"
3533
- ]);
3534
- let n = e.getAttribute("type");
3535
- if (!n || ![
3536
- "confirm",
3537
- "cancel",
3538
- "deny"
3539
- ].includes(n)) return;
3540
- t[`${n}ButtonText`] = e.innerHTML, t[`show${f(n)}Button`] = !0;
3541
- let r = e.getAttribute("color");
3542
- r !== null && (t[`${n}ButtonColor`] = r);
3543
- let i = e.getAttribute("aria-label");
3544
- i !== null && (t[`${n}ButtonAriaLabel`] = i);
3545
- }), t;
3546
- }, Br = (e) => {
3547
- let t = {}, n = e.querySelector("swal-image");
3548
- if (n) {
3549
- Gr(n, [
3550
- "src",
3551
- "width",
3552
- "height",
3553
- "alt"
3554
- ]);
3555
- let e = n.getAttribute("src");
3556
- e !== null && (t.imageUrl = e || void 0);
3557
- let r = n.getAttribute("width");
3558
- r !== null && (t.imageWidth = r || void 0);
3559
- let i = n.getAttribute("height");
3560
- i !== null && (t.imageHeight = i || void 0);
3561
- let a = n.getAttribute("alt");
3562
- a !== null && (t.imageAlt = a || void 0);
3563
- }
3564
- return t;
3565
- }, Vr = (e) => {
3566
- let t = {}, n = e.querySelector("swal-icon");
3567
- return n && (Gr(n, ["type", "color"]), n.hasAttribute("type") && (t.icon = n.getAttribute("type")), n.hasAttribute("color") && (t.iconColor = n.getAttribute("color")), t.iconHtml = n.innerHTML), t;
3568
- }, Hr = (e) => {
3569
- let t = {}, n = e.querySelector("swal-input");
3570
- n && (Gr(n, [
3571
- "type",
3572
- "label",
3573
- "placeholder",
3574
- "value"
3575
- ]), t.input = n.getAttribute("type") || "text", n.hasAttribute("label") && (t.inputLabel = n.getAttribute("label")), n.hasAttribute("placeholder") && (t.inputPlaceholder = n.getAttribute("placeholder")), n.hasAttribute("value") && (t.inputValue = n.getAttribute("value")));
3576
- let r = Array.from(e.querySelectorAll("swal-input-option"));
3577
- return r.length && (t.inputOptions = {}, r.forEach((e) => {
3578
- Gr(e, ["value"]);
3579
- let n = e.getAttribute("value");
3580
- if (!n) return;
3581
- let r = e.innerHTML;
3582
- t.inputOptions[n] = r;
3583
- })), t;
3584
- }, Ur = (e, t) => {
3585
- let n = {};
3586
- for (let r in t) {
3587
- let i = t[r], a = e.querySelector(i);
3588
- a && (Gr(a, []), n[i.replace(/^swal-/, "")] = a.innerHTML.trim());
3589
- }
3590
- return n;
3591
- }, Wr = (e) => {
3592
- let t = Fr.concat([
3593
- "swal-param",
3594
- "swal-function-param",
3595
- "swal-button",
3596
- "swal-image",
3597
- "swal-icon",
3598
- "swal-input",
3599
- "swal-input-option"
3600
- ]);
3601
- Array.from(e.children).forEach((e) => {
3602
- let n = e.tagName.toLowerCase();
3603
- t.includes(n) || p(`Unrecognized element <${n}>`);
3604
- });
3605
- }, Gr = (e, t) => {
3606
- Array.from(e.attributes).forEach((n) => {
3607
- t.indexOf(n.name) === -1 && p([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`, `${t.length ? `Allowed attributes are: ${t.join(", ")}` : "To set the value, use HTML within the element."}`]);
3608
- });
3609
- }, Kr = (e) => {
3610
- var t, n;
3611
- let r = C(), i = E();
3612
- if (!r || !i) return;
3613
- typeof e.willOpen == "function" && e.willOpen(i), (t = a.eventEmitter) == null || t.emit("willOpen", i);
3614
- let o = window.getComputedStyle(document.body).overflowY;
3615
- if (Xr(r, i, e), setTimeout(() => {
3616
- Jr(r, i);
3617
- }, 10), de() && (Yr(r, e.scrollbarPadding !== void 0 && e.scrollbarPadding, o), Ut()), Kt && e.backdrop === !1 && i.scrollHeight > r.clientHeight && (r.style.pointerEvents = "auto"), !fe() && !a.previousActiveElement && (a.previousActiveElement = document.activeElement), typeof e.didOpen == "function") {
3618
- let t = e.didOpen;
3619
- setTimeout(() => t(i));
3620
- }
3621
- (n = a.eventEmitter) == null || n.emit("didOpen", i);
3622
- }, qr = (e) => {
3623
- let t = E();
3624
- if (!t || e.target !== t) return;
3625
- let n = C();
3626
- n && (t.removeEventListener("animationend", qr), t.removeEventListener("transitionend", qr), n.style.overflowY = "auto", L(n, l["no-transition"]));
3627
- }, Jr = (e, t) => {
3628
- Ce(t) ? (e.style.overflowY = "hidden", t.addEventListener("animationend", qr), t.addEventListener("transitionend", qr)) : e.style.overflowY = "auto";
3629
- }, Yr = (e, t, n) => {
3630
- qt(), t && n !== "hidden" && tn(n), setTimeout(() => {
3631
- e.scrollTop = 0;
3632
- });
3633
- }, Xr = (e, t, n) => {
3634
- var r;
3635
- (r = n.showClass) != null && r.backdrop && I(e, n.showClass.backdrop), n.animation ? (t.style.setProperty("opacity", "0", "important"), z(t, "grid"), setTimeout(() => {
3636
- var e;
3637
- (e = n.showClass) != null && e.popup && I(t, n.showClass.popup), t.style.removeProperty("opacity");
3638
- }, 10)) : z(t, "grid"), I([document.documentElement, document.body], l.shown), n.heightAuto && n.backdrop && !n.toast && I([document.documentElement, document.body], l["height-auto"]);
3639
- };
3640
- var Zr = {
3641
- email: (e, t) => /^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e) ? Promise.resolve() : Promise.resolve(t || "Invalid email address"),
3642
- url: (e, t) => /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e) ? Promise.resolve() : Promise.resolve(t || "Invalid URL")
3643
- };
3644
- function Qr(e) {
3645
- e.inputValidator || (e.input === "email" && (e.inputValidator = Zr.email), e.input === "url" && (e.inputValidator = Zr.url));
3646
- }
3647
- function $r(e) {
3648
- (!e.target || typeof e.target == "string" && !document.querySelector(e.target) || typeof e.target != "string" && !e.target.appendChild) && (p("Target parameter is not valid, defaulting to \"body\""), e.target = "body");
3649
- }
3650
- function ei(e) {
3651
- Qr(e), e.showLoaderOnConfirm && !e.preConfirm && p("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"), $r(e), typeof e.title == "string" && (e.title = e.title.split("\n").join("<br />")), Ae(e);
3652
- }
3653
- let Q;
3654
- var ti = /*#__PURE__*/ new WeakMap();
3655
- class $ {
3656
- constructor(...e) {
3657
- if (r(this, ti, Promise.resolve({
3658
- isConfirmed: !1,
3659
- isDenied: !1,
3660
- isDismissed: !0
3661
- })), typeof window > "u") return;
3662
- Q = this;
3663
- let t = Object.freeze(this.constructor.argsToParams(e));
3664
- this.params = t, this.isAwaitingPromise = !1, i(ti, this, this._main(Q.params));
3665
- }
3666
- _main(e, t = {}) {
3667
- if (nr(Object.assign({}, t, e)), a.currentInstance) {
3668
- let e = Ht.swalPromiseResolve.get(a.currentInstance), { isAwaitingPromise: t } = a.currentInstance;
3669
- a.currentInstance._destroy(), t || e({ isDismissed: !0 }), de() && Wt();
3670
- }
3671
- a.currentInstance = Q;
3672
- let n = ri(e, t);
3673
- ei(n), Object.freeze(n), a.timeout && (a.timeout.stop(), delete a.timeout), clearTimeout(a.restoreFocusTimeout);
3674
- let r = ii(Q);
3675
- return Et(Q, n), J.innerParams.set(Q, n), ni(Q, r, n);
3676
- }
3677
- then(e) {
3678
- return n(ti, this).then(e);
3679
- }
3680
- finally(e) {
3681
- return n(ti, this).finally(e);
3682
- }
3683
- }
3684
- let ni = (e, t, n) => new Promise((r, i) => {
3685
- let o = (t) => {
3686
- e.close({
3687
- isDismissed: !0,
3688
- dismiss: t,
3689
- isConfirmed: !1,
3690
- isDenied: !1
3691
- });
3692
- };
3693
- Ht.swalPromiseResolve.set(e, r), Ht.swalPromiseReject.set(e, i), t.confirmButton.onclick = () => {
3694
- En(e);
3695
- }, t.denyButton.onclick = () => {
3696
- Dn(e);
3697
- }, t.cancelButton.onclick = () => {
3698
- On(e, o);
3699
- }, t.closeButton.onclick = () => {
3700
- o(jt.close);
3701
- }, ur(n, t, o), Nt(a, n, o), hn(e, n), Kr(n), ai(a, n, o), oi(t, n), setTimeout(() => {
3702
- t.container.scrollTop = 0;
3703
- });
3704
- }), ri = (e, t) => {
3705
- let n = Ir(e), r = Object.assign({}, Kn, t, n, e);
3706
- return r.showClass = Object.assign({}, Kn.showClass, r.showClass), r.hideClass = Object.assign({}, Kn.hideClass, r.hideClass), r.animation === !1 && (r.showClass = { backdrop: "swal2-noanimation" }, r.hideClass = {}), r;
3707
- }, ii = (e) => {
3708
- let t = {
3709
- popup: E(),
3710
- container: C(),
3711
- actions: oe(),
3712
- confirmButton: A(),
3713
- denyButton: j(),
3714
- cancelButton: ie(),
3715
- loader: M(),
3716
- closeButton: le(),
3717
- validationMessage: re(),
3718
- progressSteps: ne()
3719
- };
3720
- return J.domCache.set(e, t), t;
3721
- }, ai = (e, t, n) => {
3722
- let r = ce();
3723
- B(r), t.timer && (e.timeout = new Pr(() => {
3724
- n("timer"), delete e.timeout;
3725
- }, t.timer), t.timerProgressBar && r && (z(r), F(r, t, "timerProgressBar"), setTimeout(() => {
3726
- e.timeout && e.timeout.running && we(t.timer);
3727
- })));
3728
- }, oi = (e, t) => {
3729
- if (!t.toast) {
3730
- if (!v(t.allowEnterKey)) {
3731
- _("allowEnterKey", "preConfirm: () => false"), e.popup.focus();
3732
- return;
3733
- }
3734
- si(e) || ci(e, t) || Pt(-1, 1);
3735
- }
3736
- }, si = (e) => {
3737
- let t = Array.from(e.popup.querySelectorAll("[autofocus]"));
3738
- for (let e of t) if (e instanceof HTMLElement && H(e)) return e.focus(), !0;
3739
- return !1;
3740
- }, ci = (e, t) => t.focusDeny && H(e.denyButton) ? (e.denyButton.focus(), !0) : t.focusCancel && H(e.cancelButton) ? (e.cancelButton.focus(), !0) : t.focusConfirm && H(e.confirmButton) ? (e.confirmButton.focus(), !0) : !1;
3741
- $.prototype.disableButtons = Vn, $.prototype.enableButtons = Bn, $.prototype.getInput = Ln, $.prototype.disableInput = Un, $.prototype.enableInput = Hn, $.prototype.hideLoading = Fn, $.prototype.disableLoading = Fn, $.prototype.showValidationMessage = Wn, $.prototype.resetValidationMessage = Gn, $.prototype.close = Z, $.prototype.closePopup = Z, $.prototype.closeModal = Z, $.prototype.closeToast = Z, $.prototype.rejectPromise = sn, $.prototype.update = rr, $.prototype._destroy = ar, Object.assign($, Nr), Object.keys(lr).forEach((e) => {
3742
- $[e] = function(...t) {
3743
- if (Q && Q[e]) return Q[e](...t);
3744
- };
3745
- }), $.DismissReason = jt, $.version = "11.26.25";
3746
- let li = $;
3747
- return li.default = li, li;
3748
- })), e !== void 0 && e.Sweetalert2 && (e.swal = e.sweetAlert = e.Swal = e.SweetAlert = e.Sweetalert2), typeof document < "u" && function(e, t) {
3749
- var n = e.createElement("style");
3750
- if (e.getElementsByTagName("head")[0].appendChild(n), n.styleSheet) n.styleSheet.disabled || (n.styleSheet.cssText = t);
3751
- else try {
3752
- n.innerHTML = t;
3753
- } catch {
3754
- n.innerText = t;
3755
- }
3756
- }(document, ":root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:auto}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:\"top-start top top-end\" \"center-start center center-end\" \"bottom-start bottom-center bottom-end\";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:auto}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}");
3757
- })))(), 1);
3758
- function Ft({ title: e, inputs: t, confirmText: n, cancelText: r }) {
3759
- let i = t.map((e, t) => `<input id="${`swal-input-${t}`}" class="swal2-input" placeholder="${e.placeholder || ""}" value="${e.value || ""}">`).join("");
3760
- return Pt.default.fire({
3761
- title: e,
3762
- html: i,
3763
- focusConfirm: !1,
3764
- preConfirm: () => {
3765
- let e = t.map((e, t) => {
3766
- let n = `swal-input-${t}`, r = document.getElementById(n);
3767
- if (!r) return null;
3768
- let i = r.value;
3769
- return e.required && !i ? (Pt.default.showValidationMessage(e.requiredMessage || "This field is required"), !1) : i;
3770
- });
3771
- return !e.includes(!1) && e;
3772
- },
3773
- showCancelButton: !0,
3774
- confirmButtonText: n || "Confirm",
3775
- cancelButtonText: r || "Cancel"
3776
- });
3777
- }
3778
- //#endregion
3779
- //#region src/components/shared/toolbar/Insert/Hooks/insertLogic.jsx
3780
- function It() {
3781
- let e = window.getSelection();
3782
- return e && e.rangeCount > 0 ? e.getRangeAt(0).cloneRange() : null;
3783
- }
3784
- function Lt(e) {
3785
- if (!e) return;
3786
- let t = window.getSelection();
3787
- t && (t.removeAllRanges(), t.addRange(e));
3788
- }
3789
- function Rt() {
3790
- let e = document.querySelector(".forge-editor__content");
3791
- if (e) {
3792
- e.focus();
3793
- let t = document.createRange(), n = window.getSelection();
3794
- if (n) {
3795
- let r = e.lastChild;
3796
- r ? (t.setStartAfter(r), t.collapse(!0)) : (t.selectNodeContents(e), t.collapse(!1)), n.removeAllRanges(), n.addRange(t);
3797
- }
3798
- }
3799
- }
3800
- function zt(e) {
3801
- let t = window.getSelection();
3802
- if (!t || !t.rangeCount) {
3803
- Rt(), setTimeout(() => zt(e), 50);
3804
- return;
3805
- }
3806
- let n = t.getRangeAt(0);
3807
- n.deleteContents();
3808
- let r = n.createContextualFragment(e), i = r.lastChild;
3809
- n.insertNode(r), i ? (n.setStartAfter(i), n.collapse(!0)) : n.collapse(!1), t.removeAllRanges(), t.addRange(n);
3810
- }
3811
- function Bt() {
3812
- return {
3813
- insertLink: async () => {
3814
- let e = It(), t = await Ft({
3815
- title: "Insert Link",
3816
- inputs: [{
3817
- placeholder: "URL",
3818
- value: "https://",
3819
- required: !0,
3820
- requiredMessage: "URL is required"
3821
- }, { placeholder: "Link text (optional)" }],
3822
- confirmText: "Insert",
3823
- cancelText: "Cancel"
3824
- });
3825
- if (t.isConfirmed && t.value) {
3826
- Lt(e);
3827
- let [n, r] = t.value;
3828
- zt(r ? `<a href="${n}" target="_blank" rel="noopener">${r}</a>` : `<a href="${n}" target="_blank" rel="noopener">${n}</a>`);
3829
- }
3830
- },
3831
- insertImage: async () => {
3832
- let e = It(), t = await Ft({
3833
- title: "Insert Image",
3834
- inputs: [{
3835
- placeholder: "Image URL",
3836
- value: "https://",
3837
- required: !0,
3838
- requiredMessage: "Image URL is required"
3839
- }, {
3840
- placeholder: "Alt text",
3841
- value: "Image"
3842
- }],
3843
- confirmText: "Insert",
3844
- cancelText: "Cancel"
3845
- });
3846
- if (t.isConfirmed && t.value) {
3847
- Lt(e);
3848
- let [n, r] = t.value;
3849
- zt(`<img src="${n}" alt="${r}" style="max-width: 100%;">`);
3850
- }
3851
- },
3852
- insertVideo: async () => {
3853
- let e = It(), t = await Ft({
3854
- title: "Insert Video",
3855
- inputs: [{
3856
- placeholder: "Video URL (YouTube/Vimeo)",
3857
- value: "https://",
3858
- required: !0,
3859
- requiredMessage: "Video URL is required"
3860
- }],
3861
- confirmText: "Insert",
3862
- cancelText: "Cancel"
3863
- });
3864
- if (t.isConfirmed && t.value) {
3865
- Lt(e);
3866
- let [n] = t.value, r;
3867
- r = n.includes("youtube.com") || n.includes("youtu.be") ? `<iframe width="560" height="315" src="${n.replace("watch?v=", "embed/").replace("youtu.be/", "youtube.com/embed/")}" frameborder="0" allowfullscreen></iframe>` : `<video controls src="${n}" style="max-width: 100%;"></video>`, zt(r);
3868
- }
3869
- }
3870
- };
3871
- }
3872
- //#endregion
3873
- //#region src/components/shared/toolbar/Insert/Components/index.jsx
3874
- function Vt() {
3875
- return /* @__PURE__ */ R(Nt, { logic: Bt() });
3876
- }
3877
- //#endregion
3878
- //#region src/components/shared/toolbar/View/Components/ViewToolbar.jsx
3879
- function Ht({ logic: e }) {
3880
- let { toggleFullscreen: t, toggleCodeView: n, showHelp: r } = e, i = "forge-toolbar-button group relative flex h-8 cursor-pointer items-center justify-center rounded-[2px] border border-[#ccc] bg-white px-2 text-sm leading-none transition-all duration-150 hover:bg-[#f0f0f0] active:translate-y-px", a = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]";
3881
- return /* @__PURE__ */ R("div", {
3882
- className: "forge-toolbar-group forge-toolbar-view flex items-center gap-0.5",
3883
- children: [/* @__PURE__ */ R("button", {
3884
- type: "button",
3885
- className: i,
3886
- onClick: t,
3887
- "aria-label": "Full Screen",
3888
- children: [/* @__PURE__ */ R("span", {
3889
- className: "forge-toolbar-icon",
3890
- children: "⛶"
3891
- }), /* @__PURE__ */ R("span", {
3892
- className: a,
3893
- "data-i18n": "fullscreen",
3894
- children: "Full Screen"
3895
- })]
3896
- }), /* @__PURE__ */ R("button", {
3897
- type: "button",
3898
- className: i,
3899
- onClick: n,
3900
- "aria-label": "Code View",
3901
- children: [/* @__PURE__ */ R("span", {
3902
- className: "forge-toolbar-icon",
3903
- children: "</>"
3904
- }), /* @__PURE__ */ R("span", {
3905
- className: a,
3906
- "data-i18n": "codeview",
3907
- children: "Code View"
3908
- })]
3909
- })]
3910
- });
3911
- }
3912
- //#endregion
3913
- //#region src/components/shared/toolbar/View/Hooks/viewLogic.jsx
3914
- var Ut = /* @__PURE__ */ new Set([
3915
- "br",
3916
- "hr",
3917
- "img",
3918
- "input",
3919
- "meta",
3920
- "link",
3921
- "area",
3922
- "base",
3923
- "col",
3924
- "embed",
3925
- "source",
3926
- "track",
3927
- "wbr"
3928
- ]);
3929
- function Wt(e) {
3930
- return Array.from(e.attributes).map((e) => ` ${e.name}="${e.value.replace(/"/g, "&quot;")}"`).join("");
3931
- }
3932
- function Gt(e) {
3933
- return e.replace(/\u200B/g, "").trim();
3934
- }
3935
- function Kt(e, t, n) {
3936
- let r = " ".repeat(t);
3937
- if (e.nodeType === 3) {
3938
- let t = Gt(e.textContent);
3939
- if (!t) return;
3940
- n.push(r + t);
3941
- return;
3942
- }
3943
- if (e.nodeType !== 1) return;
3944
- let i = e.tagName.toLowerCase(), a = Wt(e);
3945
- if (Ut.has(i)) {
3946
- n.push(`${r}<${i}${a}>`);
3947
- return;
3948
- }
3949
- let o = Array.from(e.childNodes).filter((e) => e.nodeType === 3 ? Gt(e.textContent) !== "" : e.nodeType === 1);
3950
- if (o.length === 0) {
3951
- n.push(`${r}<${i}${a}></${i}>`);
3952
- return;
3953
- }
3954
- if (o.length === 1 && o[0].nodeType === 3) {
3955
- n.push(`${r}<${i}${a}>${Gt(o[0].textContent)}</${i}>`);
3956
- return;
3957
- }
3958
- n.push(`${r}<${i}${a}>`), o.forEach((e) => Kt(e, t + 1, n)), n.push(`${r}</${i}>`);
3959
- }
3960
- function qt(e) {
3961
- let t = document.createElement("template");
3962
- t.innerHTML = e;
3963
- let n = [];
3964
- return Array.from(t.content.childNodes).forEach((e) => Kt(e, 0, n)), n.join("\n");
3965
- }
3966
- function Jt(e) {
3967
- Array.from(e.childNodes).forEach((t) => {
3968
- t.nodeType === 3 ? /^\s*$/.test(t.textContent) ? e.removeChild(t) : t.textContent = t.textContent.trim() : t.nodeType === 1 && Jt(t);
3969
- });
3970
- }
3971
- function Yt(e) {
3972
- let t = document.createElement("template");
3973
- return t.innerHTML = e, Jt(t.content), t.content;
3974
- }
3975
- function Xt(e) {
3976
- e.focus();
3977
- let t = document.createRange();
3978
- t.selectNodeContents(e), t.collapse(!1);
3979
- let n = window.getSelection();
3980
- n && (n.removeAllRanges(), n.addRange(t));
3981
- }
3982
- function Zt() {
3983
- return {
3984
- toggleFullscreen: () => {
3985
- let e = document.querySelector(".forge-editor");
3986
- e && (document.fullscreenElement ? document.exitFullscreen().catch(() => {}) : e.requestFullscreen().catch(() => {}));
3987
- },
3988
- toggleCodeView: () => {
3989
- let e = document.querySelector(".forge-editor__content");
3990
- if (!e) return;
3991
- let t = document.querySelector(".forge-code-view-textarea");
3992
- if (t) {
3993
- let n = t.value, r = Yt(n);
3994
- e.removeAttribute("data-code-view"), e.innerHTML = "", e.appendChild(r), e.style.display = "", t.remove(), Xt(e);
3995
- } else {
3996
- let t = e.innerHTML, n = qt(t), r = document.createElement("textarea");
3997
- r.className = e.className, r.classList.add("forge-code-view-textarea"), r.value = n, r.spellcheck = !1, r.style.fontFamily = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", r.style.fontSize = "13px", r.style.lineHeight = "1.6", r.style.whiteSpace = "pre-wrap", r.style.overflowWrap = "break-word", r.style.tabSize = "2", r.style.border = "none", r.style.outline = "none", r.style.resize = "none", r.style.background = "transparent", e.style.display = "none", e.setAttribute("data-code-view", "true"), e.parentNode.insertBefore(r, e.nextSibling), r.focus(), r.setSelectionRange(r.value.length, r.value.length);
3998
- }
3999
- },
4000
- showHelp: () => {
4001
- let e = [
4002
- "Forge Editor - Keyboard Shortcuts:",
4003
- "",
4004
- "Bold: Ctrl+B",
4005
- "Underline: Ctrl+U",
4006
- "Link: Ctrl+K",
4007
- "Undo: Ctrl+Z",
4008
- "Redo: Ctrl+Y",
4009
- "",
4010
- "Visit: https://github.com/your-repo/forge-edit"
4011
- ].join("\n");
4012
- alert(e);
4013
- }
4014
- };
4015
- }
4016
- //#endregion
4017
- //#region src/components/shared/toolbar/View/Components/index.jsx
4018
- function Qt() {
4019
- return /* @__PURE__ */ R(Ht, { logic: Zt() });
4020
- }
4021
- //#endregion
4022
- //#region src/components/shared/toolbar/Index/index.jsx
4023
- function $t({ editorRef: e }) {
4024
- return /* @__PURE__ */ R("div", {
4025
- className: "forge-editor__toolbar sticky top-0 z-10 m-0 flex flex-shrink-0 flex-wrap items-center justify-between gap-[4px] rounded-t-[3px] border-b border-[#ddd] bg-[#f5f5f5] p-[5px] text-[#333]",
4026
- role: "toolbar",
4027
- children: [
4028
- /* @__PURE__ */ R(z, {}),
4029
- /* @__PURE__ */ R(J, {}),
4030
- /* @__PURE__ */ R(tt, { editorRef: e }),
4031
- /* @__PURE__ */ R(mt, {}),
4032
- /* @__PURE__ */ R(Et, {}),
4033
- /* @__PURE__ */ R(Mt, {}),
4034
- /* @__PURE__ */ R(Vt, {}),
4035
- /* @__PURE__ */ R(Qt, {})
4036
- ]
4037
- });
4038
- }
4039
- //#endregion
4040
- //#region src/components/shared/statusbar/Components/index.jsx
4041
- function en() {
4042
- return /* @__PURE__ */ R("div", {
4043
- className: "forge-statusbar box-border flex h-2.5 w-full flex-shrink-0 cursor-s-resize items-center justify-center rounded-b-[3px] border-t border-[#ccc] bg-[#f0f0f0]",
4044
- role: "status",
4045
- children: /* @__PURE__ */ R("div", {
4046
- className: "flex flex-col items-center gap-px",
4047
- "aria-label": "resize",
4048
- children: [
4049
- /* @__PURE__ */ R("div", { className: "h-px w-3 rounded-[1px] bg-[#888]" }),
4050
- /* @__PURE__ */ R("div", { className: "h-px w-3 rounded-[1px] bg-[#888]" }),
4051
- /* @__PURE__ */ R("div", { className: "h-px w-3 rounded-[1px] bg-[#888]" })
4052
- ]
4053
- })
4054
- });
4055
- }
4056
- //#endregion
4057
- //#region src/components/shared/statusbar/Hooks/resize.js
4058
- var tn = 100;
4059
- function nn(e, t, n = {}) {
4060
- if (!e || !t) return () => {};
4061
- let r = n.minHeight ?? tn, i = n.maxHeight ?? Infinity, a = 0, o = 0;
4062
- function s(e) {
4063
- let n = e.clientY - a, s = o + n;
4064
- s = Math.min(Math.max(s, r), i), t.style.height = `${s}px`;
4065
- }
4066
- function c() {
4067
- document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", c), document.body.style.removeProperty("user-select"), document.body.style.removeProperty("cursor");
4068
- }
4069
- function l(e) {
4070
- e.preventDefault(), a = e.clientY, o = t.getBoundingClientRect().height, document.body.style.userSelect = "none", document.body.style.cursor = "s-resize", document.addEventListener("mousemove", s), document.addEventListener("mouseup", c);
4071
- }
4072
- return e.addEventListener("mousedown", l), function() {
4073
- e.removeEventListener("mousedown", l), document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", c);
4074
- };
4075
- }
4076
- //#endregion
4077
- //#region src/components/shared/toolbar/Style/Hooks/styleLogic.jsx
4078
- function rn(e) {
4079
- let t = window.getSelection(), n = document.createRange(), r = e;
4080
- for (; r.lastChild && r.lastChild.nodeName !== "BR";) r = r.lastChild;
4081
- r.nodeType === 3 ? (n.setStart(r, r.textContent.length), n.collapse(!0)) : r.lastChild && r.lastChild.nodeName === "BR" ? (n.setStart(r, r.childNodes.length - 1), n.collapse(!0)) : (n.selectNodeContents(r), n.collapse(!1)), t.removeAllRanges(), t.addRange(n);
4082
- }
4083
- function an(e) {
4084
- let t = window.getSelection();
4085
- if (!t || !t.rangeCount) return;
4086
- let n = t.getRangeAt(0).commonAncestorContainer;
4087
- n.nodeType === 3 && (n = n.parentElement);
4088
- let r = n.closest("p, h1, h2, h3, h4, h5, h6, blockquote, pre");
4089
- if (r) {
4090
- let t = r.textContent.trim().length > 0, n = document.createElement(e);
4091
- if (t) for (; r.firstChild;) {
4092
- let e = r.firstChild;
4093
- if (e.nodeName === "BR" && r.childNodes.length === 1) {
4094
- r.removeChild(e);
4095
- continue;
4096
- }
4097
- n.appendChild(e);
4098
- }
4099
- else n.innerHTML = "<br>";
4100
- r.replaceWith(n), rn(n);
4101
- }
4102
- }
4103
- function Z(e) {
4104
- if (!e) return;
4105
- let t = e.querySelector("[data-command='style']"), n = e.querySelector(".forge-dropdown-style");
4106
- !t || !n || (Qe(t, n), n.querySelectorAll(".forge-dropdown-item").forEach((e) => {
4107
- e.addEventListener("mousedown", (r) => {
4108
- r.preventDefault(), r.stopPropagation();
4109
- let i = e.dataset.value || e.getAttribute("data-value");
4110
- i && an(i), n.classList.remove("is-open"), t.classList.remove("is-active");
4111
- });
4112
- }));
4113
- }
4114
- //#endregion
4115
- //#region src/components/shared/i18n/index.js
4116
- var on = {
4117
- en: {
4118
- style: "Style",
4119
- normal: "Normal",
4120
- blockquote: "Blockquote",
4121
- code: "Code",
4122
- header1: "Header 1",
4123
- header2: "Header 2",
4124
- header3: "Header 3",
4125
- header4: "Header 4",
4126
- header5: "Header 5",
4127
- header6: "Header 6",
4128
- bold: "Bold",
4129
- underline: "Underline",
4130
- removeFormat: "Remove Font Style",
4131
- fontName: "Font Family",
4132
- recentColor: "Recent Color",
4133
- moreColor: "More Color",
4134
- recentBackColor: "Recent Background Color",
4135
- moreBackColor: "More Background Colors",
4136
- insertUnorderedList: "Unordered List",
4137
- insertOrderedList: "Ordered List",
4138
- paragraph: "Paragraph",
4139
- justifyLeft: "Align Left",
4140
- justifyCenter: "Align Center",
4141
- justifyRight: "Align Right",
4142
- justifyFull: "Justify",
4143
- outdent: "Outdent",
4144
- indent: "Indent",
4145
- table: "Table",
4146
- link: "Link",
4147
- picture: "Picture",
4148
- video: "Video",
4149
- fullscreen: "Full Screen",
4150
- codeview: "Code View",
4151
- help: "Help"
4152
- },
4153
- ar: {
4154
- style: "نمط",
4155
- normal: "عادي",
4156
- blockquote: "اقتباس",
4157
- code: "كود",
4158
- header1: "عنوان 1",
4159
- header2: "عنوان 2",
4160
- header3: "عنوان 3",
4161
- header4: "عنوان 4",
4162
- header5: "عنوان 5",
4163
- header6: "عنوان 6",
4164
- bold: "عريض",
4165
- underline: "تسطير",
4166
- removeFormat: "إزالة تنسيق الخط",
4167
- fontName: "نوع الخط",
4168
- recentColor: "آخر لون مستخدم",
4169
- moreColor: "المزيد من الألوان",
4170
- recentBackColor: "آخر لون خلفية",
4171
- moreBackColor: "المزيد من ألوان الخلفية",
4172
- insertUnorderedList: "قائمة نقطية",
4173
- insertOrderedList: "قائمة مرقمة",
4174
- paragraph: "فقرة",
4175
- justifyLeft: "محاذاة لليسار",
4176
- justifyCenter: "محاذاة للوسط",
4177
- justifyRight: "محاذاة لليمين",
4178
- justifyFull: "ضبط",
4179
- outdent: "تقليل المسافة البادئة",
4180
- indent: "زيادة المسافة البادئة",
4181
- table: "جدول",
4182
- link: "رابط",
4183
- picture: "صورة",
4184
- video: "فيديو",
4185
- fullscreen: "ملء الشاشة",
4186
- codeview: "عرض الكود",
4187
- help: "مساعدة"
4188
- }
4189
- }, sn = "en";
4190
- function cn(e, t) {
4191
- return (on[e] || on[sn])[t] || on[sn][t] || t;
4192
- }
4193
- //#endregion
4194
- //#region src/components/shared/i18n/apply.js
4195
- function ln(e, t) {
4196
- e.querySelectorAll("[data-i18n]").forEach((e) => {
4197
- e.textContent = cn(t, e.getAttribute("data-i18n"));
4198
- });
4199
- }
4200
- //#endregion
4201
- //#region src/components/shared/toolbar/Style/Utils/ensureParagraph.jsx
4202
- function un(e) {
4203
- if (e && !(e.children.length > 0 || e.textContent.trim().length > 0)) {
4204
- let t = document.createElement("p");
4205
- t.innerHTML = "<br>", e.appendChild(t);
4206
- }
4207
- }
4208
- //#endregion
4209
- //#region src/components/shared/toolbar/Style/Utils/enterKeyHandler.jsx
4210
- var dn = [
4211
- "h1",
4212
- "h2",
4213
- "h3",
4214
- "h4",
4215
- "h5",
4216
- "h6",
4217
- "blockquote"
4218
- ], fn = ["pre"];
4219
- function pn(e, t, n) {
4220
- let r = e.nodeType === 3 ? e.parentNode : e;
4221
- for (; r && r !== t;) {
4222
- if (r.nodeType === 1 && n.includes(r.tagName.toLowerCase())) return r;
4223
- r = r.parentNode;
4224
- }
4225
- return null;
4226
- }
4227
- function mn(e) {
4228
- let t = window.getSelection(), n = document.createRange();
4229
- n.selectNodeContents(e), n.collapse(!0), t.removeAllRanges(), t.addRange(n);
4230
- }
4231
- function hn(e) {
4232
- if (!e) return () => {};
4233
- let t = (t) => {
4234
- if (t.key !== "Enter" || t.shiftKey || e.getAttribute("data-code-view") === "true" || e.contentEditable !== "true") return;
4235
- let n = window.getSelection();
4236
- if (!n || !n.rangeCount) return;
4237
- let r = n.getRangeAt(0);
4238
- if (pn(r.startContainer, e, fn)) {
4239
- t.preventDefault();
4240
- let e = document.createElement("br");
4241
- r.deleteContents(), r.insertNode(e);
4242
- let i = document.createRange();
4243
- i.setStartAfter(e), i.collapse(!0), n.removeAllRanges(), n.addRange(i);
4244
- return;
4245
- }
4246
- let i = pn(r.startContainer, e, dn);
4247
- if (!i) return;
4248
- t.preventDefault();
4249
- let a = document.createRange();
4250
- a.setStart(r.endContainer, r.endOffset), a.setEndAfter(i.lastChild || i);
4251
- let o = a.extractContents(), s = document.createElement("p");
4252
- o.textContent.trim().length === 0 ? s.innerHTML = "<br>" : s.appendChild(o), i.nextSibling ? i.parentNode.insertBefore(s, i.nextSibling) : i.parentNode.appendChild(s), i.textContent.trim().length === 0 && i.childNodes.length === 0 && (i.innerHTML = "<br>"), mn(s);
4253
- };
4254
- return e.addEventListener("keydown", t), () => {
4255
- e.removeEventListener("keydown", t);
4256
- };
4257
- }
4258
- //#endregion
4259
- //#region src/components/shared/toolbar/Hooks/contentClick.js
4260
- function gn(e) {
4261
- e.addEventListener("click", (t) => {
4262
- if (t.target === e) {
4263
- let t = window.getSelection();
4264
- if (!t) return;
4265
- let n = e.lastElementChild;
4266
- if (!n || n.tagName === "PRE" || n.tagName === "BLOCKQUOTE" || /^H[1-6]$/.test(n.tagName)) {
4267
- let n = document.createElement("p");
4268
- n.innerHTML = "<br>", e.appendChild(n);
4269
- let r = document.createRange();
4270
- r.setStart(n, 0), r.collapse(!0), t.removeAllRanges(), t.addRange(r);
4271
- }
4272
- }
4273
- });
4274
- }
4275
- //#endregion
4276
- //#region src/components/shared/toolbar/ImagePopover/Components/ImagePopover.jsx
4277
- function _n({ target: e, onClose: t, onResize: n, onFloat: r, onRemove: i }) {
4278
- let a = q(null);
4279
- if (!e) return null;
4280
- let o = e.getBoundingClientRect(), s = {
4281
- left: o.left + o.width / 2 - 100 + "px",
4282
- top: o.bottom + 10 + "px"
4283
- }, c = "note-btn cursor-pointer rounded-[2px] border border-[#ccc] bg-[#f5f5f5] px-2 py-1 text-xs leading-[1.4] transition-all duration-100 ease-in-out hover:border-[#999] hover:bg-[#e6e6e6] active:translate-y-px active:bg-[#d0d0d0]", l = "note-btn-group flex gap-0.5 border-r border-[#ddd] pr-1 last:border-r-0 last:pr-0", u = "not-italic text-sm leading-none";
4284
- return /* @__PURE__ */ R("div", {
4285
- ref: a,
4286
- className: "note-popover bottom note-image-popover fixed z-[9999] min-w-[200px] rounded-[4px] border border-[#ccc] bg-white p-1.5 shadow-[0_2px_8px_rgba(0,0,0,0.15)]",
4287
- style: s,
4288
- children: [/* @__PURE__ */ R("div", {
4289
- className: "absolute -top-2 left-1/2 -translate-x-1/2",
4290
- children: [/* @__PURE__ */ R("div", { className: "border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent border-b-[#ccc]" }), /* @__PURE__ */ R("div", { className: "absolute top-[1px] left-[-7px] border-l-7 border-r-7 border-b-7 border-l-transparent border-r-transparent border-b-white" })]
4291
- }), /* @__PURE__ */ R("div", {
4292
- className: "popover-content note-children-container flex flex-wrap items-center gap-1",
4293
- children: [
4294
- /* @__PURE__ */ R("div", {
4295
- className: `${l} note-resize`,
4296
- children: [
4297
- /* @__PURE__ */ R("button", {
4298
- type: "button",
4299
- className: c,
4300
- tabIndex: "-1",
4301
- "aria-label": "Resize full",
4302
- onClick: () => n(e, 1),
4303
- children: /* @__PURE__ */ R("span", {
4304
- className: "note-fontsize-10 text-[10px]",
4305
- children: "100%"
4306
- })
4307
- }),
4308
- /* @__PURE__ */ R("button", {
4309
- type: "button",
4310
- className: c,
4311
- tabIndex: "-1",
4312
- "aria-label": "Resize half",
4313
- onClick: () => n(e, .5),
4314
- children: /* @__PURE__ */ R("span", {
4315
- className: "note-fontsize-10 text-[10px]",
4316
- children: "50%"
4317
- })
4318
- }),
4319
- /* @__PURE__ */ R("button", {
4320
- type: "button",
4321
- className: c,
4322
- tabIndex: "-1",
4323
- "aria-label": "Resize quarter",
4324
- onClick: () => n(e, .25),
4325
- children: /* @__PURE__ */ R("span", {
4326
- className: "note-fontsize-10 text-[10px]",
4327
- children: "25%"
4328
- })
4329
- }),
4330
- /* @__PURE__ */ R("button", {
4331
- type: "button",
4332
- className: c,
4333
- tabIndex: "-1",
4334
- "aria-label": "Original size",
4335
- onClick: () => n(e, "original"),
4336
- children: /* @__PURE__ */ R("i", {
4337
- className: `note-icon-rollback ${u}`,
4338
- children: "↺"
4339
- })
4340
- })
4341
- ]
4342
- }),
4343
- /* @__PURE__ */ R("div", {
4344
- className: `${l} note-float`,
4345
- children: [
4346
- /* @__PURE__ */ R("button", {
4347
- type: "button",
4348
- className: c,
4349
- tabIndex: "-1",
4350
- "aria-label": "Float Left",
4351
- onClick: () => r(e, "left"),
4352
- children: /* @__PURE__ */ R("i", {
4353
- className: `note-icon-float-left ${u}`,
4354
- children: "◀"
4355
- })
4356
- }),
4357
- /* @__PURE__ */ R("button", {
4358
- type: "button",
4359
- className: c,
4360
- tabIndex: "-1",
4361
- "aria-label": "Center",
4362
- onClick: () => r(e, "center"),
4363
- children: /* @__PURE__ */ R("i", {
4364
- className: `note-icon-float-center ${u}`,
4365
- children: "↔"
4366
- })
4367
- }),
4368
- /* @__PURE__ */ R("button", {
4369
- type: "button",
4370
- className: c,
4371
- tabIndex: "-1",
4372
- "aria-label": "Float Right",
4373
- onClick: () => r(e, "right"),
4374
- children: /* @__PURE__ */ R("i", {
4375
- className: `note-icon-float-right ${u}`,
4376
- children: "▶"
4377
- })
4378
- }),
4379
- /* @__PURE__ */ R("button", {
4380
- type: "button",
4381
- className: c,
4382
- tabIndex: "-1",
4383
- "aria-label": "Remove float",
4384
- onClick: () => r(e, "none"),
4385
- children: /* @__PURE__ */ R("i", {
4386
- className: `note-icon-rollback ${u}`,
4387
- children: "↺"
4388
- })
4389
- })
4390
- ]
4391
- }),
4392
- /* @__PURE__ */ R("div", {
4393
- className: `${l} note-remove`,
4394
- children: /* @__PURE__ */ R("button", {
4395
- type: "button",
4396
- className: c,
4397
- tabIndex: "-1",
4398
- "aria-label": "Remove Image",
4399
- onClick: () => i(e),
4400
- children: /* @__PURE__ */ R("i", {
4401
- className: `note-icon-trash ${u}`,
4402
- children: "🗑"
4403
- })
4404
- })
4405
- })
4406
- ]
4407
- })]
4408
- });
4409
- }
4410
- //#endregion
4411
- //#region src/components/shared/toolbar/ImagePopover/Hooks/useImagePopover.jsx
4412
- function vn() {
4413
- let [e, t] = G(null), [n, r] = G(!1);
4414
- return K(() => {
4415
- let e = (e) => {
4416
- let i = e.target.closest("img");
4417
- i ? (t(i), r(!0)) : n && (r(!1), t(null));
4418
- }, i = (e) => {
4419
- e.key === "Escape" && n && (r(!1), t(null));
4420
- };
4421
- return document.addEventListener("click", e), document.addEventListener("keydown", i), () => {
4422
- document.removeEventListener("click", e), document.removeEventListener("keydown", i);
4423
- };
4424
- }, [n]), {
4425
- target: n ? e : null,
4426
- onClose: () => {
4427
- r(!1), t(null);
4428
- },
4429
- onResize: (e, n) => {
4430
- if (n === "original") e.style.width = "", e.style.height = "", e.removeAttribute("width"), e.removeAttribute("height");
4431
- else {
4432
- let t = e.naturalWidth || e.width, r = e.naturalHeight || e.height;
4433
- e.style.width = t * n + "px", e.style.height = r * n + "px";
4434
- }
4435
- r(!1), t(null);
4436
- },
4437
- onFloat: (e, n) => {
4438
- n === "none" ? (e.style.float = "", e.style.margin = "", e.style.display = "") : n === "center" ? (e.style.float = "none", e.style.display = "block", e.style.margin = "0 auto") : (e.style.float = n, e.style.display = "", e.style.margin = n === "left" ? "0 10px 5px 0" : "0 0 5px 10px"), r(!1), t(null);
4439
- },
4440
- onRemove: (e) => {
4441
- e.parentElement.removeChild(e), r(!1), t(null);
4442
- }
4443
- };
4444
- }
4445
- //#endregion
4446
- //#region src/components/shared/toolbar/ImagePopover/Components/index.jsx
4447
- function yn() {
4448
- return /* @__PURE__ */ R(_n, { ...vn() });
4449
- }
4450
- //#endregion
4451
- //#region src/components/light/index.jsx
4452
- function bn(e) {
4453
- return {
4454
- getHTML() {
4455
- return e.innerHTML;
4456
- },
4457
- setHTML(t) {
4458
- e.innerHTML = t;
4459
- },
4460
- getText() {
4461
- return e.textContent;
4462
- },
4463
- getSelection() {
4464
- let e = window.getSelection();
4465
- return e ? e.toString() : "";
4466
- }
4467
- };
4468
- }
4469
- function xn(e) {
4470
- let t = e.lang || "en", n = e.dir || "ltr", r = { current: null }, i = /* @__PURE__ */ R("div", {
4471
- className: "forge-editor forge-editor--light flex flex-col w-full rounded-[3px] border border-[#ddd] bg-white box-border align-top min-h-[120px]",
4472
- lang: t,
4473
- dir: n,
4474
- children: [
4475
- /* @__PURE__ */ R($t, { editorRef: r }),
4476
- /* @__PURE__ */ R("div", {
4477
- className: "forge-editor__content flex-1 min-h-[60px] overflow-auto p-[10px] pb-12 outline-none box-border [&_blockquote]:my-2 [&_blockquote]:border-l-4 [&_blockquote]:border-[#ccc] [&_blockquote]:pl-4 [&_blockquote]:italic [&_pre]:bg-[#f4f4f4] [&_pre]:p-2 [&_pre]:rounded [&_h1]:text-2xl [&_h1]:font-bold [&_h2]:text-xl [&_h2]:font-bold [&_h3]:text-lg [&_h3]:font-bold",
4478
- contentEditable: "true",
4479
- "data-placeholder": e.placeholder || ""
4480
- }),
4481
- /* @__PURE__ */ R(en, {}),
4482
- /* @__PURE__ */ R(yn, {})
4483
- ]
4484
- }), a = document.createElement("div");
4485
- I(i, a);
4486
- let o = a.firstElementChild, s = o.querySelector(".forge-editor__content");
4487
- r.current = s, un(s), gn(s), hn(s);
4488
- let c = o.querySelector(".forge-toolbar-style");
4489
- c && Z(c);
4490
- let l = o.querySelector(".forge-editor__toolbar");
4491
- l && ln(l, t);
4492
- let u = o.querySelector(".forge-statusbar");
4493
- return u && nn(u, o, { minHeight: 120 }), {
4494
- element: o,
4495
- ...bn(s)
4496
- };
4497
- }
4498
- //#endregion
4499
- //#region src/main/index.jsx
4500
- function Sn(e) {
4501
- let t = l(e);
4502
- if (t.type === "light") {
4503
- let { element: n, getHTML: r, setHTML: i, getText: a, getSelection: o } = xn(t);
4504
- return e.innerHTML = "", e.appendChild(n), n.style.width = t.width, n.style.height = t.height, {
4505
- element: n,
4506
- getHTML: r,
4507
- setHTML: i,
4508
- getText: a,
4509
- getSelection: o
4510
- };
4511
- }
4512
- return null;
4513
- }
4514
- //#endregion
4515
- //#region src/main/main.jsx
4516
- var Cn = document.querySelectorAll("forge-editor"), wn = [];
4517
- Cn.forEach((e) => {
4518
- let t = Sn(e);
4519
- t && wn.push(t);
4520
- }), window.forgeEditors = wn;
4521
- var Tn = document.getElementById("get-html-btn"), En = document.getElementById("html-output");
4522
- Tn && En && wn[0] && Tn.addEventListener("click", () => {
4523
- En.value = wn[0].getHTML();
4524
- });
4525
- //#endregion
1
+ import { t as e } from "./main-DG9QJcNZ.js";
2
+ export { e as default };