let oldPushState = history.pushState; function extendHTMLElementWithStyleSetters() { ["accentColor", "additiveSymbols", "alignContent", "alignItems", "alignSelf", "alignmentBaseline", "all", "anchorName", "anchorScope", "animation", "animationComposition", "animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationRange", "animationRangeEnd", "animationRangeStart", "animationTimeline", "animationTimingFunction", "appRegion", "appearance", "ascentOverride", "aspectRatio", "backdropFilter", "backfaceVisibility", "background", "backgroundAttachment", "backgroundBlendMode", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPosition", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize", "basePalette", "baselineShift", "baselineSource", "blockSize", "border", "borderBlock", "borderBlockColor", "borderBlockEnd", "borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth", "borderBlockStart", "borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth", "borderBlockStyle", "borderBlockWidth", "borderBottom", "borderBottomColor", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStyle", "borderBottomWidth", "borderCollapse", "borderColor", "borderEndEndRadius", "borderEndStartRadius", "borderImage", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderInline", "borderInlineColor", "borderInlineEnd", "borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth", "borderInlineStart", "borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth", "borderInlineStyle", "borderInlineWidth", "borderLeft", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRadius", "borderRight", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderSpacing", "borderStartEndRadius", "borderStartStartRadius", "borderStyle", "borderTop", "borderTopColor", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStyle", "borderTopWidth", "borderWidth", "bottom", "boxDecorationBreak", "boxShadow", "boxSizing", "breakAfter", "breakBefore", "breakInside", "bufferedRendering", "captionSide", "caretAnimation", "caretColor", "clear", "clip", "clipPath", "clipRule", "color", "colorInterpolation", "colorInterpolationFilters", "colorRendering", "colorScheme", "columnCount", "columnFill", "columnGap", "columnRule", "columnRuleColor", "columnRuleStyle", "columnRuleWidth", "columnSpan", "columnWidth", "columns", "contain", "containIntrinsicBlockSize", "containIntrinsicHeight", "containIntrinsicInlineSize", "containIntrinsicSize", "containIntrinsicWidth", "container", "containerName", "containerType", "content", "contentVisibility", "cornerBlockEndShape", "cornerBlockStartShape", "cornerBottomLeftShape", "cornerBottomRightShape", "cornerBottomShape", "cornerEndEndShape", "cornerEndStartShape", "cornerInlineEndShape", "cornerInlineStartShape", "cornerLeftShape", "cornerRightShape", "cornerShape", "cornerStartEndShape", "cornerStartStartShape", "cornerTopLeftShape", "cornerTopRightShape", "cornerTopShape", "counterIncrement", "counterReset", "counterSet", "cursor", "cx", "cy", "d", "descentOverride", "direction", "display", "dominantBaseline", "dynamicRangeLimit", "emptyCells", "fallback", "fieldSizing", "fill", "fillOpacity", "fillRule", "filter", "flex", "flexBasis", "flexDirection", "flexFlow", "flexGrow", "flexShrink", "flexWrap", "float", "floodColor", "floodOpacity", "font", "fontDisplay", "fontFamily", "fontFeatureSettings", "fontKerning", "fontOpticalSizing", "fontPalette", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontSynthesis", "fontSynthesisSmallCaps", "fontSynthesisStyle", "fontSynthesisWeight", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantEmoji", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontVariationSettings", "fontWeight", "forcedColorAdjust", "gap", "grid", "gridArea", "gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridColumn", "gridColumnEnd", "gridColumnGap", "gridColumnStart", "gridGap", "gridRow", "gridRowEnd", "gridRowGap", "gridRowStart", "gridTemplate", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows", "height", "hyphenateCharacter", "hyphenateLimitChars", "hyphens", "imageOrientation", "imageRendering", "inherits", "initialLetter", "initialValue", "inlineSize", "inset", "insetBlock", "insetBlockEnd", "insetBlockStart", "insetInline", "insetInlineEnd", "insetInlineStart", "interactivity", "interpolateSize", "isolation", "justifyContent", "justifyItems", "justifySelf", "left", "letterSpacing", "lightingColor", "lineBreak", "lineGapOverride", "lineHeight", "listStyle", "listStyleImage", "listStylePosition", "listStyleType", "margin", "marginBlock", "marginBlockEnd", "marginBlockStart", "marginBottom", "marginInline", "marginInlineEnd", "marginInlineStart", "marginLeft", "marginRight", "marginTop", "marker", "markerEnd", "markerMid", "markerStart", "mask", "maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPosition", "maskRepeat", "maskSize", "maskType", "mathDepth", "mathShift", "mathStyle", "maxBlockSize", "maxHeight", "maxInlineSize", "maxWidth", "minBlockSize", "minHeight", "minInlineSize", "minWidth", "mixBlendMode", "navigation", "negative", "objectFit", "objectPosition", "objectViewBox", "offset", "offsetAnchor", "offsetDistance", "offsetPath", "offsetPosition", "offsetRotate", "opacity", "order", "orphans", "outline", "outlineColor", "outlineOffset", "outlineStyle", "outlineWidth", "overflow", "overflowAnchor", "overflowBlock", "overflowClipMargin", "overflowInline", "overflowWrap", "overflowX", "overflowY", "overlay", "overrideColors", "overscrollBehavior", "overscrollBehaviorBlock", "overscrollBehaviorInline", "overscrollBehaviorX", "overscrollBehaviorY", "pad", "padding", "paddingBlock", "paddingBlockEnd", "paddingBlockStart", "paddingBottom", "paddingInline", "paddingInlineEnd", "paddingInlineStart", "paddingLeft", "paddingRight", "paddingTop", "page", "pageBreakAfter", "pageBreakBefore", "pageBreakInside", "pageOrientation", "paintOrder", "perspective", "perspectiveOrigin", "placeContent", "placeItems", "placeSelf", "pointerEvents", "position", "positionAnchor", "positionArea", "positionTry", "positionTryFallbacks", "positionTryOrder", "positionVisibility", "prefix", "printColorAdjust", "quotes", "r", "range", "readingFlow", "readingOrder", "resize", "result", "right", "rotate", "rowGap", "rubyAlign", "rubyPosition", "rx", "ry", "scale", "scrollBehavior", "scrollInitialTarget", "scrollMargin", "scrollMarginBlock", "scrollMarginBlockEnd", "scrollMarginBlockStart", "scrollMarginBottom", "scrollMarginInline", "scrollMarginInlineEnd", "scrollMarginInlineStart", "scrollMarginLeft", "scrollMarginRight", "scrollMarginTop", "scrollMarkerGroup", "scrollPadding", "scrollPaddingBlock", "scrollPaddingBlockEnd", "scrollPaddingBlockStart", "scrollPaddingBottom", "scrollPaddingInline", "scrollPaddingInlineEnd", "scrollPaddingInlineStart", "scrollPaddingLeft", "scrollPaddingRight", "scrollPaddingTop", "scrollSnapAlign", "scrollSnapStop", "scrollSnapType", "scrollTargetGroup", "scrollTimeline", "scrollTimelineAxis", "scrollTimelineName", "scrollbarColor", "scrollbarGutter", "scrollbarWidth", "shapeImageThreshold", "shapeMargin", "shapeOutside", "shapeRendering", "size", "sizeAdjust", "speak", "speakAs", "src", "stopColor", "stopOpacity", "stroke", "strokeDasharray", "strokeDashoffset", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeOpacity", "strokeWidth", "suffix", "symbols", "syntax", "system", "tabSize", "tableLayout", "textAlign", "textAlignLast", "textAnchor", "textAutospace", "textBox", "textBoxEdge", "textBoxTrim", "textCombineUpright", "textDecoration", "textDecorationColor", "textDecorationLine", "textDecorationSkipInk", "textDecorationStyle", "textDecorationThickness", "textEmphasis", "textEmphasisColor", "textEmphasisPosition", "textEmphasisStyle", "textIndent", "textOrientation", "textOverflow", "textRendering", "textShadow", "textSizeAdjust", "textSpacingTrim", "textTransform", "textUnderlineOffset", "textUnderlinePosition", "textWrap", "textWrapMode", "textWrapStyle", "timelineScope", "top", "touchAction", "transform", "transformBox", "transformOrigin", "transformStyle", "transition", "transitionBehavior", "transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction", "translate", "types", "unicodeBidi", "unicodeRange", "userSelect", "vectorEffect", "verticalAlign", "viewTimeline", "viewTimelineAxis", "viewTimelineInset", "viewTimelineName", "viewTransitionClass", "viewTransitionGroup", "viewTransitionName", "visibility", "webkitAlignContent", "webkitAlignItems", "webkitAlignSelf", "webkitAnimation", "webkitAnimationDelay", "webkitAnimationDirection", "webkitAnimationDuration", "webkitAnimationFillMode", "webkitAnimationIterationCount", "webkitAnimationName", "webkitAnimationPlayState", "webkitAnimationTimingFunction", "webkitAppRegion", "webkitAppearance", "webkitBackfaceVisibility", "webkitBackgroundClip", "webkitBackgroundOrigin", "webkitBackgroundSize", "webkitBorderAfter", "webkitBorderAfterColor", "webkitBorderAfterStyle", "webkitBorderAfterWidth", "webkitBorderBefore", "webkitBorderBeforeColor", "webkitBorderBeforeStyle", "webkitBorderBeforeWidth", "webkitBorderBottomLeftRadius", "webkitBorderBottomRightRadius", "webkitBorderEnd", "webkitBorderEndColor", "webkitBorderEndStyle", "webkitBorderEndWidth", "webkitBorderHorizontalSpacing", "webkitBorderImage", "webkitBorderRadius", "webkitBorderStart", "webkitBorderStartColor", "webkitBorderStartStyle", "webkitBorderStartWidth", "webkitBorderTopLeftRadius", "webkitBorderTopRightRadius", "webkitBorderVerticalSpacing", "webkitBoxAlign", "webkitBoxDecorationBreak", "webkitBoxDirection", "webkitBoxFlex", "webkitBoxOrdinalGroup", "webkitBoxOrient", "webkitBoxPack", "webkitBoxReflect", "webkitBoxShadow", "webkitBoxSizing", "webkitClipPath", "webkitColumnBreakAfter", "webkitColumnBreakBefore", "webkitColumnBreakInside", "webkitColumnCount", "webkitColumnGap", "webkitColumnRule", "webkitColumnRuleColor", "webkitColumnRuleStyle", "webkitColumnRuleWidth", "webkitColumnSpan", "webkitColumnWidth", "webkitColumns", "webkitFilter", "webkitFlex", "webkitFlexBasis", "webkitFlexDirection", "webkitFlexFlow", "webkitFlexGrow", "webkitFlexShrink", "webkitFlexWrap", "webkitFontFeatureSettings", "webkitFontSmoothing", "webkitHyphenateCharacter", "webkitJustifyContent", "webkitLineBreak", "webkitLineClamp", "webkitLocale", "webkitLogicalHeight", "webkitLogicalWidth", "webkitMarginAfter", "webkitMarginBefore", "webkitMarginEnd", "webkitMarginStart", "webkitMask", "webkitMaskBoxImage", "webkitMaskBoxImageOutset", "webkitMaskBoxImageRepeat", "webkitMaskBoxImageSlice", "webkitMaskBoxImageSource", "webkitMaskBoxImageWidth", "webkitMaskClip", "webkitMaskComposite", "webkitMaskImage", "webkitMaskOrigin", "webkitMaskPosition", "webkitMaskPositionX", "webkitMaskPositionY", "webkitMaskRepeat", "webkitMaskSize", "webkitMaxLogicalHeight", "webkitMaxLogicalWidth", "webkitMinLogicalHeight", "webkitMinLogicalWidth", "webkitOpacity", "webkitOrder", "webkitPaddingAfter", "webkitPaddingBefore", "webkitPaddingEnd", "webkitPaddingStart", "webkitPerspective", "webkitPerspectiveOrigin", "webkitPerspectiveOriginX", "webkitPerspectiveOriginY", "webkitPrintColorAdjust", "webkitRtlOrdering", "webkitRubyPosition", "webkitShapeImageThreshold", "webkitShapeMargin", "webkitShapeOutside", "webkitTapHighlightColor", "webkitTextCombine", "webkitTextDecorationsInEffect", "webkitTextEmphasis", "webkitTextEmphasisColor", "webkitTextEmphasisPosition", "webkitTextEmphasisStyle", "webkitTextFillColor", "webkitTextOrientation", "webkitTextSecurity", "webkitTextSizeAdjust", "webkitTextStroke", "webkitTextStrokeColor", "webkitTextStrokeWidth", "webkitTransform", "webkitTransformOrigin", "webkitTransformOriginX", "webkitTransformOriginY", "webkitTransformOriginZ", "webkitTransformStyle", "webkitTransition", "webkitTransitionDelay", "webkitTransitionDuration", "webkitTransitionProperty", "webkitTransitionTimingFunction", "webkitUserDrag", "webkitUserModify", "webkitUserSelect", "webkitWritingMode", "whiteSpace", "whiteSpaceCollapse", "widows", "width", "willChange", "wordBreak", "wordSpacing", "wordWrap", "writingMode", "x", "y", "zIndex", "zoom"].forEach(e => { if ("translate" === e) return; const t = function (e) { if (!(e in document.createElement("div").style)) return "invalid"; switch (e) { case "gap": case "borderRadius": case "width": case "height": case "maxWidth": case "maxHeight": case "minWidth": case "minHeight": case "left": case "top": case "bottom": case "right": case "padding": case "paddingLeft": case "paddingTop": case "paddingBottom": case "paddingRight": case "margin": case "marginLeft": case "marginTop": case "marginBottom": case "marginRight": case "textUnderlineOffset": case "letterSpacing": return "unit-number"; default: return "string" } }(e); switch (t) { case "unit-number": HTMLElement.prototype[e] = StyleFunction(function (t, n = "px") { if ("auto" === t) return this.style[e] = t, this; if (this.style[e] = t + n, "" !== t && "" === this.style[e]) throw new Error(`Invalid CSS value for ${e}: ` + t + n); return this }); break; case "string": HTMLElement.prototype[e] = StyleFunction(function (t) { if (this.style[e] = t, "" !== t && "" === this.style[e]) throw new Error(`Invalid CSS value for ${e}: ` + t); return this }) } }) } function StyleFunction(e) { let t = function (n, i = "px") { return "function" == typeof n ? (this.setUpState(t, n), this) : (e.call(this, n, i), this) }; return t } function checkPositionType(e) { let t = window.getComputedStyle(e).position; "absolute" !== t && "fixed" !== t && (e.style.position = "absolute") } function _storeListener(e, t, n, i) { e.__listeners || (e.__listeners = []); const r = JSON.stringify(i), o = e.__listeners.findIndex(e => e.type === t && e.handler.toString() === n.toString() && JSON.stringify(e.options) === r); if (-1 === o) e.addEventListener(t, n, i), e.__listeners.push({ type: t, handler: n, options: i }); else { const r = e.__listeners[o]; e.removeEventListener(r.type, r.handler, r.options), e.addEventListener(t, n, i), e.__listeners[o] = { type: t, handler: n, options: i } } } history.pushState = function () { let e = oldPushState.apply(this, arguments); return window.dispatchEvent(new Event("pushstate")), window.dispatchEvent(new Event("navigate")), e }, window.addEventListener("popstate", () => { window.dispatchEvent(new Event("navigate")) }), window.setQuery = function (e, t) { const n = new URL(window.location.href), i = n.searchParams; null == t ? i.delete(e) : i.set(e, t); const r = n.toString(); return history.replaceState(null, "", r), window.dispatchEvent(new Event("query-changed")), r }, window.navigateTo = function (e) { window.dispatchEvent(new Event("navigate")), window.history.pushState({}, "", e) }, HTMLElement.prototype.$ = function (e) { return window.$(e, this) }, DocumentFragment.prototype.$ = function (e) { return window.$(e, this) }, window.$ = function (e, t = document) { return t.querySelector(e) }, window.$$ = function (e, t = document) { return Array.from(t.querySelectorAll(e)) }, HTMLElement.prototype.$$ = function (e) { return window.$$(e, this) }, DocumentFragment.prototype.$$ = function (e) { return window.$$(e, this) }, console.red = function (e) { this.log(`%c${e}`, "color: rgb(254, 79, 42);") }, console.green = function (e) { this.log(`%c${e}`, "color: rgb(79, 254, 42);") }, window.darkMode = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches, document.documentElement.classList.add(darkMode ? "dark" : "light"), window.getColor = function (e) { const t = getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim(); if (!t) throw new Error("Color not found"); return t }, window.isMobile = function () { return /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(navigator.userAgent) }, window.css = function (e) { let t = document.querySelector("style#pageStyle"); t || (t = document.createElement("style"), t.id = "pageStyle", document.head.appendChild(t)); let n = e.substring(0, e.indexOf("{")).trim(); n = n.replace(/\*/g, "all"), n = n.replace(/#/g, "id-"), n = n.replace(/,/g, ""); let i = t.querySelector(`:scope > style[id='${n}']`); i ? i.innerText = e : (i = document.createElement("style"), i.id = n, i.appendChild(document.createTextNode(e)), t.appendChild(i)) }, window.html = function (e) { return (new DOMParser).parseFromString(e, "text/html").body.firstChild }, window.util = {}, window.util.observeClassChange = (e, t) => { if (!(e && e instanceof Element)) throw new Error("observeClassChange requires a valid DOM element."); const n = new MutationObserver(n => { for (const i of n) "attributes" === i.type && "class" === i.attributeName && t(e.classList) }); return n.observe(e, { attributes: !0, attributeFilter: ["class"] }), n }, Object.defineProperty(Array.prototype, "last", { get() { return this[this.length - 1] }, enumerable: !1 }), window.quill = { rendering: [], lastState: null, render: e => { if (e instanceof Shadow) { let t = quill.rendering[quill.rendering.length - 1]; t || (t = document.body), t.appendChild(e) } else { e.render || (e.render = () => { }); let t = quill.rendering[quill.rendering.length - 1]; if (!t) throw new Error("Quill: no parent for element"); t.appendChild(e) } quill.rendering.push(e), e.render(), quill.rendering.pop(e) }, rerender: e => { Array.from(e.attributes).forEach(t => e.removeAttribute(t.name)), e.innerHTML = "", e.removeAllListeners(), quill.rendering.push(e), e.render(), quill.rendering.pop() }, isStack: e => e.classList.contains("HStack") || e.classList.contains("ZStack") || e.classList.contains("VStack") }, window.Shadow = class extends HTMLElement { constructor() { super() } }, window.register = (e, t) => { if ("function" != typeof e.prototype.render) throw new Error("Element must have a render: " + e.prototype.constructor.name); t || (t = e.prototype.constructor.name.toLowerCase() + "-"), customElements.define(t, e), e.css && css(e.css), window[e.prototype.constructor.name] = function (...t) { let n = new e(...t); if (n.state) { const o = new WeakMap; function i(e, t = []) { if (e && "object" == typeof e) { if (o.has(e)) return o.get(e); const a = new Proxy(e, function (e) { return { get(t, n, o) { if ("symbol" == typeof n) return Reflect.get(t, n, o); let a = Array.isArray(t) && !r(n) ? e : e.concat(n); quill.lastState = a.join("."); return i(Reflect.get(t, n, o), a) }, set(t, i, o, a) { const l = Array.isArray(t) ? t.length : void 0; if (t[i] === o) return !0; const s = Reflect.set(t, i, o, a); let c = !Array.isArray(t) || r(i) && t.length === l ? e.concat(i).join(".") : e; const d = n.stateWatchers[c]; return d && d.forEach(e => e()), s } } }(t)); return o.set(e, a), a } return e } function r(e) { return "string" == typeof e && "" !== e && String(+e) === e } let a = i(n.state); Object.defineProperty(n, "state", { value: a, writable: !1, configurable: !1, enumerable: !0 }); let l = {}; Object.keys(n.state).forEach(e => l[e] = []), Object.defineProperty(n, "stateWatchers", { value: l, writable: !1, configurable: !1, enumerable: !0 }) } return quill.render(n), n } }, HTMLElement.prototype.rerender = function () { quill.rerender(this) }, window.pct = "%", window.vmin = "vmin", window.vmax = "vmax", window.vh = "vh", window.vw = "vw", window.px = "px", window.em = "em", window.rem = "rem", window.inches = "in", HTMLElement.prototype.addStyle = function (e) { return e(this) }, window.css = function (e) { let t = document.querySelector("style#pageStyle"); t || (t = document.createElement("style"), t.id = "pageStyle", document.head.appendChild(t)); let n = e.substring(0, e.indexOf("{")).trim(); n = n.replace(/\*/g, "all"), n = n.replace(/#/g, "id-"), n = n.replace(/,/g, ""); let i = t.querySelector(`:scope > style[id='${n}']`); i ? i.innerText = e : (i = document.createElement("style"), i.id = n, i.appendChild(document.createTextNode(e)), t.appendChild(i)) }, extendHTMLElementWithStyleSetters(), HTMLElement.prototype.addStateWatcher = function (e, t) { let n = this; for (; !(n instanceof Shadow);)n = n.parentNode; n.stateWatchers[e].push(t) }, HTMLElement.prototype.setUpState = function (e, t) { let n = e => Array.isArray(e) ? e : [e], i = n(t()); if (!quill.lastState) throw new Error("Quill: style state function does not access valid state"); this.addStateWatcher(quill.lastState, () => { e.call(this, ...n(t())) }), quill.lastState = null, e.call(this, ...i) }, HTMLElement.prototype.styles = function (e) { return e.call(this, this), this }, HTMLElement.prototype.paddingVertical = StyleFunction(function (e, t = "px") { return this.style.paddingTop = e + t, this.style.paddingBottom = e + t, this }), HTMLElement.prototype.paddingHorizontal = StyleFunction(function (e, t = "px") { return this.style.paddingRight = e + t, this.style.paddingLeft = e + t, this }), HTMLElement.prototype.marginVertical = StyleFunction(function (e, t = "px") { return this.style.marginTop = e + t, this.style.marginBottom = e + t, this }), HTMLElement.prototype.marginHorizontal = StyleFunction(function (e, t = "px") { return this.style.marginRight = e + t, this.style.marginLeft = e + t, this }), HTMLElement.prototype.borderVertical = StyleFunction(function (e) { return this.style.borderTop = e, this.style.borderBottom = e, this }), HTMLElement.prototype.borderHorizontal = StyleFunction(function (e) { return this.style.borderRight = e, this.style.borderLeft = e, this }), HTMLElement.prototype.fontSize = StyleFunction(function (e, t = "px") { switch (e) { case "6xl": e = "3.75", t = "rem"; break; case "5xl": e = "3", t = "rem"; break; case "4xl": e = "2.25", t = "rem"; break; case "3xl": e = "1.875", t = "rem"; break; case "2xl": e = "1.5", t = "rem"; break; case "xl": e = "1.25", t = "rem"; break; case "l": e = "1.125", t = "rem"; break; case "s": e = "0.875", t = "rem"; break; case "xs": e = "0.75", t = "rem" }return this.style.fontSize = e + t, this }), HTMLElement.prototype.width = function (e, t = "px") { if ("number" != typeof e && "auto" !== e || Number.isNaN(e)) throw new Error(`Invalid value: ${e}. Expected a number.`); return this.style.width = e + t, "inline" === window.getComputedStyle(this).display && (this.style.display = "block"), this }, HTMLElement.prototype.height = function (e, t = "px") { if ("number" != typeof e && "auto" !== e || Number.isNaN(e)) throw new Error(`Invalid value: ${e}. Expected a number.`); return this.style.height = e + t, "inline" === window.getComputedStyle(this).display && (this.style.display = "block"), this }, HTMLElement.prototype.x = function (e, t = "px") { if ("number" != typeof e || isNaN(e)) throw new Error(`Invalid value: ${e}. Expected a number.`); return checkPositionType(this), this.style.left = e + t, this }, HTMLElement.prototype.y = function (e, t = "px") { if ("number" != typeof e || isNaN(e)) throw new Error(`Invalid value: ${e}. Expected a number.`); return checkPositionType(this), this.style.top = e + t, this }, HTMLElement.prototype.xRight = function (e, t = "px") { if ("number" != typeof e || isNaN(e)) throw new Error(`Invalid value: ${e}. Expected a number.`); return checkPositionType(this), this.style.right = e + t, this }, HTMLElement.prototype.yBottom = function (e, t = "px") { if ("number" != typeof e || isNaN(e)) throw new Error(`Invalid value: ${e}. Expected a number.`); return checkPositionType(this), this.style.bottom = e + t, this }, HTMLElement.prototype.backgroundImage = function (...e) { const t = e.map(e => (e.includes("/") && !e.includes("gradient") && (e = "url(" + e + ")"), String(e).trim())).join(", "); return this.style.backgroundImage = t, this }, HTMLElement.prototype.center = function () { return this.style.transform = "translate(-50%, -50%)", this }, HTMLElement.prototype.centerX = function () { return this.style.transform = "translateX(-50%)", this }, HTMLElement.prototype.centerY = function () { return this.style.transform = "translateY(-50%)", this }, HTMLElement.prototype.verticalAlign = function (e) { const t = getComputedStyle(this).flexDirection; if (!t) throw new Error("verticalAlign can be only be used on HStacks or VStacks!"); return "column" === t || "column-reverse" === t ? this.style.justifyContent = e : this.style.alignItems = e, this }, HTMLElement.prototype.horizontalAlign = function (e) { const t = getComputedStyle(this).flexDirection; if (!t) throw new Error("horizontalAlign can be only be used on HStacks or VStacks!"); return "column" === t || "column-reverse" === t ? this.style.alignItems = e : this.style.justifyContent = e, this }, quill.setChildren = function (e, t) { if ("string" == typeof t) e.innerText = t; else { if ("function" != typeof t) throw new Error("Children of unknown type"); e.render = t } }, window.a = function (e, t = e) { if (!e) throw new Error("quill a: missing href argument. Function: a( href, inner=href )"); let n = document.createElement("a"); return n.setAttribute("href", e), quill.setChildren(n, t), quill.render(n), n }, window.img = function (e, t = "", n = "") { let i = document.createElement("img"); if (!e || "string" != typeof e) throw new Error("img: missing first argument: src | String"); return i.src = e, t && "string" == typeof t ? i.style.width = t : t && (i.style.width = t + "px"), n && "string" == typeof n ? i.style.height = n : n && (i.style.height = n + "px"), quill.render(i), i }, HTMLImageElement.prototype.backgroundColor = function (e) { return this.src.endsWith(".svg") || this.src.startsWith("data:image/svg+xml") ? fetch(this.src).then(e => e.text()).then(t => { const n = t.replace(/\bfill="[^"]*"/g, `fill="${e}"`), i = new Blob([n], { type: "image/svg+xml" }); this.src = URL.createObjectURL(i) }).catch(e => { console.error("Error updating SVG fill:", e) }) : this.style.backgroundColor = e, this }, window.p = function (e) { let t = document.createElement("p"); return "function" == typeof innerText ? t.render = e : t.innerHTML = e, t.style.margin = "0", quill.render(t), t }, window.h1 = function (e) { let t = document.createElement("h1"); return t.innerText = e, quill.render(t), t }, window.h2 = function (e) { let t = document.createElement("h2"); return t.innerText = e, quill.render(t), t }, window.h3 = function (e) { let t = document.createElement("h3"); return t.innerText = e, quill.render(t), t }, window.div = function (e) { let t = document.createElement("div"); return t.innerText = e ?? "", quill.render(t), t }, window.span = function (e) { let t = document.createElement("span"); return t.innerText = e, quill.render(t), t }, window.button = function (e = "") { let t = document.createElement("button"); return quill.setChildren(t, e), quill.render(t), t }, window.form = function (e) { let t = document.createElement("form"); return t.render = e, quill.render(t), t }, window.input = function (e = "", t, n) { let i = document.createElement("input"); return i.placeholder = e, i.style.width = t, i.style.height = n, quill.render(i), i }, window.label = function (e) { let t = document.createElement("label"); return "string" == typeof e ? t.innerText = e : t.render = e, quill.render(t), t }, window.textarea = function (e = "") { let t = document.createElement("textarea"); return t.placeholder = e, quill.render(t), t }, handleStack = function (e, t, n = "") { let i = quill.rendering[quill.rendering.length - 1]; if ("" !== i.innerHTML.trim() || quill.isStack(i)) { let i = document.createElement("div"); return i.classList.add(t), i.style.cssText += n, i.render = e, quill.render(i), i } return i.style.cssText += n, i.classList.add(t), e(), quill.lastState && i.addStateWatcher(quill.lastState, () => { i.innerHTML = "", e() }), i }, window.VStack = function (e = () => { }) { return handleStack(e, "VStack", "\n display: flex;\n flex-direction: column;\n ") }, window.HStack = function (e = () => { }) { return handleStack(e, "HStack", "\n display: flex;\n flex-direction: row;\n ") }, window.ZStack = function (e = () => { }) { return handleStack(e, "ZStack") }, window.svgMethods = function (e) { e.pulse = function (e = 600) { return this.style.transition = `transform ${e}ms ease-in-out`, this.style.transform = "scale(1.2)", setTimeout(() => { this.style.transform = "scale(1)" }, e / 2), this }, e.rotate = function (e = 360, t = 1e3) { return this.style.transition = `transform ${t}ms linear`, this.style.transform = `rotate(${e}deg)`, this }, e.fill = function (e) { return this.setAttribute("fill", e), this }, e.height = function (e) { return this.setAttribute("height", e), this }, e.width = function (e) { return this.setAttribute("width", e), this }, e.stroke = function (e, t) { return this.setAttribute("stroke", t), this.setAttribute("stroke-width", e), this }, e.toggle = function () { return this.style.display = "none" === this.style.display ? "" : "none", this } }, window.Rectangle = function (e = "40px", t = "40px") { const n = "http://www.w3.org/2000/svg", i = document.createElementNS(n, "svg"), r = document.createElementNS(n, "rect"); return i.setAttribute("width", e), i.setAttribute("height", t), i.setAttribute("viewBox", "0 0 100 100"), i.setAttribute("preserveAspectRatio", "xMidYMid meet"), r.setAttribute("x", "15"), r.setAttribute("y", "15"), r.setAttribute("width", "70"), r.setAttribute("height", "70"), i.appendChild(r), svgMethods(i), quill.render(i), i }, window.Triangle = function (e = "40px", t = "40px") { const n = "http://www.w3.org/2000/svg", i = document.createElementNS(n, "svg"), r = document.createElementNS(n, "path"); return i.setAttribute("width", e), i.setAttribute("height", t), i.setAttribute("viewBox", "0 0 100 100"), i.setAttribute("preserveAspectRatio", "xMidYMid meet"), r.setAttribute("d", "M 25 15 L 90 50 L 25 85 Z"), i.appendChild(r), svgMethods(i), quill.render(i), i }, HTMLElement.prototype.onAppear = function (e) { return e.call(this), this }, HTMLElement.prototype.onClick = function (e) { return this._storeListener("mousedown", t => e.call(this, !1, t)), this._storeListener("mouseup", t => e.call(this, !0, t)), this }, HTMLElement.prototype.onMouseDown = function (e) { return this._storeListener("mousedown", e), this }, HTMLElement.prototype.onMouseUp = function (e) { return this._storeListener("mouseup", e), this }, HTMLElement.prototype.onRightClick = function (e) { return this._storeListener("contextmenu", e), this }, HTMLElement.prototype.onHover = function (e) { return this._storeListener("mouseover", t => e.call(this, !0, t)), this._storeListener("mouseleave", t => e.call(this, !1, t)), this }, HTMLElement.prototype.onFocus = function (e) { if (!this.matches("input, textarea, select, button")) throw new Error("Can't put focus event on non-form element!"); return this._storeListener("focus", () => e.call(this, !0)), this._storeListener("blur", () => e.call(this, !1)), this }, HTMLElement.prototype.onKeyDown = function (e) { return this._storeListener("keydown", e), this }, HTMLElement.prototype.onInput = function (e) { if (!this.matches('input, textarea, [contenteditable=""], [contenteditable="true"]')) throw new Error("Can't put input event on non-input element!"); return this._storeListener("input", e), this }, HTMLElement.prototype.onChange = function (e) { if (!this.matches('input, textarea, [contenteditable=""], [contenteditable="true"]')) throw new Error("Can't put input event on non-input element!"); return this._storeListener("change", e), this }, HTMLElement.prototype.onSubmit = function (e) { if (!this.matches("form")) throw new Error("Can't put form event on non-form element!"); return this._storeListener("submit", e), this }, HTMLElement.prototype.onTouch = function (e) { return this._storeListener("touchstart", () => e.call(this, !0)), this._storeListener("touchend", () => e.call(this, !1)), this._storeListener("touchcancel", () => e.call(this, null)), this }, HTMLElement.prototype.onTap = function (e) { return this._storeListener("touchend", e), this }, navigateListeners = [], window.addEventListener("navigate", () => { for (entry of navigateListeners) entry.el.dispatchEvent(new CustomEvent("navigate")) }), HTMLElement.prototype.onNavigate = function (e) { this._storeListener("navigate", e); let t = !1, n = Array.from(this.parentNode.children).indexOf(this); for (entry of navigateListeners) if (entry.cb.toString() === e.toString() && entry.index === n && this.nodeName === entry.el.nodeName) { t = !0; break } return !1 === t && navigateListeners.push({ el: this, cb: e, index: n }), this }, queryListeners = [], HTMLElement.prototype.onQueryChanged = function (e) { this._storeListener("query-changed", e); let t = !1; for (entry of queryListeners) if (entry.cb.toString() === e.toString() && this.nodeName === entry.el.nodeName) { t = !0; break } return !1 === t && queryListeners.push({ el: this, cb: e }), this }, window.addEventListener("query-changed", () => { for (entry of queryListeners) entry.el.dispatchEvent(new CustomEvent("query-changed")) }), HTMLElement.prototype.onEvent = function (e, t) { return window._storeListener(window, e, t), this }, HTMLElement.prototype._storeListener = function (e, t, n) { window._storeListener(this, e, t, n) }, window.__listeners = [], HTMLElement.prototype.removeAllListeners = function () { if (this.__listeners) { for (const { type: e, handler: t, options: n } of this.__listeners) this.removeEventListener(e, t, n); return this.__listeners = [], this } }, HTMLElement.prototype.attr = function (e) { if ("object" != typeof e || null === e || Array.isArray(e)) throw new TypeError("attr() expects an object with key-value pairs"); for (const [t, n] of Object.entries(e)) this.setAttribute(t, n); return this };