apprun 3.33.9 → 3.35.0
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/.clinerules +1 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/WHATSNEW.md +106 -0
- package/apprun.d.ts +7 -1
- package/dist/apprun-dev-tools.js +1 -1
- package/dist/apprun-dev-tools.js.map +1 -1
- package/dist/apprun-html.esm.js +21 -4
- package/dist/apprun-html.esm.js.map +1 -1
- package/dist/apprun-html.js +1 -1
- package/dist/apprun-html.js.LICENSE.txt +6 -0
- package/dist/apprun-html.js.map +1 -1
- package/dist/apprun-play-html.esm.js +21 -4
- package/dist/apprun-play-html.esm.js.map +1 -1
- package/dist/apprun-play.js +1 -1
- package/dist/apprun-play.js.map +1 -1
- package/dist/apprun.esm.js +1 -1
- package/dist/apprun.esm.js.map +1 -1
- package/dist/apprun.js +1 -1
- package/dist/apprun.js.map +1 -1
- package/esm/app.js +38 -10
- package/esm/app.js.map +1 -1
- package/esm/apprun-code.js.map +1 -1
- package/esm/apprun-dev-tools-tests.js.map +1 -1
- package/esm/apprun-dev-tools.js.map +1 -1
- package/esm/apprun-html.js.map +1 -1
- package/esm/apprun-play.js.map +1 -1
- package/esm/apprun.js +65 -9
- package/esm/apprun.js.map +1 -1
- package/esm/component.js +59 -1
- package/esm/component.js.map +1 -1
- package/esm/decorator.js +33 -0
- package/esm/decorator.js.map +1 -1
- package/esm/directive.js +31 -0
- package/esm/directive.js.map +1 -1
- package/esm/router.js +27 -0
- package/esm/router.js.map +1 -1
- package/esm/types.js +28 -0
- package/esm/types.js.map +1 -1
- package/esm/vdom-lit-html.js +19 -17
- package/esm/vdom-lit-html.js.map +1 -1
- package/esm/vdom-my.js.map +1 -1
- package/esm/vdom-patch.js.map +1 -1
- package/esm/vdom-to-html.js.map +1 -1
- package/esm/vdom.js +24 -0
- package/esm/vdom.js.map +1 -1
- package/esm/web-component.js +32 -0
- package/esm/web-component.js.map +1 -1
- package/index.html +3 -2
- package/jest.config.js +63 -0
- package/jest.setup.js +47 -0
- package/jsx-runtime.js +1 -1
- package/jsx-runtime.js.map +1 -1
- package/package.json +16 -43
- package/react.js +0 -15
- package/rollup.config.js +27 -10
- package/src/app.ts +64 -30
- package/src/apprun.ts +94 -13
- package/src/component.ts +57 -1
- package/src/decorator.ts +34 -1
- package/src/directive.ts +33 -1
- package/src/global.d.ts +22 -0
- package/src/router.ts +28 -2
- package/src/types/apprun.d.ts +56 -0
- package/src/types.ts +30 -1
- package/src/vdom-lit-html.ts +21 -19
- package/src/vdom.ts +25 -2
- package/src/web-component.ts +33 -0
- package/tsconfig.jest.json +27 -3
- package/tsconfig.json +3 -3
- package/webpack.config.cjs +9 -2
package/dist/apprun-html.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see apprun-html.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apprun=e():t.apprun=e()}(this,(()=>(()=>{"use strict";var t={859:(t,e,n)=>{n.d(e,{A:()=>r,q:()=>s});class s{constructor(){this._events={}}on(t,e,n={}){this._events[t]=this._events[t]||[],this._events[t].push({fn:e,options:n})}off(t,e){const n=this._events[t]||[];this._events[t]=n.filter((t=>t.fn!==e))}find(t){return this._events[t]}run(t,...e){const n=this.getSubscribers(t,this._events);return console.assert(n&&n.length>0,"No subscriber for event: "+t),n.forEach((n=>{const{fn:s,options:i}=n;return i.delay?this.delay(t,s,e,i):Object.keys(i).length>0?s.apply(this,[...e,i]):s.apply(this,e),!n.options.once})),n.length}once(t,e,n={}){this.on(t,e,Object.assign(Object.assign({},n),{once:!0}))}delay(t,e,n,s){s._t&&clearTimeout(s._t),s._t=setTimeout((()=>{clearTimeout(s._t),Object.keys(s).length>0?e.apply(this,[...n,s]):e.apply(this,n)}),s.delay)}runAsync(t,...e){const n=this.getSubscribers(t,this._events);console.assert(n&&n.length>0,"No subscriber for event: "+t);const s=n.map((t=>{const{fn:n,options:s}=t;return Object.keys(s).length>0?n.apply(this,[...e,s]):n.apply(this,e)}));return Promise.all(s)}query(t,...e){return this.runAsync(t,...e)}getSubscribers(t,e){const n=e[t]||[];return e[t]=n.filter((t=>!t.options.once)),Object.keys(e).filter((e=>e.endsWith("*")&&t.startsWith(e.replace("*","")))).sort(((t,e)=>e.length-t.length)).forEach((s=>n.push(...e[s].map((e=>Object.assign(Object.assign({},e),{options:Object.assign(Object.assign({},e.options),{event:t})})))))),n}}let i;const o="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g;o.app&&o._AppRunVersions?i=o.app:(i=new s,o.app=i,o._AppRunVersions="AppRun-3");const r=i},466:(t,e,n)=>{n.d(e,{Component:()=>f,ROUTER_404_EVENT:()=>m,ROUTER_EVENT:()=>_,app:()=>s.A,customElement:()=>c,default:()=>A,event:()=>l,on:()=>h,safeHTML:()=>i.safeHTML,update:()=>l});var s=n(859),i=n(320);const o=(t,e={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(e.observedAttributes||[]).map((t=>t.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const n=e||{};this._shadowRoot=n.shadow?this.attachShadow({mode:"open"}):this;const s=n.observedAttributes||[],i=s.reduce(((t,e)=>{const n=e.toLowerCase();return n!==e&&(t[n]=e),t}),{});this._attrMap=t=>i[t]||t;const o={};Array.from(this.attributes).forEach((t=>o[this._attrMap(t.name)]=t.value)),s.forEach((t=>{void 0!==this[t]&&(o[t]=this[t]),Object.defineProperty(this,t,{get:()=>o[t],set(e){this.attributeChangedCallback(t,o[t],e)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const e=this.children?Array.from(this.children):[];if(this._component=new t(Object.assign(Object.assign({},o),{children:e})).mount(this._shadowRoot,n),this._component._props=o,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const t=this._component.mounted(o,e,this._component.state);void 0!==t&&(this._component.state=t)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component),!1!==n.render&&this._component.run(".")}))}}disconnectedCallback(){var t,e,n,s;null===(e=null===(t=this._component)||void 0===t?void 0:t.unload)||void 0===e||e.call(t),null===(s=null===(n=this._component)||void 0===n?void 0:n.unmount)||void 0===s||s.call(n),this._component=null}attributeChangedCallback(t,n,s){if(this._component){const i=this._attrMap(t);this._component._props[i]=s,this._component.run("attributeChanged",i,n,s),s!==n&&!1!==e.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}},r=(t,e,n)=>{"undefined"!=typeof customElements&&customElements.define(t,o(e,n))},a={meta:new WeakMap,defineMetadata(t,e,n){this.meta.has(n)||this.meta.set(n,{}),this.meta.get(n)[t]=e},getMetadataKeys(t){return t=Object.getPrototypeOf(t),this.meta.get(t)?Object.keys(this.meta.get(t)):[]},getMetadata(t,e){return e=Object.getPrototypeOf(e),this.meta.get(e)?this.meta.get(e)[t]:null}};function l(t,e={}){return(n,s,i)=>{const o=t?t.toString():s;return a.defineMetadata(`apprun-update:${o}`,{name:o,key:s,options:e},n),i}}function h(t,e={}){return function(n,s){const i=t?t.toString():s;a.defineMetadata(`apprun-update:${i}`,{name:i,key:s,options:e},n)}}function c(t,e){return function(n){return r(t,n,e),n}}var u=n(741);const d=new Map;s.A.find("get-components")||s.A.on("get-components",(t=>t.components=d));const p=t=>t;class f{renderState(t,e=null){if(!this.view)return;let n=e||this.view(t);if(s.A.debug&&s.A.run("debug",{component:this,_:n?".":"-",state:t,vdom:n,el:this.element}),"object"!=typeof document)return;const i="string"==typeof this.element&&this.element?document.getElementById(this.element)||document.querySelector(this.element):this.element;if(!i)return;const o="_c";this.unload?i._component===this&&i.getAttribute(o)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),i.setAttribute(o,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((t=>{t[0].oldValue!==this.tracking_id&&document.body.contains(i)||(this.unload(this.state),this.observer.disconnect(),this.observer=null)}))),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[o]}))):i.removeAttribute&&i.removeAttribute(o),i._component=this,!e&&n&&(n=(0,u.A)(n,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>s.A.render(i,n,this))):s.A.render(i,n,this)),this.rendered&&this.rendered(this.state)}setState(t,e={render:!0,history:!1}){if(t instanceof Promise)Promise.resolve(t).then((n=>{this.setState(n,e),this._state=t}));else{if(this._state=t,null==t)return;this.state=t,!1!==e.render&&(e.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(t))):this.renderState(t)),!1!==e.history&&this.enable_history&&(this._history=[...this._history,t],this._history_idx=this._history.length-1),"function"==typeof e.callback&&e.callback(this.state)}}constructor(t,e,n,i){this.state=t,this.view=e,this.update=n,this.options=i,this._app=new s.q,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this._history_prev=()=>{this._history_idx--,this._history_idx>=0?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=0},this._history_next=()=>{this._history_idx++,this._history_idx<this._history.length?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=this._history.length-1},this.start=(t=null,e)=>{if(this.mount(t,Object.assign({render:!0},e)),this.mounted&&"function"==typeof this.mounted){const t=this.mounted({},[],this.state);void 0!==t&&this.setState(t)}return this}}mount(t=null,e){var n,i;return console.assert(!this.element,"Component already mounted."),this.options=e=Object.assign(Object.assign({},this.options),e),this.element=t,this.global_event=e.global_event,this.enable_history=!!e.history,this.enable_history&&(this.on(e.history.prev||"history-prev",this._history_prev),this.on(e.history.next||"history-next",this._history_next)),e.route&&(this.update=this.update||{},this.update[e.route]||(this.update[e.route]=p)),this.add_actions(),this.state=null!==(i=null!==(n=this.state)&&void 0!==n?n:this.model)&&void 0!==i?i:{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!e.render,history:!0}),s.A.debug&&(d.get(t)?d.get(t).push(this):d.set(t,[this])),this}is_global_event(t){return t&&(this.global_event||this._global_events.indexOf(t)>=0||t.startsWith("#")||t.startsWith("/")||t.startsWith("@"))}add_action(t,e,n={}){e&&"function"==typeof e&&(n.global&&this._global_events.push(t),this.on(t,((...i)=>{s.A.debug&&s.A.run("debug",{component:this,_:">",event:t,p:i,current_state:this.state,options:n});const o=e(this.state,...i);s.A.debug&&s.A.run("debug",{component:this,_:"<",event:t,p:i,newState:o,state:this.state,options:n}),this.setState(o,n)}),n))}add_actions(){const t=this.update||{};a.getMetadataKeys(this).forEach((e=>{if(e.startsWith("apprun-update:")){const n=a.getMetadata(e,this);t[n.name]=[this[n.key].bind(this),n.options]}}));const e={};Array.isArray(t)?t.forEach((t=>{const[n,s,i]=t;n.toString().split(",").forEach((t=>e[t.trim()]=[s,i]))})):Object.keys(t).forEach((n=>{const s=t[n];("function"==typeof s||Array.isArray(s))&&n.split(",").forEach((t=>e[t.trim()]=s))})),e["."]||(e["."]=p),Object.keys(e).forEach((t=>{const n=e[t];"function"==typeof n?this.add_action(t,n):Array.isArray(n)&&this.add_action(t,n[0],n[1])}))}run(t,...e){if(this.state instanceof Promise)return Promise.resolve(this.state).then((n=>{this.state=n,this.run(t,...e)}));{const n=t.toString();return this.is_global_event(n)?s.A.run(n,...e):this._app.run(n,...e)}}on(t,e,n){const i=t.toString();return this._actions.push({name:i,fn:e}),this.is_global_event(i)?s.A.on(i,e,n):this._app.on(i,e,n)}runAsync(t,...e){const n=t.toString();return this.is_global_event(n)?s.A.runAsync(n,...e):this._app.runAsync(n,...e)}query(t,...e){return this.runAsync(t,...e)}unmount(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this._actions.forEach((t=>{const{name:e,fn:n}=t;this.is_global_event(e)?s.A.off(e,n):this._app.off(e,n)}))}}f.__isAppRunComponent=!0;const _="//",m="///",g=t=>{if(t||(t="#"),t.startsWith("#")){const[e,...n]=t.split("/");s.A.run(e,...n)||s.A.run(m,e,...n),s.A.run(_,e,...n)}else if(t.startsWith("/")){const[e,n,...i]=t.split("/");s.A.run("/"+n,...i)||s.A.run(m,"/"+n,...i),s.A.run(_,"/"+n,...i)}else s.A.run(t)||s.A.run(m,t),s.A.run(_,t)},A=s.A;if(!s.A.start){s.A.h=s.A.createElement=i.createElement,s.A.render=i.render,s.A.Fragment=i.Fragment,s.A.webComponent=r,s.A.safeHTML=i.safeHTML,s.A.start=(t,e,n,s,i)=>{const o=Object.assign({render:!0,global_event:!0},i),r=new f(e,n,s);return i&&i.rendered&&(r.rendered=i.rendered),i&&i.mounted&&(r.mounted=i.mounted),r.start(t,o),r};const t=t=>{};s.A.on("$",t),s.A.on("debug",(e=>t)),s.A.on(_,t),s.A.on("#",t),s.A.route=g,s.A.on("route",(t=>s.A.route&&s.A.route(t))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{s.A.route===g&&(window.onpopstate=()=>g(location.hash),document.body.hasAttribute("apprun-no-init")||s.A["no-init-route"]||g(location.hash))})),"object"==typeof window&&(window.Component=f,window._React=window.React,window.React=s.A,window.on=h,window.customElement=c,window.safeHTML=i.safeHTML),s.A.use_render=(t,e=0)=>s.A.render=0===e?(e,n)=>t(n,e):(e,n)=>t(e,n),s.A.use_react=(t,e)=>{s.A.h=s.A.createElement=t.createElement,s.A.Fragment=t.Fragment,s.A.render=(t,n)=>e.render(n,t),t.version&&t.version.startsWith("18")&&(s.A.render=(t,n)=>{t&&n&&(t._root||(t._root=e.createRoot(t)),t._root.render(n))})}}},741:(t,e,n)=>{n.d(e,{A:()=>a});var s=n(859);const i=(t,e)=>(e?t.state[e]:t.state)||"",o=(t,e,n)=>{if(e){const s=t.state||{};s[e]=n,t.setState(s)}else t.setState(n)},r=(t,e)=>{if(Array.isArray(t))return t.map((t=>r(t,e)));{let{type:n,tag:a,props:l,children:h}=t;return a=a||n,h=h||(null==l?void 0:l.children),l&&Object.keys(l).forEach((t=>{t.startsWith("$")&&(((t,e,n,r)=>{if(t.startsWith("$on")){const n=e[t];if(t=t.substring(1),"boolean"==typeof n)e[t]=e=>r.run?r.run(t,e):s.A.run(t,e);else if("string"==typeof n)e[t]=t=>r.run?r.run(n,t):s.A.run(n,t);else if("function"==typeof n)e[t]=t=>r.setState(n(r.state,t));else if(Array.isArray(n)){const[i,...o]=n;"string"==typeof i?e[t]=t=>r.run?r.run(i,...o,t):s.A.run(i,...o,t):"function"==typeof i&&(e[t]=t=>r.setState(i(r.state,...o,t)))}}else if("$bind"===t){const s=e.type||"text",a="string"==typeof e[t]?e[t]:e.name;if("input"===n)switch(s){case"checkbox":e.checked=i(r,a),e.onclick=t=>o(r,a||t.target.name,t.target.checked);break;case"radio":e.checked=i(r,a)===e.value,e.onclick=t=>o(r,a||t.target.name,t.target.value);break;case"number":case"range":e.value=i(r,a),e.oninput=t=>o(r,a||t.target.name,Number(t.target.value));break;default:e.value=i(r,a),e.oninput=t=>o(r,a||t.target.name,t.target.value)}else"select"===n?(e.value=i(r,a),e.onchange=t=>{t.target.multiple||o(r,a||t.target.name,t.target.value)}):"option"===n?(e.selected=i(r,a),e.onclick=t=>o(r,a||t.target.name,t.target.selected)):"textarea"===n&&(e.innerHTML=i(r,a),e.oninput=t=>o(r,a||t.target.name,t.target.value))}else s.A.run("$",{key:t,tag:n,props:e,component:r})})(t,l,a,e),delete l[t])})),h&&r(h,e),t}},a=r},791:(t,e,n)=>{n.d(e,{FK:()=>i,cJ:()=>h,n:()=>a,t_:()=>d});var s=n(741);function i(t,...e){return r(e)}const o="_props";function r(t){const e=[],n=t=>{null!=t&&""!==t&&!1!==t&&e.push("function"==typeof t||"object"==typeof t?t:`${t}`)};return t&&t.forEach((t=>{Array.isArray(t)?t.forEach((t=>n(t))):n(t)})),e}function a(t,e,...n){const s=r(n);if("string"==typeof t)return{tag:t,props:e,children:s};if(Array.isArray(t))return t;if(void 0===t&&n)return s;if(Object.getPrototypeOf(t).__isAppRunComponent)return{tag:t,props:e,children:s};if("function"==typeof t)return t(e,s);throw new Error(`Unknown tag in vdom ${t}`)}const l=new WeakMap,h=(t,e,n={})=>{null!=e&&!1!==e&&function(t,e,n={}){if(null==e||!1===e)return;if(e=m(e,n),!t)return;const s="SVG"===t.nodeName;Array.isArray(e)?u(t,e,s):u(t,[e],s)}("string"==typeof t&&t?document.getElementById(t)||document.querySelector(t):t,e=(0,s.A)(e,n),n)};function c(t,e,n){3!==e._op&&(n=n||"svg"===e.tag,function(t,e){const n=t.nodeName,s=`${e.tag||""}`;return n.toUpperCase()===s.toUpperCase()}(t,e)?(!(2&e._op)&&u(t,e.children,n),!(1&e._op)&&_(t,e.props,n)):t.parentNode.replaceChild(f(e,n),t))}function u(t,e,n){var s,i;const o=(null===(s=t.childNodes)||void 0===s?void 0:s.length)||0,r=(null==e?void 0:e.length)||0,a=Math.min(o,r);for(let s=0;s<a;s++){const i=e[s];if(3===i._op)continue;const o=t.childNodes[s];if("string"==typeof i)o.textContent!==i&&(3===o.nodeType?o.nodeValue=i:t.replaceChild(p(i),o));else if(i instanceof HTMLElement||i instanceof SVGElement)t.insertBefore(i,o);else{const e=i.props&&i.props.key;if(e)if(o.key===e)c(t.childNodes[s],i,n);else{const r=l[e];if(r){const e=r.nextSibling;t.insertBefore(r,o),e?t.insertBefore(o,e):t.appendChild(o),c(t.childNodes[s],i,n)}else t.replaceChild(f(i,n),o)}else c(t.childNodes[s],i,n)}}let h=(null===(i=t.childNodes)||void 0===i?void 0:i.length)||0;for(;h>a;)t.removeChild(t.lastChild),h--;if(r>a){const s=document.createDocumentFragment();for(let t=a;t<e.length;t++)s.appendChild(f(e[t],n));t.appendChild(s)}}const d=t=>{const e=document.createElement("section");return e.insertAdjacentHTML("afterbegin",t),Array.from(e.children)};function p(t){if(0===(null==t?void 0:t.indexOf("_html:"))){const e=document.createElement("div");return e.insertAdjacentHTML("afterbegin",t.substring(6)),e}return document.createTextNode(null!=t?t:"")}function f(t,e){if(t instanceof HTMLElement||t instanceof SVGElement)return t;if("string"==typeof t)return p(t);if(!t.tag||"function"==typeof t.tag)return p(JSON.stringify(t));const n=(e=e||"svg"===t.tag)?document.createElementNS("http://www.w3.org/2000/svg",t.tag):document.createElement(t.tag);return _(n,t.props,e),t.children&&t.children.forEach((t=>n.appendChild(f(t,e)))),n}function _(t,e,n){const s=t[o]||{};e=function(t,e){e.class=e.class||e.className,delete e.className;const n={};return t&&Object.keys(t).forEach((t=>n[t]=null)),e&&Object.keys(e).forEach((t=>n[t]=e[t])),n}(s,e||{}),t[o]=e;for(const s in e){const i=e[s];if(s.startsWith("data-")){const e=s.substring(5).replace(/-(\w)/g,(t=>t[1].toUpperCase()));t.dataset[e]!==i&&(i||""===i?t.dataset[e]=i:delete t.dataset[e])}else if("style"===s)if(t.style.cssText&&(t.style.cssText=""),"string"==typeof i)t.style.cssText=i;else for(const e in i)t.style[e]!==i[e]&&(t.style[e]=i[e]);else if(s.startsWith("xlink")){const e=s.replace("xlink","").toLowerCase();null==i||!1===i?t.removeAttributeNS("http://www.w3.org/1999/xlink",e):t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}else s.startsWith("on")?i&&"function"!=typeof i?"string"==typeof i&&(i?t.setAttribute(s,i):t.removeAttribute(s)):t[s]=i:/^id$|^class$|^list$|^readonly$|^contenteditable$|^role|-|^for$/g.test(s)||n?t.getAttribute(s)!==i&&(i?t.setAttribute(s,i):t.removeAttribute(s)):t[s]!==i&&(t[s]=i);"key"===s&&i&&(l[i]=t)}e&&"function"==typeof e.ref&&window.requestAnimationFrame((()=>e.ref(t)))}function m(t,e,n=0){var s;if("string"==typeof t)return t;if(Array.isArray(t))return t.map((t=>m(t,e,n++)));let i=t;if(t&&"function"==typeof t.tag&&Object.getPrototypeOf(t.tag).__isAppRunComponent&&(i=function(t,e,n){const{tag:s,props:i,children:o}=t;let r=`_${n}`,a=i&&i.id;a?r=a:a=`_${n}${Date.now()}`;let l="section";i&&i.as&&(l=i.as,delete i.as),e.__componentCache||(e.__componentCache={});let h=e.__componentCache[r];if(h&&h instanceof s&&h.element)h.renderState(h.state);else{const t=document.createElement(l);h=e.__componentCache[r]=new s(Object.assign(Object.assign({},i),{children:o})).mount(t,{render:!0})}if(h.mounted){const t=h.mounted(i,o,h.state);void 0!==t&&h.setState(t)}return _(h.element,i,!1),h.element}(t,e,n)),i&&Array.isArray(i.children)){const t=null===(s=i.props)||void 0===s?void 0:s._component;if(t){let e=0;i.children=i.children.map((n=>m(n,t,e++)))}else i.children=i.children.map((t=>m(t,e,n++)))}return i}},320:(t,e,n)=>{n.d(e,{Fragment:()=>s.FK,createElement:()=>s.n,render:()=>s.cJ,safeHTML:()=>s.t_});var s=n(791)},804:(t,e,n)=>{n.d(e,{OA:()=>s,WL:()=>o,u$:()=>i});const s={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},i=t=>(...e)=>({_$litDirective$:t,values:e});class o{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}},752:(t,e,n)=>{var s;n.d(e,{JW:()=>T,XX:()=>F,c0:()=>x,qy:()=>E,s6:()=>C});const i=window,o=i.trustedTypes,r=o?o.createPolicy("lit-html",{createHTML:t=>t}):void 0,a="$lit$",l=`lit$${(Math.random()+"").slice(9)}$`,h="?"+l,c=`<${h}>`,u=document,d=()=>u.createComment(""),p=t=>null===t||"object"!=typeof t&&"function"!=typeof t,f=Array.isArray,_="[ \t\n\f\r]",m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,g=/-->/g,A=/>/g,y=RegExp(`>|${_}(?:([^\\s"'>=/]+)(${_}*=${_}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),v=/'/g,b=/"/g,$=/^(?:script|style|textarea|title)$/i,w=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),E=w(1),T=w(2),x=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),O=new WeakMap,S=u.createTreeWalker(u,129,null,!1);function N(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==r?r.createHTML(e):e}const M=(t,e)=>{const n=t.length-1,s=[];let i,o=2===e?"<svg>":"",r=m;for(let e=0;e<n;e++){const n=t[e];let h,u,d=-1,p=0;for(;p<n.length&&(r.lastIndex=p,u=r.exec(n),null!==u);)p=r.lastIndex,r===m?"!--"===u[1]?r=g:void 0!==u[1]?r=A:void 0!==u[2]?($.test(u[2])&&(i=RegExp("</"+u[2],"g")),r=y):void 0!==u[3]&&(r=y):r===y?">"===u[0]?(r=null!=i?i:m,d=-1):void 0===u[1]?d=-2:(d=r.lastIndex-u[2].length,h=u[1],r=void 0===u[3]?y:'"'===u[3]?b:v):r===b||r===v?r=y:r===g||r===A?r=m:(r=y,i=void 0);const f=r===y&&t[e+1].startsWith("/>")?" ":"";o+=r===m?n+c:d>=0?(s.push(h),n.slice(0,d)+a+n.slice(d)+l+f):n+l+(-2===d?(s.push(void 0),e):f)}return[N(t,o+(t[n]||"<?>")+(2===e?"</svg>":"")),s]};class j{constructor({strings:t,_$litType$:e},n){let s;this.parts=[];let i=0,r=0;const c=t.length-1,u=this.parts,[p,f]=M(t,e);if(this.el=j.createElement(p,n),S.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=S.nextNode())&&u.length<c;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith(a)||e.startsWith(l)){const n=f[r++];if(t.push(e),void 0!==n){const t=s.getAttribute(n.toLowerCase()+a).split(l),e=/([.?@])?(.*)/.exec(n);u.push({type:1,index:i,name:e[2],strings:t,ctor:"."===e[1]?W:"?"===e[1]?V:"@"===e[1]?U:L})}else u.push({type:6,index:i})}for(const e of t)s.removeAttribute(e)}if($.test(s.tagName)){const t=s.textContent.split(l),e=t.length-1;if(e>0){s.textContent=o?o.emptyScript:"";for(let n=0;n<e;n++)s.append(t[n],d()),S.nextNode(),u.push({type:2,index:++i});s.append(t[e],d())}}}else if(8===s.nodeType)if(s.data===h)u.push({type:2,index:i});else{let t=-1;for(;-1!==(t=s.data.indexOf(l,t+1));)u.push({type:7,index:i}),t+=l.length-1}i++}}static createElement(t,e){const n=u.createElement("template");return n.innerHTML=t,n}}function H(t,e,n=t,s){var i,o,r,a;if(e===x)return e;let l=void 0!==s?null===(i=n._$Co)||void 0===i?void 0:i[s]:n._$Cl;const h=p(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(o=null==l?void 0:l._$AO)||void 0===o||o.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,n,s)),void 0!==s?(null!==(r=(a=n)._$Co)&&void 0!==r?r:a._$Co=[])[s]=l:n._$Cl=l),void 0!==l&&(e=H(t,l._$AS(t,e.values),l,s)),e}class k{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:n},parts:s}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:u).importNode(n,!0);S.currentNode=i;let o=S.nextNode(),r=0,a=0,l=s[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new R(o,o.nextSibling,this,t):1===l.type?e=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(e=new B(o,this,t)),this._$AV.push(e),l=s[++a]}r!==(null==l?void 0:l.index)&&(o=S.nextNode(),r++)}return S.currentNode=u,i}v(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class R{constructor(t,e,n,s){var i;this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=s,this._$Cp=null===(i=null==s?void 0:s.isConnected)||void 0===i||i}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=H(this,t,e),p(t)?t===C||null==t||""===t?(this._$AH!==C&&this._$AR(),this._$AH=C):t!==this._$AH&&t!==x&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>f(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==C&&p(this._$AH)?this._$AA.nextSibling.data=t:this.$(u.createTextNode(t)),this._$AH=t}g(t){var e;const{values:n,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(N(s.h,s.h[0]),this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.v(n);else{const t=new k(i,this),e=t.u(this.options);t.v(n),this.$(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new j(t)),e}T(t){f(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,s=0;for(const i of t)s===e.length?e.push(n=new R(this.k(d()),this.k(d()),this,this.options)):n=e[s],n._$AI(i),s++;s<e.length&&(this._$AR(n&&n._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var n;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class L{constructor(t,e,n,s,i){this.type=1,this._$AH=C,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=C}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,s){const i=this.strings;let o=!1;if(void 0===i)t=H(this,t,e,0),o=!p(t)||t!==this._$AH&&t!==x,o&&(this._$AH=t);else{const s=t;let r,a;for(t=i[0],r=0;r<i.length-1;r++)a=H(this,s[n+r],e,r),a===x&&(a=this._$AH[r]),o||(o=!p(a)||a!==this._$AH[r]),a===C?t=C:t!==C&&(t+=(null!=a?a:"")+i[r+1]),this._$AH[r]=a}o&&!s&&this.j(t)}j(t){t===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===C?void 0:t}}const P=o?o.emptyScript:"";class V extends L{constructor(){super(...arguments),this.type=4}j(t){t&&t!==C?this.element.setAttribute(this.name,P):this.element.removeAttribute(this.name)}}class U extends L{constructor(t,e,n,s,i){super(t,e,n,s,i),this.type=5}_$AI(t,e=this){var n;if((t=null!==(n=H(this,t,e,0))&&void 0!==n?n:C)===x)return;const s=this._$AH,i=t===C&&s!==C||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==C&&(s===C||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==n?n:this.element,t):this._$AH.handleEvent(t)}}class B{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){H(this,t)}}const I=i.litHtmlPolyfillSupport;null==I||I(j,R),(null!==(s=i.litHtmlVersions)&&void 0!==s?s:i.litHtmlVersions=[]).push("2.8.0");const F=(t,e,n)=>{var s,i;const o=null!==(s=null==n?void 0:n.renderBefore)&&void 0!==s?s:e;let r=o._$litPart$;if(void 0===r){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=r=new R(e.insertBefore(d(),t),t,void 0,null!=n?n:{})}return r._$AI(t),r}}},e={};function n(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};n.r(s),n.d(s,{Component:()=>i.Component,ROUTER_404_EVENT:()=>i.ROUTER_404_EVENT,ROUTER_EVENT:()=>i.ROUTER_EVENT,app:()=>i.app,customElement:()=>i.customElement,default:()=>p,event:()=>i.event,html:()=>r.qy,on:()=>i.on,render:()=>c,run:()=>d,safeHTML:()=>i.safeHTML,svg:()=>r.JW,update:()=>i.update});var i=n(466),o=n(791),r=n(752),a=n(804);class l extends a.WL{constructor(t){if(super(t),this.et=r.s6,t.type!==a.OA.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===r.s6||null==t)return this.ft=void 0,this.et=t;if(t===r.c0)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}l.directiveName="unsafeHTML",l.resultType=1;const h=(0,a.u$)(l);function c(t,e,n){e&&("string"==typeof e?(t._$litPart$||t.replaceChildren(),(0,r.XX)(r.qy`${h(e)}`,t)):e._$litType$?(t._$litPart$||t.replaceChildren(),(0,r.XX)(e,t)):((0,o.cJ)(t,e,n),t._$litPart$=void 0))}class u extends a.WL{constructor(t){if(super(t),t.type!==a.OA.EVENT)throw new Error("${run} can only be used in event handlers")}update(t,e){let{element:n,name:s}=t;const o=()=>{let t=n._component;for(;!t&&n;)n=n.parentElement,t=n&&n._component;return console.assert(!!t,"Component not found."),t},[r,...a]=e;return"string"==typeof r?n[`on${s}`]=t=>{const e=o();e?e.run(r,...a,t):i.default.run(r,...a,t)}:"function"==typeof r&&(n[`on${s}`]=t=>o().setState(r(o().state,...a,t))),this.render()}render(){return r.c0}}const d=(0,a.u$)(u);i.default.createElement=o.n,i.default.render=c,i.default.Fragment=o.FK;const p=i.default;return"object"==typeof window&&(window.React=window._React||i.default,window.html=r.qy,window.svg=r.JW,window.run=d),s})()));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apprun=e():t.apprun=e()}(this,(()=>(()=>{"use strict";var t={859:(t,e,s)=>{s.d(e,{A:()=>r,q:()=>n});class n{constructor(){this._events={}}on(t,e,s={}){this._events[t]=this._events[t]||[],this._events[t].push({fn:e,options:s})}off(t,e){const s=this._events[t]||[];this._events[t]=s.filter((t=>t.fn!==e))}find(t){return this._events[t]}run(t,...e){const s=this.getSubscribers(t,this._events);return console.assert(s&&s.length>0,"No subscriber for event: "+t),s.forEach((s=>{const{fn:n,options:i}=s;return i.delay?this.delay(t,n,e,i):Object.keys(i).length>0?n.apply(this,[...e,i]):n.apply(this,e),!s.options.once})),s.length}once(t,e,s={}){this.on(t,e,Object.assign(Object.assign({},s),{once:!0}))}delay(t,e,s,n){n._t&&clearTimeout(n._t),n._t=setTimeout((()=>{clearTimeout(n._t),Object.keys(n).length>0?e.apply(this,[...s,n]):e.apply(this,s)}),n.delay)}runAsync(t,...e){const s=this.getSubscribers(t,this._events);console.assert(s&&s.length>0,"No subscriber for event: "+t);const n=s.map((t=>{const{fn:s,options:n}=t;return Object.keys(n).length>0?s.apply(this,[...e,n]):s.apply(this,e)}));return Promise.all(n)}query(t,...e){return this.runAsync(t,...e)}getSubscribers(t,e){const s=e[t]||[];return e[t]=s.filter((t=>!t.options.once)),Object.keys(e).filter((e=>e.endsWith("*")&&t.startsWith(e.replace("*","")))).sort(((t,e)=>e.length-t.length)).forEach((n=>s.push(...e[n].map((e=>Object.assign(Object.assign({},e),{options:Object.assign(Object.assign({},e.options),{event:t})})))))),s}}let i;const o="undefined"!=typeof window?window:void 0!==s.g?s.g:"undefined"!=typeof self?self:{};o.app&&o._AppRunVersions?i=o.app:(i=new n,o.app=i,o._AppRunVersions="AppRun-3.3.11");const r=i},466:(t,e,s)=>{s.d(e,{Component:()=>f,ROUTER_404_EVENT:()=>m,ROUTER_EVENT:()=>_,app:()=>n.A,customElement:()=>l,default:()=>g,event:()=>h,on:()=>c,safeHTML:()=>i.safeHTML,update:()=>h});var n=s(859),i=s(320);const o=(t,e={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(e.observedAttributes||[]).map((t=>t.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const s=e||{};this._shadowRoot=s.shadow?this.attachShadow({mode:"open"}):this;const n=s.observedAttributes||[],i=n.reduce(((t,e)=>{const s=e.toLowerCase();return s!==e&&(t[s]=e),t}),{});this._attrMap=t=>i[t]||t;const o={};Array.from(this.attributes).forEach((t=>o[this._attrMap(t.name)]=t.value)),n.forEach((t=>{void 0!==this[t]&&(o[t]=this[t]),Object.defineProperty(this,t,{get:()=>o[t],set(e){this.attributeChangedCallback(t,o[t],e)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const e=this.children?Array.from(this.children):[];if(this._component=new t(Object.assign(Object.assign({},o),{children:e})).mount(this._shadowRoot,s),this._component._props=o,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const t=this._component.mounted(o,e,this._component.state);void 0!==t&&(this._component.state=t)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component),!1!==s.render&&this._component.run(".")}))}}disconnectedCallback(){var t,e,s,n;null===(e=null===(t=this._component)||void 0===t?void 0:t.unload)||void 0===e||e.call(t),null===(n=null===(s=this._component)||void 0===s?void 0:s.unmount)||void 0===n||n.call(s),this._component=null}attributeChangedCallback(t,s,n){if(this._component){const i=this._attrMap(t);this._component._props[i]=n,this._component.run("attributeChanged",i,s,n),n!==s&&!1!==e.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}},r=(t,e,s)=>{"undefined"!=typeof customElements&&customElements.define(t,o(e,s))},a={meta:new WeakMap,defineMetadata(t,e,s){this.meta.has(s)||this.meta.set(s,{}),this.meta.get(s)[t]=e},getMetadataKeys(t){return t=Object.getPrototypeOf(t),this.meta.get(t)?Object.keys(this.meta.get(t)):[]},getMetadata(t,e){return e=Object.getPrototypeOf(e),this.meta.get(e)?this.meta.get(e)[t]:null}};function h(t,e={}){return(s,n,i)=>{const o=t?t.toString():n;return a.defineMetadata(`apprun-update:${o}`,{name:o,key:n,options:e},s),i}}function c(t,e={}){return function(s,n){const i=t?t.toString():n;a.defineMetadata(`apprun-update:${i}`,{name:i,key:n,options:e},s)}}function l(t,e){return function(s){return r(t,s,e),s}}var d=s(741);const u=new Map;n.A.find("get-components")||n.A.on("get-components",(t=>t.components=u));const p=t=>t;class f{renderState(t,e=null){if(!this.view)return;let s=e||this.view(t);if(n.A.debug&&n.A.run("debug",{component:this,_:s?".":"-",state:t,vdom:s,el:this.element}),"object"!=typeof document)return;const i="string"==typeof this.element&&this.element?document.getElementById(this.element)||document.querySelector(this.element):this.element;if(!i)return;const o="_c";this.unload?i._component===this&&i.getAttribute(o)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),i.setAttribute(o,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((t=>{t[0].oldValue!==this.tracking_id&&document.body.contains(i)||(this.unload(this.state),this.observer.disconnect(),this.observer=null)}))),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[o]}))):i.removeAttribute&&i.removeAttribute(o),i._component=this,!e&&s&&(s=(0,d.A)(s,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>n.A.render(i,s,this))):n.A.render(i,s,this)),this.rendered&&this.rendered(this.state)}setState(t,e={render:!0,history:!1}){const s=t;if(null==s?void 0:s[Symbol.asyncIterator])this.setState((async t=>{try{for(;;){const{value:s,done:n}=await t.next();if(n)break;this.setState(s,e)}}catch(t){console.error("Error in async iterator:",t)}})(s[Symbol.asyncIterator]()),e);else if((null==s?void 0:s[Symbol.iterator])&&"function"==typeof s.next)for(const t of s)this.setState(t,e);else if(t&&t instanceof Promise)Promise.resolve(t).then((s=>{this.setState(s,e),this._state=t}));else{if(this._state=t,null==t)return;this.state=t,!1!==e.render&&(e.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(t))):this.renderState(t)),!1!==e.history&&this.enable_history&&(this._history=[...this._history,t],this._history_idx=this._history.length-1),"function"==typeof e.callback&&e.callback(this.state)}}constructor(t,e,s,i){this.state=t,this.view=e,this.update=s,this.options=i,this._app=new n.q,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this._history_prev=()=>{this._history_idx--,this._history_idx>=0?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=0},this._history_next=()=>{this._history_idx++,this._history_idx<this._history.length?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=this._history.length-1},this.start=(t=null,e)=>{if(this.mount(t,Object.assign({render:!0},e)),this.mounted&&"function"==typeof this.mounted){const t=this.mounted({},[],this.state);void 0!==t&&this.setState(t)}return this}}mount(t=null,e){var s,i;return console.assert(!this.element,"Component already mounted."),this.options=e=Object.assign(Object.assign({},this.options),e),this.element=t,this.global_event=e.global_event,this.enable_history=!!e.history,this.enable_history&&(this.on(e.history.prev||"history-prev",this._history_prev),this.on(e.history.next||"history-next",this._history_next)),e.route&&(this.update=this.update||{},this.update[e.route]||(this.update[e.route]=p)),this.add_actions(),this.state=null!==(i=null!==(s=this.state)&&void 0!==s?s:this.model)&&void 0!==i?i:{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!e.render,history:!0}),n.A.debug&&(u.get(t)?u.get(t).push(this):u.set(t,[this])),this}is_global_event(t){return t&&(this.global_event||this._global_events.indexOf(t)>=0||t.startsWith("#")||t.startsWith("/")||t.startsWith("@"))}add_action(t,e,s={}){e&&"function"==typeof e&&(s.global&&this._global_events.push(t),this.on(t,((...i)=>{n.A.debug&&n.A.run("debug",{component:this,_:">",event:t,p:i,current_state:this.state,options:s});const o=e(this.state,...i);n.A.debug&&n.A.run("debug",{component:this,_:"<",event:t,p:i,newState:o,state:this.state,options:s}),this.setState(o,s)}),s))}add_actions(){const t=this.update||{};a.getMetadataKeys(this).forEach((e=>{if(e.startsWith("apprun-update:")){const s=a.getMetadata(e,this);t[s.name]=[this[s.key].bind(this),s.options]}}));const e={};Array.isArray(t)?t.forEach((t=>{const[s,n,i]=t;s.toString().split(",").forEach((t=>e[t.trim()]=[n,i]))})):Object.keys(t).forEach((s=>{const n=t[s];("function"==typeof n||Array.isArray(n))&&s.split(",").forEach((t=>e[t.trim()]=n))})),e["."]||(e["."]=p),Object.keys(e).forEach((t=>{const s=e[t];"function"==typeof s?this.add_action(t,s):Array.isArray(s)&&this.add_action(t,s[0],s[1])}))}run(t,...e){if(this.state instanceof Promise)return Promise.resolve(this.state).then((s=>{this.state=s,this.run(t,...e)}));{const s=t.toString();return this.is_global_event(s)?n.A.run(s,...e):this._app.run(s,...e)}}on(t,e,s){const i=t.toString();return this._actions.push({name:i,fn:e}),this.is_global_event(i)?n.A.on(i,e,s):this._app.on(i,e,s)}runAsync(t,...e){const s=t.toString();return this.is_global_event(s)?n.A.runAsync(s,...e):this._app.runAsync(s,...e)}query(t,...e){return this.runAsync(t,...e)}unmount(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this._actions.forEach((t=>{const{name:e,fn:s}=t;this.is_global_event(e)?n.A.off(e,s):this._app.off(e,s)}))}}f.__isAppRunComponent=!0;const _="//",m="///",y=t=>{if(n.A.lastUrl!==t)if(n.A.lastUrl=t,t||(t="#"),t.startsWith("#")){const[e,...s]=t.split("/");n.A.run(e,...s)||n.A.run(m,e,...s),n.A.run(_,e,...s)}else if(t.startsWith("/")){const[e,s,...i]=t.split("/");n.A.run("/"+s,...i)||n.A.run(m,"/"+s,...i),n.A.run(_,"/"+s,...i)}else n.A.run(t)||n.A.run(m,t),n.A.run(_,t)},g=n.A;if(!n.A.start){n.A.version="3.35.0",n.A.h=n.A.createElement=i.createElement,n.A.render=i.render,n.A.Fragment=i.Fragment,n.A.webComponent=r,n.A.safeHTML=i.safeHTML,n.A.start=(t,e,s,n,i)=>{const o=Object.assign({render:!0,global_event:!0},i),r=new f(e,s,n);return i&&i.rendered&&(r.rendered=i.rendered),i&&i.mounted&&(r.mounted=i.mounted),r.start(t,o),r};const t=t=>{};n.A.on("debug",(e=>t)),n.A.on(_,t),n.A.on(m,t),n.A.route=y,n.A.on("route",(t=>n.A.route&&n.A.route(t))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{const t=document.body.hasAttribute("apprun-no-init")||n.A["no-init-route"]||!1,e=n.A.find("#")||n.A.find("#/")||!1;window.addEventListener("hashchange",(()=>y(location.hash))),window.addEventListener("popstate",(()=>y(location.pathname))),e?t&&y(location.hash):(t&&y(location.pathname),document.body.addEventListener("click",(t=>{const e=t.target,s="A"===e.tagName?e:e.closest("a");s&&s.origin===location.origin&&(t.preventDefault(),history.pushState(null,"",s.pathname),y(s.pathname))})))})),"object"==typeof window&&(window.Component=f,window._React=window.React,window.React=n.A,window.on=c,window.customElement=l,window.safeHTML=i.safeHTML),n.A.use_render=(t,e=0)=>{n.A.render=0===e?(e,s)=>t(s,e):(e,s)=>t(e,s)},n.A.use_react=(t,e)=>{n.A.h=n.A.createElement=t.createElement,n.A.Fragment=t.Fragment,n.A.render=(t,s)=>e.render(s,t),t.version&&t.version.startsWith("18")&&(n.A.render=(t,s)=>{t&&s&&(t._root||(t._root=e.createRoot(t)),t._root.render(s))})}}},741:(t,e,s)=>{s.d(e,{A:()=>a});var n=s(859);const i=(t,e)=>(e?t.state[e]:t.state)||"",o=(t,e,s)=>{if(e){const n=t.state||{};n[e]=s,t.setState(n)}else t.setState(s)},r=(t,e)=>{if(Array.isArray(t))return t.map((t=>r(t,e)));{let{type:s,tag:a,props:h,children:c}=t;return a=a||s,c=c||(null==h?void 0:h.children),h&&Object.keys(h).forEach((t=>{t.startsWith("$")&&(((t,e,s,r)=>{if(t.startsWith("$on")){const s=e[t];if(t=t.substring(1),"boolean"==typeof s)e[t]=e=>r.run?r.run(t,e):n.A.run(t,e);else if("string"==typeof s)e[t]=t=>r.run?r.run(s,t):n.A.run(s,t);else if("function"==typeof s)e[t]=t=>r.setState(s(r.state,t));else if(Array.isArray(s)){const[i,...o]=s;"string"==typeof i?e[t]=t=>r.run?r.run(i,...o,t):n.A.run(i,...o,t):"function"==typeof i&&(e[t]=t=>r.setState(i(r.state,...o,t)))}}else if("$bind"===t){const n=e.type||"text",a="string"==typeof e[t]?e[t]:e.name;if("input"===s)switch(n){case"checkbox":e.checked=i(r,a),e.onclick=t=>o(r,a||t.target.name,t.target.checked);break;case"radio":e.checked=i(r,a)===e.value,e.onclick=t=>o(r,a||t.target.name,t.target.value);break;case"number":case"range":e.value=i(r,a),e.oninput=t=>o(r,a||t.target.name,Number(t.target.value));break;default:e.value=i(r,a),e.oninput=t=>o(r,a||t.target.name,t.target.value)}else"select"===s?(e.value=i(r,a),e.onchange=t=>{t.target.multiple||o(r,a||t.target.name,t.target.value)}):"option"===s?(e.selected=i(r,a),e.onclick=t=>o(r,a||t.target.name,t.target.selected)):"textarea"===s&&(e.innerHTML=i(r,a),e.oninput=t=>o(r,a||t.target.name,t.target.value))}else n.A.run("$",{key:t,tag:s,props:e,component:r})})(t,h,a,e),delete h[t])})),c&&r(c,e),t}},a=r},791:(t,e,s)=>{s.d(e,{FK:()=>i,cJ:()=>c,n:()=>a,t_:()=>u});var n=s(741);function i(t,...e){return r(e)}const o="_props";function r(t){const e=[],s=t=>{null!=t&&""!==t&&!1!==t&&e.push("function"==typeof t||"object"==typeof t?t:`${t}`)};return t&&t.forEach((t=>{Array.isArray(t)?t.forEach((t=>s(t))):s(t)})),e}function a(t,e,...s){const n=r(s);if("string"==typeof t)return{tag:t,props:e,children:n};if(Array.isArray(t))return t;if(void 0===t&&s)return n;if(Object.getPrototypeOf(t).__isAppRunComponent)return{tag:t,props:e,children:n};if("function"==typeof t)return t(e,n);throw new Error(`Unknown tag in vdom ${t}`)}const h=new WeakMap,c=(t,e,s={})=>{null!=e&&!1!==e&&function(t,e,s={}){if(null==e||!1===e)return;if(e=m(e,s),!t)return;const n="SVG"===t.nodeName;Array.isArray(e)?d(t,e,n):d(t,[e],n)}("string"==typeof t&&t?document.getElementById(t)||document.querySelector(t):t,e=(0,n.A)(e,s),s)};function l(t,e,s){3!==e._op&&(s=s||"svg"===e.tag,function(t,e){const s=t.nodeName,n=`${e.tag||""}`;return s.toUpperCase()===n.toUpperCase()}(t,e)?(!(2&e._op)&&d(t,e.children,s),!(1&e._op)&&_(t,e.props,s)):t.parentNode.replaceChild(f(e,s),t))}function d(t,e,s){var n,i;const o=(null===(n=t.childNodes)||void 0===n?void 0:n.length)||0,r=(null==e?void 0:e.length)||0,a=Math.min(o,r);for(let n=0;n<a;n++){const i=e[n];if(3===i._op)continue;const o=t.childNodes[n];if("string"==typeof i)o.textContent!==i&&(3===o.nodeType?o.nodeValue=i:t.replaceChild(p(i),o));else if(i instanceof HTMLElement||i instanceof SVGElement)t.insertBefore(i,o);else{const e=i.props&&i.props.key;if(e)if(o.key===e)l(t.childNodes[n],i,s);else{const r=h[e];if(r){const e=r.nextSibling;t.insertBefore(r,o),e?t.insertBefore(o,e):t.appendChild(o),l(t.childNodes[n],i,s)}else t.replaceChild(f(i,s),o)}else l(t.childNodes[n],i,s)}}let c=(null===(i=t.childNodes)||void 0===i?void 0:i.length)||0;for(;c>a;)t.removeChild(t.lastChild),c--;if(r>a){const n=document.createDocumentFragment();for(let t=a;t<e.length;t++)n.appendChild(f(e[t],s));t.appendChild(n)}}const u=t=>{const e=document.createElement("section");return e.insertAdjacentHTML("afterbegin",t),Array.from(e.children)};function p(t){if(0===(null==t?void 0:t.indexOf("_html:"))){const e=document.createElement("div");return e.insertAdjacentHTML("afterbegin",t.substring(6)),e}return document.createTextNode(null!=t?t:"")}function f(t,e){if(t instanceof HTMLElement||t instanceof SVGElement)return t;if("string"==typeof t)return p(t);if(!t.tag||"function"==typeof t.tag)return p(JSON.stringify(t));const s=(e=e||"svg"===t.tag)?document.createElementNS("http://www.w3.org/2000/svg",t.tag):document.createElement(t.tag);return _(s,t.props,e),t.children&&t.children.forEach((t=>s.appendChild(f(t,e)))),s}function _(t,e,s){const n=t[o]||{};e=function(t,e){e.class=e.class||e.className,delete e.className;const s={};return t&&Object.keys(t).forEach((t=>s[t]=null)),e&&Object.keys(e).forEach((t=>s[t]=e[t])),s}(n,e||{}),t[o]=e;for(const n in e){const i=e[n];if(n.startsWith("data-")){const e=n.substring(5).replace(/-(\w)/g,(t=>t[1].toUpperCase()));t.dataset[e]!==i&&(i||""===i?t.dataset[e]=i:delete t.dataset[e])}else if("style"===n)if(t.style.cssText&&(t.style.cssText=""),"string"==typeof i)t.style.cssText=i;else for(const e in i)t.style[e]!==i[e]&&(t.style[e]=i[e]);else if(n.startsWith("xlink")){const e=n.replace("xlink","").toLowerCase();null==i||!1===i?t.removeAttributeNS("http://www.w3.org/1999/xlink",e):t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}else n.startsWith("on")?i&&"function"!=typeof i?"string"==typeof i&&(i?t.setAttribute(n,i):t.removeAttribute(n)):t[n]=i:/^id$|^class$|^list$|^readonly$|^contenteditable$|^role|-|^for$/g.test(n)||s?t.getAttribute(n)!==i&&(i?t.setAttribute(n,i):t.removeAttribute(n)):t[n]!==i&&(t[n]=i);"key"===n&&i&&(h[i]=t)}e&&"function"==typeof e.ref&&window.requestAnimationFrame((()=>e.ref(t)))}function m(t,e,s=0){var n;if("string"==typeof t)return t;if(Array.isArray(t))return t.map((t=>m(t,e,s++)));let i=t;if(t&&"function"==typeof t.tag&&Object.getPrototypeOf(t.tag).__isAppRunComponent&&(i=function(t,e,s){const{tag:n,props:i,children:o}=t;let r=`_${s}`,a=i&&i.id;a?r=a:a=`_${s}${Date.now()}`;let h="section";i&&i.as&&(h=i.as,delete i.as),e.__componentCache||(e.__componentCache={});let c=e.__componentCache[r];if(c&&c instanceof n&&c.element)c.renderState(c.state);else{const t=document.createElement(h);c=e.__componentCache[r]=new n(Object.assign(Object.assign({},i),{children:o})).mount(t,{render:!0})}if(c.mounted){const t=c.mounted(i,o,c.state);void 0!==t&&c.setState(t)}return _(c.element,i,!1),c.element}(t,e,s)),i&&Array.isArray(i.children)){const t=null===(n=i.props)||void 0===n?void 0:n._component;if(t){let e=0;i.children=i.children.map((s=>m(s,t,e++)))}else i.children=i.children.map((t=>m(t,e,s++)))}return i}},320:(t,e,s)=>{s.d(e,{Fragment:()=>n.FK,createElement:()=>n.n,render:()=>n.cJ,safeHTML:()=>n.t_});var n=s(791)},804:(t,e,s)=>{s.d(e,{OA:()=>n,WL:()=>o,u$:()=>i});const n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},i=t=>(...e)=>({_$litDirective$:t,values:e});class o{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}},752:(t,e,s)=>{s.d(e,{JW:()=>w,XX:()=>D,c0:()=>S,qy:()=>E,s6:()=>C});const n=globalThis,i=n.trustedTypes,o=i?i.createPolicy("lit-html",{createHTML:t=>t}):void 0,r="$lit$",a=`lit$${Math.random().toFixed(9).slice(2)}$`,h="?"+a,c=`<${h}>`,l=document,d=()=>l.createComment(""),u=t=>null===t||"object"!=typeof t&&"function"!=typeof t,p=Array.isArray,f="[ \t\n\f\r]",_=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,m=/-->/g,y=/>/g,g=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),A=/'/g,$=/"/g,v=/^(?:script|style|textarea|title)$/i,b=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),E=b(1),w=b(2),S=(b(3),Symbol.for("lit-noChange")),C=Symbol.for("lit-nothing"),O=new WeakMap,T=l.createTreeWalker(l,129);function x(t,e){if(!p(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==o?o.createHTML(e):e}const M=(t,e)=>{const s=t.length-1,n=[];let i,o=2===e?"<svg>":3===e?"<math>":"",h=_;for(let e=0;e<s;e++){const s=t[e];let l,d,u=-1,p=0;for(;p<s.length&&(h.lastIndex=p,d=h.exec(s),null!==d);)p=h.lastIndex,h===_?"!--"===d[1]?h=m:void 0!==d[1]?h=y:void 0!==d[2]?(v.test(d[2])&&(i=RegExp("</"+d[2],"g")),h=g):void 0!==d[3]&&(h=g):h===g?">"===d[0]?(h=i??_,u=-1):void 0===d[1]?u=-2:(u=h.lastIndex-d[2].length,l=d[1],h=void 0===d[3]?g:'"'===d[3]?$:A):h===$||h===A?h=g:h===m||h===y?h=_:(h=g,i=void 0);const f=h===g&&t[e+1].startsWith("/>")?" ":"";o+=h===_?s+c:u>=0?(n.push(l),s.slice(0,u)+r+s.slice(u)+a+f):s+a+(-2===u?e:f)}return[x(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class P{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let o=0,c=0;const l=t.length-1,u=this.parts,[p,f]=M(t,e);if(this.el=P.createElement(p,s),T.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=T.nextNode())&&u.length<l;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(r)){const e=f[c++],s=n.getAttribute(t).split(a),i=/([.?@])?(.*)/.exec(e);u.push({type:1,index:o,name:i[2],strings:s,ctor:"."===i[1]?U:"?"===i[1]?H:"@"===i[1]?L:R}),n.removeAttribute(t)}else t.startsWith(a)&&(u.push({type:6,index:o}),n.removeAttribute(t));if(v.test(n.tagName)){const t=n.textContent.split(a),e=t.length-1;if(e>0){n.textContent=i?i.emptyScript:"";for(let s=0;s<e;s++)n.append(t[s],d()),T.nextNode(),u.push({type:2,index:++o});n.append(t[e],d())}}}else if(8===n.nodeType)if(n.data===h)u.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(a,t+1));)u.push({type:7,index:o}),t+=a.length-1}o++}}static createElement(t,e){const s=l.createElement("template");return s.innerHTML=t,s}}function N(t,e,s=t,n){if(e===S)return e;let i=void 0!==n?s._$Co?.[n]:s._$Cl;const o=u(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,s,n)),void 0!==n?(s._$Co??=[])[n]=i:s._$Cl=i),void 0!==i&&(e=N(t,i._$AS(t,e.values),i,n)),e}class k{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??l).importNode(e,!0);T.currentNode=n;let i=T.nextNode(),o=0,r=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new j(i,i.nextSibling,this,t):1===a.type?e=new a.ctor(i,a.name,a.strings,this,t):6===a.type&&(e=new W(i,this,t)),this._$AV.push(e),a=s[++r]}o!==a?.index&&(i=T.nextNode(),o++)}return T.currentNode=l,n}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class j{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=N(this,t,e),u(t)?t===C||null==t||""===t?(this._$AH!==C&&this._$AR(),this._$AH=C):t!==this._$AH&&t!==S&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>p(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==C&&u(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=P.createElement(x(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new k(n,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new P(t)),e}k(t){p(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new j(this.O(d()),this.O(d()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,i){this.type=1,this._$AH=C,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=C}_$AI(t,e=this,s,n){const i=this.strings;let o=!1;if(void 0===i)t=N(this,t,e,0),o=!u(t)||t!==this._$AH&&t!==S,o&&(this._$AH=t);else{const n=t;let r,a;for(t=i[0],r=0;r<i.length-1;r++)a=N(this,n[s+r],e,r),a===S&&(a=this._$AH[r]),o||=!u(a)||a!==this._$AH[r],a===C?t=C:t!==C&&(t+=(a??"")+i[r+1]),this._$AH[r]=a}o&&!n&&this.j(t)}j(t){t===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class U extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===C?void 0:t}}class H extends R{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==C)}}class L extends R{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){if((t=N(this,t,e,0)??C)===S)return;const s=this._$AH,n=t===C&&s!==C||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==C&&(s===C||n);n&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class W{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){N(this,t)}}const V=n.litHtmlPolyfillSupport;V?.(P,j),(n.litHtmlVersions??=[]).push("3.3.0");const D=(t,e,s)=>{const n=s?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=s?.renderBefore??null;n._$litPart$=i=new j(e.insertBefore(d(),t),t,void 0,s??{})}return i._$AI(t),i}}},e={};function s(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,s),o.exports}s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};s.r(n),s.d(n,{Component:()=>i.Component,ROUTER_404_EVENT:()=>i.ROUTER_404_EVENT,ROUTER_EVENT:()=>i.ROUTER_EVENT,app:()=>i.app,customElement:()=>i.customElement,default:()=>L,event:()=>i.event,html:()=>T.qy,on:()=>i.on,render:()=>R,run:()=>H,safeHTML:()=>i.safeHTML,svg:()=>T.JW,update:()=>i.update});var i=s(466),o=s(791);const r=globalThis,a=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,h=Symbol(),c=new WeakMap;class l{constructor(t,e,s){if(this._$cssResult$=!0,s!==h)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(a&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=c.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&c.set(e,t))}return t}toString(){return this.cssText}}const d=(t,e)=>{if(a)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const s of e){const e=document.createElement("style"),n=r.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=s.cssText,t.appendChild(e)}},u=a?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new l("string"==typeof t?t:t+"",void 0,h))(e)})(t):t,{is:p,defineProperty:f,getOwnPropertyDescriptor:_,getOwnPropertyNames:m,getOwnPropertySymbols:y,getPrototypeOf:g}=Object,A=globalThis,$=A.trustedTypes,v=$?$.emptyScript:"",b=A.reactiveElementPolyfillSupport,E=(t,e)=>t,w={toAttribute(t,e){switch(e){case Boolean:t=t?v:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},S=(t,e)=>!p(t,e),C={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:S};Symbol.metadata??=Symbol("metadata"),A.litPropertyMetadata??=new WeakMap;class O extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=C){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),n=this.getPropertyDescriptor(t,s,e);void 0!==n&&f(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){const{get:n,set:i}=_(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const o=n?.call(this);i?.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??C}static _$Ei(){if(this.hasOwnProperty(E("elementProperties")))return;const t=g(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){const t=this.properties,e=[...m(t),...y(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return d(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(void 0!==n&&!0===s.reflect){const i=(void 0!==s.converter?.toAttribute?s.converter:w).toAttribute(e,s.type);this._$Em=t,null==i?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(t,e){const s=this.constructor,n=s._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=s.getPropertyOptions(n),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:w;this._$Em=n,this[n]=i.fromAttribute(e,t.type)??this._$Ej?.get(n)??null,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const n=this.constructor,i=this[t];if(s??=n.getPropertyOptions(t),!((s.hasChanged??S)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:i},o){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==i||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,s,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}O.elementStyles=[],O.shadowRootOptions={mode:"open"},O[E("elementProperties")]=new Map,O[E("finalized")]=new Map,b?.({ReactiveElement:O}),(A.reactiveElementVersions??=[]).push("2.1.0");var T=s(752);const x=globalThis;class M extends O{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=(0,T.XX)(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return T.c0}}M._$litElement$=!0,M.finalized=!0,x.litElementHydrateSupport?.({LitElement:M});const P=x.litElementPolyfillSupport;P?.({LitElement:M}),(x.litElementVersions??=[]).push("4.2.0");var N=s(804);class k extends N.WL{constructor(t){if(super(t),this.it=T.s6,t.type!==N.OA.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===T.s6||null==t)return this._t=void 0,this.it=t;if(t===T.c0)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}k.directiveName="unsafeHTML",k.resultType=1;const j=(0,N.u$)(k);function R(t,e,s){e&&("string"==typeof e?(t._$litPart$||t.replaceChildren(),(0,T.XX)(T.qy`${j(e)}`,t)):e._$litType$?(t._$litPart$||t.replaceChildren(),(0,T.XX)(e,t)):((0,o.cJ)(t,e,s),t._$litPart$=void 0))}class U extends N.WL{constructor(t){if(super(t),t.type!==N.OA.EVENT)throw new Error("run() can only be used in event handlers")}update(t,e){const s=t.element,n=t.name,[o,...r]=e,a=()=>{let t=s,e=t._component;for(;!e&&t;)t=t.parentElement,e=t&&t._component;return console.assert(!!e,"Component not found."),e};return"string"==typeof o?s[`on${n}`]=t=>{const e=a();e?e.run(o,...r,t):i.default.run(o,...r,t)}:"function"==typeof o&&(s[`on${n}`]=t=>a().setState(o(a().state,...r,t))),this.render()}render(){return T.c0}}const H=(0,N.u$)(U);i.default.createElement=o.n,i.default.render=R,i.default.Fragment=o.FK;const L=i.default;return"object"==typeof window&&(window.React=window._React||i.default,window.html=T.qy,window.svg=T.JW,window.run=H),n})()));
|
|
3
3
|
//# sourceMappingURL=apprun-html.js.map
|