mancha 0.8.49 → 0.8.50

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.
@@ -75,6 +75,10 @@ const PROPS_CUSTOM = {
75
75
  hidden: { display: "none" },
76
76
  inline: { display: "inline" },
77
77
  "inline-block": { display: "inline-block" },
78
+ // List.
79
+ "list-none": { "list-style-type": "none" },
80
+ "list-disc": { "list-style-type": "disc" },
81
+ "list-decimal": { "list-style-type": "decimal" },
78
82
  // Flex.
79
83
  flex: { display: "flex" },
80
84
  "flex-1": { flex: "1 1 0%" },
@@ -519,19 +523,19 @@ function tblr(props) {
519
523
  // PX units top.
520
524
  ...UNITS_ALL.map((v) => [`${sign}${klass}t-${v}px`, `${prop}-top: ${sign}${v}px`]),
521
525
  // PX units bottom.
522
- ...UNITS_ALL.map((v) => [`${sign}${klass}t-${v}px`, `${prop}-bottom: ${sign}${v}px`]),
526
+ ...UNITS_ALL.map((v) => [`${sign}${klass}b-${v}px`, `${prop}-bottom: ${sign}${v}px`]),
523
527
  // PX units left.
524
- ...UNITS_ALL.map((v) => [`${sign}${klass}t-${v}px`, `${prop}-left: ${sign}${v}px`]),
528
+ ...UNITS_ALL.map((v) => [`${sign}${klass}l-${v}px`, `${prop}-left: ${sign}${v}px`]),
525
529
  // PX units right.
526
- ...UNITS_ALL.map((v) => [`${sign}${klass}t-${v}px`, `${prop}-right: ${sign}${v}px`]),
530
+ ...UNITS_ALL.map((v) => [`${sign}${klass}r-${v}px`, `${prop}-right: ${sign}${v}px`]),
527
531
  // Percent units top.
528
- ...PERCENTS.map((v) => [`${sign}${klass}y-${v}\\%`, `${prop}-top: ${sign}${v}%`]),
532
+ ...PERCENTS.map((v) => [`${sign}${klass}t-${v}\\%`, `${prop}-top: ${sign}${v}%`]),
529
533
  // Percent units bottom.
530
- ...PERCENTS.map((v) => [`${sign}${klass}y-${v}\\%`, `${prop}-bottom: ${sign}${v}%;`]),
534
+ ...PERCENTS.map((v) => [`${sign}${klass}b-${v}\\%`, `${prop}-bottom: ${sign}${v}%;`]),
531
535
  // Percent units left.
532
- ...PERCENTS.map((v) => [`${sign}${klass}x-${v}\\%`, `${prop}-left: ${sign}${v}%`]),
536
+ ...PERCENTS.map((v) => [`${sign}${klass}l-${v}\\%`, `${prop}-left: ${sign}${v}%`]),
533
537
  // Percent units right.
534
- ...PERCENTS.map((v) => [`${sign}${klass}x-${v}\\%`, `${prop}-right: ${sign}${v}%`]),
538
+ ...PERCENTS.map((v) => [`${sign}${klass}r-${v}\\%`, `${prop}-right: ${sign}${v}%`]),
535
539
  ]),
536
540
  ])
