@maily-to/core 0.0.10 → 0.0.12
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 +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +22 -22
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
"use strict";var
|
|
3
|
-
`);
|
|
4
|
-
`);E('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-left:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-z-50{z-index:50}.mly-mb-4{margin-bottom:1rem}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-inline-block{display:inline-block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-max-h-\\[330px\\]{max-height:330px}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-full{width:100%}.mly-min-w-\\[128px\\]{min-width:128px}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-3{gap:.75rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.mly-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-md{border-radius:.375rem}.mly-rounded-none{border-radius:0}.mly-border{border-width:1px}.mly-border-0{border-width:0px}.mly-border-l-4{border-left-width:4px}.mly-border-t{border-top-width:1px}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.mly-border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.mly-bg-\\[\\#efefef\\]{--tw-bg-opacity: 1;background-color:rgb(239 239 239 / var(--tw-bg-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity))}.mly-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.mly-stroke-\\[2\\.5\\]{stroke-width:2.5}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-0{padding-top:0;padding-bottom:0}.mly-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-capitalize{text-transform:capitalize}.mly-leading-none{line-height:1}.mly-tracking-normal{letter-spacing:0em}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');var le=require("@tiptap/react");var J=require("@tiptap/react"),x=require("lucide-react");var Te=require("@tiptap/core"),Le=b(require("@tiptap/extension-image"));var Pe=["sm","md","lg"],G=["left","center","right"],Ne="left",de="sm";function Ft(t){let e={sm:"40px",md:"48px",lg:"64px"};return[`height:${e[t]||e[de]}`,`width:${e[t]||e[de]}`]}function Wt(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[Ne]}var Re=Le.default.extend({name:"logo",priority:1e3,addAttributes(){var t;return k(d({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:de,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:Ne,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,a=["position:relative","margin-top:0",...Ft(o),...Wt(r)];return t.style=a.join(";"),["img",(0,Te.mergeAttributes)(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});var ze=b(require("react")),Ie=require("@radix-ui/react-slot");var Se=require("clsx"),Be=require("tailwind-merge");function w(...t){return(0,Be.twMerge)((0,Se.clsx)(t))}var Ee=require("react/jsx-runtime"),N=ze.forwardRef((s,i)=>{var n=s,{className:t,variant:e="default",size:o="default",asChild:r=!1}=n,a=z(n,["className","variant","size","asChild"]);let l=r?Ie.Slot:"button",c="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",h={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},g={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},p=w("mly-editor",c,h[e],g[o],t);return(0,Ee.jsx)(l,d({className:p,ref:i},a))});N.displayName="BaseButton";var X=require("react/jsx-runtime");function I(t){return(0,X.jsx)(N,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:w("mly-px-2.5"),type:"button",children:t.icon?(0,X.jsx)(t.icon,{className:w("mly-h-3.5 mly-w-3.5")}):(0,X.jsx)("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}var ce=require("react/jsx-runtime");function He(t){let{editor:e}=t,o=[x.AlignLeftIcon,x.AlignCenterIcon,x.AlignRightIcon],r=G.map((s,n)=>({name:s,isActive:()=>e==null?void 0:e.isActive({textAlign:s}),command:()=>{var l,c,h,g;(l=t==null?void 0:t.editor)!=null&&l.isActive({textAlign:s})?(h=(c=t==null?void 0:t.editor)==null?void 0:c.chain())==null||h.focus().unsetTextAlign().run():(g=t==null?void 0:t.editor)==null||g.chain().focus().setTextAlign(s).run()},icon:o[n]})),a=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:x.BoldIcon},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:x.ItalicIcon},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:x.UnderlineIcon},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:x.StrikethroughIcon},...r,{name:"code",isActive:()=>e==null?void 0:e.isActive("code"),command:()=>e==null?void 0:e.chain().focus().toggleCode().run(),icon:x.CodeIcon},{name:"link",command:()=>{let s=e==null?void 0:e.getAttributes("link").href,n=window.prompt("URL",s);if(n!==null){if(n===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:n}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:x.LinkIcon}],i=k(d({},t),{shouldShow:({editor:s,state:n,from:l,to:c})=>{let{doc:h,selection:g}=n,{empty:p}=g,A=!h.textBetween(l,c).length&&(0,J.isTextSelection)(n.selection);return!(p||A||!s.isEditable||s.isActive("image")||s.isActive("logo")||s.isActive("spacer")||s.isActive("variable")||s.isActive({mailyComponent:"button"}))},tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,ce.jsx)(J.BubbleMenu,k(d({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:a.map((s,n)=>(0,ce.jsx)(I,d({},s),n))}))}var pe=require("react"),f=require("lucide-react");var j=require("react/jsx-runtime"),Ve=t=>{let{editor:e,config:o}=t,r=(0,pe.useMemo)(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:f.BoldIcon},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:f.ItalicIcon},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:f.UnderlineIcon},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:f.StrikethroughIcon},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:f.EraserIcon},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:f.SeparatorHorizontal},{name:"link",command:()=>{let i=e.getAttributes("link").href,s=window.prompt("URL",i);if(s!==null){if(s===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:s}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:f.LinkIcon},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:f.AlignLeft},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:f.AlignCenter},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:f.AlignRight}],[e]),a=(0,pe.useMemo)(()=>r.reduce((i,s)=>(i.includes(s.group)||i.push(s.group),i),[]),[r]);return e?(0,j.jsx)("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:a.map((i,s)=>(0,j.jsx)("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(n=>n.group===i).map((n,l)=>(0,j.jsx)(I,d({},n),l))},s))}):null};var Oe=require("@tiptap/react"),L=require("lucide-react");var ye=require("react/jsx-runtime");function Ue(t){let{editor:e}=t,o=[L.AlignLeftIcon,L.AlignCenterIcon,L.AlignRightIcon],r=G.map((n,l)=>({name:n,isActive:()=>(e==null?void 0:e.isActive("logo",{alignment:n}))||(e==null?void 0:e.isActive("image",{alignment:n})),shouldShow:()=>(e==null?void 0:e.isActive("logo"))||(e==null?void 0:e.isActive("image")),command:()=>{var h,g;(e==null?void 0:e.isActive("logo"))?(h=t==null?void 0:t.editor)==null||h.chain().focus().setLogoAttributes({alignment:n}).run():(g=t==null?void 0:t.editor)==null||g.chain().focus().updateAttributes("image",{alignment:n}).run()},icon:o[l]})),a=Pe.map(n=>({name:n,isActive:()=>{var l;return(l=t==null?void 0:t.editor)==null?void 0:l.isActive("logo",{size:n})},shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var l;(l=t==null?void 0:t.editor)==null||l.chain().focus().setLogoAttributes({size:n}).run()}})),i=[...r,{name:"url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var A,T,C;let{editor:n}=t,l=(A=n==null?void 0:n.getAttributes("logo"))==null?void 0:A.src,c=window.prompt("Update logo URL",l);if(!c)return;let h=(T=n==null?void 0:n.getAttributes("logo"))==null?void 0:T.size,g=(C=n==null?void 0:n.getAttributes("logo"))==null?void 0:C.alignment,p=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:c,size:h,alignment:g}),n==null||n.commands.setNodeSelection((p==null?void 0:p.from)||0)},icon:L.Link},{name:"image-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var g;let{editor:n}=t,l=(g=n==null?void 0:n.getAttributes("image"))==null?void 0:g.src,c=window.prompt("Update Image URL",l);if(!c)return;let h=n==null?void 0:n.state.selection;n==null||n.commands.setImage({src:c}),n==null||n.commands.setNodeSelection((h==null?void 0:h.from)||0)},icon:L.Unlink},...a],s=k(d({},t),{shouldShow:({editor:n})=>n.isActive("logo")||n.isActive("image"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,ye.jsx)(Oe.BubbleMenu,k(d({},s),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:i.filter(n=>{var l;return(l=n.shouldShow)==null?void 0:l.call(n)}).map((n,l)=>(0,ye.jsx)(I,d({},n),l))}))}var qe=require("@tiptap/react");var Y=require("@tiptap/core"),ue=["sm","md","lg","xl"],$t="sm";function Kt(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[$t]}`}var De=Y.Node.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!ue.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=Kt(o),["div",(0,Y.mergeAttributes)({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer relative z-50",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});var ge=require("react/jsx-runtime");function Fe(t){let{editor:e}=t,o=ue.map(a=>({name:a,isActive:()=>e==null?void 0:e.isActive("spacer",{height:a}),command:()=>{e==null||e.chain().focus().setSpacer({height:a}).run()}})),r=k(d({},t),{shouldShow:({editor:a})=>a.isActive("spacer"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,ge.jsx)(qe.BubbleMenu,k(d({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((a,i)=>(0,ge.jsx)(I,d({},a),i))}))}var At=b(require("@tiptap/starter-kit")),Ct=require("@tiptap/extension-color"),Mt=b(require("@tiptap/extension-link")),Tt=b(require("@tiptap/extension-list-item")),Lt=b(require("@tiptap/extension-paragraph")),Pt=b(require("@tiptap/extension-placeholder")),Nt=b(require("@tiptap/extension-text-align")),xe=b(require("@tiptap/extension-text-style")),Rt=b(require("@tiptap/extension-heading")),St=b(require("@tiptap/extension-underline"));var We=require("@tiptap/core"),$e=require("@tiptap/extension-horizontal-rule"),Ke=$e.HorizontalRule.extend({addInputRules(){return[new We.InputRule({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,a=e.from,i=e.to;r.insert(a-1,this.type.create(o)).delete(r.mapping.map(a),r.mapping.map(i))}})]}});var Q=require("@tiptap/core"),Ze=require("@tiptap/react");var Je=require("@tiptap/react"),F=require("lucide-react"),fe=require("react-colorful");var _e=b(require("react"));var Ge=require("react/jsx-runtime"),H=_e.forwardRef((a,r)=>{var i=a,{className:t,type:e}=i,o=z(i,["className","type"]);return(0,Ge.jsx)("input",d({type:e,className:w("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",t),ref:r},o))});H.displayName="Input";var Xe=b(require("react")),R=b(require("@radix-ui/react-popover"));var he=require("react/jsx-runtime"),D=R.Root,q=R.Trigger,V=Xe.forwardRef((i,a)=>{var s=i,{className:t,align:e="center",sideOffset:o=4}=s,r=z(s,["className","align","sideOffset"]);return(0,he.jsx)(R.Portal,{children:(0,he.jsx)(R.Content,d({ref:a,align:e,sideOffset:o,className:w("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2 text-gray-950","mly-editor",t)},r))})});V.displayName=R.Content.displayName;var m=require("react/jsx-runtime"),_t={left:F.AlignLeftIcon,center:F.AlignCenterIcon,right:F.AlignRightIcon},we={style(t){return Ye.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return Qe.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(_t).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function je(t){let{url:e,text:o,alignment:r,variant:a,borderRadius:i,buttonColor:s,textColor:n}=t.node.attrs;return(0,m.jsx)(Je.NodeViewWrapper,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:(0,m.jsxs)(D,{open:t.selected,children:[(0,m.jsx)(q,{asChild:!0,children:(0,m.jsx)("div",{children:(0,m.jsx)("a",{className:w("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":i==="round","!mly-rounded-md":i==="smooth","!mly-rounded-none":i==="sharp"}),href:e,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,style:{backgroundColor:a==="filled"?s:"transparent",color:n,borderWidth:2,borderStyle:"solid",borderColor:s},children:o})})}),(0,m.jsxs)(V,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:l=>l.preventDefault(),onCloseAutoFocus:l=>l.preventDefault(),children:[(0,m.jsx)(H,{placeholder:"Add text here",value:o,onChange:l=>{t.updateAttributes({text:l.target.value})}}),(0,m.jsx)(H,{placeholder:"Add link here",value:e,onChange:l=>{t.updateAttributes({url:l.target.value})}}),(0,m.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,m.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),(0,m.jsx)("div",{className:"mly-flex mly-gap-1",children:we.style(t).map((l,c)=>(0,m.jsx)(N,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,type:"button",children:l.name},c))})]}),(0,m.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,m.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),(0,m.jsx)("div",{className:"mly-flex mly-gap-1",children:we.cornerRadius(t).map((l,c)=>(0,m.jsx)(N,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,type:"button",children:l.name},c))})]}),(0,m.jsxs)("div",{className:"flex gap-2",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),(0,m.jsx)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:we.alignment(t).map((l,c)=>(0,m.jsx)(N,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:l.onClick,type:"button",children:(0,m.jsx)(l.icon,{size:16})},c))})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),(0,m.jsxs)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[(0,m.jsx)(Gt,{variant:a,color:s,onChange:l=>{t.updateAttributes({buttonColor:l})}}),(0,m.jsx)(Xt,{color:n,onChange:l=>{t.updateAttributes({textColor:l})}})]})]})]})]})]})})}function Gt(t){let{color:e,onChange:o,variant:r}=t;return(0,m.jsxs)(D,{children:[(0,m.jsx)(q,{asChild:!0,children:(0,m.jsx)(N,{variant:"ghost",className:"",size:"sm",type:"button",children:(0,m.jsx)("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),(0,m.jsx)(V,{className:"mly-w-full !mly-p-0 mly-rounded-none mly-bg-transparent mly-border-0",children:(0,m.jsx)(fe.HexAlphaColorPicker,{color:e,onChange:a=>{queueMicrotask(()=>{o(a)})}})})]})}function Xt(t){let{color:e,onChange:o}=t;return(0,m.jsxs)(D,{children:[(0,m.jsx)(q,{asChild:!0,children:(0,m.jsx)(N,{variant:"ghost",size:"sm",type:"button",children:(0,m.jsxs)("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[(0,m.jsx)("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),(0,m.jsx)("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),(0,m.jsx)(V,{className:"mly-w-full !mly-p-0 mly-rounded-none mly-bg-transparent mly-border-0",children:(0,m.jsx)(fe.HexAlphaColorPicker,{color:e,onChange:r=>{queueMicrotask(()=>{o(r)})}})})]})}var Ye=["filled","outline"],Qe=["sharp","smooth","round"],et=Q.Node.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",(0,Q.mergeAttributes)({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return(0,Ze.ReactNodeViewRenderer)(je)}});var Z=require("@tiptap/core"),be=Z.Node.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",(0,Z.mergeAttributes)(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});var S=require("react"),te=require("@tiptap/react"),lt=b(require("tippy.js")),at=require("lucide-react");var ee=require("react");var nt=require("react/jsx-runtime"),tt=(0,ee.createContext)({variables:[],slashCommands:[]});function ot(t){let r=t,{children:e}=r,o=z(r,["children"]);return(0,nt.jsx)(tt.Provider,{value:o,children:e})}function rt(){let t=(0,ee.useContext)(tt);if(!t)throw new Error("Missing MailyContext.Provider in the component tree");return t}var v=require("react/jsx-runtime"),it=(0,S.forwardRef)((t,e)=>{var i,s;let[o,r]=(0,S.useState)(0),a=n=>{let l=t.items[n];l&&t.command({id:l})};return(0,S.useEffect)(()=>r(0),[t.items]),(0,S.useImperativeHandle)(e,()=>({onKeyDown:({event:n})=>n.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):n.key==="ArrowDown"?(r((o+1)%t.items.length),!0):n.key==="Enter"?(a(o),!0):!1})),(0,v.jsx)("div",{className:"mly-z-50 mly-h-auto mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-1 mly-shadow-md mly-transition-all mly-min-w-[128px]",children:(i=t==null?void 0:t.items)!=null&&i.length?(s=t==null?void 0:t.items)==null?void 0:s.map((n,l)=>(0,v.jsx)("button",{onClick:()=>a(l),className:w("mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",l===o?"mly-bg-gray-200":"mly-bg-white"),children:n},l)):(0,v.jsx)("button",{className:"mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 mly-bg-white",children:"No result"})})});it.displayName="VariableList";function st(t=[]){let e=t.map(o=>o.name);return{items:({query:o})=>e.concat(o.length>0?[o]:[]).filter(r=>r.toLowerCase().startsWith(o.toLowerCase())).slice(0,5),render:()=>{let o,r=null;return{onStart:a=>{o=new te.ReactRenderer(it,{props:a,editor:a.editor}),a.clientRect&&(r=(0,lt.default)("body",{getReferenceClientRect:a.clientRect,appendTo:()=>document.body,content:o.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(a){var i;o.updateProps(a),a.clientRect&&((i=r==null?void 0:r[0])==null||i.setProps({getReferenceClientRect:a.clientRect}))},onKeyDown(a){var i;return a.event.key==="Escape"?(r==null||r[0].hide(),!0):(i=o.ref)==null?void 0:i.onKeyDown(a)},onExit(){!r||!(r!=null&&r[0])||!o||(r==null||r[0].destroy(),o.destroy())}}}}}function mt(t){var h,g;let{node:e,selected:o,updateAttributes:r}=t,{id:a,fallback:i}=e.attrs,{variables:s=[]}=rt(),n=(g=(h=s.find(p=>p.name===a))==null?void 0:h.required)!=null?g:!0,[l,c]=(0,S.useState)(!1);return(0,v.jsx)(te.NodeViewWrapper,{className:w("react-component",o&&"ProseMirror-selectednode","mly-leading-none mly-inline-block"),draggable:"false",children:(0,v.jsxs)(D,{open:l,onOpenChange:c,children:[(0,v.jsx)(q,{children:(0,v.jsxs)("span",{tabIndex:-1,className:"mly-py-1 mly-px-2 mly-bg-rose-50 mly-border mly-border-rose-200 mly-text-rose-800 mly-rounded-md mly-leading-none mly-inline-flex mly-items-center mly-gap-1",children:[a,n&&!i&&(0,v.jsx)(at.AlertTriangle,{className:"mly-w-3 mly-shrink-0 mly-h-3 mly-stroke-[2.5]"})]})}),(0,v.jsxs)(V,{align:"start",className:"mly-space-y-2",onOpenAutoFocus:p=>p.preventDefault(),onCloseAutoFocus:p=>p.preventDefault(),children:[(0,v.jsxs)("label",{className:"mly-block mly-w-full mly-leading-none mly-space-y-1.5",children:[(0,v.jsx)("span",{className:"mly-leading-none mly-text-xs mly-font-normal",children:"Variable Name"}),(0,v.jsx)(H,{placeholder:"Add Variable Name",value:a,onChange:p=>{r({id:p.target.value})}})]}),(0,v.jsxs)("label",{className:"mly-block mly-w-full mly-leading-none mly-space-y-1.5",children:[(0,v.jsx)("span",{className:"mly-leading-none mly-text-xs mly-font-normal",children:"Fallback Value"}),(0,v.jsx)(H,{placeholder:"Fallback Value",value:i||"",onChange:p=>{r({fallback:p.target.value})}}),(0,v.jsx)("p",{className:"mly-text-xs mly-text-gray-500",children:"If the variable doesn't exist, this fallback value will be used."})]})]})]})})}var M=require("react"),dt=require("@tiptap/core"),ct=require("@tiptap/react"),pt=b(require("@tiptap/suggestion")),u=require("lucide-react"),yt=b(require("tippy.js"));var y=require("react/jsx-runtime"),ut=dt.Extension.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[(0,pt.default)(d({editor:this.editor},this.options.suggestion))]}}),Jt=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:(0,y.jsx)(u.Text,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:(0,y.jsx)(u.Heading1,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:(0,y.jsx)(u.Heading2,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:(0,y.jsx)(u.Heading3,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:(0,y.jsx)(u.List,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:(0,y.jsx)(u.ListOrdered,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:(0,y.jsx)(u.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Image URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setImage({src:o}).run())}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:(0,y.jsx)(u.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Logo URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setLogoImage({src:o}).run())}},{title:"Spacer",description:"Add a spacer to the page. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:(0,y.jsx)(u.MoveVertical,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to the page.",searchTerms:["link","button","cta"],icon:(0,y.jsx)(u.MousePointer,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setButton().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:(0,y.jsx)(u.DivideIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHardBreak().run()}},{title:"Blockquote",description:"Add blockquote.",searchTerms:["quote","blockquote"],icon:(0,y.jsx)(u.TextQuote,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBlockquote().run()}},{title:"Footer",description:"Add a footer text to the page.",searchTerms:["footer","text"],icon:(0,y.jsx)(u.FootprintsIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:(0,y.jsx)(u.EraserIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().selectParentNode().deleteSelection().run()}}],jt=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,a=e.offsetTop,i=a+r;a<t.scrollTop?t.scrollTop-=t.scrollTop-a+5:i>o+t.scrollTop&&(t.scrollTop+=i-o-t.scrollTop+5)},Yt=({items:t,command:e,editor:o})=>{let[r,a]=(0,M.useState)(0),i=(0,M.useCallback)(n=>{let l=t[n];l&&e(l)},[e,o,t]);(0,M.useEffect)(()=>{let n=["ArrowUp","ArrowDown","Enter"],l=c=>{if(n.includes(c.key))return c.preventDefault(),c.key==="ArrowUp"?(a((r+t.length-1)%t.length),!0):c.key==="ArrowDown"?(a((r+1)%t.length),!0):c.key==="Enter"?(i(r),!0):!1};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[t,r,a,i]),(0,M.useEffect)(()=>{a(0)},[t]);let s=(0,M.useRef)(null);return(0,M.useLayoutEffect)(()=>{let n=s==null?void 0:s.current,l=n==null?void 0:n.children[r];l&&n&&jt(n,l)},[r]),t.length>0?(0,y.jsxs)("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[(0,y.jsx)("div",{id:"slash-command",ref:s,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((n,l)=>(0,y.jsxs)("button",{className:w("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",l===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>i(l),type:"button",children:[(0,y.jsx)("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:n.icon}),(0,y.jsxs)("div",{children:[(0,y.jsx)("p",{className:"mly-font-medium",children:n.title}),(0,y.jsx)("p",{className:"mly-text-xs mly-text-gray-400",children:n.description})]})]},l))}),(0,y.jsx)("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:(0,y.jsxs)("div",{className:"mly-flex mly-items-center",children:[(0,y.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,y.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),(0,y.jsx)("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),(0,y.jsx)("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),(0,y.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,y.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null};function gt(t=[]){return{items:({query:e})=>[...Jt,...t].filter(o=>{if(typeof e=="string"&&e.length>0){let r=e.toLowerCase();return o.title.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)||o.searchTerms&&o.searchTerms.some(a=>a.includes(r))}return!0}),render:()=>{let e,o=null;return{onStart:r=>{e=new ct.ReactRenderer(Yt,{props:r,editor:r.editor}),o=(0,yt.default)("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:r=>{e==null||e.updateProps(r),o&&o[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var a;return r.event.key==="Escape"?(o==null||o[0].hide(),!0):(a=e==null?void 0:e.ref)==null?void 0:a.onKeyDown(r)},onExit:()=>{!o||!(o!=null&&o[0])||!e||(o==null||o[0].destroy(),e==null||e.destroy())}}}}}var oe=require("@tiptap/core"),ht=require("@tiptap/pm/state"),wt=require("@tiptap/react"),ft=b(require("@tiptap/suggestion"));var Qt=new ht.PluginKey("variable"),bt=oe.Node.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},renderLabel({options:t,node:e}){var o;return`${(o=e.attrs.label)!=null?o:e.attrs.id}`},suggestion:{char:"@",pluginKey:Qt,command:({editor:t,range:e,props:o})=>{var i,s;let r=t.view.state.selection.$to.nodeAfter;((i=r==null?void 0:r.text)==null?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:o},{type:"text",text:" "}]).run(),(s=window.getSelection())==null||s.collapseToEnd()},allow:({state:t,range:e})=>{let o=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!o.parent.type.contentMatch.matchType(r)}}}},addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},fallback:{default:null,parseHTML:t=>t.getAttribute("data-fallback"),renderHTML:t=>t.fallback?{"data-fallback":t.fallback}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",(0,oe.mergeAttributes)({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})]},renderText({node:t}){return this.options.renderLabel({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let o=!1,{selection:r}=e,{empty:a,anchor:i}=r;return a?(e.doc.nodesBetween(i-1,i,(s,n)=>{if(s.type.name===this.name)return o=!0,t.insertText(this.options.suggestion.char||"",n,n+s.nodeSize),!1}),o):!1})}},addProseMirrorPlugins(){return[(0,ft.default)(d({editor:this.editor},this.options.suggestion))]},addNodeView(){return(0,wt.ReactNodeViewRenderer)(mt)}});var re=require("@tiptap/react"),ne=require("react"),vt=b(require("@tiptap/extension-image"));var W=require("react"),xt=t=>{let e=(0,W.useRef)(null);return(0,W.useLayoutEffect)(()=>{e.current=t},[t]),(0,W.useCallback)((...o)=>{if(e.current===null)throw new Error("Handler is not assigned");return e.current(...o)},[])};var B=require("react/jsx-runtime"),Zt=60;function eo(t){let{node:e,updateAttributes:o,selected:r}=t,a=(0,ne.useRef)(null),[i,s]=(0,ne.useState)(),n=xt(p=>{let A=document.querySelector(".ProseMirror-selectednode");if(!a.current||!A||!r)return;let T=A.offsetWidth;p.preventDefault();let C=p.currentTarget.dataset.direction||"--",O=p.clientX,$=a.current.width,ae=a.current.height,U=$,ie=ae,zt=C[1]==="w"?-1:1,se=()=>{window.removeEventListener("mousemove",ve),window.removeEventListener("mouseup",se),o({width:U,height:ie}),s(void 0)},ve=ke=>{if(U=Math.max($+zt*(ke.clientX-O),Zt),U>T&&(U=T),ie=U/$*ae,s({width:U,height:ie}),!ke.buttons)return se()};window.addEventListener("mousemove",ve),window.addEventListener("mouseup",se)});function l(p){return(0,B.jsx)("div",{role:"button",tabIndex:0,onMouseDown:n,"data-direction":p,className:"mly-bg-rose-500",style:k(d(d({position:"absolute",height:"10px",width:"10px"},{n:{top:0},s:{bottom:0}}[p[0]]),{w:{left:0},e:{right:0}}[p[1]]),{cursor:`${p}-resize`})})}let{alignment:c="center",width:h,height:g}=e.attrs||{};return(0,B.jsxs)(re.NodeViewWrapper,{as:"div",draggable:!0,"data-drag-handle":!0,style:d(k(d({width:h,height:g},i),{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block"}),{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[c]||{}),children:[(0,B.jsx)("img",k(d({},e.attrs),{ref:a,style:k(d({},i),{cursor:"default",marginBottom:0})})),r&&(0,B.jsxs)(B.Fragment,{children:[[{left:0,top:0,height:"100%",width:"1px"},{right:0,top:0,height:"100%",width:"1px"},{top:0,left:0,width:"100%",height:"1px"},{bottom:0,left:0,width:"100%",height:"1px"}].map((p,A)=>(0,B.jsx)("div",{className:"mly-bg-rose-500",style:d({position:"absolute"},p)},A)),l("nw"),l("ne"),l("sw"),l("se")]})]})}var kt=vt.default.extend({addAttributes(){var t;return k(d({},(t=this.parent)==null?void 0:t.call(this)),{width:{renderHTML:({width:e})=>({width:e})},height:{renderHTML:({height:e})=>({height:e})},alignment:{default:"center",renderHTML:({alignment:e})=>({"data-alignment":e}),parseHTML:e=>e.getAttribute("data-alignment")||"center"}})},addNodeView(){return(0,re.ReactNodeViewRenderer)(eo)}});function Bt(t){let{variables:e,slashCommands:o}=t;return[At.default.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},code:{HTMLAttributes:{class:"mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"}},horizontalRule:!1,blockquote:{HTMLAttributes:{class:"mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"}}}),St.default,Re,Ct.Color.configure({types:[xe.default.name,Tt.default.name]}),xe.default.configure(),Nt.default.configure({types:[Lt.default.name,Rt.default.name,be.name]}),Ke,Pt.default.configure({placeholder:({node:r})=>r.type.name==="heading"?`Heading ${r.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),De,be,bt.configure({suggestion:st(e)}),ut.configure({suggestion:gt(o)}),Mt.default.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),et,kt]}var P=require("react/jsx-runtime");function to(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:a=!0,spellCheck:i=!1,autofocus:s="end"}={},onCreate:n,onUpdate:l,extensions:c,contentHtml:h,contentJson:g,variables:p,slashCommands:A}=t,T=null;g?T=(g==null?void 0:g.type)==="doc"?g:{type:"doc",content:g}:h?T=h:T={type:"doc",content:[{type:"paragraph",content:[]}]};let C=(0,le.useEditor)({editorProps:{attributes:{class:w("mly-prose mly-w-full",o),spellCheck:i?"true":"false"},handleDOMEvents:{keydown:(O,$)=>{if(["ArrowUp","ArrowDown","Enter"].includes($.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:O})=>{n==null||n(O)},onUpdate:({editor:O})=>{l==null||l(O)},extensions:[...Bt({variables:p,slashCommands:A}),...c||[]],content:T,autofocus:s});return C?(0,P.jsx)(ot,{variables:p,children:(0,P.jsxs)("div",{className:w("mly-editor mly-antialiased",e),children:[a&&(0,P.jsx)(Ve,{config:t.config,editor:C}),(0,P.jsxs)("div",{className:w("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[(0,P.jsx)(He,{editor:C}),(0,P.jsx)(Ue,{editor:C}),(0,P.jsx)(Fe,{editor:C}),(0,P.jsx)(le.EditorContent,{editor:C})]})]})}):null}0&&(module.exports={Editor});
|
|
2
|
+
"use strict";var Dt=Object.create;var W=Object.defineProperty,_t=Object.defineProperties,qt=Object.getOwnPropertyDescriptor,Ft=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertyNames,G=Object.getOwnPropertySymbols,$t=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var Le=(t,e,o)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,c=(t,e)=>{for(var o in e||(e={}))ce.call(e,o)&&Le(t,o,e[o]);if(G)for(var o of G(e))Pe.call(e,o)&&Le(t,o,e[o]);return t},A=(t,e)=>_t(t,Ft(e));var L=(t,e)=>{var o={};for(var r in t)ce.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&G)for(var r of G(t))e.indexOf(r)<0&&Pe.call(t,r)&&(o[r]=t[r]);return o};var Kt=(t,e)=>{for(var o in e)W(t,o,{get:e[o],enumerable:!0})},Ne=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of Wt(e))!ce.call(t,l)&&l!==o&&W(t,l,{get:()=>e[l],enumerable:!(r=qt(e,l))||r.enumerable});return t};var x=(t,e,o)=>(o=t!=null?Dt($t(t)):{},Ne(e||!t||!t.__esModule?W(o,"default",{value:t,enumerable:!0}):o,t)),Gt=t=>Ne(W({},"__esModule",{value:!0}),t);var so={};Kt(so,{Editor:()=>io});module.exports=Gt(so);function H(t,{insertAt:e}={}){if(!t||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}H(`.mly-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mly-editor .mly-prose h1,.mly-editor .mly-prose h2,.mly-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mly-editor .mly-prose h1{font-size:36px}.mly-editor .mly-prose h2{font-size:30px}.mly-editor .mly-prose h3{font-size:24px}.mly-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mly-editor .mly-prose h1+p,.mly-editor .mly-prose h2+p,.mly-editor .mly-prose h3+p,.mly-editor .mly-prose hr+p{margin-top:0}.mly-editor .mly-prose ol,.mly-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mly-editor .mly-prose li>p{margin:0}.mly-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mly-editor .mly-prose hr{margin-block:32px}.mly-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mly-editor .mly-prose .spacer+*{margin-top:0}.mly-editor .mly-prose p+.spacer{margin-top:-20px}.mly-editor .mly-prose blockquote+.spacer{margin-top:-16px}.mly-editor .mly-prose h1+.spacer,.mly-editor .mly-prose h2+.spacer,.mly-editor .mly-prose h3+.spacer{margin-top:-12px}.mly-editor .mly-prose ol+.spacer,.mly-editor .mly-prose ul+.spacer{margin-top:-20px}.mly-editor .mly-prose img+.spacer{margin-top:-32px}.mly-editor .mly-prose .node-button+.spacer,.mly-editor .mly-prose footer+.spacer{margin-top:-20px}.mly-editor .mly-prose .node-button{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose .node-image{line-height:0;margin-top:0;margin-bottom:32px;outline:none}.mly-editor .mly-prose .node-image+.spacer{margin-top:-32px}.mly-editor .mly-prose code:before,.mly-editor .mly-prose code:after{content:none}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0}.ProseMirror:focus{outline:none}.ProseMirror .is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror .is-empty:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror-selectednode{outline:3px solid #555}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.mly-editor .react-colorful__alpha{border-radius:0}.mly-editor .react-colorful__saturation,.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{border-radius:8px}.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{height:16px}.mly-editor .react-colorful__pointer{width:16px;height:16px}
|
|
3
|
+
`);H(`:where(.mly-editor),:where(.mly-editor) :before,:where(.mly-editor) :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:where(.mly-editor) :before,:where(.mly-editor) :after{--tw-content: ""}:where(.mly-editor) html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}:where(.mly-editor) body{margin:0;line-height:inherit}:where(.mly-editor) hr{height:0;color:inherit;border-top-width:1px}:where(.mly-editor) abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6{font-size:inherit;font-weight:inherit}:where(.mly-editor) a{color:inherit;text-decoration:inherit}:where(.mly-editor) b,:where(.mly-editor) strong{font-weight:bolder}:where(.mly-editor) code,:where(.mly-editor) kbd,:where(.mly-editor) samp,:where(.mly-editor) pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}:where(.mly-editor) small{font-size:80%}:where(.mly-editor) sub,:where(.mly-editor) sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.mly-editor) sub{bottom:-.25em}:where(.mly-editor) sup{top:-.5em}:where(.mly-editor) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.mly-editor) button,:where(.mly-editor) input,:where(.mly-editor) optgroup,:where(.mly-editor) select,:where(.mly-editor) textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}:where(.mly-editor) button,:where(.mly-editor) select{text-transform:none}:where(.mly-editor) button,:where(.mly-editor) [type=button],:where(.mly-editor) [type=reset],:where(.mly-editor) [type=submit]{-webkit-appearance:button;background-image:none}:where(.mly-editor) :-moz-focusring{outline:auto}:where(.mly-editor) :-moz-ui-invalid{box-shadow:none}:where(.mly-editor) progress{vertical-align:baseline}:where(.mly-editor) ::-webkit-inner-spin-button,:where(.mly-editor) ::-webkit-outer-spin-button{height:auto}:where(.mly-editor) [type=search]{-webkit-appearance:textfield;outline-offset:-2px}:where(.mly-editor) ::-webkit-search-decoration{-webkit-appearance:none}:where(.mly-editor) ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(.mly-editor) summary{display:list-item}:where(.mly-editor) blockquote,:where(.mly-editor) dl,:where(.mly-editor) dd,:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6,:where(.mly-editor) hr,:where(.mly-editor) figure,:where(.mly-editor) p,:where(.mly-editor) pre{margin:0}:where(.mly-editor) fieldset{margin:0;padding:0}:where(.mly-editor) legend{padding:0}:where(.mly-editor) ol,:where(.mly-editor) ul,:where(.mly-editor) menu{list-style:none;margin:0;padding:0}:where(.mly-editor) dialog{padding:0}:where(.mly-editor) textarea{resize:vertical}:where(.mly-editor) input::-moz-placeholder,:where(.mly-editor) textarea::-moz-placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) input::placeholder,:where(.mly-editor) textarea::placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) button,:where(.mly-editor) [role=button]{cursor:pointer}:where(.mly-editor) :disabled{cursor:default}:where(.mly-editor) img,:where(.mly-editor) svg,:where(.mly-editor) video,:where(.mly-editor) canvas,:where(.mly-editor) audio,:where(.mly-editor) iframe,:where(.mly-editor) embed,:where(.mly-editor) object{display:block;vertical-align:middle}:where(.mly-editor) img,:where(.mly-editor) video{max-width:100%;height:auto}:where(.mly-editor) [hidden]{display:none}
|
|
4
|
+
`);H('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:start;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-z-50{z-index:50}.mly-mb-4{margin-bottom:1rem}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-inline-block{display:inline-block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-max-h-\\[330px\\]{max-height:330px}.\\!mly-w-full{width:100%!important}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-full{width:100%}.mly-min-w-0{min-width:0px}.mly-min-w-\\[128px\\]{min-width:128px}.mly-min-w-\\[260px\\]{min-width:260px}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-3{gap:.75rem}.mly-gap-4{gap:1rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.mly-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-lg{border-radius:.5rem}.mly-rounded-md{border-radius:.375rem}.mly-rounded-none{border-radius:0}.mly-rounded-xl{border-radius:.75rem}.mly-border{border-width:1px}.mly-border-0{border-width:0px}.mly-border-l-4{border-left-width:4px}.mly-border-t{border-top-width:1px}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.mly-border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.\\!mly-bg-transparent{background-color:transparent!important}.mly-bg-\\[\\#efefef\\]{--tw-bg-opacity: 1;background-color:rgb(239 239 239 / var(--tw-bg-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity))}.mly-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.mly-stroke-\\[2\\.5\\]{stroke-width:2.5}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-0{padding-top:0;padding-bottom:0}.mly-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-uppercase{text-transform:uppercase}.mly-capitalize{text-transform:capitalize}.mly-leading-none{line-height:1}.mly-tracking-normal{letter-spacing:0em}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity))}.mly-text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));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)}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-border-gray-400:focus-visible{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');var ie=require("@tiptap/react");var j=require("@tiptap/react"),v=require("lucide-react");var Re=require("@tiptap/core"),Se=x(require("@tiptap/extension-image"));var Be=["sm","md","lg"],X=["left","center","right"],ze="left",pe="sm";function Xt(t){let e={sm:"40px",md:"48px",lg:"64px"};return[`height:${e[t]||e[pe]}`,`width:${e[t]||e[pe]}`]}function Jt(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[ze]}var Ie=Se.default.extend({name:"logo",priority:1e3,addAttributes(){var t;return A(c({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:pe,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:ze,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,l=["position:relative","margin-top:0",...Xt(o),...Jt(r)];return t.style=l.join(";"),["img",(0,Re.mergeAttributes)(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});var Ve=x(require("react")),Oe=require("@radix-ui/react-slot");var Ee=require("clsx"),He=require("tailwind-merge");function f(...t){return(0,He.twMerge)((0,Ee.clsx)(t))}var Ue=require("react/jsx-runtime"),R=Ve.forwardRef((s,i)=>{var n=s,{className:t,variant:e="default",size:o="default",asChild:r=!1}=n,l=L(n,["className","variant","size","asChild"]);let a=r?Oe.Slot:"button",u="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",m={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},p={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},h=f("mly-editor",u,m[e],p[o],t);return(0,Ue.jsx)(a,c({className:h,ref:i},l))});R.displayName="BaseButton";var J=require("react/jsx-runtime");function E(t){return(0,J.jsx)(R,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:f("mly-px-2.5"),type:"button",children:t.icon?(0,J.jsx)(t.icon,{className:f("mly-h-3.5 mly-w-3.5")}):(0,J.jsx)("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}var ye=require("react/jsx-runtime");function De(t){let{editor:e}=t,o=[v.AlignLeftIcon,v.AlignCenterIcon,v.AlignRightIcon],r=X.map((s,n)=>({name:s,isActive:()=>e==null?void 0:e.isActive({textAlign:s}),command:()=>{var a,u,m,p;(a=t==null?void 0:t.editor)!=null&&a.isActive({textAlign:s})?(m=(u=t==null?void 0:t.editor)==null?void 0:u.chain())==null||m.focus().unsetTextAlign().run():(p=t==null?void 0:t.editor)==null||p.chain().focus().setTextAlign(s).run()},icon:o[n]})),l=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:v.BoldIcon},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:v.ItalicIcon},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:v.UnderlineIcon},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:v.StrikethroughIcon},...r,{name:"code",isActive:()=>e==null?void 0:e.isActive("code"),command:()=>e==null?void 0:e.chain().focus().toggleCode().run(),icon:v.CodeIcon},{name:"link",command:()=>{let s=e==null?void 0:e.getAttributes("link").href,n=window.prompt("URL",s);if(n!==null){if(n===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:n}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:v.LinkIcon}],i=A(c({},t),{shouldShow:({editor:s,state:n,from:a,to:u})=>{let{doc:m,selection:p}=n,{empty:h}=p,I=!m.textBetween(a,u).length&&(0,j.isTextSelection)(n.selection);return!(h||I||!s.isEditable||s.isActive("image")||s.isActive("logo")||s.isActive("spacer")||s.isActive("variable")||s.isActive({mailyComponent:"button"}))},tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,ye.jsx)(j.BubbleMenu,A(c({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:l.map((s,n)=>(0,ye.jsx)(E,c({},s),n))}))}var ue=require("react"),b=require("lucide-react");var Y=require("react/jsx-runtime"),_e=t=>{let{editor:e,config:o}=t,r=(0,ue.useMemo)(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:b.BoldIcon},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:b.ItalicIcon},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:b.UnderlineIcon},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:b.StrikethroughIcon},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:b.EraserIcon},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:b.SeparatorHorizontal},{name:"link",command:()=>{let i=e.getAttributes("link").href,s=window.prompt("URL",i);if(s!==null){if(s===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:s}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:b.LinkIcon},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:b.AlignLeft},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:b.AlignCenter},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:b.AlignRight}],[e]),l=(0,ue.useMemo)(()=>r.reduce((i,s)=>(i.includes(s.group)||i.push(s.group),i),[]),[r]);return e?(0,Y.jsx)("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:l.map((i,s)=>(0,Y.jsx)("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(n=>n.group===i).map((n,a)=>(0,Y.jsx)(E,c({},n),a))},s))}):null};var qe=require("@tiptap/react"),C=require("lucide-react");var ge=require("react/jsx-runtime");function Fe(t){let{editor:e}=t,o=[C.AlignLeftIcon,C.AlignCenterIcon,C.AlignRightIcon],r=X.map((n,a)=>({name:n,isActive:()=>(e==null?void 0:e.isActive("logo",{alignment:n}))||(e==null?void 0:e.isActive("image",{alignment:n})),shouldShow:()=>(e==null?void 0:e.isActive("logo"))||(e==null?void 0:e.isActive("image")),command:()=>{var m,p;(e==null?void 0:e.isActive("logo"))?(m=t==null?void 0:t.editor)==null||m.chain().focus().setLogoAttributes({alignment:n}).run():(p=t==null?void 0:t.editor)==null||p.chain().focus().updateAttributes("image",{alignment:n}).run()},icon:o[a]})),l=Be.map(n=>({name:n,isActive:()=>{var a;return(a=t==null?void 0:t.editor)==null?void 0:a.isActive("logo",{size:n})},shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var a;(a=t==null?void 0:t.editor)==null||a.chain().focus().setLogoAttributes({size:n}).run()}})),i=[...r,{name:"url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var I,T,w;let{editor:n}=t,a=(I=n==null?void 0:n.getAttributes("logo"))==null?void 0:I.src,u=window.prompt("Update logo URL",a);if(!u)return;let m=(T=n==null?void 0:n.getAttributes("logo"))==null?void 0:T.size,p=(w=n==null?void 0:n.getAttributes("logo"))==null?void 0:w.alignment,h=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:u,size:m,alignment:p}),n==null||n.commands.setNodeSelection((h==null?void 0:h.from)||0)},icon:C.Link},{name:"image-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var p;let{editor:n}=t,a=(p=n==null?void 0:n.getAttributes("image"))==null?void 0:p.src,u=window.prompt("Update Image URL",a);if(!u)return;let m=n==null?void 0:n.state.selection;n==null||n.commands.setImage({src:u}),n==null||n.commands.setNodeSelection((m==null?void 0:m.from)||0)},icon:C.Unlink},{name:"image-external-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var m;let{editor:n}=t,a=(m=n==null?void 0:n.getAttributes("image"))==null?void 0:m.externalLink,u=window.prompt("Update Image External URL",a||"");n==null||n.commands.updateAttributes("image",{externalLink:u||""})},icon:C.ArrowUpRight},...l],s=A(c({},t),{shouldShow:({editor:n})=>n.isActive("logo")||n.isActive("image"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,ge.jsx)(qe.BubbleMenu,A(c({},s),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:i.filter(n=>{var a;return(a=n.shouldShow)==null?void 0:a.call(n)}).map((n,a)=>(0,ge.jsx)(E,c({},n),a))}))}var $e=require("@tiptap/react");var Q=require("@tiptap/core"),he=["sm","md","lg","xl"],jt="sm";function Yt(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[jt]}`}var We=Q.Node.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!he.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=Yt(o),["div",(0,Q.mergeAttributes)({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer relative z-50",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});var we=require("react/jsx-runtime");function Ke(t){let{editor:e}=t,o=he.map(l=>({name:l,isActive:()=>e==null?void 0:e.isActive("spacer",{height:l}),command:()=>{e==null||e.chain().focus().setSpacer({height:l}).run()}})),r=A(c({},t),{shouldShow:({editor:l})=>l.isActive("spacer"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,we.jsx)($e.BubbleMenu,A(c({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((l,i)=>(0,we.jsx)(E,c({},l),i))}))}var Pt=x(require("@tiptap/starter-kit")),Nt=require("@tiptap/extension-color"),Rt=x(require("@tiptap/extension-link")),St=x(require("@tiptap/extension-list-item")),Bt=x(require("@tiptap/extension-paragraph")),zt=x(require("@tiptap/extension-placeholder")),It=x(require("@tiptap/extension-text-align")),ke=x(require("@tiptap/extension-text-style")),Et=x(require("@tiptap/extension-heading")),Ht=x(require("@tiptap/extension-underline"));var Ge=require("@tiptap/core"),Xe=require("@tiptap/extension-horizontal-rule"),Je=Xe.HorizontalRule.extend({addInputRules(){return[new Ge.InputRule({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,l=e.from,i=e.to;r.insert(l-1,this.type.create(o)).delete(r.mapping.map(l),r.mapping.map(i))}})]}});var ee=require("@tiptap/core"),nt=require("@tiptap/react");var et=require("@tiptap/react"),q=require("lucide-react");var je=require("react"),Z=require("react-colorful"),$=require("react/jsx-runtime");function fe(t){let{color:e,onChange:o}=t,[r,l]=(0,je.useState)(e),i=s=>{l(s),o==null||o(s)};return(0,$.jsxs)("div",{className:"mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4",children:[(0,$.jsx)(Z.HexAlphaColorPicker,{color:r,onChange:i,className:"mly-flex !mly-w-full mly-flex-col mly-gap-4"}),(0,$.jsx)(Z.HexColorInput,{alpha:!0,color:r,onChange:i,className:"mly-mt-4 mly-w-full mly-min-w-0 mly-rounded-lg mly-border mly-px-2 mly-py-1.5 mly-text-sm mly-uppercase focus-visible:mly-border-gray-400 focus-visible:mly-outline-none",prefixed:!0})]})}var Ye=x(require("react"));var Qe=require("react/jsx-runtime"),V=Ye.forwardRef((l,r)=>{var i=l,{className:t,type:e}=i,o=L(i,["className","type"]);return(0,Qe.jsx)("input",c({type:e,className:f("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",t),ref:r},o))});V.displayName="Input";var Ze=x(require("react")),S=x(require("@radix-ui/react-popover"));var be=require("react/jsx-runtime"),D=S.Root,_=S.Trigger,O=Ze.forwardRef((i,l)=>{var s=i,{className:t,align:e="center",sideOffset:o=4}=s,r=L(s,["className","align","sideOffset"]);return(0,be.jsx)(S.Portal,{children:(0,be.jsx)(S.Content,c({ref:l,align:e,sideOffset:o,className:f("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-text-gray-950 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2","mly-editor",t)},r))})});O.displayName=S.Content.displayName;var d=require("react/jsx-runtime"),Qt={left:q.AlignLeftIcon,center:q.AlignCenterIcon,right:q.AlignRightIcon},xe={style(t){return ot.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return rt.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(Qt).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function tt(t){let{url:e,text:o,alignment:r,variant:l,borderRadius:i,buttonColor:s,textColor:n}=t.node.attrs,{getPos:a,editor:u}=t;return(0,d.jsx)(et.NodeViewWrapper,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:(0,d.jsxs)(D,{open:t.selected,children:[(0,d.jsx)(_,{asChild:!0,children:(0,d.jsx)("div",{children:(0,d.jsx)("button",{className:f("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":i==="round","!mly-rounded-md":i==="smooth","!mly-rounded-none":i==="sharp"}),tabIndex:-1,style:{backgroundColor:l==="filled"?s:"transparent",color:n,borderWidth:2,borderStyle:"solid",borderColor:s},onClick:m=>{m.preventDefault();let p=a();u.commands.setNodeSelection(p)},children:o})})}),(0,d.jsxs)(O,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),children:[(0,d.jsx)(V,{placeholder:"Add text here",value:o,onChange:m=>{t.updateAttributes({text:m.target.value})}}),(0,d.jsx)(V,{placeholder:"Add link here",value:e,onChange:m=>{t.updateAttributes({url:m.target.value})}}),(0,d.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,d.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),(0,d.jsx)("div",{className:"mly-flex mly-gap-1",children:xe.style(t).map((m,p)=>(0,d.jsx)(R,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},p))})]}),(0,d.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,d.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),(0,d.jsx)("div",{className:"mly-flex mly-gap-1",children:xe.cornerRadius(t).map((m,p)=>(0,d.jsx)(R,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},p))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),(0,d.jsx)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:xe.alignment(t).map((m,p)=>(0,d.jsx)(R,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:m.onClick,type:"button",children:(0,d.jsx)(m.icon,{size:16})},p))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),(0,d.jsxs)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[(0,d.jsx)(Zt,{variant:l,color:s,onChange:m=>{t.updateAttributes({buttonColor:m})}}),(0,d.jsx)(eo,{color:n,onChange:m=>{t.updateAttributes({textColor:m})}})]})]})]})]})]})})}function Zt(t){let{color:e,onChange:o,variant:r}=t;return(0,d.jsxs)(D,{children:[(0,d.jsx)(_,{asChild:!0,children:(0,d.jsx)(R,{variant:"ghost",className:"",size:"sm",type:"button",children:(0,d.jsx)("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),(0,d.jsx)(O,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:(0,d.jsx)(fe,{color:e,onChange:l=>{queueMicrotask(()=>{o(l)})}})})]})}function eo(t){let{color:e,onChange:o}=t;return(0,d.jsxs)(D,{children:[(0,d.jsx)(_,{asChild:!0,children:(0,d.jsx)(R,{variant:"ghost",size:"sm",type:"button",children:(0,d.jsxs)("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[(0,d.jsx)("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),(0,d.jsx)("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),(0,d.jsx)(O,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:(0,d.jsx)(fe,{color:e,onChange:r=>{queueMicrotask(()=>{o(r)})}})})]})}var ot=["filled","outline"],rt=["sharp","smooth","round"],lt=ee.Node.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",(0,ee.mergeAttributes)({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return(0,nt.ReactNodeViewRenderer)(tt)}});var te=require("@tiptap/core"),ve=te.Node.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",(0,te.mergeAttributes)(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});var B=require("react"),re=require("@tiptap/react"),dt=x(require("tippy.js")),ct=require("lucide-react");var oe=require("react");var mt=require("react/jsx-runtime"),at=(0,oe.createContext)({variables:[],slashCommands:[]});function it(t){let r=t,{children:e}=r,o=L(r,["children"]);return(0,mt.jsx)(at.Provider,{value:o,children:e})}function st(){let t=(0,oe.useContext)(at);if(!t)throw new Error("Missing MailyContext.Provider in the component tree");return t}var k=require("react/jsx-runtime"),pt=(0,B.forwardRef)((t,e)=>{var i,s;let[o,r]=(0,B.useState)(0),l=n=>{let a=t.items[n];a&&t.command({id:a})};return(0,B.useEffect)(()=>r(0),[t.items]),(0,B.useImperativeHandle)(e,()=>({onKeyDown:({event:n})=>n.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):n.key==="ArrowDown"?(r((o+1)%t.items.length),!0):n.key==="Enter"?(l(o),!0):!1})),(0,k.jsx)("div",{className:"mly-z-50 mly-h-auto mly-min-w-[128px] mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-1 mly-shadow-md mly-transition-all",children:(i=t==null?void 0:t.items)!=null&&i.length?(s=t==null?void 0:t.items)==null?void 0:s.map((n,a)=>(0,k.jsx)("button",{onClick:()=>l(a),className:f("mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",a===o?"mly-bg-gray-200":"mly-bg-white"),children:n},a)):(0,k.jsx)("button",{className:"mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-bg-white mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});pt.displayName="VariableList";function yt(t=[]){let e=t.map(o=>o.name);return{items:({query:o})=>e.concat(o.length>0?[o]:[]).filter(r=>r.toLowerCase().startsWith(o.toLowerCase())).slice(0,5),render:()=>{let o,r=null;return{onStart:l=>{o=new re.ReactRenderer(pt,{props:l,editor:l.editor}),l.clientRect&&(r=(0,dt.default)("body",{getReferenceClientRect:l.clientRect,appendTo:()=>document.body,content:o.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(l){var i;o.updateProps(l),l.clientRect&&((i=r==null?void 0:r[0])==null||i.setProps({getReferenceClientRect:l.clientRect}))},onKeyDown(l){var i;return l.event.key==="Escape"?(r==null||r[0].hide(),!0):(i=o.ref)==null?void 0:i.onKeyDown(l)},onExit(){!r||!(r!=null&&r[0])||!o||(r==null||r[0].destroy(),o.destroy())}}}}}function ut(t){var m,p;let{node:e,selected:o,updateAttributes:r}=t,{id:l,fallback:i}=e.attrs,{variables:s=[]}=st(),n=(p=(m=s.find(h=>h.name===l))==null?void 0:m.required)!=null?p:!0,[a,u]=(0,B.useState)(!1);return(0,k.jsx)(re.NodeViewWrapper,{className:f("react-component",o&&"ProseMirror-selectednode","mly-inline-block mly-leading-none"),draggable:"false",children:(0,k.jsxs)(D,{open:a,onOpenChange:u,children:[(0,k.jsx)(_,{children:(0,k.jsxs)("span",{tabIndex:-1,className:"mly-inline-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-border-rose-200 mly-bg-rose-50 mly-px-2 mly-py-1 mly-leading-none mly-text-rose-800",children:[l,n&&!i&&(0,k.jsx)(ct.AlertTriangle,{className:"mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]"})]})}),(0,k.jsxs)(O,{align:"start",className:"mly-space-y-2",onOpenAutoFocus:h=>h.preventDefault(),onCloseAutoFocus:h=>h.preventDefault(),children:[(0,k.jsxs)("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[(0,k.jsx)("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Variable Name"}),(0,k.jsx)(V,{placeholder:"Add Variable Name",value:l,onChange:h=>{r({id:h.target.value})}})]}),(0,k.jsxs)("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[(0,k.jsx)("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Fallback Value"}),(0,k.jsx)(V,{placeholder:"Fallback Value",value:i||"",onChange:h=>{r({fallback:h.target.value})}}),(0,k.jsx)("p",{className:"mly-text-xs mly-text-gray-500",children:"If the variable doesn't exist, this fallback value will be used."})]})]})]})})}var M=require("react"),gt=require("@tiptap/core"),ht=require("@tiptap/react"),wt=x(require("@tiptap/suggestion")),g=require("lucide-react"),ft=x(require("tippy.js"));var y=require("react/jsx-runtime"),bt=gt.Extension.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[(0,wt.default)(c({editor:this.editor},this.options.suggestion))]}}),to=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:(0,y.jsx)(g.Text,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:(0,y.jsx)(g.Heading1,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:(0,y.jsx)(g.Heading2,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:(0,y.jsx)(g.Heading3,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:(0,y.jsx)(g.List,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:(0,y.jsx)(g.ListOrdered,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:(0,y.jsx)(g.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Image URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setImage({src:o}).run())}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:(0,y.jsx)(g.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Logo URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setLogoImage({src:o}).run())}},{title:"Spacer",description:"Add a spacer to the page. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:(0,y.jsx)(g.MoveVertical,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to the page.",searchTerms:["link","button","cta"],icon:(0,y.jsx)(g.MousePointer,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setButton().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:(0,y.jsx)(g.DivideIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHardBreak().run()}},{title:"Blockquote",description:"Add blockquote.",searchTerms:["quote","blockquote"],icon:(0,y.jsx)(g.TextQuote,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBlockquote().run()}},{title:"Footer",description:"Add a footer text to the page.",searchTerms:["footer","text"],icon:(0,y.jsx)(g.FootprintsIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:(0,y.jsx)(g.EraserIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().selectParentNode().deleteSelection().run()}}],oo=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,l=e.offsetTop,i=l+r;l<t.scrollTop?t.scrollTop-=t.scrollTop-l+5:i>o+t.scrollTop&&(t.scrollTop+=i-o-t.scrollTop+5)},ro=({items:t,command:e,editor:o})=>{let[r,l]=(0,M.useState)(0),i=(0,M.useCallback)(n=>{let a=t[n];a&&e(a)},[e,o,t]);(0,M.useEffect)(()=>{let n=["ArrowUp","ArrowDown","Enter"],a=u=>{if(n.includes(u.key))return u.preventDefault(),u.key==="ArrowUp"?(l((r+t.length-1)%t.length),!0):u.key==="ArrowDown"?(l((r+1)%t.length),!0):u.key==="Enter"?(i(r),!0):!1};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[t,r,l,i]),(0,M.useEffect)(()=>{l(0)},[t]);let s=(0,M.useRef)(null);return(0,M.useLayoutEffect)(()=>{let n=s==null?void 0:s.current,a=n==null?void 0:n.children[r];a&&n&&oo(n,a)},[r]),t.length>0?(0,y.jsxs)("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[(0,y.jsx)("div",{id:"slash-command",ref:s,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((n,a)=>(0,y.jsxs)("button",{className:f("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",a===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>i(a),type:"button",children:[(0,y.jsx)("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:n.icon}),(0,y.jsxs)("div",{children:[(0,y.jsx)("p",{className:"mly-font-medium",children:n.title}),(0,y.jsx)("p",{className:"mly-text-xs mly-text-gray-400",children:n.description})]})]},a))}),(0,y.jsx)("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:(0,y.jsxs)("div",{className:"mly-flex mly-items-center",children:[(0,y.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,y.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),(0,y.jsx)("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),(0,y.jsx)("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),(0,y.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,y.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null};function xt(t=[]){return{items:({query:e})=>[...to,...t].filter(o=>{if(typeof e=="string"&&e.length>0){let r=e.toLowerCase();return o.title.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)||o.searchTerms&&o.searchTerms.some(l=>l.includes(r))}return!0}),render:()=>{let e,o=null;return{onStart:r=>{e=new ht.ReactRenderer(ro,{props:r,editor:r.editor}),o=(0,ft.default)("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:r=>{e==null||e.updateProps(r),o&&o[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var l;return r.event.key==="Escape"?(o==null||o[0].hide(),!0):(l=e==null?void 0:e.ref)==null?void 0:l.onKeyDown(r)},onExit:()=>{!o||!(o!=null&&o[0])||!e||(o==null||o[0].destroy(),e==null||e.destroy())}}}}}var ne=require("@tiptap/core"),vt=require("@tiptap/pm/state"),kt=require("@tiptap/react"),At=x(require("@tiptap/suggestion"));var no=new vt.PluginKey("variable"),Ct=ne.Node.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},renderLabel({options:t,node:e}){var o;return`${(o=e.attrs.label)!=null?o:e.attrs.id}`},suggestion:{char:"@",pluginKey:no,command:({editor:t,range:e,props:o})=>{var i,s;let r=t.view.state.selection.$to.nodeAfter;((i=r==null?void 0:r.text)==null?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:o},{type:"text",text:" "}]).run(),(s=window.getSelection())==null||s.collapseToEnd()},allow:({state:t,range:e})=>{let o=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!o.parent.type.contentMatch.matchType(r)}}}},addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},fallback:{default:null,parseHTML:t=>t.getAttribute("data-fallback"),renderHTML:t=>t.fallback?{"data-fallback":t.fallback}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",(0,ne.mergeAttributes)({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})]},renderText({node:t}){return this.options.renderLabel({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let o=!1,{selection:r}=e,{empty:l,anchor:i}=r;return l?(e.doc.nodesBetween(i-1,i,(s,n)=>{if(s.type.name===this.name)return o=!0,t.insertText(this.options.suggestion.char||"",n,n+s.nodeSize),!1}),o):!1})}},addProseMirrorPlugins(){return[(0,At.default)(c({editor:this.editor},this.options.suggestion))]},addNodeView(){return(0,kt.ReactNodeViewRenderer)(ut)}});var le=require("@tiptap/react"),ae=require("react"),Tt=x(require("@tiptap/extension-image"));var F=require("react"),Mt=t=>{let e=(0,F.useRef)(null);return(0,F.useLayoutEffect)(()=>{e.current=t},[t]),(0,F.useCallback)((...o)=>{if(e.current===null)throw new Error("Handler is not assigned");return e.current(...o)},[])};var z=require("react/jsx-runtime"),lo=60;function ao(t){let{node:e,updateAttributes:o,selected:r}=t,l=(0,ae.useRef)(null),[i,s]=(0,ae.useState)(),n=Mt(w=>{let N=document.querySelector(".ProseMirror-selectednode");if(!l.current||!N||!r)return;let K=N.offsetWidth;w.preventDefault();let Ae=w.currentTarget.dataset.direction||"--",Ot=w.clientX,se=l.current.width,Ce=l.current.height,U=se,me=Ce,Ut=Ae[1]==="w"?-1:1,de=()=>{window.removeEventListener("mousemove",Me),window.removeEventListener("mouseup",de),o({width:U,height:me}),s(void 0)},Me=Te=>{if(U=Math.max(se+Ut*(Te.clientX-Ot),lo),U>K&&(U=K),me=U/se*Ce,s({width:U,height:me}),!Te.buttons)return de()};window.addEventListener("mousemove",Me),window.addEventListener("mouseup",de)});function a(w){return(0,z.jsx)("div",{role:"button",tabIndex:0,onMouseDown:n,"data-direction":w,className:"mly-bg-rose-500",style:A(c(c({position:"absolute",height:"10px",width:"10px"},{n:{top:0},s:{bottom:0}}[w[0]]),{w:{left:0},e:{right:0}}[w[1]]),{cursor:`${w}-resize`})})}let{alignment:u="center",width:m,height:p}=e.attrs||{},T=e.attrs||{},{externalLink:h}=T,I=L(T,["externalLink"]);return(0,z.jsxs)(le.NodeViewWrapper,{as:"div",draggable:!0,"data-drag-handle":!0,style:c(A(c({width:m,height:p},i),{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block"}),{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[u]||{}),children:[(0,z.jsx)("img",A(c({},I),{ref:l,style:A(c({},i),{cursor:"default",marginBottom:0})})),r&&(0,z.jsxs)(z.Fragment,{children:[[{left:0,top:0,height:"100%",width:"1px"},{right:0,top:0,height:"100%",width:"1px"},{top:0,left:0,width:"100%",height:"1px"},{bottom:0,left:0,width:"100%",height:"1px"}].map((w,N)=>(0,z.jsx)("div",{className:"mly-bg-rose-500",style:c({position:"absolute"},w)},N)),a("nw"),a("ne"),a("sw"),a("se")]})]})}var Lt=Tt.default.extend({addAttributes(){var t;return A(c({},(t=this.parent)==null?void 0:t.call(this)),{width:{renderHTML:({width:e})=>({width:e})},height:{renderHTML:({height:e})=>({height:e})},alignment:{default:"center",renderHTML:({alignment:e})=>({"data-alignment":e}),parseHTML:e=>e.getAttribute("data-alignment")||"center"},externalLink:{default:null,renderHTML:({externalLink:e})=>e?{"data-external-link":e}:{},parseHTML:e=>{let o=e.getAttribute("data-external-link");return o?{externalLink:o}:null}}})},addNodeView(){return(0,le.ReactNodeViewRenderer)(ao)}});function Vt(t){let{variables:e,slashCommands:o}=t;return[Pt.default.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},code:{HTMLAttributes:{class:"mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"}},horizontalRule:!1,blockquote:{HTMLAttributes:{class:"mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"}}}),Ht.default,Ie,Nt.Color.configure({types:[ke.default.name,St.default.name]}),ke.default.configure(),It.default.configure({types:[Bt.default.name,Et.default.name,ve.name]}),Je,zt.default.configure({placeholder:({node:r})=>r.type.name==="heading"?`Heading ${r.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),We,ve,Ct.configure({suggestion:yt(e)}),bt.configure({suggestion:xt(o)}),Rt.default.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),lt,Lt]}var P=require("react/jsx-runtime");function io(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:l=!0,spellCheck:i=!1,autofocus:s="end"}={},onCreate:n,onUpdate:a,extensions:u,contentHtml:m,contentJson:p,variables:h,slashCommands:I}=t,T=null;p?T=(p==null?void 0:p.type)==="doc"?p:{type:"doc",content:p}:m?T=m:T={type:"doc",content:[{type:"paragraph",content:[]}]};let w=(0,ie.useEditor)({editorProps:{attributes:{class:f("mly-prose mly-w-full",o),spellCheck:i?"true":"false"},handleDOMEvents:{keydown:(N,K)=>{if(["ArrowUp","ArrowDown","Enter"].includes(K.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:N})=>{n==null||n(N)},onUpdate:({editor:N})=>{a==null||a(N)},extensions:[...Vt({variables:h,slashCommands:I}),...u||[]],content:T,autofocus:s});return w?(0,P.jsx)(it,{variables:h,children:(0,P.jsxs)("div",{className:f("mly-editor mly-antialiased",e),children:[l&&(0,P.jsx)(_e,{config:t.config,editor:w}),(0,P.jsxs)("div",{className:f("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[(0,P.jsx)(De,{editor:w}),(0,P.jsx)(Fe,{editor:w}),(0,P.jsx)(Ke,{editor:w}),(0,P.jsx)(ie.EditorContent,{editor:w})]})]})}):null}0&&(module.exports={Editor});
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var
|
|
3
|
-
`);
|
|
4
|
-
`);L('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-left:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-z-50{z-index:50}.mly-mb-4{margin-bottom:1rem}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-inline-block{display:inline-block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-max-h-\\[330px\\]{max-height:330px}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-full{width:100%}.mly-min-w-\\[128px\\]{min-width:128px}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-3{gap:.75rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.mly-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-md{border-radius:.375rem}.mly-rounded-none{border-radius:0}.mly-border{border-width:1px}.mly-border-0{border-width:0px}.mly-border-l-4{border-left-width:4px}.mly-border-t{border-top-width:1px}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.mly-border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.mly-bg-\\[\\#efefef\\]{--tw-bg-opacity: 1;background-color:rgb(239 239 239 / var(--tw-bg-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity))}.mly-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.mly-stroke-\\[2\\.5\\]{stroke-width:2.5}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-0{padding-top:0;padding-bottom:0}.mly-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-capitalize{text-transform:capitalize}.mly-leading-none{line-height:1}.mly-tracking-normal{letter-spacing:0em}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');import{EditorContent as Qo,useEditor as Zo}from"@tiptap/react";import{BubbleMenu as Ze,isTextSelection as et}from"@tiptap/react";import{AlignCenterIcon as tt,AlignLeftIcon as ot,AlignRightIcon as rt,BoldIcon as nt,CodeIcon as lt,ItalicIcon as at,LinkIcon as it,StrikethroughIcon as st,UnderlineIcon as mt}from"lucide-react";import{mergeAttributes as Ke}from"@tiptap/core";import _e from"@tiptap/extension-image";var te=["sm","md","lg"],U=["left","center","right"],oe="left",W="sm";function Ge(t){let e={sm:"40px",md:"48px",lg:"64px"};return[`height:${e[t]||e[W]}`,`width:${e[t]||e[W]}`]}function Xe(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[oe]}var re=_e.extend({name:"logo",priority:1e3,addAttributes(){var t;return w(m({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:W,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:oe,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,a=["position:relative","margin-top:0",...Ge(o),...Xe(r)];return t.style=a.join(";"),["img",Ke(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});import*as ne from"react";import{Slot as Ye}from"@radix-ui/react-slot";import{clsx as Je}from"clsx";import{twMerge as je}from"tailwind-merge";function h(...t){return je(Je(t))}import{jsx as Qe}from"react/jsx-runtime";var A=ne.forwardRef((s,i)=>{var n=s,{className:t,variant:e="default",size:o="default",asChild:r=!1}=n,a=M(n,["className","variant","size","asChild"]);let l=r?Ye:"button",d="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",u={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},y={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},c=h("mly-editor",d,u[e],y[o],t);return Qe(l,m({className:c,ref:i},a))});A.displayName="BaseButton";import{jsx as $}from"react/jsx-runtime";function T(t){return $(A,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:h("mly-px-2.5"),type:"button",children:t.icon?$(t.icon,{className:h("mly-h-3.5 mly-w-3.5")}):$("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}import{jsx as le}from"react/jsx-runtime";function ae(t){let{editor:e}=t,o=[ot,tt,rt],r=U.map((s,n)=>({name:s,isActive:()=>e==null?void 0:e.isActive({textAlign:s}),command:()=>{var l,d,u,y;(l=t==null?void 0:t.editor)!=null&&l.isActive({textAlign:s})?(u=(d=t==null?void 0:t.editor)==null?void 0:d.chain())==null||u.focus().unsetTextAlign().run():(y=t==null?void 0:t.editor)==null||y.chain().focus().setTextAlign(s).run()},icon:o[n]})),a=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:nt},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:at},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:mt},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:st},...r,{name:"code",isActive:()=>e==null?void 0:e.isActive("code"),command:()=>e==null?void 0:e.chain().focus().toggleCode().run(),icon:lt},{name:"link",command:()=>{let s=e==null?void 0:e.getAttributes("link").href,n=window.prompt("URL",s);if(n!==null){if(n===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:n}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:it}],i=w(m({},t),{shouldShow:({editor:s,state:n,from:l,to:d})=>{let{doc:u,selection:y}=n,{empty:c}=y,f=!u.textBetween(l,d).length&&et(n.selection);return!(c||f||!s.isEditable||s.isActive("image")||s.isActive("logo")||s.isActive("spacer")||s.isActive("variable")||s.isActive({mailyComponent:"button"}))},tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return le(Ze,w(m({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:a.map((s,n)=>le(T,m({},s),n))}))}import{useMemo as ie}from"react";import{AlignCenter as dt,AlignLeft as ct,AlignRight as pt,BoldIcon as yt,EraserIcon as ut,ItalicIcon as gt,LinkIcon as ht,SeparatorHorizontal as wt,StrikethroughIcon as ft,UnderlineIcon as bt}from"lucide-react";import{jsx as K}from"react/jsx-runtime";var se=t=>{let{editor:e,config:o}=t,r=ie(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:yt},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:gt},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:bt},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:ft},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:ut},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:wt},{name:"link",command:()=>{let i=e.getAttributes("link").href,s=window.prompt("URL",i);if(s!==null){if(s===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:s}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:ht},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:ct},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:dt},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:pt}],[e]),a=ie(()=>r.reduce((i,s)=>(i.includes(s.group)||i.push(s.group),i),[]),[r]);return e?K("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:a.map((i,s)=>K("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(n=>n.group===i).map((n,l)=>K(T,m({},n),l))},s))}):null};import{BubbleMenu as xt}from"@tiptap/react";import{AlignCenterIcon as vt,AlignLeftIcon as kt,AlignRightIcon as At,Link as Ct,Unlink as Mt}from"lucide-react";import{jsx as me}from"react/jsx-runtime";function de(t){let{editor:e}=t,o=[kt,vt,At],r=U.map((n,l)=>({name:n,isActive:()=>(e==null?void 0:e.isActive("logo",{alignment:n}))||(e==null?void 0:e.isActive("image",{alignment:n})),shouldShow:()=>(e==null?void 0:e.isActive("logo"))||(e==null?void 0:e.isActive("image")),command:()=>{var u,y;(e==null?void 0:e.isActive("logo"))?(u=t==null?void 0:t.editor)==null||u.chain().focus().setLogoAttributes({alignment:n}).run():(y=t==null?void 0:t.editor)==null||y.chain().focus().updateAttributes("image",{alignment:n}).run()},icon:o[l]})),a=te.map(n=>({name:n,isActive:()=>{var l;return(l=t==null?void 0:t.editor)==null?void 0:l.isActive("logo",{size:n})},shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var l;(l=t==null?void 0:t.editor)==null||l.chain().focus().setLogoAttributes({size:n}).run()}})),i=[...r,{name:"url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var f,k,b;let{editor:n}=t,l=(f=n==null?void 0:n.getAttributes("logo"))==null?void 0:f.src,d=window.prompt("Update logo URL",l);if(!d)return;let u=(k=n==null?void 0:n.getAttributes("logo"))==null?void 0:k.size,y=(b=n==null?void 0:n.getAttributes("logo"))==null?void 0:b.alignment,c=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:d,size:u,alignment:y}),n==null||n.commands.setNodeSelection((c==null?void 0:c.from)||0)},icon:Ct},{name:"image-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var y;let{editor:n}=t,l=(y=n==null?void 0:n.getAttributes("image"))==null?void 0:y.src,d=window.prompt("Update Image URL",l);if(!d)return;let u=n==null?void 0:n.state.selection;n==null||n.commands.setImage({src:d}),n==null||n.commands.setNodeSelection((u==null?void 0:u.from)||0)},icon:Mt},...a],s=w(m({},t),{shouldShow:({editor:n})=>n.isActive("logo")||n.isActive("image"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return me(xt,w(m({},s),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:i.filter(n=>{var l;return(l=n.shouldShow)==null?void 0:l.call(n)}).map((n,l)=>me(T,m({},n),l))}))}import{BubbleMenu as Rt}from"@tiptap/react";import{mergeAttributes as Tt,Node as Lt}from"@tiptap/core";var _=["sm","md","lg","xl"],Pt="sm";function Nt(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[Pt]}`}var ce=Lt.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!_.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=Nt(o),["div",Tt({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer relative z-50",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});import{jsx as pe}from"react/jsx-runtime";function ye(t){let{editor:e}=t,o=_.map(a=>({name:a,isActive:()=>e==null?void 0:e.isActive("spacer",{height:a}),command:()=>{e==null||e.chain().focus().setSpacer({height:a}).run()}})),r=w(m({},t),{shouldShow:({editor:a})=>a.isActive("spacer"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return pe(Rt,w(m({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((a,i)=>pe(T,m({},a),i))}))}import Wo from"@tiptap/starter-kit";import{Color as $o}from"@tiptap/extension-color";import Ko from"@tiptap/extension-link";import _o from"@tiptap/extension-list-item";import Go from"@tiptap/extension-paragraph";import Xo from"@tiptap/extension-placeholder";import Jo from"@tiptap/extension-text-align";import Oe from"@tiptap/extension-text-style";import jo from"@tiptap/extension-heading";import Yo from"@tiptap/extension-underline";import{InputRule as St}from"@tiptap/core";import{HorizontalRule as Bt}from"@tiptap/extension-horizontal-rule";var ue=Bt.extend({addInputRules(){return[new St({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,a=e.from,i=e.to;r.insert(a-1,this.type.create(o)).delete(r.mapping.map(a),r.mapping.map(i))}})]}});import{mergeAttributes as qt,Node as Ft}from"@tiptap/core";import{ReactNodeViewRenderer as Wt}from"@tiptap/react";import{NodeViewWrapper as It}from"@tiptap/react";import{AlignCenterIcon as Et,AlignLeftIcon as Ht,AlignRightIcon as Vt}from"lucide-react";import{HexAlphaColorPicker as fe}from"react-colorful";import*as ge from"react";import{jsx as zt}from"react/jsx-runtime";var P=ge.forwardRef((a,r)=>{var i=a,{className:t,type:e}=i,o=M(i,["className","type"]);return zt("input",m({type:e,className:h("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",t),ref:r},o))});P.displayName="Input";import*as we from"react";import*as C from"@radix-ui/react-popover";import{jsx as he}from"react/jsx-runtime";var B=C.Root,z=C.Trigger,N=we.forwardRef((i,a)=>{var s=i,{className:t,align:e="center",sideOffset:o=4}=s,r=M(s,["className","align","sideOffset"]);return he(C.Portal,{children:he(C.Content,m({ref:a,align:e,sideOffset:o,className:h("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2 text-gray-950","mly-editor",t)},r))})});N.displayName=C.Content.displayName;import{jsx as p,jsxs as x}from"react/jsx-runtime";var Ot={left:Ht,center:Et,right:Vt},G={style(t){return xe.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return ve.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(Ot).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function be(t){let{url:e,text:o,alignment:r,variant:a,borderRadius:i,buttonColor:s,textColor:n}=t.node.attrs;return p(It,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:x(B,{open:t.selected,children:[p(z,{asChild:!0,children:p("div",{children:p("a",{className:h("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":i==="round","!mly-rounded-md":i==="smooth","!mly-rounded-none":i==="sharp"}),href:e,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,style:{backgroundColor:a==="filled"?s:"transparent",color:n,borderWidth:2,borderStyle:"solid",borderColor:s},children:o})})}),x(N,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:l=>l.preventDefault(),onCloseAutoFocus:l=>l.preventDefault(),children:[p(P,{placeholder:"Add text here",value:o,onChange:l=>{t.updateAttributes({text:l.target.value})}}),p(P,{placeholder:"Add link here",value:e,onChange:l=>{t.updateAttributes({url:l.target.value})}}),x("div",{className:"mly-w-full mly-space-y-2",children:[p("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),p("div",{className:"mly-flex mly-gap-1",children:G.style(t).map((l,d)=>p(A,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,type:"button",children:l.name},d))})]}),x("div",{className:"mly-w-full mly-space-y-2",children:[p("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),p("div",{className:"mly-flex mly-gap-1",children:G.cornerRadius(t).map((l,d)=>p(A,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,type:"button",children:l.name},d))})]}),x("div",{className:"flex gap-2",children:[x("div",{children:[p("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),p("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:G.alignment(t).map((l,d)=>p(A,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:l.onClick,type:"button",children:p(l.icon,{size:16})},d))})]}),x("div",{children:[p("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),x("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[p(Ut,{variant:a,color:s,onChange:l=>{t.updateAttributes({buttonColor:l})}}),p(Dt,{color:n,onChange:l=>{t.updateAttributes({textColor:l})}})]})]})]})]})]})})}function Ut(t){let{color:e,onChange:o,variant:r}=t;return x(B,{children:[p(z,{asChild:!0,children:p(A,{variant:"ghost",className:"",size:"sm",type:"button",children:p("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),p(N,{className:"mly-w-full !mly-p-0 mly-rounded-none mly-bg-transparent mly-border-0",children:p(fe,{color:e,onChange:a=>{queueMicrotask(()=>{o(a)})}})})]})}function Dt(t){let{color:e,onChange:o}=t;return x(B,{children:[p(z,{asChild:!0,children:p(A,{variant:"ghost",size:"sm",type:"button",children:x("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[p("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),p("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),p(N,{className:"mly-w-full !mly-p-0 mly-rounded-none mly-bg-transparent mly-border-0",children:p(fe,{color:e,onChange:r=>{queueMicrotask(()=>{o(r)})}})})]})}var xe=["filled","outline"],ve=["sharp","smooth","round"],ke=Ft.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",qt({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return Wt(be)}});import{mergeAttributes as $t,Node as Kt}from"@tiptap/core";var X=Kt.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",$t(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});import{forwardRef as Jt,useEffect as jt,useImperativeHandle as Yt,useState as Te}from"react";import{NodeViewWrapper as Qt,ReactRenderer as Zt}from"@tiptap/react";import eo from"tippy.js";import{AlertTriangle as to}from"lucide-react";import{createContext as _t,useContext as Gt}from"react";import{jsx as Xt}from"react/jsx-runtime";var Ae=_t({variables:[],slashCommands:[]});function Ce(t){let r=t,{children:e}=r,o=M(r,["children"]);return Xt(Ae.Provider,{value:o,children:e})}function Me(){let t=Gt(Ae);if(!t)throw new Error("Missing MailyContext.Provider in the component tree");return t}import{jsx as v,jsxs as V}from"react/jsx-runtime";var Le=Jt((t,e)=>{var i,s;let[o,r]=Te(0),a=n=>{let l=t.items[n];l&&t.command({id:l})};return jt(()=>r(0),[t.items]),Yt(e,()=>({onKeyDown:({event:n})=>n.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):n.key==="ArrowDown"?(r((o+1)%t.items.length),!0):n.key==="Enter"?(a(o),!0):!1})),v("div",{className:"mly-z-50 mly-h-auto mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-1 mly-shadow-md mly-transition-all mly-min-w-[128px]",children:(i=t==null?void 0:t.items)!=null&&i.length?(s=t==null?void 0:t.items)==null?void 0:s.map((n,l)=>v("button",{onClick:()=>a(l),className:h("mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",l===o?"mly-bg-gray-200":"mly-bg-white"),children:n},l)):v("button",{className:"mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 mly-bg-white",children:"No result"})})});Le.displayName="VariableList";function Pe(t=[]){let e=t.map(o=>o.name);return{items:({query:o})=>e.concat(o.length>0?[o]:[]).filter(r=>r.toLowerCase().startsWith(o.toLowerCase())).slice(0,5),render:()=>{let o,r=null;return{onStart:a=>{o=new Zt(Le,{props:a,editor:a.editor}),a.clientRect&&(r=eo("body",{getReferenceClientRect:a.clientRect,appendTo:()=>document.body,content:o.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(a){var i;o.updateProps(a),a.clientRect&&((i=r==null?void 0:r[0])==null||i.setProps({getReferenceClientRect:a.clientRect}))},onKeyDown(a){var i;return a.event.key==="Escape"?(r==null||r[0].hide(),!0):(i=o.ref)==null?void 0:i.onKeyDown(a)},onExit(){!r||!(r!=null&&r[0])||!o||(r==null||r[0].destroy(),o.destroy())}}}}}function Ne(t){var u,y;let{node:e,selected:o,updateAttributes:r}=t,{id:a,fallback:i}=e.attrs,{variables:s=[]}=Me(),n=(y=(u=s.find(c=>c.name===a))==null?void 0:u.required)!=null?y:!0,[l,d]=Te(!1);return v(Qt,{className:h("react-component",o&&"ProseMirror-selectednode","mly-leading-none mly-inline-block"),draggable:"false",children:V(B,{open:l,onOpenChange:d,children:[v(z,{children:V("span",{tabIndex:-1,className:"mly-py-1 mly-px-2 mly-bg-rose-50 mly-border mly-border-rose-200 mly-text-rose-800 mly-rounded-md mly-leading-none mly-inline-flex mly-items-center mly-gap-1",children:[a,n&&!i&&v(to,{className:"mly-w-3 mly-shrink-0 mly-h-3 mly-stroke-[2.5]"})]})}),V(N,{align:"start",className:"mly-space-y-2",onOpenAutoFocus:c=>c.preventDefault(),onCloseAutoFocus:c=>c.preventDefault(),children:[V("label",{className:"mly-block mly-w-full mly-leading-none mly-space-y-1.5",children:[v("span",{className:"mly-leading-none mly-text-xs mly-font-normal",children:"Variable Name"}),v(P,{placeholder:"Add Variable Name",value:a,onChange:c=>{r({id:c.target.value})}})]}),V("label",{className:"mly-block mly-w-full mly-leading-none mly-space-y-1.5",children:[v("span",{className:"mly-leading-none mly-text-xs mly-font-normal",children:"Fallback Value"}),v(P,{placeholder:"Fallback Value",value:i||"",onChange:c=>{r({fallback:c.target.value})}}),v("p",{className:"mly-text-xs mly-text-gray-500",children:"If the variable doesn't exist, this fallback value will be used."})]})]})]})})}import{useCallback as oo,useEffect as Re,useLayoutEffect as ro,useRef as no,useState as lo}from"react";import{Extension as ao}from"@tiptap/core";import{ReactRenderer as io}from"@tiptap/react";import so from"@tiptap/suggestion";import{DivideIcon as mo,EraserIcon as co,FootprintsIcon as po,Heading1 as yo,Heading2 as uo,Heading3 as go,ImageIcon as Se,List as ho,ListOrdered as wo,MousePointer as fo,MoveVertical as bo,Text as xo,TextQuote as vo}from"lucide-react";import ko from"tippy.js";import{jsx as g,jsxs as I}from"react/jsx-runtime";var Be=ao.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[so(m({editor:this.editor},this.options.suggestion))]}}),Ao=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:g(xo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:g(yo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:g(uo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:g(go,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:g(ho,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:g(wo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:g(Se,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Image URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setImage({src:o}).run())}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:g(Se,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Logo URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setLogoImage({src:o}).run())}},{title:"Spacer",description:"Add a spacer to the page. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:g(bo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to the page.",searchTerms:["link","button","cta"],icon:g(fo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setButton().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:g(mo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHardBreak().run()}},{title:"Blockquote",description:"Add blockquote.",searchTerms:["quote","blockquote"],icon:g(vo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBlockquote().run()}},{title:"Footer",description:"Add a footer text to the page.",searchTerms:["footer","text"],icon:g(po,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:g(co,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().selectParentNode().deleteSelection().run()}}],Co=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,a=e.offsetTop,i=a+r;a<t.scrollTop?t.scrollTop-=t.scrollTop-a+5:i>o+t.scrollTop&&(t.scrollTop+=i-o-t.scrollTop+5)},Mo=({items:t,command:e,editor:o})=>{let[r,a]=lo(0),i=oo(n=>{let l=t[n];l&&e(l)},[e,o,t]);Re(()=>{let n=["ArrowUp","ArrowDown","Enter"],l=d=>{if(n.includes(d.key))return d.preventDefault(),d.key==="ArrowUp"?(a((r+t.length-1)%t.length),!0):d.key==="ArrowDown"?(a((r+1)%t.length),!0):d.key==="Enter"?(i(r),!0):!1};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[t,r,a,i]),Re(()=>{a(0)},[t]);let s=no(null);return ro(()=>{let n=s==null?void 0:s.current,l=n==null?void 0:n.children[r];l&&n&&Co(n,l)},[r]),t.length>0?I("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[g("div",{id:"slash-command",ref:s,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((n,l)=>I("button",{className:h("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",l===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>i(l),type:"button",children:[g("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:n.icon}),I("div",{children:[g("p",{className:"mly-font-medium",children:n.title}),g("p",{className:"mly-text-xs mly-text-gray-400",children:n.description})]})]},l))}),g("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:I("div",{className:"mly-flex mly-items-center",children:[I("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[g("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),g("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),g("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),I("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[g("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null};function ze(t=[]){return{items:({query:e})=>[...Ao,...t].filter(o=>{if(typeof e=="string"&&e.length>0){let r=e.toLowerCase();return o.title.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)||o.searchTerms&&o.searchTerms.some(a=>a.includes(r))}return!0}),render:()=>{let e,o=null;return{onStart:r=>{e=new io(Mo,{props:r,editor:r.editor}),o=ko("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:r=>{e==null||e.updateProps(r),o&&o[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var a;return r.event.key==="Escape"?(o==null||o[0].hide(),!0):(a=e==null?void 0:e.ref)==null?void 0:a.onKeyDown(r)},onExit:()=>{!o||!(o!=null&&o[0])||!e||(o==null||o[0].destroy(),e==null||e.destroy())}}}}}import{mergeAttributes as To,Node as Lo}from"@tiptap/core";import{PluginKey as Po}from"@tiptap/pm/state";import{ReactNodeViewRenderer as No}from"@tiptap/react";import Ro from"@tiptap/suggestion";var So=new Po("variable"),Ie=Lo.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},renderLabel({options:t,node:e}){var o;return`${(o=e.attrs.label)!=null?o:e.attrs.id}`},suggestion:{char:"@",pluginKey:So,command:({editor:t,range:e,props:o})=>{var i,s;let r=t.view.state.selection.$to.nodeAfter;((i=r==null?void 0:r.text)==null?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:o},{type:"text",text:" "}]).run(),(s=window.getSelection())==null||s.collapseToEnd()},allow:({state:t,range:e})=>{let o=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!o.parent.type.contentMatch.matchType(r)}}}},addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},fallback:{default:null,parseHTML:t=>t.getAttribute("data-fallback"),renderHTML:t=>t.fallback?{"data-fallback":t.fallback}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",To({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})]},renderText({node:t}){return this.options.renderLabel({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let o=!1,{selection:r}=e,{empty:a,anchor:i}=r;return a?(e.doc.nodesBetween(i-1,i,(s,n)=>{if(s.type.name===this.name)return o=!0,t.insertText(this.options.suggestion.char||"",n,n+s.nodeSize),!1}),o):!1})}},addProseMirrorPlugins(){return[Ro(m({editor:this.editor},this.options.suggestion))]},addNodeView(){return No(Ne)}});import{NodeViewWrapper as Eo,ReactNodeViewRenderer as Ho}from"@tiptap/react";import{useRef as Vo,useState as Oo}from"react";import Uo from"@tiptap/extension-image";import{useCallback as Bo,useLayoutEffect as zo,useRef as Io}from"react";var Ee=t=>{let e=Io(null);return zo(()=>{e.current=t},[t]),Bo((...o)=>{if(e.current===null)throw new Error("Handler is not assigned");return e.current(...o)},[])};import{Fragment as Fo,jsx as J,jsxs as He}from"react/jsx-runtime";var Do=60;function qo(t){let{node:e,updateAttributes:o,selected:r}=t,a=Vo(null),[i,s]=Oo(),n=Ee(c=>{let f=document.querySelector(".ProseMirror-selectednode");if(!a.current||!f||!r)return;let k=f.offsetWidth;c.preventDefault();let b=c.currentTarget.dataset.direction||"--",R=c.clientX,H=a.current.width,D=a.current.height,S=H,q=D,qe=b[1]==="w"?-1:1,F=()=>{window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",F),o({width:S,height:q}),s(void 0)},j=Y=>{if(S=Math.max(H+qe*(Y.clientX-R),Do),S>k&&(S=k),q=S/H*D,s({width:S,height:q}),!Y.buttons)return F()};window.addEventListener("mousemove",j),window.addEventListener("mouseup",F)});function l(c){return J("div",{role:"button",tabIndex:0,onMouseDown:n,"data-direction":c,className:"mly-bg-rose-500",style:w(m(m({position:"absolute",height:"10px",width:"10px"},{n:{top:0},s:{bottom:0}}[c[0]]),{w:{left:0},e:{right:0}}[c[1]]),{cursor:`${c}-resize`})})}let{alignment:d="center",width:u,height:y}=e.attrs||{};return He(Eo,{as:"div",draggable:!0,"data-drag-handle":!0,style:m(w(m({width:u,height:y},i),{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block"}),{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[d]||{}),children:[J("img",w(m({},e.attrs),{ref:a,style:w(m({},i),{cursor:"default",marginBottom:0})})),r&&He(Fo,{children:[[{left:0,top:0,height:"100%",width:"1px"},{right:0,top:0,height:"100%",width:"1px"},{top:0,left:0,width:"100%",height:"1px"},{bottom:0,left:0,width:"100%",height:"1px"}].map((c,f)=>J("div",{className:"mly-bg-rose-500",style:m({position:"absolute"},c)},f)),l("nw"),l("ne"),l("sw"),l("se")]})]})}var Ve=Uo.extend({addAttributes(){var t;return w(m({},(t=this.parent)==null?void 0:t.call(this)),{width:{renderHTML:({width:e})=>({width:e})},height:{renderHTML:({height:e})=>({height:e})},alignment:{default:"center",renderHTML:({alignment:e})=>({"data-alignment":e}),parseHTML:e=>e.getAttribute("data-alignment")||"center"}})},addNodeView(){return Ho(qo)}});function Ue(t){let{variables:e,slashCommands:o}=t;return[Wo.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},code:{HTMLAttributes:{class:"mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"}},horizontalRule:!1,blockquote:{HTMLAttributes:{class:"mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"}}}),Yo,re,$o.configure({types:[Oe.name,_o.name]}),Oe.configure(),Jo.configure({types:[Go.name,jo.name,X.name]}),ue,Xo.configure({placeholder:({node:r})=>r.type.name==="heading"?`Heading ${r.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),ce,X,Ie.configure({suggestion:Pe(e)}),Be.configure({suggestion:ze(o)}),Ko.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),ke,Ve]}import{jsx as E,jsxs as De}from"react/jsx-runtime";function oa(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:a=!0,spellCheck:i=!1,autofocus:s="end"}={},onCreate:n,onUpdate:l,extensions:d,contentHtml:u,contentJson:y,variables:c,slashCommands:f}=t,k=null;y?k=(y==null?void 0:y.type)==="doc"?y:{type:"doc",content:y}:u?k=u:k={type:"doc",content:[{type:"paragraph",content:[]}]};let b=Zo({editorProps:{attributes:{class:h("mly-prose mly-w-full",o),spellCheck:i?"true":"false"},handleDOMEvents:{keydown:(R,H)=>{if(["ArrowUp","ArrowDown","Enter"].includes(H.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:R})=>{n==null||n(R)},onUpdate:({editor:R})=>{l==null||l(R)},extensions:[...Ue({variables:c,slashCommands:f}),...d||[]],content:k,autofocus:s});return b?E(Ce,{variables:c,children:De("div",{className:h("mly-editor mly-antialiased",e),children:[a&&E(se,{config:t.config,editor:b}),De("div",{className:h("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[E(ae,{editor:b}),E(de,{editor:b}),E(ye,{editor:b}),E(Qo,{editor:b})]})]})}):null}export{oa as Editor};
|
|
2
|
+
var Ke=Object.defineProperty,Ge=Object.defineProperties;var Xe=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var te=(t,e,o)=>e in t?Ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,d=(t,e)=>{for(var o in e||(e={}))oe.call(e,o)&&te(t,o,e[o]);if(O)for(var o of O(e))re.call(e,o)&&te(t,o,e[o]);return t},f=(t,e)=>Ge(t,Xe(e));var k=(t,e)=>{var o={};for(var r in t)oe.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&O)for(var r of O(t))e.indexOf(r)<0&&re.call(t,r)&&(o[r]=t[r]);return o};function P(t,{insertAt:e}={}){if(!t||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}P(`.mly-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mly-editor .mly-prose h1,.mly-editor .mly-prose h2,.mly-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mly-editor .mly-prose h1{font-size:36px}.mly-editor .mly-prose h2{font-size:30px}.mly-editor .mly-prose h3{font-size:24px}.mly-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mly-editor .mly-prose h1+p,.mly-editor .mly-prose h2+p,.mly-editor .mly-prose h3+p,.mly-editor .mly-prose hr+p{margin-top:0}.mly-editor .mly-prose ol,.mly-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mly-editor .mly-prose li>p{margin:0}.mly-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mly-editor .mly-prose hr{margin-block:32px}.mly-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mly-editor .mly-prose .spacer+*{margin-top:0}.mly-editor .mly-prose p+.spacer{margin-top:-20px}.mly-editor .mly-prose blockquote+.spacer{margin-top:-16px}.mly-editor .mly-prose h1+.spacer,.mly-editor .mly-prose h2+.spacer,.mly-editor .mly-prose h3+.spacer{margin-top:-12px}.mly-editor .mly-prose ol+.spacer,.mly-editor .mly-prose ul+.spacer{margin-top:-20px}.mly-editor .mly-prose img+.spacer{margin-top:-32px}.mly-editor .mly-prose .node-button+.spacer,.mly-editor .mly-prose footer+.spacer{margin-top:-20px}.mly-editor .mly-prose .node-button{margin-top:0;margin-bottom:20px}.mly-editor .mly-prose .node-image{line-height:0;margin-top:0;margin-bottom:32px;outline:none}.mly-editor .mly-prose .node-image+.spacer{margin-top:-32px}.mly-editor .mly-prose code:before,.mly-editor .mly-prose code:after{content:none}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0}.ProseMirror:focus{outline:none}.ProseMirror .is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror .is-empty:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror-selectednode{outline:3px solid #555}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.mly-editor .react-colorful__alpha{border-radius:0}.mly-editor .react-colorful__saturation,.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{border-radius:8px}.mly-editor .react-colorful__hue,.mly-editor .react-colorful__alpha{height:16px}.mly-editor .react-colorful__pointer{width:16px;height:16px}
|
|
3
|
+
`);P(`:where(.mly-editor),:where(.mly-editor) :before,:where(.mly-editor) :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:where(.mly-editor) :before,:where(.mly-editor) :after{--tw-content: ""}:where(.mly-editor) html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}:where(.mly-editor) body{margin:0;line-height:inherit}:where(.mly-editor) hr{height:0;color:inherit;border-top-width:1px}:where(.mly-editor) abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6{font-size:inherit;font-weight:inherit}:where(.mly-editor) a{color:inherit;text-decoration:inherit}:where(.mly-editor) b,:where(.mly-editor) strong{font-weight:bolder}:where(.mly-editor) code,:where(.mly-editor) kbd,:where(.mly-editor) samp,:where(.mly-editor) pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}:where(.mly-editor) small{font-size:80%}:where(.mly-editor) sub,:where(.mly-editor) sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.mly-editor) sub{bottom:-.25em}:where(.mly-editor) sup{top:-.5em}:where(.mly-editor) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.mly-editor) button,:where(.mly-editor) input,:where(.mly-editor) optgroup,:where(.mly-editor) select,:where(.mly-editor) textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}:where(.mly-editor) button,:where(.mly-editor) select{text-transform:none}:where(.mly-editor) button,:where(.mly-editor) [type=button],:where(.mly-editor) [type=reset],:where(.mly-editor) [type=submit]{-webkit-appearance:button;background-image:none}:where(.mly-editor) :-moz-focusring{outline:auto}:where(.mly-editor) :-moz-ui-invalid{box-shadow:none}:where(.mly-editor) progress{vertical-align:baseline}:where(.mly-editor) ::-webkit-inner-spin-button,:where(.mly-editor) ::-webkit-outer-spin-button{height:auto}:where(.mly-editor) [type=search]{-webkit-appearance:textfield;outline-offset:-2px}:where(.mly-editor) ::-webkit-search-decoration{-webkit-appearance:none}:where(.mly-editor) ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(.mly-editor) summary{display:list-item}:where(.mly-editor) blockquote,:where(.mly-editor) dl,:where(.mly-editor) dd,:where(.mly-editor) h1,:where(.mly-editor) h2,:where(.mly-editor) h3,:where(.mly-editor) h4,:where(.mly-editor) h5,:where(.mly-editor) h6,:where(.mly-editor) hr,:where(.mly-editor) figure,:where(.mly-editor) p,:where(.mly-editor) pre{margin:0}:where(.mly-editor) fieldset{margin:0;padding:0}:where(.mly-editor) legend{padding:0}:where(.mly-editor) ol,:where(.mly-editor) ul,:where(.mly-editor) menu{list-style:none;margin:0;padding:0}:where(.mly-editor) dialog{padding:0}:where(.mly-editor) textarea{resize:vertical}:where(.mly-editor) input::-moz-placeholder,:where(.mly-editor) textarea::-moz-placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) input::placeholder,:where(.mly-editor) textarea::placeholder{opacity:1;color:#9ca3af}:where(.mly-editor) button,:where(.mly-editor) [role=button]{cursor:pointer}:where(.mly-editor) :disabled{cursor:default}:where(.mly-editor) img,:where(.mly-editor) svg,:where(.mly-editor) video,:where(.mly-editor) canvas,:where(.mly-editor) audio,:where(.mly-editor) iframe,:where(.mly-editor) embed,:where(.mly-editor) object{display:block;vertical-align:middle}:where(.mly-editor) img,:where(.mly-editor) video{max-width:100%;height:auto}:where(.mly-editor) [hidden]{display:none}
|
|
4
|
+
`);P('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:start;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>p:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>p:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-start:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-inline-end:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-z-50{z-index:50}.mly-mb-4{margin-bottom:1rem}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-inline-block{display:inline-block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-max-h-\\[330px\\]{max-height:330px}.\\!mly-w-full{width:100%!important}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-full{width:100%}.mly-min-w-0{min-width:0px}.mly-min-w-\\[128px\\]{min-width:128px}.mly-min-w-\\[260px\\]{min-width:260px}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-3{gap:.75rem}.mly-gap-4{gap:1rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.mly-space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-lg{border-radius:.5rem}.mly-rounded-md{border-radius:.375rem}.mly-rounded-none{border-radius:0}.mly-rounded-xl{border-radius:.75rem}.mly-border{border-width:1px}.mly-border-0{border-width:0px}.mly-border-l-4{border-left-width:4px}.mly-border-t{border-top-width:1px}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.mly-border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.\\!mly-bg-transparent{background-color:transparent!important}.mly-bg-\\[\\#efefef\\]{--tw-bg-opacity: 1;background-color:rgb(239 239 239 / var(--tw-bg-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity))}.mly-bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.mly-stroke-\\[2\\.5\\]{stroke-width:2.5}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-0{padding-top:0;padding-bottom:0}.mly-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-uppercase{text-transform:uppercase}.mly-capitalize{text-transform:capitalize}.mly-leading-none{line-height:1}.mly-tracking-normal{letter-spacing:0em}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity))}.mly-text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));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)}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-border-gray-400:focus-visible{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');import{EditorContent as ir,useEditor as sr}from"@tiptap/react";import{BubbleMenu as rt,isTextSelection as nt}from"@tiptap/react";import{AlignCenterIcon as lt,AlignLeftIcon as at,AlignRightIcon as it,BoldIcon as st,CodeIcon as mt,ItalicIcon as dt,LinkIcon as ct,StrikethroughIcon as pt,UnderlineIcon as yt}from"lucide-react";import{mergeAttributes as Je}from"@tiptap/core";import je from"@tiptap/extension-image";var ne=["sm","md","lg"],U=["left","center","right"],le="left",F="sm";function Ye(t){let e={sm:"40px",md:"48px",lg:"64px"};return[`height:${e[t]||e[F]}`,`width:${e[t]||e[F]}`]}function Qe(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[le]}var ae=je.extend({name:"logo",priority:1e3,addAttributes(){var t;return f(d({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:F,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:le,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,l=["position:relative","margin-top:0",...Ye(o),...Qe(r)];return t.style=l.join(";"),["img",Je(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});import*as ie from"react";import{Slot as tt}from"@radix-ui/react-slot";import{clsx as Ze}from"clsx";import{twMerge as et}from"tailwind-merge";function w(...t){return et(Ze(t))}import{jsx as ot}from"react/jsx-runtime";var C=ie.forwardRef((s,i)=>{var n=s,{className:t,variant:e="default",size:o="default",asChild:r=!1}=n,l=k(n,["className","variant","size","asChild"]);let a=r?tt:"button",y="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",m={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},c={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},g=w("mly-editor",y,m[e],c[o],t);return ot(a,d({className:g,ref:i},l))});C.displayName="BaseButton";import{jsx as W}from"react/jsx-runtime";function L(t){return W(C,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:w("mly-px-2.5"),type:"button",children:t.icon?W(t.icon,{className:w("mly-h-3.5 mly-w-3.5")}):W("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}import{jsx as se}from"react/jsx-runtime";function me(t){let{editor:e}=t,o=[at,lt,it],r=U.map((s,n)=>({name:s,isActive:()=>e==null?void 0:e.isActive({textAlign:s}),command:()=>{var a,y,m,c;(a=t==null?void 0:t.editor)!=null&&a.isActive({textAlign:s})?(m=(y=t==null?void 0:t.editor)==null?void 0:y.chain())==null||m.focus().unsetTextAlign().run():(c=t==null?void 0:t.editor)==null||c.chain().focus().setTextAlign(s).run()},icon:o[n]})),l=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:st},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:dt},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:yt},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:pt},...r,{name:"code",isActive:()=>e==null?void 0:e.isActive("code"),command:()=>e==null?void 0:e.chain().focus().toggleCode().run(),icon:mt},{name:"link",command:()=>{let s=e==null?void 0:e.getAttributes("link").href,n=window.prompt("URL",s);if(n!==null){if(n===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:n}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:ct}],i=f(d({},t),{shouldShow:({editor:s,state:n,from:a,to:y})=>{let{doc:m,selection:c}=n,{empty:g}=c,T=!m.textBetween(a,y).length&&nt(n.selection);return!(g||T||!s.isEditable||s.isActive("image")||s.isActive("logo")||s.isActive("spacer")||s.isActive("variable")||s.isActive({mailyComponent:"button"}))},tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return se(rt,f(d({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:l.map((s,n)=>se(L,d({},s),n))}))}import{useMemo as de}from"react";import{AlignCenter as ut,AlignLeft as gt,AlignRight as ht,BoldIcon as wt,EraserIcon as ft,ItalicIcon as bt,LinkIcon as xt,SeparatorHorizontal as vt,StrikethroughIcon as kt,UnderlineIcon as At}from"lucide-react";import{jsx as $}from"react/jsx-runtime";var ce=t=>{let{editor:e,config:o}=t,r=de(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:wt},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:bt},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:At},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:kt},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:ft},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:vt},{name:"link",command:()=>{let i=e.getAttributes("link").href,s=window.prompt("URL",i);if(s!==null){if(s===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:s}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:xt},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:gt},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:ut},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:ht}],[e]),l=de(()=>r.reduce((i,s)=>(i.includes(s.group)||i.push(s.group),i),[]),[r]);return e?$("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:l.map((i,s)=>$("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(n=>n.group===i).map((n,a)=>$(L,d({},n),a))},s))}):null};import{BubbleMenu as Ct}from"@tiptap/react";import{AlignCenterIcon as Mt,AlignLeftIcon as Tt,AlignRightIcon as Lt,ArrowUpRight as Pt,Link as Nt,Unlink as Rt}from"lucide-react";import{jsx as pe}from"react/jsx-runtime";function ye(t){let{editor:e}=t,o=[Tt,Mt,Lt],r=U.map((n,a)=>({name:n,isActive:()=>(e==null?void 0:e.isActive("logo",{alignment:n}))||(e==null?void 0:e.isActive("image",{alignment:n})),shouldShow:()=>(e==null?void 0:e.isActive("logo"))||(e==null?void 0:e.isActive("image")),command:()=>{var m,c;(e==null?void 0:e.isActive("logo"))?(m=t==null?void 0:t.editor)==null||m.chain().focus().setLogoAttributes({alignment:n}).run():(c=t==null?void 0:t.editor)==null||c.chain().focus().updateAttributes("image",{alignment:n}).run()},icon:o[a]})),l=ne.map(n=>({name:n,isActive:()=>{var a;return(a=t==null?void 0:t.editor)==null?void 0:a.isActive("logo",{size:n})},shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var a;(a=t==null?void 0:t.editor)==null||a.chain().focus().setLogoAttributes({size:n}).run()}})),i=[...r,{name:"url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("logo"),command:()=>{var T,v,h;let{editor:n}=t,a=(T=n==null?void 0:n.getAttributes("logo"))==null?void 0:T.src,y=window.prompt("Update logo URL",a);if(!y)return;let m=(v=n==null?void 0:n.getAttributes("logo"))==null?void 0:v.size,c=(h=n==null?void 0:n.getAttributes("logo"))==null?void 0:h.alignment,g=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:y,size:m,alignment:c}),n==null||n.commands.setNodeSelection((g==null?void 0:g.from)||0)},icon:Nt},{name:"image-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var c;let{editor:n}=t,a=(c=n==null?void 0:n.getAttributes("image"))==null?void 0:c.src,y=window.prompt("Update Image URL",a);if(!y)return;let m=n==null?void 0:n.state.selection;n==null||n.commands.setImage({src:y}),n==null||n.commands.setNodeSelection((m==null?void 0:m.from)||0)},icon:Rt},{name:"image-external-url",isActive:()=>!1,shouldShow:()=>e==null?void 0:e.isActive("image"),command:()=>{var m;let{editor:n}=t,a=(m=n==null?void 0:n.getAttributes("image"))==null?void 0:m.externalLink,y=window.prompt("Update Image External URL",a||"");n==null||n.commands.updateAttributes("image",{externalLink:y||""})},icon:Pt},...l],s=f(d({},t),{shouldShow:({editor:n})=>n.isActive("logo")||n.isActive("image"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return pe(Ct,f(d({},s),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:i.filter(n=>{var a;return(a=n.shouldShow)==null?void 0:a.call(n)}).map((n,a)=>pe(L,d({},n),a))}))}import{BubbleMenu as Et}from"@tiptap/react";import{mergeAttributes as St,Node as Bt}from"@tiptap/core";var K=["sm","md","lg","xl"],zt="sm";function It(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[zt]}`}var ue=Bt.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!K.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=It(o),["div",St({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer relative z-50",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});import{jsx as ge}from"react/jsx-runtime";function he(t){let{editor:e}=t,o=K.map(l=>({name:l,isActive:()=>e==null?void 0:e.isActive("spacer",{height:l}),command:()=>{e==null||e.chain().focus().setSpacer({height:l}).run()}})),r=f(d({},t),{shouldShow:({editor:l})=>l.isActive("spacer"),tippyOptions:{maxWidth:"100%",moveTransition:"mly-transform 0.15s mly-ease-out"}});return ge(Et,f(d({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((l,i)=>ge(L,d({},l),i))}))}import Qo from"@tiptap/starter-kit";import{Color as Zo}from"@tiptap/extension-color";import er from"@tiptap/extension-link";import tr from"@tiptap/extension-list-item";import or from"@tiptap/extension-paragraph";import rr from"@tiptap/extension-placeholder";import nr from"@tiptap/extension-text-align";import _e from"@tiptap/extension-text-style";import lr from"@tiptap/extension-heading";import ar from"@tiptap/extension-underline";import{InputRule as Ht}from"@tiptap/core";import{HorizontalRule as Vt}from"@tiptap/extension-horizontal-rule";var we=Vt.extend({addInputRules(){return[new Ht({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,l=e.from,i=e.to;r.insert(l-1,this.type.create(o)).delete(r.mapping.map(l),r.mapping.map(i))}})]}});import{mergeAttributes as jt,Node as Yt}from"@tiptap/core";import{ReactNodeViewRenderer as Qt}from"@tiptap/react";import{NodeViewWrapper as Ft}from"@tiptap/react";import{AlignCenterIcon as Wt,AlignLeftIcon as $t,AlignRightIcon as Kt}from"lucide-react";import{useState as Ot}from"react";import{HexAlphaColorPicker as Ut,HexColorInput as Dt}from"react-colorful";import{jsx as fe,jsxs as _t}from"react/jsx-runtime";function G(t){let{color:e,onChange:o}=t,[r,l]=Ot(e),i=s=>{l(s),o==null||o(s)};return _t("div",{className:"mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4",children:[fe(Ut,{color:r,onChange:i,className:"mly-flex !mly-w-full mly-flex-col mly-gap-4"}),fe(Dt,{alpha:!0,color:r,onChange:i,className:"mly-mt-4 mly-w-full mly-min-w-0 mly-rounded-lg mly-border mly-px-2 mly-py-1.5 mly-text-sm mly-uppercase focus-visible:mly-border-gray-400 focus-visible:mly-outline-none",prefixed:!0})]})}import*as be from"react";import{jsx as qt}from"react/jsx-runtime";var N=be.forwardRef((l,r)=>{var i=l,{className:t,type:e}=i,o=k(i,["className","type"]);return qt("input",d({type:e,className:w("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50","mly-editor",t),ref:r},o))});N.displayName="Input";import*as ve from"react";import*as M from"@radix-ui/react-popover";import{jsx as xe}from"react/jsx-runtime";var B=M.Root,z=M.Trigger,R=ve.forwardRef((i,l)=>{var s=i,{className:t,align:e="center",sideOffset:o=4}=s,r=k(s,["className","align","sideOffset"]);return xe(M.Portal,{children:xe(M.Content,d({ref:l,align:e,sideOffset:o,className:w("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-text-gray-950 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2","mly-editor",t)},r))})});R.displayName=M.Content.displayName;import{jsx as p,jsxs as b}from"react/jsx-runtime";var Gt={left:$t,center:Wt,right:Kt},X={style(t){return Ae.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return Ce.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(Gt).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function ke(t){let{url:e,text:o,alignment:r,variant:l,borderRadius:i,buttonColor:s,textColor:n}=t.node.attrs,{getPos:a,editor:y}=t;return p(Ft,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:b(B,{open:t.selected,children:[p(z,{asChild:!0,children:p("div",{children:p("button",{className:w("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":i==="round","!mly-rounded-md":i==="smooth","!mly-rounded-none":i==="sharp"}),tabIndex:-1,style:{backgroundColor:l==="filled"?s:"transparent",color:n,borderWidth:2,borderStyle:"solid",borderColor:s},onClick:m=>{m.preventDefault();let c=a();y.commands.setNodeSelection(c)},children:o})})}),b(R,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),children:[p(N,{placeholder:"Add text here",value:o,onChange:m=>{t.updateAttributes({text:m.target.value})}}),p(N,{placeholder:"Add link here",value:e,onChange:m=>{t.updateAttributes({url:m.target.value})}}),b("div",{className:"mly-w-full mly-space-y-2",children:[p("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),p("div",{className:"mly-flex mly-gap-1",children:X.style(t).map((m,c)=>p(C,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},c))})]}),b("div",{className:"mly-w-full mly-space-y-2",children:[p("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),p("div",{className:"mly-flex mly-gap-1",children:X.cornerRadius(t).map((m,c)=>p(C,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:m.onClick,type:"button",children:m.name},c))})]}),b("div",{className:"flex gap-2",children:[b("div",{children:[p("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),p("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:X.alignment(t).map((m,c)=>p(C,{"data-state":m.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:m.onClick,type:"button",children:p(m.icon,{size:16})},c))})]}),b("div",{children:[p("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),b("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[p(Xt,{variant:l,color:s,onChange:m=>{t.updateAttributes({buttonColor:m})}}),p(Jt,{color:n,onChange:m=>{t.updateAttributes({textColor:m})}})]})]})]})]})]})})}function Xt(t){let{color:e,onChange:o,variant:r}=t;return b(B,{children:[p(z,{asChild:!0,children:p(C,{variant:"ghost",className:"",size:"sm",type:"button",children:p("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),p(R,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:p(G,{color:e,onChange:l=>{queueMicrotask(()=>{o(l)})}})})]})}function Jt(t){let{color:e,onChange:o}=t;return b(B,{children:[p(z,{asChild:!0,children:p(C,{variant:"ghost",size:"sm",type:"button",children:b("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[p("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),p("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),p(R,{className:"mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",children:p(G,{color:e,onChange:r=>{queueMicrotask(()=>{o(r)})}})})]})}var Ae=["filled","outline"],Ce=["sharp","smooth","round"],Me=Yt.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",jt({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return Qt(ke)}});import{mergeAttributes as Zt,Node as eo}from"@tiptap/core";var J=eo.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",Zt(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});import{forwardRef as no,useEffect as lo,useImperativeHandle as ao,useState as Ne}from"react";import{NodeViewWrapper as io,ReactRenderer as so}from"@tiptap/react";import mo from"tippy.js";import{AlertTriangle as co}from"lucide-react";import{createContext as to,useContext as oo}from"react";import{jsx as ro}from"react/jsx-runtime";var Te=to({variables:[],slashCommands:[]});function Le(t){let r=t,{children:e}=r,o=k(r,["children"]);return ro(Te.Provider,{value:o,children:e})}function Pe(){let t=oo(Te);if(!t)throw new Error("Missing MailyContext.Provider in the component tree");return t}import{jsx as x,jsxs as H}from"react/jsx-runtime";var Re=no((t,e)=>{var i,s;let[o,r]=Ne(0),l=n=>{let a=t.items[n];a&&t.command({id:a})};return lo(()=>r(0),[t.items]),ao(e,()=>({onKeyDown:({event:n})=>n.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):n.key==="ArrowDown"?(r((o+1)%t.items.length),!0):n.key==="Enter"?(l(o),!0):!1})),x("div",{className:"mly-z-50 mly-h-auto mly-min-w-[128px] mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-1 mly-shadow-md mly-transition-all",children:(i=t==null?void 0:t.items)!=null&&i.length?(s=t==null?void 0:t.items)==null?void 0:s.map((n,a)=>x("button",{onClick:()=>l(a),className:w("mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",a===o?"mly-bg-gray-200":"mly-bg-white"),children:n},a)):x("button",{className:"mly-flex mly-w-full mly-space-x-2 mly-rounded-md mly-bg-white mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});Re.displayName="VariableList";function Se(t=[]){let e=t.map(o=>o.name);return{items:({query:o})=>e.concat(o.length>0?[o]:[]).filter(r=>r.toLowerCase().startsWith(o.toLowerCase())).slice(0,5),render:()=>{let o,r=null;return{onStart:l=>{o=new so(Re,{props:l,editor:l.editor}),l.clientRect&&(r=mo("body",{getReferenceClientRect:l.clientRect,appendTo:()=>document.body,content:o.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(l){var i;o.updateProps(l),l.clientRect&&((i=r==null?void 0:r[0])==null||i.setProps({getReferenceClientRect:l.clientRect}))},onKeyDown(l){var i;return l.event.key==="Escape"?(r==null||r[0].hide(),!0):(i=o.ref)==null?void 0:i.onKeyDown(l)},onExit(){!r||!(r!=null&&r[0])||!o||(r==null||r[0].destroy(),o.destroy())}}}}}function Be(t){var m,c;let{node:e,selected:o,updateAttributes:r}=t,{id:l,fallback:i}=e.attrs,{variables:s=[]}=Pe(),n=(c=(m=s.find(g=>g.name===l))==null?void 0:m.required)!=null?c:!0,[a,y]=Ne(!1);return x(io,{className:w("react-component",o&&"ProseMirror-selectednode","mly-inline-block mly-leading-none"),draggable:"false",children:H(B,{open:a,onOpenChange:y,children:[x(z,{children:H("span",{tabIndex:-1,className:"mly-inline-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-border-rose-200 mly-bg-rose-50 mly-px-2 mly-py-1 mly-leading-none mly-text-rose-800",children:[l,n&&!i&&x(co,{className:"mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]"})]})}),H(R,{align:"start",className:"mly-space-y-2",onOpenAutoFocus:g=>g.preventDefault(),onCloseAutoFocus:g=>g.preventDefault(),children:[H("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[x("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Variable Name"}),x(N,{placeholder:"Add Variable Name",value:l,onChange:g=>{r({id:g.target.value})}})]}),H("label",{className:"mly-block mly-w-full mly-space-y-1.5 mly-leading-none",children:[x("span",{className:"mly-text-xs mly-font-normal mly-leading-none",children:"Fallback Value"}),x(N,{placeholder:"Fallback Value",value:i||"",onChange:g=>{r({fallback:g.target.value})}}),x("p",{className:"mly-text-xs mly-text-gray-500",children:"If the variable doesn't exist, this fallback value will be used."})]})]})]})})}import{useCallback as po,useEffect as ze,useLayoutEffect as yo,useRef as uo,useState as go}from"react";import{Extension as ho}from"@tiptap/core";import{ReactRenderer as wo}from"@tiptap/react";import fo from"@tiptap/suggestion";import{DivideIcon as bo,EraserIcon as xo,FootprintsIcon as vo,Heading1 as ko,Heading2 as Ao,Heading3 as Co,ImageIcon as Ie,List as Mo,ListOrdered as To,MousePointer as Lo,MoveVertical as Po,Text as No,TextQuote as Ro}from"lucide-react";import So from"tippy.js";import{jsx as u,jsxs as I}from"react/jsx-runtime";var Ee=ho.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[fo(d({editor:this.editor},this.options.suggestion))]}}),Bo=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:u(No,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:u(ko,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:u(Ao,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:u(Co,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:u(Mo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:u(To,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:u(Ie,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Image URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setImage({src:o}).run())}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:u(Ie,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{let o=prompt("Logo URL: ")||"";o&&(t.chain().focus().deleteRange(e).run(),t.chain().focus().setLogoImage({src:o}).run())}},{title:"Spacer",description:"Add a spacer to the page. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:u(Po,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to the page.",searchTerms:["link","button","cta"],icon:u(Lo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setButton().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:u(bo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHardBreak().run()}},{title:"Blockquote",description:"Add blockquote.",searchTerms:["quote","blockquote"],icon:u(Ro,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBlockquote().run()}},{title:"Footer",description:"Add a footer text to the page.",searchTerms:["footer","text"],icon:u(vo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:u(xo,{className:"mly-h-4 mly-w-4"}),command:({editor:t,range:e})=>{t.chain().focus().selectParentNode().deleteSelection().run()}}],zo=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,l=e.offsetTop,i=l+r;l<t.scrollTop?t.scrollTop-=t.scrollTop-l+5:i>o+t.scrollTop&&(t.scrollTop+=i-o-t.scrollTop+5)},Io=({items:t,command:e,editor:o})=>{let[r,l]=go(0),i=po(n=>{let a=t[n];a&&e(a)},[e,o,t]);ze(()=>{let n=["ArrowUp","ArrowDown","Enter"],a=y=>{if(n.includes(y.key))return y.preventDefault(),y.key==="ArrowUp"?(l((r+t.length-1)%t.length),!0):y.key==="ArrowDown"?(l((r+1)%t.length),!0):y.key==="Enter"?(i(r),!0):!1};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[t,r,l,i]),ze(()=>{l(0)},[t]);let s=uo(null);return yo(()=>{let n=s==null?void 0:s.current,a=n==null?void 0:n.children[r];a&&n&&zo(n,a)},[r]),t.length>0?I("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[u("div",{id:"slash-command",ref:s,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((n,a)=>I("button",{className:w("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",a===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>i(a),type:"button",children:[u("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:n.icon}),I("div",{children:[u("p",{className:"mly-font-medium",children:n.title}),u("p",{className:"mly-text-xs mly-text-gray-400",children:n.description})]})]},a))}),u("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:I("div",{className:"mly-flex mly-items-center",children:[I("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[u("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),u("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),u("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),I("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[u("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null};function He(t=[]){return{items:({query:e})=>[...Bo,...t].filter(o=>{if(typeof e=="string"&&e.length>0){let r=e.toLowerCase();return o.title.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)||o.searchTerms&&o.searchTerms.some(l=>l.includes(r))}return!0}),render:()=>{let e,o=null;return{onStart:r=>{e=new wo(Io,{props:r,editor:r.editor}),o=So("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:r=>{e==null||e.updateProps(r),o&&o[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var l;return r.event.key==="Escape"?(o==null||o[0].hide(),!0):(l=e==null?void 0:e.ref)==null?void 0:l.onKeyDown(r)},onExit:()=>{!o||!(o!=null&&o[0])||!e||(o==null||o[0].destroy(),e==null||e.destroy())}}}}}import{mergeAttributes as Eo,Node as Ho}from"@tiptap/core";import{PluginKey as Vo}from"@tiptap/pm/state";import{ReactNodeViewRenderer as Oo}from"@tiptap/react";import Uo from"@tiptap/suggestion";var Do=new Vo("variable"),Ve=Ho.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},renderLabel({options:t,node:e}){var o;return`${(o=e.attrs.label)!=null?o:e.attrs.id}`},suggestion:{char:"@",pluginKey:Do,command:({editor:t,range:e,props:o})=>{var i,s;let r=t.view.state.selection.$to.nodeAfter;((i=r==null?void 0:r.text)==null?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:o},{type:"text",text:" "}]).run(),(s=window.getSelection())==null||s.collapseToEnd()},allow:({state:t,range:e})=>{let o=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!o.parent.type.contentMatch.matchType(r)}}}},addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},fallback:{default:null,parseHTML:t=>t.getAttribute("data-fallback"),renderHTML:t=>t.fallback?{"data-fallback":t.fallback}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",Eo({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})]},renderText({node:t}){return this.options.renderLabel({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let o=!1,{selection:r}=e,{empty:l,anchor:i}=r;return l?(e.doc.nodesBetween(i-1,i,(s,n)=>{if(s.type.name===this.name)return o=!0,t.insertText(this.options.suggestion.char||"",n,n+s.nodeSize),!1}),o):!1})}},addProseMirrorPlugins(){return[Uo(d({editor:this.editor},this.options.suggestion))]},addNodeView(){return Oo(Be)}});import{NodeViewWrapper as Wo,ReactNodeViewRenderer as $o}from"@tiptap/react";import{useRef as Ko,useState as Go}from"react";import Xo from"@tiptap/extension-image";import{useCallback as _o,useLayoutEffect as qo,useRef as Fo}from"react";var Oe=t=>{let e=Fo(null);return qo(()=>{e.current=t},[t]),_o((...o)=>{if(e.current===null)throw new Error("Handler is not assigned");return e.current(...o)},[])};import{Fragment as Yo,jsx as j,jsxs as Ue}from"react/jsx-runtime";var Jo=60;function jo(t){let{node:e,updateAttributes:o,selected:r}=t,l=Ko(null),[i,s]=Go(),n=Oe(h=>{let A=document.querySelector(".ProseMirror-selectednode");if(!l.current||!A||!r)return;let V=A.offsetWidth;h.preventDefault();let Y=h.currentTarget.dataset.direction||"--",We=h.clientX,D=l.current.width,Q=l.current.height,S=D,_=Q,$e=Y[1]==="w"?-1:1,q=()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",q),o({width:S,height:_}),s(void 0)},Z=ee=>{if(S=Math.max(D+$e*(ee.clientX-We),Jo),S>V&&(S=V),_=S/D*Q,s({width:S,height:_}),!ee.buttons)return q()};window.addEventListener("mousemove",Z),window.addEventListener("mouseup",q)});function a(h){return j("div",{role:"button",tabIndex:0,onMouseDown:n,"data-direction":h,className:"mly-bg-rose-500",style:f(d(d({position:"absolute",height:"10px",width:"10px"},{n:{top:0},s:{bottom:0}}[h[0]]),{w:{left:0},e:{right:0}}[h[1]]),{cursor:`${h}-resize`})})}let{alignment:y="center",width:m,height:c}=e.attrs||{},v=e.attrs||{},{externalLink:g}=v,T=k(v,["externalLink"]);return Ue(Wo,{as:"div",draggable:!0,"data-drag-handle":!0,style:d(f(d({width:m,height:c},i),{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block"}),{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[y]||{}),children:[j("img",f(d({},T),{ref:l,style:f(d({},i),{cursor:"default",marginBottom:0})})),r&&Ue(Yo,{children:[[{left:0,top:0,height:"100%",width:"1px"},{right:0,top:0,height:"100%",width:"1px"},{top:0,left:0,width:"100%",height:"1px"},{bottom:0,left:0,width:"100%",height:"1px"}].map((h,A)=>j("div",{className:"mly-bg-rose-500",style:d({position:"absolute"},h)},A)),a("nw"),a("ne"),a("sw"),a("se")]})]})}var De=Xo.extend({addAttributes(){var t;return f(d({},(t=this.parent)==null?void 0:t.call(this)),{width:{renderHTML:({width:e})=>({width:e})},height:{renderHTML:({height:e})=>({height:e})},alignment:{default:"center",renderHTML:({alignment:e})=>({"data-alignment":e}),parseHTML:e=>e.getAttribute("data-alignment")||"center"},externalLink:{default:null,renderHTML:({externalLink:e})=>e?{"data-external-link":e}:{},parseHTML:e=>{let o=e.getAttribute("data-external-link");return o?{externalLink:o}:null}}})},addNodeView(){return $o(jo)}});function qe(t){let{variables:e,slashCommands:o}=t;return[Qo.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},code:{HTMLAttributes:{class:"mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"}},horizontalRule:!1,blockquote:{HTMLAttributes:{class:"mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"}}}),ar,ae,Zo.configure({types:[_e.name,tr.name]}),_e.configure(),nr.configure({types:[or.name,lr.name,J.name]}),we,rr.configure({placeholder:({node:r})=>r.type.name==="heading"?`Heading ${r.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),ue,J,Ve.configure({suggestion:Se(e)}),Ee.configure({suggestion:He(o)}),er.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),Me,De]}import{jsx as E,jsxs as Fe}from"react/jsx-runtime";function ua(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:l=!0,spellCheck:i=!1,autofocus:s="end"}={},onCreate:n,onUpdate:a,extensions:y,contentHtml:m,contentJson:c,variables:g,slashCommands:T}=t,v=null;c?v=(c==null?void 0:c.type)==="doc"?c:{type:"doc",content:c}:m?v=m:v={type:"doc",content:[{type:"paragraph",content:[]}]};let h=sr({editorProps:{attributes:{class:w("mly-prose mly-w-full",o),spellCheck:i?"true":"false"},handleDOMEvents:{keydown:(A,V)=>{if(["ArrowUp","ArrowDown","Enter"].includes(V.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:A})=>{n==null||n(A)},onUpdate:({editor:A})=>{a==null||a(A)},extensions:[...qe({variables:g,slashCommands:T}),...y||[]],content:v,autofocus:s});return h?E(Le,{variables:g,children:Fe("div",{className:w("mly-editor mly-antialiased",e),children:[l&&E(ce,{config:t.config,editor:h}),Fe("div",{className:w("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[E(me,{editor:h}),E(ye,{editor:h}),E(he,{editor:h}),E(ir,{editor:h})]})]})}):null}export{ua as Editor};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maily-to/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Powerful editor for creating beautiful, pre-designed, mobile-ready emails.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -46,32 +46,32 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@radix-ui/react-popover": "^1.0.7",
|
|
48
48
|
"@radix-ui/react-slot": "^1.0.2",
|
|
49
|
-
"@tiptap/core": "^2.
|
|
50
|
-
"@tiptap/extension-color": "^2.
|
|
51
|
-
"@tiptap/extension-heading": "^2.
|
|
52
|
-
"@tiptap/extension-horizontal-rule": "^2.
|
|
53
|
-
"@tiptap/extension-image": "^2.
|
|
54
|
-
"@tiptap/extension-link": "^2.
|
|
55
|
-
"@tiptap/extension-list-item": "^2.
|
|
56
|
-
"@tiptap/extension-mention": "^2.
|
|
57
|
-
"@tiptap/extension-paragraph": "^2.
|
|
58
|
-
"@tiptap/extension-placeholder": "^2.
|
|
59
|
-
"@tiptap/extension-text-align": "^2.
|
|
60
|
-
"@tiptap/extension-text-style": "^2.
|
|
61
|
-
"@tiptap/extension-underline": "^2.
|
|
62
|
-
"@tiptap/pm": "^2.
|
|
63
|
-
"@tiptap/react": "^2.
|
|
64
|
-
"@tiptap/starter-kit": "^2.
|
|
65
|
-
"@tiptap/suggestion": "^2.
|
|
49
|
+
"@tiptap/core": "^2.2.2",
|
|
50
|
+
"@tiptap/extension-color": "^2.2.2",
|
|
51
|
+
"@tiptap/extension-heading": "^2.2.2",
|
|
52
|
+
"@tiptap/extension-horizontal-rule": "^2.2.2",
|
|
53
|
+
"@tiptap/extension-image": "^2.2.2",
|
|
54
|
+
"@tiptap/extension-link": "^2.2.2",
|
|
55
|
+
"@tiptap/extension-list-item": "^2.2.2",
|
|
56
|
+
"@tiptap/extension-mention": "^2.2.2",
|
|
57
|
+
"@tiptap/extension-paragraph": "^2.2.2",
|
|
58
|
+
"@tiptap/extension-placeholder": "^2.2.2",
|
|
59
|
+
"@tiptap/extension-text-align": "^2.2.2",
|
|
60
|
+
"@tiptap/extension-text-style": "^2.2.2",
|
|
61
|
+
"@tiptap/extension-underline": "^2.2.2",
|
|
62
|
+
"@tiptap/pm": "^2.2.2",
|
|
63
|
+
"@tiptap/react": "^2.2.2",
|
|
64
|
+
"@tiptap/starter-kit": "^2.2.2",
|
|
65
|
+
"@tiptap/suggestion": "^2.2.2",
|
|
66
66
|
"clsx": "^2.1.0",
|
|
67
|
-
"lucide-react": "^0.
|
|
67
|
+
"lucide-react": "^0.323.0",
|
|
68
68
|
"react-colorful": "^5.6.1",
|
|
69
|
-
"tailwind-merge": "^2.2.
|
|
70
|
-
"tailwindcss": "^3.4.
|
|
69
|
+
"tailwind-merge": "^2.2.1",
|
|
70
|
+
"tailwindcss": "^3.4.1",
|
|
71
71
|
"tippy.js": "^6.3.7"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"postcss": "^8.4.
|
|
74
|
+
"postcss": "^8.4.35",
|
|
75
75
|
"tailwind-config": "workspace:*",
|
|
76
76
|
"tsconfig": "workspace:*",
|
|
77
77
|
"typescript": "^5.3.3"
|