apprun 3.37.1 → 3.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -2
- package/README.md +3 -0
- package/ai/apprun-html.prompt.md +290 -0
- package/ai/apprun.prompt.md +166 -0
- package/apprun.d.ts +7 -4
- package/dist/apprun-code.js +1 -1
- package/dist/apprun-code.js.map +1 -1
- package/dist/apprun-dev-tools.js +1 -1
- package/dist/apprun-dev-tools.js.map +1 -1
- package/dist/apprun-html.esm.js +1 -1
- package/dist/apprun-html.esm.js.map +1 -1
- package/dist/apprun-html.js +1 -1
- package/dist/apprun-html.js.map +1 -1
- package/dist/apprun-play-html.esm.js +1 -1
- package/dist/apprun-play-html.esm.js.map +1 -1
- package/dist/apprun-play.js +1 -1
- package/dist/apprun-play.js.map +1 -1
- package/dist/apprun.esm.js +1 -1
- package/dist/apprun.esm.js.map +1 -1
- package/dist/apprun.js +1 -1
- package/dist/apprun.js.map +1 -1
- package/esm/apprun.js +2 -7
- package/esm/apprun.js.map +1 -1
- package/esm/component.js.map +1 -1
- package/esm/types.js +9 -3
- package/esm/types.js.map +1 -1
- package/esm/version.js +1 -1
- package/jsx-runtime.js +1 -1
- package/jsx-runtime.js.map +1 -1
- package/package.json +1 -1
- package/src/apprun.ts +3 -8
- package/src/component.ts +4 -6
- package/src/types.ts +11 -4
- package/src/version.ts +1 -1
package/dist/apprun.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apprun.esm.js","sources":["../esm/version.js","../esm/app.js","../esm/type-utils.js","../esm/directive.js","../node_modules/property-information/lib/util/schema.js","../node_modules/property-information/lib/util/merge.js","../node_modules/property-information/lib/normalize.js","../node_modules/property-information/lib/util/info.js","../node_modules/property-information/lib/util/types.js","../node_modules/property-information/lib/util/defined-info.js","../node_modules/property-information/lib/util/create.js","../node_modules/property-information/lib/aria.js","../node_modules/property-information/lib/util/case-sensitive-transform.js","../node_modules/property-information/lib/util/case-insensitive-transform.js","../node_modules/property-information/lib/html.js","../node_modules/property-information/lib/svg.js","../node_modules/property-information/lib/xlink.js","../node_modules/property-information/lib/xmlns.js","../node_modules/property-information/lib/xml.js","../node_modules/property-information/lib/find.js","../node_modules/property-information/index.js","../esm/vdom-my-prop-attr.js","../esm/vdom-my.js","../esm/web-component.js","../esm/decorator.js","../esm/component.js","../esm/router.js","../esm/add-components.js","../esm/apprun.js"],"sourcesContent":["/**\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// Import version from package.json to maintain single source of truth\n// This version string is used across the framework\nexport const APPRUN_VERSION = '3.37.1';\n// Version string with prefix for global tracking\nexport const APPRUN_VERSION_GLOBAL = `AppRun-${APPRUN_VERSION}`;\n//# sourceMappingURL=version.js.map","/**\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 handling\n * - runAsync(): Publish events asynchronously with Promise support, returns handler values\n * - query(): Deprecated alias for runAsync() - use runAsync() instead\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 (events ending with '*')\n * - Delayed event execution with timeout management\n * - Once-only event subscriptions\n * - Async event handling with Promise.all\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 */\nimport { APPRUN_VERSION_GLOBAL } from './version';\nexport class App {\n constructor() {\n this._events = {};\n }\n on(name, fn, options = {}) {\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn, options });\n }\n off(name, fn) {\n const subscribers = this._events[name] || [];\n this._events[name] = subscribers.filter((sub) => sub.fn !== fn);\n }\n find(name) {\n return this._events[name];\n }\n run(name, ...args) {\n const subscribers = this.getSubscribers(name, this._events);\n 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, fn, args, options);\n }\n else {\n try {\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }\n catch (error) {\n console.error(`Error in event handler for '${name}':`, error);\n }\n }\n return !sub.options.once;\n });\n return subscribers.length;\n }\n once(name, fn, options = {}) {\n this.on(name, fn, { ...options, once: true });\n }\n delay(name, fn, args, options) {\n if (options._t)\n clearTimeout(options._t);\n options._t = setTimeout(() => {\n clearTimeout(options._t);\n try {\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }\n catch (error) {\n console.error(`Error in delayed event handler for '${name}':`, error);\n }\n }, options.delay);\n }\n runAsync(name, ...args) {\n const subscribers = this.getSubscribers(name, this._events);\n 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 return Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }\n catch (error) {\n console.error(`Error in async event handler for '${name}':`, error);\n return Promise.reject(error);\n }\n });\n return Promise.all(promises);\n }\n /**\n * @deprecated Use runAsync() instead. app.query() will be removed in a future version.\n */\n query(name, ...args) {\n console.warn('app.query() is deprecated. Use app.runAsync() instead.');\n return this.runAsync(name, ...args);\n }\n getSubscribers(name, events) {\n const subscribers = events[name] || [];\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 Object.keys(events).filter(evt => evt.endsWith('*') && name.startsWith(evt.replace('*', '')))\n .sort((a, b) => b.length - a.length)\n .forEach(evt => subscribers.push(...events[evt].map(sub => ({\n ...sub,\n options: { ...sub.options, event: name }\n }))));\n return subscribers;\n }\n}\nconst AppRunVersions = APPRUN_VERSION_GLOBAL;\nlet _app;\nconst root = (typeof window !== 'undefined' ? window :\n typeof global !== 'undefined' ? global :\n typeof self !== 'undefined' ? self : {});\nif (root.app && root._AppRunVersions) {\n _app = root.app;\n}\nelse {\n _app = new App();\n root.app = _app;\n root._AppRunVersions = AppRunVersions;\n}\nexport default _app;\n//# sourceMappingURL=app.js.map","/**\n * Type Safety Utilities for AppRun\n *\n * This file provides utility functions and types to improve type safety\n * across the AppRun framework, including:\n * 1. Safe type assertions with null checks\n * 2. Global object assignment helpers\n * 3. Event target type guards\n * 4. Function validation utilities\n */\n/**\n * Safely cast event target to specific HTML element type with null check\n */\nexport function safeEventTarget(event) {\n return event?.target instanceof HTMLElement ? event.target : null;\n}\n/**\n * Type guard to check if an object is a valid function\n */\nexport function isFunction(obj) {\n return typeof obj === 'function';\n}\n/**\n * Type guard to check if an object is a valid HTML element\n */\nexport function isHTMLElement(obj) {\n return obj instanceof HTMLElement;\n}\n/**\n * Safely assign properties to global object with type checking\n */\nexport function safeGlobalAssign(globalObj, assignments) {\n if (typeof globalObj === 'object' && globalObj !== null) {\n Object.keys(assignments).forEach(key => {\n globalObj[key] = assignments[key];\n });\n }\n}\n/**\n * Safely get property from global object with fallback\n */\nexport function safeGlobalGet(globalObj, property, fallback) {\n if (typeof globalObj === 'object' && globalObj !== null) {\n return globalObj[property] ?? fallback;\n }\n return fallback;\n}\n/**\n * Type-safe wrapper for DOM element queries\n */\nexport function safeQuerySelector(selector, context = document) {\n try {\n return context.querySelector(selector);\n }\n catch (error) {\n console.warn(`Invalid selector: ${selector}`, error);\n return null;\n }\n}\n/**\n * Type-safe wrapper for DOM element by ID\n */\nexport function safeGetElementById(id) {\n try {\n return document.getElementById(id);\n }\n catch (error) {\n console.warn(`Error getting element by id: ${id}`, error);\n return null;\n }\n}\n/**\n * Validate and safely execute a function with error handling\n */\nexport function safeExecute(fn, args, context, errorMessage) {\n if (!isFunction(fn)) {\n if (errorMessage) {\n console.warn(errorMessage, fn);\n }\n return undefined;\n }\n try {\n return context ? fn.apply(context, args) : fn(...args);\n }\n catch (error) {\n console.error(errorMessage || 'Error executing function:', error);\n return undefined;\n }\n}\n//# sourceMappingURL=type-utils.js.map","/**\n * Component Directives Implementation\n *\n * This file provides built-in directives for components:\n * 1. Event Binding ($on directives)\n * - $on: Bind DOM events to component events\n * - Supports event delegation and parameters\n * - Handles function, string, and array event handlers\n * - Type-safe event target handling\n *\n * 2. Two-way Data Binding ($bind directive)\n * - $bind: Sync form elements with component state\n * - Handles input types: text, checkbox, radio, number, range\n * - Supports select (single/multiple) and textarea elements\n * - Automatic value type conversion for numbers\n * - Support for complex property paths\n *\n * 3. Custom Directives\n * - Extensible directive system via '$' events\n * - Processes virtual DOM during rendering\n * - Supports custom attribute directives\n *\n * Features:\n * - Automatic state synchronization\n * - Type conversion for form inputs\n * - Event delegation support\n * - Multiple event handler formats\n * - Nested property binding\n * - Custom directive extensibility\n *\n * Type Safety Improvements (v3.35.1):\n * - Added null checks for event targets before type assertions\n * - Proper typing for different HTML element types\n * - Enhanced error handling for invalid event targets\n * - Safer DOM element property access\n *\n * Usage:\n * ```tsx\n * // Event binding\n * <button $onclick=\"event-name\">Click</button>\n * <input $oninput={e => setState(e.target.value)} />\n *\n * // Two-way binding\n * <input $bind=\"state.property\" />\n * <select $bind=\"selected\">...</select>\n *\n * // Array handlers\n * <button $onclick={['handler', param1, param2]}>Click</button>\n * ```\n */\nimport app from './app';\nimport { safeEventTarget } from './type-utils';\nconst getStateValue = (component, name) => {\n return (name ? component['state'][name] : component['state']) || '';\n};\nconst setStateValue = (component, name, value) => {\n if (name) {\n const state = component['state'] || {};\n state[name] = value;\n component.setState(state);\n }\n else {\n component.setState(value);\n }\n};\nconst apply_directive = (key, props, tag, component) => {\n if (key.startsWith('$on')) {\n const event = props[key];\n key = key.substring(1);\n if (typeof event === 'boolean') {\n props[key] = e => component.run ? component.run(key, e) : app.run(key, e);\n }\n else if (typeof event === 'string') {\n props[key] = e => component.run ? component.run(event, e) : app.run(event, e);\n }\n else if (typeof event === 'function') {\n props[key] = e => component.setState(event(component.state, e));\n }\n else if (Array.isArray(event)) {\n const [handler, ...p] = event;\n if (typeof handler === 'string') {\n props[key] = e => component.run ? component.run(handler, ...p, e) : app.run(handler, ...p, e);\n }\n else if (typeof handler === 'function') {\n props[key] = e => component.setState(handler(component.state, ...p, e));\n }\n }\n }\n else if (key === '$bind') {\n const type = props['type'] || 'text';\n const name = typeof props[key] === 'string' ? props[key] : props['name'];\n if (tag === 'input') {\n switch (type) {\n case 'checkbox':\n props['checked'] = getStateValue(component, name);\n props['onclick'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.checked);\n }\n };\n break;\n case 'radio':\n props['checked'] = getStateValue(component, name) === props['value'];\n props['onclick'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.value);\n }\n };\n break;\n case 'number':\n case 'range':\n props['value'] = getStateValue(component, name);\n props['oninput'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, Number(target.value));\n }\n };\n break;\n default:\n props['value'] = getStateValue(component, name);\n props['oninput'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.value);\n }\n };\n }\n }\n else if (tag === 'select') {\n props['value'] = getStateValue(component, name);\n props['onchange'] = e => {\n const target = safeEventTarget(e);\n if (target && !target.multiple) { // multiple selection use $bind on option\n setStateValue(component, name || target.name, target.value);\n }\n };\n }\n else if (tag === 'option') {\n props['selected'] = getStateValue(component, name);\n props['onclick'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.selected);\n }\n };\n }\n else if (tag === 'textarea') {\n props['innerHTML'] = getStateValue(component, name);\n props['oninput'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.value);\n }\n };\n }\n }\n else {\n app.run('$', { key, tag, props, component });\n }\n};\nconst directive = (vdom, component) => {\n if (Array.isArray(vdom)) {\n return vdom.map(element => directive(element, component));\n }\n else {\n let { type, tag, props, children } = vdom;\n tag = tag || type;\n children = children || props?.children;\n if (props)\n Object.keys(props).forEach(key => {\n if (key.startsWith('$')) {\n apply_directive(key, props, tag, component);\n delete props[key];\n }\n });\n if (children)\n directive(children, component);\n return vdom;\n }\n};\nexport default directive;\n//# sourceMappingURL=directive.js.map","/**\n * @import {Schema as SchemaType, Space} from 'property-information'\n */\n\n/** @type {SchemaType} */\nexport class Schema {\n /**\n * @param {SchemaType['property']} property\n * Property.\n * @param {SchemaType['normal']} normal\n * Normal.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Schema.\n */\n constructor(property, normal, space) {\n this.normal = normal\n this.property = property\n\n if (space) {\n this.space = space\n }\n }\n}\n\nSchema.prototype.normal = {}\nSchema.prototype.property = {}\nSchema.prototype.space = undefined\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {ReadonlyArray<Schema>} definitions\n * Definitions.\n * @param {Space | undefined} [space]\n * Space.\n * @returns {Schema}\n * Schema.\n */\nexport function merge(definitions, space) {\n /** @type {Record<string, Info>} */\n const property = {}\n /** @type {Record<string, string>} */\n const normal = {}\n\n for (const definition of definitions) {\n Object.assign(property, definition.property)\n Object.assign(normal, definition.normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * Get the cleaned case insensitive form of an attribute or property.\n *\n * @param {string} value\n * An attribute-like or property-like name.\n * @returns {string}\n * Value that can be used to look up the properly cased property on a\n * `Schema`.\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","/**\n * @import {Info as InfoType} from 'property-information'\n */\n\n/** @type {InfoType} */\nexport class Info {\n /**\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @returns\n * Info.\n */\n constructor(property, attribute) {\n this.attribute = attribute\n this.property = property\n }\n}\n\nInfo.prototype.attribute = ''\nInfo.prototype.booleanish = false\nInfo.prototype.boolean = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.defined = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.number = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.property = ''\nInfo.prototype.spaceSeparated = false\nInfo.prototype.space = undefined\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","/**\n * @import {Space} from 'property-information'\n */\n\nimport {Info} from './info.js'\nimport * as types from './types.js'\n\nconst checks = /** @type {ReadonlyArray<keyof typeof types>} */ (\n Object.keys(types)\n)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @param {number | null | undefined} [mask]\n * Mask.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Info.\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @template {keyof DefinedInfo} Key\n * Key type.\n * @param {DefinedInfo} values\n * Info.\n * @param {Key} key\n * Key.\n * @param {DefinedInfo[Key]} value\n * Value.\n * @returns {undefined}\n * Nothing.\n */\nfunction mark(values, key, value) {\n if (value) {\n values[key] = value\n }\n}\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\n/**\n * @typedef Definition\n * Definition of a schema.\n * @property {Record<string, string> | undefined} [attributes]\n * Normalzed names to special attribute case.\n * @property {ReadonlyArray<string> | undefined} [mustUseProperty]\n * Normalized names that must be set as properties.\n * @property {Record<string, number | null>} properties\n * Property names to their types.\n * @property {Space | undefined} [space]\n * Space.\n * @property {Transform} transform\n * Transform a property name.\n */\n\n/**\n * @callback Transform\n * Transform.\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Attribute.\n */\n\nimport {normalize} from '../normalize.js'\nimport {DefinedInfo} from './defined-info.js'\nimport {Schema} from './schema.js'\n\n/**\n * @param {Definition} definition\n * Definition.\n * @returns {Schema}\n * Schema.\n */\nexport function create(definition) {\n /** @type {Record<string, Info>} */\n const properties = {}\n /** @type {Record<string, string>} */\n const normals = {}\n\n for (const [property, value] of Object.entries(definition.properties)) {\n const info = new DefinedInfo(\n property,\n definition.transform(definition.attributes || {}, property),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(property)\n ) {\n info.mustUseProperty = true\n }\n\n properties[property] = info\n\n normals[normalize(property)] = property\n normals[normalize(info.attribute)] = property\n }\n\n return new Schema(properties, normals, definition.space)\n}\n","import {create} from './util/create.js'\nimport {booleanish, number, spaceSeparated} from './util/types.js'\n\nexport const aria = create({\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n },\n transform(_, property) {\n return property === 'role'\n ? property\n : 'aria-' + property.slice(4).toLowerCase()\n }\n})\n","/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} attribute\n * Attribute.\n * @returns {string}\n * Transformed attribute.\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Transformed property.\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n booleanish,\n boolean,\n commaSeparated,\n number,\n overloadedBoolean,\n spaceSeparated\n} from './util/types.js'\n\nexport const html = create({\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: overloadedBoolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // `<body>`. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // `<object>`. List of URIs to archives\n axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`\n background: null, // `<body>`. Use CSS `background-image` instead\n bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead\n border: number, // `<table>`. Use CSS `border-width` instead,\n borderColor: null, // `<table>`. Use CSS `border-color` instead,\n bottomMargin: number, // `<body>`\n cellPadding: null, // `<table>`\n cellSpacing: null, // `<table>`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // `<object>`\n clear: null, // `<br>`. Use CSS `clear` instead\n code: null, // `<object>`\n codeBase: null, // `<object>`\n codeType: null, // `<object>`\n color: null, // `<font>` and `<hr>`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // `<object>`\n event: null, // `<script>`\n face: null, // `<font>`. Use CSS instead\n frame: null, // `<table>`\n frameBorder: null, // `<iframe>`. Use CSS `border` instead\n hSpace: number, // `<img>` and `<object>`\n leftMargin: number, // `<body>`\n link: null, // `<body>`. Use CSS `a:link {color: *}` instead\n longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`\n lowSrc: null, // `<img>`. Use a `<picture>`\n marginHeight: number, // `<body>`\n marginWidth: number, // `<body>`\n noResize: boolean, // `<frame>`\n noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`\n noShade: boolean, // `<hr>`. Use background-color and height instead of borders\n noWrap: boolean, // `<td>` and `<th>`\n object: null, // `<applet>`\n profile: null, // `<head>`\n prompt: null, // `<isindex>`\n rev: null, // `<link>`\n rightMargin: number, // `<body>`\n rules: null, // `<table>`\n scheme: null, // `<meta>`\n scrolling: booleanish, // `<frame>`. Use overflow in the child context\n standby: null, // `<object>`\n summary: null, // `<table>`\n text: null, // `<body>`. Use CSS `color` instead\n topMargin: number, // `<body>`\n valueType: null, // `<param>`\n version: null, // `<html>`. Use a doctype.\n vAlign: null, // Several. Use CSS `vertical-align` instead\n vLink: null, // `<body>`. Use CSS `a:visited {color}` instead\n vSpace: number, // `<img>` and `<object>`\n\n // Non-standard Properties.\n allowTransparency: null,\n autoCorrect: null,\n autoSave: null,\n disablePictureInPicture: boolean,\n disableRemotePlayback: boolean,\n prefix: null,\n property: null,\n results: number,\n security: null,\n unselectable: null\n },\n space: 'html',\n transform: caseInsensitiveTransform\n})\n","import {caseSensitiveTransform} from './util/case-sensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n boolean,\n commaOrSpaceSeparated,\n commaSeparated,\n number,\n spaceSeparated\n} from './util/types.js'\n\nexport const svg = create({\n attributes: {\n accentHeight: 'accent-height',\n alignmentBaseline: 'alignment-baseline',\n arabicForm: 'arabic-form',\n baselineShift: 'baseline-shift',\n capHeight: 'cap-height',\n className: 'class',\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n colorProfile: 'color-profile',\n colorRendering: 'color-rendering',\n crossOrigin: 'crossorigin',\n dataType: 'datatype',\n dominantBaseline: 'dominant-baseline',\n enableBackground: 'enable-background',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\n fontFamily: 'font-family',\n fontSize: 'font-size',\n fontSizeAdjust: 'font-size-adjust',\n fontStretch: 'font-stretch',\n fontStyle: 'font-style',\n fontVariant: 'font-variant',\n fontWeight: 'font-weight',\n glyphName: 'glyph-name',\n glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n glyphOrientationVertical: 'glyph-orientation-vertical',\n hrefLang: 'hreflang',\n horizAdvX: 'horiz-adv-x',\n horizOriginX: 'horiz-origin-x',\n horizOriginY: 'horiz-origin-y',\n imageRendering: 'image-rendering',\n letterSpacing: 'letter-spacing',\n lightingColor: 'lighting-color',\n markerEnd: 'marker-end',\n markerMid: 'marker-mid',\n markerStart: 'marker-start',\n navDown: 'nav-down',\n navDownLeft: 'nav-down-left',\n navDownRight: 'nav-down-right',\n navLeft: 'nav-left',\n navNext: 'nav-next',\n navPrev: 'nav-prev',\n navRight: 'nav-right',\n navUp: 'nav-up',\n navUpLeft: 'nav-up-left',\n navUpRight: 'nav-up-right',\n onAbort: 'onabort',\n onActivate: 'onactivate',\n onAfterPrint: 'onafterprint',\n onBeforePrint: 'onbeforeprint',\n onBegin: 'onbegin',\n onCancel: 'oncancel',\n onCanPlay: 'oncanplay',\n onCanPlayThrough: 'oncanplaythrough',\n onChange: 'onchange',\n onClick: 'onclick',\n onClose: 'onclose',\n onCopy: 'oncopy',\n onCueChange: 'oncuechange',\n onCut: 'oncut',\n onDblClick: 'ondblclick',\n onDrag: 'ondrag',\n onDragEnd: 'ondragend',\n onDragEnter: 'ondragenter',\n onDragExit: 'ondragexit',\n onDragLeave: 'ondragleave',\n onDragOver: 'ondragover',\n onDragStart: 'ondragstart',\n onDrop: 'ondrop',\n onDurationChange: 'ondurationchange',\n onEmptied: 'onemptied',\n onEnd: 'onend',\n onEnded: 'onended',\n onError: 'onerror',\n onFocus: 'onfocus',\n onFocusIn: 'onfocusin',\n onFocusOut: 'onfocusout',\n onHashChange: 'onhashchange',\n onInput: 'oninput',\n onInvalid: 'oninvalid',\n onKeyDown: 'onkeydown',\n onKeyPress: 'onkeypress',\n onKeyUp: 'onkeyup',\n onLoad: 'onload',\n onLoadedData: 'onloadeddata',\n onLoadedMetadata: 'onloadedmetadata',\n onLoadStart: 'onloadstart',\n onMessage: 'onmessage',\n onMouseDown: 'onmousedown',\n onMouseEnter: 'onmouseenter',\n onMouseLeave: 'onmouseleave',\n onMouseMove: 'onmousemove',\n onMouseOut: 'onmouseout',\n onMouseOver: 'onmouseover',\n onMouseUp: 'onmouseup',\n onMouseWheel: 'onmousewheel',\n onOffline: 'onoffline',\n onOnline: 'ononline',\n onPageHide: 'onpagehide',\n onPageShow: 'onpageshow',\n onPaste: 'onpaste',\n onPause: 'onpause',\n onPlay: 'onplay',\n onPlaying: 'onplaying',\n onPopState: 'onpopstate',\n onProgress: 'onprogress',\n onRateChange: 'onratechange',\n onRepeat: 'onrepeat',\n onReset: 'onreset',\n onResize: 'onresize',\n onScroll: 'onscroll',\n onSeeked: 'onseeked',\n onSeeking: 'onseeking',\n onSelect: 'onselect',\n onShow: 'onshow',\n onStalled: 'onstalled',\n onStorage: 'onstorage',\n onSubmit: 'onsubmit',\n onSuspend: 'onsuspend',\n onTimeUpdate: 'ontimeupdate',\n onToggle: 'ontoggle',\n onUnload: 'onunload',\n onVolumeChange: 'onvolumechange',\n onWaiting: 'onwaiting',\n onZoom: 'onzoom',\n overlinePosition: 'overline-position',\n overlineThickness: 'overline-thickness',\n paintOrder: 'paint-order',\n panose1: 'panose-1',\n pointerEvents: 'pointer-events',\n referrerPolicy: 'referrerpolicy',\n renderingIntent: 'rendering-intent',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strikethroughPosition: 'strikethrough-position',\n strikethroughThickness: 'strikethrough-thickness',\n strokeDashArray: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeLineCap: 'stroke-linecap',\n strokeLineJoin: 'stroke-linejoin',\n strokeMiterLimit: 'stroke-miterlimit',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n tabIndex: 'tabindex',\n textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n typeOf: 'typeof',\n underlinePosition: 'underline-position',\n underlineThickness: 'underline-thickness',\n unicodeBidi: 'unicode-bidi',\n unicodeRange: 'unicode-range',\n unitsPerEm: 'units-per-em',\n vAlphabetic: 'v-alphabetic',\n vHanging: 'v-hanging',\n vIdeographic: 'v-ideographic',\n vMathematical: 'v-mathematical',\n vectorEffect: 'vector-effect',\n vertAdvY: 'vert-adv-y',\n vertOriginX: 'vert-origin-x',\n vertOriginY: 'vert-origin-y',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n xHeight: 'x-height',\n // These were camelcased in Tiny. Now lowercased in SVG 2\n playbackOrder: 'playbackorder',\n timelineBegin: 'timelinebegin'\n },\n properties: {\n about: commaOrSpaceSeparated,\n accentHeight: number,\n accumulate: null,\n additive: null,\n alignmentBaseline: null,\n alphabetic: number,\n amplitude: number,\n arabicForm: null,\n ascent: number,\n attributeName: null,\n attributeType: null,\n azimuth: number,\n bandwidth: null,\n baselineShift: null,\n baseFrequency: null,\n baseProfile: null,\n bbox: null,\n begin: null,\n bias: number,\n by: null,\n calcMode: null,\n capHeight: number,\n className: spaceSeparated,\n clip: null,\n clipPath: null,\n clipPathUnits: null,\n clipRule: null,\n color: null,\n colorInterpolation: null,\n colorInterpolationFilters: null,\n colorProfile: null,\n colorRendering: null,\n content: null,\n contentScriptType: null,\n contentStyleType: null,\n crossOrigin: null,\n cursor: null,\n cx: null,\n cy: null,\n d: null,\n dataType: null,\n defaultAction: null,\n descent: number,\n diffuseConstant: number,\n direction: null,\n display: null,\n dur: null,\n divisor: number,\n dominantBaseline: null,\n download: boolean,\n dx: null,\n dy: null,\n edgeMode: null,\n editable: null,\n elevation: number,\n enableBackground: null,\n end: null,\n event: null,\n exponent: number,\n externalResourcesRequired: null,\n fill: null,\n fillOpacity: number,\n fillRule: null,\n filter: null,\n filterRes: null,\n filterUnits: null,\n floodColor: null,\n floodOpacity: null,\n focusable: null,\n focusHighlight: null,\n fontFamily: null,\n fontSize: null,\n fontSizeAdjust: null,\n fontStretch: null,\n fontStyle: null,\n fontVariant: null,\n fontWeight: null,\n format: null,\n fr: null,\n from: null,\n fx: null,\n fy: null,\n g1: commaSeparated,\n g2: commaSeparated,\n glyphName: commaSeparated,\n glyphOrientationHorizontal: null,\n glyphOrientationVertical: null,\n glyphRef: null,\n gradientTransform: null,\n gradientUnits: null,\n handler: null,\n hanging: number,\n hatchContentUnits: null,\n hatchUnits: null,\n height: null,\n href: null,\n hrefLang: null,\n horizAdvX: number,\n horizOriginX: number,\n horizOriginY: number,\n id: null,\n ideographic: number,\n imageRendering: null,\n initialVisibility: null,\n in: null,\n in2: null,\n intercept: number,\n k: number,\n k1: number,\n k2: number,\n k3: number,\n k4: number,\n kernelMatrix: commaOrSpaceSeparated,\n kernelUnitLength: null,\n keyPoints: null, // SEMI_COLON_SEPARATED\n keySplines: null, // SEMI_COLON_SEPARATED\n keyTimes: null, // SEMI_COLON_SEPARATED\n kerning: null,\n lang: null,\n lengthAdjust: null,\n letterSpacing: null,\n lightingColor: null,\n limitingConeAngle: number,\n local: null,\n markerEnd: null,\n markerMid: null,\n markerStart: null,\n markerHeight: null,\n markerUnits: null,\n markerWidth: null,\n mask: null,\n maskContentUnits: null,\n maskUnits: null,\n mathematical: null,\n max: null,\n media: null,\n mediaCharacterEncoding: null,\n mediaContentEncodings: null,\n mediaSize: number,\n mediaTime: null,\n method: null,\n min: null,\n mode: null,\n name: null,\n navDown: null,\n navDownLeft: null,\n navDownRight: null,\n navLeft: null,\n navNext: null,\n navPrev: null,\n navRight: null,\n navUp: null,\n navUpLeft: null,\n navUpRight: null,\n numOctaves: null,\n observer: null,\n offset: null,\n onAbort: null,\n onActivate: null,\n onAfterPrint: null,\n onBeforePrint: null,\n onBegin: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnd: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFocusIn: null,\n onFocusOut: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadStart: null,\n onMessage: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onMouseWheel: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRepeat: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onShow: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onZoom: null,\n opacity: null,\n operator: null,\n order: null,\n orient: null,\n orientation: null,\n origin: null,\n overflow: null,\n overlay: null,\n overlinePosition: number,\n overlineThickness: number,\n paintOrder: null,\n panose1: null,\n path: null,\n pathLength: number,\n patternContentUnits: null,\n patternTransform: null,\n patternUnits: null,\n phase: null,\n ping: spaceSeparated,\n pitch: null,\n playbackOrder: null,\n pointerEvents: null,\n points: null,\n pointsAtX: number,\n pointsAtY: number,\n pointsAtZ: number,\n preserveAlpha: null,\n preserveAspectRatio: null,\n primitiveUnits: null,\n propagate: null,\n property: commaOrSpaceSeparated,\n r: null,\n radius: null,\n referrerPolicy: null,\n refX: null,\n refY: null,\n rel: commaOrSpaceSeparated,\n rev: commaOrSpaceSeparated,\n renderingIntent: null,\n repeatCount: null,\n repeatDur: null,\n requiredExtensions: commaOrSpaceSeparated,\n requiredFeatures: commaOrSpaceSeparated,\n requiredFonts: commaOrSpaceSeparated,\n requiredFormats: commaOrSpaceSeparated,\n resource: null,\n restart: null,\n result: null,\n rotate: null,\n rx: null,\n ry: null,\n scale: null,\n seed: null,\n shapeRendering: null,\n side: null,\n slope: null,\n snapshotTime: null,\n specularConstant: number,\n specularExponent: number,\n spreadMethod: null,\n spacing: null,\n startOffset: null,\n stdDeviation: null,\n stemh: null,\n stemv: null,\n stitchTiles: null,\n stopColor: null,\n stopOpacity: null,\n strikethroughPosition: number,\n strikethroughThickness: number,\n string: null,\n stroke: null,\n strokeDashArray: commaOrSpaceSeparated,\n strokeDashOffset: null,\n strokeLineCap: null,\n strokeLineJoin: null,\n strokeMiterLimit: number,\n strokeOpacity: number,\n strokeWidth: null,\n style: null,\n surfaceScale: number,\n syncBehavior: null,\n syncBehaviorDefault: null,\n syncMaster: null,\n syncTolerance: null,\n syncToleranceDefault: null,\n systemLanguage: commaOrSpaceSeparated,\n tabIndex: number,\n tableValues: null,\n target: null,\n targetX: number,\n targetY: number,\n textAnchor: null,\n textDecoration: null,\n textRendering: null,\n textLength: null,\n timelineBegin: null,\n title: null,\n transformBehavior: null,\n type: null,\n typeOf: commaOrSpaceSeparated,\n to: null,\n transform: null,\n transformOrigin: null,\n u1: null,\n u2: null,\n underlinePosition: number,\n underlineThickness: number,\n unicode: null,\n unicodeBidi: null,\n unicodeRange: null,\n unitsPerEm: number,\n values: null,\n vAlphabetic: number,\n vMathematical: number,\n vectorEffect: null,\n vHanging: number,\n vIdeographic: number,\n version: null,\n vertAdvY: number,\n vertOriginX: number,\n vertOriginY: number,\n viewBox: null,\n viewTarget: null,\n visibility: null,\n width: null,\n widths: null,\n wordSpacing: null,\n writingMode: null,\n x: null,\n x1: null,\n x2: null,\n xChannelSelector: null,\n xHeight: number,\n y: null,\n y1: null,\n y2: null,\n yChannelSelector: null,\n z: null,\n zoomAndPan: null\n },\n space: 'svg',\n transform: caseSensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n },\n space: 'xlink',\n transform(_, property) {\n return 'xlink:' + property.slice(5).toLowerCase()\n }\n})\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n properties: {xmlnsXLink: null, xmlns: null},\n space: 'xmlns',\n transform: caseInsensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n properties: {xmlBase: null, xmlLang: null, xmlSpace: null},\n space: 'xml',\n transform(_, property) {\n return 'xml:' + property.slice(3).toLowerCase()\n }\n})\n","/**\n * @import {Schema} from 'property-information'\n */\n\nimport {DefinedInfo} from './util/defined-info.js'\nimport {Info} from './util/info.js'\nimport {normalize} from './normalize.js'\n\nconst cap = /[A-Z]/g\nconst dash = /-[a-z]/g\nconst valid = /^data[-\\w.:]+$/i\n\n/**\n * Look up info on a property.\n *\n * In most cases the given `schema` contains info on the property.\n * All standard,\n * most legacy,\n * and some non-standard properties are supported.\n * For these cases,\n * the returned `Info` has hints about the value of the property.\n *\n * `name` can also be a valid data attribute or property,\n * in which case an `Info` object with the correctly cased `attribute` and\n * `property` is returned.\n *\n * `name` can be an unknown attribute,\n * in which case an `Info` object with `attribute` and `property` set to the\n * given name is returned.\n * It is not recommended to provide unsupported legacy or recently specced\n * properties.\n *\n *\n * @param {Schema} schema\n * Schema;\n * either the `html` or `svg` export.\n * @param {string} value\n * An attribute-like or property-like name;\n * it will be passed through `normalize` to hopefully find the correct info.\n * @returns {Info}\n * Info.\n */\nexport function find(schema, value) {\n const normal = normalize(value)\n let property = value\n let Type = Info\n\n if (normal in schema.normal) {\n return schema.property[schema.normal[normal]]\n }\n\n if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) {\n // Attribute or property.\n if (value.charAt(4) === '-') {\n // Turn it into a property.\n const rest = value.slice(5).replace(dash, camelcase)\n property = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1)\n } else {\n // Turn it into an attribute.\n const rest = value.slice(4)\n\n if (!dash.test(rest)) {\n let dashes = rest.replace(cap, kebab)\n\n if (dashes.charAt(0) !== '-') {\n dashes = '-' + dashes\n }\n\n value = 'data' + dashes\n }\n }\n\n Type = DefinedInfo\n }\n\n return new Type(property, value)\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Kebab.\n */\nfunction kebab($0) {\n return '-' + $0.toLowerCase()\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Camel.\n */\nfunction camelcase($0) {\n return $0.charAt(1).toUpperCase()\n}\n","// Note: types exposed from `index.d.ts`.\nimport {merge} from './lib/util/merge.js'\nimport {aria} from './lib/aria.js'\nimport {html as htmlBase} from './lib/html.js'\nimport {svg as svgBase} from './lib/svg.js'\nimport {xlink} from './lib/xlink.js'\nimport {xmlns} from './lib/xmlns.js'\nimport {xml} from './lib/xml.js'\n\nexport {hastToReact} from './lib/hast-to-react.js'\n\nexport const html = merge([aria, htmlBase, xlink, xmlns, xml], 'html')\n\nexport {find} from './lib/find.js'\nexport {normalize} from './lib/normalize.js'\n\nexport const svg = merge([aria, svgBase, xlink, xmlns, xml], 'svg')\n","/**\n * VDOM Property and Attribute Handler\n * Standards-compliant property/attribute handling with caching and special element support\n * Features: Skip logic for preserving user interactions during VDOM reconciliation\n * Exports: updateProps - Main function for DOM element property updates\n * Updated: 2025-01-14 - Added skip logic for focus-sensitive, scroll, and media properties\n */\nimport { find, html, svg } from 'property-information';\nconst ATTR_PROPS = '_props';\nconst propertyInfoCache = new Map();\n// Merge old and new props, handling className -> class conversion and null cleanup\nfunction mergeProps(oldProps, newProps) {\n if (newProps) {\n newProps['class'] = newProps['class'] || newProps['className'];\n delete newProps['className'];\n }\n if (!oldProps || Object.keys(oldProps).length === 0)\n return newProps || {};\n if (!newProps || Object.keys(newProps).length === 0) {\n const props = {};\n Object.keys(oldProps).forEach(p => props[p] = null);\n return props;\n }\n const props = {};\n Object.keys(oldProps).forEach(p => {\n if (!(p in newProps))\n props[p] = null;\n });\n Object.keys(newProps).forEach(p => props[p] = newProps[p]);\n return props;\n}\n// Convert kebab-case to camelCase for dataset keys\nfunction convertKebabToCamelCase(str) {\n if (str.length <= 1)\n return str.toLowerCase();\n return str.split('-').map((word, index) => index === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join('');\n}\n// Cached property information lookup\nfunction getPropertyInfo(name, isSvg) {\n const cacheKey = `${name}:${isSvg}`;\n let info = propertyInfoCache.get(cacheKey);\n if (info === undefined) {\n info = find(isSvg ? svg : html, name) || null;\n propertyInfoCache.set(cacheKey, info);\n }\n return info;\n}\n// Specialized handlers for different attribute types\nfunction setDatasetAttribute(element, attributeName, value) {\n const camelKey = convertKebabToCamelCase(attributeName.slice(5));\n if (value == null) {\n delete element.dataset[camelKey];\n }\n else {\n element.dataset[camelKey] = String(value);\n }\n}\nfunction setEventHandler(element, name, value) {\n if (!name.startsWith('on'))\n return;\n if (!value || typeof value === 'function') {\n element[name] = value;\n }\n else if (typeof value === 'string') {\n if (value)\n element.setAttribute(name, value);\n else\n element.removeAttribute(name);\n }\n}\nfunction setBooleanAttribute(element, attributeName, value) {\n if (shouldSetBooleanAttribute(value)) {\n element.setAttribute(attributeName, attributeName);\n }\n else {\n element.removeAttribute(attributeName);\n }\n}\nfunction setElementProperty(element, propertyName, value) {\n try {\n element[propertyName] = value;\n }\n catch (error) {\n setElementAttribute(element, propertyName, value, false);\n }\n}\nfunction setElementAttribute(element, attributeName, value, isSvg) {\n if (value == null) {\n element.removeAttribute(attributeName);\n return;\n }\n const stringValue = String(value);\n if (isSvg && attributeName.includes(':')) {\n const [prefix] = attributeName.split(':');\n if (prefix === 'xlink') {\n element.setAttributeNS('http://www.w3.org/1999/xlink', attributeName, stringValue);\n }\n else {\n element.setAttribute(attributeName, stringValue);\n }\n }\n else {\n element.setAttribute(attributeName, stringValue);\n }\n}\nfunction shouldSetBooleanAttribute(value) {\n if (value == null || value === false || value === '')\n return false;\n if (value === true)\n return true;\n if (typeof value === 'string') {\n const lowerValue = value.toLowerCase();\n return lowerValue !== 'false' && value !== '0';\n }\n return Boolean(value);\n}\n// Core property/attribute setting function - handles all property types with skip logic\nfunction setAttributeOrProperty(element, name, value, isSvg) {\n // Check if we should skip this property update to preserve user interaction\n if (shouldSkipPatch(element, name)) {\n return;\n }\n // Special cases with dedicated handling\n if (name === 'style') {\n if (element.style.cssText)\n element.style.cssText = '';\n if (typeof value === 'string')\n element.style.cssText = value;\n else if (value && typeof value === 'object') {\n for (const s in value) {\n if (element.style[s] !== value[s])\n element.style[s] = value[s];\n }\n }\n return;\n }\n if (name === 'key') {\n if (value !== undefined && value !== null)\n element.key = value;\n return;\n }\n if (name.startsWith('data-')) {\n setDatasetAttribute(element, name, value);\n return;\n }\n if (name.startsWith('on')) {\n setEventHandler(element, name, value);\n return;\n }\n // Form elements with special property requirements\n if ((element.tagName === 'INPUT' || element.tagName === 'TEXTAREA' || element.tagName === 'SELECT') &&\n (name === 'value' || name === 'selected' || name === 'selectedIndex')) {\n setElementProperty(element, name, value);\n return;\n }\n // Input checked needs both property and attribute\n if (element.tagName === 'INPUT' && name === 'checked') {\n setElementProperty(element, name, value);\n setBooleanAttribute(element, name, value);\n return;\n }\n // Use property information for standard attributes\n const info = getPropertyInfo(name, isSvg);\n if (info) {\n if (info.boolean || info.overloadedBoolean) {\n setBooleanAttribute(element, info.attribute, value);\n }\n else if (info.mustUseProperty && !isSvg) {\n setElementProperty(element, info.property, value);\n }\n else {\n setElementAttribute(element, info.attribute, value, isSvg);\n }\n }\n else {\n // Fallback handling for unknown attributes\n if (name.startsWith('aria-') || name === 'role') {\n setElementAttribute(element, name, value, isSvg);\n }\n else if (name in element || element[name] !== undefined) {\n setElementProperty(element, name, value);\n }\n else {\n setElementAttribute(element, name, value, isSvg);\n }\n }\n}\n// Skip logic for preventing user interaction disruption during VDOM reconciliation\nfunction shouldSkipPatch(dom, prop) {\n if (document.activeElement === dom) {\n return ['value', 'selectionStart', 'selectionEnd', 'selectionDirection']\n .includes(prop);\n }\n if (prop === 'scrollTop' || prop === 'scrollLeft') {\n return true;\n }\n if (dom instanceof HTMLMediaElement &&\n ['currentTime', 'paused', 'playbackRate', 'volume'].includes(prop)) {\n return true;\n }\n return false; // default: allow normal diff logic\n}\nfunction isValidAttributeName(name) {\n return /^[a-zA-Z_:][\\w\\-:.]*$/.test(name) &&\n !name.includes('<') && !name.includes('>') && !name.includes('\"') && !name.includes(\"'\");\n}\n// Main exported function for updating element properties\nexport function updateProps(element, props, isSvg) {\n // console.assert(!!element);\n const cached = element[ATTR_PROPS] || {};\n const merged = mergeProps(cached, props);\n element[ATTR_PROPS] = props || {};\n applyPropertiesToElement(element, merged, props, isSvg);\n}\n// Apply merged properties to element with ref handling\nfunction applyPropertiesToElement(element, mergedProps, originalProps, isSvg) {\n for (const name in mergedProps) {\n if (isValidAttributeName(name)) {\n setAttributeOrProperty(element, name, mergedProps[name], isSvg);\n }\n }\n // Handle ref callback\n if (mergedProps && typeof mergedProps['ref'] === 'function') {\n window.requestAnimationFrame(() => mergedProps['ref'](element));\n }\n}\n//# sourceMappingURL=vdom-my-prop-attr.js.map","/** * VDOM Implementation for AppRun\n *\n * Notes for AppRun’s key prop\n * Use the key prop only if you need to preserve browser-side DOM state (such as cursor\n * position in an <input>, focus, or maintaining state in inline components).\n *\n * For most use cases, especially with stateless or purely data-driven UIs, key is not\n * needed and may decrease performance by forcing DOM moves.\n *\n * AppRun aggressively updates DOM to match your vdom, so DOM node preservation is\n * only valuable when you intentionally depend on browser-managed state.\n *\n * | Use Case | Should I use `key`? | Why |\n * | ----------------------------- | ------------------- | --------------------- |\n * | Preserve input cursor/focus | ✅ Yes | Keeps browser state |\n * | Inline stateful component | ✅ Yes | Preserves component |\n * | Regular data list (stateless) | 🚫 No | Unnecessary DOM moves |\n * | Purely visual updates | 🚫 No | No state to preserve |\n *\n * Features:\n * - Virtual DOM rendering and diffing for efficient DOM updates\n * - JSX Fragment support for both Babel and TypeScript\n * - Element creation with props, children, and event handling\n * - SVG element support with proper namespace handling\n * - Component lifecycle management and caching\n * - Keyed element optimization with automatic cleanup for memory management\n * - Safe HTML insertion and text node creation\n * - Directive processing integration\n *\n * Implementation:\n * - Uses plain JavaScript object for keyCache instead of Map for better performance\n * - Implements automatic cleanup of disconnected elements from keyCache\n * - Supports both string and function-based tags\n * - Handles component mounting and state management\n * - Optimized children updating with minimal DOM operations\n * - Memory-efficient caching with configurable thresholds (500 ops, 1000 max size)\n *\n * Recent Changes:\n * - 2025-07-15: Converted keyCache from Map to plain object ({}) for improved performance\n * - Updated cleanup functions to use object property deletion instead of Map methods\n * - Enhanced memory management with automatic cleanup of disconnected elements\n * - Added comprehensive key prop usage documentation and guidelines\n */\nimport directive from './directive';\nimport { updateProps } from './vdom-my-prop-attr';\nexport function Fragment(props, ...children) {\n return collect(children);\n}\nfunction collect(children) {\n const ch = [];\n const push = (c) => {\n if (c !== null && c !== undefined && c !== '' && c !== false) {\n ch.push((typeof c === 'function' || typeof c === 'object') ? c : `${c}`);\n }\n };\n children && children.forEach(c => {\n if (Array.isArray(c)) {\n c.forEach(i => push(i));\n }\n else {\n push(c);\n }\n });\n return ch;\n}\nconst keyCache = {};\nlet cleanupCounter = 0;\nconst CLEANUP_THRESHOLD = 500; // Cleanup every 500 operations\nconst MAX_CACHE_SIZE = 1000;\n// Lightweight cleanup function - only runs when needed\nfunction cleanupKeyCache() {\n if (Object.keys(keyCache).length <= MAX_CACHE_SIZE)\n return; // Skip if under limit\n for (const [key, element] of Object.entries(keyCache)) {\n if (!element.isConnected) {\n delete keyCache[key];\n }\n }\n}\n// Export cleanup function for manual cleanup if needed\nexport function clearKeyCache() {\n for (const key in keyCache) {\n delete keyCache[key];\n }\n cleanupCounter = 0;\n}\nexport function createElement(tag, props, ...children) {\n const ch = collect(children);\n if (typeof tag === 'string')\n return { tag, props, children: ch };\n else if (Array.isArray(tag))\n return tag; // JSX fragments - babel\n else if (tag === undefined && children)\n return ch; // JSX fragments - typescript\n else if (Object.getPrototypeOf(tag).__isAppRunComponent)\n return { tag, props, children: ch }; // createComponent(tag, { ...props, children });\n else if (typeof tag === 'function')\n return tag(props, ch);\n else\n throw new Error(`Unknown tag in vdom ${tag}`);\n}\n;\nexport const updateElement = (element, nodes, component = {}) => {\n // tslint:disable-next-line\n if (nodes == null || nodes === false)\n return;\n const el = (typeof element === 'string' && element) ?\n document.getElementById(element) || document.querySelector(element) : element;\n nodes = directive(nodes, component);\n render(el, nodes, component);\n};\nfunction render(element, nodes, parent = {}) {\n // tslint:disable-next-line\n if (nodes == null || nodes === false)\n return;\n nodes = createComponent(nodes, parent);\n if (!element)\n return;\n const isSvg = element.nodeName === \"SVG\";\n if (Array.isArray(nodes)) {\n updateChildren(element, nodes, isSvg);\n }\n else {\n updateChildren(element, [nodes], isSvg);\n }\n}\nfunction same(el, node) {\n // if (!el || !node) return false;\n const key1 = el.nodeName;\n const key2 = `${node.tag || ''}`;\n return key1.toUpperCase() === key2.toUpperCase();\n}\nfunction update(element, node, isSvg) {\n // console.assert(!!element);\n isSvg = isSvg || node.tag === \"svg\";\n if (!same(element, node)) {\n element.parentNode.replaceChild(create(node, isSvg), element);\n return;\n }\n updateChildren(element, node.children, isSvg);\n updateProps(element, node.props, isSvg);\n}\nfunction updateChildren(element, children, isSvg) {\n const old_len = element.childNodes?.length || 0;\n const new_len = children?.length || 0;\n const len = Math.min(old_len, new_len);\n for (let i = 0; i < len; i++) {\n const child = children[i];\n const el = element.childNodes[i];\n if (typeof child === 'string') {\n if (el.textContent !== child) {\n if (el.nodeType === 3) {\n el.nodeValue = child;\n }\n else {\n element.replaceChild(createText(child), el);\n }\n }\n }\n else if (child instanceof HTMLElement || child instanceof SVGElement) {\n element.insertBefore(child, el);\n }\n else {\n const key = child.props && child.props['key'];\n if (key) {\n if (el.key === key) {\n update(element.childNodes[i], child, isSvg);\n }\n else {\n // console.log(el.key, key);\n const old = keyCache[key];\n if (old) {\n // const temp = old.nextSibling;\n element.insertBefore(old, el);\n // temp ? element.insertBefore(el, temp) : element.appendChild(el);\n update(element.childNodes[i], child, isSvg);\n }\n else {\n element.replaceChild(create(child, isSvg), el);\n }\n }\n }\n else {\n update(element.childNodes[i], child, isSvg);\n }\n }\n }\n let n = element.childNodes?.length || 0;\n while (n > len) {\n element.removeChild(element.lastChild);\n n--;\n }\n if (new_len > len) {\n const d = document.createDocumentFragment();\n for (let i = len; i < children.length; i++) {\n d.appendChild(create(children[i], isSvg));\n }\n element.appendChild(d);\n }\n}\nexport const safeHTML = (html) => {\n const div = document.createElement('section');\n div.insertAdjacentHTML('afterbegin', html);\n return Array.from(div.children);\n};\nfunction createText(node) {\n if (node?.indexOf('_html:') === 0) { // ?\n const div = document.createElement('div');\n div.insertAdjacentHTML('afterbegin', node.substring(6));\n return div;\n }\n else {\n return document.createTextNode(node ?? '');\n }\n}\nfunction create(node, isSvg) {\n // console.assert(node !== null && node !== undefined);\n if ((node instanceof HTMLElement) || (node instanceof SVGElement))\n return node;\n if (typeof node === \"string\")\n return createText(node);\n if (!node.tag || (typeof node.tag === 'function'))\n return createText(JSON.stringify(node));\n isSvg = isSvg || node.tag === \"svg\";\n const element = isSvg\n ? document.createElementNS(\"http://www.w3.org/2000/svg\", node.tag)\n : document.createElement(node.tag);\n updateProps(element, node.props, isSvg);\n if (node.children)\n node.children.forEach(child => element.appendChild(create(child, isSvg)));\n if (node.props && node.props.key !== undefined) {\n element.key = node.props.key;\n keyCache[node.props.key] = element;\n // Lightweight cleanup - only when counter reaches threshold\n if (++cleanupCounter >= CLEANUP_THRESHOLD) {\n cleanupKeyCache();\n cleanupCounter = 0;\n }\n }\n return element;\n}\nfunction render_component(node, parent, idx) {\n const { tag, props, children } = node;\n let key = `_${idx}`;\n let id = props && props['id'];\n if (!id)\n id = `_${idx}${Date.now()}`;\n else\n key = id;\n let asTag = 'section';\n if (props && props['as']) {\n asTag = props['as'];\n delete props['as'];\n }\n if (!parent.__componentCache)\n parent.__componentCache = {};\n let component = parent.__componentCache[key];\n if (!component || !(component instanceof tag) || !component.element) {\n const element = document.createElement(asTag);\n component = parent.__componentCache[key] = new tag({ ...props, children }).mount(element, { render: true });\n }\n else {\n component.renderState(component.state);\n }\n if (component.mounted) {\n const new_state = component.mounted(props, children, component.state);\n (typeof new_state !== 'undefined') && component.setState(new_state);\n }\n updateProps(component.element, props, false);\n return component.element;\n}\nfunction createComponent(node, parent, idx = 0) {\n if (typeof node === 'string')\n return node;\n if (Array.isArray(node))\n return node.map(child => createComponent(child, parent, idx++));\n let vdom = node;\n if (node && typeof node.tag === 'function' && Object.getPrototypeOf(node.tag).__isAppRunComponent) {\n vdom = render_component(node, parent, idx);\n }\n if (vdom && Array.isArray(vdom.children)) {\n const new_parent = vdom.props?._component;\n if (new_parent) {\n let i = 0;\n vdom.children = vdom.children.map(child => createComponent(child, new_parent, i++));\n }\n else {\n vdom.children = vdom.children.map(child => createComponent(child, parent, idx++));\n }\n }\n return vdom;\n}\n//# sourceMappingURL=vdom-my.js.map","/**\n * Web Components Integration\n *\n * This file enables using AppRun components as Web Components:\n * 1. Custom Element Creation\n * - Converts AppRun components to custom elements\n * - Handles lifecycle (connected, disconnected, attributeChanged)\n * - Manages shadow DOM and light DOM rendering options\n * - Automatic element registration with customElements.define()\n *\n * 2. Property/Attribute Sync\n * - Observes attribute changes with attributeChangedCallback\n * - Updates component state automatically on changes\n * - Handles camelCase/kebab-case conversion automatically\n * - Supports complex property types and JSON parsing\n * - Two-way data binding between attributes and state\n *\n * 3. Event Handling\n * - Proxies events between component and element\n * - Supports both global and local event systems\n * - Maintains proper event bubbling and capturing\n * - Custom event dispatching for component communication\n *\n * Features:\n * - Shadow DOM encapsulation support\n * - Attribute observation and change detection\n * - Lifecycle management and cleanup\n * - Property reflection to attributes\n * - Event proxy system\n * - Flexible rendering options\n *\n * Type Safety Improvements (v3.35.1):\n * - Enhanced custom element options typing\n * - Better lifecycle method signatures\n * - Improved attribute/property type safety\n * - Safer DOM manipulation with null checks\n *\n * Usage:\n * ```ts\n * // Register web component\n * @customElement('my-element', {\n * shadow: true,\n * observedAttributes: ['name', 'value']\n * })\n * class MyComponent extends Component {\n * // Regular AppRun component code\n * }\n *\n * // Use in HTML\n * <my-element name=\"value\" data-prop=\"complex\"></my-element>\n * ```\n */\nexport const customElement = (componentClass, options = {}) => class CustomElement extends HTMLElement {\n constructor() {\n super();\n }\n get component() { return this._component; }\n get state() { return this._component.state; }\n static get observedAttributes() {\n // attributes need to be set to lowercase in order to get observed\n return (options.observedAttributes || []).map(attr => attr.toLowerCase());\n }\n connectedCallback() {\n if (this.isConnected && !this._component) {\n const opts = options || {};\n this._shadowRoot = opts.shadow ? this.attachShadow({ mode: 'open' }) : this;\n const observedAttributes = (opts.observedAttributes || []);\n const attrMap = observedAttributes.reduce((map, name) => {\n const lc = name.toLowerCase();\n if (lc !== name) {\n map[lc] = name;\n }\n return map;\n }, {});\n this._attrMap = (name) => attrMap[name] || name;\n const props = {};\n Array.from(this.attributes).forEach(item => props[this._attrMap(item.name)] = item.value);\n // add getters/ setters to allow observation on observedAttributes\n observedAttributes.forEach(name => {\n if (this[name] !== undefined)\n props[name] = this[name];\n Object.defineProperty(this, name, {\n get() {\n return props[name];\n },\n set(value) {\n // trigger change event\n this.attributeChangedCallback(name, props[name], value);\n },\n configurable: true,\n enumerable: true\n });\n });\n requestAnimationFrame(() => {\n const children = this.children ? Array.from(this.children) : [];\n // children.forEach(el => el.parentElement.removeChild(el));\n this._component = new componentClass({ ...props, children }).mount(this._shadowRoot, opts);\n // attach props to component\n this._component._props = props;\n // expose dispatchEvent\n this._component.dispatchEvent = this.dispatchEvent.bind(this);\n if (this._component.mounted) {\n const new_state = this._component.mounted(props, children, this._component.state);\n if (typeof new_state !== 'undefined')\n this._component.state = new_state;\n }\n this.on = this._component.on.bind(this._component);\n this.run = this._component.run.bind(this._component);\n if (!(opts.render === false))\n this._component.run('.');\n });\n }\n }\n disconnectedCallback() {\n this._component?.unload?.();\n this._component?.unmount?.();\n this._component = null;\n }\n attributeChangedCallback(name, oldValue, value) {\n if (this._component) {\n // camelCase attributes arrive only in lowercase\n const mappedName = this._attrMap(name);\n // store the new property/ attribute\n this._component._props[mappedName] = value;\n this._component.run('attributeChanged', mappedName, oldValue, value);\n if (value !== oldValue && !(options.render === false)) {\n window.requestAnimationFrame(() => {\n // re-render state with new combined props on next animation frame\n this._component.run('.');\n });\n }\n }\n }\n};\nexport default (name, componentClass, options) => {\n (typeof customElements !== 'undefined') && customElements.define(name, customElement(componentClass, options));\n};\n//# sourceMappingURL=web-component.js.map","import webComponent from './web-component';\n/**\n * TypeScript Decorators for AppRun Components\n *\n * This file provides decorators that enable:\n * 1. Event Handler Registration\n * - @on(): Subscribe to events with options (global, once, delay)\n * - @update(): Define state updates with metadata and options\n * - Supports method and class decoration patterns\n *\n * 2. Web Component Integration\n * - @customElement(): Register as custom element with options\n * - Handles shadow DOM and attribute observation\n * - Automatic lifecycle management for web components\n *\n * 3. Metadata Management\n * - Custom Reflect implementation for decorator metadata\n * - Stores event handler and update metadata for runtime use\n * - Supports runtime reflection for dynamic behavior\n * - Metadata keys for event bindings and updates\n *\n * Features:\n * - Event handler decoration with options\n * - State update method decoration\n * - Web component registration\n * - Metadata-driven event binding\n * - Flexible decorator patterns\n * - Runtime metadata access\n *\n * Type Safety Improvements (v3.35.1):\n * - Enhanced decorator typing for better IDE support\n * - Improved metadata key management\n * - Better type inference for decorated methods\n *\n * Usage:\n * ```ts\n * @customElement('my-element')\n * class MyComponent extends Component {\n * @on('event', { global: true })\n * handler(state, ...args) {\n * // Handle event\n * }\n *\n * @update('event', { render: true })\n * updater(state, ...args) {\n * // Update state\n * return newState;\n * }\n * }\n * ```\n */\n// tslint:disable:no-invalid-this\nexport const Reflect = {\n meta: new WeakMap(),\n defineMetadata(metadataKey, metadataValue, target) {\n if (!this.meta.has(target))\n this.meta.set(target, {});\n this.meta.get(target)[metadataKey] = metadataValue;\n },\n getMetadataKeys(target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? Object.keys(this.meta.get(target)) : [];\n },\n getMetadata(metadataKey, target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? this.meta.get(target)[metadataKey] : null;\n }\n};\nexport function update(events, options = {}) {\n return (target, key, descriptor) => {\n const name = events ? events.toString() : key;\n Reflect.defineMetadata(`apprun-update:${name}`, { name, key, options }, target);\n return descriptor;\n };\n}\nexport function on(events, options = {}) {\n return function (target, key) {\n const name = events ? events.toString() : key;\n Reflect.defineMetadata(`apprun-update:${name}`, { name, key, options }, target);\n };\n}\nexport function customElement(name, options) {\n return function _customElement(constructor) {\n webComponent(name, constructor, options);\n return constructor;\n };\n}\n//# sourceMappingURL=decorator.js.map","/**\n * AppRun Component System Implementation\n *\n * This file provides the Component class which is the foundation for:\n * 1. State Management\n * - Maintains component state with history support\n * - Handles state updates with async/iterator support\n * - Supports state history navigation (prev/next)\n * - Promise and async iterator state handling\n *\n * 2. View Rendering\n * - Renders virtual DOM to real DOM with directives\n * - Handles component lifecycle (mounted, rendered, unload)\n * - Supports shadow DOM and web components\n * - DOM change tracking with MutationObserver\n * - View transition API support\n *\n * 3. Event Handling\n * - Local and global event subscription management\n * - Event handler registration via decorators\n * - Action to state updates with error handling\n * - Support for event options (delay, once, global)\n *\n * Features:\n * - Component caching for debugging\n * - Element tracking for cleanup\n * - History navigation support\n * - Global vs local event routing\n * - Async state handling\n * - Memory leak prevention\n * - Component unmounting with cleanup\n *\n * Type Safety Improvements (v3.35.1):\n * - Enhanced element access with null checks and warnings\n * - Improved action validation and error handling\n * - Better error reporting in component actions\n * - Safer DOM element queries with fallback warnings\n *\n * Usage:\n * ```ts\n * class MyComponent extends Component {\n * state = // Initial state\n * view = state => // Return virtual DOM\n * update = {\n * 'event': (state, ...args) => // Return new state\n * }\n * }\n *\n * // Mount component\n * new MyComponent().mount('element-id');\n * ```\n */\nimport _app, { App } from './app';\nimport { Reflect } from './decorator';\nimport directive from './directive';\nimport { safeQuerySelector, safeGetElementById } from './type-utils';\n// const componentCache = new Map();\n// if (!app.find('get-components')) app.on('get-components', o => o.components = componentCache);\nexport const REFRESH = state => state;\nconst app = _app;\nexport class Component {\n renderState(state, vdom = null) {\n if (!this.view)\n return;\n let html = vdom || this.view(state);\n app['debug'] && app.run('debug', {\n component: this,\n _: html ? '.' : '-',\n state,\n vdom: html,\n el: this.element\n });\n if (typeof document !== 'object')\n return;\n const el = (typeof this.element === 'string' && this.element) ?\n safeGetElementById(this.element) || safeQuerySelector(this.element) : this.element;\n if (!el) {\n console.warn(`Component element not found: ${this.element}`);\n return;\n }\n const tracking_attr = '_c';\n if (!this.unload) {\n el.removeAttribute && el.removeAttribute(tracking_attr);\n }\n else if (el['_component'] !== this || el.getAttribute(tracking_attr) !== this.tracking_id) {\n this.tracking_id = new Date().valueOf().toString();\n el.setAttribute(tracking_attr, this.tracking_id);\n if (typeof MutationObserver !== 'undefined') {\n if (!this.observer)\n this.observer = new MutationObserver(changes => {\n if (changes[0].oldValue === this.tracking_id || !document.body.contains(el)) {\n this.unload(this.state);\n this.observer.disconnect();\n this.observer = null;\n }\n });\n this.observer.observe(document.body, {\n childList: true, subtree: true,\n attributes: true, attributeOldValue: true, attributeFilter: [tracking_attr]\n });\n }\n }\n el['_component'] = this;\n if (!vdom && html) {\n html = directive(html, this);\n if (this.options.transition && document && document['startViewTransition']) {\n document['startViewTransition'](() => app.render(el, html, this));\n }\n else {\n app.render(el, html, this);\n }\n }\n this.rendered && this.rendered(this.state);\n }\n setState(state, options = { render: true, history: false }) {\n const handleAsyncIterator = async (iterator) => {\n try {\n while (true) {\n const { value, done } = await iterator.next();\n if (done)\n break;\n this.setState(value, options);\n }\n }\n catch (e) {\n console.error('Error in async iterator:', e);\n }\n };\n const result = state;\n if (result?.[Symbol.asyncIterator]) {\n // handleAsyncIterator(result[Symbol.asyncIterator]());\n this.setState(handleAsyncIterator(result[Symbol.asyncIterator]()), options);\n return;\n }\n else if (result?.[Symbol.iterator] && typeof result.next === \"function\") {\n for (const value of result) {\n this.setState(value, options);\n }\n return;\n }\n else if (state && state instanceof Promise) {\n // Promise will not be saved or rendered\n // state will be saved and rendered when promise is resolved\n Promise.resolve(state).then(v => {\n this.setState(v, options);\n this._state = state;\n });\n }\n else {\n this._state = state;\n if (state == null)\n return;\n this.state = state;\n if (options.render !== false) {\n // before render state\n if (options.transition && document && document['startViewTransition']) {\n document['startViewTransition'](() => this.renderState(state));\n }\n else {\n this.renderState(state);\n }\n }\n if (options.history !== false && this.enable_history) {\n this._history = [...this._history, state];\n this._history_idx = this._history.length - 1;\n }\n if (typeof options.callback === 'function')\n options.callback(this.state);\n }\n }\n constructor(state, view, update, options) {\n this.state = state;\n this.view = view;\n this.update = update;\n this.options = options;\n this._app = new App();\n this._actions = [];\n this._global_events = [];\n this._history = [];\n this._history_idx = -1;\n this._history_prev = () => {\n this._history_idx--;\n if (this._history_idx >= 0) {\n this.setState(this._history[this._history_idx], { render: true, history: false });\n }\n else {\n this._history_idx = 0;\n }\n };\n this._history_next = () => {\n this._history_idx++;\n if (this._history_idx < this._history.length) {\n this.setState(this._history[this._history_idx], { render: true, history: false });\n }\n else {\n this._history_idx = this._history.length - 1;\n }\n };\n this.start = (element = null, options) => {\n this.mount(element, { render: true, ...options });\n if (this.mounted && typeof this.mounted === 'function') {\n const new_state = this.mounted({}, [], this.state);\n (typeof new_state !== 'undefined') && this.setState(new_state);\n }\n return this;\n };\n }\n mount(element = null, options) {\n console.assert(!this.element, 'Component already mounted.');\n this.options = options = { ...this.options, ...options };\n this.element = element;\n this.global_event = options.global_event;\n this.enable_history = !!options.history;\n if (this.enable_history) {\n this.on(options.history.prev || 'history-prev', this._history_prev);\n this.on(options.history.next || 'history-next', this._history_next);\n }\n if (options.route) {\n this.update = this.update || {};\n if (!this.update[options.route])\n this.update[options.route] = REFRESH;\n }\n this.add_actions();\n this.state = this.state ?? this['model'] ?? {};\n if (typeof this.state === 'function')\n this.state = this.state();\n this.setState(this.state, { render: !!options.render, history: true });\n if (app['debug'] && app.find('debug-create-component')?.length) {\n app.run('debug-create-component', this);\n }\n return this;\n }\n is_global_event(name) {\n return name && (this.global_event ||\n this._global_events.indexOf(name) >= 0 ||\n name.startsWith('#') || name.startsWith('/') || name.startsWith('@'));\n }\n add_action(name, action, options = {}) {\n if (!action || typeof action !== 'function') {\n console.warn(`Component action for '${name}' is not a valid function:`, action);\n return;\n }\n if (options.global)\n this._global_events.push(name);\n this.on(name, (...p) => {\n app['debug'] && app.run('debug', {\n component: this,\n _: '>',\n event: name, p,\n current_state: this.state,\n options\n });\n try {\n const newState = action(this.state, ...p);\n app['debug'] && app.run('debug', {\n component: this,\n _: '<',\n event: name, p,\n newState,\n state: this.state,\n options\n });\n this.setState(newState, options);\n }\n catch (error) {\n console.error(`Error in component action '${name}':`, error);\n app['debug'] && app.run('debug', {\n component: this,\n _: '!',\n event: name, p,\n error,\n state: this.state,\n options\n });\n }\n }, options);\n }\n add_actions() {\n const actions = this.update || {};\n Reflect.getMetadataKeys(this).forEach(key => {\n if (key.startsWith('apprun-update:')) {\n const meta = Reflect.getMetadata(key, this);\n actions[meta.name] = [this[meta.key].bind(this), meta.options];\n }\n });\n const all = {};\n if (Array.isArray(actions)) {\n actions.forEach(act => {\n const [name, action, opts] = act;\n const names = name.toString();\n names.split(',').forEach(n => all[n.trim()] = [action, opts]);\n });\n }\n else {\n Object.keys(actions).forEach(name => {\n const action = actions[name];\n if (typeof action === 'function' || Array.isArray(action)) {\n name.split(',').forEach(n => all[n.trim()] = action);\n }\n });\n }\n if (!all['.'])\n all['.'] = REFRESH;\n Object.keys(all).forEach(name => {\n const action = all[name];\n if (typeof action === 'function') {\n this.add_action(name, action);\n }\n else if (Array.isArray(action)) {\n this.add_action(name, action[0], action[1]);\n }\n });\n }\n run(event, ...args) {\n if (this.state instanceof Promise) {\n return Promise.resolve(this.state).then(state => {\n this.state = state;\n this.run(event, ...args);\n });\n }\n else {\n const name = event.toString();\n return this.is_global_event(name) ?\n app.run(name, ...args) :\n this._app.run(name, ...args);\n }\n }\n on(event, fn, options) {\n const name = event.toString();\n this._actions.push({ name, fn });\n return this.is_global_event(name) ?\n app.on(name, fn, options) :\n this._app.on(name, fn, options);\n }\n runAsync(event, ...args) {\n const name = event.toString();\n return this.is_global_event(name) ?\n app.runAsync(name, ...args) :\n this._app.runAsync(name, ...args);\n }\n // obsolete\n /**\n * @deprecated Use runAsync() instead. query() will be removed in a future version.\n */\n query(event, ...args) {\n console.warn('component.query() is deprecated. Use component.runAsync() instead.');\n return this.runAsync(event, ...args);\n }\n unmount() {\n this.observer?.disconnect();\n this._actions.forEach(action => {\n const { name, fn } = action;\n this.is_global_event(name) ?\n app.off(name, fn) :\n this._app.off(name, fn);\n });\n }\n}\nComponent.__isAppRunComponent = true;\n//# sourceMappingURL=component.js.map","/**\n * AppRun Router Implementation with Hierarchical Matching\n *\n * This file provides URL routing capabilities:\n * 1. Hash-based routing (#/path)\n * - Works with SPA mode using hash fragments\n * - Handles hashchange events automatically\n * - No server configuration required\n * 2. Path-based routing (/path)\n * - Works with browser history API\n * - Requires server configuration for SPA routing\n * - Handles popstate events automatically\n * 3. Event-based navigation\n * - Routes trigger corresponding component events\n * - Automatic route parameter extraction\n * - Fallback to 404 handling for unknown routes\n *\n * Features:\n * - Automatic route event firing with ROUTER_EVENT\n * - 404 handling via ROUTER_404_EVENT for unmatched routes\n * - History API integration for seamless navigation\n * - Route parameter parsing and injection into events\n * - URL pattern matching with parameter support\n * - Global and component-level route handling\n * - **NEW: Hierarchical route matching** - progressively tries parent routes\n *\n * Type Safety Improvements (v3.35.1):\n * - Enhanced route type definitions\n * - Better parameter type inference\n * - Improved URL validation and error handling\n *\n * Usage:\n * ```ts\n * // Basic routing\n * app.on('#/home', () => // Show home page);\n * app.on('#/users/:id', (id) => // Show user profile);\n * app.on('/api/*', (path) => // Handle API routes);\n *\n * // Navigate programmatically\n * app.run('route', '#/home');\n * route('/users/123'); // Direct routing\n *\n * // Hierarchical matching examples\n * app.on('/api', (operation, id) => // Handle /api/users/123);\n * app.on('#users', (id, action) => // Handle #users/123/edit);\n *\n * // Hierarchical Route Matching (NEW):\n * // For URL: /api/v1/users/123\n * // Router tries: /api/v1/users/123 → /api/v1/users → /api/v1 → /api → 404\n * // If handler found at /api, it receives: ('v1', 'users', '123')\n *\n * // Base Path Support (NEW):\n * app.basePath = '/myapp'; // For sub-directory deployments\n * // Links: <a href=\"/users/123\"> (relative paths)\n * // Navigation: /myapp/users/123 (full path)\n * // Routing: /users/123 (base path stripped)\n *\n * // Empty Path Handling (NEW):\n * // For URL: \"\" (empty)\n * // Router tries: # → / → #/ → 404 (in priority order)\n *\n * // 404 Behavior (ENHANCED):\n * // Fires only at minimal levels: /a, #a, #/a, a\n * // Never tries root handlers: /, #, #/\n * ```\n */\nimport app from './app';\n// Helper functions for hierarchical routing\n/**\n * Extract clean path segments from URL\n * @param url - The URL to parse\n * @returns Array of path segments\n */\nfunction parsePathSegments(url) {\n if (!url)\n return [];\n // Handle different URL types\n if (url.startsWith('#/')) {\n return url.substring(2).split('/');\n }\n else if (url.startsWith('#')) {\n return url.substring(1).split('/');\n }\n else if (url.startsWith('/')) {\n return url.substring(1).split('/');\n }\n else {\n return url.split('/');\n }\n}\n/**\n * Normalize trailing slash - convert /a/ to /a\n * @param url - The URL to normalize\n * @returns Normalized URL\n */\nfunction normalizeTrailingSlash(url) {\n if (!url || url === '/' || url === '#' || url === '#/')\n return url;\n if (url.endsWith('/'))\n return url.slice(0, -1);\n return url;\n}\n/**\n * Validate hierarchy depth and warn if too deep\n * @param segments - Path segments to validate\n */\nfunction validateHierarchyDepth(segments) {\n // Count non-empty segments for depth validation\n const nonEmptySegments = segments.filter(Boolean);\n if (nonEmptySegments.length > 11) {\n console.warn(`Deep route hierarchy detected: ${nonEmptySegments.join('/')} (${nonEmptySegments.length} levels)`);\n }\n}\n/**\n * Strip base path from URL\n * @param url - The URL to process\n * @param basePath - The base path to remove\n * @returns URL with base path removed\n */\nfunction stripBasePath(url, basePath) {\n if (!basePath || basePath === '/' || basePath === '')\n return url;\n // Normalize base path\n const normalizedBasePath = basePath.startsWith('/') ? basePath : '/' + basePath;\n if (url.startsWith(normalizedBasePath)) {\n const stripped = url.substring(normalizedBasePath.length);\n return stripped.startsWith('/') ? stripped : '/' + stripped;\n }\n return url;\n}\n/**\n * Generate hierarchy of routes to try (stops at minimal level)\n * @param segments - Array of path segments\n * @param routeType - Type of route (path, hash, hash-slash, non-prefixed)\n * @returns Array of route names to try in order\n */\nfunction generateRouteHierarchy(segments, routeType) {\n const hierarchy = [];\n // Build hierarchy from most specific to least specific\n for (let i = segments.length; i > 0; i--) {\n const currentSegments = segments.slice(0, i);\n let routeName = '';\n switch (routeType) {\n case 'path':\n routeName = '/' + currentSegments.join('/');\n break;\n case 'hash':\n routeName = '#' + currentSegments.join('/');\n break;\n case 'hash-slash':\n routeName = '#/' + currentSegments.join('/');\n break;\n case 'non-prefixed':\n routeName = currentSegments.join('/');\n break;\n }\n hierarchy.push(routeName);\n }\n return hierarchy;\n}\n/**\n * Find handler in hierarchy and return handler info\n * @param hierarchy - Array of route names to try\n * @param originalSegments - Original path segments\n * @returns Handler info if found, null otherwise\n */\nfunction findHandlerInHierarchy(hierarchy, originalSegments) {\n for (let i = 0; i < hierarchy.length; i++) {\n const routeName = hierarchy[i];\n const subscribers = app.find(routeName);\n if (subscribers && subscribers.length > 0) {\n // Found handler - calculate remaining parameters\n const handlerDepth = hierarchy.length - i;\n const parameters = originalSegments.slice(handlerDepth);\n return {\n eventName: routeName,\n parameters: parameters\n };\n }\n }\n return null;\n}\n/**\n * Handle empty path with priority order: # → / → #/ → 404\n */\nfunction handleEmptyPath() {\n // Try # first\n const hashSubscribers = app.find('#');\n if (hashSubscribers && hashSubscribers.length > 0) {\n app.run('#');\n app.run(ROUTER_EVENT, '#');\n return;\n }\n // Try / second\n const pathSubscribers = app.find('/');\n if (pathSubscribers && pathSubscribers.length > 0) {\n app.run('/');\n app.run(ROUTER_EVENT, '/');\n return;\n }\n // Try #/ third\n const hashSlashSubscribers = app.find('#/');\n if (hashSlashSubscribers && hashSlashSubscribers.length > 0) {\n app.run('#/');\n app.run(ROUTER_EVENT, '#/');\n return;\n }\n // Fire 404 if no handlers found\n console.warn('No subscribers for event: ');\n app.run(ROUTER_404_EVENT, '');\n app.run(ROUTER_EVENT, '');\n}\n/**\n * Main hierarchical routing logic\n * @param url - The URL to route\n */\nfunction routeWithHierarchy(url) {\n // Handle empty path\n if (!url) {\n handleEmptyPath();\n return;\n }\n // Normalize trailing slash\n url = normalizeTrailingSlash(url);\n // Strip base path if configured\n const basePath = app['basePath'];\n if (basePath) {\n url = stripBasePath(url, basePath);\n }\n // Parse segments and validate depth\n const segments = parsePathSegments(url);\n validateHierarchyDepth(segments);\n // Determine route type\n let routeType;\n if (url.startsWith('#/')) {\n routeType = 'hash-slash';\n }\n else if (url.startsWith('#')) {\n routeType = 'hash';\n }\n else if (url.startsWith('/')) {\n routeType = 'path';\n }\n else {\n routeType = 'non-prefixed';\n }\n // Generate hierarchy\n const hierarchy = generateRouteHierarchy(segments, routeType);\n // Find handler in hierarchy\n const handlerInfo = findHandlerInHierarchy(hierarchy, segments);\n if (handlerInfo) {\n // Found handler - publish route with parameters\n publishRoute(handlerInfo.eventName, ...handlerInfo.parameters);\n }\n else {\n // No handler found - fire 404 with original URL\n if (hierarchy.length > 0) {\n const minimalRoute = hierarchy[hierarchy.length - 1];\n console.warn(`No subscribers for event: ${minimalRoute}`);\n app.run(ROUTER_404_EVENT, url);\n app.run(ROUTER_EVENT, url);\n }\n else {\n handleEmptyPath();\n }\n }\n}\nconst publishRoute = (name, ...args) => {\n if (!name || name === ROUTER_EVENT || name === ROUTER_404_EVENT)\n return;\n const subscribers = app.find(name);\n if (!subscribers || subscribers.length === 0) {\n console.warn(`No subscribers for event: ${name}`);\n app.run(ROUTER_404_EVENT, name, ...args);\n }\n else {\n app.run(name, ...args);\n }\n app.run(ROUTER_EVENT, name, ...args);\n};\nexport const ROUTER_EVENT = '//';\nexport const ROUTER_404_EVENT = '///';\nexport const route = (url) => {\n if (app['lastUrl'] === url)\n return; // Prevent duplicate routing\n app['lastUrl'] = url;\n // Use hierarchical routing logic\n routeWithHierarchy(url);\n};\nexport default route;\n//# sourceMappingURL=router.js.map","import app from './app'; // ADD: Global app instance access\n// Type guard functions using the enhanced type system\nfunction isComponentInstance(obj) {\n return obj && typeof obj === 'object' && typeof obj.mount === 'function';\n}\nfunction isComponentConstructor(fn) {\n return typeof fn === 'function' &&\n fn.prototype &&\n fn.prototype.constructor === fn &&\n (fn.prototype.mount !== undefined ||\n fn.prototype.state !== undefined ||\n fn.prototype.view !== undefined);\n}\nfunction isFactoryFunction(fn) {\n return typeof fn === 'function' && !isComponentConstructor(fn);\n}\n// Recursive function resolution with enhanced type checking\nasync function resolveComponent(component, maxDepth = 3) {\n let resolved = component;\n let depth = 0;\n while (isFactoryFunction(resolved) && depth < maxDepth) {\n try {\n const result = await resolved();\n if (result === resolved)\n break; // Prevent infinite loops\n resolved = result;\n depth++;\n }\n catch (error) {\n console.error(`Error executing component function: ${error}`);\n break;\n }\n }\n return resolved;\n}\nexport default async (element, components) => {\n for (const [route, component] of Object.entries(components)) {\n if (!component || !route) {\n console.error(`Invalid component configuration: component=${component}, route=${route}`);\n continue;\n }\n // Check if it's a direct component instance\n if (isComponentInstance(component)) {\n const options = { route };\n component.mount(element, options);\n continue;\n }\n // Check if it's a component class constructor\n if (isComponentConstructor(component)) {\n const instance = new component();\n const options = { route };\n instance.mount(element, options);\n continue;\n }\n // At this point it must be a function - resolve it\n if (isFactoryFunction(component)) {\n // Resolve the function to see what it returns\n let resolved = await resolveComponent(component);\n // Check if resolved result is a component instance\n if (isComponentInstance(resolved)) {\n const options = { route };\n resolved.mount(element, options);\n continue;\n }\n // Check if resolved result is a component constructor\n if (isComponentConstructor(resolved)) {\n const instance = new resolved();\n const options = { route };\n instance.mount(element, options);\n continue;\n }\n // If resolved result is still a function or anything else, treat original as event handler with render wrapper\n app.on(route, (...args) => {\n const result = component(...args);\n if (typeof element === 'string') {\n element = document.querySelector(element);\n if (!element) {\n console.error(`Element not found: ${element}`);\n return;\n }\n }\n return app.render(element, result);\n });\n continue;\n }\n // If we get here, it's an invalid component type\n console.error(`Invalid component: component must be a class, instance, or function that returns a class/instance`);\n }\n};\n//# sourceMappingURL=add-components.js.map","/**\n * Main AppRun framework entry point\n *\n * This file:\n * 1. Assembles core AppRun modules into a complete framework\n * 2. Exports public API and types\n * 3. Initializes global app instance with:\n * - Virtual DOM rendering\n * - Component system\n * - Router with improved null safety\n * - Web component support\n * - Type-safe React integration\n * - Component batch mounting system\n *\n * Key exports:\n * - app: Global event system instance\n * - Component: Base component class\n * - Decorators: @on, @update, @customElement\n * - Router events and configuration\n * - Web component registration\n *\n * Features:\n * - Event-driven architecture with pub/sub pattern\n * - Virtual DOM rendering with multiple renderer support\n * - Component lifecycle management\n * - Client-side routing with hash/path support\n * - Web Components integration\n * - React compatibility layer\n * - TypeScript support with strong typing\n * - Batch component mounting with addComponents(element, components)\n *\n * Type Safety Improvements (v3.35.1):\n * - Added null checks for DOM event targets\n * - Improved global window object assignments with proper typing\n * - Enhanced React integration parameter validation\n * - Better error handling for invalid event handlers\n * - Safer element access with proper type assertions\n *\n * Recent Changes:\n * - Modified addComponents to accept (element, components) where components is a key-value object with routes as keys and components as values\n * - Simplified component mounting API for better usability\n *\n * Usage:\n * ```ts\n * import { app, Component } from 'apprun';\n *\n * // Create components\n * class MyComponent extends Component {\n * state = // Initial state\n * view = state => // Render view\n * update = {\n * 'event': (state, ...args) => // Handle events\n * }\n * }\n *\n * // Mount multiple components\n * app.addComponents(document.body, {\n * '/home': MyComponent,\n * '/about': AnotherComponent\n * });\n * ```\n */\nimport _app, { App } from './app';\nimport { createElement, render, Fragment, safeHTML } from './vdom';\nimport { Component } from './component';\nimport { on, update, customElement } from './decorator';\nimport { route, ROUTER_EVENT, ROUTER_404_EVENT } from './router';\nimport webComponent from './web-component';\nimport addComponents from './add-components';\nimport { APPRUN_VERSION } from './version';\nconst app = _app;\nexport default app;\nexport { App, app, Component, on, update, Fragment, safeHTML };\nexport { update as event };\nexport { ROUTER_EVENT, ROUTER_404_EVENT };\nexport { customElement };\nif (!app.start) {\n app.version = APPRUN_VERSION;\n app.h = app.createElement = createElement;\n app.render = render;\n app.Fragment = Fragment;\n app.webComponent = webComponent;\n app.safeHTML = safeHTML;\n app.start = (element, model, view, update, options) => {\n const opts = { render: true, global_event: true, ...options };\n const component = new Component(model, view, update);\n if (options && options.rendered)\n component.rendered = options.rendered;\n if (options && options.mounted)\n component.mounted = options.mounted;\n component.start(element, opts);\n return component;\n };\n // Deprecated: app.query is deprecated in favor of app.runAsync\n app.query = app.query || app.runAsync;\n const NOOP = _ => { };\n app.on('/', NOOP);\n app.on('debug', _ => NOOP);\n app.on(ROUTER_EVENT, NOOP);\n app.on(ROUTER_404_EVENT, NOOP);\n app.route = route;\n app.on('route', url => app['route'] && app['route'](url));\n if (typeof document === 'object') {\n let basePath = location.pathname;\n if (basePath.endsWith('/')) {\n basePath = basePath.slice(0, -1);\n }\n app.basePath = basePath;\n document.addEventListener(\"DOMContentLoaded\", () => {\n const no_init_route = document.body.hasAttribute('apprun-no-init') || app['no-init-route'] || false;\n const use_hash = app.find('#') || app.find('#/') || false;\n // console.log(`AppRun ${app.version} started with ${use_hash ? 'hash' : 'path'} routing. Initial load: ${init_load ? 'disabled' : 'enabled'}.`);\n window.addEventListener('hashchange', () => route(location.hash));\n window.addEventListener('popstate', () => route(location.pathname));\n if (use_hash) {\n !no_init_route && route(location.hash);\n }\n else {\n !no_init_route && (() => {\n const basePath = app.basePath || '';\n let initialPath = location.pathname;\n // Strip base path if present\n if (basePath && initialPath.startsWith(basePath)) {\n initialPath = initialPath.substring(basePath.length);\n if (!initialPath.startsWith('/'))\n initialPath = '/' + initialPath;\n }\n route(initialPath);\n })();\n document.body.addEventListener('click', e => {\n const element = e.target;\n if (!element)\n return;\n const menu = (element.tagName === 'A' ? element : element.closest('a'));\n if (menu &&\n menu.origin === location.origin &&\n menu.pathname) {\n e.preventDefault();\n // Handle base path for navigation\n const basePath = app.basePath || '';\n const fullPath = basePath + menu.pathname;\n history.pushState(null, '', fullPath);\n route(menu.pathname); // Route with relative path (without base path)\n }\n });\n }\n });\n }\n if (typeof window === 'object') {\n const globalWindow = window;\n globalWindow['Component'] = Component;\n globalWindow['_React'] = globalWindow['React'];\n globalWindow['React'] = app;\n globalWindow['on'] = on;\n globalWindow['customElement'] = customElement;\n globalWindow['safeHTML'] = safeHTML;\n }\n app.use_render = (render, mode = 0) => {\n if (mode === 0) {\n app.render = (el, vdom) => render(vdom, el); // react style\n }\n else {\n app.render = (el, vdom) => render(el, vdom); // apprun style\n }\n };\n app.use_react = (React, ReactDOM) => {\n if (!React || !ReactDOM) {\n console.error('AppRun use_react: React and ReactDOM parameters are required');\n return;\n }\n if (typeof React.createElement !== 'function') {\n console.error('AppRun use_react: Invalid React object - createElement method not found');\n return;\n }\n if (!React.Fragment) {\n console.error('AppRun use_react: Invalid React object - Fragment not found');\n return;\n }\n app.h = app.createElement = React.createElement;\n app.Fragment = React.Fragment;\n // React 18+ uses createRoot API\n if (React.version && React.version.startsWith('18')) {\n if (!ReactDOM.createRoot || typeof ReactDOM.createRoot !== 'function') {\n console.error('AppRun use_react: ReactDOM.createRoot not found in React 18+');\n return;\n }\n app.render = (el, vdom) => {\n if (!el || vdom === undefined)\n return;\n if (!el._root)\n el._root = ReactDOM.createRoot(el);\n el._root.render(vdom);\n };\n }\n else {\n // Legacy React versions\n if (!ReactDOM.render || typeof ReactDOM.render !== 'function') {\n console.error('AppRun use_react: ReactDOM.render not found in legacy React');\n return;\n }\n app.render = (el, vdom) => ReactDOM.render(vdom, el);\n }\n };\n app.addComponents = addComponents;\n}\n//# sourceMappingURL=apprun.js.map"],"names":["APPRUN_VERSION","APPRUN_VERSION_GLOBAL","App","constructor","this","_events","on","name","fn","options","push","off","subscribers","filter","sub","find","run","args","getSubscribers","console","assert","length","forEach","error","delay","Object","keys","apply","once","_t","clearTimeout","setTimeout","runAsync","promises","map","Promise","resolve","reject","all","query","warn","events","evt","endsWith","startsWith","replace","sort","a","b","event","AppRunVersions","_app","root","window","global","self","app","_AppRunVersions","_app$1","safeEventTarget","target","HTMLElement","getStateValue","component","setStateValue","value","state","setState","directive","vdom","Array","isArray","element","type","tag","props","children","key","substring","e","handler","p","checked","Number","multiple","selected","apply_directive","Schema","property","normal","space","merge","definitions","definition","assign","normalize","toLowerCase","prototype","undefined","Info","attribute","booleanish","boolean","commaOrSpaceSeparated","commaSeparated","defined","mustUseProperty","number","overloadedBoolean","spaceSeparated","powers","increment","checks","types","DefinedInfo","mask","index","super","mark","check","values","create","properties","normals","entries","info","transform","attributes","includes","aria","ariaActiveDescendant","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaControls","ariaCurrent","ariaDescribedBy","ariaDetails","ariaDisabled","ariaDropEffect","ariaErrorMessage","ariaExpanded","ariaFlowTo","ariaGrabbed","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLabelledBy","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaOwns","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRelevant","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText","role","_","slice","caseSensitiveTransform","caseInsensitiveTransform","html","acceptcharset","classname","htmlfor","httpequiv","abbr","accept","acceptCharset","accessKey","action","allow","allowFullScreen","allowPaymentRequest","allowUserMedia","alt","as","async","autoCapitalize","autoComplete","autoFocus","autoPlay","blocking","capture","charSet","cite","className","cols","colSpan","content","contentEditable","controls","controlsList","coords","crossOrigin","data","dateTime","decoding","default","defer","dir","dirName","disabled","download","draggable","encType","enterKeyHint","fetchPriority","form","formAction","formEncType","formMethod","formNoValidate","formTarget","headers","height","hidden","high","href","hrefLang","htmlFor","httpEquiv","id","imageSizes","imageSrcSet","inert","inputMode","integrity","is","isMap","itemId","itemProp","itemRef","itemScope","itemType","kind","label","lang","language","list","loading","loop","low","manifest","max","maxLength","media","method","min","minLength","muted","nonce","noModule","noValidate","onAbort","onAfterPrint","onAuxClick","onBeforeMatch","onBeforePrint","onBeforeToggle","onBeforeUnload","onBlur","onCancel","onCanPlay","onCanPlayThrough","onChange","onClick","onClose","onContextLost","onContextMenu","onContextRestored","onCopy","onCueChange","onCut","onDblClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onDurationChange","onEmptied","onEnded","onError","onFocus","onFormData","onHashChange","onInput","onInvalid","onKeyDown","onKeyPress","onKeyUp","onLanguageChange","onLoad","onLoadedData","onLoadedMetadata","onLoadEnd","onLoadStart","onMessage","onMessageError","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onOffline","onOnline","onPageHide","onPageShow","onPaste","onPause","onPlay","onPlaying","onPopState","onProgress","onRateChange","onRejectionHandled","onReset","onResize","onScroll","onScrollEnd","onSecurityPolicyViolation","onSeeked","onSeeking","onSelect","onSlotChange","onStalled","onStorage","onSubmit","onSuspend","onTimeUpdate","onToggle","onUnhandledRejection","onUnload","onVolumeChange","onWaiting","onWheel","open","optimum","pattern","ping","placeholder","playsInline","popover","popoverTarget","popoverTargetAction","poster","preload","readOnly","referrerPolicy","rel","required","reversed","rows","rowSpan","sandbox","scope","scoped","seamless","shadowRootClonable","shadowRootDelegatesFocus","shadowRootMode","shape","size","sizes","slot","span","spellCheck","src","srcDoc","srcLang","srcSet","start","step","style","tabIndex","title","translate","typeMustMatch","useMap","width","wrap","writingSuggestions","align","aLink","archive","axis","background","bgColor","border","borderColor","bottomMargin","cellPadding","cellSpacing","char","charOff","classId","clear","code","codeBase","codeType","color","compact","declare","face","frame","frameBorder","hSpace","leftMargin","link","longDesc","lowSrc","marginHeight","marginWidth","noResize","noHref","noShade","noWrap","object","profile","prompt","rev","rightMargin","rules","scheme","scrolling","standby","summary","text","topMargin","valueType","version","vAlign","vLink","vSpace","allowTransparency","autoCorrect","autoSave","disablePictureInPicture","disableRemotePlayback","prefix","results","security","unselectable","svg","accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dataType","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","horizOriginY","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","navDown","navDownLeft","navDownRight","navLeft","navNext","navPrev","navRight","navUp","navUpLeft","navUpRight","onActivate","onBegin","onEnd","onFocusIn","onFocusOut","onMouseWheel","onRepeat","onShow","onZoom","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDashArray","strokeDashOffset","strokeLineCap","strokeLineJoin","strokeMiterLimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","transformOrigin","typeOf","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wordSpacing","writingMode","xHeight","playbackOrder","timelineBegin","about","accumulate","additive","alphabetic","amplitude","ascent","attributeName","attributeType","azimuth","bandwidth","baseFrequency","baseProfile","bbox","begin","bias","by","calcMode","clip","clipPathUnits","contentScriptType","contentStyleType","cursor","cx","cy","d","defaultAction","descent","diffuseConstant","direction","display","dur","divisor","dx","dy","edgeMode","editable","elevation","end","exponent","externalResourcesRequired","fill","filterRes","filterUnits","focusable","focusHighlight","format","fr","from","fx","fy","g1","g2","glyphRef","gradientTransform","gradientUnits","hanging","hatchContentUnits","hatchUnits","ideographic","initialVisibility","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","kerning","lengthAdjust","limitingConeAngle","local","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","mathematical","mediaCharacterEncoding","mediaContentEncodings","mediaSize","mediaTime","mode","numOctaves","observer","offset","opacity","operator","order","orient","orientation","origin","overflow","overlay","path","pathLength","patternContentUnits","patternTransform","patternUnits","phase","pitch","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","propagate","r","radius","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","requiredFonts","requiredFormats","resource","restart","result","rotate","rx","ry","scale","seed","side","slope","snapshotTime","specularConstant","specularExponent","spreadMethod","spacing","startOffset","stdDeviation","stemh","stemv","stitchTiles","string","stroke","surfaceScale","syncBehavior","syncBehaviorDefault","syncMaster","syncTolerance","syncToleranceDefault","systemLanguage","tableValues","targetX","targetY","textLength","transformBehavior","to","u1","u2","unicode","viewBox","viewTarget","visibility","widths","x","x1","x2","xChannelSelector","y","y1","y2","yChannelSelector","z","zoomAndPan","xlink","xLinkActuate","xLinkArcRole","xLinkHref","xLinkRole","xLinkShow","xLinkTitle","xLinkType","xmlns","xmlnsxlink","xmlnsXLink","xml","xmlBase","xmlLang","xmlSpace","cap","dash","valid","kebab","$0","camelcase","charAt","toUpperCase","htmlBase","svgBase","ATTR_PROPS","propertyInfoCache","Map","getPropertyInfo","isSvg","cacheKey","get","schema","Type","test","rest","dashes","set","setBooleanAttribute","Boolean","shouldSetBooleanAttribute","removeAttribute","setAttribute","setElementProperty","propertyName","setElementAttribute","stringValue","String","split","setAttributeNS","setAttributeOrProperty","dom","prop","document","activeElement","HTMLMediaElement","shouldSkipPatch","cssText","s","camelKey","str","word","join","dataset","setDatasetAttribute","setEventHandler","tagName","isValidAttributeName","updateProps","merged","oldProps","newProps","mergeProps","mergedProps","originalProps","requestAnimationFrame","applyPropertiesToElement","Fragment","collect","ch","c","i","keyCache","cleanupCounter","updateElement","nodes","parent","createComponent","nodeName","updateChildren","render","getElementById","querySelector","update","node","el","key1","key2","same","parentNode","replaceChild","old_len","childNodes","new_len","len","Math","child","textContent","nodeType","nodeValue","createText","SVGElement","insertBefore","old","n","removeChild","lastChild","createDocumentFragment","appendChild","safeHTML","div","createElement","insertAdjacentHTML","indexOf","createTextNode","JSON","stringify","createElementNS","isConnected","cleanupKeyCache","idx","getPrototypeOf","__isAppRunComponent","Date","now","asTag","__componentCache","renderState","mount","mounted","new_state","render_component","new_parent","_component","customElement","componentClass","observedAttributes","attr","connectedCallback","opts","_shadowRoot","shadow","attachShadow","attrMap","reduce","lc","_attrMap","item","defineProperty","attributeChangedCallback","configurable","enumerable","_props","dispatchEvent","bind","disconnectedCallback","unload","unmount","oldValue","mappedName","webComponent","customElements","define","Reflect","meta","WeakMap","defineMetadata","metadataKey","metadataValue","has","getMetadataKeys","getMetadata","descriptor","toString","REFRESH","Component","view","safeGetElementById","selector","context","safeQuerySelector","tracking_attr","getAttribute","tracking_id","valueOf","MutationObserver","changes","body","contains","disconnect","observe","childList","subtree","attributeOldValue","attributeFilter","transition","rendered","history","handleAsyncIterator","iterator","done","next","Symbol","asyncIterator","then","v","_state","enable_history","_history","_history_idx","callback","_actions","_global_events","_history_prev","_history_next","global_event","prev","route","add_actions","is_global_event","add_action","current_state","newState","actions","act","trim","handleEmptyPath","hashSubscribers","ROUTER_EVENT","pathSubscribers","hashSlashSubscribers","ROUTER_404_EVENT","routeWithHierarchy","url","normalizeTrailingSlash","basePath","normalizedBasePath","stripped","stripBasePath","segments","parsePathSegments","routeType","nonEmptySegments","validateHierarchyDepth","hierarchy","currentSegments","routeName","generateRouteHierarchy","handlerInfo","originalSegments","handlerDepth","eventName","parameters","findHandlerInHierarchy","publishRoute","minimalRoute","isComponentInstance","obj","isComponentConstructor","isFactoryFunction","resolveComponent","maxDepth","resolved","depth","h","Error","model","NOOP","location","pathname","addEventListener","no_init_route","hasAttribute","use_hash","hash","initialPath","menu","closest","preventDefault","fullPath","pushState","globalWindow","use_render","use_react","React","ReactDOM","createRoot","_root","addComponents","components"],"mappings":"AAWO,MAAMA,EAAiB,SAEjBC,EAAwB,UAAUD,ICkCxC,MAAME,EACT,WAAAC,GACIC,KAAKC,QAAU,CAAA,CACnB,CACA,EAAAC,CAAGC,EAAMC,EAAIC,EAAU,CAAA,GACnBL,KAAKC,QAAQE,GAAQH,KAAKC,QAAQE,IAAS,GAC3CH,KAAKC,QAAQE,GAAMG,KAAK,CAAEF,KAAIC,WAClC,CACA,GAAAE,CAAIJ,EAAMC,GACN,MAAMI,EAAcR,KAAKC,QAAQE,IAAS,GAC1CH,KAAKC,QAAQE,GAAQK,EAAYC,QAAQC,GAAQA,EAAIN,KAAOA,GAChE,CACA,IAAAO,CAAKR,GACD,OAAOH,KAAKC,QAAQE,EACxB,CACA,GAAAS,CAAIT,KAASU,GACT,MAAML,EAAcR,KAAKc,eAAeX,EAAMH,KAAKC,SAqBnD,OApBAc,QAAQC,OAAOR,GAAeA,EAAYS,OAAS,EAAG,4BAA8Bd,GACpFK,EAAYU,SAASR,IACjB,MAAMN,GAAEA,EAAEC,QAAEA,GAAYK,EACxB,IAAKN,GAAoB,mBAAPA,EAEd,OADAW,QAAQI,MAAM,6BAA6BhB,wBAA4BC,IAChE,EAEX,GAAIC,EAAQe,MACRpB,KAAKoB,MAAMjB,EAAMC,EAAIS,EAAMR,QAG3B,IACIgB,OAAOC,KAAKjB,GAASY,OAAS,EAAIb,EAAGmB,MAAMvB,KAAM,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wB,OAAO3vB,EAAS+mB,GAJnBpqB,QAAQI,MAAM,sBAAsBiD,IAIV,GAG1C,MAEArD,QAAQI,MAAM,0GAhDVJ,QAAQI,MAAM,8CAA8CwC,YAAoB64B,IAiDxF,CCqHJ","x_google_ignoreList":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]}
|
|
1
|
+
{"version":3,"file":"apprun.esm.js","sources":["../esm/version.js","../esm/app.js","../esm/type-utils.js","../esm/directive.js","../node_modules/property-information/lib/util/schema.js","../node_modules/property-information/lib/util/merge.js","../node_modules/property-information/lib/normalize.js","../node_modules/property-information/lib/util/info.js","../node_modules/property-information/lib/util/types.js","../node_modules/property-information/lib/util/defined-info.js","../node_modules/property-information/lib/util/create.js","../node_modules/property-information/lib/aria.js","../node_modules/property-information/lib/util/case-sensitive-transform.js","../node_modules/property-information/lib/util/case-insensitive-transform.js","../node_modules/property-information/lib/html.js","../node_modules/property-information/lib/svg.js","../node_modules/property-information/lib/xlink.js","../node_modules/property-information/lib/xmlns.js","../node_modules/property-information/lib/xml.js","../node_modules/property-information/lib/find.js","../node_modules/property-information/index.js","../esm/vdom-my-prop-attr.js","../esm/vdom-my.js","../esm/web-component.js","../esm/decorator.js","../esm/component.js","../esm/router.js","../esm/add-components.js","../esm/apprun.js"],"sourcesContent":["/**\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// Import version from package.json to maintain single source of truth\n// This version string is used across the framework\nexport const APPRUN_VERSION = '3.37.2';\n// Version string with prefix for global tracking\nexport const APPRUN_VERSION_GLOBAL = `AppRun-${APPRUN_VERSION}`;\n//# sourceMappingURL=version.js.map","/**\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 handling\n * - runAsync(): Publish events asynchronously with Promise support, returns handler values\n * - query(): Deprecated alias for runAsync() - use runAsync() instead\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 (events ending with '*')\n * - Delayed event execution with timeout management\n * - Once-only event subscriptions\n * - Async event handling with Promise.all\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 */\nimport { APPRUN_VERSION_GLOBAL } from './version';\nexport class App {\n constructor() {\n this._events = {};\n }\n on(name, fn, options = {}) {\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn, options });\n }\n off(name, fn) {\n const subscribers = this._events[name] || [];\n this._events[name] = subscribers.filter((sub) => sub.fn !== fn);\n }\n find(name) {\n return this._events[name];\n }\n run(name, ...args) {\n const subscribers = this.getSubscribers(name, this._events);\n 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, fn, args, options);\n }\n else {\n try {\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }\n catch (error) {\n console.error(`Error in event handler for '${name}':`, error);\n }\n }\n return !sub.options.once;\n });\n return subscribers.length;\n }\n once(name, fn, options = {}) {\n this.on(name, fn, { ...options, once: true });\n }\n delay(name, fn, args, options) {\n if (options._t)\n clearTimeout(options._t);\n options._t = setTimeout(() => {\n clearTimeout(options._t);\n try {\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }\n catch (error) {\n console.error(`Error in delayed event handler for '${name}':`, error);\n }\n }, options.delay);\n }\n runAsync(name, ...args) {\n const subscribers = this.getSubscribers(name, this._events);\n 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 return Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }\n catch (error) {\n console.error(`Error in async event handler for '${name}':`, error);\n return Promise.reject(error);\n }\n });\n return Promise.all(promises);\n }\n /**\n * @deprecated Use runAsync() instead. app.query() will be removed in a future version.\n */\n query(name, ...args) {\n console.warn('app.query() is deprecated. Use app.runAsync() instead.');\n return this.runAsync(name, ...args);\n }\n getSubscribers(name, events) {\n const subscribers = events[name] || [];\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 Object.keys(events).filter(evt => evt.endsWith('*') && name.startsWith(evt.replace('*', '')))\n .sort((a, b) => b.length - a.length)\n .forEach(evt => subscribers.push(...events[evt].map(sub => ({\n ...sub,\n options: { ...sub.options, event: name }\n }))));\n return subscribers;\n }\n}\nconst AppRunVersions = APPRUN_VERSION_GLOBAL;\nlet _app;\nconst root = (typeof window !== 'undefined' ? window :\n typeof global !== 'undefined' ? global :\n typeof self !== 'undefined' ? self : {});\nif (root.app && root._AppRunVersions) {\n _app = root.app;\n}\nelse {\n _app = new App();\n root.app = _app;\n root._AppRunVersions = AppRunVersions;\n}\nexport default _app;\n//# sourceMappingURL=app.js.map","/**\n * Type Safety Utilities for AppRun\n *\n * This file provides utility functions and types to improve type safety\n * across the AppRun framework, including:\n * 1. Safe type assertions with null checks\n * 2. Global object assignment helpers\n * 3. Event target type guards\n * 4. Function validation utilities\n */\n/**\n * Safely cast event target to specific HTML element type with null check\n */\nexport function safeEventTarget(event) {\n return event?.target instanceof HTMLElement ? event.target : null;\n}\n/**\n * Type guard to check if an object is a valid function\n */\nexport function isFunction(obj) {\n return typeof obj === 'function';\n}\n/**\n * Type guard to check if an object is a valid HTML element\n */\nexport function isHTMLElement(obj) {\n return obj instanceof HTMLElement;\n}\n/**\n * Safely assign properties to global object with type checking\n */\nexport function safeGlobalAssign(globalObj, assignments) {\n if (typeof globalObj === 'object' && globalObj !== null) {\n Object.keys(assignments).forEach(key => {\n globalObj[key] = assignments[key];\n });\n }\n}\n/**\n * Safely get property from global object with fallback\n */\nexport function safeGlobalGet(globalObj, property, fallback) {\n if (typeof globalObj === 'object' && globalObj !== null) {\n return globalObj[property] ?? fallback;\n }\n return fallback;\n}\n/**\n * Type-safe wrapper for DOM element queries\n */\nexport function safeQuerySelector(selector, context = document) {\n try {\n return context.querySelector(selector);\n }\n catch (error) {\n console.warn(`Invalid selector: ${selector}`, error);\n return null;\n }\n}\n/**\n * Type-safe wrapper for DOM element by ID\n */\nexport function safeGetElementById(id) {\n try {\n return document.getElementById(id);\n }\n catch (error) {\n console.warn(`Error getting element by id: ${id}`, error);\n return null;\n }\n}\n/**\n * Validate and safely execute a function with error handling\n */\nexport function safeExecute(fn, args, context, errorMessage) {\n if (!isFunction(fn)) {\n if (errorMessage) {\n console.warn(errorMessage, fn);\n }\n return undefined;\n }\n try {\n return context ? fn.apply(context, args) : fn(...args);\n }\n catch (error) {\n console.error(errorMessage || 'Error executing function:', error);\n return undefined;\n }\n}\n//# sourceMappingURL=type-utils.js.map","/**\n * Component Directives Implementation\n *\n * This file provides built-in directives for components:\n * 1. Event Binding ($on directives)\n * - $on: Bind DOM events to component events\n * - Supports event delegation and parameters\n * - Handles function, string, and array event handlers\n * - Type-safe event target handling\n *\n * 2. Two-way Data Binding ($bind directive)\n * - $bind: Sync form elements with component state\n * - Handles input types: text, checkbox, radio, number, range\n * - Supports select (single/multiple) and textarea elements\n * - Automatic value type conversion for numbers\n * - Support for complex property paths\n *\n * 3. Custom Directives\n * - Extensible directive system via '$' events\n * - Processes virtual DOM during rendering\n * - Supports custom attribute directives\n *\n * Features:\n * - Automatic state synchronization\n * - Type conversion for form inputs\n * - Event delegation support\n * - Multiple event handler formats\n * - Nested property binding\n * - Custom directive extensibility\n *\n * Type Safety Improvements (v3.35.1):\n * - Added null checks for event targets before type assertions\n * - Proper typing for different HTML element types\n * - Enhanced error handling for invalid event targets\n * - Safer DOM element property access\n *\n * Usage:\n * ```tsx\n * // Event binding\n * <button $onclick=\"event-name\">Click</button>\n * <input $oninput={e => setState(e.target.value)} />\n *\n * // Two-way binding\n * <input $bind=\"state.property\" />\n * <select $bind=\"selected\">...</select>\n *\n * // Array handlers\n * <button $onclick={['handler', param1, param2]}>Click</button>\n * ```\n */\nimport app from './app';\nimport { safeEventTarget } from './type-utils';\nconst getStateValue = (component, name) => {\n return (name ? component['state'][name] : component['state']) || '';\n};\nconst setStateValue = (component, name, value) => {\n if (name) {\n const state = component['state'] || {};\n state[name] = value;\n component.setState(state);\n }\n else {\n component.setState(value);\n }\n};\nconst apply_directive = (key, props, tag, component) => {\n if (key.startsWith('$on')) {\n const event = props[key];\n key = key.substring(1);\n if (typeof event === 'boolean') {\n props[key] = e => component.run ? component.run(key, e) : app.run(key, e);\n }\n else if (typeof event === 'string') {\n props[key] = e => component.run ? component.run(event, e) : app.run(event, e);\n }\n else if (typeof event === 'function') {\n props[key] = e => component.setState(event(component.state, e));\n }\n else if (Array.isArray(event)) {\n const [handler, ...p] = event;\n if (typeof handler === 'string') {\n props[key] = e => component.run ? component.run(handler, ...p, e) : app.run(handler, ...p, e);\n }\n else if (typeof handler === 'function') {\n props[key] = e => component.setState(handler(component.state, ...p, e));\n }\n }\n }\n else if (key === '$bind') {\n const type = props['type'] || 'text';\n const name = typeof props[key] === 'string' ? props[key] : props['name'];\n if (tag === 'input') {\n switch (type) {\n case 'checkbox':\n props['checked'] = getStateValue(component, name);\n props['onclick'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.checked);\n }\n };\n break;\n case 'radio':\n props['checked'] = getStateValue(component, name) === props['value'];\n props['onclick'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.value);\n }\n };\n break;\n case 'number':\n case 'range':\n props['value'] = getStateValue(component, name);\n props['oninput'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, Number(target.value));\n }\n };\n break;\n default:\n props['value'] = getStateValue(component, name);\n props['oninput'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.value);\n }\n };\n }\n }\n else if (tag === 'select') {\n props['value'] = getStateValue(component, name);\n props['onchange'] = e => {\n const target = safeEventTarget(e);\n if (target && !target.multiple) { // multiple selection use $bind on option\n setStateValue(component, name || target.name, target.value);\n }\n };\n }\n else if (tag === 'option') {\n props['selected'] = getStateValue(component, name);\n props['onclick'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.selected);\n }\n };\n }\n else if (tag === 'textarea') {\n props['innerHTML'] = getStateValue(component, name);\n props['oninput'] = e => {\n const target = safeEventTarget(e);\n if (target) {\n setStateValue(component, name || target.name, target.value);\n }\n };\n }\n }\n else {\n app.run('$', { key, tag, props, component });\n }\n};\nconst directive = (vdom, component) => {\n if (Array.isArray(vdom)) {\n return vdom.map(element => directive(element, component));\n }\n else {\n let { type, tag, props, children } = vdom;\n tag = tag || type;\n children = children || props?.children;\n if (props)\n Object.keys(props).forEach(key => {\n if (key.startsWith('$')) {\n apply_directive(key, props, tag, component);\n delete props[key];\n }\n });\n if (children)\n directive(children, component);\n return vdom;\n }\n};\nexport default directive;\n//# sourceMappingURL=directive.js.map","/**\n * @import {Schema as SchemaType, Space} from 'property-information'\n */\n\n/** @type {SchemaType} */\nexport class Schema {\n /**\n * @param {SchemaType['property']} property\n * Property.\n * @param {SchemaType['normal']} normal\n * Normal.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Schema.\n */\n constructor(property, normal, space) {\n this.normal = normal\n this.property = property\n\n if (space) {\n this.space = space\n }\n }\n}\n\nSchema.prototype.normal = {}\nSchema.prototype.property = {}\nSchema.prototype.space = undefined\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {ReadonlyArray<Schema>} definitions\n * Definitions.\n * @param {Space | undefined} [space]\n * Space.\n * @returns {Schema}\n * Schema.\n */\nexport function merge(definitions, space) {\n /** @type {Record<string, Info>} */\n const property = {}\n /** @type {Record<string, string>} */\n const normal = {}\n\n for (const definition of definitions) {\n Object.assign(property, definition.property)\n Object.assign(normal, definition.normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * Get the cleaned case insensitive form of an attribute or property.\n *\n * @param {string} value\n * An attribute-like or property-like name.\n * @returns {string}\n * Value that can be used to look up the properly cased property on a\n * `Schema`.\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","/**\n * @import {Info as InfoType} from 'property-information'\n */\n\n/** @type {InfoType} */\nexport class Info {\n /**\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @returns\n * Info.\n */\n constructor(property, attribute) {\n this.attribute = attribute\n this.property = property\n }\n}\n\nInfo.prototype.attribute = ''\nInfo.prototype.booleanish = false\nInfo.prototype.boolean = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.defined = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.number = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.property = ''\nInfo.prototype.spaceSeparated = false\nInfo.prototype.space = undefined\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","/**\n * @import {Space} from 'property-information'\n */\n\nimport {Info} from './info.js'\nimport * as types from './types.js'\n\nconst checks = /** @type {ReadonlyArray<keyof typeof types>} */ (\n Object.keys(types)\n)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @param {number | null | undefined} [mask]\n * Mask.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Info.\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @template {keyof DefinedInfo} Key\n * Key type.\n * @param {DefinedInfo} values\n * Info.\n * @param {Key} key\n * Key.\n * @param {DefinedInfo[Key]} value\n * Value.\n * @returns {undefined}\n * Nothing.\n */\nfunction mark(values, key, value) {\n if (value) {\n values[key] = value\n }\n}\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\n/**\n * @typedef Definition\n * Definition of a schema.\n * @property {Record<string, string> | undefined} [attributes]\n * Normalzed names to special attribute case.\n * @property {ReadonlyArray<string> | undefined} [mustUseProperty]\n * Normalized names that must be set as properties.\n * @property {Record<string, number | null>} properties\n * Property names to their types.\n * @property {Space | undefined} [space]\n * Space.\n * @property {Transform} transform\n * Transform a property name.\n */\n\n/**\n * @callback Transform\n * Transform.\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Attribute.\n */\n\nimport {normalize} from '../normalize.js'\nimport {DefinedInfo} from './defined-info.js'\nimport {Schema} from './schema.js'\n\n/**\n * @param {Definition} definition\n * Definition.\n * @returns {Schema}\n * Schema.\n */\nexport function create(definition) {\n /** @type {Record<string, Info>} */\n const properties = {}\n /** @type {Record<string, string>} */\n const normals = {}\n\n for (const [property, value] of Object.entries(definition.properties)) {\n const info = new DefinedInfo(\n property,\n definition.transform(definition.attributes || {}, property),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(property)\n ) {\n info.mustUseProperty = true\n }\n\n properties[property] = info\n\n normals[normalize(property)] = property\n normals[normalize(info.attribute)] = property\n }\n\n return new Schema(properties, normals, definition.space)\n}\n","import {create} from './util/create.js'\nimport {booleanish, number, spaceSeparated} from './util/types.js'\n\nexport const aria = create({\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n },\n transform(_, property) {\n return property === 'role'\n ? property\n : 'aria-' + property.slice(4).toLowerCase()\n }\n})\n","/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} attribute\n * Attribute.\n * @returns {string}\n * Transformed attribute.\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Transformed property.\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n booleanish,\n boolean,\n commaSeparated,\n number,\n overloadedBoolean,\n spaceSeparated\n} from './util/types.js'\n\nexport const html = create({\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: overloadedBoolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // `<body>`. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // `<object>`. List of URIs to archives\n axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`\n background: null, // `<body>`. Use CSS `background-image` instead\n bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead\n border: number, // `<table>`. Use CSS `border-width` instead,\n borderColor: null, // `<table>`. Use CSS `border-color` instead,\n bottomMargin: number, // `<body>`\n cellPadding: null, // `<table>`\n cellSpacing: null, // `<table>`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // `<object>`\n clear: null, // `<br>`. Use CSS `clear` instead\n code: null, // `<object>`\n codeBase: null, // `<object>`\n codeType: null, // `<object>`\n color: null, // `<font>` and `<hr>`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // `<object>`\n event: null, // `<script>`\n face: null, // `<font>`. Use CSS instead\n frame: null, // `<table>`\n frameBorder: null, // `<iframe>`. Use CSS `border` instead\n hSpace: number, // `<img>` and `<object>`\n leftMargin: number, // `<body>`\n link: null, // `<body>`. Use CSS `a:link {color: *}` instead\n longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`\n lowSrc: null, // `<img>`. Use a `<picture>`\n marginHeight: number, // `<body>`\n marginWidth: number, // `<body>`\n noResize: boolean, // `<frame>`\n noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`\n noShade: boolean, // `<hr>`. Use background-color and height instead of borders\n noWrap: boolean, // `<td>` and `<th>`\n object: null, // `<applet>`\n profile: null, // `<head>`\n prompt: null, // `<isindex>`\n rev: null, // `<link>`\n rightMargin: number, // `<body>`\n rules: null, // `<table>`\n scheme: null, // `<meta>`\n scrolling: booleanish, // `<frame>`. Use overflow in the child context\n standby: null, // `<object>`\n summary: null, // `<table>`\n text: null, // `<body>`. Use CSS `color` instead\n topMargin: number, // `<body>`\n valueType: null, // `<param>`\n version: null, // `<html>`. Use a doctype.\n vAlign: null, // Several. Use CSS `vertical-align` instead\n vLink: null, // `<body>`. Use CSS `a:visited {color}` instead\n vSpace: number, // `<img>` and `<object>`\n\n // Non-standard Properties.\n allowTransparency: null,\n autoCorrect: null,\n autoSave: null,\n disablePictureInPicture: boolean,\n disableRemotePlayback: boolean,\n prefix: null,\n property: null,\n results: number,\n security: null,\n unselectable: null\n },\n space: 'html',\n transform: caseInsensitiveTransform\n})\n","import {caseSensitiveTransform} from './util/case-sensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n boolean,\n commaOrSpaceSeparated,\n commaSeparated,\n number,\n spaceSeparated\n} from './util/types.js'\n\nexport const svg = create({\n attributes: {\n accentHeight: 'accent-height',\n alignmentBaseline: 'alignment-baseline',\n arabicForm: 'arabic-form',\n baselineShift: 'baseline-shift',\n capHeight: 'cap-height',\n className: 'class',\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n colorProfile: 'color-profile',\n colorRendering: 'color-rendering',\n crossOrigin: 'crossorigin',\n dataType: 'datatype',\n dominantBaseline: 'dominant-baseline',\n enableBackground: 'enable-background',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\n fontFamily: 'font-family',\n fontSize: 'font-size',\n fontSizeAdjust: 'font-size-adjust',\n fontStretch: 'font-stretch',\n fontStyle: 'font-style',\n fontVariant: 'font-variant',\n fontWeight: 'font-weight',\n glyphName: 'glyph-name',\n glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n glyphOrientationVertical: 'glyph-orientation-vertical',\n hrefLang: 'hreflang',\n horizAdvX: 'horiz-adv-x',\n horizOriginX: 'horiz-origin-x',\n horizOriginY: 'horiz-origin-y',\n imageRendering: 'image-rendering',\n letterSpacing: 'letter-spacing',\n lightingColor: 'lighting-color',\n markerEnd: 'marker-end',\n markerMid: 'marker-mid',\n markerStart: 'marker-start',\n navDown: 'nav-down',\n navDownLeft: 'nav-down-left',\n navDownRight: 'nav-down-right',\n navLeft: 'nav-left',\n navNext: 'nav-next',\n navPrev: 'nav-prev',\n navRight: 'nav-right',\n navUp: 'nav-up',\n navUpLeft: 'nav-up-left',\n navUpRight: 'nav-up-right',\n onAbort: 'onabort',\n onActivate: 'onactivate',\n onAfterPrint: 'onafterprint',\n onBeforePrint: 'onbeforeprint',\n onBegin: 'onbegin',\n onCancel: 'oncancel',\n onCanPlay: 'oncanplay',\n onCanPlayThrough: 'oncanplaythrough',\n onChange: 'onchange',\n onClick: 'onclick',\n onClose: 'onclose',\n onCopy: 'oncopy',\n onCueChange: 'oncuechange',\n onCut: 'oncut',\n onDblClick: 'ondblclick',\n onDrag: 'ondrag',\n onDragEnd: 'ondragend',\n onDragEnter: 'ondragenter',\n onDragExit: 'ondragexit',\n onDragLeave: 'ondragleave',\n onDragOver: 'ondragover',\n onDragStart: 'ondragstart',\n onDrop: 'ondrop',\n onDurationChange: 'ondurationchange',\n onEmptied: 'onemptied',\n onEnd: 'onend',\n onEnded: 'onended',\n onError: 'onerror',\n onFocus: 'onfocus',\n onFocusIn: 'onfocusin',\n onFocusOut: 'onfocusout',\n onHashChange: 'onhashchange',\n onInput: 'oninput',\n onInvalid: 'oninvalid',\n onKeyDown: 'onkeydown',\n onKeyPress: 'onkeypress',\n onKeyUp: 'onkeyup',\n onLoad: 'onload',\n onLoadedData: 'onloadeddata',\n onLoadedMetadata: 'onloadedmetadata',\n onLoadStart: 'onloadstart',\n onMessage: 'onmessage',\n onMouseDown: 'onmousedown',\n onMouseEnter: 'onmouseenter',\n onMouseLeave: 'onmouseleave',\n onMouseMove: 'onmousemove',\n onMouseOut: 'onmouseout',\n onMouseOver: 'onmouseover',\n onMouseUp: 'onmouseup',\n onMouseWheel: 'onmousewheel',\n onOffline: 'onoffline',\n onOnline: 'ononline',\n onPageHide: 'onpagehide',\n onPageShow: 'onpageshow',\n onPaste: 'onpaste',\n onPause: 'onpause',\n onPlay: 'onplay',\n onPlaying: 'onplaying',\n onPopState: 'onpopstate',\n onProgress: 'onprogress',\n onRateChange: 'onratechange',\n onRepeat: 'onrepeat',\n onReset: 'onreset',\n onResize: 'onresize',\n onScroll: 'onscroll',\n onSeeked: 'onseeked',\n onSeeking: 'onseeking',\n onSelect: 'onselect',\n onShow: 'onshow',\n onStalled: 'onstalled',\n onStorage: 'onstorage',\n onSubmit: 'onsubmit',\n onSuspend: 'onsuspend',\n onTimeUpdate: 'ontimeupdate',\n onToggle: 'ontoggle',\n onUnload: 'onunload',\n onVolumeChange: 'onvolumechange',\n onWaiting: 'onwaiting',\n onZoom: 'onzoom',\n overlinePosition: 'overline-position',\n overlineThickness: 'overline-thickness',\n paintOrder: 'paint-order',\n panose1: 'panose-1',\n pointerEvents: 'pointer-events',\n referrerPolicy: 'referrerpolicy',\n renderingIntent: 'rendering-intent',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strikethroughPosition: 'strikethrough-position',\n strikethroughThickness: 'strikethrough-thickness',\n strokeDashArray: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeLineCap: 'stroke-linecap',\n strokeLineJoin: 'stroke-linejoin',\n strokeMiterLimit: 'stroke-miterlimit',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n tabIndex: 'tabindex',\n textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n typeOf: 'typeof',\n underlinePosition: 'underline-position',\n underlineThickness: 'underline-thickness',\n unicodeBidi: 'unicode-bidi',\n unicodeRange: 'unicode-range',\n unitsPerEm: 'units-per-em',\n vAlphabetic: 'v-alphabetic',\n vHanging: 'v-hanging',\n vIdeographic: 'v-ideographic',\n vMathematical: 'v-mathematical',\n vectorEffect: 'vector-effect',\n vertAdvY: 'vert-adv-y',\n vertOriginX: 'vert-origin-x',\n vertOriginY: 'vert-origin-y',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n xHeight: 'x-height',\n // These were camelcased in Tiny. Now lowercased in SVG 2\n playbackOrder: 'playbackorder',\n timelineBegin: 'timelinebegin'\n },\n properties: {\n about: commaOrSpaceSeparated,\n accentHeight: number,\n accumulate: null,\n additive: null,\n alignmentBaseline: null,\n alphabetic: number,\n amplitude: number,\n arabicForm: null,\n ascent: number,\n attributeName: null,\n attributeType: null,\n azimuth: number,\n bandwidth: null,\n baselineShift: null,\n baseFrequency: null,\n baseProfile: null,\n bbox: null,\n begin: null,\n bias: number,\n by: null,\n calcMode: null,\n capHeight: number,\n className: spaceSeparated,\n clip: null,\n clipPath: null,\n clipPathUnits: null,\n clipRule: null,\n color: null,\n colorInterpolation: null,\n colorInterpolationFilters: null,\n colorProfile: null,\n colorRendering: null,\n content: null,\n contentScriptType: null,\n contentStyleType: null,\n crossOrigin: null,\n cursor: null,\n cx: null,\n cy: null,\n d: null,\n dataType: null,\n defaultAction: null,\n descent: number,\n diffuseConstant: number,\n direction: null,\n display: null,\n dur: null,\n divisor: number,\n dominantBaseline: null,\n download: boolean,\n dx: null,\n dy: null,\n edgeMode: null,\n editable: null,\n elevation: number,\n enableBackground: null,\n end: null,\n event: null,\n exponent: number,\n externalResourcesRequired: null,\n fill: null,\n fillOpacity: number,\n fillRule: null,\n filter: null,\n filterRes: null,\n filterUnits: null,\n floodColor: null,\n floodOpacity: null,\n focusable: null,\n focusHighlight: null,\n fontFamily: null,\n fontSize: null,\n fontSizeAdjust: null,\n fontStretch: null,\n fontStyle: null,\n fontVariant: null,\n fontWeight: null,\n format: null,\n fr: null,\n from: null,\n fx: null,\n fy: null,\n g1: commaSeparated,\n g2: commaSeparated,\n glyphName: commaSeparated,\n glyphOrientationHorizontal: null,\n glyphOrientationVertical: null,\n glyphRef: null,\n gradientTransform: null,\n gradientUnits: null,\n handler: null,\n hanging: number,\n hatchContentUnits: null,\n hatchUnits: null,\n height: null,\n href: null,\n hrefLang: null,\n horizAdvX: number,\n horizOriginX: number,\n horizOriginY: number,\n id: null,\n ideographic: number,\n imageRendering: null,\n initialVisibility: null,\n in: null,\n in2: null,\n intercept: number,\n k: number,\n k1: number,\n k2: number,\n k3: number,\n k4: number,\n kernelMatrix: commaOrSpaceSeparated,\n kernelUnitLength: null,\n keyPoints: null, // SEMI_COLON_SEPARATED\n keySplines: null, // SEMI_COLON_SEPARATED\n keyTimes: null, // SEMI_COLON_SEPARATED\n kerning: null,\n lang: null,\n lengthAdjust: null,\n letterSpacing: null,\n lightingColor: null,\n limitingConeAngle: number,\n local: null,\n markerEnd: null,\n markerMid: null,\n markerStart: null,\n markerHeight: null,\n markerUnits: null,\n markerWidth: null,\n mask: null,\n maskContentUnits: null,\n maskUnits: null,\n mathematical: null,\n max: null,\n media: null,\n mediaCharacterEncoding: null,\n mediaContentEncodings: null,\n mediaSize: number,\n mediaTime: null,\n method: null,\n min: null,\n mode: null,\n name: null,\n navDown: null,\n navDownLeft: null,\n navDownRight: null,\n navLeft: null,\n navNext: null,\n navPrev: null,\n navRight: null,\n navUp: null,\n navUpLeft: null,\n navUpRight: null,\n numOctaves: null,\n observer: null,\n offset: null,\n onAbort: null,\n onActivate: null,\n onAfterPrint: null,\n onBeforePrint: null,\n onBegin: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnd: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFocusIn: null,\n onFocusOut: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadStart: null,\n onMessage: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onMouseWheel: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRepeat: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onShow: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onZoom: null,\n opacity: null,\n operator: null,\n order: null,\n orient: null,\n orientation: null,\n origin: null,\n overflow: null,\n overlay: null,\n overlinePosition: number,\n overlineThickness: number,\n paintOrder: null,\n panose1: null,\n path: null,\n pathLength: number,\n patternContentUnits: null,\n patternTransform: null,\n patternUnits: null,\n phase: null,\n ping: spaceSeparated,\n pitch: null,\n playbackOrder: null,\n pointerEvents: null,\n points: null,\n pointsAtX: number,\n pointsAtY: number,\n pointsAtZ: number,\n preserveAlpha: null,\n preserveAspectRatio: null,\n primitiveUnits: null,\n propagate: null,\n property: commaOrSpaceSeparated,\n r: null,\n radius: null,\n referrerPolicy: null,\n refX: null,\n refY: null,\n rel: commaOrSpaceSeparated,\n rev: commaOrSpaceSeparated,\n renderingIntent: null,\n repeatCount: null,\n repeatDur: null,\n requiredExtensions: commaOrSpaceSeparated,\n requiredFeatures: commaOrSpaceSeparated,\n requiredFonts: commaOrSpaceSeparated,\n requiredFormats: commaOrSpaceSeparated,\n resource: null,\n restart: null,\n result: null,\n rotate: null,\n rx: null,\n ry: null,\n scale: null,\n seed: null,\n shapeRendering: null,\n side: null,\n slope: null,\n snapshotTime: null,\n specularConstant: number,\n specularExponent: number,\n spreadMethod: null,\n spacing: null,\n startOffset: null,\n stdDeviation: null,\n stemh: null,\n stemv: null,\n stitchTiles: null,\n stopColor: null,\n stopOpacity: null,\n strikethroughPosition: number,\n strikethroughThickness: number,\n string: null,\n stroke: null,\n strokeDashArray: commaOrSpaceSeparated,\n strokeDashOffset: null,\n strokeLineCap: null,\n strokeLineJoin: null,\n strokeMiterLimit: number,\n strokeOpacity: number,\n strokeWidth: null,\n style: null,\n surfaceScale: number,\n syncBehavior: null,\n syncBehaviorDefault: null,\n syncMaster: null,\n syncTolerance: null,\n syncToleranceDefault: null,\n systemLanguage: commaOrSpaceSeparated,\n tabIndex: number,\n tableValues: null,\n target: null,\n targetX: number,\n targetY: number,\n textAnchor: null,\n textDecoration: null,\n textRendering: null,\n textLength: null,\n timelineBegin: null,\n title: null,\n transformBehavior: null,\n type: null,\n typeOf: commaOrSpaceSeparated,\n to: null,\n transform: null,\n transformOrigin: null,\n u1: null,\n u2: null,\n underlinePosition: number,\n underlineThickness: number,\n unicode: null,\n unicodeBidi: null,\n unicodeRange: null,\n unitsPerEm: number,\n values: null,\n vAlphabetic: number,\n vMathematical: number,\n vectorEffect: null,\n vHanging: number,\n vIdeographic: number,\n version: null,\n vertAdvY: number,\n vertOriginX: number,\n vertOriginY: number,\n viewBox: null,\n viewTarget: null,\n visibility: null,\n width: null,\n widths: null,\n wordSpacing: null,\n writingMode: null,\n x: null,\n x1: null,\n x2: null,\n xChannelSelector: null,\n xHeight: number,\n y: null,\n y1: null,\n y2: null,\n yChannelSelector: null,\n z: null,\n zoomAndPan: null\n },\n space: 'svg',\n transform: caseSensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n },\n space: 'xlink',\n transform(_, property) {\n return 'xlink:' + property.slice(5).toLowerCase()\n }\n})\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n properties: {xmlnsXLink: null, xmlns: null},\n space: 'xmlns',\n transform: caseInsensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n properties: {xmlBase: null, xmlLang: null, xmlSpace: null},\n space: 'xml',\n transform(_, property) {\n return 'xml:' + property.slice(3).toLowerCase()\n }\n})\n","/**\n * @import {Schema} from 'property-information'\n */\n\nimport {DefinedInfo} from './util/defined-info.js'\nimport {Info} from './util/info.js'\nimport {normalize} from './normalize.js'\n\nconst cap = /[A-Z]/g\nconst dash = /-[a-z]/g\nconst valid = /^data[-\\w.:]+$/i\n\n/**\n * Look up info on a property.\n *\n * In most cases the given `schema` contains info on the property.\n * All standard,\n * most legacy,\n * and some non-standard properties are supported.\n * For these cases,\n * the returned `Info` has hints about the value of the property.\n *\n * `name` can also be a valid data attribute or property,\n * in which case an `Info` object with the correctly cased `attribute` and\n * `property` is returned.\n *\n * `name` can be an unknown attribute,\n * in which case an `Info` object with `attribute` and `property` set to the\n * given name is returned.\n * It is not recommended to provide unsupported legacy or recently specced\n * properties.\n *\n *\n * @param {Schema} schema\n * Schema;\n * either the `html` or `svg` export.\n * @param {string} value\n * An attribute-like or property-like name;\n * it will be passed through `normalize` to hopefully find the correct info.\n * @returns {Info}\n * Info.\n */\nexport function find(schema, value) {\n const normal = normalize(value)\n let property = value\n let Type = Info\n\n if (normal in schema.normal) {\n return schema.property[schema.normal[normal]]\n }\n\n if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) {\n // Attribute or property.\n if (value.charAt(4) === '-') {\n // Turn it into a property.\n const rest = value.slice(5).replace(dash, camelcase)\n property = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1)\n } else {\n // Turn it into an attribute.\n const rest = value.slice(4)\n\n if (!dash.test(rest)) {\n let dashes = rest.replace(cap, kebab)\n\n if (dashes.charAt(0) !== '-') {\n dashes = '-' + dashes\n }\n\n value = 'data' + dashes\n }\n }\n\n Type = DefinedInfo\n }\n\n return new Type(property, value)\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Kebab.\n */\nfunction kebab($0) {\n return '-' + $0.toLowerCase()\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Camel.\n */\nfunction camelcase($0) {\n return $0.charAt(1).toUpperCase()\n}\n","// Note: types exposed from `index.d.ts`.\nimport {merge} from './lib/util/merge.js'\nimport {aria} from './lib/aria.js'\nimport {html as htmlBase} from './lib/html.js'\nimport {svg as svgBase} from './lib/svg.js'\nimport {xlink} from './lib/xlink.js'\nimport {xmlns} from './lib/xmlns.js'\nimport {xml} from './lib/xml.js'\n\nexport {hastToReact} from './lib/hast-to-react.js'\n\nexport const html = merge([aria, htmlBase, xlink, xmlns, xml], 'html')\n\nexport {find} from './lib/find.js'\nexport {normalize} from './lib/normalize.js'\n\nexport const svg = merge([aria, svgBase, xlink, xmlns, xml], 'svg')\n","/**\n * VDOM Property and Attribute Handler\n * Standards-compliant property/attribute handling with caching and special element support\n * Features: Skip logic for preserving user interactions during VDOM reconciliation\n * Exports: updateProps - Main function for DOM element property updates\n * Updated: 2025-01-14 - Added skip logic for focus-sensitive, scroll, and media properties\n */\nimport { find, html, svg } from 'property-information';\nconst ATTR_PROPS = '_props';\nconst propertyInfoCache = new Map();\n// Merge old and new props, handling className -> class conversion and null cleanup\nfunction mergeProps(oldProps, newProps) {\n if (newProps) {\n newProps['class'] = newProps['class'] || newProps['className'];\n delete newProps['className'];\n }\n if (!oldProps || Object.keys(oldProps).length === 0)\n return newProps || {};\n if (!newProps || Object.keys(newProps).length === 0) {\n const props = {};\n Object.keys(oldProps).forEach(p => props[p] = null);\n return props;\n }\n const props = {};\n Object.keys(oldProps).forEach(p => {\n if (!(p in newProps))\n props[p] = null;\n });\n Object.keys(newProps).forEach(p => props[p] = newProps[p]);\n return props;\n}\n// Convert kebab-case to camelCase for dataset keys\nfunction convertKebabToCamelCase(str) {\n if (str.length <= 1)\n return str.toLowerCase();\n return str.split('-').map((word, index) => index === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join('');\n}\n// Cached property information lookup\nfunction getPropertyInfo(name, isSvg) {\n const cacheKey = `${name}:${isSvg}`;\n let info = propertyInfoCache.get(cacheKey);\n if (info === undefined) {\n info = find(isSvg ? svg : html, name) || null;\n propertyInfoCache.set(cacheKey, info);\n }\n return info;\n}\n// Specialized handlers for different attribute types\nfunction setDatasetAttribute(element, attributeName, value) {\n const camelKey = convertKebabToCamelCase(attributeName.slice(5));\n if (value == null) {\n delete element.dataset[camelKey];\n }\n else {\n element.dataset[camelKey] = String(value);\n }\n}\nfunction setEventHandler(element, name, value) {\n if (!name.startsWith('on'))\n return;\n if (!value || typeof value === 'function') {\n element[name] = value;\n }\n else if (typeof value === 'string') {\n if (value)\n element.setAttribute(name, value);\n else\n element.removeAttribute(name);\n }\n}\nfunction setBooleanAttribute(element, attributeName, value) {\n if (shouldSetBooleanAttribute(value)) {\n element.setAttribute(attributeName, attributeName);\n }\n else {\n element.removeAttribute(attributeName);\n }\n}\nfunction setElementProperty(element, propertyName, value) {\n try {\n element[propertyName] = value;\n }\n catch (error) {\n setElementAttribute(element, propertyName, value, false);\n }\n}\nfunction setElementAttribute(element, attributeName, value, isSvg) {\n if (value == null) {\n element.removeAttribute(attributeName);\n return;\n }\n const stringValue = String(value);\n if (isSvg && attributeName.includes(':')) {\n const [prefix] = attributeName.split(':');\n if (prefix === 'xlink') {\n element.setAttributeNS('http://www.w3.org/1999/xlink', attributeName, stringValue);\n }\n else {\n element.setAttribute(attributeName, stringValue);\n }\n }\n else {\n element.setAttribute(attributeName, stringValue);\n }\n}\nfunction shouldSetBooleanAttribute(value) {\n if (value == null || value === false || value === '')\n return false;\n if (value === true)\n return true;\n if (typeof value === 'string') {\n const lowerValue = value.toLowerCase();\n return lowerValue !== 'false' && value !== '0';\n }\n return Boolean(value);\n}\n// Core property/attribute setting function - handles all property types with skip logic\nfunction setAttributeOrProperty(element, name, value, isSvg) {\n // Check if we should skip this property update to preserve user interaction\n if (shouldSkipPatch(element, name)) {\n return;\n }\n // Special cases with dedicated handling\n if (name === 'style') {\n if (element.style.cssText)\n element.style.cssText = '';\n if (typeof value === 'string')\n element.style.cssText = value;\n else if (value && typeof value === 'object') {\n for (const s in value) {\n if (element.style[s] !== value[s])\n element.style[s] = value[s];\n }\n }\n return;\n }\n if (name === 'key') {\n if (value !== undefined && value !== null)\n element.key = value;\n return;\n }\n if (name.startsWith('data-')) {\n setDatasetAttribute(element, name, value);\n return;\n }\n if (name.startsWith('on')) {\n setEventHandler(element, name, value);\n return;\n }\n // Form elements with special property requirements\n if ((element.tagName === 'INPUT' || element.tagName === 'TEXTAREA' || element.tagName === 'SELECT') &&\n (name === 'value' || name === 'selected' || name === 'selectedIndex')) {\n setElementProperty(element, name, value);\n return;\n }\n // Input checked needs both property and attribute\n if (element.tagName === 'INPUT' && name === 'checked') {\n setElementProperty(element, name, value);\n setBooleanAttribute(element, name, value);\n return;\n }\n // Use property information for standard attributes\n const info = getPropertyInfo(name, isSvg);\n if (info) {\n if (info.boolean || info.overloadedBoolean) {\n setBooleanAttribute(element, info.attribute, value);\n }\n else if (info.mustUseProperty && !isSvg) {\n setElementProperty(element, info.property, value);\n }\n else {\n setElementAttribute(element, info.attribute, value, isSvg);\n }\n }\n else {\n // Fallback handling for unknown attributes\n if (name.startsWith('aria-') || name === 'role') {\n setElementAttribute(element, name, value, isSvg);\n }\n else if (name in element || element[name] !== undefined) {\n setElementProperty(element, name, value);\n }\n else {\n setElementAttribute(element, name, value, isSvg);\n }\n }\n}\n// Skip logic for preventing user interaction disruption during VDOM reconciliation\nfunction shouldSkipPatch(dom, prop) {\n if (document.activeElement === dom) {\n return ['value', 'selectionStart', 'selectionEnd', 'selectionDirection']\n .includes(prop);\n }\n if (prop === 'scrollTop' || prop === 'scrollLeft') {\n return true;\n }\n if (dom instanceof HTMLMediaElement &&\n ['currentTime', 'paused', 'playbackRate', 'volume'].includes(prop)) {\n return true;\n }\n return false; // default: allow normal diff logic\n}\nfunction isValidAttributeName(name) {\n return /^[a-zA-Z_:][\\w\\-:.]*$/.test(name) &&\n !name.includes('<') && !name.includes('>') && !name.includes('\"') && !name.includes(\"'\");\n}\n// Main exported function for updating element properties\nexport function updateProps(element, props, isSvg) {\n // console.assert(!!element);\n const cached = element[ATTR_PROPS] || {};\n const merged = mergeProps(cached, props);\n element[ATTR_PROPS] = props || {};\n applyPropertiesToElement(element, merged, props, isSvg);\n}\n// Apply merged properties to element with ref handling\nfunction applyPropertiesToElement(element, mergedProps, originalProps, isSvg) {\n for (const name in mergedProps) {\n if (isValidAttributeName(name)) {\n setAttributeOrProperty(element, name, mergedProps[name], isSvg);\n }\n }\n // Handle ref callback\n if (mergedProps && typeof mergedProps['ref'] === 'function') {\n window.requestAnimationFrame(() => mergedProps['ref'](element));\n }\n}\n//# sourceMappingURL=vdom-my-prop-attr.js.map","/** * VDOM Implementation for AppRun\n *\n * Notes for AppRun’s key prop\n * Use the key prop only if you need to preserve browser-side DOM state (such as cursor\n * position in an <input>, focus, or maintaining state in inline components).\n *\n * For most use cases, especially with stateless or purely data-driven UIs, key is not\n * needed and may decrease performance by forcing DOM moves.\n *\n * AppRun aggressively updates DOM to match your vdom, so DOM node preservation is\n * only valuable when you intentionally depend on browser-managed state.\n *\n * | Use Case | Should I use `key`? | Why |\n * | ----------------------------- | ------------------- | --------------------- |\n * | Preserve input cursor/focus | ✅ Yes | Keeps browser state |\n * | Inline stateful component | ✅ Yes | Preserves component |\n * | Regular data list (stateless) | 🚫 No | Unnecessary DOM moves |\n * | Purely visual updates | 🚫 No | No state to preserve |\n *\n * Features:\n * - Virtual DOM rendering and diffing for efficient DOM updates\n * - JSX Fragment support for both Babel and TypeScript\n * - Element creation with props, children, and event handling\n * - SVG element support with proper namespace handling\n * - Component lifecycle management and caching\n * - Keyed element optimization with automatic cleanup for memory management\n * - Safe HTML insertion and text node creation\n * - Directive processing integration\n *\n * Implementation:\n * - Uses plain JavaScript object for keyCache instead of Map for better performance\n * - Implements automatic cleanup of disconnected elements from keyCache\n * - Supports both string and function-based tags\n * - Handles component mounting and state management\n * - Optimized children updating with minimal DOM operations\n * - Memory-efficient caching with configurable thresholds (500 ops, 1000 max size)\n *\n * Recent Changes:\n * - 2025-07-15: Converted keyCache from Map to plain object ({}) for improved performance\n * - Updated cleanup functions to use object property deletion instead of Map methods\n * - Enhanced memory management with automatic cleanup of disconnected elements\n * - Added comprehensive key prop usage documentation and guidelines\n */\nimport directive from './directive';\nimport { updateProps } from './vdom-my-prop-attr';\nexport function Fragment(props, ...children) {\n return collect(children);\n}\nfunction collect(children) {\n const ch = [];\n const push = (c) => {\n if (c !== null && c !== undefined && c !== '' && c !== false) {\n ch.push((typeof c === 'function' || typeof c === 'object') ? c : `${c}`);\n }\n };\n children && children.forEach(c => {\n if (Array.isArray(c)) {\n c.forEach(i => push(i));\n }\n else {\n push(c);\n }\n });\n return ch;\n}\nconst keyCache = {};\nlet cleanupCounter = 0;\nconst CLEANUP_THRESHOLD = 500; // Cleanup every 500 operations\nconst MAX_CACHE_SIZE = 1000;\n// Lightweight cleanup function - only runs when needed\nfunction cleanupKeyCache() {\n if (Object.keys(keyCache).length <= MAX_CACHE_SIZE)\n return; // Skip if under limit\n for (const [key, element] of Object.entries(keyCache)) {\n if (!element.isConnected) {\n delete keyCache[key];\n }\n }\n}\n// Export cleanup function for manual cleanup if needed\nexport function clearKeyCache() {\n for (const key in keyCache) {\n delete keyCache[key];\n }\n cleanupCounter = 0;\n}\nexport function createElement(tag, props, ...children) {\n const ch = collect(children);\n if (typeof tag === 'string')\n return { tag, props, children: ch };\n else if (Array.isArray(tag))\n return tag; // JSX fragments - babel\n else if (tag === undefined && children)\n return ch; // JSX fragments - typescript\n else if (Object.getPrototypeOf(tag).__isAppRunComponent)\n return { tag, props, children: ch }; // createComponent(tag, { ...props, children });\n else if (typeof tag === 'function')\n return tag(props, ch);\n else\n throw new Error(`Unknown tag in vdom ${tag}`);\n}\n;\nexport const updateElement = (element, nodes, component = {}) => {\n // tslint:disable-next-line\n if (nodes == null || nodes === false)\n return;\n const el = (typeof element === 'string' && element) ?\n document.getElementById(element) || document.querySelector(element) : element;\n nodes = directive(nodes, component);\n render(el, nodes, component);\n};\nfunction render(element, nodes, parent = {}) {\n // tslint:disable-next-line\n if (nodes == null || nodes === false)\n return;\n nodes = createComponent(nodes, parent);\n if (!element)\n return;\n const isSvg = element.nodeName === \"SVG\";\n if (Array.isArray(nodes)) {\n updateChildren(element, nodes, isSvg);\n }\n else {\n updateChildren(element, [nodes], isSvg);\n }\n}\nfunction same(el, node) {\n // if (!el || !node) return false;\n const key1 = el.nodeName;\n const key2 = `${node.tag || ''}`;\n return key1.toUpperCase() === key2.toUpperCase();\n}\nfunction update(element, node, isSvg) {\n // console.assert(!!element);\n isSvg = isSvg || node.tag === \"svg\";\n if (!same(element, node)) {\n element.parentNode.replaceChild(create(node, isSvg), element);\n return;\n }\n updateChildren(element, node.children, isSvg);\n updateProps(element, node.props, isSvg);\n}\nfunction updateChildren(element, children, isSvg) {\n const old_len = element.childNodes?.length || 0;\n const new_len = children?.length || 0;\n const len = Math.min(old_len, new_len);\n for (let i = 0; i < len; i++) {\n const child = children[i];\n const el = element.childNodes[i];\n if (typeof child === 'string') {\n if (el.textContent !== child) {\n if (el.nodeType === 3) {\n el.nodeValue = child;\n }\n else {\n element.replaceChild(createText(child), el);\n }\n }\n }\n else if (child instanceof HTMLElement || child instanceof SVGElement) {\n element.insertBefore(child, el);\n }\n else {\n const key = child.props && child.props['key'];\n if (key) {\n if (el.key === key) {\n update(element.childNodes[i], child, isSvg);\n }\n else {\n // console.log(el.key, key);\n const old = keyCache[key];\n if (old) {\n // const temp = old.nextSibling;\n element.insertBefore(old, el);\n // temp ? element.insertBefore(el, temp) : element.appendChild(el);\n update(element.childNodes[i], child, isSvg);\n }\n else {\n element.replaceChild(create(child, isSvg), el);\n }\n }\n }\n else {\n update(element.childNodes[i], child, isSvg);\n }\n }\n }\n let n = element.childNodes?.length || 0;\n while (n > len) {\n element.removeChild(element.lastChild);\n n--;\n }\n if (new_len > len) {\n const d = document.createDocumentFragment();\n for (let i = len; i < children.length; i++) {\n d.appendChild(create(children[i], isSvg));\n }\n element.appendChild(d);\n }\n}\nexport const safeHTML = (html) => {\n const div = document.createElement('section');\n div.insertAdjacentHTML('afterbegin', html);\n return Array.from(div.children);\n};\nfunction createText(node) {\n if (node?.indexOf('_html:') === 0) { // ?\n const div = document.createElement('div');\n div.insertAdjacentHTML('afterbegin', node.substring(6));\n return div;\n }\n else {\n return document.createTextNode(node ?? '');\n }\n}\nfunction create(node, isSvg) {\n // console.assert(node !== null && node !== undefined);\n if ((node instanceof HTMLElement) || (node instanceof SVGElement))\n return node;\n if (typeof node === \"string\")\n return createText(node);\n if (!node.tag || (typeof node.tag === 'function'))\n return createText(JSON.stringify(node));\n isSvg = isSvg || node.tag === \"svg\";\n const element = isSvg\n ? document.createElementNS(\"http://www.w3.org/2000/svg\", node.tag)\n : document.createElement(node.tag);\n updateProps(element, node.props, isSvg);\n if (node.children)\n node.children.forEach(child => element.appendChild(create(child, isSvg)));\n if (node.props && node.props.key !== undefined) {\n element.key = node.props.key;\n keyCache[node.props.key] = element;\n // Lightweight cleanup - only when counter reaches threshold\n if (++cleanupCounter >= CLEANUP_THRESHOLD) {\n cleanupKeyCache();\n cleanupCounter = 0;\n }\n }\n return element;\n}\nfunction render_component(node, parent, idx) {\n const { tag, props, children } = node;\n let key = `_${idx}`;\n let id = props && props['id'];\n if (!id)\n id = `_${idx}${Date.now()}`;\n else\n key = id;\n let asTag = 'section';\n if (props && props['as']) {\n asTag = props['as'];\n delete props['as'];\n }\n if (!parent.__componentCache)\n parent.__componentCache = {};\n let component = parent.__componentCache[key];\n if (!component || !(component instanceof tag) || !component.element) {\n const element = document.createElement(asTag);\n component = parent.__componentCache[key] = new tag({ ...props, children }).mount(element, { render: true });\n }\n else {\n component.renderState(component.state);\n }\n if (component.mounted) {\n const new_state = component.mounted(props, children, component.state);\n (typeof new_state !== 'undefined') && component.setState(new_state);\n }\n updateProps(component.element, props, false);\n return component.element;\n}\nfunction createComponent(node, parent, idx = 0) {\n if (typeof node === 'string')\n return node;\n if (Array.isArray(node))\n return node.map(child => createComponent(child, parent, idx++));\n let vdom = node;\n if (node && typeof node.tag === 'function' && Object.getPrototypeOf(node.tag).__isAppRunComponent) {\n vdom = render_component(node, parent, idx);\n }\n if (vdom && Array.isArray(vdom.children)) {\n const new_parent = vdom.props?._component;\n if (new_parent) {\n let i = 0;\n vdom.children = vdom.children.map(child => createComponent(child, new_parent, i++));\n }\n else {\n vdom.children = vdom.children.map(child => createComponent(child, parent, idx++));\n }\n }\n return vdom;\n}\n//# sourceMappingURL=vdom-my.js.map","/**\n * Web Components Integration\n *\n * This file enables using AppRun components as Web Components:\n * 1. Custom Element Creation\n * - Converts AppRun components to custom elements\n * - Handles lifecycle (connected, disconnected, attributeChanged)\n * - Manages shadow DOM and light DOM rendering options\n * - Automatic element registration with customElements.define()\n *\n * 2. Property/Attribute Sync\n * - Observes attribute changes with attributeChangedCallback\n * - Updates component state automatically on changes\n * - Handles camelCase/kebab-case conversion automatically\n * - Supports complex property types and JSON parsing\n * - Two-way data binding between attributes and state\n *\n * 3. Event Handling\n * - Proxies events between component and element\n * - Supports both global and local event systems\n * - Maintains proper event bubbling and capturing\n * - Custom event dispatching for component communication\n *\n * Features:\n * - Shadow DOM encapsulation support\n * - Attribute observation and change detection\n * - Lifecycle management and cleanup\n * - Property reflection to attributes\n * - Event proxy system\n * - Flexible rendering options\n *\n * Type Safety Improvements (v3.35.1):\n * - Enhanced custom element options typing\n * - Better lifecycle method signatures\n * - Improved attribute/property type safety\n * - Safer DOM manipulation with null checks\n *\n * Usage:\n * ```ts\n * // Register web component\n * @customElement('my-element', {\n * shadow: true,\n * observedAttributes: ['name', 'value']\n * })\n * class MyComponent extends Component {\n * // Regular AppRun component code\n * }\n *\n * // Use in HTML\n * <my-element name=\"value\" data-prop=\"complex\"></my-element>\n * ```\n */\nexport const customElement = (componentClass, options = {}) => class CustomElement extends HTMLElement {\n constructor() {\n super();\n }\n get component() { return this._component; }\n get state() { return this._component.state; }\n static get observedAttributes() {\n // attributes need to be set to lowercase in order to get observed\n return (options.observedAttributes || []).map(attr => attr.toLowerCase());\n }\n connectedCallback() {\n if (this.isConnected && !this._component) {\n const opts = options || {};\n this._shadowRoot = opts.shadow ? this.attachShadow({ mode: 'open' }) : this;\n const observedAttributes = (opts.observedAttributes || []);\n const attrMap = observedAttributes.reduce((map, name) => {\n const lc = name.toLowerCase();\n if (lc !== name) {\n map[lc] = name;\n }\n return map;\n }, {});\n this._attrMap = (name) => attrMap[name] || name;\n const props = {};\n Array.from(this.attributes).forEach(item => props[this._attrMap(item.name)] = item.value);\n // add getters/ setters to allow observation on observedAttributes\n observedAttributes.forEach(name => {\n if (this[name] !== undefined)\n props[name] = this[name];\n Object.defineProperty(this, name, {\n get() {\n return props[name];\n },\n set(value) {\n // trigger change event\n this.attributeChangedCallback(name, props[name], value);\n },\n configurable: true,\n enumerable: true\n });\n });\n requestAnimationFrame(() => {\n const children = this.children ? Array.from(this.children) : [];\n // children.forEach(el => el.parentElement.removeChild(el));\n this._component = new componentClass({ ...props, children }).mount(this._shadowRoot, opts);\n // attach props to component\n this._component._props = props;\n // expose dispatchEvent\n this._component.dispatchEvent = this.dispatchEvent.bind(this);\n if (this._component.mounted) {\n const new_state = this._component.mounted(props, children, this._component.state);\n if (typeof new_state !== 'undefined')\n this._component.state = new_state;\n }\n this.on = this._component.on.bind(this._component);\n this.run = this._component.run.bind(this._component);\n if (!(opts.render === false))\n this._component.run('.');\n });\n }\n }\n disconnectedCallback() {\n this._component?.unload?.();\n this._component?.unmount?.();\n this._component = null;\n }\n attributeChangedCallback(name, oldValue, value) {\n if (this._component) {\n // camelCase attributes arrive only in lowercase\n const mappedName = this._attrMap(name);\n // store the new property/ attribute\n this._component._props[mappedName] = value;\n this._component.run('attributeChanged', mappedName, oldValue, value);\n if (value !== oldValue && !(options.render === false)) {\n window.requestAnimationFrame(() => {\n // re-render state with new combined props on next animation frame\n this._component.run('.');\n });\n }\n }\n }\n};\nexport default (name, componentClass, options) => {\n (typeof customElements !== 'undefined') && customElements.define(name, customElement(componentClass, options));\n};\n//# sourceMappingURL=web-component.js.map","import webComponent from './web-component';\n/**\n * TypeScript Decorators for AppRun Components\n *\n * This file provides decorators that enable:\n * 1. Event Handler Registration\n * - @on(): Subscribe to events with options (global, once, delay)\n * - @update(): Define state updates with metadata and options\n * - Supports method and class decoration patterns\n *\n * 2. Web Component Integration\n * - @customElement(): Register as custom element with options\n * - Handles shadow DOM and attribute observation\n * - Automatic lifecycle management for web components\n *\n * 3. Metadata Management\n * - Custom Reflect implementation for decorator metadata\n * - Stores event handler and update metadata for runtime use\n * - Supports runtime reflection for dynamic behavior\n * - Metadata keys for event bindings and updates\n *\n * Features:\n * - Event handler decoration with options\n * - State update method decoration\n * - Web component registration\n * - Metadata-driven event binding\n * - Flexible decorator patterns\n * - Runtime metadata access\n *\n * Type Safety Improvements (v3.35.1):\n * - Enhanced decorator typing for better IDE support\n * - Improved metadata key management\n * - Better type inference for decorated methods\n *\n * Usage:\n * ```ts\n * @customElement('my-element')\n * class MyComponent extends Component {\n * @on('event', { global: true })\n * handler(state, ...args) {\n * // Handle event\n * }\n *\n * @update('event', { render: true })\n * updater(state, ...args) {\n * // Update state\n * return newState;\n * }\n * }\n * ```\n */\n// tslint:disable:no-invalid-this\nexport const Reflect = {\n meta: new WeakMap(),\n defineMetadata(metadataKey, metadataValue, target) {\n if (!this.meta.has(target))\n this.meta.set(target, {});\n this.meta.get(target)[metadataKey] = metadataValue;\n },\n getMetadataKeys(target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? Object.keys(this.meta.get(target)) : [];\n },\n getMetadata(metadataKey, target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? this.meta.get(target)[metadataKey] : null;\n }\n};\nexport function update(events, options = {}) {\n return (target, key, descriptor) => {\n const name = events ? events.toString() : key;\n Reflect.defineMetadata(`apprun-update:${name}`, { name, key, options }, target);\n return descriptor;\n };\n}\nexport function on(events, options = {}) {\n return function (target, key) {\n const name = events ? events.toString() : key;\n Reflect.defineMetadata(`apprun-update:${name}`, { name, key, options }, target);\n };\n}\nexport function customElement(name, options) {\n return function _customElement(constructor) {\n webComponent(name, constructor, options);\n return constructor;\n };\n}\n//# sourceMappingURL=decorator.js.map","/**\n * AppRun Component System Implementation\n *\n * This file provides the Component class which is the foundation for:\n * 1. State Management\n * - Maintains component state with history support\n * - Handles state updates with async/iterator support\n * - Supports state history navigation (prev/next)\n * - Promise and async iterator state handling\n *\n * 2. View Rendering\n * - Renders virtual DOM to real DOM with directives\n * - Handles component lifecycle (mounted, rendered, unload)\n * - Supports shadow DOM and web components\n * - DOM change tracking with MutationObserver\n * - View transition API support\n *\n * 3. Event Handling\n * - Local and global event subscription management\n * - Event handler registration via decorators\n * - Action to state updates with error handling\n * - Support for event options (delay, once, global)\n *\n * Features:\n * - Component caching for debugging\n * - Element tracking for cleanup\n * - History navigation support\n * - Global vs local event routing\n * - Async state handling\n * - Memory leak prevention\n * - Component unmounting with cleanup\n *\n * Type Safety Improvements (v3.35.1):\n * - Enhanced element access with null checks and warnings\n * - Improved action validation and error handling\n * - Better error reporting in component actions\n * - Safer DOM element queries with fallback warnings\n *\n * Usage:\n * ```ts\n * class MyComponent extends Component {\n * state = // Initial state\n * view = state => // Return virtual DOM\n * update = {\n * 'event': (state, ...args) => // Return new state\n * }\n * }\n *\n * // Mount component\n * new MyComponent().mount('element-id');\n * ```\n */\nimport _app, { App } from './app';\nimport { Reflect } from './decorator';\nimport directive from './directive';\nimport { safeQuerySelector, safeGetElementById } from './type-utils';\n// const componentCache = new Map();\n// if (!app.find('get-components')) app.on('get-components', o => o.components = componentCache);\nexport const REFRESH = state => state;\nconst app = _app;\nexport class Component {\n renderState(state, vdom = null) {\n if (!this.view)\n return;\n let html = vdom || this.view(state);\n app['debug'] && app.run('debug', {\n component: this,\n _: html ? '.' : '-',\n state,\n vdom: html,\n el: this.element\n });\n if (typeof document !== 'object')\n return;\n const el = (typeof this.element === 'string' && this.element) ?\n safeGetElementById(this.element) || safeQuerySelector(this.element) : this.element;\n if (!el) {\n console.warn(`Component element not found: ${this.element}`);\n return;\n }\n const tracking_attr = '_c';\n if (!this.unload) {\n el.removeAttribute && el.removeAttribute(tracking_attr);\n }\n else if (el['_component'] !== this || el.getAttribute(tracking_attr) !== this.tracking_id) {\n this.tracking_id = new Date().valueOf().toString();\n el.setAttribute(tracking_attr, this.tracking_id);\n if (typeof MutationObserver !== 'undefined') {\n if (!this.observer)\n this.observer = new MutationObserver(changes => {\n if (changes[0].oldValue === this.tracking_id || !document.body.contains(el)) {\n this.unload(this.state);\n this.observer.disconnect();\n this.observer = null;\n }\n });\n this.observer.observe(document.body, {\n childList: true, subtree: true,\n attributes: true, attributeOldValue: true, attributeFilter: [tracking_attr]\n });\n }\n }\n el['_component'] = this;\n if (!vdom && html) {\n html = directive(html, this);\n if (this.options.transition && document && document['startViewTransition']) {\n document['startViewTransition'](() => app.render(el, html, this));\n }\n else {\n app.render(el, html, this);\n }\n }\n this.rendered && this.rendered(this.state);\n }\n setState(state, options = { render: true, history: false }) {\n const handleAsyncIterator = async (iterator) => {\n try {\n while (true) {\n const { value, done } = await iterator.next();\n if (done)\n break;\n this.setState(value, options);\n }\n }\n catch (e) {\n console.error('Error in async iterator:', e);\n }\n };\n const result = state;\n if (result?.[Symbol.asyncIterator]) {\n // handleAsyncIterator(result[Symbol.asyncIterator]());\n this.setState(handleAsyncIterator(result[Symbol.asyncIterator]()), options);\n return;\n }\n else if (result?.[Symbol.iterator] && typeof result.next === \"function\") {\n for (const value of result) {\n this.setState(value, options);\n }\n return;\n }\n else if (state && state instanceof Promise) {\n // Promise will not be saved or rendered\n // state will be saved and rendered when promise is resolved\n Promise.resolve(state).then(v => {\n this.setState(v, options);\n this._state = state;\n });\n }\n else {\n this._state = state;\n if (state == null)\n return;\n this.state = state;\n if (options.render !== false) {\n // before render state\n if (options.transition && document && document['startViewTransition']) {\n document['startViewTransition'](() => this.renderState(state));\n }\n else {\n this.renderState(state);\n }\n }\n if (options.history !== false && this.enable_history) {\n this._history = [...this._history, state];\n this._history_idx = this._history.length - 1;\n }\n if (typeof options.callback === 'function')\n options.callback(this.state);\n }\n }\n constructor(state, view, update, options) {\n this.state = state;\n this.view = view;\n this.update = update;\n this.options = options;\n this._app = new App();\n this._actions = [];\n this._global_events = [];\n this._history = [];\n this._history_idx = -1;\n this._history_prev = () => {\n this._history_idx--;\n if (this._history_idx >= 0) {\n this.setState(this._history[this._history_idx], { render: true, history: false });\n }\n else {\n this._history_idx = 0;\n }\n };\n this._history_next = () => {\n this._history_idx++;\n if (this._history_idx < this._history.length) {\n this.setState(this._history[this._history_idx], { render: true, history: false });\n }\n else {\n this._history_idx = this._history.length - 1;\n }\n };\n this.start = (element = null, options) => {\n this.mount(element, { render: true, ...options });\n if (this.mounted && typeof this.mounted === 'function') {\n const new_state = this.mounted({}, [], this.state);\n (typeof new_state !== 'undefined') && this.setState(new_state);\n }\n return this;\n };\n }\n mount(element = null, options) {\n console.assert(!this.element, 'Component already mounted.');\n this.options = options = { ...this.options, ...options };\n this.element = element;\n this.global_event = options.global_event;\n this.enable_history = !!options.history;\n if (this.enable_history) {\n this.on(options.history.prev || 'history-prev', this._history_prev);\n this.on(options.history.next || 'history-next', this._history_next);\n }\n if (options.route) {\n this.update = this.update || {};\n if (!this.update[options.route])\n this.update[options.route] = REFRESH;\n }\n this.add_actions();\n this.state = this.state ?? this['model'] ?? {};\n if (typeof this.state === 'function')\n this.state = this.state();\n this.setState(this.state, { render: !!options.render, history: true });\n if (app['debug'] && app.find('debug-create-component')?.length) {\n app.run('debug-create-component', this);\n }\n return this;\n }\n is_global_event(name) {\n return name && (this.global_event ||\n this._global_events.indexOf(name) >= 0 ||\n name.startsWith('#') || name.startsWith('/') || name.startsWith('@'));\n }\n add_action(name, action, options = {}) {\n if (!action || typeof action !== 'function') {\n console.warn(`Component action for '${name}' is not a valid function:`, action);\n return;\n }\n if (options.global)\n this._global_events.push(name);\n this.on(name, (...p) => {\n app['debug'] && app.run('debug', {\n component: this,\n _: '>',\n event: name, p,\n current_state: this.state,\n options\n });\n try {\n const newState = action(this.state, ...p);\n app['debug'] && app.run('debug', {\n component: this,\n _: '<',\n event: name, p,\n newState,\n state: this.state,\n options\n });\n this.setState(newState, options);\n }\n catch (error) {\n console.error(`Error in component action '${name}':`, error);\n app['debug'] && app.run('debug', {\n component: this,\n _: '!',\n event: name, p,\n error,\n state: this.state,\n options\n });\n }\n }, options);\n }\n add_actions() {\n const actions = this.update || {};\n Reflect.getMetadataKeys(this).forEach(key => {\n if (key.startsWith('apprun-update:')) {\n const meta = Reflect.getMetadata(key, this);\n actions[meta.name] = [this[meta.key].bind(this), meta.options];\n }\n });\n const all = {};\n if (Array.isArray(actions)) {\n actions.forEach(act => {\n const [name, action, opts] = act;\n const names = name.toString();\n names.split(',').forEach(n => all[n.trim()] = [action, opts]);\n });\n }\n else {\n Object.keys(actions).forEach(name => {\n const action = actions[name];\n if (typeof action === 'function' || Array.isArray(action)) {\n name.split(',').forEach(n => all[n.trim()] = action);\n }\n });\n }\n if (!all['.'])\n all['.'] = REFRESH;\n Object.keys(all).forEach(name => {\n const action = all[name];\n if (typeof action === 'function') {\n this.add_action(name, action);\n }\n else if (Array.isArray(action)) {\n this.add_action(name, action[0], action[1]);\n }\n });\n }\n run(event, ...args) {\n if (this.state instanceof Promise) {\n return Promise.resolve(this.state).then(state => {\n this.state = state;\n this.run(event, ...args);\n });\n }\n else {\n const name = event.toString();\n return this.is_global_event(name) ?\n app.run(name, ...args) :\n this._app.run(name, ...args);\n }\n }\n on(event, fn, options) {\n const name = event.toString();\n this._actions.push({ name, fn });\n return this.is_global_event(name) ?\n app.on(name, fn, options) :\n this._app.on(name, fn, options);\n }\n runAsync(event, ...args) {\n const name = event.toString();\n return this.is_global_event(name) ?\n app.runAsync(name, ...args) :\n this._app.runAsync(name, ...args);\n }\n // obsolete\n /**\n * @deprecated Use runAsync() instead. query() will be removed in a future version.\n */\n query(event, ...args) {\n console.warn('component.query() is deprecated. Use component.runAsync() instead.');\n return this.runAsync(event, ...args);\n }\n unmount() {\n this.observer?.disconnect();\n this._actions.forEach(action => {\n const { name, fn } = action;\n this.is_global_event(name) ?\n app.off(name, fn) :\n this._app.off(name, fn);\n });\n }\n}\nComponent.__isAppRunComponent = true;\n//# sourceMappingURL=component.js.map","/**\n * AppRun Router Implementation with Hierarchical Matching\n *\n * This file provides URL routing capabilities:\n * 1. Hash-based routing (#/path)\n * - Works with SPA mode using hash fragments\n * - Handles hashchange events automatically\n * - No server configuration required\n * 2. Path-based routing (/path)\n * - Works with browser history API\n * - Requires server configuration for SPA routing\n * - Handles popstate events automatically\n * 3. Event-based navigation\n * - Routes trigger corresponding component events\n * - Automatic route parameter extraction\n * - Fallback to 404 handling for unknown routes\n *\n * Features:\n * - Automatic route event firing with ROUTER_EVENT\n * - 404 handling via ROUTER_404_EVENT for unmatched routes\n * - History API integration for seamless navigation\n * - Route parameter parsing and injection into events\n * - URL pattern matching with parameter support\n * - Global and component-level route handling\n * - **NEW: Hierarchical route matching** - progressively tries parent routes\n *\n * Type Safety Improvements (v3.35.1):\n * - Enhanced route type definitions\n * - Better parameter type inference\n * - Improved URL validation and error handling\n *\n * Usage:\n * ```ts\n * // Basic routing\n * app.on('#/home', () => // Show home page);\n * app.on('#/users/:id', (id) => // Show user profile);\n * app.on('/api/*', (path) => // Handle API routes);\n *\n * // Navigate programmatically\n * app.run('route', '#/home');\n * route('/users/123'); // Direct routing\n *\n * // Hierarchical matching examples\n * app.on('/api', (operation, id) => // Handle /api/users/123);\n * app.on('#users', (id, action) => // Handle #users/123/edit);\n *\n * // Hierarchical Route Matching (NEW):\n * // For URL: /api/v1/users/123\n * // Router tries: /api/v1/users/123 → /api/v1/users → /api/v1 → /api → 404\n * // If handler found at /api, it receives: ('v1', 'users', '123')\n *\n * // Base Path Support (NEW):\n * app.basePath = '/myapp'; // For sub-directory deployments\n * // Links: <a href=\"/users/123\"> (relative paths)\n * // Navigation: /myapp/users/123 (full path)\n * // Routing: /users/123 (base path stripped)\n *\n * // Empty Path Handling (NEW):\n * // For URL: \"\" (empty)\n * // Router tries: # → / → #/ → 404 (in priority order)\n *\n * // 404 Behavior (ENHANCED):\n * // Fires only at minimal levels: /a, #a, #/a, a\n * // Never tries root handlers: /, #, #/\n * ```\n */\nimport app from './app';\n// Helper functions for hierarchical routing\n/**\n * Extract clean path segments from URL\n * @param url - The URL to parse\n * @returns Array of path segments\n */\nfunction parsePathSegments(url) {\n if (!url)\n return [];\n // Handle different URL types\n if (url.startsWith('#/')) {\n return url.substring(2).split('/');\n }\n else if (url.startsWith('#')) {\n return url.substring(1).split('/');\n }\n else if (url.startsWith('/')) {\n return url.substring(1).split('/');\n }\n else {\n return url.split('/');\n }\n}\n/**\n * Normalize trailing slash - convert /a/ to /a\n * @param url - The URL to normalize\n * @returns Normalized URL\n */\nfunction normalizeTrailingSlash(url) {\n if (!url || url === '/' || url === '#' || url === '#/')\n return url;\n if (url.endsWith('/'))\n return url.slice(0, -1);\n return url;\n}\n/**\n * Validate hierarchy depth and warn if too deep\n * @param segments - Path segments to validate\n */\nfunction validateHierarchyDepth(segments) {\n // Count non-empty segments for depth validation\n const nonEmptySegments = segments.filter(Boolean);\n if (nonEmptySegments.length > 11) {\n console.warn(`Deep route hierarchy detected: ${nonEmptySegments.join('/')} (${nonEmptySegments.length} levels)`);\n }\n}\n/**\n * Strip base path from URL\n * @param url - The URL to process\n * @param basePath - The base path to remove\n * @returns URL with base path removed\n */\nfunction stripBasePath(url, basePath) {\n if (!basePath || basePath === '/' || basePath === '')\n return url;\n // Normalize base path\n const normalizedBasePath = basePath.startsWith('/') ? basePath : '/' + basePath;\n if (url.startsWith(normalizedBasePath)) {\n const stripped = url.substring(normalizedBasePath.length);\n return stripped.startsWith('/') ? stripped : '/' + stripped;\n }\n return url;\n}\n/**\n * Generate hierarchy of routes to try (stops at minimal level)\n * @param segments - Array of path segments\n * @param routeType - Type of route (path, hash, hash-slash, non-prefixed)\n * @returns Array of route names to try in order\n */\nfunction generateRouteHierarchy(segments, routeType) {\n const hierarchy = [];\n // Build hierarchy from most specific to least specific\n for (let i = segments.length; i > 0; i--) {\n const currentSegments = segments.slice(0, i);\n let routeName = '';\n switch (routeType) {\n case 'path':\n routeName = '/' + currentSegments.join('/');\n break;\n case 'hash':\n routeName = '#' + currentSegments.join('/');\n break;\n case 'hash-slash':\n routeName = '#/' + currentSegments.join('/');\n break;\n case 'non-prefixed':\n routeName = currentSegments.join('/');\n break;\n }\n hierarchy.push(routeName);\n }\n return hierarchy;\n}\n/**\n * Find handler in hierarchy and return handler info\n * @param hierarchy - Array of route names to try\n * @param originalSegments - Original path segments\n * @returns Handler info if found, null otherwise\n */\nfunction findHandlerInHierarchy(hierarchy, originalSegments) {\n for (let i = 0; i < hierarchy.length; i++) {\n const routeName = hierarchy[i];\n const subscribers = app.find(routeName);\n if (subscribers && subscribers.length > 0) {\n // Found handler - calculate remaining parameters\n const handlerDepth = hierarchy.length - i;\n const parameters = originalSegments.slice(handlerDepth);\n return {\n eventName: routeName,\n parameters: parameters\n };\n }\n }\n return null;\n}\n/**\n * Handle empty path with priority order: # → / → #/ → 404\n */\nfunction handleEmptyPath() {\n // Try # first\n const hashSubscribers = app.find('#');\n if (hashSubscribers && hashSubscribers.length > 0) {\n app.run('#');\n app.run(ROUTER_EVENT, '#');\n return;\n }\n // Try / second\n const pathSubscribers = app.find('/');\n if (pathSubscribers && pathSubscribers.length > 0) {\n app.run('/');\n app.run(ROUTER_EVENT, '/');\n return;\n }\n // Try #/ third\n const hashSlashSubscribers = app.find('#/');\n if (hashSlashSubscribers && hashSlashSubscribers.length > 0) {\n app.run('#/');\n app.run(ROUTER_EVENT, '#/');\n return;\n }\n // Fire 404 if no handlers found\n console.warn('No subscribers for event: ');\n app.run(ROUTER_404_EVENT, '');\n app.run(ROUTER_EVENT, '');\n}\n/**\n * Main hierarchical routing logic\n * @param url - The URL to route\n */\nfunction routeWithHierarchy(url) {\n // Handle empty path\n if (!url) {\n handleEmptyPath();\n return;\n }\n // Normalize trailing slash\n url = normalizeTrailingSlash(url);\n // Strip base path if configured\n const basePath = app['basePath'];\n if (basePath) {\n url = stripBasePath(url, basePath);\n }\n // Parse segments and validate depth\n const segments = parsePathSegments(url);\n validateHierarchyDepth(segments);\n // Determine route type\n let routeType;\n if (url.startsWith('#/')) {\n routeType = 'hash-slash';\n }\n else if (url.startsWith('#')) {\n routeType = 'hash';\n }\n else if (url.startsWith('/')) {\n routeType = 'path';\n }\n else {\n routeType = 'non-prefixed';\n }\n // Generate hierarchy\n const hierarchy = generateRouteHierarchy(segments, routeType);\n // Find handler in hierarchy\n const handlerInfo = findHandlerInHierarchy(hierarchy, segments);\n if (handlerInfo) {\n // Found handler - publish route with parameters\n publishRoute(handlerInfo.eventName, ...handlerInfo.parameters);\n }\n else {\n // No handler found - fire 404 with original URL\n if (hierarchy.length > 0) {\n const minimalRoute = hierarchy[hierarchy.length - 1];\n console.warn(`No subscribers for event: ${minimalRoute}`);\n app.run(ROUTER_404_EVENT, url);\n app.run(ROUTER_EVENT, url);\n }\n else {\n handleEmptyPath();\n }\n }\n}\nconst publishRoute = (name, ...args) => {\n if (!name || name === ROUTER_EVENT || name === ROUTER_404_EVENT)\n return;\n const subscribers = app.find(name);\n if (!subscribers || subscribers.length === 0) {\n console.warn(`No subscribers for event: ${name}`);\n app.run(ROUTER_404_EVENT, name, ...args);\n }\n else {\n app.run(name, ...args);\n }\n app.run(ROUTER_EVENT, name, ...args);\n};\nexport const ROUTER_EVENT = '//';\nexport const ROUTER_404_EVENT = '///';\nexport const route = (url) => {\n if (app['lastUrl'] === url)\n return; // Prevent duplicate routing\n app['lastUrl'] = url;\n // Use hierarchical routing logic\n routeWithHierarchy(url);\n};\nexport default route;\n//# sourceMappingURL=router.js.map","import app from './app'; // ADD: Global app instance access\n// Type guard functions using the enhanced type system\nfunction isComponentInstance(obj) {\n return obj && typeof obj === 'object' && typeof obj.mount === 'function';\n}\nfunction isComponentConstructor(fn) {\n return typeof fn === 'function' &&\n fn.prototype &&\n fn.prototype.constructor === fn &&\n (fn.prototype.mount !== undefined ||\n fn.prototype.state !== undefined ||\n fn.prototype.view !== undefined);\n}\nfunction isFactoryFunction(fn) {\n return typeof fn === 'function' && !isComponentConstructor(fn);\n}\n// Recursive function resolution with enhanced type checking\nasync function resolveComponent(component, maxDepth = 3) {\n let resolved = component;\n let depth = 0;\n while (isFactoryFunction(resolved) && depth < maxDepth) {\n try {\n const result = await resolved();\n if (result === resolved)\n break; // Prevent infinite loops\n resolved = result;\n depth++;\n }\n catch (error) {\n console.error(`Error executing component function: ${error}`);\n break;\n }\n }\n return resolved;\n}\nexport default async (element, components) => {\n for (const [route, component] of Object.entries(components)) {\n if (!component || !route) {\n console.error(`Invalid component configuration: component=${component}, route=${route}`);\n continue;\n }\n // Check if it's a direct component instance\n if (isComponentInstance(component)) {\n const options = { route };\n component.mount(element, options);\n continue;\n }\n // Check if it's a component class constructor\n if (isComponentConstructor(component)) {\n const instance = new component();\n const options = { route };\n instance.mount(element, options);\n continue;\n }\n // At this point it must be a function - resolve it\n if (isFactoryFunction(component)) {\n // Resolve the function to see what it returns\n let resolved = await resolveComponent(component);\n // Check if resolved result is a component instance\n if (isComponentInstance(resolved)) {\n const options = { route };\n resolved.mount(element, options);\n continue;\n }\n // Check if resolved result is a component constructor\n if (isComponentConstructor(resolved)) {\n const instance = new resolved();\n const options = { route };\n instance.mount(element, options);\n continue;\n }\n // If resolved result is still a function or anything else, treat original as event handler with render wrapper\n app.on(route, (...args) => {\n const result = component(...args);\n if (typeof element === 'string') {\n element = document.querySelector(element);\n if (!element) {\n console.error(`Element not found: ${element}`);\n return;\n }\n }\n return app.render(element, result);\n });\n continue;\n }\n // If we get here, it's an invalid component type\n console.error(`Invalid component: component must be a class, instance, or function that returns a class/instance`);\n }\n};\n//# sourceMappingURL=add-components.js.map","/**\n * Main AppRun framework entry point\n *\n * This file:\n * 1. Assembles core AppRun modules into a complete framework\n * 2. Exports public API and types\n * 3. Initializes global app instance with:\n * - Virtual DOM rendering\n * - Component system\n * - Router with improved null safety\n * - Web component support\n * - Type-safe React integration\n * - Component batch mounting system\n *\n * Key exports:\n * - app: Global event system instance\n * - Component: Base component class\n * - Decorators: @on, @update, @customElement\n * - Router events and configuration\n * - Web component registration\n *\n * Features:\n * - Event-driven architecture with pub/sub pattern\n * - Virtual DOM rendering with multiple renderer support\n * - Component lifecycle management\n * - Client-side routing with hash/path support\n * - Web Components integration\n * - React compatibility layer\n * - TypeScript support with strong typing\n * - Batch component mounting with addComponents(element, components)\n *\n * Type Safety Improvements (v3.35.1):\n * - Added null checks for DOM event targets\n * - Improved global window object assignments with proper typing\n * - Enhanced React integration parameter validation\n * - Better error handling for invalid event handlers\n * - Safer element access with proper type assertions\n *\n * Recent Changes:\n * - Modified addComponents to accept (element, components) where components is a key-value object with routes as keys and components as values\n * - Simplified component mounting API for better usability\n *\n * Usage:\n * ```ts\n * import { app, Component } from 'apprun';\n *\n * // Create components\n * class MyComponent extends Component {\n * state = // Initial state\n * view = state => // Render view\n * update = {\n * 'event': (state, ...args) => // Handle events\n * }\n * }\n *\n * // Mount multiple components\n * app.addComponents(document.body, {\n * '/home': MyComponent,\n * '/about': AnotherComponent\n * });\n * ```\n */\nimport _app, { App } from './app';\nimport { createElement, render, Fragment, safeHTML } from './vdom';\nimport { Component } from './component';\nimport { on, update, customElement } from './decorator';\nimport { route, ROUTER_EVENT, ROUTER_404_EVENT } from './router';\nimport webComponent from './web-component';\nimport addComponents from './add-components';\nimport { APPRUN_VERSION } from './version';\nconst app = _app;\nexport default app;\nexport { App, app, Component, on, update, Fragment, safeHTML };\nexport { update as event };\nexport { ROUTER_EVENT, ROUTER_404_EVENT };\nexport { customElement };\nif (!app.start) {\n app.version = APPRUN_VERSION;\n app.h = app.createElement = createElement;\n app.render = render;\n app.Fragment = Fragment;\n app.webComponent = webComponent;\n app.safeHTML = safeHTML;\n app.start = (element, state, view, update, options) => {\n const opts = { render: true, global_event: true, ...options };\n const component = new Component(state, view, update);\n if (options && options.rendered)\n component.rendered = options.rendered;\n if (options && options.mounted)\n component.mounted = options.mounted;\n component.start(element, opts);\n return component;\n };\n // Deprecated: app.query is deprecated in favor of app.runAsync\n app.query = app.query || app.runAsync;\n const NOOP = _ => { };\n app.on('/', NOOP);\n app.on('debug', _ => NOOP);\n app.on(ROUTER_EVENT, NOOP);\n app.on(ROUTER_404_EVENT, NOOP);\n app.route = route;\n app.on('route', url => app['route'] && app['route'](url));\n if (typeof document === 'object') {\n document.addEventListener(\"DOMContentLoaded\", () => {\n const no_init_route = document.body.hasAttribute('apprun-no-init') || app['no-init-route'] || false;\n const use_hash = app.find('#') || app.find('#/') || false;\n // console.log(`AppRun ${app.version} started with ${use_hash ? 'hash' : 'path'} routing. Initial load: ${init_load ? 'disabled' : 'enabled'}.`);\n window.addEventListener('hashchange', () => route(location.hash));\n window.addEventListener('popstate', () => route(location.pathname));\n if (use_hash) {\n !no_init_route && route(location.hash);\n }\n else {\n !no_init_route && (() => {\n const basePath = app.basePath || '';\n let initialPath = location.pathname;\n // Strip base path if present\n if (basePath && initialPath.startsWith(basePath)) {\n initialPath = initialPath.substring(basePath.length);\n if (!initialPath.startsWith('/'))\n initialPath = '/' + initialPath;\n }\n route(initialPath);\n })();\n document.body.addEventListener('click', e => {\n const element = e.target;\n if (!element)\n return;\n const menu = (element.tagName === 'A' ? element : element.closest('a'));\n if (menu &&\n menu.origin === location.origin &&\n menu.pathname) {\n e.preventDefault();\n // Handle base path for navigation\n const basePath = app.basePath || '';\n const fullPath = basePath + menu.pathname;\n history.pushState(null, '', fullPath);\n route(menu.pathname); // Route with relative path (without base path)\n }\n });\n }\n });\n }\n if (typeof window === 'object') {\n const globalWindow = window;\n globalWindow['Component'] = Component;\n globalWindow['_React'] = globalWindow['React'];\n globalWindow['React'] = app;\n globalWindow['on'] = on;\n globalWindow['customElement'] = customElement;\n globalWindow['safeHTML'] = safeHTML;\n }\n app.use_render = (render, mode = 0) => {\n if (mode === 0) {\n app.render = (el, vdom) => render(vdom, el); // react style\n }\n else {\n app.render = (el, vdom) => render(el, vdom); // apprun style\n }\n };\n app.use_react = (React, ReactDOM) => {\n if (!React || !ReactDOM) {\n console.error('AppRun use_react: React and ReactDOM parameters are required');\n return;\n }\n if (typeof React.createElement !== 'function') {\n console.error('AppRun use_react: Invalid React object - createElement method not found');\n return;\n }\n if (!React.Fragment) {\n console.error('AppRun use_react: Invalid React object - Fragment not found');\n return;\n }\n app.h = app.createElement = React.createElement;\n app.Fragment = React.Fragment;\n // React 18+ uses createRoot API\n if (React.version && React.version.startsWith('18')) {\n if (!ReactDOM.createRoot || typeof ReactDOM.createRoot !== 'function') {\n console.error('AppRun use_react: ReactDOM.createRoot not found in React 18+');\n return;\n }\n app.render = (el, vdom) => {\n if (!el || vdom === undefined)\n return;\n if (!el._root)\n el._root = ReactDOM.createRoot(el);\n el._root.render(vdom);\n };\n }\n else {\n // Legacy React versions\n if (!ReactDOM.render || typeof ReactDOM.render !== 'function') {\n console.error('AppRun use_react: ReactDOM.render not found in legacy React');\n return;\n }\n app.render = (el, vdom) => ReactDOM.render(vdom, el);\n }\n };\n app.addComponents = addComponents;\n}\n//# sourceMappingURL=apprun.js.map"],"names":["APPRUN_VERSION","APPRUN_VERSION_GLOBAL","App","constructor","this","_events","on","name","fn","options","push","off","subscribers","filter","sub","find","run","args","getSubscribers","console","assert","length","forEach","error","delay","Object","keys","apply","once","_t","clearTimeout","setTimeout","runAsync","promises","map","Promise","resolve","reject","all","query","warn","events","evt","endsWith","startsWith","replace","sort","a","b","event","AppRunVersions","_app","root","window","global","self","app","_AppRunVersions","_app$1","safeEventTarget","target","HTMLElement","getStateValue","component","setStateValue","value","state","setState","directive","vdom","Array","isArray","element","type","tag","props","children","key","substring","e","handler","p","checked","Number","multiple","selected","apply_directive","Schema","property","normal","space","merge","definitions","definition","assign","normalize","toLowerCase","prototype","undefined","Info","attribute","booleanish","boolean","commaOrSpaceSeparated","commaSeparated","defined","mustUseProperty","number","overloadedBoolean","spaceSeparated","powers","increment","checks","types","DefinedInfo","mask","index","super","mark","check","values","create","properties","normals","entries","info","transform","attributes","includes","aria","ariaActiveDescendant","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaControls","ariaCurrent","ariaDescribedBy","ariaDetails","ariaDisabled","ariaDropEffect","ariaErrorMessage","ariaExpanded","ariaFlowTo","ariaGrabbed","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLabelledBy","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaOwns","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRelevant","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText","role","_","slice","caseSensitiveTransform","caseInsensitiveTransform","html","acceptcharset","classname","htmlfor","httpequiv","abbr","accept","acceptCharset","accessKey","action","allow","allowFullScreen","allowPaymentRequest","allowUserMedia","alt","as","async","autoCapitalize","autoComplete","autoFocus","autoPlay","blocking","capture","charSet","cite","className","cols","colSpan","content","contentEditable","controls","controlsList","coords","crossOrigin","data","dateTime","decoding","default","defer","dir","dirName","disabled","download","draggable","encType","enterKeyHint","fetchPriority","form","formAction","formEncType","formMethod","formNoValidate","formTarget","headers","height","hidden","high","href","hrefLang","htmlFor","httpEquiv","id","imageSizes","imageSrcSet","inert","inputMode","integrity","is","isMap","itemId","itemProp","itemRef","itemScope","itemType","kind","label","lang","language","list","loading","loop","low","manifest","max","maxLength","media","method","min","minLength","muted","nonce","noModule","noValidate","onAbort","onAfterPrint","onAuxClick","onBeforeMatch","onBeforePrint","onBeforeToggle","onBeforeUnload","onBlur","onCancel","onCanPlay","onCanPlayThrough","onChange","onClick","onClose","onContextLost","onContextMenu","onContextRestored","onCopy","onCueChange","onCut","onDblClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onDurationChange","onEmptied","onEnded","onError","onFocus","onFormData","onHashChange","onInput","onInvalid","onKeyDown","onKeyPress","onKeyUp","onLanguageChange","onLoad","onLoadedData","onLoadedMetadata","onLoadEnd","onLoadStart","onMessage","onMessageError","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onOffline","onOnline","onPageHide","onPageShow","onPaste","onPause","onPlay","onPlaying","onPopState","onProgress","onRateChange","onRejectionHandled","onReset","onResize","onScroll","onScrollEnd","onSecurityPolicyViolation","onSeeked","onSeeking","onSelect","onSlotChange","onStalled","onStorage","onSubmit","onSuspend","onTimeUpdate","onToggle","onUnhandledRejection","onUnload","onVolumeChange","onWaiting","onWheel","open","optimum","pattern","ping","placeholder","playsInline","popover","popoverTarget","popoverTargetAction","poster","preload","readOnly","referrerPolicy","rel","required","reversed","rows","rowSpan","sandbox","scope","scoped","seamless","shadowRootClonable","shadowRootDelegatesFocus","shadowRootMode","shape","size","sizes","slot","span","spellCheck","src","srcDoc","srcLang","srcSet","start","step","style","tabIndex","title","translate","typeMustMatch","useMap","width","wrap","writingSuggestions","align","aLink","archive","axis","background","bgColor","border","borderColor","bottomMargin","cellPadding","cellSpacing","char","charOff","classId","clear","code","codeBase","codeType","color","compact","declare","face","frame","frameBorder","hSpace","leftMargin","link","longDesc","lowSrc","marginHeight","marginWidth","noResize","noHref","noShade","noWrap","object","profile","prompt","rev","rightMargin","rules","scheme","scrolling","standby","summary","text","topMargin","valueType","version","vAlign","vLink","vSpace","allowTransparency","autoCorrect","autoSave","disablePictureInPicture","disableRemotePlayback","prefix","results","security","unselectable","svg","accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dataType","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","horizOriginY","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","navDown","navDownLeft","navDownRight","navLeft","navNext","navPrev","navRight","navUp","navUpLeft","navUpRight","onActivate","onBegin","onEnd","onFocusIn","onFocusOut","onMouseWheel","onRepeat","onShow","onZoom","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDashArray","strokeDashOffset","strokeLineCap","strokeLineJoin","strokeMiterLimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","transformOrigin","typeOf","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wordSpacing","writingMode","xHeight","playbackOrder","timelineBegin","about","accumulate","additive","alphabetic","amplitude","ascent","attributeName","attributeType","azimuth","bandwidth","baseFrequency","baseProfile","bbox","begin","bias","by","calcMode","clip","clipPathUnits","contentScriptType","contentStyleType","cursor","cx","cy","d","defaultAction","descent","diffuseConstant","direction","display","dur","divisor","dx","dy","edgeMode","editable","elevation","end","exponent","externalResourcesRequired","fill","filterRes","filterUnits","focusable","focusHighlight","format","fr","from","fx","fy","g1","g2","glyphRef","gradientTransform","gradientUnits","hanging","hatchContentUnits","hatchUnits","ideographic","initialVisibility","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","kerning","lengthAdjust","limitingConeAngle","local","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","mathematical","mediaCharacterEncoding","mediaContentEncodings","mediaSize","mediaTime","mode","numOctaves","observer","offset","opacity","operator","order","orient","orientation","origin","overflow","overlay","path","pathLength","patternContentUnits","patternTransform","patternUnits","phase","pitch","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","propagate","r","radius","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","requiredFonts","requiredFormats","resource","restart","result","rotate","rx","ry","scale","seed","side","slope","snapshotTime","specularConstant","specularExponent","spreadMethod","spacing","startOffset","stdDeviation","stemh","stemv","stitchTiles","string","stroke","surfaceScale","syncBehavior","syncBehaviorDefault","syncMaster","syncTolerance","syncToleranceDefault","systemLanguage","tableValues","targetX","targetY","textLength","transformBehavior","to","u1","u2","unicode","viewBox","viewTarget","visibility","widths","x","x1","x2","xChannelSelector","y","y1","y2","yChannelSelector","z","zoomAndPan","xlink","xLinkActuate","xLinkArcRole","xLinkHref","xLinkRole","xLinkShow","xLinkTitle","xLinkType","xmlns","xmlnsxlink","xmlnsXLink","xml","xmlBase","xmlLang","xmlSpace","cap","dash","valid","kebab","$0","camelcase","charAt","toUpperCase","htmlBase","svgBase","ATTR_PROPS","propertyInfoCache","Map","getPropertyInfo","isSvg","cacheKey","get","schema","Type","test","rest","dashes","set","setBooleanAttribute","Boolean","shouldSetBooleanAttribute","removeAttribute","setAttribute","setElementProperty","propertyName","setElementAttribute","stringValue","String","split","setAttributeNS","setAttributeOrProperty","dom","prop","document","activeElement","HTMLMediaElement","shouldSkipPatch","cssText","s","camelKey","str","word","join","dataset","setDatasetAttribute","setEventHandler","tagName","isValidAttributeName","updateProps","merged","oldProps","newProps","mergeProps","mergedProps","originalProps","requestAnimationFrame","applyPropertiesToElement","Fragment","collect","ch","c","i","keyCache","cleanupCounter","updateElement","nodes","parent","createComponent","nodeName","updateChildren","render","getElementById","querySelector","update","node","el","key1","key2","same","parentNode","replaceChild","old_len","childNodes","new_len","len","Math","child","textContent","nodeType","nodeValue","createText","SVGElement","insertBefore","old","n","removeChild","lastChild","createDocumentFragment","appendChild","safeHTML","div","createElement","insertAdjacentHTML","indexOf","createTextNode","JSON","stringify","createElementNS","isConnected","cleanupKeyCache","idx","getPrototypeOf","__isAppRunComponent","Date","now","asTag","__componentCache","renderState","mount","mounted","new_state","render_component","new_parent","_component","customElement","componentClass","observedAttributes","attr","connectedCallback","opts","_shadowRoot","shadow","attachShadow","attrMap","reduce","lc","_attrMap","item","defineProperty","attributeChangedCallback","configurable","enumerable","_props","dispatchEvent","bind","disconnectedCallback","unload","unmount","oldValue","mappedName","webComponent","customElements","define","Reflect","meta","WeakMap","defineMetadata","metadataKey","metadataValue","has","getMetadataKeys","getMetadata","descriptor","toString","REFRESH","Component","view","safeGetElementById","selector","context","safeQuerySelector","tracking_attr","getAttribute","tracking_id","valueOf","MutationObserver","changes","body","contains","disconnect","observe","childList","subtree","attributeOldValue","attributeFilter","transition","rendered","history","handleAsyncIterator","iterator","done","next","Symbol","asyncIterator","then","v","_state","enable_history","_history","_history_idx","callback","_actions","_global_events","_history_prev","_history_next","global_event","prev","route","add_actions","is_global_event","add_action","current_state","newState","actions","act","trim","handleEmptyPath","hashSubscribers","ROUTER_EVENT","pathSubscribers","hashSlashSubscribers","ROUTER_404_EVENT","routeWithHierarchy","url","normalizeTrailingSlash","basePath","normalizedBasePath","stripped","stripBasePath","segments","parsePathSegments","routeType","nonEmptySegments","validateHierarchyDepth","hierarchy","currentSegments","routeName","generateRouteHierarchy","handlerInfo","originalSegments","handlerDepth","eventName","parameters","findHandlerInHierarchy","publishRoute","minimalRoute","isComponentInstance","obj","isComponentConstructor","isFactoryFunction","resolveComponent","maxDepth","resolved","depth","h","Error","NOOP","addEventListener","no_init_route","hasAttribute","use_hash","location","hash","pathname","initialPath","menu","closest","preventDefault","fullPath","pushState","globalWindow","use_render","use_react","React","ReactDOM","createRoot","_root","addComponents","components"],"mappings":"AAWO,MAAMA,EAAiB,SAEjBC,EAAwB,UAAUD,ICkCxC,MAAME,EACT,WAAAC,GACIC,KAAKC,QAAU,CAAA,CACnB,CACA,EAAAC,CAAGC,EAAMC,EAAIC,EAAU,CAAA,GACnBL,KAAKC,QAAQE,GAAQH,KAAKC,QAAQE,IAAS,GAC3CH,KAAKC,QAAQE,GAAMG,KAAK,CAAEF,KAAIC,WAClC,CACA,GAAAE,CAAIJ,EAAMC,GACN,MAAMI,EAAcR,KAAKC,QAAQE,IAAS,GAC1CH,KAAKC,QAAQE,GAAQK,EAAYC,QAAQC,GAAQA,EAAIN,KAAOA,GAChE,CACA,IAAAO,CAAKR,GACD,OAAOH,KAAK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