This commit is contained in:
浪子
2024-11-08 14:57:59 +08:00
parent c606be86a6
commit 4e3310f10b
24 changed files with 35 additions and 36 deletions
+4 -4
View File
@@ -34,9 +34,9 @@
</style>
<script>(self.Astro || (self.Astro = {})).load=async t => { await (await t())() }, window.dispatchEvent(new Event("astro:load")), (() => { var t = Object.defineProperty, e = (e, r, n) => ((e, r, n) => r in e ? t(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n)(e, "symbol" != typeof r ? r + "" : r, n); { let t = { 0: t => s(t), 1: t => n(t), 2: t => new RegExp(t), 3: t => new Date(t), 4: t => new Map(n(t)), 5: t => new Set(n(t)), 6: t => BigInt(t), 7: t => new URL(t), 8: t => new Uint8Array(t), 9: t => new Uint16Array(t), 10: t => new Uint32Array(t) }, r = e => { let [r, n] = e; return r in t ? t[r](n) : void 0 }, n = t => t.map(r), s = t => "object" != typeof t || null === t ? t : Object.fromEntries(Object.entries(t).map((([t, e]) => [t, r(e)]))); class i extends HTMLElement { constructor() { super(...arguments), e(this, "Component"), e(this, "hydrator"), e(this, "hydrate", (async () => { var t; if (!this.hydrator || !this.isConnected) return; let e = null == (t = this.parentElement) ? void 0 : t.closest("astro-island[ssr]"); if (e) return void e.addEventListener("astro:hydrate", this.hydrate, { once: !0 }); let r, n = this.querySelectorAll("astro-slot"), i = {}, o = this.querySelectorAll("template[data-astro-template]"); for (let t of o) { let e = t.closest(this.tagName); null != e && e.isSameNode(this) && (i[t.getAttribute("data-astro-template") || "default"] = t.innerHTML, t.remove()) } for (let t of n) { let e = t.closest(this.tagName); null != e && e.isSameNode(this) && (i[t.getAttribute("name") || "default"] = t.innerHTML) } try { r = this.hasAttribute("props") ? s(JSON.parse(this.getAttribute("props"))) : {} } catch (t) { let e = this.getAttribute("component-url") || "<unknown>", r = this.getAttribute("component-export"); throw r && (e += ` (export ${r})`), console.error(`[hydrate] Error parsing props for component ${e}`, this.getAttribute("props"), t), t } await this.hydrator(this)(this.Component, r, i, { client: this.getAttribute("client") }), this.removeAttribute("ssr"), this.dispatchEvent(new CustomEvent("astro:hydrate")) })), e(this, "unmount", (() => { this.isConnected || this.dispatchEvent(new CustomEvent("astro:unmount")) })) } disconnectedCallback() { document.removeEventListener("astro:after-swap", this.unmount), document.addEventListener("astro:after-swap", this.unmount, { once: !0 }) } connectedCallback() { if (this.hasAttribute("await-children") && "interactive" !== document.readyState && "complete" !== document.readyState) { let t = () => { document.removeEventListener("DOMContentLoaded", t), e.disconnect(), this.childrenConnectedCallback() }, e = new MutationObserver((() => { var e; (null == (e = this.lastChild) ? void 0 : e.nodeType) === Node.COMMENT_NODE && "astro:end" === this.lastChild.nodeValue && (this.lastChild.remove(), t()) })); e.observe(this, { childList: !0 }), document.addEventListener("DOMContentLoaded", t) } else this.childrenConnectedCallback() } async childrenConnectedCallback() { let t = this.getAttribute("before-hydration-url"); t && await import(t), this.start() } async start() { let t = JSON.parse(this.getAttribute("opts")), e = this.getAttribute("client"); if (void 0 !== Astro[e]) try { await Astro[e]((async () => { let t = this.getAttribute("renderer-url"), [e, { default: r }] = await Promise.all([import(this.getAttribute("component-url")), t ? import(t) : () => () => { }]), n = this.getAttribute("component-export") || "default"; if (n.includes(".")) { this.Component = e; for (let t of n.split(".")) this.Component = this.Component[t] } else this.Component = e[n]; return this.hydrator = r, this.hydrate }), t, this) } catch (t) { console.error(`[astro-island] Error hydrating ${this.getAttribute("component-url")}`, t) } else window.addEventListener(`astro:${e}`, (() => this.start()), { once: !0 }) } attributeChangedCallback() { this.hydrate() } } e(i, "observedAttributes", ["props"]), customElements.get("astro-island") || customElements.define("astro-island", i) } })()</script>
<astro-island await-children="" client=load component-export=default
component-url="<?php $this->options->themeUrl('/_astro/LightDarkSwitch.CrseSjSX.js'); ?>"
component-url="<?php $this->options->themeUrl('/assets/js/LightDarkSwitch.js'); ?>"
opts={&quot;name&quot;:&quot;LightDarkSwitch&quot;,&quot;value&quot;:true} props={}
renderer-url="<?php $this->options->themeUrl('/_astro/client.Cx1FBVJX.js'); ?>" ssr="" uid=ilJcP>
renderer-url="<?php $this->options->themeUrl('/assets/js/client.js'); ?>" ssr="" uid=ilJcP>
<div class="relative z-50" role=menu tabindex=-1>
<button
@@ -113,9 +113,9 @@
<script>(self.Astro || (self.Astro = {})).only = async t => { await (await t())() }, window.dispatchEvent(new Event("astro:only"))</script>
<astro-island await-children="" client=only component-export=default
component-url="<?php $this->options->themeUrl('/_astro/DisplaySettings.DzxJq6Tk.js'); ?>"
component-url="<?php $this->options->themeUrl('/assets/js/DisplaySettings.js'); ?>"
opts={&quot;name&quot;:&quot;DisplaySettings&quot;,&quot;value&quot;:&quot;svelte&quot;}
props={} renderer-url="<?php $this->options->themeUrl('/_astro/client.Cx1FBVJX.js'); ?>" ssr="" uid=Z114tL9>
props={} renderer-url="<?php $this->options->themeUrl('/assets/js/client.js'); ?>" ssr="" uid=Z114tL9>
<template
data-astro-template=restore-icon>
<svg data-icon=fa6-solid:arrow-rotate-left height=0.875rem