@webqit/oohtml 4.4.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bindings-api.js +1 -1
- package/dist/bindings-api.js.map +2 -2
- package/dist/context-api.js +1 -1
- package/dist/context-api.js.map +2 -2
- package/dist/data-binding.js +5 -5
- package/dist/data-binding.js.map +2 -2
- package/dist/html-imports.js +1 -1
- package/dist/html-imports.js.map +2 -2
- package/dist/main.js +15 -15
- package/dist/main.js.map +2 -2
- package/dist/main.lite.js +10 -10
- package/dist/main.lite.js.map +2 -2
- package/dist/namespaced-html.js +1 -1
- package/dist/namespaced-html.js.map +2 -2
- package/dist/scoped-css.js +1 -1
- package/dist/scoped-css.js.map +2 -2
- package/package.json +2 -2
- package/src/bindings-api/index.js +1 -1
- package/src/context-api/DOMContexts.js +1 -1
- package/src/data-binding/index.js +13 -13
- package/src/html-imports/HTMLImportsContext.js +1 -1
package/dist/main.lite.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../node_modules/@webqit/quantum-js/src/index.lite.js", "../node_modules/@webqit/observer/src/main.js", "../node_modules/@webqit/util/js/isObject.js", "../node_modules/@webqit/util/js/getType.js", "../node_modules/@webqit/util/js/isArray.js", "../node_modules/@webqit/util/js/isTypeFunction.js", "../node_modules/@webqit/util/js/isNull.js", "../node_modules/@webqit/util/js/isUndefined.js", "../node_modules/@webqit/util/js/isTypeObject.js", "../node_modules/@webqit/util/js/isEmpty.js", "../node_modules/@webqit/util/js/isFunction.js", "../node_modules/@webqit/util/js/isNumber.js", "../node_modules/@webqit/util/js/isNumeric.js", "../node_modules/@webqit/util/js/isString.js", "../node_modules/@webqit/util/js/isTypeArray.js", "../node_modules/@webqit/util/arr/pushUnique.js", "../node_modules/@webqit/util/obj/getPrototypeChain.js", "../node_modules/@webqit/util/obj/getAllPropertyNames.js", "../node_modules/@webqit/util/obj/mergeCallback.js", "../node_modules/@webqit/util/obj/merge.js", "../node_modules/@webqit/util/js/wq.js", "../node_modules/@webqit/util/arr/from.js", "../node_modules/@webqit/observer/src/util.js", "../node_modules/@webqit/observer/src/core/Registration.js", "../node_modules/@webqit/observer/src/core/ListenerRegistration.js", "../node_modules/@webqit/observer/src/core/Registry.js", "../node_modules/@webqit/observer/src/core/Descriptor.js", "../node_modules/@webqit/observer/src/core/ListenerRegistry.js", "../node_modules/@webqit/observer/src/core/TrapsRegistration.js", "../node_modules/@webqit/observer/src/core/TrapsRegistry.js", "../node_modules/@webqit/observer/src/actors.js", "../node_modules/@webqit/observer/src/index.js", "../node_modules/@webqit/quantum-js/src/util.js", "../node_modules/@webqit/quantum-js/src/params.js", "../node_modules/@webqit/quantum-js/src/runtime/hot-module-registry.js", "../node_modules/@webqit/quantum-js/src/runtime/EventTarget.js", "../node_modules/@webqit/quantum-js/src/runtime/Signal.js", "../node_modules/@webqit/quantum-js/src/runtime/Scope.js", "../node_modules/@webqit/quantum-js/src/runtime/Autorun.js", "../node_modules/@webqit/quantum-js/src/runtime/AutoIterator.js", "../node_modules/@webqit/quantum-js/src/runtime/AutoAsyncIterator.js", "../node_modules/@webqit/quantum-js/src/runtime/State.js", "../node_modules/@webqit/quantum-js/src/runtime/Runtime.js", "../node_modules/@webqit/quantum-js/src/runtime/index.js", "../node_modules/@webqit/quantum-js/src/AbstractQuantumScript.js", "../node_modules/@webqit/util/obj/get.js", "../node_modules/@webqit/util/obj/set.js", "../node_modules/@webqit/realdom/src/Scheduler.js", "../node_modules/@webqit/realdom/src/realtime/Util.js", "../node_modules/@webqit/realdom/src/realtime/DOMSpec.js", "../node_modules/@webqit/realdom/src/realtime/Realtime.js", "../node_modules/@webqit/realdom/src/realtime/AttrRealtime.js", "../node_modules/@webqit/realdom/src/realtime/DOMRealtime.js", "../node_modules/@webqit/realdom/src/polyfills.js", "../node_modules/@webqit/realdom/src/index.js", "../node_modules/@webqit/util/str/toTitle.js", "../src/util.js", "../src/context-api/_DOMContextRequestEvent.js", "../src/context-api/DOMContextResponse.js", "../src/context-api/DuplicateContextError.js", "../src/context-api/DOMContexts.js", "../src/context-api/DOMContext.js", "../src/namespaced-html/DOMNamingContext.js", "../src/namespaced-html/index.js", "../src/scoped-js/index.js", "../src/data-binding/index.js", "../src/bindings-api/DOMBindingsContext.js", "../src/bindings-api/index.js", "../src/html-imports/HTMLModule.js", "../src/html-imports/HTMLImportsContext.js", "../src/html-imports/_HTMLImportElement.js", "../src/html-imports/index.js", "../src/context-api/index.js", "../src/scoped-css/index.js", "../src/init.js", "../src/index.lite.js"],
|
|
4
|
-
"sourcesContent": ["\n/**\n * @imports\n */\nimport Observer from '@webqit/observer';\nimport { _$functionArgs } from './util.js';\nimport { $eval } from './runtime/index.js';\nimport AbstractQuantumScript from './AbstractQuantumScript.js';\nimport State from './runtime/State.js';\n\n/** -------------- APIs */\n\nexport { Observer, State }\n\nexport let QuantumFunction;\n\nexport function AsyncQuantumFunction( ...args ) {\n const { source, params } = _$functionArgs( args );\n const compiledFunction = $eval( 'async-function', parseCompileCallback, source, params );\n if ( !( compiledFunction instanceof Promise ) ) return compiledFunction;\n // Introduce a wrapper function that awaits main function\n const wrapperFunction = async function( ...args ) { return ( await compiledFunction ).call( this, ...args ); }\n Object.defineProperty( wrapperFunction, 'toString', { value: async function( ...args ) { return ( await compiledFunction ).toString( ...args ) } } )\n return wrapperFunction;\n}\nexport const QuantumAsyncFunction = AsyncQuantumFunction; // For backwards compat\n\nexport let QuantumScript;\n\nexport class AsyncQuantumScript extends AbstractQuantumScript {\n static sourceType = 'async-script';\n static parseCompileCallback = parseCompileCallback;\n}\nexport const QuantumAsyncScript = AsyncQuantumScript; // For backwards compat\n\n\nexport class QuantumModule extends AbstractQuantumScript {\n static sourceType = 'module';\n static parseCompileCallback = parseCompileCallback;\n}\n\n/** -------------- parse-compile */\n\nfunction parseCompileCallback( ...args ) {\n const params = typeof args[ args.length - 1 ] === 'object' ? args.pop() : {}; \n const source = args.pop() || '';\n // $qCompiler has been loaded sync?\n if ( globalThis.webqit?.$qCompiler ) {\n const { parse, compile } = globalThis.webqit.$qCompiler;\n const ast = parse( source, params.parserParams );\n return compile( ast, params.compilerParams );\n }\n // Load and run $qCompiler async - in the background?\n globalThis.webqit = globalThis.webqit || {};\n if ( !globalThis.webqit.$qCompilerWorker ) {\n const customUrl = document.querySelector( 'meta[name=\"$q-compiler-url\"]' );\n const compilerUrls = ( customUrl?.content.split( ',' ) || [] ).concat( 'https://unpkg.com/@webqit/quantum-js/dist/compiler.js' );\n const workerScriptText = `\n const compilerUrls = [ '${ compilerUrls.join( `','` ) }' ];\n ( function importScript() {\n try { importScripts( compilerUrls.shift().trim() ) } catch( e ) { if ( compilerUrls.length ) { importScript(); } }\n } )();\n const { parse, compile } = globalThis.webqit.$qCompiler;\n globalThis.onmessage = e => {\n const { source, params } = e.data;\n const ast = parse( source, params.parserParams );\n const { toString, ...compilation } = compile( ast, params.compilerParams );\n e.ports[ 0 ]?.postMessage( compilation );\n };`;\n globalThis.webqit.$qCompilerWorker = new Worker( `data:text/javascript;base64,${ btoa( workerScriptText ) }` );\n }\n return new Promise( res => {\n let messageChannel = new MessageChannel;\n webqit.$qCompilerWorker.postMessage( { source, params }, [ messageChannel.port2 ] );\n messageChannel.port1.onmessage = e => {\n const { ...compilation } = e.data;\n Object.defineProperty( compilation, 'toString', {\n value: base64 => base64 === 'base64' ? compilation.compiledSourceBase64 : compilation.compiledSource\n } );\n res( compilation );\n }\n } );\n}", "import { _isObject, _isTypeObject, _isFunction, _getType } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport { _wq, _await, env } from './util.js';\nimport ListenerRegistry from './core/ListenerRegistry.js';\nimport TrapsRegistry from './core/TrapsRegistry.js';\nimport Descriptor from './core/Descriptor.js';\nimport { unproxy } from './actors.js';\n\n/* ---------------SPECIAL APIs--------------- */\n\n/**\n * Creates a Path array instance from arguments.\n * \n * @param Array\t ...segments\n *\n * @return Path\n */\nclass Path extends Array {}\nexport function path( ...segments ) {\n return new Path( ...segments );\n}\n\n/**\n * Creates a \"Subtree\" directive.\n * \n * @return Subtree\n */\nclass Subtree extends Array {}\nexport function subtree() {\n return new Subtree;\n}\n\n/**\n * Creates an \"Infinity\" directive.\n * \n * @return Infinity\n */\nexport function any() {\n return Infinity;\n}\n\n/**\n * Reduces a path array against handler.\n * \n * @param Array|Object\t target\n * @param Array\t path\n * @param Function\t receiver\n * @param Function\t final\n * @param Object\t params\n * \n * @example reduce( object, [ segement1, segement2 ], observe, ( value, flags ) => {}, params );\n *\n * @return Any\n */\nexport function reduce( target, path, receiver, final = x => x, params = {} ) {\n const _isSubtree = path instanceof Subtree;\n if ( !_isSubtree && !path?.length ) return;\n return ( function eat( target, path, $params, $isSubtree ) {\n const isSubtree = $isSubtree || path[ $params.level ] instanceof Subtree;\n const segment = isSubtree ? Infinity : path[ $params.level ];\n const isLastSegment = isSubtree ? false : $params.level === path.length - 1;\n if ( target instanceof Descriptor && target.operation !== 'get' ) {\n // Always probe event-generated trees\n $params = { ...$params, probe: 'always' };\n } else if ( $params.probe !== 'always' ) {\n // Probe until (before) last segment\n $params = { ...$params, probe: !isLastSegment };\n }\n // ---------------\n return receiver( target, segment, ( result, ...args ) => {\n // -----------\n const addTrail = ( desc ) => {\n if ( !( desc instanceof Descriptor ) ) return;\n desc.path = 'key' in desc ? [ desc.key ] : [];\n if ( target instanceof Descriptor ) {\n desc.path = 'key' in desc ? target.path.concat( desc.key ) : target.path.slice( 0 );\n Object.defineProperty( desc, 'context', { get: () => target, configurable: true } );\n }\n };\n const flags = args[ 0 ] || {};\n const advance = ( result ) => {\n if ( result instanceof Descriptor && 'argumentsList' in result ) {\n return;\n }\n const $value = resolveObj( result/* a Descriptor who's value could be proxied */, false );\n return _await( $value/* could be a promise */, $value => {\n if ( result instanceof Descriptor ) {\n result.value = $value; // Update to (fulfilled), unproxied, value\n } else {\n result = $value;\n }\n return eat( result, path, { ...$params, ...flags, keyInParent: result.key, level: $params.level + 1, }, isSubtree );\n } );\n };\n // -----------\n if ( isPropsList( segment ) && Array.isArray( result ) ) {\n result.forEach( addTrail );\n if ( isLastSegment ) {\n return final( result, ...args );\n }\n if ( isSubtree && result[ 0 ] instanceof Descriptor && ( result[ 0 ].operation !== 'get' || params.asGet ) ) {\n final( result, ...args );\n }\n for ( const entry of result ) {\n advance( entry );\n }\n return;\n }\n // -----------\n addTrail( result );\n if ( isLastSegment ) {\n return final( result, ...args );\n }\n return advance( result );\n // -----------\n }, $params );\n } )( target, path.slice( 0 ), { ...params, level: 0 }, _isSubtree );\n}\n\n/**\n * Adds an observer to a target's registry.\n *\n * @param Array|Object\t target\n * @param String|Object\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return AbortController\n */\nexport function observe( target, prop, receiver, params = {} ) {\n // ---------------\n const originalTarget = resolveObj( target, !params.level );\n\tif ( _isFunction( arguments[ 1 ] ) ) {\n [ , receiver, params = {} ] = arguments;\n prop = Infinity;\n\t}\n\tif ( !_isFunction( receiver ) ) throw new Error( `Handler must be a function; \"${ _getType( receiver ) }\" given!` );\n if ( prop instanceof Path || prop instanceof Subtree ) return reduce( originalTarget, prop, observe, receiver, params );\n // ---------------\n params = { ...params, descripted: true };\n delete params.live;\n if ( !_isTypeObject( originalTarget ) ) return params.probe && get( originalTarget, prop, receiver, params ) || undefined;\n // ---------------\n const emit = bind( originalTarget, prop, receiver, params );\n if ( params.probe ) {\n return get( originalTarget, prop, emit, params );\n }\n return emit();\n}\n\n/**\n * Adds an interceptor object to a target's registry.\n *\n * @param Array|Object\t target\n * @param Object\t traps\n * @param Object\t\t params\n *\n * @return AbortRegistry\n */\nexport function intercept( target, traps, params = {} ) {\n // ---------------\n const originalTarget = resolveObj( target );\n if ( !_isObject( traps ) ) {\n [ /*target*/, /*operation*/, /*handler*/, params = {} ] = arguments;\n traps = { [ arguments[ 1 ] ]: arguments[ 2 ] };\n }\n // ---------------\n return TrapsRegistry.getInstance( originalTarget, true, params.namespace ).addRegistration( { traps, params } );\n}\n\n/* ---------------QUERY APIs--------------- */\n\n/**\n * Performs a \"getOwnPropertyDescriptor\" operation.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getOwnPropertyDescriptor( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'getOwnPropertyDescriptor', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a \"getOwnPropertyDescriptors\" operation.\n * @note this isn't part of the standard Reflect API.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getOwnPropertyDescriptors( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'getOwnPropertyDescriptors', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a \"getPrototypeOf\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getPrototypeOf( target, receiver = x => x, params = {} ) {\n return exec( target, 'getPrototypeOf', {}, receiver, params );\n}\n\n/**\n * Performs a \"isExtensible\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function isExtensible( target, receiver = x => x, params = {} ) {\n return exec( target, 'isExtensible', {}, receiver, params );\n}\n\n/**\n * Performs a \"ownKeys\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function ownKeys( target, receiver = x => x, params = {} ) {\n return exec( target, 'ownKeys', {}, receiver, params );\n}\n\n/**\n * Performs an operation of the given \"type\".\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function has( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'has', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a get operation.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function get( target, prop, receiver = x => x, params = {} ) {\n // ---------------\n let isLive;\n const originalTarget = resolveObj( target, !params.level );\n if ( _isObject( receiver ) ) {\n [ params, receiver ] = [ receiver, x => x ];\n } else if ( params.live ) { isLive = true; }\n if ( prop instanceof Path || prop instanceof Subtree ) return reduce( originalTarget, prop, get, receiver, { ...params, asGet: true } );\n // ---------------\n return resolveProps( originalTarget, prop, props => {\n const related = [ ...props ];\n return ( function next( results, _props, _done ) {\n if ( !_props.length ) return _done( results );\n const prop = _props.shift();\n if ( ![ 'string', 'number', 'symbol' ].includes( typeof prop ) ) {\n throw new Error( `Property name/key ${ prop } invalid.` );\n }\n // ---------\n function defaultGet( descriptor, value = undefined ) {\n const _next = value => ( descriptor.value = value, next( [ ...results, params.live || params.descripted ? descriptor : value ]/** not using concat() as value may be an array */, _props, _done ) );\n if ( arguments.length > 1 ) return _next( value );\n if ( !_isTypeObject( originalTarget ) ) return _next( originalTarget?.[ descriptor.key ] );\n const accessorizedProps = _wq( originalTarget, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key );\n if ( accessorization && accessorization.intact() ) {\n return _next( accessorization.getValue( params.withPropertyDescriptors ) );\n }\n if ( params.withPropertyDescriptors ) {\n const desc = Object.getOwnPropertyDescriptor( originalTarget, descriptor.key );\n return _next( desc );\n }\n return _next( Reflect.get( originalTarget, descriptor.key/*, ...( params.receiver ? [ params.receiver ] : [] )*//*Throws Illegal invocation error ffor DOM nodes, e.g.*/ ) );\n }\n // ---------\n const descriptor = new Descriptor( originalTarget, {\n type: 'get',\n key: prop,\n value: undefined,\n operation: 'get',\n related,\n } );\n if ( !_isTypeObject( originalTarget ) ) return defaultGet( descriptor );\n const trapsRegistry = TrapsRegistry.getInstance( originalTarget, false, params.namespace );\n if ( trapsRegistry ) {\n return trapsRegistry.emit( descriptor, defaultGet );\n }\n return defaultGet( descriptor );\n } )( [], props.slice( 0 ), results => {\n const result_s = isPropsList( prop/*original*/ ) ? results : results[ 0 ];\n if ( isLive && _isTypeObject( originalTarget ) ) {\n const emit = bind( originalTarget, prop, receiver, params, target.key );\n return emit( result_s );\n }\n return receiver( result_s );\n } );\n }, params );\n}\n\n/* ---------------MUTATION APIs--------------- */\n\n/**\n * Performs a batch operation.\n * \n * @param Object\t target\n * @param Function\t callback\n * @param Object\t params\n *\n * @return Void\n */\nexport function batch( target, callback, params = {} ) {\n const originalTarget = resolveObj( target );\n return ListenerRegistry.getInstance( originalTarget, true, params.namespace ).batch( callback, params );\n}\n\n/**\n * Performs a mirror operation.\n * \n * @param Object\t source\n * @param Object\t target\n * @param Object\t params\n *\n * @return Void\n */\nexport function map( source, target, params = {} ) {\n target = resolveObj( target );\n source = resolveObj( source );\n const only = ( params.only || [] ).slice( 0 ), except = ( params.except || [] ).slice( 0 );\n const sourceKeys = Object.keys( params.spread ? [ ...source ] : source ).map( k => !isNaN( k ) ? parseInt( k ) : k );\n const filteredKeys = only.length ? only.filter( k => sourceKeys.includes( k ) ) : sourceKeys.filter( k => !except.includes( k ) );\n const resolveKey = k => { \n if ( !Array.isArray( target ) || isNaN( k ) ) return k;\n return k - except.filter( i => i < k ).length;\n };\n const doSet = key => {\n const descriptor = getOwnPropertyDescriptor( source, key, params );\n if ( ( 'value' in descriptor ) && descriptor.writable && descriptor.enumerable && descriptor.configurable ) {\n set( target, resolveKey( key ), descriptor.value, params );\n } else if ( descriptor.enumerable || params.onlyEnumerable === false ) { defineProperty( target, key, { ...descriptor, configurable: true }, params ); }\n };\n batch( target, () => {\n filteredKeys.forEach( doSet );\n } );\n return observe( source, mutations => {\n //batch( target, () => {\n mutations.filter( m => only.length ? only.includes( m.key ) : !except.includes( m.key ) ).forEach( m => {\n if ( m.type === 'delete' ) return deleteProperty( target, resolveKey( m.key ), params );\n if ( m.type === 'def' ) {\n if ( m.value.enumerable || params.onlyEnumerable === false ) {\n defineProperty( target, resolveKey( m.key ), { ...m.value, configurable: true }, params );\n }\n return;\n }\n doSet( m.key );\n } );\n //}, params );\n }, { ...params, withPropertyDescriptors: true } );\n}\n\n/**\n * Performs a set operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Any\t value\n * @param Function\t receiver\n * @param Object\t params\n * @param Bool\t def\n *\n * @return Any\n */\nexport function set( target, prop, value, receiver = x => x, params = {}, def = false ) {\n // ---------------\n const originalTarget = resolveObj( target );\n let entries = [ [ prop, value ] ];\n if ( _isObject( prop ) ) {\n [ /*target*/, /*hash*/, receiver = x => x, params = {}, def = false ] = arguments;\n entries = Object.entries( prop );\n }\n if ( _isObject( receiver ) ) { [ def, params, receiver ] = [ typeof params === 'boolean' ? params : def, receiver, x => x ]; }\n // ---------------\n const related = entries.map( ( [ prop ] ) => prop );\n return ( function next( descriptors, entries, _done ) {\n if ( !entries.length ) return _done( descriptors );\n const [ prop, value ] = entries.shift();\n // ---------\n function defaultSet( descriptor, status = undefined ) {\n const _next = status => ( descriptor.status = status, next( descriptors.concat( descriptor ), entries, _done ) );\n if ( arguments.length > 1 ) return _next( descriptor, status );\n const accessorizedProps = _wq( originalTarget, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key );\n if ( descriptor.type === 'def' ) {\n if ( accessorization && !accessorization.restore() ) _next( false );\n Object.defineProperty( originalTarget, descriptor.key, descriptor.value );\n return _next( true );\n }\n if ( accessorization && accessorization.intact() ) {\n return _next( accessorization.setValue( descriptor.value ) );\n }\n return _next( Reflect.set( originalTarget, descriptor.key, descriptor.value ) );\n }\n // ---------\n function exec( isUpdate, oldValue ) {\n if ( params.diff && value === oldValue ) return next( descriptors, entries, _done );\n const descriptor = new Descriptor( originalTarget, {\n type: def ? 'def' : 'set',\n key: prop,\n value,\n isUpdate,\n oldValue,\n related: [ ...related ],\n operation: def ? 'defineProperty' : 'set',\n detail: params.detail,\n } );\n const trapsRegistry = TrapsRegistry.getInstance( originalTarget, false, params.namespace );\n return trapsRegistry \n ? trapsRegistry.emit( descriptor, defaultSet ) \n : defaultSet( descriptor );\n }\n // ---------\n return has( originalTarget, prop, exists => {\n if ( !exists ) return exec( exists );\n if ( prop === 'length' && Array.isArray( originalTarget ) && _wq( originalTarget ).has( '$length' ) ) {\n return exec( true, _wq( originalTarget ).get( '$length' ) );\n }\n const $params = { ...params, withPropertyDescriptors: def };\n return get( originalTarget, prop, oldValue => exec( exists, oldValue ), $params );\n }, params );\n // ---------\n } )( [], entries.slice( 0 ), descriptors => {\n const listenerRegistry = ListenerRegistry.getInstance( originalTarget, false, params.namespace );\n if ( listenerRegistry ) listenerRegistry.emit( descriptors, { eventsArePropertyDescriptors: !!def } );\n return receiver(\n isPropsList( prop/*original*/ ) ? descriptors.map( opr => opr.status ) : descriptors[ 0 ]?.status\n );\n } );\n}\n\n/**\n * Performs a defineProperty operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Object\t descriptor\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function defineProperty( target, prop, descriptor, receiver = x => x, params = {} ) {\n return set( target, prop, descriptor, receiver, params, true/*def*/ );\n}\n\n/**\n * Performs a defineProperties operation.\n * @note this isn't part of the standard Reflect API.\n * \n * @param Object\t target\n * @param Object\t descriptors\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function defineProperties( target, descriptors, receiver = x => x, params = {} ) {\n return set( target, descriptors, receiver, params, true/*def*/ );\n}\n\n/**\n * Performs a delete operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function deleteProperty( target, prop, receiver = x => x, params = {} ) {\n // ---------------\n const originalTarget = resolveObj( target );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; }\n // ---------------\n const props = _arrFrom( prop, false ), related = [ ...props ];\n return ( function next( descriptors, props, _done ) {\n if ( !props.length ) return _done( descriptors );\n const prop = props.shift();\n // ---------\n function defaultDel( descriptor, status = undefined ) {\n const _next = status => ( descriptor.status = status, next( descriptors.concat( descriptor ), props, _done ) );\n if ( arguments.length > 1 ) return _next( descriptor, status );\n const accessorizedProps = _wq( originalTarget, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key );\n if ( accessorization && !accessorization.restore() ) _next( false );\n return _next( Reflect.deleteProperty( originalTarget, descriptor.key ) );\n }\n // ---------\n function exec( oldValue ) {\n const descriptor = new Descriptor( originalTarget, {\n type: 'delete',\n key: prop,\n oldValue,\n related: [ ...related ],\n operation: 'deleteProperty',\n detail: params.detail,\n } );\n const trapsRegistry = TrapsRegistry.getInstance( originalTarget, false, params.namespace );\n return trapsRegistry \n ? trapsRegistry.emit( descriptor, defaultDel ) \n : defaultDel( descriptor );\n }\n // ---------\n return get( originalTarget, prop, exec, params );\n // ---------\n } )( [], props.slice( 0 ), descriptors => {\n const listenerRegistry = ListenerRegistry.getInstance( originalTarget, false, params.namespace );\n if ( listenerRegistry ) listenerRegistry.emit( descriptors );\n return receiver(\n isPropsList( prop/*original*/ ) ? descriptors.map( opr => opr.status ) : descriptors[ 0 ].status\n );\n } );\n}\n\n/**\n * @alias deleteProperty()\n */\nexport function deleteProperties( target, props, receiver = x => x, params = {} ) {\n return deleteProperty( ...arguments );\n}\n\n/* ---------------EFFECT APIs--------------- */\n\n/**\n * Performs a \"construct\" operation.\n *\n * @param Array|Object\t target\n * @param Array\t\t\t argumentsList\n * @param Object\t\t newTarget\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function construct( target, argumentsList, newTarget = null, receiver = x => x, params = {} ) {\n return exec( target, 'construct', arguments.length > 2 ? { argumentsList, newTarget } : { argumentsList }, receiver, params );\n}\n\n/**\n * Performs an \"apply\" operation.\n *\n * @param Array|Object\t target\n * @param Any\t thisArgument\n * @param Array\t argumentsList\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function apply( target, thisArgument, argumentsList, receiver = x => x, params = {} ) {\n const originalThis = unproxy( thisArgument );\n let returnValue;\n if ( Array.isArray( thisArgument ) ) {\n if ( params.arrayMethodName ) {\n const descriptor = new Descriptor( originalThis, {\n operation: params.arrayMethodName,\n argumentsList\n } );\n const listenerRegistry = ListenerRegistry.getInstance( originalThis, false, params.namespace );\n listenerRegistry?.emit( [ descriptor ], { eventIsArrayMethodDescriptor: true } );\n }\n _wq( originalThis ).set( '$length', originalThis.length );\n returnValue = batch(\n originalThis,\n () => exec( target, 'apply', { thisArgument/*proxy wrappers allowed; in fact is why it works*/, argumentsList }, receiver, params ),\n params\n );\n _wq( originalThis ).delete( '$length' );\n } else {\n returnValue = exec( target, 'apply', { thisArgument: originalThis, argumentsList }, receiver, params );\n }\n return returnValue;\n}\n\n/**\n * Performs a \"setPrototypeOf\" operation.\n *\n * @param Array|Object\t target\n * @param Anyr\t proto\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function setPrototypeOf( target, proto, receiver = x => x, params = {} ) {\n return exec( target, 'setPrototypeOf', { proto }, receiver, params );\n}\n\n/**\n * Performs a \"preventExtension\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function preventExtensions( target, receiver = x => x, params = {} ) {\n return exec( target, 'preventExtensions', {}, receiver, params );\n}\n\n/* ---------------HELPER APIs--------------- */\n\n/**\n * Adds an observer to a target's registry.\n *\n * @param Array|Object\t target\n * @param String|Object\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Function: AbortController\n */\nfunction bind( target, prop, receiver, params = {} ) {\n const controller = new AbortController;\n env.setMaxListeners?.( 0, controller.signal );\n if ( params.signal ) { params.signal.addEventListener( 'abort', () => controller.abort() ); }\n const $params = { ...params, signal: controller.signal };\n const listenerRegistry = ListenerRegistry.getInstance( target, true, $params.namespace );\n const childRegistrations = new Map;\n return function emit( descriptor_s = [], prevRegistration = null ) {\n let flags, registrationNext, isExisting;\n if ( isPropsList( prop ) ) {\n if ( prevRegistration ) {\n isExisting = true;\n registrationNext = prevRegistration;\n for ( const descriptor of descriptor_s ) {\n childRegistrations.get( descriptor.key )?.remove();\n childRegistrations.delete( descriptor.key );\n }\n } else {\n registrationNext = listenerRegistry.addRegistration( prop, emit, $params );\n }\n flags = { signal: registrationNext.signal, childRegistrations };\n } else {\n prevRegistration?.remove();\n registrationNext = listenerRegistry.addRegistration( prop, emit, $params );\n flags = { signal: registrationNext.signal };\n }\n // ------------------\n if ( $params.childRegistrations && $params.keyInParent ) {\n $params.childRegistrations.set( $params.keyInParent, registrationNext );\n }\n // ------------------\n if ( arguments.length ) {\n const handlerReturnValue = receiver( descriptor_s, flags );\n if ( arguments.length > 1 ) return handlerReturnValue;\n }\n return controller;\n };\n}\n\n/**\n * Performs an operation of the given \"type\".\n *\n * @param Array|Object\t target\n * @param String\t\t operation\n * @param Object\t\t payload\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nfunction exec( target, operation, payload = {}, receiver = x => x, params = {} ) {\n // ---------\n target = resolveObj( target );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; } \n // ---------\n function defaultExec( descriptor, result ) {\n if ( arguments.length > 1 ) return receiver( result );\n return receiver( ( Reflect[ operation ] || Object[ operation ] )( target, ...Object.values( payload ) ) );\n }\n // ---------\n const descriptor = new Descriptor( target, { operation, ...payload } );\n const trapsRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n if ( trapsRegistry ) {\n return trapsRegistry.emit( descriptor, defaultExec );\n }\n return defaultExec( descriptor );\n}\n\n// Asks if prop is a multi-result field\nfunction isPropsList( prop ) {\n return prop === Infinity || Array.isArray( prop );\n}\n\n// Resolves obj down to it's self\nfunction resolveObj( obj, assert = true, probePropertyDescriptors = true ) {\n\tif ( ( !obj || !_isTypeObject( obj ) ) && assert ) throw new Error( `Object must be of type object or array! \"${ _getType( obj ) }\" given.` );\n if ( obj instanceof Descriptor ) {\n if ( obj.type === 'def' && probePropertyDescriptors ) {\n obj = typeof obj.value.get === 'function' ? obj.value.get() : obj.value.value;\n } else {\n obj = obj.value;\n }\n }\n\treturn obj && unproxy( obj );\n}\n\n// Resolves prop down to actual keys\nfunction resolveProps( obj, prop, receiver, params = {} ) {\n if ( prop === Infinity ) {\n if ( params.level && !_isTypeObject( obj ) ) return receiver( [] );\n return receiver( Object.keys( obj ) );\n }\n return receiver( _arrFrom( prop, false ) );\n}\n", "\n/**\n * Tells if val is pure object.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !Array.isArray(val) && typeof val === 'object' && val;\n};\n", "\n/**\n * Returns the val's type.\n *\n * @param string \tval\n *\n * @return string\n */\nexport default function(val) {\n\treturn typeof val;\n};\n", "\n/**\n * Tells if val is of type \"array\".\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val);\n};\n", "\n/**\n * Tells if val is of type \"function\".\n * This holds true for both regular functions and classes.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn typeof val === 'function';\n};\n", "\n/**\n * Tells if val is undefined or is null.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val === null || val === '';\n};\n", "\n/**\n * Tells if val is undefined or is of type \"undefined\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn arguments.length && (val === undefined || typeof val === 'undefined');\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"object\".\n * This holds true for anything object, including built-ins.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val) || (typeof val === 'object' && val) || _isTypeFunction(val);\n};\n", "\n/**\n * @imports\n */\nimport _isNull from './isNull.js';\nimport _isUndefined from './isUndefined.js';\nimport _isTypeObject from './isTypeObject.js';\n\n/**\n * Tells if val is empty in its own type.\n * This holds true for NULLs, UNDEFINED, FALSE, 0,\n * objects without keys, empty arrays.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNull(val) || _isUndefined(val) || val === false || val === 0 \n\t\t|| (_isTypeObject(val) && !Object.keys(val).length);\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"function\".\n *\n * @param object \t\tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isTypeFunction(val) || (val && {}.toString.call(val) === '[object function]');\n};\n", "\n/**\n * Tells if val is of type \"number\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof Number || (typeof val === 'number');\n};\n", "\n/**\n * @imports\n */\nimport _isNumber from './isNumber.js';\n/**\n * Tells if val is of type \"string\" or a numeric string.\n * This holds true for both numbers and numeric strings.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNumber(val) || (val !== true && val !== false && val !== null && val !== '' && !isNaN(val * 1));\n};\n", "\n/**\n * Tells if val is of type \"string\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof String || (typeof val === 'string' && val !== null);\n};\n", "\n/**\n * @imports\n */\nimport _isString from './isString.js';\nimport _isUndefined from './isUndefined.js';\n\n/**\n * Tells if val is \"array-like\".\n * This holds true for anything that has a length property.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !_isString(val) && !_isUndefined(val.length);\n};\n", "\n/**\n * Adds an item if not already exist.\n *\n * @param array \tarr\n * @param array\t \t...itms\n *\n * @return array\n */\nexport default function(arr, ...items) {\n\titems.forEach(itm => {\n\t\tif (arr.indexOf(itm) < 0) {\n\t\t\tarr.push(itm);\n\t\t}\n\t});\n\treturn arr;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\n\n/**\n * Returns the prototype chain.\n *\n * @param object \t\tobj\n * @param object\t \tuntil\n *\n * @return bool\n */\nexport default function(obj, until) {\n\tuntil = until || Object.prototype;\n\tuntil = until && !_isArray(until) ? [until] : until;\n\t// We get the chain of inheritance\n\tvar prototypalChain = [];\n\tvar obj = obj;\n\twhile((obj && (!until || until.indexOf(obj) < 0) && obj.name !== 'default')) {\n\t\tprototypalChain.push(obj);\n\t\tobj = obj ? Object.getPrototypeOf(obj) : null;\n\t}\n\treturn prototypalChain;\n};\n", "\n/**\n * @imports\n */\nimport _pushUnique from '../arr/pushUnique.js';\nimport _getPrototypeChain from './getPrototypeChain.js';\n\n/**\n * Eagerly retrieves object members all down the prototype chain.\n *\n * @param object\t \tobj\n * @param object\t \tuntil\n *\n * @return array\n */\nexport default function(obj, until) {\n\tvar keysAll = [];\n\t_getPrototypeChain(obj, until).forEach(obj => {\n\t\t_pushUnique(keysAll, ...Object.getOwnPropertyNames(obj));\n\t});\n\treturn keysAll;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isObject from '../js/isObject.js';\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _getAllPropertyNames from './getAllPropertyNames.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function mergeCallback(objs, callback, deepProps = false, isReplace = false, withSymbols = false) {\n\tvar depth = 0;\n\tvar obj1 = objs.shift();\n\tif (_isNumeric(obj1) || obj1 === true || obj1 === false) {\n\t\tdepth = obj1;\n\t\tobj1 = objs.shift();\n\t}\n\tif (!objs.length) {\n\t\tthrow new Error('_merge() requires two or more array/objects.');\n\t}\n\tobjs.forEach((obj2, i) => {\n\t\tif (!_isTypeObject(obj2) && !_isFunction(obj2)) {\n\t\t\treturn;\n\t\t}\n\t\t(deepProps ? _getAllPropertyNames(obj2) : Object.keys(obj2)).forEach(key => {\n\t\t\tif (!callback(key, obj1, obj2, i)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valAtObj1 = obj1[key];\n\t\t\tvar valAtObj2 = obj2[key];\n\t\t\tif (((_isArray(valAtObj1) && _isArray(valAtObj2)) || (_isObject(valAtObj1) && _isObject(valAtObj2))) \n\t\t\t&& (depth === true || depth > 0)) {\n\t\t\t\t// RECURSE...\n\t\t\t\tobj1[key] = _isArray(valAtObj1) && _isArray(valAtObj2) ? [] : {};\n\t\t\t\tmergeCallback([_isNumeric(depth) ? depth - 1 : depth, obj1[key], valAtObj1, valAtObj2], callback, deepProps, isReplace, withSymbols);\n\t\t\t} else {\n\t\t\t\tif (_isArray(obj1) && _isArray(obj2)) {\n\t\t\t\t\tif (isReplace) {\n\t\t\t\t\t\tobj1[key] = valAtObj2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobj1.push(valAtObj2);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// In case we're setting a read-only property\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (withSymbols) {\n\t\t\t\t\t\t\tObject.defineProperty(obj1, key, Object.getOwnPropertyDescriptor(obj2, key));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tobj1[key] = obj2[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\treturn obj1;\n};\n", "\n/**\n * @imports\n */\nimport _mergeCallback from './mergeCallback.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function(...objs) {\n\treturn _mergeCallback(objs, (k, obj1, obj2) => {\n\t\treturn true;\n\t}, false/*deepProps*/, false/*isReplace*/, false/*withSymbols*/);\n};\n", "export default function wq(obj, ...namespaces) {\n if (!obj || !['object', 'function'].includes(typeof obj)) {\n throw new Error(`Argument #1 must be of type object`);\n }\n let wq = obj[Symbol.for('wq')];\n if (!wq) {\n wq = new WQInternals;\n Object.defineProperty(obj, Symbol.for('wq'), {\n value: wq,\n // Defaults, but to be explicit...\n enumerable: false,\n configurable: false,\n writable: false\n });\n }\n if (!namespaces.length) {\n return wq;\n }\n let _ns, _wq;\n while ((_ns = namespaces.shift())) {\n if ((_wq = wq) && !(wq = wq.get(_ns))) {\n wq = new WQInternals;\n _wq.set(_ns, wq);\n }\n }\n return wq;\n}\n\nclass WQInternals extends Map {}", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isTypeArray from '../js/isTypeArray.js';\nimport _isEmpty from '../js/isEmpty.js';\nimport _isObject from '../js/isObject.js';\n\n/**\n * Casts an array-like object to an array.\n *\n * @param mixed \tval\n * @param bool\t \tcastObject\n *\n * @return array\n */\nexport default function(val, castObject = true) {\n\tif (_isArray(val)) {\n\t\treturn val;\n\t};\n\tif (!castObject && _isObject(val)) {\n\t\treturn [val];\n\t};\n\tif (val !== false && val !== 0 && _isEmpty(val)) {\n\t\treturn [];\n\t};\n\tif (_isTypeArray(val)) {\n\t\treturn Array.prototype.slice.call(val);\n\t};\n\tif (_isObject(val)) {\n\t\treturn Object.values(val);\n\t};\n\treturn [val];\n};\n", "\n/**\n * @imports\n */\nimport { _wq as __wq } from '@webqit/util/js/index.js';\n\nexport const _wq = ( target, ...args ) => __wq( target, 'observerAPI', ...args );\n\nexport const _await = ( value, callback ) => value instanceof Promise ? value.then( callback ) : callback( value );\n\nexport const env = {};\n", "\n/**\n * ---------------------------\n * The Registration class\n * ---------------------------\n */\n\nexport default class Registration {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param Registry\t\t\tregistry\n\t * @param object\t\t\tdfn\n\t *\n\t * @return void\n\t */\n\tconstructor( registry, dfn ) {\n\t\tthis.registry = registry;\n\t\tObject.assign( this, { ...dfn, target: registry.target } );\n\t\tif ( this.params.signal ) {\n\t\t\tthis.params.signal.addEventListener( 'abort', () => this.remove() );\n\t\t}\n\t}\n\n\t/**\n\t * Sets a \"disconnected\" flag on the Registration.\n\t *\n\t * @return void\n\t */\n\tremove() {\n\t\tthis.removed = true;\n\t\treturn this.registry.removeRegistration( this );\n\t}\n}", "\n/**\n * @imports\n */\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport Registration from './Registration.js';\nimport { _await, env } from '../util.js';\n\n/**\n * ---------------------------\n * The ListenerRegistration class\n * ---------------------------\n */\n\nexport default class ListenerRegistration extends Registration {\n\t\n\t/**\n\t * @constructor\n\t */\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.emit.currentRegistration = this;\n\t\tObject.defineProperty( this, 'abortController', { value: new AbortController } );\n\t\tObject.defineProperty( this, 'signal', { value: this.abortController.signal } );\n\t\tenv.setMaxListeners?.( 0, this.signal );\n\t}\n\n\t/**\n\t * De-registers the instance.\n\t * \n\t * @return Void\n\t */\n\tremove() {\n\t\tthis.abortController.abort();\n\t\tsuper.remove();\n\t}\n\n\t/**\n\t * Calls the observer's handler function\n\t * on matching with the event's fields.\n\t *\n\t * @param Array\t\t\t \t\tevents\n\t *\n\t * @return Any\n\t */\n\tfire( events ) {\n\t\tif ( this.emit.recursionTarget && ![ 'inject', 'force-async', 'force-sync' ].includes( this.params.recursions ) ) return;\n\t\tlet matches = events, filter = this.filter;\n\t\tif ( filter !== Infinity && ( filter = _arrFrom( filter, false ) ) ) {\n\t\t\tmatches = events.filter( event => filter.includes( event.key ) );\n\t\t}\n\t\tif ( this.params.diff ) {\n\t\t\tmatches = matches.filter( event => event.type !== 'set' || event.value !== event.oldValue );\n\t\t}\n\t\tif ( !matches.length ) return;\n\t\tif ( [ 'inject', 'defer' ].includes( this.params.recursions ) ) {\n\t\t\tif ( this.emit.recursionTarget ) {\n\t\t\t\tthis.emit.recursionTarget.push( ...matches );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.emit.recursionTarget = this.params.recursions === 'inject' ? matches : [];\n\t\t}\n\t\tconst $ret = this.filter === Infinity || Array.isArray( this.filter )\n\t\t\t? this.emit( matches, this )\n\t\t\t: this.emit( matches[ 0 ], this );\n\t\t// NOTEL: on calling emit(), this registration has expired and a new one active!!!\n\t\treturn _await( $ret, ret => {\n\t\t\tconst recursions = this.emit.recursionTarget;\n\t\t\tdelete this.emit.recursionTarget;\n\t\t\tif ( this.params.recursions === 'defer' ) {\n\t\t\t\tif ( recursions?.length ) return this.emit.currentRegistration.fire( recursions );\n\t\t\t}\n\t\t\treturn ret;\n\t\t} );\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _isTypeObject, _getType } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom, _intersect, _equals as _arrEquals } from '@webqit/util/arr/index.js';\nimport { _wq } from '../util.js';\n\n/**\n * ---------------------------\n * The Registry class\n * ---------------------------\n */\n\nexport default class Registry {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param object\ttarget\n\t * \n\t * @return void\n\t */\n\tconstructor( target ) {\n\t\tthis.target = target;\n\t\tthis.entries = [];\n\t}\n\t\n\t/**\n\t * Adds an Registration instance\n\t * with optional tags.\n\t *\n\t * @param Registration\t\tregistration\n\t *\n\t * @return Registration\n\t */\n\taddRegistration( registration ) {\n\t\tthis.entries.push( registration );\n\t\treturn registration;\n\t}\n\t\n\t/**\n\t * Removes registrations by reference.\n\t *\n\t * @param Registration\t\tregistration\n\t *\n\t * @return void\n\t */\n\tremoveRegistration( registration ) {\n\t\tthis.entries = this.entries.filter( _entry => _entry !== registration );\n\t}\n\t\t\n\t/**\n\t * Returns a observer-specific object embedded on an element.\n\t *\n\t * @param string\t\ttype\n\t * @param array|object\ttarget\n\t * @param bool \tcreateIfNotExists\n\t * @param string \tnamespace\n\t *\n\t * @return Registry\n\t */\n\tstatic _getInstance( type, target, createIfNotExists = true, namespace = this.__namespace ) {\n\t\tif ( !_isTypeObject( target ) ) throw new Error( `Subject must be of type object; \"${ _getType( target ) }\" given!` );\n\t\tlet ImplementationClass = this;\n\t\tif ( namespace && _wq( Registry, 'namespaces' ).has( type + '-' + namespace ) ) {\n\t\t\tImplementationClass = _wq( Registry, 'namespaces' ).get( type + '-' + namespace );\n\t\t\ttype += '-' + namespace\n\t\t}\n\t\tif ( !_wq( target, 'registry' ).has( type ) && createIfNotExists ) {\n\t\t\t_wq( target, 'registry' ).set( type, new ImplementationClass( target ) );\n\t\t}\n\t\treturn _wq( target, 'registry' ).get( type );\n\t}\n\n\t/**\n\t * Extend a Fireable Class with a namespace.\n\t *\n\t * @param string\t\tnamespace\n\t * @param class \tImplementationClass\n\t *\n\t * @return void|class\n\t */\n\tstatic _namespace( type, namespace, ImplementationClass = null ) {\n\t\ttype += '-' + namespace;\n\t\tif ( arguments.length === 2 ) return _wq( Registry, 'namespaces' ).get( type );\n\t\tif ( !( ImplementationClass.prototype instanceof this ) ) {\n\t\t\tthrow new Error( `The implementation of the namespace ${ this.name }.${ namespace } must be a subclass of ${ this.name }.` );\n\t\t}\n\t\t_wq( Registry, 'namespaces' ).set( type, ImplementationClass );\n\t\tImplementationClass.__namespace = namespace;\n\t}\n}", "\n/**\n * ---------------------------\n * The Descriptor class\n * ---------------------------\n */\n\nexport default class Descriptor {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param array|object\ttarget\n\t * @param object\t\tdfn\n\t *\n\t * @return void\n\t */\n\tconstructor( target, dfn ) {\n\t\tthis.target = target;\n\t\tif ( !( dfn.operation ) ) throw new Error( 'Descriptor operation must be given in definition!' );\n\t\tObject.assign( this, dfn );\n\t}\n}", "\n/**\n * @imports\n */\nimport ListenerRegistration from './ListenerRegistration.js';\nimport Registry from './Registry.js';\nimport { _await } from '../util.js';\nimport Descriptor from './Descriptor.js';\n\n/**\n * ---------------------------\n * The ListenerRegistry class\n * ---------------------------\n */\n\nexport default class ListenerRegistry extends Registry {\n\n\tstatic getInstance( target, createIfNotExists = true, namespace = null ) {\n\t\treturn super._getInstance( 'listeners', ...arguments );\n\t}\n\n\tstatic namespace( namespace, ImplementationClass = null ) {\n\t\treturn super._namespace( 'listeners', ...arguments );\n\t}\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( target ) {\n\t\tsuper( target );\n\t\tthis.batches = [];\n\t}\n\t\n\t/**\n\t * @addRegistration\n\t */\n\taddRegistration( filter, emit, params ) {\n\t\treturn super.addRegistration( new ListenerRegistration( this, { filter, emit, params } ) );\n\t}\n\t\n\t/**\n\t * Fires all observers with the given evt (change).\n\t *\n\t * @param Arrayn events\n\t *\n\t * @return Void\n\t */\n\temit( events, { eventsArePropertyDescriptors = false, eventIsArrayMethodDescriptor = false } = {} ) {\n\t\tif ( this.batches.length ) {\n\t\t\tconst arrayMethodName = this.batches[ 0 ].params.arrayMethodName;\n\t\t\tthis.batches[ 0 ].snapshots.push( {\n\t\t\t\tevents: [ ...events ],\n\t\t\t\tarrayMethodName, // Typically from array operations\n\t\t\t\teventsArePropertyDescriptors, // Typically from defineProperty() operations\n\t\t\t\teventIsArrayMethodDescriptor // Typically from array method operations\n\t\t\t} );\n\t\t\treturn\n\t\t}\n\t\tthis.$emit( this.entries, [ {\n\t\t\tevents, \n\t\t\teventsArePropertyDescriptors, // Typically from defineProperty() operations\n\t\t\teventIsArrayMethodDescriptor // Typically from array method operations\n\t\t} ] );\n\t}\n\n\t$emit( listeners, snapshots ) {\n\t\t// Analyse listener modes\n\t\tlet listenersLength = 0,\n\t\tlistenersAskingEventsWithPropertyDescriptors = 0,\n\t\tlistenersAskingArrayMethodDescriptors = 0;\n\t\tfor ( const listener of listeners ) {\n\t\t\tlistenersLength += 1;\n\t\t\tif ( listener.params.withPropertyDescriptors ) {\n\t\t\t\tlistenersAskingEventsWithPropertyDescriptors += 1;\n\t\t\t}\n\t\t\tif ( listener.params.withArrayMethodDescriptors ) {\n\t\t\t\tlistenersAskingArrayMethodDescriptors += 1;\n\t\t\t}\n\t\t}\n\t\t// Sort events\n\t\tconst events_with_PropertyDescriptors_with_ArrayMethodDescriptors = [], events_with_PropertyDescriptors_without_ArrayMethodDescriptors = [];\n\t\tconst events_without_PropertyDescriptors_with_ArrayMethodDescriptors = [], events_without_PropertyDescriptors_without_ArrayMethodDescriptors = [];\n\t\tfor ( const snapshot of snapshots ) {\n\t\t\tconst arrayMethodName = snapshot.arrayMethodName;\n\t\t\tconst eventsArePropertyDescriptors = snapshot.eventsArePropertyDescriptors;\n\t\t\tconst eventIsArrayMethodDescriptor = snapshot.eventIsArrayMethodDescriptor;\n\t\t\tfor ( const event of snapshot.events ) {\n\t\t\t\tif ( arrayMethodName ) {\n\t\t\t\t\tevent.operation = arrayMethodName;\n\t\t\t\t}\n\t\t\t\t// Some opting in to PropertyDescriptors\n\t\t\t\tif ( listenersAskingEventsWithPropertyDescriptors ) {\n\t\t\t\t\t//if ( !arrayMethodName ) { }\n\t\t\t\t\tlistenersAskingArrayMethodDescriptors && // Some opting in to ArrayMethodDescriptors\n\t\t\t\t\tevents_with_PropertyDescriptors_with_ArrayMethodDescriptors.push( event );\n\t\t\t\t\tif ( !eventIsArrayMethodDescriptor ) {\n\t\t\t\t\t\tlistenersAskingArrayMethodDescriptors !== listenersLength && // Some opting out of ArrayMethodDescriptors\n\t\t\t\t\t\tevents_with_PropertyDescriptors_without_ArrayMethodDescriptors.push( event );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Some opting out of PropertyDescriptors\n\t\t\t\tif ( listenersAskingEventsWithPropertyDescriptors !== listenersLength ) {\n\t\t\t\t\tlet $event = event;\n\t\t\t\t\tif ( eventsArePropertyDescriptors ) {\n\t\t\t\t\t\tconst { target, type, ...details } = event;\n\t\t\t\t\t\t$event = new Descriptor( target, { type: 'set', ...details } );\n\t\t\t\t\t\tObject.defineProperty( $event, 'value', 'get' in details.value ? { get: () => details.value.get() } : { value: details.value.value } )\n\t\t\t\t\t\tif ( details.oldValue ) {\n\t\t\t\t\t\t\tObject.defineProperty( $event, 'oldValue', 'get' in details.oldValue ? { get: () => details.oldValue.get() } : { value: details.oldValue.value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if ( !arrayMethodName/*Although eedless as is typically mutually exclusive to eventsArePropertyDescriptors*/ ) { }\n\t\t\t\t\tlistenersAskingArrayMethodDescriptors && // Some opting in to ArrayMethodDescriptors\n\t\t\t\t\tevents_without_PropertyDescriptors_with_ArrayMethodDescriptors.push( $event );\n\t\t\t\t\tif ( !eventIsArrayMethodDescriptor ) { // Although eedless as is typically already implied by eventsArePropertyDescriptors\n\t\t\t\t\t\tlistenersAskingArrayMethodDescriptors !== listenersLength && // Some opting out of ArrayMethodDescriptors\n\t\t\t\t\t\tevents_without_PropertyDescriptors_without_ArrayMethodDescriptors.push( $event );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Dispatch\n\t\tfor ( const listener of listeners ) {\n\t\t\tif ( listener.params.withPropertyDescriptors ) {\n\t\t\t\tif ( listener.params.withArrayMethodDescriptors ) {\n\t\t\t\t\tevents_with_PropertyDescriptors_with_ArrayMethodDescriptors.length &&\n\t\t\t\t\tlistener.fire( events_with_PropertyDescriptors_with_ArrayMethodDescriptors );\n\t\t\t\t} else {\n\t\t\t\t\tevents_with_PropertyDescriptors_without_ArrayMethodDescriptors.length &&\n\t\t\t\t\tlistener.fire( events_with_PropertyDescriptors_without_ArrayMethodDescriptors );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( listener.params.withArrayMethodDescriptors ) {\n\t\t\t\t\tevents_without_PropertyDescriptors_with_ArrayMethodDescriptors.length &&\n\t\t\t\t\tlistener.fire( events_without_PropertyDescriptors_with_ArrayMethodDescriptors );\n\t\t\t\t} else {\n\t\t\t\t\tevents_without_PropertyDescriptors_without_ArrayMethodDescriptors.length &&\n\t\t\t\t\tlistener.fire( events_without_PropertyDescriptors_without_ArrayMethodDescriptors );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Fires all observers with the given evt (change).\n\t *\n\t * @param Arrayn events\n\t *\n\t * @return Void\n\t */\n\tbatch( callback, params = {} ) {\n\t\tthis.batches.unshift( { entries: [ ...this.entries ], snapshots: [], params } );\n\t\tconst returnValue = callback();\n\t\treturn _await( returnValue, returnValue => {\n\t\t\tconst batch = this.batches.shift();\n\t\t\tif ( !batch.snapshots.length ) return returnValue;\n\t\t\tthis.$emit( batch.entries, batch.snapshots );\n\t\t\treturn returnValue;\n\t\t} );\n\t}\n\n}\n", "\n/**\n * @imports\n */\nimport Registration from './Registration.js';\n\n/**\n * ---------------------------\n * The TrapsRegistration class\n * ---------------------------\n */\n\nexport default class TrapsRegistration extends Registration {\n\t\n\t/**\n\t * Calls the observer's handler function\n\t * on matching with the descriptor's fields.\n\t *\n\t * @param Descriptor\t\t\t \tdescriptor\n\t * @param function\t\t\t\t\tnext\n\t * @param mixed\t\t\t\t\t \trecieved\n\t *\n\t * @return void\n\t */\n\texec( descriptor, next, recieved ) {\n\t\tif ( this.running || !this.traps[ descriptor.operation ] ) {\n\t\t\treturn next( ...Array.prototype.slice.call( arguments, 2 ) );\n\t\t}\n\t\tthis.running = true;\n\t\treturn this.traps[ descriptor.operation ]( descriptor, recieved, ( ...args ) => {\n\t\t\tthis.running = false;\n\t\t\treturn next( ...args );\n\t\t} );\n\t}\n}", "\n/**\n * @imports\n */\nimport TrapsRegistration from './TrapsRegistration.js';\nimport Registry from './Registry.js';\n\n/**\n * ---------------------------\n * The TrapsRegistry class\n * ---------------------------\n */\n\nexport default class TrapsRegistry extends Registry {\n\n\tstatic getInstance( target, createIfNotExists = true, namespace = null ) {\n\t\treturn super._getInstance( 'traps', ...arguments );\n\t}\n\n\tstatic namespace( namespace, ImplementationClass = null ) {\n\t\treturn super._namespace( 'traps', ...arguments );\n\t}\n\t\n\t/**\n\t * @inheritdoc\n\t */\n\taddRegistration( dfn ) {\n\t\treturn super.addRegistration( new TrapsRegistration( this, dfn ) );\n\t}\n\n\t/**\n\t * Fires all interceptors with the given action.\n\t *\n\t * @param Descriptor\t\tdescriptor\n\t * @param function\t\t\tdefaultHandler\n\t *\n\t * @return mixed\n\t */\n\temit( descriptor, defaultHandler = null ) {\n\t\tconst $this = this;\n\t\treturn ( function next( index, ..._args ) {\n\t\t\tconst registration = $this.entries[ index ];\n\t\t\tif ( registration ) {\n\t\t\t\treturn registration.exec( descriptor, ( ...args ) => {\n\t\t\t\t\treturn next( index + 1, ...args );\n\t\t\t\t}/*next*/, ..._args );\n\t\t\t}\n\t\t\treturn defaultHandler ? defaultHandler( descriptor, ..._args ) : _args[ 0 ];\n\t\t} )( 0 );\n\t}\n}", "\n/**\n * @imports\n */\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport { _isClass, _isFunction, _isTypeObject, _getType } from '@webqit/util/js/index.js';\nimport { set, deleteProperty, has, get, ownKeys, defineProperty, getOwnPropertyDescriptor } from \"./main.js\";\nimport { apply, construct, getPrototypeOf, setPrototypeOf, isExtensible, preventExtensions } from \"./main.js\";\nimport { _wq } from './util.js';\n\n/* ---------------ACCESSORIZE METHODS--------------- */\n\n/**\n * Accessorizes props.\n *\n * @param Array|Object\ttarget\n * @param String|Array\tprops\n * @param Object\t\tparams\n *\n * @return Array\n */\nconst symWQOriginal = Symbol('wqOriginal');\nexport function accessorize( target, props, params = {} ) {\n target = resolveTarget( target );\n const accessorizedProps = _wq( target, 'accessorizedProps' );\n // ---------\n function getDescriptorDeep( prop ) {\n let descriptor, proto = target;\n do {\n descriptor = Object.getOwnPropertyDescriptor( proto, prop );\n } while ( !descriptor && ( proto = Object.getPrototypeOf( proto ) ) );\n return descriptor \n ? { proto, descriptor } \n : { descriptor: { value: undefined, configurable: true, enumerable: true, writable: true } };\n }\n // ---------\n function accessorizeProp( prop ) {\n if ( accessorizedProps.has( prop + '' ) ) return true;\n // ------------------\n // Current Descriptor Record\n const currentDescriptorRecord = getDescriptorDeep( prop );\n currentDescriptorRecord.getValue = function( withPropertyDescriptors = false ) {\n if ( withPropertyDescriptors ) return this.descriptor;\n return this.descriptor.get ? this.descriptor.get() : this.descriptor.value;\n };\n currentDescriptorRecord.setValue = function( value, withPropertyDescriptors = false ) {\n this.dirty = true;\n if ( withPropertyDescriptors ) { this.descriptor = value; return; }\n return this.descriptor.set ? this.descriptor.set( value ) !== false : ( this.descriptor.value = value, true );\n };\n currentDescriptorRecord.intact = function() {\n const currentDescriptor = Object.getOwnPropertyDescriptor( target, prop );\n return currentDescriptor?.get === accessorization.get \n && currentDescriptor?.set === accessorization.set\n && accessorizedProps.get( prop + '' ) === this;\n };\n currentDescriptorRecord.restore = function() {\n if ( !this.intact() ) return false;\n if ( ( this.proto && this.proto !== target ) || ( !this.proto && !this.dirty ) ) { delete target[ prop ]; }\n else { Object.defineProperty( target, prop, this.descriptor ); }\n accessorizedProps.delete( prop + '' );\n return true;\n };\n accessorizedProps.set( !isNaN( prop ) ? parseInt( prop ) : prop, currentDescriptorRecord );\n // ------------------\n // enumerable, configurable\n const { enumerable = true } = currentDescriptorRecord.descriptor;\n const accessorization = { enumerable, configurable: true };\n // set, get\n if ( ( 'value' in currentDescriptorRecord.descriptor ) || currentDescriptorRecord.descriptor.set ) {\n accessorization.set = function ( value ) { return set( this, prop, value, params ); };\n }\n if ( ( 'value' in currentDescriptorRecord.descriptor ) || currentDescriptorRecord.descriptor.get ) {\n accessorization.get = function () { return get( this, prop, params ); };\n }\n try {\n Object.defineProperty( target, prop, accessorization );\n return true;\n } catch( e ) {\n accessorizedProps.delete( prop + '' );\n return false;\n }\n }\n const _props = Array.isArray( props ) ? props : (\n props === undefined ? Object.keys( target ) : [ props ]\n );\n const statuses = _props.map( accessorizeProp );\n return props === undefined || Array.isArray( props ) \n ? statuses \n : statuses[ 0 ];\n}\n\n/**\n * Unaccessorizes previously accessorized props.\n *\n * @param Array|Object\ttarget\n * @param String|Array\tprops\n * @param Object\t\tparams\n *\n * @return Array\n */\nexport function unaccessorize( target, props, params = {} ) {\n target = resolveTarget( target );\n const accessorizedProps = _wq( target, 'accessorizedProps' );\n function unaccessorizeProp( prop ) {\n if ( !accessorizedProps.has( prop + '' ) ) return true;\n return accessorizedProps.get( prop + '' ).restore();\n }\n const _props = Array.isArray( props ) ? props : (\n props === undefined ? Object.keys( target ) : [ props ]\n );\n const statuses = _props.map( unaccessorizeProp );\n return props === undefined || Array.isArray( props ) \n ? statuses \n : statuses[ 0 ];\n}\n\n/* ---------------PROXY METHODS--------------- */\n\n/**\n * Returns an object as a proxy and binds all instance methods\n * to the proxy instead of the object itself.\n *\n * @param Array|Object\t\ttarget\n * @param Object\t\t params\n * @param Function\t\t extendCallback\n *\n * @return Proxy\n */\nexport function proxy( target, params = {}, extendCallback = undefined ) {\n // Resolve target\n const originalTarget = resolveTarget( target );\n // Return same proxy instance?\n if ( typeof params.membrane === 'boolean' ) throw new Error( `The params.membrane parameter cannot be of type boolean.` );\n if ( params.membrane && _wq( originalTarget, 'membraneRef' ).has( params.membrane ) ) { return _wq( originalTarget, 'membraneRef' ).get( params.membrane ); }\n const traps = {\n apply: ( target, thisArgument, argumentsList ) => apply( target, thisArgument, argumentsList, undefined, params ),\n construct: ( target, argumentsList, newTarget = null ) => construct( target, argumentsList, newTarget, params ),\n defineProperty: ( target, propertyKey, attributes ) => defineProperty( target, propertyKey, attributes, params ),\n deleteProperty: ( target, propertyKey ) => deleteProperty( target, propertyKey, params ),\n get: ( target, propertyKey, receiver = null ) => {\n if ( propertyKey === symWQOriginal ) {\n return originalTarget;\n }\n const $params = { ...params, receiver };\n const returnValue = get( target, propertyKey, $params );\n if ( Array.isArray( target ) && typeof returnValue === 'function' ) {\n // Return a proxy, but in terms of a membrane. \n return proxy( returnValue, { ...params, arrayMethodName: propertyKey, membrane: receiver/* the instance obj that will be the thisArgument at apply(). Much like function.bind() */ } );\n }\n return returnValue;\n },\n getOwnPropertyDescriptor: ( target, propertyKey ) => getOwnPropertyDescriptor( target, propertyKey, params ),\n getPrototypeOf: target => getPrototypeOf( target, params ),\n has: ( target, propertyKey ) => has( target, propertyKey, params ),\n isExtensible: target => isExtensible( target, params ),\n ownKeys: target => ownKeys( target, params ),\n preventExtensions: target => preventExtensions( target, params ),\n set: ( target, propertyKey, value, receiver = null ) => set( target, propertyKey, value, { ...params, receiver } ),\n setPrototypeOf: ( target, prototype ) => setPrototypeOf( target, prototype, params ),\n };\n // Extend...\n const $traps = extendCallback?.( traps ) || traps;\n // Create proxy\n const $proxy = new Proxy( originalTarget, $traps );\n if ( params.membrane ) { _wq( originalTarget, 'membraneRef' ).set( params.membrane, $proxy ); }\n\treturn $proxy;\n}\n\n/**\n * Returns the original object earlier proxied by proxy().\n *\n * @param Proxy|Any\t\ttarget\n *\n * @return Any\n */\nexport function unproxy( target ) {\n // Proxy targets are mapped to their own instances internally\n return target && target[ symWQOriginal ] || target;\n}\n\n/* ---------------HELPERS--------------- */\n\n/** \n * Ensures target object is an object or array.\n *\n * @param Array|Object\ttarget\n *\n * @return Array|Object\n */\nfunction resolveTarget( target ) {\n\tif ( !target || !_isTypeObject( target ) ) throw new Error('Target must be of type object!');\n\treturn unproxy( target );\n}\n", "\n/**\n * @imports\n */\nimport * as main from './main.js';\nimport * as actors from './actors.js';\n\nconst Observer = { ...main, ...actors };\n\nexport default Observer;", "\nexport const _call = ( _function, ...args ) => {\n const callback = args.pop();\n if ( _function.constructor.name === 'AsyncFunction' ) return _await( _function.call( ...args ), callback );\n try {\n return callback( _function.call( ...args ) );\n } catch( e ) { return callback( undefined, e ); }\n};\n\nexport const _await = ( maybePromise, callback ) => {\n return maybePromise instanceof Promise ? maybePromise.then( callback ).catch( e => callback( undefined, e ) ) : callback( maybePromise )\n};\n\nexport const _isTypeObject = val => {\n\treturn ( typeof val === 'object' && val ) || typeof val === 'function';\n};\n\nexport function _$functionArgs( args ) {\n const params = typeof args[ args.length - 1 ] === 'object' ? args.pop() : {};\n const source = args.pop() || '';\n params.functionParams = args;\n return { source, params };\n}\n\nexport const env = {};\n", "\n/**\n * @exports\n */\nexport function resolveParams( ...extensions ) {\n let extension, params = { runtimeParams, compilerParams, parserParams };\n while( extension = extensions.shift() ) {\n const {\n runtimeParams: _runtimeParams = {},\n compilerParams: { globalsNoObserve: _globalsNoObserve = [], globalsOnlyPathsExcept: _globalsOnlyPathsExcept = [], ..._compilerParams } = {},\n parserParams: _parserParams = {},\n } = extension;\n params = {\n runtimeParams: { ...params.runtimeParams, ..._runtimeParams },\n compilerParams: { ...params.compilerParams, globalsNoObserve: [ ...params.compilerParams.globalsNoObserve, ..._globalsNoObserve ], globalsOnlyPathsExcept: [ ...params.compilerParams.globalsOnlyPathsExcept, ..._globalsOnlyPathsExcept ], ..._compilerParams },\n parserParams: { ...params.parserParams, ..._parserParams },\n };\n if ( extensions.devMode ) { /* shortcut for devMode configs */ }\n }\n return params;\n}\nexport const parserParams = {\n ecmaVersion: 'latest',\n allowReturnOutsideFunction: true,\n allowAwaitOutsideFunction: false,\n allowSuperOutsideMethod: false,\n preserveParens: false,\n locations: true,\n};\nexport const compilerParams = {\n globalsNoObserve: [ 'arguments', 'debugger', ],\n globalsOnlyPathsExcept: [],\n originalSource: true,\n locations: true,\n compact: 2,\n};\nexport const runtimeParams = {\n apiVersion: 3,\n};\n", "\n/**\n * The modules registry\n */\nexport const registry = Object.create( null );", "/**\n * @imports\n */\nimport { env } from \"../util.js\";\n\nexport default class _EventTarget extends EventTarget {\n\n managedAlways = new Set;\n managedOnce = new Set;\n\n constructor() {\n super();\n env.setMaxListeners?.( 0, this );\n }\n\n fire( evenName ) { return this.dispatchEvent( new Event( evenName, { cancelable: true } ) ); }\n\n on( ...args ) {\n this.addEventListener( ...args );\n return () => this.removeEventListener( ...args );\n }\n\n abort( total = false ) {\n this.managedAlways.forEach( x => x.abort ? x.abort( total ) : x( total ) );\n this.managedOnce.forEach( x => x.abort ? x.abort( total ) : x( total ) );\n this.managedOnce.clear();\n this.fire( 'abort' );\n }\n\n manage( x ) { this.managedAlways.add( x ); }\n once( x ) { this.managedOnce.add( x ); }\n\n}", "\n/**\n * @import\n */\nimport Observer from '@webqit/observer';\nimport { _isTypeObject } from '../util.js';\nimport EventTarget from './EventTarget.js';\n\nexport default class Signal extends EventTarget {\n\n subscribers = new Set;\n signals = new Map;\n\n constructor( context, type, state ) {\n super();\n this.context = context;\n this.context?.once( () => this.abort() );\n this.once( () => this.watchMode( false ) );\n this.type = type;\n this.state = state;\n }\n\n get name() { return [ ...this.context?.signals.keys() || [] ].find( k => this.context.signals.get( k ) === this ); }\n \n signal( name, type = 'prop' ) {\n let signal = this.signals.get( name );\n if ( !signal ) {\n // Initialization\n signal = new Signal(\n this,\n type,\n type === 'object' ? name : ( _isTypeObject( this.state ) ? Observer.get( this.state, name ) : undefined )\n );\n this.signals.set( name, signal );\n // Self-start\n if ( this.signals.size === 1 ) { this.watchMode(); }\n // Cleanup\n signal.once( () => {\n // On being killed, auto-delete\n this.signals.delete( name );\n // On empty self-kill\n if ( !this.signals.size ) { this.watchMode( false ); }\n } );\n }\n return signal;\n }\n\n subscribe( autorun ) {\n this.subscribers.add( autorun );\n autorun.once( () => {\n // Cleanup\n this.subscribers.delete( autorun );\n // On empty self-kill\n if ( !this.subscribers.size ) { this.abort(); }\n } );\n }\n\n watchMode( flag = true ) {\n this.mutationsWatch?.abort();\n if ( !flag || !this.signals.size || !_isTypeObject( this.state ) ) return;\n this.mutationsWatch = Observer.observe( this.state, mutations => {\n // Find subscribers and organize them by target runtime\n const groupings = { map: new Map, add( autoruns, mutation ) {\n for ( const autorun of autoruns ) {\n if ( autorun.spec.beforeSchedule?.( mutation ) === false ) continue;\n if ( !this.map.has( autorun.runtime ) ) { this.map.set( autorun.runtime, new Set ); }\n this.map.get( autorun.runtime ).add( autorun );\n }\n } };\n for ( const mutation of mutations ) {\n const signal = this.signals.get( mutation.key );\n if ( !signal ) continue;\n groupings.add( signal.subscribers, mutation );\n signal.refresh( mutation.value );\n }\n // Dispatch to runtimes...\n const runtimesMap = !groupings.map.size ? groupings.map : [ ...groupings.map ].sort( ( a, b ) => a.$serial > b.$serial ? -1 : 1 );\n //const runtimesMap = groupings.map;\n for ( const [ runtime, autoruns ] of runtimesMap ) {\n if ( runtime.state === 'aborted' ) continue;\n runtime.schedule( ...autoruns );\n }\n }, { recursions: 'force-sync' } );\n }\n\n refresh( newState ) {\n this.state = newState;\n for ( const [ name, signal ] of this.signals ) {\n signal.refresh( Observer.get( this.state ?? {}, name ) );\n }\n this.watchMode();\n }\n\n}", "\n/**\n * @import\n */\nimport Signal from './Signal.js';\n\nexport default class Scope extends Signal {\n\n symbols = new Map;\n constructor( context, type, state = undefined ) {\n super( context, type, state || Object.create( null ) );\n }\n\n}", "\n/**\n * @import\n */\nimport Observer from '@webqit/observer';\nimport { _await, _call } from '../util.js';\nimport EventTarget from './EventTarget.js';\nimport Scope from './Scope.js';\n\nexport default class Autorun extends EventTarget {\n\n state;\n\n constructor( context, type, spec, serial, scope, closure ) {\n super();\n // We are to be managed by context\n context?.once( this );\n this.context = context;\n this.type = type;\n this.spec = spec || {};\n this.scope = scope;\n if ( context?.scope !== scope ) {\n // It's own scope, so we manage it\n this.manage( scope );\n }\n this.serial = serial;\n if ( closure ) { this.closure = closure; }\n if ( context?.type === 'iteration' ) { this.path = context.path.concat( this.spec.index ); }\n else if ( context?.type === 'round' ) { this.path = context.path.concat( this.serial ); }\n else { this.path = ( context?.path || [] ).slice( 0, -1 ).concat( this.serial ); }\n this.flowControl = new Map;\n }\n\n get runtime() { return this.context.runtime; }\n\n contains( node ) { return this === node.context || ( node.context && this.contains( node.context ) ); }\n\n order( node ) {\n if ( !node ) return this;\n const [ a, b ] = node.path.length < this.path.length ? [ node, this ] : [ this, node ];\n return a.path.reduce( ( prev, key, i ) => {\n return prev && key <= b.path[ i ];\n }, true ) && a || b;\n }\n\n beforeExecute() {\n this.state = 'running';\n // Get record and reset\n const flowControlBefore = this.flowControl;\n this.flowControl = new Map;\n return flowControlBefore;\n }\n\n execute( callback = null ) {\n this.runtime.thread.unshift( this );\n return _await( this.beforeExecute(), stateBefore => {\n return _call( this.closure, this, this, ( returnValue, exception ) => {\n if ( exception ) return this.throw( exception, [ this.serial, this.context?.serial ], exception.code );\n if ( this.spec.complete ) { returnValue = this.spec.complete( returnValue, this ); }\n this.afterExecute( stateBefore );\n this.runtime.thread.shift();\n return callback ? callback( returnValue, this ) : returnValue;\n } );\n } );\n }\n\n throw( e, serials, errorCode ) {\n if ( this.type === 'function' && [ 'HandlerFunction', 'FinalizerFunction' ].includes( this.$params.executionMode ) ) {\n // Hoist control further above the context that handed it to us\n return this.$params.lexicalContext.throw( e, serials, errorCode );\n } else if ( this.spec.handler ) return this.spec.handler( e );\n else if ( this.type !== 'function' && this.context ) return this.context.throw( e, serials, errorCode );\n if ( e.cause ) throw e;\n // Message\n const message = `${ e.message || e }`;\n const $message = errorCode !== null ? `[${ errorCode }]: ${ message }` : message;\n // Cause\n const cause = serials.map( serial => serial !== -1 && this.extractSource( serial, true ) ).filter( x => x );\n cause.push( { source: this.runtime.$params.originalSource } );\n // Type\n const ErrorClass = globalThis[ e.name ];\n const error = new ( ErrorClass || Error )( $message, { cause } );\n // File\n const fileName = this.runtime.$params.sourceType === 'module' && this.$params.experimentalFeatures !== false && this.$params.exportNamespace || this.$params.fileName;\n if ( fileName ) { error.fileName = fileName; }\n if ( errorCode ) { error.code = errorCode; }\n throw error;\n }\n\n afterExecute( flowControlBefore ) {\n this.state = 'complete';\n // Compare records... and hoist differences\n const flowControlAfter = this.flowControl;\n if ( this.spec.finalizer ) this.spec.finalizer();\n // Handle downstream\n this.handleDownstream( flowControlAfter.size, flowControlBefore.size );\n this.handleRightstream( flowControlAfter.size, flowControlBefore.size );\n for ( const cmd of [ 'break', 'continue', 'return' ] ) {\n if ( flowControlAfter.has( cmd ) && !flowControlAfter.get( cmd ).endpoint ) { this.hoistFlowControl( cmd, flowControlAfter.get( cmd ).arg ); }\n else if ( flowControlBefore.has( cmd ) && !flowControlBefore.get( cmd ).endpoint ) { this.hoistFlowControl( cmd, flowControlBefore.get( cmd ).arg, true ); }\n }\n }\n\n typed( as, value, name = undefined ) {\n const valueType = Array.isArray( value ) ? 'array' : ( value === null ? 'null' : typeof value );\n if ( valueType === as || ( as === 'iterable' && value?.[ Symbol.iterator ] ) || ( as === 'desctructurable' && ![ 'undefined', 'null' ].includes( valueType ) ) ) return value;\n if ( as === 'iterable' ) { throw new Error( `value is not iterable.` ); }\n if ( as === 'desctructurable' ) { throw new Error( ( name ? `Cannot access ${ name }; ` : '' ) + `object not desctructurable.` ); }\n throw new Error( `value must be of type ${ as }.` );\n }\n\n let( name, serial, closure, spec = {} ) { return this.var( name, serial, closure, { ...spec, kind: 'let' } ); }\n\n const( name, serial, closure, spec = {} ) { return this.var( name, serial, closure, { ...spec, kind: 'const' } ); }\n\n var( name, serial, closure, spec = {} ) {\n spec = { kind: 'var'/* as default */, ...spec };\n // Uninitialized declarations like: let a;\n if ( !closure ) closure = () => undefined;\n const $closure = !spec.restOf ? closure : ( ...args ) => {\n try { return closure( ...args ); }\n catch( e ) { throw new Error( `Cannot declare ${ name }; ${ e.message }` ); }\n };\n const complete = ( returnValue, autorun ) => {\n let scope = autorun.scope;\n if ( spec.kind === 'var' ) {\n //let scope = this.runtime.scope;\n // For plain scripts, hoist all the way to the global scope... or somewhere before where its been defined\n while ( ![ 'module', 'function' ].includes( scope.type ) && !Observer.has( scope.state, name ) && scope.context ) {\n scope = scope.context;\n }\n } else if ( scope.type === 'this' && scope.context ) {\n // We're in a script or module program. scope.context is either going to be 'env' or 'module'\n scope = scope.context;\n }\n let symbolState = scope.symbols.get( name );\n if ( symbolState && ( symbolState.kind !== spec.kind || ( spec.kind === 'let' && symbolState.serial !== serial ) ) ) {\n throw new Error( `Identifier \"${ name }\" has already been declared.` );\n }\n symbolState?.reader?.abort(); // Any previous reader? Type \"var\" cannot rely on autorun lifecycle cleanup\n symbolState = { serial, kind: spec.kind }; // New state!\n let assignedValue = returnValue;\n if ( spec.restOf ) {\n if ( spec.type === 'array' ) {\n assignedValue = [];\n } else { assignedValue = {}; }\n symbolState.reader = Observer.map( returnValue, assignedValue, { except: spec.restOf, spread: spec.type === 'array' } );\n autorun.once( symbolState.reader ); // Lifecycle cleanup\n }\n scope.symbols.set( name, symbolState );\n Observer.set( scope.state, name, assignedValue );\n return assignedValue;\n };\n return this.autorun( spec.kind, { complete, ...spec }, serial, $closure );\n }\n\n update( name, closure, spec = {} ) {\n // Find lexical scope\n let lexicalScope = this.scope;\n while( lexicalScope && !Observer.has( lexicalScope.state, name ) ) { lexicalScope = lexicalScope.context; }\n // Validation\n if ( !lexicalScope ) { throw new ReferenceError( `${ name } is not defined.` ); }\n let symbolState = lexicalScope.symbols.get( name );\n if ( symbolState?.kind === 'const' ) { throw new ReferenceError( `Assignment to constant variable \"${ name }\".` ); }\n const valueBefore = Observer.get( lexicalScope.state, name );\n const $closure = !spec.restOf ? closure : ( ...args ) => {\n try { return closure( ...args ); }\n catch( e ) { throw new Error( `Cannot update ${ name }; ${ e.message }` ); }\n };\n return _call( $closure, undefined, valueBefore, ( returnValue, exception ) => {\n if ( exception ) return this.throw( exception, [ this.serial ] );\n // Operation\n symbolState?.reader?.abort(); // Any previous reader?\n let assignedValue = returnValue;\n if ( spec.restOf ) {\n symbolState = symbolState || {}; // New state!\n if ( spec.type === 'array' ) {\n assignedValue = [];\n } else { assignedValue = {}; }\n symbolState.reader = Observer.map( returnValue, assignedValue, { except: spec.restOf, spread: spec.type === 'array' } );\n this.once( symbolState.reader ); // Lifecycle cleanup\n }\n Observer.set( lexicalScope.state, name, assignedValue );\n return [ 'postinc', 'postdec' ].includes( spec.kind ) ? valueBefore : assignedValue;\n } );\n }\n\n ref( name, ...rest ) {\n let depth = 0, hint = {};\n if ( typeof rest[ 0 ] === 'number' ) {\n depth = rest.shift();\n hint = rest.shift() || {};\n } else if ( typeof rest[ 0 ] === 'object' ) {\n hint = rest.shift();\n }\n // Find lexical scope\n let lexicalScope = this.scope;\n while( lexicalScope && !Observer.has( lexicalScope.state, name ) ) {\n lexicalScope = lexicalScope.context;\n }\n // Not found?\n if ( !lexicalScope ) {\n if ( hint.isTypeCheck ) return;\n throw new Error( `${ name } is not defined.` );\n }\n // Bind now?\n const kind = lexicalScope.symbols.get( name )?.kind;\n const baseSignal = lexicalScope.signal( name, kind );\n if ( hint.typed ) { this.typed( hint.typed, baseSignal.state, name ); }\n return this.autobind( baseSignal, depth, hint );\n }\n\n obj( val, ...rest ) {\n let depth = 0, hint = {};\n if ( typeof rest[ 0 ] === 'number' ) {\n depth = rest.shift();\n hint = rest.shift() || {};\n } else if ( typeof rest[ 0 ] === 'object' ) {\n hint = rest.shift();\n }\n return this.autobind( this.runtime.$objects.signal( val, 'object' ), depth, hint );\n }\n\n autobind( baseSignal, depth, hint ) {\n const quantumMode = [ 'QuantumProgram', 'QuantumFunction' ].includes( this.runtime.$params.executionMode );\n const isConst = baseSignal.type === 'const';\n const isRuntime = this === this.runtime;\n const isAborted = this.state === 'aborted';\n const isStatic = this.spec.static;\n const nowRunning = this;\n return ( function proxy( signal, depth ) {\n // Do bindings first\n if ( quantumMode && !isStatic && !isConst && !isRuntime && !isAborted ) {\n signal.subscribe( nowRunning );\n }\n // Return bare value here?\n if ( !depth || !signal.state || typeof signal.state !== 'object' ) {\n let returnValue = signal.state;\n if ( typeof signal.state === 'function' && !/^class\\s?/.test(Function.prototype.toString.call(signal.state)) ) {\n // We're returning a proxy for functions instead of: signal.context.state[ signal.name ].bind( signal.context.state );\n returnValue = Observer.proxy( signal.state, { membrane: signal } );\n }\n return returnValue;\n }\n // Return dynamic value\n let propertyAlreadyBound;\n return Observer.proxy( signal.state, {}, traps => ( {\n ...traps,\n get( target, name, receiver = null ) {\n // Constructs are always going to for one property access: ref('a').b, and we need to prevent .c from creating a binding\n if ( propertyAlreadyBound ) { return traps.get( target, name, receiver ); }\n propertyAlreadyBound = true;\n return proxy( signal.signal( name ), depth - 1 );\n },\n } ) );\n } )( baseSignal, depth );\n }\n\n autorun( type, ...rest ) {\n let closure = rest.pop();\n const serial = rest.pop();\n const spec = rest.pop() || {};\n // Handle certain types with their own class\n let AutorunClass = Autorun, scope = this.scope;\n if ( type === 'iteration' ) {\n const staticDefs = this.runtime.constructor;\n AutorunClass = closure.constructor.name === 'AsyncFunction' ? staticDefs.AutoAsyncIterator : staticDefs.AutoIterator;\n }\n if ( [ 'block', 'switch', 'iteration' ].includes( type ) ) { scope = new Scope( scope, type ); }\n // Instantiate\n const autorun = new AutorunClass( this, type, spec, serial, scope, closure );\n if ( type === 'downstream' ) {\n // Declare a \"downstream\" for the context\n this.downstream = autorun;\n // For now\n if ( this.flowControlApplied() ) return;\n } else if ( this.type === 'switch' && this.breakpoint ) {\n return;\n }\n // Push stack and execute\n return autorun.execute();\n }\n\n function( executionMode, functionKind, serial, $qFunction ) {\n // Declare in current scope\n if ( functionKind === 'Declaration' ) {\n Observer.set( this.scope.state, $qFunction.name, $qFunction );\n }\n // Metarise function\n const _this = this;\n Object.defineProperty( $qFunction, 'toString', { value: function( $qSource = false ) {\n if ( $qSource && executionMode === 'QuantumFunction' ) return Function.prototype.toString.call( $qFunction );\n const originalSource = _this.runtime.extractSource( serial );\n return originalSource.startsWith( 'static ' ) ? originalSource.replace( 'static ', '' ) : originalSource;\n } } );\n return $qFunction;\n }\n\n class( classKind, $class, methodsSpec ) {\n // Declare in current scope\n if ( classKind === 'Declaration' ) {\n Observer.set( this.scope.state, $class.name, $class );\n }\n // Metarise methods\n methodsSpec.forEach( ( { name, isQuantumFunction, static: isStatic, serial } ) => {\n this.function( isQuantumFunction && 'QuantumFunction' || 'RegularFunction', 'Expression', serial, isStatic ? $class[ name ] : $class.prototype[ name ] )\n } );\n return $class;\n }\n\n async import( ...args ) { return this.runtime.import( ...args ); }\n\n async export( ...args ) { return this.runtime.export( ...args ); }\n\n continue( label ) { return this.applyFlowControl( 'continue', label ); }\n\n break( label ) { return this.applyFlowControl( 'break', label ); }\n\n return( arg ) { return this.applyFlowControl( 'return', arg ); }\n\n applyFlowControl( cmd, arg, unset = false ) {\n const sizeBefore = this.flowControl.size;\n if ( unset ) { this.flowControl.delete( cmd ); }\n else { this.flowControl.set( cmd, { arg } ); }\n if ( this.type === 'round' ) { this.context.breakpoint = this; }\n if ( this.type === 'round' && [ 'break', 'continue' ].includes( cmd ) && arg === this.context?.spec.label ) {\n if ( !unset ) { this.flowControl.get( cmd ).endpoint = true; }\n if ( this.state !== 'running' ) { this.handleRightstream( this.flowControl.size, sizeBefore ); }\n return;\n }\n if ( this.context?.type === 'switch' && cmd === 'break' && !arg ) {\n if ( !unset ) { this.flowControl.get( cmd ).endpoint = true; }\n this.context.breakpoint = this;\n return;\n }\n // Notice that no hoisting and no \"downstream\" handling if in active scope\n // as that would be done at after() hook!\n if ( this.state !== 'running' ) {\n this.handleDownstream( this.flowControl.size, sizeBefore );\n this.hoistFlowControl( ...arguments );\n }\n }\n\n hoistFlowControl( ...args ) { return this.context?.applyFlowControl( ...args ); }\n\n flowControlApplied( cmd, arg ) {\n if ( !arguments.length ) return this.flowControl.size || false;\n if ( arguments.length === 1 ) return this.flowControl.has( cmd );\n return this.flowControl.get( cmd )?.arg === arg;\n }\n\n handleDownstream( sizeAfter, sizeBefore ) {\n let downstream;\n if ( ![ 'block' ].includes( this.type ) // If this is \"downstream\", the \"downstream\" you see from parent scope will be self\n || !( downstream = this.context?.downstream ) ) return;\n if ( sizeAfter ) { downstream.abort(); }\n else if ( sizeBefore ) {\n downstream.state = 'resuming'; // Just something other than \"aborted\"\n this.runtime.schedule( downstream );\n }\n }\n\n handleRightstream( sizeAfter, sizeBefore ) {\n if ( this.type !== 'round' ) return;\n let nextRound = this, returnees = new Set;\n while( nextRound = nextRound.nextRound ) {\n if ( sizeAfter ) { nextRound.abort(); }\n else if ( sizeBefore && nextRound.state !== 'inert' ) {\n nextRound.state = 'resuming'; // Just something other than \"aborted\"\n returnees.add( nextRound );\n }\n }\n if ( returnees.size ) { this.runtime.schedule( ...returnees ); }\n if ( !sizeAfter && sizeBefore ) {\n this.runtime.on( 'reflection', () => {\n if ( this.context.iterating ) return;\n this.context.iterate();\n }, { once: true } );\n }\n }\n\n abort( total = false ) {\n if ( total ) {\n if ( this.context?.breakpoint === this ) { delete this.context.breakpoint; }\n this.flowControl.clear();\n }\n this.state = total ? 'inert' : 'aborted';\n return super.abort( total );\n }\n \n}", "\n/**\n * @import\n */\nimport { _await } from '../util.js';\nimport Observer from '@webqit/observer';\nimport Autorun from './Autorun.js';\nimport Scope from './Scope.js';\n\nexport default class AutoIterator extends Autorun {\n\n rounds = new Map;\n\n constructor( context, type, spec, serial, scope, closure ) {\n spec.$closure = closure;\n super( context, type, spec, serial, scope );\n this.manage( () => {\n delete this.breakpoint;\n this.rounds.clear();\n } );\n }\n\n pseudorun( callback ) {\n this.runtime.iThread.unshift( this );\n return _await( callback(), returnValue => {\n this.runtime.iThread.pop();\n return returnValue;\n } );\n }\n\n createIterator() {\n if ( this.spec.kind === 'for-in' ) return ( function* () { for ( let key in this.iteratee ) yield key; } ).call( this );\n if ( this.spec.kind === 'for-of' ) return ( function* () { for ( let val of this.iteratee ) yield val; } ).call( this );\n return { next: () => ({ done: !this.pseudorun( () => this.spec.test( this ) ), }), };\n }\n\n closure() {\n if ( [ 'for-of', 'for-in' ].includes( this.spec.kind ) ) {\n [ this.production, this.iteratee ] = this.spec.parameters( this );\n this.iterator = this.createIterator();\n this.iterator.original = true;\n this.watchMode();\n } else {\n if ( this.spec.kind === 'for' ) { this.spec.init( this ); }\n this.iterator = this.createIterator();\n }\n this.iterate();\n }\n\n terminated() { return this.breakpoint && !this.breakpoint.flowControlApplied( 'continue', this.spec.label ) && this.breakpoint.flowControlApplied(); }\n advance() { if ( this.spec.kind === 'for' ) { this.pseudorun( () => this.spec.advance( this ) ); } }\n\n iterate() {\n this.iterating = true;\n const $test = () => !this.terminated()/* must come before */ && !( this.cursor = this.iterator.next() ).done;\n const $round = () => {\n const round = this.createRound( this.cursor.value );\n round.execute();\n this.advance();\n };\n if ( this.spec.kind === 'do-while' ) { do $round(); while ( $test() ); }\n else { while ( $test() ) $round(); }\n this.iterating = false;\n }\n\n createRound( production ) {\n const index = this.rounds.size, spec = { index };\n // The scope instance starts life with the variables that the iteration round should see.\n const state = [ 'for-in', 'for-of' ].includes( this.spec.kind ) ? { [ this.production ]: production } : { ...this.scope.state };\n const scope = new Scope( this.scope, 'round', state );\n this.scope.symbols.forEach( ( meta, name ) => { scope.symbols.set( name, meta ); } );\n const round = new Autorun( this, 'round', spec, this.serial, scope, this.spec.$closure );\n const key = this.spec.kind === 'for-in' ? production : index;\n this.rounds.set( key, round );\n if ( this.lastRound ) {\n this.lastRound.nextRound = round;\n round.prevRound = this.lastRound;\n }\n this.lastRound = round;\n return round;\n }\n\n watchMode() {\n if ( this.spec.static ) return;\n const handleMutations = ( mutations, currentCursor ) => {\n const deletions = new Set, extension = new Set;\n for ( const mutation of mutations ) {\n if ( Array.isArray( this.iteratee ) && mutation.key === 'length' ) continue;\n const production = this.spec.kind === 'for-in' ? mutation.key : mutation.value;\n const key = this.spec.kind === 'for-in' ? mutation.key : parseInt( mutation.key );\n const existingRound = this.rounds.get( key ); // Note that we're not using has()\n if ( existingRound ) {\n // This is an existing round\n Observer.set( existingRound.scope.state, this.production, production );\n if ( mutation.type === 'delete' ) {\n this.rounds.set( key, undefined ); // No actual deletions here as this.rounds.size is our index\n if ( existingRound.prevRound ) { existingRound.prevRound.nextRound = existingRound.nextRound; }\n if ( existingRound.nextRound ) { existingRound.nextRound.prevRound = existingRound.prevRound; }\n // Fired above for the last time and now should die\n deletions.add( existingRound );\n }\n } else if ( mutation.type !== 'delete' && !mutation.isUpdate ) {\n // This is a brand new entry\n // Deletions and updates that didn't have an existing round above are obviously awaiting visit from a paused loop\n if ( this.spec.kind === 'for-of' && this.iterator.original && !currentCursor.done ) continue; // A live iteration is going on\n extension.add( production );\n }\n }\n this.runtime.on( 'reflection', () => {\n deletions.forEach( deletion => deletion.abort( true ) );\n }, { once: true } );\n if ( extension.size ) {\n this.iterator = ( function* ( parent ) {\n yield* parent;\n yield* extension;\n } )( this.iterator );\n if ( currentCursor.done ) { this.iterate(); }\n }\n };\n this.once( Observer.observe( this.iteratee, mutations => {\n _await( this.cursor, currentCursor => handleMutations( mutations, currentCursor ) );\n } ) );\n }\n \n}", "\n/**\n * @import\n */\nimport AutoIterator from './AutoIterator.js';\n\nexport default class AutoAsyncIterator extends AutoIterator {\n\n async createIterator() {\n if ( this.spec.kind === 'for-in' ) return ( function* () { for ( let key in this.iteratee ) yield key; } ).call( this );\n if ( this.spec.kind === 'for-of' ) return ( function* () { for ( let val of this.iteratee ) yield val; } ).call( this );\n return { next: async () => ({ done: !( await this.pseudorun( () => this.spec.test( this ) ) ), }), };\n }\n\n async closure() {\n if ( [ 'for-of', 'for-in' ].includes( this.spec.kind ) ) {\n [ this.production, this.iteratee ] = await this.spec.parameters( this );\n this.iterator = await this.createIterator();\n this.iterator.original = true;\n this.watchMode();\n } else {\n if ( this.spec.kind === 'for' ) { await this.spec.init( this ); }\n this.iterator = await this.createIterator();\n }\n await this.iterate();\n }\n\n async iterate() {\n let cursor; this.iterating = true;\n const $test = async () => ( !this.terminated()/* must come before */ && ( this.cursor = this.iterator.next() ) && ( cursor = await this.cursor ) && !cursor.done );\n const $round = async () => {\n const round = this.createRound( cursor.value );\n await round.execute();\n await this.advance();\n };\n if ( this.spec.kind === 'do-while' ) { do await $round(); while ( await $test() ); }\n else { while ( await $test() ) await $round(); }\n this.iterating = false;\n }\n\n}", "\n/**\n * @imports\n */\nimport Observer from \"@webqit/observer\";\n\nexport default class State {\n\n constructor( runtime ) {\n Object.defineProperty( this, 'runtime', { value: runtime } );\n const events = { statechange: () => { Observer.defineProperty( this, 'value', { value: runtime.flowControl.get( 'return' )?.arg, enumerable: true, configurable: true } ); }, };\n for ( const name in events ) {\n runtime.on( name, events[ name ] );\n events[ name ]();\n }\n if ( runtime.$params.sourceType === 'module' ) {\n Object.defineProperty( this, 'exports', { value: runtime.exports } );\n }\n }\n \n dispose() { return this.runtime.abort( true ); }\n\n}\n", "import Observer from '@webqit/observer';\nimport { _await } from '../util.js';\nimport { registry } from './hot-module-registry.js';\nimport AutoAsyncIterator from './AutoAsyncIterator.js';\nimport AutoIterator from './AutoIterator.js';\nimport Autorun from './Autorun.js';\nimport Scope from './Scope.js';\nimport State from './State.js';\n\nexport default class Runtime extends Autorun {\n\n static AutoAsyncIterator = AutoAsyncIterator;\n static AutoIterator = AutoIterator;\n\n locations = [];\n queue = new Set;\n thread = [];\n iThread = [];\n\n constructor( context, type, params, scope, closure ) {\n const { $serial = 0, spec, ...$params } = params;\n super( context, type, spec, -1, scope, closure );\n this.$serial = $serial;\n this.$params = $params;\n // Random object\n this.$objects = new Scope( undefined, 'objects' );\n this.manage( this.$objects );\n // Imports/exports\n this.exports = Object.create( null );\n this.$promises = { imports: [], exports: [] };\n this.manage( () => {\n Observer.deleteProperties( this.exports, Object.keys( this.exports ) );\n this.$promises.imports.splice( 0 );\n this.$promises.exports.splice( 0 );\n } );\n }\n\n extractSource( serial, full = false ) {\n const [ [ locStart, line, column ], [ locEnd ] ] = this.locations[ serial ];\n const expr = this.$params.originalSource.slice( locStart, locEnd );\n return full ? { expr, line, column } : expr;\n }\n\n get runtime() { return this; }\n\n get nowRunning() { return this.thread[ 0 ]; }\n\n schedule( ...autoruns ) {\n // Determine if active beforehand\n const isActive = this.queue.size;\n for ( const autorun of autoruns ) { this.queue.add( autorun ); }\n if ( isActive ) return;\n // Event Loop\n this.flowControlDirty = false;\n return ( function nextTick( prevReturn, current ) {\n // Find following...\n let following;\n for ( const autorun of this.queue ) {\n // If autorun is higher in source ignore\n // Or a parent autorun has already been run in this event loop which started by aborting all descendants\n // Or the unique situation with \"for\" loops where \"test\" and \"update\" expressions tend to self-schedule the AutoIteration instance.\n if ( current && current.order( autorun ) !== current || [ 'aborted', 'running' ].includes( autorun.state ) || this.iThread[ 0 ]?.contains( autorun ) ) {\n this.queue.delete( autorun ); continue;\n }\n // Get $autorun to be very next to _this.currentMicro\n following = following ? following.order( autorun ) : autorun;\n if ( !current ) { current = following; }\n }\n // Fire events\n if ( !following ) {\n this.fire( 'reflection' );\n if ( this.flowControlApplied() ) { this.fire( 'statechange' ); }\n return prevReturn;\n }\n // Execute following...\n following.abort();\n // Evaluate and possibly await...\n return following.execute( returnValue => {\n // Remove from queue\n this.queue.delete( following );\n // Next tick\n return nextTick.call( this, returnValue, following );\n } );\n } ).call( this, undefined, this.nowRunning );\n }\n\n execute( callback = null ) {\n return super.execute( returnValue => {\n const quantumMode = [ 'QuantumProgram', 'QuantumFunction' ].includes( this.$params.executionMode );\n const actualReturnValue = quantumMode\n ? new State( this )\n : this.flowControl.get( 'return' )?.arg;//returnValue;\n return callback ? callback( actualReturnValue, this ) : actualReturnValue;\n } );\n }\n\n spawn( executionMode, thisContext, closure, lexicalContext = null ) {\n const context = this.nowRunning || lexicalContext || this;\n const params = { ...this.$params, $serial: this.$serial + 1, executionMode, lexicalContext };\n const scope = new Scope( context.scope, 'function', { [ 'this' ]: thisContext } );\n const subRuntime = new this.constructor( context, 'function', params, scope, closure );\n return subRuntime.execute();\n }\n\n async import( ...args ) {\n const source = args.pop();\n const $source = typeof source === 'string' ? { source } : source;\n const onload = modules => {\n if ( $source.forExport || $source.isDynamic ) return modules;\n this.assignModules( args, this.scope.state, modules, source.serial );\n };\n if ( this.$params.experimentalFeatures !== false && registry[ $source.source ] ) {\n return onload( registry[ $source.source ] );\n }\n const promise = ( async () => {\n const moduleName = this.$params.sourceType === 'module' && this.$params.experimentalFeatures !== false && this.$params.exportNamespace || this.$params.fileName;\n try { return onload( { ...await import( $source.source ) } ); } catch( e ) {\n if ( e.code === 'ERR_MODULE_NOT_FOUND' ) { this.throw( new Error( `Cannot find module \"${ $source.source }\"${ moduleName ? ` imported at \"${ moduleName }\"` : '' }.` ), [ $source.serial ], e.code ); }\n else this.throw( e, [ $source.serial ], e.code );\n }\n } )();\n if ( !$source.isDynamic ) {\n this.$promises[ $source.forExport ? 'exports' : 'imports' ].push( promise );\n }\n return promise;\n }\n\n async export( ...args ) {\n const source = !Array.isArray( args[ args.length - 1 ] ) ? args.pop() : null;\n // Export from source or from top-level scope!\n const modules = source ? await this.import( { ...source, forExport: true } ) : this.scope.state;\n // Assign imported modules to exports object\n this.assignModules( args, this.exports, modules, source?.serial );\n }\n\n assignModules( specifiers, target, source, sourceSerial = null ) {\n const observeList = [];\n const quantumMode = [ 'QuantumProgram', 'QuantumFunction' ].includes( this.$params.executionMode );\n for ( const [ local, serial, alias ] of specifiers ) {\n if ( local === '*' && alias ) {\n ( quantumMode ? Observer : Reflect ).set( target, alias, source );\n continue;\n }\n if ( !Observer.has( source, local ) ) { this.throw( new Error( `The requested module does not provide an export named \"${ local }\".` ), [ serial, sourceSerial ] ); }\n ( quantumMode ? Observer : Reflect ).set( target, alias || local, Observer.get( source, local ) );\n observeList.push( [ local, serial, alias ] );\n }\n if ( !observeList.length || !quantumMode ) return;\n this.once( Observer.observe( source, mutations => {\n for ( const [ local, /* serial */, alias ] of observeList ) {\n for ( const mutation of mutations ) {\n if ( local === '*' ) { Observer.set( target, mutation.key, mutation.value ); }\n else if ( mutation.key === local ) { Observer.set( target, alias || local, mutation.value ); } \n }\n }\n } ) );\n }\n \n afterExecute( ...args ) {\n if ( this.$params.sourceType === 'module' && this.$params.experimentalFeatures !== false && this.$params.exportNamespace ) {\n registry[ this.$params.exportNamespace ] = this.exports;\n this.once( () => { delete registry[ this.$params.exportNamespace ]; } );\n }\n return super.afterExecute( ...args );\n }\n\n}", "\n/**\n * @imports\n */\nimport { _await } from '../util.js';\nimport { resolveParams } from '../params.js';\nimport Runtime from './Runtime.js';\nimport Scope from './Scope.js';\nimport State from './State.js';\n\nexport { State, Runtime }\n\nexport function $eval( sourceType, parseCompileCallback, source, params ) {\n // params could have: env, functionParams, parserParams, compilerParams, runtimeParams\n const { env, functionParams = [], exportNamespace, fileName } = params;\n const { parserParams, compilerParams, runtimeParams, } = resolveParams( params );\n const inBrowser = Object.getOwnPropertyDescriptor( globalThis, 'window' )?.get?.toString().includes( '[native code]' ) ?? false;\n const asyncEval = [ 'async-script', 'module' ].includes( sourceType );\n\n // Format source? Mode can be: function, async-function, script, async-script, module\n if ( sourceType === 'module' ) {\n parserParams.sourceType = sourceType;\n parserParams.allowAwaitOutsideFunction = true;\n } else if ( [ 'function', 'async-function' ].includes( sourceType ) ) {\n // Design the actual stateful function\n const body = ` ` + source.split( `\\n` ).join( `\\n ` );\n source = `return ${ sourceType === 'async-function' ? 'async ' : '' }function**(${ functionParams.join( ', ' ) }) {\\n${ body }\\n}`;\n // The top-level program is a simple return statement as above. This return shouldn't be treated as reactive nor return a state object, but the plain value\n parserParams.executionMode = 'RegularProgram';\n } else if ( ![ 'script', 'async-script' ].includes( sourceType ) ) {\n throw new Error( `Unrecognized sourceType specified: \"${ sourceType }\".` );\n }\n\n // Proceed to parse-compile\n compilerParams.sourceType = sourceType;\n parserParams.inBrowser = inBrowser;\n compilerParams.base64 = asyncEval && inBrowser && `export default async function(%0) {%1}`;\n const compilation = parseCompileCallback( source, { parserParams, compilerParams } );\n if ( compilation instanceof Promise && ![ 'async-function', 'async-script', 'module' ].includes( sourceType ) ) {\n throw new Error( `Parse-compile can only return a Promise for sourceTypes: async-function, async-script, module.` );\n }\n\n // Proceed to eval\n runtimeParams.sourceType = sourceType;\n runtimeParams.inBrowser = inBrowser;\n runtimeParams.exportNamespace = exportNamespace;\n runtimeParams.fileName = fileName;\n return _await( compilation, compilation => {\n const isFunction = [ 'function', 'async-function' ].includes( sourceType );\n // Below, \"async-function\" would already has async in the returned function\n // And no need to ask compilation.topLevelAwait\n const $eval = ( $qIdentifier, source ) => {\n if ( runtimeParams.compileFunction ) return runtimeParams.compileFunction( source.toString(), [ $qIdentifier ] );\n if ( compilerParams.base64 ) { /* @experimental */\n // Save to a variable to fool bundlephobia about the import();\n const dataUrl = `data:text/javascript;base64,${ source.toString( 'base64' ) }`;\n const impt = () => import( dataUrl ).then( m => m.default );\n //if ( window.webqit?.realdom?.schedule ) return window.webqit?.realdom?.schedule( 'write', impt, true );\n return impt();\n }\n return new ( asyncEval ? ( async function() {} ).constructor : Function )( $qIdentifier, source.toString() );\n };\n return _await( $eval( compilation.identifier + '', compilation ), main => {\n const createRuntime = ( thisContext, $env = env ) => {\n let $main = main;\n if ( thisContext ) { $main = $main.bind( thisContext ); }\n // There's always a global scope\n let contextType = 'global', scope = new Scope( undefined, contextType, globalThis );\n // Then this, for script scope, which may also directly reflect/mutate any provided \"env\"\n if ( sourceType.endsWith( 'script' ) || $env ) { contextType = 'env'; scope = new Scope( scope, contextType, $env ); }\n // Or this for module scope. And where \"env\" was provided, the \"env\" scope above too\n if ( sourceType === 'module' ) { contextType = 'module'; scope = new Scope( scope, contextType ); }\n if ( typeof thisContext !== 'undefined' ) { scope = new Scope( scope, 'this', { [ 'this' ]: thisContext } ); }\n return new Runtime( undefined, contextType, { ...runtimeParams, originalSource: compilation.originalSource, executionMode: compilation.isQuantumProgram && 'QuantumProgram' || 'RegularProgram' }, scope, $main );\n };\n return isFunction\n ? createRuntime().execute() // Produces the actual stateful function designed above\n : { createRuntime, compilation };\n } );\n } );\n}", "\n/**\n * @imports\n */\nimport { _await } from './util.js';\nimport { $eval, State } from './runtime/index.js';\n\n/**\n * @Script\n */\nexport default class AbstractQuantumScript {\n constructor( ...args ) {\n const $static = this.constructor;\n const params = typeof args[ args.length - 1 ] === 'object' ? args.pop() : {};\n const source = args.pop() || '';\n this.$program = $eval( $static.sourceType, $static.parseCompileCallback, source, params );\n }\n\n execute() { return _await( this.$program, ( { createRuntime } ) => createRuntime().execute() ); }\n\n bind( thisContext, env = undefined ) { return _await( this.$program, ( { createRuntime } ) => createRuntime( thisContext, env ) ); }\n\n toString( $qSource = false ) {\n return _await( this.$program, ( { compilation } ) => {\n if ( $qSource ) return compilation + '';\n return compilation.originalSource;\n } );\n }\n}", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isUndefined from '../js/isUndefined.js';\nimport _isNull from '../js/isNull.js';\nimport _arrFrom from '../arr/from.js';\n\n/**\n * Retrieves the value at the given path.\n *\n * A return value of undefined is ambiguous, and can mean either that the\n * path does not exist, or that the path actually exists but with a value of undefined. If it is required to\n * know whether the path actually exists, pass an object as a third argument.\n * This object will have an \"exists\" key set to true/false.\n *\n * @param object \t\t\t\tctxt\n * @param array \t\t\t\tpath\n * @param object \t\t\t\ttrap\n * @param object \t\t\t\treciever\n *\n * @return mixed\n */\nexport default function(ctxt, path, trap = {}, reciever = {}) {\n\tpath = _arrFrom(path).slice();\n\tvar _ctxt = ctxt;\n\twhile(!_isUndefined(_ctxt) && !_isNull(_ctxt) && path.length) {\n\t\tvar _key = path.shift();\n\t\tif (!(trap.get ? trap.get(_ctxt, _key) : (_isTypeObject(_ctxt) ? _key in _ctxt : _ctxt[_key]))) {\n\t\t\treciever.exists = false;\n\t\t\treturn;\n\t\t}\n\t\t_ctxt = trap.get ? trap.get(_ctxt, _key) : _ctxt[_key];\n\t}\n\treciever.exists = true;\n\treturn _ctxt;\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _isArray from '../js/isArray.js';\nimport _arrFrom from '../arr/from.js';\nimport _get from './get.js';\n\n/**\n * Sets a value to the given path.\n *\n * @param object \t\t\t\tobj\n * @param array \t\t\t\tpath\n * @param mixed \t\t\t\tval\n * @param object|function \t\tbuildTree\n * @param object \t\t\t\ttrap\n *\n * @return bool\n */\nexport default function(obj, path, val, buildTree = {}, trap = {}) {\n\tconst _set = (target, key, val) => {\n\t\tif (trap.set) {\n\t\t\treturn trap.set(target, key, val);\n\t\t} else {\n\t\t\tif (_isNumeric(path[i]) && _isArray(target)) {\n\t\t\t\ttarget.push(val);\n\t\t\t} else {\n\t\t\t\ttarget[key] = val;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t};\n\tpath = _arrFrom(path);\n\tvar target = obj;\n\tfor(var i = 0; i < path.length; i ++) {\n\t\tif (i < path.length - 1) {\n\t\t\tif (!target || (!_isTypeObject(target) && !_isFunction(target))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar branch = _get(target, path[i], trap);\n\t\t\tif (!_isTypeObject(branch)) {\n\t\t\t\tif (trap.buildTree === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbranch = _isFunction(trap.buildTree) ? trap.buildTree(i) : (_isNumeric(path[i + 1]) ? [] : {});\n\t\t\t\tvar branchSuccess = _set(target, path[i], branch);\n\t\t\t\tif (!branchSuccess) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttarget = branch;\n\t\t} else {\n\t\t\treturn _set(target, path[i], val);\n\t\t}\n\t}\n};\n", "\n/**\n * ---------------------------\n * Binds callbacks to requestAnimationFrame()\n * to create a central \"read/write\" phases for Ctxt access.\n * ---------------------------\n */\n\t\t\t\nexport default class Scheduler {\n\n\t/**\n\t * Starts the loop.\n\t *\n\t * @return this\n\t */\n\tconstructor( window, synthesis = false ) {\n\t\tObject.defineProperty( this, 'window', { value: window } );\n\t\tObject.defineProperty( this, 'readCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, 'writeCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, '_synthesis', { value: 0, writable: true } );\n\t\tif ( !synthesis && this.window.requestAnimationFrame ) {\n\t\t\tthis._loop();\n\t\t} else { this._synthesis ++; }\n\t}\n\n\tget synthesis() { return this._synthesis; }\n\n\tasync synthesizeWhile( callback ) {\n\t\tthis._synthesis ++;\n\t\tthis._fulfill();\n\t\tconst returnValue = await callback();\n\t\tthis._synthesis --;\n\t\treturn returnValue;\n\t}\n\n\t_fulfill() {\n\t\tfor ( const callback of this.readCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.readCallbacks.delete( callback );\n\t\t}\n\t\tfor ( const callback of this.writeCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.writeCallbacks.delete( callback );\n\t\t}\n\t}\n\n\t_loop() {\n\t\tthis.window.requestAnimationFrame( () => {\n\t\t\tthis._fulfill();\n\t\t\tthis._loop();\n\t\t} );\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"read\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonread( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.readCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.readCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"write\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonwrite( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.writeCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.writeCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * A special construct for Ctxt manipulations that span\n\t * one or more read/write cycles.\n\t *\n\t * @param function \tread\n\t * @param function \twrite\n\t * @param mixed\t\tprevTransaction\n\t *\n\t * @return void|mixed\n\t */\n\tcycle( onread, onwrite, prevTransaction ) {\n\t\tthis.onread( () => {\n\t\t\t// Record initial values\n\t\t\tconst readReturn = onread( prevTransaction );\n\t\t\t// Call erite, the transation\n\t\t\tconst callWrite = ( readReturn ) => {\n\t\t\t\tif ( readReturn === undefined ) return;\n\t\t\t\tthis.onwrite( () => {\n\t\t\t\t\tconst writeReturn = onwrite( readReturn, prevTransaction );\n\t\t\t\t\t// Repeat transaction\n\t\t\t\t\tconst repeatTransaction = ( writeReturn ) => {\n\t\t\t\t\t\tif ( writeReturn === undefined ) return;\n\t\t\t\t\t\tthis.cycle( onread, onwrite, writeReturn );\n\t\t\t\t\t};\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\t// If \"write\" returns a promise, we wait until it is resolved\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\tif ( writeReturn instanceof Promise ) {\n\t\t\t\t\t\twriteReturn.then( repeatTransaction );\n\t\t\t\t\t} else {\n\t\t\t\t\t\trepeatTransaction( writeReturn );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t\t// ---------------------------------------\n\t\t\t// If \"read\" returns a promise, we wait until it is resolved\n\t\t\t// ---------------------------------------\n\t\t\tif ( readReturn instanceof Promise ) {\n\t\t\t\treadReturn.then( callWrite );\n\t\t\t} else {\n\t\t\t\tcallWrite( readReturn );\n\t\t\t}\n\t\t} );\n\t}\n\n}", "\n\nexport function isXpath( expr ) { return ( expr = expr.trim() ) && expr.startsWith( '(' ) && expr.endsWith( ')' ) }\n\nexport function xpathQuery( window, context, expr, subtree = true ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', subtree ? '(.//' : '(./' ) ).join( '|' );\n let nodes = [], node;\n try {\n // Throws in firefox and safari where context is a text node\n const result = window.document.evaluate( expr, context, null, window.XPathResult.ANY_TYPE );\n while ( node = result.iterateNext() ) nodes.push( node );\n } catch( e ) {}\n return nodes;\n}\n\nexport function xpathMatch( window, node, expr ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', '(self::' ) ).join( '|' );\n try {\n // Throws in firefox and safari where context is a text node and query isn't\n return window.document.evaluate( `${ expr }`, node, null, window.XPathResult.BOOLEAN_TYPE ).booleanValue;\n } catch( e ) {}\n}\n\nexport function containsNode( window, a, b, crossRoots = false, testCache = null ) {\n const prevTest = testCache?.get( a )?.get( b );\n if ( typeof prevTest !== 'undefined' ) return prevTest;\n const response = val => {\n if ( !testCache?.has( a ) ) testCache?.set( a, new WeakMap );\n testCache?.get( a )?.set( b, val );\n return val;\n };\n const rootNodeA = a.getRootNode();\n const rootNodeB = b.getRootNode();\n if ( rootNodeA === rootNodeB ) return response( a.contains( b ) );\n if ( crossRoots && rootNodeB instanceof window.ShadowRoot ) return response( containsNode( window, a, rootNodeB.host, crossRoots, testCache ) );\n return response( false );\n}\n\nexport function splitOuter( str, delim = '|' ) {\n return [ ...str ].reduce( ( [ quote, depth, splits, skip ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}", "\n/**\n * @imports\n */\nimport * as Util from './Util.js';\n\nexport default class DOMSpec {\n constructor( content ) {\n this.content = content;\n this.type = typeof content === 'string' ? 'selector' : 'instance';\n this.kind = this.type === 'instance' ? null : Util.isXpath( content ) ? 'xpath' : 'css';\n if ( this.kind === 'xpath' ) {\n this.isXpathAttr = Util.splitOuter( content.trim().slice( 1, -1 ), '@' ).length > 1;\n }\n }\n toString() { return this.content; }\n}", "\n/**\n * @imports\n */\nimport { _isFunction, _isObject, _wq } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport DOMSpec from './DOMSpec.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class Realtime\n */\nexport default class Realtime {\n\n\t/**\n\t * @constructor\n\t *\n\t * @param document|Element\tcontext\n\t */\n\tconstructor( context, namespace, window ) {\n\t\tthis.context = context;\n\t\tthis.namespace = namespace;\n\t\tthis.window = context.defaultView || context.ownerDocument?.defaultView || window;\n\t\tthis.document = this.window.document;\n\t\tthis.webqit = this.window.webqit;\n\t\tObject.defineProperty( this, '#', { value: {} } );\n\t}\n\t\n\t/**\n\t * Resolves arguments\n\t * \n\t * @param Array \t\t\targs \n\t * \n\t * @returns Array\n\t */\n\tresolveArgs( args ) {\n\t\tif ( _isFunction( args[ 0 ] ) ) { args = [ [], ...args ]; }\n\t\telse if ( _isObject( args[ 0 ] ) && !( args[ 0 ] instanceof DOMSpec ) && args.length === 1 ) {\n\t\t\targs = [ [], undefined, args[ 0 ] ];\n\t\t} else if ( _isObject( args[ 1 ] ) && args.length === 2 ) {\n\t\t\targs = [ _arrFrom( args[ 0 ], false/*castObject*/ ), undefined, args[ 1 ] ];\n\t\t} else { args[ 0 ] = _arrFrom( args[ 0 ], false/*castObject*/ ); }\n\t\tif ( args[ 0 ].filter( x => typeof x !== 'string' && !( x instanceof DOMSpec ) && !( x instanceof this.window.Node ) ).length ) {\n\t\t\tthrow new Error( `Argument #2 must be either a string or a Node object, or a list of those.` );\n\t\t}\n\t\targs[ 0 ] = args[ 0 ].map( s => s instanceof DOMSpec ? s : new DOMSpec( s ) );\n\t\treturn args;\n\t}\n\n\t/**\n\t * @registry\n\t *\n\t * @param Array\t\t\t\t...args\n\t * \n\t * @returns Map\n\t */\n\tregistry( ...args ) {\n\t\treturn _wq( this.window, 'realdom', this.namespace, ...args );\n\t}\n\t\t\n\t/**\n\t * @createSignalGenerator\n\t * \n\t * @param Object \t\t\tmo \n\t * \n\t * @returns Object\n\t */\n\tcreateSignalGenerator() {\n\t\treturn {\n\t\t\tgenerate() {\n\t\t\t\t// Abort previous\n\t\t\t\tthis.lastController?.abort();\n\t\t\t\tthis.lastController = new AbortController;\n\t\t\t\tconst flags = { signal: this.lastController.signal };\n\t\t\t\treturn flags;\n\t\t\t},\n\t\t\tdisconnect() { this.lastController?.abort(); }\n\t\t}\n\t}\n\t\t\n\t/**\n\t * Loops through registration objects whose contexts match the event context.\n\t * \n\t * @param String \t\tinterceptionTiming\n\t * @param Object|Array \trecord_s\n\t * @param Function \t\tcallback \n\t * \n\t * @returns void\n\t */\n\tforEachMatchingContext( interceptionTiming, record_s, callback ) {\n\t\tconst { window } = this, deferreds = new Set, testCache = new WeakMap;\n\t\tfor ( const [ registration, deferred ] of this.registry( interceptionTiming ) ) {\n\t\t\tlet $records = [].concat( record_s ).filter( record => Util.containsNode( window, registration.context, record.target, registration.params.subtree === 'cross-roots', testCache ) );\n\t\t\tif ( !$records.length ) continue;\n\t\t\tconst args = [ registration, Array.isArray( record_s ) ? $records : $records[ 0 ] ];\n\t\t\tif ( deferred ) deferreds.add( args ); else callback.call( window, ...args );\n\t\t}\n\t\tfor ( const args of deferreds ) callback.call( window, ...args );\n\t\tdeferreds.clear();\n\t}\n\n\t/**\n\t * @disconnectables\n\t * \n\t * @param AbortSignal \t\tsignal\n\t * @param Array \t\t\t...objects \n\t * \n\t * @returns Object\n\t */\n\tdisconnectables( signal, ...objects ) {\n\t\tconst disconnectable = { disconnect() {\n\t\t\tobjects.forEach( d => (\n\t\t\t\td && _isFunction( d.disconnect ) && d.disconnect() \n\t\t\t\t|| _isFunction( d ) && d() \n\t\t\t\t|| _isObject( d ) && ( d.disconnected = true )\n\t\t\t) );\n\t\t} };\n\t\tif ( signal ) signal.addEventListener( 'abort', () => disconnectable.disconnect() );\n\t\treturn disconnectable;\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _wq } from '@webqit/util/js/index.js';\nimport Realtime from './Realtime.js';\nimport DOMSpec from './DOMSpec.js';\n\n/**\n *\n * @class AttrRealtime\n */\nexport default class AttrRealtime extends Realtime {\n\n\ttype = 'attr';\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'attr', ...args );\n\t}\n\t\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tget( spec, callback = undefined, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// -------------\n\t\tconst records = attrIntersection( context, spec );\n\t\tif ( !callback ) return records;\n\t\tconst signalGenerator = params.lifecycleSignals && this.createSignalGenerator();\n\t\tif ( !originalFilterIsString ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( records, flags, context );\n\t\t} else {\n\t\t\tfor ( const record of records ) {\n\t\t\t\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\t\t\t\tcallback( record, flags, context );\n\t\t\t}\n\t\t}\n\t\t// -------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( originalFilterIsString ? spec[ 0 ] : spec, callback, { newValue: true, ...params } );\n\t\t\treturn this.disconnectables( params.signal, disconnectable_live );\n\t\t}\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( originalFilterIsString ? spec[ 0 ] : spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails && !webqit.realdom.attrInterceptionHooks?.intercepting ) {\n\t\t\tattrInterception.call( window, 'intercept', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => {\n\t\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\t\tdispatch.call( window, registration, records, context );\n\t\t} );\n\t\t// ------------------\n\t\tconst $params = { attributes: true, attributeOldValue: params.oldValue, subtree: params.subtree && true };\n\t\tif ( spec.length ) { $params.attributeFilter = spec.map( a => a + '' ); }\n\t\tdisconnectable.observe( context, $params );\n\t\t// -------------\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tattrInterception.call( window, interceptionTiming, records => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, records, dispatch );\n\t\t\t} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() { registry.delete( registration ); } };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n}\n\n/**\n * Deduplicates records.\n * \n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction dedupAndIgnoreInternals( records ) {\n\treturn records.reduce( ( rcds, rcd, i ) => {\n\t\tif ( rcds[ i - 1 ]?.attributeName === rcd.attributeName ) return rcds;\n\t\tif ( _wq( rcd.target, 'realdom', 'internalAttrInteractions' ).get( rcd.attributeName ) ) return rcds;\n\t\treturn rcds.concat( rcd );\n\t}, [] );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration\n * @param Array \t\t\trecords\n * \n * @returns Void\n */\nfunction dispatch( registration, records ) {\n\tconst { context, spec, callback, params, atomics, originalFilterIsString, signalGenerator } = registration;\n\tif (!params.subtree) {\n\t\trecords = records.filter((r) => {\n\t\t\treturn r.target === context;\n\t\t}); \n\t}\n\tif ( !records.length ) return;\n\tconst $spec = spec.map( a => a + '' );\n\tif ( params.atomic && !atomics.size ) {\n\t\trecords = attrIntersection( context, spec, records );\n\t} else if ( params.timing !== 'async' && spec.length ) {\n\t\trecords = records.filter( r => $spec.includes( r.name ) );\n\t}\n\tif ( !records.length ) return;\n\t// Should we care about old / new values being present?\n\tif ( !( params.newValue === null && params.oldValue === null && params.eventDetails ) ) {\n\t\trecords = records.map( rcd => {\n\t\t\tlet exclusion;\n\t\t\tif ( !params.eventDetails ) {\n\t\t\t\t( { event: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.oldValue && ( 'oldValue' in rcd ) ) {\n\t\t\t\t( { oldValue: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.newValue && ( 'value' in rcd ) ) {\n\t\t\t\t( { value: exclusion, ...rcd } = rcd );\n\t\t\t} else if ( params.newValue && typeof rcd.value === 'undefined' ) {\n\t\t\t\trcd = { ...rcd, value: internalAttrInteraction( rcd.target, rcd.name, () => rcd.target.getAttribute( rcd.name ) ) };\n\t\t\t}\n\t\t\treturn rcd;\n\t\t} );\n\t}\n\tif ( params.atomic ) {\n\t\trecords.forEach( record => atomics.set( record.name, record ) );\n\t\trecords = Array.from( atomics.entries() ).map( ( [ , value ] ) => value );\n\t}\n\tconst record_s = originalFilterIsString ? records[ 0 ] : records;\n\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\tcallback( record_s, flags, context );\n}\n\n/**\n */\nfunction internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'realdom', 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\n/**\n * Helper to determining which records to deliver.\n * \n * @param Object \t\t\tcontext\n * @param Array \t\t\tspec\n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction attrIntersection( context, spec, records = [] ) {\n\tconst _type = { event: null, type: 'attribute' };\n\tif ( spec.length ) {\n\t\treturn spec.map( attrName => {\n\t\t\tattrName = attrName + '';\n\t\t\treturn records.find( r => r.name === attrName ) || { target: context, name: attrName, value: internalAttrInteraction( context, attrName, () => context.getAttribute( attrName ) ), ..._type };\n\t\t} );\n\t}\n\tconst attrs = Array.from( context.attributes );\n\treturn attrs.map( attr => {\n\t\treturn records.find( r => r.name === attr.nodeName ) || { target: context, name: attr.nodeName, value: internalAttrInteraction( context, attr.nodeName, () => attr.nodeValue ), ..._type };\n\t} );\n}\n\n/**\n * Determines the event for an attr mutation record.\n * \n * @param MutationRecord \t{ target, attributeName }\n * \n * @returns Object\n */\nfunction withAttrEventDetails( { target, attributeName, value, oldValue } ) {\n\tconst window = this, registry = window.webqit.realdom.attrInterceptionRecords?.get( target ) || {};\n\tconst event = registry[ attributeName ]?.[ 0 ] || 'mutation';\n\tconst record = { target, name: attributeName, value, oldValue, type: 'observation', event };\n\treturn record;\n}\n\n/**\n * Attributes intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction attrInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Element } = window;\n\tif ( !webqit.realdom.attrInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'attrInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.attrInterceptionHooks.has( timing ) ) { webqit.realdom.attrInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.attrInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.attrInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.attrInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `Attr mutation APIs are now being intercepted.` );\n\twebqit.realdom.attrInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'attrInterceptionRecords', { value: new Map } );\n\n\t// Interception hooks\n\tconst attrIntercept = ( record, defaultAction ) => {\n\t\tif ( !webqit.realdom.attrInterceptionRecords.has( record.target ) ) { webqit.realdom.attrInterceptionRecords.set( record.target, {} ); }\n\t\tconst registry = webqit.realdom.attrInterceptionRecords.get( record.target );\n\t\t// ------------------\n\t\tregistry[ record.name ] = registry[ record.name ] || [];\n\t\tregistry[ record.name ].unshift( record.event );\n\t\tif ( _wq( record.target, 'realdom', 'internalAttrInteractions' ).get( record.name ) ) return defaultAction();\n\t\t// ------------------\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( [ record ] ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( [ record ] ) );\n\t\treturn returnValue;\n\t};\n\n\t// Interception observer WILL need to know non-API-based mutations\n\tconst mo = new window.MutationObserver( records => {\n\t\trecords = records.filter( rcd => {\n\t\t\tconst registry = window.webqit.realdom.attrInterceptionRecords?.get( rcd.target ) || {};\n\t\t\treturn !registry[ rcd.attributeName ]?.shift();\n\t\t} );\n\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\tif ( !records.length ) return;\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( records ) );\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( records ) );\n\t} );\n\tmo.observe( document, { attributes: true, subtree: true, attributeOldValue: true } );\n\n\t// Intercept DOM attr mutation methods\n\tconst originalApis = Object.create( null );\n\t[ 'setAttribute', 'removeAttribute', 'toggleAttribute', ].forEach( apiName => {\n\t\toriginalApis[ apiName ] = Element.prototype[ apiName ];\n\t\tElement.prototype[ apiName ] = function( ...args ) {\n\t\t\tlet value, oldValue = internalAttrInteraction( this, args[ 0 ], () => this.getAttribute( args[ 0 ] ) );\n\t\t\tif ( [ 'setAttribute', 'toggleAttribute' ].includes( apiName ) ) { value = args[ 1 ]; }\n\t\t\tif ( apiName === 'toggleAttribute' && value === undefined ) {\n\t\t\t\tvalue = oldValue === null ? true : false;\n\t\t\t}\n\t\t\tconst record = { target: this, name: args[ 0 ], value, oldValue, type: 'interception', event: [ this, apiName ] };\n\t\t\tconst exec = () => originalApis[ apiName ].call( this, ...args );\n\t\t\treturn attrIntercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\n/**\n * @imports\n */\nimport { _isObject } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport AttrRealtime from './AttrRealtime.js';\nimport Realtime from './Realtime.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class DOMRealtime\n */\nexport default class DOMRealtime extends Realtime {\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'tree', ...args );\n\t}\n\n\t/**\n\t * Alias for ( new AttrRealtime() ).all( ... )\n\t */\n\tattr( filter, callback = undefined, params = {} ) {\n\t\tconst { context, window } = this;\n\t\treturn ( new AttrRealtime( context, window ) ).get( ...arguments );\n\t}\n\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tquery( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// ------------------\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'query', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ------------------\n\t\tif ( !params.generation || params.generation === 'entrants' ) {\n\t\t\tif ( !spec.length ) {\n\t\t\t\t//if ( params.subtree ) throw new Error( `The subtree option requires a selector to work.` );\n\t\t\t\t[ ...context.children ].forEach( node => getRecord( context ).entrants.push( node ) );\n\t\t\t} else if ( spec.every( s => s.type === 'selector' ) ) {\n\t\t\t\tconst [ cssSelectors, xpathQueries ] = spec.reduce( ( [ css, xpath ], s ) => {\n\t\t\t\t\treturn s.kind === 'xpath' ? [ css, xpath.concat( s ) ] : [ css.concat( s ), xpath ];\n\t\t\t\t}, [ [], [] ] );\n\t\t\t\tconst matches = [];\n\t\t\t\tif ( params.subtree ) {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...context.querySelectorAll( cssSelectors.join( ',' ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries ) ); }\n\t\t\t\t} else {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...[ ...context.children ].filter( node => node.matches( cssSelectors ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries, false ) ); }\n\t\t\t\t}\n\t\t\t\tmatches.forEach( node => getRecord( node.parentNode || context ).entrants.push( node ) );\n\t\t\t}\n\t\t}\n\t\t// ------------------\n\t\tif ( !callback ) return records;\n\t\tconst disconnectable = { disconnected: false };\n\t\tconst signalGenerator = callback && params.lifecycleSignals && this.createSignalGenerator();\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tif ( disconnectable.disconnected ) break;\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t\t// ------------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( spec, callback, params );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, disconnectable_live );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: false } )\n\t */\n\tchildren( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: false } );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: true } )\n\t */\n\tsubtree( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: true } );\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit, document } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails ) { webqit.realdom.domInterceptionRecordsAlwaysOn = true; }\n\t\tif ( ( document.readyState === 'loading' || webqit.realdom.domInterceptionRecordsAlwaysOn ) && !webqit.realdom.domInterceptionHooks?.intercepting ) {\n\t\t\tdomInterception.call( window, 'sync', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tdispatch.call( window, registration, withEventDetails.call( window, record ), context );\n\t\t} ) );\n\t\tdisconnectable.observe( context, { childList: true, subtree: params.subtree && true, } );\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\t\t\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tdomInterception.call( window, interceptionTiming, record => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, record, dispatch );\n\t\t\t} );\n\t\t}\n\t\tconst mo = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tif ( Array.isArray( ( record = withEventDetails.call( window, record ) ).event ) ) return;\n\t\t\tdispatch.call( window, registration, record, context );\n\t\t} ) );\n\t\tmo.observe( context, { childList: true, subtree: params.subtree && true } );\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() {\n\t\t\tregistry.delete( registration );\n\t\t\tmo.disconnect();\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Tracks the connectedness of element references.\n\t *\n\t * @param array|Element\t\t\t\telements\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable\n\t */\n\ttrack( elements, callback, params = {} ) {\n\t\tparams = { subtree: true, ...params };\n\t\treturn this.observe( elements, record => {\n\t\t\tif ( record.entrants.length ) callback( true, Array.isArray( elements ) ? record.entrants : record.entrants[ 0 ] );\n\t\t\tif ( record.exits.length ) callback( false, Array.isArray( elements ) ? record.exits : record.exits[ 0 ] );\n\t\t}, params );\n\t}\n}\n\n/**\n * Sensitivty for attribute changes for attribute spec.\n * \n * @param object registration\n * \n * @returns Disconnectable\n */\nfunction staticSensitivity( registration ) {\n\tconst window = this;\n\tconst { context, spec, callback, params, signalGenerator } = registration;\n\tconst cssSelectors = spec.filter( s => s.kind === 'css' );\n\tconst parseDot = selector => selector.match( /\\.([\\w-]+)/g )?.length ? [ 'class' ] : [];\n\tconst parseHash = selector => selector.match( /#([\\w-]+)/g )?.length ? [ 'id' ] : [];\n\tconst parse = selector => [ ...selector.matchAll( /\\[([^\\=\\]]+)(\\=[^\\]]+)?\\]/g ) ].map( x => x[ 1 ] ).concat( parseDot( selector ) ).concat( parseHash( selector ) );\n\tif ( !( registration.$attrs = Array.from( new Set( cssSelectors.filter( s => ( s + '' ).includes( '[' ) ).reduce( ( attrs, selector ) => attrs.concat( parse( selector + '' ) ), [] ) ) ) ).length ) return;\n\t// ---------\n\tconst entrants = new Set, exits = new Set;\n\tentrants.push = val => ( exits.delete( val ), entrants.add( val ) );\n\texits.push = val => ( entrants.delete( val ), exits.add( val ) );\n\tregistration.$deliveryCache = { entrants, exits };\n\t// ---------\n\treturn ( new AttrRealtime( context, window ) ).observe( registration.$attrs, _records => {\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'static', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ---------\n\t\tconst matchesCache = new WeakMap;\n\t\tconst matches = node => {\n\t\t\tif ( !matchesCache.has( node ) ) { matchesCache.set( node, cssSelectors.some( s => node.matches( s + '' ) ) ); }\n\t\t\treturn matchesCache.get( node );\n\t\t};\n\t\t// ---------\n\t\tfor ( const _record of _records ) {\n\t\t\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\t\t\tif ( params.generation && generation !== params.generation ) return;\n\t\t\t\tif ( registration.$deliveryCache[ generation ].has( _record.target ) || ( generation === 'entrants' ? !matches( _record.target ) : matches( _record.target ) ) ) return;\n\t\t\t\tregistration.$deliveryCache[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target )[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target ).event = _record.event;\n\t\t\t} );\n\t\t}\n\t\t// ---------\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t}, { subtree: params.subtree, timing: params.timing, eventDetails: params.eventDetails } );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration \n * @param Object \t\t\trecord \n * \n * @returns Void\n */\nfunction dispatch( registration, _record ) {\n\tconst { context, spec, callback, params, signalGenerator, $deliveryCache } = registration;\n\t// ---------\n\tconst record = { ..._record, entrants: [], exits: [] };\n\tif ( !params.eventDetails ) { delete record.event; }\n\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\tif ( params.generation && generation !== params.generation ) return;\n\t\tif ( spec.length ) {\n\t\t\trecord[ generation ] = nodesIntersection.call( this, spec, params.subtree === 'cross-roots', _record[ generation ], _record.event !== 'parse' );\n\t\t} else {\n\t\t\trecord[ generation ] = [ ..._record[ generation ] ];\n\t\t}\n\t\tif ( !$deliveryCache ) return;\n\t\tfor ( const node of record[ generation ] ) {\n\t\t\t$deliveryCache[ generation ].push( node );\n\t\t}\n\t} );\n\t// ---------\n\tif ( !record.entrants.length && !record.exits.length ) return;\n\tconst flags = signalGenerator?.generate() || {};\n\tcallback( record, flags, context );\n}\n\n/**\n * Aggregates instances of els in sources\n * \n * @param Array \t\t\tspec \n * @param Bool \t\t\t\tcrossRoots \n * @param Array \t\t\tsources \n * @param Bool \t\t\t\tdeepIntersect \n * \n * @returns \n */\nfunction nodesIntersection( spec, crossRoots, sources, deepIntersect ) {\n\tsources = Array.isArray( sources ) ? sources : [ ...sources ];\n\tconst match = ( sources, s ) => {\n\t\t// Filter out text nodes\n\t\tif ( s.type === 'selector' ) {\n\t\t\t// Is directly mutated...\n\t\t\tlet matches = s.isXpathAttr ? [] : sources.filter( source => s.kind === 'xpath' ? Util.xpathMatch( this, source, s + '' ) : source.matches && source.matches( s + '' ) );\n\t\t\t// Is contextly mutated...\n\t\t\tif ( deepIntersect || s.isXpathAttr ) {\n\t\t\t\tmatches = sources.reduce( ( collection, source ) => {\n\t\t\t\t\tif ( s.kind === 'xpath' ) { return [ ...collection, ...Util.xpathQuery( this, source, s, deepIntersect ) ]; }\n\t\t\t\t\treturn source.querySelectorAll ? [ ...collection, ...source.querySelectorAll( s + '' ) ] : collection;\n\t\t\t\t}, matches );\n\t\t\t}\n\t\t\tif ( matches.length ) return matches;\n\t\t} else {\n\t\t\t// Is directly mutated...\n\t\t\tif ( sources.includes( s.content ) || (\n\t\t\t\tdeepIntersect && sources.some( source => Util.containsNode( this/* window */, source, s.content, crossRoots ) )\n\t\t\t) ) { return [ s.content ]; }\n\t\t}\n\t};\n\t// Search can be expensive...\n\t// Multiple listeners searching the same thing in the same list?\n\tif ( !sources.$$searchCache ) { sources.$$searchCache = new Map; }\n\treturn spec.reduce( ( matches, s ) => {\n\t\tlet _matches;\n\t\tif ( sources.$$searchCache.has( s.content ) ) {\n\t\t\t_matches = sources.$$searchCache.get( s.content );\n\t\t} else {\n\t\t\t_matches = match( sources, s ) || [];\n\t\t\tif ( s.type === 'instance' ) {\n\t\t\t\tsources.$$searchCache.set( s.content, _matches );\n\t\t\t}\n\t\t}\n\t\treturn matches.concat( _matches );\n\t}, [] );\n}\n\n/**\n * Determines the event for a mutation record\n * \n * @param MutationRecord \t{ target, entrants, exits }\n * \n * @returns Object\n */\nfunction withEventDetails( { target, addedNodes, removedNodes } ) {\n\tlet window = this, event;\n\tevent = _arrFrom( addedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), null );\n\tevent = _arrFrom( removedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), event );\n\tevent = event || window.document.readyState === 'loading' && 'parse' || 'mutation';\n\treturn { target, entrants: addedNodes, exits: removedNodes, type: 'observation', event };\n}\n\n/**\n * DOM intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction domInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Node, CharacterData, Element, HTMLElement, HTMLTemplateElement, DocumentFragment } = window;\n\tif ( !webqit.realdom.domInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'domInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionNoRecurse ) { Object.defineProperty( webqit.realdom, 'domInterceptionNoRecurse', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionHooks.has( timing ) ) { webqit.realdom.domInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.domInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.domInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.domInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `DOM mutation APIs are now being intercepted.` );\n\twebqit.realdom.domInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'domInterceptionRecords', { value: new Map } );\n\n\t// No recursion helper\n\tconst noRecurse = ( node, method, callback ) => {\n\t\twebqit.realdom.domInterceptionNoRecurse.set( node, method );\n\t\tconst returnValue = callback();\n\t\twebqit.realdom.domInterceptionNoRecurse.delete( node );\n\t\treturn returnValue;\n\t};\n\n\t// Interception hooks\n\tconst intercept = ( record, defaultAction ) => {\n\t\trecord.entrants.concat( record.exits ).forEach( node => {\n\t\t\tclearTimeout( webqit.realdom.domInterceptionRecords.get( node )?.timeout ); // Clear any previous that's still active\n\t\t\twebqit.realdom.domInterceptionRecords.set( node, record.event ); // Main: set event details... and next to timeout details\n\t\t\tconst timeout = setTimeout( () => { webqit.realdom.domInterceptionRecords.delete( node ); }, 0 );\n\t\t\tObject.defineProperty( record.event, 'timeout', { value: timeout, configurable: true } );\n\t\t} );\n\t\twebqit.realdom.domInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( record ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.domInterceptionHooks.get( 'sync' )?.forEach( callback => callback( record ) );\n\t\treturn returnValue;\n\t};\n\n\t// Intercept DOM mutation methods\n\tconst _apiNames = {\n\t\t// Note the order\n\t\tShadowRoot: [ 'innerHTML', 'setHTMLUnsafe' ],\n\t\tDocumentFragment: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tDocument: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tHTMLElement: [ 'outerText', 'innerText' ],\n\t\tElement: [ 'append', 'prepend', 'before', 'after', 'insertAdjacentElement', 'insertAdjacentHTML', 'remove', 'replaceChildren', 'replaceWith', 'setHTMLUnsafe', 'innerHTML', 'outerHTML' ],\n\t\tCharacterData: [ 'before', 'after', 'remove', 'replaceWith' ],\n\t\tNode: [ 'insertBefore', 'replaceChild', 'removeChild', 'appendChild', 'textContent', 'nodeValue' ],\n\t};\n\tconst _apiOriginals = {\n\t\t// Note the order\n\t\tShadowRoot: Object.create( null ), // extends DocumentFragment\n\t\tDocumentFragment: Object.create( null ), // extends Node\n\t\tDocument: Object.create( null ), // extends Node\n\t\tHTMLElement: Object.create( null ), // extends Element,\n\t\tElement: Object.create( null ), // extends Node\n\t\tCharacterData: Object.create( null ), // extends Node\n\t\tNode: Object.create( null ),\n\t};\n\n\tconst _apiNamesUnique = new Set( Object.values( _apiNames ).reduce( ( all, apis ) => all.concat( apis ), [] ) );\n\t_apiNamesUnique.forEach( apiName => {\n\t\t\n\t\tObject.keys( _apiNames ).forEach( DOMClassName => {\n\t\t\tif ( !_apiNames[ DOMClassName ].includes( apiName ) ) return;\n\t\t\tconst _apiOriginal = Object.getOwnPropertyDescriptor( window[ DOMClassName ].prototype, apiName );\n\t\t\tif ( !_apiOriginal ) return; // Typically: Element:setHTMLUnsafe\n\t\t\tObject.defineProperty( window[ DOMClassName ].prototype, apiName, 'value' in _apiOriginal ? { ..._apiOriginal, value: method } : { ..._apiOriginal, set: setter } );\n\t\t\t_apiOriginals[ DOMClassName ][ apiName ] = _apiOriginal;\n\t\t} );\n\n\t\tfunction method( ...args ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\tif ( webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'insertBefore' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'insertAdjacentElement', 'insertAdjacentHTML' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 1 ] ];\n\t\t\t\tif ( [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t} else if ( [ 'setHTMLUnsafe', 'replaceChildren' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\tentrants = apiName === 'replaceChildren' ? [ ...args ] : [ args[ 0 ] ];\n\t\t\t} else if ( [ 'replaceWith', 'remove' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\tentrants = apiName === 'replaceWith' ? [ ...args ] : [];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else if ( [ 'replaceChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ args[ 1 ] ];\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'removeChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...args ];\n\t\t\t} else {\n\t\t\t\t// 'before', 'after', 'append', 'prepend', 'appendChild'\n\t\t\t\tentrants = [ ...args ];\n\t\t\t\tif ( [ 'before', 'after' ].includes( apiName ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to entrants\n\t\t\tlet apiNameFinal = apiName;\n\t\t\tif ( [ 'insertAdjacentHTML', 'setHTMLUnsafe' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'insertAdjacentHTML' && [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\t$apiOriginals.setHTMLUnsafe.value.call( temp, entrants[ 0 ], apiName === 'setHTMLUnsafe' ? args[ 1 ] : {} );\n\t\t\t\tentrants = [ ...temp.childNodes ];\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'insertAdjacentHTML' ) {\n\t\t\t\t\tapiNameFinal = 'insertAdjacentElement';\n\t\t\t\t\targs[ 1 ] = new DocumentFragment;\n\t\t\t\t\tnoRecurse( args[ 1 ], 'append', () => args[ 1 ].append( ...temp.childNodes ) );\n\t\t\t\t} else {\n\t\t\t\t\tapiNameFinal = 'replaceChildren';\n\t\t\t\t\targs = [ ...temp.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, () => {\n\t\t\t\treturn $apiOriginals[ apiNameFinal ].value.call( this, ...args );\n\t\t\t} );\n\t\t}\n\n\t\tfunction setter( value ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].set.call( this, value );\n\t\t\tif ( this instanceof HTMLScriptElement || webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'outerHTML', 'outerText' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else {\n\t\t\t\t// 'innerHTML', 'innerText', 'textContent', 'nodeValue'\n\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\ttarget = this.content;\n\t\t\t\t\texits = [ ...this.content.childNodes ];\n\t\t\t\t} else {\n\t\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to nodes\n\t\t\tif ( [ 'outerHTML', 'innerHTML' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return exec();\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\tnoRecurse( temp, apiName, () => temp[ apiName ] = value );\n\t\t\t\tentrants = this instanceof HTMLTemplateElement ? [ ...temp.content.childNodes ] : [ ...temp.childNodes ];\n\t\t\t\tif ( ( this instanceof HTMLTemplateElement && this.hasAttribute( 'src' ) ) || this instanceof ShadowRoot ) {\n\t\t\t\t\tconst getScripts = nodes => nodes.reduce( ( scripts, el ) => {\n\t\t\t\t\t\tif ( el instanceof HTMLScriptElement ) return scripts.concat( el );\n\t\t\t\t\t\tif ( el instanceof HTMLTemplateElement ) return scripts.concat( getScripts( [ el.content ] ) );\n\t\t\t\t\t\tscripts = scripts.concat( getScripts( [ ...( el.querySelectorAll?.( 'template' ) || [] ) ].map( t => t.content ) ) );\n\t\t\t\t\t\treturn scripts.concat( ...( el.querySelectorAll?.( 'script' ) || [] ) );\n\t\t\t\t\t}, [] );\n\t\t\t\t\tfor ( const script of getScripts( entrants ) ) {\n\t\t\t\t\t\tif (this instanceof ShadowRoot) {\n\t\t\t\t\t\t\tscript.setAttribute('data-handling', 'manual');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst $script = document.createElement( 'script' );\n\t\t\t\t\t\t[ ...script.attributes ].forEach( attr => $script.setAttribute( attr.name, attr.value ) );\n\t\t\t\t\t\t$script.textContent = script.textContent;\n\t\t\t\t\t\tnoRecurse( script, 'replaceWith', () => script.replaceWith( $script ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\tvalue = new DocumentFragment;\n\t\t\t\t\tnoRecurse( value, 'append', () => value.append( ...entrants ) );\n\t\t\t\t\texec = () => noRecurse( this, 'replaceWith', () => Element.prototype.replaceWith.call( this, value ) );\n\t\t\t\t} else {\n\t\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\t\texec = () => noRecurse( this.content, 'replaceChildren', () => this.content.replaceChildren( ...entrants ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\texec = () => noRecurse( this, 'replaceChildren', () => Element.prototype.replaceChildren.call( this, ...entrants ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\r\n/**\r\n * Applies all supported polyfills\r\n */\r\nexport default function() {\r\n CSS_escape.call( this );\r\n Node_isConnected.call( this );\r\n Element_matches.call( this );\r\n}\r\n\r\n/**\r\n * Polyfills the window.CSS object.\r\n * \r\n * @return void\r\n */\r\nexport function CSS_escape() {\r\n const window = this;\r\n if ( !window.CSS ) { window.CSS = {} }\r\n if ( !window.CSS.escape ) {\r\n /**\r\n * Polyfills the window.CSS.escape() function.\r\n * \r\n * @param string str \r\n * \r\n * @return string\r\n */\r\n window.CSS.escape = str => str.replace( /([\\:@\\~\\$\\&])/g, '\\\\$1' );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Node.prototype.isConnected property\r\n * \r\n * @see MDN\r\n * \r\n * @return bool\r\n*/\r\nexport function Node_isConnected() {\r\n const window = this;\r\n if ( !( 'isConnected' in window.Node.prototype ) ) {\r\n Object.defineProperty( window.Node.prototype, 'isConnected', { get: function() {\r\n return !this.ownerDocument || !(\r\n this.ownerDocument.compareDocumentPosition( this )\r\n & this.DOCUMENT_POSITION_DISCONNECTED);\r\n } } );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Element.prototype.matches() method\r\n * \r\n * @see MDN\r\n * \r\n * @return void\r\n*/\r\nexport function Element_matches() {\r\n const window = this;\r\n if ( !window.Element.prototype.matches ) {\r\n window.Element.prototype.matches = \r\n window.Element.prototype.matchesSelector || \r\n window.Element.prototype.mozMatchesSelector ||\r\n window.Element.prototype.msMatchesSelector || \r\n window.Element.prototype.oMatchesSelector || \r\n window.Element.prototype.webkitMatchesSelector ||\r\n function( s ) {\r\n var matches = ( this.document || this.ownerDocument ).querySelectorAll( s ),\r\n i = matches.length;\r\n while ( --i >= 0 && matches.item( i ) !== this ) {}\r\n return i > -1; \r\n }\r\n }\r\n}", "\r\n/**\r\n * @imports\r\n */\r\nimport { _isNumeric, _isString, _isFunction } from '@webqit/util/js/index.js';\r\nimport { _set } from '@webqit/util/obj/index.js';\r\nimport Scheduler from './Scheduler.js';\r\nimport DOMRealtime from './realtime/DOMRealtime.js';\r\nimport AttrRealtime from './realtime/AttrRealtime.js';\r\nimport polyfill from './polyfills.js';\r\n\r\nexport default function() {\r\n const window = this;\r\n if ( !window.webqit ) window.webqit = {};\r\n if ( window.webqit.realdom ) return window.webqit.realdom;\r\n window.webqit.realdom = {};\r\n polyfill.call( window );\r\n // ------\r\n window.webqit.realdom.meta = ( ...args ) => meta.call( window, ...args );\r\n window.webqit.realdom.ready = ( ...args ) => ready.call( window, ...args );\r\n // ------\r\n window.webqit.realdom.realtime = ( context, namespace = 'dom' ) => {\r\n if ( namespace === 'dom' ) return new DOMRealtime( context, window );\r\n if ( namespace === 'attr' ) return new AttrRealtime( context, window );\r\n };\r\n // ------\r\n const scheduler = new Scheduler( window );\r\n window.webqit.realdom.schedule = ( type, ...args ) => {\r\n return scheduler[ `on${ type }` ]( ...args );\r\n };\r\n window.webqit.realdom.synthesizeWhile = ( ...args ) => {\r\n return scheduler.synthesizeWhile( ...args );\r\n };\r\n // ------\r\n return window.webqit.realdom;\r\n}\r\n\r\n\r\n/**\r\n * DOM-ready listeners.\r\n * \r\n * @param Function\t \t\tcallback\r\n * \r\n * @return void\r\n */\r\nfunction ready( ...args ) {\r\n let timing = 'interactive', callback;\r\n if ( _isString( args[ 0 ] ) ) {\r\n timing = args[ 0 ];\r\n if ( _isFunction( args[ 1 ] ) ) { callback = args[ 1 ]; }\r\n } else if ( _isFunction( args[ 0 ] ) ) { callback = args[ 0 ]; }\r\n // --------------\r\n const timings = { interactive: [ 'interactive', 'complete' ], complete: [ 'complete' ], };\r\n if ( !timings[ timing ] ) throw new Error( `Invalid ready-state timing: ${ timing }.` );\r\n\tconst window = this;\r\n // --------------\r\n if ( !callback ) {\r\n if ( !window.webqit.realdom.readyStatePromises ) {\r\n window.webqit.realdom.readyStatePromises = {\r\n interactive: new Promise( res => ready.call( this, 'interactive', res ) ),\r\n complete: new Promise( res => ready.call( this, 'complete', res ) ),\r\n };\r\n }\r\n return window.webqit.realdom.readyStatePromises[ timing ];\r\n }\r\n // --------------\r\n\tif ( timings[ timing ].includes( window.document.readyState ) ) return callback( window );\r\n if ( !window.webqit.realdom.readyStateCallbacks ) {\r\n window.webqit.realdom.readyStateCallbacks = { interactive: [], complete: [] };\r\n window.document.addEventListener( 'readystatechange', () => {\r\n const state = window.document.readyState;\r\n for ( const callback of window.webqit.realdom.readyStateCallbacks[ state ].splice( 0 ) ) {\r\n callback( window );\r\n }\r\n }, false );\r\n }\r\n window.webqit.realdom.readyStateCallbacks[ timing ].push( callback );\r\n}\r\n\r\n/**\r\n * A webqit's meta tag props reader.\r\n * \r\n * @param String name\r\n * \r\n * @return Object\r\n */\r\nfunction meta( name ) {\r\n const window = this;\r\n let _content = {}, _el;\r\n if ( _el = window.document.querySelector( `meta[name=\"${ name }\"]` ) ) {\r\n _content = ( _el.content || '' ).split( ';' ).filter( v => v ).reduce( ( _metaVars, directive ) => {\r\n const directiveSplit = directive.split( '=' ).map( d => d.trim() );\r\n _set( _metaVars, directiveSplit[ 0 ].split( '.' ), directiveSplit[ 1 ] === 'true' ? true : (directiveSplit[ 1 ] === 'false' ? false : (\r\n _isNumeric( directiveSplit[ 1 ] ) ? parseInt( directiveSplit[ 1 ] ) : directiveSplit[ 1 ]\r\n ) )\r\n );\r\n return _metaVars;\r\n }, {} );\r\n }\r\n return { get name() { return name; }, get content() { return _el.content; }, json() {\r\n\t\treturn JSON.parse( JSON.stringify( _content ) );\r\n } };\r\n}", "\n/**\n * Converts a string to title case.\n *\n * @param string \tstr\n * @param bool \t\tstrict\n *\n * @return string\n */\nexport default function(str, strict) {\n\tif (typeof str !== 'string') {\n\t\treturn str;\n\t}\n\treturn str.replace(/\\w\\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + ((typeof strict !== undefined && strict) ? txt.substr(1).toLowerCase() : txt.substr(1)); })\n};\n", "\n/**\n * @imports\n */\nimport realdomInit from '@webqit/realdom';\nimport { _wq as __wq } from '@webqit/util/js/index.js';\nimport { _merge } from '@webqit/util/obj/index.js';\nimport { _toTitle } from '@webqit/util/str/index.js';\n\nexport const _wq = ( target, ...args ) => __wq( target, 'oohtml', ...args );\n\nexport const env = {};\n\nexport function _init( name, $config, $defaults ) {\n const window = this, realdom = realdomInit.call( window );\n env.window = window;\n if ( !window.webqitConfig ) {\n window.webqitConfig = realdom.meta( 'webqit' ).json();\n }\n window.webqit || ( window.webqit = {} );\n window.webqit.oohtml || ( window.webqit.oohtml = {} );\n window.webqit.oohtml.configs || ( window.webqit.oohtml.configs = {} );\n // ---------------------\n const configKey = name.toUpperCase().replace( '-', '_' );\n if ( !window.webqit.oohtml.configs[ configKey ] ) {\n window.webqit.oohtml.configs[ configKey ] = {};\n const config = window.webqit.oohtml.configs[ configKey ];\n _merge( 2, config, $defaults, $config, realdom.meta( name ).json() );\n if ( window.webqitConfig.prefix ) {\n Object.keys( config ).forEach( main => {\n Object.keys( config[ main ] ).forEach( key => {\n if ( main === 'api' && typeof config[ main ][ key ] === 'string' ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }${ _toTitle( config[ main ][ key ] ) }`\n } else if ( [ 'attr', 'elements' ].includes( main ) && config[ main ][ key ]?.startsWith( 'data-' ) === false ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }-${ config[ main ][ key ] }`\n }\n } );\n } );\n }\n }\n // ---------------------\n return { config: window.webqit.oohtml.configs[ configKey ], realdom, window };\n}\n\nexport function getInternalAttrInteraction( node, attrName ) {\n\treturn _wq( node, 'internalAttrInteractions' ).get( attrName );\n}\nexport function internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\nexport function _compare( a, b, depth = 1, objectSizing = false ) {\n if ( depth && typeof a === 'object' && a && typeof b === 'object' && b && ( !objectSizing || Object.keys( a ).length === Object.keys( b ).length ) ) {\n for ( let key in a ) {\n if ( !_compare( a[ key ], b[ key ], depth - 1, objectSizing ) ) return false;\n }\n return true;\n }\n if ( Array.isArray( a ) && Array.isArray( b ) && a.length === b.length ) {\n return ( b = b.slice( 0 ).sort() ) && a.slice( 0 ).sort().every( ( valueA, i ) => valueA === b[ i ] );\n }\n return a === b;\n}\n\nexport function _splitOuter( str, delim ) {\n return [ ...str ].reduce( ( [ quote, depth, splits ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}\n\n// Unique ID generator\nexport const _uniqId = () => ( 0 | Math.random() * 9e6 ).toString( 36 );\n\n// Hash of anything generator\nconst hashTable = new Map;\nexport function _toHash( val ) {\n let hash;\n if ( !( hash = hashTable.get( val ) ) ) {\n hash = _uniqId();\n hashTable.set( val, hash );\n }\n return hash;\n}\n\n// Value of any hash\nexport function _fromHash( hash ) {\n let val;\n hashTable.forEach( ( _hash, _val ) => {\n if ( _hash === hash ) val = _val;\n } );\n return val;\n}", "\n/**\n * @imports\n */\nimport { env } from '../util.js';\n\nexport default function() {\n const { window } = env, { webqit } = window;\n if ( webqit.DOMContextRequestEvent ) return webqit.DOMContextRequestEvent;\n class DOMContextRequestEvent extends window.Event {\n /**\n * @constructor\n */\n constructor( ...args ) {\n const callback = args.pop();\n if ( typeof callback !== 'function' ) throw new Error( `Callback must be provided.` );\n const options = args.pop();\n if ( !options?.kind ) throw new Error( `\"options.kind\" must be specified.` );\n const eventNames = [ 'contextrequest', 'contextclaim' ];\n const type = args.pop() || eventNames[ 0 ];\n if ( !eventNames.includes( type ) ) throw new Error( `Invalid event type. Must be one of: ${ eventNames.join( ',' ) }` );\n // -------------\n const { kind, detail, targetContext, live, signal, diff, ...otherOpts } = options;\n super( type, { ...otherOpts, bubbles: otherOpts.bubbles !== false } );\n // -------------\n Object.defineProperty( this, 'callback', { get: () => callback } );\n Object.defineProperty( this, 'kind', { get: () => kind } );\n Object.defineProperty( this, 'targetContext', { get: () => targetContext } );\n Object.defineProperty( this, 'detail', { get: () => detail } );\n Object.defineProperty( this, 'live', { get: () => live } );\n Object.defineProperty( this, 'signal', { get: () => signal } );\n Object.defineProperty( this, 'diff', { get: () => diff } );\n Object.defineProperty( this, 'options', { get: () => otherOpts } );\n Object.defineProperty( this, 'meta', { value: {} } );\n }\n\n get target() { return super.target || this.meta.target; }\n get answered() { return this.meta.answered || false; }\n\n /**\n * @respondWith\n */\n respondWith( response ) {\n this.meta.answered = true;\n if ( this.diff ) {\n if ( '_prevValue' in this && this._prevValue === response ) return;\n Object.defineProperty( this, '_prevValue', { value: response, configurable: true } );\n }\n return this.callback( response );\n }\n }\n webqit.DOMContextRequestEvent = DOMContextRequestEvent;\n return DOMContextRequestEvent;\n}", "\n/**\n * @imports\n */\nimport { env } from '../util.js';\n\nexport default class DOMContextResponse extends AbortController {\n constructor( callback ) {\n super();\n callback( response => {\n const { window: { webqit: { Observer } } } = env;\n Observer.defineProperty( this, 'value', { value: response, configurable: true, enumerable: true } );\n }, this );\n }\n}", "\nexport default class DuplicateContextError extends Error {}", "\n/**\n * @imports\n */\nimport _DOMContextRequestEvent from './_DOMContextRequestEvent.js';\nimport DOMContextResponse from './DOMContextResponse.js';\nimport DOMContext from './DOMContext.js';\nimport DuplicateContextError from './DuplicateContextError.js';\nimport { _ } from '../util.js';\n\nconst waitListMappings = new Map;\nexport default class DOMContexts {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _wq( host ).get( 'contexts::instance' ) || new this( host );;\n }\n\n /**\n * @constructor\n */\n constructor( host ) {\n _wq( host ).get( `contexts::instance` )?.dispose();\n _wq( host ).set( `contexts::instance`, this );\n const priv = { host, contexts: new Set };\n Object.defineProperty( this, '#', { get: () => priv } );\n }\n\n /**\n * @Symbol.iterator\n */\n [ Symbol.iterator ] () { return this[ '#' ].contexts[ Symbol.iterator ](); }\n\n /**\n * @length\n */\n get length() { return this[ '#' ].contexts.size; }\n\n /**\n * @find()\n */\n find( ...args ) {\n return [ ...this[ '#' ].contexts ].find( ctx => {\n if ( typeof args[ 0 ] === 'function' ) return args[ 0 ]( ctx );\n return ctx.constructor.kind === args[ 0 ] && ( !args[ 1 ] || ctx.detail === args[ 1 ] );\n } );\n }\n\n /**\n * @attach()\n */\n attach( ctx ) {\n if ( !( ctx instanceof DOMContext) ) throw new TypeError( `Context is not a valid DOMContext instance.` );\n if ( this.find( ctx.constructor.kind, ctx.detail ) ) {\n throw new DuplicateContextError( `Context of same kind \"${ ctx.constructor.kind }\"${ ctx.detail ? ` and detail \"${ ctx.detail }\"` : '' } already exists.` );\n }\n this[ '#' ].contexts.add( ctx );\n ctx.initialize( this[ '#' ].host );\n }\n\n /**\n * @detach()\n */\n detach( ctx ) {\n ctx.dispose( this[ '#' ].host );\n this[ '#' ].contexts.delete( ctx );\n }\n\n /**\n * @request()\n */\n request( ...args ) {\n return new DOMContextResponse( ( emitter, responseInstance ) => {\n if ( typeof args[ args.length - 1 ] !== 'function' ) {\n if ( !args[ args.length - 1 ] ) { args[ args.length - 1 ] = emitter; }\n else { args.push( emitter ); }\n }\n\n let options;\n if ( ( options = args.find( arg => typeof arg === 'object' && arg ) ) && options.live ) {\n if ( options.signal ) options.signal.addEventListener( 'abort', () => responseInstance.abort() );\n args[ args.indexOf( options ) ] = { ...options, signal: responseInstance.signal };\n }\n const event = new ( _DOMContextRequestEvent() )( ...args );\n this[ '#' ].host.dispatchEvent( event );\n } );\n }\n\n}", "\n/**\n * @imports\n */\nimport DOMContexts from './DOMContexts.js';\nimport { env } from '../util.js';\n\nexport default class DOMContext {\n\n /**\n * To be implemented by subclasses\n */\n static kind;\n\n /**\n * @createRequest\n */\n static createRequest() { return { kind: this.kind }; }\n \n /**\n * @constructor\n */\n constructor( detail = null ) {\n Object.defineProperty( this, 'detail', { get: () => detail } );\n Object.defineProperty( this, 'subscriptions', { value: new Set } );\n }\n\n /**\n * @configs\n */\n get configs() {\n const { window: { webqit: { oohtml: { configs } } } } = env;\n return configs;\n }\n\n /**\n * @name\n */\n get name() { return [ env.window.Document, env.window.ShadowRoot ].some( x => this.host instanceof x ) ? Infinity : this.host.getAttribute( this.configs.CONTEXT_API.attr.contextname ); }\n\n /**\n * @subscribed()\n */\n subscribed( event ) {}\n\n /**\n * @handle()\n */\n handle( event ) {}\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) {}\n\n /**\n * @matchEvent\n */\n matchEvent( event ) {\n return event.kind === this.constructor.kind\n && ( !event.targetContext || event.targetContext === this.name );\n }\n\n /**\n * @handleEvent()\n */\n handleEvent( event ) {\n if ( this.disposed || typeof event.respondWith !== 'function' ) return;\n if ( event.type === 'contextclaim' ) {\n if ( !( event.detail instanceof DOMContext ) || event.target === this.host ) return;\n const claims = new Set;\n this.subscriptions.forEach( subscriptionEvent => {\n if ( !event.target.contains( subscriptionEvent.target ) || !event.detail.matchEvent( subscriptionEvent ) ) return;\n this.subscriptions.delete( subscriptionEvent );\n this.unsubscribed( subscriptionEvent );\n claims.add( subscriptionEvent );\n } );\n if ( claims.size ) { return event.respondWith( claims ); }\n }\n if ( event.type === 'contextrequest' ) {\n if ( !this.matchEvent( event ) ) return;\n if ( event.live ) {\n this.subscriptions.add( event );\n this.subscribed( event );\n event.signal?.addEventListener( 'abort', () => {\n this.subscriptions.delete( event );\n this.unsubscribed( event );\n } );\n }\n event.stopPropagation();\n return this.handle( event );\n }\n }\n\n /**\n * @initialize()\n */\n initialize( host ) {\n this.host = host;\n this.disposed = false;\n host.addEventListener( 'contextrequest', this );\n host.addEventListener( 'contextclaim', this );\n const { value: claims } = DOMContexts.instance( host ).request( 'contextclaim', { kind: this.constructor.kind, detail: this } );\n claims?.forEach( subscriptionEvent => {\n this.subscriptions.add( subscriptionEvent );\n this.subscribed( subscriptionEvent );\n this.handle( subscriptionEvent );\n } );\n return this;\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n this.disposed = true;\n host.removeEventListener( 'contextrequest', this );\n host.removeEventListener( 'contextclaim', this );\n this.subscriptions.forEach( subscriptionEvent => {\n this.subscriptions.delete( subscriptionEvent );\n this.unsubscribed( subscriptionEvent );\n const { target } = subscriptionEvent;\n subscriptionEvent.meta.answered = false;\n target.dispatchEvent( subscriptionEvent );\n } );\n return this;\n }\n\n}", "\n/**\n * @imports\n */\nimport DOMContext from '../context-api/DOMContext.js';\nimport { env } from '../util.js';\n\nexport default class DOMNamingContext extends DOMContext {\n\n static kind = 'namespace';\n\n /**\n * @createRequest\n */\n static createRequest( detail = null ) {\n const request = super.createRequest();\n if ( detail?.startsWith( '@' ) ) {\n const [ targetContext, ...detail ] = detail.slice( 1 ).split( '/' ).map( s => s.trim() );\n request.targetContext = targetContext;\n request.detail = detail.join( '/' );\n } else { request.detail = detail; }\n return request;\n }\n\n /**\n * @namespaceObj\n */\n get namespaceObj() { return this.host[ this.configs.NAMESPACED_HTML.api.namespace ]; }\n\n /**\n * @handle()\n */\n handle( event ) {\n const { window: { webqit: { Observer } } } = env;\n // Any existing event.meta.controller? Abort!\n event.meta.controller?.abort();\n\n // Parse and translate detail\n if ( !( event.detail || '' ).trim() ) return event.respondWith( Observer.unproxy( this.namespaceObj ) );\n let path = ( event.detail || '' ).split( '/' ).map( x => x.trim() ).filter( x => x );\n if ( !path.length ) return event.respondWith();\n path = path.join( `/${ this.configs.NAMESPACED_HTML.api.namespace }/` )?.split( '/' ) || [];\n\n event.meta.controller = Observer.reduce( this.namespaceObj, path, Observer.get, descriptor => {\n if ( this.disposed ) return; // If already scheduled but aborted as in provider unmounting\n event.respondWith( descriptor.value );\n }, { live: event.live, signal: event.signal, descripted: true } );\n }\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) { event.meta.controller?.abort(); }\n}\n", "\n/**\n * @imports\n */\nimport DOMNamingContext from './DOMNamingContext.js';\nimport { _wq, _init, _splitOuter, _fromHash, _toHash, getInternalAttrInteraction, internalAttrInteraction } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'namespaced-html', $config, {\n\t\tattr: { namespace: 'namespace', lid: 'id', },\n\t\tapi: { namespace: 'namespace', },\n\t\ttokens: { lidrefPrefix: '~', lidrefSeparator: ':' },\n\t\ttarget: { className: ':target', eventName: ':target', scrolling: true },\n } );\n\tconfig.lidSelector = `[${ window.CSS.escape( config.attr.lid ) }]`;\n\tconfig.namespaceSelector = `[${ window.CSS.escape( config.attr.namespace ) }]`;\n window.webqit.DOMNamingContext = DOMNamingContext;\n exposeAPIs.call( window, config );\n realtime.call( window, config );\n}\n\n/**\n * @init\n * \n * @param Object config\n * \n * @return String\n */\nfunction lidUtil( config ) {\n\tconst { lidrefPrefix, lidrefSeparator, } = config.tokens;\n\treturn {\n\t\tescape( str, mode = 1 ) { return [ ...str ].map( x => !/\\w/.test( x ) ? ( mode === 2 ? `\\\\\\\\${ x }` : `\\\\${ x }` ) : x ).join( '' ); },\n\t\tlidrefPrefix( escapeMode = 0 ) { return escapeMode ? this.escape( lidrefPrefix, escapeMode ) : lidrefPrefix; },\n\t\tlidrefSeparator( escapeMode = 0 ) { return escapeMode ? this.escape( lidrefSeparator, escapeMode ) : lidrefSeparator; },\n\t\tisUuid( str, escapeMode = 0 ) { return str.startsWith( this.lidrefPrefix( escapeMode ) ) && str.includes( this.lidrefSeparator( escapeMode ) ); },\n\t\t//isLidref( str, escapeMode = 0 ) { return str.startsWith( this.lidrefPrefix( escapeMode ) ) && !str.includes( this.lidrefSeparator( escapeMode ) ); },\n\t\ttoUuid( hash, lid, escapeMode = 0 ) { return hash.endsWith( '-root' ) ? lid : `${ this.lidrefPrefix( escapeMode ) }${ hash }${ this.lidrefSeparator( escapeMode ) }${ lid }`; },\n\t\tuuidToId( str, escapeMode = 0 ) { return this.isUuid( str ) ? str.split( this.lidrefSeparator( escapeMode ) )[ 1 ] : str; },\n\t\tuuidToLidref( str, escapeMode = 0 ) { return this.isUuid( str ) ? `${ this.lidrefPrefix( escapeMode ) }${ str.split( this.lidrefSeparator( escapeMode ) )[ 1 ] }` : str; },\n\t}\n}\n\n/**\n * @rewriteSelector\n * \n * @param String selectorText\n * @param String namespaceUUID\n * @param String scopeSelector\n * @param Bool escapeMode\n * \n * @return String\n */\nexport function rewriteSelector( selectorText, namespaceUUID, scopeSelector = null, escapeMode = 0 ) {\n\tconst window = this, { webqit: { oohtml: { configs: { NAMESPACED_HTML: config } } } } = window;\n\tconst $lidUtil = lidUtil( config );\n\t// Match :scope and relative ID selector\n\tconst regex = new RegExp( `${ scopeSelector ? `:scope|` : '' }#(${ $lidUtil.lidrefPrefix( escapeMode + 1 ) })?([\\\\w]+${ $lidUtil.lidrefSeparator( escapeMode + 1 ) })?((?:[\\\\w-]|\\\\\\\\.)+)`, 'g' );\n\t// Parse potentially combined selectors individually and categorise into categories per whether they have :scope or not\n\tconst [ cat1, cat2 ] = _splitOuter( selectorText, ',' ).reduce( ( [ cat1, cat2 ], selector ) => {\n\t\t// The deal: match and replace\n\t\tlet quotesMatch, hadScopeSelector;\n\t\tselector = selector.replace( regex, ( match, lidrefPrefixMatch, lidrefSeparatorMatch, id, index ) => {\n\t\t\tif ( !quotesMatch ) { // Lazy: stuff\n\t\t\t\t// Match strings between quotes (single or double) and use that qualify matches above\n\t\t\t\t// The string: String.raw`She said, \"Hello, John. I\\\"m your friend.\" or \"you're he're\" 'f\\'\"j\\'\"f'jfjf`;\n\t\t\t\t// Should yield: `\"Hello, John. I\\\\\"m your friend.\"`, `\"you're he're\"`, `'f\\\\'\"j\\\\'\"f'`\n\t\t\t\tquotesMatch = [ ...selector.matchAll( /([\"'])(?:(?=(\\\\?))\\2.)*?\\1/g ) ];\n\t\t\t}\n\t\t\t// Qualify match\n\t\t\tif ( quotesMatch.some( q => index > q.index && index + match.length < q.index + q[ 0 ].length ) ) return match;\n\t\t\t// Replace :scope\n\t\t\tif ( match === ':scope' ) {\n\t\t\t\thadScopeSelector = true;\n\t\t\t\treturn scopeSelector;\n\t\t\t}\n\t\t\tconst isLidref = lidrefPrefixMatch && !lidrefSeparatorMatch;\n\t\t\tconst isUuid = lidrefPrefixMatch && lidrefSeparatorMatch;\t\t\t\n\t\t\tif ( isUuid ) {\n\t\t\t\treturn `#${ $lidUtil.escape( match.replace( '#', '' ), 1 ) }`;\n\t\t\t}\n\t\t\t// Rewrite relative ID selector\n\t\t\tif ( isLidref ) {\n\t\t\t\tif ( config.attr.lid === 'id' && namespaceUUID && !namespaceUUID.endsWith( '-root' ) ) {\n\t\t\t\t\treturn `#${ $lidUtil.toUuid( namespaceUUID, id, 1 ) }`;\n\t\t\t\t}\n\t\t\t\t// Fallback to attr-based\n\t\t\t}\n\t\t\t// Rewrite absolute ID selector\n\t\t\tlet rewrite;\n\t\t\tif ( config.attr.lid === 'id' ) {\n\t\t\t\trewrite = `:is(#${ id },[id^=\"${ $lidUtil.lidrefPrefix( escapeMode ) }\"][id$=\"${ $lidUtil.lidrefSeparator( escapeMode ) }${ id }\"])`;\n\t\t\t} else {\n\t\t\t\trewrite = `:is(#${ id },[${ window.CSS.escape( config.attr.lid ) }=\"${ id }\"])`;\n\t\t\t}\n\t\t\treturn isLidref ? `:is(${ rewrite }):not(${ scopeSelector ? scopeSelector + ' ' : '' }${ config.namespaceSelector } *)` : rewrite;\n\t\t} );\n\t\t// Category 2 has :scope and category 1 does not\n\t\treturn hadScopeSelector ? [ cat1, cat2.concat( selector ) ] : [ cat1.concat( selector ), cat2 ];\n\t}, [ [], [] ] );\n\t// Do the upgrade\n\tlet newSelectorText;\n\tif ( scopeSelector && cat1.length ) {\n\t\tnewSelectorText = [ cat1.length > 1 ? `${ scopeSelector } :is(${ cat1.join( ', ' ) })` : `${ scopeSelector } ${ cat1[ 0 ] }`, cat2.join( ', ' ) ].filter( x => x ).join( ', ' );\n\t} else {\n\t\tnewSelectorText = [ ...cat1, ...cat2 ].join( ', ' );\n\t}\n\treturn newSelectorText;\n}\n\n/**\n * @param Element node\n *\n * @return Object\n */\nexport function getOwnNamespaceObject( node ) {\n\tconst window = this;\n\tif ( !_wq( node ).has( 'namespace' ) ) {\n\t\tconst namespaceObj = Object.create( null );\n\t\t_wq( node ).set( 'namespace', namespaceObj );\n\t\tconst isDocumentRoot = [ window.Document, window.ShadowRoot ].some( x => node instanceof x );\n\t\tObject.defineProperty( namespaceObj, Symbol.toStringTag, { get() {\n\t\t\treturn isDocumentRoot ? 'RootNamespaceRegistry' : 'NamespaceRegistry';\n\t\t} } );\n\t}\n\treturn _wq( node ).get( 'namespace' );\n}\n\n/**\n * @param Element node\n * @param Bool forID\n *\n * @return Object\n */\nexport function getOwnerNamespaceObject( node, forID = false ) {\n\tconst window = this, { webqit: { oohtml: { configs: { NAMESPACED_HTML: config } } } } = window;\n\tconst isDocumentRoot = [ window.Document, window.ShadowRoot ].some( x => node instanceof x );\n\treturn getOwnNamespaceObject.call( window, isDocumentRoot ? node : ( ( forID ? node.parentNode : node )?.closest/*can be documentFragment when Shadow DOM*/?.( config.namespaceSelector ) || node.getRootNode() ) );\n}\n\n/**\n * @param Object namespaceObj\n *\n * @return String\n */\nexport function getNamespaceUUID( namespaceObj ) {\n\tconst isDocumentRoot = Object.prototype.toString.call( namespaceObj ) === '[object RootNamespaceRegistry]';\n return ( _fromHash( namespaceObj ) || _toHash( namespaceObj ) ) + ( isDocumentRoot ? '-root' : '' );\n}\n\n/**\n * Exposes Namespaced HTML with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this, { webqit: { Observer } } = window;\n // The Namespace API\n [ window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = prototype === window.Document.prototype ? 'Document' : ( prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element' );\n if ( config.api.namespace in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.namespace }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.namespace, { get: function() {\n\t\t\treturn Observer.proxy( getOwnNamespaceObject.call( window, this ) );\n\t\t} } );\n } );\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { Observer, realdom, oohtml: { configs }, DOMNamingContext } } = window;\n\t\n\t// ------------\n\t// APIS\n // ------------\n\t// See https://wicg.github.io/aom/aria-reflection-explainer.html & https://github.com/whatwg/html/issues/3515 for the ARIA refelction properties idea\n\t// See https://www.w3.org/TR/wai-aria-1.1/#attrs_relationships for the relational ARIA attributes\n\tconst idRefsAttrs = [ 'aria-owns', 'aria-controls', 'aria-labelledby', 'aria-describedby', 'aria-flowto', ];\n\tconst idRefAttrs = [ 'for', 'list', 'form', 'aria-activedescendant', 'aria-details', 'aria-errormessage', ];\n\tconst attrList = [ config.attr.lid, ...idRefsAttrs, ...idRefAttrs ];\n\tconst relMap = { id: 'id'/* just in case it's in attrList */, for: 'htmlFor', 'aria-owns': 'ariaOwns', 'aria-controls': 'ariaControls', 'aria-labelledby': 'ariaLabelledBy', 'aria-describedby': 'ariaDescribedBy', 'aria-flowto': 'ariaFlowto', 'aria-activedescendant': 'ariaActiveDescendant', 'aria-details': 'ariaDetails', 'aria-errormessage': 'ariaErrorMessage' };\n\tconst $lidUtil = lidUtil( config );\n\tconst uuidsToLidrefs = ( node, attrName, getter ) => {\n\t\tif ( !getInternalAttrInteraction( node, attrName ) && _wq( node, 'attrOriginals' ).has( attrName ) ) {\n\t\t\treturn _wq( node, 'attrOriginals' ).get( attrName );\n\t\t}\n\t\tconst value = getter();\n\t\tif ( getInternalAttrInteraction( node, attrName ) ) return value;\n\t\treturn value && value.split( ' ' ).map( x => ( x = x.trim() ) && ( attrName === config.attr.lid ? $lidUtil.uuidToId : $lidUtil.uuidToLidref ).call( $lidUtil, x ) ).join( ' ' );\n\t};\n\n\t// Intercept getElementById()\n\tconst getElementByIdDescr = Object.getOwnPropertyDescriptor( window.Document.prototype, 'getElementById' );\n\tObject.defineProperty( window.Document.prototype, 'getElementById', { ...getElementByIdDescr, value( id ) {\n\t\treturn this.querySelector( `#${ id }` ); // To be rewritten at querySelector()\n\t} } );\n\t// Intercept querySelector() and querySelectorAll()\n\tfor ( const queryApi of [ 'querySelector', 'querySelectorAll' ] ) {\n\t\tfor ( nodeApi of [ window.Document, window.Element ] ) {\n\t\t\tconst querySelectorDescr = Object.getOwnPropertyDescriptor( nodeApi.prototype, queryApi );\n\t\t\tObject.defineProperty( nodeApi.prototype, queryApi, { ...querySelectorDescr, value( selector ) {\n\t\t\t\treturn querySelectorDescr.value.call( this, rewriteSelector.call( window, selector, getNamespaceUUID( getOwnNamespaceObject.call( window, this ) ) ) );\n\t\t\t} } );\n\t\t}\n\t}\n\t// Intercept getAttribute()\n\tconst getAttributeDescr = Object.getOwnPropertyDescriptor( window.Element.prototype, 'getAttribute' );\n\tObject.defineProperty( window.Element.prototype, 'getAttribute', { ...getAttributeDescr, value( attrName ) {\n\t\tconst getter = () => getAttributeDescr.value.call( this, attrName );\n\t\treturn attrList.includes( attrName ) && !_wq( this, 'lock' ).get( attrName ) ? uuidsToLidrefs( this, attrName, getter ) : getter();\n\t} } );\n\t// Hide implementation details on the Attr node too.\n\tconst propertyDescr = Object.getOwnPropertyDescriptor( window.Attr.prototype, 'value' );\n\tObject.defineProperty( window.Attr.prototype, 'value', { ...propertyDescr, get() {\n\t\tconst getter = () => propertyDescr.get.call( this );\n\t\treturn attrList.includes( this.name ) ? uuidsToLidrefs( this.ownerElement, this.name, getter ) : getter();\n\t} } );\n\tconst propertyDescr2 = Object.getOwnPropertyDescriptor( window.Node.prototype, 'nodeValue' );\n\tObject.defineProperty( window.Node.prototype, 'nodeValue', { ...propertyDescr2, get() {\n\t\tconst getter = () => propertyDescr2.get.call( this );\n\t\treturn this instanceof window.Attr && attrList.includes( this.name ) ? uuidsToLidrefs( this.ownerElement, this.name, getter ) : getter();\n\t} } );\n\t// These APIs should return LIDREFS minus the hash part\n\tfor ( const attrName of attrList ) {\n\t\tif ( !( attrName in relMap ) ) continue;\n\t\tconst domApis = attrName === 'for' ? [ window.HTMLLabelElement, window.HTMLOutputElement ] : [ window.Element ];\n\t\tfor ( const domApi of domApis ) {\n\t\t\tconst propertyDescr = Object.getOwnPropertyDescriptor( domApi.prototype, relMap[ attrName ] );\n\t\t\tif ( !propertyDescr ) continue;\n\t\t\tObject.defineProperty( domApi.prototype, relMap[ attrName ], { ...propertyDescr, get() {\n\t\t\t\tconst getter = () => propertyDescr.get.call( this, attrName );\n\t\t\t\treturn uuidsToLidrefs( this, attrName, getter );\n\t\t\t} } );\n\t\t}\n\t}\n\tif ( config.attr.lid !== 'id' ) {\n\t\t// Reflect the custom [config.attr.lid] attribute\n\t\tObject.defineProperty( window.Element.prototype, config.attr.lid, { configurable: true, enumerable: true, get() {\n\t\t\treturn this.getAttribute( config.attr.lid );\n\t\t}, set( value ) {\n\t\t\treturn this.setAttribute( config.attr.lid, value );\n\t\t} } );\n\t}\n\n\t// ------------\n // LOCAL IDS & IDREFS\n // ------------\n\tconst attrChange = ( entry, attrName, value, callback ) => {\n\t\treturn internalAttrInteraction( entry, attrName, () => {\n\t\t\tif ( typeof value === 'function' ) value = value();\n\t\t\treturn callback( value );\n\t\t} );\n\t};\n\tconst setupBinding = ( entry, attrName, value, newNamespaceObj = null ) => {\n\t\tattrChange( entry, attrName, value, value => {\n\t\t\tconst isLidAttr = attrName === config.attr.lid;\n\t\t\tconst namespaceObj = newNamespaceObj || getOwnerNamespaceObject.call( window, entry, isLidAttr );\n\t\t\tconst namespaceUUID = getNamespaceUUID( namespaceObj );\n\t\t\tif ( isLidAttr ) {\n\t\t\t\tconst id = $lidUtil.uuidToId( value );\n\t\t\t\tif ( Observer.get( namespaceObj, id ) !== entry ) {\n\t\t\t\t\tconst uuid = $lidUtil.toUuid( namespaceUUID, id );\n\t\t\t\t\tif ( uuid !== value ) { entry.setAttribute( 'id', uuid ); }\n\t\t\t\t\tObserver.set( namespaceObj, id, entry );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t_wq( entry, 'attrOriginals' ).set( attrName, value ); // Save original before rewrite\n\t\t\t\tconst newAttrValue = value.split( ' ' ).map( idref => ( idref = idref.trim() ) && $lidUtil.isUuid( idref ) ? idref : $lidUtil.toUuid( namespaceUUID, idref ) ).join( ' ' );\n\t\t\t\tentry.setAttribute( attrName, newAttrValue );\n\t\t\t\t_wq( namespaceObj ).set( 'idrefs', _wq( namespaceObj ).get( 'idrefs' ) || new Set );\n\t\t\t\t_wq( namespaceObj ).get( 'idrefs' ).add( entry );\n\t\t\t}\n\t\t} );\n\t};\n\tconst cleanupBinding = ( entry, attrName, oldValue, prevNamespaceObj = null ) => {\n\t\tattrChange( entry, attrName, oldValue, oldValue => {\n\t\t\tconst isLidAttr = attrName === config.attr.lid;\n\t\t\tconst namespaceObj = prevNamespaceObj || getOwnerNamespaceObject.call( window, entry, isLidAttr );\n\t\t\tif ( isLidAttr ) {\n\t\t\t\tconst id = $lidUtil.uuidToId( oldValue );\n\t\t\t\tif ( Observer.get( namespaceObj, id ) === entry ) {\n\t\t\t\t\tObserver.deleteProperty( namespaceObj, id );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst newAttrValue = _wq( entry, 'attrOriginals' ).get( attrName );// oldValue.split( ' ' ).map( lid => ( lid = lid.trim() ) && $lidUtil.uuidToLidref( lid ) ).join( ' ' );\n\t\t\t\tif ( entry.hasAttribute( attrName ) ) entry.setAttribute( attrName, newAttrValue );\n\t\t\t\t_wq( namespaceObj ).get( 'idrefs' )?.delete( entry );\n\t\t\t}\n\t\t} );\n\t};\n\n // ------------\n // NAMESPACE\n // ------------\n realdom.realtime( window.document ).query( config.namespaceSelector, record => {\n\t\tconst reAssociate = ( entry, attrName, oldNamespaceObj, newNamespaceObj ) => {\n\t\t\tif ( !entry.hasAttribute( attrName ) ) return;\n\t\t\tconst attrValue = () => entry.getAttribute( attrName );\n\t\t\tcleanupBinding( entry, attrName, attrValue/* Current resolved value as-is */, oldNamespaceObj );\n\t\t\tif ( entry.isConnected ) { setupBinding( entry, attrName, _wq( entry, 'attrOriginals' ).get( attrName )/* Saved original value */ || attrValue/* Lest it's ID */, newNamespaceObj ); }\n\t\t};\n record.exits.forEach( entry => {\n\t\t\tif ( entry.isConnected ) {\n\t\t\t\tconst namespaceObj = getOwnNamespaceObject.call( window, entry );\n\t\t\t\t// Detach ID and IDREF associations\n\t\t\t\tfor ( const node of new Set( [ ...Object.values( namespaceObj ), ...( _wq( namespaceObj ).get( 'idrefs' ) || [] ) ] ) ) {\n\t\t\t\t\tfor ( const attrName of attrList ) { reAssociate( node, attrName, namespaceObj ); }\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Detach ID associations\n\t\t\tconst contextsApi = entry[ configs.CONTEXT_API.api.contexts ];\n\t\t\tconst ctx = contextsApi.find( DOMNamingContext.kind );\n\t\t\t// Detach namespace instance\n\t\t\tif ( ctx ) { contextsApi.detach( ctx ); }\n } );\n record.entrants.forEach( entry => {\n\t\t\t// Claim ID and IDREF associations\n\t\t\tlet newSuperNamespaceObj;\n\t\t\tconst superNamespaceObj = getOwnerNamespaceObject.call( window, entry, true );\n\t\t\tfor ( const node of new Set( [ ...Object.values( superNamespaceObj ), ...( _wq( superNamespaceObj ).get( 'idrefs' ) || [] ) ] ) ) {\n\t\t\t\tif ( ( newSuperNamespaceObj = getOwnerNamespaceObject.call( window, node, true ) ) === superNamespaceObj ) continue;\n\t\t\t\tfor ( const attrName of attrList ) { reAssociate( node, attrName, superNamespaceObj, newSuperNamespaceObj ); }\n\t\t\t}\n\t\t\t// Attach namespace instance\n\t\t\tconst contextsApi = entry[ configs.CONTEXT_API.api.contexts ];\n\t\t\tif ( !contextsApi.find( DOMNamingContext.kind ) ) { contextsApi.attach( new DOMNamingContext ); }\n } );\n }, { id: 'namespace-html:namespace', live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true, eventDetails: true } );\n\n\t// DOM realtime\n\trealdom.realtime( window.document ).query( `[${ attrList.map( attrName => window.CSS.escape( attrName ) ).join( '],[' ) }]`, record => {\n\t\t// We do some caching to prevent redundanct lookups\n\t\tconst namespaceNodesToTest = { forID: new Map, forOther: new Map, };\n\t\tfor ( const attrName of attrList ) {\n\t\t\t// Point to the right cache\n\t\t\tconst _namespaceNodesToTest = attrName === config.attr.lid ? namespaceNodesToTest.forID : namespaceNodesToTest.forOther;\n\t\t\trecord.exits.forEach( entry => {\n\t\t\t\tif ( !entry.hasAttribute( attrName ) ) return;\n\t\t\t\t// Point to the right namespace node\n\t\t\t\tlet namespaceNodeToTest = _namespaceNodesToTest.get( entry );\n\t\t\t\tif ( typeof namespaceNodeToTest === 'undefined' ) {\n\t\t\t\t\tnamespaceNodeToTest = ( attrName === config.attr.lid ? entry.parentNode : entry )?.closest/*can be documentFragment when Shadow DOM*/?.( config.namespaceSelector ) || entry.getRootNode().host;\n\t\t\t\t\t_namespaceNodesToTest.set( entry, namespaceNodeToTest );\n\t\t\t\t}\n\t\t\t\tif ( namespaceNodeToTest && !namespaceNodeToTest.isConnected ) return;\n\t\t\t\tcleanupBinding( entry, attrName, () => entry.getAttribute( attrName )/* Current resolved value as-is */ );\n\t\t\t} );\n\t\t\trecord.entrants.forEach( entry => {\n\t\t\t\tif ( !entry.hasAttribute( attrName ) ) return;\n\t\t\t\tsetupBinding( entry, attrName, () => entry.getAttribute( attrName )/* Raw value (as-is) that will be saved as original */ );\n\t\t\t} );\n\t\t}\n\t\tnamespaceNodesToTest.forID.clear();\n\t\tnamespaceNodesToTest.forOther.clear();\n\t}, { id: 'namespace-html:attrs', live: true, subtree: 'cross-roots', timing: 'sync' } );\n\t// Attr realtime\n\trealdom.realtime( window.document, 'attr' ).observe( attrList, records => {\n\t\tfor ( const record of records ) {\n\t\t\tif ( record.oldValue ) { cleanupBinding( record.target, record.name, record.oldValue/* Current resolved value as-is */ ); }\n\t\t\tif ( record.value ) { setupBinding( record.target, record.name, record.value/* Raw value (as-is) that will be saved as original */ ); }\n\t\t}\n\t}, { id: 'namespace-html:attr(attrs)', subtree: 'cross-roots', timing: 'sync', newValue: true, oldValue: true } );\n\n // ------------\n\t// TARGETS\n // ------------\n\tlet prevTarget;\n\tconst activateTarget = () => {\n\t\tif ( !window.location.hash?.startsWith( `#${ $lidUtil.lidrefPrefix() }` ) ) return;\n\t\tconst path = window.location.hash?.substring( `#${ $lidUtil.lidrefPrefix() }`.length ).split( '/' ).map( s => s.trim() ).filter( s => s ) || [];\n\t\tconst currTarget = path.reduce( ( prev, segment ) => prev && prev[ config.api.namespace ][ segment ], window.document );\n\t\tif ( prevTarget && config.target.className ) { prevTarget.classList.toggle( config.target.className, false ); }\n\t\tif ( currTarget && currTarget !== window.document ) {\n\t\t\tif ( config.target.className ) { currTarget.classList.toggle( config.target.className, true ); }\n\t\t\tif ( config.target.eventName ) { currTarget.dispatchEvent( new window.CustomEvent( config.target.eventName ) ); }\n\t\t\tif ( config.target.scrolling && path.length > 1 ) { currTarget.scrollIntoView(); }\n\t\t\tprevTarget = currTarget;\n\t\t}\n\t};\n\t// \"hash\" realtime\n\twindow.addEventListener( 'hashchange', activateTarget );\n\trealdom.ready( activateTarget );\n\t// ----------------\n}\n", "\n/**\n * @imports\n */\nimport { resolveParams } from '@webqit/quantum-js/params';\nimport { _wq, _init, _toHash, _fromHash } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init({ advanced = {}, ...$config }) {\n const { config, window } = _init.call( this, 'scoped-js', $config, {\n script: { retention: 'retain', mimeTypes: 'module|text/javascript|application/javascript', timing: 'auto' },\n api: { scripts: 'scripts' },\n advanced: resolveParams(advanced),\n } );\n const customTypes = Array.isArray( config.script.mimeTypes ) ? config.script.mimeTypes : config.script.mimeTypes.split( '|' ).filter( t => t );\n config.scriptSelector = customTypes.map( t => `script[type=\"${ window.CSS.escape( t ) }\"]:not([oohtmlignore])` ).concat(`script:not([type])`).join( ',' );\n window.webqit.oohtml.Script = {\n compileCache: [ new Map, new Map, ],\n execute: execute.bind( window, config ),\n };\n exposeAPIs.call( window, config );\n realtime.call( window, config );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this, scriptsMap = new Map;\n if ( config.api.scripts in window.Element.prototype ) { throw new Error( `The \"Element\" class already has a \"${ config.api.scripts }\" property!` ); }\n [ window.ShadowRoot.prototype, window.Element.prototype ].forEach( proto => {\n Object.defineProperty( proto, config.api.scripts, { get: function() {\n if ( !scriptsMap.has( this ) ) { scriptsMap.set( this, [] ); }\n return scriptsMap.get( this );\n }, } );\n } );\n Object.defineProperties( window.HTMLScriptElement.prototype, {\n scoped: {\n configurable: true,\n get() { return this.hasAttribute( 'scoped' ); },\n set( value ) { this.toggleAttribute( 'scoped', value ); },\n },\n quantum: {\n configurable: true,\n get() { return this.hasAttribute( 'quantum' ); },\n set( value ) { this.toggleAttribute( 'quantum', value ); },\n },\n } );\n}\n\n// Script runner\nasync function execute( config, execHash ) {\n const window = this, { realdom } = window.webqit;\n const exec = _fromHash( execHash );\n if ( !exec ) throw new Error( `Argument must be a valid exec hash.` );\n const { script, compiledScript, thisContext } = exec;\n // Honour retention flag\n if ( config.script.retention === 'dispose' ) {\n script.remove();\n } else if ( config.script.retention === 'hidden' ) {\n script.textContent = `\"source hidden\"`;\n } else {\n script.textContent = await compiledScript.toString();\n }\n // Execute and save state\n const varScope = script.scoped ? thisContext : script.getRootNode();\n if ( !_wq( varScope ).has( 'scriptEnv' ) ) {\n _wq( varScope ).set( 'scriptEnv', Object.create( null ) );\n }\n const state = await ( await compiledScript.bind( thisContext, _wq( varScope ).get( 'scriptEnv' ) ) ).execute();\n if ( script.quantum ) { Object.defineProperty( script, 'state', { value: state } ); }\n realdom.realtime( window.document ).observe( script, () => {\n if ( script.quantum ) { state.dispose(); }\n if ( thisContext instanceof window.Element ) { thisContext[ config.api.scripts ]?.splice( thisContext[ config.api.scripts ].indexOf( script, 1 ) ); }\n }, { id: 'scoped-js:script-exits', subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const inBrowser = Object.getOwnPropertyDescriptor( globalThis, 'window' )?.get?.toString().includes( '[native code]' ) ?? false;\n const window = this, { webqit: { oohtml, realdom } } = window;\n if ( !window.HTMLScriptElement.supports ) { window.HTMLScriptElement.supports = type => [ 'text/javascript', 'application/javascript' ].includes( type ); }\n const handled = new WeakSet;\n realdom.realtime( window.document ).query( config.scriptSelector, record => {\n record.entrants.forEach( script => {\n if ( handled.has( script ) || (!inBrowser && !script.hasAttribute('ssr')) ) return;\n // Do compilation\n const compiledScript = compileScript.call( window, config, script );\n if ( !compiledScript ) return;\n handled.add( script );\n // Run now!!!\n const thisContext = script.scoped ? script.parentNode || record.target : ( script.type === 'module' ? undefined : window );\n if ( script.scoped ) { thisContext[ config.api.scripts ].push( script ); }\n const execHash = _toHash( { script, compiledScript, thisContext } );\n const manualHandling = record.type === 'query' || ( script.type && !window.HTMLScriptElement.supports( script.type ) ) || script.getAttribute('data-handling') === 'manual';\n if ( manualHandling || config.script.timing === 'manual' ) { oohtml.Script.execute( execHash ); } else {\n script.textContent = `webqit.oohtml.Script.execute( '${ execHash }' );`;\n }\n } );\n }, { id: 'scoped-js:script-entries', live: true, subtree: 'cross-roots', timing: 'intercept', generation: 'entrants', eventDetails: true } );\n // ---\n}\n\nfunction compileScript( config, script ) {\n const window = this, { webqit: { oohtml, QuantumScript, AsyncQuantumScript, QuantumModule } } = window;\n const textContent = ( script._ = script.textContent.trim() ) && script._.startsWith( '/*@oohtml*/if(false){' ) && script._.endsWith( '}/*@oohtml*/' ) ? script._.slice( 21, -12 ) : script.textContent;\n if ( !textContent.trim().length ) return;\n const sourceHash = _toHash( textContent );\n const compileCache = oohtml.Script.compileCache[ script.quantum ? 0 : 1 ];\n let compiledScript;\n if ( !( compiledScript = compileCache.get( sourceHash ) ) ) {\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n compiledScript = new ( script.type === 'module' ? QuantumModule : ( QuantumScript || AsyncQuantumScript ) )( textContent, {\n exportNamespace: `#${ script.id }`,\n fileName: `${ window.document.url?.split( '#' )?.[ 0 ] || '' }#${ script.id }`,\n parserParams: { ...parserParams, executionMode: script.quantum && 'QuantumProgram' || 'RegularProgram' },\n compilerParams,\n runtimeParams,\n } );\n compileCache.set( sourceHash, compiledScript );\n }\n return compiledScript;\n}\n\nexport function idleCompiler( node ) {\n const window = this, { webqit: { oohtml: { configs: { SCOPED_JS: config } } } } = window;\n [ ...( node?.querySelectorAll( config.scriptSelector ) || [] ) ].forEach( script => {\n compileScript.call( window, config, script );\n } );\n}", "import { resolveParams } from '@webqit/quantum-js/params';\nimport { xpathQuery } from '@webqit/realdom/src/realtime/Util.js';\nimport { _wq, _init, _splitOuter } from '../util.js';\n\n/**\n * Initializes DOM Parts.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'data-binding', $config, {\n attr: { render: 'render', itemIndex: 'data-key' },\n tokens: { nodeType: 'processing-instruction', tagStart: '?{', tagEnd: '}?', stateStart: '; [=', stateEnd: ']' },\n advanced: resolveParams({ runtimeParams: { spec: { handler: e => {} } } }),\n } );\n ( { CONTEXT_API: config.CONTEXT_API, BINDINGS_API: config.BINDINGS_API, HTML_IMPORTS: config.HTML_IMPORTS } = window.webqit.oohtml.configs );\n config.attrSelector = `[${ window.CSS.escape( config.attr.render ) }]`;\n const discreteBindingsMatch = ( start, end ) => {\n const starting = `starts-with(., \"${ start }\")`;\n const ending = `substring(., string-length(.) - string-length(\"${ end }\") + 1) = \"${ end }\"`;\n return `${ starting } and ${ ending }`;\n }\n config.discreteBindingsSelector = `comment()[${ discreteBindingsMatch( config.tokens.tagStart, config.tokens.tagEnd ) }]`;\n realtime.call( window, config );\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { realdom } } = window;\n\t// ----------------\n /**\n * For an element, render should happen first\n <div render=\"\">\n <?{ content }?>\n </div>\n */\n realdom.realtime( window.document ).query( config.attrSelector, record => {\n cleanup.call( this, ...record.exits );\n setTimeout(() => {\n mountInlineBindings.call( window, config, ...record.entrants );\n }, 0);\n }, { id: 'data-binding:attr', live: true, subtree: 'cross-roots', timing: 'sync', eventDetails: true, staticSensitivity: true } );\n realdom.realtime( window.document ).query( `(${ config.discreteBindingsSelector })`, record => {\n setTimeout(() => {\n cleanup.call( this, ...record.exits );\n mountDiscreteBindings.call( window, config, ...record.entrants );\n }, 0);\n }, { id: 'data-binding:descrete', live: true, subtree: 'cross-roots', timing: 'sync' } );\n}\n\nfunction createDynamicScope( config, root ) {\n const { webqit: { realdom, Observer, DOMBindingsContext } } = this;\n if ( _wq( root ).has( 'data-binding' ) ) return _wq( root ).get( 'data-binding' );\n const scope = Object.create( null ), abortController = new AbortController;\n scope[ '$exec__' ] = ( target, prop, ...args ) => {\n const exec = () => {\n try { target[ prop ]( ...args ); }\n catch( e ) { throw new Error( `Error executing \"${ prop }()\": ${ e.message } at ${ e.cause }` ); }\n };\n exec();\n };\n scope[ '$assign__' ] = ( target, prop, val ) => {\n const exec = () => {\n try { target[ prop ] = val; }\n catch( e ) { throw new Error( `Error executing \"${ prop } = ${ val }\": ${ e.message } at ${ e.cause }` ); }\n };\n exec();\n };\n Observer.intercept( scope, {\n get: ( e, recieved, next ) => {\n if ( !( e.key in scope ) ) {\n const request = { ...DOMBindingsContext.createRequest( e.key ), live: true, signal: abortController.signal };\n root[ config.CONTEXT_API.api.contexts ].request( request, value => {\n Observer.set( scope, e.key, value );\n } );\n }\n return next( scope[ e.key ] ?? ( e.key in globalThis ? globalThis[ e.key ] : undefined ) );\n },\n has: ( e, recieved, next ) => { return next( true ); }\n } );\n const instance = { scope, abortController, bindings: new Map };\n _wq( root ).set( 'data-binding', instance );\n return instance;\n}\n\nfunction cleanup( ...entries ) {\n for ( const node of entries ) {\n const root = node.nodeName === '#text' ? node.parentNode : node;\n const { bindings, abortController } = _wq( root ).get( 'data-binding' ) || {};\n if ( !bindings?.has( node ) ) return;\n bindings.get( node ).state.dispose();\n bindings.get( node ).signals?.forEach( s => s.abort() );\n bindings.delete( node );\n if ( !bindings.size ) {\n abortController.abort();\n _wq( root ).delete( 'data-binding' );\n }\n }\n}\n\nfunction patternMatch( config, str ) {\n const tagStart = config.tokens.tagStart.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const tagEnd = config.tokens.tagEnd.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const stateStart = config.tokens.stateStart.split( '' ).map( x => x === ' ' ? `(?:\\\\s+)?` : `\\\\${ x }` ).join( '' );\n const stateEnd = config.tokens.stateEnd.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const pattern = `^${ tagStart }(.*?)(?:${ stateStart }(\\\\d+)${ stateEnd }(?:\\\\s+)?)?${ tagEnd }$`;\n const [ /*raw*/, expr, span ] = str.match( new RegExp( pattern ) );\n return { raw: str, expr, span: parseInt( span ?? 0 ) };\n}\n\nasync function mountDiscreteBindings( config, ...entries ) {\n const window = this;\n const instances = entries.reduce( ( instances, node ) => {\n if ( node.isBound ) return instances;\n const template = patternMatch( config, node.nodeValue );\n let textNode = node;\n if ( template.span ) {\n textNode = node.nextSibling;\n if ( textNode?.nodeName !== '#text' || textNode.nodeValue.length < template.span ) return instances;\n if ( textNode.nodeValue.length > template.span ) { textNode.splitText( template.span ); }\n } else {\n textNode = node.ownerDocument.createTextNode( '' );\n node.after( textNode );\n }\n textNode.isBound = true;\n let anchorNode = node;\n if ( window.webqit.env !== 'server' ) {\n anchorNode.remove();\n anchorNode = null;\n }\n return instances.concat( { textNode, template, anchorNode } );\n }, [] );\n\n for ( const { textNode, template, anchorNode } of instances ) {\n const compiled = compileDiscreteBindings.call( window, config, template.expr );\n const { scope, bindings } = createDynamicScope.call( this, config, textNode.parentNode );\n Object.defineProperty( textNode, '$oohtml_internal_databinding_anchorNode', { value: anchorNode, configurable: true } );\n try {\n bindings.set( textNode, { state: await ( await compiled.bind( textNode, scope ) ).execute(), } );\n } catch( e ) {\n console.log(e);\n }\n }\n}\n\nconst discreteParseCache = new Map;\nfunction compileDiscreteBindings( config, str ) {\n if ( discreteParseCache.has( str ) ) return discreteParseCache.get( str );\n let source = `let content = ((${ str }) ?? '') + '';`;\n source += `$assign__wq(this, 'nodeValue', content);`;\n source += `if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__wq(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', \"${ config.tokens.tagStart }${ escDouble( str ) }${ config.tokens.stateStart }\" + content.length + \"${ config.tokens.stateEnd } ${ config.tokens.tagEnd }\"); }`;\n const { webqit: { QuantumModule } } = this;\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n const compiled = new QuantumModule( source, { parserParams, compilerParams, runtimeParams } );\n discreteParseCache.set( str, compiled );\n return compiled;\n}\n\nasync function mountInlineBindings( config, ...entries ) {\n for ( const node of entries ) {\n const compiled = compileInlineBindings.call( this, config, node.getAttribute( config.attr.render ) );\n const { scope, bindings } = createDynamicScope.call( this, config, node );\n const signals = [];\n Object.defineProperty( node, '$oohtml_internal_databinding_signals', { value: signals, configurable: true } );\n try {\n bindings.set( node, { signals, state: await ( await compiled.bind( node, scope ) ).execute(), } );\n } catch( e ) {\n console.log(e);\n }\n }\n}\n\nconst inlineParseCache = new Map;\nfunction compileInlineBindings( config, str ) {\n if ( inlineParseCache.has( str ) ) return inlineParseCache.get( str );\n const validation = {};\n let $event_i = -1;\n const source = _splitOuter( str, ';' ).map( str => {\n const [ left, right ] = _splitOuter( str, ':' ).map( x => x.trim() );\n const directive = left[ 0 ], param = left.slice( 1 ).trim();\n const arg = `(${ right })`, $arg = `(${ arg } ?? '')`;\n // CSS\n if ( directive === '&' ) {\n if ( param.startsWith( '--' ) ) return `$exec__wq(this.style, 'setProperty', \"${ escDouble( param ) }\", ${ $arg });`;\n return `$assign__wq(this.style, \"${ escDouble( param ) }\", ${ $arg });`;\n }\n // Class list\n if ( directive === '%' ) return `$exec__wq(this.classList, 'toggle', \"${ escDouble( param ) }\", !!${ arg });`;\n // Attribute\n if ( directive === '~' ) {\n if ( param.startsWith( '?' ) ) return `$exec__wq(this, 'toggleAttribute', \"${ escDouble( param.substring( 1 ).trim() ) }\", !!${ arg });`;\n return `$exec__wq(this, 'setAttribute', \"${ escDouble( param ) }\", ${ $arg });`;\n }\n // Structure\n if ( directive === '#' ) {\n if ( validation[ param ] ) throw new Error( `Duplicate binding: ${ left }.` );\n validation[ param ] = true;\n if ( param === 'text' ) return `$assign__wq(this, 'textContent', ${ $arg });`;\n if ( param === 'html' ) return `$assign__wq(this, 'innerHTML', ${ $arg });`;\n if ( param === 'items' ) {\n const [ iterationSpec, importSpec ] = _splitOuter( right, '/' );\n if ( !importSpec ) throw new Error( `Invalid ${ directive }items spec: ${ str }; no import specifier.` );\n let [ raw, production, kind, iteratee ] = iterationSpec.trim().match( /(.*?[\\)\\s+])(of|in)([\\(\\{\\[\\s+].*)/i ) || [];\n if ( !raw ) throw new Error( `Invalid ${ directive }items spec: ${ str }.` );\n if ( production.startsWith( '(' ) ) {\n production = production.trim().slice( 1, -1 ).split( ',' ).map( x => x.trim() );\n } else { production = [ production ]; }\n if ( production.length > ( kind === 'in' ? 3 : 2 ) ) throw new Error( `Invalid ${ directive }items spec: ${ str }.` );\n const indices = kind === 'in' ? production[ 2 ] : ( production[ 1 ] || '$index__' );\n return `\n let $iteratee__ = ${ iteratee };\n let $import__ = this.${ config.HTML_IMPORTS.api.import }( ${ importSpec.trim() }, true );\n this.$oohtml_internal_databinding_signals?.push( $import__ );\n\n if ( $import__.value && $iteratee__ ) {\n let $existing__ = new Map;\n [ ...this.children ].filter( el => el.matches( '[${ config.attr.itemIndex }]' ) ).forEach( x => {\n $existing__.set( x.getAttribute( '${ config.attr.itemIndex }' ), x );\n } );\n ${ indices ? `let ${ indices } = -1;` : '' }\n for ( let ${ production[ 0 ] } ${ kind } $iteratee__ ) {\n ${ indices ? `${ indices } ++;` : '' }\n ${ kind === 'in' && production[ 1 ] ? `let ${ production[ 1 ] } = $iteratee__[ ${ production[ 0 ] } ];` : '' }\n const $itemBinding__ = { ${ production.join( ', ' ) } };\n \n const $key___ = ( ${ kind === 'in' ? production[ 0 ] : indices } ) + '';\n let $itemNode__ = $existing__.get( $key___ );\n if ( $itemNode__ ) {\n $existing__.delete( $key___ );\n $exec__wq($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );\n } else {\n $itemNode__ = ( Array.isArray( $import__.value ) ? $import__.value[ 0 ] : ( $import__.value instanceof window.HTMLTemplateElement ? $import__.value.content.firstElementChild : $import__.value ) ).cloneNode( true );\n $itemNode__.setAttribute( \"${ config.attr.itemIndex }\", $key___ );\n $exec__wq($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );\n $exec__wq(this, 'appendChild', $itemNode__ );\n }\n\n if ( ${ kind === 'in' ? `!( ${ production[ 0 ] } in $iteratee__ )` : `typeof ${ production[ 0 ] } === 'undefined'` } ) { $itemNode__.remove(); }\n }\n $existing__.forEach( x => x.remove() );\n $existing__.clear();\n }`;\n }\n }\n // Events\n if ( directive === '@' ) {\n $event_i++;\n return `\n const handler${ $event_i } = event => ${ right.startsWith('{') ? right : arg };\n this.addEventListener( '${ param }', handler${ $event_i } );\n const abort${ $event_i } = () => this.removeEventListener( '${ param }', handler${ $event_i } );\n this.$oohtml_internal_databinding_signals?.push( { abort: abort${ $event_i } } );\n `;\n }\n // Functions\n if ( directive === '$' ) {\n return `$exec__wq(this, '${ param }', ${ arg });`;\n }\n if ( str.trim() ) throw new Error( `Invalid binding: ${ str }.` );\n } ).join( `\\n` );\n const { webqit: { QuantumModule } } = this;\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n const compiled = new QuantumModule( source, { parserParams, compilerParams, runtimeParams } );\n inlineParseCache.set( str, compiled );\n return compiled;\n}\n\nconst escDouble = str => str.replace(/\"/g, '\\\\\"');\n\nexport function idleCompiler( node ) {\n const window = this, { webqit: { oohtml: { configs: { DATA_BINDING: config } } } } = window;\n // Attr selector must also come first, as in above\n ( node?.matches( config.attrSelector ) ? [ node ] : [] ).concat([ ...( node?.querySelectorAll( config.attrSelector ) || [] ) ]).forEach( node => {\n compileInlineBindings.call( window, config, node.getAttribute( config.attr.render ) );\n } );\n xpathQuery( window, node, `(${ config.discreteBindingsSelector })` ).forEach( node => {\n const template = patternMatch( config, node.nodeValue );\n compileDiscreteBindings.call( window, config, template.expr );\n } );\n}", "\n/**\n * @imports\n */\nimport DOMContext from '../context-api/DOMContext.js';\nimport { env } from '../util.js';\n\nexport default class DOMBindingsContext extends DOMContext {\n\n static kind = 'bindings';\n\n /**\n * @createRequest\n */\n static createRequest( detail = null ) {\n const request = super.createRequest();\n if ( detail?.startsWith( '@' ) ) {\n const [ targetContext, ...detail ] = detail.slice( 1 ).split( '.' ).map( s => s.trim() );\n request.targetContext = targetContext;\n request.detail = detail.join( '.' );\n } else { request.detail = detail; }\n return request;\n }\n\n /**\n * @bindingsObj\n */\n get bindingsObj() { return this.host[ this.configs.BINDINGS_API.api.bindings ]; }\n\n /**\n * @matchesEvent\n */\n matchEvent( event ) {\n return super.matchEvent( event )\n && ( !event.detail || !this.detail || ( Array.isArray( event.detail ) ? event.detail[ 0 ] === this.detail : event.detail === this.detail ) );\n }\n\n /**\n * @handle()\n */\n handle( event ) {\n // Any existing event.meta.controller? Abort!\n event.meta.controller?.abort();\n if ( !( event.detail + '' ).trim() ) return event.respondWith( this.bindingsObj );\n const { window: { webqit: { Observer } } } = env;\n event.meta.controller = Observer.reduce( this.bindingsObj, Array.isArray( event.detail ) ? event.detail : [ event.detail ], Observer.get, descriptor => {\n if ( this.disposed ) return; // If already scheduled but aborted as in provider unmounting\n event.respondWith( descriptor.value );\n }, { live: event.live, signal: event.signal, descripted: true } );\n }\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) { event.meta.controller?.abort(); }\n}\n", "\n/**\n * @imports\n */\nimport DOMBindingsContext from './DOMBindingsContext.js';\nimport { _wq, _init, _splitOuter } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'bindings-api', $config, {\n attr: { bindingsreflection: 'bindings' },\n api: { bind: 'bind', bindings: 'bindings', },\n } );\n window.webqit.DOMBindingsContext = DOMBindingsContext;\n exposeAPIs.call( window, config );\n realtime.call(window, config);\n}\n\n/**\n * @Defs\n * \n * The internal bindings object\n * within elements and the document object.\n */\nfunction getBindings( config, node ) {\n const window = this, { webqit: { Observer, oohtml: { configs: { CONTEXT_API: ctxConfig } } } } = window;\n\tif ( !_wq( node ).has( 'bindings' ) ) {\n\t\tconst bindingsObj = Object.create( null );\n\t\t_wq( node ).set( 'bindings', bindingsObj );\n Observer.observe( bindingsObj, mutations => {\n if ( node instanceof window.Element ) {\n const bindingsParse = parseBindingsAttr( node.getAttribute( config.attr.bindingsreflection ) || '' );\n const bindingsParseBefore = new Map(bindingsParse);\n for ( const m of mutations ) {\n if ( m.detail?.publish !== false ) {\n if ( m.type === 'delete' ) bindingsParse.delete( m.key );\n else bindingsParse.set( m.key, undefined );\n }\n }\n if ( bindingsParse.size && bindingsParse.size !== bindingsParseBefore.size ) {\n node.setAttribute( config.attr.bindingsreflection, `{ ${ [ ...bindingsParse.entries() ].map(([ key, value ]) => value === undefined ? key : `${ key }: ${ value }` ).join( ', ' ) } }` );\n } else if ( !bindingsParse.size ) node.toggleAttribute( config.attr.bindingsreflection, false );\n } else {\n const contextsApi = node[ ctxConfig.api.contexts ];\n for ( const m of mutations ) {\n if ( m.type === 'delete' ) {\n const ctx = contextsApi.find( DOMBindingsContext.kind, m.key );\n if ( ctx ) contextsApi.detach( ctx );\n } else if ( !contextsApi.find( DOMBindingsContext.kind, m.key ) ) {\n contextsApi.attach( new DOMBindingsContext( m.key ) );\n }\n }\n }\n } );\n\t}\n\treturn _wq( node ).get( 'bindings' );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n\tconst window = this, { webqit: { Observer } } = window;\n // The Bindings APIs\n [ window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = prototype === window.Document.prototype ? 'Document' : ( prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element' );\n if ( config.api.bind in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.bind }\" API!` ); }\n if ( config.api.bindings in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.bindings }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.bind, { value: function( bindings, options = {} ) {\n return applyBindings.call( window, config, this, bindings, options );\n } });\n Object.defineProperty( prototype, config.api.bindings, { get: function() {\n return Observer.proxy( getBindings.call( window, config, this ) );\n } } );\n } );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n * @param document|Element target\n * @param Object bindings\n * @param Object params\n *\n * @return Void\n */\nfunction applyBindings( config, target, bindings, { merge, diff, publish, namespace } = {} ) {\n const window = this, { webqit: { Observer } } = window;\n const bindingsObj = getBindings.call( this, config, target );\n const $params = { diff, namespace, detail: { publish } };\n const exitingKeys = merge ? [] : Observer.ownKeys( bindingsObj, $params ).filter( key => !( key in bindings ) );\n return Observer.batch( bindingsObj, () => {\n if ( exitingKeys.length ) { Observer.deleteProperties( bindingsObj, exitingKeys, $params ); }\n return Observer.set( bindingsObj, bindings, $params );\n }, $params );\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n * and their module query results; then resolves the respective import elements.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime(config) {\n const window = this, { webqit: { realdom, Observer, oohtml: { configs } } } = window;\n // ------------\n const attachBindingsContext = (host, key) => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n if ( !contextsApi.find( DOMBindingsContext.kind, key ) ) {\n contextsApi.attach( new DOMBindingsContext( key ) );\n }\n };\n const detachBindingsContext = (host, key) => {\n let ctx, contextsApi = host[configs.CONTEXT_API.api.contexts];\n while( ctx = contextsApi.find( DOMBindingsContext.kind, key ) ) contextsApi.detach(ctx);\n };\n // ------------\n realdom.realtime(window.document).query( `[${window.CSS.escape(config.attr.bindingsreflection)}]`, record => {\n record.exits.forEach( entry => detachBindingsContext( entry ) );\n record.entrants.forEach(entry => {\n const bindingsParse = parseBindingsAttr( entry.getAttribute( config.attr.bindingsreflection ) || '' );\n const newData = [ ...bindingsParse.entries() ].filter(([ k, v ]) => v !== undefined );\n if ( newData.length ) entry[ config.api.bind ]( Object.fromEntries( newData ), { merge: true, publish: false } );\n for ( const [ key ] of bindingsParse ) {\n attachBindingsContext( entry, key );\n }\n } );\n }, { id: 'bindings:dom', live: true, subtree: 'cross-roots', timing: 'sync', eventDetails: true });\n\trealdom.realtime( window.document, 'attr' ).observe( config.attr.bindingsreflection, record => {\n const bindingsObj = getBindings.call( window, config, record.target );\n const bindingsParse = parseBindingsAttr( record.value || '' );\n const oldBindings = parseBindingsAttr( record.oldValue || '' );\n for ( const key of new Set([ ...bindingsParse.keys(), ...oldBindings.keys() ]) ) {\n if ( !oldBindings.has( key ) ) {\n if ( bindingsParse.get( key ) !== undefined ) Observer.set( bindingsObj, key, bindingsParse.get( key ), { detail: { publish: false } } );\n attachBindingsContext( record.target, key );\n } else if ( !bindingsParse.has( key ) ) {\n if ( oldBindings.get( key ) !== undefined ) Observer.deleteProperty( bindingsObj, key, { detail: { publish: false } } );\n detachBindingsContext( record.target, key );\n } else if ( bindingsParse.get( key ) !== oldBindings.get( key ) ) {\n Observer.set( bindingsObj, key, bindingsParse.get( key ), { detail: { publish: false } } );\n }\n }\n\t}, { id: 'bindings:attr', subtree: 'cross-roots', timing: 'sync', newValue: true, oldValue: true } );\n}\n\nconst parseBindingsAttr = str => {\n str = str.trim();\n return new Map(_splitOuter( str.slice(1, -1), ',' ).filter( s => s.trim() ).map( _str => {\n return _splitOuter( _str, ':' ).map( s => s.trim() );\n }));\n};\n", "\n/**\n * @imports\n */\nimport { getDefs } from './index.js';\nimport { _wq, env } from '../util.js';\n\nexport default class HTMLModule {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _wq( host ).get( 'defsmanager::instance' ) || new this( host );\n }\n\n /**\n * @constructor\n */\n constructor( host, parent = null, level = 0 ) {\n const { window } = env, { webqit: { realdom, oohtml: { configs } } } = window;\n _wq( host ).get( `defsmanager::instance` )?.dispose();\n _wq( host ).set( `defsmanager::instance`, this );\n this.window = window;\n this.host = host;\n this.config = configs.HTML_IMPORTS;\n this.parent = parent;\n this.level = level;\n this.defs = getDefs( this.host );\n this.defId = ( this.host.getAttribute( this.config.attr.def ) || '' ).trim();\n this.validateDefId( this.defId );\n // ----------\n this.realtimeA = realdom.realtime( this.host.content ).children( record => {\n this.expose( record.entrants, true );\n this.expose( record.exits, false );\n }, { live: true, timing: 'sync' } );\n // ----------\n this.realtimeB = realdom.realtime( this.host ).attr( [ 'src', 'loading' ], ( ...args ) => this.evaluateLoading( ...args ), {\n live: true,\n atomic: true,\n timing: 'sync',\n lifecycleSignals: true\n } );\n // ----------\n this.realtimeC = this.evalInheritance();\n // ----------\n }\n\n /**\n * Validates export ID.\n * \n * @param String defId\n *\n * @returns Void\n */\n validateDefId( defId ) {\n if ( [ '@', '/', '*', '#' ].some( token => defId.includes( token ) ) ) {\n throw new Error( `The export ID \"${ defId }\" contains an invalid character.` );\n }\n }\n\n /**\n * Maps module contents as defs.\n * \n * @param Array entries\n * @param Bool isConnected\n *\n * @returns Void\n */\n expose( entries, isConnected ) {\n const { window } = env, { webqit: { Observer } } = window;\n let dirty, allFragments = this.defs[ '#' ] || [];\n entries.forEach( entry => {\n if ( entry.nodeType !== 1 ) return;\n const isTemplate = entry.matches( this.config.templateSelector );\n const defId = ( entry.getAttribute( isTemplate ? this.config.attr.def : this.config.attr.fragmentdef ) || '' ).trim();\n if ( isConnected ) {\n if ( isTemplate && defId ) {\n new HTMLModule( entry, this.host, this.level + 1 );\n } else {\n allFragments.push( entry );\n dirty = true;\n if ( typeof requestIdleCallback === 'function' ) {\n requestIdleCallback( () => {\n this.config.idleCompilers?.forEach( callback => callback.call( this.window, entry ) );\n } );\n }\n }\n if ( defId ) {\n this.validateDefId( defId );\n Observer.set( this.defs, ( !isTemplate && '#' || '' ) + defId, entry );\n }\n } else {\n if ( isTemplate && defId ) { HTMLModule.instance( entry ).dispose(); }\n else {\n allFragments = allFragments.filter( x => x !== entry );\n dirty = true;\n }\n if ( defId ) Observer.deleteProperty( this.defs, ( !isTemplate && '#' || '' ) + defId );\n }\n } );\n if ( dirty ) Observer.set( this.defs, '#', allFragments );\n }\n\n /**\n * Evaluates remote content loading.\n *\n * @param AbortSignal signal\n * \n * @returns Void\n */\n evaluateLoading( [ record1, record2 ], { signal } ) {\n const { window: { webqit: { Observer } } } = env;\n const src = ( record1.value || '' ).trim();\n if ( !src ) return;\n let $loadingPromise, loadingPromise = promise => {\n if ( !promise ) return $loadingPromise; // Get\n $loadingPromise = promise.then( () => interception.remove() ); // Set\n };\n const loading = ( record2.value || '' ).trim();\n const interception = Observer.intercept( this.defs, 'get', async ( descriptor, recieved, next ) => {\n if ( loading === 'lazy' ) { loadingPromise( this.load( src, true ) ); }\n await loadingPromise();\n return next();\n }, { signal } );\n if ( loading !== 'lazy' ) { loadingPromise( this.load( src ) ); }\n }\n \n /**\n * Fetches a module's \"src\".\n *\n * @param String src\n *\n * @return Promise\n */\n load( src ) {\n const { window } = env;\n if ( this.host.content.children.length ) return Promise.resolve();\n // Ongoing request?\n if ( this.fetchInFlight?.src === src ) return this.fetchInFlight.request;\n this.fetchInFlight?.controller.abort();\n\n // The promise\n const controller = new AbortController();\n const fire = ( type, detail ) => this.host.dispatchEvent( new window.CustomEvent( type, { detail } ) );\n const request = window.fetch( src, { signal: controller.signal, element: this.host } ).then( response => {\n return response.ok ? response.text() : Promise.reject( response.statusText );\n } ).then( content => {\n this.host.innerHTML = content.trim(); // IMPORTANT: .trim()\n fire( 'load' );\n return this.host;\n } ).catch( e => {\n console.error( `Error fetching the bundle at \"${ src }\": ${ e.message }` );\n this.fetchInFlight = null;\n fire( 'loaderror' );\n return this.host;\n } );\n this.fetchInFlight = { src, request, controller };\n return request;\n }\n\n /**\n * Evaluates module inheritance.\n *\n * @returns Void|AbortController\n */\n evalInheritance( ) {\n if ( !this.parent ) return [];\n const { window: { webqit: { Observer } } } = env;\n let extendedId = ( this.host.getAttribute( this.config.attr.extends ) || '' ).trim();\n let inheritedIds = ( this.host.getAttribute( this.config.attr.inherits ) || '' ).trim().split( ' ' ).map( id => id.trim() ).filter( x => x );\n const handleInherited = records => {\n records.forEach( record => {\n if ( Observer.get( this.defs, record.key ) !== record.oldValue ) return;\n if ( [ 'get'/*initial get*/, 'set', 'def' ].includes( record.type ) ) {\n Observer[ record.type.replace( 'get', 'set' ) ]( this.defs, record.key, record.value );\n } else if ( record.type === 'delete' ) {\n Observer.deleteProperty( this.defs, record.key );\n }\n } );\n };\n const realtimes = [];\n const parentDefsObj = getDefs( this.parent );\n if ( extendedId ) {\n realtimes.push( Observer.reduce( parentDefsObj, [ extendedId, this.config.api.defs, Infinity ], Observer.get, handleInherited, { live: true } ) );\n }\n if ( inheritedIds.length ) {\n realtimes.push( Observer.get( parentDefsObj, inheritedIds.includes( '*' ) ? Infinity : inheritedIds, handleInherited, { live: true } ) );\n }\n return realtimes;\n }\n \n /**\n * Disposes the instance and its processes.\n *\n * @returns Void\n */\n dispose() {\n this.realtimeA.disconnect();\n this.realtimeB.disconnect();\n this.realtimeC.forEach( r => ( r instanceof Promise ? r.then( r => r.abort() ) : r.abort() ) );\n Object.entries( this.defs ).forEach( ( [ key, entry ] ) => {\n if ( key.startsWith( '#' ) ) return;\n HTMLModule.instance( entry ).dispose();\n } );\n }\n}\n", "\n/**\n * @imports\n */\nimport DOMContext from '../context-api/DOMContext.js';\nimport { getDefs } from './index.js';\nimport { _wq, env } from '../util.js';\n\nexport default class HTMLImportsContext extends DOMContext {\n\n /**\n * @kind\n */\n static kind = 'html-imports';\n\n /**\n * @createRequest\n */\n static createRequest( detail = null ) {\n const request = super.createRequest();\n if ( detail?.startsWith( '/' ) ) {\n request.detail = detail;\n request.targetContext = Infinity;\n } else if ( detail?.startsWith( '@' ) ) {\n const [ targetContext, ..._detail ] = detail.slice( 1 ).split( /(?<=\\w)(?=\\/|#)/ ).map( s => s.trim() );\n request.targetContext = targetContext;\n request.detail = _detail.join( '' );\n } else { request.detail = detail; }\n return request;\n }\n \n /**\n * @localModules\n */\n get localModules() { return getDefs( this.host ); }\n get inheritedModules() { return this.#inheritedModules; }\n #inheritedModules = {};\n\n /**\n * @handle()\n */\n \n handle( event ) {\n const { window: { webqit: { Observer } } } = env;\n // Any existing event.meta.controller? Abort!\n event.meta.controller?.abort();\n // Parse and translate detail\n let path = ( event.detail || '' ).split( /\\/|(?<=\\w)(?=#)/g ).map( x => x.trim() ).filter( x => x );\n if ( !path.length ) return event.respondWith();\n path = path.join( `/${ this.configs.HTML_IMPORTS.api.defs }/` )?.split( '/' ).map( x => x === '*' ? Infinity : x ) || [];\n // We'll now fulfill request\n const options = { live: event.live, signal: event.signal, descripted: true };\n event.meta.controller = Observer.reduce( this.#modules, path, Observer.get, ( m ) => {\n if ( Array.isArray( m ) ) {\n if ( !m.length ) {\n event.respondWith();\n return;\n }\n // Paths with wildcard\n for ( const n of m ) {\n event.respondWith( n );\n }\n } else {\n event.respondWith( m.value );\n }\n }, options );\n }\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) { event.meta.controller?.abort(); }\n\n /**\n * @initialize()\n */\n #modules;\n #controller1;\n #controller2;\n initialize( host ) {\n this.host = host;\n const { window: { webqit: { Observer } } } = env;\n // ----------------\n // Resolve\n const resolve = () => {\n for (const key of new Set([...Object.keys(this.localModules), ...Object.keys(this.inheritedModules), ...Object.keys(this.#modules)])) {\n if ( !Observer.has( this.localModules, key ) && !Observer.has( this.inheritedModules, key ) ) {\n Observer.deleteProperty( this.#modules, key );\n } else if (key === '#' && Observer.has( this.localModules, key ) && Observer.has( this.inheritedModules, key ) ) {\n Observer.set( this.#modules, key, [...Observer.get( this.localModules, key ), ...Observer.get( this.inheritedModules, key )] );\n } else {\n const _module = Observer.get( this.localModules, key ) || Observer.get( this.inheritedModules, key );\n if ( Observer.get( this.#modules, key ) !== _module ) {\n Observer.set( this.#modules, key, _module );\n }\n }\n }\n };\n // ----------------\n // Observe local\n this.#modules = { ...this.localModules };\n this.#controller1?.abort();\n this.#controller1 = Observer.observe( this.localModules, () => resolve('local'), { timing: 'sync' } );\n // ----------------\n // If host has importscontext attr, compute that\n const $config = this.configs.HTML_IMPORTS;\n if ( this.host.matches && $config.attr.importscontext ) {\n const realdom = this.host.ownerDocument.defaultView.webqit.realdom;\n let prevRef;\n this.#controller2?.disconnect();\n this.#controller2 = realdom.realtime( this.host ).attr( $config.attr.importscontext, ( record, { signal } ) => { \n const moduleRef = ( record.value || '' ).trim();\n if ( moduleRef === prevRef ) return;\n prevRef = moduleRef;\n // This superModules contextrequest is automatically aborted by the injected signal below\n this.#inheritedModules = {};\n const request = { ...this.constructor.createRequest( moduleRef ? `${moduleRef}/*` : '*' ), live: true, signal, diff: true };\n this.host.parentNode[ this.configs.CONTEXT_API.api.contexts ].request( request, ( m ) => {\n if ( !m ) {\n this.#inheritedModules = {};\n resolve('inherited');\n } else if ( m.type === 'delete' ) {\n delete this.#inheritedModules[m.key];\n if ( !Reflect.has( this.localModules, m.key ) ) {\n Observer.deleteProperty( this.#modules, m.key );\n }\n } else {\n this.#inheritedModules[m.key] = m.value;\n if ( !Reflect.has( this.localModules, m.key ) && Reflect.get( this.#modules, m.key ) !== m.value ) {\n Observer.set( this.#modules, m.key, m.value );\n }\n }\n } );\n resolve('inherited');\n }, { live: true, timing: 'sync', oldValue: true, lifecycleSignals: true } );\n }\n // ----------------\n return super.initialize( host );\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n // Stop listening for sources\n this.#controller1?.abort();\n this.#controller2?.disconnect();\n // Now, stop listening for contextrequest and contextclaim events\n // And relinquish own subscribers to owner context\n return super.dispose( host );\n }\n}\n", "\n/**\n * @imports\n */\nimport HTMLImportsContext from './HTMLImportsContext.js';\nimport { _wq, env } from '../util.js';\n\n/**\n * Creates the HTMLImportElement class.\n * \n * @param Object config \n * \n * @return HTMLImportElement\n */\nexport default function() {\n const { window } = env, { webqit } = window, { realdom, oohtml: { configs } } = webqit;\n if ( webqit.HTMLImportElement ) return webqit.HTMLImportElement;\n const BaseElement = configs.HTML_IMPORTS.elements.import.includes( '-' ) ? window.HTMLElement : class {};\n class HTMLImportElement extends BaseElement {\n \n /**\n * @instance\n * \n * @param HTMLElement node\n * \n * @returns \n */\n static instance( node ) {\n if ( configs.HTML_IMPORTS.elements.import.includes( '-' ) && ( node instanceof this ) ) return node;\n return _wq( node ).get( 'import::instance' ) || new this( node );\n }\n\n /**\n * @constructor\n */\n constructor( ...args ) {\n super();\n // --------\n const el = args[ 0 ] || this;\n _wq( el ).set( 'import::instance', this );\n Object.defineProperty( this, 'el', { get: () => el, configurable: false } );\n\n const priv = {};\n Object.defineProperty( this, '#', { get: () => priv, configurable: false } );\n priv.slottedElements = new Set;\n\n priv.setAnchorNode = anchorNode => {\n priv.anchorNode = anchorNode;\n return anchorNode;\n };\n\n priv.live = callback => {\n if ( priv.liveImportsRealtime ) throw new Error(`Import element already in live mode.`);\n const parentNode = this.el.isConnected ? this.el.parentNode : priv.anchorNode.parentNode;\n priv.liveImportsRealtime = realdom.realtime( this.el ).attr( configs.HTML_IMPORTS.attr.ref, ( record, { signal } ) => {\n priv.moduleRef = record.value;\n const moduleRef = priv.moduleRef.includes( '#' ) ? priv.moduleRef : `${ priv.moduleRef }#`/* for live children */;\n const request = { ...HTMLImportsContext.createRequest( moduleRef ), live: signal && true, signal, diff: !moduleRef.endsWith('#') };\n parentNode[ configs.CONTEXT_API.api.contexts ].request( request, response => {\n callback( ( response instanceof window.HTMLTemplateElement ? [ ...response.content.children ] : (\n Array.isArray( response ) ? response : response && [ response ]\n ) ) || [] );\n } );\n }, { live: true, timing: 'sync', lifecycleSignals: true } );\n priv.autoDestroyRealtime = realdom.realtime( window.document ).track( parentNode, () => {\n priv.die();\n }, { subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n };\n\n priv.die = () => {\n priv.autoDestroyRealtime?.disconnect();\n priv.liveImportsRealtime?.disconnect();\n priv.liveImportsRealtime = null;\n };\n\n priv.hydrate = ( anchorNode, slottedElements ) => {\n anchorNode.replaceWith( priv.setAnchorNode( this.createAnchorNode() ) );\n priv.live( fragments => {\n // The default action\n if ( priv.originalsRemapped ) return this.fill( fragments );\n // Initial remap action\n const identifiersMap = fragments.map( ( fragment, i ) => ( { el: fragment, fragmentDef: fragment.getAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) || '', tagName: fragment.tagName, i } ) );\n slottedElements.forEach( ( slottedElement, i ) => {\n const tagName = slottedElement.tagName, fragmentDef = slottedElement.getAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) || '';\n const originalsMatch = ( i ++, identifiersMap.find( fragmentIdentifiers => fragmentIdentifiers.tagName === tagName && fragmentIdentifiers.fragmentDef === fragmentDef && fragmentIdentifiers.i === i ) );\n if ( originalsMatch ) _wq( slottedElement ).set( 'original@imports', originalsMatch.el ); // Or should we throw integrity error here?\n _wq( slottedElement ).set( 'slot@imports', this.el );\n priv.slottedElements.add( slottedElement );\n } );\n priv.originalsRemapped = true;\n });\n };\n\n priv.autoRestore = ( callback = null ) => {\n priv.autoRestoreRealtime?.disconnect();\n if ( callback ) callback();\n const restore = () => {\n if (this.el.isConnected) return;\n this.el.setAttribute( 'data-nodecount', 0 );\n priv.internalMutation = true;\n priv.anchorNode.replaceWith( this.el );\n priv.internalMutation = false;\n priv.setAnchorNode( null );\n };\n if ( !priv.slottedElements.size ) return restore();\n const autoRestoreRealtime = realdom.realtime( priv.anchorNode.parentNode ).observe( [ ...priv.slottedElements ], record => {\n record.exits.forEach( outgoingNode => {\n _wq( outgoingNode ).delete( 'slot@imports' );\n priv.slottedElements.delete( outgoingNode );\n } );\n if ( !priv.slottedElements.size ) {\n autoRestoreRealtime.disconnect();\n // At this point, ignore if this is a removal involving the whole parent node\n if ( !record.target.isConnected ) return;\n restore();\n }\n }, { subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n priv.autoRestoreRealtime = autoRestoreRealtime;\n };\n\n priv.connectedCallback = () => {\n if ( priv.internalMutation ) return;\n priv.live( fragments => this.fill( fragments ) );\n };\n\n priv.disconnectedCallback = () => {\n if ( priv.internalMutation ) return;\n priv.die();\n };\n }\n\n /**\n * Creates the slot's anchor node.\n *\n * @return Element\n */\n createAnchorNode() {\n if ( window.webqit.env !== 'server' ) { return window.document.createTextNode( '' ) }\n const escapeElement = window.document.createElement( 'div' );\n escapeElement.textContent = this.el.outerHTML;\n const anchorNode = window.document.createComment( escapeElement.innerHTML );\n _wq( anchorNode ).set( 'isAnchorNode', true );\n return anchorNode;\n }\n\n /**\n * Fills the slot with slottableElements\n *\n * @param Iterable slottableElements\n *\n * @return void\n */\n fill( slottableElements, r ) {\n if (!this.el.isConnected && (!this[ '#' ].anchorNode || !this[ '#' ].anchorNode.isConnected)) {\n // LiveImports must be responding to an event that just removed the subtree from DOM\n return;\n }\n if ( Array.isArray( slottableElements ) ) { slottableElements = new Set( slottableElements ) }\n // This state must be set before the diffing below and the serialization done at createAnchorNode()\n this.el.setAttribute( 'data-nodecount', slottableElements.size );\n this[ '#' ].autoRestore( () => {\n this[ '#' ].slottedElements.forEach( slottedElement => {\n const slottedElementOriginal = _wq( slottedElement ).get( 'original@imports' );\n // If still available in source, simply leave unchanged\n // otherwise remove it from slot... to reflect this change\n if ( slottableElements.has( slottedElementOriginal ) ) {\n slottableElements.delete( slottedElementOriginal );\n } else {\n this[ '#' ].slottedElements.delete( slottedElement );\n // This removal will not be caught\n slottedElement.remove();\n }\n } );\n // Make sure anchor node is what's in place...\n // not the import element itslef - but all only when we have slottableElements.size\n if ( slottableElements.size && this.el.isConnected ) {\n const newAnchorNode = this[ '#' ].setAnchorNode( this.createAnchorNode() );\n this[ '#' ].internalMutation = true;\n this.el.replaceWith( newAnchorNode );\n this[ '#' ].internalMutation = false;\n }\n // Insert slottables now\n slottableElements.forEach( slottableElement => {\n // Clone each slottable element and give it a reference to its original\n const slottableElementClone = slottableElement.cloneNode( true );\n // The folllowing references must be set before adding to DODM\n if ( !slottableElementClone.hasAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) ) {\n slottableElementClone.toggleAttribute( configs.HTML_IMPORTS.attr.fragmentdef, true );\n }\n _wq( slottableElementClone ).set( 'original@imports', slottableElement );\n _wq( slottableElementClone ).set( 'slot@imports', this.el );\n this[ '#' ].slottedElements.add( slottableElementClone );\n this[ '#' ].anchorNode.before( slottableElementClone );\n } );\n } );\n }\n\n /**\n * Empty slot.\n *\n * @return void\n */\n empty() { this[ '#' ].slottedElements.forEach( slottedElement => slottedElement.remove() ); }\n\n /**\n * Returns the slot's anchorNode.\n *\n * @return array\n */\n get anchorNode() { return this[ '#' ].anchorNode; }\n\n /**\n * Returns the slot's module reference, if any.\n *\n * @return string\n */\n get moduleRef() { return this[ '#' ].moduleRef; }\n\n /**\n * Returns the slot's slotted elements.\n *\n * @return array\n */\n get slottedElements() { return this[ '#' ].slottedElements; }\n }\n if ( configs.HTML_IMPORTS.elements.import.includes( '-' ) ) { customElements.define( configs.HTML_IMPORTS.elements.import, HTMLImportElement ); }\n webqit.HTMLImportElement = HTMLImportElement;\n return HTMLImportElement;\n}", "\n/**\n * @imports\n */\nimport HTMLModule from './HTMLModule.js';\nimport HTMLImportsContext from './HTMLImportsContext.js';\nimport _HTMLImportElement from './_HTMLImportElement.js';\nimport { _wq, _init } from '../util.js';\n\n/**\n * Initializes HTML Modules.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init($config = {}) {\n const { config, window } = _init.call(this, 'html-imports', $config, {\n elements: { import: 'import', },\n attr: { def: 'def', extends: 'extends', inherits: 'inherits', ref: 'ref', importscontext: 'importscontext', },\n api: { def: 'def', defs: 'defs', import: 'import' },\n });\n if (!config.attr.fragmentdef) { config.attr.fragmentdef = config.attr.def; }\n config.templateSelector = `template[${window.CSS.escape(config.attr.def)}]`;\n config.importsContextSelector = `[${window.CSS.escape(config.attr.importscontext)}]`;\n config.slottedElementsSelector = `[${window.CSS.escape(config.attr.fragmentdef)}]:not(template)`;\n const anchorNodeMatch = (start, end) => {\n const starting = `starts-with(., \"${start}\")`;\n const ending = `substring(., string-length(.) - string-length(\"${end}\") + 1) = \"${end}\"`;\n return `${starting} and ${ending}`;\n }\n config.anchorNodeSelector = `comment()[${anchorNodeMatch(`<${config.elements.import}`, `</${config.elements.import}>`)}]`;\n window.webqit.HTMLImportsContext = HTMLImportsContext;\n window.webqit.HTMLImportElement = _HTMLImportElement();\n exposeAPIs.call(window, config);\n realtime.call(window, config);\n}\n\n/**\n * Returns the \"defs\" object associated with the given node.\n *\n * @param Element node\n * @param Bool autoCreate\n *\n * @return Object\n */\nexport function getDefs(node, autoCreate = true) {\n if (!_wq(node).has('defs') && autoCreate) {\n const defs = Object.create(null);\n _wq(node).set('defs', defs);\n }\n return _wq(node).get('defs');\n}\n\n/**\n * Exposes HTML Modules with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs(config) {\n const window = this, { webqit: { oohtml: { configs } } } = window;\n // The \"def\" & \"defs\" properties\n if (config.api.def in window.HTMLTemplateElement.prototype) { throw new Error(`The \"HTMLTemplateElement\" prototype already has a \"${config.api.def}\" API!`); }\n if (config.api.defs in window.HTMLTemplateElement.prototype) { throw new Error(`The \"HTMLTemplateElement\" prototype already has a \"${config.api.defs}\" API!`); }\n // No-conflict assertions\n Object.defineProperty(window.HTMLTemplateElement.prototype, config.api.def, {\n get: function () {\n return this.getAttribute(config.attr.def);\n }\n });\n Object.defineProperty(window.HTMLTemplateElement.prototype, config.api.defs, {\n get: function () {\n return getDefs(this);\n }\n });\n // The \"scoped\" property\n Object.defineProperty(window.HTMLTemplateElement.prototype, 'scoped', {\n configurable: true,\n get() { return this.hasAttribute('scoped'); },\n set(value) { this.toggleAttribute('scoped', value); },\n });\n // The Import API\n [window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype].forEach(prototype => {\n // No-conflict assertions\n const type = prototype === window.Document.prototype ? 'Document' : (prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element');\n if (config.api.import in prototype) { throw new Error(`The ${type} prototype already has a \"${config.api.import}\" API!`); }\n // Definitions\n Object.defineProperty(prototype, config.api.import, {\n value: function (ref, live = false, callback = null) {\n return importRequest(this, ...arguments);\n }\n });\n });\n function importRequest(context, ref, live = false, callback = null) {\n let options = {};\n if (typeof live === 'function') {\n callback = live;\n live = false;\n } else if (typeof live === 'object' && live) {\n options = { ...live, ...options };\n } else { options = { live }; }\n const request = { ...HTMLImportsContext.createRequest(ref), ...options };\n return context[configs.CONTEXT_API.api.contexts].request(request, callback);\n }\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n * and their module query results; then resolves the respective import elements.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime(config) {\n const window = this, { webqit: { Observer, realdom, oohtml: { configs }, HTMLImportElement, HTMLImportsContext } } = window;\n\n // ------------\n // MODULES\n // ------------\n const attachImportsContext = host => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n if (!contextsApi.find(HTMLImportsContext.kind)) {\n contextsApi.attach(new HTMLImportsContext);\n }\n };\n const detachImportsContext = host => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n const ctx = contextsApi.find(HTMLImportsContext.kind);\n if (ctx && ( /* disconnect? */!host.isConnected || /* not inheriting && no localModules? */(\n !host.matches?.(config.importsContextSelector) && !Object.keys(ctx.localModules).length\n ))) {\n contextsApi.detach(ctx);\n }\n };\n // ------------\n realdom.realtime(window.document).query([config.templateSelector, config.importsContextSelector], record => {\n record.entrants.forEach(entry => {\n if (entry.matches(config.templateSelector)) {\n const htmlModule = HTMLModule.instance(entry);\n htmlModule.ownerContext = entry.scoped ? entry.parentNode : entry.getRootNode();\n const ownerContextModulesObj = getDefs(htmlModule.ownerContext);\n if (htmlModule.defId) { Observer.set(ownerContextModulesObj, htmlModule.defId, entry); }\n // The ownerContext's defs - ownerContextModulesObj - has to be populated\n // Before attaching a context instance to it, to give the just created context something to use for\n // fullfiling reclaimed requests.\n attachImportsContext(htmlModule.ownerContext);\n } else {\n attachImportsContext(entry);\n }\n });\n record.exits.forEach(entry => {\n if (entry.matches(config.templateSelector)) {\n const htmlModule = HTMLModule.instance(entry);\n //if (!htmlModule.ownerContext) return; // JSDOM sometimes\n const ownerContextModulesObj = getDefs(htmlModule.ownerContext);\n if (htmlModule.defId && htmlModule.ownerContext.isConnected) { Observer.deleteProperty(ownerContextModulesObj, htmlModule.defId); }\n detachImportsContext(htmlModule.ownerContext);\n } else {\n detachImportsContext(entry);\n }\n });\n }, { id: 'imports:template/importscontext', live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true, eventDetails: true });\n\n // ------------\n // IMPORTS\n // ------------\n realdom.realtime(window.document).query(config.elements.import, record => {\n record.entrants.forEach(node => handleRealtime(node, true, record));\n record.exits.forEach(node => handleRealtime(node, false, record));\n }, { id: 'imports:import', live: true, subtree: 'cross-roots', timing: 'sync', deferred: true });\n function handleRealtime(entry, connectedState) {\n const elInstance = HTMLImportElement.instance(entry);\n if (connectedState) { elInstance['#'].connectedCallback(); }\n else { elInstance['#'].disconnectedCallback(); }\n }\n // Hydration\n if (window.webqit.env === 'server') return;\n realdom.realtime(window.document).query(`(${config.anchorNodeSelector})`, record => {\n record.entrants.forEach(anchorNode => {\n if (_wq(anchorNode).get('isAnchorNode')) return; // Doubling up on the early return above! Ignoring every just created anchorNode\n const reviver = window.document.createElement('div');\n reviver.innerHTML = anchorNode.nodeValue;\n reviver.innerHTML = reviver.firstChild.textContent;\n const importEl = reviver.firstChild;\n let nodecount = parseInt(importEl.getAttribute('data-nodecount'));\n const slottedElements = new Set;\n let slottedElement = anchorNode;\n while ((slottedElement = slottedElement.previousElementSibling) && slottedElement.matches(config.slottedElementsSelector) && nodecount--) {\n slottedElements.add(slottedElement);\n }\n HTMLImportElement.instance(importEl)['#'].hydrate(anchorNode, slottedElements);\n });\n }, { id: 'imports:hydration', live: true, subtree: 'cross-roots', timing: 'sync' });\n}", "\n/**\n * @imports\n */\nimport DOMContexts from './DOMContexts.js';\nimport DOMContext from './DOMContext.js';\nimport _DOMContextRequestEvent from './_DOMContextRequestEvent.js';\nimport DOMContextResponse from './DOMContextResponse.js';\nimport DuplicateContextError from './DuplicateContextError.js';\nimport { _init } from '../util.js';\n\n/**\n * Initializes HTML Modules.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'context-api', $config, {\n elements: { roots: 'root,webflo-embedded', },\n attr: { contextname: 'contextname', },\n api: { contexts: 'contexts', },\n } );\n const waitListMappings = new Map, dispatchEvent = window.EventTarget.prototype.dispatchEvent;\n Object.defineProperty( window.EventTarget.prototype, 'dispatchEvent', { value: function( ...args ) {\n const event = args[0], rootNode = this?.closest?.(config.elements.roots) || this.getRootNode?.();\n if ( [ 'contextclaim', 'contextrequest' ].includes( event.type ) && rootNode ) {\n if ( event.meta ) event.meta.target = this;\n const temp = (event) => {\n event.stopImmediatePropagation();\n // Always set this whether answered or not\n if ( event.meta ) event.meta.target = event.target;\n if ( event.answered ) return;\n if ( !waitListMappings.get( rootNode ) ) waitListMappings.set( rootNode, new Set );\n if ( event.type === 'contextrequest' && event.live ) {\n waitListMappings.get( rootNode ).add( event );\n } else if ( event.type === 'contextclaim' ) {\n const claims = new Set;\n waitListMappings.get( rootNode ).forEach( subscriptionEvent => {\n if ( !event.target.contains( subscriptionEvent.target ) || !event.detail?.matchEvent?.( subscriptionEvent ) ) return;\n waitListMappings.get( rootNode ).delete( subscriptionEvent );\n claims.add( subscriptionEvent );\n } );\n if ( !waitListMappings.get( rootNode ).size ) waitListMappings.delete( rootNode );\n return event.respondWith?.( claims );\n }\n };\n rootNode.addEventListener( event.type, temp );\n const returnValue = dispatchEvent.call( this, ...args );\n rootNode.removeEventListener( event.type, temp );\n return returnValue;\n }\n return dispatchEvent.call( this, ...args );\n } } );\n window.webqit.DOMContexts = DOMContexts;\n window.webqit.DOMContext = DOMContext;\n window.webqit.DOMContextRequestEvent = _DOMContextRequestEvent();\n window.webqit.DOMContextResponse = DOMContextResponse;\n window.webqit.DuplicateContextError = DuplicateContextError;\n exposeAPIs.call( window, config );\n}\n\n/**\n * Exposes HTML Modules with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this;\n [ window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = prototype === window.Document.prototype ? 'Document' : ( prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element' );\n if ( config.api.contexts in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.contexts }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.contexts, { get: function() {\n return DOMContexts.instance( this );\n } } );\n } );\n}\n", "\n/**\n * @imports\n */\nimport { rewriteSelector, getOwnerNamespaceObject, getNamespaceUUID } from '../namespaced-html/index.js';\nimport { _init, _toHash } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init({ advanced = {}, ...$config }) {\n const { config, window } = _init.call( this, 'scoped-css', $config, {\n api: { styleSheets: 'styleSheets' },\n style: { retention: 'retain', mimeTypes: 'text/css', strategy: null },\n } );\n config.styleSelector = (Array.isArray( config.style.mimeTypes ) ? config.style.mimeTypes : config.style.mimeTypes.split( '|' ) ).concat( '' ).reduce( ( selector, mm ) => {\n const qualifier = mm ? `[type=\"${ window.CSS.escape( mm ) }\"]` : ':not([type])';\n return selector.concat( `style${ qualifier }` );\n }, [] ).join( ',' );\n window.webqit.oohtml.Style = {\n compileCache: new Map,\n };\n exposeAPIs.call( window, config );\n realtime.call( window, config );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this, styleSheetsMap = new Map;\n // The \"styleSheets\" API\n [ window.Element.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = 'Element';\n if ( config.api.styleSheets in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.styleSheets }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.styleSheets, { get: function() {\n if ( !styleSheetsMap.has( this ) ) { styleSheetsMap.set( this, [] ); }\n return styleSheetsMap.get( this );\n }, } );\n } );\n // The HTMLStyleElement \"scoped\" property\n Object.defineProperty( window.HTMLStyleElement.prototype, 'scoped', {\n configurable: true,\n get() { return this.hasAttribute( 'scoped' ); },\n set( value ) { this.toggleAttribute( 'scoped', value ); },\n } );\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { oohtml, realdom } } = window;\n const inBrowser = Object.getOwnPropertyDescriptor( globalThis, 'window' )?.get?.toString().includes( '[native code]' ) ?? false;\n if ( !window.CSS.supports ) { window.CSS.supports = () => false; }\n const handled = new WeakSet;\n realdom.realtime( window.document ).query( config.styleSelector, record => {\n record.entrants.forEach( style => {\n if ( handled.has( style ) ) return;\n handled.add( style );\n // Do compilation\n const sourceHash = _toHash( style.textContent );\n const supportsHAS = CSS.supports( 'selector(:has(a,b))' );\n const scopeSelector = style.scoped && ( supportsHAS ? `:has(> style[rand-${ sourceHash }])` : `[rand-${ sourceHash }]` );\n const supportsScope = style.scoped && window.CSSScopeRule && false/* Disabled for buggy behaviour: rewriting selectorText within an @scope block invalidates the scoping */;\n const scopeRoot = style.scoped && style.parentNode || style.getRootNode();\n if ( scopeRoot instanceof window.Element ) {\n scopeRoot[ config.api.styleSheets ].push( style );\n if ( !inBrowser ) return;\n ( supportsHAS ? style : scopeRoot ).toggleAttribute( `rand-${ sourceHash }`, true );\n }\n if ( !inBrowser ) return;\n if ( style.scoped && style.hasAttribute( 'shared' ) ) {\n let compiledSheet;\n if ( !( compiledSheet = oohtml.Style.compileCache.get( sourceHash ) ) ) {\n compiledSheet = createAdoptableStylesheet.call( window, style, null, supportsScope, scopeSelector );\n oohtml.Style.compileCache.set( sourceHash, compiledSheet );\n }\n // Run now!!!\n Object.defineProperty( style, 'sheet', { value: compiledSheet, configurable: true } );\n style.textContent = '\\n/*[ Shared style sheet ]*/\\n';\n } else {\n const transform = () => {\n const namespaceUUID = getNamespaceUUID( getOwnerNamespaceObject.call( window, scopeRoot ) );\n upgradeSheet.call( this, style.sheet, namespaceUUID, !supportsScope && scopeSelector );\n };\n if ( style.isConnected ) { transform(); }\n else { setTimeout( () => { transform(); }, 0 ); }\n }\n } );\n }, { id: 'scoped-css', live: true, subtree: 'cross-roots', timing: 'intercept', generation: 'entrants' } );\n // ---\n}\n\nfunction createAdoptableStylesheet( style, namespaceUUID, supportsScope, scopeSelector ) {\n const window = this, textContent = style.textContent;\n let styleSheet, cssText = supportsScope && scopeSelector ? `@scope (${ scopeSelector }) {\\n${ textContent.trim() }\\n}` : textContent.trim();\n try {\n styleSheet = new window.CSSStyleSheet;\n styleSheet.replaceSync( cssText );\n upgradeSheet.call( this, styleSheet, namespaceUUID, !supportsScope && scopeSelector );\n const adopt = () => style.getRootNode().adoptedStyleSheets.push( styleSheet );\n if ( style.isConnected ) { adopt(); }\n else { setTimeout( () => { adopt(); }, 0 ); }\n } catch( e ) {\n const styleCopy = window.document.createElement( 'style' );\n style.after( styleCopy );\n styleCopy.textContent = cssText;\n styleSheet = styleCopy.sheet;\n upgradeSheet.call( this, styleSheet, namespaceUUID, !supportsScope && scopeSelector );\n }\n return styleSheet;\n}\n\nfunction upgradeSheet( styleSheet, namespaceUUID, scopeSelector = null ) {\n const l = styleSheet?.cssRules.length || -1;\n for ( let i = 0; i < l; ++i ) {\n const cssRule = styleSheet.cssRules[ i ];\n if ( cssRule instanceof CSSImportRule ) {\n // Handle imported stylesheets\n //upgradeSheet( cssRule.styleSheet, namespaceUUID, scopeSelector );\n continue;\n }\n upgradeRule.call( this, cssRule, namespaceUUID, scopeSelector );\n }\n}\n\nfunction upgradeRule( cssRule, namespaceUUID, scopeSelector = null ) {\n if ( cssRule instanceof CSSStyleRule ) {\n // Resolve relative IDs and scoping (for non-@scope browsers)\n upgradeSelector.call( this, cssRule, namespaceUUID, scopeSelector );\n return;\n }\n if ( [ window.CSSScopeRule, window.CSSMediaRule, window.CSSContainerRule, window.CSSSupportsRule, window.CSSLayerBlockRule ].some( type => type && cssRule instanceof type ) ) {\n // Parse @rule blocks\n const l = cssRule.cssRules.length;\n for ( let i = 0; i < l; ++i ) {\n upgradeRule.call( this, cssRule.cssRules[ i ], namespaceUUID, scopeSelector );\n }\n }\n}\n\nfunction upgradeSelector( cssRule, namespaceUUID, scopeSelector = null ) {\n const newSelectorText = rewriteSelector.call( this, cssRule.selectorText, namespaceUUID, scopeSelector, 1 );\n cssRule.selectorText = newSelectorText;\n // Parse nested blocks. (CSS nesting)\n if ( cssRule.cssRules ) {\n const l = cssRule.cssRules.length;\n for ( let i = 0; i < l; ++i ) {\n upgradeSelector.call( this, cssRule.cssRules[ i ], namespaceUUID, /* Nesting has nothing to do with scopeSelector */ );\n }\n }\n}", "\n/**\n * @imports\n */\nimport NamespacedHTML from './namespaced-html/index.js';\nimport ScopedJS, { idleCompiler as idleCompiler1 } from './scoped-js/index.js';\nimport DataBinding, { idleCompiler as idleCompiler2 } from './data-binding/index.js';\nimport BindingsAPI from './bindings-api/index.js';\nimport HTMLImports from './html-imports/index.js';\nimport ContextAPI from './context-api/index.js';\nimport ScopedCSS from './scoped-css/index.js';\n\n/**\n * @init\n */\nexport default function init( QuantumJS, configs = {} ) {\n if ( !this.webqit ) { this.webqit = {}; }\n Object.assign( this.webqit, QuantumJS );\n // --------------\n ContextAPI.call( this, ( configs.CONTEXT_API || {} ) );\n BindingsAPI.call( this, ( configs.BINDINGS_API || {} ) ); // Depends on ContextAPI\n // Imports must happen before the rest... structure must be flattened before the other things below which query the DOM\n HTMLImports.call( this, { ...( configs.HTML_IMPORTS || {} ), idleCompilers: [ idleCompiler1, idleCompiler2 ] } ); // Depends on ContextAPI\n NamespacedHTML.call( this, ( configs.NAMESPACED_HTML || {} ) ); // Depends on ContextAPI\n DataBinding.call( this, ( configs.DATA_BINDING || {} ) ); // Depends on ContextAPI, BindingsAPI, HTMLImports\n ScopedCSS.call( this, ( configs.SCOPED_CSS || {} ) ); // Depends on NamespacedHTML\n ScopedJS.call( this, ( configs.SCOPED_JS || {} ) );\n}\n", "\n/**\n * @imports\n */\nimport * as QuantumJS from '@webqit/quantum-js/lite';\nimport init from './init.js';\n\n/**\n * @init\n */\ninit.call( window, QuantumJS );"],
|
|
5
|
-
"mappings": "skBAAA,4NCAA,mcCQe,WAAS,EAAK,CAC5B,MAAO,CAAC,MAAM,QAAQ,CAAG,GAAK,MAAO,IAAQ,UAAY,CAC1D,CCFe,YAAS,EAAK,CAC5B,MAAO,OAAO,EACf,CCFe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CAAG,CACzB,CCDe,YAAS,EAAK,CAC5B,MAAO,OAAO,IAAQ,UACvB,CCHe,YAAS,EAAK,CAC5B,MAAO,KAAQ,MAAQ,IAAQ,EAChC,CCFe,YAAS,EAAK,CAC5B,MAAO,WAAU,QAAW,KAAQ,QAAa,MAAO,GAAQ,IACjE,CCIe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CAAG,GAAM,MAAO,IAAQ,UAAY,GAAQ,GAAgB,CAAG,CACrF,CCCe,YAAS,EAAK,CAC5B,MAAO,IAAQ,CAAG,GAAK,GAAa,CAAG,GAAK,IAAQ,IAAS,IAAQ,GAChE,EAAc,CAAG,GAAK,CAAC,OAAO,KAAK,CAAG,EAAE,MAC9C,CCPe,WAAS,EAAK,CAC5B,MAAO,IAAgB,CAAG,GAAM,GAAO,CAAC,EAAE,SAAS,KAAK,CAAG,IAAM,mBAClE,CCPe,YAAS,EAAK,CAC5B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AAU,GAAK,CAAkE,CAE7H,CACJ,CCrJe,YAAe,EAAW,EAAU,CAAC,EAAI,CACpD,AAAM,KAAK,QAAW,MAAK,OAAS,CAAC,GACrC,OAAO,OAAQ,KAAK,OAAQ,CAAU,EAEtC,GAAW,KAAM,KAAQ,EAAQ,aAAe,CAAC,CAAI,EACrD,GAAY,KAAM,KAAQ,EAAQ,cAAgB,CAAC,CAAI,EAEvD,GAAY,KAAM,KAAM,CAAE,GAAK,EAAQ,cAAgB,CAAC,EAAK,cAAe,CAAE,GAAe,EAAc,CAAE,CAAE,EAC/G,GAAe,KAAM,KAAQ,EAAQ,iBAAmB,CAAC,CAAI,EAC7D,GAAY,KAAM,KAAQ,EAAQ,cAAgB,CAAC,CAAI,EACvD,GAAU,KAAM,KAAQ,EAAQ,YAAc,CAAC,CAAI,EACnD,GAAS,KAAM,KAAQ,EAAQ,WAAa,CAAC,CAAI,CACrD,CCjBA,GAAK,KAAM,OAAQ,EAAU",
|
|
4
|
+
"sourcesContent": ["\n/**\n * @imports\n */\nimport Observer from '@webqit/observer';\nimport { _$functionArgs } from './util.js';\nimport { $eval } from './runtime/index.js';\nimport AbstractQuantumScript from './AbstractQuantumScript.js';\nimport State from './runtime/State.js';\n\n/** -------------- APIs */\n\nexport { Observer, State }\n\nexport let QuantumFunction;\n\nexport function AsyncQuantumFunction( ...args ) {\n const { source, params } = _$functionArgs( args );\n const compiledFunction = $eval( 'async-function', parseCompileCallback, source, params );\n if ( !( compiledFunction instanceof Promise ) ) return compiledFunction;\n // Introduce a wrapper function that awaits main function\n const wrapperFunction = async function( ...args ) { return ( await compiledFunction ).call( this, ...args ); }\n Object.defineProperty( wrapperFunction, 'toString', { value: async function( ...args ) { return ( await compiledFunction ).toString( ...args ) } } )\n return wrapperFunction;\n}\nexport const QuantumAsyncFunction = AsyncQuantumFunction; // For backwards compat\n\nexport let QuantumScript;\n\nexport class AsyncQuantumScript extends AbstractQuantumScript {\n static sourceType = 'async-script';\n static parseCompileCallback = parseCompileCallback;\n}\nexport const QuantumAsyncScript = AsyncQuantumScript; // For backwards compat\n\n\nexport class QuantumModule extends AbstractQuantumScript {\n static sourceType = 'module';\n static parseCompileCallback = parseCompileCallback;\n}\n\n/** -------------- parse-compile */\n\nfunction parseCompileCallback( ...args ) {\n const params = typeof args[ args.length - 1 ] === 'object' ? args.pop() : {}; \n const source = args.pop() || '';\n // $qCompiler has been loaded sync?\n if ( globalThis.webqit?.$qCompiler ) {\n const { parse, compile } = globalThis.webqit.$qCompiler;\n const ast = parse( source, params.parserParams );\n return compile( ast, params.compilerParams );\n }\n // Load and run $qCompiler async - in the background?\n globalThis.webqit = globalThis.webqit || {};\n if ( !globalThis.webqit.$qCompilerWorker ) {\n const customUrl = document.querySelector( 'meta[name=\"$q-compiler-url\"]' );\n const compilerUrls = ( customUrl?.content.split( ',' ) || [] ).concat( 'https://unpkg.com/@webqit/quantum-js/dist/compiler.js' );\n const workerScriptText = `\n const compilerUrls = [ '${ compilerUrls.join( `','` ) }' ];\n ( function importScript() {\n try { importScripts( compilerUrls.shift().trim() ) } catch( e ) { if ( compilerUrls.length ) { importScript(); } }\n } )();\n const { parse, compile } = globalThis.webqit.$qCompiler;\n globalThis.onmessage = e => {\n const { source, params } = e.data;\n const ast = parse( source, params.parserParams );\n const { toString, ...compilation } = compile( ast, params.compilerParams );\n e.ports[ 0 ]?.postMessage( compilation );\n };`;\n globalThis.webqit.$qCompilerWorker = new Worker( `data:text/javascript;base64,${ btoa( workerScriptText ) }` );\n }\n return new Promise( res => {\n let messageChannel = new MessageChannel;\n webqit.$qCompilerWorker.postMessage( { source, params }, [ messageChannel.port2 ] );\n messageChannel.port1.onmessage = e => {\n const { ...compilation } = e.data;\n Object.defineProperty( compilation, 'toString', {\n value: base64 => base64 === 'base64' ? compilation.compiledSourceBase64 : compilation.compiledSource\n } );\n res( compilation );\n }\n } );\n}", "import { _isObject, _isTypeObject, _isFunction, _getType } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport { _wq, _await, env } from './util.js';\nimport ListenerRegistry from './core/ListenerRegistry.js';\nimport TrapsRegistry from './core/TrapsRegistry.js';\nimport Descriptor from './core/Descriptor.js';\nimport { unproxy } from './actors.js';\n\n/* ---------------SPECIAL APIs--------------- */\n\n/**\n * Creates a Path array instance from arguments.\n * \n * @param Array\t ...segments\n *\n * @return Path\n */\nclass Path extends Array {}\nexport function path( ...segments ) {\n return new Path( ...segments );\n}\n\n/**\n * Creates a \"Subtree\" directive.\n * \n * @return Subtree\n */\nclass Subtree extends Array {}\nexport function subtree() {\n return new Subtree;\n}\n\n/**\n * Creates an \"Infinity\" directive.\n * \n * @return Infinity\n */\nexport function any() {\n return Infinity;\n}\n\n/**\n * Reduces a path array against handler.\n * \n * @param Array|Object\t target\n * @param Array\t path\n * @param Function\t receiver\n * @param Function\t final\n * @param Object\t params\n * \n * @example reduce( object, [ segement1, segement2 ], observe, ( value, flags ) => {}, params );\n *\n * @return Any\n */\nexport function reduce( target, path, receiver, final = x => x, params = {} ) {\n const _isSubtree = path instanceof Subtree;\n if ( !_isSubtree && !path?.length ) return;\n return ( function eat( target, path, $params, $isSubtree ) {\n const isSubtree = $isSubtree || path[ $params.level ] instanceof Subtree;\n const segment = isSubtree ? Infinity : path[ $params.level ];\n const isLastSegment = isSubtree ? false : $params.level === path.length - 1;\n if ( target instanceof Descriptor && target.operation !== 'get' ) {\n // Always probe event-generated trees\n $params = { ...$params, probe: 'always' };\n } else if ( $params.probe !== 'always' ) {\n // Probe until (before) last segment\n $params = { ...$params, probe: !isLastSegment };\n }\n // ---------------\n return receiver( target, segment, ( result, ...args ) => {\n // -----------\n const addTrail = ( desc ) => {\n if ( !( desc instanceof Descriptor ) ) return;\n desc.path = 'key' in desc ? [ desc.key ] : [];\n if ( target instanceof Descriptor ) {\n desc.path = 'key' in desc ? target.path.concat( desc.key ) : target.path.slice( 0 );\n Object.defineProperty( desc, 'context', { get: () => target, configurable: true } );\n }\n };\n const flags = args[ 0 ] || {};\n const advance = ( result ) => {\n if ( result instanceof Descriptor && 'argumentsList' in result ) {\n return;\n }\n const $value = resolveObj( result/* a Descriptor who's value could be proxied */, false );\n return _await( $value/* could be a promise */, $value => {\n if ( result instanceof Descriptor ) {\n result.value = $value; // Update to (fulfilled), unproxied, value\n } else {\n result = $value;\n }\n return eat( result, path, { ...$params, ...flags, keyInParent: result.key, level: $params.level + 1, }, isSubtree );\n } );\n };\n // -----------\n if ( isPropsList( segment ) && Array.isArray( result ) ) {\n result.forEach( addTrail );\n if ( isLastSegment ) {\n return final( result, ...args );\n }\n if ( isSubtree && result[ 0 ] instanceof Descriptor && ( result[ 0 ].operation !== 'get' || params.asGet ) ) {\n final( result, ...args );\n }\n for ( const entry of result ) {\n advance( entry );\n }\n return;\n }\n // -----------\n addTrail( result );\n if ( isLastSegment ) {\n return final( result, ...args );\n }\n return advance( result );\n // -----------\n }, $params );\n } )( target, path.slice( 0 ), { ...params, level: 0 }, _isSubtree );\n}\n\n/**\n * Adds an observer to a target's registry.\n *\n * @param Array|Object\t target\n * @param String|Object\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return AbortController\n */\nexport function observe( target, prop, receiver, params = {} ) {\n // ---------------\n const originalTarget = resolveObj( target, !params.level );\n\tif ( _isFunction( arguments[ 1 ] ) ) {\n [ , receiver, params = {} ] = arguments;\n prop = Infinity;\n\t}\n\tif ( !_isFunction( receiver ) ) throw new Error( `Handler must be a function; \"${ _getType( receiver ) }\" given!` );\n if ( prop instanceof Path || prop instanceof Subtree ) return reduce( originalTarget, prop, observe, receiver, params );\n // ---------------\n params = { ...params, descripted: true };\n delete params.live;\n if ( !_isTypeObject( originalTarget ) ) return params.probe && get( originalTarget, prop, receiver, params ) || undefined;\n // ---------------\n const emit = bind( originalTarget, prop, receiver, params );\n if ( params.probe ) {\n return get( originalTarget, prop, emit, params );\n }\n return emit();\n}\n\n/**\n * Adds an interceptor object to a target's registry.\n *\n * @param Array|Object\t target\n * @param Object\t traps\n * @param Object\t\t params\n *\n * @return AbortRegistry\n */\nexport function intercept( target, traps, params = {} ) {\n // ---------------\n const originalTarget = resolveObj( target );\n if ( !_isObject( traps ) ) {\n [ /*target*/, /*operation*/, /*handler*/, params = {} ] = arguments;\n traps = { [ arguments[ 1 ] ]: arguments[ 2 ] };\n }\n // ---------------\n return TrapsRegistry.getInstance( originalTarget, true, params.namespace ).addRegistration( { traps, params } );\n}\n\n/* ---------------QUERY APIs--------------- */\n\n/**\n * Performs a \"getOwnPropertyDescriptor\" operation.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getOwnPropertyDescriptor( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'getOwnPropertyDescriptor', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a \"getOwnPropertyDescriptors\" operation.\n * @note this isn't part of the standard Reflect API.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getOwnPropertyDescriptors( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'getOwnPropertyDescriptors', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a \"getPrototypeOf\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getPrototypeOf( target, receiver = x => x, params = {} ) {\n return exec( target, 'getPrototypeOf', {}, receiver, params );\n}\n\n/**\n * Performs a \"isExtensible\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function isExtensible( target, receiver = x => x, params = {} ) {\n return exec( target, 'isExtensible', {}, receiver, params );\n}\n\n/**\n * Performs a \"ownKeys\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function ownKeys( target, receiver = x => x, params = {} ) {\n return exec( target, 'ownKeys', {}, receiver, params );\n}\n\n/**\n * Performs an operation of the given \"type\".\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function has( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'has', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a get operation.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function get( target, prop, receiver = x => x, params = {} ) {\n // ---------------\n let isLive;\n const originalTarget = resolveObj( target, !params.level );\n if ( _isObject( receiver ) ) {\n [ params, receiver ] = [ receiver, x => x ];\n } else if ( params.live ) { isLive = true; }\n if ( prop instanceof Path || prop instanceof Subtree ) return reduce( originalTarget, prop, get, receiver, { ...params, asGet: true } );\n // ---------------\n return resolveProps( originalTarget, prop, props => {\n const related = [ ...props ];\n return ( function next( results, _props, _done ) {\n if ( !_props.length ) return _done( results );\n const prop = _props.shift();\n if ( ![ 'string', 'number', 'symbol' ].includes( typeof prop ) ) {\n throw new Error( `Property name/key ${ prop } invalid.` );\n }\n // ---------\n function defaultGet( descriptor, value = undefined ) {\n const _next = value => ( descriptor.value = value, next( [ ...results, params.live || params.descripted ? descriptor : value ]/** not using concat() as value may be an array */, _props, _done ) );\n if ( arguments.length > 1 ) return _next( value );\n if ( !_isTypeObject( originalTarget ) ) return _next( originalTarget?.[ descriptor.key ] );\n const accessorizedProps = _wq( originalTarget, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key );\n if ( accessorization && accessorization.intact() ) {\n return _next( accessorization.getValue( params.withPropertyDescriptors ) );\n }\n if ( params.withPropertyDescriptors ) {\n const desc = Object.getOwnPropertyDescriptor( originalTarget, descriptor.key );\n return _next( desc );\n }\n return _next( Reflect.get( originalTarget, descriptor.key/*, ...( params.receiver ? [ params.receiver ] : [] )*//*Throws Illegal invocation error ffor DOM nodes, e.g.*/ ) );\n }\n // ---------\n const descriptor = new Descriptor( originalTarget, {\n type: 'get',\n key: prop,\n value: undefined,\n operation: 'get',\n related,\n } );\n if ( !_isTypeObject( originalTarget ) ) return defaultGet( descriptor );\n const trapsRegistry = TrapsRegistry.getInstance( originalTarget, false, params.namespace );\n if ( trapsRegistry ) {\n return trapsRegistry.emit( descriptor, defaultGet );\n }\n return defaultGet( descriptor );\n } )( [], props.slice( 0 ), results => {\n const result_s = isPropsList( prop/*original*/ ) ? results : results[ 0 ];\n if ( isLive && _isTypeObject( originalTarget ) ) {\n const emit = bind( originalTarget, prop, receiver, params, target.key );\n return emit( result_s );\n }\n return receiver( result_s );\n } );\n }, params );\n}\n\n/* ---------------MUTATION APIs--------------- */\n\n/**\n * Performs a batch operation.\n * \n * @param Object\t target\n * @param Function\t callback\n * @param Object\t params\n *\n * @return Void\n */\nexport function batch( target, callback, params = {} ) {\n const originalTarget = resolveObj( target );\n return ListenerRegistry.getInstance( originalTarget, true, params.namespace ).batch( callback, params );\n}\n\n/**\n * Performs a mirror operation.\n * \n * @param Object\t source\n * @param Object\t target\n * @param Object\t params\n *\n * @return Void\n */\nexport function map( source, target, params = {} ) {\n target = resolveObj( target );\n source = resolveObj( source );\n const only = ( params.only || [] ).slice( 0 ), except = ( params.except || [] ).slice( 0 );\n const sourceKeys = Object.keys( params.spread ? [ ...source ] : source ).map( k => !isNaN( k ) ? parseInt( k ) : k );\n const filteredKeys = only.length ? only.filter( k => sourceKeys.includes( k ) ) : sourceKeys.filter( k => !except.includes( k ) );\n const resolveKey = k => { \n if ( !Array.isArray( target ) || isNaN( k ) ) return k;\n return k - except.filter( i => i < k ).length;\n };\n const doSet = key => {\n const descriptor = getOwnPropertyDescriptor( source, key, params );\n if ( ( 'value' in descriptor ) && descriptor.writable && descriptor.enumerable && descriptor.configurable ) {\n set( target, resolveKey( key ), descriptor.value, params );\n } else if ( descriptor.enumerable || params.onlyEnumerable === false ) { defineProperty( target, key, { ...descriptor, configurable: true }, params ); }\n };\n batch( target, () => {\n filteredKeys.forEach( doSet );\n } );\n return observe( source, mutations => {\n //batch( target, () => {\n mutations.filter( m => only.length ? only.includes( m.key ) : !except.includes( m.key ) ).forEach( m => {\n if ( m.type === 'delete' ) return deleteProperty( target, resolveKey( m.key ), params );\n if ( m.type === 'def' ) {\n if ( m.value.enumerable || params.onlyEnumerable === false ) {\n defineProperty( target, resolveKey( m.key ), { ...m.value, configurable: true }, params );\n }\n return;\n }\n doSet( m.key );\n } );\n //}, params );\n }, { ...params, withPropertyDescriptors: true } );\n}\n\n/**\n * Performs a set operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Any\t value\n * @param Function\t receiver\n * @param Object\t params\n * @param Bool\t def\n *\n * @return Any\n */\nexport function set( target, prop, value, receiver = x => x, params = {}, def = false ) {\n // ---------------\n const originalTarget = resolveObj( target );\n let entries = [ [ prop, value ] ];\n if ( _isObject( prop ) ) {\n [ /*target*/, /*hash*/, receiver = x => x, params = {}, def = false ] = arguments;\n entries = Object.entries( prop );\n }\n if ( _isObject( receiver ) ) { [ def, params, receiver ] = [ typeof params === 'boolean' ? params : def, receiver, x => x ]; }\n // ---------------\n const related = entries.map( ( [ prop ] ) => prop );\n return ( function next( descriptors, entries, _done ) {\n if ( !entries.length ) return _done( descriptors );\n const [ prop, value ] = entries.shift();\n // ---------\n function defaultSet( descriptor, status = undefined ) {\n const _next = status => ( descriptor.status = status, next( descriptors.concat( descriptor ), entries, _done ) );\n if ( arguments.length > 1 ) return _next( descriptor, status );\n const accessorizedProps = _wq( originalTarget, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key );\n if ( descriptor.type === 'def' ) {\n if ( accessorization && !accessorization.restore() ) _next( false );\n Object.defineProperty( originalTarget, descriptor.key, descriptor.value );\n return _next( true );\n }\n if ( accessorization && accessorization.intact() ) {\n return _next( accessorization.setValue( descriptor.value ) );\n }\n return _next( Reflect.set( originalTarget, descriptor.key, descriptor.value ) );\n }\n // ---------\n function exec( isUpdate, oldValue ) {\n if ( params.diff && value === oldValue ) return next( descriptors, entries, _done );\n const descriptor = new Descriptor( originalTarget, {\n type: def ? 'def' : 'set',\n key: prop,\n value,\n isUpdate,\n oldValue,\n related: [ ...related ],\n operation: def ? 'defineProperty' : 'set',\n detail: params.detail,\n } );\n const trapsRegistry = TrapsRegistry.getInstance( originalTarget, false, params.namespace );\n return trapsRegistry \n ? trapsRegistry.emit( descriptor, defaultSet ) \n : defaultSet( descriptor );\n }\n // ---------\n return has( originalTarget, prop, exists => {\n if ( !exists ) return exec( exists );\n if ( prop === 'length' && Array.isArray( originalTarget ) && _wq( originalTarget ).has( '$length' ) ) {\n return exec( true, _wq( originalTarget ).get( '$length' ) );\n }\n const $params = { ...params, withPropertyDescriptors: def };\n return get( originalTarget, prop, oldValue => exec( exists, oldValue ), $params );\n }, params );\n // ---------\n } )( [], entries.slice( 0 ), descriptors => {\n const listenerRegistry = ListenerRegistry.getInstance( originalTarget, false, params.namespace );\n if ( listenerRegistry ) listenerRegistry.emit( descriptors, { eventsArePropertyDescriptors: !!def } );\n return receiver(\n isPropsList( prop/*original*/ ) ? descriptors.map( opr => opr.status ) : descriptors[ 0 ]?.status\n );\n } );\n}\n\n/**\n * Performs a defineProperty operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Object\t descriptor\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function defineProperty( target, prop, descriptor, receiver = x => x, params = {} ) {\n return set( target, prop, descriptor, receiver, params, true/*def*/ );\n}\n\n/**\n * Performs a defineProperties operation.\n * @note this isn't part of the standard Reflect API.\n * \n * @param Object\t target\n * @param Object\t descriptors\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function defineProperties( target, descriptors, receiver = x => x, params = {} ) {\n return set( target, descriptors, receiver, params, true/*def*/ );\n}\n\n/**\n * Performs a delete operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function deleteProperty( target, prop, receiver = x => x, params = {} ) {\n // ---------------\n const originalTarget = resolveObj( target );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; }\n // ---------------\n const props = _arrFrom( prop, false ), related = [ ...props ];\n return ( function next( descriptors, props, _done ) {\n if ( !props.length ) return _done( descriptors );\n const prop = props.shift();\n // ---------\n function defaultDel( descriptor, status = undefined ) {\n const _next = status => ( descriptor.status = status, next( descriptors.concat( descriptor ), props, _done ) );\n if ( arguments.length > 1 ) return _next( descriptor, status );\n const accessorizedProps = _wq( originalTarget, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key );\n if ( accessorization && !accessorization.restore() ) _next( false );\n return _next( Reflect.deleteProperty( originalTarget, descriptor.key ) );\n }\n // ---------\n function exec( oldValue ) {\n const descriptor = new Descriptor( originalTarget, {\n type: 'delete',\n key: prop,\n oldValue,\n related: [ ...related ],\n operation: 'deleteProperty',\n detail: params.detail,\n } );\n const trapsRegistry = TrapsRegistry.getInstance( originalTarget, false, params.namespace );\n return trapsRegistry \n ? trapsRegistry.emit( descriptor, defaultDel ) \n : defaultDel( descriptor );\n }\n // ---------\n return get( originalTarget, prop, exec, params );\n // ---------\n } )( [], props.slice( 0 ), descriptors => {\n const listenerRegistry = ListenerRegistry.getInstance( originalTarget, false, params.namespace );\n if ( listenerRegistry ) listenerRegistry.emit( descriptors );\n return receiver(\n isPropsList( prop/*original*/ ) ? descriptors.map( opr => opr.status ) : descriptors[ 0 ].status\n );\n } );\n}\n\n/**\n * @alias deleteProperty()\n */\nexport function deleteProperties( target, props, receiver = x => x, params = {} ) {\n return deleteProperty( ...arguments );\n}\n\n/* ---------------EFFECT APIs--------------- */\n\n/**\n * Performs a \"construct\" operation.\n *\n * @param Array|Object\t target\n * @param Array\t\t\t argumentsList\n * @param Object\t\t newTarget\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function construct( target, argumentsList, newTarget = null, receiver = x => x, params = {} ) {\n return exec( target, 'construct', arguments.length > 2 ? { argumentsList, newTarget } : { argumentsList }, receiver, params );\n}\n\n/**\n * Performs an \"apply\" operation.\n *\n * @param Array|Object\t target\n * @param Any\t thisArgument\n * @param Array\t argumentsList\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function apply( target, thisArgument, argumentsList, receiver = x => x, params = {} ) {\n const originalThis = unproxy( thisArgument );\n let returnValue;\n if ( Array.isArray( thisArgument ) ) {\n if ( params.arrayMethodName ) {\n const descriptor = new Descriptor( originalThis, {\n operation: params.arrayMethodName,\n argumentsList\n } );\n const listenerRegistry = ListenerRegistry.getInstance( originalThis, false, params.namespace );\n listenerRegistry?.emit( [ descriptor ], { eventIsArrayMethodDescriptor: true } );\n }\n _wq( originalThis ).set( '$length', originalThis.length );\n returnValue = batch(\n originalThis,\n () => exec( target, 'apply', { thisArgument/*proxy wrappers allowed; in fact is why it works*/, argumentsList }, receiver, params ),\n params\n );\n _wq( originalThis ).delete( '$length' );\n } else {\n returnValue = exec( target, 'apply', { thisArgument: originalThis, argumentsList }, receiver, params );\n }\n return returnValue;\n}\n\n/**\n * Performs a \"setPrototypeOf\" operation.\n *\n * @param Array|Object\t target\n * @param Anyr\t proto\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function setPrototypeOf( target, proto, receiver = x => x, params = {} ) {\n return exec( target, 'setPrototypeOf', { proto }, receiver, params );\n}\n\n/**\n * Performs a \"preventExtension\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function preventExtensions( target, receiver = x => x, params = {} ) {\n return exec( target, 'preventExtensions', {}, receiver, params );\n}\n\n/* ---------------HELPER APIs--------------- */\n\n/**\n * Adds an observer to a target's registry.\n *\n * @param Array|Object\t target\n * @param String|Object\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Function: AbortController\n */\nfunction bind( target, prop, receiver, params = {} ) {\n const controller = new AbortController;\n env.setMaxListeners?.( 0, controller.signal );\n if ( params.signal ) { params.signal.addEventListener( 'abort', () => controller.abort() ); }\n const $params = { ...params, signal: controller.signal };\n const listenerRegistry = ListenerRegistry.getInstance( target, true, $params.namespace );\n const childRegistrations = new Map;\n return function emit( descriptor_s = [], prevRegistration = null ) {\n let flags, registrationNext, isExisting;\n if ( isPropsList( prop ) ) {\n if ( prevRegistration ) {\n isExisting = true;\n registrationNext = prevRegistration;\n for ( const descriptor of descriptor_s ) {\n childRegistrations.get( descriptor.key )?.remove();\n childRegistrations.delete( descriptor.key );\n }\n } else {\n registrationNext = listenerRegistry.addRegistration( prop, emit, $params );\n }\n flags = { signal: registrationNext.signal, childRegistrations };\n } else {\n prevRegistration?.remove();\n registrationNext = listenerRegistry.addRegistration( prop, emit, $params );\n flags = { signal: registrationNext.signal };\n }\n // ------------------\n if ( $params.childRegistrations && $params.keyInParent ) {\n $params.childRegistrations.set( $params.keyInParent, registrationNext );\n }\n // ------------------\n if ( arguments.length ) {\n const handlerReturnValue = receiver( descriptor_s, flags );\n if ( arguments.length > 1 ) return handlerReturnValue;\n }\n return controller;\n };\n}\n\n/**\n * Performs an operation of the given \"type\".\n *\n * @param Array|Object\t target\n * @param String\t\t operation\n * @param Object\t\t payload\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nfunction exec( target, operation, payload = {}, receiver = x => x, params = {} ) {\n // ---------\n target = resolveObj( target );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; } \n // ---------\n function defaultExec( descriptor, result ) {\n if ( arguments.length > 1 ) return receiver( result );\n return receiver( ( Reflect[ operation ] || Object[ operation ] )( target, ...Object.values( payload ) ) );\n }\n // ---------\n const descriptor = new Descriptor( target, { operation, ...payload } );\n const trapsRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n if ( trapsRegistry ) {\n return trapsRegistry.emit( descriptor, defaultExec );\n }\n return defaultExec( descriptor );\n}\n\n// Asks if prop is a multi-result field\nfunction isPropsList( prop ) {\n return prop === Infinity || Array.isArray( prop );\n}\n\n// Resolves obj down to it's self\nfunction resolveObj( obj, assert = true, probePropertyDescriptors = true ) {\n\tif ( ( !obj || !_isTypeObject( obj ) ) && assert ) throw new Error( `Object must be of type object or array! \"${ _getType( obj ) }\" given.` );\n if ( obj instanceof Descriptor ) {\n if ( obj.type === 'def' && probePropertyDescriptors ) {\n obj = typeof obj.value.get === 'function' ? obj.value.get() : obj.value.value;\n } else {\n obj = obj.value;\n }\n }\n\treturn obj && unproxy( obj );\n}\n\n// Resolves prop down to actual keys\nfunction resolveProps( obj, prop, receiver, params = {} ) {\n if ( prop === Infinity ) {\n if ( params.level && !_isTypeObject( obj ) ) return receiver( [] );\n return receiver( Object.keys( obj ) );\n }\n return receiver( _arrFrom( prop, false ) );\n}\n", "\n/**\n * Tells if val is pure object.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !Array.isArray(val) && typeof val === 'object' && val;\n};\n", "\n/**\n * Returns the val's type.\n *\n * @param string \tval\n *\n * @return string\n */\nexport default function(val) {\n\treturn typeof val;\n};\n", "\n/**\n * Tells if val is of type \"array\".\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val);\n};\n", "\n/**\n * Tells if val is of type \"function\".\n * This holds true for both regular functions and classes.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn typeof val === 'function';\n};\n", "\n/**\n * Tells if val is undefined or is null.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val === null || val === '';\n};\n", "\n/**\n * Tells if val is undefined or is of type \"undefined\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn arguments.length && (val === undefined || typeof val === 'undefined');\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"object\".\n * This holds true for anything object, including built-ins.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val) || (typeof val === 'object' && val) || _isTypeFunction(val);\n};\n", "\n/**\n * @imports\n */\nimport _isNull from './isNull.js';\nimport _isUndefined from './isUndefined.js';\nimport _isTypeObject from './isTypeObject.js';\n\n/**\n * Tells if val is empty in its own type.\n * This holds true for NULLs, UNDEFINED, FALSE, 0,\n * objects without keys, empty arrays.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNull(val) || _isUndefined(val) || val === false || val === 0 \n\t\t|| (_isTypeObject(val) && !Object.keys(val).length);\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"function\".\n *\n * @param object \t\tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isTypeFunction(val) || (val && {}.toString.call(val) === '[object function]');\n};\n", "\n/**\n * Tells if val is of type \"number\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof Number || (typeof val === 'number');\n};\n", "\n/**\n * @imports\n */\nimport _isNumber from './isNumber.js';\n/**\n * Tells if val is of type \"string\" or a numeric string.\n * This holds true for both numbers and numeric strings.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNumber(val) || (val !== true && val !== false && val !== null && val !== '' && !isNaN(val * 1));\n};\n", "\n/**\n * Tells if val is of type \"string\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof String || (typeof val === 'string' && val !== null);\n};\n", "\n/**\n * @imports\n */\nimport _isString from './isString.js';\nimport _isUndefined from './isUndefined.js';\n\n/**\n * Tells if val is \"array-like\".\n * This holds true for anything that has a length property.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !_isString(val) && !_isUndefined(val.length);\n};\n", "\n/**\n * Adds an item if not already exist.\n *\n * @param array \tarr\n * @param array\t \t...itms\n *\n * @return array\n */\nexport default function(arr, ...items) {\n\titems.forEach(itm => {\n\t\tif (arr.indexOf(itm) < 0) {\n\t\t\tarr.push(itm);\n\t\t}\n\t});\n\treturn arr;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\n\n/**\n * Returns the prototype chain.\n *\n * @param object \t\tobj\n * @param object\t \tuntil\n *\n * @return bool\n */\nexport default function(obj, until) {\n\tuntil = until || Object.prototype;\n\tuntil = until && !_isArray(until) ? [until] : until;\n\t// We get the chain of inheritance\n\tvar prototypalChain = [];\n\tvar obj = obj;\n\twhile((obj && (!until || until.indexOf(obj) < 0) && obj.name !== 'default')) {\n\t\tprototypalChain.push(obj);\n\t\tobj = obj ? Object.getPrototypeOf(obj) : null;\n\t}\n\treturn prototypalChain;\n};\n", "\n/**\n * @imports\n */\nimport _pushUnique from '../arr/pushUnique.js';\nimport _getPrototypeChain from './getPrototypeChain.js';\n\n/**\n * Eagerly retrieves object members all down the prototype chain.\n *\n * @param object\t \tobj\n * @param object\t \tuntil\n *\n * @return array\n */\nexport default function(obj, until) {\n\tvar keysAll = [];\n\t_getPrototypeChain(obj, until).forEach(obj => {\n\t\t_pushUnique(keysAll, ...Object.getOwnPropertyNames(obj));\n\t});\n\treturn keysAll;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isObject from '../js/isObject.js';\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _getAllPropertyNames from './getAllPropertyNames.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function mergeCallback(objs, callback, deepProps = false, isReplace = false, withSymbols = false) {\n\tvar depth = 0;\n\tvar obj1 = objs.shift();\n\tif (_isNumeric(obj1) || obj1 === true || obj1 === false) {\n\t\tdepth = obj1;\n\t\tobj1 = objs.shift();\n\t}\n\tif (!objs.length) {\n\t\tthrow new Error('_merge() requires two or more array/objects.');\n\t}\n\tobjs.forEach((obj2, i) => {\n\t\tif (!_isTypeObject(obj2) && !_isFunction(obj2)) {\n\t\t\treturn;\n\t\t}\n\t\t(deepProps ? _getAllPropertyNames(obj2) : Object.keys(obj2)).forEach(key => {\n\t\t\tif (!callback(key, obj1, obj2, i)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valAtObj1 = obj1[key];\n\t\t\tvar valAtObj2 = obj2[key];\n\t\t\tif (((_isArray(valAtObj1) && _isArray(valAtObj2)) || (_isObject(valAtObj1) && _isObject(valAtObj2))) \n\t\t\t&& (depth === true || depth > 0)) {\n\t\t\t\t// RECURSE...\n\t\t\t\tobj1[key] = _isArray(valAtObj1) && _isArray(valAtObj2) ? [] : {};\n\t\t\t\tmergeCallback([_isNumeric(depth) ? depth - 1 : depth, obj1[key], valAtObj1, valAtObj2], callback, deepProps, isReplace, withSymbols);\n\t\t\t} else {\n\t\t\t\tif (_isArray(obj1) && _isArray(obj2)) {\n\t\t\t\t\tif (isReplace) {\n\t\t\t\t\t\tobj1[key] = valAtObj2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobj1.push(valAtObj2);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// In case we're setting a read-only property\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (withSymbols) {\n\t\t\t\t\t\t\tObject.defineProperty(obj1, key, Object.getOwnPropertyDescriptor(obj2, key));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tobj1[key] = obj2[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\treturn obj1;\n};\n", "\n/**\n * @imports\n */\nimport _mergeCallback from './mergeCallback.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function(...objs) {\n\treturn _mergeCallback(objs, (k, obj1, obj2) => {\n\t\treturn true;\n\t}, false/*deepProps*/, false/*isReplace*/, false/*withSymbols*/);\n};\n", "export default function wq(obj, ...namespaces) {\n if (!obj || !['object', 'function'].includes(typeof obj)) {\n throw new Error(`Argument #1 must be of type object`);\n }\n let wq = obj[Symbol.for('wq')];\n if (!wq) {\n wq = new WQInternals;\n Object.defineProperty(obj, Symbol.for('wq'), {\n value: wq,\n // Defaults, but to be explicit...\n enumerable: false,\n configurable: false,\n writable: false\n });\n }\n if (!namespaces.length) {\n return wq;\n }\n let _ns, _wq;\n while ((_ns = namespaces.shift())) {\n if ((_wq = wq) && !(wq = wq.get(_ns))) {\n wq = new WQInternals;\n _wq.set(_ns, wq);\n }\n }\n return wq;\n}\n\nclass WQInternals extends Map {}", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isTypeArray from '../js/isTypeArray.js';\nimport _isEmpty from '../js/isEmpty.js';\nimport _isObject from '../js/isObject.js';\n\n/**\n * Casts an array-like object to an array.\n *\n * @param mixed \tval\n * @param bool\t \tcastObject\n *\n * @return array\n */\nexport default function(val, castObject = true) {\n\tif (_isArray(val)) {\n\t\treturn val;\n\t};\n\tif (!castObject && _isObject(val)) {\n\t\treturn [val];\n\t};\n\tif (val !== false && val !== 0 && _isEmpty(val)) {\n\t\treturn [];\n\t};\n\tif (_isTypeArray(val)) {\n\t\treturn Array.prototype.slice.call(val);\n\t};\n\tif (_isObject(val)) {\n\t\treturn Object.values(val);\n\t};\n\treturn [val];\n};\n", "\n/**\n * @imports\n */\nimport { _wq as __wq } from '@webqit/util/js/index.js';\n\nexport const _wq = ( target, ...args ) => __wq( target, 'observerAPI', ...args );\n\nexport const _await = ( value, callback ) => value instanceof Promise ? value.then( callback ) : callback( value );\n\nexport const env = {};\n", "\n/**\n * ---------------------------\n * The Registration class\n * ---------------------------\n */\n\nexport default class Registration {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param Registry\t\t\tregistry\n\t * @param object\t\t\tdfn\n\t *\n\t * @return void\n\t */\n\tconstructor( registry, dfn ) {\n\t\tthis.registry = registry;\n\t\tObject.assign( this, { ...dfn, target: registry.target } );\n\t\tif ( this.params.signal ) {\n\t\t\tthis.params.signal.addEventListener( 'abort', () => this.remove() );\n\t\t}\n\t}\n\n\t/**\n\t * Sets a \"disconnected\" flag on the Registration.\n\t *\n\t * @return void\n\t */\n\tremove() {\n\t\tthis.removed = true;\n\t\treturn this.registry.removeRegistration( this );\n\t}\n}", "\n/**\n * @imports\n */\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport Registration from './Registration.js';\nimport { _await, env } from '../util.js';\n\n/**\n * ---------------------------\n * The ListenerRegistration class\n * ---------------------------\n */\n\nexport default class ListenerRegistration extends Registration {\n\t\n\t/**\n\t * @constructor\n\t */\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.emit.currentRegistration = this;\n\t\tObject.defineProperty( this, 'abortController', { value: new AbortController } );\n\t\tObject.defineProperty( this, 'signal', { value: this.abortController.signal } );\n\t\tenv.setMaxListeners?.( 0, this.signal );\n\t}\n\n\t/**\n\t * De-registers the instance.\n\t * \n\t * @return Void\n\t */\n\tremove() {\n\t\tthis.abortController.abort();\n\t\tsuper.remove();\n\t}\n\n\t/**\n\t * Calls the observer's handler function\n\t * on matching with the event's fields.\n\t *\n\t * @param Array\t\t\t \t\tevents\n\t *\n\t * @return Any\n\t */\n\tfire( events ) {\n\t\tif ( this.emit.recursionTarget && ![ 'inject', 'force-async', 'force-sync' ].includes( this.params.recursions ) ) return;\n\t\tlet matches = events, filter = this.filter;\n\t\tif ( filter !== Infinity && ( filter = _arrFrom( filter, false ) ) ) {\n\t\t\tmatches = events.filter( event => filter.includes( event.key ) );\n\t\t}\n\t\tif ( this.params.diff ) {\n\t\t\tmatches = matches.filter( event => event.type !== 'set' || event.value !== event.oldValue );\n\t\t}\n\t\tif ( !matches.length ) return;\n\t\tif ( [ 'inject', 'defer' ].includes( this.params.recursions ) ) {\n\t\t\tif ( this.emit.recursionTarget ) {\n\t\t\t\tthis.emit.recursionTarget.push( ...matches );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.emit.recursionTarget = this.params.recursions === 'inject' ? matches : [];\n\t\t}\n\t\tconst $ret = this.filter === Infinity || Array.isArray( this.filter )\n\t\t\t? this.emit( matches, this )\n\t\t\t: this.emit( matches[ 0 ], this );\n\t\t// NOTEL: on calling emit(), this registration has expired and a new one active!!!\n\t\treturn _await( $ret, ret => {\n\t\t\tconst recursions = this.emit.recursionTarget;\n\t\t\tdelete this.emit.recursionTarget;\n\t\t\tif ( this.params.recursions === 'defer' ) {\n\t\t\t\tif ( recursions?.length ) return this.emit.currentRegistration.fire( recursions );\n\t\t\t}\n\t\t\treturn ret;\n\t\t} );\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _isTypeObject, _getType } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom, _intersect, _equals as _arrEquals } from '@webqit/util/arr/index.js';\nimport { _wq } from '../util.js';\n\n/**\n * ---------------------------\n * The Registry class\n * ---------------------------\n */\n\nexport default class Registry {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param object\ttarget\n\t * \n\t * @return void\n\t */\n\tconstructor( target ) {\n\t\tthis.target = target;\n\t\tthis.entries = [];\n\t}\n\t\n\t/**\n\t * Adds an Registration instance\n\t * with optional tags.\n\t *\n\t * @param Registration\t\tregistration\n\t *\n\t * @return Registration\n\t */\n\taddRegistration( registration ) {\n\t\tthis.entries.push( registration );\n\t\treturn registration;\n\t}\n\t\n\t/**\n\t * Removes registrations by reference.\n\t *\n\t * @param Registration\t\tregistration\n\t *\n\t * @return void\n\t */\n\tremoveRegistration( registration ) {\n\t\tthis.entries = this.entries.filter( _entry => _entry !== registration );\n\t}\n\t\t\n\t/**\n\t * Returns a observer-specific object embedded on an element.\n\t *\n\t * @param string\t\ttype\n\t * @param array|object\ttarget\n\t * @param bool \tcreateIfNotExists\n\t * @param string \tnamespace\n\t *\n\t * @return Registry\n\t */\n\tstatic _getInstance( type, target, createIfNotExists = true, namespace = this.__namespace ) {\n\t\tif ( !_isTypeObject( target ) ) throw new Error( `Subject must be of type object; \"${ _getType( target ) }\" given!` );\n\t\tlet ImplementationClass = this;\n\t\tif ( namespace && _wq( Registry, 'namespaces' ).has( type + '-' + namespace ) ) {\n\t\t\tImplementationClass = _wq( Registry, 'namespaces' ).get( type + '-' + namespace );\n\t\t\ttype += '-' + namespace\n\t\t}\n\t\tif ( !_wq( target, 'registry' ).has( type ) && createIfNotExists ) {\n\t\t\t_wq( target, 'registry' ).set( type, new ImplementationClass( target ) );\n\t\t}\n\t\treturn _wq( target, 'registry' ).get( type );\n\t}\n\n\t/**\n\t * Extend a Fireable Class with a namespace.\n\t *\n\t * @param string\t\tnamespace\n\t * @param class \tImplementationClass\n\t *\n\t * @return void|class\n\t */\n\tstatic _namespace( type, namespace, ImplementationClass = null ) {\n\t\ttype += '-' + namespace;\n\t\tif ( arguments.length === 2 ) return _wq( Registry, 'namespaces' ).get( type );\n\t\tif ( !( ImplementationClass.prototype instanceof this ) ) {\n\t\t\tthrow new Error( `The implementation of the namespace ${ this.name }.${ namespace } must be a subclass of ${ this.name }.` );\n\t\t}\n\t\t_wq( Registry, 'namespaces' ).set( type, ImplementationClass );\n\t\tImplementationClass.__namespace = namespace;\n\t}\n}", "\n/**\n * ---------------------------\n * The Descriptor class\n * ---------------------------\n */\n\nexport default class Descriptor {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param array|object\ttarget\n\t * @param object\t\tdfn\n\t *\n\t * @return void\n\t */\n\tconstructor( target, dfn ) {\n\t\tthis.target = target;\n\t\tif ( !( dfn.operation ) ) throw new Error( 'Descriptor operation must be given in definition!' );\n\t\tObject.assign( this, dfn );\n\t}\n}", "\n/**\n * @imports\n */\nimport ListenerRegistration from './ListenerRegistration.js';\nimport Registry from './Registry.js';\nimport { _await } from '../util.js';\nimport Descriptor from './Descriptor.js';\n\n/**\n * ---------------------------\n * The ListenerRegistry class\n * ---------------------------\n */\n\nexport default class ListenerRegistry extends Registry {\n\n\tstatic getInstance( target, createIfNotExists = true, namespace = null ) {\n\t\treturn super._getInstance( 'listeners', ...arguments );\n\t}\n\n\tstatic namespace( namespace, ImplementationClass = null ) {\n\t\treturn super._namespace( 'listeners', ...arguments );\n\t}\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( target ) {\n\t\tsuper( target );\n\t\tthis.batches = [];\n\t}\n\t\n\t/**\n\t * @addRegistration\n\t */\n\taddRegistration( filter, emit, params ) {\n\t\treturn super.addRegistration( new ListenerRegistration( this, { filter, emit, params } ) );\n\t}\n\t\n\t/**\n\t * Fires all observers with the given evt (change).\n\t *\n\t * @param Arrayn events\n\t *\n\t * @return Void\n\t */\n\temit( events, { eventsArePropertyDescriptors = false, eventIsArrayMethodDescriptor = false } = {} ) {\n\t\tif ( this.batches.length ) {\n\t\t\tconst arrayMethodName = this.batches[ 0 ].params.arrayMethodName;\n\t\t\tthis.batches[ 0 ].snapshots.push( {\n\t\t\t\tevents: [ ...events ],\n\t\t\t\tarrayMethodName, // Typically from array operations\n\t\t\t\teventsArePropertyDescriptors, // Typically from defineProperty() operations\n\t\t\t\teventIsArrayMethodDescriptor // Typically from array method operations\n\t\t\t} );\n\t\t\treturn\n\t\t}\n\t\tthis.$emit( this.entries, [ {\n\t\t\tevents, \n\t\t\teventsArePropertyDescriptors, // Typically from defineProperty() operations\n\t\t\teventIsArrayMethodDescriptor // Typically from array method operations\n\t\t} ] );\n\t}\n\n\t$emit( listeners, snapshots ) {\n\t\t// Analyse listener modes\n\t\tlet listenersLength = 0,\n\t\tlistenersAskingEventsWithPropertyDescriptors = 0,\n\t\tlistenersAskingArrayMethodDescriptors = 0;\n\t\tfor ( const listener of listeners ) {\n\t\t\tlistenersLength += 1;\n\t\t\tif ( listener.params.withPropertyDescriptors ) {\n\t\t\t\tlistenersAskingEventsWithPropertyDescriptors += 1;\n\t\t\t}\n\t\t\tif ( listener.params.withArrayMethodDescriptors ) {\n\t\t\t\tlistenersAskingArrayMethodDescriptors += 1;\n\t\t\t}\n\t\t}\n\t\t// Sort events\n\t\tconst events_with_PropertyDescriptors_with_ArrayMethodDescriptors = [], events_with_PropertyDescriptors_without_ArrayMethodDescriptors = [];\n\t\tconst events_without_PropertyDescriptors_with_ArrayMethodDescriptors = [], events_without_PropertyDescriptors_without_ArrayMethodDescriptors = [];\n\t\tfor ( const snapshot of snapshots ) {\n\t\t\tconst arrayMethodName = snapshot.arrayMethodName;\n\t\t\tconst eventsArePropertyDescriptors = snapshot.eventsArePropertyDescriptors;\n\t\t\tconst eventIsArrayMethodDescriptor = snapshot.eventIsArrayMethodDescriptor;\n\t\t\tfor ( const event of snapshot.events ) {\n\t\t\t\tif ( arrayMethodName ) {\n\t\t\t\t\tevent.operation = arrayMethodName;\n\t\t\t\t}\n\t\t\t\t// Some opting in to PropertyDescriptors\n\t\t\t\tif ( listenersAskingEventsWithPropertyDescriptors ) {\n\t\t\t\t\t//if ( !arrayMethodName ) { }\n\t\t\t\t\tlistenersAskingArrayMethodDescriptors && // Some opting in to ArrayMethodDescriptors\n\t\t\t\t\tevents_with_PropertyDescriptors_with_ArrayMethodDescriptors.push( event );\n\t\t\t\t\tif ( !eventIsArrayMethodDescriptor ) {\n\t\t\t\t\t\tlistenersAskingArrayMethodDescriptors !== listenersLength && // Some opting out of ArrayMethodDescriptors\n\t\t\t\t\t\tevents_with_PropertyDescriptors_without_ArrayMethodDescriptors.push( event );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Some opting out of PropertyDescriptors\n\t\t\t\tif ( listenersAskingEventsWithPropertyDescriptors !== listenersLength ) {\n\t\t\t\t\tlet $event = event;\n\t\t\t\t\tif ( eventsArePropertyDescriptors ) {\n\t\t\t\t\t\tconst { target, type, ...details } = event;\n\t\t\t\t\t\t$event = new Descriptor( target, { type: 'set', ...details } );\n\t\t\t\t\t\tObject.defineProperty( $event, 'value', 'get' in details.value ? { get: () => details.value.get() } : { value: details.value.value } )\n\t\t\t\t\t\tif ( details.oldValue ) {\n\t\t\t\t\t\t\tObject.defineProperty( $event, 'oldValue', 'get' in details.oldValue ? { get: () => details.oldValue.get() } : { value: details.oldValue.value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if ( !arrayMethodName/*Although eedless as is typically mutually exclusive to eventsArePropertyDescriptors*/ ) { }\n\t\t\t\t\tlistenersAskingArrayMethodDescriptors && // Some opting in to ArrayMethodDescriptors\n\t\t\t\t\tevents_without_PropertyDescriptors_with_ArrayMethodDescriptors.push( $event );\n\t\t\t\t\tif ( !eventIsArrayMethodDescriptor ) { // Although eedless as is typically already implied by eventsArePropertyDescriptors\n\t\t\t\t\t\tlistenersAskingArrayMethodDescriptors !== listenersLength && // Some opting out of ArrayMethodDescriptors\n\t\t\t\t\t\tevents_without_PropertyDescriptors_without_ArrayMethodDescriptors.push( $event );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Dispatch\n\t\tfor ( const listener of listeners ) {\n\t\t\tif ( listener.params.withPropertyDescriptors ) {\n\t\t\t\tif ( listener.params.withArrayMethodDescriptors ) {\n\t\t\t\t\tevents_with_PropertyDescriptors_with_ArrayMethodDescriptors.length &&\n\t\t\t\t\tlistener.fire( events_with_PropertyDescriptors_with_ArrayMethodDescriptors );\n\t\t\t\t} else {\n\t\t\t\t\tevents_with_PropertyDescriptors_without_ArrayMethodDescriptors.length &&\n\t\t\t\t\tlistener.fire( events_with_PropertyDescriptors_without_ArrayMethodDescriptors );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( listener.params.withArrayMethodDescriptors ) {\n\t\t\t\t\tevents_without_PropertyDescriptors_with_ArrayMethodDescriptors.length &&\n\t\t\t\t\tlistener.fire( events_without_PropertyDescriptors_with_ArrayMethodDescriptors );\n\t\t\t\t} else {\n\t\t\t\t\tevents_without_PropertyDescriptors_without_ArrayMethodDescriptors.length &&\n\t\t\t\t\tlistener.fire( events_without_PropertyDescriptors_without_ArrayMethodDescriptors );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Fires all observers with the given evt (change).\n\t *\n\t * @param Arrayn events\n\t *\n\t * @return Void\n\t */\n\tbatch( callback, params = {} ) {\n\t\tthis.batches.unshift( { entries: [ ...this.entries ], snapshots: [], params } );\n\t\tconst returnValue = callback();\n\t\treturn _await( returnValue, returnValue => {\n\t\t\tconst batch = this.batches.shift();\n\t\t\tif ( !batch.snapshots.length ) return returnValue;\n\t\t\tthis.$emit( batch.entries, batch.snapshots );\n\t\t\treturn returnValue;\n\t\t} );\n\t}\n\n}\n", "\n/**\n * @imports\n */\nimport Registration from './Registration.js';\n\n/**\n * ---------------------------\n * The TrapsRegistration class\n * ---------------------------\n */\n\nexport default class TrapsRegistration extends Registration {\n\t\n\t/**\n\t * Calls the observer's handler function\n\t * on matching with the descriptor's fields.\n\t *\n\t * @param Descriptor\t\t\t \tdescriptor\n\t * @param function\t\t\t\t\tnext\n\t * @param mixed\t\t\t\t\t \trecieved\n\t *\n\t * @return void\n\t */\n\texec( descriptor, next, recieved ) {\n\t\tif ( this.running || !this.traps[ descriptor.operation ] ) {\n\t\t\treturn next( ...Array.prototype.slice.call( arguments, 2 ) );\n\t\t}\n\t\tthis.running = true;\n\t\treturn this.traps[ descriptor.operation ]( descriptor, recieved, ( ...args ) => {\n\t\t\tthis.running = false;\n\t\t\treturn next( ...args );\n\t\t} );\n\t}\n}", "\n/**\n * @imports\n */\nimport TrapsRegistration from './TrapsRegistration.js';\nimport Registry from './Registry.js';\n\n/**\n * ---------------------------\n * The TrapsRegistry class\n * ---------------------------\n */\n\nexport default class TrapsRegistry extends Registry {\n\n\tstatic getInstance( target, createIfNotExists = true, namespace = null ) {\n\t\treturn super._getInstance( 'traps', ...arguments );\n\t}\n\n\tstatic namespace( namespace, ImplementationClass = null ) {\n\t\treturn super._namespace( 'traps', ...arguments );\n\t}\n\t\n\t/**\n\t * @inheritdoc\n\t */\n\taddRegistration( dfn ) {\n\t\treturn super.addRegistration( new TrapsRegistration( this, dfn ) );\n\t}\n\n\t/**\n\t * Fires all interceptors with the given action.\n\t *\n\t * @param Descriptor\t\tdescriptor\n\t * @param function\t\t\tdefaultHandler\n\t *\n\t * @return mixed\n\t */\n\temit( descriptor, defaultHandler = null ) {\n\t\tconst $this = this;\n\t\treturn ( function next( index, ..._args ) {\n\t\t\tconst registration = $this.entries[ index ];\n\t\t\tif ( registration ) {\n\t\t\t\treturn registration.exec( descriptor, ( ...args ) => {\n\t\t\t\t\treturn next( index + 1, ...args );\n\t\t\t\t}/*next*/, ..._args );\n\t\t\t}\n\t\t\treturn defaultHandler ? defaultHandler( descriptor, ..._args ) : _args[ 0 ];\n\t\t} )( 0 );\n\t}\n}", "\n/**\n * @imports\n */\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport { _isClass, _isFunction, _isTypeObject, _getType } from '@webqit/util/js/index.js';\nimport { set, deleteProperty, has, get, ownKeys, defineProperty, getOwnPropertyDescriptor } from \"./main.js\";\nimport { apply, construct, getPrototypeOf, setPrototypeOf, isExtensible, preventExtensions } from \"./main.js\";\nimport { _wq } from './util.js';\n\n/* ---------------ACCESSORIZE METHODS--------------- */\n\n/**\n * Accessorizes props.\n *\n * @param Array|Object\ttarget\n * @param String|Array\tprops\n * @param Object\t\tparams\n *\n * @return Array\n */\nconst symWQOriginal = Symbol('wqOriginal');\nexport function accessorize( target, props, params = {} ) {\n target = resolveTarget( target );\n const accessorizedProps = _wq( target, 'accessorizedProps' );\n // ---------\n function getDescriptorDeep( prop ) {\n let descriptor, proto = target;\n do {\n descriptor = Object.getOwnPropertyDescriptor( proto, prop );\n } while ( !descriptor && ( proto = Object.getPrototypeOf( proto ) ) );\n return descriptor \n ? { proto, descriptor } \n : { descriptor: { value: undefined, configurable: true, enumerable: true, writable: true } };\n }\n // ---------\n function accessorizeProp( prop ) {\n if ( accessorizedProps.has( prop + '' ) ) return true;\n // ------------------\n // Current Descriptor Record\n const currentDescriptorRecord = getDescriptorDeep( prop );\n currentDescriptorRecord.getValue = function( withPropertyDescriptors = false ) {\n if ( withPropertyDescriptors ) return this.descriptor;\n return this.descriptor.get ? this.descriptor.get() : this.descriptor.value;\n };\n currentDescriptorRecord.setValue = function( value, withPropertyDescriptors = false ) {\n this.dirty = true;\n if ( withPropertyDescriptors ) { this.descriptor = value; return; }\n return this.descriptor.set ? this.descriptor.set( value ) !== false : ( this.descriptor.value = value, true );\n };\n currentDescriptorRecord.intact = function() {\n const currentDescriptor = Object.getOwnPropertyDescriptor( target, prop );\n return currentDescriptor?.get === accessorization.get \n && currentDescriptor?.set === accessorization.set\n && accessorizedProps.get( prop + '' ) === this;\n };\n currentDescriptorRecord.restore = function() {\n if ( !this.intact() ) return false;\n if ( ( this.proto && this.proto !== target ) || ( !this.proto && !this.dirty ) ) { delete target[ prop ]; }\n else { Object.defineProperty( target, prop, this.descriptor ); }\n accessorizedProps.delete( prop + '' );\n return true;\n };\n accessorizedProps.set( !isNaN( prop ) ? parseInt( prop ) : prop, currentDescriptorRecord );\n // ------------------\n // enumerable, configurable\n const { enumerable = true } = currentDescriptorRecord.descriptor;\n const accessorization = { enumerable, configurable: true };\n // set, get\n if ( ( 'value' in currentDescriptorRecord.descriptor ) || currentDescriptorRecord.descriptor.set ) {\n accessorization.set = function ( value ) { return set( this, prop, value, params ); };\n }\n if ( ( 'value' in currentDescriptorRecord.descriptor ) || currentDescriptorRecord.descriptor.get ) {\n accessorization.get = function () { return get( this, prop, params ); };\n }\n try {\n Object.defineProperty( target, prop, accessorization );\n return true;\n } catch( e ) {\n accessorizedProps.delete( prop + '' );\n return false;\n }\n }\n const _props = Array.isArray( props ) ? props : (\n props === undefined ? Object.keys( target ) : [ props ]\n );\n const statuses = _props.map( accessorizeProp );\n return props === undefined || Array.isArray( props ) \n ? statuses \n : statuses[ 0 ];\n}\n\n/**\n * Unaccessorizes previously accessorized props.\n *\n * @param Array|Object\ttarget\n * @param String|Array\tprops\n * @param Object\t\tparams\n *\n * @return Array\n */\nexport function unaccessorize( target, props, params = {} ) {\n target = resolveTarget( target );\n const accessorizedProps = _wq( target, 'accessorizedProps' );\n function unaccessorizeProp( prop ) {\n if ( !accessorizedProps.has( prop + '' ) ) return true;\n return accessorizedProps.get( prop + '' ).restore();\n }\n const _props = Array.isArray( props ) ? props : (\n props === undefined ? Object.keys( target ) : [ props ]\n );\n const statuses = _props.map( unaccessorizeProp );\n return props === undefined || Array.isArray( props ) \n ? statuses \n : statuses[ 0 ];\n}\n\n/* ---------------PROXY METHODS--------------- */\n\n/**\n * Returns an object as a proxy and binds all instance methods\n * to the proxy instead of the object itself.\n *\n * @param Array|Object\t\ttarget\n * @param Object\t\t params\n * @param Function\t\t extendCallback\n *\n * @return Proxy\n */\nexport function proxy( target, params = {}, extendCallback = undefined ) {\n // Resolve target\n const originalTarget = resolveTarget( target );\n // Return same proxy instance?\n if ( typeof params.membrane === 'boolean' ) throw new Error( `The params.membrane parameter cannot be of type boolean.` );\n if ( params.membrane && _wq( originalTarget, 'membraneRef' ).has( params.membrane ) ) { return _wq( originalTarget, 'membraneRef' ).get( params.membrane ); }\n const traps = {\n apply: ( target, thisArgument, argumentsList ) => apply( target, thisArgument, argumentsList, undefined, params ),\n construct: ( target, argumentsList, newTarget = null ) => construct( target, argumentsList, newTarget, params ),\n defineProperty: ( target, propertyKey, attributes ) => defineProperty( target, propertyKey, attributes, params ),\n deleteProperty: ( target, propertyKey ) => deleteProperty( target, propertyKey, params ),\n get: ( target, propertyKey, receiver = null ) => {\n if ( propertyKey === symWQOriginal ) {\n return originalTarget;\n }\n const $params = { ...params, receiver };\n const returnValue = get( target, propertyKey, $params );\n // Auto-wrap array methods\n if ( Array.isArray( target ) && typeof returnValue === 'function' ) {\n return proxy( returnValue, { ...params, arrayMethodName: propertyKey, membrane: receiver/* the instance obj that will be the thisArgument at apply(). Much like function.bind() */ }, extendCallback );\n }\n // Auto-wrap others if so specified\n if ( params.chainable && _isTypeObject( returnValue ) ) {\n return proxy( returnValue, params, extendCallback );\n }\n return returnValue;\n },\n getOwnPropertyDescriptor: ( target, propertyKey ) => getOwnPropertyDescriptor( target, propertyKey, params ),\n getPrototypeOf: target => getPrototypeOf( target, params ),\n has: ( target, propertyKey ) => has( target, propertyKey, params ),\n isExtensible: target => isExtensible( target, params ),\n ownKeys: target => ownKeys( target, params ),\n preventExtensions: target => preventExtensions( target, params ),\n set: ( target, propertyKey, value, receiver = null ) => set( target, propertyKey, value, { ...params, receiver } ),\n setPrototypeOf: ( target, prototype ) => setPrototypeOf( target, prototype, params ),\n };\n // Extend...\n const $traps = extendCallback?.( traps ) || traps;\n // Create proxy\n const $proxy = new Proxy( originalTarget, $traps );\n if ( params.membrane ) { _wq( originalTarget, 'membraneRef' ).set( params.membrane, $proxy ); }\n\treturn $proxy;\n}\n\n/**\n * Returns the original object earlier proxied by proxy().\n *\n * @param Proxy|Any\t\ttarget\n *\n * @return Any\n */\nexport function unproxy( target ) {\n // Proxy targets are mapped to their own instances internally\n return target && target[ symWQOriginal ] || target;\n}\n\n/* ---------------HELPERS--------------- */\n\n/** \n * Ensures target object is an object or array.\n *\n * @param Array|Object\ttarget\n *\n * @return Array|Object\n */\nfunction resolveTarget( target ) {\n\tif ( !target || !_isTypeObject( target ) ) throw new Error('Target must be of type object!');\n\treturn unproxy( target );\n}\n", "\n/**\n * @imports\n */\nimport * as main from './main.js';\nimport * as actors from './actors.js';\n\nconst Observer = { ...main, ...actors };\n\nexport default Observer;", "\nexport const _call = ( _function, ...args ) => {\n const callback = args.pop();\n if ( _function.constructor.name === 'AsyncFunction' ) return _await( _function.call( ...args ), callback );\n try {\n return callback( _function.call( ...args ) );\n } catch( e ) { return callback( undefined, e ); }\n};\n\nexport const _await = ( maybePromise, callback ) => {\n return maybePromise instanceof Promise ? maybePromise.then( callback ).catch( e => callback( undefined, e ) ) : callback( maybePromise )\n};\n\nexport const _isTypeObject = val => {\n\treturn ( typeof val === 'object' && val ) || typeof val === 'function';\n};\n\nexport function _$functionArgs( args ) {\n const params = typeof args[ args.length - 1 ] === 'object' ? args.pop() : {};\n const source = args.pop() || '';\n params.functionParams = args;\n return { source, params };\n}\n\nexport const env = {};\n", "\n/**\n * @exports\n */\nexport function resolveParams( ...extensions ) {\n let extension, params = { runtimeParams, compilerParams, parserParams };\n while( extension = extensions.shift() ) {\n const {\n runtimeParams: _runtimeParams = {},\n compilerParams: { globalsNoObserve: _globalsNoObserve = [], globalsOnlyPathsExcept: _globalsOnlyPathsExcept = [], ..._compilerParams } = {},\n parserParams: _parserParams = {},\n } = extension;\n params = {\n runtimeParams: { ...params.runtimeParams, ..._runtimeParams },\n compilerParams: { ...params.compilerParams, globalsNoObserve: [ ...params.compilerParams.globalsNoObserve, ..._globalsNoObserve ], globalsOnlyPathsExcept: [ ...params.compilerParams.globalsOnlyPathsExcept, ..._globalsOnlyPathsExcept ], ..._compilerParams },\n parserParams: { ...params.parserParams, ..._parserParams },\n };\n if ( extensions.devMode ) { /* shortcut for devMode configs */ }\n }\n return params;\n}\nexport const parserParams = {\n ecmaVersion: 'latest',\n allowReturnOutsideFunction: true,\n allowAwaitOutsideFunction: false,\n allowSuperOutsideMethod: false,\n preserveParens: false,\n locations: true,\n};\nexport const compilerParams = {\n globalsNoObserve: [ 'arguments', 'debugger', ],\n globalsOnlyPathsExcept: [],\n originalSource: true,\n locations: true,\n compact: 2,\n};\nexport const runtimeParams = {\n apiVersion: 3,\n};\n", "\n/**\n * The modules registry\n */\nexport const registry = Object.create( null );", "/**\n * @imports\n */\nimport { env } from \"../util.js\";\n\nexport default class _EventTarget extends EventTarget {\n\n managedAlways = new Set;\n managedOnce = new Set;\n\n constructor() {\n super();\n env.setMaxListeners?.( 0, this );\n }\n\n fire( evenName ) { return this.dispatchEvent( new Event( evenName, { cancelable: true } ) ); }\n\n on( ...args ) {\n this.addEventListener( ...args );\n return () => this.removeEventListener( ...args );\n }\n\n abort( total = false ) {\n this.managedAlways.forEach( x => x.abort ? x.abort( total ) : x( total ) );\n this.managedOnce.forEach( x => x.abort ? x.abort( total ) : x( total ) );\n this.managedOnce.clear();\n this.fire( 'abort' );\n }\n\n manage( x ) { this.managedAlways.add( x ); }\n once( x ) { this.managedOnce.add( x ); }\n\n}", "\n/**\n * @import\n */\nimport Observer from '@webqit/observer';\nimport { _isTypeObject } from '../util.js';\nimport EventTarget from './EventTarget.js';\n\nexport default class Signal extends EventTarget {\n\n subscribers = new Set;\n signals = new Map;\n\n constructor( context, type, state ) {\n super();\n this.context = context;\n this.context?.once( () => this.abort() );\n this.once( () => this.watchMode( false ) );\n this.type = type;\n this.state = state;\n }\n\n get name() { return [ ...this.context?.signals.keys() || [] ].find( k => this.context.signals.get( k ) === this ); }\n \n signal( name, type = 'prop' ) {\n let signal = this.signals.get( name );\n if ( !signal ) {\n // Initialization\n signal = new Signal(\n this,\n type,\n type === 'object' ? name : ( _isTypeObject( this.state ) ? Observer.get( this.state, name ) : undefined )\n );\n this.signals.set( name, signal );\n // Self-start\n if ( this.signals.size === 1 ) { this.watchMode(); }\n // Cleanup\n signal.once( () => {\n // On being killed, auto-delete\n this.signals.delete( name );\n // On empty self-kill\n if ( !this.signals.size ) { this.watchMode( false ); }\n } );\n }\n return signal;\n }\n\n subscribe( autorun ) {\n this.subscribers.add( autorun );\n autorun.once( () => {\n // Cleanup\n this.subscribers.delete( autorun );\n // On empty self-kill\n if ( !this.subscribers.size ) { this.abort(); }\n } );\n }\n\n watchMode( flag = true ) {\n this.mutationsWatch?.abort();\n if ( !flag || !this.signals.size || !_isTypeObject( this.state ) ) return;\n this.mutationsWatch = Observer.observe( this.state, mutations => {\n // Find subscribers and organize them by target runtime\n const groupings = { map: new Map, add( autoruns, mutation ) {\n for ( const autorun of autoruns ) {\n if ( autorun.spec.beforeSchedule?.( mutation ) === false ) continue;\n if ( !this.map.has( autorun.runtime ) ) { this.map.set( autorun.runtime, new Set ); }\n this.map.get( autorun.runtime ).add( autorun );\n }\n } };\n for ( const mutation of mutations ) {\n const signal = this.signals.get( mutation.key );\n if ( !signal ) continue;\n groupings.add( signal.subscribers, mutation );\n signal.refresh( mutation.value );\n }\n // Dispatch to runtimes...\n const runtimesMap = !groupings.map.size ? groupings.map : [ ...groupings.map ].sort( ( a, b ) => a.$serial > b.$serial ? -1 : 1 );\n //const runtimesMap = groupings.map;\n for ( const [ runtime, autoruns ] of runtimesMap ) {\n if ( runtime.state === 'aborted' ) continue;\n runtime.schedule( ...autoruns );\n }\n }, { recursions: 'force-sync' } );\n }\n\n refresh( newState ) {\n this.state = newState;\n for ( const [ name, signal ] of this.signals ) {\n signal.refresh( Observer.get( this.state ?? {}, name ) );\n }\n this.watchMode();\n }\n\n}", "\n/**\n * @import\n */\nimport Signal from './Signal.js';\n\nexport default class Scope extends Signal {\n\n symbols = new Map;\n constructor( context, type, state = undefined ) {\n super( context, type, state || Object.create( null ) );\n }\n\n}", "\n/**\n * @import\n */\nimport Observer from '@webqit/observer';\nimport { _await, _call } from '../util.js';\nimport EventTarget from './EventTarget.js';\nimport Scope from './Scope.js';\n\nexport default class Autorun extends EventTarget {\n\n state;\n\n constructor( context, type, spec, serial, scope, closure ) {\n super();\n // We are to be managed by context\n context?.once( this );\n this.context = context;\n this.type = type;\n this.spec = spec || {};\n this.scope = scope;\n if ( context?.scope !== scope ) {\n // It's own scope, so we manage it\n this.manage( scope );\n }\n this.serial = serial;\n if ( closure ) { this.closure = closure; }\n if ( context?.type === 'iteration' ) { this.path = context.path.concat( this.spec.index ); }\n else if ( context?.type === 'round' ) { this.path = context.path.concat( this.serial ); }\n else { this.path = ( context?.path || [] ).slice( 0, -1 ).concat( this.serial ); }\n this.flowControl = new Map;\n }\n\n get runtime() { return this.context.runtime; }\n\n contains( node ) { return this === node.context || ( node.context && this.contains( node.context ) ); }\n\n order( node ) {\n if ( !node ) return this;\n const [ a, b ] = node.path.length < this.path.length ? [ node, this ] : [ this, node ];\n return a.path.reduce( ( prev, key, i ) => {\n return prev && key <= b.path[ i ];\n }, true ) && a || b;\n }\n\n beforeExecute() {\n this.state = 'running';\n // Get record and reset\n const flowControlBefore = this.flowControl;\n this.flowControl = new Map;\n return flowControlBefore;\n }\n\n execute( callback = null ) {\n this.runtime.thread.unshift( this );\n return _await( this.beforeExecute(), stateBefore => {\n return _call( this.closure, this, this, ( returnValue, exception ) => {\n if ( exception ) return this.throw( exception, [ this.serial, this.context?.serial ], exception.code );\n if ( this.spec.complete ) { returnValue = this.spec.complete( returnValue, this ); }\n this.afterExecute( stateBefore );\n this.runtime.thread.shift();\n return callback ? callback( returnValue, this ) : returnValue;\n } );\n } );\n }\n\n throw( e, serials, errorCode ) {\n if ( this.type === 'function' && [ 'HandlerFunction', 'FinalizerFunction' ].includes( this.$params.executionMode ) ) {\n // Hoist control further above the context that handed it to us\n return this.$params.lexicalContext.throw( e, serials, errorCode );\n } else if ( this.spec.handler ) return this.spec.handler( e );\n else if ( this.type !== 'function' && this.context ) return this.context.throw( e, serials, errorCode );\n if ( e.cause ) throw e;\n // Message\n const message = `${ e.message || e }`;\n const $message = errorCode !== null ? `[${ errorCode }]: ${ message }` : message;\n // Cause\n const cause = serials.map( serial => serial !== -1 && this.extractSource( serial, true ) ).filter( x => x );\n cause.push( { source: this.runtime.$params.originalSource } );\n // Type\n const ErrorClass = globalThis[ e.name ];\n const error = new ( ErrorClass || Error )( $message, { cause } );\n // File\n const fileName = this.runtime.$params.sourceType === 'module' && this.$params.experimentalFeatures !== false && this.$params.exportNamespace || this.$params.fileName;\n if ( fileName ) { error.fileName = fileName; }\n if ( errorCode ) { error.code = errorCode; }\n throw error;\n }\n\n afterExecute( flowControlBefore ) {\n this.state = 'complete';\n // Compare records... and hoist differences\n const flowControlAfter = this.flowControl;\n if ( this.spec.finalizer ) this.spec.finalizer();\n // Handle downstream\n this.handleDownstream( flowControlAfter.size, flowControlBefore.size );\n this.handleRightstream( flowControlAfter.size, flowControlBefore.size );\n for ( const cmd of [ 'break', 'continue', 'return' ] ) {\n if ( flowControlAfter.has( cmd ) && !flowControlAfter.get( cmd ).endpoint ) { this.hoistFlowControl( cmd, flowControlAfter.get( cmd ).arg ); }\n else if ( flowControlBefore.has( cmd ) && !flowControlBefore.get( cmd ).endpoint ) { this.hoistFlowControl( cmd, flowControlBefore.get( cmd ).arg, true ); }\n }\n }\n\n typed( as, value, name = undefined ) {\n const valueType = Array.isArray( value ) ? 'array' : ( value === null ? 'null' : typeof value );\n if ( valueType === as || ( as === 'iterable' && value?.[ Symbol.iterator ] ) || ( as === 'desctructurable' && ![ 'undefined', 'null' ].includes( valueType ) ) ) return value;\n if ( as === 'iterable' ) { throw new Error( `value is not iterable.` ); }\n if ( as === 'desctructurable' ) { throw new Error( ( name ? `Cannot access ${ name }; ` : '' ) + `object not desctructurable.` ); }\n throw new Error( `value must be of type ${ as }.` );\n }\n\n let( name, serial, closure, spec = {} ) { return this.var( name, serial, closure, { ...spec, kind: 'let' } ); }\n\n const( name, serial, closure, spec = {} ) { return this.var( name, serial, closure, { ...spec, kind: 'const' } ); }\n\n var( name, serial, closure, spec = {} ) {\n spec = { kind: 'var'/* as default */, ...spec };\n // Uninitialized declarations like: let a;\n if ( !closure ) closure = () => undefined;\n const $closure = !spec.restOf ? closure : ( ...args ) => {\n try { return closure( ...args ); }\n catch( e ) { throw new Error( `Cannot declare ${ name }; ${ e.message }` ); }\n };\n const complete = ( returnValue, autorun ) => {\n let scope = autorun.scope;\n if ( spec.kind === 'var' ) {\n //let scope = this.runtime.scope;\n // For plain scripts, hoist all the way to the global scope... or somewhere before where its been defined\n while ( ![ 'module', 'function' ].includes( scope.type ) && !Observer.has( scope.state, name ) && scope.context ) {\n scope = scope.context;\n }\n } else if ( scope.type === 'this' && scope.context ) {\n // We're in a script or module program. scope.context is either going to be 'env' or 'module'\n scope = scope.context;\n }\n let symbolState = scope.symbols.get( name );\n if ( symbolState && ( symbolState.kind !== spec.kind || ( spec.kind === 'let' && symbolState.serial !== serial ) ) ) {\n throw new Error( `Identifier \"${ name }\" has already been declared.` );\n }\n symbolState?.reader?.abort(); // Any previous reader? Type \"var\" cannot rely on autorun lifecycle cleanup\n symbolState = { serial, kind: spec.kind }; // New state!\n let assignedValue = returnValue;\n if ( spec.restOf ) {\n if ( spec.type === 'array' ) {\n assignedValue = [];\n } else { assignedValue = {}; }\n symbolState.reader = Observer.map( returnValue, assignedValue, { except: spec.restOf, spread: spec.type === 'array' } );\n autorun.once( symbolState.reader ); // Lifecycle cleanup\n }\n scope.symbols.set( name, symbolState );\n Observer.set( scope.state, name, assignedValue );\n return assignedValue;\n };\n return this.autorun( spec.kind, { complete, ...spec }, serial, $closure );\n }\n\n update( name, closure, spec = {} ) {\n // Find lexical scope\n let lexicalScope = this.scope;\n while( lexicalScope && !Observer.has( lexicalScope.state, name ) ) { lexicalScope = lexicalScope.context; }\n // Validation\n if ( !lexicalScope ) { throw new ReferenceError( `${ name } is not defined.` ); }\n let symbolState = lexicalScope.symbols.get( name );\n if ( symbolState?.kind === 'const' ) { throw new ReferenceError( `Assignment to constant variable \"${ name }\".` ); }\n const valueBefore = Observer.get( lexicalScope.state, name );\n const $closure = !spec.restOf ? closure : ( ...args ) => {\n try { return closure( ...args ); }\n catch( e ) { throw new Error( `Cannot update ${ name }; ${ e.message }` ); }\n };\n return _call( $closure, undefined, valueBefore, ( returnValue, exception ) => {\n if ( exception ) return this.throw( exception, [ this.serial ] );\n // Operation\n symbolState?.reader?.abort(); // Any previous reader?\n let assignedValue = returnValue;\n if ( spec.restOf ) {\n symbolState = symbolState || {}; // New state!\n if ( spec.type === 'array' ) {\n assignedValue = [];\n } else { assignedValue = {}; }\n symbolState.reader = Observer.map( returnValue, assignedValue, { except: spec.restOf, spread: spec.type === 'array' } );\n this.once( symbolState.reader ); // Lifecycle cleanup\n }\n Observer.set( lexicalScope.state, name, assignedValue );\n return [ 'postinc', 'postdec' ].includes( spec.kind ) ? valueBefore : assignedValue;\n } );\n }\n\n ref( name, ...rest ) {\n let depth = 0, hint = {};\n if ( typeof rest[ 0 ] === 'number' ) {\n depth = rest.shift();\n hint = rest.shift() || {};\n } else if ( typeof rest[ 0 ] === 'object' ) {\n hint = rest.shift();\n }\n // Find lexical scope\n let lexicalScope = this.scope;\n while( lexicalScope && !Observer.has( lexicalScope.state, name ) ) {\n lexicalScope = lexicalScope.context;\n }\n // Not found?\n if ( !lexicalScope ) {\n if ( hint.isTypeCheck ) return;\n throw new Error( `${ name } is not defined.` );\n }\n // Bind now?\n const kind = lexicalScope.symbols.get( name )?.kind;\n const baseSignal = lexicalScope.signal( name, kind );\n if ( hint.typed ) { this.typed( hint.typed, baseSignal.state, name ); }\n return this.autobind( baseSignal, depth, hint );\n }\n\n obj( val, ...rest ) {\n let depth = 0, hint = {};\n if ( typeof rest[ 0 ] === 'number' ) {\n depth = rest.shift();\n hint = rest.shift() || {};\n } else if ( typeof rest[ 0 ] === 'object' ) {\n hint = rest.shift();\n }\n return this.autobind( this.runtime.$objects.signal( val, 'object' ), depth, hint );\n }\n\n autobind( baseSignal, depth, hint ) {\n const quantumMode = [ 'QuantumProgram', 'QuantumFunction' ].includes( this.runtime.$params.executionMode );\n const isConst = baseSignal.type === 'const';\n const isRuntime = this === this.runtime;\n const isAborted = this.state === 'aborted';\n const isStatic = this.spec.static;\n const nowRunning = this;\n return ( function proxy( signal, depth ) {\n // Do bindings first\n if ( quantumMode && !isStatic && !isConst && !isRuntime && !isAborted ) {\n signal.subscribe( nowRunning );\n }\n // Return bare value here?\n if ( !depth || !signal.state || typeof signal.state !== 'object' ) {\n let returnValue = signal.state;\n if ( typeof signal.state === 'function' && !/^class\\s?/.test(Function.prototype.toString.call(signal.state)) ) {\n // We're returning a proxy for functions instead of: signal.context.state[ signal.name ].bind( signal.context.state );\n returnValue = Observer.proxy( signal.state, { membrane: signal } );\n }\n return returnValue;\n }\n // Return dynamic value\n let propertyAlreadyBound;\n return Observer.proxy( signal.state, {}, traps => ( {\n ...traps,\n get( target, name, receiver = null ) {\n // Constructs are always going to for one property access: ref('a').b, and we need to prevent .c from creating a binding\n if ( propertyAlreadyBound ) { return traps.get( target, name, receiver ); }\n propertyAlreadyBound = true;\n return proxy( signal.signal( name ), depth - 1 );\n },\n } ) );\n } )( baseSignal, depth );\n }\n\n autorun( type, ...rest ) {\n let closure = rest.pop();\n const serial = rest.pop();\n const spec = rest.pop() || {};\n // Handle certain types with their own class\n let AutorunClass = Autorun, scope = this.scope;\n if ( type === 'iteration' ) {\n const staticDefs = this.runtime.constructor;\n AutorunClass = closure.constructor.name === 'AsyncFunction' ? staticDefs.AutoAsyncIterator : staticDefs.AutoIterator;\n }\n if ( [ 'block', 'switch', 'iteration' ].includes( type ) ) { scope = new Scope( scope, type ); }\n // Instantiate\n const autorun = new AutorunClass( this, type, spec, serial, scope, closure );\n if ( type === 'downstream' ) {\n // Declare a \"downstream\" for the context\n this.downstream = autorun;\n // For now\n if ( this.flowControlApplied() ) return;\n } else if ( this.type === 'switch' && this.breakpoint ) {\n return;\n }\n // Push stack and execute\n return autorun.execute();\n }\n\n function( executionMode, functionKind, serial, $qFunction ) {\n // Declare in current scope\n if ( functionKind === 'Declaration' ) {\n Observer.set( this.scope.state, $qFunction.name, $qFunction );\n }\n // Metarise function\n const _this = this;\n Object.defineProperty( $qFunction, 'toString', { value: function( $qSource = false ) {\n if ( $qSource && executionMode === 'QuantumFunction' ) return Function.prototype.toString.call( $qFunction );\n const originalSource = _this.runtime.extractSource( serial );\n return originalSource.startsWith( 'static ' ) ? originalSource.replace( 'static ', '' ) : originalSource;\n } } );\n return $qFunction;\n }\n\n class( classKind, $class, methodsSpec ) {\n // Declare in current scope\n if ( classKind === 'Declaration' ) {\n Observer.set( this.scope.state, $class.name, $class );\n }\n // Metarise methods\n methodsSpec.forEach( ( { name, isQuantumFunction, static: isStatic, serial } ) => {\n this.function( isQuantumFunction && 'QuantumFunction' || 'RegularFunction', 'Expression', serial, isStatic ? $class[ name ] : $class.prototype[ name ] )\n } );\n return $class;\n }\n\n async import( ...args ) { return this.runtime.import( ...args ); }\n\n async export( ...args ) { return this.runtime.export( ...args ); }\n\n continue( label ) { return this.applyFlowControl( 'continue', label ); }\n\n break( label ) { return this.applyFlowControl( 'break', label ); }\n\n return( arg ) { return this.applyFlowControl( 'return', arg ); }\n\n applyFlowControl( cmd, arg, unset = false ) {\n const sizeBefore = this.flowControl.size;\n if ( unset ) { this.flowControl.delete( cmd ); }\n else { this.flowControl.set( cmd, { arg } ); }\n if ( this.type === 'round' ) { this.context.breakpoint = this; }\n if ( this.type === 'round' && [ 'break', 'continue' ].includes( cmd ) && arg === this.context?.spec.label ) {\n if ( !unset ) { this.flowControl.get( cmd ).endpoint = true; }\n if ( this.state !== 'running' ) { this.handleRightstream( this.flowControl.size, sizeBefore ); }\n return;\n }\n if ( this.context?.type === 'switch' && cmd === 'break' && !arg ) {\n if ( !unset ) { this.flowControl.get( cmd ).endpoint = true; }\n this.context.breakpoint = this;\n return;\n }\n // Notice that no hoisting and no \"downstream\" handling if in active scope\n // as that would be done at after() hook!\n if ( this.state !== 'running' ) {\n this.handleDownstream( this.flowControl.size, sizeBefore );\n this.hoistFlowControl( ...arguments );\n }\n }\n\n hoistFlowControl( ...args ) { return this.context?.applyFlowControl( ...args ); }\n\n flowControlApplied( cmd, arg ) {\n if ( !arguments.length ) return this.flowControl.size || false;\n if ( arguments.length === 1 ) return this.flowControl.has( cmd );\n return this.flowControl.get( cmd )?.arg === arg;\n }\n\n handleDownstream( sizeAfter, sizeBefore ) {\n let downstream;\n if ( ![ 'block' ].includes( this.type ) // If this is \"downstream\", the \"downstream\" you see from parent scope will be self\n || !( downstream = this.context?.downstream ) ) return;\n if ( sizeAfter ) { downstream.abort(); }\n else if ( sizeBefore ) {\n downstream.state = 'resuming'; // Just something other than \"aborted\"\n this.runtime.schedule( downstream );\n }\n }\n\n handleRightstream( sizeAfter, sizeBefore ) {\n if ( this.type !== 'round' ) return;\n let nextRound = this, returnees = new Set;\n while( nextRound = nextRound.nextRound ) {\n if ( sizeAfter ) { nextRound.abort(); }\n else if ( sizeBefore && nextRound.state !== 'inert' ) {\n nextRound.state = 'resuming'; // Just something other than \"aborted\"\n returnees.add( nextRound );\n }\n }\n if ( returnees.size ) { this.runtime.schedule( ...returnees ); }\n if ( !sizeAfter && sizeBefore ) {\n this.runtime.on( 'reflection', () => {\n if ( this.context.iterating ) return;\n this.context.iterate();\n }, { once: true } );\n }\n }\n\n abort( total = false ) {\n if ( total ) {\n if ( this.context?.breakpoint === this ) { delete this.context.breakpoint; }\n this.flowControl.clear();\n }\n this.state = total ? 'inert' : 'aborted';\n return super.abort( total );\n }\n \n}", "\n/**\n * @import\n */\nimport { _await } from '../util.js';\nimport Observer from '@webqit/observer';\nimport Autorun from './Autorun.js';\nimport Scope from './Scope.js';\n\nexport default class AutoIterator extends Autorun {\n\n rounds = new Map;\n\n constructor( context, type, spec, serial, scope, closure ) {\n spec.$closure = closure;\n super( context, type, spec, serial, scope );\n this.manage( () => {\n delete this.breakpoint;\n this.rounds.clear();\n } );\n }\n\n pseudorun( callback ) {\n this.runtime.iThread.unshift( this );\n return _await( callback(), returnValue => {\n this.runtime.iThread.pop();\n return returnValue;\n } );\n }\n\n createIterator() {\n if ( this.spec.kind === 'for-in' ) return ( function* () { for ( let key in this.iteratee ) yield key; } ).call( this );\n if ( this.spec.kind === 'for-of' ) return ( function* () { for ( let val of this.iteratee ) yield val; } ).call( this );\n return { next: () => ({ done: !this.pseudorun( () => this.spec.test( this ) ), }), };\n }\n\n closure() {\n if ( [ 'for-of', 'for-in' ].includes( this.spec.kind ) ) {\n [ this.production, this.iteratee ] = this.spec.parameters( this );\n this.iterator = this.createIterator();\n this.iterator.original = true;\n this.watchMode();\n } else {\n if ( this.spec.kind === 'for' ) { this.spec.init( this ); }\n this.iterator = this.createIterator();\n }\n this.iterate();\n }\n\n terminated() { return this.breakpoint && !this.breakpoint.flowControlApplied( 'continue', this.spec.label ) && this.breakpoint.flowControlApplied(); }\n advance() { if ( this.spec.kind === 'for' ) { this.pseudorun( () => this.spec.advance( this ) ); } }\n\n iterate() {\n this.iterating = true;\n const $test = () => !this.terminated()/* must come before */ && !( this.cursor = this.iterator.next() ).done;\n const $round = () => {\n const round = this.createRound( this.cursor.value );\n round.execute();\n this.advance();\n };\n if ( this.spec.kind === 'do-while' ) { do $round(); while ( $test() ); }\n else { while ( $test() ) $round(); }\n this.iterating = false;\n }\n\n createRound( production ) {\n const index = this.rounds.size, spec = { index };\n // The scope instance starts life with the variables that the iteration round should see.\n const state = [ 'for-in', 'for-of' ].includes( this.spec.kind ) ? { [ this.production ]: production } : { ...this.scope.state };\n const scope = new Scope( this.scope, 'round', state );\n this.scope.symbols.forEach( ( meta, name ) => { scope.symbols.set( name, meta ); } );\n const round = new Autorun( this, 'round', spec, this.serial, scope, this.spec.$closure );\n const key = this.spec.kind === 'for-in' ? production : index;\n this.rounds.set( key, round );\n if ( this.lastRound ) {\n this.lastRound.nextRound = round;\n round.prevRound = this.lastRound;\n }\n this.lastRound = round;\n return round;\n }\n\n watchMode() {\n if ( this.spec.static ) return;\n const handleMutations = ( mutations, currentCursor ) => {\n const deletions = new Set, extension = new Set;\n for ( const mutation of mutations ) {\n if ( Array.isArray( this.iteratee ) && mutation.key === 'length' ) continue;\n const production = this.spec.kind === 'for-in' ? mutation.key : mutation.value;\n const key = this.spec.kind === 'for-in' ? mutation.key : parseInt( mutation.key );\n const existingRound = this.rounds.get( key ); // Note that we're not using has()\n if ( existingRound ) {\n // This is an existing round\n Observer.set( existingRound.scope.state, this.production, production );\n if ( mutation.type === 'delete' ) {\n this.rounds.set( key, undefined ); // No actual deletions here as this.rounds.size is our index\n if ( existingRound.prevRound ) { existingRound.prevRound.nextRound = existingRound.nextRound; }\n if ( existingRound.nextRound ) { existingRound.nextRound.prevRound = existingRound.prevRound; }\n // Fired above for the last time and now should die\n deletions.add( existingRound );\n }\n } else if ( mutation.type !== 'delete' && !mutation.isUpdate ) {\n // This is a brand new entry\n // Deletions and updates that didn't have an existing round above are obviously awaiting visit from a paused loop\n if ( this.spec.kind === 'for-of' && this.iterator.original && !currentCursor.done ) continue; // A live iteration is going on\n extension.add( production );\n }\n }\n this.runtime.on( 'reflection', () => {\n deletions.forEach( deletion => deletion.abort( true ) );\n }, { once: true } );\n if ( extension.size ) {\n this.iterator = ( function* ( parent ) {\n yield* parent;\n yield* extension;\n } )( this.iterator );\n if ( currentCursor.done ) { this.iterate(); }\n }\n };\n this.once( Observer.observe( this.iteratee, mutations => {\n _await( this.cursor, currentCursor => handleMutations( mutations, currentCursor ) );\n } ) );\n }\n \n}", "\n/**\n * @import\n */\nimport AutoIterator from './AutoIterator.js';\n\nexport default class AutoAsyncIterator extends AutoIterator {\n\n async createIterator() {\n if ( this.spec.kind === 'for-in' ) return ( function* () { for ( let key in this.iteratee ) yield key; } ).call( this );\n if ( this.spec.kind === 'for-of' ) return ( function* () { for ( let val of this.iteratee ) yield val; } ).call( this );\n return { next: async () => ({ done: !( await this.pseudorun( () => this.spec.test( this ) ) ), }), };\n }\n\n async closure() {\n if ( [ 'for-of', 'for-in' ].includes( this.spec.kind ) ) {\n [ this.production, this.iteratee ] = await this.spec.parameters( this );\n this.iterator = await this.createIterator();\n this.iterator.original = true;\n this.watchMode();\n } else {\n if ( this.spec.kind === 'for' ) { await this.spec.init( this ); }\n this.iterator = await this.createIterator();\n }\n await this.iterate();\n }\n\n async iterate() {\n let cursor; this.iterating = true;\n const $test = async () => ( !this.terminated()/* must come before */ && ( this.cursor = this.iterator.next() ) && ( cursor = await this.cursor ) && !cursor.done );\n const $round = async () => {\n const round = this.createRound( cursor.value );\n await round.execute();\n await this.advance();\n };\n if ( this.spec.kind === 'do-while' ) { do await $round(); while ( await $test() ); }\n else { while ( await $test() ) await $round(); }\n this.iterating = false;\n }\n\n}", "\n/**\n * @imports\n */\nimport Observer from \"@webqit/observer\";\n\nexport default class State {\n\n constructor( runtime ) {\n Object.defineProperty( this, 'runtime', { value: runtime } );\n const events = { statechange: () => { Observer.defineProperty( this, 'value', { value: runtime.flowControl.get( 'return' )?.arg, enumerable: true, configurable: true } ); }, };\n for ( const name in events ) {\n runtime.on( name, events[ name ] );\n events[ name ]();\n }\n if ( runtime.$params.sourceType === 'module' ) {\n Object.defineProperty( this, 'exports', { value: runtime.exports } );\n }\n }\n \n dispose() { return this.runtime.abort( true ); }\n\n}\n", "import Observer from '@webqit/observer';\nimport { _await } from '../util.js';\nimport { registry } from './hot-module-registry.js';\nimport AutoAsyncIterator from './AutoAsyncIterator.js';\nimport AutoIterator from './AutoIterator.js';\nimport Autorun from './Autorun.js';\nimport Scope from './Scope.js';\nimport State from './State.js';\n\nexport default class Runtime extends Autorun {\n\n static AutoAsyncIterator = AutoAsyncIterator;\n static AutoIterator = AutoIterator;\n\n locations = [];\n queue = new Set;\n thread = [];\n iThread = [];\n\n constructor( context, type, params, scope, closure ) {\n const { $serial = 0, spec, ...$params } = params;\n super( context, type, spec, -1, scope, closure );\n this.$serial = $serial;\n this.$params = $params;\n // Random object\n this.$objects = new Scope( undefined, 'objects' );\n this.manage( this.$objects );\n // Imports/exports\n this.exports = Object.create( null );\n this.$promises = { imports: [], exports: [] };\n this.manage( () => {\n Observer.deleteProperties( this.exports, Object.keys( this.exports ) );\n this.$promises.imports.splice( 0 );\n this.$promises.exports.splice( 0 );\n } );\n }\n\n extractSource( serial, full = false ) {\n const [ [ locStart, line, column ], [ locEnd ] ] = this.locations[ serial ];\n const expr = this.$params.originalSource.slice( locStart, locEnd );\n return full ? { expr, line, column } : expr;\n }\n\n get runtime() { return this; }\n\n get nowRunning() { return this.thread[ 0 ]; }\n\n schedule( ...autoruns ) {\n // Determine if active beforehand\n const isActive = this.queue.size;\n for ( const autorun of autoruns ) { this.queue.add( autorun ); }\n if ( isActive ) return;\n // Event Loop\n this.flowControlDirty = false;\n return ( function nextTick( prevReturn, current ) {\n // Find following...\n let following;\n for ( const autorun of this.queue ) {\n // If autorun is higher in source ignore\n // Or a parent autorun has already been run in this event loop which started by aborting all descendants\n // Or the unique situation with \"for\" loops where \"test\" and \"update\" expressions tend to self-schedule the AutoIteration instance.\n if ( current && current.order( autorun ) !== current || [ 'aborted', 'running' ].includes( autorun.state ) || this.iThread[ 0 ]?.contains( autorun ) ) {\n this.queue.delete( autorun ); continue;\n }\n // Get $autorun to be very next to _this.currentMicro\n following = following ? following.order( autorun ) : autorun;\n if ( !current ) { current = following; }\n }\n // Fire events\n if ( !following ) {\n this.fire( 'reflection' );\n if ( this.flowControlApplied() ) { this.fire( 'statechange' ); }\n return prevReturn;\n }\n // Execute following...\n following.abort();\n // Evaluate and possibly await...\n return following.execute( returnValue => {\n // Remove from queue\n this.queue.delete( following );\n // Next tick\n return nextTick.call( this, returnValue, following );\n } );\n } ).call( this, undefined, this.nowRunning );\n }\n\n execute( callback = null ) {\n return super.execute( returnValue => {\n const quantumMode = [ 'QuantumProgram', 'QuantumFunction' ].includes( this.$params.executionMode );\n const actualReturnValue = quantumMode\n ? new State( this )\n : this.flowControl.get( 'return' )?.arg;//returnValue;\n return callback ? callback( actualReturnValue, this ) : actualReturnValue;\n } );\n }\n\n spawn( executionMode, thisContext, closure, lexicalContext = null ) {\n const context = this.nowRunning || lexicalContext || this;\n const params = { ...this.$params, $serial: this.$serial + 1, executionMode, lexicalContext };\n const scope = new Scope( context.scope, 'function', { [ 'this' ]: thisContext } );\n const subRuntime = new this.constructor( context, 'function', params, scope, closure );\n return subRuntime.execute();\n }\n\n async import( ...args ) {\n const source = args.pop();\n const $source = typeof source === 'string' ? { source } : source;\n const onload = modules => {\n if ( $source.forExport || $source.isDynamic ) return modules;\n this.assignModules( args, this.scope.state, modules, source.serial );\n };\n if ( this.$params.experimentalFeatures !== false && registry[ $source.source ] ) {\n return onload( registry[ $source.source ] );\n }\n const promise = ( async () => {\n const moduleName = this.$params.sourceType === 'module' && this.$params.experimentalFeatures !== false && this.$params.exportNamespace || this.$params.fileName;\n try { return onload( { ...await import( $source.source ) } ); } catch( e ) {\n if ( e.code === 'ERR_MODULE_NOT_FOUND' ) { this.throw( new Error( `Cannot find module \"${ $source.source }\"${ moduleName ? ` imported at \"${ moduleName }\"` : '' }.` ), [ $source.serial ], e.code ); }\n else this.throw( e, [ $source.serial ], e.code );\n }\n } )();\n if ( !$source.isDynamic ) {\n this.$promises[ $source.forExport ? 'exports' : 'imports' ].push( promise );\n }\n return promise;\n }\n\n async export( ...args ) {\n const source = !Array.isArray( args[ args.length - 1 ] ) ? args.pop() : null;\n // Export from source or from top-level scope!\n const modules = source ? await this.import( { ...source, forExport: true } ) : this.scope.state;\n // Assign imported modules to exports object\n this.assignModules( args, this.exports, modules, source?.serial );\n }\n\n assignModules( specifiers, target, source, sourceSerial = null ) {\n const observeList = [];\n const quantumMode = [ 'QuantumProgram', 'QuantumFunction' ].includes( this.$params.executionMode );\n for ( const [ local, serial, alias ] of specifiers ) {\n if ( local === '*' && alias ) {\n ( quantumMode ? Observer : Reflect ).set( target, alias, source );\n continue;\n }\n if ( !Observer.has( source, local ) ) { this.throw( new Error( `The requested module does not provide an export named \"${ local }\".` ), [ serial, sourceSerial ] ); }\n ( quantumMode ? Observer : Reflect ).set( target, alias || local, Observer.get( source, local ) );\n observeList.push( [ local, serial, alias ] );\n }\n if ( !observeList.length || !quantumMode ) return;\n this.once( Observer.observe( source, mutations => {\n for ( const [ local, /* serial */, alias ] of observeList ) {\n for ( const mutation of mutations ) {\n if ( local === '*' ) { Observer.set( target, mutation.key, mutation.value ); }\n else if ( mutation.key === local ) { Observer.set( target, alias || local, mutation.value ); } \n }\n }\n } ) );\n }\n \n afterExecute( ...args ) {\n if ( this.$params.sourceType === 'module' && this.$params.experimentalFeatures !== false && this.$params.exportNamespace ) {\n registry[ this.$params.exportNamespace ] = this.exports;\n this.once( () => { delete registry[ this.$params.exportNamespace ]; } );\n }\n return super.afterExecute( ...args );\n }\n\n}", "\n/**\n * @imports\n */\nimport { _await } from '../util.js';\nimport { resolveParams } from '../params.js';\nimport Runtime from './Runtime.js';\nimport Scope from './Scope.js';\nimport State from './State.js';\n\nexport { State, Runtime }\n\nexport function $eval( sourceType, parseCompileCallback, source, params ) {\n // params could have: env, functionParams, parserParams, compilerParams, runtimeParams\n const { env, functionParams = [], exportNamespace, fileName } = params;\n const { parserParams, compilerParams, runtimeParams, } = resolveParams( params );\n const inBrowser = Object.getOwnPropertyDescriptor( globalThis, 'window' )?.get?.toString().includes( '[native code]' ) ?? false;\n const asyncEval = [ 'async-script', 'module' ].includes( sourceType );\n\n // Format source? Mode can be: function, async-function, script, async-script, module\n if ( sourceType === 'module' ) {\n parserParams.sourceType = sourceType;\n parserParams.allowAwaitOutsideFunction = true;\n } else if ( [ 'function', 'async-function' ].includes( sourceType ) ) {\n // Design the actual stateful function\n const body = ` ` + source.split( `\\n` ).join( `\\n ` );\n source = `return ${ sourceType === 'async-function' ? 'async ' : '' }function**(${ functionParams.join( ', ' ) }) {\\n${ body }\\n}`;\n // The top-level program is a simple return statement as above. This return shouldn't be treated as reactive nor return a state object, but the plain value\n parserParams.executionMode = 'RegularProgram';\n } else if ( ![ 'script', 'async-script' ].includes( sourceType ) ) {\n throw new Error( `Unrecognized sourceType specified: \"${ sourceType }\".` );\n }\n\n // Proceed to parse-compile\n compilerParams.sourceType = sourceType;\n parserParams.inBrowser = inBrowser;\n compilerParams.base64 = asyncEval && inBrowser && `export default async function(%0) {%1}`;\n const compilation = parseCompileCallback( source, { parserParams, compilerParams } );\n if ( compilation instanceof Promise && ![ 'async-function', 'async-script', 'module' ].includes( sourceType ) ) {\n throw new Error( `Parse-compile can only return a Promise for sourceTypes: async-function, async-script, module.` );\n }\n\n // Proceed to eval\n runtimeParams.sourceType = sourceType;\n runtimeParams.inBrowser = inBrowser;\n runtimeParams.exportNamespace = exportNamespace;\n runtimeParams.fileName = fileName;\n return _await( compilation, compilation => {\n const isFunction = [ 'function', 'async-function' ].includes( sourceType );\n // Below, \"async-function\" would already has async in the returned function\n // And no need to ask compilation.topLevelAwait\n const $eval = ( $qIdentifier, source ) => {\n if ( runtimeParams.compileFunction ) return runtimeParams.compileFunction( source.toString(), [ $qIdentifier ] );\n if ( compilerParams.base64 ) { /* @experimental */\n // Save to a variable to fool bundlephobia about the import();\n const dataUrl = `data:text/javascript;base64,${ source.toString( 'base64' ) }`;\n const impt = () => import( dataUrl ).then( m => m.default );\n //if ( window.webqit?.realdom?.schedule ) return window.webqit?.realdom?.schedule( 'write', impt, true );\n return impt();\n }\n return new ( asyncEval ? ( async function() {} ).constructor : Function )( $qIdentifier, source.toString() );\n };\n return _await( $eval( compilation.identifier + '', compilation ), main => {\n const createRuntime = ( thisContext, $env = env ) => {\n let $main = main;\n if ( thisContext ) { $main = $main.bind( thisContext ); }\n // There's always a global scope\n let contextType = 'global', scope = new Scope( undefined, contextType, globalThis );\n // Then this, for script scope, which may also directly reflect/mutate any provided \"env\"\n if ( sourceType.endsWith( 'script' ) || $env ) { contextType = 'env'; scope = new Scope( scope, contextType, $env ); }\n // Or this for module scope. And where \"env\" was provided, the \"env\" scope above too\n if ( sourceType === 'module' ) { contextType = 'module'; scope = new Scope( scope, contextType ); }\n if ( typeof thisContext !== 'undefined' ) { scope = new Scope( scope, 'this', { [ 'this' ]: thisContext } ); }\n return new Runtime( undefined, contextType, { ...runtimeParams, originalSource: compilation.originalSource, executionMode: compilation.isQuantumProgram && 'QuantumProgram' || 'RegularProgram' }, scope, $main );\n };\n return isFunction\n ? createRuntime().execute() // Produces the actual stateful function designed above\n : { createRuntime, compilation };\n } );\n } );\n}", "\n/**\n * @imports\n */\nimport { _await } from './util.js';\nimport { $eval, State } from './runtime/index.js';\n\n/**\n * @Script\n */\nexport default class AbstractQuantumScript {\n constructor( ...args ) {\n const $static = this.constructor;\n const params = typeof args[ args.length - 1 ] === 'object' ? args.pop() : {};\n const source = args.pop() || '';\n this.$program = $eval( $static.sourceType, $static.parseCompileCallback, source, params );\n }\n\n execute() { return _await( this.$program, ( { createRuntime } ) => createRuntime().execute() ); }\n\n bind( thisContext, env = undefined ) { return _await( this.$program, ( { createRuntime } ) => createRuntime( thisContext, env ) ); }\n\n toString( $qSource = false ) {\n return _await( this.$program, ( { compilation } ) => {\n if ( $qSource ) return compilation + '';\n return compilation.originalSource;\n } );\n }\n}", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isUndefined from '../js/isUndefined.js';\nimport _isNull from '../js/isNull.js';\nimport _arrFrom from '../arr/from.js';\n\n/**\n * Retrieves the value at the given path.\n *\n * A return value of undefined is ambiguous, and can mean either that the\n * path does not exist, or that the path actually exists but with a value of undefined. If it is required to\n * know whether the path actually exists, pass an object as a third argument.\n * This object will have an \"exists\" key set to true/false.\n *\n * @param object \t\t\t\tctxt\n * @param array \t\t\t\tpath\n * @param object \t\t\t\ttrap\n * @param object \t\t\t\treciever\n *\n * @return mixed\n */\nexport default function(ctxt, path, trap = {}, reciever = {}) {\n\tpath = _arrFrom(path).slice();\n\tvar _ctxt = ctxt;\n\twhile(!_isUndefined(_ctxt) && !_isNull(_ctxt) && path.length) {\n\t\tvar _key = path.shift();\n\t\tif (!(trap.get ? trap.get(_ctxt, _key) : (_isTypeObject(_ctxt) ? _key in _ctxt : _ctxt[_key]))) {\n\t\t\treciever.exists = false;\n\t\t\treturn;\n\t\t}\n\t\t_ctxt = trap.get ? trap.get(_ctxt, _key) : _ctxt[_key];\n\t}\n\treciever.exists = true;\n\treturn _ctxt;\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _isArray from '../js/isArray.js';\nimport _arrFrom from '../arr/from.js';\nimport _get from './get.js';\n\n/**\n * Sets a value to the given path.\n *\n * @param object \t\t\t\tobj\n * @param array \t\t\t\tpath\n * @param mixed \t\t\t\tval\n * @param object|function \t\tbuildTree\n * @param object \t\t\t\ttrap\n *\n * @return bool\n */\nexport default function(obj, path, val, buildTree = {}, trap = {}) {\n\tconst _set = (target, key, val) => {\n\t\tif (trap.set) {\n\t\t\treturn trap.set(target, key, val);\n\t\t} else {\n\t\t\tif (_isNumeric(path[i]) && _isArray(target)) {\n\t\t\t\ttarget.push(val);\n\t\t\t} else {\n\t\t\t\ttarget[key] = val;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t};\n\tpath = _arrFrom(path);\n\tvar target = obj;\n\tfor(var i = 0; i < path.length; i ++) {\n\t\tif (i < path.length - 1) {\n\t\t\tif (!target || (!_isTypeObject(target) && !_isFunction(target))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar branch = _get(target, path[i], trap);\n\t\t\tif (!_isTypeObject(branch)) {\n\t\t\t\tif (trap.buildTree === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbranch = _isFunction(trap.buildTree) ? trap.buildTree(i) : (_isNumeric(path[i + 1]) ? [] : {});\n\t\t\t\tvar branchSuccess = _set(target, path[i], branch);\n\t\t\t\tif (!branchSuccess) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttarget = branch;\n\t\t} else {\n\t\t\treturn _set(target, path[i], val);\n\t\t}\n\t}\n};\n", "\n/**\n * ---------------------------\n * Binds callbacks to requestAnimationFrame()\n * to create a central \"read/write\" phases for Ctxt access.\n * ---------------------------\n */\n\t\t\t\nexport default class Scheduler {\n\n\t/**\n\t * Starts the loop.\n\t *\n\t * @return this\n\t */\n\tconstructor( window, synthesis = false ) {\n\t\tObject.defineProperty( this, 'window', { value: window } );\n\t\tObject.defineProperty( this, 'readCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, 'writeCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, '_synthesis', { value: 0, writable: true } );\n\t\tif ( !synthesis && this.window.requestAnimationFrame ) {\n\t\t\tthis._loop();\n\t\t} else { this._synthesis ++; }\n\t}\n\n\tget synthesis() { return this._synthesis; }\n\n\tasync synthesizeWhile( callback ) {\n\t\tthis._synthesis ++;\n\t\tthis._fulfill();\n\t\tconst returnValue = await callback();\n\t\tthis._synthesis --;\n\t\treturn returnValue;\n\t}\n\n\t_fulfill() {\n\t\tfor ( const callback of this.readCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.readCallbacks.delete( callback );\n\t\t}\n\t\tfor ( const callback of this.writeCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.writeCallbacks.delete( callback );\n\t\t}\n\t}\n\n\t_loop() {\n\t\tthis.window.requestAnimationFrame( () => {\n\t\t\tthis._fulfill();\n\t\t\tthis._loop();\n\t\t} );\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"read\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonread( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.readCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.readCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"write\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonwrite( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.writeCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.writeCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * A special construct for Ctxt manipulations that span\n\t * one or more read/write cycles.\n\t *\n\t * @param function \tread\n\t * @param function \twrite\n\t * @param mixed\t\tprevTransaction\n\t *\n\t * @return void|mixed\n\t */\n\tcycle( onread, onwrite, prevTransaction ) {\n\t\tthis.onread( () => {\n\t\t\t// Record initial values\n\t\t\tconst readReturn = onread( prevTransaction );\n\t\t\t// Call erite, the transation\n\t\t\tconst callWrite = ( readReturn ) => {\n\t\t\t\tif ( readReturn === undefined ) return;\n\t\t\t\tthis.onwrite( () => {\n\t\t\t\t\tconst writeReturn = onwrite( readReturn, prevTransaction );\n\t\t\t\t\t// Repeat transaction\n\t\t\t\t\tconst repeatTransaction = ( writeReturn ) => {\n\t\t\t\t\t\tif ( writeReturn === undefined ) return;\n\t\t\t\t\t\tthis.cycle( onread, onwrite, writeReturn );\n\t\t\t\t\t};\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\t// If \"write\" returns a promise, we wait until it is resolved\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\tif ( writeReturn instanceof Promise ) {\n\t\t\t\t\t\twriteReturn.then( repeatTransaction );\n\t\t\t\t\t} else {\n\t\t\t\t\t\trepeatTransaction( writeReturn );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t\t// ---------------------------------------\n\t\t\t// If \"read\" returns a promise, we wait until it is resolved\n\t\t\t// ---------------------------------------\n\t\t\tif ( readReturn instanceof Promise ) {\n\t\t\t\treadReturn.then( callWrite );\n\t\t\t} else {\n\t\t\t\tcallWrite( readReturn );\n\t\t\t}\n\t\t} );\n\t}\n\n}", "\n\nexport function isXpath( expr ) { return ( expr = expr.trim() ) && expr.startsWith( '(' ) && expr.endsWith( ')' ) }\n\nexport function xpathQuery( window, context, expr, subtree = true ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', subtree ? '(.//' : '(./' ) ).join( '|' );\n let nodes = [], node;\n try {\n // Throws in firefox and safari where context is a text node\n const result = window.document.evaluate( expr, context, null, window.XPathResult.ANY_TYPE );\n while ( node = result.iterateNext() ) nodes.push( node );\n } catch( e ) {}\n return nodes;\n}\n\nexport function xpathMatch( window, node, expr ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', '(self::' ) ).join( '|' );\n try {\n // Throws in firefox and safari where context is a text node and query isn't\n return window.document.evaluate( `${ expr }`, node, null, window.XPathResult.BOOLEAN_TYPE ).booleanValue;\n } catch( e ) {}\n}\n\nexport function containsNode( window, a, b, crossRoots = false, testCache = null ) {\n const prevTest = testCache?.get( a )?.get( b );\n if ( typeof prevTest !== 'undefined' ) return prevTest;\n const response = val => {\n if ( !testCache?.has( a ) ) testCache?.set( a, new WeakMap );\n testCache?.get( a )?.set( b, val );\n return val;\n };\n const rootNodeA = a.getRootNode();\n const rootNodeB = b.getRootNode();\n if ( rootNodeA === rootNodeB ) return response( a.contains( b ) );\n if ( crossRoots && rootNodeB instanceof window.ShadowRoot ) return response( containsNode( window, a, rootNodeB.host, crossRoots, testCache ) );\n return response( false );\n}\n\nexport function splitOuter( str, delim = '|' ) {\n return [ ...str ].reduce( ( [ quote, depth, splits, skip ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}", "\n/**\n * @imports\n */\nimport * as Util from './Util.js';\n\nexport default class DOMSpec {\n constructor( content ) {\n this.content = content;\n this.type = typeof content === 'string' ? 'selector' : 'instance';\n this.kind = this.type === 'instance' ? null : Util.isXpath( content ) ? 'xpath' : 'css';\n if ( this.kind === 'xpath' ) {\n this.isXpathAttr = Util.splitOuter( content.trim().slice( 1, -1 ), '@' ).length > 1;\n }\n }\n toString() { return this.content; }\n}", "\n/**\n * @imports\n */\nimport { _isFunction, _isObject, _wq } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport DOMSpec from './DOMSpec.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class Realtime\n */\nexport default class Realtime {\n\n\t/**\n\t * @constructor\n\t *\n\t * @param document|Element\tcontext\n\t */\n\tconstructor( context, namespace, window ) {\n\t\tthis.context = context;\n\t\tthis.namespace = namespace;\n\t\tthis.window = context.defaultView || context.ownerDocument?.defaultView || window;\n\t\tthis.document = this.window.document;\n\t\tthis.webqit = this.window.webqit;\n\t\tObject.defineProperty( this, '#', { value: {} } );\n\t}\n\t\n\t/**\n\t * Resolves arguments\n\t * \n\t * @param Array \t\t\targs \n\t * \n\t * @returns Array\n\t */\n\tresolveArgs( args ) {\n\t\tif ( _isFunction( args[ 0 ] ) ) { args = [ [], ...args ]; }\n\t\telse if ( _isObject( args[ 0 ] ) && !( args[ 0 ] instanceof DOMSpec ) && args.length === 1 ) {\n\t\t\targs = [ [], undefined, args[ 0 ] ];\n\t\t} else if ( _isObject( args[ 1 ] ) && args.length === 2 ) {\n\t\t\targs = [ _arrFrom( args[ 0 ], false/*castObject*/ ), undefined, args[ 1 ] ];\n\t\t} else { args[ 0 ] = _arrFrom( args[ 0 ], false/*castObject*/ ); }\n\t\tif ( args[ 0 ].filter( x => typeof x !== 'string' && !( x instanceof DOMSpec ) && !( x instanceof this.window.Node ) ).length ) {\n\t\t\tthrow new Error( `Argument #2 must be either a string or a Node object, or a list of those.` );\n\t\t}\n\t\targs[ 0 ] = args[ 0 ].map( s => s instanceof DOMSpec ? s : new DOMSpec( s ) );\n\t\treturn args;\n\t}\n\n\t/**\n\t * @registry\n\t *\n\t * @param Array\t\t\t\t...args\n\t * \n\t * @returns Map\n\t */\n\tregistry( ...args ) {\n\t\treturn _wq( this.window, 'realdom', this.namespace, ...args );\n\t}\n\t\t\n\t/**\n\t * @createSignalGenerator\n\t * \n\t * @param Object \t\t\tmo \n\t * \n\t * @returns Object\n\t */\n\tcreateSignalGenerator() {\n\t\treturn {\n\t\t\tgenerate() {\n\t\t\t\t// Abort previous\n\t\t\t\tthis.lastController?.abort();\n\t\t\t\tthis.lastController = new AbortController;\n\t\t\t\tconst flags = { signal: this.lastController.signal };\n\t\t\t\treturn flags;\n\t\t\t},\n\t\t\tdisconnect() { this.lastController?.abort(); }\n\t\t}\n\t}\n\t\t\n\t/**\n\t * Loops through registration objects whose contexts match the event context.\n\t * \n\t * @param String \t\tinterceptionTiming\n\t * @param Object|Array \trecord_s\n\t * @param Function \t\tcallback \n\t * \n\t * @returns void\n\t */\n\tforEachMatchingContext( interceptionTiming, record_s, callback ) {\n\t\tconst { window } = this, deferreds = new Set, testCache = new WeakMap;\n\t\tfor ( const [ registration, deferred ] of this.registry( interceptionTiming ) ) {\n\t\t\tlet $records = [].concat( record_s ).filter( record => Util.containsNode( window, registration.context, record.target, registration.params.subtree === 'cross-roots', testCache ) );\n\t\t\tif ( !$records.length ) continue;\n\t\t\tconst args = [ registration, Array.isArray( record_s ) ? $records : $records[ 0 ] ];\n\t\t\tif ( deferred ) deferreds.add( args ); else callback.call( window, ...args );\n\t\t}\n\t\tfor ( const args of deferreds ) callback.call( window, ...args );\n\t\tdeferreds.clear();\n\t}\n\n\t/**\n\t * @disconnectables\n\t * \n\t * @param AbortSignal \t\tsignal\n\t * @param Array \t\t\t...objects \n\t * \n\t * @returns Object\n\t */\n\tdisconnectables( signal, ...objects ) {\n\t\tconst disconnectable = { disconnect() {\n\t\t\tobjects.forEach( d => (\n\t\t\t\td && _isFunction( d.disconnect ) && d.disconnect() \n\t\t\t\t|| _isFunction( d ) && d() \n\t\t\t\t|| _isObject( d ) && ( d.disconnected = true )\n\t\t\t) );\n\t\t} };\n\t\tif ( signal ) signal.addEventListener( 'abort', () => disconnectable.disconnect() );\n\t\treturn disconnectable;\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _wq } from '@webqit/util/js/index.js';\nimport Realtime from './Realtime.js';\nimport DOMSpec from './DOMSpec.js';\n\n/**\n *\n * @class AttrRealtime\n */\nexport default class AttrRealtime extends Realtime {\n\n\ttype = 'attr';\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'attr', ...args );\n\t}\n\t\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tget( spec, callback = undefined, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// -------------\n\t\tconst records = attrIntersection( context, spec );\n\t\tif ( !callback ) return records;\n\t\tconst signalGenerator = params.lifecycleSignals && this.createSignalGenerator();\n\t\tif ( !originalFilterIsString ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( records, flags, context );\n\t\t} else {\n\t\t\tfor ( const record of records ) {\n\t\t\t\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\t\t\t\tcallback( record, flags, context );\n\t\t\t}\n\t\t}\n\t\t// -------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( originalFilterIsString ? spec[ 0 ] : spec, callback, { newValue: true, ...params } );\n\t\t\treturn this.disconnectables( params.signal, disconnectable_live );\n\t\t}\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( originalFilterIsString ? spec[ 0 ] : spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails && !webqit.realdom.attrInterceptionHooks?.intercepting ) {\n\t\t\tattrInterception.call( window, 'intercept', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => {\n\t\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\t\tdispatch.call( window, registration, records, context );\n\t\t} );\n\t\t// ------------------\n\t\tconst $params = { attributes: true, attributeOldValue: params.oldValue, subtree: params.subtree && true };\n\t\tif ( spec.length ) { $params.attributeFilter = spec.map( a => a + '' ); }\n\t\tdisconnectable.observe( context, $params );\n\t\t// -------------\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tattrInterception.call( window, interceptionTiming, records => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, records, dispatch );\n\t\t\t} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() { registry.delete( registration ); } };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n}\n\n/**\n * Deduplicates records.\n * \n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction dedupAndIgnoreInternals( records ) {\n\treturn records.reduce( ( rcds, rcd, i ) => {\n\t\tif ( rcds[ i - 1 ]?.attributeName === rcd.attributeName ) return rcds;\n\t\tif ( _wq( rcd.target, 'realdom', 'internalAttrInteractions' ).get( rcd.attributeName ) ) return rcds;\n\t\treturn rcds.concat( rcd );\n\t}, [] );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration\n * @param Array \t\t\trecords\n * \n * @returns Void\n */\nfunction dispatch( registration, records ) {\n\tconst { context, spec, callback, params, atomics, originalFilterIsString, signalGenerator } = registration;\n\tif (!params.subtree) {\n\t\trecords = records.filter((r) => {\n\t\t\treturn r.target === context;\n\t\t}); \n\t}\n\tif ( !records.length ) return;\n\tconst $spec = spec.map( a => a + '' );\n\tif ( params.atomic && !atomics.size ) {\n\t\trecords = attrIntersection( context, spec, records );\n\t} else if ( params.timing !== 'async' && spec.length ) {\n\t\trecords = records.filter( r => $spec.includes( r.name ) );\n\t}\n\tif ( !records.length ) return;\n\t// Should we care about old / new values being present?\n\tif ( !( params.newValue === null && params.oldValue === null && params.eventDetails ) ) {\n\t\trecords = records.map( rcd => {\n\t\t\tlet exclusion;\n\t\t\tif ( !params.eventDetails ) {\n\t\t\t\t( { event: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.oldValue && ( 'oldValue' in rcd ) ) {\n\t\t\t\t( { oldValue: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.newValue && ( 'value' in rcd ) ) {\n\t\t\t\t( { value: exclusion, ...rcd } = rcd );\n\t\t\t} else if ( params.newValue && typeof rcd.value === 'undefined' ) {\n\t\t\t\trcd = { ...rcd, value: internalAttrInteraction( rcd.target, rcd.name, () => rcd.target.getAttribute( rcd.name ) ) };\n\t\t\t}\n\t\t\treturn rcd;\n\t\t} );\n\t}\n\tif ( params.atomic ) {\n\t\trecords.forEach( record => atomics.set( record.name, record ) );\n\t\trecords = Array.from( atomics.entries() ).map( ( [ , value ] ) => value );\n\t}\n\tconst record_s = originalFilterIsString ? records[ 0 ] : records;\n\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\tcallback( record_s, flags, context );\n}\n\n/**\n */\nfunction internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'realdom', 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\n/**\n * Helper to determining which records to deliver.\n * \n * @param Object \t\t\tcontext\n * @param Array \t\t\tspec\n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction attrIntersection( context, spec, records = [] ) {\n\tconst _type = { event: null, type: 'attribute' };\n\tif ( spec.length ) {\n\t\treturn spec.map( attrName => {\n\t\t\tattrName = attrName + '';\n\t\t\treturn records.find( r => r.name === attrName ) || { target: context, name: attrName, value: internalAttrInteraction( context, attrName, () => context.getAttribute( attrName ) ), ..._type };\n\t\t} );\n\t}\n\tconst attrs = Array.from( context.attributes );\n\treturn attrs.map( attr => {\n\t\treturn records.find( r => r.name === attr.nodeName ) || { target: context, name: attr.nodeName, value: internalAttrInteraction( context, attr.nodeName, () => attr.nodeValue ), ..._type };\n\t} );\n}\n\n/**\n * Determines the event for an attr mutation record.\n * \n * @param MutationRecord \t{ target, attributeName }\n * \n * @returns Object\n */\nfunction withAttrEventDetails( { target, attributeName, value, oldValue } ) {\n\tconst window = this, registry = window.webqit.realdom.attrInterceptionRecords?.get( target ) || {};\n\tconst event = registry[ attributeName ]?.[ 0 ] || 'mutation';\n\tconst record = { target, name: attributeName, value, oldValue, type: 'observation', event };\n\treturn record;\n}\n\n/**\n * Attributes intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction attrInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Element } = window;\n\tif ( !webqit.realdom.attrInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'attrInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.attrInterceptionHooks.has( timing ) ) { webqit.realdom.attrInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.attrInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.attrInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.attrInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `Attr mutation APIs are now being intercepted.` );\n\twebqit.realdom.attrInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'attrInterceptionRecords', { value: new Map } );\n\n\t// Interception hooks\n\tconst attrIntercept = ( record, defaultAction ) => {\n\t\tif ( !webqit.realdom.attrInterceptionRecords.has( record.target ) ) { webqit.realdom.attrInterceptionRecords.set( record.target, {} ); }\n\t\tconst registry = webqit.realdom.attrInterceptionRecords.get( record.target );\n\t\t// ------------------\n\t\tregistry[ record.name ] = registry[ record.name ] || [];\n\t\tregistry[ record.name ].unshift( record.event );\n\t\tif ( _wq( record.target, 'realdom', 'internalAttrInteractions' ).get( record.name ) ) return defaultAction();\n\t\t// ------------------\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( [ record ] ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( [ record ] ) );\n\t\treturn returnValue;\n\t};\n\n\t// Interception observer WILL need to know non-API-based mutations\n\tconst mo = new window.MutationObserver( records => {\n\t\trecords = records.filter( rcd => {\n\t\t\tconst registry = window.webqit.realdom.attrInterceptionRecords?.get( rcd.target ) || {};\n\t\t\treturn !registry[ rcd.attributeName ]?.shift();\n\t\t} );\n\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\tif ( !records.length ) return;\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( records ) );\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( records ) );\n\t} );\n\tmo.observe( document, { attributes: true, subtree: true, attributeOldValue: true } );\n\n\t// Intercept DOM attr mutation methods\n\tconst originalApis = Object.create( null );\n\t[ 'setAttribute', 'removeAttribute', 'toggleAttribute', ].forEach( apiName => {\n\t\toriginalApis[ apiName ] = Element.prototype[ apiName ];\n\t\tElement.prototype[ apiName ] = function( ...args ) {\n\t\t\tlet value, oldValue = internalAttrInteraction( this, args[ 0 ], () => this.getAttribute( args[ 0 ] ) );\n\t\t\tif ( [ 'setAttribute', 'toggleAttribute' ].includes( apiName ) ) { value = args[ 1 ]; }\n\t\t\tif ( apiName === 'toggleAttribute' && value === undefined ) {\n\t\t\t\tvalue = oldValue === null ? true : false;\n\t\t\t}\n\t\t\tconst record = { target: this, name: args[ 0 ], value, oldValue, type: 'interception', event: [ this, apiName ] };\n\t\t\tconst exec = () => originalApis[ apiName ].call( this, ...args );\n\t\t\treturn attrIntercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\n/**\n * @imports\n */\nimport { _isObject } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport AttrRealtime from './AttrRealtime.js';\nimport Realtime from './Realtime.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class DOMRealtime\n */\nexport default class DOMRealtime extends Realtime {\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'tree', ...args );\n\t}\n\n\t/**\n\t * Alias for ( new AttrRealtime() ).all( ... )\n\t */\n\tattr( filter, callback = undefined, params = {} ) {\n\t\tconst { context, window } = this;\n\t\treturn ( new AttrRealtime( context, window ) ).get( ...arguments );\n\t}\n\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tquery( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// ------------------\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'query', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ------------------\n\t\tif ( !params.generation || params.generation === 'entrants' ) {\n\t\t\tif ( !spec.length ) {\n\t\t\t\t//if ( params.subtree ) throw new Error( `The subtree option requires a selector to work.` );\n\t\t\t\t[ ...context.children ].forEach( node => getRecord( context ).entrants.push( node ) );\n\t\t\t} else if ( spec.every( s => s.type === 'selector' ) ) {\n\t\t\t\tconst [ cssSelectors, xpathQueries ] = spec.reduce( ( [ css, xpath ], s ) => {\n\t\t\t\t\treturn s.kind === 'xpath' ? [ css, xpath.concat( s ) ] : [ css.concat( s ), xpath ];\n\t\t\t\t}, [ [], [] ] );\n\t\t\t\tconst matches = [];\n\t\t\t\tif ( params.subtree ) {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...context.querySelectorAll( cssSelectors.join( ',' ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries ) ); }\n\t\t\t\t} else {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...[ ...context.children ].filter( node => node.matches( cssSelectors ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries, false ) ); }\n\t\t\t\t}\n\t\t\t\tmatches.forEach( node => getRecord( node.parentNode || context ).entrants.push( node ) );\n\t\t\t}\n\t\t}\n\t\t// ------------------\n\t\tif ( !callback ) return records;\n\t\tconst disconnectable = { disconnected: false };\n\t\tconst signalGenerator = callback && params.lifecycleSignals && this.createSignalGenerator();\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tif ( disconnectable.disconnected ) break;\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t\t// ------------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( spec, callback, params );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, disconnectable_live );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: false } )\n\t */\n\tchildren( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: false } );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: true } )\n\t */\n\tsubtree( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: true } );\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit, document } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails ) { webqit.realdom.domInterceptionRecordsAlwaysOn = true; }\n\t\tif ( ( document.readyState === 'loading' || webqit.realdom.domInterceptionRecordsAlwaysOn ) && !webqit.realdom.domInterceptionHooks?.intercepting ) {\n\t\t\tdomInterception.call( window, 'sync', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tdispatch.call( window, registration, withEventDetails.call( window, record ), context );\n\t\t} ) );\n\t\tdisconnectable.observe( context, { childList: true, subtree: params.subtree && true, } );\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\t\t\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tdomInterception.call( window, interceptionTiming, record => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, record, dispatch );\n\t\t\t} );\n\t\t}\n\t\tconst mo = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tif ( Array.isArray( ( record = withEventDetails.call( window, record ) ).event ) ) return;\n\t\t\tdispatch.call( window, registration, record, context );\n\t\t} ) );\n\t\tmo.observe( context, { childList: true, subtree: params.subtree && true } );\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() {\n\t\t\tregistry.delete( registration );\n\t\t\tmo.disconnect();\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Tracks the connectedness of element references.\n\t *\n\t * @param array|Element\t\t\t\telements\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable\n\t */\n\ttrack( elements, callback, params = {} ) {\n\t\tparams = { subtree: true, ...params };\n\t\treturn this.observe( elements, record => {\n\t\t\tif ( record.entrants.length ) callback( true, Array.isArray( elements ) ? record.entrants : record.entrants[ 0 ] );\n\t\t\tif ( record.exits.length ) callback( false, Array.isArray( elements ) ? record.exits : record.exits[ 0 ] );\n\t\t}, params );\n\t}\n}\n\n/**\n * Sensitivty for attribute changes for attribute spec.\n * \n * @param object registration\n * \n * @returns Disconnectable\n */\nfunction staticSensitivity( registration ) {\n\tconst window = this;\n\tconst { context, spec, callback, params, signalGenerator } = registration;\n\tconst cssSelectors = spec.filter( s => s.kind === 'css' );\n\tconst parseDot = selector => selector.match( /\\.([\\w-]+)/g )?.length ? [ 'class' ] : [];\n\tconst parseHash = selector => selector.match( /#([\\w-]+)/g )?.length ? [ 'id' ] : [];\n\tconst parse = selector => [ ...selector.matchAll( /\\[([^\\=\\]]+)(\\=[^\\]]+)?\\]/g ) ].map( x => x[ 1 ] ).concat( parseDot( selector ) ).concat( parseHash( selector ) );\n\tif ( !( registration.$attrs = Array.from( new Set( cssSelectors.filter( s => ( s + '' ).includes( '[' ) ).reduce( ( attrs, selector ) => attrs.concat( parse( selector + '' ) ), [] ) ) ) ).length ) return;\n\t// ---------\n\tconst entrants = new Set, exits = new Set;\n\tentrants.push = val => ( exits.delete( val ), entrants.add( val ) );\n\texits.push = val => ( entrants.delete( val ), exits.add( val ) );\n\tregistration.$deliveryCache = { entrants, exits };\n\t// ---------\n\treturn ( new AttrRealtime( context, window ) ).observe( registration.$attrs, _records => {\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'static', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ---------\n\t\tconst matchesCache = new WeakMap;\n\t\tconst matches = node => {\n\t\t\tif ( !matchesCache.has( node ) ) { matchesCache.set( node, cssSelectors.some( s => node.matches( s + '' ) ) ); }\n\t\t\treturn matchesCache.get( node );\n\t\t};\n\t\t// ---------\n\t\tfor ( const _record of _records ) {\n\t\t\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\t\t\tif ( params.generation && generation !== params.generation ) return;\n\t\t\t\tif ( registration.$deliveryCache[ generation ].has( _record.target ) || ( generation === 'entrants' ? !matches( _record.target ) : matches( _record.target ) ) ) return;\n\t\t\t\tregistration.$deliveryCache[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target )[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target ).event = _record.event;\n\t\t\t} );\n\t\t}\n\t\t// ---------\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t}, { subtree: params.subtree, timing: params.timing, eventDetails: params.eventDetails } );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration \n * @param Object \t\t\trecord \n * \n * @returns Void\n */\nfunction dispatch( registration, _record ) {\n\tconst { context, spec, callback, params, signalGenerator, $deliveryCache } = registration;\n\t// ---------\n\tconst record = { ..._record, entrants: [], exits: [] };\n\tif ( !params.eventDetails ) { delete record.event; }\n\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\tif ( params.generation && generation !== params.generation ) return;\n\t\tif ( spec.length ) {\n\t\t\trecord[ generation ] = nodesIntersection.call( this, spec, params.subtree === 'cross-roots', _record[ generation ], _record.event !== 'parse' );\n\t\t} else {\n\t\t\trecord[ generation ] = [ ..._record[ generation ] ];\n\t\t}\n\t\tif ( !$deliveryCache ) return;\n\t\tfor ( const node of record[ generation ] ) {\n\t\t\t$deliveryCache[ generation ].push( node );\n\t\t}\n\t} );\n\t// ---------\n\tif ( !record.entrants.length && !record.exits.length ) return;\n\tconst flags = signalGenerator?.generate() || {};\n\tcallback( record, flags, context );\n}\n\n/**\n * Aggregates instances of els in sources\n * \n * @param Array \t\t\tspec \n * @param Bool \t\t\t\tcrossRoots \n * @param Array \t\t\tsources \n * @param Bool \t\t\t\tdeepIntersect \n * \n * @returns \n */\nfunction nodesIntersection( spec, crossRoots, sources, deepIntersect ) {\n\tsources = Array.isArray( sources ) ? sources : [ ...sources ];\n\tconst match = ( sources, s ) => {\n\t\t// Filter out text nodes\n\t\tif ( s.type === 'selector' ) {\n\t\t\t// Is directly mutated...\n\t\t\tlet matches = s.isXpathAttr ? [] : sources.filter( source => s.kind === 'xpath' ? Util.xpathMatch( this, source, s + '' ) : source.matches && source.matches( s + '' ) );\n\t\t\t// Is contextly mutated...\n\t\t\tif ( deepIntersect || s.isXpathAttr ) {\n\t\t\t\tmatches = sources.reduce( ( collection, source ) => {\n\t\t\t\t\tif ( s.kind === 'xpath' ) { return [ ...collection, ...Util.xpathQuery( this, source, s, deepIntersect ) ]; }\n\t\t\t\t\treturn source.querySelectorAll ? [ ...collection, ...source.querySelectorAll( s + '' ) ] : collection;\n\t\t\t\t}, matches );\n\t\t\t}\n\t\t\tif ( matches.length ) return matches;\n\t\t} else {\n\t\t\t// Is directly mutated...\n\t\t\tif ( sources.includes( s.content ) || (\n\t\t\t\tdeepIntersect && sources.some( source => Util.containsNode( this/* window */, source, s.content, crossRoots ) )\n\t\t\t) ) { return [ s.content ]; }\n\t\t}\n\t};\n\t// Search can be expensive...\n\t// Multiple listeners searching the same thing in the same list?\n\tif ( !sources.$$searchCache ) { sources.$$searchCache = new Map; }\n\treturn spec.reduce( ( matches, s ) => {\n\t\tlet _matches;\n\t\tif ( sources.$$searchCache.has( s.content ) ) {\n\t\t\t_matches = sources.$$searchCache.get( s.content );\n\t\t} else {\n\t\t\t_matches = match( sources, s ) || [];\n\t\t\tif ( s.type === 'instance' ) {\n\t\t\t\tsources.$$searchCache.set( s.content, _matches );\n\t\t\t}\n\t\t}\n\t\treturn matches.concat( _matches );\n\t}, [] );\n}\n\n/**\n * Determines the event for a mutation record\n * \n * @param MutationRecord \t{ target, entrants, exits }\n * \n * @returns Object\n */\nfunction withEventDetails( { target, addedNodes, removedNodes } ) {\n\tlet window = this, event;\n\tevent = _arrFrom( addedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), null );\n\tevent = _arrFrom( removedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), event );\n\tevent = event || window.document.readyState === 'loading' && 'parse' || 'mutation';\n\treturn { target, entrants: addedNodes, exits: removedNodes, type: 'observation', event };\n}\n\n/**\n * DOM intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction domInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Node, CharacterData, Element, HTMLElement, HTMLTemplateElement, DocumentFragment } = window;\n\tif ( !webqit.realdom.domInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'domInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionNoRecurse ) { Object.defineProperty( webqit.realdom, 'domInterceptionNoRecurse', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionHooks.has( timing ) ) { webqit.realdom.domInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.domInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.domInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.domInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `DOM mutation APIs are now being intercepted.` );\n\twebqit.realdom.domInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'domInterceptionRecords', { value: new Map } );\n\n\t// No recursion helper\n\tconst noRecurse = ( node, method, callback ) => {\n\t\twebqit.realdom.domInterceptionNoRecurse.set( node, method );\n\t\tconst returnValue = callback();\n\t\twebqit.realdom.domInterceptionNoRecurse.delete( node );\n\t\treturn returnValue;\n\t};\n\n\t// Interception hooks\n\tconst intercept = ( record, defaultAction ) => {\n\t\trecord.entrants.concat( record.exits ).forEach( node => {\n\t\t\tclearTimeout( webqit.realdom.domInterceptionRecords.get( node )?.timeout ); // Clear any previous that's still active\n\t\t\twebqit.realdom.domInterceptionRecords.set( node, record.event ); // Main: set event details... and next to timeout details\n\t\t\tconst timeout = setTimeout( () => { webqit.realdom.domInterceptionRecords.delete( node ); }, 0 );\n\t\t\tObject.defineProperty( record.event, 'timeout', { value: timeout, configurable: true } );\n\t\t} );\n\t\twebqit.realdom.domInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( record ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.domInterceptionHooks.get( 'sync' )?.forEach( callback => callback( record ) );\n\t\treturn returnValue;\n\t};\n\n\t// Intercept DOM mutation methods\n\tconst _apiNames = {\n\t\t// Note the order\n\t\tShadowRoot: [ 'innerHTML', 'setHTMLUnsafe' ],\n\t\tDocumentFragment: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tDocument: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tHTMLElement: [ 'outerText', 'innerText' ],\n\t\tElement: [ 'append', 'prepend', 'before', 'after', 'insertAdjacentElement', 'insertAdjacentHTML', 'remove', 'replaceChildren', 'replaceWith', 'setHTMLUnsafe', 'innerHTML', 'outerHTML' ],\n\t\tCharacterData: [ 'before', 'after', 'remove', 'replaceWith' ],\n\t\tNode: [ 'insertBefore', 'replaceChild', 'removeChild', 'appendChild', 'textContent', 'nodeValue' ],\n\t};\n\tconst _apiOriginals = {\n\t\t// Note the order\n\t\tShadowRoot: Object.create( null ), // extends DocumentFragment\n\t\tDocumentFragment: Object.create( null ), // extends Node\n\t\tDocument: Object.create( null ), // extends Node\n\t\tHTMLElement: Object.create( null ), // extends Element,\n\t\tElement: Object.create( null ), // extends Node\n\t\tCharacterData: Object.create( null ), // extends Node\n\t\tNode: Object.create( null ),\n\t};\n\n\tconst _apiNamesUnique = new Set( Object.values( _apiNames ).reduce( ( all, apis ) => all.concat( apis ), [] ) );\n\t_apiNamesUnique.forEach( apiName => {\n\t\t\n\t\tObject.keys( _apiNames ).forEach( DOMClassName => {\n\t\t\tif ( !_apiNames[ DOMClassName ].includes( apiName ) ) return;\n\t\t\tconst _apiOriginal = Object.getOwnPropertyDescriptor( window[ DOMClassName ].prototype, apiName );\n\t\t\tif ( !_apiOriginal ) return; // Typically: Element:setHTMLUnsafe\n\t\t\tObject.defineProperty( window[ DOMClassName ].prototype, apiName, 'value' in _apiOriginal ? { ..._apiOriginal, value: method } : { ..._apiOriginal, set: setter } );\n\t\t\t_apiOriginals[ DOMClassName ][ apiName ] = _apiOriginal;\n\t\t} );\n\n\t\tfunction method( ...args ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\tif ( webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'insertBefore' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'insertAdjacentElement', 'insertAdjacentHTML' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 1 ] ];\n\t\t\t\tif ( [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t} else if ( [ 'setHTMLUnsafe', 'replaceChildren' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\tentrants = apiName === 'replaceChildren' ? [ ...args ] : [ args[ 0 ] ];\n\t\t\t} else if ( [ 'replaceWith', 'remove' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\tentrants = apiName === 'replaceWith' ? [ ...args ] : [];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else if ( [ 'replaceChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ args[ 1 ] ];\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'removeChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...args ];\n\t\t\t} else {\n\t\t\t\t// 'before', 'after', 'append', 'prepend', 'appendChild'\n\t\t\t\tentrants = [ ...args ];\n\t\t\t\tif ( [ 'before', 'after' ].includes( apiName ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to entrants\n\t\t\tlet apiNameFinal = apiName;\n\t\t\tif ( [ 'insertAdjacentHTML', 'setHTMLUnsafe' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'insertAdjacentHTML' && [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\t$apiOriginals.setHTMLUnsafe.value.call( temp, entrants[ 0 ], apiName === 'setHTMLUnsafe' ? args[ 1 ] : {} );\n\t\t\t\tentrants = [ ...temp.childNodes ];\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'insertAdjacentHTML' ) {\n\t\t\t\t\tapiNameFinal = 'insertAdjacentElement';\n\t\t\t\t\targs[ 1 ] = new DocumentFragment;\n\t\t\t\t\tnoRecurse( args[ 1 ], 'append', () => args[ 1 ].append( ...temp.childNodes ) );\n\t\t\t\t} else {\n\t\t\t\t\tapiNameFinal = 'replaceChildren';\n\t\t\t\t\targs = [ ...temp.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, () => {\n\t\t\t\treturn $apiOriginals[ apiNameFinal ].value.call( this, ...args );\n\t\t\t} );\n\t\t}\n\n\t\tfunction setter( value ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].set.call( this, value );\n\t\t\tif ( this instanceof HTMLScriptElement || webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'outerHTML', 'outerText' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else {\n\t\t\t\t// 'innerHTML', 'innerText', 'textContent', 'nodeValue'\n\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\ttarget = this.content;\n\t\t\t\t\texits = [ ...this.content.childNodes ];\n\t\t\t\t} else {\n\t\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to nodes\n\t\t\tif ( [ 'outerHTML', 'innerHTML' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return exec();\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\tnoRecurse( temp, apiName, () => temp[ apiName ] = value );\n\t\t\t\tentrants = this instanceof HTMLTemplateElement ? [ ...temp.content.childNodes ] : [ ...temp.childNodes ];\n\t\t\t\tif ( ( this instanceof HTMLTemplateElement && this.hasAttribute( 'src' ) ) || this instanceof ShadowRoot ) {\n\t\t\t\t\tconst getScripts = nodes => nodes.reduce( ( scripts, el ) => {\n\t\t\t\t\t\tif ( el instanceof HTMLScriptElement ) return scripts.concat( el );\n\t\t\t\t\t\tif ( el instanceof HTMLTemplateElement ) return scripts.concat( getScripts( [ el.content ] ) );\n\t\t\t\t\t\tscripts = scripts.concat( getScripts( [ ...( el.querySelectorAll?.( 'template' ) || [] ) ].map( t => t.content ) ) );\n\t\t\t\t\t\treturn scripts.concat( ...( el.querySelectorAll?.( 'script' ) || [] ) );\n\t\t\t\t\t}, [] );\n\t\t\t\t\tfor ( const script of getScripts( entrants ) ) {\n\t\t\t\t\t\tif (this instanceof ShadowRoot) {\n\t\t\t\t\t\t\tscript.setAttribute('data-handling', 'manual');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst $script = document.createElement( 'script' );\n\t\t\t\t\t\t[ ...script.attributes ].forEach( attr => $script.setAttribute( attr.name, attr.value ) );\n\t\t\t\t\t\t$script.textContent = script.textContent;\n\t\t\t\t\t\tnoRecurse( script, 'replaceWith', () => script.replaceWith( $script ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\tvalue = new DocumentFragment;\n\t\t\t\t\tnoRecurse( value, 'append', () => value.append( ...entrants ) );\n\t\t\t\t\texec = () => noRecurse( this, 'replaceWith', () => Element.prototype.replaceWith.call( this, value ) );\n\t\t\t\t} else {\n\t\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\t\texec = () => noRecurse( this.content, 'replaceChildren', () => this.content.replaceChildren( ...entrants ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\texec = () => noRecurse( this, 'replaceChildren', () => Element.prototype.replaceChildren.call( this, ...entrants ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\r\n/**\r\n * Applies all supported polyfills\r\n */\r\nexport default function() {\r\n CSS_escape.call( this );\r\n Node_isConnected.call( this );\r\n Element_matches.call( this );\r\n}\r\n\r\n/**\r\n * Polyfills the window.CSS object.\r\n * \r\n * @return void\r\n */\r\nexport function CSS_escape() {\r\n const window = this;\r\n if ( !window.CSS ) { window.CSS = {} }\r\n if ( !window.CSS.escape ) {\r\n /**\r\n * Polyfills the window.CSS.escape() function.\r\n * \r\n * @param string str \r\n * \r\n * @return string\r\n */\r\n window.CSS.escape = str => str.replace( /([\\:@\\~\\$\\&])/g, '\\\\$1' );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Node.prototype.isConnected property\r\n * \r\n * @see MDN\r\n * \r\n * @return bool\r\n*/\r\nexport function Node_isConnected() {\r\n const window = this;\r\n if ( !( 'isConnected' in window.Node.prototype ) ) {\r\n Object.defineProperty( window.Node.prototype, 'isConnected', { get: function() {\r\n return !this.ownerDocument || !(\r\n this.ownerDocument.compareDocumentPosition( this )\r\n & this.DOCUMENT_POSITION_DISCONNECTED);\r\n } } );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Element.prototype.matches() method\r\n * \r\n * @see MDN\r\n * \r\n * @return void\r\n*/\r\nexport function Element_matches() {\r\n const window = this;\r\n if ( !window.Element.prototype.matches ) {\r\n window.Element.prototype.matches = \r\n window.Element.prototype.matchesSelector || \r\n window.Element.prototype.mozMatchesSelector ||\r\n window.Element.prototype.msMatchesSelector || \r\n window.Element.prototype.oMatchesSelector || \r\n window.Element.prototype.webkitMatchesSelector ||\r\n function( s ) {\r\n var matches = ( this.document || this.ownerDocument ).querySelectorAll( s ),\r\n i = matches.length;\r\n while ( --i >= 0 && matches.item( i ) !== this ) {}\r\n return i > -1; \r\n }\r\n }\r\n}", "\r\n/**\r\n * @imports\r\n */\r\nimport { _isNumeric, _isString, _isFunction } from '@webqit/util/js/index.js';\r\nimport { _set } from '@webqit/util/obj/index.js';\r\nimport Scheduler from './Scheduler.js';\r\nimport DOMRealtime from './realtime/DOMRealtime.js';\r\nimport AttrRealtime from './realtime/AttrRealtime.js';\r\nimport polyfill from './polyfills.js';\r\n\r\nexport default function() {\r\n const window = this;\r\n if ( !window.webqit ) window.webqit = {};\r\n if ( window.webqit.realdom ) return window.webqit.realdom;\r\n window.webqit.realdom = {};\r\n polyfill.call( window );\r\n // ------\r\n window.webqit.realdom.meta = ( ...args ) => meta.call( window, ...args );\r\n window.webqit.realdom.ready = ( ...args ) => ready.call( window, ...args );\r\n // ------\r\n window.webqit.realdom.realtime = ( context, namespace = 'dom' ) => {\r\n if ( namespace === 'dom' ) return new DOMRealtime( context, window );\r\n if ( namespace === 'attr' ) return new AttrRealtime( context, window );\r\n };\r\n // ------\r\n const scheduler = new Scheduler( window );\r\n window.webqit.realdom.schedule = ( type, ...args ) => {\r\n return scheduler[ `on${ type }` ]( ...args );\r\n };\r\n window.webqit.realdom.synthesizeWhile = ( ...args ) => {\r\n return scheduler.synthesizeWhile( ...args );\r\n };\r\n // ------\r\n return window.webqit.realdom;\r\n}\r\n\r\n\r\n/**\r\n * DOM-ready listeners.\r\n * \r\n * @param Function\t \t\tcallback\r\n * \r\n * @return void\r\n */\r\nfunction ready( ...args ) {\r\n let timing = 'interactive', callback;\r\n if ( _isString( args[ 0 ] ) ) {\r\n timing = args[ 0 ];\r\n if ( _isFunction( args[ 1 ] ) ) { callback = args[ 1 ]; }\r\n } else if ( _isFunction( args[ 0 ] ) ) { callback = args[ 0 ]; }\r\n // --------------\r\n const timings = { interactive: [ 'interactive', 'complete' ], complete: [ 'complete' ], };\r\n if ( !timings[ timing ] ) throw new Error( `Invalid ready-state timing: ${ timing }.` );\r\n\tconst window = this;\r\n // --------------\r\n if ( !callback ) {\r\n if ( !window.webqit.realdom.readyStatePromises ) {\r\n window.webqit.realdom.readyStatePromises = {\r\n interactive: new Promise( res => ready.call( this, 'interactive', res ) ),\r\n complete: new Promise( res => ready.call( this, 'complete', res ) ),\r\n };\r\n }\r\n return window.webqit.realdom.readyStatePromises[ timing ];\r\n }\r\n // --------------\r\n\tif ( timings[ timing ].includes( window.document.readyState ) ) return callback( window );\r\n if ( !window.webqit.realdom.readyStateCallbacks ) {\r\n window.webqit.realdom.readyStateCallbacks = { interactive: [], complete: [] };\r\n window.document.addEventListener( 'readystatechange', () => {\r\n const state = window.document.readyState;\r\n for ( const callback of window.webqit.realdom.readyStateCallbacks[ state ].splice( 0 ) ) {\r\n callback( window );\r\n }\r\n }, false );\r\n }\r\n window.webqit.realdom.readyStateCallbacks[ timing ].push( callback );\r\n}\r\n\r\n/**\r\n * A webqit's meta tag props reader.\r\n * \r\n * @param String name\r\n * \r\n * @return Object\r\n */\r\nfunction meta( name ) {\r\n const window = this;\r\n let _content = {}, _el;\r\n if ( _el = window.document.querySelector( `meta[name=\"${ name }\"]` ) ) {\r\n _content = ( _el.content || '' ).split( ';' ).filter( v => v ).reduce( ( _metaVars, directive ) => {\r\n const directiveSplit = directive.split( '=' ).map( d => d.trim() );\r\n _set( _metaVars, directiveSplit[ 0 ].split( '.' ), directiveSplit[ 1 ] === 'true' ? true : (directiveSplit[ 1 ] === 'false' ? false : (\r\n _isNumeric( directiveSplit[ 1 ] ) ? parseInt( directiveSplit[ 1 ] ) : directiveSplit[ 1 ]\r\n ) )\r\n );\r\n return _metaVars;\r\n }, {} );\r\n }\r\n return { get name() { return name; }, get content() { return _el.content; }, json() {\r\n\t\treturn JSON.parse( JSON.stringify( _content ) );\r\n } };\r\n}", "\n/**\n * Converts a string to title case.\n *\n * @param string \tstr\n * @param bool \t\tstrict\n *\n * @return string\n */\nexport default function(str, strict) {\n\tif (typeof str !== 'string') {\n\t\treturn str;\n\t}\n\treturn str.replace(/\\w\\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + ((typeof strict !== undefined && strict) ? txt.substr(1).toLowerCase() : txt.substr(1)); })\n};\n", "\n/**\n * @imports\n */\nimport realdomInit from '@webqit/realdom';\nimport { _wq as __wq } from '@webqit/util/js/index.js';\nimport { _merge } from '@webqit/util/obj/index.js';\nimport { _toTitle } from '@webqit/util/str/index.js';\n\nexport const _wq = ( target, ...args ) => __wq( target, 'oohtml', ...args );\n\nexport const env = {};\n\nexport function _init( name, $config, $defaults ) {\n const window = this, realdom = realdomInit.call( window );\n env.window = window;\n if ( !window.webqitConfig ) {\n window.webqitConfig = realdom.meta( 'webqit' ).json();\n }\n window.webqit || ( window.webqit = {} );\n window.webqit.oohtml || ( window.webqit.oohtml = {} );\n window.webqit.oohtml.configs || ( window.webqit.oohtml.configs = {} );\n // ---------------------\n const configKey = name.toUpperCase().replace( '-', '_' );\n if ( !window.webqit.oohtml.configs[ configKey ] ) {\n window.webqit.oohtml.configs[ configKey ] = {};\n const config = window.webqit.oohtml.configs[ configKey ];\n _merge( 2, config, $defaults, $config, realdom.meta( name ).json() );\n if ( window.webqitConfig.prefix ) {\n Object.keys( config ).forEach( main => {\n Object.keys( config[ main ] ).forEach( key => {\n if ( main === 'api' && typeof config[ main ][ key ] === 'string' ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }${ _toTitle( config[ main ][ key ] ) }`\n } else if ( [ 'attr', 'elements' ].includes( main ) && config[ main ][ key ]?.startsWith( 'data-' ) === false ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }-${ config[ main ][ key ] }`\n }\n } );\n } );\n }\n }\n // ---------------------\n return { config: window.webqit.oohtml.configs[ configKey ], realdom, window };\n}\n\nexport function getInternalAttrInteraction( node, attrName ) {\n\treturn _wq( node, 'internalAttrInteractions' ).get( attrName );\n}\nexport function internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\nexport function _compare( a, b, depth = 1, objectSizing = false ) {\n if ( depth && typeof a === 'object' && a && typeof b === 'object' && b && ( !objectSizing || Object.keys( a ).length === Object.keys( b ).length ) ) {\n for ( let key in a ) {\n if ( !_compare( a[ key ], b[ key ], depth - 1, objectSizing ) ) return false;\n }\n return true;\n }\n if ( Array.isArray( a ) && Array.isArray( b ) && a.length === b.length ) {\n return ( b = b.slice( 0 ).sort() ) && a.slice( 0 ).sort().every( ( valueA, i ) => valueA === b[ i ] );\n }\n return a === b;\n}\n\nexport function _splitOuter( str, delim ) {\n return [ ...str ].reduce( ( [ quote, depth, splits ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}\n\n// Unique ID generator\nexport const _uniqId = () => ( 0 | Math.random() * 9e6 ).toString( 36 );\n\n// Hash of anything generator\nconst hashTable = new Map;\nexport function _toHash( val ) {\n let hash;\n if ( !( hash = hashTable.get( val ) ) ) {\n hash = _uniqId();\n hashTable.set( val, hash );\n }\n return hash;\n}\n\n// Value of any hash\nexport function _fromHash( hash ) {\n let val;\n hashTable.forEach( ( _hash, _val ) => {\n if ( _hash === hash ) val = _val;\n } );\n return val;\n}", "\n/**\n * @imports\n */\nimport { env } from '../util.js';\n\nexport default function() {\n const { window } = env, { webqit } = window;\n if ( webqit.DOMContextRequestEvent ) return webqit.DOMContextRequestEvent;\n class DOMContextRequestEvent extends window.Event {\n /**\n * @constructor\n */\n constructor( ...args ) {\n const callback = args.pop();\n if ( typeof callback !== 'function' ) throw new Error( `Callback must be provided.` );\n const options = args.pop();\n if ( !options?.kind ) throw new Error( `\"options.kind\" must be specified.` );\n const eventNames = [ 'contextrequest', 'contextclaim' ];\n const type = args.pop() || eventNames[ 0 ];\n if ( !eventNames.includes( type ) ) throw new Error( `Invalid event type. Must be one of: ${ eventNames.join( ',' ) }` );\n // -------------\n const { kind, detail, targetContext, live, signal, diff, ...otherOpts } = options;\n super( type, { ...otherOpts, bubbles: otherOpts.bubbles !== false } );\n // -------------\n Object.defineProperty( this, 'callback', { get: () => callback } );\n Object.defineProperty( this, 'kind', { get: () => kind } );\n Object.defineProperty( this, 'targetContext', { get: () => targetContext } );\n Object.defineProperty( this, 'detail', { get: () => detail } );\n Object.defineProperty( this, 'live', { get: () => live } );\n Object.defineProperty( this, 'signal', { get: () => signal } );\n Object.defineProperty( this, 'diff', { get: () => diff } );\n Object.defineProperty( this, 'options', { get: () => otherOpts } );\n Object.defineProperty( this, 'meta', { value: {} } );\n }\n\n get target() { return super.target || this.meta.target; }\n get answered() { return this.meta.answered || false; }\n\n /**\n * @respondWith\n */\n respondWith( response ) {\n this.meta.answered = true;\n if ( this.diff ) {\n if ( '_prevValue' in this && this._prevValue === response ) return;\n Object.defineProperty( this, '_prevValue', { value: response, configurable: true } );\n }\n return this.callback( response );\n }\n }\n webqit.DOMContextRequestEvent = DOMContextRequestEvent;\n return DOMContextRequestEvent;\n}", "\n/**\n * @imports\n */\nimport { env } from '../util.js';\n\nexport default class DOMContextResponse extends AbortController {\n constructor( callback ) {\n super();\n callback( response => {\n const { window: { webqit: { Observer } } } = env;\n Observer.defineProperty( this, 'value', { value: response, configurable: true, enumerable: true } );\n }, this );\n }\n}", "\nexport default class DuplicateContextError extends Error {}", "\n/**\n * @imports\n */\nimport _DOMContextRequestEvent from './_DOMContextRequestEvent.js';\nimport DOMContextResponse from './DOMContextResponse.js';\nimport DOMContext from './DOMContext.js';\nimport DuplicateContextError from './DuplicateContextError.js';\nimport { _wq } from '../util.js';\n\nconst waitListMappings = new Map;\nexport default class DOMContexts {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _wq( host ).get( 'contexts::instance' ) || new this( host );;\n }\n\n /**\n * @constructor\n */\n constructor( host ) {\n _wq( host ).get( `contexts::instance` )?.dispose();\n _wq( host ).set( `contexts::instance`, this );\n const priv = { host, contexts: new Set };\n Object.defineProperty( this, '#', { get: () => priv } );\n }\n\n /**\n * @Symbol.iterator\n */\n [ Symbol.iterator ] () { return this[ '#' ].contexts[ Symbol.iterator ](); }\n\n /**\n * @length\n */\n get length() { return this[ '#' ].contexts.size; }\n\n /**\n * @find()\n */\n find( ...args ) {\n return [ ...this[ '#' ].contexts ].find( ctx => {\n if ( typeof args[ 0 ] === 'function' ) return args[ 0 ]( ctx );\n return ctx.constructor.kind === args[ 0 ] && ( !args[ 1 ] || ctx.detail === args[ 1 ] );\n } );\n }\n\n /**\n * @attach()\n */\n attach( ctx ) {\n if ( !( ctx instanceof DOMContext) ) throw new TypeError( `Context is not a valid DOMContext instance.` );\n if ( this.find( ctx.constructor.kind, ctx.detail ) ) {\n throw new DuplicateContextError( `Context of same kind \"${ ctx.constructor.kind }\"${ ctx.detail ? ` and detail \"${ ctx.detail }\"` : '' } already exists.` );\n }\n this[ '#' ].contexts.add( ctx );\n ctx.initialize( this[ '#' ].host );\n }\n\n /**\n * @detach()\n */\n detach( ctx ) {\n ctx.dispose( this[ '#' ].host );\n this[ '#' ].contexts.delete( ctx );\n }\n\n /**\n * @request()\n */\n request( ...args ) {\n return new DOMContextResponse( ( emitter, responseInstance ) => {\n if ( typeof args[ args.length - 1 ] !== 'function' ) {\n if ( !args[ args.length - 1 ] ) { args[ args.length - 1 ] = emitter; }\n else { args.push( emitter ); }\n }\n\n let options;\n if ( ( options = args.find( arg => typeof arg === 'object' && arg ) ) && options.live ) {\n if ( options.signal ) options.signal.addEventListener( 'abort', () => responseInstance.abort() );\n args[ args.indexOf( options ) ] = { ...options, signal: responseInstance.signal };\n }\n const event = new ( _DOMContextRequestEvent() )( ...args );\n this[ '#' ].host.dispatchEvent( event );\n } );\n }\n\n}", "\n/**\n * @imports\n */\nimport DOMContexts from './DOMContexts.js';\nimport { env } from '../util.js';\n\nexport default class DOMContext {\n\n /**\n * To be implemented by subclasses\n */\n static kind;\n\n /**\n * @createRequest\n */\n static createRequest() { return { kind: this.kind }; }\n \n /**\n * @constructor\n */\n constructor( detail = null ) {\n Object.defineProperty( this, 'detail', { get: () => detail } );\n Object.defineProperty( this, 'subscriptions', { value: new Set } );\n }\n\n /**\n * @configs\n */\n get configs() {\n const { window: { webqit: { oohtml: { configs } } } } = env;\n return configs;\n }\n\n /**\n * @name\n */\n get name() { return [ env.window.Document, env.window.ShadowRoot ].some( x => this.host instanceof x ) ? Infinity : this.host.getAttribute( this.configs.CONTEXT_API.attr.contextname ); }\n\n /**\n * @subscribed()\n */\n subscribed( event ) {}\n\n /**\n * @handle()\n */\n handle( event ) {}\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) {}\n\n /**\n * @matchEvent\n */\n matchEvent( event ) {\n return event.kind === this.constructor.kind\n && ( !event.targetContext || event.targetContext === this.name );\n }\n\n /**\n * @handleEvent()\n */\n handleEvent( event ) {\n if ( this.disposed || typeof event.respondWith !== 'function' ) return;\n if ( event.type === 'contextclaim' ) {\n if ( !( event.detail instanceof DOMContext ) || event.target === this.host ) return;\n const claims = new Set;\n this.subscriptions.forEach( subscriptionEvent => {\n if ( !event.target.contains( subscriptionEvent.target ) || !event.detail.matchEvent( subscriptionEvent ) ) return;\n this.subscriptions.delete( subscriptionEvent );\n this.unsubscribed( subscriptionEvent );\n claims.add( subscriptionEvent );\n } );\n if ( claims.size ) { return event.respondWith( claims ); }\n }\n if ( event.type === 'contextrequest' ) {\n if ( !this.matchEvent( event ) ) return;\n if ( event.live ) {\n this.subscriptions.add( event );\n this.subscribed( event );\n event.signal?.addEventListener( 'abort', () => {\n this.subscriptions.delete( event );\n this.unsubscribed( event );\n } );\n }\n event.stopPropagation();\n return this.handle( event );\n }\n }\n\n /**\n * @initialize()\n */\n initialize( host ) {\n this.host = host;\n this.disposed = false;\n host.addEventListener( 'contextrequest', this );\n host.addEventListener( 'contextclaim', this );\n const { value: claims } = DOMContexts.instance( host ).request( 'contextclaim', { kind: this.constructor.kind, detail: this } );\n claims?.forEach( subscriptionEvent => {\n this.subscriptions.add( subscriptionEvent );\n this.subscribed( subscriptionEvent );\n this.handle( subscriptionEvent );\n } );\n return this;\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n this.disposed = true;\n host.removeEventListener( 'contextrequest', this );\n host.removeEventListener( 'contextclaim', this );\n this.subscriptions.forEach( subscriptionEvent => {\n this.subscriptions.delete( subscriptionEvent );\n this.unsubscribed( subscriptionEvent );\n const { target } = subscriptionEvent;\n subscriptionEvent.meta.answered = false;\n target.dispatchEvent( subscriptionEvent );\n } );\n return this;\n }\n\n}", "\n/**\n * @imports\n */\nimport DOMContext from '../context-api/DOMContext.js';\nimport { env } from '../util.js';\n\nexport default class DOMNamingContext extends DOMContext {\n\n static kind = 'namespace';\n\n /**\n * @createRequest\n */\n static createRequest( detail = null ) {\n const request = super.createRequest();\n if ( detail?.startsWith( '@' ) ) {\n const [ targetContext, ...detail ] = detail.slice( 1 ).split( '/' ).map( s => s.trim() );\n request.targetContext = targetContext;\n request.detail = detail.join( '/' );\n } else { request.detail = detail; }\n return request;\n }\n\n /**\n * @namespaceObj\n */\n get namespaceObj() { return this.host[ this.configs.NAMESPACED_HTML.api.namespace ]; }\n\n /**\n * @handle()\n */\n handle( event ) {\n const { window: { webqit: { Observer } } } = env;\n // Any existing event.meta.controller? Abort!\n event.meta.controller?.abort();\n\n // Parse and translate detail\n if ( !( event.detail || '' ).trim() ) return event.respondWith( Observer.unproxy( this.namespaceObj ) );\n let path = ( event.detail || '' ).split( '/' ).map( x => x.trim() ).filter( x => x );\n if ( !path.length ) return event.respondWith();\n path = path.join( `/${ this.configs.NAMESPACED_HTML.api.namespace }/` )?.split( '/' ) || [];\n\n event.meta.controller = Observer.reduce( this.namespaceObj, path, Observer.get, descriptor => {\n if ( this.disposed ) return; // If already scheduled but aborted as in provider unmounting\n event.respondWith( descriptor.value );\n }, { live: event.live, signal: event.signal, descripted: true } );\n }\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) { event.meta.controller?.abort(); }\n}\n", "\n/**\n * @imports\n */\nimport DOMNamingContext from './DOMNamingContext.js';\nimport { _wq, _init, _splitOuter, _fromHash, _toHash, getInternalAttrInteraction, internalAttrInteraction } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'namespaced-html', $config, {\n\t\tattr: { namespace: 'namespace', lid: 'id', },\n\t\tapi: { namespace: 'namespace', },\n\t\ttokens: { lidrefPrefix: '~', lidrefSeparator: ':' },\n\t\ttarget: { className: ':target', eventName: ':target', scrolling: true },\n } );\n\tconfig.lidSelector = `[${ window.CSS.escape( config.attr.lid ) }]`;\n\tconfig.namespaceSelector = `[${ window.CSS.escape( config.attr.namespace ) }]`;\n window.webqit.DOMNamingContext = DOMNamingContext;\n exposeAPIs.call( window, config );\n realtime.call( window, config );\n}\n\n/**\n * @init\n * \n * @param Object config\n * \n * @return String\n */\nfunction lidUtil( config ) {\n\tconst { lidrefPrefix, lidrefSeparator, } = config.tokens;\n\treturn {\n\t\tescape( str, mode = 1 ) { return [ ...str ].map( x => !/\\w/.test( x ) ? ( mode === 2 ? `\\\\\\\\${ x }` : `\\\\${ x }` ) : x ).join( '' ); },\n\t\tlidrefPrefix( escapeMode = 0 ) { return escapeMode ? this.escape( lidrefPrefix, escapeMode ) : lidrefPrefix; },\n\t\tlidrefSeparator( escapeMode = 0 ) { return escapeMode ? this.escape( lidrefSeparator, escapeMode ) : lidrefSeparator; },\n\t\tisUuid( str, escapeMode = 0 ) { return str.startsWith( this.lidrefPrefix( escapeMode ) ) && str.includes( this.lidrefSeparator( escapeMode ) ); },\n\t\t//isLidref( str, escapeMode = 0 ) { return str.startsWith( this.lidrefPrefix( escapeMode ) ) && !str.includes( this.lidrefSeparator( escapeMode ) ); },\n\t\ttoUuid( hash, lid, escapeMode = 0 ) { return hash.endsWith( '-root' ) ? lid : `${ this.lidrefPrefix( escapeMode ) }${ hash }${ this.lidrefSeparator( escapeMode ) }${ lid }`; },\n\t\tuuidToId( str, escapeMode = 0 ) { return this.isUuid( str ) ? str.split( this.lidrefSeparator( escapeMode ) )[ 1 ] : str; },\n\t\tuuidToLidref( str, escapeMode = 0 ) { return this.isUuid( str ) ? `${ this.lidrefPrefix( escapeMode ) }${ str.split( this.lidrefSeparator( escapeMode ) )[ 1 ] }` : str; },\n\t}\n}\n\n/**\n * @rewriteSelector\n * \n * @param String selectorText\n * @param String namespaceUUID\n * @param String scopeSelector\n * @param Bool escapeMode\n * \n * @return String\n */\nexport function rewriteSelector( selectorText, namespaceUUID, scopeSelector = null, escapeMode = 0 ) {\n\tconst window = this, { webqit: { oohtml: { configs: { NAMESPACED_HTML: config } } } } = window;\n\tconst $lidUtil = lidUtil( config );\n\t// Match :scope and relative ID selector\n\tconst regex = new RegExp( `${ scopeSelector ? `:scope|` : '' }#(${ $lidUtil.lidrefPrefix( escapeMode + 1 ) })?([\\\\w]+${ $lidUtil.lidrefSeparator( escapeMode + 1 ) })?((?:[\\\\w-]|\\\\\\\\.)+)`, 'g' );\n\t// Parse potentially combined selectors individually and categorise into categories per whether they have :scope or not\n\tconst [ cat1, cat2 ] = _splitOuter( selectorText, ',' ).reduce( ( [ cat1, cat2 ], selector ) => {\n\t\t// The deal: match and replace\n\t\tlet quotesMatch, hadScopeSelector;\n\t\tselector = selector.replace( regex, ( match, lidrefPrefixMatch, lidrefSeparatorMatch, id, index ) => {\n\t\t\tif ( !quotesMatch ) { // Lazy: stuff\n\t\t\t\t// Match strings between quotes (single or double) and use that qualify matches above\n\t\t\t\t// The string: String.raw`She said, \"Hello, John. I\\\"m your friend.\" or \"you're he're\" 'f\\'\"j\\'\"f'jfjf`;\n\t\t\t\t// Should yield: `\"Hello, John. I\\\\\"m your friend.\"`, `\"you're he're\"`, `'f\\\\'\"j\\\\'\"f'`\n\t\t\t\tquotesMatch = [ ...selector.matchAll( /([\"'])(?:(?=(\\\\?))\\2.)*?\\1/g ) ];\n\t\t\t}\n\t\t\t// Qualify match\n\t\t\tif ( quotesMatch.some( q => index > q.index && index + match.length < q.index + q[ 0 ].length ) ) return match;\n\t\t\t// Replace :scope\n\t\t\tif ( match === ':scope' ) {\n\t\t\t\thadScopeSelector = true;\n\t\t\t\treturn scopeSelector;\n\t\t\t}\n\t\t\tconst isLidref = lidrefPrefixMatch && !lidrefSeparatorMatch;\n\t\t\tconst isUuid = lidrefPrefixMatch && lidrefSeparatorMatch;\t\t\t\n\t\t\tif ( isUuid ) {\n\t\t\t\treturn `#${ $lidUtil.escape( match.replace( '#', '' ), 1 ) }`;\n\t\t\t}\n\t\t\t// Rewrite relative ID selector\n\t\t\tif ( isLidref ) {\n\t\t\t\tif ( config.attr.lid === 'id' && namespaceUUID && !namespaceUUID.endsWith( '-root' ) ) {\n\t\t\t\t\treturn `#${ $lidUtil.toUuid( namespaceUUID, id, 1 ) }`;\n\t\t\t\t}\n\t\t\t\t// Fallback to attr-based\n\t\t\t}\n\t\t\t// Rewrite absolute ID selector\n\t\t\tlet rewrite;\n\t\t\tif ( config.attr.lid === 'id' ) {\n\t\t\t\trewrite = `:is(#${ id },[id^=\"${ $lidUtil.lidrefPrefix( escapeMode ) }\"][id$=\"${ $lidUtil.lidrefSeparator( escapeMode ) }${ id }\"])`;\n\t\t\t} else {\n\t\t\t\trewrite = `:is(#${ id },[${ window.CSS.escape( config.attr.lid ) }=\"${ id }\"])`;\n\t\t\t}\n\t\t\treturn isLidref ? `:is(${ rewrite }):not(${ scopeSelector ? scopeSelector + ' ' : '' }${ config.namespaceSelector } *)` : rewrite;\n\t\t} );\n\t\t// Category 2 has :scope and category 1 does not\n\t\treturn hadScopeSelector ? [ cat1, cat2.concat( selector ) ] : [ cat1.concat( selector ), cat2 ];\n\t}, [ [], [] ] );\n\t// Do the upgrade\n\tlet newSelectorText;\n\tif ( scopeSelector && cat1.length ) {\n\t\tnewSelectorText = [ cat1.length > 1 ? `${ scopeSelector } :is(${ cat1.join( ', ' ) })` : `${ scopeSelector } ${ cat1[ 0 ] }`, cat2.join( ', ' ) ].filter( x => x ).join( ', ' );\n\t} else {\n\t\tnewSelectorText = [ ...cat1, ...cat2 ].join( ', ' );\n\t}\n\treturn newSelectorText;\n}\n\n/**\n * @param Element node\n *\n * @return Object\n */\nexport function getOwnNamespaceObject( node ) {\n\tconst window = this;\n\tif ( !_wq( node ).has( 'namespace' ) ) {\n\t\tconst namespaceObj = Object.create( null );\n\t\t_wq( node ).set( 'namespace', namespaceObj );\n\t\tconst isDocumentRoot = [ window.Document, window.ShadowRoot ].some( x => node instanceof x );\n\t\tObject.defineProperty( namespaceObj, Symbol.toStringTag, { get() {\n\t\t\treturn isDocumentRoot ? 'RootNamespaceRegistry' : 'NamespaceRegistry';\n\t\t} } );\n\t}\n\treturn _wq( node ).get( 'namespace' );\n}\n\n/**\n * @param Element node\n * @param Bool forID\n *\n * @return Object\n */\nexport function getOwnerNamespaceObject( node, forID = false ) {\n\tconst window = this, { webqit: { oohtml: { configs: { NAMESPACED_HTML: config } } } } = window;\n\tconst isDocumentRoot = [ window.Document, window.ShadowRoot ].some( x => node instanceof x );\n\treturn getOwnNamespaceObject.call( window, isDocumentRoot ? node : ( ( forID ? node.parentNode : node )?.closest/*can be documentFragment when Shadow DOM*/?.( config.namespaceSelector ) || node.getRootNode() ) );\n}\n\n/**\n * @param Object namespaceObj\n *\n * @return String\n */\nexport function getNamespaceUUID( namespaceObj ) {\n\tconst isDocumentRoot = Object.prototype.toString.call( namespaceObj ) === '[object RootNamespaceRegistry]';\n return ( _fromHash( namespaceObj ) || _toHash( namespaceObj ) ) + ( isDocumentRoot ? '-root' : '' );\n}\n\n/**\n * Exposes Namespaced HTML with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this, { webqit: { Observer } } = window;\n // The Namespace API\n [ window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = prototype === window.Document.prototype ? 'Document' : ( prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element' );\n if ( config.api.namespace in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.namespace }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.namespace, { get: function() {\n\t\t\treturn Observer.proxy( getOwnNamespaceObject.call( window, this ) );\n\t\t} } );\n } );\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { Observer, realdom, oohtml: { configs }, DOMNamingContext } } = window;\n\t\n\t// ------------\n\t// APIS\n // ------------\n\t// See https://wicg.github.io/aom/aria-reflection-explainer.html & https://github.com/whatwg/html/issues/3515 for the ARIA refelction properties idea\n\t// See https://www.w3.org/TR/wai-aria-1.1/#attrs_relationships for the relational ARIA attributes\n\tconst idRefsAttrs = [ 'aria-owns', 'aria-controls', 'aria-labelledby', 'aria-describedby', 'aria-flowto', ];\n\tconst idRefAttrs = [ 'for', 'list', 'form', 'aria-activedescendant', 'aria-details', 'aria-errormessage', ];\n\tconst attrList = [ config.attr.lid, ...idRefsAttrs, ...idRefAttrs ];\n\tconst relMap = { id: 'id'/* just in case it's in attrList */, for: 'htmlFor', 'aria-owns': 'ariaOwns', 'aria-controls': 'ariaControls', 'aria-labelledby': 'ariaLabelledBy', 'aria-describedby': 'ariaDescribedBy', 'aria-flowto': 'ariaFlowto', 'aria-activedescendant': 'ariaActiveDescendant', 'aria-details': 'ariaDetails', 'aria-errormessage': 'ariaErrorMessage' };\n\tconst $lidUtil = lidUtil( config );\n\tconst uuidsToLidrefs = ( node, attrName, getter ) => {\n\t\tif ( !getInternalAttrInteraction( node, attrName ) && _wq( node, 'attrOriginals' ).has( attrName ) ) {\n\t\t\treturn _wq( node, 'attrOriginals' ).get( attrName );\n\t\t}\n\t\tconst value = getter();\n\t\tif ( getInternalAttrInteraction( node, attrName ) ) return value;\n\t\treturn value && value.split( ' ' ).map( x => ( x = x.trim() ) && ( attrName === config.attr.lid ? $lidUtil.uuidToId : $lidUtil.uuidToLidref ).call( $lidUtil, x ) ).join( ' ' );\n\t};\n\n\t// Intercept getElementById()\n\tconst getElementByIdDescr = Object.getOwnPropertyDescriptor( window.Document.prototype, 'getElementById' );\n\tObject.defineProperty( window.Document.prototype, 'getElementById', { ...getElementByIdDescr, value( id ) {\n\t\treturn this.querySelector( `#${ id }` ); // To be rewritten at querySelector()\n\t} } );\n\t// Intercept querySelector() and querySelectorAll()\n\tfor ( const queryApi of [ 'querySelector', 'querySelectorAll' ] ) {\n\t\tfor ( nodeApi of [ window.Document, window.Element ] ) {\n\t\t\tconst querySelectorDescr = Object.getOwnPropertyDescriptor( nodeApi.prototype, queryApi );\n\t\t\tObject.defineProperty( nodeApi.prototype, queryApi, { ...querySelectorDescr, value( selector ) {\n\t\t\t\treturn querySelectorDescr.value.call( this, rewriteSelector.call( window, selector, getNamespaceUUID( getOwnNamespaceObject.call( window, this ) ) ) );\n\t\t\t} } );\n\t\t}\n\t}\n\t// Intercept getAttribute()\n\tconst getAttributeDescr = Object.getOwnPropertyDescriptor( window.Element.prototype, 'getAttribute' );\n\tObject.defineProperty( window.Element.prototype, 'getAttribute', { ...getAttributeDescr, value( attrName ) {\n\t\tconst getter = () => getAttributeDescr.value.call( this, attrName );\n\t\treturn attrList.includes( attrName ) && !_wq( this, 'lock' ).get( attrName ) ? uuidsToLidrefs( this, attrName, getter ) : getter();\n\t} } );\n\t// Hide implementation details on the Attr node too.\n\tconst propertyDescr = Object.getOwnPropertyDescriptor( window.Attr.prototype, 'value' );\n\tObject.defineProperty( window.Attr.prototype, 'value', { ...propertyDescr, get() {\n\t\tconst getter = () => propertyDescr.get.call( this );\n\t\treturn attrList.includes( this.name ) ? uuidsToLidrefs( this.ownerElement, this.name, getter ) : getter();\n\t} } );\n\tconst propertyDescr2 = Object.getOwnPropertyDescriptor( window.Node.prototype, 'nodeValue' );\n\tObject.defineProperty( window.Node.prototype, 'nodeValue', { ...propertyDescr2, get() {\n\t\tconst getter = () => propertyDescr2.get.call( this );\n\t\treturn this instanceof window.Attr && attrList.includes( this.name ) ? uuidsToLidrefs( this.ownerElement, this.name, getter ) : getter();\n\t} } );\n\t// These APIs should return LIDREFS minus the hash part\n\tfor ( const attrName of attrList ) {\n\t\tif ( !( attrName in relMap ) ) continue;\n\t\tconst domApis = attrName === 'for' ? [ window.HTMLLabelElement, window.HTMLOutputElement ] : [ window.Element ];\n\t\tfor ( const domApi of domApis ) {\n\t\t\tconst propertyDescr = Object.getOwnPropertyDescriptor( domApi.prototype, relMap[ attrName ] );\n\t\t\tif ( !propertyDescr ) continue;\n\t\t\tObject.defineProperty( domApi.prototype, relMap[ attrName ], { ...propertyDescr, get() {\n\t\t\t\tconst getter = () => propertyDescr.get.call( this, attrName );\n\t\t\t\treturn uuidsToLidrefs( this, attrName, getter );\n\t\t\t} } );\n\t\t}\n\t}\n\tif ( config.attr.lid !== 'id' ) {\n\t\t// Reflect the custom [config.attr.lid] attribute\n\t\tObject.defineProperty( window.Element.prototype, config.attr.lid, { configurable: true, enumerable: true, get() {\n\t\t\treturn this.getAttribute( config.attr.lid );\n\t\t}, set( value ) {\n\t\t\treturn this.setAttribute( config.attr.lid, value );\n\t\t} } );\n\t}\n\n\t// ------------\n // LOCAL IDS & IDREFS\n // ------------\n\tconst attrChange = ( entry, attrName, value, callback ) => {\n\t\treturn internalAttrInteraction( entry, attrName, () => {\n\t\t\tif ( typeof value === 'function' ) value = value();\n\t\t\treturn callback( value );\n\t\t} );\n\t};\n\tconst setupBinding = ( entry, attrName, value, newNamespaceObj = null ) => {\n\t\tattrChange( entry, attrName, value, value => {\n\t\t\tconst isLidAttr = attrName === config.attr.lid;\n\t\t\tconst namespaceObj = newNamespaceObj || getOwnerNamespaceObject.call( window, entry, isLidAttr );\n\t\t\tconst namespaceUUID = getNamespaceUUID( namespaceObj );\n\t\t\tif ( isLidAttr ) {\n\t\t\t\tconst id = $lidUtil.uuidToId( value );\n\t\t\t\tif ( Observer.get( namespaceObj, id ) !== entry ) {\n\t\t\t\t\tconst uuid = $lidUtil.toUuid( namespaceUUID, id );\n\t\t\t\t\tif ( uuid !== value ) { entry.setAttribute( 'id', uuid ); }\n\t\t\t\t\tObserver.set( namespaceObj, id, entry );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t_wq( entry, 'attrOriginals' ).set( attrName, value ); // Save original before rewrite\n\t\t\t\tconst newAttrValue = value.split( ' ' ).map( idref => ( idref = idref.trim() ) && $lidUtil.isUuid( idref ) ? idref : $lidUtil.toUuid( namespaceUUID, idref ) ).join( ' ' );\n\t\t\t\tentry.setAttribute( attrName, newAttrValue );\n\t\t\t\t_wq( namespaceObj ).set( 'idrefs', _wq( namespaceObj ).get( 'idrefs' ) || new Set );\n\t\t\t\t_wq( namespaceObj ).get( 'idrefs' ).add( entry );\n\t\t\t}\n\t\t} );\n\t};\n\tconst cleanupBinding = ( entry, attrName, oldValue, prevNamespaceObj = null ) => {\n\t\tattrChange( entry, attrName, oldValue, oldValue => {\n\t\t\tconst isLidAttr = attrName === config.attr.lid;\n\t\t\tconst namespaceObj = prevNamespaceObj || getOwnerNamespaceObject.call( window, entry, isLidAttr );\n\t\t\tif ( isLidAttr ) {\n\t\t\t\tconst id = $lidUtil.uuidToId( oldValue );\n\t\t\t\tif ( Observer.get( namespaceObj, id ) === entry ) {\n\t\t\t\t\tObserver.deleteProperty( namespaceObj, id );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst newAttrValue = _wq( entry, 'attrOriginals' ).get( attrName );// oldValue.split( ' ' ).map( lid => ( lid = lid.trim() ) && $lidUtil.uuidToLidref( lid ) ).join( ' ' );\n\t\t\t\tif ( entry.hasAttribute( attrName ) ) entry.setAttribute( attrName, newAttrValue );\n\t\t\t\t_wq( namespaceObj ).get( 'idrefs' )?.delete( entry );\n\t\t\t}\n\t\t} );\n\t};\n\n // ------------\n // NAMESPACE\n // ------------\n realdom.realtime( window.document ).query( config.namespaceSelector, record => {\n\t\tconst reAssociate = ( entry, attrName, oldNamespaceObj, newNamespaceObj ) => {\n\t\t\tif ( !entry.hasAttribute( attrName ) ) return;\n\t\t\tconst attrValue = () => entry.getAttribute( attrName );\n\t\t\tcleanupBinding( entry, attrName, attrValue/* Current resolved value as-is */, oldNamespaceObj );\n\t\t\tif ( entry.isConnected ) { setupBinding( entry, attrName, _wq( entry, 'attrOriginals' ).get( attrName )/* Saved original value */ || attrValue/* Lest it's ID */, newNamespaceObj ); }\n\t\t};\n record.exits.forEach( entry => {\n\t\t\tif ( entry.isConnected ) {\n\t\t\t\tconst namespaceObj = getOwnNamespaceObject.call( window, entry );\n\t\t\t\t// Detach ID and IDREF associations\n\t\t\t\tfor ( const node of new Set( [ ...Object.values( namespaceObj ), ...( _wq( namespaceObj ).get( 'idrefs' ) || [] ) ] ) ) {\n\t\t\t\t\tfor ( const attrName of attrList ) { reAssociate( node, attrName, namespaceObj ); }\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Detach ID associations\n\t\t\tconst contextsApi = entry[ configs.CONTEXT_API.api.contexts ];\n\t\t\tconst ctx = contextsApi.find( DOMNamingContext.kind );\n\t\t\t// Detach namespace instance\n\t\t\tif ( ctx ) { contextsApi.detach( ctx ); }\n } );\n record.entrants.forEach( entry => {\n\t\t\t// Claim ID and IDREF associations\n\t\t\tlet newSuperNamespaceObj;\n\t\t\tconst superNamespaceObj = getOwnerNamespaceObject.call( window, entry, true );\n\t\t\tfor ( const node of new Set( [ ...Object.values( superNamespaceObj ), ...( _wq( superNamespaceObj ).get( 'idrefs' ) || [] ) ] ) ) {\n\t\t\t\tif ( ( newSuperNamespaceObj = getOwnerNamespaceObject.call( window, node, true ) ) === superNamespaceObj ) continue;\n\t\t\t\tfor ( const attrName of attrList ) { reAssociate( node, attrName, superNamespaceObj, newSuperNamespaceObj ); }\n\t\t\t}\n\t\t\t// Attach namespace instance\n\t\t\tconst contextsApi = entry[ configs.CONTEXT_API.api.contexts ];\n\t\t\tif ( !contextsApi.find( DOMNamingContext.kind ) ) { contextsApi.attach( new DOMNamingContext ); }\n } );\n }, { id: 'namespace-html:namespace', live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true, eventDetails: true } );\n\n\t// DOM realtime\n\trealdom.realtime( window.document ).query( `[${ attrList.map( attrName => window.CSS.escape( attrName ) ).join( '],[' ) }]`, record => {\n\t\t// We do some caching to prevent redundanct lookups\n\t\tconst namespaceNodesToTest = { forID: new Map, forOther: new Map, };\n\t\tfor ( const attrName of attrList ) {\n\t\t\t// Point to the right cache\n\t\t\tconst _namespaceNodesToTest = attrName === config.attr.lid ? namespaceNodesToTest.forID : namespaceNodesToTest.forOther;\n\t\t\trecord.exits.forEach( entry => {\n\t\t\t\tif ( !entry.hasAttribute( attrName ) ) return;\n\t\t\t\t// Point to the right namespace node\n\t\t\t\tlet namespaceNodeToTest = _namespaceNodesToTest.get( entry );\n\t\t\t\tif ( typeof namespaceNodeToTest === 'undefined' ) {\n\t\t\t\t\tnamespaceNodeToTest = ( attrName === config.attr.lid ? entry.parentNode : entry )?.closest/*can be documentFragment when Shadow DOM*/?.( config.namespaceSelector ) || entry.getRootNode().host;\n\t\t\t\t\t_namespaceNodesToTest.set( entry, namespaceNodeToTest );\n\t\t\t\t}\n\t\t\t\tif ( namespaceNodeToTest && !namespaceNodeToTest.isConnected ) return;\n\t\t\t\tcleanupBinding( entry, attrName, () => entry.getAttribute( attrName )/* Current resolved value as-is */ );\n\t\t\t} );\n\t\t\trecord.entrants.forEach( entry => {\n\t\t\t\tif ( !entry.hasAttribute( attrName ) ) return;\n\t\t\t\tsetupBinding( entry, attrName, () => entry.getAttribute( attrName )/* Raw value (as-is) that will be saved as original */ );\n\t\t\t} );\n\t\t}\n\t\tnamespaceNodesToTest.forID.clear();\n\t\tnamespaceNodesToTest.forOther.clear();\n\t}, { id: 'namespace-html:attrs', live: true, subtree: 'cross-roots', timing: 'sync' } );\n\t// Attr realtime\n\trealdom.realtime( window.document, 'attr' ).observe( attrList, records => {\n\t\tfor ( const record of records ) {\n\t\t\tif ( record.oldValue ) { cleanupBinding( record.target, record.name, record.oldValue/* Current resolved value as-is */ ); }\n\t\t\tif ( record.value ) { setupBinding( record.target, record.name, record.value/* Raw value (as-is) that will be saved as original */ ); }\n\t\t}\n\t}, { id: 'namespace-html:attr(attrs)', subtree: 'cross-roots', timing: 'sync', newValue: true, oldValue: true } );\n\n // ------------\n\t// TARGETS\n // ------------\n\tlet prevTarget;\n\tconst activateTarget = () => {\n\t\tif ( !window.location.hash?.startsWith( `#${ $lidUtil.lidrefPrefix() }` ) ) return;\n\t\tconst path = window.location.hash?.substring( `#${ $lidUtil.lidrefPrefix() }`.length ).split( '/' ).map( s => s.trim() ).filter( s => s ) || [];\n\t\tconst currTarget = path.reduce( ( prev, segment ) => prev && prev[ config.api.namespace ][ segment ], window.document );\n\t\tif ( prevTarget && config.target.className ) { prevTarget.classList.toggle( config.target.className, false ); }\n\t\tif ( currTarget && currTarget !== window.document ) {\n\t\t\tif ( config.target.className ) { currTarget.classList.toggle( config.target.className, true ); }\n\t\t\tif ( config.target.eventName ) { currTarget.dispatchEvent( new window.CustomEvent( config.target.eventName ) ); }\n\t\t\tif ( config.target.scrolling && path.length > 1 ) { currTarget.scrollIntoView(); }\n\t\t\tprevTarget = currTarget;\n\t\t}\n\t};\n\t// \"hash\" realtime\n\twindow.addEventListener( 'hashchange', activateTarget );\n\trealdom.ready( activateTarget );\n\t// ----------------\n}\n", "\n/**\n * @imports\n */\nimport { resolveParams } from '@webqit/quantum-js/params';\nimport { _wq, _init, _toHash, _fromHash } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init({ advanced = {}, ...$config }) {\n const { config, window } = _init.call( this, 'scoped-js', $config, {\n script: { retention: 'retain', mimeTypes: 'module|text/javascript|application/javascript', timing: 'auto' },\n api: { scripts: 'scripts' },\n advanced: resolveParams(advanced),\n } );\n const customTypes = Array.isArray( config.script.mimeTypes ) ? config.script.mimeTypes : config.script.mimeTypes.split( '|' ).filter( t => t );\n config.scriptSelector = customTypes.map( t => `script[type=\"${ window.CSS.escape( t ) }\"]:not([oohtmlignore])` ).concat(`script:not([type])`).join( ',' );\n window.webqit.oohtml.Script = {\n compileCache: [ new Map, new Map, ],\n execute: execute.bind( window, config ),\n };\n exposeAPIs.call( window, config );\n realtime.call( window, config );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this, scriptsMap = new Map;\n if ( config.api.scripts in window.Element.prototype ) { throw new Error( `The \"Element\" class already has a \"${ config.api.scripts }\" property!` ); }\n [ window.ShadowRoot.prototype, window.Element.prototype ].forEach( proto => {\n Object.defineProperty( proto, config.api.scripts, { get: function() {\n if ( !scriptsMap.has( this ) ) { scriptsMap.set( this, [] ); }\n return scriptsMap.get( this );\n }, } );\n } );\n Object.defineProperties( window.HTMLScriptElement.prototype, {\n scoped: {\n configurable: true,\n get() { return this.hasAttribute( 'scoped' ); },\n set( value ) { this.toggleAttribute( 'scoped', value ); },\n },\n quantum: {\n configurable: true,\n get() { return this.hasAttribute( 'quantum' ); },\n set( value ) { this.toggleAttribute( 'quantum', value ); },\n },\n } );\n}\n\n// Script runner\nasync function execute( config, execHash ) {\n const window = this, { realdom } = window.webqit;\n const exec = _fromHash( execHash );\n if ( !exec ) throw new Error( `Argument must be a valid exec hash.` );\n const { script, compiledScript, thisContext } = exec;\n // Honour retention flag\n if ( config.script.retention === 'dispose' ) {\n script.remove();\n } else if ( config.script.retention === 'hidden' ) {\n script.textContent = `\"source hidden\"`;\n } else {\n script.textContent = await compiledScript.toString();\n }\n // Execute and save state\n const varScope = script.scoped ? thisContext : script.getRootNode();\n if ( !_wq( varScope ).has( 'scriptEnv' ) ) {\n _wq( varScope ).set( 'scriptEnv', Object.create( null ) );\n }\n const state = await ( await compiledScript.bind( thisContext, _wq( varScope ).get( 'scriptEnv' ) ) ).execute();\n if ( script.quantum ) { Object.defineProperty( script, 'state', { value: state } ); }\n realdom.realtime( window.document ).observe( script, () => {\n if ( script.quantum ) { state.dispose(); }\n if ( thisContext instanceof window.Element ) { thisContext[ config.api.scripts ]?.splice( thisContext[ config.api.scripts ].indexOf( script, 1 ) ); }\n }, { id: 'scoped-js:script-exits', subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const inBrowser = Object.getOwnPropertyDescriptor( globalThis, 'window' )?.get?.toString().includes( '[native code]' ) ?? false;\n const window = this, { webqit: { oohtml, realdom } } = window;\n if ( !window.HTMLScriptElement.supports ) { window.HTMLScriptElement.supports = type => [ 'text/javascript', 'application/javascript' ].includes( type ); }\n const handled = new WeakSet;\n realdom.realtime( window.document ).query( config.scriptSelector, record => {\n record.entrants.forEach( script => {\n if ( handled.has( script ) || (!inBrowser && !script.hasAttribute('ssr')) ) return;\n // Do compilation\n const compiledScript = compileScript.call( window, config, script );\n if ( !compiledScript ) return;\n handled.add( script );\n // Run now!!!\n const thisContext = script.scoped ? script.parentNode || record.target : ( script.type === 'module' ? undefined : window );\n if ( script.scoped ) { thisContext[ config.api.scripts ].push( script ); }\n const execHash = _toHash( { script, compiledScript, thisContext } );\n const manualHandling = record.type === 'query' || ( script.type && !window.HTMLScriptElement.supports( script.type ) ) || script.getAttribute('data-handling') === 'manual';\n if ( manualHandling || config.script.timing === 'manual' ) { oohtml.Script.execute( execHash ); } else {\n script.textContent = `webqit.oohtml.Script.execute( '${ execHash }' );`;\n }\n } );\n }, { id: 'scoped-js:script-entries', live: true, subtree: 'cross-roots', timing: 'intercept', generation: 'entrants', eventDetails: true } );\n // ---\n}\n\nfunction compileScript( config, script ) {\n const window = this, { webqit: { oohtml, QuantumScript, AsyncQuantumScript, QuantumModule } } = window;\n const textContent = ( script._ = script.textContent.trim() ) && script._.startsWith( '/*@oohtml*/if(false){' ) && script._.endsWith( '}/*@oohtml*/' ) ? script._.slice( 21, -12 ) : script.textContent;\n if ( !textContent.trim().length ) return;\n const sourceHash = _toHash( textContent );\n const compileCache = oohtml.Script.compileCache[ script.quantum ? 0 : 1 ];\n let compiledScript;\n if ( !( compiledScript = compileCache.get( sourceHash ) ) ) {\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n compiledScript = new ( script.type === 'module' ? QuantumModule : ( QuantumScript || AsyncQuantumScript ) )( textContent, {\n exportNamespace: `#${ script.id }`,\n fileName: `${ window.document.url?.split( '#' )?.[ 0 ] || '' }#${ script.id }`,\n parserParams: { ...parserParams, executionMode: script.quantum && 'QuantumProgram' || 'RegularProgram' },\n compilerParams,\n runtimeParams,\n } );\n compileCache.set( sourceHash, compiledScript );\n }\n return compiledScript;\n}\n\nexport function idleCompiler( node ) {\n const window = this, { webqit: { oohtml: { configs: { SCOPED_JS: config } } } } = window;\n [ ...( node?.querySelectorAll( config.scriptSelector ) || [] ) ].forEach( script => {\n compileScript.call( window, config, script );\n } );\n}", "import { resolveParams } from '@webqit/quantum-js/params';\nimport { xpathQuery } from '@webqit/realdom/src/realtime/Util.js';\nimport { _wq, _init, _splitOuter } from '../util.js';\n\n/**\n * Initializes DOM Parts.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'data-binding', $config, {\n attr: { render: 'render', itemIndex: 'data-key' },\n tokens: { nodeType: 'processing-instruction', tagStart: '?{', tagEnd: '}?', stateStart: '; [=', stateEnd: ']' },\n advanced: resolveParams({ runtimeParams: { spec: { handler: e => {} } } }),\n } );\n ( { CONTEXT_API: config.CONTEXT_API, BINDINGS_API: config.BINDINGS_API, HTML_IMPORTS: config.HTML_IMPORTS } = window.webqit.oohtml.configs );\n config.attrSelector = `[${ window.CSS.escape( config.attr.render ) }]`;\n const discreteBindingsMatch = ( start, end ) => {\n const starting = `starts-with(., \"${ start }\")`;\n const ending = `substring(., string-length(.) - string-length(\"${ end }\") + 1) = \"${ end }\"`;\n return `${ starting } and ${ ending }`;\n }\n config.discreteBindingsSelector = `comment()[${ discreteBindingsMatch( config.tokens.tagStart, config.tokens.tagEnd ) }]`;\n realtime.call( window, config );\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { realdom } } = window;\n\t// ----------------\n /**\n * For an element, render should happen first\n <div render=\"\">\n <?{ content }?>\n </div>\n */\n realdom.realtime( window.document ).query( config.attrSelector, record => {\n cleanup.call( this, ...record.exits );\n setTimeout(() => {\n mountInlineBindings.call( window, config, ...record.entrants );\n }, 0);\n }, { id: 'data-binding:attr', live: true, subtree: 'cross-roots', timing: 'sync', eventDetails: true, staticSensitivity: true } );\n realdom.realtime( window.document ).query( `(${ config.discreteBindingsSelector })`, record => {\n setTimeout(() => {\n cleanup.call( this, ...record.exits );\n mountDiscreteBindings.call( window, config, ...record.entrants );\n }, 0);\n }, { id: 'data-binding:descrete', live: true, subtree: 'cross-roots', timing: 'sync' } );\n}\n\nfunction createDynamicScope( config, root ) {\n const { webqit: { realdom, Observer, DOMBindingsContext } } = this;\n if ( _wq( root ).has( 'data-binding' ) ) return _wq( root ).get( 'data-binding' );\n const scope = Object.create( null ), abortController = new AbortController;\n scope[ '$exec__' ] = ( target, prop, ...args ) => {\n const exec = () => {\n try { target[ prop ]( ...args ); }\n catch( e ) { throw new Error( `Error executing \"${ prop }()\": ${ e.message } at ${ e.cause }` ); }\n };\n exec();\n };\n scope[ '$assign__' ] = ( target, prop, val ) => {\n const exec = () => {\n try { target[ prop ] = val; }\n catch( e ) { throw new Error( `Error executing \"${ prop } = ${ val }\": ${ e.message } at ${ e.cause }` ); }\n };\n exec();\n };\n Observer.intercept( scope, {\n get: ( e, recieved, next ) => {\n if ( !( e.key in scope ) ) {\n const request = { ...DOMBindingsContext.createRequest( e.key ), live: true, signal: abortController.signal };\n root[ config.CONTEXT_API.api.contexts ].request( request, value => {\n Observer.set( scope, e.key, value );\n } );\n }\n return next( scope[ e.key ] ?? ( e.key in globalThis ? globalThis[ e.key ] : undefined ) );\n },\n has: ( e, recieved, next ) => { return next( true ); }\n } );\n const instance = { scope, abortController, bindings: new Map };\n _wq( root ).set( 'data-binding', instance );\n return instance;\n}\n\nfunction cleanup( ...entries ) {\n for ( const node of entries ) {\n const root = node.nodeName === '#text' ? node.parentNode : node;\n const { bindings, abortController } = _wq( root ).get( 'data-binding' ) || {};\n if ( !bindings?.has( node ) ) return;\n bindings.get( node ).state.dispose();\n bindings.get( node ).signals?.forEach( s => s.abort() );\n bindings.delete( node );\n if ( !bindings.size ) {\n abortController.abort();\n _wq( root ).delete( 'data-binding' );\n }\n }\n}\n\nfunction patternMatch( config, str ) {\n const tagStart = config.tokens.tagStart.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const tagEnd = config.tokens.tagEnd.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const stateStart = config.tokens.stateStart.split( '' ).map( x => x === ' ' ? `(?:\\\\s+)?` : `\\\\${ x }` ).join( '' );\n const stateEnd = config.tokens.stateEnd.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const pattern = `^${ tagStart }(.*?)(?:${ stateStart }(\\\\d+)${ stateEnd }(?:\\\\s+)?)?${ tagEnd }$`;\n const [ /*raw*/, expr, span ] = str.match( new RegExp( pattern ) );\n return { raw: str, expr, span: parseInt( span ?? 0 ) };\n}\n\nasync function mountDiscreteBindings( config, ...entries ) {\n const window = this;\n const instances = entries.reduce( ( instances, node ) => {\n if ( node.isBound ) return instances;\n const template = patternMatch( config, node.nodeValue );\n let textNode = node;\n if ( template.span ) {\n textNode = node.nextSibling;\n if ( textNode?.nodeName !== '#text' || textNode.nodeValue.length < template.span ) return instances;\n if ( textNode.nodeValue.length > template.span ) { textNode.splitText( template.span ); }\n } else {\n textNode = node.ownerDocument.createTextNode( '' );\n node.after( textNode );\n }\n textNode.isBound = true;\n let anchorNode = node;\n if ( window.webqit.env !== 'server' ) {\n anchorNode.remove();\n anchorNode = null;\n }\n return instances.concat( { textNode, template, anchorNode } );\n }, [] );\n\n for ( const { textNode, template, anchorNode } of instances ) {\n const compiled = compileDiscreteBindings.call( window, config, template.expr );\n const { scope, bindings } = createDynamicScope.call( this, config, textNode.parentNode );\n Object.defineProperty( textNode, '$oohtml_internal_databinding_anchorNode', { value: anchorNode, configurable: true } );\n try {\n bindings.set( textNode, { state: await ( await compiled.bind( textNode, scope ) ).execute(), } );\n } catch( e ) {\n console.log(e);\n }\n }\n}\n\nconst discreteParseCache = new Map;\nfunction compileDiscreteBindings( config, str ) {\n if ( discreteParseCache.has( str ) ) return discreteParseCache.get( str );\n let source = `let content = ((${ str }) ?? '') + '';`;\n source += `$assign__(this, 'nodeValue', content);`;\n source += `if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', \"${ config.tokens.tagStart }${ escDouble( str ) }${ config.tokens.stateStart }\" + content.length + \"${ config.tokens.stateEnd } ${ config.tokens.tagEnd }\"); }`;\n const { webqit: { QuantumModule } } = this;\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n const compiled = new QuantumModule( source, { parserParams, compilerParams, runtimeParams } );\n discreteParseCache.set( str, compiled );\n return compiled;\n}\n\nasync function mountInlineBindings( config, ...entries ) {\n for ( const node of entries ) {\n const compiled = compileInlineBindings.call( this, config, node.getAttribute( config.attr.render ) );\n const { scope, bindings } = createDynamicScope.call( this, config, node );\n const signals = [];\n Object.defineProperty( node, '$oohtml_internal_databinding_signals', { value: signals, configurable: true } );\n try {\n bindings.set( node, { signals, state: await ( await compiled.bind( node, scope ) ).execute(), } );\n } catch( e ) {\n console.log(e);\n }\n }\n}\n\nconst inlineParseCache = new Map;\nfunction compileInlineBindings( config, str ) {\n if ( inlineParseCache.has( str ) ) return inlineParseCache.get( str );\n const validation = {};\n let $event_i = -1;\n const source = _splitOuter( str, ';' ).map( str => {\n const [ left, right ] = _splitOuter( str, ':' ).map( x => x.trim() );\n const directive = left[ 0 ], param = left.slice( 1 ).trim();\n const arg = `(${ right })`, $arg = `(${ arg } ?? '')`;\n // CSS\n if ( directive === '&' ) {\n if ( param.startsWith( '--' ) ) return `$exec__(this.style, 'setProperty', \"${ escDouble( param ) }\", ${ $arg });`;\n return `$assign__(this.style, \"${ escDouble( param ) }\", ${ $arg });`;\n }\n // Class list\n if ( directive === '%' ) return `$exec__(this.classList, 'toggle', \"${ escDouble( param ) }\", !!${ arg });`;\n // Attribute\n if ( directive === '~' ) {\n if ( param.startsWith( '?' ) ) return `$exec__(this, 'toggleAttribute', \"${ escDouble( param.substring( 1 ).trim() ) }\", !!${ arg });`;\n return `$exec__(this, 'setAttribute', \"${ escDouble( param ) }\", ${ $arg });`;\n }\n // Structure\n if ( directive === '#' ) {\n if ( validation[ param ] ) throw new Error( `Duplicate binding: ${ left }.` );\n validation[ param ] = true;\n if ( param === 'text' ) return `$assign__(this, 'textContent', ${ $arg });`;\n if ( param === 'html' ) return `$assign__(this, 'innerHTML', ${ $arg });`;\n if ( param === 'items' ) {\n const [ iterationSpec, importSpec ] = _splitOuter( right, '/' );\n if ( !importSpec ) throw new Error( `Invalid ${ directive }items spec: ${ str }; no import specifier.` );\n let [ raw, production, kind, iteratee ] = iterationSpec.trim().match( /(.*?[\\)\\s+])(of|in)([\\(\\{\\[\\s+].*)/i ) || [];\n if ( !raw ) throw new Error( `Invalid ${ directive }items spec: ${ str }.` );\n if ( production.startsWith( '(' ) ) {\n production = production.trim().slice( 1, -1 ).split( ',' ).map( x => x.trim() );\n } else { production = [ production ]; }\n if ( production.length > ( kind === 'in' ? 3 : 2 ) ) throw new Error( `Invalid ${ directive }items spec: ${ str }.` );\n const indices = kind === 'in' ? production[ 2 ] : ( production[ 1 ] || '$index__' );\n return `\n let $iteratee__ = ${ iteratee };\n let $import__ = this.${ config.HTML_IMPORTS.api.import }( ${ importSpec.trim() }, true );\n this.$oohtml_internal_databinding_signals?.push( $import__ );\n\n if ( $import__.value && $iteratee__ ) {\n let $existing__ = new Map;\n [ ...this.children ].filter( el => el.matches( '[${ config.attr.itemIndex }]' ) ).forEach( x => {\n $existing__.set( x.getAttribute( '${ config.attr.itemIndex }' ), x );\n } );\n ${ indices ? `let ${ indices } = -1;` : '' }\n for ( let ${ production[ 0 ] } ${ kind } $iteratee__ ) {\n ${ indices ? `${ indices } ++;` : '' }\n ${ kind === 'in' && production[ 1 ] ? `let ${ production[ 1 ] } = $iteratee__[ ${ production[ 0 ] } ];` : '' }\n const $itemBinding__ = { ${ production.join( ', ' ) } };\n \n const $key___ = ( ${ kind === 'in' ? production[ 0 ] : indices } ) + '';\n let $itemNode__ = $existing__.get( $key___ );\n if ( $itemNode__ ) {\n $existing__.delete( $key___ );\n $exec__($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );\n } else {\n $itemNode__ = ( Array.isArray( $import__.value ) ? $import__.value[ 0 ] : ( $import__.value instanceof window.HTMLTemplateElement ? $import__.value.content.firstElementChild : $import__.value ) ).cloneNode( true );\n $itemNode__.setAttribute( \"${ config.attr.itemIndex }\", $key___ );\n $exec__($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );\n $exec__(this, 'appendChild', $itemNode__ );\n }\n\n if ( ${ kind === 'in' ? `!( ${ production[ 0 ] } in $iteratee__ )` : `typeof ${ production[ 0 ] } === 'undefined'` } ) { $itemNode__.remove(); }\n }\n $existing__.forEach( x => x.remove() );\n $existing__.clear();\n }`;\n }\n }\n // Events\n if ( directive === '@' ) {\n $event_i++;\n return `\n const handler${ $event_i } = event => ${ right.startsWith('{') ? right : arg };\n this.addEventListener( '${ param }', handler${ $event_i } );\n const abort${ $event_i } = () => this.removeEventListener( '${ param }', handler${ $event_i } );\n this.$oohtml_internal_databinding_signals?.push( { abort: abort${ $event_i } } );\n `;\n }\n // Functions\n if ( directive === '$' ) {\n return `$exec__(this, '${ param }', ${ arg });`;\n }\n if ( str.trim() ) throw new Error( `Invalid binding: ${ str }.` );\n } ).join( `\\n` );\n const { webqit: { QuantumModule } } = this;\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n const compiled = new QuantumModule( source, { parserParams, compilerParams, runtimeParams } );\n inlineParseCache.set( str, compiled );\n return compiled;\n}\n\nconst escDouble = str => str.replace(/\"/g, '\\\\\"');\n\nexport function idleCompiler( node ) {\n const window = this, { webqit: { oohtml: { configs: { DATA_BINDING: config } } } } = window;\n // Attr selector must also come first, as in above\n ( node?.matches( config.attrSelector ) ? [ node ] : [] ).concat([ ...( node?.querySelectorAll( config.attrSelector ) || [] ) ]).forEach( node => {\n compileInlineBindings.call( window, config, node.getAttribute( config.attr.render ) );\n } );\n xpathQuery( window, node, `(${ config.discreteBindingsSelector })` ).forEach( node => {\n const template = patternMatch( config, node.nodeValue );\n compileDiscreteBindings.call( window, config, template.expr );\n } );\n}", "\n/**\n * @imports\n */\nimport DOMContext from '../context-api/DOMContext.js';\nimport { env } from '../util.js';\n\nexport default class DOMBindingsContext extends DOMContext {\n\n static kind = 'bindings';\n\n /**\n * @createRequest\n */\n static createRequest( detail = null ) {\n const request = super.createRequest();\n if ( detail?.startsWith( '@' ) ) {\n const [ targetContext, ...detail ] = detail.slice( 1 ).split( '.' ).map( s => s.trim() );\n request.targetContext = targetContext;\n request.detail = detail.join( '.' );\n } else { request.detail = detail; }\n return request;\n }\n\n /**\n * @bindingsObj\n */\n get bindingsObj() { return this.host[ this.configs.BINDINGS_API.api.bindings ]; }\n\n /**\n * @matchesEvent\n */\n matchEvent( event ) {\n return super.matchEvent( event )\n && ( !event.detail || !this.detail || ( Array.isArray( event.detail ) ? event.detail[ 0 ] === this.detail : event.detail === this.detail ) );\n }\n\n /**\n * @handle()\n */\n handle( event ) {\n // Any existing event.meta.controller? Abort!\n event.meta.controller?.abort();\n if ( !( event.detail + '' ).trim() ) return event.respondWith( this.bindingsObj );\n const { window: { webqit: { Observer } } } = env;\n event.meta.controller = Observer.reduce( this.bindingsObj, Array.isArray( event.detail ) ? event.detail : [ event.detail ], Observer.get, descriptor => {\n if ( this.disposed ) return; // If already scheduled but aborted as in provider unmounting\n event.respondWith( descriptor.value );\n }, { live: event.live, signal: event.signal, descripted: true } );\n }\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) { event.meta.controller?.abort(); }\n}\n", "\n/**\n * @imports\n */\nimport DOMBindingsContext from './DOMBindingsContext.js';\nimport { _wq, _init, _splitOuter } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'bindings-api', $config, {\n attr: { bindingsreflection: 'bindings' },\n api: { bind: 'bind', bindings: 'bindings', },\n } );\n window.webqit.DOMBindingsContext = DOMBindingsContext;\n exposeAPIs.call( window, config );\n realtime.call(window, config);\n}\n\n/**\n * @Defs\n * \n * The internal bindings object\n * within elements and the document object.\n */\nfunction getBindings( config, node ) {\n const window = this, { webqit: { Observer, oohtml: { configs: { CONTEXT_API: ctxConfig } } } } = window;\n\tif ( !_wq( node ).has( 'bindings' ) ) {\n\t\tconst bindingsObj = Object.create( null );\n\t\t_wq( node ).set( 'bindings', bindingsObj );\n Observer.observe( bindingsObj, mutations => {\n if ( node instanceof window.Element ) {\n const bindingsParse = parseBindingsAttr( node.getAttribute( config.attr.bindingsreflection ) || '' );\n const bindingsParseBefore = new Map(bindingsParse);\n for ( const m of mutations ) {\n if ( m.detail?.publish !== false ) {\n if ( m.type === 'delete' ) bindingsParse.delete( m.key );\n else bindingsParse.set( m.key, undefined );\n }\n }\n if ( bindingsParse.size && bindingsParse.size !== bindingsParseBefore.size ) {\n node.setAttribute( config.attr.bindingsreflection, `{ ${ [ ...bindingsParse.entries() ].map(([ key, value ]) => value === undefined ? key : `${ key }: ${ value }` ).join( ', ' ) } }` );\n } else if ( !bindingsParse.size ) node.toggleAttribute( config.attr.bindingsreflection, false );\n } else {\n const contextsApi = node[ ctxConfig.api.contexts ];\n for ( const m of mutations ) {\n if ( m.type === 'delete' ) {\n const ctx = contextsApi.find( DOMBindingsContext.kind, m.key );\n if ( ctx ) contextsApi.detach( ctx );\n } else if ( !contextsApi.find( DOMBindingsContext.kind, m.key ) ) {\n contextsApi.attach( new DOMBindingsContext( m.key ) );\n }\n }\n }\n } );\n\t}\n\treturn _wq( node ).get( 'bindings' );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n\tconst window = this, { webqit: { Observer } } = window;\n // The Bindings APIs\n [ window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = prototype === window.Document.prototype ? 'Document' : ( prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element' );\n if ( config.api.bind in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.bind }\" API!` ); }\n if ( config.api.bindings in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.bindings }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.bind, { value: function( bindings, options = {} ) {\n return applyBindings.call( window, config, this, bindings, options );\n } });\n Object.defineProperty( prototype, config.api.bindings, { get: function() {\n return Observer.proxy( getBindings.call( window, config, this ) );\n } } );\n } );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n * @param document|Element target\n * @param Object bindings\n * @param Object params\n *\n * @return Void\n */\nfunction applyBindings( config, target, bindings, { merge, diff, publish, namespace } = {} ) {\n const window = this, { webqit: { Observer } } = window;\n const bindingsObj = getBindings.call( this, config, target );\n const $params = { diff, namespace, detail: { publish } };\n const exitingKeys = merge ? [] : Object.keys( bindingsObj ).filter( key => !( key in bindings ) );\n return Observer.batch( bindingsObj, () => {\n if ( exitingKeys.length ) { Observer.deleteProperties( bindingsObj, exitingKeys, $params ); }\n return Observer.set( bindingsObj, bindings, $params );\n }, $params );\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n * and their module query results; then resolves the respective import elements.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime(config) {\n const window = this, { webqit: { realdom, Observer, oohtml: { configs } } } = window;\n // ------------\n const attachBindingsContext = (host, key) => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n if ( !contextsApi.find( DOMBindingsContext.kind, key ) ) {\n contextsApi.attach( new DOMBindingsContext( key ) );\n }\n };\n const detachBindingsContext = (host, key) => {\n let ctx, contextsApi = host[configs.CONTEXT_API.api.contexts];\n while( ctx = contextsApi.find( DOMBindingsContext.kind, key ) ) contextsApi.detach(ctx);\n };\n // ------------\n realdom.realtime(window.document).query( `[${window.CSS.escape(config.attr.bindingsreflection)}]`, record => {\n record.exits.forEach( entry => detachBindingsContext( entry ) );\n record.entrants.forEach(entry => {\n const bindingsParse = parseBindingsAttr( entry.getAttribute( config.attr.bindingsreflection ) || '' );\n const newData = [ ...bindingsParse.entries() ].filter(([ k, v ]) => v !== undefined );\n if ( newData.length ) entry[ config.api.bind ]( Object.fromEntries( newData ), { merge: true, publish: false } );\n for ( const [ key ] of bindingsParse ) {\n attachBindingsContext( entry, key );\n }\n } );\n }, { id: 'bindings:dom', live: true, subtree: 'cross-roots', timing: 'sync', eventDetails: true });\n\trealdom.realtime( window.document, 'attr' ).observe( config.attr.bindingsreflection, record => {\n const bindingsObj = getBindings.call( window, config, record.target );\n const bindingsParse = parseBindingsAttr( record.value || '' );\n const oldBindings = parseBindingsAttr( record.oldValue || '' );\n for ( const key of new Set([ ...bindingsParse.keys(), ...oldBindings.keys() ]) ) {\n if ( !oldBindings.has( key ) ) {\n if ( bindingsParse.get( key ) !== undefined ) Observer.set( bindingsObj, key, bindingsParse.get( key ), { detail: { publish: false } } );\n attachBindingsContext( record.target, key );\n } else if ( !bindingsParse.has( key ) ) {\n if ( oldBindings.get( key ) !== undefined ) Observer.deleteProperty( bindingsObj, key, { detail: { publish: false } } );\n detachBindingsContext( record.target, key );\n } else if ( bindingsParse.get( key ) !== oldBindings.get( key ) ) {\n Observer.set( bindingsObj, key, bindingsParse.get( key ), { detail: { publish: false } } );\n }\n }\n\t}, { id: 'bindings:attr', subtree: 'cross-roots', timing: 'sync', newValue: true, oldValue: true } );\n}\n\nconst parseBindingsAttr = str => {\n str = str.trim();\n return new Map(_splitOuter( str.slice(1, -1), ',' ).filter( s => s.trim() ).map( _str => {\n return _splitOuter( _str, ':' ).map( s => s.trim() );\n }));\n};\n", "\n/**\n * @imports\n */\nimport { getDefs } from './index.js';\nimport { _wq, env } from '../util.js';\n\nexport default class HTMLModule {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _wq( host ).get( 'defsmanager::instance' ) || new this( host );\n }\n\n /**\n * @constructor\n */\n constructor( host, parent = null, level = 0 ) {\n const { window } = env, { webqit: { realdom, oohtml: { configs } } } = window;\n _wq( host ).get( `defsmanager::instance` )?.dispose();\n _wq( host ).set( `defsmanager::instance`, this );\n this.window = window;\n this.host = host;\n this.config = configs.HTML_IMPORTS;\n this.parent = parent;\n this.level = level;\n this.defs = getDefs( this.host );\n this.defId = ( this.host.getAttribute( this.config.attr.def ) || '' ).trim();\n this.validateDefId( this.defId );\n // ----------\n this.realtimeA = realdom.realtime( this.host.content ).children( record => {\n this.expose( record.entrants, true );\n this.expose( record.exits, false );\n }, { live: true, timing: 'sync' } );\n // ----------\n this.realtimeB = realdom.realtime( this.host ).attr( [ 'src', 'loading' ], ( ...args ) => this.evaluateLoading( ...args ), {\n live: true,\n atomic: true,\n timing: 'sync',\n lifecycleSignals: true\n } );\n // ----------\n this.realtimeC = this.evalInheritance();\n // ----------\n }\n\n /**\n * Validates export ID.\n * \n * @param String defId\n *\n * @returns Void\n */\n validateDefId( defId ) {\n if ( [ '@', '/', '*', '#' ].some( token => defId.includes( token ) ) ) {\n throw new Error( `The export ID \"${ defId }\" contains an invalid character.` );\n }\n }\n\n /**\n * Maps module contents as defs.\n * \n * @param Array entries\n * @param Bool isConnected\n *\n * @returns Void\n */\n expose( entries, isConnected ) {\n const { window } = env, { webqit: { Observer } } = window;\n let dirty, allFragments = this.defs[ '#' ] || [];\n entries.forEach( entry => {\n if ( entry.nodeType !== 1 ) return;\n const isTemplate = entry.matches( this.config.templateSelector );\n const defId = ( entry.getAttribute( isTemplate ? this.config.attr.def : this.config.attr.fragmentdef ) || '' ).trim();\n if ( isConnected ) {\n if ( isTemplate && defId ) {\n new HTMLModule( entry, this.host, this.level + 1 );\n } else {\n allFragments.push( entry );\n dirty = true;\n if ( typeof requestIdleCallback === 'function' ) {\n requestIdleCallback( () => {\n this.config.idleCompilers?.forEach( callback => callback.call( this.window, entry ) );\n } );\n }\n }\n if ( defId ) {\n this.validateDefId( defId );\n Observer.set( this.defs, ( !isTemplate && '#' || '' ) + defId, entry );\n }\n } else {\n if ( isTemplate && defId ) { HTMLModule.instance( entry ).dispose(); }\n else {\n allFragments = allFragments.filter( x => x !== entry );\n dirty = true;\n }\n if ( defId ) Observer.deleteProperty( this.defs, ( !isTemplate && '#' || '' ) + defId );\n }\n } );\n if ( dirty ) Observer.set( this.defs, '#', allFragments );\n }\n\n /**\n * Evaluates remote content loading.\n *\n * @param AbortSignal signal\n * \n * @returns Void\n */\n evaluateLoading( [ record1, record2 ], { signal } ) {\n const { window: { webqit: { Observer } } } = env;\n const src = ( record1.value || '' ).trim();\n if ( !src ) return;\n let $loadingPromise, loadingPromise = promise => {\n if ( !promise ) return $loadingPromise; // Get\n $loadingPromise = promise.then( () => interception.remove() ); // Set\n };\n const loading = ( record2.value || '' ).trim();\n const interception = Observer.intercept( this.defs, 'get', async ( descriptor, recieved, next ) => {\n if ( loading === 'lazy' ) { loadingPromise( this.load( src, true ) ); }\n await loadingPromise();\n return next();\n }, { signal } );\n if ( loading !== 'lazy' ) { loadingPromise( this.load( src ) ); }\n }\n \n /**\n * Fetches a module's \"src\".\n *\n * @param String src\n *\n * @return Promise\n */\n load( src ) {\n const { window } = env;\n if ( this.host.content.children.length ) return Promise.resolve();\n // Ongoing request?\n if ( this.fetchInFlight?.src === src ) return this.fetchInFlight.request;\n this.fetchInFlight?.controller.abort();\n\n // The promise\n const controller = new AbortController();\n const fire = ( type, detail ) => this.host.dispatchEvent( new window.CustomEvent( type, { detail } ) );\n const request = window.fetch( src, { signal: controller.signal, element: this.host } ).then( response => {\n return response.ok ? response.text() : Promise.reject( response.statusText );\n } ).then( content => {\n this.host.innerHTML = content.trim(); // IMPORTANT: .trim()\n fire( 'load' );\n return this.host;\n } ).catch( e => {\n console.error( `Error fetching the bundle at \"${ src }\": ${ e.message }` );\n this.fetchInFlight = null;\n fire( 'loaderror' );\n return this.host;\n } );\n this.fetchInFlight = { src, request, controller };\n return request;\n }\n\n /**\n * Evaluates module inheritance.\n *\n * @returns Void|AbortController\n */\n evalInheritance( ) {\n if ( !this.parent ) return [];\n const { window: { webqit: { Observer } } } = env;\n let extendedId = ( this.host.getAttribute( this.config.attr.extends ) || '' ).trim();\n let inheritedIds = ( this.host.getAttribute( this.config.attr.inherits ) || '' ).trim().split( ' ' ).map( id => id.trim() ).filter( x => x );\n const handleInherited = records => {\n records.forEach( record => {\n if ( Observer.get( this.defs, record.key ) !== record.oldValue ) return;\n if ( [ 'get'/*initial get*/, 'set', 'def' ].includes( record.type ) ) {\n Observer[ record.type.replace( 'get', 'set' ) ]( this.defs, record.key, record.value );\n } else if ( record.type === 'delete' ) {\n Observer.deleteProperty( this.defs, record.key );\n }\n } );\n };\n const realtimes = [];\n const parentDefsObj = getDefs( this.parent );\n if ( extendedId ) {\n realtimes.push( Observer.reduce( parentDefsObj, [ extendedId, this.config.api.defs, Infinity ], Observer.get, handleInherited, { live: true } ) );\n }\n if ( inheritedIds.length ) {\n realtimes.push( Observer.get( parentDefsObj, inheritedIds.includes( '*' ) ? Infinity : inheritedIds, handleInherited, { live: true } ) );\n }\n return realtimes;\n }\n \n /**\n * Disposes the instance and its processes.\n *\n * @returns Void\n */\n dispose() {\n this.realtimeA.disconnect();\n this.realtimeB.disconnect();\n this.realtimeC.forEach( r => ( r instanceof Promise ? r.then( r => r.abort() ) : r.abort() ) );\n Object.entries( this.defs ).forEach( ( [ key, entry ] ) => {\n if ( key.startsWith( '#' ) ) return;\n HTMLModule.instance( entry ).dispose();\n } );\n }\n}\n", "\n/**\n * @imports\n */\nimport DOMContext from '../context-api/DOMContext.js';\nimport { getDefs } from './index.js';\nimport { env } from '../util.js';\n\nexport default class HTMLImportsContext extends DOMContext {\n\n /**\n * @kind\n */\n static kind = 'html-imports';\n\n /**\n * @createRequest\n */\n static createRequest( detail = null ) {\n const request = super.createRequest();\n if ( detail?.startsWith( '/' ) ) {\n request.detail = detail;\n request.targetContext = Infinity;\n } else if ( detail?.startsWith( '@' ) ) {\n const [ targetContext, ..._detail ] = detail.slice( 1 ).split( /(?<=\\w)(?=\\/|#)/ ).map( s => s.trim() );\n request.targetContext = targetContext;\n request.detail = _detail.join( '' );\n } else { request.detail = detail; }\n return request;\n }\n \n /**\n * @localModules\n */\n get localModules() { return getDefs( this.host ); }\n get inheritedModules() { return this.#inheritedModules; }\n #inheritedModules = {};\n\n /**\n * @handle()\n */\n \n handle( event ) {\n const { window: { webqit: { Observer } } } = env;\n // Any existing event.meta.controller? Abort!\n event.meta.controller?.abort();\n // Parse and translate detail\n let path = ( event.detail || '' ).split( /\\/|(?<=\\w)(?=#)/g ).map( x => x.trim() ).filter( x => x );\n if ( !path.length ) return event.respondWith();\n path = path.join( `/${ this.configs.HTML_IMPORTS.api.defs }/` )?.split( '/' ).map( x => x === '*' ? Infinity : x ) || [];\n // We'll now fulfill request\n const options = { live: event.live, signal: event.signal, descripted: true };\n event.meta.controller = Observer.reduce( this.#modules, path, Observer.get, ( m ) => {\n if ( Array.isArray( m ) ) {\n if ( !m.length ) {\n event.respondWith();\n return;\n }\n // Paths with wildcard\n for ( const n of m ) {\n event.respondWith( n );\n }\n } else {\n event.respondWith( m.value );\n }\n }, options );\n }\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) { event.meta.controller?.abort(); }\n\n /**\n * @initialize()\n */\n #modules;\n #controller1;\n #controller2;\n initialize( host ) {\n this.host = host;\n const { window: { webqit: { Observer } } } = env;\n // ----------------\n // Resolve\n const resolve = () => {\n for (const key of new Set([...Object.keys(this.localModules), ...Object.keys(this.inheritedModules), ...Object.keys(this.#modules)])) {\n if ( !Observer.has( this.localModules, key ) && !Observer.has( this.inheritedModules, key ) ) {\n Observer.deleteProperty( this.#modules, key );\n } else if (key === '#' && Observer.has( this.localModules, key ) && Observer.has( this.inheritedModules, key ) ) {\n Observer.set( this.#modules, key, [...Observer.get( this.localModules, key ), ...Observer.get( this.inheritedModules, key )] );\n } else {\n const _module = Observer.get( this.localModules, key ) || Observer.get( this.inheritedModules, key );\n if ( Observer.get( this.#modules, key ) !== _module ) {\n Observer.set( this.#modules, key, _module );\n }\n }\n }\n };\n // ----------------\n // Observe local\n this.#modules = { ...this.localModules };\n this.#controller1?.abort();\n this.#controller1 = Observer.observe( this.localModules, () => resolve('local'), { timing: 'sync' } );\n // ----------------\n // If host has importscontext attr, compute that\n const $config = this.configs.HTML_IMPORTS;\n if ( this.host.matches && $config.attr.importscontext ) {\n const realdom = this.host.ownerDocument.defaultView.webqit.realdom;\n let prevRef;\n this.#controller2?.disconnect();\n this.#controller2 = realdom.realtime( this.host ).attr( $config.attr.importscontext, ( record, { signal } ) => { \n const moduleRef = ( record.value || '' ).trim();\n if ( moduleRef === prevRef ) return;\n prevRef = moduleRef;\n // This superModules contextrequest is automatically aborted by the injected signal below\n this.#inheritedModules = {};\n const request = { ...this.constructor.createRequest( moduleRef ? `${moduleRef}/*` : '*' ), live: true, signal, diff: true };\n this.host.parentNode[ this.configs.CONTEXT_API.api.contexts ].request( request, ( m ) => {\n if ( !m ) {\n this.#inheritedModules = {};\n resolve('inherited');\n } else if ( m.type === 'delete' ) {\n delete this.#inheritedModules[m.key];\n if ( !Reflect.has( this.localModules, m.key ) ) {\n Observer.deleteProperty( this.#modules, m.key );\n }\n } else {\n this.#inheritedModules[m.key] = m.value;\n if ( !Reflect.has( this.localModules, m.key ) && Reflect.get( this.#modules, m.key ) !== m.value ) {\n Observer.set( this.#modules, m.key, m.value );\n }\n }\n } );\n resolve('inherited');\n }, { live: true, timing: 'sync', oldValue: true, lifecycleSignals: true } );\n }\n // ----------------\n return super.initialize( host );\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n // Stop listening for sources\n this.#controller1?.abort();\n this.#controller2?.disconnect();\n // Now, stop listening for contextrequest and contextclaim events\n // And relinquish own subscribers to owner context\n return super.dispose( host );\n }\n}\n", "\n/**\n * @imports\n */\nimport HTMLImportsContext from './HTMLImportsContext.js';\nimport { _wq, env } from '../util.js';\n\n/**\n * Creates the HTMLImportElement class.\n * \n * @param Object config \n * \n * @return HTMLImportElement\n */\nexport default function() {\n const { window } = env, { webqit } = window, { realdom, oohtml: { configs } } = webqit;\n if ( webqit.HTMLImportElement ) return webqit.HTMLImportElement;\n const BaseElement = configs.HTML_IMPORTS.elements.import.includes( '-' ) ? window.HTMLElement : class {};\n class HTMLImportElement extends BaseElement {\n \n /**\n * @instance\n * \n * @param HTMLElement node\n * \n * @returns \n */\n static instance( node ) {\n if ( configs.HTML_IMPORTS.elements.import.includes( '-' ) && ( node instanceof this ) ) return node;\n return _wq( node ).get( 'import::instance' ) || new this( node );\n }\n\n /**\n * @constructor\n */\n constructor( ...args ) {\n super();\n // --------\n const el = args[ 0 ] || this;\n _wq( el ).set( 'import::instance', this );\n Object.defineProperty( this, 'el', { get: () => el, configurable: false } );\n\n const priv = {};\n Object.defineProperty( this, '#', { get: () => priv, configurable: false } );\n priv.slottedElements = new Set;\n\n priv.setAnchorNode = anchorNode => {\n priv.anchorNode = anchorNode;\n return anchorNode;\n };\n\n priv.live = callback => {\n if ( priv.liveImportsRealtime ) throw new Error(`Import element already in live mode.`);\n const parentNode = this.el.isConnected ? this.el.parentNode : priv.anchorNode.parentNode;\n priv.liveImportsRealtime = realdom.realtime( this.el ).attr( configs.HTML_IMPORTS.attr.ref, ( record, { signal } ) => {\n priv.moduleRef = record.value;\n const moduleRef = priv.moduleRef.includes( '#' ) ? priv.moduleRef : `${ priv.moduleRef }#`/* for live children */;\n const request = { ...HTMLImportsContext.createRequest( moduleRef ), live: signal && true, signal, diff: !moduleRef.endsWith('#') };\n parentNode[ configs.CONTEXT_API.api.contexts ].request( request, response => {\n callback( ( response instanceof window.HTMLTemplateElement ? [ ...response.content.children ] : (\n Array.isArray( response ) ? response : response && [ response ]\n ) ) || [] );\n } );\n }, { live: true, timing: 'sync', lifecycleSignals: true } );\n priv.autoDestroyRealtime = realdom.realtime( window.document ).track( parentNode, () => {\n priv.die();\n }, { subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n };\n\n priv.die = () => {\n priv.autoDestroyRealtime?.disconnect();\n priv.liveImportsRealtime?.disconnect();\n priv.liveImportsRealtime = null;\n };\n\n priv.hydrate = ( anchorNode, slottedElements ) => {\n anchorNode.replaceWith( priv.setAnchorNode( this.createAnchorNode() ) );\n priv.live( fragments => {\n // The default action\n if ( priv.originalsRemapped ) return this.fill( fragments );\n // Initial remap action\n const identifiersMap = fragments.map( ( fragment, i ) => ( { el: fragment, fragmentDef: fragment.getAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) || '', tagName: fragment.tagName, i } ) );\n slottedElements.forEach( ( slottedElement, i ) => {\n const tagName = slottedElement.tagName, fragmentDef = slottedElement.getAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) || '';\n const originalsMatch = ( i ++, identifiersMap.find( fragmentIdentifiers => fragmentIdentifiers.tagName === tagName && fragmentIdentifiers.fragmentDef === fragmentDef && fragmentIdentifiers.i === i ) );\n if ( originalsMatch ) _wq( slottedElement ).set( 'original@imports', originalsMatch.el ); // Or should we throw integrity error here?\n _wq( slottedElement ).set( 'slot@imports', this.el );\n priv.slottedElements.add( slottedElement );\n } );\n priv.originalsRemapped = true;\n });\n };\n\n priv.autoRestore = ( callback = null ) => {\n priv.autoRestoreRealtime?.disconnect();\n if ( callback ) callback();\n const restore = () => {\n if (this.el.isConnected) return;\n this.el.setAttribute( 'data-nodecount', 0 );\n priv.internalMutation = true;\n priv.anchorNode.replaceWith( this.el );\n priv.internalMutation = false;\n priv.setAnchorNode( null );\n };\n if ( !priv.slottedElements.size ) return restore();\n const autoRestoreRealtime = realdom.realtime( priv.anchorNode.parentNode ).observe( [ ...priv.slottedElements ], record => {\n record.exits.forEach( outgoingNode => {\n _wq( outgoingNode ).delete( 'slot@imports' );\n priv.slottedElements.delete( outgoingNode );\n } );\n if ( !priv.slottedElements.size ) {\n autoRestoreRealtime.disconnect();\n // At this point, ignore if this is a removal involving the whole parent node\n if ( !record.target.isConnected ) return;\n restore();\n }\n }, { subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n priv.autoRestoreRealtime = autoRestoreRealtime;\n };\n\n priv.connectedCallback = () => {\n if ( priv.internalMutation ) return;\n priv.live( fragments => this.fill( fragments ) );\n };\n\n priv.disconnectedCallback = () => {\n if ( priv.internalMutation ) return;\n priv.die();\n };\n }\n\n /**\n * Creates the slot's anchor node.\n *\n * @return Element\n */\n createAnchorNode() {\n if ( window.webqit.env !== 'server' ) { return window.document.createTextNode( '' ) }\n const escapeElement = window.document.createElement( 'div' );\n escapeElement.textContent = this.el.outerHTML;\n const anchorNode = window.document.createComment( escapeElement.innerHTML );\n _wq( anchorNode ).set( 'isAnchorNode', true );\n return anchorNode;\n }\n\n /**\n * Fills the slot with slottableElements\n *\n * @param Iterable slottableElements\n *\n * @return void\n */\n fill( slottableElements, r ) {\n if (!this.el.isConnected && (!this[ '#' ].anchorNode || !this[ '#' ].anchorNode.isConnected)) {\n // LiveImports must be responding to an event that just removed the subtree from DOM\n return;\n }\n if ( Array.isArray( slottableElements ) ) { slottableElements = new Set( slottableElements ) }\n // This state must be set before the diffing below and the serialization done at createAnchorNode()\n this.el.setAttribute( 'data-nodecount', slottableElements.size );\n this[ '#' ].autoRestore( () => {\n this[ '#' ].slottedElements.forEach( slottedElement => {\n const slottedElementOriginal = _wq( slottedElement ).get( 'original@imports' );\n // If still available in source, simply leave unchanged\n // otherwise remove it from slot... to reflect this change\n if ( slottableElements.has( slottedElementOriginal ) ) {\n slottableElements.delete( slottedElementOriginal );\n } else {\n this[ '#' ].slottedElements.delete( slottedElement );\n // This removal will not be caught\n slottedElement.remove();\n }\n } );\n // Make sure anchor node is what's in place...\n // not the import element itslef - but all only when we have slottableElements.size\n if ( slottableElements.size && this.el.isConnected ) {\n const newAnchorNode = this[ '#' ].setAnchorNode( this.createAnchorNode() );\n this[ '#' ].internalMutation = true;\n this.el.replaceWith( newAnchorNode );\n this[ '#' ].internalMutation = false;\n }\n // Insert slottables now\n slottableElements.forEach( slottableElement => {\n // Clone each slottable element and give it a reference to its original\n const slottableElementClone = slottableElement.cloneNode( true );\n // The folllowing references must be set before adding to DODM\n if ( !slottableElementClone.hasAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) ) {\n slottableElementClone.toggleAttribute( configs.HTML_IMPORTS.attr.fragmentdef, true );\n }\n _wq( slottableElementClone ).set( 'original@imports', slottableElement );\n _wq( slottableElementClone ).set( 'slot@imports', this.el );\n this[ '#' ].slottedElements.add( slottableElementClone );\n this[ '#' ].anchorNode.before( slottableElementClone );\n } );\n } );\n }\n\n /**\n * Empty slot.\n *\n * @return void\n */\n empty() { this[ '#' ].slottedElements.forEach( slottedElement => slottedElement.remove() ); }\n\n /**\n * Returns the slot's anchorNode.\n *\n * @return array\n */\n get anchorNode() { return this[ '#' ].anchorNode; }\n\n /**\n * Returns the slot's module reference, if any.\n *\n * @return string\n */\n get moduleRef() { return this[ '#' ].moduleRef; }\n\n /**\n * Returns the slot's slotted elements.\n *\n * @return array\n */\n get slottedElements() { return this[ '#' ].slottedElements; }\n }\n if ( configs.HTML_IMPORTS.elements.import.includes( '-' ) ) { customElements.define( configs.HTML_IMPORTS.elements.import, HTMLImportElement ); }\n webqit.HTMLImportElement = HTMLImportElement;\n return HTMLImportElement;\n}", "\n/**\n * @imports\n */\nimport HTMLModule from './HTMLModule.js';\nimport HTMLImportsContext from './HTMLImportsContext.js';\nimport _HTMLImportElement from './_HTMLImportElement.js';\nimport { _wq, _init } from '../util.js';\n\n/**\n * Initializes HTML Modules.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init($config = {}) {\n const { config, window } = _init.call(this, 'html-imports', $config, {\n elements: { import: 'import', },\n attr: { def: 'def', extends: 'extends', inherits: 'inherits', ref: 'ref', importscontext: 'importscontext', },\n api: { def: 'def', defs: 'defs', import: 'import' },\n });\n if (!config.attr.fragmentdef) { config.attr.fragmentdef = config.attr.def; }\n config.templateSelector = `template[${window.CSS.escape(config.attr.def)}]`;\n config.importsContextSelector = `[${window.CSS.escape(config.attr.importscontext)}]`;\n config.slottedElementsSelector = `[${window.CSS.escape(config.attr.fragmentdef)}]:not(template)`;\n const anchorNodeMatch = (start, end) => {\n const starting = `starts-with(., \"${start}\")`;\n const ending = `substring(., string-length(.) - string-length(\"${end}\") + 1) = \"${end}\"`;\n return `${starting} and ${ending}`;\n }\n config.anchorNodeSelector = `comment()[${anchorNodeMatch(`<${config.elements.import}`, `</${config.elements.import}>`)}]`;\n window.webqit.HTMLImportsContext = HTMLImportsContext;\n window.webqit.HTMLImportElement = _HTMLImportElement();\n exposeAPIs.call(window, config);\n realtime.call(window, config);\n}\n\n/**\n * Returns the \"defs\" object associated with the given node.\n *\n * @param Element node\n * @param Bool autoCreate\n *\n * @return Object\n */\nexport function getDefs(node, autoCreate = true) {\n if (!_wq(node).has('defs') && autoCreate) {\n const defs = Object.create(null);\n _wq(node).set('defs', defs);\n }\n return _wq(node).get('defs');\n}\n\n/**\n * Exposes HTML Modules with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs(config) {\n const window = this, { webqit: { oohtml: { configs } } } = window;\n // The \"def\" & \"defs\" properties\n if (config.api.def in window.HTMLTemplateElement.prototype) { throw new Error(`The \"HTMLTemplateElement\" prototype already has a \"${config.api.def}\" API!`); }\n if (config.api.defs in window.HTMLTemplateElement.prototype) { throw new Error(`The \"HTMLTemplateElement\" prototype already has a \"${config.api.defs}\" API!`); }\n // No-conflict assertions\n Object.defineProperty(window.HTMLTemplateElement.prototype, config.api.def, {\n get: function () {\n return this.getAttribute(config.attr.def);\n }\n });\n Object.defineProperty(window.HTMLTemplateElement.prototype, config.api.defs, {\n get: function () {\n return getDefs(this);\n }\n });\n // The \"scoped\" property\n Object.defineProperty(window.HTMLTemplateElement.prototype, 'scoped', {\n configurable: true,\n get() { return this.hasAttribute('scoped'); },\n set(value) { this.toggleAttribute('scoped', value); },\n });\n // The Import API\n [window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype].forEach(prototype => {\n // No-conflict assertions\n const type = prototype === window.Document.prototype ? 'Document' : (prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element');\n if (config.api.import in prototype) { throw new Error(`The ${type} prototype already has a \"${config.api.import}\" API!`); }\n // Definitions\n Object.defineProperty(prototype, config.api.import, {\n value: function (ref, live = false, callback = null) {\n return importRequest(this, ...arguments);\n }\n });\n });\n function importRequest(context, ref, live = false, callback = null) {\n let options = {};\n if (typeof live === 'function') {\n callback = live;\n live = false;\n } else if (typeof live === 'object' && live) {\n options = { ...live, ...options };\n } else { options = { live }; }\n const request = { ...HTMLImportsContext.createRequest(ref), ...options };\n return context[configs.CONTEXT_API.api.contexts].request(request, callback);\n }\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n * and their module query results; then resolves the respective import elements.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime(config) {\n const window = this, { webqit: { Observer, realdom, oohtml: { configs }, HTMLImportElement, HTMLImportsContext } } = window;\n\n // ------------\n // MODULES\n // ------------\n const attachImportsContext = host => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n if (!contextsApi.find(HTMLImportsContext.kind)) {\n contextsApi.attach(new HTMLImportsContext);\n }\n };\n const detachImportsContext = host => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n const ctx = contextsApi.find(HTMLImportsContext.kind);\n if (ctx && ( /* disconnect? */!host.isConnected || /* not inheriting && no localModules? */(\n !host.matches?.(config.importsContextSelector) && !Object.keys(ctx.localModules).length\n ))) {\n contextsApi.detach(ctx);\n }\n };\n // ------------\n realdom.realtime(window.document).query([config.templateSelector, config.importsContextSelector], record => {\n record.entrants.forEach(entry => {\n if (entry.matches(config.templateSelector)) {\n const htmlModule = HTMLModule.instance(entry);\n htmlModule.ownerContext = entry.scoped ? entry.parentNode : entry.getRootNode();\n const ownerContextModulesObj = getDefs(htmlModule.ownerContext);\n if (htmlModule.defId) { Observer.set(ownerContextModulesObj, htmlModule.defId, entry); }\n // The ownerContext's defs - ownerContextModulesObj - has to be populated\n // Before attaching a context instance to it, to give the just created context something to use for\n // fullfiling reclaimed requests.\n attachImportsContext(htmlModule.ownerContext);\n } else {\n attachImportsContext(entry);\n }\n });\n record.exits.forEach(entry => {\n if (entry.matches(config.templateSelector)) {\n const htmlModule = HTMLModule.instance(entry);\n //if (!htmlModule.ownerContext) return; // JSDOM sometimes\n const ownerContextModulesObj = getDefs(htmlModule.ownerContext);\n if (htmlModule.defId && htmlModule.ownerContext.isConnected) { Observer.deleteProperty(ownerContextModulesObj, htmlModule.defId); }\n detachImportsContext(htmlModule.ownerContext);\n } else {\n detachImportsContext(entry);\n }\n });\n }, { id: 'imports:template/importscontext', live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true, eventDetails: true });\n\n // ------------\n // IMPORTS\n // ------------\n realdom.realtime(window.document).query(config.elements.import, record => {\n record.entrants.forEach(node => handleRealtime(node, true, record));\n record.exits.forEach(node => handleRealtime(node, false, record));\n }, { id: 'imports:import', live: true, subtree: 'cross-roots', timing: 'sync', deferred: true });\n function handleRealtime(entry, connectedState) {\n const elInstance = HTMLImportElement.instance(entry);\n if (connectedState) { elInstance['#'].connectedCallback(); }\n else { elInstance['#'].disconnectedCallback(); }\n }\n // Hydration\n if (window.webqit.env === 'server') return;\n realdom.realtime(window.document).query(`(${config.anchorNodeSelector})`, record => {\n record.entrants.forEach(anchorNode => {\n if (_wq(anchorNode).get('isAnchorNode')) return; // Doubling up on the early return above! Ignoring every just created anchorNode\n const reviver = window.document.createElement('div');\n reviver.innerHTML = anchorNode.nodeValue;\n reviver.innerHTML = reviver.firstChild.textContent;\n const importEl = reviver.firstChild;\n let nodecount = parseInt(importEl.getAttribute('data-nodecount'));\n const slottedElements = new Set;\n let slottedElement = anchorNode;\n while ((slottedElement = slottedElement.previousElementSibling) && slottedElement.matches(config.slottedElementsSelector) && nodecount--) {\n slottedElements.add(slottedElement);\n }\n HTMLImportElement.instance(importEl)['#'].hydrate(anchorNode, slottedElements);\n });\n }, { id: 'imports:hydration', live: true, subtree: 'cross-roots', timing: 'sync' });\n}", "\n/**\n * @imports\n */\nimport DOMContexts from './DOMContexts.js';\nimport DOMContext from './DOMContext.js';\nimport _DOMContextRequestEvent from './_DOMContextRequestEvent.js';\nimport DOMContextResponse from './DOMContextResponse.js';\nimport DuplicateContextError from './DuplicateContextError.js';\nimport { _init } from '../util.js';\n\n/**\n * Initializes HTML Modules.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'context-api', $config, {\n elements: { roots: 'root,webflo-embedded', },\n attr: { contextname: 'contextname', },\n api: { contexts: 'contexts', },\n } );\n const waitListMappings = new Map, dispatchEvent = window.EventTarget.prototype.dispatchEvent;\n Object.defineProperty( window.EventTarget.prototype, 'dispatchEvent', { value: function( ...args ) {\n const event = args[0], rootNode = this?.closest?.(config.elements.roots) || this.getRootNode?.();\n if ( [ 'contextclaim', 'contextrequest' ].includes( event.type ) && rootNode ) {\n if ( event.meta ) event.meta.target = this;\n const temp = (event) => {\n event.stopImmediatePropagation();\n // Always set this whether answered or not\n if ( event.meta ) event.meta.target = event.target;\n if ( event.answered ) return;\n if ( !waitListMappings.get( rootNode ) ) waitListMappings.set( rootNode, new Set );\n if ( event.type === 'contextrequest' && event.live ) {\n waitListMappings.get( rootNode ).add( event );\n } else if ( event.type === 'contextclaim' ) {\n const claims = new Set;\n waitListMappings.get( rootNode ).forEach( subscriptionEvent => {\n if ( !event.target.contains( subscriptionEvent.target ) || !event.detail?.matchEvent?.( subscriptionEvent ) ) return;\n waitListMappings.get( rootNode ).delete( subscriptionEvent );\n claims.add( subscriptionEvent );\n } );\n if ( !waitListMappings.get( rootNode ).size ) waitListMappings.delete( rootNode );\n return event.respondWith?.( claims );\n }\n };\n rootNode.addEventListener( event.type, temp );\n const returnValue = dispatchEvent.call( this, ...args );\n rootNode.removeEventListener( event.type, temp );\n return returnValue;\n }\n return dispatchEvent.call( this, ...args );\n } } );\n window.webqit.DOMContexts = DOMContexts;\n window.webqit.DOMContext = DOMContext;\n window.webqit.DOMContextRequestEvent = _DOMContextRequestEvent();\n window.webqit.DOMContextResponse = DOMContextResponse;\n window.webqit.DuplicateContextError = DuplicateContextError;\n exposeAPIs.call( window, config );\n}\n\n/**\n * Exposes HTML Modules with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this;\n [ window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = prototype === window.Document.prototype ? 'Document' : ( prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element' );\n if ( config.api.contexts in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.contexts }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.contexts, { get: function() {\n return DOMContexts.instance( this );\n } } );\n } );\n}\n", "\n/**\n * @imports\n */\nimport { rewriteSelector, getOwnerNamespaceObject, getNamespaceUUID } from '../namespaced-html/index.js';\nimport { _init, _toHash } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init({ advanced = {}, ...$config }) {\n const { config, window } = _init.call( this, 'scoped-css', $config, {\n api: { styleSheets: 'styleSheets' },\n style: { retention: 'retain', mimeTypes: 'text/css', strategy: null },\n } );\n config.styleSelector = (Array.isArray( config.style.mimeTypes ) ? config.style.mimeTypes : config.style.mimeTypes.split( '|' ) ).concat( '' ).reduce( ( selector, mm ) => {\n const qualifier = mm ? `[type=\"${ window.CSS.escape( mm ) }\"]` : ':not([type])';\n return selector.concat( `style${ qualifier }` );\n }, [] ).join( ',' );\n window.webqit.oohtml.Style = {\n compileCache: new Map,\n };\n exposeAPIs.call( window, config );\n realtime.call( window, config );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this, styleSheetsMap = new Map;\n // The \"styleSheets\" API\n [ window.Element.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = 'Element';\n if ( config.api.styleSheets in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.styleSheets }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.styleSheets, { get: function() {\n if ( !styleSheetsMap.has( this ) ) { styleSheetsMap.set( this, [] ); }\n return styleSheetsMap.get( this );\n }, } );\n } );\n // The HTMLStyleElement \"scoped\" property\n Object.defineProperty( window.HTMLStyleElement.prototype, 'scoped', {\n configurable: true,\n get() { return this.hasAttribute( 'scoped' ); },\n set( value ) { this.toggleAttribute( 'scoped', value ); },\n } );\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { oohtml, realdom } } = window;\n const inBrowser = Object.getOwnPropertyDescriptor( globalThis, 'window' )?.get?.toString().includes( '[native code]' ) ?? false;\n if ( !window.CSS.supports ) { window.CSS.supports = () => false; }\n const handled = new WeakSet;\n realdom.realtime( window.document ).query( config.styleSelector, record => {\n record.entrants.forEach( style => {\n if ( handled.has( style ) ) return;\n handled.add( style );\n // Do compilation\n const sourceHash = _toHash( style.textContent );\n const supportsHAS = CSS.supports( 'selector(:has(a,b))' );\n const scopeSelector = style.scoped && ( supportsHAS ? `:has(> style[rand-${ sourceHash }])` : `[rand-${ sourceHash }]` );\n const supportsScope = style.scoped && window.CSSScopeRule && false/* Disabled for buggy behaviour: rewriting selectorText within an @scope block invalidates the scoping */;\n const scopeRoot = style.scoped && style.parentNode || style.getRootNode();\n if ( scopeRoot instanceof window.Element ) {\n scopeRoot[ config.api.styleSheets ].push( style );\n if ( !inBrowser ) return;\n ( supportsHAS ? style : scopeRoot ).toggleAttribute( `rand-${ sourceHash }`, true );\n }\n if ( !inBrowser ) return;\n if ( style.scoped && style.hasAttribute( 'shared' ) ) {\n let compiledSheet;\n if ( !( compiledSheet = oohtml.Style.compileCache.get( sourceHash ) ) ) {\n compiledSheet = createAdoptableStylesheet.call( window, style, null, supportsScope, scopeSelector );\n oohtml.Style.compileCache.set( sourceHash, compiledSheet );\n }\n // Run now!!!\n Object.defineProperty( style, 'sheet', { value: compiledSheet, configurable: true } );\n style.textContent = '\\n/*[ Shared style sheet ]*/\\n';\n } else {\n const transform = () => {\n const namespaceUUID = getNamespaceUUID( getOwnerNamespaceObject.call( window, scopeRoot ) );\n upgradeSheet.call( this, style.sheet, namespaceUUID, !supportsScope && scopeSelector );\n };\n if ( style.isConnected ) { transform(); }\n else { setTimeout( () => { transform(); }, 0 ); }\n }\n } );\n }, { id: 'scoped-css', live: true, subtree: 'cross-roots', timing: 'intercept', generation: 'entrants' } );\n // ---\n}\n\nfunction createAdoptableStylesheet( style, namespaceUUID, supportsScope, scopeSelector ) {\n const window = this, textContent = style.textContent;\n let styleSheet, cssText = supportsScope && scopeSelector ? `@scope (${ scopeSelector }) {\\n${ textContent.trim() }\\n}` : textContent.trim();\n try {\n styleSheet = new window.CSSStyleSheet;\n styleSheet.replaceSync( cssText );\n upgradeSheet.call( this, styleSheet, namespaceUUID, !supportsScope && scopeSelector );\n const adopt = () => style.getRootNode().adoptedStyleSheets.push( styleSheet );\n if ( style.isConnected ) { adopt(); }\n else { setTimeout( () => { adopt(); }, 0 ); }\n } catch( e ) {\n const styleCopy = window.document.createElement( 'style' );\n style.after( styleCopy );\n styleCopy.textContent = cssText;\n styleSheet = styleCopy.sheet;\n upgradeSheet.call( this, styleSheet, namespaceUUID, !supportsScope && scopeSelector );\n }\n return styleSheet;\n}\n\nfunction upgradeSheet( styleSheet, namespaceUUID, scopeSelector = null ) {\n const l = styleSheet?.cssRules.length || -1;\n for ( let i = 0; i < l; ++i ) {\n const cssRule = styleSheet.cssRules[ i ];\n if ( cssRule instanceof CSSImportRule ) {\n // Handle imported stylesheets\n //upgradeSheet( cssRule.styleSheet, namespaceUUID, scopeSelector );\n continue;\n }\n upgradeRule.call( this, cssRule, namespaceUUID, scopeSelector );\n }\n}\n\nfunction upgradeRule( cssRule, namespaceUUID, scopeSelector = null ) {\n if ( cssRule instanceof CSSStyleRule ) {\n // Resolve relative IDs and scoping (for non-@scope browsers)\n upgradeSelector.call( this, cssRule, namespaceUUID, scopeSelector );\n return;\n }\n if ( [ window.CSSScopeRule, window.CSSMediaRule, window.CSSContainerRule, window.CSSSupportsRule, window.CSSLayerBlockRule ].some( type => type && cssRule instanceof type ) ) {\n // Parse @rule blocks\n const l = cssRule.cssRules.length;\n for ( let i = 0; i < l; ++i ) {\n upgradeRule.call( this, cssRule.cssRules[ i ], namespaceUUID, scopeSelector );\n }\n }\n}\n\nfunction upgradeSelector( cssRule, namespaceUUID, scopeSelector = null ) {\n const newSelectorText = rewriteSelector.call( this, cssRule.selectorText, namespaceUUID, scopeSelector, 1 );\n cssRule.selectorText = newSelectorText;\n // Parse nested blocks. (CSS nesting)\n if ( cssRule.cssRules ) {\n const l = cssRule.cssRules.length;\n for ( let i = 0; i < l; ++i ) {\n upgradeSelector.call( this, cssRule.cssRules[ i ], namespaceUUID, /* Nesting has nothing to do with scopeSelector */ );\n }\n }\n}", "\n/**\n * @imports\n */\nimport NamespacedHTML from './namespaced-html/index.js';\nimport ScopedJS, { idleCompiler as idleCompiler1 } from './scoped-js/index.js';\nimport DataBinding, { idleCompiler as idleCompiler2 } from './data-binding/index.js';\nimport BindingsAPI from './bindings-api/index.js';\nimport HTMLImports from './html-imports/index.js';\nimport ContextAPI from './context-api/index.js';\nimport ScopedCSS from './scoped-css/index.js';\n\n/**\n * @init\n */\nexport default function init( QuantumJS, configs = {} ) {\n if ( !this.webqit ) { this.webqit = {}; }\n Object.assign( this.webqit, QuantumJS );\n // --------------\n ContextAPI.call( this, ( configs.CONTEXT_API || {} ) );\n BindingsAPI.call( this, ( configs.BINDINGS_API || {} ) ); // Depends on ContextAPI\n // Imports must happen before the rest... structure must be flattened before the other things below which query the DOM\n HTMLImports.call( this, { ...( configs.HTML_IMPORTS || {} ), idleCompilers: [ idleCompiler1, idleCompiler2 ] } ); // Depends on ContextAPI\n NamespacedHTML.call( this, ( configs.NAMESPACED_HTML || {} ) ); // Depends on ContextAPI\n DataBinding.call( this, ( configs.DATA_BINDING || {} ) ); // Depends on ContextAPI, BindingsAPI, HTMLImports\n ScopedCSS.call( this, ( configs.SCOPED_CSS || {} ) ); // Depends on NamespacedHTML\n ScopedJS.call( this, ( configs.SCOPED_JS || {} ) );\n}\n", "\n/**\n * @imports\n */\nimport * as QuantumJS from '@webqit/quantum-js/lite';\nimport init from './init.js';\n\n/**\n * @init\n */\ninit.call( window, QuantumJS );"],
|
|
5
|
+
"mappings": "skBAAA,4NCAA,mcCQe,WAAS,EAAK,CAC5B,MAAO,CAAC,MAAM,QAAQ,CAAG,GAAK,MAAO,IAAQ,UAAY,CAC1D,CCFe,YAAS,EAAK,CAC5B,MAAO,OAAO,EACf,CCFe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CAAG,CACzB,CCDe,YAAS,EAAK,CAC5B,MAAO,OAAO,IAAQ,UACvB,CCHe,YAAS,EAAK,CAC5B,MAAO,KAAQ,MAAQ,IAAQ,EAChC,CCFe,YAAS,EAAK,CAC5B,MAAO,WAAU,QAAW,KAAQ,QAAa,MAAO,GAAQ,IACjE,CCIe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CAAG,GAAM,MAAO,IAAQ,UAAY,GAAQ,GAAgB,CAAG,CACrF,CCCe,YAAS,EAAK,CAC5B,MA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