apprun 4.0.0 → 6.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/CHANGELOG.md +235 -12
  2. package/LICENSE +1 -1
  3. package/README.md +225 -110
  4. package/apprun.d.ts +240 -34
  5. package/cli/app.js +29 -0
  6. package/cli/colors.js +69 -0
  7. package/cli/index.html +13 -0
  8. package/cli/index.js +96 -0
  9. package/dist/apprun-code.js +2 -0
  10. package/dist/apprun-code.js.map +1 -0
  11. package/dist/apprun-dev-tools.js +1 -1
  12. package/dist/apprun-dev-tools.js.map +1 -1
  13. package/dist/apprun-html.esm.js +34 -0
  14. package/dist/apprun-html.esm.js.map +1 -0
  15. package/dist/apprun-html.js +2 -1
  16. package/dist/apprun-html.js.LICENSE.txt +11 -0
  17. package/dist/apprun-html.js.map +1 -1
  18. package/dist/apprun-play.js +2 -0
  19. package/dist/apprun-play.js.map +1 -0
  20. package/dist/apprun.esm.js +2 -0
  21. package/dist/apprun.esm.js.map +1 -0
  22. package/dist/apprun.js +1 -1
  23. package/dist/apprun.js.map +1 -1
  24. package/dist/createState.js +2 -0
  25. package/dist/createState.js.map +1 -0
  26. package/esm/add-components.js +90 -0
  27. package/esm/add-components.js.map +1 -0
  28. package/esm/app.js +209 -0
  29. package/esm/app.js.map +1 -0
  30. package/esm/apprun-code.js +170 -0
  31. package/esm/apprun-code.js.map +1 -0
  32. package/esm/apprun-dev-tools-tests.js +95 -0
  33. package/esm/apprun-dev-tools-tests.js.map +1 -0
  34. package/esm/apprun-dev-tools.js +281 -0
  35. package/esm/apprun-dev-tools.js.map +1 -0
  36. package/esm/apprun-html.js +24 -0
  37. package/esm/apprun-html.js.map +1 -0
  38. package/esm/apprun-play.js +248 -0
  39. package/esm/apprun-play.js.map +1 -0
  40. package/esm/apprun.js +220 -0
  41. package/esm/apprun.js.map +1 -0
  42. package/esm/component.js +413 -0
  43. package/esm/component.js.map +1 -0
  44. package/esm/createState.js +9 -0
  45. package/esm/createState.js.map +1 -0
  46. package/esm/decorator.js +88 -0
  47. package/esm/decorator.js.map +1 -0
  48. package/esm/directive.js +306 -0
  49. package/esm/directive.js.map +1 -0
  50. package/esm/router.js +345 -0
  51. package/esm/router.js.map +1 -0
  52. package/esm/type-utils.js +90 -0
  53. package/esm/type-utils.js.map +1 -0
  54. package/esm/types.js +58 -0
  55. package/esm/types.js.map +1 -0
  56. package/esm/vdom-lit-html.js +65 -0
  57. package/esm/vdom-lit-html.js.map +1 -0
  58. package/esm/vdom-my-prop-attr.js +227 -0
  59. package/esm/vdom-my-prop-attr.js.map +1 -0
  60. package/esm/vdom-my.js +293 -0
  61. package/esm/vdom-my.js.map +1 -0
  62. package/esm/vdom-to-html.js +54 -0
  63. package/esm/vdom-to-html.js.map +1 -0
  64. package/esm/vdom.js +28 -0
  65. package/esm/vdom.js.map +1 -0
  66. package/esm/version.js +15 -0
  67. package/esm/version.js.map +1 -0
  68. package/esm/web-component.js +155 -0
  69. package/esm/web-component.js.map +1 -0
  70. package/jsx-runtime.js +2 -0
  71. package/jsx-runtime.js.map +1 -0
  72. package/package.json +90 -41
  73. package/.travis.yml +0 -10
  74. package/.vscode/launch.json +0 -19
  75. package/BACKERS.md +0 -3
  76. package/apprun-cli.js +0 -177
  77. package/cli-templates/_gitignore +0 -6
  78. package/cli-templates/component.ts_ +0 -16
  79. package/cli-templates/index.html +0 -11
  80. package/cli-templates/karma.conf.js +0 -24
  81. package/cli-templates/main.ts_ +0 -13
  82. package/cli-templates/readme.md +0 -7
  83. package/cli-templates/spa_index.html +0 -14
  84. package/cli-templates/spa_main.ts_ +0 -47
  85. package/cli-templates/spec.ts_ +0 -11
  86. package/cli-templates/tsconfig.json +0 -12
  87. package/cli-templates/webpack.config.js +0 -23
  88. package/demo-html/app.js +0 -2
  89. package/demo-html/app.js.map +0 -1
  90. package/demo-html/counter-c.html +0 -29
  91. package/demo-html/counter-wc-event.html +0 -29
  92. package/demo-html/counter-wc.html +0 -29
  93. package/demo-html/counter.html +0 -26
  94. package/demo-html/index.html +0 -14
  95. package/demo-html/main.tsx +0 -31
  96. package/docs/README.md +0 -326
  97. package/docs/index.html +0 -23
  98. package/index.html +0 -85
  99. package/logo.png +0 -0
  100. package/src/app.ts +0 -69
  101. package/src/apprun-dev-tools.tsx +0 -67
  102. package/src/apprun-html.ts +0 -13
  103. package/src/apprun.ts +0 -53
  104. package/src/component.ts +0 -189
  105. package/src/createComponent.tsx +0 -38
  106. package/src/decorator.ts +0 -36
  107. package/src/router.ts +0 -19
  108. package/src/types.ts +0 -9
  109. package/src/vdom-html.ts +0 -17
  110. package/src/vdom-my.ts +0 -191
  111. package/src/vdom-to-html.tsx +0 -45
  112. package/src/vdom.ts +0 -7
  113. package/src/web-component.ts +0 -29
  114. package/tests/app-rx.spec_ +0 -41
  115. package/tests/app.spec.ts +0 -122
  116. package/tests/application.spec.tsx +0 -23
  117. package/tests/component.spec.tsx +0 -296
  118. package/tests/custom-element.spec.tsx +0 -19
  119. package/tests/data-attr.spec.tsx +0 -42
  120. package/tests/decorator.spec.tsx +0 -104
  121. package/tests/fragment.spec.tsx +0 -79
  122. package/tests/hyperscript.spec.ts +0 -43
  123. package/tests/node-test.js +0 -7
  124. package/tests/router.spec.ts +0 -69
  125. package/tests/stateful-component.spec.tsx +0 -248
  126. package/tests/typed.spec.tsx +0 -63
  127. package/tests/vdom-html.spec.ts +0 -35
  128. package/tests/vdom-jsx.spec.tsx +0 -131
  129. package/tests/vdom-my.spec.tsx +0 -195
  130. package/tests/view-engine.spec.js +0 -59
  131. package/tsconfig.json +0 -11
  132. package/tslint.json +0 -124
  133. package/typescriptreact.json +0 -87
  134. package/viewEngine.js +0 -54
  135. package/webpack.config.js +0 -30
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://apprun/webpack/universalModuleDefinition","webpack://apprun/webpack/bootstrap","webpack://apprun/./src/app.ts","webpack://apprun/./src/vdom-to-html.tsx","webpack://apprun/./src/apprun-dev-tools.tsx","webpack://apprun/(webpack)/buildin/global.js"],"names":["root","factory","exports","module","define","amd","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","App","[object Object]","_events","fn","options","push","subscribers","filter","sub","length","args","console","assert","delay","apply","once","on","assign","_t","clearTimeout","setTimeout","app","global","window","default","toProps","props","keys","map","prop","join","toString","getProp","toHTMLArray","nodes","node","toHTML","vdom","clean","obj","Array","isArray","startsWith","substring","tag","children","JSON","stringify","app_1","vdom_to_html_1","log","debug","off","Events","events","createElement","sort","a","b","event","Components","components","component","constructor","print","run","state","view","html","newWin","open","document","write","location","href","close","forEach","el","element","getElementById","comps","e","g","Function","eval"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,OAAAD,IAEAD,EAAA,OAAAC,IARA,CASCK,KAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,aAAwDC,MAAA,WAExDP,O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ACT,MAAM3B,EAZG6B,IAASlB,EAAAxB,QAAA+B,cAAA,UACnB7E,OAAOiD,KAAKuC,GAAOtC,IAAIrD,GAAOyE,EAAAxB,QAAA+B,cAAA,UAC7BP,EAAAxB,QAAA+B,cAAA,eAAOhF,GACPyE,EAAAxB,QAAA+B,cAACK,GAAWC,WAAYK,EAAM3F,QASjB4F,CAAKN,IA3CtB,SAAgBO,GACd,MAAMC,EAAS9C,OAAO+C,KAAK,GAAI,gBAAiB,aAChDD,EAAOE,SAASC,4CACWD,SAASE,SAASC,2KAM5BN,+CAIjBC,EAAOE,SAASI,QA+BdN,CAAOpB,EAAAzB,QAAOa,SAEd3D,OAAOiD,KAAKkC,GAAYe,QAAQC,IAC9B,MAAMC,EAAwB,iBAAPD,EAAkBN,SAASQ,eAAeF,GAAMA,EACjEG,EAAQnB,EAAWgB,GAAIjD,IAAIkC,KAC/BA,YACAR,OAAQQ,EAAoB,SAAEN,KAAK,CAAEC,EAAGC,IAAMD,EAAElF,KAAOmF,EAAEnF,KAAO,GAAK,GAAIqD,IAAIqD,GAAKA,EAAE1G,SAEtFoC,QAAQuC,IAAI4B,EAASE,wBC/D3B,IAAAE,EAGAA,EAAA,WACA,OAAAtH,KADA,GAIA,IAEAsH,KAAAC,SAAA,cAAAA,KAAA,EAAAC,MAAA,QACC,MAAAH,GAED,iBAAA1D,SAAA2D,EAAA3D,QAOA9D,EAAAD,QAAA0H","file":"dist/apprun-dev-tools.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n","export class App {\n\n private _events: Object;\n\n public start;\n public createElement;\n public render;\n public Fragment;\n public webComponent;\n\n constructor() {\n this._events = {};\n }\n\n on(name: string, fn: (...args) => void, options: any = {}) {\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn: fn, options: options });\n }\n\n off(name: string, fn: (...args) => void) {\n let subscribers = this._events[name];\n if (subscribers) {\n subscribers = subscribers.filter((sub) => sub.fn !== fn);\n if (subscribers.length) this._events[name] = subscribers;\n else delete this._events[name]\n }\n }\n\n run(name: string, ...args) {\n let subscribers = this._events[name];\n console.assert(!!subscribers, 'No subscriber for event: ' + name);\n if (subscribers) {\n subscribers = subscribers.filter((sub) => {\n const { fn, options } = sub;\n if (options.delay) {\n this.delay(name, fn, args, options);\n } else {\n fn.apply(this, args);\n }\n return !sub.options.once;\n });\n if (subscribers.length) this._events[name] = subscribers;\n else delete this._events[name]\n }\n }\n\n once(name: string, fn, options: any = {}) {\n this.on(name, fn, { ...options, once: true });\n }\n\n private delay(name, fn, args, options) {\n if (options._t) clearTimeout(options._t);\n options._t = setTimeout(() => {\n clearTimeout(options._t);\n fn.apply(this, args);\n }, options.delay);\n }\n}\n\nlet app: App;\ndeclare var global;\nconst root = global || window;\nif (root['app'] && root['app']['start']) {\n app = root['app'];\n} else {\n app = new App();\n root['app'] = app;\n}\nexport default app;\n","\nimport { VDOM } from './types';\n\nfunction getProp(prop) {\n if (typeof prop === 'object') {\n return Object.keys(prop).map(name => `${name}:${prop[name]}`).join(';');\n }\n else return prop.toString();\n}\n\nfunction toProps(props) {\n return Object.keys(props)\n .map(name => ` ${name === 'className' ? 'class' : name}=\"${getProp(props[name])}\"`)\n .join('');\n}\n\nfunction toHTMLArray(nodes) {\n return nodes.map(node => toHTML(node)).join('');\n}\n\nfunction clean(obj) {\n for (var i in obj) {\n if (obj[i] == null) {\n delete obj[i];\n } else if (typeof obj[i] === 'object') {\n clean(obj[i]);\n }\n }\n}\n\nfunction toHTML (vdom: VDOM) {\n if (!vdom) return '';\n clean(vdom);\n if (Array.isArray(vdom)) return toHTMLArray(vdom);\n if (typeof vdom === 'string') {\n return vdom.startsWith('_html:') ? vdom.substring(6) : vdom;\n } else if (vdom.tag) {\n const props = vdom.props ? toProps(vdom.props) : '';\n const children = vdom.children ? toHTMLArray(vdom.children) : '';\n return `<${vdom.tag}${props}>${children}</${vdom.tag}>`;\n }\n if (typeof vdom === 'object') return JSON.stringify(vdom);\n}\n\nexport default toHTML;","import app from './app';\nimport toHTML from './vdom-to-html';\n\nconst log = p => console.log(p);\nlet debug = false;\n\nwindow['_debug'] = (on) => {\n on ? !debug && app.on('debug', log) : debug && app.off('debug', log);\n debug = on;\n}\n\nfunction newWin(html) {\n const newWin = window.open('', '_apprun_debug', 'toolbar=0');\n newWin.document.write(`<html>\n <title>AppRun Analyzer | ${document.location.href}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\" }\n li { margin-left: 30px; }\n </style>\n <body>\n <div id=\"main\">${html}</div>\n </script>\n </body>\n </html>`);\n newWin.document.close();\n}\n\nconst Events = ({ events }) => <ul>\n {events && events\n .sort(((a, b) => a.name > b.name ? 1 : -1))\n .map(event => <li>\n {event.name}\n </li>)}\n</ul>;\n\nconst Components = ({ components }) => <ul>\n {components.map(component => <li>\n <div>{component.constructor.name}</div>\n <Events events={component['_actions']} />\n </li>)}\n</ul>;\n\nconst view = state => <ul>\n {Object.keys(state).map(name =><li>\n <div>#{name}</div>\n <Components components={state[name]} />\n </li>)}\n</ul>\n\nwindow['_components'] = (print) => {\n const o = { components: {} };\n app.run('get-components', o);\n const { components } = o;\n if (print) {\n const vdom = view(components);\n newWin(toHTML(vdom));\n } else {\n Object.keys(components).forEach(el => {\n const element = typeof el === 'string' ? document.getElementById(el) : el;\n const comps = components[el].map(component => ({\n component,\n events: component['_actions'].sort(((a, b) => a.name > b.name ? 1 : -1)).map(e => e.name),\n }));\n console.log(element, comps);\n });\n }\n}","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n"],"sourceRoot":""}
1
+ {"version":3,"file":"dist/apprun-dev-tools.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CAAC,ECD3BA,EAAoBC,EAAI,WACvB,GAA0B,iBAAfC,WAAyB,OAAOA,WAC3C,IACC,OAAOH,MAAQ,IAAII,SAAS,cAAb,EAChB,CAAE,MAAOC,GACR,GAAsB,iBAAXC,OAAqB,OAAOA,MACxC,CACA,CAPuB,GC+MxB,IAAIC,EACJ,MAAMb,EAA0B,oBAAXY,OAAyBA,YAC1B,IAAX,EAAAJ,EAAyB,EAAAA,EACd,oBAATM,KAAuBA,KAAO,CAAC,EAEtCd,EAAKe,KAAOf,EAAKgB,gBACnBH,EAAOb,EAAKe,KAEZF,EAAO,IAjKF,MAML,WAAAI,GAFQ,KAAAC,kBAAmB,EAGzBZ,KAAKa,QAAU,CAAC,EAChBb,KAAKc,iBAAmB,EAC1B,C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AQe,EAE5B,IAEJ,CACF,C","sources":["webpack://apprun/webpack/universalModuleDefinition","webpack://apprun/webpack/bootstrap","webpack://apprun/webpack/runtime/global","webpack://apprun/./src/app.ts","webpack://apprun/./src/version.ts","webpack://apprun/./src/vdom-to-html.tsx","webpack://apprun/./src/apprun-dev-tools-tests.tsx","webpack://apprun/./src/apprun-dev-tools.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","/**\n * Core AppRun application class and singleton instance\n *\n * This file provides:\n * 1. App class - The core event system implementation with pub/sub capabilities\n * - on(): Subscribe to events with options (once, delay, global)\n * - off(): Unsubscribe from events with proper cleanup\n * - run(): Publish events synchronously with error-event reporting\n * - runAsync(): Publish events asynchronously with Promise support, returns handler values\n *\n * 2. Default app singleton - Global event bus instance\n * - Created once and reused across the application\n * - Stored in global scope (window/global) with version tracking\n * - Prevents duplicate instances across different versions\n *\n * Features:\n * - Event wildcards support with indexed wildcard subscriptions (events ending with '*')\n * - Delayed event execution with subscription-owned timeout management\n * - Once-only event subscriptions, including wildcard subscriptions\n * - Async event handling with Promise.all\n * - Central error event reporting with console fallback\n * - Global event bus shared across components\n * - Memory leak prevention with proper cleanup\n *\n * Type Safety Improvements (v3.35.1):\n * - Added validation for event handler functions\n * - Enhanced error handling in event execution\n * - Improved null checks in delayed event handling\n * - Better error reporting for invalid handlers\n *\n * Usage:\n * ```ts\n * // Subscribe to events\n * app.on('event-name', (state, ...args) => {\n * // Handle event\n * });\n *\n * // Publish events (fire-and-forget)\n * app.run('event-name', ...args);\n * \n * // Get return values from event handlers\n * app.runAsync('event-name', data).then(results => {\n * // Handle results array\n * });\n * ```\n */\n\nimport { EventOptions } from './types'\nimport { APPRUN_VERSION_GLOBAL } from './version'\n\ntype Subscriber = { fn: (...args: any[]) => any, options: EventOptions, _t?: any };\ntype SubscriberCall = Subscriber & { _source?: Subscriber };\ntype WildcardSubscriber = { name: string, prefix: string, sub: Subscriber };\n\nexport class App {\n\n _events: { [key: string]: Subscriber[] };\n private _wildcard_events: WildcardSubscriber[];\n private _reporting_error = false;\n\n constructor() {\n this._events = {} as { [key: string]: Subscriber[] };\n this._wildcard_events = [];\n }\n\n on(name: string, fn: (...args: any[]) => any, options: EventOptions = {}): void {\n this._events[name] = this._events[name] || [];\n const sub = { fn, options };\n this._events[name].push(sub);\n if (name.endsWith('*')) {\n this._wildcard_events.push({ name, prefix: name.replace('*', ''), sub });\n this._wildcard_events.sort((a, b) => b.name.length - a.name.length);\n }\n }\n\n off(name: string, fn: (...args: any[]) => any): void {\n const subscribers = this._events[name] || [];\n\n this._events[name] = subscribers.filter((sub) => sub.fn !== fn);\n if (name.endsWith('*')) {\n this._wildcard_events = this._wildcard_events.filter(item => !(item.name === name && item.sub.fn === fn));\n }\n }\n\n find(name: string): any {\n return this._events[name];\n }\n\n run(name: string, ...args: any[]): number {\n const subscribers = this.getSubscribers(name, this._events);\n if ((this as any).debug) console.assert(subscribers && subscribers.length > 0, 'No subscriber for event: ' + name);\n subscribers.forEach((sub) => {\n const { fn, options } = sub;\n if (!fn || typeof fn !== 'function') {\n console.error(`AppRun event handler for '${name}' is not a function:`, fn);\n return false;\n }\n if (options.delay) {\n this.delay(name, sub, args);\n } else {\n try {\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n } catch (error) {\n this.reportError(name, error, { phase: 'run', args });\n }\n }\n });\n\n return subscribers.length;\n }\n\n once(name: string, fn: (...args: any[]) => any, options: EventOptions = {}): void {\n this.on(name, fn, { ...options, once: true });\n }\n\n private delay(name: string, sub: SubscriberCall, args: any[]): void {\n const source = sub._source || sub;\n const { fn, options } = sub;\n if (source._t) clearTimeout(source._t);\n source._t = setTimeout(() => {\n clearTimeout(source._t);\n source._t = null;\n try {\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n } catch (error) {\n this.reportError(name, error, { phase: 'delay', args });\n }\n }, options.delay);\n }\n\n runAsync(name: string, ...args: any[]): Promise<any[]> {\n const subscribers = this.getSubscribers(name, this._events);\n if ((this as any).debug) console.assert(subscribers && subscribers.length > 0, 'No subscriber for event: ' + name);\n const promises = subscribers.map(sub => {\n const { fn, options } = sub;\n if (!fn || typeof fn !== 'function') {\n console.error(`AppRun async event handler for '${name}' is not a function:`, fn);\n return Promise.resolve(null);\n }\n try {\n const result = Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n return Promise.resolve(result).catch(error => {\n this.reportError(name, error, { phase: 'runAsync', args });\n return Promise.reject(error);\n });\n } catch (error) {\n this.reportError(name, error, { phase: 'runAsync', args });\n return Promise.reject(error);\n }\n });\n return Promise.all(promises);\n }\n\n private reportError(name: string, error: any, context: any = {}): void {\n const payload = { event: name, error, app: this, ...context };\n const errorSubscribers = name === 'error' || this._reporting_error ? [] : this.getSubscribers('error', this._events);\n if (errorSubscribers.length > 0) {\n this._reporting_error = true;\n try {\n errorSubscribers.forEach(sub => {\n try {\n sub.fn.call(this, payload);\n } catch (errorHandlerError) {\n console.error(`Error in error event handler:`, errorHandlerError);\n }\n });\n } finally {\n this._reporting_error = false;\n }\n } else if (context.phase === 'delay') {\n console.error(`Error in delayed event handler for '${name}':`, error);\n } else if (context.phase === 'runAsync') {\n console.error(`Error in async event handler for '${name}':`, error);\n } else {\n console.error(`Error in event handler for '${name}':`, error);\n }\n }\n\n private removeOnceWildcardSubscriber(evt: string, sub: Subscriber): void {\n this._events[evt] = (this._events[evt] || []).filter(item => item !== sub);\n this._wildcard_events = this._wildcard_events.filter(item => item.sub !== sub);\n }\n\n private getSubscribers(name: string, events: { [key: string]: Subscriber[] }): SubscriberCall[] {\n const subscribers = events[name] || [];\n const calls: SubscriberCall[] = subscribers.slice();\n\n // Update the list of subscribers by pulling out those which will run once.\n // We must do this update prior to running any of the events in case they\n // cause additional events to be turned off or on.\n events[name] = subscribers.filter((sub) => {\n return !sub.options.once;\n });\n this._wildcard_events.filter(({ name: evt, prefix }) => evt !== name && name.startsWith(prefix))\n .forEach(({ name: evt, sub }) => {\n if (sub.options.once) this.removeOnceWildcardSubscriber(evt, sub);\n calls.push({\n ...sub,\n _source: sub,\n options: { ...sub.options, event: name }\n });\n });\n return calls;\n }\n}\n\nconst AppRunVersions = APPRUN_VERSION_GLOBAL;\nlet _app: App;\nconst root = (typeof window !== 'undefined' ? window :\n typeof global !== 'undefined' ? global :\n typeof self !== 'undefined' ? self : {}) as any;\n\nif (root.app && root._AppRunVersions) {\n _app = root.app;\n} else {\n _app = new App();\n root.app = _app;\n root._AppRunVersions = AppRunVersions;\n}\nexport default _app;\n","/**\n * Version Management Utility\n *\n * Single source of truth for AppRun version information.\n * This file ensures version consistency across all modules.\n *\n * The version is derived from package.json and should be updated\n * only when the package version changes.\n */\n\n// Import version from package.json to maintain single source of truth\n// This version string is used across the framework\nexport const APPRUN_VERSION = '6.0.0';\n\n// Version string with prefix for global tracking\nexport const APPRUN_VERSION_GLOBAL = `AppRun-${APPRUN_VERSION}`;\n","\n/**\n * VDOM to HTML string renderer\n *\n * Converts AppRun VDOM, arrays, strings, and lit templates to HTML strings.\n * String nodes are rendered literally; trusted markup must be supplied through\n * explicit trusted-HTML helpers before reaching this renderer.\n */\n\nimport { VDOM } from './types';\nimport { TemplateResult } from 'lit-html';\n\nfunction getProp(prop) {\n if (typeof prop === 'object') {\n return Object.keys(prop).map(name => `${name}:${prop[name]}`).join(';');\n }\n else return prop.toString();\n}\n\nfunction toProps(props) {\n return Object.keys(props)\n .map(name => ` ${name === 'className' ? 'class' : name}=\"${getProp(props[name])}\"`)\n .join('');\n}\n\nfunction toHTMLArray(nodes) {\n return nodes.map(node => toHTML(node)).join('');\n}\n\nfunction clean(obj) {\n for (var i in obj) {\n if (obj[i] == null) {\n delete obj[i];\n } else if (typeof obj[i] === 'object') {\n clean(obj[i]);\n }\n }\n}\n\nfunction toHTML (vdom) {\n if (!vdom) return '';\n if (vdom['_$litType$']) {\n return vdom.toString();\n }\n clean(vdom);\n if (Array.isArray(vdom)) return toHTMLArray(vdom);\n if (typeof vdom === 'string') {\n return vdom;\n } else if (vdom.tag) {\n const props = vdom.props ? toProps(vdom.props) : '';\n const children = vdom.children ? toHTMLArray(vdom.children) : '';\n return `<${vdom.tag}${props}>${children}</${vdom.tag}>`;\n }\n if (typeof vdom === 'object') return JSON.stringify(vdom);\n}\n\nexport default toHTML;\n","declare var app;\nlet win;\napp['debug'] = true;\n\nfunction openWin(name) {\n win = window.open('', name);\n win.document.write(`<html>\n <title>AppRun Analyzer | ${document.location.href}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\" }\n </style>\n <body><pre>`);\n}\n\nfunction write(text) {\n win.document.write(text + '\\n');\n}\n\nfunction closeWin() {\n win.document.write(`</pre>\n </body>\n </html>`);\n win.document.close();\n}\n\nconst print_component_test = component => {\n write(`import ${component.constructor.name} from '../src/${component.constructor.name}'`);\n write(`describe('${component.constructor.name}', ()=>{`);\n component._actions.forEach(action => {\n if (action.name !== '.') {\n write(` it ('should handle event: ${action.name}', (done)=>{`);\n write(` const component = new ${component.constructor.name}().mount();`);\n write(` component.run('${action.name}');`);\n write(` setTimeout(() => {`);\n write(` \\/\\/expect(?).toHaveBeenCalled();`);\n write(` \\/\\/expect(component.state).toBe(?);`);\n write(` done();`);\n write(` })`);\n }\n });\n write(`});`);\n};\nexport const _createEventTests = () => {\n const o = { components: {} };\n app.run('get-components', o);\n const { components } = o;\n openWin('');\n if (components instanceof Map) {\n for (let [key, comps] of components) {\n comps.forEach(print_component_test);\n }\n } else {\n Object.keys(components).forEach(el => {\n components[el].forEach(print_component_test);\n });\n }\n closeWin();\n}\n\nlet recording = false;\nlet events = [];\n\napp.on('debug', p => {\n if (recording && p.vdom) {\n events.push(p);\n console.log(`* ${events.length} state(s) recorded.`);\n }\n});\n\nexport const _createStateTests = (s) => {\n\n const printTests = () => {\n if (events.length === 0) {\n console.log('* No state recorded.');\n return;\n }\n openWin('');\n events.forEach((event, idx) => {\n write(` it ('view snapshot: #${idx + 1}', ()=>{`);\n write(` const component = new ${event.component.constructor.name}()`);\n write(` const state = ${JSON.stringify(event.state, undefined, 2)};`);\n write(` const vdom = component['view'](state);`);\n write(` expect(JSON.stringify(vdom)).toMatchSnapshot();`);\n write(` })`);\n });\n closeWin();\n }\n\n if (s === 'start') {\n events = [];\n recording = true;\n console.log('* State logging started.');\n } else if (s === 'stop') {\n printTests();\n recording = false;\n events = [];\n console.log('* State logging stopped.');\n } else {\n console.log('create-state-tests <start|stop>');\n }\n}\n","import app from './app';\nimport toHTML from './vdom-to-html';\nimport { _createEventTests, _createStateTests } from './apprun-dev-tools-tests';\n\nfunction createProxy(obj) {\n const handler = {\n get(target, property, receiver) {\n\n // Get the property value\n const value = Reflect.get(target, property, receiver);\n\n // If the value is an object (including arrays), proxy it\n if (typeof value === 'object' && value !== null) {\n if (Array.isArray(value)) {\n // Proxy each element of the array if it's an object\n return value.map(item => createProxy(item));\n } else {\n // Recursively proxy the object\n return createProxy(value);\n }\n }\n\n return `{${property}}`\n },\n\n };\n\n return Array.isArray(obj) ?\n obj.map(item => createProxy(item)) : new Proxy(obj, handler);\n}\n\nfunction htmlEncode(input) {\n return !input ? input : input.toString()\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}\n\nfunction getVDOM(component) {\n let view;\n if (typeof component.state === 'object') {\n const proxy = createProxy(component.state);\n view = component.view(proxy);\n } else {\n view = component.view(component.state);\n }\n return view;\n}\n\nconst componentCache = new Map();\napp['debug'] = true;\napp.on('debug-create-component', component => {\n const element = component.element;\n if (!element) {\n console.warn('Component created without an element:', component);\n return;\n }\n if (componentCache.get(element)) { componentCache.get(element).push(component) }\n else { componentCache.set(element, [component]) }\n});\n\nwindow['_apprun-help'] = ['', () => {\n Object.keys(window).forEach(cmd => {\n if (cmd.startsWith('_apprun-')) {\n cmd === '_apprun-help' ?\n console.log('AppRun Commands:') :\n console.log(`* ${cmd.substring(8)}: ${window[cmd][0]}`);\n }\n });\n}];\n\nfunction newWin(html) {\n const win = window.open('', '_apprun_debug', 'toolbar=0');\n win.document.write(`<html>\n <title>AppRun Analyzer | ${document.location.href}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\" }\n li { margin-left: 80px; }\n </style>\n <body>\n <div id=\"main\">${html}</div>\n </script>\n </body>\n </html>`);\n win.document.close();\n}\n\nconst viewElement = element => <div>\n {element.tagName.toLowerCase()}{element.id ? '#' + element.id : ''}\n {' '}\n {element.className && element.className.split(' ').map(c => '.' + c).join()}\n</div>;\n\nconst viewComponents = state => {\n const Components = ({ components }) => <ul>\n {components.map(component => {\n\n const vdom = getVDOM(component);\n const events = component['_actions'].map(a => a.name);\n\n const component_def = {\n state: component.state,\n view: vdom,\n actions: events,\n update: component.update\n };\n\n return <li>\n <div>{component.constructor.name}</div>\n <div><pre>{htmlEncode(JSON.stringify(component_def, null, 2))}</pre></div>\n <br />\n </li>;\n\n })}\n </ul>;\n\n return <ul>\n {state.map(({ element, comps }) => <li>\n <div>{viewElement(element)}</div>\n <Components components={comps} />\n </li>)}\n </ul>\n}\n\nconst viewEvents = state => {\n const Components = ({ components }) => <ul>\n {components.map(component => <li>\n <div>{component.constructor.name}</div>\n </li>)}\n </ul>;\n\n const Events = ({ events, global }) => <ul>\n {events && events\n .filter(event =>\n event.global === global && event.event !== '.')\n .map(({ event, components }) => <li>\n <div>{event}</div>\n <Components components={components} />\n </li>)}\n </ul>;\n\n return <div>\n <div>GLOBAL EVENTS</div>\n <Events events={state} global={true} />\n <div>LOCAL EVENTS</div>\n <Events events={state} global={false} />\n </div>\n}\n\nconst _events = (print?) => {\n const global_events = app['_events']\n const events = {};\n const cache = componentCache;\n\n const add_component = component => component['_actions'].forEach(event => {\n events[event.name] = events[event.name] || [];\n events[event.name].push(component);\n });\n\n if (cache instanceof Map) {\n for (let [key, comps] of cache) {\n comps.forEach(add_component);\n }\n }\n const data = [];\n Object.keys(events).forEach(event => {\n data.push({ event, components: events[event], global: global_events[event] ? true : false });\n });\n\n data.sort(((a, b) => a.event > b.event ? 1 : -1)).map(e => e.event);\n\n if (print) {\n const vdom = viewEvents(data);\n newWin(toHTML(vdom));\n } else {\n console.log('=== GLOBAL EVENTS ===')\n data.filter(event => event.global && event.event !== '.')\n .forEach(({ event, components }) => console.log({ event }, components));\n console.log('=== LOCAL EVENTS ===')\n data.filter(event => !event.global && event.event !== '.')\n .forEach(({ event, components }) => console.log({ event }, components));\n }\n}\n\nconst _components = (print?) => {\n const components = componentCache;\n const data = [];\n\n if (components instanceof Map) {\n for (let [key, comps] of components) {\n const element = typeof key === 'string' ? document.getElementById(key) || document.querySelector(key) : key;\n data.push({ element, comps });\n }\n }\n if (print) {\n const vdom = viewComponents(data);\n newWin(toHTML(vdom));\n } else {\n data.forEach(({ element, comps }) => console.log(element, comps));\n }\n}\n\nlet debugging = Number(window?.localStorage?.getItem('__apprun_debugging__')) || 0;\napp.on('debug', p => {\n if (debugging & 1 && p.event) console.log(p);\n if (debugging & 2 && p.vdom) console.log(p);\n});\n\nwindow['_apprun-components'] = ['components [print|clear]', (p) => {\n if (p === 'print') {\n _components(true);\n } else if (p === 'clear') {\n componentCache.clear();\n console.log('Component cache cleared');\n } else {\n _components(false);\n }\n}]\n\nwindow['_apprun-events'] = ['events [print]', (p) => {\n _events(p === 'print');\n}]\n\nwindow['_apprun-log'] = ['log [event|view] on|off', (a1?, a2?) => {\n if (a1 === 'on') {\n debugging = 3;\n } else if (a1 === 'off') {\n debugging = 0;\n } else if (a1 === 'event') {\n if (a2 === 'on') {\n debugging |= 1;\n } else if (a2 === 'off') {\n debugging &= ~1;\n }\n } else if (a1 === 'view') {\n if (a2 === 'on') {\n debugging |= 2;\n } else if (a2 === 'off') {\n debugging &= ~2;\n }\n }\n console.log(`* log ${a1} ${a2 || ''}`);\n window?.localStorage?.setItem('__apprun_debugging__', `${debugging}`)\n}];\n\nwindow['_apprun-create-event-tests'] = ['create-event-tests',\n () => _createEventTests()\n]\n\nwindow['_apprun-create-state-tests'] = ['create-state-tests <start|stop>',\n (p?) => _createStateTests(p)\n]\n\nwindow['_apprun'] = (strings) => {\n const [cmd, ...p] = strings[0].split(' ').filter(c => !!c);\n const command = window[`_apprun-${cmd}`];\n if (command) command[1](...p);\n else window['_apprun-help'][1]();\n}\n\nconsole.info('AppRun DevTools 3.36: type \"_apprun `help`\" to list all available commands.');\n\nconst reduxExt = window['__REDUX_DEVTOOLS_EXTENSION__'];\nif (reduxExt) {\n let devTools_running = false;\n const devTools = window['__REDUX_DEVTOOLS_EXTENSION__'].connect();\n if (devTools) {\n const hash = location.hash || '#';\n devTools.send(hash, '');\n const buf = [{ component: null, state: '' }];\n console.info('Connected to the Redux DevTools');\n devTools.subscribe((message) => {\n if (message.type === 'START') devTools_running = true;\n else if (message.type === 'STOP') devTools_running = false;\n else if (message.type === 'DISPATCH') {\n // console.log('From Redux DevTools: ', message);\n const idx = message.payload.index;\n if (idx === 0) { app.run(hash) }\n else {\n const { component, state } = buf[idx];\n component?.setState(state);\n }\n }\n });\n\n const send = (component, action, state) => {\n if (state == null) return;\n buf.push({ component, state });\n devTools.send(action, state);\n }\n\n app.on('debug', p => {\n if (devTools_running && p.event) {\n const state = p.newState;\n const type = p.event;\n const payload = p.p;\n const action = { type, payload };\n const component = p.component;\n if (state instanceof Promise) {\n state.then(s => send(component, action, s));\n } else {\n send(component, action, state);\n }\n }\n });\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","g","globalThis","Function","e","window","_app","self","app","_AppRunVersions","constructor","_reporting_error","_events","_wildcard_events","on","name","fn","options","sub","push","endsWith","prefix","replace","sort","a","b","length","off","subscribers","filter","item","find","run","args","getSubscribers","debug","console","assert","forEach","error","delay","Object","keys","apply","reportError","phase","once","source","_source","_t","clearTimeout","setTimeout","runAsync","promises","map","Promise","resolve","result","catch","reject","all","context","payload","event","errorSubscribers","call","errorHandlerError","removeOnceWildcardSubscriber","evt","events","calls","slice","startsWith","toHTMLArray","nodes","node","toHTML","join","clean","obj","i","vdom","toString","Array","isArray","tag","props","prop","toProps","children","JSON","stringify","win","openWin","open","document","write","location","href","text","closeWin","close","print_component_test","component","_actions","action","recording","p","log","createProxy","handler","get","target","property","receiver","value","Reflect","Proxy","getVDOM","view","state","proxy","componentCache","Map","newWin","html","element","set","warn","cmd","substring","_components","print","components","data","key","comps","getElementById","querySelector","Components","component_def","actions","update","input","tagName","toLowerCase","id","className","split","c","viewElement","viewComponents","debugging","Number","localStorage","getItem","clear","global_events","cache","add_component","global","Events","viewEvents","a1","a2","setItem","o","el","_createEventTests","s","idx","undefined","strings","command","info","devTools_running","devTools","connect","hash","send","buf","subscribe","message","type","index","setState","newState","then"],"sourceRoot":""}
@@ -0,0 +1,34 @@
1
+ const n="6.0.0",t=`AppRun-${n}`;class e{constructor(){this._reporting_error=!1,this._events={},this._wildcard_events=[]}on(n,t,e={}){this._events[n]=this._events[n]||[];const o={fn:t,options:e};this._events[n].push(o),n.endsWith("*")&&(this._wildcard_events.push({name:n,prefix:n.replace("*",""),sub:o}),this._wildcard_events.sort(((n,t)=>t.name.length-n.name.length)))}off(n,t){const e=this._events[n]||[];this._events[n]=e.filter((n=>n.fn!==t)),n.endsWith("*")&&(this._wildcard_events=this._wildcard_events.filter((e=>!(e.name===n&&e.sub.fn===t))))}find(n){return this._events[n]}run(n,...t){const e=this.getSubscribers(n,this._events);return this.debug&&console.assert(e&&e.length>0,"No subscriber for event: "+n),e.forEach((e=>{const{fn:o,options:l}=e;if(!o||"function"!=typeof o)return console.error(`AppRun event handler for '${n}' is not a function:`,o),!1;if(l.delay)this.delay(n,e,t);else try{Object.keys(l).length>0?o.apply(this,[...t,l]):o.apply(this,t)}catch(e){this.reportError(n,e,{phase:"run",args:t})}})),e.length}once(n,t,e={}){this.on(n,t,{...e,once:!0})}delay(n,t,e){const o=t._source||t,{fn:l,options:i}=t;o._t&&clearTimeout(o._t),o._t=setTimeout((()=>{clearTimeout(o._t),o._t=null;try{Object.keys(i).length>0?l.apply(this,[...e,i]):l.apply(this,e)}catch(t){this.reportError(n,t,{phase:"delay",args:e})}}),i.delay)}runAsync(n,...t){const e=this.getSubscribers(n,this._events);this.debug&&console.assert(e&&e.length>0,"No subscriber for event: "+n);const o=e.map((e=>{const{fn:o,options:l}=e;if(!o||"function"!=typeof o)return console.error(`AppRun async event handler for '${n}' is not a function:`,o),Promise.resolve(null);try{const e=Object.keys(l).length>0?o.apply(this,[...t,l]):o.apply(this,t);return Promise.resolve(e).catch((e=>(this.reportError(n,e,{phase:"runAsync",args:t}),Promise.reject(e))))}catch(e){return this.reportError(n,e,{phase:"runAsync",args:t}),Promise.reject(e)}}));return Promise.all(o)}reportError(n,t,e={}){const o={event:n,error:t,app:this,...e},l="error"===n||this._reporting_error?[]:this.getSubscribers("error",this._events);if(l.length>0){this._reporting_error=!0;try{l.forEach((n=>{try{n.fn.call(this,o)}catch(n){console.error("Error in error event handler:",n)}}))}finally{this._reporting_error=!1}}else"delay"===e.phase?console.error(`Error in delayed event handler for '${n}':`,t):"runAsync"===e.phase?console.error(`Error in async event handler for '${n}':`,t):console.error(`Error in event handler for '${n}':`,t)}removeOnceWildcardSubscriber(n,t){this._events[n]=(this._events[n]||[]).filter((n=>n!==t)),this._wildcard_events=this._wildcard_events.filter((n=>n.sub!==t))}getSubscribers(n,t){const e=t[n]||[],o=e.slice();return t[n]=e.filter((n=>!n.options.once)),this._wildcard_events.filter((({name:t,prefix:e})=>t!==n&&n.startsWith(e))).forEach((({name:t,sub:e})=>{e.options.once&&this.removeOnceWildcardSubscriber(t,e),o.push({...e,_source:e,options:{...e.options,event:n}})})),o}}const o=t;let l;const i="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(n){return n?.target instanceof HTMLElement?n.target:null}i.app&&i._AppRunVersions?l=i.app:(l=new e,i.app=l,i._AppRunVersions=o);const r=n=>{if(!n)return[];const t=[];let e="",o=!1,l="";for(let i=0;i<n.length;i++){const s=n[i];"["!==s||o?"]"===s&&o?(l?e=e.slice(1,-1):/^\d+$/.test(e)&&(e=parseInt(e,10)),t.push(e),e="",o=!1,l=""):'"'!==s&&"'"!==s||!o?"."!==s||o?e+=s:e&&(t.push(e),e=""):(l?s===l&&(l=""):l=s,e+=s):(e&&(t.push(e),e=""),o=!0)}return e&&t.push(e),t},u=(n,t)=>{if(!t)return n.state||"";const e=r(t),o=((n,t)=>{let e=n;for(const n of t){if(null==e)return;e=e[n]}return e})(n.state,e);return void 0!==o?o:""},a=(n,t,e)=>{if(!t)return void n.setState(e);const o=r(t),l=((n,t,e)=>{if(0===t.length)return e;const o={...n};let l=o;for(let n=0;n<t.length-1;n++){const e=t[n],o=t[n+1];null==l[e]?l[e]="number"==typeof o?[]:{}:Array.isArray(l[e])?l[e]=[...l[e]]:"object"==typeof l[e]&&(l[e]={...l[e]}),l=l[e]}return l[t[t.length-1]]=e,o})(n.state||{},o,e);n.setState(l)},c=(n,t)=>{if(Array.isArray(n))return n.map((n=>c(n,t)));{let{type:e,tag:o,props:i,children:r}=n;return o=o||e,r=r||i?.children,i&&Object.keys(i).forEach((n=>{n.startsWith("$")&&(((n,t,e,o)=>{if(n.startsWith("$on")){const e=t[n];if(n=n.substring(1),"boolean"==typeof e)t[n]=t=>o.run?o.run(n,t):l.run(n,t);else if("string"==typeof e)t[n]=n=>o.run?o.run(e,n):l.run(e,n);else if("function"==typeof e)t[n]=n=>o.setState(e(o.state,n));else if(Array.isArray(e)){const[i,...s]=e;"string"==typeof i?t[n]=n=>o.run?o.run(i,...s,n):l.run(i,...s,n):"function"==typeof i&&(t[n]=n=>o.setState(i(o.state,...s,n)))}}else if("$bind"===n){const l=t.type||"text",i="string"==typeof t[n]?t[n]:t.name;if("input"===e)switch(l){case"checkbox":t.checked=u(o,i),t.onclick=n=>{const t=s(n);t&&a(o,i||t.name,t.checked)};break;case"radio":t.checked=u(o,i)===t.value,t.onclick=n=>{const t=s(n);t&&a(o,i||t.name,t.value)};break;case"number":case"range":t.value=u(o,i),t.oninput=n=>{const t=s(n);t&&a(o,i||t.name,Number(t.value))};break;default:t.value=u(o,i),t.oninput=n=>{const t=s(n);t&&a(o,i||t.name,t.value)}}else"select"===e?(t.value=u(o,i),t.onchange=n=>{const t=s(n);t&&!t.multiple&&a(o,i||t.name,t.value)}):"option"===e?(t.selected=u(o,i),t.onclick=n=>{const t=s(n);t&&a(o,i||t.name,t.selected)}):"textarea"===e&&(t.value=u(o,i),t.oninput=n=>{const t=s(n);t&&a(o,i||t.name,t.value)})}else l.run("$",{key:n,tag:e,props:t,component:o})})(n,i,o,t),delete i[n])})),r&&c(r,t),n}};class h{constructor(n,t,e){this.normal=t,this.property=n,e&&(this.space=e)}}function d(n,t){const e={},o={};for(const t of n)Object.assign(e,t.property),Object.assign(o,t.normal);return new h(e,o,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=C(),y=C(),v=C(),b=C(),w=C(),S=C(),k=C();function C(){return 2**++g}var x=Object.freeze({__proto__:null,boolean:m,booleanish:y,commaOrSpaceSeparated:k,commaSeparated:S,number:b,overloadedBoolean:v,spaceSeparated:w});const O=Object.keys(x);class M extends p{constructor(n,t,e,o){let l=-1;if(super(n,t),A(this,"space",o),"number"==typeof e)for(;++l<O.length;){const n=O[l];A(this,O[l],(e&x[n])===x[n])}}}function A(n,t,e){e&&(n[t]=e)}function P(n){const t={},e={};for(const[o,l]of Object.entries(n.properties)){const i=new M(o,n.transform(n.attributes||{},o),l,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(i.mustUseProperty=!0),t[o]=i,e[f(o)]=o,e[f(i.attribute)]=o}return new h(t,e,n.space)}M.prototype.defined=!0;const E=P({properties:{ariaActiveDescendant:null,ariaAtomic:y,ariaAutoComplete:null,ariaBusy:y,ariaChecked:y,ariaColCount:b,ariaColIndex:b,ariaColSpan:b,ariaControls:w,ariaCurrent:null,ariaDescribedBy:w,ariaDetails:null,ariaDisabled:y,ariaDropEffect:w,ariaErrorMessage:null,ariaExpanded:y,ariaFlowTo:w,ariaGrabbed:y,ariaHasPopup:null,ariaHidden:y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:w,ariaLevel:b,ariaLive:null,ariaModal:y,ariaMultiLine:y,ariaMultiSelectable:y,ariaOrientation:null,ariaOwns:w,ariaPlaceholder:null,ariaPosInSet:b,ariaPressed:y,ariaReadOnly:y,ariaRelevant:null,ariaRequired:y,ariaRoleDescription:w,ariaRowCount:b,ariaRowIndex:b,ariaRowSpan:b,ariaSelected:y,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 $(n,t){return t in n?n[t]:t}function R(n,t){return $(n,t.toLowerCase())}const D=P({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:y,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:v,draggable:y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:m,formTarget:null,headers:w,height:b,hidden:v,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:y,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:y,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:y,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:R}),L=P({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:$}),T=P({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=P({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:R}),_=P({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 N(n){return n.charAt(1).toUpperCase()}const H=d([E,D,T,j,_],"html"),F=d([E,L,T,j,_],"svg"),V="_props",W=new Map;function q(n,t){const e=`${n}:${t}`;let o=W.get(e);return void 0===o&&(o=function(n,t){const e=f(t);let o=t,l=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,N);o="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}}l=M}return new l(o,t)}(t?F:H,n)||null,W.set(e,o)),o}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(o){Y(n,t,e,!1)}}function Y(n,t,e,o){if(null==e)return void n.removeAttribute(t);const l=String(e);if(o&&t.includes(":")){const[e]=t.split(":");"xlink"===e?n.setAttributeNS("http://www.w3.org/1999/xlink",t,l):n.setAttribute(t,l)}else n.setAttribute(t,l)}function Z(n,t,e,o){if(function(n,t){if(document.activeElement===n)return["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 o=(l=t.slice(5)).length<=1?l.toLowerCase():l.split("-").map(((n,t)=>0===t?n.toLowerCase():n.charAt(0).toUpperCase()+n.slice(1).toLowerCase())).join("");var l;null==e?delete n.dataset[o]:n.dataset[o]=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 l=q(t,o);l?l.boolean||l.overloadedBoolean?K(n,l.attribute,e):l.mustUseProperty&&!o?X(n,l.property,e):Y(n,l.attribute,e,o):t.startsWith("aria-")||"role"===t?Y(n,t,e,o):t in n||void 0!==n[t]?X(n,t,e):Y(n,t,e,o)}function J(n){return/^[a-zA-Z_:][\w\-:.]*$/.test(n)&&!n.includes("<")&&!n.includes(">")&&!n.includes('"')&&!n.includes("'")}function G(n,t,e){const o=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,o){for(const e in t)J(e)&&Z(n,e,t[e],o);t&&"function"==typeof t.ref&&window.requestAnimationFrame((()=>t.ref(n)))}(n,o,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}function tn(n,t,...e){const o=nn(e);if("string"==typeof n)return{tag:n,props:t,children:o};if(Array.isArray(n))return n;if(void 0===n&&e)return o;if(Object.getPrototypeOf(n).i)return{tag:n,props:t,children:o};if("function"==typeof n)return n(t,o);throw new Error(`Unknown tag in vdom ${n}`)}const en=(n,t,e={})=>{if(null==t||!1===t)return;!function(n,t,e={}){if(null==t||!1===t)return;if(function(n){if(!n||!n.m)return;n.v={}}(e),t=hn(t,e),function(n){if(!n||!n.m||!n.v)return;Object.keys(n.m).forEach((t=>{n.v[t]||(n.m[t]?.unmount?.(),delete n.m[t])})),n.v=null}(e),!n)return;const o="SVG"===n.nodeName;Array.isArray(t)?ln(n,t,o):ln(n,[t],o)}("string"==typeof n&&n?document.getElementById(n)||document.querySelector(n):n,t=c(t,e),e)};function on(n,t,e){e=e||"svg"===t.tag,function(n,t){const e=n.nodeName,o=`${t.tag||""}`;return e.toUpperCase()===o.toUpperCase()}(n,t)?(ln(n,t.children,e),G(n,t.props,e)):n.parentNode.replaceChild(cn(t,e),n)}function ln(n,t,e){const o={};Array.from(n.childNodes||[]).forEach((n=>{void 0!==n.key&&null!==n.key&&(o[sn(n.key)]=n)}));const l=n.childNodes?.length||0,i=t?.length||0,s=Math.min(l,i);for(let l=0;l<s;l++){const i=t[l],s=n.childNodes[l];if("string"==typeof i)s.textContent!==i&&(3===s.nodeType?s.nodeValue=i:n.replaceChild(an(i),s));else if(i instanceof HTMLElement||i instanceof SVGElement)n.insertBefore(i,s);else{const t=i.props?i.props.key:void 0;if(null!=t)if(s.key===t)on(n.childNodes[l],i,e);else{const r=o[sn(t)];r?(n.insertBefore(r,s),on(n.childNodes[l],i,e)):n.replaceChild(cn(i,e),s)}else on(n.childNodes[l],i,e)}}let r=n.childNodes?.length||0;for(;r>s;)n.removeChild(n.lastChild),r--;if(i>s){const o=document.createDocumentFragment();for(let n=s;n<t.length;n++)o.appendChild(cn(t[n],e));n.appendChild(o)}}function sn(n){return`${typeof n}:${String(n)}`}const rn=n=>{const t=document.createElement("section");return t.insertAdjacentHTML("afterbegin",n),Array.from(t.children)},un=rn;function an(n){return document.createTextNode(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&&null!==n.props.key&&(e.key=n.props.key),e}function hn(n,t,e=0){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:o,props:l,children:i}=n,s=l&&l.id,r=null!=s?String(s):`_${e}`;let u="section";l&&l.as&&(u=l.as,delete l.as),t.m||(t.m={}),function(n,t){n&&(n.v=n.v||{},n.v[t]=!0)}(t,r);let a=t.m[r];if(a&&a instanceof o&&a.element)a.renderState(a.state);else{const n=document.createElement(u);a=t.m[r]=new o({...l,children:i}).mount(n,{render:!0})}if(a.mounted){const n=a.mounted(l,i,a.state);void 0!==n&&a.setState(n)}return G(a.element,l,!1),a.element}(n,t,e)),o&&Array.isArray(o.children)){const n=o.props?._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(),this._pendingAttributes=[]}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&&null==this._mountFrame){const e=t||{};this._shadowRoot=e.shadow?this.attachShadow({mode:"open"}):this;const o=e.observedAttributes||[],l=o.reduce(((n,t)=>{const e=t.toLowerCase();return e!==t&&(n[e]=t),n}),{});this._attrMap=n=>l[n]||n;const i={};Array.from(this.attributes).forEach((n=>i[this._attrMap(n.name)]=n.value)),o.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})})),this._mountFrame=requestAnimationFrame((()=>{if(this._mountFrame=null,!this.isConnected)return;const t=this.children?Array.from(this.children):[];if(this._component=new n({...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);const o=this._pendingAttributes;this._pendingAttributes=[],o.forEach((({name:n,oldValue:t,value:e})=>{this.attributeChangedCallback(n,t,e)})),!1!==e.render&&this._component.run(".")}))}}disconnectedCallback(){null!=this._mountFrame&&(cancelAnimationFrame(this._mountFrame),this._mountFrame=null),this._pendingAttributes=[],this._component?.unload?.(this._component.state),this._component?.unmount?.(),this._component=null}attributeChangedCallback(n,e,o){if(this._component){const l=this._attrMap?this._attrMap(n):n;this._component._props[l]=o,this._component.run("attributeChanged",l,e,o),o!==e&&!1!==t.render&&window.requestAnimationFrame((()=>{this._component?.run(".")}))}else this._pendingAttributes.push({name:n,oldValue:e,value:o})}};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,o,l)=>{const i=n?n.toString():o;return pn.defineMetadata(`apprun-update:${i}`,{name:i,key:o,options:t},e),l}}function mn(n,t={}){return function(e,o){const l=n?n.toString():o;pn.defineMetadata(`apprun-update:${l}`,{name:l,key:o,options:t},e)}}function yn(n,t){return function(e){return fn(n,e,t),e}}const vn=n=>n,bn=l;let wn=0;const Sn="_c",kn=new Map;let Cn=null;function xn(){0===kn.size&&Cn&&(Cn.disconnect(),Cn=null)}function On(n){const t=kn.get(n);t&&(kn.delete(n),t.component.unload?.(t.component.state),xn())}function Mn(n,t,e){const o=kn.get(t);o&&o.component!==n&&On(t),kn.set(t,{component:n,tracking_id:e}),!Cn&&"undefined"!=typeof MutationObserver&&"object"==typeof document&&document.body&&(Cn=new MutationObserver((n=>{n.forEach((n=>{if("attributes"===n.type){const t=n.target,e=kn.get(t);e&&n.oldValue===e.tracking_id&&On(t)}else"childList"===n.type&&Array.from(kn.keys()).forEach((n=>{document.body.contains(n)||On(n)}))}))})),Cn.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[Sn]}))}function An(n){n&&(kn.delete(n),xn())}class Pn{renderState(n,t=null){if(!this.view)return;let e=t||this.view(n);if(bn.debug&&bn.run("debug",{component:this,_:e?".":"-",state:n,vdom:e,el:this.element}),"object"!=typeof document)return;const o="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;o?(this.unload?o._component===this&&o.getAttribute(Sn)===this.tracking_id||(this.tracking_element&&this.tracking_element!==o&&An(this.tracking_element),this.tracking_id=(++wn).toString(36),o.setAttribute(Sn,this.tracking_id),this.tracking_element=o,Mn(this,o,this.tracking_id)):(An(this.tracking_element),this.tracking_element=null,o.removeAttribute&&o.removeAttribute(Sn)),o._component=this,!t&&e&&(e=c(e,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>bn.render(o,e,this))):bn.render(o,e,this)),this.rendered&&this.rendered(this.state)):console.warn(`Component element not found: ${this.element}`)}setState(n,t={render:!0,history:!1}){const e=async n=>{try{for(;;){const{value:e,done:o}=await n.next();if(o)break;this.setState(e,t)}}catch(n){console.error("Error in async iterator:",n)}},o=n;if(o?.[Symbol.asyncIterator])this.setState(e(o[Symbol.asyncIterator]()),t);else if(o?.[Symbol.iterator]&&"function"==typeof o.next)for(const n of o)this.setState(n,t);else if(n&&n instanceof Promise){const e=n;this._pending_state=e,Promise.resolve(e).then((n=>{this._pending_state===e&&(this._pending_state=null,this.setState(n,t))}))}else{if(this._state=n,null==n)return;this._pending_state=null,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,o,l={}){this.state=n,this.view=t,this.update=o,this.options=l,this._app=new e,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this.enable_history=!1,this.global_event=!1,this.tracking_element=null,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,{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){if(console.assert(!this.element,"Component already mounted."),this.options=t={...this.options,...t},this.element=n,this.global_event=t.global_event,this.enable_history=!!t.history,this.enable_history){const n=function(n){return"object"==typeof n&&null!==n?n:{}}(t.history);this.on(n.prev||"history-prev",this._history_prev),this.on(n.next||"history-next",this._history_next)}return t.route&&(this.update=this.update||{},this.update[t.route]||(this.update[t.route]=vn)),this.add_actions(),this.state=this.state??this.model??{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!t.render,history:!0}),bn.debug&&bn.find("debug-create-component")?.length&&bn.run("debug-create-component",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,((...o)=>{bn.debug&&bn.run("debug",{component:this,_:">",event:n,p:o,current_state:this.state,options:e});try{const l=t(this.state,...o);bn.debug&&bn.run("debug",{component:this,_:"<",event:n,p:o,newState:l,state:this.state,options:e}),this.setState(l,e)}catch(t){const l={event:n,error:t,component:this,state:this.state,args:o,phase:"component"};bn.find("error")?.length?bn.run("error",l):console.error(`Error in component action '${n}':`,t),bn.debug&&bn.run("debug",{component:this,_:"!",event:n,p:o,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,o,l]=n;e.toString().split(",").forEach((n=>t[n.trim()]=[o,l]))})):Object.keys(n).forEach((e=>{const o=n[e];("function"==typeof o||Array.isArray(o))&&e.split(",").forEach((n=>t[n.trim()]=o))})),t["."]||(t["."]=vn),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)?bn.run(e,...t):this._app.run(e,...t)}}on(n,t,e){const o=n.toString();return this._actions.push({name:o,fn:t}),this.is_global_event(o)?bn.on(o,t,e):this._app.on(o,t,e)}runAsync(n,...t){const e=n.toString();return this.is_global_event(e)?bn.runAsync(e,...t):this._app.runAsync(e,...t)}unmount(){An(this.tracking_element),this.tracking_element=null,this._actions.forEach((n=>{const{name:t,fn:e}=n;this.is_global_event(t)?bn.off(t,e):this._app.off(t,e)}))}}function En(n){return n?n.startsWith("#/")?n.substring(2).split("/"):n.startsWith("#")||n.startsWith("/")?n.substring(1).split("/"):n.split("/"):[]}function $n(n){return n.startsWith("#/")?"hash-slash":n.startsWith("#")?"hash":n.startsWith("/")?"path":"non-prefixed"}function Rn(n,t,e){if($n(n)!==t||!En(n).some((n=>"*"===n||n.startsWith(":"))))return null;const o=En(n),l=[];let i=0;for(let t=0;t<o.length;t++){const s=o[t];if("*"===s)return l.push(e.slice(t).join("/")),{eventName:n,parameters:l,score:10*i+o.length};const r=e[t];if(void 0===r)return null;if(s.startsWith(":"))l.push(r);else{if(s!==r)return null;i++}}return o.length!==e.length?null:{eventName:n,parameters:l,score:10*i+o.length}}function Dn(){const n=l.find("#");if(n&&n.length>0)return l.run("#"),void l.run(jn,"#");const t=l.find("/");if(t&&t.length>0)return l.run("/"),void l.run(jn,"/");const e=l.find("#/");if(e&&e.length>0)return l.run("#/"),void l.run(jn,"#/");l.debug&&console.warn("No subscribers for event: "),l.run(_n,""),l.run(jn,"")}function Ln(n){if(!n)return void Dn();n=function(n){return n&&"/"!==n&&"#"!==n&&"#/"!==n&&n.endsWith("/")?n.slice(0,-1):n}(n);const t=l.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=En(n);!function(n){const t=n.filter(Boolean);t.length>11&&console.warn(`Deep route hierarchy detected: ${t.join("/")} (${t.length} levels)`)}(e);const o=$n(n),i=function(n,t){const e=[];for(let o=n.length;o>0;o--){const l=n.slice(0,o);let i="";switch(t){case"path":i="/"+l.join("/");break;case"hash":i="#"+l.join("/");break;case"hash-slash":i="#/"+l.join("/");break;case"non-prefixed":i=l.join("/")}e.push(i)}return e}(e,o),s=i[0],r=l.find(s),u=r&&r.length>0?{eventName:s,parameters:[]}:function(n,t){const e=Object.keys(l._events||{}).map((e=>Rn(e,n,t))).filter(Boolean).sort(((n,t)=>t.score-n.score||t.eventName.length-n.eventName.length));return e.length>0?{eventName:e[0].eventName,parameters:e[0].parameters}:null}(o,e)||function(n,t){for(let e=0;e<n.length;e++){const o=n[e],i=l.find(o);if(i&&i.length>0){const l=n.length-e;return{eventName:o,parameters:t.slice(l)}}}return null}(i.slice(1),e);if(u)Tn(u.eventName,...u.parameters);else if(i.length>0){const t=i[i.length-1];l.debug&&console.warn(`No subscribers for event: ${t}`),l.run(_n,n),l.run(jn,n)}else Dn()}Pn.i=!0;const Tn=(n,...t)=>{if(!n||n===jn||n===_n)return;const e=l.find(n);e&&0!==e.length?l.run(n,...t):(l.debug&&console.warn(`No subscribers for event: ${n}`),l.run(_n,n,...t)),l.run(jn,n,...t)},jn="//",_n="///",Un=n=>{l.lastUrl!==n&&(l.lastUrl=n,Ln(n))};function zn(n){return n&&"object"==typeof n&&"function"==typeof n.mount}function In(n){return"function"==typeof n&&n.prototype&&n.prototype.constructor===n&&(void 0!==n.prototype.mount||void 0!==n.prototype.state||void 0!==n.prototype.view)}function Bn(n){return"function"==typeof n&&!In(n)}async function Nn(n,t=3){let e=n,o=0;for(;Bn(e)&&o<t;)try{const n=await e();if(n===e)break;e=n,o++}catch(n){console.error(`Error executing component function: ${n}`);break}return e}const Hn=l,Fn=(n,t)=>{if(!((n,t)=>!(!t||n.defaultPrevented||0!==n.button||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||t.target&&"_self"!==t.target.toLowerCase()||t.hasAttribute("download")||(t.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("external")||t.origin!==location.origin||!t.pathname))(n,t))return!1;n.preventDefault();const e=(Hn.basePath||"")+t.pathname;return history.pushState(null,"",e),Un(t.pathname),!0};if(!Hn.start){Hn.version=n,Hn.h=Hn.createElement=tn,Hn.render=en,Hn.Fragment=Q,Hn.webComponent=fn,Hn.trustedHTML=rn,Hn.safeHTML=un,Hn.start=(n,t,e,o,l)=>{const i={render:!0,global_event:!0,...l},s=new Pn(t,e,o);return l&&l.rendered&&(s.rendered=l.rendered),l&&l.mounted&&(s.mounted=l.mounted),s.start(n,i),s};const t=n=>{};if(Hn.on("/",t),Hn.on("debug",(n=>t)),Hn.on(jn,t),Hn.on(_n,t),Hn.route=Un,Hn.on("route",(n=>Hn.route&&Hn.route(n))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{const n=document.body.hasAttribute("apprun-no-init")||Hn["no-init-route"]||!1,t=Hn.find("#")||Hn.find("#/")||!1;window.addEventListener("hashchange",(()=>Un(location.hash))),window.addEventListener("popstate",(()=>Un(location.pathname))),t?!n&&Un(location.hash):(!n&&(()=>{const n=Hn.basePath||"";let t=location.pathname;n&&t.startsWith(n)&&(t=t.substring(n.length),t.startsWith("/")||(t="/"+t)),Un(t)})(),document.body.addEventListener("click",(n=>{const t=n.target,e=t instanceof Element?t:t?.parentElement;if(!e)return;const o="A"===e.tagName?e:e.closest("a");Fn(n,o)})))})),"object"==typeof window){const n=window;n.Component=Pn,n.on=mn,n.customElement=yn,n.trustedHTML=rn,n.safeHTML=un}Hn.use_render=(n,t=0)=>{Hn.render=0===t?(t,e)=>n(e,t):(t,e)=>n(t,e)},Hn.use_react=(n,t)=>{if(n&&t)if("function"==typeof n.createElement)if(n.Fragment)if(Hn.h=Hn.createElement=n.createElement,Hn.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+");Hn.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");Hn.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")},Hn.addComponents=async(n,t)=>{for(const[e,o]of Object.entries(t))if(o&&e)if(zn(o)){const t={route:e};o.mount(n,t)}else if(In(o)){const t={route:e};(new o).mount(n,t)}else if(Bn(o)){let t=await Nn(o);if(zn(t)){const o={route:e};t.mount(n,o);continue}if(In(t)){const o={route:e};(new t).mount(n,o);continue}l.on(e,((...t)=>{const e=o(...t),i="string"==typeof n?document.querySelector(n):n;if(i)return l.render(i,e);console.error(`Element not found: ${n}`)}))}else console.error("Invalid component: component must be a class, instance, or function that returns a class/instance");else console.error(`Invalid component configuration: component=${o}, route=${e}`)}}
2
+ /**
3
+ * @license
4
+ * Copyright 2019 Google LLC
5
+ * SPDX-License-Identifier: BSD-3-Clause
6
+ */const Vn=globalThis,Wn=Vn.ShadowRoot&&(void 0===Vn.ShadyCSS||Vn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,qn=Symbol(),Kn=new WeakMap;let Xn=class{constructor(n,t,e){if(this._$cssResult$=!0,e!==qn)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(Wn&&void 0===n){const e=void 0!==t&&1===t.length;e&&(n=Kn.get(t)),void 0===n&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),e&&Kn.set(t,n))}return n}toString(){return this.cssText}};const Yn=Wn?n=>n:n=>n instanceof CSSStyleSheet?(n=>{let t="";for(const e of n.cssRules)t+=e.cssText;return(n=>new Xn("string"==typeof n?n:n+"",void 0,qn))(t)})(n):n
7
+ /**
8
+ * @license
9
+ * Copyright 2017 Google LLC
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */,{is:Zn,defineProperty:Jn,getOwnPropertyDescriptor:Gn,getOwnPropertyNames:Qn,getOwnPropertySymbols:nt,getPrototypeOf:tt}=Object,et=globalThis,ot=et.trustedTypes,lt=ot?ot.emptyScript:"",it=et.reactiveElementPolyfillSupport,st=(n,t)=>n,rt={toAttribute(n,t){switch(t){case Boolean:n=n?lt: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}},ut=(n,t)=>!Zn(n,t),at={attribute:!0,type:String,converter:rt,reflect:!1,useDefault:!1,hasChanged:ut};Symbol.metadata??=Symbol("metadata"),et.litPropertyMetadata??=new WeakMap;let ct=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=at){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(),o=this.getPropertyDescriptor(n,e,t);void 0!==o&&Jn(this.prototype,n,o)}}static getPropertyDescriptor(n,t,e){const{get:o,set:l}=Gn(this.prototype,n)??{get(){return this[t]},set(n){this[t]=n}};return{get:o,set(t){const i=o?.call(this);l?.call(this,t),this.requestUpdate(n,i,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??at}static _$Ei(){if(this.hasOwnProperty(st("elementProperties")))return;const n=tt(this);n.finalize(),void 0!==n.l&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(st("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(st("properties"))){const n=this.properties,t=[...Qn(n),...nt(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(Yn(n))}else void 0!==n&&t.push(Yn(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(Wn)n.adoptedStyleSheets=t.map((n=>n instanceof CSSStyleSheet?n:n.styleSheet));else for(const e of t){const t=document.createElement("style"),o=Vn.litNonce;void 0!==o&&t.setAttribute("nonce",o),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),o=this.constructor._$Eu(n,e);if(void 0!==o&&!0===e.reflect){const l=(void 0!==e.converter?.toAttribute?e.converter:rt).toAttribute(t,e.type);this._$Em=n,null==l?this.removeAttribute(o):this.setAttribute(o,l),this._$Em=null}}_$AK(n,t){const e=this.constructor,o=e._$Eh.get(n);if(void 0!==o&&this._$Em!==o){const n=e.getPropertyOptions(o),l="function"==typeof n.converter?{fromAttribute:n.converter}:void 0!==n.converter?.fromAttribute?n.converter:rt;this._$Em=o,this[o]=l.fromAttribute(t,n.type)??this._$Ej?.get(o)??null,this._$Em=null}}requestUpdate(n,t,e){if(void 0!==n){const o=this.constructor,l=this[n];if(e??=o.getPropertyOptions(n),!((e.hasChanged??ut)(l,t)||e.useDefault&&e.reflect&&l===this._$Ej?.get(n)&&!this.hasAttribute(o._$Eu(n,e))))return;this.C(n,t,e)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(n,t,{useDefault:e,reflect:o,wrapped:l},i){e&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,i??t??this[n]),!0!==l||void 0!==i)||(this._$AL.has(n)||(this.hasUpdated||e||(t=void 0),this._$AL.set(n,t)),!0===o&&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,o=this[t];!0!==n||this._$AL.has(t)||void 0===o||this.C(t,void 0,e,o)}}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){}};ct.elementStyles=[],ct.shadowRootOptions={mode:"open"},ct[st("elementProperties")]=new Map,ct[st("finalized")]=new Map,it?.({ReactiveElement:ct}),(et.reactiveElementVersions??=[]).push("2.1.0");
12
+ /**
13
+ * @license
14
+ * Copyright 2017 Google LLC
15
+ * SPDX-License-Identifier: BSD-3-Clause
16
+ */
17
+ const ht=globalThis,dt=ht.trustedTypes,ft=dt?dt.createPolicy("lit-html",{createHTML:n=>n}):void 0,pt="$lit$",gt=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+gt,yt=`<${mt}>`,vt=document,bt=()=>vt.createComment(""),wt=n=>null===n||"object"!=typeof n&&"function"!=typeof n,St=Array.isArray,kt="[ \t\n\f\r]",Ct=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xt=/-->/g,Ot=/>/g,Mt=RegExp(`>|${kt}(?:([^\\s"'>=/]+)(${kt}*=${kt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),At=/'/g,Pt=/"/g,Et=/^(?:script|style|textarea|title)$/i,$t=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),Rt=$t(1),Dt=$t(2),Lt=Symbol.for("lit-noChange"),Tt=Symbol.for("lit-nothing"),jt=new WeakMap,_t=vt.createTreeWalker(vt,129);function Ut(n,t){if(!St(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ft?ft.createHTML(t):t}const zt=(n,t)=>{const e=n.length-1,o=[];let l,i=2===t?"<svg>":3===t?"<math>":"",s=Ct;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===Ct?"!--"===u[1]?s=xt:void 0!==u[1]?s=Ot:void 0!==u[2]?(Et.test(u[2])&&(l=RegExp("</"+u[2],"g")),s=Mt):void 0!==u[3]&&(s=Mt):s===Mt?">"===u[0]?(s=l??Ct,a=-1):void 0===u[1]?a=-2:(a=s.lastIndex-u[2].length,r=u[1],s=void 0===u[3]?Mt:'"'===u[3]?Pt:At):s===Pt||s===At?s=Mt:s===xt||s===Ot?s=Ct:(s=Mt,l=void 0);const h=s===Mt&&n[t+1].startsWith("/>")?" ":"";i+=s===Ct?e+yt:a>=0?(o.push(r),e.slice(0,a)+pt+e.slice(a)+gt+h):e+gt+(-2===a?t:h)}return[Ut(n,i+(n[e]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class It{constructor({strings:n,_$litType$:t},e){let o;this.parts=[];let l=0,i=0;const s=n.length-1,r=this.parts,[u,a]=zt(n,t);if(this.el=It.createElement(u,e),_t.currentNode=this.el.content,2===t||3===t){const n=this.el.content.firstChild;n.replaceWith(...n.childNodes)}for(;null!==(o=_t.nextNode())&&r.length<s;){if(1===o.nodeType){if(o.hasAttributes())for(const n of o.getAttributeNames())if(n.endsWith(pt)){const t=a[i++],e=o.getAttribute(n).split(gt),s=/([.?@])?(.*)/.exec(t);r.push({type:1,index:l,name:s[2],strings:e,ctor:"."===s[1]?Vt:"?"===s[1]?Wt:"@"===s[1]?qt:Ft}),o.removeAttribute(n)}else n.startsWith(gt)&&(r.push({type:6,index:l}),o.removeAttribute(n));if(Et.test(o.tagName)){const n=o.textContent.split(gt),t=n.length-1;if(t>0){o.textContent=dt?dt.emptyScript:"";for(let e=0;e<t;e++)o.append(n[e],bt()),_t.nextNode(),r.push({type:2,index:++l});o.append(n[t],bt())}}}else if(8===o.nodeType)if(o.data===mt)r.push({type:2,index:l});else{let n=-1;for(;-1!==(n=o.data.indexOf(gt,n+1));)r.push({type:7,index:l}),n+=gt.length-1}l++}}static createElement(n,t){const e=vt.createElement("template");return e.innerHTML=n,e}}function Bt(n,t,e=n,o){if(t===Lt)return t;let l=void 0!==o?e._$Co?.[o]:e._$Cl;const i=wt(t)?void 0:t._$litDirective$;return l?.constructor!==i&&(l?._$AO?.(!1),void 0===i?l=void 0:(l=new i(n),l._$AT(n,e,o)),void 0!==o?(e._$Co??=[])[o]=l:e._$Cl=l),void 0!==l&&(t=Bt(n,l._$AS(n,t.values),l,o)),t}class Nt{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,o=(n?.creationScope??vt).importNode(t,!0);_t.currentNode=o;let l=_t.nextNode(),i=0,s=0,r=e[0];for(;void 0!==r;){if(i===r.index){let t;2===r.type?t=new Ht(l,l.nextSibling,this,n):1===r.type?t=new r.ctor(l,r.name,r.strings,this,n):6===r.type&&(t=new Kt(l,this,n)),this._$AV.push(t),r=e[++s]}i!==r?.index&&(l=_t.nextNode(),i++)}return _t.currentNode=vt,o}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 Ht{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,t,e,o){this.type=2,this._$AH=Tt,this._$AN=void 0,this._$AA=n,this._$AB=t,this._$AM=e,this.options=o,this._$Cv=o?.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=Bt(this,n,t),wt(n)?n===Tt||null==n||""===n?(this._$AH!==Tt&&this._$AR(),this._$AH=Tt):n!==this._$AH&&n!==Lt&&this._(n):void 0!==n._$litType$?this.$(n):void 0!==n.nodeType?this.T(n):(n=>St(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!==Tt&&wt(this._$AH)?this._$AA.nextSibling.data=n:this.T(vt.createTextNode(n)),this._$AH=n}$(n){const{values:t,_$litType$:e}=n,o="number"==typeof e?this._$AC(n):(void 0===e.el&&(e.el=It.createElement(Ut(e.h,e.h[0]),this.options)),e);if(this._$AH?._$AD===o)this._$AH.p(t);else{const n=new Nt(o,this),e=n.u(this.options);n.p(t),this.T(e),this._$AH=n}}_$AC(n){let t=jt.get(n.strings);return void 0===t&&jt.set(n.strings,t=new It(n)),t}k(n){St(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let e,o=0;for(const l of n)o===t.length?t.push(e=new Ht(this.O(bt()),this.O(bt()),this,this.options)):e=t[o],e._$AI(l),o++;o<t.length&&(this._$AR(e&&e._$AB.nextSibling,o),t.length=o)}_$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 Ft{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,t,e,o,l){this.type=1,this._$AH=Tt,this._$AN=void 0,this.element=n,this.name=t,this._$AM=o,this.options=l,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=Tt}_$AI(n,t=this,e,o){const l=this.strings;let i=!1;if(void 0===l)n=Bt(this,n,t,0),i=!wt(n)||n!==this._$AH&&n!==Lt,i&&(this._$AH=n);else{const o=n;let s,r;for(n=l[0],s=0;s<l.length-1;s++)r=Bt(this,o[e+s],t,s),r===Lt&&(r=this._$AH[s]),i||=!wt(r)||r!==this._$AH[s],r===Tt?n=Tt:n!==Tt&&(n+=(r??"")+l[s+1]),this._$AH[s]=r}i&&!o&&this.j(n)}j(n){n===Tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}}class Vt extends Ft{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===Tt?void 0:n}}class Wt extends Ft{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==Tt)}}class qt extends Ft{constructor(n,t,e,o,l){super(n,t,e,o,l),this.type=5}_$AI(n,t=this){if((n=Bt(this,n,t,0)??Tt)===Lt)return;const e=this._$AH,o=n===Tt&&e!==Tt||n.capture!==e.capture||n.once!==e.once||n.passive!==e.passive,l=n!==Tt&&(e===Tt||o);o&&this.element.removeEventListener(this.name,this,e),l&&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 Kt{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){Bt(this,n)}}const Xt=ht.litHtmlPolyfillSupport;Xt?.(It,Ht),(ht.litHtmlVersions??=[]).push("3.3.0");const Yt=(n,t,e)=>{const o=e?.renderBefore??t;let l=o._$litPart$;if(void 0===l){const n=e?.renderBefore??null;o._$litPart$=l=new Ht(t.insertBefore(bt(),n),n,void 0,e??{})}return l._$AI(n),l
18
+ /**
19
+ * @license
20
+ * Copyright 2017 Google LLC
21
+ * SPDX-License-Identifier: BSD-3-Clause
22
+ */},Zt=globalThis;let Jt=class extends ct{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=Yt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Lt}};Jt._$litElement$=!0,Jt.finalized=!0,Zt.litElementHydrateSupport?.({LitElement:Jt});const Gt=Zt.litElementPolyfillSupport;Gt?.({LitElement:Jt}),(Zt.litElementVersions??=[]).push("4.2.0");
23
+ /**
24
+ * @license
25
+ * Copyright 2017 Google LLC
26
+ * SPDX-License-Identifier: BSD-3-Clause
27
+ */
28
+ const Qt=2,ne=5,te=n=>(...t)=>({_$litDirective$:n,values:t});class ee{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
+ /**
30
+ * @license
31
+ * Copyright 2017 Google LLC
32
+ * SPDX-License-Identifier: BSD-3-Clause
33
+ */class oe extends ee{constructor(n){if(super(n),this.it=Tt,n.type!==Qt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(n){if(n===Tt||null==n)return this._t=void 0,this.it=n;if(n===Lt)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:[]}}}oe.directiveName="unsafeHTML",oe.resultType=1;const le=te(oe);function ie(n,t,e){t&&("string"==typeof t?(n._$litPart$||n.replaceChildren(),Yt(Rt`${le(t)}`,n)):t._$litType$?(n._$litPart$||n.replaceChildren(),Yt(t,n)):(en(n,t,e),n._$litPart$=void 0))}const se=te(class extends ee{constructor(n){if(super(n),n.type!==ne)throw new Error("run() can only be used in event handlers")}update(n,t){const e=n.element,o=n.name,[l,...i]=t,s=()=>{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 l?e[`on${o}`]=n=>{const t=s();t?t.run(l,...i,n):Hn.run(l,...i,n)}:"function"==typeof l&&(e[`on${o}`]=n=>s().setState(l(s().state,...i,n))),this.render()}render(){return Lt}});Hn.createElement=tn,Hn.render=ie,Hn.Fragment=Q;(()=>{if("object"!=typeof window)return;const n=window;var t,e;e={html:Rt,svg:Dt,run:se},"object"==typeof(t=n)&&null!==t&&Object.keys(e).forEach((n=>{t[n]=e[n]}))})();export{Pn as Component,_n as ROUTER_404_EVENT,jn as ROUTER_EVENT,Hn as app,yn as customElement,Hn as default,gn as event,Rt as html,mn as on,ie as render,se as run,un as safeHTML,Dt as svg,rn as trustedHTML,gn as update};
34
+ //# sourceMappingURL=apprun-html.esm.js.map