apprun 3.35.0 → 3.36.1

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +134 -16
  3. package/WHATSNEW.md +28 -12
  4. package/apprun-book.jpg +0 -0
  5. package/apprun.d.ts +9 -6
  6. package/cli/app.js +29 -0
  7. package/cli/index.html +13 -0
  8. package/{apprun-cli.js → cli/index.js} +8 -14
  9. package/dist/apprun-dev-tools.js +1 -2
  10. package/dist/apprun-dev-tools.js.map +1 -1
  11. package/dist/apprun-html.esm.js +7 -7
  12. package/dist/apprun-html.esm.js.map +1 -1
  13. package/dist/apprun-html.js +1 -1
  14. package/dist/apprun-html.js.map +1 -1
  15. package/dist/apprun-play-html.esm.js +7 -7
  16. package/dist/apprun-play-html.esm.js.map +1 -1
  17. package/dist/apprun-play.js +1 -1
  18. package/dist/apprun-play.js.map +1 -1
  19. package/dist/apprun.esm.js +1 -1
  20. package/dist/apprun.esm.js.map +1 -1
  21. package/dist/apprun.js +1 -1
  22. package/dist/apprun.js.map +1 -1
  23. package/esm/app.js +60 -12
  24. package/esm/app.js.map +1 -1
  25. package/esm/apprun-dev-tools.js +1 -7
  26. package/esm/apprun-dev-tools.js.map +1 -1
  27. package/esm/apprun-html.js +8 -4
  28. package/esm/apprun-html.js.map +1 -1
  29. package/esm/apprun.js +81 -17
  30. package/esm/apprun.js.map +1 -1
  31. package/esm/component.js +60 -19
  32. package/esm/component.js.map +1 -1
  33. package/esm/decorator.js +22 -5
  34. package/esm/decorator.js.map +1 -1
  35. package/esm/directive.js +64 -13
  36. package/esm/directive.js.map +1 -1
  37. package/esm/router.js +263 -22
  38. package/esm/router.js.map +1 -1
  39. package/esm/type-utils.js +91 -0
  40. package/esm/type-utils.js.map +1 -0
  41. package/esm/types.js +32 -11
  42. package/esm/types.js.map +1 -1
  43. package/esm/vdom-my-new.js +329 -0
  44. package/esm/vdom-my-new.js.map +1 -0
  45. package/esm/vdom-my-prop-attr.js +227 -0
  46. package/esm/vdom-my-prop-attr.js.map +1 -0
  47. package/esm/vdom-my.js +77 -88
  48. package/esm/vdom-my.js.map +1 -1
  49. package/esm/version.js +15 -0
  50. package/esm/version.js.map +1 -0
  51. package/esm/web-component.js +30 -10
  52. package/esm/web-component.js.map +1 -1
  53. package/index.html +1 -1
  54. package/jest.config.js +3 -8
  55. package/jest.setup.js +29 -3
  56. package/jsx-runtime.js +1 -1
  57. package/jsx-runtime.js.map +1 -1
  58. package/package.json +7 -7
  59. package/src/app.ts +58 -12
  60. package/src/apprun-dev-tools.tsx +1 -7
  61. package/src/apprun-html.ts +8 -4
  62. package/src/apprun.ts +97 -20
  63. package/src/component.ts +62 -20
  64. package/src/decorator.ts +23 -6
  65. package/src/directive.ts +64 -13
  66. package/src/router.ts +282 -20
  67. package/src/type-utils.ts +130 -0
  68. package/src/types.ts +33 -12
  69. package/src/vdom-my-new.ts +311 -0
  70. package/src/vdom-my-prop-attr.ts +241 -0
  71. package/src/vdom-my.ts +82 -71
  72. package/src/version.ts +16 -0
  73. package/src/web-component.ts +31 -11
  74. package/cli/export.js +0 -92
  75. package/cli/import.js +0 -68