537
541
  .flatMap(([klass, rule]) => [
package/dist/mancha.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t={654:(t,e,r)=>{r.d(e,{A:()=>a});var n=r(601),o=r.n(n),i=r(314),s=r.n(i)()(o());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 r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(n)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]);n&&s[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={id:n,exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.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 r of e)t(r)&&(yield r)}static*mapGenerator(t,e){for(const r of e)yield t(r)}static equals(t,e){const r=t[Symbol.iterator](),n=e[Symbol.iterator]();let o=r.next(),i=n.next();for(;!o.done&&!i.done;){if(o.value!==i.value)return!1;o=r.next(),i=n.next()}return o.done===i.done}}var e,n;(n=e||(e={})).Root="root",n.Text="text",n.Directive="directive",n.Comment="comment",n.Script="script",n.Style="style",n.Tag="tag",n.CDATA="cdata",n.Doctype="doctype",e.Root,e.Text,e.Directive,e.Comment,e.Script,e.Style,e.Tag,e.CDATA,e.Doctype;class o{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 i extends o{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}}class s extends i{constructor(){super(...arguments),this.type=e.Text}get nodeType(){return 3}}class a extends i{constructor(){super(...arguments),this.type=e.Comment}get nodeType(){return 8}}class c extends i{constructor(t,r){super(r),this.name=t,this.type=e.Directive}get nodeType(){return 1}}class l extends o{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,r,n=[],o=("script"===t?e.Script:"style"===t?e.Style:e.Tag)){super(n),this.name=t,this.attribs=r,this.type=o}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,r;return{name:t,value:this.attribs[t],namespace:null===(e=this["x-attribsNamespace"])||void 0===e?void 0:e[t],prefix:null===(r=this["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))}}function p(t,r=!1){let n;if(function(t){return t.type===e.Text}(t))n=new s(t.data);else if(function(t){return t.type===e.Comment}(t))n=new a(t.data);else if(function(t){return(r=t).type===e.Tag||r.type===e.Script||r.type===e.Style;var r}(t)){const e=r?f(t.children):[],o=new d(t.name,{...t.attribs},e);e.forEach((t=>t.parent=o)),null!=t.namespace&&(o.namespace=t.namespace),t["x-attribsNamespace"]&&(o["x-attribsNamespace"]={...t["x-attribsNamespace"]}),t["x-attribsPrefix"]&&(o["x-attribsPrefix"]={...t["x-attribsPrefix"]}),n=o}else if(function(t){return t.type===e.CDATA}(t)){const e=r?f(t.children):[],o=new u(e);e.forEach((t=>t.parent=o)),n=o}else if(function(t){return t.type===e.Root}(t)){const e=r?f(t.children):[],o=new h(e);e.forEach((t=>t.parent=o)),t["x-mode"]&&(o["x-mode"]=t["x-mode"]),n=o}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"]),n=e}}return n.startIndex=t.startIndex,n.endIndex=t.endIndex,null!=t.sourceCodeLocation&&(n.sourceCodeLocation=t.sourceCodeLocation),n}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 r=new Set,n=Array.from(t.childNodes).filter((t=>!e.has(t)));for(yield t;n.length;){const t=n.shift();r.has(t)||(r.add(t),yield t),t.childNodes&&Array.from(t.childNodes).filter((t=>!e.has(t))).forEach((t=>n.push(t)))}}function $(t,e){return"function"==typeof t?.[e]}function g(t,e){return t instanceof d?t.attribs?.[e]:t.getAttribute?.(e)}function b(t,e,r){t instanceof d?t.attribs[e]=r:t.setAttribute?.(e,r)}function x(t,e){t instanceof d?delete t.attribs[e]:t.removeAttribute?.(e)}function y(t,e,r){if(t instanceof d&&e instanceof d)e.attribs[r]=t.attribs[r];else{const n=t?.getAttributeNode?.(r);e?.setAttributeNode?.(n?.cloneNode(!0))}}function v(t,...e){if($(t,"replaceWith"))return t.replaceWith(...e);{const r=t,n=r.parentNode,o=Array.from(n.childNodes).indexOf(r);e.forEach((t=>t.parentNode=n)),n.childNodes=[].concat(Array.from(n.childNodes).slice(0,o)).concat(e).concat(Array.from(n.childNodes).slice(o+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 r=e;return t.childNodes=t.children.filter((t=>t!==r)),r}}function A(t,e,r){return r?$(t,"insertBefore")?t.insertBefore(e,r):(v(r,e,r),e):w(t,e)}function j(t){return t instanceof o?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(((r,n)=>{const o=this.timeouts.get(e);o&&clearTimeout(o),this.timeouts.set(e,setTimeout((()=>{try{r(e()),this.timeouts.delete(e)}catch(t){n(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,r]of Object.entries(t||{}))this.set(e,r)}wrapFunction(t){return(...e)=>t.call(this.$,...e)}wrapObject(t,e){return null==t||(r=t)instanceof E||r.__is_proxy__||t.constructor!==Object&&!Array.isArray(t)?t:new Proxy(t,{deleteProperty:(t,r)=>r in t&&(delete t[r],e(),!0),set:(r,n,o,i)=>{"object"==typeof o&&null!=t&&(o=this.wrapObject(o,e));const s=Reflect.set(r,n,o,i);return e(),s},get:(t,e,r)=>"__is_proxy__"===e||Reflect.get(t,e,r)});var r}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 r=Array.from(this.observers.get(t)||[]);await this.debounce(e,(()=>Promise.all(r.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 r=()=>this.notify(t);e&&"function"==typeof e&&(e=this.wrapFunction(e)),e&&"object"==typeof e&&(e=this.wrapObject(e,r)),this.store.set(t,e),await r()}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)),r=Object.fromEntries(e.map((t=>[t,void 0])));return new Proxy(r,{get:(e,r,n)=>"string"==typeof r&&this.store.has(r)?this.get(r,t):"$"===r?this.proxify(t):Reflect.get(this,r,n),set:(t,e,r,n)=>("string"!=typeof e||e in this?Reflect.set(this,e,r,n):this.set(e,r),!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 r=this._observer?this:this.$;if(this.store.has(t))return r[t];{const n=this.cachedExpressionFunction(t),o=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 n.call(r,...o)}}}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 r=t;if("include"!==r.tagName?.toLocaleLowerCase())return;this.log("<include> tag found in:\n",S(t,128)),this.log("<include> params:",e);const n=g(r,"src");if(!n)throw new Error(`"src" attribute missing from ${t}.`);const o=e=>{const n=e.firstChild;for(const t of Array.from(r.attributes))n&&"src"!==t.name&&y(r,n,t.name);v(t,...e.childNodes)},i={...e,rootDocument:!1,maxdepth:e?.maxdepth-1};if(0===i.maxdepth)throw new Error("Maximum recursion depth reached.");if(n.includes("://")||n.startsWith("//"))this.log("Including remote file from absolute path:",n),await this.preprocessRemote(n,i).then(o);else if(e?.dirpath?.includes("://")||e?.dirpath?.startsWith("//")){const t=n.startsWith("/")?n:`${e.dirpath}/${n}`;this.log("Including remote file from relative path:",t),await this.preprocessRemote(t,i).then(o)}else if("/"===n.charAt(0))this.log("Including local file from absolute path:",n),await this.preprocessLocal(n,i).then(o);else{const t=e?.dirpath&&"."!==e?.dirpath?`${e?.dirpath}/${n}`:n;this.log("Including local file from relative path:",t),await this.preprocessLocal(t,i).then(o)}},e.rebaseRelativePaths=async function(t,e){const r=t,n=r.tagName?.toLowerCase();if(!e?.dirpath)return;const o=g(r,"src"),i=g(r,"href"),s=g(r,"data"),a=o||i||s;a&&(a&&P(a)&&this.log("Rebasing relative path as:",e.dirpath,"/",a),"img"===n&&o&&P(o)?b(r,"src",`${e.dirpath}/${o}`):"a"===n&&i&&P(i)||"link"===n&&i&&P(i)?b(r,"href",`${e.dirpath}/${i}`):"script"===n&&o&&P(o)||"source"===n&&o&&P(o)||"audio"===n&&o&&P(o)||"video"===n&&o&&P(o)||"track"===n&&o&&P(o)||"iframe"===n&&o&&P(o)?b(r,"src",`${e.dirpath}/${o}`):"object"===n&&s&&P(s)?b(r,"data",`${e.dirpath}/${s}`):"input"===n&&o&&P(o)?b(r,"src",`${e.dirpath}/${o}`):("area"===n&&i&&P(i)||"base"===n&&i&&P(i))&&b(r,"href",`${e.dirpath}/${i}`))},e.registerCustomElements=async function(t,e){const r=t;if("template"===r.tagName?.toLowerCase()&&g(r,"is")){const t=g(r,"is")?.toLowerCase();this._customElements.has(t)||(this.log(`Registering custom element: ${t}\n`,S(r,128)),this._customElements.set(t,r.cloneNode(!0)),N(r.parentNode,r))}},e.resolveCustomElements=async function(e,r){const n=e,o=n.tagName?.toLowerCase();if(this._customElements.has(o)){this.log(`Processing custom element: ${o}\n`,S(n,128));const r=this._customElements.get(o),i=(r.content||r).cloneNode(!0),s=function(t){return t instanceof d?t.children.find((t=>t instanceof d)):t.firstElementChild}(i);for(const t of Array.from(n.attributes))s&&y(n,s,t.name);const a=new t(m(i)).find((t=>"slot"===t.tagName?.toLowerCase()));a&&v(a,...n.childNodes),v(e,...i.childNodes)}},e.resolveTextNodeExpressions=async function(t,e){const r=j(t)||"";if(3!==t.nodeType||!r?.trim())return;this.log("Processing node content value:\n",k(r,128));const n=new RegExp(/{{ ([^}]+) }}/gm),i=Array.from(r.matchAll(n)).map((t=>t[1]));return this.effect((function(){let e=r;for(const r of i){const n=this.eval(r,{$elem:t});e=e.replace(`{{ ${r} }}`,String(n))}!function(t,e){t instanceof o?t.data=e:t.nodeValue=e}(t,e)}))},e.resolveDataAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=g(r,":data");if(n){this.log(":data attribute found in:\n",S(t,128)),x(r,":data");const o=e?.rootNode===t?this:this.clone();t.renderer=o;const i=function(t,e=[]){return new Function(...e,`with (this) { return (async () => (${t}))(); }`)}(n,this.evalkeys),s=await i.call(o.$,{$elem:t});if(await Promise.all(Object.entries(s).map((([t,e])=>o.set(t,e)))),o!==this)for(const e of m(t,this._skipNodes))this._skipNodes.add(e);await o.mount(t,e)}},e.resolveWatchAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=g(r,"@watch");n&&(this.log("@watch attribute found in:\n",S(t,128)),x(r,"@watch"),await this.effect((function(){return this.eval(n,{$elem:t})})))},e.resolveTextAttributes=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=g(r,"$text");return n?(this.log("$text attribute found in:\n",S(t,128)),x(r,"$text"),this.effect((function(){!function(t,e){t instanceof d?t.children=[new s(e)]:t.textContent=e}(t,this.eval(n,{$elem:t}))}))):void 0},e.resolveHtmlAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=g(r,"$html");return n?(this.log("$html attribute found in:\n",S(t,128)),x(r,"$html"),this.effect((function(){const o=this.eval(n,{$elem:t});return new Promise((async t=>{const n=await this.preprocessString(o,e);await this.renderNode(n),function(t,...e){$(t,"replaceChildren")?t.replaceChildren(...e):(t.childNodes=e,e.forEach((e=>e.parentNode=t)))}(r,n),t()}))}))):void 0},e.resolvePropAttributes=async function(t,e){if(this._skipNodes.has(t))return;const r=t;for(const e of Array.from(r.attributes||[]))if(e.name.startsWith("$")&&!_.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(r,e.name);const n=e.name.slice(1).replace(/-./g,(t=>t[1].toUpperCase()));await this.effect((function(){t[n]=this.eval(e.value,{$elem:t})}))}},e.resolveAttrAttributes=async function(t,e){if(this._skipNodes.has(t))return;const r=t;for(const e of Array.from(r.attributes||[]))if(e.name.startsWith(":")&&!_.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(r,e.name);const n=e.name.slice(1);this.effect((function(){b(r,n,this.eval(e.value,{$elem:t}))}))}},e.resolveEventAttributes=async function(t,e){if(this._skipNodes.has(t))return;const r=t;for(const e of Array.from(r.attributes||[]))e.name.startsWith("@")&&!_.has(e.name)&&(this.log(e.name,"attribute found in:\n",S(t,128)),x(r,e.name),t.addEventListener?.(e.name.substring(1),(r=>this.eval(e.value,{$elem:t,$event:r}))))},e.resolveForAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=g(r,":for")?.trim();if(n){this.log(":for attribute found in:\n",S(t,128)),x(r,":for");for(const e of m(t,this._skipNodes))this._skipNodes.add(e);const o=t.parentNode,i=function(t,e){return e?e.createElement(t):new d(t,{})}("template",t.ownerDocument);A(o,i,t),N(o,t),w(i,t),this.log(":for template:\n",S(i,128));const s=n.split(" in ",2);if(2!==s.length)throw new Error(`Invalid :for format: \`${n}\`. Expected "{key} in {expression}".`);const a=[],[c,l]=s;await this.effect((function(){const r=this.eval(l,{$elem:t});if(this.log(":for list items:",r),a.splice(0,a.length).forEach((t=>{N(o,t),this._skipNodes.delete(t)})),!Array.isArray(r))return console.error(`Expression did not yield a list: \`${l}\` => \`${r}\``),Promise.resolve();const n=[];for(const o of r){const r=this.clone();r.set(c,o);const i=t.cloneNode(!0);a.push(i),this._skipNodes.add(i),n.push(r.mount(i,e)),this.log("Rendered list child:\n",S(i,128))}const s=i.nextSibling;for(const t of a)A(o,t,s);return Promise.all(n)}))}},e.resolveBindAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=g(r,":bind");if(n){this.log(":bind attribute found in:\n",S(t,128));const e=["change","input"],o=g(r,":bind-events")?.split(",")||e;x(r,":bind"),x(r,":bind-events");const i="checkbox"===g(r,"type")?"checked":"value",s=`$elem.${i} = ${n}`;this.effect((function(){const e=this.eval(s,{$elem:t});r[i]=e}));const a=`${n} = $elem.${i}`;for(const e of o)t.addEventListener(e,(()=>this.eval(a,{$elem:t})))}},e.resolveShowAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=g(r,":show");if(n){this.log(":show attribute found in:\n",S(t,128)),x(r,":show");const e="none"===r.style?.display?"":r.style?.display??g(r,"style")?.split(";")?.find((t=>"display"===t.split(":")[0]))?.split(":")?.at(1)?.trim();this.effect((function(){const o=this.eval(n,{$elem:t});r.style?r.style.display=o?e:"none":b(r,"style",`display: ${o?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 r=this.parseHTML(t,e);return await this.preprocessNode(r,e),r}async preprocessRemote(t,e){const r={};e?.cache&&(r.cache=e.cache);const n=await fetch(t,r).then((t=>t.text()));return this.preprocessString(n,{...e,dirpath:M(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}async preprocessLocal(t,e){const r=await this.fetchLocal(t,e);return this.preprocessString(r,{...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,r){r={dirpath:this.dirpath,maxdepth:10,...r};const n=new t(m(e,this._skipNodes)).map((async t=>{this.log("Preprocessing node:\n",S(t,128)),await T.resolveIncludes.call(this,t,r),await T.rebaseRelativePaths.call(this,t,r),await T.registerCustomElements.call(this,t,r),await T.resolveCustomElements.call(this,t,r)}));return await Promise.all(n.generator()),e}async renderNode(t,e){for(const r of m(t,this._skipNodes))this.log("Rendering node:\n",S(r,128)),await T.resolveDataAttribute.call(this,r,e),await T.resolveForAttribute.call(this,r,e),await T.resolveTextAttributes.call(this,r,e),await T.resolveHtmlAttribute.call(this,r,e),await T.resolveShowAttribute.call(this,r,e),await T.resolveWatchAttribute.call(this,r,e),await T.resolveBindAttribute.call(this,r,e),await T.resolvePropAttributes.call(this,r,e),await T.resolveAttrAttributes.call(this,r,e),await T.resolveEventAttributes.call(this,r,e),await T.resolveTextNodeExpressions.call(this,r,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=r(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"},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:["color","background-color","border-color","text-decoration-color","fill","stroke","opacity","box-shadow","transform","filter","backdrop-filter"].map((t=>`${t} 150ms`)).join(", ")},"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((([r,n])=>`@media (min-width: ${n}px) { .${r}\\:${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((r=>[`${e}-${r}`,`${t}: ${r*R}rem`])),...I.map((r=>[`-${e}-${r}`,`${t}: -${r*R}rem`])),...I.map((r=>[`${e}-${r}px`,`${t}: ${r}px`])),...I.map((r=>[`-${e}-${r}px`,`${t}: -${r}px`])),...W.map((r=>[`${e}-${r}\\%`,`${t}: ${r}%`])),...W.map((r=>[`-${e}-${r}\\%`,` ${t}: -${r}%`]))])).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; }`,...I.map((t=>[t,t*R])).map((([r,n])=>`.${e}x-${r} { ${t}-left: ${n}rem; ${t}-right: ${n}rem; }`)),...I.map((t=>[t,t*R])).map((([r,n])=>`.${e}y-${r} { ${t}-top: ${n}rem; ${t}-bottom: ${n}rem; }`)),...I.map((r=>`.${e}x-${r}px { ${t}-left: ${r}px; ${t}-right: ${r}px; }`)),...I.map((r=>`.${e}y-${r}px { ${t}-top: ${r}px; ${t}-bottom: ${r}px; }`)),...W.map((r=>`.${e}x-${r}\\% { ${t}-left: ${r}%; ${t}-right: ${r}%; }`)),...W.map((r=>`.${e}y-${r}\\% { ${t}-top: ${r}%; ${t}-bottom: ${r}%; }`))]))}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)}`]])),r=Object.entries(X).flatMap((([t,e])=>Object.entries(e).flatMap((([e,r])=>[[`text-${t}-${e}`,`color: #${r.toString(16)}`],[`fill-${t}-${e}`,`fill: #${r.toString(16)}`],[`bg-${t}-${e}`,`background-color: #${r.toString(16)}`],[`border-${t}-${e}`,`border-color: #${r.toString(16)}`]]))));return[].concat(t).concat(e).concat(r).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 rt=self.document?.currentScript;if(self.document?.currentScript?.hasAttribute("init")){const t=rt?.hasAttribute("debug"),e=rt?.getAttribute("cache"),r=rt?.getAttribute("target")?.split("+")||["body"];window.addEventListener("load",(()=>{r.map((async r=>{const n=self.document.querySelector(r);await et.debug(t).mount(n,{cache:e})}))}))}if(self.document?.currentScript?.hasAttribute("css")){const t=rt?.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,r])=>[`.${t} { ${e}: ${r} }`,`${J(t).join(",")} { ${e}: ${r} }`,...K(t,`${e}: ${r}`)])))),...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),...(nt=H,Object.entries(nt).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((r=>[...I.map((t=>[t,t*R])).map((([n,o])=>[`${r}${e}t-${n}`,`${t}-top: ${r}${o}rem`])),...I.map((t=>[t,t*R])).map((([n,o])=>[`${r}${e}b-${n}`,`${t}-bottom: ${r}${o}rem`])),...I.map((t=>[t,t*R])).map((([n,o])=>[`${r}${e}l-${n}`,`${t}-left: ${r}${o}rem`])),...I.map((t=>[t,t*R])).map((([n,o])=>[`${r}${e}r-${n}`,`${t}-right: ${r}${o}rem`])),...I.map((n=>[`${r}${e}t-${n}px`,`${t}-top: ${r}${n}px`])),...I.map((n=>[`${r}${e}t-${n}px`,`${t}-bottom: ${r}${n}px`])),...I.map((n=>[`${r}${e}t-${n}px`,`${t}-left: ${r}${n}px`])),...I.map((n=>[`${r}${e}t-${n}px`,`${t}-right: ${r}${n}px`])),...W.map((n=>[`${r}${e}y-${n}\\%`,`${t}-top: ${r}${n}%`])),...W.map((n=>[`${r}${e}y-${n}\\%`,`${t}-bottom: ${r}${n}%;`])),...W.map((n=>[`${r}${e}x-${n}\\%`,`${t}-left: ${r}${n}%`])),...W.map((n=>[`${r}${e}x-${n}\\%`,`${t}-right: ${r}${n}%`]))]))])).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 nt})()})();
1
+ (()=>{"use strict";var t={654:(t,e,r)=>{r.d(e,{A:()=>a});var n=r(601),o=r.n(n),i=r(314),s=r.n(i)()(o());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 r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(n)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]);n&&s[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={id:n,exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.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 r of e)t(r)&&(yield r)}static*mapGenerator(t,e){for(const r of e)yield t(r)}static equals(t,e){const r=t[Symbol.iterator](),n=e[Symbol.iterator]();let o=r.next(),i=n.next();for(;!o.done&&!i.done;){if(o.value!==i.value)return!1;o=r.next(),i=n.next()}return o.done===i.done}}var e,n;(n=e||(e={})).Root="root",n.Text="text",n.Directive="directive",n.Comment="comment",n.Script="script",n.Style="style",n.Tag="tag",n.CDATA="cdata",n.Doctype="doctype",e.Root,e.Text,e.Directive,e.Comment,e.Script,e.Style,e.Tag,e.CDATA,e.Doctype;class o{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 i extends o{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}}class s extends i{constructor(){super(...arguments),this.type=e.Text}get nodeType(){return 3}}class a extends i{constructor(){super(...arguments),this.type=e.Comment}get nodeType(){return 8}}class c extends i{constructor(t,r){super(r),this.name=t,this.type=e.Directive}get nodeType(){return 1}}class l extends o{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 d extends l{constructor(){super(...arguments),this.type=e.Root}get nodeType(){return 9}}class h extends l{constructor(t,r,n=[],o=("script"===t?e.Script:"style"===t?e.Style:e.Tag)){super(n),this.name=t,this.attribs=r,this.type=o}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,r;return{name:t,value:this.attribs[t],namespace:null===(e=this["x-attribsNamespace"])||void 0===e?void 0:e[t],prefix:null===(r=this["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))}}function p(t,r=!1){let n;if(function(t){return t.type===e.Text}(t))n=new s(t.data);else if(function(t){return t.type===e.Comment}(t))n=new a(t.data);else if(function(t){return(r=t).type===e.Tag||r.type===e.Script||r.type===e.Style;var r}(t)){const e=r?f(t.children):[],o=new h(t.name,{...t.attribs},e);e.forEach((t=>t.parent=o)),null!=t.namespace&&(o.namespace=t.namespace),t["x-attribsNamespace"]&&(o["x-attribsNamespace"]={...t["x-attribsNamespace"]}),t["x-attribsPrefix"]&&(o["x-attribsPrefix"]={...t["x-attribsPrefix"]}),n=o}else if(function(t){return t.type===e.CDATA}(t)){const e=r?f(t.children):[],o=new u(e);e.forEach((t=>t.parent=o)),n=o}else if(function(t){return t.type===e.Root}(t)){const e=r?f(t.children):[],o=new d(e);e.forEach((t=>t.parent=o)),t["x-mode"]&&(o["x-mode"]=t["x-mode"]),n=o}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"]),n=e}}return n.startIndex=t.startIndex,n.endIndex=t.endIndex,null!=t.sourceCodeLocation&&(n.sourceCodeLocation=t.sourceCodeLocation),n}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 r=new Set,n=Array.from(t.childNodes).filter((t=>!e.has(t)));for(yield t;n.length;){const t=n.shift();r.has(t)||(r.add(t),yield t),t.childNodes&&Array.from(t.childNodes).filter((t=>!e.has(t))).forEach((t=>n.push(t)))}}function $(t,e){return"function"==typeof t?.[e]}function b(t,e){return t instanceof h?t.attribs?.[e]:t.getAttribute?.(e)}function g(t,e,r){t instanceof h?t.attribs[e]=r:t.setAttribute?.(e,r)}function x(t,e){t instanceof h?delete t.attribs[e]:t.removeAttribute?.(e)}function y(t,e,r){if(t instanceof h&&e instanceof h)e.attribs[r]=t.attribs[r];else{const n=t?.getAttributeNode?.(r);e?.setAttributeNode?.(n?.cloneNode(!0))}}function v(t,...e){if($(t,"replaceWith"))return t.replaceWith(...e);{const r=t,n=r.parentNode,o=Array.from(n.childNodes).indexOf(r);e.forEach((t=>t.parentNode=n)),n.childNodes=[].concat(Array.from(n.childNodes).slice(0,o)).concat(e).concat(Array.from(n.childNodes).slice(o+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 r=e;return t.childNodes=t.children.filter((t=>t!==r)),r}}function A(t,e,r){return r?$(t,"insertBefore")?t.insertBefore(e,r):(v(r,e,r),e):w(t,e)}function j(t){return t instanceof o?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(((r,n)=>{const o=this.timeouts.get(e);o&&clearTimeout(o),this.timeouts.set(e,setTimeout((()=>{try{r(e()),this.timeouts.delete(e)}catch(t){n(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,r]of Object.entries(t||{}))this.set(e,r)}wrapFunction(t){return(...e)=>t.call(this.$,...e)}wrapObject(t,e){return null==t||(r=t)instanceof E||r.__is_proxy__||t.constructor!==Object&&!Array.isArray(t)?t:new Proxy(t,{deleteProperty:(t,r)=>r in t&&(delete t[r],e(),!0),set:(r,n,o,i)=>{"object"==typeof o&&null!=t&&(o=this.wrapObject(o,e));const s=Reflect.set(r,n,o,i);return e(),s},get:(t,e,r)=>"__is_proxy__"===e||Reflect.get(t,e,r)});var r}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 r=Array.from(this.observers.get(t)||[]);await this.debounce(e,(()=>Promise.all(r.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 r=()=>this.notify(t);e&&"function"==typeof e&&(e=this.wrapFunction(e)),e&&"object"==typeof e&&(e=this.wrapObject(e,r)),this.store.set(t,e),await r()}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)),r=Object.fromEntries(e.map((t=>[t,void 0])));return new Proxy(r,{get:(e,r,n)=>"string"==typeof r&&this.store.has(r)?this.get(r,t):"$"===r?this.proxify(t):Reflect.get(this,r,n),set:(t,e,r,n)=>("string"!=typeof e||e in this?Reflect.set(this,e,r,n):this.set(e,r),!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 r=this._observer?this:this.$;if(this.store.has(t))return r[t];{const n=this.cachedExpressionFunction(t),o=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 n.call(r,...o)}}}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 r=t;if("include"!==r.tagName?.toLocaleLowerCase())return;this.log("<include> tag found in:\n",S(t,128)),this.log("<include> params:",e);const n=b(r,"src");if(!n)throw new Error(`"src" attribute missing from ${t}.`);const o=e=>{const n=e.firstChild;for(const t of Array.from(r.attributes))n&&"src"!==t.name&&y(r,n,t.name);v(t,...e.childNodes)},i={...e,rootDocument:!1,maxdepth:e?.maxdepth-1};if(0===i.maxdepth)throw new Error("Maximum recursion depth reached.");if(n.includes("://")||n.startsWith("//"))this.log("Including remote file from absolute path:",n),await this.preprocessRemote(n,i).then(o);else if(e?.dirpath?.includes("://")||e?.dirpath?.startsWith("//")){const t=n.startsWith("/")?n:`${e.dirpath}/${n}`;this.log("Including remote file from relative path:",t),await this.preprocessRemote(t,i).then(o)}else if("/"===n.charAt(0))this.log("Including local file from absolute path:",n),await this.preprocessLocal(n,i).then(o);else{const t=e?.dirpath&&"."!==e?.dirpath?`${e?.dirpath}/${n}`:n;this.log("Including local file from relative path:",t),await this.preprocessLocal(t,i).then(o)}},e.rebaseRelativePaths=async function(t,e){const r=t,n=r.tagName?.toLowerCase();if(!e?.dirpath)return;const o=b(r,"src"),i=b(r,"href"),s=b(r,"data"),a=o||i||s;a&&(a&&P(a)&&this.log("Rebasing relative path as:",e.dirpath,"/",a),"img"===n&&o&&P(o)?g(r,"src",`${e.dirpath}/${o}`):"a"===n&&i&&P(i)||"link"===n&&i&&P(i)?g(r,"href",`${e.dirpath}/${i}`):"script"===n&&o&&P(o)||"source"===n&&o&&P(o)||"audio"===n&&o&&P(o)||"video"===n&&o&&P(o)||"track"===n&&o&&P(o)||"iframe"===n&&o&&P(o)?g(r,"src",`${e.dirpath}/${o}`):"object"===n&&s&&P(s)?g(r,"data",`${e.dirpath}/${s}`):"input"===n&&o&&P(o)?g(r,"src",`${e.dirpath}/${o}`):("area"===n&&i&&P(i)||"base"===n&&i&&P(i))&&g(r,"href",`${e.dirpath}/${i}`))},e.registerCustomElements=async function(t,e){const r=t;if("template"===r.tagName?.toLowerCase()&&b(r,"is")){const t=b(r,"is")?.toLowerCase();this._customElements.has(t)||(this.log(`Registering custom element: ${t}\n`,S(r,128)),this._customElements.set(t,r.cloneNode(!0)),N(r.parentNode,r))}},e.resolveCustomElements=async function(e,r){const n=e,o=n.tagName?.toLowerCase();if(this._customElements.has(o)){this.log(`Processing custom element: ${o}\n`,S(n,128));const r=this._customElements.get(o),i=(r.content||r).cloneNode(!0),s=function(t){return t instanceof h?t.children.find((t=>t instanceof h)):t.firstElementChild}(i);for(const t of Array.from(n.attributes))s&&y(n,s,t.name);const a=new t(m(i)).find((t=>"slot"===t.tagName?.toLowerCase()));a&&v(a,...n.childNodes),v(e,...i.childNodes)}},e.resolveTextNodeExpressions=async function(t,e){const r=j(t)||"";if(3!==t.nodeType||!r?.trim())return;this.log("Processing node content value:\n",k(r,128));const n=new RegExp(/{{ ([^}]+) }}/gm),i=Array.from(r.matchAll(n)).map((t=>t[1]));return this.effect((function(){let e=r;for(const r of i){const n=this.eval(r,{$elem:t});e=e.replace(`{{ ${r} }}`,String(n))}!function(t,e){t instanceof o?t.data=e:t.nodeValue=e}(t,e)}))},e.resolveDataAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=b(r,":data");if(n){this.log(":data attribute found in:\n",S(t,128)),x(r,":data");const o=e?.rootNode===t?this:this.clone();t.renderer=o;const i=function(t,e=[]){return new Function(...e,`with (this) { return (async () => (${t}))(); }`)}(n,this.evalkeys),s=await i.call(o.$,{$elem:t});if(await Promise.all(Object.entries(s).map((([t,e])=>o.set(t,e)))),o!==this)for(const e of m(t,this._skipNodes))this._skipNodes.add(e);await o.mount(t,e)}},e.resolveWatchAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=b(r,"@watch");n&&(this.log("@watch attribute found in:\n",S(t,128)),x(r,"@watch"),await this.effect((function(){return this.eval(n,{$elem:t})})))},e.resolveTextAttributes=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=b(r,"$text");return n?(this.log("$text attribute found in:\n",S(t,128)),x(r,"$text"),this.effect((function(){!function(t,e){t instanceof h?t.children=[new s(e)]:t.textContent=e}(t,this.eval(n,{$elem:t}))}))):void 0},e.resolveHtmlAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=b(r,"$html");return n?(this.log("$html attribute found in:\n",S(t,128)),x(r,"$html"),this.effect((function(){const o=this.eval(n,{$elem:t});return new Promise((async t=>{const n=await this.preprocessString(o,e);await this.renderNode(n),function(t,...e){$(t,"replaceChildren")?t.replaceChildren(...e):(t.childNodes=e,e.forEach((e=>e.parentNode=t)))}(r,n),t()}))}))):void 0},e.resolvePropAttributes=async function(t,e){if(this._skipNodes.has(t))return;const r=t;for(const e of Array.from(r.attributes||[]))if(e.name.startsWith("$")&&!_.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(r,e.name);const n=e.name.slice(1).replace(/-./g,(t=>t[1].toUpperCase()));await this.effect((function(){t[n]=this.eval(e.value,{$elem:t})}))}},e.resolveAttrAttributes=async function(t,e){if(this._skipNodes.has(t))return;const r=t;for(const e of Array.from(r.attributes||[]))if(e.name.startsWith(":")&&!_.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(r,e.name);const n=e.name.slice(1);this.effect((function(){g(r,n,this.eval(e.value,{$elem:t}))}))}},e.resolveEventAttributes=async function(t,e){if(this._skipNodes.has(t))return;const r=t;for(const e of Array.from(r.attributes||[]))e.name.startsWith("@")&&!_.has(e.name)&&(this.log(e.name,"attribute found in:\n",S(t,128)),x(r,e.name),t.addEventListener?.(e.name.substring(1),(r=>this.eval(e.value,{$elem:t,$event:r}))))},e.resolveForAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=b(r,":for")?.trim();if(n){this.log(":for attribute found in:\n",S(t,128)),x(r,":for");for(const e of m(t,this._skipNodes))this._skipNodes.add(e);const o=t.parentNode,i=function(t,e){return e?e.createElement(t):new h(t,{})}("template",t.ownerDocument);A(o,i,t),N(o,t),w(i,t),this.log(":for template:\n",S(i,128));const s=n.split(" in ",2);if(2!==s.length)throw new Error(`Invalid :for format: \`${n}\`. Expected "{key} in {expression}".`);const a=[],[c,l]=s;await this.effect((function(){const r=this.eval(l,{$elem:t});if(this.log(":for list items:",r),a.splice(0,a.length).forEach((t=>{N(o,t),this._skipNodes.delete(t)})),!Array.isArray(r))return console.error(`Expression did not yield a list: \`${l}\` => \`${r}\``),Promise.resolve();const n=[];for(const o of r){const r=this.clone();r.set(c,o);const i=t.cloneNode(!0);a.push(i),this._skipNodes.add(i),n.push(r.mount(i,e)),this.log("Rendered list child:\n",S(i,128))}const s=i.nextSibling;for(const t of a)A(o,t,s);return Promise.all(n)}))}},e.resolveBindAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=b(r,":bind");if(n){this.log(":bind attribute found in:\n",S(t,128));const e=["change","input"],o=b(r,":bind-events")?.split(",")||e;x(r,":bind"),x(r,":bind-events");const i="checkbox"===b(r,"type")?"checked":"value",s=`$elem.${i} = ${n}`;this.effect((function(){const e=this.eval(s,{$elem:t});r[i]=e}));const a=`${n} = $elem.${i}`;for(const e of o)t.addEventListener(e,(()=>this.eval(a,{$elem:t})))}},e.resolveShowAttribute=async function(t,e){if(this._skipNodes.has(t))return;const r=t,n=b(r,":show");if(n){this.log(":show attribute found in:\n",S(t,128)),x(r,":show");const e="none"===r.style?.display?"":r.style?.display??b(r,"style")?.split(";")?.find((t=>"display"===t.split(":")[0]))?.split(":")?.at(1)?.trim();this.effect((function(){const o=this.eval(n,{$elem:t});r.style?r.style.display=o?e:"none":g(r,"style",`display: ${o?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 r=this.parseHTML(t,e);return await this.preprocessNode(r,e),r}async preprocessRemote(t,e){const r={};e?.cache&&(r.cache=e.cache);const n=await fetch(t,r).then((t=>t.text()));return this.preprocessString(n,{...e,dirpath:M(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}async preprocessLocal(t,e){const r=await this.fetchLocal(t,e);return this.preprocessString(r,{...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,r){r={dirpath:this.dirpath,maxdepth:10,...r};const n=new t(m(e,this._skipNodes)).map((async t=>{this.log("Preprocessing node:\n",S(t,128)),await T.resolveIncludes.call(this,t,r),await T.rebaseRelativePaths.call(this,t,r),await T.registerCustomElements.call(this,t,r),await T.resolveCustomElements.call(this,t,r)}));return await Promise.all(n.generator()),e}async renderNode(t,e){for(const r of m(t,this._skipNodes))this.log("Rendering node:\n",S(r,128)),await T.resolveDataAttribute.call(this,r,e),await T.resolveForAttribute.call(this,r,e),await T.resolveTextAttributes.call(this,r,e),await T.resolveHtmlAttribute.call(this,r,e),await T.resolveShowAttribute.call(this,r,e),await T.resolveWatchAttribute.call(this,r,e),await T.resolveBindAttribute.call(this,r,e),await T.resolvePropAttributes.call(this,r,e),await T.resolveAttrAttributes.call(this,r,e),await T.resolveEventAttributes.call(this,r,e),await T.resolveTextNodeExpressions.call(this,r,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=r(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"},"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:["color","background-color","border-color","text-decoration-color","fill","stroke","opacity","box-shadow","transform","filter","backdrop-filter"].map((t=>`${t} 150ms`)).join(", ")},"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((([r,n])=>`@media (min-width: ${n}px) { .${r}\\:${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((r=>[`${e}-${r}`,`${t}: ${r*R}rem`])),...I.map((r=>[`-${e}-${r}`,`${t}: -${r*R}rem`])),...I.map((r=>[`${e}-${r}px`,`${t}: ${r}px`])),...I.map((r=>[`-${e}-${r}px`,`${t}: -${r}px`])),...W.map((r=>[`${e}-${r}\\%`,`${t}: ${r}%`])),...W.map((r=>[`-${e}-${r}\\%`,` ${t}: -${r}%`]))])).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; }`,...I.map((t=>[t,t*R])).map((([r,n])=>`.${e}x-${r} { ${t}-left: ${n}rem; ${t}-right: ${n}rem; }`)),...I.map((t=>[t,t*R])).map((([r,n])=>`.${e}y-${r} { ${t}-top: ${n}rem; ${t}-bottom: ${n}rem; }`)),...I.map((r=>`.${e}x-${r}px { ${t}-left: ${r}px; ${t}-right: ${r}px; }`)),...I.map((r=>`.${e}y-${r}px { ${t}-top: ${r}px; ${t}-bottom: ${r}px; }`)),...W.map((r=>`.${e}x-${r}\\% { ${t}-left: ${r}%; ${t}-right: ${r}%; }`)),...W.map((r=>`.${e}y-${r}\\% { ${t}-top: ${r}%; ${t}-bottom: ${r}%; }`))]))}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)}`]])),r=Object.entries(X).flatMap((([t,e])=>Object.entries(e).flatMap((([e,r])=>[[`text-${t}-${e}`,`color: #${r.toString(16)}`],[`fill-${t}-${e}`,`fill: #${r.toString(16)}`],[`bg-${t}-${e}`,`background-color: #${r.toString(16)}`],[`border-${t}-${e}`,`border-color: #${r.toString(16)}`]]))));return[].concat(t).concat(e).concat(r).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 rt=self.document?.currentScript;if(self.document?.currentScript?.hasAttribute("init")){const t=rt?.hasAttribute("debug"),e=rt?.getAttribute("cache"),r=rt?.getAttribute("target")?.split("+")||["body"];window.addEventListener("load",(()=>{r.map((async r=>{const n=self.document.querySelector(r);await et.debug(t).mount(n,{cache:e})}))}))}if(self.document?.currentScript?.hasAttribute("css")){const t=rt?.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,r])=>[`.${t} { ${e}: ${r} }`,`${J(t).join(",")} { ${e}: ${r} }`,...K(t,`${e}: ${r}`)])))),...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),...(nt=H,Object.entries(nt).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((r=>[...I.map((t=>[t,t*R])).map((([n,o])=>[`${r}${e}t-${n}`,`${t}-top: ${r}${o}rem`])),...I.map((t=>[t,t*R])).map((([n,o])=>[`${r}${e}b-${n}`,`${t}-bottom: ${r}${o}rem`])),...I.map((t=>[t,t*R])).map((([n,o])=>[`${r}${e}l-${n}`,`${t}-left: ${r}${o}rem`])),...I.map((t=>[t,t*R])).map((([n,o])=>[`${r}${e}r-${n}`,`${t}-right: ${r}${o}rem`])),...I.map((n=>[`${r}${e}t-${n}px`,`${t}-top: ${r}${n}px`])),...I.map((n=>[`${r}${e}b-${n}px`,`${t}-bottom: ${r}${n}px`])),...I.map((n=>[`${r}${e}l-${n}px`,`${t}-left: ${r}${n}px`])),...I.map((n=>[`${r}${e}r-${n}px`,`${t}-right: ${r}${n}px`])),...W.map((n=>[`${r}${e}t-${n}\\%`,`${t}-top: ${r}${n}%`])),...W.map((n=>[`${r}${e}b-${n}\\%`,`${t}-bottom: ${r}${n}%;`])),...W.map((n=>[`${r}${e}l-${n}\\%`,`${t}-left: ${r}${n}%`])),...W.map((n=>[`${r}${e}r-${n}\\%`,`${t}-right: ${r}${n}%`]))]))])).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 nt})()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mancha",
3
- "version": "0.8.49",
3
+ "version": "0.8.50",
4
4
  "description": "Javscript HTML rendering engine",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",