mancha 0.9.0 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,15 +3,11 @@ import { JSDOM } from "jsdom";
3
3
  import { IRenderer } from "./core.js";
4
4
  export class Renderer extends IRenderer {
5
5
  parseHTML(content, params = { rootDocument: false }) {
6
- const dom = new JSDOM();
7
6
  if (params.rootDocument) {
8
- const DOMParser = dom.window.DOMParser;
9
- return new DOMParser().parseFromString(content, "text/html");
7
+ return new JSDOM(content).window.document;
10
8
  }
11
9
  else {
12
- const range = dom.window.document.createRange();
13
- range.selectNodeContents(dom.window.document.body);
14
- return range.createContextualFragment(content);
10
+ return JSDOM.fragment(content);
15
11
  }
16
12
  }
17
13
  serializeHTML(root) {
@@ -19,6 +15,12 @@ export class Renderer extends IRenderer {
19
15
  const XMLSerializer = dom.window.XMLSerializer;
20
16
  return new XMLSerializer().serializeToString(root).replace(/\s?xmlns="[^"]+"/gm, "");
21
17
  }
18
+ createElement(tag, owner) {
19
+ return (owner || new JSDOM().window.document).createElement(tag);
20
+ }
21
+ textContent(node, content) {
22
+ node.textContent = content;
23
+ }
22
24
  async fetchLocal(fpath, params) {
23
25
  return fs.readFile(fpath, { encoding: params?.encoding || "utf8" });
24
26
  }
@@ -1,10 +1,9 @@
1
- /// <reference types="node" />
2
1
  import { IRenderer } from "./core.js";
3
2
  export interface ParserParams {
4
3
  /** Whether the file parsed is a root document, or a document fragment. */
5
4
  rootDocument?: boolean;
6
5
  /** Encoding to use when processing local files. */
7
- encoding?: BufferEncoding;
6
+ encoding?: "ascii" | "utf8";
8
7
  }
9
8
  /** The RendererParams interface defines the parameters that can be passed to the renderer. */
10
9
  export interface RenderParams {
@@ -0,0 +1,3 @@
1
+ import { Renderer } from "./browser.js";
2
+ declare const Mancha: Renderer;
3
+ export default Mancha;
package/dist/mancha.js CHANGED
@@ -1 +1,88 @@
1
- (()=>{"use strict";var t={654:(t,e,n)=>{n.d(e,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([t.id,"html{max-width:70ch;padding:2em 1em;margin:auto;line-height:1.75;font-size:1.25em;font-family:sans-serif}h1,h2,h3,h4,h5,h6{margin:1em 0 .5em}ol,p,ul{margin-bottom:1em;color:#1d1d1d}",""]);const a=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,i,o){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);r&&s[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{class t{iterable;constructor(t){this.iterable=t}filter(e){return new t(t.filterGenerator(e,this.iterable))}map(e){return new t(t.mapGenerator(e,this.iterable))}find(t){for(const e of this.iterable)if(t(e))return e}array(){return Array.from(this.iterable)}*generator(){for(const t of this.iterable)yield t}static*filterGenerator(t,e){for(const n of e)t(n)&&(yield n)}static*mapGenerator(t,e){for(const n of e)yield t(n)}static equals(t,e){const n=t[Symbol.iterator](),r=e[Symbol.iterator]();let i=n.next(),o=r.next();for(;!i.done&&!o.done;){if(i.value!==o.value)return!1;i=n.next(),o=r.next()}return i.done===o.done}}var e,r;(r=e||(e={})).Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype",e.Root,e.Text,e.Directive,e.Comment,e.Script,e.Style,e.Tag,e.CDATA,e.Doctype;class i{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return p(this,t)}}class o extends i{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}}class s extends o{constructor(){super(...arguments),this.type=e.Text}get nodeType(){return 3}}class a extends o{constructor(){super(...arguments),this.type=e.Comment}get nodeType(){return 8}}class c extends o{constructor(t,n){super(n),this.name=t,this.type=e.Directive}get nodeType(){return 1}}class l extends i{constructor(t){super(),this.children=t}get firstChild(){var t;return null!==(t=this.children[0])&&void 0!==t?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}}class u extends l{constructor(){super(...arguments),this.type=e.CDATA}get nodeType(){return 4}}class h extends l{constructor(){super(...arguments),this.type=e.Root}get nodeType(){return 9}}class d extends l{constructor(t,n,r=[],i=("script"===t?e.Script:"style"===t?e.Style:e.Tag)){super(r),this.name=t,this.attribs=n,this.type=i}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map((t=>{var e,n;return{name:t,value:this.attribs[t],namespace:null===(e=this["x-attribsNamespace"])||void 0===e?void 0:e[t],prefix:null===(n=this["x-attribsPrefix"])||void 0===n?void 0:n[t]}}))}}function p(t,n=!1){let r;if(function(t){return t.type===e.Text}(t))r=new s(t.data);else if(function(t){return t.type===e.Comment}(t))r=new a(t.data);else if(function(t){return(n=t).type===e.Tag||n.type===e.Script||n.type===e.Style;var n}(t)){const e=n?f(t.children):[],i=new d(t.name,{...t.attribs},e);e.forEach((t=>t.parent=i)),null!=t.namespace&&(i.namespace=t.namespace),t["x-attribsNamespace"]&&(i["x-attribsNamespace"]={...t["x-attribsNamespace"]}),t["x-attribsPrefix"]&&(i["x-attribsPrefix"]={...t["x-attribsPrefix"]}),r=i}else if(function(t){return t.type===e.CDATA}(t)){const e=n?f(t.children):[],i=new u(e);e.forEach((t=>t.parent=i)),r=i}else if(function(t){return t.type===e.Root}(t)){const e=n?f(t.children):[],i=new h(e);e.forEach((t=>t.parent=i)),t["x-mode"]&&(i["x-mode"]=t["x-mode"]),r=i}else{if(!function(t){return t.type===e.Directive}(t))throw new Error(`Not implemented yet: ${t.type}`);{const e=new c(t.name,t.data);null!=t["x-name"]&&(e["x-name"]=t["x-name"],e["x-publicId"]=t["x-publicId"],e["x-systemId"]=t["x-systemId"]),r=e}}return r.startIndex=t.startIndex,r.endIndex=t.endIndex,null!=t.sourceCodeLocation&&(r.sourceCodeLocation=t.sourceCodeLocation),r}function f(t){const e=t.map((t=>p(t,!0)));for(let t=1;t<e.length;t++)e[t].prev=e[t-1],e[t-1].next=e[t];return e}function*m(t,e=new Set){const n=new Set,r=Array.from(t.childNodes).filter((t=>!e.has(t)));for(yield t;r.length;){const t=r.shift();n.has(t)||(n.add(t),yield t),t.childNodes&&Array.from(t.childNodes).filter((t=>!e.has(t))).forEach((t=>r.push(t)))}}function $(t,e){return"function"==typeof t?.[e]}function b(t,e){return t instanceof d?t.attribs?.[e]:t.getAttribute?.(e)}function g(t,e,n){t instanceof d?t.attribs[e]=n:t.setAttribute?.(e,n)}function x(t,e){t instanceof d?delete t.attribs[e]:t.removeAttribute?.(e)}function y(t,e,n){if(t instanceof d&&e instanceof d)e.attribs[n]=t.attribs[n];else{const r=t?.getAttributeNode?.(n);e?.setAttributeNode?.(r?.cloneNode(!0))}}function v(t,...e){if($(t,"replaceWith"))return t.replaceWith(...e);{const n=t,r=n.parentNode,i=Array.from(r.childNodes).indexOf(n);e.forEach((t=>t.parentNode=r)),r.childNodes=[].concat(Array.from(r.childNodes).slice(0,i)).concat(e).concat(Array.from(r.childNodes).slice(i+1))}}function w(t,e){return $(e,"appendChild")?t.appendChild(e):(t.childNodes.push(e),e.parentNode=t,e)}function N(t,e){if($(e,"removeChild"))return t.removeChild(e);{const n=e;return t.childNodes=t.children.filter((t=>t!==n)),n}}function A(t,e,n){return n?$(t,"insertBefore")?t.insertBefore(e,n):(v(n,e,n),e):w(t,e)}function j(t){return t instanceof i?t.data:t.nodeValue}function k(t,e=0){return t?t.length<=e?t:t.slice(0,e-1)+"…":""}function S(t,e=0){return k(t.outerHTML||j(t)||String(t),e)}window.htmlparser2;class C{timeouts=new Map;debounce(t,e){return new Promise(((n,r)=>{const i=this.timeouts.get(e);i&&clearTimeout(i),this.timeouts.set(e,setTimeout((()=>{try{n(e()),this.timeouts.delete(e)}catch(t){r(t)}}),t))}))}}class E extends C{evalkeys=["$elem","$event"];expressionCache=new Map;store=new Map;observers=new Map;_observer=null;_lock=Promise.resolve();constructor(t){super();for(let[e,n]of Object.entries(t||{}))this.set(e,n)}wrapFunction(t){return(...e)=>t.call(this.$,...e)}wrapObject(t,e){return null==t||(n=t)instanceof E||n.__is_proxy__||t.constructor!==Object&&!Array.isArray(t)?t:new Proxy(t,{deleteProperty:(t,n)=>n in t&&(delete t[n],e(),!0),set:(n,r,i,o)=>{"object"==typeof i&&null!=t&&(i=this.wrapObject(i,e));const s=Reflect.set(n,r,i,o);return e(),s},get:(t,e,n)=>"__is_proxy__"===e||Reflect.get(t,e,n)});var n}watch(t,e){this.observers.has(t)||this.observers.set(t,new Set),this.observers.get(t)?.has(e)||this.observers.get(t)?.add(e)}async notify(t,e=10){const n=Array.from(this.observers.get(t)||[]);await this.debounce(e,(()=>Promise.all(n.map((t=>t.call(this.proxify(t)))))))}get(t,e){return e&&this.watch(t,e),this.store.get(t)}async set(t,e){if(e===this.store.get(t))return;const n=()=>this.notify(t);e&&"function"==typeof e&&(e=this.wrapFunction(e)),e&&"object"==typeof e&&(e=this.wrapObject(e,n)),this.store.set(t,e),await n()}del(t){this.store.delete(t),this.observers.delete(t)}has(t){return this.store.has(t)}effect(t){return t.call(this.proxify(t))}proxify(t){const e=Array.from(this.store.entries()).map((([t])=>t)),n=Object.fromEntries(e.map((t=>[t,void 0])));return new Proxy(n,{get:(e,n,r)=>"string"==typeof n&&this.store.has(n)?this.get(n,t):"$"===n?this.proxify(t):Reflect.get(this,n,r),set:(t,e,n,r)=>("string"!=typeof e||e in this?Reflect.set(this,e,n,r):this.set(e,n),!0)})}get $(){return this.proxify()}cachedExpressionFunction(t){return this.expressionCache.has(t)||this.expressionCache.set(t,function(t,e=[]){return new Function(...e,`with (this) { return (${t}); }`)}(t,this.evalkeys)),this.expressionCache.get(t)}eval(t,e={}){const n=this._observer?this:this.$;if(this.store.has(t))return n[t];{const r=this.cachedExpressionFunction(t),i=this.evalkeys.map((t=>e[t]));if(Object.keys(e).some((t=>!this.evalkeys.includes(t))))throw new Error(`Invalid argument key, must be one of: ${this.evalkeys.join(", ")}`);return r.call(n,...i)}}}const _=new Set([":bind",":bind-events",":data",":for",":show","@watch","$html"]);var T;function M(t){return t.includes("/")?t.split("/").slice(0,-1).join("/"):""}function P(t){return!(t.includes("://")||t.startsWith("/")||t.startsWith("#")||t.startsWith("data:"))}!function(e){e.resolveIncludes=async function(t,e){const n=t;if("include"!==n.tagName?.toLocaleLowerCase())return;this.log("<include> tag found in:\n",S(t,128)),this.log("<include> params:",e);const r=b(n,"src");if(!r)throw new Error(`"src" attribute missing from ${t}.`);const i=e=>{const r=e.firstChild;for(const t of Array.from(n.attributes))r&&"src"!==t.name&&y(n,r,t.name);v(t,...e.childNodes)},o={...e,rootDocument:!1,maxdepth:e?.maxdepth-1};if(0===o.maxdepth)throw new Error("Maximum recursion depth reached.");if(r.includes("://")||r.startsWith("//"))this.log("Including remote file from absolute path:",r),await this.preprocessRemote(r,o).then(i);else if(e?.dirpath?.includes("://")||e?.dirpath?.startsWith("//")){const t=r.startsWith("/")?r:`${e.dirpath}/${r}`;this.log("Including remote file from relative path:",t),await this.preprocessRemote(t,o).then(i)}else if("/"===r.charAt(0))this.log("Including local file from absolute path:",r),await this.preprocessLocal(r,o).then(i);else{const t=e?.dirpath&&"."!==e?.dirpath?`${e?.dirpath}/${r}`:r;this.log("Including local file from relative path:",t),await this.preprocessLocal(t,o).then(i)}},e.rebaseRelativePaths=async function(t,e){const n=t,r=n.tagName?.toLowerCase();if(!e?.dirpath)return;const i=b(n,"src"),o=b(n,"href"),s=b(n,"data"),a=i||o||s;a&&(a&&P(a)&&this.log("Rebasing relative path as:",e.dirpath,"/",a),"img"===r&&i&&P(i)?g(n,"src",`${e.dirpath}/${i}`):"a"===r&&o&&P(o)||"link"===r&&o&&P(o)?g(n,"href",`${e.dirpath}/${o}`):"script"===r&&i&&P(i)||"source"===r&&i&&P(i)||"audio"===r&&i&&P(i)||"video"===r&&i&&P(i)||"track"===r&&i&&P(i)||"iframe"===r&&i&&P(i)?g(n,"src",`${e.dirpath}/${i}`):"object"===r&&s&&P(s)?g(n,"data",`${e.dirpath}/${s}`):"input"===r&&i&&P(i)?g(n,"src",`${e.dirpath}/${i}`):("area"===r&&o&&P(o)||"base"===r&&o&&P(o))&&g(n,"href",`${e.dirpath}/${o}`))},e.registerCustomElements=async function(t,e){const n=t;if("template"===n.tagName?.toLowerCase()&&b(n,"is")){const t=b(n,"is")?.toLowerCase();this._customElements.has(t)||(this.log(`Registering custom element: ${t}\n`,S(n,128)),this._customElements.set(t,n.cloneNode(!0)),N(n.parentNode,n))}},e.resolveCustomElements=async function(e,n){const r=e,i=r.tagName?.toLowerCase();if(this._customElements.has(i)){this.log(`Processing custom element: ${i}\n`,S(r,128));const n=this._customElements.get(i),o=(n.content||n).cloneNode(!0),s=function(t){return t instanceof d?t.children.find((t=>t instanceof d)):t.firstElementChild}(o);for(const t of Array.from(r.attributes))s&&y(r,s,t.name);const a=new t(m(o)).find((t=>"slot"===t.tagName?.toLowerCase()));a&&v(a,...r.childNodes),v(e,...o.childNodes)}},e.resolveTextNodeExpressions=async function(t,e){const n=j(t)||"";if(3!==t.nodeType||!n?.trim())return;this.log("Processing node content value:\n",k(n,128));const r=new RegExp(/{{ ([^}]+) }}/gm),o=Array.from(n.matchAll(r)).map((t=>t[1]));return this.effect((function(){let e=n;for(const n of o){const r=this.eval(n,{$elem:t});e=e.replace(`{{ ${n} }}`,String(r))}!function(t,e){t instanceof i?t.data=e:t.nodeValue=e}(t,e)}))},e.resolveDataAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=b(n,":data");if(r){this.log(":data attribute found in:\n",S(t,128)),x(n,":data");const i=e?.rootNode===t?this:this.clone();t.renderer=i;const o=function(t,e=[]){return new Function(...e,`with (this) { return (async () => (${t}))(); }`)}(r,this.evalkeys),s=await o.call(i.$,{$elem:t});if(await Promise.all(Object.entries(s).map((([t,e])=>i.set(t,e)))),i!==this)for(const e of m(t,this._skipNodes))this._skipNodes.add(e);await i.mount(t,e)}},e.resolveWatchAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=b(n,"@watch");r&&(this.log("@watch attribute found in:\n",S(t,128)),x(n,"@watch"),await this.effect((function(){return this.eval(r,{$elem:t})})))},e.resolveTextAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=b(n,"$text");return r?(this.log("$text attribute found in:\n",S(t,128)),x(n,"$text"),this.effect((function(){!function(t,e){t instanceof d?t.children=[new s(e)]:t.textContent=e}(t,this.eval(r,{$elem:t}))}))):void 0},e.resolveHtmlAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=b(n,"$html");return r?(this.log("$html attribute found in:\n",S(t,128)),x(n,"$html"),this.effect((function(){const i=this.eval(r,{$elem:t});return new Promise((async t=>{const r=await this.preprocessString(i,e);await this.renderNode(r),function(t,...e){$(t,"replaceChildren")?t.replaceChildren(...e):(t.childNodes=e,e.forEach((e=>e.parentNode=t)))}(n,r),t()}))}))):void 0},e.resolvePropAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t;for(const e of Array.from(n.attributes||[]))if(e.name.startsWith("$")&&!_.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(n,e.name);const r=e.name.slice(1).replace(/-./g,(t=>t[1].toUpperCase()));await this.effect((function(){t[r]=this.eval(e.value,{$elem:t})}))}},e.resolveAttrAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t;for(const e of Array.from(n.attributes||[]))if(e.name.startsWith(":")&&!_.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(n,e.name);const r=e.name.slice(1);this.effect((function(){g(n,r,this.eval(e.value,{$elem:t}))}))}},e.resolveEventAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t;for(const e of Array.from(n.attributes||[]))e.name.startsWith("@")&&!_.has(e.name)&&(this.log(e.name,"attribute found in:\n",S(t,128)),x(n,e.name),t.addEventListener?.(e.name.substring(1),(n=>this.eval(e.value,{$elem:t,$event:n}))))},e.resolveForAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=b(n,":for")?.trim();if(r){this.log(":for attribute found in:\n",S(t,128)),x(n,":for");for(const e of m(t,this._skipNodes))this._skipNodes.add(e);const i=t.parentNode,o=function(t,e){return e?e.createElement(t):new d(t,{})}("template",t.ownerDocument);A(i,o,t),N(i,t),w(o,t),this.log(":for template:\n",S(o,128));const s=r.split(" in ",2);if(2!==s.length)throw new Error(`Invalid :for format: \`${r}\`. Expected "{key} in {expression}".`);const a=[],[c,l]=s;await this.effect((function(){const n=this.eval(l,{$elem:t});if(this.log(":for list items:",n),a.splice(0,a.length).forEach((t=>{N(i,t),this._skipNodes.delete(t)})),!Array.isArray(n))return console.error(`Expression did not yield a list: \`${l}\` => \`${n}\``),Promise.resolve();const r=[];for(const i of n){const n=this.clone();n.set(c,i);const o=t.cloneNode(!0);a.push(o),this._skipNodes.add(o),r.push(n.mount(o,e)),this.log("Rendered list child:\n",S(o,128))}const s=o.nextSibling;for(const t of a)A(i,t,s);return Promise.all(r)}))}},e.resolveBindAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=b(n,":bind");if(r){this.log(":bind attribute found in:\n",S(t,128));const e=["change","input"],i=b(n,":bind-events")?.split(",")||e;x(n,":bind"),x(n,":bind-events");const o="checkbox"===b(n,"type")?"checked":"value",s=`$elem.${o} = ${r}`;this.effect((function(){const e=this.eval(s,{$elem:t});n[o]=e}));const a=`${r} = $elem.${o}`;for(const e of i)t.addEventListener(e,(()=>this.eval(a,{$elem:t})))}},e.resolveShowAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=b(n,":show");if(r){this.log(":show attribute found in:\n",S(t,128)),x(n,":show");const e="none"===n.style?.display?"":n.style?.display??b(n,"style")?.split(";")?.find((t=>"display"===t.split(":")[0]))?.split(":")?.at(1)?.trim();this.effect((function(){const i=this.eval(r,{$elem:t});n.style?n.style.display=i?e:"none":g(n,"style",`display: ${i?e:"none"};`)}))}}}(T||(T={}));class O extends E{debugging=!1;dirpath="";_skipNodes=new Set;_customElements=new Map;debug(t){return this.debugging=t,this}async fetchRemote(t,e){return fetch(t,{cache:e?.cache??"default"}).then((t=>t.text()))}async fetchLocal(t,e){return this.fetchRemote(t,e)}async preprocessString(t,e){this.log("Preprocessing string content with params:\n",e);const n=this.parseHTML(t,e);return await this.preprocessNode(n,e),n}async preprocessRemote(t,e){const n={};e?.cache&&(n.cache=e.cache);const r=await fetch(t,n).then((t=>t.text()));return this.preprocessString(r,{...e,dirpath:M(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}async preprocessLocal(t,e){const n=await this.fetchLocal(t,e);return this.preprocessString(n,{...e,dirpath:M(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}clone(){const t=Object.fromEntries(this.store.entries()),e=new this.constructor(t).debug(this.debugging);return e._customElements=this._customElements,Array.from(this.store.keys()).forEach((t=>this.watch(t,(()=>e.set(t,this.get(t)))))),e}log(...t){this.debugging&&console.debug(...t)}async preprocessNode(e,n){n={dirpath:this.dirpath,maxdepth:10,...n};const r=new t(m(e,this._skipNodes)).map((async t=>{this.log("Preprocessing node:\n",S(t,128)),await T.resolveIncludes.call(this,t,n),await T.rebaseRelativePaths.call(this,t,n),await T.registerCustomElements.call(this,t,n),await T.resolveCustomElements.call(this,t,n)}));return await Promise.all(r.generator()),e}async renderNode(t,e){for(const n of m(t,this._skipNodes))this.log("Rendering node:\n",S(n,128)),await T.resolveDataAttribute.call(this,n,e),await T.resolveForAttribute.call(this,n,e),await T.resolveTextAttributes.call(this,n,e),await T.resolveHtmlAttribute.call(this,n,e),await T.resolveShowAttribute.call(this,n,e),await T.resolveWatchAttribute.call(this,n,e),await T.resolveBindAttribute.call(this,n,e),await T.resolvePropAttributes.call(this,n,e),await T.resolveAttrAttributes.call(this,n,e),await T.resolveEventAttributes.call(this,n,e),await T.resolveTextNodeExpressions.call(this,n,e);return t}async mount(t,e){e={...e,rootNode:t},await this.preprocessNode(t,e),await this.renderNode(t,e),t.renderer=this}}var z=n(654);const L={sm:640,md:768,lg:1024,xl:1280},R=.25,D=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],I=[...D,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,112,128,144,160,192,224,256,288,320,384,448,512,...Object.values(L)],W=[1,2,5,10,20,25,30,40,50,60,70,75,80,90,95,98,99,100],F=["hover","focus","disabled","focus","active"],H={margin:"m",padding:"p"},B={width:"w",height:"h"},G={top:"top",right:"right",bottom:"bottom",left:"left"},V={"min-width":"min-w","min-height":"min-h","max-width":"max-w","max-height":"max-h"},q={bold:{"font-weight":"bold"},semibold:{"font-weight":600},italic:{"font-style":"italic"},underline:{"text-decoration":"underline"},"no-underline":{"text-decoration":"none"},"decoration-none":{"text-decoration":"none"},"line-through":{"text-decoration":"line-through"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},"font-mono":{"font-family":"monospace"},"font-sans":{"font-family":"sans-serif"},"font-serif":{"font-family":"serif"},"font-cursive":{"font-family":"cursive"},"text-left":{"text-align":"left"},"text-right":{"text-align":"right"},"text-center":{"text-align":"center"},"text-justify":{"text-align":"justify"},"text-xs":{"font-size":".75rem"},"text-sm":{"font-size":".875rem"},"text-base":{"font-size":"1rem"},"text-lg":{"font-size":"1.125rem"},"text-xl":{"font-size":"1.25rem"},relative:{position:"relative"},fixed:{position:"fixed"},absolute:{position:"absolute"},sticky:{position:"sticky"},"object-contain":{"object-fit":"contain"},"object-cover":{"object-fit":"cover"},"object-fill":{"object-fit":"fill"},"object-none":{"object-fit":"none"},block:{display:"block"},contents:{display:"contents"},hidden:{display:"none"},inline:{display:"inline"},"inline-block":{display:"inline-block"},visible:{visibility:"visible"},invisible:{visibility:"hidden"},collapse:{visibility:"collapse"},"list-none":{"list-style-type":"none"},"list-disc":{"list-style-type":"disc"},"list-decimal":{"list-style-type":"decimal"},flex:{display:"flex"},"flex-1":{flex:"1 1 0%"},"flex-inline":{display:"inline-flex"},"flex-row":{"flex-direction":"row"},"flex-col":{"flex-direction":"column"},"flex-row-reverse":{"flex-direction":"row-reverse"},"flex-col-reverse":{"flex-direction":"column-reverse"},"flex-wrap":{"flex-wrap":"wrap"},"flex-wrap-reverse":{"flex-wrap":"wrap-reverse"},"flex-nowrap":{"flex-wrap":"nowrap"},"justify-start":{"justify-content":"flex-start"},"justify-end":{"justify-content":"flex-end"},"justify-center":{"justify-content":"center"},"justify-between":{"justify-content":"space-between"},"justify-around":{"justify-content":"space-around"},"justify-evenly":{"justify-content":"space-evenly"},"justify-stretch":{"justify-content":"stretch"},"items-start":{"align-items":"flex-start"},"items-end":{"align-items":"flex-end"},"items-center":{"align-items":"center"},"items-stretch":{"align-items":"stretch"},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"overflow-auto":{overflow:"auto"},"overflow-x-auto":{"overflow-x":"auto"},"overflow-y-auto":{"overflow-y":"auto"},"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"cursor-pointer":{cursor:"pointer"},"cursor-wait":{cursor:"wait"},"cursor-not-allowed":{cursor:"not-allowed"},"select-none":{"user-select":"none"},"select-all":{"user-select":"all"},"pointer-events-auto":{"pointer-events":"auto"},"pointer-events-none":{"pointer-events":"none"},"box-border":{"box-sizing":"border-box"},"box-content":{"box-sizing":"content-box"},resize:{resize:"both"},"resize-x":{resize:"horizontal"},"resize-y":{resize:"vertical"},"resize-none":{resize:"none"},border:{border:"1px solid"},"border-none":{border:"none"},"border-solid":{"border-style":"solid"},"border-dashed":{"border-style":"dashed"},"border-dotted":{"border-style":"dotted"},"rounded-none":{"border-radius":"0"},rounded:{"border-radius":".25rem"},"rounded-sm":{"border-radius":".125rem"},"rounded-md":{"border-radius":".375rem"},"rounded-lg":{"border-radius":".5rem"},"rounded-xl":{"border-radius":".75rem"},"rounded-full":{"border-radius":"9999px"},"transition-none":{transition:"none"},transition:{transition:"all 150ms ease-in-out"},"animate-none":{animation:"none"},"animate-spin":{animation:"spin 1s linear infinite"},"animate-ping":{animation:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite"},"animate-pulse":{animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"}},U=["@keyframes spin {\n from { transform: rotate(0deg) }\n to { transform: rotate(360deg) }\n }","@keyframes ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n }","@keyframes pulse {\n 0%, 100% { opacity: 1 }\n 50% { opacity: .5 }\n }"],X={red:{50:16772078,100:16764370,200:15702682,300:15037299,400:15684432,500:16007990,600:15022389,700:13840175,800:12986408,900:12000284},pink:{50:16573676,100:16301008,200:16027569,300:15753874,400:15483002,500:15277667,600:14162784,700:12720219,800:11342935,900:8916559},purple:{50:15984117,100:14794471,200:13538264,300:12216520,400:11225020,500:10233776,600:9315498,700:8069026,800:6953882,900:4854924},"deep-purple":{50:15591414,100:13747433,200:11771355,300:9795021,400:8280002,500:6765239,600:6174129,700:5320104,800:4532128,900:3218322},indigo:{50:15264502,100:12962537,200:10463450,300:7964363,400:6056896,500:4149685,600:3754411,700:3162015,800:2635155,900:1713022},blue:{50:14938877,100:12312315,200:9489145,300:6600182,400:4367861,500:2201331,600:2001125,700:1668818,800:1402304,900:870305},"light-blue":{50:14808574,100:11789820,200:8508666,300:5227511,400:2733814,500:240116,600:236517,700:166097,800:161725,900:87963},cyan:{50:14743546,100:11725810,200:8445674,300:5099745,400:2541274,500:48340,600:44225,700:38823,800:33679,900:24676},teal:{50:14742257,100:11722715,200:8440772,300:5093036,400:2533018,500:38536,600:35195,700:31083,800:26972,900:19776},green:{50:15267305,100:13166281,200:10868391,300:8505220,400:6732650,500:5025616,600:4431943,700:3706428,800:3046706,900:1793568},"light-green":{50:15857897,100:14478792,200:12968357,300:11457921,400:10275941,500:9159498,600:8172354,700:6856504,800:5606191,900:3369246},lime:{50:16382951,100:15791299,200:15134364,300:14477173,400:13951319,500:13491257,600:12634675,700:11514923,800:10394916,900:8550167},yellow:{50:16776679,100:16775620,200:16774557,300:16773494,400:16772696,500:16771899,600:16635957,700:16498733,800:16361509,900:16088855},amber:{50:16775393,100:16772275,200:16769154,300:16766287,400:16763432,500:16761095,600:16757504,700:16752640,800:16748288,900:16740096},orange:{50:16774112,100:16769202,200:16764032,300:16758605,400:16754470,500:16750592,600:16485376,700:16088064,800:15690752,900:15094016},"deep-orange":{50:16509415,100:16764092,200:16755601,300:16747109,400:16740419,500:16733986,600:16011550,700:15092249,800:14172949,900:12531212},brown:{50:15723497,100:14142664,200:12364452,300:10586239,400:9268835,500:7951688,600:7162945,700:6111287,800:5125166,900:4073251},gray:{50:16448250,100:16119285,200:15658734,300:14737632,400:12434877,500:10395294,600:7697781,700:6381921,800:4342338,900:2171169},"blue-gray":{50:15527921,100:13621468,200:11583173,300:9479342,400:7901340,500:6323595,600:5533306,700:4545124,800:3622735,900:2503224}};function J(t){return F.map((e=>`.${e}\\:${t}:${e}`))}function K(t,e){return Object.entries(L).map((([n,r])=>`@media (min-width: ${r}px) { .${n}\\:${t} { ${e} } }`))}function Q(t,e){return t.includes("@media")&&!e.includes("@media")?1:!t.includes("@media")&&e.includes("@media")?-1:t.localeCompare(e)}function Y(t){return Object.entries(t).flatMap((([t,e])=>[[`${e}-0`,`${t}: 0`],[`${e}-screen`,`${t}: 100vw`],[`${e}-full`,`${t}: 100%`],...I.map((n=>[`${e}-${n}`,`${t}: ${n*R}rem`])),...I.map((n=>[`-${e}-${n}`,`${t}: -${n*R}rem`])),...I.map((n=>[`${e}-${n}px`,`${t}: ${n}px`])),...I.map((n=>[`-${e}-${n}px`,`${t}: -${n}px`])),...W.map((n=>[`${e}-${n}\\%`,`${t}: ${n}%`])),...W.map((n=>[`-${e}-${n}\\%`,` ${t}: -${n}%`]))])).flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))}function Z(t){return Object.entries(t).flatMap((([t,e])=>[`.${e}-auto { ${t}: auto; }`,`.${e}x-auto { ${t}-left: auto; ${t}-right: auto; }`,`.${e}y-auto { ${t}-top: auto; ${t}-bottom: auto; }`,`.${e}x-0 { ${t}-left: 0; ${t}-right: 0; }`,`.${e}y-0 { ${t}-top: 0; ${t}-bottom: 0; }`,...I.map((t=>[t,t*R])).map((([n,r])=>`.${e}x-${n} { ${t}-left: ${r}rem; ${t}-right: ${r}rem; }`)),...I.map((t=>[t,t*R])).map((([n,r])=>`.${e}y-${n} { ${t}-top: ${r}rem; ${t}-bottom: ${r}rem; }`)),...I.map((n=>`.${e}x-${n}px { ${t}-left: ${n}px; ${t}-right: ${n}px; }`)),...I.map((n=>`.${e}y-${n}px { ${t}-top: ${n}px; ${t}-bottom: ${n}px; }`)),...W.map((n=>`.${e}x-${n}\\% { ${t}-left: ${n}%; ${t}-right: ${n}%; }`)),...W.map((n=>`.${e}y-${n}\\% { ${t}-top: ${n}%; ${t}-bottom: ${n}%; }`))]))}function tt(){const t=[["white","#fff"],["black","#000"],["transparent","transparent"]].flatMap((([t,e])=>[[`text-${t}`,`color: ${e}`],[`fill-${t}`,`fill: ${e}`],[`bg-${t}`,`background-color: ${e}`],[`border-${t}`,`border-color: ${e}`]])),e=Object.entries(X).flatMap((([t,e])=>[[`text-${t}`,`color: #${e[500].toString(16)}`],[`fill-${t}`,`fill: #${e[500].toString(16)}`],[`bg-${t}`,`background-color: #${e[500].toString(16)}`],[`border-${t}`,`border-color: #${e[500].toString(16)}`]])),n=Object.entries(X).flatMap((([t,e])=>Object.entries(e).flatMap((([e,n])=>[[`text-${t}-${e}`,`color: #${n.toString(16)}`],[`fill-${t}-${e}`,`fill: #${n.toString(16)}`],[`bg-${t}-${e}`,`background-color: #${n.toString(16)}`],[`border-${t}-${e}`,`border-color: #${n.toString(16)}`]]))));return[].concat(t).concat(e).concat(n).flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))}const et=new class extends O{dirpath=M(self.location.href);parseHTML(t,e={rootDocument:!1}){if(e.rootDocument)return(new DOMParser).parseFromString(t,"text/html");{const e=document.createRange();return e.selectNodeContents(document.body),e.createContextualFragment(t)}}serializeHTML(t){return(new XMLSerializer).serializeToString(t).replace(/\s?xmlns="[^"]+"/gm,"")}preprocessLocal(t,e){return this.preprocessRemote(t,e)}};self.Mancha=et;const nt=self.document?.currentScript;if(self.document?.currentScript?.hasAttribute("init")){const t=nt?.hasAttribute("debug"),e=nt?.getAttribute("cache"),n=nt?.getAttribute("target")?.split("+")||["body"];window.addEventListener("load",(()=>{n.map((async n=>{const r=self.document.querySelector(n);await et.debug(t).mount(r,{cache:e})}))}))}if(self.document?.currentScript?.hasAttribute("css")){const t=nt?.getAttribute("css")?.split("+");for(const e of t){const t=document.createElement("style");switch(e){case"basic":t.textContent=z.A;break;case"utils":t.textContent=(void 0,[...U,...Object.entries(q).flatMap((([t,e])=>Object.entries(e).flatMap((([e,n])=>[`.${t} { ${e}: ${n} }`,`${J(t).join(",")} { ${e}: ${n} }`,...K(t,`${e}: ${n}`)])))),...tt(),...[["opacity-0","opacity: 0"],...W.map((t=>[`opacity-${t}`,"opacity: "+t/100]))].flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)])),...Y(B),...Z(B),...Y(G),...Z(G),...(rt=H,Object.entries(rt).flatMap((([t,e])=>[[`${e}t-0`,`${t}-top: 0`],[`${e}b-0`,`${t}-bottom: 0`],[`${e}l-0`,`${t}-left: 0`],[`${e}r-0`,`${t}-right: 0`],[`${e}t-auto`,`${t}-top: auto`],[`${e}b-auto`,`${t}-bottom: auto`],[`${e}l-auto`,`${t}-left: auto`],[`${e}r-auto`,`${t}-right: auto`],...["","-"].flatMap((n=>[...I.map((t=>[t,t*R])).map((([r,i])=>[`${n}${e}t-${r}`,`${t}-top: ${n}${i}rem`])),...I.map((t=>[t,t*R])).map((([r,i])=>[`${n}${e}b-${r}`,`${t}-bottom: ${n}${i}rem`])),...I.map((t=>[t,t*R])).map((([r,i])=>[`${n}${e}l-${r}`,`${t}-left: ${n}${i}rem`])),...I.map((t=>[t,t*R])).map((([r,i])=>[`${n}${e}r-${r}`,`${t}-right: ${n}${i}rem`])),...I.map((r=>[`${n}${e}t-${r}px`,`${t}-top: ${n}${r}px`])),...I.map((r=>[`${n}${e}b-${r}px`,`${t}-bottom: ${n}${r}px`])),...I.map((r=>[`${n}${e}l-${r}px`,`${t}-left: ${n}${r}px`])),...I.map((r=>[`${n}${e}r-${r}px`,`${t}-right: ${n}${r}px`])),...W.map((r=>[`${n}${e}t-${r}\\%`,`${t}-top: ${n}${r}%`])),...W.map((r=>[`${n}${e}b-${r}\\%`,`${t}-bottom: ${n}${r}%;`])),...W.map((r=>[`${n}${e}l-${r}\\%`,`${t}-left: ${n}${r}%`])),...W.map((r=>[`${n}${e}r-${r}\\%`,`${t}-right: ${n}${r}%`]))]))])).flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))),...Y(H),...Z(H),".space-x-0 > * { margin-left: 0 }",".space-y-0 > * { margin-top: 0 }",...I.map((t=>`.space-x-${t} > :not(:first-child) { margin-left: ${t*R}rem }`)),...I.map((t=>`.space-y-${t} > :not(:first-child) { margin-top: ${t*R}rem }`)),...I.map((t=>`.space-x-${t}px > :not(:first-child) { margin-left: ${t}px }`)),...I.map((t=>`.space-y-${t}px > :not(:first-child) { margin-top: ${t}px }`)),".gap-0 { gap: 0 }",...I.map((t=>`.gap-${t} { gap: ${t*R}rem }`)),...I.map((t=>`.gap-${t}px { gap: ${t}px }`)),...I.map((t=>`.gap-x-${t} { column-gap: ${t*R}rem }`)),...I.map((t=>`.gap-y-${t} { row-gap: ${t*R}rem }`)),...I.map((t=>`.gap-x-${t}px { column-gap: ${t}px }`)),...I.map((t=>`.gap-y-${t}px { row-gap: ${t}px }`)),...Y(V),...[...D.map((t=>[`border-${t}`,`border-width: ${t}px`]))].flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))].sort(Q).join("\n"));break;default:console.error(`Unknown style name: "${e}"`)}self.document.head.appendChild(t)}}var rt})()})();
1
+ (()=>{"use strict";const e=/^\s*(?!javascript:)(?:[\w+.-]+:|[^:/?#]*(?:[/?#]|$))/i;function t(t){if(!function(t){const r=!e.test(t);return r}(t))return t}function r(e){return t(e)}
2
+ /**
3
+ * @license
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ const i={};function n(e){0}"undefined"!=typeof window&&window.TrustedScriptURL;
7
+ /**
8
+ * @license
9
+ * SPDX-License-Identifier: Apache-2.0
10
+ */
11
+ class s{constructor(e,t){this.privateDoNotAccessOrElseWrappedAttributePrefix=t}toString(){return this.privateDoNotAccessOrElseWrappedAttributePrefix}}const o=s;function a(e){if(function(e){return e instanceof s}(e))return e.privateDoNotAccessOrElseWrappedAttributePrefix;throw new Error("")}"undefined"!=typeof window&&window.TrustedHTML;function c(e,t,r,i){if(0===e.length){throw new Error("")}const n=e.map((e=>a(e))),s=r.toLowerCase();if(n.every((e=>0!==s.indexOf(e))))throw new Error(`Attribute "${r}" does not match any of the allowed prefixes.`);t.setAttribute(r,i)}"undefined"!=typeof window&&window.TrustedScript;
12
+ /**
13
+ * @license
14
+ * SPDX-License-Identifier: Apache-2.0
15
+ */
16
+ class l{}class h extends l{constructor(e,t){super(),n(),this.privateDoNotAccessOrElseWrappedStyleSheet=e}toString(){return this.privateDoNotAccessOrElseWrappedStyleSheet}}
17
+ /**
18
+ * @license
19
+ * SPDX-License-Identifier: Apache-2.0
20
+ */
21
+ function u(e,t){e.textContent=function(e){if(e instanceof h)return e.privateDoNotAccessOrElseWrappedStyleSheet;throw new Error("")}(t)}Error;class d{iterable;constructor(e){this.iterable=e}filter(e){return new d(d.filterGenerator(e,this.iterable))}map(e){return new d(d.mapGenerator(e,this.iterable))}find(e){for(const t of this.iterable)if(e(t))return t}array(){return Array.from(this.iterable)}*generator(){for(const e of this.iterable)yield e}static*filterGenerator(e,t){for(const r of t)e(r)&&(yield r)}static*mapGenerator(e,t){for(const r of t)yield e(r)}static equals(e,t){const r=e[Symbol.iterator](),i=t[Symbol.iterator]();let n=r.next(),s=i.next();for(;!n.done&&!s.done;){if(n.value!==s.value)return!1;n=r.next(),s=i.next()}return n.done===s.done}}function p(e){return Object.isFrozen(e)&&Object.isFrozen(e.raw)}function f(e){return-1===e.toString().indexOf("`")}f((e=>e``))||f((e=>e`\0`))||f((e=>e`\n`))||f((e=>e`\u0000`)),p``&&p`\0`&&p`\n`&&p`\u0000`;
22
+ /**
23
+ * @license
24
+ * SPDX-License-Identifier: Apache-2.0
25
+ */
26
+ function m(e){const t=e[0].toLowerCase();return new o(i,t)}
27
+ /**
28
+ * @license
29
+ * SPDX-License-Identifier: Apache-2.0
30
+ */
31
+ var _,E;
32
+ /**
33
+ * @license
34
+ * SPDX-License-Identifier: Apache-2.0
35
+ */
36
+ function g(e){return{valueOf:e}.valueOf()}!function(e){e[e.STYLE_TAG=0]="STYLE_TAG",e[e.STYLE_ATTRIBUTE=1]="STYLE_ATTRIBUTE",e[e.HTML_ATTRIBUTE=2]="HTML_ATTRIBUTE"}(_||(_={}));
37
+ /**
38
+ * @license
39
+ * SPDX-License-Identifier: Apache-2.0
40
+ */
41
+ class ${constructor(e,t,r,i,n){this.allowedElements=e,this.elementPolicies=t,this.allowedGlobalAttributes=r,this.globalAttributePolicies=i,this.globallyAllowedAttributePrefixes=n}isAllowedElement(e){return"FORM"!==e&&(this.allowedElements.has(e)||this.elementPolicies.has(e))}getAttributePolicy(e,t){const r=this.elementPolicies.get(t);if(null==r?void 0:r.has(e))return r.get(e);if(this.allowedGlobalAttributes.has(e))return{policyAction:E.KEEP};const i=this.globalAttributePolicies.get(e);return i||(this.globallyAllowedAttributePrefixes&&[...this.globallyAllowedAttributePrefixes].some((t=>0===e.indexOf(t)))?{policyAction:E.KEEP}:{policyAction:E.DROP})}}!function(e){e[e.DROP=0]="DROP",e[e.KEEP=1]="KEEP",e[e.KEEP_AND_SANITIZE_URL=2]="KEEP_AND_SANITIZE_URL",e[e.KEEP_AND_NORMALIZE=3]="KEEP_AND_NORMALIZE",e[e.KEEP_AND_SANITIZE_STYLE=4]="KEEP_AND_SANITIZE_STYLE",e[e.KEEP_AND_USE_RESOURCE_URL_POLICY=5]="KEEP_AND_USE_RESOURCE_URL_POLICY",e[e.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET=6]="KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET"}(E||(E={}));new Set(["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"]);
42
+ /**
43
+ * @license
44
+ * SPDX-License-Identifier: Apache-2.0
45
+ */
46
+ const v=["ARTICLE","SECTION","NAV","ASIDE","H1","H2","H3","H4","H5","H6","HEADER","FOOTER","ADDRESS","P","HR","PRE","BLOCKQUOTE","OL","UL","LH","LI","DL","DT","DD","FIGURE","FIGCAPTION","MAIN","DIV","EM","STRONG","SMALL","S","CITE","Q","DFN","ABBR","RUBY","RB","RT","RTC","RP","DATA","TIME","CODE","VAR","SAMP","KBD","SUB","SUP","I","B","U","MARK","BDI","BDO","SPAN","BR","WBR","INS","DEL","PICTURE","PARAM","TRACK","MAP","TABLE","CAPTION","COLGROUP","COL","TBODY","THEAD","TFOOT","TR","TD","TH","SELECT","DATALIST","OPTGROUP","OPTION","OUTPUT","PROGRESS","METER","FIELDSET","LEGEND","DETAILS","SUMMARY","MENU","DIALOG","SLOT","CANVAS","FONT","CENTER","ACRONYM","BASEFONT","BIG","DIR","HGROUP","STRIKE","TT"],b=[["A",new Map([["href",{policyAction:E.KEEP_AND_SANITIZE_URL}]])],["AREA",new Map([["href",{policyAction:E.KEEP_AND_SANITIZE_URL}]])],["LINK",new Map([["href",{policyAction:E.KEEP_AND_USE_RESOURCE_URL_POLICY,conditions:new Map([["rel",new Set(["alternate","author","bookmark","canonical","cite","help","icon","license","next","prefetch","dns-prefetch","prerender","preconnect","preload","prev","search","subresource"])]])}]])],["SOURCE",new Map([["src",{policyAction:E.KEEP_AND_USE_RESOURCE_URL_POLICY}],["srcset",{policyAction:E.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET}]])],["IMG",new Map([["src",{policyAction:E.KEEP_AND_USE_RESOURCE_URL_POLICY}],["srcset",{policyAction:E.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET}]])],["VIDEO",new Map([["src",{policyAction:E.KEEP_AND_USE_RESOURCE_URL_POLICY}]])],["AUDIO",new Map([["src",{policyAction:E.KEEP_AND_USE_RESOURCE_URL_POLICY}]])]],y=["title","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-current","aria-disabled","aria-dropeffect","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","alt","align","autocapitalize","autocomplete","autocorrect","autofocus","autoplay","bgcolor","border","cellpadding","cellspacing","checked","color","cols","colspan","controls","datetime","disabled","download","draggable","enctype","face","formenctype","frameborder","height","hreflang","hidden","ismap","label","lang","loop","max","maxlength","media","minlength","min","multiple","muted","nonce","open","placeholder","preload","rel","required","reversed","role","rows","rowspan","selected","shape","size","sizes","slot","span","spellcheck","start","step","summary","translate","type","valign","value","width","wrap","itemscope","itemtype","itemid","itemprop","itemref"],w=[["dir",{policyAction:E.KEEP_AND_NORMALIZE,conditions:g((()=>new Map([["dir",new Set(["auto","ltr","rtl"])]])))}],["async",{policyAction:E.KEEP_AND_NORMALIZE,conditions:g((()=>new Map([["async",new Set(["async"])]])))}],["cite",{policyAction:E.KEEP_AND_SANITIZE_URL}],["loading",{policyAction:E.KEEP_AND_NORMALIZE,conditions:g((()=>new Map([["loading",new Set(["eager","lazy"])]])))}],["poster",{policyAction:E.KEEP_AND_SANITIZE_URL}],["target",{policyAction:E.KEEP_AND_NORMALIZE,conditions:g((()=>new Map([["target",new Set(["_self","_blank"])]])))}]];new $(new Set(v),new Map(b),new Set(y),new Map(w)),new $(new Set(g((()=>v.concat(["STYLE"])))),new Map(b),new Set(g((()=>y.concat(["id","name","class"])))),new Map(g((()=>w.concat([["style",{policyAction:E.KEEP_AND_SANITIZE_STYLE}]])))));
47
+ /**
48
+ * @license
49
+ * SPDX-License-Identifier: Apache-2.0
50
+ */
51
+ function x(e){return function(e){return new h(e,i)}(e[0])}const A=[m`:`,m`style`,m`class`];function*O(e,t=new Set){const r=new Set,i=Array.from(e.childNodes).filter((e=>!t.has(e)));for(yield e;i.length;){const e=i.shift();r.has(e)||(r.add(e),yield e),e.childNodes&&Array.from(e.childNodes).filter((e=>!t.has(e))).forEach((e=>i.push(e)))}}function R(e,t){return void 0!==e?.[t]}function I(e,t){return"function"==typeof e?.[t]}function N(e,t){return R(e,"attribs")?e.attribs?.[t]??null:e.getAttribute?.(t)}function T(e,t,r){R(e,"attribs")?e.attribs[t]=r:c(A,e,t,r)}function S(e,t){R(e,"attribs")?delete e.attribs[t]:e.removeAttribute?.(t)}function P(e,t,r){if(R(e,"attribs")&&R(t,"attribs"))t.attribs[r]=e.attribs[r];else{const i=e?.getAttribute?.(r);T(t,r,i||"")}}function k(e,...t){if(I(e,"replaceWith"))return e.replaceWith(...t);{const r=e,i=r.parentNode,n=Array.from(i.childNodes).indexOf(r);t.forEach((e=>e.parentNode=i)),i.childNodes=[].concat(Array.from(i.childNodes).slice(0,n)).concat(t).concat(Array.from(i.childNodes).slice(n+1))}}function C(e,...t){I(e,"replaceChildren")?e.replaceChildren(...t):(e.childNodes=t,t.forEach((t=>t.parentNode=e)))}function L(e,t){return I(t,"appendChild")?e.appendChild(t):(e.childNodes.push(t),t.parentNode=e,t)}function D(e,t){return I(t,"removeChild")?e.removeChild(t):(C(e,...Array.from(e.childNodes).filter((e=>e!==t))),t)}function M(e,t,r){return r?I(e,"insertBefore")?e.insertBefore(t,r):(k(r,t,r),t):L(e,t)}function U(e,t=0){return e?e.length<=t?e:e.slice(0,t-1)+"…":""}function j(e,t=0){return U(e.outerHTML||e.nodeValue||String(e),t)}function z(e){return e.includes("/")?e.split("/").slice(0,-1).join("/"):""}var G;!function(e){e.resolveIncludes=async function(e,t){const r=e;if("include"!==r.tagName?.toLocaleLowerCase())return;this.log("<include> tag found in:\n",j(e,128)),this.log("<include> params:",t);const i=N(r,"src");if(!i)throw new Error(`"src" attribute missing from ${e}.`);const n=t=>{const i=t.firstChild;for(const e of Array.from(r.attributes))i&&"src"!==e.name&&P(r,i,e.name);k(e,...t.childNodes)},s={...t,rootDocument:!1,maxdepth:t?.maxdepth-1};if(0===s.maxdepth)throw new Error("Maximum recursion depth reached.");if(i.includes("://")||i.startsWith("//"))this.log("Including remote file from absolute path:",i),await this.preprocessRemote(i,s).then(n);else if(t?.dirpath?.includes("://")||t?.dirpath?.startsWith("//")){const e=i.startsWith("/")?i:`${t.dirpath}/${i}`;this.log("Including remote file from relative path:",e),await this.preprocessRemote(e,s).then(n)}else if("/"===i.charAt(0))this.log("Including local file from absolute path:",i),await this.preprocessLocal(i,s).then(n);else{const e=t?.dirpath&&"."!==t?.dirpath?`${t?.dirpath}/${i}`:i;this.log("Including local file from relative path:",e),await this.preprocessLocal(e,s).then(n)}},e.rebaseRelativePaths=async function(e,t){const i=e,n=i.tagName?.toLowerCase();if(!t?.dirpath)return;const s=N(i,"src"),o=N(i,"href"),a=s||o;if(a&&!((c=a).includes("://")||c.startsWith("/")||c.startsWith("#")||c.startsWith("data:"))){const e=`${t.dirpath}/${a}`;this.log("Rebasing relative path as:",e),"img"===n?i.src=e:"a"===n?
52
+ /**
53
+ * @license
54
+ * SPDX-License-Identifier: Apache-2.0
55
+ */
56
+ function(e,t){const i=r(t);void 0!==i&&(e.href=i)}(i,e):"source"===n||"audio"===n||"video"===n||"track"===n||"input"===n?i.src=e:"area"===n?
57
+ /**
58
+ * @license
59
+ * SPDX-License-Identifier: Apache-2.0
60
+ */
61
+ function(e,t){const i=r(t);void 0!==i&&(e.href=i)}(i,e):this.log("Unable to rebase relative path for element:",n)}var c},e.registerCustomElements=async function(e,t){const r=e;if("template"===r.tagName?.toLowerCase()&&N(r,"is")){const e=N(r,"is")?.toLowerCase();this._customElements.has(e)||(this.log(`Registering custom element: ${e}\n`,j(r,128)),this._customElements.set(e,r.cloneNode(!0)),D(r.parentNode,r))}},e.resolveCustomElements=async function(e,t){const r=e,i=r.tagName?.toLowerCase();if(this._customElements.has(i)){this.log(`Processing custom element: ${i}\n`,j(r,128));const t=this._customElements.get(i),n=(t.content||t).cloneNode(!0),s=function(e){return R(e,"firstElementChild")?e.firstElementChild:Array.from(e.children).find((e=>1===e.nodeType))}(n);for(const e of Array.from(r.attributes))s&&P(r,s,e.name);const o=new d(O(n)).find((e=>"slot"===e.tagName?.toLowerCase()));o&&k(o,...r.childNodes),k(e,...n.childNodes)}},e.resolveTextNodeExpressions=async function(e,t){const r=e.nodeValue||"";if(3!==e.nodeType||!r?.trim())return;this.log("Processing node content value:\n",U(r,128));const i=new RegExp(/{{ ([^}]+) }}/gm),n=Array.from(r.matchAll(i)).map((e=>e[1]));return this.effect((function(){let t=r;for(const r of n){const i=this.eval(r,{$elem:e});t=t.replace(`{{ ${r} }}`,String(i))}e.nodeValue=t}))},e.resolveDataAttribute=async function(e,t){if(this._skipNodes.has(e))return;const r=e,i=N(r,":data");if(i){this.log(":data attribute found in:\n",j(e,128)),S(r,":data");const n=t?.rootNode===e?this:this.clone();e.renderer=n;const s=n.eval(i,{$elem:e});if(await Promise.all(Object.entries(s).map((([e,t])=>n.set(e,t)))),n!==this)for(const t of O(e,this._skipNodes))this._skipNodes.add(t);await n.mount(e,t)}},e.resolveClassAttribute=async function(e,t){if(this._skipNodes.has(e))return;const r=e,i=N(r,":class");if(i){this.log(":class attribute found in:\n",j(e,128)),S(r,":class");const t=N(r,"class")||"";return this.effect((function(){const n=this.eval(i,{$elem:e});T(r,"class",(n?`${t} ${n}`:t).trim())}))}},e.resolveTextAttributes=async function(e,t){if(this._skipNodes.has(e))return;const r=e,i=N(r,":text");if(i){this.log(":text attribute found in:\n",j(e,128)),S(r,":text");const t=t=>this.textContent(e,t);return this.effect((function(){t(this.eval(i,{$elem:e}))}))}},e.resolveHtmlAttribute=async function(e,t){if(this._skipNodes.has(e))return;const r=e,i=N(r,":html");return i?(this.log(":html attribute found in:\n",j(e,128)),S(r,":html"),this.effect((function(){const n=this.eval(i,{$elem:e});return new Promise((async e=>{const i=await this.preprocessString(n,t);await this.renderNode(i),C(r,i),e()}))}))):void 0},e.resolveEventAttributes=async function(e,t){if(this._skipNodes.has(e))return;const r=e;for(const t of Array.from(r.attributes||[]))t.name.startsWith(":on:")&&(this.log(t.name,"attribute found in:\n",j(e,128)),S(r,t.name),e.addEventListener?.(t.name.substring(4),(r=>this.eval(t.value,{$elem:e,$event:r}))))},e.resolveForAttribute=async function(e,t){if(this._skipNodes.has(e))return;const r=e,i=N(r,":for")?.trim();if(i){this.log(":for attribute found in:\n",j(e,128)),S(r,":for");for(const t of O(e,this._skipNodes))this._skipNodes.add(t);const n=e.parentNode,s=this.createElement("template",e.ownerDocument);M(n,s,e),D(n,e),L(s,e),this.log(":for template:\n",j(s,128));const o=i.split(" in ",2);if(2!==o.length)throw new Error(`Invalid :for format: \`${i}\`. Expected "{key} in {expression}".`);const a=[],[c,l]=o;await this.effect((function(){const r=this.eval(l,{$elem:e});if(this.log(":for list items:",r),a.splice(0,a.length).forEach((e=>{D(n,e),this._skipNodes.delete(e)})),!Array.isArray(r))return console.error(`Expression did not yield a list: \`${l}\` => \`${r}\``),Promise.resolve();const i=[];for(const n of r){const r=this.clone();r.set(c,n);const s=e.cloneNode(!0);a.push(s),this._skipNodes.add(s),i.push(r.mount(s,t)),this.log("Rendered list child:\n",j(s,128))}const o=s.nextSibling;for(const e of a)M(n,e,o);return Promise.all(i)}))}},e.resolveBindAttribute=async function(e,t){if(this._skipNodes.has(e))return;const r=e,i=N(r,":bind");if(i){this.log(":bind attribute found in:\n",j(e,128));const t=["change","input"],n=N(r,":bind:on")?.split(",")||t;S(r,":bind"),S(r,":bind:on");const s="checkbox"===N(r,"type")?"checked":"value";this.effect((function(){const t=this.eval(i,{$elem:e});r[s]=t}));const o=`${i} = $elem.${s}`;for(const t of n)e.addEventListener(t,(()=>this.eval(o,{$elem:e})))}},e.resolveShowAttribute=async function(e,t){if(this._skipNodes.has(e))return;const r=e,i=N(r,":show");if(i){this.log(":show attribute found in:\n",j(e,128)),S(r,":show");const t="none"===r.style?.display?"":r.style?.display??N(r,"style")?.split(";")?.find((e=>"display"===e.split(":")[0]))?.split(":")?.at(1)?.trim();this.effect((function(){const n=this.eval(i,{$elem:e});r.style?r.style.display=n?t:"none":T(r,"style",`display: ${n?t:"none"};`)}))}},e.resolveCustomAttribute=async function(e,t){if(this._skipNodes.has(e))return;const r=e;for(const t of Array.from(r.attributes||[]))if(t.name.startsWith(":")){this.log(t.name,"attribute found in:\n",j(e,128)),S(r,t.name);const i=t.name.substring(1).replace(/-./g,(e=>e[1].toUpperCase()));this.effect((function(){const n=this.eval(t.value,{$elem:e});r[i]=n}))}}}(G||(G={}));
62
+ /*
63
+ * @license
64
+ * Portions Copyright (c) 2013, the Dart project authors.
65
+ */
66
+ const F=["this"],K=["+","-","!"],Y=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],W={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},B=["==","!=","<=",">=","||","&&","??","|>"],H=["===","!=="];var V;!function(e){e[e.STRING=1]="STRING",e[e.IDENTIFIER=2]="IDENTIFIER",e[e.DOT=3]="DOT",e[e.COMMA=4]="COMMA",e[e.COLON=5]="COLON",e[e.INTEGER=6]="INTEGER",e[e.DECIMAL=7]="DECIMAL",e[e.OPERATOR=8]="OPERATOR",e[e.GROUPER=9]="GROUPER",e[e.KEYWORD=10]="KEYWORD",e[e.ARROW=11]="ARROW"}(V||(V={}));const Z=(e,t,r=0)=>({kind:e,value:t,precedence:r}),q=e=>95===e||36===e||65<=(e&=-33)&&e<=90,Q=e=>48<=e&&e<=57;class X{_input;_index=-1;_tokenStart=0;_next;constructor(e){this._input=e,this._advance()}nextToken(){for(;9===(e=this._next)||10===e||13===e||32===e;)this._advance(!0);var e;if((e=>34===e||39===e)(this._next))return this._tokenizeString();if(q(this._next))return this._tokenizeIdentOrKeyword();if(Q(this._next))return this._tokenizeNumber();if(46===this._next)return this._tokenizeDot();if(44===this._next)return this._tokenizeComma();if(58===this._next)return this._tokenizeColon();if((e=>43===e||45===e||42===e||47===e||33===e||38===e||37===e||60===e||61===e||62===e||63===e||94===e||124===e)(this._next))return this._tokenizeOperator();if((e=>40===e||41===e||91===e||93===e||123===e||125===e)(this._next))return this._tokenizeGrouper();if(this._advance(),void 0!==this._next)throw new Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),!0===e&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){const t=this._input.substring(this._tokenStart,this._index+e);return 0===e&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){const e="unterminated string",t=this._next;for(this._advance(!0);this._next!==t;){if(void 0===this._next)throw new Error(e);if(92===this._next&&(this._advance(),void 0===this._next))throw new Error(e);this._advance()}const r=Z(V.STRING,this._getValue().replace(/\\(.)/g,((e,t)=>{switch(t){case"n":return"\n";case"r":return"\r";case"t":return"\t";case"b":return"\b";case"f":return"\f";default:return t}})));return this._advance(),r}_tokenizeIdentOrKeyword(){do{this._advance()}while(e=this._next,q(e)||Q(e));var e;const t=this._getValue(),r=(i=t,-1!==F.indexOf(i)?V.KEYWORD:V.IDENTIFIER);var i;return Z(r,t)}_tokenizeNumber(){do{this._advance()}while(Q(this._next));return 46===this._next?this._tokenizeDot():Z(V.INTEGER,this._getValue())}_tokenizeDot(){return this._advance(),Q(this._next)?this._tokenizeFraction():(this._clearValue(),Z(V.DOT,".",13))}_tokenizeComma(){return this._advance(!0),Z(V.COMMA,",")}_tokenizeColon(){return this._advance(!0),Z(V.COLON,":")}_tokenizeFraction(){do{this._advance()}while(Q(this._next));return Z(V.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(-1!==H.indexOf(e))this._advance(),this._advance();else{if(e=this._getValue(1),"=>"===e)return this._advance(),Z(V.ARROW,e);-1!==B.indexOf(e)&&this._advance()}return e=this._getValue(),Z(V.OPERATOR,e,W[e])}_tokenizeGrouper(){const e=String.fromCharCode(this._next),t=Z(V.GROUPER,e,W[e]);return this._advance(!0),t}}class J{_kind;_tokenizer;_ast;_token;_value;constructor(e,t){this._tokenizer=new X(e),this._ast=t}parse(){return this._advance(),this._parseExpression()}_advance(e,t){if(!this._matches(e,t))throw new Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);const r=this._tokenizer.nextToken();this._token=r,this._kind=r?.kind,this._value=r?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();const e=this._parseUnary();return void 0===e?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(void 0===e)throw new Error("Expected left to be defined.");for(;this._token;)if(this._matches(V.GROUPER,"(")){const t=this._parseArguments();e=this._ast.invoke(e,void 0,t)}else if(this._matches(V.GROUPER,"[")){const t=this._parseIndex();e=this._ast.index(e,t)}else if(this._matches(V.DOT)){this._advance();const t=this._parseUnary();e=this._makeInvokeOrGetter(e,t)}else{if(this._matches(V.KEYWORD))break;if(!(this._matches(V.OPERATOR)&&this._token.precedence>=t))break;e="?"===this._value?this._parseTernary(e):this._parseBinary(e,this._token)}return e}_makeInvokeOrGetter(e,t){if(void 0===t)throw new Error("expected identifier");if("ID"===t.type)return this._ast.getter(e,t.value);if("Invoke"===t.type&&"ID"===t.receiver.type){const r=t.receiver;return this._ast.invoke(e,r.value,t.arguments)}throw new Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(-1===Y.indexOf(t.value))throw new Error(`unknown operator: ${t.value}`);this._advance();let r=this._parseUnary();for(;(this._kind===V.OPERATOR||this._kind===V.DOT||this._kind===V.GROUPER)&&this._token.precedence>t.precedence;)r=this._parsePrecedence(r,this._token.precedence);return this._ast.binary(e,t.value,r)}_parseUnary(){if(this._matches(V.OPERATOR)){const e=this._value;if(this._advance(),"+"===e||"-"===e){if(this._matches(V.INTEGER))return this._parseInteger(e);if(this._matches(V.DECIMAL))return this._parseDecimal(e)}if(-1===K.indexOf(e))throw new Error(`unexpected token: ${e}`);const t=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(V.OPERATOR,"?");const t=this._parseExpression();this._advance(V.COLON);const r=this._parseExpression();return this._ast.ternary(e,t,r)}_parsePrimary(){switch(this._kind){case V.KEYWORD:const e=this._value;if("this"===e)return this._advance(),this._ast.id(e);if(-1!==F.indexOf(e))throw new Error(`unexpected keyword: ${e}`);throw new Error(`unrecognized keyword: ${e}`);case V.IDENTIFIER:return this._parseInvokeOrIdentifier();case V.STRING:return this._parseString();case V.INTEGER:return this._parseInteger();case V.DECIMAL:return this._parseDecimal();case V.GROUPER:return"("===this._value?this._parseParenOrFunction():"{"===this._value?this._parseMap():"["===this._value?this._parseList():void 0;case V.COLON:throw new Error('unexpected token ":"');default:return}}_parseList(){const e=[];do{if(this._advance(),this._matches(V.GROUPER,"]"))break;e.push(this._parseExpression())}while(this._matches(V.COMMA));return this._advance(V.GROUPER,"]"),this._ast.list(e)}_parseMap(){const e={};do{if(this._advance(),this._matches(V.GROUPER,"}"))break;const t=this._value;(this._matches(V.STRING)||this._matches(V.IDENTIFIER))&&this._advance(),this._advance(V.COLON),e[t]=this._parseExpression()}while(this._matches(V.COMMA));return this._advance(V.GROUPER,"}"),this._ast.map(e)}_parseInvokeOrIdentifier(){const e=this._value;if("true"===e)return this._advance(),this._ast.literal(!0);if("false"===e)return this._advance(),this._ast.literal(!1);if("null"===e)return this._advance(),this._ast.literal(null);if("undefined"===e)return this._advance(),this._ast.literal(void 0);const t=this._parseIdentifier(),r=this._parseArguments();return r?this._ast.invoke(t,void 0,r):t}_parseIdentifier(){if(!this._matches(V.IDENTIFIER))throw new Error(`expected identifier: ${this._value}`);const e=this._value;return this._advance(),this._ast.id(e)}_parseArguments(){if(!this._matches(V.GROUPER,"("))return;const e=[];do{if(this._advance(),this._matches(V.GROUPER,")"))break;const t=this._parseExpression();e.push(t)}while(this._matches(V.COMMA));return this._advance(V.GROUPER,")"),e}_parseIndex(){this._advance();const e=this._parseExpression();return this._advance(V.GROUPER,"]"),e}_parseParenOrFunction(){const e=this._parseArguments();if(this._matches(V.ARROW)){this._advance();const t=this._parseExpression(),r=e?.map((e=>e.value))??[];return this._ast.arrowFunction(r,t)}return this._ast.paren(e[0])}_parseString(){const e=this._ast.literal(this._value);return this._advance(),e}_parseInteger(e=""){const t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=""){const t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}}
67
+ /*
68
+ * @license
69
+ * Portions Copyright (c) 2013, the Dart project authors.
70
+ */
71
+ const ee={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"||":(e,t)=>e||t,"&&":(e,t)=>e&&t,"??":(e,t)=>e??t,"|":(e,t)=>t(e),"|>":(e,t)=>t(e)},te={"+":e=>e,"-":e=>-e,"!":e=>!e};class re{timeouts=new Map;debounce(e,t){return new Promise(((r,i)=>{const n=this.timeouts.get(t);n&&clearTimeout(n),this.timeouts.set(t,setTimeout((()=>{try{r(t()),this.timeouts.delete(t)}catch(e){i(e)}}),e))}))}}const ie=new class{empty(){return{type:"Empty",evaluate:e=>e,getIds:e=>e}}literal(e){return{type:"Literal",value:e,evaluate(e){return this.value},getIds:e=>e}}id(e){return{type:"ID",value:e,evaluate(e){return"this"===this.value?e:e?.[this.value]},getIds(e){return e.push(this.value),e}}}unary(e,t){const r=te[e];return{type:"Unary",operator:e,child:t,evaluate(e){return r(this.child.evaluate(e))},getIds(e){return this.child.getIds(e)}}}binary(e,t,r){const i=ee[t];return{type:"Binary",operator:t,left:e,right:r,evaluate(e){if("="===this.operator){if("ID"!==this.left.type&&"Getter"!==this.left.type&&"Index"!==this.left.type)throw new Error(`Invalid assignment target: ${this.left}`);const t=this.right.evaluate(e);let r,i;return"Getter"===this.left.type?(r=this.left.receiver.evaluate(e),i=this.left.name):"Index"===this.left.type?(r=this.left.receiver.evaluate(e),i=this.left.argument.evaluate(e)):"ID"===this.left.type&&(r=e,i=this.left.value),void 0===r?void 0:r[i]=t}return i(this.left.evaluate(e),this.right.evaluate(e))},getIds(e){return this.left.getIds(e),this.right.getIds(e),e}}}getter(e,t){return{type:"Getter",receiver:e,name:t,evaluate(e){return this.receiver.evaluate(e)?.[this.name]},getIds(e){return this.receiver.getIds(e),e}}}invoke(e,t,r){if(null!=t&&"string"!=typeof t)throw new Error("method not a string");return{type:"Invoke",receiver:e,method:t,arguments:r,evaluate(e){const r=this.receiver.evaluate(e),i=this.method?r:e?.this??e,n=this.method?r?.[t]:r,s=(this.arguments??[]).map((t=>t?.evaluate(e)));return n?.apply?.(i,s)},getIds(e){return this.receiver.getIds(e),this.arguments?.forEach((t=>t?.getIds(e))),e}}}paren(e){return e}index(e,t){return{type:"Index",receiver:e,argument:t,evaluate(e){return this.receiver.evaluate(e)?.[this.argument.evaluate(e)]},getIds(e){return this.receiver.getIds(e),e}}}ternary(e,t,r){return{type:"Ternary",condition:e,trueExpr:t,falseExpr:r,evaluate(e){return this.condition.evaluate(e)?this.trueExpr.evaluate(e):this.falseExpr.evaluate(e)},getIds(e){return this.condition.getIds(e),this.trueExpr.getIds(e),this.falseExpr.getIds(e),e}}}map(e){return{type:"Map",entries:e,evaluate(t){const r={};if(e&&this.entries)for(const i in e){const e=this.entries[i];e&&(r[i]=e.evaluate(t))}return r},getIds(t){if(e&&this.entries)for(const r in e){const e=this.entries[r];e&&e.getIds(t)}return t}}}list(e){return{type:"List",items:e,evaluate(e){return this.items?.map((t=>t?.evaluate(e)))},getIds(e){return this.items?.forEach((t=>t?.getIds(e))),e}}}arrowFunction(e,t){return{type:"ArrowFunction",params:e,body:t,evaluate(e){const t=this.params,r=this.body;return function(...i){const n=Object.fromEntries(t.map(((e,t)=>[e,i[t]]))),s=new Proxy(e??{},{set:(e,t,r)=>(n.hasOwnProperty(t)&&(n[t]=r),e[t]=r),get:(e,t)=>n.hasOwnProperty(t)?n[t]:e[t]});return r.evaluate(s)}},getIds(e){return this.body.getIds(e).filter((e=>!this.params.includes(e)))}}}};class ne extends re{evalkeys=["$elem","$event"];expressionCache=new Map;store=new Map;observers=new Map;_observer=null;_lock=Promise.resolve();constructor(e){super();for(let[t,r]of Object.entries(e||{}))this.set(t,r)}wrapFunction(e){return(...t)=>e.call(this.$,...t)}wrapObject(e,t){return null==e||((r=e)instanceof ne||r.__is_proxy__)||e.constructor!==Object&&!Array.isArray(e)?e:new Proxy(e,{deleteProperty:(e,r)=>r in e&&(delete e[r],t(),!0),set:(r,i,n,s)=>{"object"==typeof n&&null!=e&&(n=this.wrapObject(n,t));const o=Reflect.set(r,i,n,s);return t(),o},get:(e,t,r)=>"__is_proxy__"===t||Reflect.get(e,t,r)});var r}watch(e,t){this.observers.has(e)||this.observers.set(e,new Set),this.observers.get(e)?.has(t)||this.observers.get(e)?.add(t)}async notify(e,t=10){const r=Array.from(this.observers.get(e)||[]);await this.debounce(t,(()=>Promise.all(r.map((e=>e.call(this.proxify(e)))))))}get(e,t){return t&&this.watch(e,t),this.store.get(e)}async set(e,t){if(t===this.store.get(e))return;const r=()=>this.notify(e);t&&"function"==typeof t&&(t=this.wrapFunction(t)),t&&"object"==typeof t&&(t=this.wrapObject(t,r)),this.store.set(e,t),await r()}del(e){this.store.delete(e),this.observers.delete(e)}has(e){return this.store.has(e)}effect(e){return e.call(this.proxify(e))}proxify(e){const t=Array.from(this.store.entries()).map((([e])=>e)),r=Object.fromEntries(t.map((e=>[e,void 0])));return new Proxy(r,{get:(t,r,i)=>"string"==typeof r&&this.store.has(r)?this.get(r,e):"$"===r?this.proxify(e):Reflect.get(this,r,i),set:(e,t,r,i)=>("string"!=typeof t||t in this?Reflect.set(this,t,r,i):this.set(t,r),!0)})}get $(){return this.proxify()}makeEvalFunction(e){if(e.includes(";"))throw new Error("Complex expressions are not supported.");let t=null;if(e.includes("=")){const[r,i]=e.split("=");t=r.trim(),e=i.trim()}return(r,i)=>{const n=((e,t)=>new J(e,t).parse())(e,ie),s=n?.getIds([])?.map((e=>[e,i[e]??r[e]??globalThis[e]])),o=n?.evaluate(Object.fromEntries(s||[]));if(!t)return o;r[t]=o}}cachedExpressionFunction(e){return e=e.trim(),this.expressionCache.has(e)||this.expressionCache.set(e,this.makeEvalFunction(e)),this.expressionCache.get(e)}eval(e,t={}){const r=this._observer?this:this.$;if(this.store.has(e))return r[e];return this.cachedExpressionFunction(e)(r,t)}}class se extends ne{debugging=!1;dirpath="";_skipNodes=new Set;_customElements=new Map;debug(e){return this.debugging=e,this}async fetchRemote(e,t){return fetch(e,{cache:t?.cache??"default"}).then((e=>e.text()))}async fetchLocal(e,t){return this.fetchRemote(e,t)}async preprocessString(e,t){this.log("Preprocessing string content with params:\n",t);const r=this.parseHTML(e,t);return await this.preprocessNode(r,t),r}async preprocessRemote(e,t){const r={};t?.cache&&(r.cache=t.cache);const i=await fetch(e,r).then((e=>e.text()));return this.preprocessString(i,{...t,dirpath:z(e),rootDocument:t?.rootDocument??!e.endsWith(".tpl.html")})}async preprocessLocal(e,t){const r=await this.fetchLocal(e,t);return this.preprocessString(r,{...t,dirpath:z(e),rootDocument:t?.rootDocument??!e.endsWith(".tpl.html")})}clone(){const e=Object.fromEntries(this.store.entries()),t=new this.constructor(e).debug(this.debugging);return t._customElements=this._customElements,Array.from(this.store.keys()).forEach((e=>this.watch(e,(()=>t.set(e,this.get(e)))))),t}log(...e){this.debugging&&console.debug(...e)}async preprocessNode(e,t){t={dirpath:this.dirpath,maxdepth:10,...t};const r=new d(O(e,this._skipNodes)).map((async e=>{this.log("Preprocessing node:\n",j(e,128)),await G.resolveIncludes.call(this,e,t),await G.rebaseRelativePaths.call(this,e,t),await G.registerCustomElements.call(this,e,t),await G.resolveCustomElements.call(this,e,t)}));return await Promise.all(r.generator()),e}async renderNode(e,t){for(const r of O(e,this._skipNodes))this.log("Rendering node:\n",j(r,128)),await G.resolveDataAttribute.call(this,r,t),await G.resolveForAttribute.call(this,r,t),await G.resolveTextAttributes.call(this,r,t),await G.resolveHtmlAttribute.call(this,r,t),await G.resolveShowAttribute.call(this,r,t),await G.resolveClassAttribute.call(this,r,t),await G.resolveBindAttribute.call(this,r,t),await G.resolveEventAttributes.call(this,r,t),await G.resolveTextNodeExpressions.call(this,r,t),await G.resolveCustomAttribute.call(this,r,t);return e}async mount(e,t){t={...t,rootNode:e},await this.preprocessNode(e,t),await this.renderNode(e,t),e.renderer=this}}class oe extends se{dirpath=z(self.location.href);parseHTML(e,t={rootDocument:!1}){if(t.rootDocument)return(new DOMParser).parseFromString(e,"text/html");{const t=document.createRange();return t.selectNodeContents(document.body),t.createContextualFragment(e)}}serializeHTML(e){return(new XMLSerializer).serializeToString(e).replace(/\s?xmlns="[^"]+"/gm,"")}preprocessLocal(e,t){return this.preprocessRemote(e,t)}createElement(e,t){return(t||document).createElement(e)}textContent(e,t){e.textContent=t}}new oe;const ae={sm:640,md:768,lg:1024,xl:1280},ce=.25,le=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],he=[...le,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,112,128,144,160,192,224,256,288,320,384,448,512,...Object.values(ae)],ue=[1,2,5,10,20,25,30,40,50,60,70,75,80,90,95,98,99,100],de=["hover","focus","disabled","focus","active"],pe={margin:"m",padding:"p"},fe={width:"w",height:"h"},me={top:"top",right:"right",bottom:"bottom",left:"left"},_e={"min-width":"min-w","min-height":"min-h","max-width":"max-w","max-height":"max-h"},Ee={bold:{"font-weight":"bold"},semibold:{"font-weight":600},italic:{"font-style":"italic"},underline:{"text-decoration":"underline"},"no-underline":{"text-decoration":"none"},"decoration-none":{"text-decoration":"none"},"line-through":{"text-decoration":"line-through"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},"font-mono":{"font-family":"monospace"},"font-sans":{"font-family":"sans-serif"},"font-serif":{"font-family":"serif"},"font-cursive":{"font-family":"cursive"},"text-left":{"text-align":"left"},"text-right":{"text-align":"right"},"text-center":{"text-align":"center"},"text-justify":{"text-align":"justify"},"text-xs":{"font-size":".75rem"},"text-sm":{"font-size":".875rem"},"text-base":{"font-size":"1rem"},"text-lg":{"font-size":"1.125rem"},"text-xl":{"font-size":"1.25rem"},relative:{position:"relative"},fixed:{position:"fixed"},absolute:{position:"absolute"},sticky:{position:"sticky"},"object-contain":{"object-fit":"contain"},"object-cover":{"object-fit":"cover"},"object-fill":{"object-fit":"fill"},"object-none":{"object-fit":"none"},block:{display:"block"},contents:{display:"contents"},hidden:{display:"none"},inline:{display:"inline"},"inline-block":{display:"inline-block"},visible:{visibility:"visible"},invisible:{visibility:"hidden"},collapse:{visibility:"collapse"},"list-none":{"list-style-type":"none"},"list-disc":{"list-style-type":"disc"},"list-decimal":{"list-style-type":"decimal"},flex:{display:"flex"},"flex-1":{flex:"1 1 0%"},"flex-inline":{display:"inline-flex"},"flex-row":{"flex-direction":"row"},"flex-col":{"flex-direction":"column"},"flex-row-reverse":{"flex-direction":"row-reverse"},"flex-col-reverse":{"flex-direction":"column-reverse"},"flex-wrap":{"flex-wrap":"wrap"},"flex-wrap-reverse":{"flex-wrap":"wrap-reverse"},"flex-nowrap":{"flex-wrap":"nowrap"},"justify-start":{"justify-content":"flex-start"},"justify-end":{"justify-content":"flex-end"},"justify-center":{"justify-content":"center"},"justify-between":{"justify-content":"space-between"},"justify-around":{"justify-content":"space-around"},"justify-evenly":{"justify-content":"space-evenly"},"justify-stretch":{"justify-content":"stretch"},"items-start":{"align-items":"flex-start"},"items-end":{"align-items":"flex-end"},"items-center":{"align-items":"center"},"items-stretch":{"align-items":"stretch"},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"overflow-auto":{overflow:"auto"},"overflow-x-auto":{"overflow-x":"auto"},"overflow-y-auto":{"overflow-y":"auto"},"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"cursor-pointer":{cursor:"pointer"},"cursor-wait":{cursor:"wait"},"cursor-not-allowed":{cursor:"not-allowed"},"select-none":{"user-select":"none"},"select-all":{"user-select":"all"},"pointer-events-auto":{"pointer-events":"auto"},"pointer-events-none":{"pointer-events":"none"},"box-border":{"box-sizing":"border-box"},"box-content":{"box-sizing":"content-box"},resize:{resize:"both"},"resize-x":{resize:"horizontal"},"resize-y":{resize:"vertical"},"resize-none":{resize:"none"},border:{border:"1px solid"},"border-none":{border:"none"},"border-solid":{"border-style":"solid"},"border-dashed":{"border-style":"dashed"},"border-dotted":{"border-style":"dotted"},"rounded-none":{"border-radius":"0"},rounded:{"border-radius":".25rem"},"rounded-sm":{"border-radius":".125rem"},"rounded-md":{"border-radius":".375rem"},"rounded-lg":{"border-radius":".5rem"},"rounded-xl":{"border-radius":".75rem"},"rounded-full":{"border-radius":"9999px"},"transition-none":{transition:"none"},transition:{transition:"all 150ms ease-in-out"},"animate-none":{animation:"none"},"animate-spin":{animation:"spin 1s linear infinite"},"animate-ping":{animation:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite"},"animate-pulse":{animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"}},ge=["@keyframes spin {\n from { transform: rotate(0deg) }\n to { transform: rotate(360deg) }\n }","@keyframes ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n }","@keyframes pulse {\n 0%, 100% { opacity: 1 }\n 50% { opacity: .5 }\n }"],$e={red:{50:16772078,100:16764370,200:15702682,300:15037299,400:15684432,500:16007990,600:15022389,700:13840175,800:12986408,900:12000284},pink:{50:16573676,100:16301008,200:16027569,300:15753874,400:15483002,500:15277667,600:14162784,700:12720219,800:11342935,900:8916559},purple:{50:15984117,100:14794471,200:13538264,300:12216520,400:11225020,500:10233776,600:9315498,700:8069026,800:6953882,900:4854924},"deep-purple":{50:15591414,100:13747433,200:11771355,300:9795021,400:8280002,500:6765239,600:6174129,700:5320104,800:4532128,900:3218322},indigo:{50:15264502,100:12962537,200:10463450,300:7964363,400:6056896,500:4149685,600:3754411,700:3162015,800:2635155,900:1713022},blue:{50:14938877,100:12312315,200:9489145,300:6600182,400:4367861,500:2201331,600:2001125,700:1668818,800:1402304,900:870305},"light-blue":{50:14808574,100:11789820,200:8508666,300:5227511,400:2733814,500:240116,600:236517,700:166097,800:161725,900:87963},cyan:{50:14743546,100:11725810,200:8445674,300:5099745,400:2541274,500:48340,600:44225,700:38823,800:33679,900:24676},teal:{50:14742257,100:11722715,200:8440772,300:5093036,400:2533018,500:38536,600:35195,700:31083,800:26972,900:19776},green:{50:15267305,100:13166281,200:10868391,300:8505220,400:6732650,500:5025616,600:4431943,700:3706428,800:3046706,900:1793568},"light-green":{50:15857897,100:14478792,200:12968357,300:11457921,400:10275941,500:9159498,600:8172354,700:6856504,800:5606191,900:3369246},lime:{50:16382951,100:15791299,200:15134364,300:14477173,400:13951319,500:13491257,600:12634675,700:11514923,800:10394916,900:8550167},yellow:{50:16776679,100:16775620,200:16774557,300:16773494,400:16772696,500:16771899,600:16635957,700:16498733,800:16361509,900:16088855},amber:{50:16775393,100:16772275,200:16769154,300:16766287,400:16763432,500:16761095,600:16757504,700:16752640,800:16748288,900:16740096},orange:{50:16774112,100:16769202,200:16764032,300:16758605,400:16754470,500:16750592,600:16485376,700:16088064,800:15690752,900:15094016},"deep-orange":{50:16509415,100:16764092,200:16755601,300:16747109,400:16740419,500:16733986,600:16011550,700:15092249,800:14172949,900:12531212},brown:{50:15723497,100:14142664,200:12364452,300:10586239,400:9268835,500:7951688,600:7162945,700:6111287,800:5125166,900:4073251},gray:{50:16448250,100:16119285,200:15658734,300:14737632,400:12434877,500:10395294,600:7697781,700:6381921,800:4342338,900:2171169},"blue-gray":{50:15527921,100:13621468,200:11583173,300:9479342,400:7901340,500:6323595,600:5533306,700:4545124,800:3622735,900:2503224}};function ve(e){return de.map((t=>`.${t}\\:${e}:${t}`))}function be(e,t){return Object.entries(ae).map((([r,i])=>`@media (min-width: ${i}px) { .${r}\\:${e} { ${t} } }`))}function ye(e,t){return e.includes("@media")&&!t.includes("@media")?1:!e.includes("@media")&&t.includes("@media")?-1:e.localeCompare(t)}function we(e){return Object.entries(e).flatMap((([e,t])=>[[`${t}-0`,`${e}: 0`],[`${t}-screen`,`${e}: 100vw`],[`${t}-full`,`${e}: 100%`],...he.map((r=>[`${t}-${r}`,`${e}: ${r*ce}rem`])),...he.map((r=>[`-${t}-${r}`,`${e}: -${r*ce}rem`])),...he.map((r=>[`${t}-${r}px`,`${e}: ${r}px`])),...he.map((r=>[`-${t}-${r}px`,`${e}: -${r}px`])),...ue.map((r=>[`${t}-${r}\\%`,`${e}: ${r}%`])),...ue.map((r=>[`-${t}-${r}\\%`,` ${e}: -${r}%`]))])).flatMap((([e,t])=>[`.${e} { ${t} }`,`${ve(e).join(",")} { ${t} }`,...be(e,t)]))}function xe(e){return Object.entries(e).flatMap((([e,t])=>[`.${t}-auto { ${e}: auto; }`,`.${t}x-auto { ${e}-left: auto; ${e}-right: auto; }`,`.${t}y-auto { ${e}-top: auto; ${e}-bottom: auto; }`,`.${t}x-0 { ${e}-left: 0; ${e}-right: 0; }`,`.${t}y-0 { ${e}-top: 0; ${e}-bottom: 0; }`,...he.map((e=>[e,e*ce])).map((([r,i])=>`.${t}x-${r} { ${e}-left: ${i}rem; ${e}-right: ${i}rem; }`)),...he.map((e=>[e,e*ce])).map((([r,i])=>`.${t}y-${r} { ${e}-top: ${i}rem; ${e}-bottom: ${i}rem; }`)),...he.map((r=>`.${t}x-${r}px { ${e}-left: ${r}px; ${e}-right: ${r}px; }`)),...he.map((r=>`.${t}y-${r}px { ${e}-top: ${r}px; ${e}-bottom: ${r}px; }`)),...ue.map((r=>`.${t}x-${r}\\% { ${e}-left: ${r}%; ${e}-right: ${r}%; }`)),...ue.map((r=>`.${t}y-${r}\\% { ${e}-top: ${r}%; ${e}-bottom: ${r}%; }`))]))}function Ae(){const e=[["white","#fff"],["black","#000"],["transparent","transparent"]].flatMap((([e,t])=>[[`text-${e}`,`color: ${t}`],[`fill-${e}`,`fill: ${t}`],[`bg-${e}`,`background-color: ${t}`],[`border-${e}`,`border-color: ${t}`]])),t=Object.entries($e).flatMap((([e,t])=>[[`text-${e}`,`color: #${t[500].toString(16)}`],[`fill-${e}`,`fill: #${t[500].toString(16)}`],[`bg-${e}`,`background-color: #${t[500].toString(16)}`],[`border-${e}`,`border-color: #${t[500].toString(16)}`]])),r=Object.entries($e).flatMap((([e,t])=>Object.entries(t).flatMap((([t,r])=>[[`text-${e}-${t}`,`color: #${r.toString(16)}`],[`fill-${e}-${t}`,`fill: #${r.toString(16)}`],[`bg-${e}-${t}`,`background-color: #${r.toString(16)}`],[`border-${e}-${t}`,`border-color: #${r.toString(16)}`]]))));return[].concat(e).concat(t).concat(r).flatMap((([e,t])=>[`.${e} { ${t} }`,`${ve(e).join(",")} { ${t} }`,...be(e,t)]))}const Oe=new oe;globalThis.Mancha=Oe;const Re=globalThis.document?.currentScript;if(globalThis.document?.currentScript?.hasAttribute("init")){const e=Re?.hasAttribute("debug"),t=Re?.getAttribute("cache"),r=Re?.getAttribute("target")?.split("+")||["body"];window.addEventListener("load",(()=>{r.map((async r=>{const i=globalThis.document.querySelector(r);await Oe.debug(e).mount(i,{cache:t})}))}))}if(globalThis.document?.currentScript?.hasAttribute("css")){const e=Re?.getAttribute("css")?.split("+");for(const t of e){const e=document.createElement("style");switch(t){case"basic":u(e,x`
72
+ html {
73
+ max-width: 70ch;
74
+ padding: 2em 1em;
75
+ margin: auto;
76
+ line-height: 1.75;
77
+ font-size: 1.25em;
78
+ font-family: sans-serif;
79
+ }
80
+
81
+ h1,h2,h3,h4,h5,h6 {
82
+ margin: 1em 0 0.5em;
83
+ }
84
+
85
+ p,ul,ol {
86
+ margin-bottom: 1em;
87
+ color: #1d1d1d;
88
+ }`);break;case"utils":e.textContent=(Ie=void 0,[...ge,...Object.entries(Ee).flatMap((([e,t])=>Object.entries(t).flatMap((([t,r])=>[`.${e} { ${t}: ${r} }`,`${ve(e).join(",")} { ${t}: ${r} }`,...be(e,`${t}: ${r}`)])))),...Ae(),...[["opacity-0","opacity: 0"],...ue.map((e=>[`opacity-${e}`,"opacity: "+e/100]))].flatMap((([e,t])=>[`.${e} { ${t} }`,`${ve(e).join(",")} { ${t} }`,...be(e,t)])),...we(fe),...xe(fe),...we(me),...xe(me),...(Ie=pe,Object.entries(Ie).flatMap((([e,t])=>[[`${t}t-0`,`${e}-top: 0`],[`${t}b-0`,`${e}-bottom: 0`],[`${t}l-0`,`${e}-left: 0`],[`${t}r-0`,`${e}-right: 0`],[`${t}t-auto`,`${e}-top: auto`],[`${t}b-auto`,`${e}-bottom: auto`],[`${t}l-auto`,`${e}-left: auto`],[`${t}r-auto`,`${e}-right: auto`],...["","-"].flatMap((r=>[...he.map((e=>[e,e*ce])).map((([i,n])=>[`${r}${t}t-${i}`,`${e}-top: ${r}${n}rem`])),...he.map((e=>[e,e*ce])).map((([i,n])=>[`${r}${t}b-${i}`,`${e}-bottom: ${r}${n}rem`])),...he.map((e=>[e,e*ce])).map((([i,n])=>[`${r}${t}l-${i}`,`${e}-left: ${r}${n}rem`])),...he.map((e=>[e,e*ce])).map((([i,n])=>[`${r}${t}r-${i}`,`${e}-right: ${r}${n}rem`])),...he.map((i=>[`${r}${t}t-${i}px`,`${e}-top: ${r}${i}px`])),...he.map((i=>[`${r}${t}b-${i}px`,`${e}-bottom: ${r}${i}px`])),...he.map((i=>[`${r}${t}l-${i}px`,`${e}-left: ${r}${i}px`])),...he.map((i=>[`${r}${t}r-${i}px`,`${e}-right: ${r}${i}px`])),...ue.map((i=>[`${r}${t}t-${i}\\%`,`${e}-top: ${r}${i}%`])),...ue.map((i=>[`${r}${t}b-${i}\\%`,`${e}-bottom: ${r}${i}%;`])),...ue.map((i=>[`${r}${t}l-${i}\\%`,`${e}-left: ${r}${i}%`])),...ue.map((i=>[`${r}${t}r-${i}\\%`,`${e}-right: ${r}${i}%`]))]))])).flatMap((([e,t])=>[`.${e} { ${t} }`,`${ve(e).join(",")} { ${t} }`,...be(e,t)]))),...we(pe),...xe(pe),".space-x-0 > * { margin-left: 0 }",".space-y-0 > * { margin-top: 0 }",...he.map((e=>`.space-x-${e} > :not(:first-child) { margin-left: ${e*ce}rem }`)),...he.map((e=>`.space-y-${e} > :not(:first-child) { margin-top: ${e*ce}rem }`)),...he.map((e=>`.space-x-${e}px > :not(:first-child) { margin-left: ${e}px }`)),...he.map((e=>`.space-y-${e}px > :not(:first-child) { margin-top: ${e}px }`)),".gap-0 { gap: 0 }",...he.map((e=>`.gap-${e} { gap: ${e*ce}rem }`)),...he.map((e=>`.gap-${e}px { gap: ${e}px }`)),...he.map((e=>`.gap-x-${e} { column-gap: ${e*ce}rem }`)),...he.map((e=>`.gap-y-${e} { row-gap: ${e*ce}rem }`)),...he.map((e=>`.gap-x-${e}px { column-gap: ${e}px }`)),...he.map((e=>`.gap-y-${e}px { row-gap: ${e}px }`)),...we(_e),...[...le.map((e=>[`border-${e}`,`border-width: ${e}px`]))].flatMap((([e,t])=>[`.${e} { ${t} }`,`${ve(e).join(",")} { ${t} }`,...be(e,t)]))].sort(ye).join("\n"));break;default:console.error(`Unknown style name: "${t}"`)}globalThis.document.head.appendChild(e)}}var Ie})();