@@ -1,34 +1,34 @@
1
- class t{constructor(){this._events={}}on(t,s,i={}){this._events[t]=this._events[t]||[],this._events[t].push({fn:s,options:i})}off(t,s){const i=this._events[t]||[];this._events[t]=i.filter((t=>t.fn!==s))}find(t){return this._events[t]}run(t,...s){const i=this.getSubscribers(t,this._events);return console.assert(i&&i.length>0,"No subscriber for event: "+t),i.forEach((i=>{const{fn:e,options:n}=i;return n.delay?this.delay(t,e,s,n):Object.keys(n).length>0?e.apply(this,[...s,n]):e.apply(this,s),!i.options.once})),i.length}once(t,s,i={}){this.on(t,s,Object.assign(Object.assign({},i),{once:!0}))}delay(t,s,i,e){e._t&&clearTimeout(e._t),e._t=setTimeout((()=>{clearTimeout(e._t),Object.keys(e).length>0?s.apply(this,[...i,e]):s.apply(this,i)}),e.delay)}runAsync(t,...s){const i=this.getSubscribers(t,this._events);console.assert(i&&i.length>0,"No subscriber for event: "+t);const e=i.map((t=>{const{fn:i,options:e}=t;return Object.keys(e).length>0?i.apply(this,[...s,e]):i.apply(this,s)}));return Promise.all(e)}query(t,...s){return this.runAsync(t,...s)}getSubscribers(t,s){const i=s[t]||[];return s[t]=i.filter((t=>!t.options.once)),Object.keys(s).filter((s=>s.endsWith("*")&&t.startsWith(s.replace("*","")))).sort(((t,s)=>s.length-t.length)).forEach((e=>i.push(...s[e].map((s=>Object.assign(Object.assign({},s),{options:Object.assign(Object.assign({},s.options),{event:t})})))))),i}}let s;const i="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};i.app&&i._AppRunVersions?s=i.app:(s=new t,i.app=s,i._AppRunVersions="AppRun-3.3.11");var e=s;const n=(t,s)=>(s?t.state[s]:t.state)||"",o=(t,s,i)=>{if(s){const e=t.state||{};e[s]=i,t.setState(e)}else t.setState(i)},r=(t,s)=>{if(Array.isArray(t))return t.map((t=>r(t,s)));{let{type:i,tag:h,props:c,children:l}=t;return h=h||i,l=l||(null==c?void 0:c.children),c&&Object.keys(c).forEach((t=>{t.startsWith("$")&&(((t,s,i,r)=>{if(t.startsWith("$on")){const i=s[t];if(t=t.substring(1),"boolean"==typeof i)s[t]=s=>r.run?r.run(t,s):e.run(t,s);else if("string"==typeof i)s[t]=t=>r.run?r.run(i,t):e.run(i,t);else if("function"==typeof i)s[t]=t=>r.setState(i(r.state,t));else if(Array.isArray(i)){const[n,...o]=i;"string"==typeof n?s[t]=t=>r.run?r.run(n,...o,t):e.run(n,...o,t):"function"==typeof n&&(s[t]=t=>r.setState(n(r.state,...o,t)))}}else if("$bind"===t){const e=s.type||"text",h="string"==typeof s[t]?s[t]:s.name;if("input"===i)switch(e){case"checkbox":s.checked=n(r,h),s.onclick=t=>o(r,h||t.target.name,t.target.checked);break;case"radio":s.checked=n(r,h)===s.value,s.onclick=t=>o(r,h||t.target.name,t.target.value);break;case"number":case"range":s.value=n(r,h),s.oninput=t=>o(r,h||t.target.name,Number(t.target.value));break;default:s.value=n(r,h),s.oninput=t=>o(r,h||t.target.name,t.target.value)}else"select"===i?(s.value=n(r,h),s.onchange=t=>{t.target.multiple||o(r,h||t.target.name,t.target.value)}):"option"===i?(s.selected=n(r,h),s.onclick=t=>o(r,h||t.target.name,t.target.selected)):"textarea"===i&&(s.innerHTML=n(r,h),s.oninput=t=>o(r,h||t.target.name,t.target.value))}else e.run("$",{key:t,tag:i,props:s,component:r})})(t,c,h,s),delete c[t])})),l&&r(l,s),t}};function h(t,...s){return l(s)}const c="_props";function l(t){const s=[],i=t=>{null!=t&&""!==t&&!1!==t&&s.push("function"==typeof t||"object"==typeof t?t:`${t}`)};return t&&t.forEach((t=>{Array.isArray(t)?t.forEach((t=>i(t))):i(t)})),s}function u(t,s,...i){const e=l(i);if("string"==typeof t)return{tag:t,props:s,children:e};if(Array.isArray(t))return t;if(void 0===t&&i)return e;if(Object.getPrototypeOf(t).i)return{tag:t,props:s,children:e};if("function"==typeof t)return t(s,e);throw new Error(`Unknown tag in vdom ${t}`)}const a=new WeakMap,f=(t,s,i={})=>{if(null==s||!1===s)return;!function(t,s,i={}){if(null==s||!1===s)return;if(s=m(s,i),!t)return;const e="SVG"===t.nodeName;Array.isArray(s)?p(t,s,e):p(t,[s],e)}("string"==typeof t&&t?document.getElementById(t)||document.querySelector(t):t,s=r(s,i),i)};function d(t,s,i){3!==s._op&&(i=i||"svg"===s.tag,!function(t,s){const i=t.nodeName,e=`${s.tag||""}`;return i.toUpperCase()===e.toUpperCase()}(t,s)?t.parentNode.replaceChild(b(s,i),t):(!(2&s._op)&&p(t,s.children,i),!(1&s._op)&&w(t,s.props,i)))}function p(t,s,i){var e,n;const o=(null===(e=t.childNodes)||void 0===e?void 0:e.length)||0,r=(null==s?void 0:s.length)||0,h=Math.min(o,r);for(let e=0;e<h;e++){const n=s[e];if(3===n._op)continue;const o=t.childNodes[e];if("string"==typeof n)o.textContent!==n&&(3===o.nodeType?o.nodeValue=n:t.replaceChild(v(n),o));else if(n instanceof HTMLElement||n instanceof SVGElement)t.insertBefore(n,o);else{const s=n.props&&n.props.key;if(s)if(o.key===s)d(t.childNodes[e],n,i);else{const r=a[s];if(r){const s=r.nextSibling;t.insertBefore(r,o),s?t.insertBefore(o,s):t.appendChild(o),d(t.childNodes[e],n,i)}else t.replaceChild(b(n,i),o)}else d(t.childNodes[e],n,i)}}let c=(null===(n=t.childNodes)||void 0===n?void 0:n.length)||0;for(;c>h;)t.removeChild(t.lastChild),c--;if(r>h){const e=document.createDocumentFragment();for(let t=h;t<s.length;t++)e.appendChild(b(s[t],i));t.appendChild(e)}}const y=t=>{const s=document.createElement("section");return s.insertAdjacentHTML("afterbegin",t),Array.from(s.children)};function v(t){if(0===(null==t?void 0:t.indexOf("_html:"))){const s=document.createElement("div");return s.insertAdjacentHTML("afterbegin",t.substring(6)),s}return document.createTextNode(null!=t?t:"")}function b(t,s){if(t instanceof HTMLElement||t instanceof SVGElement)return t;if("string"==typeof t)return v(t);if(!t.tag||"function"==typeof t.tag)return v(JSON.stringify(t));const i=(s=s||"svg"===t.tag)?document.createElementNS("http://www.w3.org/2000/svg",t.tag):document.createElement(t.tag);return w(i,t.props,s),t.children&&t.children.forEach((t=>i.appendChild(b(t,s)))),i}function w(t,s,i){const e=t[c]||{};s=function(t,s){s.class=s.class||s.className,delete s.className;const i={};return t&&Object.keys(t).forEach((t=>i[t]=null)),Object.keys(s).forEach((t=>i[t]=s[t])),i}(e,s||{}),t[c]=s;for(const e in s){const n=s[e];if(e.startsWith("data-")){const s=e.substring(5).replace(/-(\w)/g,(t=>t[1].toUpperCase()));t.dataset[s]!==n&&(n||""===n?t.dataset[s]=n:delete t.dataset[s])}else if("style"===e)if(t.style.cssText&&(t.style.cssText=""),"string"==typeof n)t.style.cssText=n;else for(const s in n)t.style[s]!==n[s]&&(t.style[s]=n[s]);else if(e.startsWith("xlink")){const s=e.replace("xlink","").toLowerCase();null==n||!1===n?t.removeAttributeNS("http://www.w3.org/1999/xlink",s):t.setAttributeNS("http://www.w3.org/1999/xlink",s,n)}else e.startsWith("on")?n&&"function"!=typeof n?"string"==typeof n&&(n?t.setAttribute(e,n):t.removeAttribute(e)):t[e]=n:/^id$|^class$|^list$|^readonly$|^contenteditable$|^role|-|^for$/g.test(e)||i?t.getAttribute(e)!==n&&(n?t.setAttribute(e,n):t.removeAttribute(e)):t[e]!==n&&(t[e]=n);"key"===e&&n&&(a[n]=t)}s&&"function"==typeof s.ref&&window.requestAnimationFrame((()=>s.ref(t)))}function m(t,s,i=0){var e;if("string"==typeof t)return t;if(Array.isArray(t))return t.map((t=>m(t,s,i++)));let n=t;if(t&&"function"==typeof t.tag&&Object.getPrototypeOf(t.tag).i&&(n=function(t,s,i){const{tag:e,props:n,children:o}=t;let r=`_${i}`,h=n&&n.id;h?r=h:h=`_${i}${Date.now()}`;let c="section";n&&n.as&&(c=n.as,delete n.as),s.v||(s.v={});let l=s.v[r];if(l&&l instanceof e&&l.element)l.renderState(l.state);else{const t=document.createElement(c);l=s.v[r]=new e(Object.assign(Object.assign({},n),{children:o})).mount(t,{render:!0})}if(l.mounted){const t=l.mounted(n,o,l.state);void 0!==t&&l.setState(t)}return w(l.element,n,!1),l.element}(t,s,i)),n&&Array.isArray(n.children)){const t=null===(e=n.props)||void 0===e?void 0:e._component;if(t){let s=0;n.children=n.children.map((i=>m(i,t,s++)))}else n.children=n.children.map((t=>m(t,s,i++)))}return n}const g=(t,s={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(s.observedAttributes||[]).map((t=>t.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const i=s||{};this._shadowRoot=i.shadow?this.attachShadow({mode:"open"}):this;const e=i.observedAttributes||[],n=e.reduce(((t,s)=>{const i=s.toLowerCase();return i!==s&&(t[i]=s),t}),{});this._attrMap=t=>n[t]||t;const o={};Array.from(this.attributes).forEach((t=>o[this._attrMap(t.name)]=t.value)),e.forEach((t=>{void 0!==this[t]&&(o[t]=this[t]),Object.defineProperty(this,t,{get:()=>o[t],set(s){this.attributeChangedCallback(t,o[t],s)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const s=this.children?Array.from(this.children):[];if(this._component=new t(Object.assign(Object.assign({},o),{children:s})).mount(this._shadowRoot,i),this._component._props=o,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const t=this._component.mounted(o,s,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!==i.render&&this._component.run(".")}))}}disconnectedCallback(){var t,s,i,e;null===(s=null===(t=this._component)||void 0===t?void 0:t.unload)||void 0===s||s.call(t),null===(e=null===(i=this._component)||void 0===i?void 0:i.unmount)||void 0===e||e.call(i),this._component=null}attributeChangedCallback(t,i,e){if(this._component){const n=this._attrMap(t);this._component._props[n]=e,this._component.run("attributeChanged",n,i,e),e!==i&&!1!==s.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}};var $=(t,s,i)=>{"undefined"!=typeof customElements&&customElements.define(t,g(s,i))};const S={meta:new WeakMap,defineMetadata(t,s,i){this.meta.has(i)||this.meta.set(i,{}),this.meta.get(i)[t]=s},getMetadataKeys(t){return t=Object.getPrototypeOf(t),this.meta.get(t)?Object.keys(this.meta.get(t)):[]},getMetadata(t,s){return s=Object.getPrototypeOf(s),this.meta.get(s)?this.meta.get(s)[t]:null}};function O(t,s={}){return(i,e,n)=>{const o=t?t.toString():e;return S.defineMetadata(`apprun-update:${o}`,{name:o,key:e,options:s},i),n}}function A(t,s={}){return function(i,e){const n=t?t.toString():e;S.defineMetadata(`apprun-update:${n}`,{name:n,key:e,options:s},i)}}function _(t,s){return function(i){return $(t,i,s),i}}const j=new Map;e.find("get-components")||e.on("get-components",(t=>t.components=j));const k=t=>t;class E{renderState(t,s=null){if(!this.view)return;let i=s||this.view(t);if(e.debug&&e.run("debug",{component:this,_:i?".":"-",state:t,vdom:i,el:this.element}),"object"!=typeof document)return;const n="string"==typeof this.element&&this.element?document.getElementById(this.element)||document.querySelector(this.element):this.element;if(!n)return;const o="_c";this.unload?n._component===this&&n.getAttribute(o)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),n.setAttribute(o,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((t=>{t[0].oldValue!==this.tracking_id&&document.body.contains(n)||(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]}))):n.removeAttribute&&n.removeAttribute(o),n._component=this,!s&&i&&(i=r(i,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>e.render(n,i,this))):e.render(n,i,this)),this.rendered&&this.rendered(this.state)}setState(t,s={render:!0,history:!1}){const i=async t=>{try{for(;;){const{value:i,done:e}=await t.next();if(e)break;this.setState(i,s)}}catch(t){console.error("Error in async iterator:",t)}},e=t;if(null==e?void 0:e[Symbol.asyncIterator])this.setState(i(e[Symbol.asyncIterator]()),s);else if((null==e?void 0:e[Symbol.iterator])&&"function"==typeof e.next)for(const t of e)this.setState(t,s);else if(t&&t instanceof Promise)Promise.resolve(t).then((i=>{this.setState(i,s),this._state=t}));else{if(this._state=t,null==t)return;this.state=t,!1!==s.render&&(s.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(t))):this.renderState(t)),!1!==s.history&&this.enable_history&&(this._history=[...this._history,t],this._history_idx=this._history.length-1),"function"==typeof s.callback&&s.callback(this.state)}}constructor(s,i,e,n){this.state=s,this.view=i,this.update=e,this.options=n,this._app=new t,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,s)=>{if(this.mount(t,Object.assign({render:!0},s)),this.mounted&&"function"==typeof this.mounted){const t=this.mounted({},[],this.state);void 0!==t&&this.setState(t)}return this}}mount(t=null,s){var i,n;return console.assert(!this.element,"Component already mounted."),this.options=s=Object.assign(Object.assign({},this.options),s),this.element=t,this.global_event=s.global_event,this.enable_history=!!s.history,this.enable_history&&(this.on(s.history.prev||"history-prev",this._history_prev),this.on(s.history.next||"history-next",this._history_next)),s.route&&(this.update=this.update||{},this.update[s.route]||(this.update[s.route]=k)),this.add_actions(),this.state=null!==(n=null!==(i=this.state)&&void 0!==i?i:this.model)&&void 0!==n?n:{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!s.render,history:!0}),e.debug&&(j.get(t)?j.get(t).push(this):j.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,s,i={}){s&&"function"==typeof s&&(i.global&&this._global_events.push(t),this.on(t,((...n)=>{e.debug&&e.run("debug",{component:this,_:">",event:t,p:n,current_state:this.state,options:i});const o=s(this.state,...n);e.debug&&e.run("debug",{component:this,_:"<",event:t,p:n,newState:o,state:this.state,options:i}),this.setState(o,i)}),i))}add_actions(){const t=this.update||{};S.getMetadataKeys(this).forEach((s=>{if(s.startsWith("apprun-update:")){const i=S.getMetadata(s,this);t[i.name]=[this[i.key].bind(this),i.options]}}));const s={};Array.isArray(t)?t.forEach((t=>{const[i,e,n]=t;i.toString().split(",").forEach((t=>s[t.trim()]=[e,n]))})):Object.keys(t).forEach((i=>{const e=t[i];("function"==typeof e||Array.isArray(e))&&i.split(",").forEach((t=>s[t.trim()]=e))})),s["."]||(s["."]=k),Object.keys(s).forEach((t=>{const i=s[t];"function"==typeof i?this.add_action(t,i):Array.isArray(i)&&this.add_action(t,i[0],i[1])}))}run(t,...s){if(this.state instanceof Promise)return Promise.resolve(this.state).then((i=>{this.state=i,this.run(t,...s)}));{const i=t.toString();return this.is_global_event(i)?e.run(i,...s):this._app.run(i,...s)}}on(t,s,i){const n=t.toString();return this._actions.push({name:n,fn:s}),this.is_global_event(n)?e.on(n,s,i):this._app.on(n,s,i)}runAsync(t,...s){const i=t.toString();return this.is_global_event(i)?e.runAsync(i,...s):this._app.runAsync(i,...s)}query(t,...s){return this.runAsync(t,...s)}unmount(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this._actions.forEach((t=>{const{name:s,fn:i}=t;this.is_global_event(s)?e.off(s,i):this._app.off(s,i)}))}}E.i=!0;const M="//",C="///",x=t=>{if(e.lastUrl!==t)if(e.lastUrl=t,t||(t="#"),t.startsWith("#")){const[s,...i]=t.split("/");e.run(s,...i)||e.run(C,s,...i),e.run(M,s,...i)}else if(t.startsWith("/")){const[s,i,...n]=t.split("/");e.run("/"+i,...n)||e.run(C,"/"+i,...n),e.run(M,"/"+i,...n)}else e.run(t)||e.run(C,t),e.run(M,t)};if(!e.start){e.version="3.35.0",e.h=e.createElement=u,e.render=f,e.Fragment=h,e.webComponent=$,e.safeHTML=y,e.start=(t,s,i,e,n)=>{const o=Object.assign({render:!0,global_event:!0},n),r=new E(s,i,e);return n&&n.rendered&&(r.rendered=n.rendered),n&&n.mounted&&(r.mounted=n.mounted),r.start(t,o),r};const t=t=>{};e.on("debug",(s=>t)),e.on(M,t),e.on(C,t),e.route=x,e.on("route",(t=>e.route&&e.route(t))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{const t=document.body.hasAttribute("apprun-no-init")||e["no-init-route"]||!1,s=e.find("#")||e.find("#/")||!1;window.addEventListener("hashchange",(()=>x(location.hash))),window.addEventListener("popstate",(()=>x(location.pathname))),s?t&&x(location.hash):(t&&x(location.pathname),document.body.addEventListener("click",(t=>{const s=t.target,i="A"===s.tagName?s:s.closest("a");i&&i.origin===location.origin&&(t.preventDefault(),history.pushState(null,"",i.pathname),x(i.pathname))})))})),"object"==typeof window&&(window.Component=E,window._React=window.React,window.React=e,window.on=A,window.customElement=_,window.safeHTML=y),e.use_render=(t,s=0)=>{e.render=0===s?(s,i)=>t(i,s):(s,i)=>t(s,i)},e.use_react=(t,s)=>{e.h=e.createElement=t.createElement,e.Fragment=t.Fragment,e.render=(t,i)=>s.render(i,t),t.version&&t.version.startsWith("18")&&(e.render=(t,i)=>{t&&i&&(t._root||(t._root=s.createRoot(t)),t._root.render(i))})}}
1
+ const n="3.36.1",t=`AppRun-${n}`;class e{constructor(){this._events={}}on(n,t,e={}){this._events[n]=this._events[n]||[],this._events[n].push({fn:t,options:e})}off(n,t){const e=this._events[n]||[];this._events[n]=e.filter((n=>n.fn!==t))}find(n){return this._events[n]}run(n,...t){const e=this.getSubscribers(n,this._events);return console.assert(e&&e.length>0,"No subscriber for event: "+n),e.forEach((e=>{const{fn:l,options:o}=e;if(!l||"function"!=typeof l)return console.error(`AppRun event handler for '${n}' is not a function:`,l),!1;if(o.delay)this.delay(n,l,t,o);else try{Object.keys(o).length>0?l.apply(this,[...t,o]):l.apply(this,t)}catch(t){console.error(`Error in event handler for '${n}':`,t)}return!e.options.once})),e.length}once(n,t,e={}){this.on(n,t,Object.assign(Object.assign({},e),{once:!0}))}delay(n,t,e,l){l._t&&clearTimeout(l._t),l._t=setTimeout((()=>{clearTimeout(l._t);try{Object.keys(l).length>0?t.apply(this,[...e,l]):t.apply(this,e)}catch(t){console.error(`Error in delayed event handler for '${n}':`,t)}}),l.delay)}runAsync(n,...t){const e=this.getSubscribers(n,this._events);console.assert(e&&e.length>0,"No subscriber for event: "+n);const l=e.map((e=>{const{fn:l,options:o}=e;if(!l||"function"!=typeof l)return console.error(`AppRun async event handler for '${n}' is not a function:`,l),Promise.resolve(null);try{return Object.keys(o).length>0?l.apply(this,[...t,o]):l.apply(this,t)}catch(t){return console.error(`Error in async event handler for '${n}':`,t),Promise.reject(t)}}));return Promise.all(l)}query(n,...t){return console.warn("app.query() is deprecated. Use app.runAsync() instead."),this.runAsync(n,...t)}getSubscribers(n,t){const e=t[n]||[];return t[n]=e.filter((n=>!n.options.once)),Object.keys(t).filter((t=>t.endsWith("*")&&n.startsWith(t.replace("*","")))).sort(((n,t)=>t.length-n.length)).forEach((l=>e.push(...t[l].map((t=>Object.assign(Object.assign({},t),{options:Object.assign(Object.assign({},t.options),{event:n})})))))),e}}const l=t;let o;const i="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};i.app&&i._AppRunVersions?o=i.app:(o=new e,i.app=o,i._AppRunVersions=l);var s=o;function r(n){return(null==n?void 0:n.target)instanceof HTMLElement?n.target:null}const u=(n,t)=>(t?n.state[t]:n.state)||"",a=(n,t,e)=>{if(t){const l=n.state||{};l[t]=e,n.setState(l)}else n.setState(e)},c=(n,t)=>{if(Array.isArray(n))return n.map((n=>c(n,t)));{let{type:e,tag:l,props:o,children:i}=n;return l=l||e,i=i||(null==o?void 0:o.children),o&&Object.keys(o).forEach((n=>{n.startsWith("$")&&(((n,t,e,l)=>{if(n.startsWith("$on")){const e=t[n];if(n=n.substring(1),"boolean"==typeof e)t[n]=t=>l.run?l.run(n,t):s.run(n,t);else if("string"==typeof e)t[n]=n=>l.run?l.run(e,n):s.run(e,n);else if("function"==typeof e)t[n]=n=>l.setState(e(l.state,n));else if(Array.isArray(e)){const[o,...i]=e;"string"==typeof o?t[n]=n=>l.run?l.run(o,...i,n):s.run(o,...i,n):"function"==typeof o&&(t[n]=n=>l.setState(o(l.state,...i,n)))}}else if("$bind"===n){const o=t.type||"text",i="string"==typeof t[n]?t[n]:t.name;if("input"===e)switch(o){case"checkbox":t.checked=u(l,i),t.onclick=n=>{const t=r(n);t&&a(l,i||t.name,t.checked)};break;case"radio":t.checked=u(l,i)===t.value,t.onclick=n=>{const t=r(n);t&&a(l,i||t.name,t.value)};break;case"number":case"range":t.value=u(l,i),t.oninput=n=>{const t=r(n);t&&a(l,i||t.name,Number(t.value))};break;default:t.value=u(l,i),t.oninput=n=>{const t=r(n);t&&a(l,i||t.name,t.value)}}else"select"===e?(t.value=u(l,i),t.onchange=n=>{const t=r(n);t&&!t.multiple&&a(l,i||t.name,t.value)}):"option"===e?(t.selected=u(l,i),t.onclick=n=>{const t=r(n);t&&a(l,i||t.name,t.selected)}):"textarea"===e&&(t.innerHTML=u(l,i),t.oninput=n=>{const t=r(n);t&&a(l,i||t.name,t.value)})}else s.run("$",{key:n,tag:e,props:t,component:l})})(n,o,l,t),delete o[n])})),i&&c(i,t),n}};class h{constructor(n,t,e){this.normal=t,this.property=n,e&&(this.space=e)}}function d(n,t){const e={},l={};for(const t of n)Object.assign(e,t.property),Object.assign(l,t.normal);return new h(e,l,t)}function f(n){return n.toLowerCase()}h.prototype.normal={},h.prototype.property={},h.prototype.space=void 0;class p{constructor(n,t){this.attribute=t,this.property=n}}p.prototype.attribute="",p.prototype.booleanish=!1,p.prototype.boolean=!1,p.prototype.commaOrSpaceSeparated=!1,p.prototype.commaSeparated=!1,p.prototype.defined=!1,p.prototype.mustUseProperty=!1,p.prototype.number=!1,p.prototype.overloadedBoolean=!1,p.prototype.property="",p.prototype.spaceSeparated=!1,p.prototype.space=void 0;let g=0;const m=O(),v=O(),y=O(),b=O(),w=O(),S=O(),k=O();function O(){return 2**++g}var C=Object.freeze({__proto__:null,boolean:m,booleanish:v,commaOrSpaceSeparated:k,commaSeparated:S,number:b,overloadedBoolean:y,spaceSeparated:w});const x=Object.keys(C);class M extends p{constructor(n,t,e,l){let o=-1;if(super(n,t),P(this,"space",l),"number"==typeof e)for(;++o<x.length;){const n=x[o];P(this,x[o],(e&C[n])===C[n])}}}function P(n,t,e){e&&(n[t]=e)}function A(n){const t={},e={};for(const[l,o]of Object.entries(n.properties)){const i=new M(l,n.transform(n.attributes||{},l),o,n.space);n.mustUseProperty&&n.mustUseProperty.includes(l)&&(i.mustUseProperty=!0),t[l]=i,e[f(l)]=l,e[f(i.attribute)]=l}return new h(t,e,n.space)}M.prototype.defined=!0;const E=A({properties:{ariaActiveDescendant:null,ariaAtomic:v,ariaAutoComplete:null,ariaBusy:v,ariaChecked:v,ariaColCount:b,ariaColIndex:b,ariaColSpan:b,ariaControls:w,ariaCurrent:null,ariaDescribedBy:w,ariaDetails:null,ariaDisabled:v,ariaDropEffect:w,ariaErrorMessage:null,ariaExpanded:v,ariaFlowTo:w,ariaGrabbed:v,ariaHasPopup:null,ariaHidden:v,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:w,ariaLevel:b,ariaLive:null,ariaModal:v,ariaMultiLine:v,ariaMultiSelectable:v,ariaOrientation:null,ariaOwns:w,ariaPlaceholder:null,ariaPosInSet:b,ariaPressed:v,ariaReadOnly:v,ariaRelevant:null,ariaRequired:v,ariaRoleDescription:w,ariaRowCount:b,ariaRowIndex:b,ariaRowSpan:b,ariaSelected:v,ariaSetSize:b,ariaSort:null,ariaValueMax:b,ariaValueMin:b,ariaValueNow:b,ariaValueText:null,role:null},transform:(n,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function R(n,t){return t in n?n[t]:t}function D(n,t){return R(n,t.toLowerCase())}const $=A({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:S,acceptCharset:w,accessKey:w,action:null,allow:null,allowFullScreen:m,allowPaymentRequest:m,allowUserMedia:m,alt:null,as:null,async:m,autoCapitalize:null,autoComplete:w,autoFocus:m,autoPlay:m,blocking:w,capture:null,charSet:null,checked:m,cite:null,className:w,cols:b,colSpan:null,content:null,contentEditable:v,controls:m,controlsList:w,coords:b|S,crossOrigin:null,data:null,dateTime:null,decoding:null,default:m,defer:m,dir:null,dirName:null,disabled:m,download:y,draggable:v,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:m,formTarget:null,headers:w,height:b,hidden:y,high:b,href:null,hrefLang:null,htmlFor:w,httpEquiv:w,id:null,imageSizes:null,imageSrcSet:null,inert:m,inputMode:null,integrity:null,is:null,isMap:m,itemId:null,itemProp:w,itemRef:w,itemScope:m,itemType:w,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:m,low:b,manifest:null,max:null,maxLength:b,media:null,method:null,min:null,minLength:b,multiple:m,muted:m,name:null,nonce:null,noModule:m,noValidate:m,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:m,optimum:b,pattern:null,ping:w,placeholder:null,playsInline:m,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:m,referrerPolicy:null,rel:w,required:m,reversed:m,rows:b,rowSpan:b,sandbox:w,scope:null,scoped:m,seamless:m,selected:m,shadowRootClonable:m,shadowRootDelegatesFocus:m,shadowRootMode:null,shape:null,size:b,sizes:null,slot:null,span:b,spellCheck:v,src:null,srcDoc:null,srcLang:null,srcSet:null,start:b,step:null,style:null,tabIndex:b,target:null,title:null,translate:null,type:null,typeMustMatch:m,useMap:null,value:v,width:b,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:w,axis:null,background:null,bgColor:null,border:b,borderColor:null,bottomMargin:b,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:m,declare:m,event:null,face:null,frame:null,frameBorder:null,hSpace:b,leftMargin:b,link:null,longDesc:null,lowSrc:null,marginHeight:b,marginWidth:b,noResize:m,noHref:m,noShade:m,noWrap:m,object:null,profile:null,prompt:null,rev:null,rightMargin:b,rules:null,scheme:null,scrolling:v,standby:null,summary:null,text:null,topMargin:b,valueType:null,version:null,vAlign:null,vLink:null,vSpace:b,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:m,disableRemotePlayback:m,prefix:null,property:null,results:b,security:null,unselectable:null},space:"html",transform:D}),L=A({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:k,accentHeight:b,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:b,amplitude:b,arabicForm:null,ascent:b,attributeName:null,attributeType:null,azimuth:b,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:b,by:null,calcMode:null,capHeight:b,className:w,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:b,diffuseConstant:b,direction:null,display:null,dur:null,divisor:b,dominantBaseline:null,download:m,dx:null,dy:null,edgeMode:null,editable:null,elevation:b,enableBackground:null,end:null,event:null,exponent:b,externalResourcesRequired:null,fill:null,fillOpacity:b,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:S,g2:S,glyphName:S,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:b,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:b,horizOriginX:b,horizOriginY:b,id:null,ideographic:b,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:b,k:b,k1:b,k2:b,k3:b,k4:b,kernelMatrix:k,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:b,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:b,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:b,overlineThickness:b,paintOrder:null,panose1:null,path:null,pathLength:b,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:w,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:b,pointsAtY:b,pointsAtZ:b,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:k,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:k,rev:k,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:k,requiredFeatures:k,requiredFonts:k,requiredFormats:k,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:b,specularExponent:b,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:b,strikethroughThickness:b,string:null,stroke:null,strokeDashArray:k,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:b,strokeOpacity:b,strokeWidth:null,style:null,surfaceScale:b,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:k,tabIndex:b,tableValues:null,target:null,targetX:b,targetY:b,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:k,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:b,underlineThickness:b,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:b,values:null,vAlphabetic:b,vMathematical:b,vectorEffect:null,vHanging:b,vIdeographic:b,version:null,vertAdvY:b,vertOriginX:b,vertOriginY:b,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:b,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:R}),T=A({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(n,t)=>"xlink:"+t.slice(5).toLowerCase()}),j=A({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:D}),_=A({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(n,t)=>"xml:"+t.slice(3).toLowerCase()}),U=/[A-Z]/g,z=/-[a-z]/g,I=/^data[-\w.:]+$/i;function B(n){return"-"+n.toLowerCase()}function H(n){return n.charAt(1).toUpperCase()}const N=d([E,$,T,j,_],"html"),F=d([E,L,T,j,_],"svg"),V="_props",q=new Map;function W(n,t){const e=`${n}:${t}`;let l=q.get(e);return void 0===l&&(l=function(n,t){const e=f(t);let l=t,o=p;if(e in n.normal)return n.property[n.normal[e]];if(e.length>4&&"data"===e.slice(0,4)&&I.test(t)){if("-"===t.charAt(4)){const n=t.slice(5).replace(z,H);l="data"+n.charAt(0).toUpperCase()+n.slice(1)}else{const n=t.slice(4);if(!z.test(n)){let e=n.replace(U,B);"-"!==e.charAt(0)&&(e="-"+e),t="data"+e}}o=M}return new o(l,t)}(t?F:N,n)||null,q.set(e,l)),l}function K(n,t,e){!function(n){if(null==n||!1===n||""===n)return!1;if(!0===n)return!0;if("string"==typeof n){return"false"!==n.toLowerCase()&&"0"!==n}return Boolean(n)}(e)?n.removeAttribute(t):n.setAttribute(t,t)}function X(n,t,e){try{n[t]=e}catch(l){Y(n,t,e,!1)}}function Y(n,t,e,l){if(null==e)return void n.removeAttribute(t);const o=String(e);if(l&&t.includes(":")){const[e]=t.split(":");"xlink"===e?n.setAttributeNS("http://www.w3.org/1999/xlink",t,o):n.setAttribute(t,o)}else n.setAttribute(t,o)}function Z(n,t,e,l){if(function(n,t){if(document.activeElement===n)return["value","selectionStart","selectionEnd","selectionDirection"].includes(t);if("scrollTop"===t||"scrollLeft"===t)return!0;if(n instanceof HTMLMediaElement&&["currentTime","paused","playbackRate","volume"].includes(t))return!0;return!1}(n,t))return;if("style"===t){if(n.style.cssText&&(n.style.cssText=""),"string"==typeof e)n.style.cssText=e;else if(e&&"object"==typeof e)for(const t in e)n.style[t]!==e[t]&&(n.style[t]=e[t]);return}if("key"===t)return void(null!=e&&(n.key=e));if(t.startsWith("data-"))return void function(n,t,e){const l=(o=t.slice(5)).length<=1?o.toLowerCase():o.split("-").map(((n,t)=>0===t?n.toLowerCase():n.charAt(0).toUpperCase()+n.slice(1).toLowerCase())).join("");var o;null==e?delete n.dataset[l]:n.dataset[l]=String(e)}(n,t,e);if(t.startsWith("on"))return void function(n,t,e){t.startsWith("on")&&(e&&"function"!=typeof e?"string"==typeof e&&(e?n.setAttribute(t,e):n.removeAttribute(t)):n[t]=e)}(n,t,e);if(!("INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&"SELECT"!==n.tagName||"value"!==t&&"selected"!==t&&"selectedIndex"!==t))return void X(n,t,e);if("INPUT"===n.tagName&&"checked"===t)return X(n,t,e),void K(n,t,e);const o=W(t,l);o?o.boolean||o.overloadedBoolean?K(n,o.attribute,e):o.mustUseProperty&&!l?X(n,o.property,e):Y(n,o.attribute,e,l):t.startsWith("aria-")||"role"===t?Y(n,t,e,l):t in n||void 0!==n[t]?X(n,t,e):Y(n,t,e,l)}function J(n){return/^[a-zA-Z_:][\w\-:.]*$/.test(n)&&!n.includes("<")&&!n.includes(">")&&!n.includes('"')&&!n.includes("'")}function G(n,t,e){const l=function(n,t){if(t&&(t.class=t.class||t.className,delete t.className),!n||0===Object.keys(n).length)return t||{};if(!t||0===Object.keys(t).length){const t={};return Object.keys(n).forEach((n=>t[n]=null)),t}const e={};return Object.keys(n).forEach((n=>{n in t||(e[n]=null)})),Object.keys(t).forEach((n=>e[n]=t[n])),e}(n[V]||{},t);n[V]=t||{},function(n,t,e,l){for(const e in t)J(e)&&Z(n,e,t[e],l);t&&"function"==typeof t.ref&&window.requestAnimationFrame((()=>t.ref(n)))}(n,l,0,e)}function Q(n,...t){return nn(t)}function nn(n){const t=[],e=n=>{null!=n&&""!==n&&!1!==n&&t.push("function"==typeof n||"object"==typeof n?n:`${n}`)};return n&&n.forEach((n=>{Array.isArray(n)?n.forEach((n=>e(n))):e(n)})),t}const tn={};let en=0;function ln(n,t,...e){const l=nn(e);if("string"==typeof n)return{tag:n,props:t,children:l};if(Array.isArray(n))return n;if(void 0===n&&e)return l;if(Object.getPrototypeOf(n).i)return{tag:n,props:t,children:l};if("function"==typeof n)return n(t,l);throw new Error(`Unknown tag in vdom ${n}`)}const on=(n,t,e={})=>{if(null==t||!1===t)return;!function(n,t,e={}){if(null==t||!1===t)return;if(t=hn(t,e),!n)return;const l="SVG"===n.nodeName;Array.isArray(t)?rn(n,t,l):rn(n,[t],l)}("string"==typeof n&&n?document.getElementById(n)||document.querySelector(n):n,t=c(t,e),e)};function sn(n,t,e){e=e||"svg"===t.tag,function(n,t){const e=n.nodeName,l=`${t.tag||""}`;return e.toUpperCase()===l.toUpperCase()}(n,t)?(rn(n,t.children,e),G(n,t.props,e)):n.parentNode.replaceChild(cn(t,e),n)}function rn(n,t,e){var l,o;const i=(null===(l=n.childNodes)||void 0===l?void 0:l.length)||0,s=(null==t?void 0:t.length)||0,r=Math.min(i,s);for(let l=0;l<r;l++){const o=t[l],i=n.childNodes[l];if("string"==typeof o)i.textContent!==o&&(3===i.nodeType?i.nodeValue=o:n.replaceChild(an(o),i));else if(o instanceof HTMLElement||o instanceof SVGElement)n.insertBefore(o,i);else{const t=o.props&&o.props.key;if(t)if(i.key===t)sn(n.childNodes[l],o,e);else{const s=tn[t];s?(n.insertBefore(s,i),sn(n.childNodes[l],o,e)):n.replaceChild(cn(o,e),i)}else sn(n.childNodes[l],o,e)}}let u=(null===(o=n.childNodes)||void 0===o?void 0:o.length)||0;for(;u>r;)n.removeChild(n.lastChild),u--;if(s>r){const l=document.createDocumentFragment();for(let n=r;n<t.length;n++)l.appendChild(cn(t[n],e));n.appendChild(l)}}const un=n=>{const t=document.createElement("section");return t.insertAdjacentHTML("afterbegin",n),Array.from(t.children)};function an(n){if(0===(null==n?void 0:n.indexOf("_html:"))){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",n.substring(6)),t}return document.createTextNode(null!=n?n:"")}function cn(n,t){if(n instanceof HTMLElement||n instanceof SVGElement)return n;if("string"==typeof n)return an(n);if(!n.tag||"function"==typeof n.tag)return an(JSON.stringify(n));const e=(t=t||"svg"===n.tag)?document.createElementNS("http://www.w3.org/2000/svg",n.tag):document.createElement(n.tag);return G(e,n.props,t),n.children&&n.children.forEach((n=>e.appendChild(cn(n,t)))),n.props&&void 0!==n.props.key&&(e.key=n.props.key,tn[n.props.key]=e,++en>=500&&(!function(){if(!(Object.keys(tn).length<=1e3))for(const[n,t]of Object.entries(tn))t.isConnected||delete tn[n]}(),en=0)),e}function hn(n,t,e=0){var l;if("string"==typeof n)return n;if(Array.isArray(n))return n.map((n=>hn(n,t,e++)));let o=n;if(n&&"function"==typeof n.tag&&Object.getPrototypeOf(n.tag).i&&(o=function(n,t,e){const{tag:l,props:o,children:i}=n;let s=`_${e}`,r=o&&o.id;r?s=r:r=`_${e}${Date.now()}`;let u="section";o&&o.as&&(u=o.as,delete o.as),t.m||(t.m={});let a=t.m[s];if(a&&a instanceof l&&a.element)a.renderState(a.state);else{const n=document.createElement(u);a=t.m[s]=new l(Object.assign(Object.assign({},o),{children:i})).mount(n,{render:!0})}if(a.mounted){const n=a.mounted(o,i,a.state);void 0!==n&&a.setState(n)}return G(a.element,o,!1),a.element}(n,t,e)),o&&Array.isArray(o.children)){const n=null===(l=o.props)||void 0===l?void 0:l._component;if(n){let t=0;o.children=o.children.map((e=>hn(e,n,t++)))}else o.children=o.children.map((n=>hn(n,t,e++)))}return o}const dn=(n,t={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(t.observedAttributes||[]).map((n=>n.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const e=t||{};this._shadowRoot=e.shadow?this.attachShadow({mode:"open"}):this;const l=e.observedAttributes||[],o=l.reduce(((n,t)=>{const e=t.toLowerCase();return e!==t&&(n[e]=t),n}),{});this._attrMap=n=>o[n]||n;const i={};Array.from(this.attributes).forEach((n=>i[this._attrMap(n.name)]=n.value)),l.forEach((n=>{void 0!==this[n]&&(i[n]=this[n]),Object.defineProperty(this,n,{get:()=>i[n],set(t){this.attributeChangedCallback(n,i[n],t)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const t=this.children?Array.from(this.children):[];if(this._component=new n(Object.assign(Object.assign({},i),{children:t})).mount(this._shadowRoot,e),this._component._props=i,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const n=this._component.mounted(i,t,this._component.state);void 0!==n&&(this._component.state=n)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component),!1!==e.render&&this._component.run(".")}))}}disconnectedCallback(){var n,t,e,l;null===(t=null===(n=this._component)||void 0===n?void 0:n.unload)||void 0===t||t.call(n),null===(l=null===(e=this._component)||void 0===e?void 0:e.unmount)||void 0===l||l.call(e),this._component=null}attributeChangedCallback(n,e,l){if(this._component){const o=this._attrMap(n);this._component._props[o]=l,this._component.run("attributeChanged",o,e,l),l!==e&&!1!==t.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}};var fn=(n,t,e)=>{"undefined"!=typeof customElements&&customElements.define(n,dn(t,e))};const pn={meta:new WeakMap,defineMetadata(n,t,e){this.meta.has(e)||this.meta.set(e,{}),this.meta.get(e)[n]=t},getMetadataKeys(n){return n=Object.getPrototypeOf(n),this.meta.get(n)?Object.keys(this.meta.get(n)):[]},getMetadata(n,t){return t=Object.getPrototypeOf(t),this.meta.get(t)?this.meta.get(t)[n]:null}};function gn(n,t={}){return(e,l,o)=>{const i=n?n.toString():l;return pn.defineMetadata(`apprun-update:${i}`,{name:i,key:l,options:t},e),o}}function mn(n,t={}){return function(e,l){const o=n?n.toString():l;pn.defineMetadata(`apprun-update:${o}`,{name:o,key:l,options:t},e)}}function vn(n,t){return function(e){return fn(n,e,t),e}}const yn=new Map;s.find("get-components")||s.on("get-components",(n=>n.components=yn));const bn=n=>n;class wn{renderState(n,t=null){if(!this.view)return;let e=t||this.view(n);if(s.debug&&s.run("debug",{component:this,_:e?".":"-",state:n,vdom:e,el:this.element}),"object"!=typeof document)return;const l="string"==typeof this.element&&this.element?function(n){try{return document.getElementById(n)}catch(t){return console.warn(`Error getting element by id: ${n}`,t),null}}(this.element)||function(n,t=document){try{return t.querySelector(n)}catch(t){return console.warn(`Invalid selector: ${n}`,t),null}}(this.element):this.element;if(!l)return void console.warn(`Component element not found: ${this.element}`);const o="_c";this.unload?l._component===this&&l.getAttribute(o)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),l.setAttribute(o,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((n=>{n[0].oldValue!==this.tracking_id&&document.body.contains(l)||(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]}))):l.removeAttribute&&l.removeAttribute(o),l._component=this,!t&&e&&(e=c(e,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>s.render(l,e,this))):s.render(l,e,this)),this.rendered&&this.rendered(this.state)}setState(n,t={render:!0,history:!1}){const e=async n=>{try{for(;;){const{value:e,done:l}=await n.next();if(l)break;this.setState(e,t)}}catch(n){console.error("Error in async iterator:",n)}},l=n;if(null==l?void 0:l[Symbol.asyncIterator])this.setState(e(l[Symbol.asyncIterator]()),t);else if((null==l?void 0:l[Symbol.iterator])&&"function"==typeof l.next)for(const n of l)this.setState(n,t);else if(n&&n instanceof Promise)Promise.resolve(n).then((e=>{this.setState(e,t),this._state=n}));else{if(this._state=n,null==n)return;this.state=n,!1!==t.render&&(t.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(n))):this.renderState(n)),!1!==t.history&&this.enable_history&&(this._history=[...this._history,n],this._history_idx=this._history.length-1),"function"==typeof t.callback&&t.callback(this.state)}}constructor(n,t,l,o){this.state=n,this.view=t,this.update=l,this.options=o,this._app=new e,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=(n=null,t)=>{if(this.mount(n,Object.assign({render:!0},t)),this.mounted&&"function"==typeof this.mounted){const n=this.mounted({},[],this.state);void 0!==n&&this.setState(n)}return this}}mount(n=null,t){var e,l;return console.assert(!this.element,"Component already mounted."),this.options=t=Object.assign(Object.assign({},this.options),t),this.element=n,this.global_event=t.global_event,this.enable_history=!!t.history,this.enable_history&&(this.on(t.history.prev||"history-prev",this._history_prev),this.on(t.history.next||"history-next",this._history_next)),t.route&&(this.update=this.update||{},this.update[t.route]||(this.update[t.route]=bn)),this.add_actions(),this.state=null!==(l=null!==(e=this.state)&&void 0!==e?e:this.model)&&void 0!==l?l:{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!t.render,history:!0}),s.debug&&(yn.get(n)?yn.get(n).push(this):yn.set(n,[this])),this}is_global_event(n){return n&&(this.global_event||this._global_events.indexOf(n)>=0||n.startsWith("#")||n.startsWith("/")||n.startsWith("@"))}add_action(n,t,e={}){t&&"function"==typeof t?(e.global&&this._global_events.push(n),this.on(n,((...l)=>{s.debug&&s.run("debug",{component:this,_:">",event:n,p:l,current_state:this.state,options:e});try{const o=t(this.state,...l);s.debug&&s.run("debug",{component:this,_:"<",event:n,p:l,newState:o,state:this.state,options:e}),this.setState(o,e)}catch(t){console.error(`Error in component action '${n}':`,t),s.debug&&s.run("debug",{component:this,_:"!",event:n,p:l,error:t,state:this.state,options:e})}}),e)):console.warn(`Component action for '${n}' is not a valid function:`,t)}add_actions(){const n=this.update||{};pn.getMetadataKeys(this).forEach((t=>{if(t.startsWith("apprun-update:")){const e=pn.getMetadata(t,this);n[e.name]=[this[e.key].bind(this),e.options]}}));const t={};Array.isArray(n)?n.forEach((n=>{const[e,l,o]=n;e.toString().split(",").forEach((n=>t[n.trim()]=[l,o]))})):Object.keys(n).forEach((e=>{const l=n[e];("function"==typeof l||Array.isArray(l))&&e.split(",").forEach((n=>t[n.trim()]=l))})),t["."]||(t["."]=bn),Object.keys(t).forEach((n=>{const e=t[n];"function"==typeof e?this.add_action(n,e):Array.isArray(e)&&this.add_action(n,e[0],e[1])}))}run(n,...t){if(this.state instanceof Promise)return Promise.resolve(this.state).then((e=>{this.state=e,this.run(n,...t)}));{const e=n.toString();return this.is_global_event(e)?s.run(e,...t):this._app.run(e,...t)}}on(n,t,e){const l=n.toString();return this._actions.push({name:l,fn:t}),this.is_global_event(l)?s.on(l,t,e):this._app.on(l,t,e)}runAsync(n,...t){const e=n.toString();return this.is_global_event(e)?s.runAsync(e,...t):this._app.runAsync(e,...t)}query(n,...t){return console.warn("component.query() is deprecated. Use component.runAsync() instead."),this.runAsync(n,...t)}unmount(){var n;null===(n=this.observer)||void 0===n||n.disconnect(),this._actions.forEach((n=>{const{name:t,fn:e}=n;this.is_global_event(t)?s.off(t,e):this._app.off(t,e)}))}}function Sn(){const n=s.find("#");if(n&&n.length>0)return s.run("#"),void s.run(Cn,"#");const t=s.find("/");if(t&&t.length>0)return s.run("/"),void s.run(Cn,"/");const e=s.find("#/");if(e&&e.length>0)return s.run("#/"),void s.run(Cn,"#/");console.warn("No subscribers for event: "),s.run(xn,""),s.run(Cn,"")}function kn(n){if(!n)return void Sn();n=function(n){return n&&"/"!==n&&"#"!==n&&"#/"!==n&&n.endsWith("/")?n.slice(0,-1):n}(n);const t=s.basePath;t&&(n=function(n,t){if(!t||"/"===t||""===t)return n;const e=t.startsWith("/")?t:"/"+t;if(n.startsWith(e)){const t=n.substring(e.length);return t.startsWith("/")?t:"/"+t}return n}(n,t));const e=function(n){return n?n.startsWith("#/")?n.substring(2).split("/"):n.startsWith("#")||n.startsWith("/")?n.substring(1).split("/"):n.split("/"):[]}(n);let l;!function(n){const t=n.filter(Boolean);t.length>11&&console.warn(`Deep route hierarchy detected: ${t.join("/")} (${t.length} levels)`)}(e),l=n.startsWith("#/")?"hash-slash":n.startsWith("#")?"hash":n.startsWith("/")?"path":"non-prefixed";const o=function(n,t){const e=[];for(let l=n.length;l>0;l--){const o=n.slice(0,l);let i="";switch(t){case"path":i="/"+o.join("/");break;case"hash":i="#"+o.join("/");break;case"hash-slash":i="#/"+o.join("/");break;case"non-prefixed":i=o.join("/")}e.push(i)}return e}(e,l),i=function(n,t){for(let e=0;e<n.length;e++){const l=n[e],o=s.find(l);if(o&&o.length>0){const o=n.length-e;return{eventName:l,parameters:t.slice(o)}}}return null}(o,e);if(i)On(i.eventName,...i.parameters);else if(o.length>0){const t=o[o.length-1];console.warn(`No subscribers for event: ${t}`),s.run(xn,n),s.run(Cn,n)}else Sn()}wn.i=!0;const On=(n,...t)=>{if(!n||n===Cn||n===xn)return;const e=s.find(n);e&&0!==e.length?s.run(n,...t):(console.warn(`No subscribers for event: ${n}`),s.run(xn,n,...t)),s.run(Cn,n,...t)},Cn="//",xn="///",Mn=n=>{s.lastUrl!==n&&(s.lastUrl=n,kn(n))};if(!s.start){s.version=n,s.h=s.createElement=ln,s.render=on,s.Fragment=Q,s.webComponent=fn,s.safeHTML=un,s.start=(n,t,e,l,o)=>{const i=Object.assign({render:!0,global_event:!0},o),s=new wn(t,e,l);return o&&o.rendered&&(s.rendered=o.rendered),o&&o.mounted&&(s.mounted=o.mounted),s.start(n,i),s},s.once=s.once||((n,t,e={})=>{s.on(n,t,Object.assign(Object.assign({},e),{once:!0}))}),s.query=s.query||s.runAsync;const t=n=>{};if(s.on("/",t),s.on("debug",(n=>t)),s.on(Cn,t),s.on(xn,t),s.route=Mn,s.on("route",(n=>s.route&&s.route(n))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{const n=document.body.hasAttribute("apprun-no-init")||s["no-init-route"]||!1,t=s.find("#")||s.find("#/")||!1;window.addEventListener("hashchange",(()=>Mn(location.hash))),window.addEventListener("popstate",(()=>Mn(location.pathname))),t?!n&&Mn(location.hash):(!n&&(()=>{const n=s.basePath||"";let t=location.pathname;n&&t.startsWith(n)&&(t=t.substring(n.length),t.startsWith("/")||(t="/"+t)),Mn(t)})(),document.body.addEventListener("click",(n=>{const t=n.target;if(!t)return;const e="A"===t.tagName?t:t.closest("a");if(e&&e.origin===location.origin&&e.pathname){n.preventDefault();const t=(s.basePath||"")+e.pathname;history.pushState(null,"",t),Mn(e.pathname)}})))})),"object"==typeof window){const n=window;n.Component=wn,n._React=n.React,n.React=s,n.on=mn,n.customElement=vn,n.safeHTML=un}s.use_render=(n,t=0)=>{s.render=0===t?(t,e)=>n(e,t):(t,e)=>n(t,e)},s.use_react=(n,t)=>{if(n&&t)if("function"==typeof n.createElement)if(n.Fragment)if(s.h=s.createElement=n.createElement,s.Fragment=n.Fragment,n.version&&n.version.startsWith("18")){if(!t.createRoot||"function"!=typeof t.createRoot)return void console.error("AppRun use_react: ReactDOM.createRoot not found in React 18+");s.render=(n,e)=>{n&&void 0!==e&&(n._root||(n._root=t.createRoot(n)),n._root.render(e))}}else{if(!t.render||"function"!=typeof t.render)return void console.error("AppRun use_react: ReactDOM.render not found in legacy React");s.render=(n,e)=>t.render(e,n)}else console.error("AppRun use_react: Invalid React object - Fragment not found");else console.error("AppRun use_react: Invalid React object - createElement method not found");else console.error("AppRun use_react: React and ReactDOM parameters are required")}}
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const T=globalThis,P=T.ShadowRoot&&(void 0===T.ShadyCSS||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,U=Symbol(),N=new WeakMap;let L=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==U)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o;const s=this.t;if(P&&void 0===t){const i=void 0!==s&&1===s.length;i&&(t=N.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&N.set(s,t))}return t}toString(){return this.cssText}};const R=P?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let s="";for(const i of t.cssRules)s+=i.cssText;return(t=>new L("string"==typeof t?t:t+"",void 0,U))(s)})(t):t
6
+ */const Pn=globalThis,An=Pn.ShadowRoot&&(void 0===Pn.ShadyCSS||Pn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,En=Symbol(),Rn=new WeakMap;let Dn=class{constructor(n,t,e){if(this._$cssResult$=!0,e!==En)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=t}get styleSheet(){let n=this.o;const t=this.t;if(An&&void 0===n){const e=void 0!==t&&1===t.length;e&&(n=Rn.get(t)),void 0===n&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),e&&Rn.set(t,n))}return n}toString(){return this.cssText}};const $n=An?n=>n:n=>n instanceof CSSStyleSheet?(n=>{let t="";for(const e of n.cssRules)t+=e.cssText;return(n=>new Dn("string"==typeof n?n:n+"",void 0,En))(t)})(n):n
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */,{is:D,defineProperty:z,getOwnPropertyDescriptor:H,getOwnPropertyNames:I,getOwnPropertySymbols:W,getPrototypeOf:q}=Object,V=globalThis,G=V.trustedTypes,J=G?G.emptyScript:"",B=V.reactiveElementPolyfillSupport,F=(t,s)=>t,K={toAttribute(t,s){switch(s){case Boolean:t=t?J:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},Z=(t,s)=>!D(t,s),Q={attribute:!0,type:String,converter:K,reflect:!1,useDefault:!1,hasChanged:Z};Symbol.metadata??=Symbol("metadata"),V.litPropertyMetadata??=new WeakMap;let X=class 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,s=Q){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),e=this.getPropertyDescriptor(t,i,s);void 0!==e&&z(this.prototype,t,e)}}static getPropertyDescriptor(t,s,i){const{get:e,set:n}=H(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const o=e?.call(this);n?.call(this,s),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Q}static _$Ei(){if(this.hasOwnProperty(F("elementProperties")))return;const t=q(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(F("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(F("properties"))){const t=this.properties,s=[...I(t),...W(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)s.unshift(R(t))}else void 0!==t&&s.push(R(t));return s}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:"string"==typeof i?i:"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,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,s)=>{if(P)t.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of s){const s=document.createElement("style"),e=T.litNonce;void 0!==e&&s.setAttribute("nonce",e),s.textContent=i.cssText,t.appendChild(s)}})(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,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const n=(void 0!==i.converter?.toAttribute?i.converter:K).toAttribute(s,i.type);this._$Em=t,null==n?this.removeAttribute(e):this.setAttribute(e,n),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:K;this._$Em=e,this[e]=n.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,n=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??Z)(n,s)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:n},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??s??this[t]),!0!==n||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&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,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}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){}};X.elementStyles=[],X.shadowRootOptions={mode:"open"},X[F("elementProperties")]=new Map,X[F("finalized")]=new Map,B?.({ReactiveElement:X}),(V.reactiveElementVersions??=[]).push("2.1.0");
11
+ */,{is:Ln,defineProperty:Tn,getOwnPropertyDescriptor:jn,getOwnPropertyNames:_n,getOwnPropertySymbols:Un,getPrototypeOf:zn}=Object,In=globalThis,Bn=In.trustedTypes,Hn=Bn?Bn.emptyScript:"",Nn=In.reactiveElementPolyfillSupport,Fn=(n,t)=>n,Vn={toAttribute(n,t){switch(t){case Boolean:n=n?Hn:null;break;case Object:case Array:n=null==n?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=null!==n;break;case Number:e=null===n?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch(n){e=null}}return e}},qn=(n,t)=>!Ln(n,t),Wn={attribute:!0,type:String,converter:Vn,reflect:!1,useDefault:!1,hasChanged:qn};Symbol.metadata??=Symbol("metadata"),In.litPropertyMetadata??=new WeakMap;let Kn=class extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,t=Wn){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(n,t),!t.noAccessor){const e=Symbol(),l=this.getPropertyDescriptor(n,e,t);void 0!==l&&Tn(this.prototype,n,l)}}static getPropertyDescriptor(n,t,e){const{get:l,set:o}=jn(this.prototype,n)??{get(){return this[t]},set(n){this[t]=n}};return{get:l,set(t){const i=l?.call(this);o?.call(this,t),this.requestUpdate(n,i,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??Wn}static _$Ei(){if(this.hasOwnProperty(Fn("elementProperties")))return;const n=zn(this);n.finalize(),void 0!==n.l&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(Fn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fn("properties"))){const n=this.properties,t=[..._n(n),...Un(n)];for(const e of t)this.createProperty(e,n[e])}const n=this[Symbol.metadata];if(null!==n){const t=litPropertyMetadata.get(n);if(void 0!==t)for(const[n,e]of t)this.elementProperties.set(n,e)}this._$Eh=new Map;for(const[n,t]of this.elementProperties){const e=this._$Eu(n,t);void 0!==e&&this._$Eh.set(e,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){const t=[];if(Array.isArray(n)){const e=new Set(n.flat(1/0).reverse());for(const n of e)t.unshift($n(n))}else void 0!==n&&t.push($n(n));return t}static _$Eu(n,t){const e=t.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof n?n.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((n=>this.enableUpdating=n)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((n=>n(this)))}addController(n){(this._$EO??=new Set).add(n),void 0!==this.renderRoot&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){const n=new Map,t=this.constructor.elementProperties;for(const e of t.keys())this.hasOwnProperty(e)&&(n.set(e,this[e]),delete this[e]);n.size>0&&(this._$Ep=n)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,t)=>{if(An)n.adoptedStyleSheets=t.map((n=>n instanceof CSSStyleSheet?n:n.styleSheet));else for(const e of t){const t=document.createElement("style"),l=Pn.litNonce;void 0!==l&&t.setAttribute("nonce",l),t.textContent=e.cssText,n.appendChild(t)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((n=>n.hostConnected?.()))}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach((n=>n.hostDisconnected?.()))}attributeChangedCallback(n,t,e){this._$AK(n,e)}_$ET(n,t){const e=this.constructor.elementProperties.get(n),l=this.constructor._$Eu(n,e);if(void 0!==l&&!0===e.reflect){const o=(void 0!==e.converter?.toAttribute?e.converter:Vn).toAttribute(t,e.type);this._$Em=n,null==o?this.removeAttribute(l):this.setAttribute(l,o),this._$Em=null}}_$AK(n,t){const e=this.constructor,l=e._$Eh.get(n);if(void 0!==l&&this._$Em!==l){const n=e.getPropertyOptions(l),o="function"==typeof n.converter?{fromAttribute:n.converter}:void 0!==n.converter?.fromAttribute?n.converter:Vn;this._$Em=l,this[l]=o.fromAttribute(t,n.type)??this._$Ej?.get(l)??null,this._$Em=null}}requestUpdate(n,t,e){if(void 0!==n){const l=this.constructor,o=this[n];if(e??=l.getPropertyOptions(n),!((e.hasChanged??qn)(o,t)||e.useDefault&&e.reflect&&o===this._$Ej?.get(n)&&!this.hasAttribute(l._$Eu(n,e))))return;this.C(n,t,e)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(n,t,{useDefault:e,reflect:l,wrapped:o},i){e&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,i??t??this[n]),!0!==o||void 0!==i)||(this._$AL.has(n)||(this.hasUpdated||e||(t=void 0),this._$AL.set(n,t)),!0===l&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const n=this.scheduleUpdate();return null!=n&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[n,t]of this._$Ep)this[n]=t;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[t,e]of n){const{wrapped:n}=e,l=this[t];!0!==n||this._$AL.has(t)||void 0===l||this.C(t,void 0,e,l)}}let n=!1;const t=this._$AL;try{n=this.shouldUpdate(t),n?(this.willUpdate(t),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw n=!1,this._$EM(),t}n&&this._$AE(t)}willUpdate(n){}_$AE(n){this._$EO?.forEach((n=>n.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach((n=>this._$ET(n,this[n]))),this._$EM()}updated(n){}firstUpdated(n){}};Kn.elementStyles=[],Kn.shadowRootOptions={mode:"open"},Kn[Fn("elementProperties")]=new Map,Kn[Fn("finalized")]=new Map,Nn?.({ReactiveElement:Kn}),(In.reactiveElementVersions??=[]).push("2.1.0");
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const Y=globalThis,tt=Y.trustedTypes,st=tt?tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,it="$lit$",et=`lit$${Math.random().toFixed(9).slice(2)}$`,nt="?"+et,ot=`<${nt}>`,rt=document,ht=()=>rt.createComment(""),ct=t=>null===t||"object"!=typeof t&&"function"!=typeof t,lt=Array.isArray,ut="[ \t\n\f\r]",at=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ft=/-->/g,dt=/>/g,pt=RegExp(`>|${ut}(?:([^\\s"'>=/]+)(${ut}*=${ut}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),yt=/'/g,vt=/"/g,bt=/^(?:script|style|textarea|title)$/i,wt=t=>(s,...i)=>({_$litType$:t,strings:s,values:i}),mt=wt(1),gt=wt(2),$t=Symbol.for("lit-noChange"),St=Symbol.for("lit-nothing"),Ot=new WeakMap,At=rt.createTreeWalker(rt,129);function _t(t,s){if(!lt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==st?st.createHTML(s):s}const jt=(t,s)=>{const i=t.length-1,e=[];let n,o=2===s?"<svg>":3===s?"<math>":"",r=at;for(let s=0;s<i;s++){const i=t[s];let h,c,l=-1,u=0;for(;u<i.length&&(r.lastIndex=u,c=r.exec(i),null!==c);)u=r.lastIndex,r===at?"!--"===c[1]?r=ft:void 0!==c[1]?r=dt:void 0!==c[2]?(bt.test(c[2])&&(n=RegExp("</"+c[2],"g")),r=pt):void 0!==c[3]&&(r=pt):r===pt?">"===c[0]?(r=n??at,l=-1):void 0===c[1]?l=-2:(l=r.lastIndex-c[2].length,h=c[1],r=void 0===c[3]?pt:'"'===c[3]?vt:yt):r===vt||r===yt?r=pt:r===ft||r===dt?r=at:(r=pt,n=void 0);const a=r===pt&&t[s+1].startsWith("/>")?" ":"";o+=r===at?i+ot:l>=0?(e.push(h),i.slice(0,l)+it+i.slice(l)+et+a):i+et+(-2===l?s:a)}return[_t(t,o+(t[i]||"<?>")+(2===s?"</svg>":3===s?"</math>":"")),e]};class kt{constructor({strings:t,_$litType$:s},i){let e;this.parts=[];let n=0,o=0;const r=t.length-1,h=this.parts,[c,l]=jt(t,s);if(this.el=kt.createElement(c,i),At.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(e=At.nextNode())&&h.length<r;){if(1===e.nodeType){if(e.hasAttributes())for(const t of e.getAttributeNames())if(t.endsWith(it)){const s=l[o++],i=e.getAttribute(t).split(et),r=/([.?@])?(.*)/.exec(s);h.push({type:1,index:n,name:r[2],strings:i,ctor:"."===r[1]?Tt:"?"===r[1]?Pt:"@"===r[1]?Ut:xt}),e.removeAttribute(t)}else t.startsWith(et)&&(h.push({type:6,index:n}),e.removeAttribute(t));if(bt.test(e.tagName)){const t=e.textContent.split(et),s=t.length-1;if(s>0){e.textContent=tt?tt.emptyScript:"";for(let i=0;i<s;i++)e.append(t[i],ht()),At.nextNode(),h.push({type:2,index:++n});e.append(t[s],ht())}}}else if(8===e.nodeType)if(e.data===nt)h.push({type:2,index:n});else{let t=-1;for(;-1!==(t=e.data.indexOf(et,t+1));)h.push({type:7,index:n}),t+=et.length-1}n++}}static createElement(t,s){const i=rt.createElement("template");return i.innerHTML=t,i}}function Et(t,s,i=t,e){if(s===$t)return s;let n=void 0!==e?i._$Co?.[e]:i._$Cl;const o=ct(s)?void 0:s._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,i,e)),void 0!==e?(i._$Co??=[])[e]=n:i._$Cl=n),void 0!==n&&(s=Et(t,n._$AS(t,s.values),n,e)),s}class Mt{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:s},parts:i}=this._$AD,e=(t?.creationScope??rt).importNode(s,!0);At.currentNode=e;let n=At.nextNode(),o=0,r=0,h=i[0];for(;void 0!==h;){if(o===h.index){let s;2===h.type?s=new Ct(n,n.nextSibling,this,t):1===h.type?s=new h.ctor(n,h.name,h.strings,this,t):6===h.type&&(s=new Nt(n,this,t)),this._$AV.push(s),h=i[++r]}o!==h?.index&&(n=At.nextNode(),o++)}return At.currentNode=rt,e}p(t){let s=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,s),s+=i.strings.length-2):i._$AI(t[s])),s++}}class Ct{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,i,e){this.type=2,this._$AH=St,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const s=this._$AM;return void 0!==s&&11===t?.nodeType&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=Et(this,t,s),ct(t)?t===St||null==t||""===t?(this._$AH!==St&&this._$AR(),this._$AH=St):t!==this._$AH&&t!==$t&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>lt(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!==St&&ct(this._$AH)?this._$AA.nextSibling.data=t:this.T(rt.createTextNode(t)),this._$AH=t}$(t){const{values:s,_$litType$:i}=t,e="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=kt.createElement(_t(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===e)this._$AH.p(s);else{const t=new Mt(e,this),i=t.u(this.options);t.p(s),this.T(i),this._$AH=t}}_$AC(t){let s=Ot.get(t.strings);return void 0===s&&Ot.set(t.strings,s=new kt(t)),s}k(t){lt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,e=0;for(const n of t)e===s.length?s.push(i=new Ct(this.O(ht()),this.O(ht()),this,this.options)):i=s[e],i._$AI(n),e++;e<s.length&&(this._$AR(i&&i._$AB.nextSibling,e),s.length=e)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class xt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,i,e,n){this.type=1,this._$AH=St,this._$AN=void 0,this.element=t,this.name=s,this._$AM=e,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=St}_$AI(t,s=this,i,e){const n=this.strings;let o=!1;if(void 0===n)t=Et(this,t,s,0),o=!ct(t)||t!==this._$AH&&t!==$t,o&&(this._$AH=t);else{const e=t;let r,h;for(t=n[0],r=0;r<n.length-1;r++)h=Et(this,e[i+r],s,r),h===$t&&(h=this._$AH[r]),o||=!ct(h)||h!==this._$AH[r],h===St?t=St:t!==St&&(t+=(h??"")+n[r+1]),this._$AH[r]=h}o&&!e&&this.j(t)}j(t){t===St?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Tt extends xt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===St?void 0:t}}class Pt extends xt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==St)}}class Ut extends xt{constructor(t,s,i,e,n){super(t,s,i,e,n),this.type=5}_$AI(t,s=this){if((t=Et(this,t,s,0)??St)===$t)return;const i=this._$AH,e=t===St&&i!==St||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==St&&(i===St||e);e&&this.element.removeEventListener(this.name,this,i),n&&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 Nt{constructor(t,s,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Et(this,t)}}const Lt=Y.litHtmlPolyfillSupport;Lt?.(kt,Ct),(Y.litHtmlVersions??=[]).push("3.3.0");const Rt=(t,s,i)=>{const e=i?.renderBefore??s;let n=e._$litPart$;if(void 0===n){const t=i?.renderBefore??null;e._$litPart$=n=new Ct(s.insertBefore(ht(),t),t,void 0,i??{})}return n._$AI(t),n
17
+ const Xn=globalThis,Yn=Xn.trustedTypes,Zn=Yn?Yn.createPolicy("lit-html",{createHTML:n=>n}):void 0,Jn="$lit$",Gn=`lit$${Math.random().toFixed(9).slice(2)}$`,Qn="?"+Gn,nt=`<${Qn}>`,tt=document,et=()=>tt.createComment(""),lt=n=>null===n||"object"!=typeof n&&"function"!=typeof n,ot=Array.isArray,it="[ \t\n\f\r]",st=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,rt=/-->/g,ut=/>/g,at=RegExp(`>|${it}(?:([^\\s"'>=/]+)(${it}*=${it}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,ht=/"/g,dt=/^(?:script|style|textarea|title)$/i,ft=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),pt=ft(1),gt=ft(2),mt=Symbol.for("lit-noChange"),vt=Symbol.for("lit-nothing"),yt=new WeakMap,bt=tt.createTreeWalker(tt,129);function wt(n,t){if(!ot(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Zn?Zn.createHTML(t):t}const St=(n,t)=>{const e=n.length-1,l=[];let o,i=2===t?"<svg>":3===t?"<math>":"",s=st;for(let t=0;t<e;t++){const e=n[t];let r,u,a=-1,c=0;for(;c<e.length&&(s.lastIndex=c,u=s.exec(e),null!==u);)c=s.lastIndex,s===st?"!--"===u[1]?s=rt:void 0!==u[1]?s=ut:void 0!==u[2]?(dt.test(u[2])&&(o=RegExp("</"+u[2],"g")),s=at):void 0!==u[3]&&(s=at):s===at?">"===u[0]?(s=o??st,a=-1):void 0===u[1]?a=-2:(a=s.lastIndex-u[2].length,r=u[1],s=void 0===u[3]?at:'"'===u[3]?ht:ct):s===ht||s===ct?s=at:s===rt||s===ut?s=st:(s=at,o=void 0);const h=s===at&&n[t+1].startsWith("/>")?" ":"";i+=s===st?e+nt:a>=0?(l.push(r),e.slice(0,a)+Jn+e.slice(a)+Gn+h):e+Gn+(-2===a?t:h)}return[wt(n,i+(n[e]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),l]};class kt{constructor({strings:n,_$litType$:t},e){let l;this.parts=[];let o=0,i=0;const s=n.length-1,r=this.parts,[u,a]=St(n,t);if(this.el=kt.createElement(u,e),bt.currentNode=this.el.content,2===t||3===t){const n=this.el.content.firstChild;n.replaceWith(...n.childNodes)}for(;null!==(l=bt.nextNode())&&r.length<s;){if(1===l.nodeType){if(l.hasAttributes())for(const n of l.getAttributeNames())if(n.endsWith(Jn)){const t=a[i++],e=l.getAttribute(n).split(Gn),s=/([.?@])?(.*)/.exec(t);r.push({type:1,index:o,name:s[2],strings:e,ctor:"."===s[1]?Pt:"?"===s[1]?At:"@"===s[1]?Et:Mt}),l.removeAttribute(n)}else n.startsWith(Gn)&&(r.push({type:6,index:o}),l.removeAttribute(n));if(dt.test(l.tagName)){const n=l.textContent.split(Gn),t=n.length-1;if(t>0){l.textContent=Yn?Yn.emptyScript:"";for(let e=0;e<t;e++)l.append(n[e],et()),bt.nextNode(),r.push({type:2,index:++o});l.append(n[t],et())}}}else if(8===l.nodeType)if(l.data===Qn)r.push({type:2,index:o});else{let n=-1;for(;-1!==(n=l.data.indexOf(Gn,n+1));)r.push({type:7,index:o}),n+=Gn.length-1}o++}}static createElement(n,t){const e=tt.createElement("template");return e.innerHTML=n,e}}function Ot(n,t,e=n,l){if(t===mt)return t;let o=void 0!==l?e._$Co?.[l]:e._$Cl;const i=lt(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(n),o._$AT(n,e,l)),void 0!==l?(e._$Co??=[])[l]=o:e._$Cl=o),void 0!==o&&(t=Ot(n,o._$AS(n,t.values),o,l)),t}class Ct{constructor(n,t){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){const{el:{content:t},parts:e}=this._$AD,l=(n?.creationScope??tt).importNode(t,!0);bt.currentNode=l;let o=bt.nextNode(),i=0,s=0,r=e[0];for(;void 0!==r;){if(i===r.index){let t;2===r.type?t=new xt(o,o.nextSibling,this,n):1===r.type?t=new r.ctor(o,r.name,r.strings,this,n):6===r.type&&(t=new Rt(o,this,n)),this._$AV.push(t),r=e[++s]}i!==r?.index&&(o=bt.nextNode(),i++)}return bt.currentNode=tt,l}p(n){let t=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(n,e,t),t+=e.strings.length-2):e._$AI(n[t])),t++}}class xt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,t,e,l){this.type=2,this._$AH=vt,this._$AN=void 0,this._$AA=n,this._$AB=t,this._$AM=e,this.options=l,this._$Cv=l?.isConnected??!0}get parentNode(){let n=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===n?.nodeType&&(n=t.parentNode),n}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(n,t=this){n=Ot(this,n,t),lt(n)?n===vt||null==n||""===n?(this._$AH!==vt&&this._$AR(),this._$AH=vt):n!==this._$AH&&n!==mt&&this._(n):void 0!==n._$litType$?this.$(n):void 0!==n.nodeType?this.T(n):(n=>ot(n)||"function"==typeof n?.[Symbol.iterator])(n)?this.k(n):this._(n)}O(n){return this._$AA.parentNode.insertBefore(n,this._$AB)}T(n){this._$AH!==n&&(this._$AR(),this._$AH=this.O(n))}_(n){this._$AH!==vt&&lt(this._$AH)?this._$AA.nextSibling.data=n:this.T(tt.createTextNode(n)),this._$AH=n}$(n){const{values:t,_$litType$:e}=n,l="number"==typeof e?this._$AC(n):(void 0===e.el&&(e.el=kt.createElement(wt(e.h,e.h[0]),this.options)),e);if(this._$AH?._$AD===l)this._$AH.p(t);else{const n=new Ct(l,this),e=n.u(this.options);n.p(t),this.T(e),this._$AH=n}}_$AC(n){let t=yt.get(n.strings);return void 0===t&&yt.set(n.strings,t=new kt(n)),t}k(n){ot(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let e,l=0;for(const o of n)l===t.length?t.push(e=new xt(this.O(et()),this.O(et()),this,this.options)):e=t[l],e._$AI(o),l++;l<t.length&&(this._$AR(e&&e._$AB.nextSibling,l),t.length=l)}_$AR(n=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);n&&n!==this._$AB;){const t=n.nextSibling;n.remove(),n=t}}setConnected(n){void 0===this._$AM&&(this._$Cv=n,this._$AP?.(n))}}class Mt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,t,e,l,o){this.type=1,this._$AH=vt,this._$AN=void 0,this.element=n,this.name=t,this._$AM=l,this.options=o,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=vt}_$AI(n,t=this,e,l){const o=this.strings;let i=!1;if(void 0===o)n=Ot(this,n,t,0),i=!lt(n)||n!==this._$AH&&n!==mt,i&&(this._$AH=n);else{const l=n;let s,r;for(n=o[0],s=0;s<o.length-1;s++)r=Ot(this,l[e+s],t,s),r===mt&&(r=this._$AH[s]),i||=!lt(r)||r!==this._$AH[s],r===vt?n=vt:n!==vt&&(n+=(r??"")+o[s+1]),this._$AH[s]=r}i&&!l&&this.j(n)}j(n){n===vt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}}class Pt extends Mt{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===vt?void 0:n}}class At extends Mt{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==vt)}}class Et extends Mt{constructor(n,t,e,l,o){super(n,t,e,l,o),this.type=5}_$AI(n,t=this){if((n=Ot(this,n,t,0)??vt)===mt)return;const e=this._$AH,l=n===vt&&e!==vt||n.capture!==e.capture||n.once!==e.once||n.passive!==e.passive,o=n!==vt&&(e===vt||l);l&&this.element.removeEventListener(this.name,this,e),o&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,n):this._$AH.handleEvent(n)}}class Rt{constructor(n,t,e){this.element=n,this.type=6,this._$AN=void 0,this._$AM=t,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(n){Ot(this,n)}}const Dt=Xn.litHtmlPolyfillSupport;Dt?.(kt,xt),(Xn.litHtmlVersions??=[]).push("3.3.0");const $t=(n,t,e)=>{const l=e?.renderBefore??t;let o=l._$litPart$;if(void 0===o){const n=e?.renderBefore??null;l._$litPart$=o=new xt(t.insertBefore(et(),n),n,void 0,e??{})}return o._$AI(n),o
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
- */},Dt=globalThis;let zt=class extends X{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 s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return $t}};zt._$litElement$=!0,zt.finalized=!0,Dt.litElementHydrateSupport?.({LitElement:zt});const Ht=Dt.litElementPolyfillSupport;Ht?.({LitElement:zt}),(Dt.litElementVersions??=[]).push("4.2.0");
22
+ */},Lt=globalThis;let Tt=class extends Kn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const n=super.createRenderRoot();return this.renderOptions.renderBefore??=n.firstChild,n}update(n){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=$t(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return mt}};Tt._$litElement$=!0,Tt.finalized=!0,Lt.litElementHydrateSupport?.({LitElement:Tt});const jt=Lt.litElementPolyfillSupport;jt?.({LitElement:Tt}),(Lt.litElementVersions??=[]).push("4.2.0");
23
23
  /**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
27
  */
28
- const It=2,Wt=5,qt=t=>(...s)=>({_$litDirective$:t,values:s});class Vt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,s,i){this._$Ct=t,this._$AM=s,this._$Ci=i}_$AS(t,s){return this.update(t,s)}update(t,s){return this.render(...s)}}
28
+ const _t=2,Ut=5,zt=n=>(...t)=>({_$litDirective$:n,values:t});class It{constructor(n){}get _$AU(){return this._$AM._$AU}_$AT(n,t,e){this._$Ct=n,this._$AM=t,this._$Ci=e}_$AS(n,t){return this.update(n,t)}update(n,t){return this.render(...t)}}
29
29
  /**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */class Gt extends Vt{constructor(t){if(super(t),this.it=St,t.type!==It)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===St||null==t)return this._t=void 0,this.it=t;if(t===$t)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 s=[t];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}Gt.directiveName="unsafeHTML",Gt.resultType=1;const Jt=qt(Gt);function Bt(t,s,i){s&&("string"==typeof s?(t._$litPart$||t.replaceChildren(),Rt(mt`${Jt(s)}`,t)):s._$litType$?(t._$litPart$||t.replaceChildren(),Rt(s,t)):(f(t,s,i),t._$litPart$=void 0))}const Ft=qt(class extends Vt{constructor(t){if(super(t),t.type!==Wt)throw new Error("run() can only be used in event handlers")}update(t,s){const i=t.element,n=t.name,[o,...r]=s,h=()=>{let t=i,s=t._component;for(;!s&&t;)t=t.parentElement,s=t&&t._component;return console.assert(!!s,"Component not found."),s};return"string"==typeof o?i[`on${n}`]=t=>{const s=h();s?s.run(o,...r,t):e.run(o,...r,t)}:"function"==typeof o&&(i[`on${n}`]=t=>h().setState(o(h().state,...r,t))),this.render()}render(){return $t}});e.createElement=u,e.render=Bt,e.Fragment=h,"object"==typeof window&&(window.React=window._React||e,window.html=mt,window.svg=gt,window.run=Ft);export{E as Component,C as ROUTER_404_EVENT,M as ROUTER_EVENT,e as app,_ as customElement,e as default,O as event,mt as html,A as on,Bt as render,Ft as run,y as safeHTML,gt as svg,O as update};
33
+ */class Bt extends It{constructor(n){if(super(n),this.it=vt,n.type!==_t)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(n){if(n===vt||null==n)return this._t=void 0,this.it=n;if(n===mt)return n;if("string"!=typeof n)throw Error(this.constructor.directiveName+"() called with a non-string value");if(n===this.it)return this._t;this.it=n;const t=[n];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Bt.directiveName="unsafeHTML",Bt.resultType=1;const Ht=zt(Bt);function Nt(n,t,e){t&&("string"==typeof t?(n._$litPart$||n.replaceChildren(),$t(pt`${Ht(t)}`,n)):t._$litType$?(n._$litPart$||n.replaceChildren(),$t(t,n)):(on(n,t,e),n._$litPart$=void 0))}const Ft=zt(class extends It{constructor(n){if(super(n),n.type!==Ut)throw new Error("run() can only be used in event handlers")}update(n,t){const e=n.element,l=n.name,[o,...i]=t,r=()=>{let n=e,t=n._component;for(;!t&&n;)n=n.parentElement,t=n&&n._component;return console.assert(!!t,"Component not found."),t};return"string"==typeof o?e[`on${l}`]=n=>{const t=r();t?t.run(o,...i,n):s.run(o,...i,n)}:"function"==typeof o&&(e[`on${l}`]=n=>r().setState(o(r().state,...i,n))),this.render()}render(){return mt}});if(s.createElement=ln,s.render=Nt,s.Fragment=Q,"object"==typeof window){const n=window;Vt=n,qt={React:n._React||s,html:pt,svg:gt,run:Ft},"object"==typeof Vt&&null!==Vt&&Object.keys(qt).forEach((n=>{Vt[n]=qt[n]}))}var Vt,qt;export{wn as Component,xn as ROUTER_404_EVENT,Cn as ROUTER_EVENT,s as app,vn as customElement,s as default,gn as event,pt as html,mn as on,Nt as render,Ft as run,un as safeHTML,gt as svg,gn as update};
34
34
  //# sourceMappingURL=apprun-html.esm.js.map