@creejs/commons-events 2.1.4 → 2.1.6

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var r={isFunction:u,isNil:l};function u(t){return "function"==typeof t}function l(t){return null==t}function y(t){return null!=t&&"number"==typeof t}function d(t){return null!=t&&"string"==typeof t}function m(t){return null!=t&&"symbol"==typeof t}var N={assertNumber:E,assertFunction:v,assertNotNil:function(t,e){if(l(t))throw new Error((e?'"'+e+'" ':" ")+"Should Not Nil")},assertString:b,assertStringOrSymbol:function(t,e){if(!d(t)&&!m(t))throw new Error(`${e?'"'+e+'" ':" "}Not String or Symbol: type=${typeof t} value=${JSON.stringify(t)}`)}};function b(t,e){if(!d(t))throw new Error(`${e?'"'+e+'" ':" "}Not String: type=${typeof t} value=${JSON.stringify(t)}`)}function E(t,e){if(!y(t))throw new Error(`${e?'"'+e+'" ':" "}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)}function v(t,e){if(!u(t))throw new Error(`${e?'"'+e+'" ':" "}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)}
5
+ var r={isFunction:s,isNil:f};function s(t){return "function"==typeof t}function f(t){return null==t}function y(t){return null!=t&&"number"==typeof t}function d(t){return null!=t&&"string"==typeof t}function m(t){return null!=t&&"symbol"==typeof t}var b={assertNumber:$,assertFunction:E,assertNotNil:function(t,e){if(f(t))throw new Error((e?'"'+e+'" ':" ")+"Should Not Nil")},assertString:O,assertStringOrSymbol:function(t,e){if(!d(t)&&!m(t))throw new Error(`${e?'"'+e+'" ':" "}Not String or Symbol: type=${typeof t} value=${JSON.stringify(t)}`)}};function O(t,e){if(!d(t))throw new Error(`${e?'"'+e+'" ':" "}Not String: type=${typeof t} value=${JSON.stringify(t)}`)}function $(t,e){if(!y(t))throw new Error(`${e?'"'+e+'" ':" "}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)}function E(t,e){if(!s(t))throw new Error(`${e?'"'+e+'" ':" "}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)}
6
6
 
7
7
  const DefaultOwner = 'DOwner$#$';
8
8
 
@@ -10,7 +10,7 @@ const DefaultOwner = 'DOwner$#$';
10
10
  // internal
11
11
 
12
12
  // module vars
13
- const { assertFunction: assertFunction$2, assertNotNil: assertNotNil$1 } = N;
13
+ const { assertFunction: assertFunction$2, assertNotNil: assertNotNil$1 } = b;
14
14
  /**
15
15
  * Wraps a function to be called when an event is fired.
16
16
  * @typedef {import('./event.js').default} Event
@@ -100,7 +100,7 @@ class Listener {
100
100
 
101
101
  // module vars
102
102
  const { isFunction, isNil: isNil$1 } = r;
103
- const { assertStringOrSymbol: assertStringOrSymbol$1, assertFunction: assertFunction$1 } = N;
103
+ const { assertStringOrSymbol: assertStringOrSymbol$1, assertFunction: assertFunction$1 } = b;
104
104
 
105
105
  /**
106
106
  * An Event definition
@@ -458,7 +458,7 @@ const { isNil } = r;
458
458
  const {
459
459
  assertString, assertFunction, assertNumber,
460
460
  assertStringOrSymbol, assertNotNil
461
- } = N;
461
+ } = b;
462
462
 
463
463
  /**
464
464
  * methods allowed to mixin other objects
@@ -1 +1 @@
1
- {"version":3,"file":"index-dev.cjs","sources":["../../../lang/dist/esm/index-min.js","../../lib/constants.js","../../lib/listener.js","../../lib/event.js","../../lib/event-emitter.js"],"sourcesContent":["var t={constructorName:function(t){return t?.constructor?.name},defaults:function(t,...e){if(null==t)throw new TypeError('\"target\" must not be null or undefined');for(const n of e)if(null!=n)for(const e in n)void 0===t[e]&&(t[e]=n[e]);return t},extend:e,extends:e,equals:function(t,e){if(t===e)return!0;if(\"function\"==typeof t?.equals)return t.equals(e);if(\"function\"==typeof e?.equals)return e.equals(t);return!1},isBrowser:n,isNode:function(){return!n()}};function e(t,...e){if(null==t)throw new TypeError('\"target\" must not be null or undefined');for(const n of e)if(null!=n)for(const e in n)t[e]=n[e];return t}function n(){return\"undefined\"!=typeof window&&\"undefined\"!=typeof document}var r={isArray:o,isBoolean:i,isBuffer:function(t){return null!=t&&Buffer.isBuffer(t)},isFunction:u,isInstance:s,isIterable:function(t){return null!=t&&\"function\"==typeof t[Symbol.iterator]},isDate:function(t){return null!=t&&t instanceof Date},isError:function(t){return null!=t&&t instanceof Error},isMap:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===Map},isWeakMap:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===WeakMap},isNumber:y,isPositive:f,isNegative:c,isNil:l,isNullOrUndefined:function(t){return null==t},isNull:a,isUndefined:p,isPlainObject:g,isObject:h,isPromise:w,isRegExp:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===RegExp},isSet:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===Set},isWeakSet:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===WeakSet},isStream:function(t){return null!=t&&\"function\"==typeof t.pipe},isString:d,isSymbol:m,isPrimitive:function(t){return null!==t&&(\"string\"==typeof t||\"number\"==typeof t||\"boolean\"==typeof t)}};function o(t){return Array.isArray(t)}function i(t){return\"boolean\"==typeof t}function u(t){return\"function\"==typeof t}function s(t){return null!=t&&\"object\"==typeof t&&!g(t)}function l(t){return null==t}function f(t){return!!y(t)&&t>0}function c(t){return!!y(t)&&t<0}function a(t){return null===t}function p(t){return void 0===t}function y(t){return null!=t&&\"number\"==typeof t}function h(t){return null!=t&&\"object\"==typeof t}function g(t){return null!==t&&\"object\"==typeof t&&(t.constructor===Object||void 0===t.constructor)}function w(t){return null!=t&&\"function\"==typeof t.then}function d(t){return null!=t&&\"string\"==typeof t}function m(t){return null!=t&&\"symbol\"==typeof t}var N={assertNumber:E,assertPositive:function(t,e){if(!f(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Positive: ${t}`)},assertNegative:function(t,e){if(!c(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Negative: ${t}`)},assertBoolean:function(t,e){if(!i(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Boolean: type=${typeof t} value=${JSON.stringify(t)}`)},assertObject:function(t,e){if(!h(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Object: type=${typeof t} value=${JSON.stringify(t)}`)},assertPlainObject:function(t,e){if(!g(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not PlainObject: type=${typeof t} value=${JSON.stringify(t)}`)},assertSymbol:function(t,e){if(!m(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Symbol: type=${typeof t} value=${JSON.stringify(t)}`)},assertFunction:v,assertInstance:function(t,e){if(!s(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Class Instance: type=${typeof t} value=${JSON.stringify(t)}`)},assertPromise:S,assertNil:function(t,e){if(!l(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Neither Null nor Undefined: type=${typeof t} value=${JSON.stringify(t)}`)},assertNotNil:function(t,e){if(l(t))throw new Error((e?'\"'+e+'\" ':\" \")+\"Should Not Nil\")},assertNull:function(t,e){if(!a(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Null: type=${typeof t} value=${JSON.stringify(t)}`)},assertNotNull:function(t,e){if(a(t))throw new Error((e?'\"'+e+'\" ':\" \")+\"Should Not Null\")},assertUndefined:function(t,e){if(!p(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Undefined: type=${typeof t} value=${JSON.stringify(t)}`)},assertString:b,assertArray:$,assertStringOrSymbol:function(t,e){if(!d(t)&&!m(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not String or Symbol: type=${typeof t} value=${JSON.stringify(t)}`)}};function $(t,e){if(!Array.isArray(t))throw new Error(`${e?e+\"\":\" \"}Not Array: type=${typeof t} value=${JSON.stringify(t)}`)}function b(t,e){if(!d(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not String: type=${typeof t} value=${JSON.stringify(t)}`)}function E(t,e){if(!y(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)}function v(t,e){if(!u(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)}function S(t,e){if(!w(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Promise: type=${typeof t} value=${JSON.stringify(t)}`)}var O={isEmpty:x,assertNotEmpty:P,isBlank:j,assertNotBlank:function(t){if(j(t))throw new Error(`Blank String: ${t}`)},capitalize:function(t){if(b(t),0===t.length)return t;const e=t.charAt(0),n=e.toUpperCase();return e===n?t:n+t.slice(1)},decapitalize:function(t){if(b(t),0===t.length)return t;const e=t.charAt(0),n=e.toLowerCase();return e===n?t:n+t.slice(1)},splitWithFixedLength:function(t,e,n=\" \"){if(b(t),E(e),b(n),0===t.length)return[];if(e<=0)throw new Error(\"length muse >=0\");if(t.length<e)return[t.padEnd(e,n)];const r=[];for(let o=0;o<t.length;o+=e){const i=t.substring(o,o+e);r.push(i.padEnd(e,n))}return r},split:function(t,...e){b(t);if(0===t.length)return[];const n=[...e];0===e.length&&e.push(\",\");const r=k(t,...n);if(0===r.length)return[];const o=[];let i=\"\",u=0;for(const{marker:e,index:n}of r)i=t.substring(u,n),o.push(i),u=n+e.length;return i=t.substring(u),o.push(i),o},findMarkerPositions:function(t,...e){if(b(t),0===e.length)throw new Error(\"At least one marker must be provided\");const n=[];for(const r of new Set(e)){if(x(r))continue;b(r);let e=t.indexOf(r);for(;-1!==e;)n.push({marker:r,index:e}),e=t.indexOf(r,e+r.length)}return n.sort((t,e)=>t.index-e.index),n},findMarkerPositionsRegex:k,substringBefore:function(t,e){if(b(t),b(e),0===t.length||0===e.length)return;const n=t.indexOf(e);if(-1===n)return;return t.substring(0,n)},substringBeforeLast:function(t,e){if(b(t),b(e),0===t.length||0===e.length)return;const n=t.lastIndexOf(e);if(-1===n)return;return t.substring(0,n)},substringAfter:function(t,e){if(b(t),b(e),0===t.length||0===e.length)return;const n=t.indexOf(e);if(-1===n)return;return t.substring(n+e.length)},substringAfterLast:function(t,e){if(b(t),b(e),0===t.length||0===e.length)return;const n=t.lastIndexOf(e);if(-1===n)return;return t.substring(n+e.length)},substringBetween:function(t,e,n){P(t),P(e),P(n);const r=t.indexOf(e);if(-1===r)return;const o=t.indexOf(n,r+e.length);if(-1===o)return;return t.substring(r+e.length,o)},substringBetweenGreedy:function(t,e,n){P(t),P(e),P(n);const r=t.indexOf(e);if(-1===r)return;const o=t.lastIndexOf(n);if(-1===o||o<=r)return;return t.substring(r+e.length,o)},substringsBetween:function(t,e,n){P(t),P(e),P(n);const r=[];let o=0;for(;;){const i=t.indexOf(e,o);if(-1===i)break;const u=t.indexOf(n,i+e.length);if(-1===u)break;r.push(t.substring(i+e.length,u)),o=u+n.length}return r}};function x(t){return null==t||(b(t),0===t.length)}function P(t){if(x(t))throw new Error(`Empty String: ${t}`)}function j(t){return null==t||(b(t),0===t.trim().length)}function k(t,...e){if(b(t),0===e.length)throw new Error(\"At least one marker must be provided\");const n=[...new Set(e.filter(t=>null!=t))].map(t=>(b(t),t.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\"))),r=new RegExp(n.map(t=>`(${t})`).join(\"|\"),\"g\"),o=[];let i=null;for(;null!==(i=r.exec(t));){for(let t=1;t<i.length;t++)if(i[t]){o.push({marker:e[t-1],index:i.index});break}0===i[0].length&&r.lastIndex++}return o}var T={quiet:function(t){v(t);try{const e=t();return w(e)?e.catch(()=>{}):e}catch(t){}},quietKeepError:function(t,e){v(t),$(e);try{const n=t();return w(n)?n.catch(t=>e.push(t)):n}catch(t){e.push(t)}}},J={defer:A,delay:function(t,e){y(t)?(e=t,t=Promise.resolve()):null==t&&null==e&&(e=1,t=Promise.resolve());null!=t&&S(t),E(e=e??1e3);const n=A(),r=Date.now();return t.then((...t)=>{const o=Date.now()-r;o<e?setTimeout(()=>n.resolve(...t),e-o):n.resolve(...t)}).catch(t=>{const o=Date.now()-r;o<e?setTimeout(()=>n.reject(t),e-o):n.reject(t)}),n.promise},timeout:function(t,e,n){S(t),E(e=e??1);const r=A(e,n),o=Date.now();return t.then((...t)=>{Date.now()-o<=e?r.resolve(...t):r.reject(new Error(n??`Promise Timeout: ${e}ms`))}).catch(t=>{!r.resolved&&!r.rejected&&r.reject(t)}),r.promise},allSettled:B,returnValuePromised:U,series:async function(t){$(t);const e=[];for(const n of t)v(n),e.push(await n());return e},seriesAllSettled:async function(t){$(t);const e=[];for(const n of t){v(n);try{e.push({ok:!0,result:await n()})}catch(t){e.push({ok:!1,result:t})}}return e},parallel:async function(t,e=5){if($(t),E(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>v(t));const n=[];if(t.length<=e){const e=await Promise.all(t.map(t=>U(t)));return n.push(...e),n}const r=[];for(const o of t)if(v(o),r.push(o),r.length>=e){const t=await Promise.all(r.map(t=>U(t)));n.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await Promise.all(r.map(t=>U(t)));n.push(...t)}return n},parallelAllSettled:async function(t,e=5){if($(t),E(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>v(t));const n=[];if(t.length<=e){const e=await B(t.map(t=>U(t)));return n.push(...e),n}const r=[];for(const o of t)if(v(o),r.push(o),r.length>=e){const t=await B(r.map(t=>U(t)));n.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await B(r.map(t=>U(t)));n.push(...t)}return n}};function A(t=-1,e){E(t);const n={};let r;return t>=0&&(n.timerHandler=r=setTimeout(()=>{clearTimeout(r),n.timerCleared=!0,n.reject(new Error(e??`Promise Timeout: ${t}ms`))},t),n.timerHandler=r),n.promise=new Promise((t,e)=>{n.resolve=(...e)=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.resolved=!0,t(...e)},n.reject=t=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.rejected=!0,e(t)}}),n.promise.cancel=()=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.rejected=!0,n.canceled=n.promise.canceled=!0,n.reject(new Error(\"Cancelled\"))},n}async function B(t){$(t);const e=await Promise.allSettled(t),n=[];for(const t of e)\"fulfilled\"===t.status&&n.push({ok:!0,result:t.value}),\"rejected\"===t.status&&n.push({ok:!1,result:t.reason});return n}function U(t){try{const e=t();return w(e)?e:Promise.resolve(e)}catch(t){return Promise.reject(t)}}const{isPlainObject:I}=r;var C={proxy:q,newProxyInstance:function(t,e,n,r=!0){const o=q(t,n,r);return Reflect.construct(o,e??[])}};function q(t,e,n=!0){if(\"function\"!=typeof t)throw new TypeError(`Not Class: type=${typeof t}, value=${JSON.stringify(t)}`);if(null!=e){if(!I(e))throw new TypeError(`Not PropertyHandler: type=${typeof e}, value=${JSON.stringify(e)}`);const{get:t,set:n}=e;if(null!=t&&\"function\"!=typeof t)throw new TypeError(`Not PropertyHandler.get: type=${typeof t}, value=${JSON.stringify(t)}`);if(null!=n&&\"function\"!=typeof n)throw new TypeError(`Not PropertyHandler.set: type=${typeof n}, value=${JSON.stringify(n)}`)}const r={construct(t,r,o){const i=Reflect.construct(t,r);return new Proxy(n?Object.preventExtensions(i):i,e??{})}};return new Proxy(t,r)}var D={proxy:function(t,e,n=!0){if(l(t)||!h(t)||o(t))throw new TypeError(`Not Object: type=${typeof t}, value=${JSON.stringify(t)}`);return new Proxy(n?Object.preventExtensions(t):t,e??{})}},L={LangUtils:t,StringUtils:O,TypeUtils:r,TypeAssert:N,ExecUtils:T,PromiseUtils:J,Lang:t,Type:r,Exec:T,ClassProxyUtils:C,InstanceProxyUtils:D};export{C as ClassProxyUtils,T as Exec,T as ExecUtils,D as InstanceProxyUtils,t as Lang,t as LangUtils,J as PromiseUtils,O as StringUtils,r as Type,N as TypeAssert,r as TypeUtils,L as default};\n//# sourceMappingURL=index-min.js.map\n","export const DefaultOwner = 'DOwner$#$'\nexport default {\n DefaultOwner\n}\n","// 3rd\n// internal\nimport { TypeAssert } from '@creejs/commons-lang'\n\n// owned\nimport { DefaultOwner } from './constants.js'\n\n// module vars\nconst { assertFunction, assertNotNil } = TypeAssert\n/**\n * Wraps a function to be called when an event is fired.\n * @typedef {import('./event.js').default} Event\n * @class Listener\n */\nexport default class Listener {\n /**\n * @param {Event} event\n * @param {function} callback - The function to be called when event is fired\n * @param {boolean} [isOnce=false] - is a one time listener?\n */\n constructor (event, callback, isOnce = false) {\n assertNotNil(event, 'event')\n assertFunction(callback, 'callback')\n this._event = event\n this._callback = callback\n this._isOnce = !!isOnce // is Once Listener?\n this._owner = undefined\n }\n\n /**\n * Sets the owner of this listener.\n * @param {*} owner - The owner object to be associated with this listener.\n */\n set owner (owner) {\n this._owner = owner\n }\n\n get owner () {\n return this._owner === DefaultOwner ? undefined : this._owner\n }\n\n get event () {\n return this._event\n }\n\n get isOnce () {\n return this._isOnce\n }\n\n /**\n * Checks if the provided function is the same as the listener's wrapped function.\n * @param {Function} callback - The function to compare against.\n * @returns {boolean} True if the functions are the same, false otherwise.\n */\n isSameCallback (callback) {\n return this._callback === callback\n }\n\n get callback () {\n return this._callback\n }\n\n /**\n * Invokes the stored function with the provided arguments.\n * @param {...*} args - Arguments to pass to the function.\n * @returns {*} The result of the function invocation.\n */\n invoke (...args) {\n try {\n return this._callback(...args)\n } finally {\n if (this._isOnce) {\n try {\n this._event._remove(this)\n } catch (err) {\n // do nothing\n console.warn(err)\n }\n }\n }\n }\n\n /**\n * Invokes the listener with the provided arguments.\n * Alias for {@linkcode Listener.invoke}\n * @param {...*} args - Arguments to be passed to the listener.\n * @returns {*} The result of the listener invocation.\n */\n listener (...args) {\n return this.invoke(...args)\n }\n}\nexport { Listener as ListenerType }\n","// 3rd\n// internal\nimport { TypeUtils, TypeAssert } from '@creejs/commons-lang'\n\n// owned\n// eslint-disable-next-line no-unused-vars\nimport Listener from './listener.js'\nimport { DefaultOwner } from './constants.js'\n\n// module vars\nconst { isFunction, isNil } = TypeUtils\nconst { assertStringOrSymbol, assertFunction } = TypeAssert\n\n/**\n * An Event definition\n * 1. listeners are grouped by owner\n * * if not specified, group it into one Default owner\n * 2. one listener may belong to multiple owners\n * 3. one owner may have multiple listeners\n */\nexport default class Event {\n static get DefaultOwner () {\n return DefaultOwner\n }\n\n /**\n * Creates a new Event instance with the specified name.\n * @param {string|Symbol} eventName - The name of the event.\n */\n constructor (eventName) {\n assertStringOrSymbol(eventName, 'eventName')\n this._name = eventName\n /**\n * use Set to store unique listeners\n * @type {Set<function>}\n */\n this._callbacks = new Set()\n /**\n * @type {Array<Listener>}\n */\n this._listeners = [] // user array to keep order\n /**\n * @type {Map<function, Set<Listener>>}\n */\n this._callback2Listeners = new Map()\n /**\n * use listener to index owners. One Listener Instance only belongs to one owner\n * @type {Map<Listener, *>}\n */\n this._listener2Owner = new Map()\n /**\n * use \"owner\" to group listeners; one owner may have multiple listeners\n * @type {Map<*, Set<Listener>>}\n */\n this._owner2Listeners = new Map()\n }\n\n /**\n * Name of the event.\n * @returns {string|Symbol}\n */\n get name () {\n return this._name\n }\n\n isEmpty () {\n return this._callbacks.size === 0\n }\n\n /**\n * Returns a copy of the raw listeners array.\n * @returns {Array<Listener>} A shallow copy of the listeners array.\n */\n rawListeners () {\n return [...this._listeners]\n }\n\n /**\n * Returns the number of listeners listening for the event.\n * If callback is provided, it will return how many times the callback is found in the list of the listeners\n * @param {Function} [callback] - The callback function to count\n * @returns {number}\n */\n listenerCount (callback) {\n if (callback == null) {\n return this._listeners.length\n }\n return this._callback2Listeners.get(callback)?.size ?? 0\n }\n\n /**\n * Returns a shallow copy of the registered callbacks array.\n * if one callback function is added multiple times, it will be returned multiple times.\n * @returns {Array<function>} A new array containing all registered callbacks.\n */\n callbacks () {\n return [...this.rawListeners().map(listener => listener.callback)]\n }\n\n /**\n * Emits current event, invoking all registered listeners by order.\n * @param {...*} args - Arguments to be passed to each listener.\n * @returns {boolean} True if the event had listeners, false otherwise.\n */\n emit (...args) {\n if (this._listeners.length === 0) {\n return false\n }\n // Clone _listeners, it may be changed during call listener\n for (const listener of [...this._listeners]) {\n listener.invoke(...args)\n }\n return true\n }\n\n /**\n * Checks if listener is registered with this event.\n * @param {function} callback - The listener function to check.\n * @returns {boolean} True if the listener is registered, false otherwise.\n */\n hasListener (callback) {\n if (!isFunction(callback)) {\n return false\n }\n return this._callbacks.has(callback)\n }\n\n /**\n * Checks if owner has any registered listeners.\n * @param {*} owner - The owner to check for registered listeners.\n * @returns {boolean} True if the owner has listeners, false otherwise.\n */\n hasOwner (owner) {\n if (isNil(owner)) {\n return false\n }\n return this._owner2Listeners.has(owner)\n }\n\n /**\n * Adds an event listener\n * @param {function} callback - The callback function to be invoked when the event occurs.\n * @param {*} [owner] - use \"owner\" to group listeners, then can remove all listeners for an owner.\n * @returns {boolean} true if added, false otherwise.\n */\n addListener (callback, owner) {\n return this._addListener(callback, owner, false, false)\n }\n\n /**\n * Prepends a listener callback to the beginning of the listeners array.\n * No checks are made to see if the listener has already been added.\n * Multiple calls passing the same combination of eventName and listener will result in the listener being added,\n * and called, multiple times.\n * @param {Function} callback - The callback function to be executed when the event is emitted.\n * @param {Object} owner - The owner object to which the listener belongs.\n * @returns {boolean}\n */\n prependListener (callback, owner) {\n return this._addListener(callback, owner, false, true)\n }\n\n /**\n * Adds a one-time listener for the event. The listener is automatically removed after being invoked once.\n * @param {Function} callback - The function to call when the event is triggered.\n * @param {Object} [owner] - The object that owns the callback (used for binding `this` context).\n * @returns {boolean}\n */\n addOnceListener (callback, owner) {\n return this._addListener(callback, owner, true, false)\n }\n\n /**\n * Adds a one-time event listener that will be automatically removed after being triggered once.\n * The listener will only be triggered if the event is pretended (simulated).\n * @param {Function} callback - The function to call when the event is triggered.\n * @param {Object} owner - The object that owns the listener (used for reference tracking).\n * @returns {boolean} The listener function that was added.\n */\n prependOnceListener (callback, owner) {\n return this._addListener(callback, owner, true, true)\n }\n\n /**\n * Adds a listener for the event.\n * @param {Function} callback - The callback function to be executed when the event occurs\n * @param {*} [owner] - The owner object that the listener belongs to (defaults to DeaultOwner)\n * @param {boolean} [isOnce=false] - Whether the listener should be removed after first invocation\n * @param {boolean} [isPrepend=false] - Whether the listener should be inert at the beginning of the listeners array\n * @returns {boolean} Returns true if listener was added successfully, false if callback is nil or duplicate\n * @protected\n */\n _addListener (callback, owner, isOnce, isPrepend) {\n if (isNil(callback)) {\n return false\n }\n assertFunction(callback)\n if (!this._callbacks.has(callback)) {\n this._callbacks.add(callback)\n }\n // a listener must belong to an owner\n owner = owner ?? DefaultOwner\n\n // use Listener to wrap callback\n const listener = new Listener(this, callback, isOnce)\n listener.owner = owner\n if (isPrepend) {\n this._listeners.unshift(listener)\n } else {\n this._listeners.push(listener)\n }\n\n // index, rapadly find one listener's owner\n this._listener2Owner.set(listener, owner)\n\n // one callback function may be registered many times\n let callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners == null) {\n callbackListeners = new Set()\n this._callback2Listeners.set(callback, callbackListeners)\n }\n callbackListeners.add(listener)\n\n // group by owner\n let ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n ownerListeners = new Set()\n this._owner2Listeners.set(owner, ownerListeners)\n }\n ownerListeners.add(listener)\n\n return true\n }\n\n /**\n * Removes a callback\n * @param {Function} callback - The callback function to remove.\n * @returns {boolean} true if removed, false otherwise.\n */\n removeListener (callback) {\n if (isNil(callback)) {\n return false\n }\n if (!this._callbacks.has(callback)) {\n return false\n }\n this._callbacks.delete(callback)\n\n const listeners = this._callback2Listeners.get(callback)\n if (listeners == null) { // should not happen\n return false\n }\n this._callback2Listeners.delete(callback)\n for (const listener of listeners) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(this._listeners.indexOf(listener), 1)\n\n // remove from owner index\n const owner = this._listener2Owner.get(listener)\n if (owner == null) {\n continue\n }\n this._listener2Owner.delete(listener)\n const ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n continue\n }\n ownerListeners.delete(listener)\n if (ownerListeners.size === 0) {\n this._owner2Listeners.delete(owner)\n }\n }\n return true\n }\n\n /**\n * Removes a listener from both global and owner indexes.\n * @param {Listener} listener - The listener function to remove\n */\n _remove (listener) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(index, 1)\n\n // clean callback index\n const { callback } = listener\n const callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners != null) {\n callbackListeners.delete(listener)\n if (callbackListeners.size === 0) {\n this._callback2Listeners.delete(callback)\n this._callbacks.delete(callback)\n }\n }\n\n // remove from owner index\n const owner = this._listener2Owner.get(listener)\n if (owner == null) {\n return\n }\n this._listener2Owner.delete(listener)\n const ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n return\n }\n ownerListeners.delete(listener)\n if (ownerListeners.size === 0) {\n this._owner2Listeners.delete(owner)\n }\n }\n\n /**\n * Removes all event listeners\n * @param {*} [owner] - Without owner, all listeners will be removed; otherwise, only listeners of \"owner\" will be removed.\n * @returns {this}\n */\n removeAllListeners (owner) {\n // remove listeners of owner\n if (isNil(owner)) {\n // remove all Listeners\n this._callbacks.clear()\n this._listeners.length = 0\n this._callback2Listeners.clear()\n this._listener2Owner.clear()\n this._owner2Listeners.clear()\n return this\n }\n // all listeners of the owner\n const ownerListeners = this._owner2Listeners.get(owner)\n // no owner\n if (ownerListeners == null) {\n return this\n }\n // clear owner index\n this._owner2Listeners.delete(owner)\n // clearn listeners of owner one by one\n for (const listener of ownerListeners) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(this._listeners.indexOf(listener), 1)\n\n // clean listener-owner index\n this._listener2Owner.delete(listener)\n\n // one callback function may be registered many times, has many Listeners\n const { callback } = listener\n const callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners == null) {\n continue\n }\n callbackListeners.delete(listener)\n if (callbackListeners.size === 0) {\n this._callback2Listeners.delete(callback)\n this._callbacks.delete(callback)\n }\n }\n return this\n }\n}\n\nexport { Event as EventType }\n","// 3rd\n// internal\nimport { TypeUtils, TypeAssert } from '@creejs/commons-lang'\n\n// owned\nimport Event from './event.js'\n// eslint-disable-next-line no-unused-vars\nimport Listener from './listener.js'\n\n// module vars\nconst { isNil } = TypeUtils\nconst {\n assertString, assertFunction, assertNumber,\n assertStringOrSymbol, assertNotNil\n} = TypeAssert\n\n/**\n * methods allowed to mixin other objects\n */\nconst MixinMethods = [\n 'on', 'once', 'addListener', 'prependListener', 'prependOnceListener',\n 'off', 'offAll', 'offOwner', 'removeAllListeners', 'removeListener',\n 'emit', 'setMaxListeners', 'getMaxListeners', 'hasOwner',\n 'listeners', 'listenerCount', 'eventNames', 'rawListeners'\n]\nlet DefaultMaxListeners = 10\n/**\n * 1. An EventEmitter follows the API of NodeJS EventEmitter.\n * 2. Enhancement:\n * * Listeners are grouped by \"owner\".\n * * Operation via \"owner\"\n * * Duplicate listeners are filtered out. Only unique One kept.\n */\nexport default class EventEmitter {\n /**\n * Mixes EventEmitter methods into the given object.\n * @template T\n * @param {T} obj - The target object to mix methods into.\n * @returns {T} The modified object with EventEmitter methods.\n */\n static mixin (obj) {\n const emitter = new EventEmitter()\n // @ts-ignore\n obj.__emitter = emitter\n for (const name of MixinMethods) {\n // @ts-ignore\n const method = emitter[name]\n // @ts-ignore\n obj[name] = method.bind(emitter)\n }\n return obj\n }\n\n static get defaultMaxListeners () {\n return DefaultMaxListeners\n }\n\n static set defaultMaxListeners (maxListeners) {\n assertNumber(maxListeners)\n DefaultMaxListeners = maxListeners ?? 10\n }\n\n /**\n */\n constructor () {\n /**\n * @type {Map<string|Symbol, Event>}\n */\n this._name2Event = new Map()\n this._maxListeners = DefaultMaxListeners\n }\n\n /**\n * Alias of {@linkcode EventEmitter.addListener}\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n addListener (eventName, listener, owner) {\n return this.on(eventName, listener, owner)\n }\n\n /**\n * Adds the listener function to the beginning of the listeners array for the event named eventName.\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n prependListener (eventName, listener, owner) {\n assertString(eventName)\n assertFunction(listener)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.prependListener(listener, owner)\n return this\n }\n\n /**\n * Adds a one-time listener function for the event named eventName to the beginning of the listeners array.\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n prependOnceListener (eventName, listener, owner) {\n assertString(eventName)\n assertFunction(listener)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.prependOnceListener(listener, owner)\n return this\n }\n\n /**\n * Synchronously calls each of the listeners registered for the event named eventName,\n * in the order they were registered, passing the supplied arguments to each.\n * Returns true if the event had listeners, false otherwise.\n * @param {string|Symbol} eventName - The name of the event.\n * @param {...*} args arguments to pass to the listeners.\n * @returns {boolean}\n */\n emit (eventName, ...args) {\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return false\n }\n event.emit(...args)\n return true\n }\n\n /**\n * Returns an array listing the events for which the emitter has registered listeners.\n * @returns {Array<string|Symbol>} An array of event names.\n */\n eventNames () {\n return [...this._name2Event.keys()]\n }\n\n getMaxListeners () {\n return this._maxListeners\n }\n\n /**\n * Returns the number of listeners listening for the event named eventName.\n * If listener is provided, it will return how many times the listener is found\n * in the list of the listeners of the event.\n * @param {string|Symbol} eventName - The name of the event to check\n * @param {function} [listener] - Optional specific listener to count\n * @returns {number} The number of listeners for the event\n */\n listenerCount (eventName, listener) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return 0\n }\n return event.listenerCount(listener)\n }\n\n /**\n * Returns a copy of the array of listeners for the event named eventName.\n * 1. if a callback function added multiple times, it will be returned multiple times.\n * @param {string} eventName\n * @returns {Array<function>}\n */\n listeners (eventName) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return []\n }\n return event.callbacks()\n }\n\n /**\n * Removes a callback function from a specific event.\n * 1. If the event doesn't exist or has no listeners, do nothing\n * 2. if one callback function added multiple times, all of them will be removed.\n * * !!! This is different from the behavior of Node.js EventEmitter.\n *\n * @param {string} eventName - The name of the event to remove callback from\n * @param {function} callback - The callback function to remove\n * @returns {EventEmitter} Returns the emitter instance for chaining\n */\n off (eventName, callback) {\n const event = this._name2Event.get(eventName)\n if (event == null) {\n return this\n }\n event.removeListener(callback)\n if (event.isEmpty()) {\n this._name2Event.delete(eventName)\n return this\n }\n return this\n }\n\n /**\n * Removes all listeners for the specified event.\n * if owner is limited, only the listeners of the owner will be removed.\n *\n * @param {string|Symbol} eventName - The name of the event to clear listeners for.\n * @param {*} owner - The owner whose listeners should be removed.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n offAll (eventName, owner) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null) {\n return this\n }\n event.removeAllListeners(owner)\n if (event.isEmpty()) {\n this._name2Event.delete(eventName)\n return this\n }\n return this\n }\n\n /**\n * Removes all event listeners belonging to the specified owner.\n * @param {*} owner - The owner whose listeners should be removed.\n * @returns {this}\n */\n offOwner (owner) {\n assertNotNil(owner, 'owner')\n const events = [...this._name2Event.values()]\n for (const event of events) {\n event.removeAllListeners(owner)\n if (event.isEmpty()) {\n this._name2Event.delete(event.name)\n }\n }\n return this\n }\n\n /**\n * Adds the listener function to the end of the listeners array for the event named eventName.\n * @param {string|Symbol} eventName\n * @param {function} callback\n * @param {*} [owner]\n * @returns {this}\n */\n on (eventName, callback, owner) {\n assertString(eventName)\n assertFunction(callback)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.addListener(callback, owner)\n return this\n }\n\n /**\n * Checks if the number of listeners for the given event exceeds the maximum allowed.\n * Emits a warning if the listener count reaches or exceeds the maxListeners threshold.\n * @private\n * @param {string|Symbol} eventName - The name of the event to check\n * @returns {void}\n */\n _checkMaxListeners (eventName) {\n let listenerCount = 0\n if (this._maxListeners !== 0 && this._maxListeners !== Infinity && (listenerCount = this.listenerCount(eventName)) >= this._maxListeners) {\n console.warn(`maxlistenersexceededwarning: Possible EventEmitter memory leak detected. ${listenerCount} ${eventName} listeners added to [${this}]. Use emitter.setMaxListeners() to increase limit`)\n }\n }\n\n /**\n * Adds a listener that will be invoked only once for the event named eventName.SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit`)\n }\n }\n\n /**\n * Adds a one-time callback function for the specified event.\n * The callback is invoked only once and then automatically removed.\n *\n * @param {string} eventName - The name of the event to listen for.\n * @param {Function} callback - The callback function to execute when the event is emitted.\n * @param {*} [owner] - Optional owner used to group listener callbacks.\n * @returns {EventEmitter} Returns the emitter instance for chaining.\n */\n once (eventName, callback, owner) {\n assertString(eventName)\n assertFunction(callback)\n\n const event = this._getOrCreateEvent(eventName)\n event.addOnceListener(callback, owner)\n return this\n }\n\n /**\n * Returns a copy of the array of listeners for the event named eventName,\n * including any wrappers (such as those created by .once()).\n * @param {string} eventName - The name of the event.\n * @returns {Listener[]} An array of raw listener functions, or empty array if none exist.\n */\n rawListeners (eventName) {\n return this._name2Event.get(eventName)?.rawListeners() || []\n }\n\n /**\n * Alias of {@linkcode EventEmitter.offAll}\n * @param {string|Symbol} eventName - The name of the event to remove listeners for.\n * @param {*} owner - The owner of the listeners to be removed.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n removeAllListeners (eventName, owner) {\n return this.offAll(eventName, owner)\n }\n\n /**\n * Alias of {@linkcode EventEmitter.off}\n * @param {string} eventName - The name of the event.\n * @param {Function} callback - The callback function to remove.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n removeListener (eventName, callback) {\n return this.off(eventName, callback)\n }\n\n /**\n * Sets the maximum number of listeners that can be added to this event emitter.\n * @param {number} max - The maximum number of listeners.\n * @returns {this} The set maximum number of listeners.\n */\n setMaxListeners (max) {\n assertNumber(max)\n if (max < 0) {\n throw new RangeError('maxListeners must >=0')\n }\n this._maxListeners = max\n return this\n }\n\n /**\n * Gets an existing event by name or creates a new one if it doesn't exist.\n * @private\n * @param {string|Symbol} eventName - The name of the event to get or create.\n * @returns {Event} The existing or newly created Event instance.\n */\n _getOrCreateEvent (eventName) {\n if (this._name2Event.has(eventName)) {\n // @ts-ignore\n return this._name2Event.get(eventName)\n }\n const event = new Event(eventName)\n this._name2Event.set(eventName, event)\n return event\n }\n\n /**\n * Checks if the specified owner has any registered events.\n * @param {Object} owner - The owner object to check for registered events.\n * @returns {boolean} True if the owner has any registered events, false otherwise.\n */\n hasOwner (owner) {\n if (isNil(owner)) {\n return false\n }\n for (const event of this._name2Event.values()) {\n if (event.hasOwner(owner)) {\n return true\n }\n }\n return false\n }\n}\n\nexport { EventEmitter as EventEmitterType }\n"],"names":["assertFunction","assertNotNil","TypeAssert","isNil","TypeUtils","assertStringOrSymbol"],"mappings":";;;;AAAkrB,IAAI,CAAC,CAAC,CAAgF,UAAU,CAAC,CAAC,CAA6Y,KAAK,CAAC,CAA0hB,CAAC,CAA+E,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAM,UAAU,EAAE,OAAO,CAAC,CAAyD,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAA+H,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAA8M,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAytB,cAAc,CAAC,CAAC,CAA8S,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,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AI,OAAO;AACX,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE,QAAQ,CAAC,CAAC,KAAK,EAAE;AACnB,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE;AACtB,MAAM,OAAO;AACb,IAAI;AACJ,IAAI,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE;AACnD,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACjC,QAAQ,OAAO;AACf,MAAM;AACN,IAAI;AACJ,IAAI,OAAO;AACX,EAAE;AACF;;;;;"}
1
+ {"version":3,"file":"index-dev.cjs","sources":["../../../lang/dist/esm/index-min.js","../../lib/constants.js","../../lib/listener.js","../../lib/event.js","../../lib/event-emitter.js"],"sourcesContent":["var t={constructorName:function(t){return t?.constructor?.name},defaults:function(t,...e){if(null==t)throw new TypeError('\"target\" must not be null or undefined');for(const n of e)if(null!=n)for(const e in n)void 0===t[e]&&(t[e]=n[e]);return t},extend:e,extends:e,equals:function(t,e){if(t===e)return!0;if(\"function\"==typeof t?.equals)return t.equals(e);if(\"function\"==typeof e?.equals)return e.equals(t);return!1},isBrowser:n,isNode:function(){return!n()}};function e(t,...e){if(null==t)throw new TypeError('\"target\" must not be null or undefined');for(const n of e)if(null!=n)for(const e in n)t[e]=n[e];return t}function n(){return\"undefined\"!=typeof window&&\"undefined\"!=typeof document}var r={isArray:o,isBoolean:i,isBuffer:function(t){return null!=t&&Buffer.isBuffer(t)},isFunction:s,isInstance:u,isIterable:function(t){return null!=t&&\"function\"==typeof t[Symbol.iterator]},isDate:function(t){return null!=t&&t instanceof Date},isError:function(t){return null!=t&&t instanceof Error},isMap:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===Map},isWeakMap:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===WeakMap},isNumber:y,isPositive:l,isNegative:c,isNil:f,isNullOrUndefined:function(t){return null==t},isNull:a,isUndefined:p,isPlainObject:g,isObject:h,isPromise:w,isRegExp:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===RegExp},isSet:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===Set},isWeakSet:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===WeakSet},isStream:function(t){return null!=t&&\"function\"==typeof t.pipe},isString:d,isSymbol:m,isPrimitive:function(t){return null!==t&&(\"string\"==typeof t||\"number\"==typeof t||\"boolean\"==typeof t)}};function o(t){return Array.isArray(t)}function i(t){return\"boolean\"==typeof t}function s(t){return\"function\"==typeof t}function u(t){return null!=t&&\"object\"==typeof t&&!g(t)}function f(t){return null==t}function l(t){return!!y(t)&&t>0}function c(t){return!!y(t)&&t<0}function a(t){return null===t}function p(t){return void 0===t}function y(t){return null!=t&&\"number\"==typeof t}function h(t){return null!=t&&\"object\"==typeof t}function g(t){return null!==t&&\"object\"==typeof t&&(t.constructor===Object||void 0===t.constructor)}function w(t){return null!=t&&\"function\"==typeof t.then}function d(t){return null!=t&&\"string\"==typeof t}function m(t){return null!=t&&\"symbol\"==typeof t}var b={assertNumber:$,assertPositive:function(t,e){if(!l(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Positive: ${t}`)},assertNegative:function(t,e){if(!c(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Negative: ${t}`)},assertBoolean:function(t,e){if(!i(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Boolean: type=${typeof t} value=${JSON.stringify(t)}`)},assertObject:v,assertPlainObject:function(t,e){if(!g(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not PlainObject: type=${typeof t} value=${JSON.stringify(t)}`)},assertSymbol:function(t,e){if(!m(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Symbol: type=${typeof t} value=${JSON.stringify(t)}`)},assertFunction:E,assertInstance:function(t,e){if(!u(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Class Instance: type=${typeof t} value=${JSON.stringify(t)}`)},assertPromise:S,assertNil:function(t,e){if(!f(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Neither Null nor Undefined: type=${typeof t} value=${JSON.stringify(t)}`)},assertNotNil:function(t,e){if(f(t))throw new Error((e?'\"'+e+'\" ':\" \")+\"Should Not Nil\")},assertNull:function(t,e){if(!a(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Null: type=${typeof t} value=${JSON.stringify(t)}`)},assertNotNull:function(t,e){if(a(t))throw new Error((e?'\"'+e+'\" ':\" \")+\"Should Not Null\")},assertUndefined:function(t,e){if(!p(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Undefined: type=${typeof t} value=${JSON.stringify(t)}`)},assertString:O,assertArray:N,assertStringOrSymbol:function(t,e){if(!d(t)&&!m(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not String or Symbol: type=${typeof t} value=${JSON.stringify(t)}`)}};function N(t,e){if(!Array.isArray(t))throw new Error(`${e?e+\"\":\" \"}Not Array: type=${typeof t} value=${JSON.stringify(t)}`)}function O(t,e){if(!d(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not String: type=${typeof t} value=${JSON.stringify(t)}`)}function $(t,e){if(!y(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)}function v(t,e){if(!h(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Object: type=${typeof t} value=${JSON.stringify(t)}`)}function E(t,e){if(!s(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)}function S(t,e){if(!w(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Promise: type=${typeof t} value=${JSON.stringify(t)}`)}var j={isEmpty:P,assertNotEmpty:x,isBlank:k,assertNotBlank:function(t){if(k(t))throw new Error(`Blank String: ${t}`)},capitalize:function(t){if(O(t),0===t.length)return t;const e=t.charAt(0),n=e.toUpperCase();return e===n?t:n+t.slice(1)},decapitalize:function(t){if(O(t),0===t.length)return t;const e=t.charAt(0),n=e.toLowerCase();return e===n?t:n+t.slice(1)},splitWithFixedLength:function(t,e,n=\" \"){if(O(t),$(e),O(n),0===t.length)return[];if(e<=0)throw new Error(\"length muse >=0\");if(t.length<e)return[t.padEnd(e,n)];const r=[];for(let o=0;o<t.length;o+=e){const i=t.substring(o,o+e);r.push(i.padEnd(e,n))}return r},split:function(t,...e){O(t);if(0===t.length)return[];const n=[...e];0===e.length&&e.push(\",\");const r=T(t,...n);if(0===r.length)return[];const o=[];let i=\"\",s=0;for(const{marker:e,index:n}of r)i=t.substring(s,n),o.push(i),s=n+e.length;return i=t.substring(s),o.push(i),o},findMarkerPositions:function(t,...e){if(O(t),0===e.length)throw new Error(\"At least one marker must be provided\");const n=[];for(const r of new Set(e)){if(P(r))continue;O(r);let e=t.indexOf(r);for(;-1!==e;)n.push({marker:r,index:e}),e=t.indexOf(r,e+r.length)}return n.sort((t,e)=>t.index-e.index),n},findMarkerPositionsRegex:T,substringBefore:function(t,e){if(O(t),O(e),0===t.length||0===e.length)return;const n=t.indexOf(e);if(-1===n)return;return t.substring(0,n)},substringBeforeLast:function(t,e){if(O(t),O(e),0===t.length||0===e.length)return;const n=t.lastIndexOf(e);if(-1===n)return;return t.substring(0,n)},substringAfter:function(t,e){if(O(t),O(e),0===t.length||0===e.length)return;const n=t.indexOf(e);if(-1===n)return;return t.substring(n+e.length)},substringAfterLast:function(t,e){if(O(t),O(e),0===t.length||0===e.length)return;const n=t.lastIndexOf(e);if(-1===n)return;return t.substring(n+e.length)},substringBetween:function(t,e,n){x(t),x(e),x(n);const r=t.indexOf(e);if(-1===r)return;const o=t.indexOf(n,r+e.length);if(-1===o)return;return t.substring(r+e.length,o)},substringBetweenGreedy:function(t,e,n){x(t),x(e),x(n);const r=t.indexOf(e);if(-1===r)return;const o=t.lastIndexOf(n);if(-1===o||o<=r)return;return t.substring(r+e.length,o)},substringsBetween:function(t,e,n){x(t),x(e),x(n);const r=[];let o=0;for(;;){const i=t.indexOf(e,o);if(-1===i)break;const s=t.indexOf(n,i+e.length);if(-1===s)break;r.push(t.substring(i+e.length,s)),o=s+n.length}return r}};function P(t){return null==t||(O(t),0===t.length)}function x(t){if(P(t))throw new Error(`Empty String: ${t}`)}function k(t){return null==t||(O(t),0===t.trim().length)}function T(t,...e){if(O(t),0===e.length)throw new Error(\"At least one marker must be provided\");const n=[...new Set(e.filter(t=>null!=t))].map(t=>(O(t),t.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\"))),r=new RegExp(n.map(t=>`(${t})`).join(\"|\"),\"g\"),o=[];let i=null;for(;null!==(i=r.exec(t));){for(let t=1;t<i.length;t++)if(i[t]){o.push({marker:e[t-1],index:i.index});break}0===i[0].length&&r.lastIndex++}return o}var J={quiet:function(t){E(t);try{const e=t();return w(e)?e.catch(()=>{}):e}catch(t){}},quietKeepError:function(t,e){E(t),N(e);try{const n=t();return w(n)?n.catch(t=>e.push(t)):n}catch(t){e.push(t)}}},A={defer:B,delay:function(t,e){y(t)?(e=t,t=Promise.resolve()):null==t&&null==e&&(e=1,t=Promise.resolve());null!=t&&S(t),$(e=e??1e3);const n=B(),r=Date.now();return t.then((...t)=>{const o=Date.now()-r;o<e?setTimeout(()=>n.resolve(...t),e-o):n.resolve(...t)}).catch(t=>{const o=Date.now()-r;o<e?setTimeout(()=>n.reject(t),e-o):n.reject(t)}),n.promise},timeout:function(t,e,n){S(t),$(e=e??1);const r=B(e,n),o=Date.now();return t.then((...t)=>{Date.now()-o<=e?r.resolve(...t):r.reject(new Error(n??`Promise Timeout: ${e}ms`))}).catch(t=>{!r.resolved&&!r.rejected&&r.reject(t)}),r.promise},allSettled:U,returnValuePromised:C,series:async function(t){N(t);const e=[];for(const n of t)E(n),e.push(await n());return e},seriesAllSettled:async function(t){N(t);const e=[];for(const n of t){E(n);try{e.push({ok:!0,result:await n()})}catch(t){e.push({ok:!1,result:t})}}return e},parallel:async function(t,e=5){if(N(t),$(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>E(t));const n=[];if(t.length<=e){const e=await Promise.all(t.map(t=>C(t)));return n.push(...e),n}const r=[];for(const o of t)if(E(o),r.push(o),r.length>=e){const t=await Promise.all(r.map(t=>C(t)));n.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await Promise.all(r.map(t=>C(t)));n.push(...t)}return n},parallelAllSettled:async function(t,e=5){if(N(t),$(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>E(t));const n=[];if(t.length<=e){const e=await U(t.map(t=>C(t)));return n.push(...e),n}const r=[];for(const o of t)if(E(o),r.push(o),r.length>=e){const t=await U(r.map(t=>C(t)));n.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await U(r.map(t=>C(t)));n.push(...t)}return n}};function B(t=-1,e){$(t);const n={};let r;return t>=0&&(n.timerHandler=r=setTimeout(()=>{clearTimeout(r),n.timerCleared=!0,n.reject(new Error(e??`Promise Timeout: ${t}ms`))},t),n.timerHandler=r),n.promise=new Promise((t,e)=>{n.resolve=(...e)=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.resolved=!0,t(...e)},n.reject=t=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.rejected=!0,e(t)}}),n.promise.cancel=()=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.rejected=!0,n.canceled=n.promise.canceled=!0,n.reject(new Error(\"Cancelled\"))},n}async function U(t){N(t);const e=await Promise.allSettled(t),n=[];for(const t of e)\"fulfilled\"===t.status&&n.push({ok:!0,result:t.value}),\"rejected\"===t.status&&n.push({ok:!1,result:t.reason});return n}function C(t){try{const e=t();return w(e)?e:Promise.resolve(e)}catch(t){return Promise.reject(t)}}const{isPlainObject:I}=r;var M={proxy:q,newProxyInstance:function(t,e,n,r=!0){const o=q(t,n,r);return Reflect.construct(o,e??[])}};function q(t,e,n=!0){if(\"function\"!=typeof t)throw new TypeError(`Not Class: type=${typeof t}, value=${JSON.stringify(t)}`);if(null!=e){if(!I(e))throw new TypeError(`Not PropertyHandler: type=${typeof e}, value=${JSON.stringify(e)}`);const{get:t,set:n}=e;if(null!=t&&\"function\"!=typeof t)throw new TypeError(`Not PropertyHandler.get: type=${typeof t}, value=${JSON.stringify(t)}`);if(null!=n&&\"function\"!=typeof n)throw new TypeError(`Not PropertyHandler.set: type=${typeof n}, value=${JSON.stringify(n)}`)}const r={construct(t,r,o){const i=Reflect.construct(t,r);return new Proxy(n?Object.preventExtensions(i):i,e??{})}};return new Proxy(t,r)}var D={proxy:function(t,e,n=!0){if(f(t)||!h(t)||o(t))throw new TypeError(`Not Object: type=${typeof t}, value=${JSON.stringify(t)}`);return new Proxy(n?Object.preventExtensions(t):t,e??{})}};function L(t){v(t,\"obj\");const e=new Set;let n=t;for(;n&&n!==Object.prototype;){const r=Object.getOwnPropertyNames(n);for(const n of r)\"constructor\"!==n&&\"function\"==typeof t[n]&&e.add(n);n=Object.getPrototypeOf(n)}return[...new Set(e)]}var R={getMethodsOfClass:function(t){E(t,\"cls\");const e=new Set;let n=t.prototype;for(;n&&n!==Object.prototype;){const t=Object.getOwnPropertyNames(n);for(const r of t)\"constructor\"!==r&&\"function\"==typeof n[r]&&e.add(r);n=Object.getPrototypeOf(n)}return[...new Set(e)]},getStaticMethodsOfClass:function(t){E(t,\"cls\");const e=new Set;let n=t;for(;n&&n!==Object.getPrototypeOf(Object);){const t=Object.getOwnPropertyNames(n);for(const r of t)\"function\"==typeof n[r]&&e.add(r);n=Object.getPrototypeOf(n)}return[...e]},getMethods:L,getMethodsOfObject:L},H={LangUtils:t,StringUtils:j,TypeUtils:r,TypeAssert:b,ExecUtils:J,PromiseUtils:A,Lang:t,Type:r,Exec:J,ClassProxyUtils:M,InstanceProxyUtils:D,ReflectUtils:R};export{M as ClassProxyUtils,J as Exec,J as ExecUtils,D as InstanceProxyUtils,t as Lang,t as LangUtils,A as PromiseUtils,R as ReflectUtils,j as StringUtils,r as Type,b as TypeAssert,r as TypeUtils,H as default};\n//# sourceMappingURL=index-min.js.map\n","export const DefaultOwner = 'DOwner$#$'\nexport default {\n DefaultOwner\n}\n","// 3rd\n// internal\nimport { TypeAssert } from '@creejs/commons-lang'\n\n// owned\nimport { DefaultOwner } from './constants.js'\n\n// module vars\nconst { assertFunction, assertNotNil } = TypeAssert\n/**\n * Wraps a function to be called when an event is fired.\n * @typedef {import('./event.js').default} Event\n * @class Listener\n */\nexport default class Listener {\n /**\n * @param {Event} event\n * @param {function} callback - The function to be called when event is fired\n * @param {boolean} [isOnce=false] - is a one time listener?\n */\n constructor (event, callback, isOnce = false) {\n assertNotNil(event, 'event')\n assertFunction(callback, 'callback')\n this._event = event\n this._callback = callback\n this._isOnce = !!isOnce // is Once Listener?\n this._owner = undefined\n }\n\n /**\n * Sets the owner of this listener.\n * @param {*} owner - The owner object to be associated with this listener.\n */\n set owner (owner) {\n this._owner = owner\n }\n\n get owner () {\n return this._owner === DefaultOwner ? undefined : this._owner\n }\n\n get event () {\n return this._event\n }\n\n get isOnce () {\n return this._isOnce\n }\n\n /**\n * Checks if the provided function is the same as the listener's wrapped function.\n * @param {Function} callback - The function to compare against.\n * @returns {boolean} True if the functions are the same, false otherwise.\n */\n isSameCallback (callback) {\n return this._callback === callback\n }\n\n get callback () {\n return this._callback\n }\n\n /**\n * Invokes the stored function with the provided arguments.\n * @param {...*} args - Arguments to pass to the function.\n * @returns {*} The result of the function invocation.\n */\n invoke (...args) {\n try {\n return this._callback(...args)\n } finally {\n if (this._isOnce) {\n try {\n this._event._remove(this)\n } catch (err) {\n // do nothing\n console.warn(err)\n }\n }\n }\n }\n\n /**\n * Invokes the listener with the provided arguments.\n * Alias for {@linkcode Listener.invoke}\n * @param {...*} args - Arguments to be passed to the listener.\n * @returns {*} The result of the listener invocation.\n */\n listener (...args) {\n return this.invoke(...args)\n }\n}\nexport { Listener as ListenerType }\n","// 3rd\n// internal\nimport { TypeUtils, TypeAssert } from '@creejs/commons-lang'\n\n// owned\n// eslint-disable-next-line no-unused-vars\nimport Listener from './listener.js'\nimport { DefaultOwner } from './constants.js'\n\n// module vars\nconst { isFunction, isNil } = TypeUtils\nconst { assertStringOrSymbol, assertFunction } = TypeAssert\n\n/**\n * An Event definition\n * 1. listeners are grouped by owner\n * * if not specified, group it into one Default owner\n * 2. one listener may belong to multiple owners\n * 3. one owner may have multiple listeners\n */\nexport default class Event {\n static get DefaultOwner () {\n return DefaultOwner\n }\n\n /**\n * Creates a new Event instance with the specified name.\n * @param {string|Symbol} eventName - The name of the event.\n */\n constructor (eventName) {\n assertStringOrSymbol(eventName, 'eventName')\n this._name = eventName\n /**\n * use Set to store unique listeners\n * @type {Set<function>}\n */\n this._callbacks = new Set()\n /**\n * @type {Array<Listener>}\n */\n this._listeners = [] // user array to keep order\n /**\n * @type {Map<function, Set<Listener>>}\n */\n this._callback2Listeners = new Map()\n /**\n * use listener to index owners. One Listener Instance only belongs to one owner\n * @type {Map<Listener, *>}\n */\n this._listener2Owner = new Map()\n /**\n * use \"owner\" to group listeners; one owner may have multiple listeners\n * @type {Map<*, Set<Listener>>}\n */\n this._owner2Listeners = new Map()\n }\n\n /**\n * Name of the event.\n * @returns {string|Symbol}\n */\n get name () {\n return this._name\n }\n\n isEmpty () {\n return this._callbacks.size === 0\n }\n\n /**\n * Returns a copy of the raw listeners array.\n * @returns {Array<Listener>} A shallow copy of the listeners array.\n */\n rawListeners () {\n return [...this._listeners]\n }\n\n /**\n * Returns the number of listeners listening for the event.\n * If callback is provided, it will return how many times the callback is found in the list of the listeners\n * @param {Function} [callback] - The callback function to count\n * @returns {number}\n */\n listenerCount (callback) {\n if (callback == null) {\n return this._listeners.length\n }\n return this._callback2Listeners.get(callback)?.size ?? 0\n }\n\n /**\n * Returns a shallow copy of the registered callbacks array.\n * if one callback function is added multiple times, it will be returned multiple times.\n * @returns {Array<function>} A new array containing all registered callbacks.\n */\n callbacks () {\n return [...this.rawListeners().map(listener => listener.callback)]\n }\n\n /**\n * Emits current event, invoking all registered listeners by order.\n * @param {...*} args - Arguments to be passed to each listener.\n * @returns {boolean} True if the event had listeners, false otherwise.\n */\n emit (...args) {\n if (this._listeners.length === 0) {\n return false\n }\n // Clone _listeners, it may be changed during call listener\n for (const listener of [...this._listeners]) {\n listener.invoke(...args)\n }\n return true\n }\n\n /**\n * Checks if listener is registered with this event.\n * @param {function} callback - The listener function to check.\n * @returns {boolean} True if the listener is registered, false otherwise.\n */\n hasListener (callback) {\n if (!isFunction(callback)) {\n return false\n }\n return this._callbacks.has(callback)\n }\n\n /**\n * Checks if owner has any registered listeners.\n * @param {*} owner - The owner to check for registered listeners.\n * @returns {boolean} True if the owner has listeners, false otherwise.\n */\n hasOwner (owner) {\n if (isNil(owner)) {\n return false\n }\n return this._owner2Listeners.has(owner)\n }\n\n /**\n * Adds an event listener\n * @param {function} callback - The callback function to be invoked when the event occurs.\n * @param {*} [owner] - use \"owner\" to group listeners, then can remove all listeners for an owner.\n * @returns {boolean} true if added, false otherwise.\n */\n addListener (callback, owner) {\n return this._addListener(callback, owner, false, false)\n }\n\n /**\n * Prepends a listener callback to the beginning of the listeners array.\n * No checks are made to see if the listener has already been added.\n * Multiple calls passing the same combination of eventName and listener will result in the listener being added,\n * and called, multiple times.\n * @param {Function} callback - The callback function to be executed when the event is emitted.\n * @param {Object} owner - The owner object to which the listener belongs.\n * @returns {boolean}\n */\n prependListener (callback, owner) {\n return this._addListener(callback, owner, false, true)\n }\n\n /**\n * Adds a one-time listener for the event. The listener is automatically removed after being invoked once.\n * @param {Function} callback - The function to call when the event is triggered.\n * @param {Object} [owner] - The object that owns the callback (used for binding `this` context).\n * @returns {boolean}\n */\n addOnceListener (callback, owner) {\n return this._addListener(callback, owner, true, false)\n }\n\n /**\n * Adds a one-time event listener that will be automatically removed after being triggered once.\n * The listener will only be triggered if the event is pretended (simulated).\n * @param {Function} callback - The function to call when the event is triggered.\n * @param {Object} owner - The object that owns the listener (used for reference tracking).\n * @returns {boolean} The listener function that was added.\n */\n prependOnceListener (callback, owner) {\n return this._addListener(callback, owner, true, true)\n }\n\n /**\n * Adds a listener for the event.\n * @param {Function} callback - The callback function to be executed when the event occurs\n * @param {*} [owner] - The owner object that the listener belongs to (defaults to DeaultOwner)\n * @param {boolean} [isOnce=false] - Whether the listener should be removed after first invocation\n * @param {boolean} [isPrepend=false] - Whether the listener should be inert at the beginning of the listeners array\n * @returns {boolean} Returns true if listener was added successfully, false if callback is nil or duplicate\n * @protected\n */\n _addListener (callback, owner, isOnce, isPrepend) {\n if (isNil(callback)) {\n return false\n }\n assertFunction(callback)\n if (!this._callbacks.has(callback)) {\n this._callbacks.add(callback)\n }\n // a listener must belong to an owner\n owner = owner ?? DefaultOwner\n\n // use Listener to wrap callback\n const listener = new Listener(this, callback, isOnce)\n listener.owner = owner\n if (isPrepend) {\n this._listeners.unshift(listener)\n } else {\n this._listeners.push(listener)\n }\n\n // index, rapadly find one listener's owner\n this._listener2Owner.set(listener, owner)\n\n // one callback function may be registered many times\n let callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners == null) {\n callbackListeners = new Set()\n this._callback2Listeners.set(callback, callbackListeners)\n }\n callbackListeners.add(listener)\n\n // group by owner\n let ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n ownerListeners = new Set()\n this._owner2Listeners.set(owner, ownerListeners)\n }\n ownerListeners.add(listener)\n\n return true\n }\n\n /**\n * Removes a callback\n * @param {Function} callback - The callback function to remove.\n * @returns {boolean} true if removed, false otherwise.\n */\n removeListener (callback) {\n if (isNil(callback)) {\n return false\n }\n if (!this._callbacks.has(callback)) {\n return false\n }\n this._callbacks.delete(callback)\n\n const listeners = this._callback2Listeners.get(callback)\n if (listeners == null) { // should not happen\n return false\n }\n this._callback2Listeners.delete(callback)\n for (const listener of listeners) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(this._listeners.indexOf(listener), 1)\n\n // remove from owner index\n const owner = this._listener2Owner.get(listener)\n if (owner == null) {\n continue\n }\n this._listener2Owner.delete(listener)\n const ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n continue\n }\n ownerListeners.delete(listener)\n if (ownerListeners.size === 0) {\n this._owner2Listeners.delete(owner)\n }\n }\n return true\n }\n\n /**\n * Removes a listener from both global and owner indexes.\n * @param {Listener} listener - The listener function to remove\n */\n _remove (listener) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(index, 1)\n\n // clean callback index\n const { callback } = listener\n const callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners != null) {\n callbackListeners.delete(listener)\n if (callbackListeners.size === 0) {\n this._callback2Listeners.delete(callback)\n this._callbacks.delete(callback)\n }\n }\n\n // remove from owner index\n const owner = this._listener2Owner.get(listener)\n if (owner == null) {\n return\n }\n this._listener2Owner.delete(listener)\n const ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n return\n }\n ownerListeners.delete(listener)\n if (ownerListeners.size === 0) {\n this._owner2Listeners.delete(owner)\n }\n }\n\n /**\n * Removes all event listeners\n * @param {*} [owner] - Without owner, all listeners will be removed; otherwise, only listeners of \"owner\" will be removed.\n * @returns {this}\n */\n removeAllListeners (owner) {\n // remove listeners of owner\n if (isNil(owner)) {\n // remove all Listeners\n this._callbacks.clear()\n this._listeners.length = 0\n this._callback2Listeners.clear()\n this._listener2Owner.clear()\n this._owner2Listeners.clear()\n return this\n }\n // all listeners of the owner\n const ownerListeners = this._owner2Listeners.get(owner)\n // no owner\n if (ownerListeners == null) {\n return this\n }\n // clear owner index\n this._owner2Listeners.delete(owner)\n // clearn listeners of owner one by one\n for (const listener of ownerListeners) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(this._listeners.indexOf(listener), 1)\n\n // clean listener-owner index\n this._listener2Owner.delete(listener)\n\n // one callback function may be registered many times, has many Listeners\n const { callback } = listener\n const callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners == null) {\n continue\n }\n callbackListeners.delete(listener)\n if (callbackListeners.size === 0) {\n this._callback2Listeners.delete(callback)\n this._callbacks.delete(callback)\n }\n }\n return this\n }\n}\n\nexport { Event as EventType }\n","// 3rd\n// internal\nimport { TypeUtils, TypeAssert } from '@creejs/commons-lang'\n\n// owned\nimport Event from './event.js'\n// eslint-disable-next-line no-unused-vars\nimport Listener from './listener.js'\n\n// module vars\nconst { isNil } = TypeUtils\nconst {\n assertString, assertFunction, assertNumber,\n assertStringOrSymbol, assertNotNil\n} = TypeAssert\n\n/**\n * methods allowed to mixin other objects\n */\nconst MixinMethods = [\n 'on', 'once', 'addListener', 'prependListener', 'prependOnceListener',\n 'off', 'offAll', 'offOwner', 'removeAllListeners', 'removeListener',\n 'emit', 'setMaxListeners', 'getMaxListeners', 'hasOwner',\n 'listeners', 'listenerCount', 'eventNames', 'rawListeners'\n]\nlet DefaultMaxListeners = 10\n/**\n * 1. An EventEmitter follows the API of NodeJS EventEmitter.\n * 2. Enhancement:\n * * Listeners are grouped by \"owner\".\n * * Operation via \"owner\"\n * * Duplicate listeners are filtered out. Only unique One kept.\n */\nexport default class EventEmitter {\n /**\n * Mixes EventEmitter methods into the given object.\n * @template T\n * @param {T} obj - The target object to mix methods into.\n * @returns {T} The modified object with EventEmitter methods.\n */\n static mixin (obj) {\n const emitter = new EventEmitter()\n // @ts-ignore\n obj.__emitter = emitter\n for (const name of MixinMethods) {\n // @ts-ignore\n const method = emitter[name]\n // @ts-ignore\n obj[name] = method.bind(emitter)\n }\n return obj\n }\n\n static get defaultMaxListeners () {\n return DefaultMaxListeners\n }\n\n static set defaultMaxListeners (maxListeners) {\n assertNumber(maxListeners)\n DefaultMaxListeners = maxListeners ?? 10\n }\n\n /**\n */\n constructor () {\n /**\n * @type {Map<string|Symbol, Event>}\n */\n this._name2Event = new Map()\n this._maxListeners = DefaultMaxListeners\n }\n\n /**\n * Alias of {@linkcode EventEmitter.addListener}\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n addListener (eventName, listener, owner) {\n return this.on(eventName, listener, owner)\n }\n\n /**\n * Adds the listener function to the beginning of the listeners array for the event named eventName.\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n prependListener (eventName, listener, owner) {\n assertString(eventName)\n assertFunction(listener)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.prependListener(listener, owner)\n return this\n }\n\n /**\n * Adds a one-time listener function for the event named eventName to the beginning of the listeners array.\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n prependOnceListener (eventName, listener, owner) {\n assertString(eventName)\n assertFunction(listener)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.prependOnceListener(listener, owner)\n return this\n }\n\n /**\n * Synchronously calls each of the listeners registered for the event named eventName,\n * in the order they were registered, passing the supplied arguments to each.\n * Returns true if the event had listeners, false otherwise.\n * @param {string|Symbol} eventName - The name of the event.\n * @param {...*} args arguments to pass to the listeners.\n * @returns {boolean}\n */\n emit (eventName, ...args) {\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return false\n }\n event.emit(...args)\n return true\n }\n\n /**\n * Returns an array listing the events for which the emitter has registered listeners.\n * @returns {Array<string|Symbol>} An array of event names.\n */\n eventNames () {\n return [...this._name2Event.keys()]\n }\n\n getMaxListeners () {\n return this._maxListeners\n }\n\n /**\n * Returns the number of listeners listening for the event named eventName.\n * If listener is provided, it will return how many times the listener is found\n * in the list of the listeners of the event.\n * @param {string|Symbol} eventName - The name of the event to check\n * @param {function} [listener] - Optional specific listener to count\n * @returns {number} The number of listeners for the event\n */\n listenerCount (eventName, listener) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return 0\n }\n return event.listenerCount(listener)\n }\n\n /**\n * Returns a copy of the array of listeners for the event named eventName.\n * 1. if a callback function added multiple times, it will be returned multiple times.\n * @param {string} eventName\n * @returns {Array<function>}\n */\n listeners (eventName) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return []\n }\n return event.callbacks()\n }\n\n /**\n * Removes a callback function from a specific event.\n * 1. If the event doesn't exist or has no listeners, do nothing\n * 2. if one callback function added multiple times, all of them will be removed.\n * * !!! This is different from the behavior of Node.js EventEmitter.\n *\n * @param {string} eventName - The name of the event to remove callback from\n * @param {function} callback - The callback function to remove\n * @returns {EventEmitter} Returns the emitter instance for chaining\n */\n off (eventName, callback) {\n const event = this._name2Event.get(eventName)\n if (event == null) {\n return this\n }\n event.removeListener(callback)\n if (event.isEmpty()) {\n this._name2Event.delete(eventName)\n return this\n }\n return this\n }\n\n /**\n * Removes all listeners for the specified event.\n * if owner is limited, only the listeners of the owner will be removed.\n *\n * @param {string|Symbol} eventName - The name of the event to clear listeners for.\n * @param {*} owner - The owner whose listeners should be removed.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n offAll (eventName, owner) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null) {\n return this\n }\n event.removeAllListeners(owner)\n if (event.isEmpty()) {\n this._name2Event.delete(eventName)\n return this\n }\n return this\n }\n\n /**\n * Removes all event listeners belonging to the specified owner.\n * @param {*} owner - The owner whose listeners should be removed.\n * @returns {this}\n */\n offOwner (owner) {\n assertNotNil(owner, 'owner')\n const events = [...this._name2Event.values()]\n for (const event of events) {\n event.removeAllListeners(owner)\n if (event.isEmpty()) {\n this._name2Event.delete(event.name)\n }\n }\n return this\n }\n\n /**\n * Adds the listener function to the end of the listeners array for the event named eventName.\n * @param {string|Symbol} eventName\n * @param {function} callback\n * @param {*} [owner]\n * @returns {this}\n */\n on (eventName, callback, owner) {\n assertString(eventName)\n assertFunction(callback)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.addListener(callback, owner)\n return this\n }\n\n /**\n * Checks if the number of listeners for the given event exceeds the maximum allowed.\n * Emits a warning if the listener count reaches or exceeds the maxListeners threshold.\n * @private\n * @param {string|Symbol} eventName - The name of the event to check\n * @returns {void}\n */\n _checkMaxListeners (eventName) {\n let listenerCount = 0\n if (this._maxListeners !== 0 && this._maxListeners !== Infinity && (listenerCount = this.listenerCount(eventName)) >= this._maxListeners) {\n console.warn(`maxlistenersexceededwarning: Possible EventEmitter memory leak detected. ${listenerCount} ${eventName} listeners added to [${this}]. Use emitter.setMaxListeners() to increase limit`)\n }\n }\n\n /**\n * Adds a listener that will be invoked only once for the event named eventName.SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit`)\n }\n }\n\n /**\n * Adds a one-time callback function for the specified event.\n * The callback is invoked only once and then automatically removed.\n *\n * @param {string} eventName - The name of the event to listen for.\n * @param {Function} callback - The callback function to execute when the event is emitted.\n * @param {*} [owner] - Optional owner used to group listener callbacks.\n * @returns {EventEmitter} Returns the emitter instance for chaining.\n */\n once (eventName, callback, owner) {\n assertString(eventName)\n assertFunction(callback)\n\n const event = this._getOrCreateEvent(eventName)\n event.addOnceListener(callback, owner)\n return this\n }\n\n /**\n * Returns a copy of the array of listeners for the event named eventName,\n * including any wrappers (such as those created by .once()).\n * @param {string} eventName - The name of the event.\n * @returns {Listener[]} An array of raw listener functions, or empty array if none exist.\n */\n rawListeners (eventName) {\n return this._name2Event.get(eventName)?.rawListeners() || []\n }\n\n /**\n * Alias of {@linkcode EventEmitter.offAll}\n * @param {string|Symbol} eventName - The name of the event to remove listeners for.\n * @param {*} owner - The owner of the listeners to be removed.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n removeAllListeners (eventName, owner) {\n return this.offAll(eventName, owner)\n }\n\n /**\n * Alias of {@linkcode EventEmitter.off}\n * @param {string} eventName - The name of the event.\n * @param {Function} callback - The callback function to remove.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n removeListener (eventName, callback) {\n return this.off(eventName, callback)\n }\n\n /**\n * Sets the maximum number of listeners that can be added to this event emitter.\n * @param {number} max - The maximum number of listeners.\n * @returns {this} The set maximum number of listeners.\n */\n setMaxListeners (max) {\n assertNumber(max)\n if (max < 0) {\n throw new RangeError('maxListeners must >=0')\n }\n this._maxListeners = max\n return this\n }\n\n /**\n * Gets an existing event by name or creates a new one if it doesn't exist.\n * @private\n * @param {string|Symbol} eventName - The name of the event to get or create.\n * @returns {Event} The existing or newly created Event instance.\n */\n _getOrCreateEvent (eventName) {\n if (this._name2Event.has(eventName)) {\n // @ts-ignore\n return this._name2Event.get(eventName)\n }\n const event = new Event(eventName)\n this._name2Event.set(eventName, event)\n return event\n }\n\n /**\n * Checks if the specified owner has any registered events.\n * @param {Object} owner - The owner object to check for registered events.\n * @returns {boolean} True if the owner has any registered events, false otherwise.\n */\n hasOwner (owner) {\n if (isNil(owner)) {\n return false\n }\n for (const event of this._name2Event.values()) {\n if (event.hasOwner(owner)) {\n return true\n }\n }\n return false\n }\n}\n\nexport { EventEmitter as EventEmitterType }\n"],"names":["assertFunction","assertNotNil","TypeAssert","isNil","TypeUtils","assertStringOrSymbol"],"mappings":";;;;AAAkrB,IAAI,CAAC,CAAC,CAAgF,UAAU,CAAC,CAAC,CAA6Y,KAAK,CAAC,CAA0hB,CAAC,CAA+E,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAM,UAAU,EAAE,OAAO,CAAC,CAAyD,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAA+H,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAA8M,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,C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WAAW,CAAC,GAAG,CAAC,SAAS;AAC3C,IAAI;AACJ,IAAI,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,SAAS;AACrC,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK;AACzC,IAAI,OAAO;AACX,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE,QAAQ,CAAC,CAAC,KAAK,EAAE;AACnB,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE;AACtB,MAAM,OAAO;AACb,IAAI;AACJ,IAAI,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE;AACnD,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACjC,QAAQ,OAAO;AACf,MAAM;AACN,IAAI;AACJ,IAAI,OAAO;AACX,EAAE;AACF;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index-min.cjs","sources":["../../../lang/dist/esm/index-min.js","../../lib/constants.js","../../lib/listener.js","../../lib/event.js","../../lib/event-emitter.js"],"sourcesContent":["var t={constructorName:function(t){return t?.constructor?.name},defaults:function(t,...e){if(null==t)throw new TypeError('\"target\" must not be null or undefined');for(const n of e)if(null!=n)for(const e in n)void 0===t[e]&&(t[e]=n[e]);return t},extend:e,extends:e,equals:function(t,e){if(t===e)return!0;if(\"function\"==typeof t?.equals)return t.equals(e);if(\"function\"==typeof e?.equals)return e.equals(t);return!1},isBrowser:n,isNode:function(){return!n()}};function e(t,...e){if(null==t)throw new TypeError('\"target\" must not be null or undefined');for(const n of e)if(null!=n)for(const e in n)t[e]=n[e];return t}function n(){return\"undefined\"!=typeof window&&\"undefined\"!=typeof document}var r={isArray:o,isBoolean:i,isBuffer:function(t){return null!=t&&Buffer.isBuffer(t)},isFunction:u,isInstance:s,isIterable:function(t){return null!=t&&\"function\"==typeof t[Symbol.iterator]},isDate:function(t){return null!=t&&t instanceof Date},isError:function(t){return null!=t&&t instanceof Error},isMap:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===Map},isWeakMap:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===WeakMap},isNumber:y,isPositive:f,isNegative:c,isNil:l,isNullOrUndefined:function(t){return null==t},isNull:a,isUndefined:p,isPlainObject:g,isObject:h,isPromise:w,isRegExp:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===RegExp},isSet:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===Set},isWeakSet:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===WeakSet},isStream:function(t){return null!=t&&\"function\"==typeof t.pipe},isString:d,isSymbol:m,isPrimitive:function(t){return null!==t&&(\"string\"==typeof t||\"number\"==typeof t||\"boolean\"==typeof t)}};function o(t){return Array.isArray(t)}function i(t){return\"boolean\"==typeof t}function u(t){return\"function\"==typeof t}function s(t){return null!=t&&\"object\"==typeof t&&!g(t)}function l(t){return null==t}function f(t){return!!y(t)&&t>0}function c(t){return!!y(t)&&t<0}function a(t){return null===t}function p(t){return void 0===t}function y(t){return null!=t&&\"number\"==typeof t}function h(t){return null!=t&&\"object\"==typeof t}function g(t){return null!==t&&\"object\"==typeof t&&(t.constructor===Object||void 0===t.constructor)}function w(t){return null!=t&&\"function\"==typeof t.then}function d(t){return null!=t&&\"string\"==typeof t}function m(t){return null!=t&&\"symbol\"==typeof t}var N={assertNumber:E,assertPositive:function(t,e){if(!f(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Positive: ${t}`)},assertNegative:function(t,e){if(!c(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Negative: ${t}`)},assertBoolean:function(t,e){if(!i(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Boolean: type=${typeof t} value=${JSON.stringify(t)}`)},assertObject:function(t,e){if(!h(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Object: type=${typeof t} value=${JSON.stringify(t)}`)},assertPlainObject:function(t,e){if(!g(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not PlainObject: type=${typeof t} value=${JSON.stringify(t)}`)},assertSymbol:function(t,e){if(!m(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Symbol: type=${typeof t} value=${JSON.stringify(t)}`)},assertFunction:v,assertInstance:function(t,e){if(!s(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Class Instance: type=${typeof t} value=${JSON.stringify(t)}`)},assertPromise:S,assertNil:function(t,e){if(!l(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Neither Null nor Undefined: type=${typeof t} value=${JSON.stringify(t)}`)},assertNotNil:function(t,e){if(l(t))throw new Error((e?'\"'+e+'\" ':\" \")+\"Should Not Nil\")},assertNull:function(t,e){if(!a(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Null: type=${typeof t} value=${JSON.stringify(t)}`)},assertNotNull:function(t,e){if(a(t))throw new Error((e?'\"'+e+'\" ':\" \")+\"Should Not Null\")},assertUndefined:function(t,e){if(!p(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Undefined: type=${typeof t} value=${JSON.stringify(t)}`)},assertString:b,assertArray:$,assertStringOrSymbol:function(t,e){if(!d(t)&&!m(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not String or Symbol: type=${typeof t} value=${JSON.stringify(t)}`)}};function $(t,e){if(!Array.isArray(t))throw new Error(`${e?e+\"\":\" \"}Not Array: type=${typeof t} value=${JSON.stringify(t)}`)}function b(t,e){if(!d(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not String: type=${typeof t} value=${JSON.stringify(t)}`)}function E(t,e){if(!y(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)}function v(t,e){if(!u(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)}function S(t,e){if(!w(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Promise: type=${typeof t} value=${JSON.stringify(t)}`)}var O={isEmpty:x,assertNotEmpty:P,isBlank:j,assertNotBlank:function(t){if(j(t))throw new Error(`Blank String: ${t}`)},capitalize:function(t){if(b(t),0===t.length)return t;const e=t.charAt(0),n=e.toUpperCase();return e===n?t:n+t.slice(1)},decapitalize:function(t){if(b(t),0===t.length)return t;const e=t.charAt(0),n=e.toLowerCase();return e===n?t:n+t.slice(1)},splitWithFixedLength:function(t,e,n=\" \"){if(b(t),E(e),b(n),0===t.length)return[];if(e<=0)throw new Error(\"length muse >=0\");if(t.length<e)return[t.padEnd(e,n)];const r=[];for(let o=0;o<t.length;o+=e){const i=t.substring(o,o+e);r.push(i.padEnd(e,n))}return r},split:function(t,...e){b(t);if(0===t.length)return[];const n=[...e];0===e.length&&e.push(\",\");const r=k(t,...n);if(0===r.length)return[];const o=[];let i=\"\",u=0;for(const{marker:e,index:n}of r)i=t.substring(u,n),o.push(i),u=n+e.length;return i=t.substring(u),o.push(i),o},findMarkerPositions:function(t,...e){if(b(t),0===e.length)throw new Error(\"At least one marker must be provided\");const n=[];for(const r of new Set(e)){if(x(r))continue;b(r);let e=t.indexOf(r);for(;-1!==e;)n.push({marker:r,index:e}),e=t.indexOf(r,e+r.length)}return n.sort((t,e)=>t.index-e.index),n},findMarkerPositionsRegex:k,substringBefore:function(t,e){if(b(t),b(e),0===t.length||0===e.length)return;const n=t.indexOf(e);if(-1===n)return;return t.substring(0,n)},substringBeforeLast:function(t,e){if(b(t),b(e),0===t.length||0===e.length)return;const n=t.lastIndexOf(e);if(-1===n)return;return t.substring(0,n)},substringAfter:function(t,e){if(b(t),b(e),0===t.length||0===e.length)return;const n=t.indexOf(e);if(-1===n)return;return t.substring(n+e.length)},substringAfterLast:function(t,e){if(b(t),b(e),0===t.length||0===e.length)return;const n=t.lastIndexOf(e);if(-1===n)return;return t.substring(n+e.length)},substringBetween:function(t,e,n){P(t),P(e),P(n);const r=t.indexOf(e);if(-1===r)return;const o=t.indexOf(n,r+e.length);if(-1===o)return;return t.substring(r+e.length,o)},substringBetweenGreedy:function(t,e,n){P(t),P(e),P(n);const r=t.indexOf(e);if(-1===r)return;const o=t.lastIndexOf(n);if(-1===o||o<=r)return;return t.substring(r+e.length,o)},substringsBetween:function(t,e,n){P(t),P(e),P(n);const r=[];let o=0;for(;;){const i=t.indexOf(e,o);if(-1===i)break;const u=t.indexOf(n,i+e.length);if(-1===u)break;r.push(t.substring(i+e.length,u)),o=u+n.length}return r}};function x(t){return null==t||(b(t),0===t.length)}function P(t){if(x(t))throw new Error(`Empty String: ${t}`)}function j(t){return null==t||(b(t),0===t.trim().length)}function k(t,...e){if(b(t),0===e.length)throw new Error(\"At least one marker must be provided\");const n=[...new Set(e.filter(t=>null!=t))].map(t=>(b(t),t.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\"))),r=new RegExp(n.map(t=>`(${t})`).join(\"|\"),\"g\"),o=[];let i=null;for(;null!==(i=r.exec(t));){for(let t=1;t<i.length;t++)if(i[t]){o.push({marker:e[t-1],index:i.index});break}0===i[0].length&&r.lastIndex++}return o}var T={quiet:function(t){v(t);try{const e=t();return w(e)?e.catch(()=>{}):e}catch(t){}},quietKeepError:function(t,e){v(t),$(e);try{const n=t();return w(n)?n.catch(t=>e.push(t)):n}catch(t){e.push(t)}}},J={defer:A,delay:function(t,e){y(t)?(e=t,t=Promise.resolve()):null==t&&null==e&&(e=1,t=Promise.resolve());null!=t&&S(t),E(e=e??1e3);const n=A(),r=Date.now();return t.then((...t)=>{const o=Date.now()-r;o<e?setTimeout(()=>n.resolve(...t),e-o):n.resolve(...t)}).catch(t=>{const o=Date.now()-r;o<e?setTimeout(()=>n.reject(t),e-o):n.reject(t)}),n.promise},timeout:function(t,e,n){S(t),E(e=e??1);const r=A(e,n),o=Date.now();return t.then((...t)=>{Date.now()-o<=e?r.resolve(...t):r.reject(new Error(n??`Promise Timeout: ${e}ms`))}).catch(t=>{!r.resolved&&!r.rejected&&r.reject(t)}),r.promise},allSettled:B,returnValuePromised:U,series:async function(t){$(t);const e=[];for(const n of t)v(n),e.push(await n());return e},seriesAllSettled:async function(t){$(t);const e=[];for(const n of t){v(n);try{e.push({ok:!0,result:await n()})}catch(t){e.push({ok:!1,result:t})}}return e},parallel:async function(t,e=5){if($(t),E(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>v(t));const n=[];if(t.length<=e){const e=await Promise.all(t.map(t=>U(t)));return n.push(...e),n}const r=[];for(const o of t)if(v(o),r.push(o),r.length>=e){const t=await Promise.all(r.map(t=>U(t)));n.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await Promise.all(r.map(t=>U(t)));n.push(...t)}return n},parallelAllSettled:async function(t,e=5){if($(t),E(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>v(t));const n=[];if(t.length<=e){const e=await B(t.map(t=>U(t)));return n.push(...e),n}const r=[];for(const o of t)if(v(o),r.push(o),r.length>=e){const t=await B(r.map(t=>U(t)));n.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await B(r.map(t=>U(t)));n.push(...t)}return n}};function A(t=-1,e){E(t);const n={};let r;return t>=0&&(n.timerHandler=r=setTimeout(()=>{clearTimeout(r),n.timerCleared=!0,n.reject(new Error(e??`Promise Timeout: ${t}ms`))},t),n.timerHandler=r),n.promise=new Promise((t,e)=>{n.resolve=(...e)=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.resolved=!0,t(...e)},n.reject=t=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.rejected=!0,e(t)}}),n.promise.cancel=()=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.rejected=!0,n.canceled=n.promise.canceled=!0,n.reject(new Error(\"Cancelled\"))},n}async function B(t){$(t);const e=await Promise.allSettled(t),n=[];for(const t of e)\"fulfilled\"===t.status&&n.push({ok:!0,result:t.value}),\"rejected\"===t.status&&n.push({ok:!1,result:t.reason});return n}function U(t){try{const e=t();return w(e)?e:Promise.resolve(e)}catch(t){return Promise.reject(t)}}const{isPlainObject:I}=r;var C={proxy:q,newProxyInstance:function(t,e,n,r=!0){const o=q(t,n,r);return Reflect.construct(o,e??[])}};function q(t,e,n=!0){if(\"function\"!=typeof t)throw new TypeError(`Not Class: type=${typeof t}, value=${JSON.stringify(t)}`);if(null!=e){if(!I(e))throw new TypeError(`Not PropertyHandler: type=${typeof e}, value=${JSON.stringify(e)}`);const{get:t,set:n}=e;if(null!=t&&\"function\"!=typeof t)throw new TypeError(`Not PropertyHandler.get: type=${typeof t}, value=${JSON.stringify(t)}`);if(null!=n&&\"function\"!=typeof n)throw new TypeError(`Not PropertyHandler.set: type=${typeof n}, value=${JSON.stringify(n)}`)}const r={construct(t,r,o){const i=Reflect.construct(t,r);return new Proxy(n?Object.preventExtensions(i):i,e??{})}};return new Proxy(t,r)}var D={proxy:function(t,e,n=!0){if(l(t)||!h(t)||o(t))throw new TypeError(`Not Object: type=${typeof t}, value=${JSON.stringify(t)}`);return new Proxy(n?Object.preventExtensions(t):t,e??{})}},L={LangUtils:t,StringUtils:O,TypeUtils:r,TypeAssert:N,ExecUtils:T,PromiseUtils:J,Lang:t,Type:r,Exec:T,ClassProxyUtils:C,InstanceProxyUtils:D};export{C as ClassProxyUtils,T as Exec,T as ExecUtils,D as InstanceProxyUtils,t as Lang,t as LangUtils,J as PromiseUtils,O as StringUtils,r as Type,N as TypeAssert,r as TypeUtils,L as default};\n//# sourceMappingURL=index-min.js.map\n","export const DefaultOwner = 'DOwner$#$'\nexport default {\n DefaultOwner\n}\n","// 3rd\n// internal\nimport { TypeAssert } from '@creejs/commons-lang'\n\n// owned\nimport { DefaultOwner } from './constants.js'\n\n// module vars\nconst { assertFunction, assertNotNil } = TypeAssert\n/**\n * Wraps a function to be called when an event is fired.\n * @typedef {import('./event.js').default} Event\n * @class Listener\n */\nexport default class Listener {\n /**\n * @param {Event} event\n * @param {function} callback - The function to be called when event is fired\n * @param {boolean} [isOnce=false] - is a one time listener?\n */\n constructor (event, callback, isOnce = false) {\n assertNotNil(event, 'event')\n assertFunction(callback, 'callback')\n this._event = event\n this._callback = callback\n this._isOnce = !!isOnce // is Once Listener?\n this._owner = undefined\n }\n\n /**\n * Sets the owner of this listener.\n * @param {*} owner - The owner object to be associated with this listener.\n */\n set owner (owner) {\n this._owner = owner\n }\n\n get owner () {\n return this._owner === DefaultOwner ? undefined : this._owner\n }\n\n get event () {\n return this._event\n }\n\n get isOnce () {\n return this._isOnce\n }\n\n /**\n * Checks if the provided function is the same as the listener's wrapped function.\n * @param {Function} callback - The function to compare against.\n * @returns {boolean} True if the functions are the same, false otherwise.\n */\n isSameCallback (callback) {\n return this._callback === callback\n }\n\n get callback () {\n return this._callback\n }\n\n /**\n * Invokes the stored function with the provided arguments.\n * @param {...*} args - Arguments to pass to the function.\n * @returns {*} The result of the function invocation.\n */\n invoke (...args) {\n try {\n return this._callback(...args)\n } finally {\n if (this._isOnce) {\n try {\n this._event._remove(this)\n } catch (err) {\n // do nothing\n console.warn(err)\n }\n }\n }\n }\n\n /**\n * Invokes the listener with the provided arguments.\n * Alias for {@linkcode Listener.invoke}\n * @param {...*} args - Arguments to be passed to the listener.\n * @returns {*} The result of the listener invocation.\n */\n listener (...args) {\n return this.invoke(...args)\n }\n}\nexport { Listener as ListenerType }\n","// 3rd\n// internal\nimport { TypeUtils, TypeAssert } from '@creejs/commons-lang'\n\n// owned\n// eslint-disable-next-line no-unused-vars\nimport Listener from './listener.js'\nimport { DefaultOwner } from './constants.js'\n\n// module vars\nconst { isFunction, isNil } = TypeUtils\nconst { assertStringOrSymbol, assertFunction } = TypeAssert\n\n/**\n * An Event definition\n * 1. listeners are grouped by owner\n * * if not specified, group it into one Default owner\n * 2. one listener may belong to multiple owners\n * 3. one owner may have multiple listeners\n */\nexport default class Event {\n static get DefaultOwner () {\n return DefaultOwner\n }\n\n /**\n * Creates a new Event instance with the specified name.\n * @param {string|Symbol} eventName - The name of the event.\n */\n constructor (eventName) {\n assertStringOrSymbol(eventName, 'eventName')\n this._name = eventName\n /**\n * use Set to store unique listeners\n * @type {Set<function>}\n */\n this._callbacks = new Set()\n /**\n * @type {Array<Listener>}\n */\n this._listeners = [] // user array to keep order\n /**\n * @type {Map<function, Set<Listener>>}\n */\n this._callback2Listeners = new Map()\n /**\n * use listener to index owners. One Listener Instance only belongs to one owner\n * @type {Map<Listener, *>}\n */\n this._listener2Owner = new Map()\n /**\n * use \"owner\" to group listeners; one owner may have multiple listeners\n * @type {Map<*, Set<Listener>>}\n */\n this._owner2Listeners = new Map()\n }\n\n /**\n * Name of the event.\n * @returns {string|Symbol}\n */\n get name () {\n return this._name\n }\n\n isEmpty () {\n return this._callbacks.size === 0\n }\n\n /**\n * Returns a copy of the raw listeners array.\n * @returns {Array<Listener>} A shallow copy of the listeners array.\n */\n rawListeners () {\n return [...this._listeners]\n }\n\n /**\n * Returns the number of listeners listening for the event.\n * If callback is provided, it will return how many times the callback is found in the list of the listeners\n * @param {Function} [callback] - The callback function to count\n * @returns {number}\n */\n listenerCount (callback) {\n if (callback == null) {\n return this._listeners.length\n }\n return this._callback2Listeners.get(callback)?.size ?? 0\n }\n\n /**\n * Returns a shallow copy of the registered callbacks array.\n * if one callback function is added multiple times, it will be returned multiple times.\n * @returns {Array<function>} A new array containing all registered callbacks.\n */\n callbacks () {\n return [...this.rawListeners().map(listener => listener.callback)]\n }\n\n /**\n * Emits current event, invoking all registered listeners by order.\n * @param {...*} args - Arguments to be passed to each listener.\n * @returns {boolean} True if the event had listeners, false otherwise.\n */\n emit (...args) {\n if (this._listeners.length === 0) {\n return false\n }\n // Clone _listeners, it may be changed during call listener\n for (const listener of [...this._listeners]) {\n listener.invoke(...args)\n }\n return true\n }\n\n /**\n * Checks if listener is registered with this event.\n * @param {function} callback - The listener function to check.\n * @returns {boolean} True if the listener is registered, false otherwise.\n */\n hasListener (callback) {\n if (!isFunction(callback)) {\n return false\n }\n return this._callbacks.has(callback)\n }\n\n /**\n * Checks if owner has any registered listeners.\n * @param {*} owner - The owner to check for registered listeners.\n * @returns {boolean} True if the owner has listeners, false otherwise.\n */\n hasOwner (owner) {\n if (isNil(owner)) {\n return false\n }\n return this._owner2Listeners.has(owner)\n }\n\n /**\n * Adds an event listener\n * @param {function} callback - The callback function to be invoked when the event occurs.\n * @param {*} [owner] - use \"owner\" to group listeners, then can remove all listeners for an owner.\n * @returns {boolean} true if added, false otherwise.\n */\n addListener (callback, owner) {\n return this._addListener(callback, owner, false, false)\n }\n\n /**\n * Prepends a listener callback to the beginning of the listeners array.\n * No checks are made to see if the listener has already been added.\n * Multiple calls passing the same combination of eventName and listener will result in the listener being added,\n * and called, multiple times.\n * @param {Function} callback - The callback function to be executed when the event is emitted.\n * @param {Object} owner - The owner object to which the listener belongs.\n * @returns {boolean}\n */\n prependListener (callback, owner) {\n return this._addListener(callback, owner, false, true)\n }\n\n /**\n * Adds a one-time listener for the event. The listener is automatically removed after being invoked once.\n * @param {Function} callback - The function to call when the event is triggered.\n * @param {Object} [owner] - The object that owns the callback (used for binding `this` context).\n * @returns {boolean}\n */\n addOnceListener (callback, owner) {\n return this._addListener(callback, owner, true, false)\n }\n\n /**\n * Adds a one-time event listener that will be automatically removed after being triggered once.\n * The listener will only be triggered if the event is pretended (simulated).\n * @param {Function} callback - The function to call when the event is triggered.\n * @param {Object} owner - The object that owns the listener (used for reference tracking).\n * @returns {boolean} The listener function that was added.\n */\n prependOnceListener (callback, owner) {\n return this._addListener(callback, owner, true, true)\n }\n\n /**\n * Adds a listener for the event.\n * @param {Function} callback - The callback function to be executed when the event occurs\n * @param {*} [owner] - The owner object that the listener belongs to (defaults to DeaultOwner)\n * @param {boolean} [isOnce=false] - Whether the listener should be removed after first invocation\n * @param {boolean} [isPrepend=false] - Whether the listener should be inert at the beginning of the listeners array\n * @returns {boolean} Returns true if listener was added successfully, false if callback is nil or duplicate\n * @protected\n */\n _addListener (callback, owner, isOnce, isPrepend) {\n if (isNil(callback)) {\n return false\n }\n assertFunction(callback)\n if (!this._callbacks.has(callback)) {\n this._callbacks.add(callback)\n }\n // a listener must belong to an owner\n owner = owner ?? DefaultOwner\n\n // use Listener to wrap callback\n const listener = new Listener(this, callback, isOnce)\n listener.owner = owner\n if (isPrepend) {\n this._listeners.unshift(listener)\n } else {\n this._listeners.push(listener)\n }\n\n // index, rapadly find one listener's owner\n this._listener2Owner.set(listener, owner)\n\n // one callback function may be registered many times\n let callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners == null) {\n callbackListeners = new Set()\n this._callback2Listeners.set(callback, callbackListeners)\n }\n callbackListeners.add(listener)\n\n // group by owner\n let ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n ownerListeners = new Set()\n this._owner2Listeners.set(owner, ownerListeners)\n }\n ownerListeners.add(listener)\n\n return true\n }\n\n /**\n * Removes a callback\n * @param {Function} callback - The callback function to remove.\n * @returns {boolean} true if removed, false otherwise.\n */\n removeListener (callback) {\n if (isNil(callback)) {\n return false\n }\n if (!this._callbacks.has(callback)) {\n return false\n }\n this._callbacks.delete(callback)\n\n const listeners = this._callback2Listeners.get(callback)\n if (listeners == null) { // should not happen\n return false\n }\n this._callback2Listeners.delete(callback)\n for (const listener of listeners) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(this._listeners.indexOf(listener), 1)\n\n // remove from owner index\n const owner = this._listener2Owner.get(listener)\n if (owner == null) {\n continue\n }\n this._listener2Owner.delete(listener)\n const ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n continue\n }\n ownerListeners.delete(listener)\n if (ownerListeners.size === 0) {\n this._owner2Listeners.delete(owner)\n }\n }\n return true\n }\n\n /**\n * Removes a listener from both global and owner indexes.\n * @param {Listener} listener - The listener function to remove\n */\n _remove (listener) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(index, 1)\n\n // clean callback index\n const { callback } = listener\n const callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners != null) {\n callbackListeners.delete(listener)\n if (callbackListeners.size === 0) {\n this._callback2Listeners.delete(callback)\n this._callbacks.delete(callback)\n }\n }\n\n // remove from owner index\n const owner = this._listener2Owner.get(listener)\n if (owner == null) {\n return\n }\n this._listener2Owner.delete(listener)\n const ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n return\n }\n ownerListeners.delete(listener)\n if (ownerListeners.size === 0) {\n this._owner2Listeners.delete(owner)\n }\n }\n\n /**\n * Removes all event listeners\n * @param {*} [owner] - Without owner, all listeners will be removed; otherwise, only listeners of \"owner\" will be removed.\n * @returns {this}\n */\n removeAllListeners (owner) {\n // remove listeners of owner\n if (isNil(owner)) {\n // remove all Listeners\n this._callbacks.clear()\n this._listeners.length = 0\n this._callback2Listeners.clear()\n this._listener2Owner.clear()\n this._owner2Listeners.clear()\n return this\n }\n // all listeners of the owner\n const ownerListeners = this._owner2Listeners.get(owner)\n // no owner\n if (ownerListeners == null) {\n return this\n }\n // clear owner index\n this._owner2Listeners.delete(owner)\n // clearn listeners of owner one by one\n for (const listener of ownerListeners) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(this._listeners.indexOf(listener), 1)\n\n // clean listener-owner index\n this._listener2Owner.delete(listener)\n\n // one callback function may be registered many times, has many Listeners\n const { callback } = listener\n const callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners == null) {\n continue\n }\n callbackListeners.delete(listener)\n if (callbackListeners.size === 0) {\n this._callback2Listeners.delete(callback)\n this._callbacks.delete(callback)\n }\n }\n return this\n }\n}\n\nexport { Event as EventType }\n","// 3rd\n// internal\nimport { TypeUtils, TypeAssert } from '@creejs/commons-lang'\n\n// owned\nimport Event from './event.js'\n// eslint-disable-next-line no-unused-vars\nimport Listener from './listener.js'\n\n// module vars\nconst { isNil } = TypeUtils\nconst {\n assertString, assertFunction, assertNumber,\n assertStringOrSymbol, assertNotNil\n} = TypeAssert\n\n/**\n * methods allowed to mixin other objects\n */\nconst MixinMethods = [\n 'on', 'once', 'addListener', 'prependListener', 'prependOnceListener',\n 'off', 'offAll', 'offOwner', 'removeAllListeners', 'removeListener',\n 'emit', 'setMaxListeners', 'getMaxListeners', 'hasOwner',\n 'listeners', 'listenerCount', 'eventNames', 'rawListeners'\n]\nlet DefaultMaxListeners = 10\n/**\n * 1. An EventEmitter follows the API of NodeJS EventEmitter.\n * 2. Enhancement:\n * * Listeners are grouped by \"owner\".\n * * Operation via \"owner\"\n * * Duplicate listeners are filtered out. Only unique One kept.\n */\nexport default class EventEmitter {\n /**\n * Mixes EventEmitter methods into the given object.\n * @template T\n * @param {T} obj - The target object to mix methods into.\n * @returns {T} The modified object with EventEmitter methods.\n */\n static mixin (obj) {\n const emitter = new EventEmitter()\n // @ts-ignore\n obj.__emitter = emitter\n for (const name of MixinMethods) {\n // @ts-ignore\n const method = emitter[name]\n // @ts-ignore\n obj[name] = method.bind(emitter)\n }\n return obj\n }\n\n static get defaultMaxListeners () {\n return DefaultMaxListeners\n }\n\n static set defaultMaxListeners (maxListeners) {\n assertNumber(maxListeners)\n DefaultMaxListeners = maxListeners ?? 10\n }\n\n /**\n */\n constructor () {\n /**\n * @type {Map<string|Symbol, Event>}\n */\n this._name2Event = new Map()\n this._maxListeners = DefaultMaxListeners\n }\n\n /**\n * Alias of {@linkcode EventEmitter.addListener}\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n addListener (eventName, listener, owner) {\n return this.on(eventName, listener, owner)\n }\n\n /**\n * Adds the listener function to the beginning of the listeners array for the event named eventName.\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n prependListener (eventName, listener, owner) {\n assertString(eventName)\n assertFunction(listener)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.prependListener(listener, owner)\n return this\n }\n\n /**\n * Adds a one-time listener function for the event named eventName to the beginning of the listeners array.\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n prependOnceListener (eventName, listener, owner) {\n assertString(eventName)\n assertFunction(listener)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.prependOnceListener(listener, owner)\n return this\n }\n\n /**\n * Synchronously calls each of the listeners registered for the event named eventName,\n * in the order they were registered, passing the supplied arguments to each.\n * Returns true if the event had listeners, false otherwise.\n * @param {string|Symbol} eventName - The name of the event.\n * @param {...*} args arguments to pass to the listeners.\n * @returns {boolean}\n */\n emit (eventName, ...args) {\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return false\n }\n event.emit(...args)\n return true\n }\n\n /**\n * Returns an array listing the events for which the emitter has registered listeners.\n * @returns {Array<string|Symbol>} An array of event names.\n */\n eventNames () {\n return [...this._name2Event.keys()]\n }\n\n getMaxListeners () {\n return this._maxListeners\n }\n\n /**\n * Returns the number of listeners listening for the event named eventName.\n * If listener is provided, it will return how many times the listener is found\n * in the list of the listeners of the event.\n * @param {string|Symbol} eventName - The name of the event to check\n * @param {function} [listener] - Optional specific listener to count\n * @returns {number} The number of listeners for the event\n */\n listenerCount (eventName, listener) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return 0\n }\n return event.listenerCount(listener)\n }\n\n /**\n * Returns a copy of the array of listeners for the event named eventName.\n * 1. if a callback function added multiple times, it will be returned multiple times.\n * @param {string} eventName\n * @returns {Array<function>}\n */\n listeners (eventName) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return []\n }\n return event.callbacks()\n }\n\n /**\n * Removes a callback function from a specific event.\n * 1. If the event doesn't exist or has no listeners, do nothing\n * 2. if one callback function added multiple times, all of them will be removed.\n * * !!! This is different from the behavior of Node.js EventEmitter.\n *\n * @param {string} eventName - The name of the event to remove callback from\n * @param {function} callback - The callback function to remove\n * @returns {EventEmitter} Returns the emitter instance for chaining\n */\n off (eventName, callback) {\n const event = this._name2Event.get(eventName)\n if (event == null) {\n return this\n }\n event.removeListener(callback)\n if (event.isEmpty()) {\n this._name2Event.delete(eventName)\n return this\n }\n return this\n }\n\n /**\n * Removes all listeners for the specified event.\n * if owner is limited, only the listeners of the owner will be removed.\n *\n * @param {string|Symbol} eventName - The name of the event to clear listeners for.\n * @param {*} owner - The owner whose listeners should be removed.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n offAll (eventName, owner) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null) {\n return this\n }\n event.removeAllListeners(owner)\n if (event.isEmpty()) {\n this._name2Event.delete(eventName)\n return this\n }\n return this\n }\n\n /**\n * Removes all event listeners belonging to the specified owner.\n * @param {*} owner - The owner whose listeners should be removed.\n * @returns {this}\n */\n offOwner (owner) {\n assertNotNil(owner, 'owner')\n const events = [...this._name2Event.values()]\n for (const event of events) {\n event.removeAllListeners(owner)\n if (event.isEmpty()) {\n this._name2Event.delete(event.name)\n }\n }\n return this\n }\n\n /**\n * Adds the listener function to the end of the listeners array for the event named eventName.\n * @param {string|Symbol} eventName\n * @param {function} callback\n * @param {*} [owner]\n * @returns {this}\n */\n on (eventName, callback, owner) {\n assertString(eventName)\n assertFunction(callback)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.addListener(callback, owner)\n return this\n }\n\n /**\n * Checks if the number of listeners for the given event exceeds the maximum allowed.\n * Emits a warning if the listener count reaches or exceeds the maxListeners threshold.\n * @private\n * @param {string|Symbol} eventName - The name of the event to check\n * @returns {void}\n */\n _checkMaxListeners (eventName) {\n let listenerCount = 0\n if (this._maxListeners !== 0 && this._maxListeners !== Infinity && (listenerCount = this.listenerCount(eventName)) >= this._maxListeners) {\n console.warn(`maxlistenersexceededwarning: Possible EventEmitter memory leak detected. ${listenerCount} ${eventName} listeners added to [${this}]. Use emitter.setMaxListeners() to increase limit`)\n }\n }\n\n /**\n * Adds a listener that will be invoked only once for the event named eventName.SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit`)\n }\n }\n\n /**\n * Adds a one-time callback function for the specified event.\n * The callback is invoked only once and then automatically removed.\n *\n * @param {string} eventName - The name of the event to listen for.\n * @param {Function} callback - The callback function to execute when the event is emitted.\n * @param {*} [owner] - Optional owner used to group listener callbacks.\n * @returns {EventEmitter} Returns the emitter instance for chaining.\n */\n once (eventName, callback, owner) {\n assertString(eventName)\n assertFunction(callback)\n\n const event = this._getOrCreateEvent(eventName)\n event.addOnceListener(callback, owner)\n return this\n }\n\n /**\n * Returns a copy of the array of listeners for the event named eventName,\n * including any wrappers (such as those created by .once()).\n * @param {string} eventName - The name of the event.\n * @returns {Listener[]} An array of raw listener functions, or empty array if none exist.\n */\n rawListeners (eventName) {\n return this._name2Event.get(eventName)?.rawListeners() || []\n }\n\n /**\n * Alias of {@linkcode EventEmitter.offAll}\n * @param {string|Symbol} eventName - The name of the event to remove listeners for.\n * @param {*} owner - The owner of the listeners to be removed.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n removeAllListeners (eventName, owner) {\n return this.offAll(eventName, owner)\n }\n\n /**\n * Alias of {@linkcode EventEmitter.off}\n * @param {string} eventName - The name of the event.\n * @param {Function} callback - The callback function to remove.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n removeListener (eventName, callback) {\n return this.off(eventName, callback)\n }\n\n /**\n * Sets the maximum number of listeners that can be added to this event emitter.\n * @param {number} max - The maximum number of listeners.\n * @returns {this} The set maximum number of listeners.\n */\n setMaxListeners (max) {\n assertNumber(max)\n if (max < 0) {\n throw new RangeError('maxListeners must >=0')\n }\n this._maxListeners = max\n return this\n }\n\n /**\n * Gets an existing event by name or creates a new one if it doesn't exist.\n * @private\n * @param {string|Symbol} eventName - The name of the event to get or create.\n * @returns {Event} The existing or newly created Event instance.\n */\n _getOrCreateEvent (eventName) {\n if (this._name2Event.has(eventName)) {\n // @ts-ignore\n return this._name2Event.get(eventName)\n }\n const event = new Event(eventName)\n this._name2Event.set(eventName, event)\n return event\n }\n\n /**\n * Checks if the specified owner has any registered events.\n * @param {Object} owner - The owner object to check for registered events.\n * @returns {boolean} True if the owner has any registered events, false otherwise.\n */\n hasOwner (owner) {\n if (isNil(owner)) {\n return false\n }\n for (const event of this._name2Event.values()) {\n if (event.hasOwner(owner)) {\n return true\n }\n }\n return false\n }\n}\n\nexport { EventEmitter as EventEmitterType }\n"],"names":["r","isFunction","u","isNil","l","t","d","N","assertNumber","e","y","Error","JSON","stringify","assertFunction","assertNotNil","assertString","assertStringOrSymbol","m","DefaultOwner","TypeAssert","Listener","constructor","event","callback","isOnce","this","_event","_callback","_isOnce","_owner","undefined","owner","isSameCallback","invoke","args","_remove","err","console","warn","listener","TypeUtils","Event","eventName","_name","_callbacks","Set","_listeners","_callback2Listeners","Map","_listener2Owner","_owner2Listeners","name","isEmpty","size","rawListeners","listenerCount","length","get","callbacks","map","emit","hasListener","has","hasOwner","addListener","_addListener","prependListener","addOnceListener","prependOnceListener","isPrepend","add","unshift","push","set","callbackListeners","ownerListeners","removeListener","delete","listeners","indexOf","splice","index","removeAllListeners","clear","MixinMethods","DefaultMaxListeners","EventEmitter","mixin","obj","emitter","__emitter","method","bind","defaultMaxListeners","maxListeners","_name2Event","_maxListeners","on","_checkMaxListeners","_getOrCreateEvent","eventNames","keys","getMaxListeners","off","offAll","offOwner","events","values","Infinity","once","setMaxListeners","max","RangeError"],"mappings":"oEAAkrB,IAAIA,EAAE,CAAgFC,WAAWC,EAA8YC,MAAMC,GAA0mB,SAASF,EAAEG,GAAG,MAAM,mBAAmBA,CAAC,CAAyD,SAASD,EAAEC,GAAG,OAAO,MAAMA,CAAC,CAA6X,SAASC,EAAED,GAAG,OAAO,MAAMA,GAAG,iBAAiBA,CAAC,CAAkD,IAAIE,EAAE,CAACC,aAA84D,SAAWH,EAAEI,GAAG,IAArwE,SAAWJ,GAAG,OAAO,MAAMA,GAAG,iBAAiBA,CAAC,CAAytEK,CAAEL,GAAG,MAAM,IAAIM,MAAM,GAAGF,EAAE,IA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AAIC,WAAW,yBAGvB,OADAvF,KAAKuE,cAAgBe,EACdtF,IACT,CAQA,iBAAA0E,CAAmBzD,GACjB,GAAIjB,KAAKsE,YAAYjC,IAAIpB,GAEvB,OAAOjB,KAAKsE,YAAYtC,IAAIf,GAE9B,MAAMpB,EAAQ,IAAImB,EAAMC,GAExB,OADAjB,KAAKsE,YAAYtB,IAAI/B,EAAWpB,GACzBA,CACT,CAOA,QAAAyC,CAAUhC,GACR,GAAI7B,EAAM6B,GACR,OAAO,EAET,IAAK,MAAMT,KAASG,KAAKsE,YAAYY,SACnC,GAAIrF,EAAMyC,SAAShC,GACjB,OAAO,EAGX,OAAO,CACT"}
1
+ {"version":3,"file":"index-min.cjs","sources":["../../../lang/dist/esm/index-min.js","../../lib/constants.js","../../lib/listener.js","../../lib/event.js","../../lib/event-emitter.js"],"sourcesContent":["var t={constructorName:function(t){return t?.constructor?.name},defaults:function(t,...e){if(null==t)throw new TypeError('\"target\" must not be null or undefined');for(const n of e)if(null!=n)for(const e in n)void 0===t[e]&&(t[e]=n[e]);return t},extend:e,extends:e,equals:function(t,e){if(t===e)return!0;if(\"function\"==typeof t?.equals)return t.equals(e);if(\"function\"==typeof e?.equals)return e.equals(t);return!1},isBrowser:n,isNode:function(){return!n()}};function e(t,...e){if(null==t)throw new TypeError('\"target\" must not be null or undefined');for(const n of e)if(null!=n)for(const e in n)t[e]=n[e];return t}function n(){return\"undefined\"!=typeof window&&\"undefined\"!=typeof document}var r={isArray:o,isBoolean:i,isBuffer:function(t){return null!=t&&Buffer.isBuffer(t)},isFunction:s,isInstance:u,isIterable:function(t){return null!=t&&\"function\"==typeof t[Symbol.iterator]},isDate:function(t){return null!=t&&t instanceof Date},isError:function(t){return null!=t&&t instanceof Error},isMap:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===Map},isWeakMap:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===WeakMap},isNumber:y,isPositive:l,isNegative:c,isNil:f,isNullOrUndefined:function(t){return null==t},isNull:a,isUndefined:p,isPlainObject:g,isObject:h,isPromise:w,isRegExp:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===RegExp},isSet:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===Set},isWeakSet:function(t){return null!=t&&\"object\"==typeof t&&t.constructor===WeakSet},isStream:function(t){return null!=t&&\"function\"==typeof t.pipe},isString:d,isSymbol:m,isPrimitive:function(t){return null!==t&&(\"string\"==typeof t||\"number\"==typeof t||\"boolean\"==typeof t)}};function o(t){return Array.isArray(t)}function i(t){return\"boolean\"==typeof t}function s(t){return\"function\"==typeof t}function u(t){return null!=t&&\"object\"==typeof t&&!g(t)}function f(t){return null==t}function l(t){return!!y(t)&&t>0}function c(t){return!!y(t)&&t<0}function a(t){return null===t}function p(t){return void 0===t}function y(t){return null!=t&&\"number\"==typeof t}function h(t){return null!=t&&\"object\"==typeof t}function g(t){return null!==t&&\"object\"==typeof t&&(t.constructor===Object||void 0===t.constructor)}function w(t){return null!=t&&\"function\"==typeof t.then}function d(t){return null!=t&&\"string\"==typeof t}function m(t){return null!=t&&\"symbol\"==typeof t}var b={assertNumber:$,assertPositive:function(t,e){if(!l(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Positive: ${t}`)},assertNegative:function(t,e){if(!c(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Negative: ${t}`)},assertBoolean:function(t,e){if(!i(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Boolean: type=${typeof t} value=${JSON.stringify(t)}`)},assertObject:v,assertPlainObject:function(t,e){if(!g(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not PlainObject: type=${typeof t} value=${JSON.stringify(t)}`)},assertSymbol:function(t,e){if(!m(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Symbol: type=${typeof t} value=${JSON.stringify(t)}`)},assertFunction:E,assertInstance:function(t,e){if(!u(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Class Instance: type=${typeof t} value=${JSON.stringify(t)}`)},assertPromise:S,assertNil:function(t,e){if(!f(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Neither Null nor Undefined: type=${typeof t} value=${JSON.stringify(t)}`)},assertNotNil:function(t,e){if(f(t))throw new Error((e?'\"'+e+'\" ':\" \")+\"Should Not Nil\")},assertNull:function(t,e){if(!a(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Null: type=${typeof t} value=${JSON.stringify(t)}`)},assertNotNull:function(t,e){if(a(t))throw new Error((e?'\"'+e+'\" ':\" \")+\"Should Not Null\")},assertUndefined:function(t,e){if(!p(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Undefined: type=${typeof t} value=${JSON.stringify(t)}`)},assertString:O,assertArray:N,assertStringOrSymbol:function(t,e){if(!d(t)&&!m(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not String or Symbol: type=${typeof t} value=${JSON.stringify(t)}`)}};function N(t,e){if(!Array.isArray(t))throw new Error(`${e?e+\"\":\" \"}Not Array: type=${typeof t} value=${JSON.stringify(t)}`)}function O(t,e){if(!d(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not String: type=${typeof t} value=${JSON.stringify(t)}`)}function $(t,e){if(!y(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)}function v(t,e){if(!h(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Object: type=${typeof t} value=${JSON.stringify(t)}`)}function E(t,e){if(!s(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)}function S(t,e){if(!w(t))throw new Error(`${e?'\"'+e+'\" ':\" \"}Not Promise: type=${typeof t} value=${JSON.stringify(t)}`)}var j={isEmpty:P,assertNotEmpty:x,isBlank:k,assertNotBlank:function(t){if(k(t))throw new Error(`Blank String: ${t}`)},capitalize:function(t){if(O(t),0===t.length)return t;const e=t.charAt(0),n=e.toUpperCase();return e===n?t:n+t.slice(1)},decapitalize:function(t){if(O(t),0===t.length)return t;const e=t.charAt(0),n=e.toLowerCase();return e===n?t:n+t.slice(1)},splitWithFixedLength:function(t,e,n=\" \"){if(O(t),$(e),O(n),0===t.length)return[];if(e<=0)throw new Error(\"length muse >=0\");if(t.length<e)return[t.padEnd(e,n)];const r=[];for(let o=0;o<t.length;o+=e){const i=t.substring(o,o+e);r.push(i.padEnd(e,n))}return r},split:function(t,...e){O(t);if(0===t.length)return[];const n=[...e];0===e.length&&e.push(\",\");const r=T(t,...n);if(0===r.length)return[];const o=[];let i=\"\",s=0;for(const{marker:e,index:n}of r)i=t.substring(s,n),o.push(i),s=n+e.length;return i=t.substring(s),o.push(i),o},findMarkerPositions:function(t,...e){if(O(t),0===e.length)throw new Error(\"At least one marker must be provided\");const n=[];for(const r of new Set(e)){if(P(r))continue;O(r);let e=t.indexOf(r);for(;-1!==e;)n.push({marker:r,index:e}),e=t.indexOf(r,e+r.length)}return n.sort((t,e)=>t.index-e.index),n},findMarkerPositionsRegex:T,substringBefore:function(t,e){if(O(t),O(e),0===t.length||0===e.length)return;const n=t.indexOf(e);if(-1===n)return;return t.substring(0,n)},substringBeforeLast:function(t,e){if(O(t),O(e),0===t.length||0===e.length)return;const n=t.lastIndexOf(e);if(-1===n)return;return t.substring(0,n)},substringAfter:function(t,e){if(O(t),O(e),0===t.length||0===e.length)return;const n=t.indexOf(e);if(-1===n)return;return t.substring(n+e.length)},substringAfterLast:function(t,e){if(O(t),O(e),0===t.length||0===e.length)return;const n=t.lastIndexOf(e);if(-1===n)return;return t.substring(n+e.length)},substringBetween:function(t,e,n){x(t),x(e),x(n);const r=t.indexOf(e);if(-1===r)return;const o=t.indexOf(n,r+e.length);if(-1===o)return;return t.substring(r+e.length,o)},substringBetweenGreedy:function(t,e,n){x(t),x(e),x(n);const r=t.indexOf(e);if(-1===r)return;const o=t.lastIndexOf(n);if(-1===o||o<=r)return;return t.substring(r+e.length,o)},substringsBetween:function(t,e,n){x(t),x(e),x(n);const r=[];let o=0;for(;;){const i=t.indexOf(e,o);if(-1===i)break;const s=t.indexOf(n,i+e.length);if(-1===s)break;r.push(t.substring(i+e.length,s)),o=s+n.length}return r}};function P(t){return null==t||(O(t),0===t.length)}function x(t){if(P(t))throw new Error(`Empty String: ${t}`)}function k(t){return null==t||(O(t),0===t.trim().length)}function T(t,...e){if(O(t),0===e.length)throw new Error(\"At least one marker must be provided\");const n=[...new Set(e.filter(t=>null!=t))].map(t=>(O(t),t.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\"))),r=new RegExp(n.map(t=>`(${t})`).join(\"|\"),\"g\"),o=[];let i=null;for(;null!==(i=r.exec(t));){for(let t=1;t<i.length;t++)if(i[t]){o.push({marker:e[t-1],index:i.index});break}0===i[0].length&&r.lastIndex++}return o}var J={quiet:function(t){E(t);try{const e=t();return w(e)?e.catch(()=>{}):e}catch(t){}},quietKeepError:function(t,e){E(t),N(e);try{const n=t();return w(n)?n.catch(t=>e.push(t)):n}catch(t){e.push(t)}}},A={defer:B,delay:function(t,e){y(t)?(e=t,t=Promise.resolve()):null==t&&null==e&&(e=1,t=Promise.resolve());null!=t&&S(t),$(e=e??1e3);const n=B(),r=Date.now();return t.then((...t)=>{const o=Date.now()-r;o<e?setTimeout(()=>n.resolve(...t),e-o):n.resolve(...t)}).catch(t=>{const o=Date.now()-r;o<e?setTimeout(()=>n.reject(t),e-o):n.reject(t)}),n.promise},timeout:function(t,e,n){S(t),$(e=e??1);const r=B(e,n),o=Date.now();return t.then((...t)=>{Date.now()-o<=e?r.resolve(...t):r.reject(new Error(n??`Promise Timeout: ${e}ms`))}).catch(t=>{!r.resolved&&!r.rejected&&r.reject(t)}),r.promise},allSettled:U,returnValuePromised:C,series:async function(t){N(t);const e=[];for(const n of t)E(n),e.push(await n());return e},seriesAllSettled:async function(t){N(t);const e=[];for(const n of t){E(n);try{e.push({ok:!0,result:await n()})}catch(t){e.push({ok:!1,result:t})}}return e},parallel:async function(t,e=5){if(N(t),$(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>E(t));const n=[];if(t.length<=e){const e=await Promise.all(t.map(t=>C(t)));return n.push(...e),n}const r=[];for(const o of t)if(E(o),r.push(o),r.length>=e){const t=await Promise.all(r.map(t=>C(t)));n.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await Promise.all(r.map(t=>C(t)));n.push(...t)}return n},parallelAllSettled:async function(t,e=5){if(N(t),$(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>E(t));const n=[];if(t.length<=e){const e=await U(t.map(t=>C(t)));return n.push(...e),n}const r=[];for(const o of t)if(E(o),r.push(o),r.length>=e){const t=await U(r.map(t=>C(t)));n.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await U(r.map(t=>C(t)));n.push(...t)}return n}};function B(t=-1,e){$(t);const n={};let r;return t>=0&&(n.timerHandler=r=setTimeout(()=>{clearTimeout(r),n.timerCleared=!0,n.reject(new Error(e??`Promise Timeout: ${t}ms`))},t),n.timerHandler=r),n.promise=new Promise((t,e)=>{n.resolve=(...e)=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.resolved=!0,t(...e)},n.reject=t=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.rejected=!0,e(t)}}),n.promise.cancel=()=>{null!=r&&(clearTimeout(r),n.timerCleared=!0),n.rejected=!0,n.canceled=n.promise.canceled=!0,n.reject(new Error(\"Cancelled\"))},n}async function U(t){N(t);const e=await Promise.allSettled(t),n=[];for(const t of e)\"fulfilled\"===t.status&&n.push({ok:!0,result:t.value}),\"rejected\"===t.status&&n.push({ok:!1,result:t.reason});return n}function C(t){try{const e=t();return w(e)?e:Promise.resolve(e)}catch(t){return Promise.reject(t)}}const{isPlainObject:I}=r;var M={proxy:q,newProxyInstance:function(t,e,n,r=!0){const o=q(t,n,r);return Reflect.construct(o,e??[])}};function q(t,e,n=!0){if(\"function\"!=typeof t)throw new TypeError(`Not Class: type=${typeof t}, value=${JSON.stringify(t)}`);if(null!=e){if(!I(e))throw new TypeError(`Not PropertyHandler: type=${typeof e}, value=${JSON.stringify(e)}`);const{get:t,set:n}=e;if(null!=t&&\"function\"!=typeof t)throw new TypeError(`Not PropertyHandler.get: type=${typeof t}, value=${JSON.stringify(t)}`);if(null!=n&&\"function\"!=typeof n)throw new TypeError(`Not PropertyHandler.set: type=${typeof n}, value=${JSON.stringify(n)}`)}const r={construct(t,r,o){const i=Reflect.construct(t,r);return new Proxy(n?Object.preventExtensions(i):i,e??{})}};return new Proxy(t,r)}var D={proxy:function(t,e,n=!0){if(f(t)||!h(t)||o(t))throw new TypeError(`Not Object: type=${typeof t}, value=${JSON.stringify(t)}`);return new Proxy(n?Object.preventExtensions(t):t,e??{})}};function L(t){v(t,\"obj\");const e=new Set;let n=t;for(;n&&n!==Object.prototype;){const r=Object.getOwnPropertyNames(n);for(const n of r)\"constructor\"!==n&&\"function\"==typeof t[n]&&e.add(n);n=Object.getPrototypeOf(n)}return[...new Set(e)]}var R={getMethodsOfClass:function(t){E(t,\"cls\");const e=new Set;let n=t.prototype;for(;n&&n!==Object.prototype;){const t=Object.getOwnPropertyNames(n);for(const r of t)\"constructor\"!==r&&\"function\"==typeof n[r]&&e.add(r);n=Object.getPrototypeOf(n)}return[...new Set(e)]},getStaticMethodsOfClass:function(t){E(t,\"cls\");const e=new Set;let n=t;for(;n&&n!==Object.getPrototypeOf(Object);){const t=Object.getOwnPropertyNames(n);for(const r of t)\"function\"==typeof n[r]&&e.add(r);n=Object.getPrototypeOf(n)}return[...e]},getMethods:L,getMethodsOfObject:L},H={LangUtils:t,StringUtils:j,TypeUtils:r,TypeAssert:b,ExecUtils:J,PromiseUtils:A,Lang:t,Type:r,Exec:J,ClassProxyUtils:M,InstanceProxyUtils:D,ReflectUtils:R};export{M as ClassProxyUtils,J as Exec,J as ExecUtils,D as InstanceProxyUtils,t as Lang,t as LangUtils,A as PromiseUtils,R as ReflectUtils,j as StringUtils,r as Type,b as TypeAssert,r as TypeUtils,H as default};\n//# sourceMappingURL=index-min.js.map\n","export const DefaultOwner = 'DOwner$#$'\nexport default {\n DefaultOwner\n}\n","// 3rd\n// internal\nimport { TypeAssert } from '@creejs/commons-lang'\n\n// owned\nimport { DefaultOwner } from './constants.js'\n\n// module vars\nconst { assertFunction, assertNotNil } = TypeAssert\n/**\n * Wraps a function to be called when an event is fired.\n * @typedef {import('./event.js').default} Event\n * @class Listener\n */\nexport default class Listener {\n /**\n * @param {Event} event\n * @param {function} callback - The function to be called when event is fired\n * @param {boolean} [isOnce=false] - is a one time listener?\n */\n constructor (event, callback, isOnce = false) {\n assertNotNil(event, 'event')\n assertFunction(callback, 'callback')\n this._event = event\n this._callback = callback\n this._isOnce = !!isOnce // is Once Listener?\n this._owner = undefined\n }\n\n /**\n * Sets the owner of this listener.\n * @param {*} owner - The owner object to be associated with this listener.\n */\n set owner (owner) {\n this._owner = owner\n }\n\n get owner () {\n return this._owner === DefaultOwner ? undefined : this._owner\n }\n\n get event () {\n return this._event\n }\n\n get isOnce () {\n return this._isOnce\n }\n\n /**\n * Checks if the provided function is the same as the listener's wrapped function.\n * @param {Function} callback - The function to compare against.\n * @returns {boolean} True if the functions are the same, false otherwise.\n */\n isSameCallback (callback) {\n return this._callback === callback\n }\n\n get callback () {\n return this._callback\n }\n\n /**\n * Invokes the stored function with the provided arguments.\n * @param {...*} args - Arguments to pass to the function.\n * @returns {*} The result of the function invocation.\n */\n invoke (...args) {\n try {\n return this._callback(...args)\n } finally {\n if (this._isOnce) {\n try {\n this._event._remove(this)\n } catch (err) {\n // do nothing\n console.warn(err)\n }\n }\n }\n }\n\n /**\n * Invokes the listener with the provided arguments.\n * Alias for {@linkcode Listener.invoke}\n * @param {...*} args - Arguments to be passed to the listener.\n * @returns {*} The result of the listener invocation.\n */\n listener (...args) {\n return this.invoke(...args)\n }\n}\nexport { Listener as ListenerType }\n","// 3rd\n// internal\nimport { TypeUtils, TypeAssert } from '@creejs/commons-lang'\n\n// owned\n// eslint-disable-next-line no-unused-vars\nimport Listener from './listener.js'\nimport { DefaultOwner } from './constants.js'\n\n// module vars\nconst { isFunction, isNil } = TypeUtils\nconst { assertStringOrSymbol, assertFunction } = TypeAssert\n\n/**\n * An Event definition\n * 1. listeners are grouped by owner\n * * if not specified, group it into one Default owner\n * 2. one listener may belong to multiple owners\n * 3. one owner may have multiple listeners\n */\nexport default class Event {\n static get DefaultOwner () {\n return DefaultOwner\n }\n\n /**\n * Creates a new Event instance with the specified name.\n * @param {string|Symbol} eventName - The name of the event.\n */\n constructor (eventName) {\n assertStringOrSymbol(eventName, 'eventName')\n this._name = eventName\n /**\n * use Set to store unique listeners\n * @type {Set<function>}\n */\n this._callbacks = new Set()\n /**\n * @type {Array<Listener>}\n */\n this._listeners = [] // user array to keep order\n /**\n * @type {Map<function, Set<Listener>>}\n */\n this._callback2Listeners = new Map()\n /**\n * use listener to index owners. One Listener Instance only belongs to one owner\n * @type {Map<Listener, *>}\n */\n this._listener2Owner = new Map()\n /**\n * use \"owner\" to group listeners; one owner may have multiple listeners\n * @type {Map<*, Set<Listener>>}\n */\n this._owner2Listeners = new Map()\n }\n\n /**\n * Name of the event.\n * @returns {string|Symbol}\n */\n get name () {\n return this._name\n }\n\n isEmpty () {\n return this._callbacks.size === 0\n }\n\n /**\n * Returns a copy of the raw listeners array.\n * @returns {Array<Listener>} A shallow copy of the listeners array.\n */\n rawListeners () {\n return [...this._listeners]\n }\n\n /**\n * Returns the number of listeners listening for the event.\n * If callback is provided, it will return how many times the callback is found in the list of the listeners\n * @param {Function} [callback] - The callback function to count\n * @returns {number}\n */\n listenerCount (callback) {\n if (callback == null) {\n return this._listeners.length\n }\n return this._callback2Listeners.get(callback)?.size ?? 0\n }\n\n /**\n * Returns a shallow copy of the registered callbacks array.\n * if one callback function is added multiple times, it will be returned multiple times.\n * @returns {Array<function>} A new array containing all registered callbacks.\n */\n callbacks () {\n return [...this.rawListeners().map(listener => listener.callback)]\n }\n\n /**\n * Emits current event, invoking all registered listeners by order.\n * @param {...*} args - Arguments to be passed to each listener.\n * @returns {boolean} True if the event had listeners, false otherwise.\n */\n emit (...args) {\n if (this._listeners.length === 0) {\n return false\n }\n // Clone _listeners, it may be changed during call listener\n for (const listener of [...this._listeners]) {\n listener.invoke(...args)\n }\n return true\n }\n\n /**\n * Checks if listener is registered with this event.\n * @param {function} callback - The listener function to check.\n * @returns {boolean} True if the listener is registered, false otherwise.\n */\n hasListener (callback) {\n if (!isFunction(callback)) {\n return false\n }\n return this._callbacks.has(callback)\n }\n\n /**\n * Checks if owner has any registered listeners.\n * @param {*} owner - The owner to check for registered listeners.\n * @returns {boolean} True if the owner has listeners, false otherwise.\n */\n hasOwner (owner) {\n if (isNil(owner)) {\n return false\n }\n return this._owner2Listeners.has(owner)\n }\n\n /**\n * Adds an event listener\n * @param {function} callback - The callback function to be invoked when the event occurs.\n * @param {*} [owner] - use \"owner\" to group listeners, then can remove all listeners for an owner.\n * @returns {boolean} true if added, false otherwise.\n */\n addListener (callback, owner) {\n return this._addListener(callback, owner, false, false)\n }\n\n /**\n * Prepends a listener callback to the beginning of the listeners array.\n * No checks are made to see if the listener has already been added.\n * Multiple calls passing the same combination of eventName and listener will result in the listener being added,\n * and called, multiple times.\n * @param {Function} callback - The callback function to be executed when the event is emitted.\n * @param {Object} owner - The owner object to which the listener belongs.\n * @returns {boolean}\n */\n prependListener (callback, owner) {\n return this._addListener(callback, owner, false, true)\n }\n\n /**\n * Adds a one-time listener for the event. The listener is automatically removed after being invoked once.\n * @param {Function} callback - The function to call when the event is triggered.\n * @param {Object} [owner] - The object that owns the callback (used for binding `this` context).\n * @returns {boolean}\n */\n addOnceListener (callback, owner) {\n return this._addListener(callback, owner, true, false)\n }\n\n /**\n * Adds a one-time event listener that will be automatically removed after being triggered once.\n * The listener will only be triggered if the event is pretended (simulated).\n * @param {Function} callback - The function to call when the event is triggered.\n * @param {Object} owner - The object that owns the listener (used for reference tracking).\n * @returns {boolean} The listener function that was added.\n */\n prependOnceListener (callback, owner) {\n return this._addListener(callback, owner, true, true)\n }\n\n /**\n * Adds a listener for the event.\n * @param {Function} callback - The callback function to be executed when the event occurs\n * @param {*} [owner] - The owner object that the listener belongs to (defaults to DeaultOwner)\n * @param {boolean} [isOnce=false] - Whether the listener should be removed after first invocation\n * @param {boolean} [isPrepend=false] - Whether the listener should be inert at the beginning of the listeners array\n * @returns {boolean} Returns true if listener was added successfully, false if callback is nil or duplicate\n * @protected\n */\n _addListener (callback, owner, isOnce, isPrepend) {\n if (isNil(callback)) {\n return false\n }\n assertFunction(callback)\n if (!this._callbacks.has(callback)) {\n this._callbacks.add(callback)\n }\n // a listener must belong to an owner\n owner = owner ?? DefaultOwner\n\n // use Listener to wrap callback\n const listener = new Listener(this, callback, isOnce)\n listener.owner = owner\n if (isPrepend) {\n this._listeners.unshift(listener)\n } else {\n this._listeners.push(listener)\n }\n\n // index, rapadly find one listener's owner\n this._listener2Owner.set(listener, owner)\n\n // one callback function may be registered many times\n let callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners == null) {\n callbackListeners = new Set()\n this._callback2Listeners.set(callback, callbackListeners)\n }\n callbackListeners.add(listener)\n\n // group by owner\n let ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n ownerListeners = new Set()\n this._owner2Listeners.set(owner, ownerListeners)\n }\n ownerListeners.add(listener)\n\n return true\n }\n\n /**\n * Removes a callback\n * @param {Function} callback - The callback function to remove.\n * @returns {boolean} true if removed, false otherwise.\n */\n removeListener (callback) {\n if (isNil(callback)) {\n return false\n }\n if (!this._callbacks.has(callback)) {\n return false\n }\n this._callbacks.delete(callback)\n\n const listeners = this._callback2Listeners.get(callback)\n if (listeners == null) { // should not happen\n return false\n }\n this._callback2Listeners.delete(callback)\n for (const listener of listeners) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(this._listeners.indexOf(listener), 1)\n\n // remove from owner index\n const owner = this._listener2Owner.get(listener)\n if (owner == null) {\n continue\n }\n this._listener2Owner.delete(listener)\n const ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n continue\n }\n ownerListeners.delete(listener)\n if (ownerListeners.size === 0) {\n this._owner2Listeners.delete(owner)\n }\n }\n return true\n }\n\n /**\n * Removes a listener from both global and owner indexes.\n * @param {Listener} listener - The listener function to remove\n */\n _remove (listener) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(index, 1)\n\n // clean callback index\n const { callback } = listener\n const callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners != null) {\n callbackListeners.delete(listener)\n if (callbackListeners.size === 0) {\n this._callback2Listeners.delete(callback)\n this._callbacks.delete(callback)\n }\n }\n\n // remove from owner index\n const owner = this._listener2Owner.get(listener)\n if (owner == null) {\n return\n }\n this._listener2Owner.delete(listener)\n const ownerListeners = this._owner2Listeners.get(owner)\n if (ownerListeners == null) {\n return\n }\n ownerListeners.delete(listener)\n if (ownerListeners.size === 0) {\n this._owner2Listeners.delete(owner)\n }\n }\n\n /**\n * Removes all event listeners\n * @param {*} [owner] - Without owner, all listeners will be removed; otherwise, only listeners of \"owner\" will be removed.\n * @returns {this}\n */\n removeAllListeners (owner) {\n // remove listeners of owner\n if (isNil(owner)) {\n // remove all Listeners\n this._callbacks.clear()\n this._listeners.length = 0\n this._callback2Listeners.clear()\n this._listener2Owner.clear()\n this._owner2Listeners.clear()\n return this\n }\n // all listeners of the owner\n const ownerListeners = this._owner2Listeners.get(owner)\n // no owner\n if (ownerListeners == null) {\n return this\n }\n // clear owner index\n this._owner2Listeners.delete(owner)\n // clearn listeners of owner one by one\n for (const listener of ownerListeners) {\n // remove from global index\n const index = this._listeners.indexOf(listener)\n index !== -1 && this._listeners.splice(this._listeners.indexOf(listener), 1)\n\n // clean listener-owner index\n this._listener2Owner.delete(listener)\n\n // one callback function may be registered many times, has many Listeners\n const { callback } = listener\n const callbackListeners = this._callback2Listeners.get(callback)\n if (callbackListeners == null) {\n continue\n }\n callbackListeners.delete(listener)\n if (callbackListeners.size === 0) {\n this._callback2Listeners.delete(callback)\n this._callbacks.delete(callback)\n }\n }\n return this\n }\n}\n\nexport { Event as EventType }\n","// 3rd\n// internal\nimport { TypeUtils, TypeAssert } from '@creejs/commons-lang'\n\n// owned\nimport Event from './event.js'\n// eslint-disable-next-line no-unused-vars\nimport Listener from './listener.js'\n\n// module vars\nconst { isNil } = TypeUtils\nconst {\n assertString, assertFunction, assertNumber,\n assertStringOrSymbol, assertNotNil\n} = TypeAssert\n\n/**\n * methods allowed to mixin other objects\n */\nconst MixinMethods = [\n 'on', 'once', 'addListener', 'prependListener', 'prependOnceListener',\n 'off', 'offAll', 'offOwner', 'removeAllListeners', 'removeListener',\n 'emit', 'setMaxListeners', 'getMaxListeners', 'hasOwner',\n 'listeners', 'listenerCount', 'eventNames', 'rawListeners'\n]\nlet DefaultMaxListeners = 10\n/**\n * 1. An EventEmitter follows the API of NodeJS EventEmitter.\n * 2. Enhancement:\n * * Listeners are grouped by \"owner\".\n * * Operation via \"owner\"\n * * Duplicate listeners are filtered out. Only unique One kept.\n */\nexport default class EventEmitter {\n /**\n * Mixes EventEmitter methods into the given object.\n * @template T\n * @param {T} obj - The target object to mix methods into.\n * @returns {T} The modified object with EventEmitter methods.\n */\n static mixin (obj) {\n const emitter = new EventEmitter()\n // @ts-ignore\n obj.__emitter = emitter\n for (const name of MixinMethods) {\n // @ts-ignore\n const method = emitter[name]\n // @ts-ignore\n obj[name] = method.bind(emitter)\n }\n return obj\n }\n\n static get defaultMaxListeners () {\n return DefaultMaxListeners\n }\n\n static set defaultMaxListeners (maxListeners) {\n assertNumber(maxListeners)\n DefaultMaxListeners = maxListeners ?? 10\n }\n\n /**\n */\n constructor () {\n /**\n * @type {Map<string|Symbol, Event>}\n */\n this._name2Event = new Map()\n this._maxListeners = DefaultMaxListeners\n }\n\n /**\n * Alias of {@linkcode EventEmitter.addListener}\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n addListener (eventName, listener, owner) {\n return this.on(eventName, listener, owner)\n }\n\n /**\n * Adds the listener function to the beginning of the listeners array for the event named eventName.\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n prependListener (eventName, listener, owner) {\n assertString(eventName)\n assertFunction(listener)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.prependListener(listener, owner)\n return this\n }\n\n /**\n * Adds a one-time listener function for the event named eventName to the beginning of the listeners array.\n * @param {string|Symbol} eventName\n * @param {function} listener\n * @param {*} [owner]\n * @returns {this}\n */\n prependOnceListener (eventName, listener, owner) {\n assertString(eventName)\n assertFunction(listener)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.prependOnceListener(listener, owner)\n return this\n }\n\n /**\n * Synchronously calls each of the listeners registered for the event named eventName,\n * in the order they were registered, passing the supplied arguments to each.\n * Returns true if the event had listeners, false otherwise.\n * @param {string|Symbol} eventName - The name of the event.\n * @param {...*} args arguments to pass to the listeners.\n * @returns {boolean}\n */\n emit (eventName, ...args) {\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return false\n }\n event.emit(...args)\n return true\n }\n\n /**\n * Returns an array listing the events for which the emitter has registered listeners.\n * @returns {Array<string|Symbol>} An array of event names.\n */\n eventNames () {\n return [...this._name2Event.keys()]\n }\n\n getMaxListeners () {\n return this._maxListeners\n }\n\n /**\n * Returns the number of listeners listening for the event named eventName.\n * If listener is provided, it will return how many times the listener is found\n * in the list of the listeners of the event.\n * @param {string|Symbol} eventName - The name of the event to check\n * @param {function} [listener] - Optional specific listener to count\n * @returns {number} The number of listeners for the event\n */\n listenerCount (eventName, listener) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return 0\n }\n return event.listenerCount(listener)\n }\n\n /**\n * Returns a copy of the array of listeners for the event named eventName.\n * 1. if a callback function added multiple times, it will be returned multiple times.\n * @param {string} eventName\n * @returns {Array<function>}\n */\n listeners (eventName) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null || event.isEmpty()) {\n return []\n }\n return event.callbacks()\n }\n\n /**\n * Removes a callback function from a specific event.\n * 1. If the event doesn't exist or has no listeners, do nothing\n * 2. if one callback function added multiple times, all of them will be removed.\n * * !!! This is different from the behavior of Node.js EventEmitter.\n *\n * @param {string} eventName - The name of the event to remove callback from\n * @param {function} callback - The callback function to remove\n * @returns {EventEmitter} Returns the emitter instance for chaining\n */\n off (eventName, callback) {\n const event = this._name2Event.get(eventName)\n if (event == null) {\n return this\n }\n event.removeListener(callback)\n if (event.isEmpty()) {\n this._name2Event.delete(eventName)\n return this\n }\n return this\n }\n\n /**\n * Removes all listeners for the specified event.\n * if owner is limited, only the listeners of the owner will be removed.\n *\n * @param {string|Symbol} eventName - The name of the event to clear listeners for.\n * @param {*} owner - The owner whose listeners should be removed.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n offAll (eventName, owner) {\n assertStringOrSymbol(eventName, 'eventName')\n const event = this._name2Event.get(eventName)\n if (event == null) {\n return this\n }\n event.removeAllListeners(owner)\n if (event.isEmpty()) {\n this._name2Event.delete(eventName)\n return this\n }\n return this\n }\n\n /**\n * Removes all event listeners belonging to the specified owner.\n * @param {*} owner - The owner whose listeners should be removed.\n * @returns {this}\n */\n offOwner (owner) {\n assertNotNil(owner, 'owner')\n const events = [...this._name2Event.values()]\n for (const event of events) {\n event.removeAllListeners(owner)\n if (event.isEmpty()) {\n this._name2Event.delete(event.name)\n }\n }\n return this\n }\n\n /**\n * Adds the listener function to the end of the listeners array for the event named eventName.\n * @param {string|Symbol} eventName\n * @param {function} callback\n * @param {*} [owner]\n * @returns {this}\n */\n on (eventName, callback, owner) {\n assertString(eventName)\n assertFunction(callback)\n this._checkMaxListeners(eventName)\n\n const event = this._getOrCreateEvent(eventName)\n event.addListener(callback, owner)\n return this\n }\n\n /**\n * Checks if the number of listeners for the given event exceeds the maximum allowed.\n * Emits a warning if the listener count reaches or exceeds the maxListeners threshold.\n * @private\n * @param {string|Symbol} eventName - The name of the event to check\n * @returns {void}\n */\n _checkMaxListeners (eventName) {\n let listenerCount = 0\n if (this._maxListeners !== 0 && this._maxListeners !== Infinity && (listenerCount = this.listenerCount(eventName)) >= this._maxListeners) {\n console.warn(`maxlistenersexceededwarning: Possible EventEmitter memory leak detected. ${listenerCount} ${eventName} listeners added to [${this}]. Use emitter.setMaxListeners() to increase limit`)\n }\n }\n\n /**\n * Adds a listener that will be invoked only once for the event named eventName.SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit`)\n }\n }\n\n /**\n * Adds a one-time callback function for the specified event.\n * The callback is invoked only once and then automatically removed.\n *\n * @param {string} eventName - The name of the event to listen for.\n * @param {Function} callback - The callback function to execute when the event is emitted.\n * @param {*} [owner] - Optional owner used to group listener callbacks.\n * @returns {EventEmitter} Returns the emitter instance for chaining.\n */\n once (eventName, callback, owner) {\n assertString(eventName)\n assertFunction(callback)\n\n const event = this._getOrCreateEvent(eventName)\n event.addOnceListener(callback, owner)\n return this\n }\n\n /**\n * Returns a copy of the array of listeners for the event named eventName,\n * including any wrappers (such as those created by .once()).\n * @param {string} eventName - The name of the event.\n * @returns {Listener[]} An array of raw listener functions, or empty array if none exist.\n */\n rawListeners (eventName) {\n return this._name2Event.get(eventName)?.rawListeners() || []\n }\n\n /**\n * Alias of {@linkcode EventEmitter.offAll}\n * @param {string|Symbol} eventName - The name of the event to remove listeners for.\n * @param {*} owner - The owner of the listeners to be removed.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n removeAllListeners (eventName, owner) {\n return this.offAll(eventName, owner)\n }\n\n /**\n * Alias of {@linkcode EventEmitter.off}\n * @param {string} eventName - The name of the event.\n * @param {Function} callback - The callback function to remove.\n * @returns {EventEmitter} The emitter instance for chaining.\n */\n removeListener (eventName, callback) {\n return this.off(eventName, callback)\n }\n\n /**\n * Sets the maximum number of listeners that can be added to this event emitter.\n * @param {number} max - The maximum number of listeners.\n * @returns {this} The set maximum number of listeners.\n */\n setMaxListeners (max) {\n assertNumber(max)\n if (max < 0) {\n throw new RangeError('maxListeners must >=0')\n }\n this._maxListeners = max\n return this\n }\n\n /**\n * Gets an existing event by name or creates a new one if it doesn't exist.\n * @private\n * @param {string|Symbol} eventName - The name of the event to get or create.\n * @returns {Event} The existing or newly created Event instance.\n */\n _getOrCreateEvent (eventName) {\n if (this._name2Event.has(eventName)) {\n // @ts-ignore\n return this._name2Event.get(eventName)\n }\n const event = new Event(eventName)\n this._name2Event.set(eventName, event)\n return event\n }\n\n /**\n * Checks if the specified owner has any registered events.\n * @param {Object} owner - The owner object to check for registered events.\n * @returns {boolean} True if the owner has any registered events, false otherwise.\n */\n hasOwner (owner) {\n if (isNil(owner)) {\n return false\n }\n for (const event of this._name2Event.values()) {\n if (event.hasOwner(owner)) {\n return true\n }\n }\n return false\n }\n}\n\nexport { EventEmitter as EventEmitterType }\n"],"names":["r","isFunction","s","isNil","f","t","d","b","assertNumber","e","y","Error","JSON","stringify","assertFunction","assertNotNil","assertString","assertStringOrSymbol","m","DefaultOwner","TypeAssert","Listener","constructor","event","callback","isOnce","this","_event","_callback","_isOnce","_owner","undefined","owner","isSameCallback","invoke","args","_remove","err","console","warn","listener","TypeUtils","Event","eventName","_name","_callbacks","Set","_listeners","_callback2Listeners","Map","_listener2Owner","_owner2Listeners","name","isEmpty","size","rawListeners","listenerCount","length","get","callbacks","map","emit","hasListener","has","hasOwner","addListener","_addListener","prependListener","addOnceListener","prependOnceListener","isPrepend","add","unshift","push","set","callbackListeners","ownerListeners","removeListener","delete","listeners","indexOf","splice","index","removeAllListeners","clear","MixinMethods","DefaultMaxListeners","EventEmitter","mixin","obj","emitter","__emitter","method","bind","defaultMaxListeners","maxListeners","_name2Event","_maxListeners","on","_checkMaxListeners","_getOrCreateEvent","eventNames","keys","getMaxListeners","off","offAll","offOwner","events","values","Infinity","once","setMaxListeners","max","Rang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B,GACb7B,EAAeU,GAIf,OAFcE,KAAK0E,kBAAkBzD,GAC/ByB,gBAAgB5C,EAAUQ,GACzBN,IACT,CAQA,YAAA6B,CAAcZ,GACZ,OAAOjB,KAAKsE,YAAYtC,IAAIf,IAAYY,gBAAkB,EAC5D,CAQA,kBAAA4B,CAAoBxC,EAAWX,GAC7B,OAAON,KAAK+E,OAAO9D,EAAWX,EAChC,CAQA,cAAA6C,CAAgBlC,EAAWnB,GACzB,OAAOE,KAAK8E,IAAI7D,EAAWnB,EAC7B,CAOA,eAAAuF,CAAiBC,GAEf,GADAxG,EAAawG,GACTA,EAAM,EACR,MAAM,IAAIC,WAAW,yBAGvB,OADAvF,KAAKuE,cAAgBe,EACdtF,IACT,CAQA,iBAAA0E,CAAmBzD,GACjB,GAAIjB,KAAKsE,YAAYjC,IAAIpB,GAEvB,OAAOjB,KAAKsE,YAAYtC,IAAIf,GAE9B,MAAMpB,EAAQ,IAAImB,EAAMC,GAExB,OADAjB,KAAKsE,YAAYtB,IAAI/B,EAAWpB,GACzBA,CACT,CAOA,QAAAyC,CAAUhC,GACR,GAAI7B,EAAM6B,GACR,OAAO,EAET,IAAK,MAAMT,KAASG,KAAKsE,YAAYY,SACnC,GAAIrF,EAAMyC,SAAShC,GACjB,OAAO,EAGX,OAAO,CACT"}
@@ -1,4 +1,4 @@
1
- var r={isFunction:u,isNil:l};function u(t){return "function"==typeof t}function l(t){return null==t}function y(t){return null!=t&&"number"==typeof t}function d(t){return null!=t&&"string"==typeof t}function m(t){return null!=t&&"symbol"==typeof t}var N={assertNumber:E,assertFunction:v,assertNotNil:function(t,e){if(l(t))throw new Error((e?'"'+e+'" ':" ")+"Should Not Nil")},assertString:b,assertStringOrSymbol:function(t,e){if(!d(t)&&!m(t))throw new Error(`${e?'"'+e+'" ':" "}Not String or Symbol: type=${typeof t} value=${JSON.stringify(t)}`)}};function b(t,e){if(!d(t))throw new Error(`${e?'"'+e+'" ':" "}Not String: type=${typeof t} value=${JSON.stringify(t)}`)}function E(t,e){if(!y(t))throw new Error(`${e?'"'+e+'" ':" "}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)}function v(t,e){if(!u(t))throw new Error(`${e?'"'+e+'" ':" "}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)}
1
+ var r={isFunction:s,isNil:f};function s(t){return "function"==typeof t}function f(t){return null==t}function y(t){return null!=t&&"number"==typeof t}function d(t){return null!=t&&"string"==typeof t}function m(t){return null!=t&&"symbol"==typeof t}var b={assertNumber:$,assertFunction:E,assertNotNil:function(t,e){if(f(t))throw new Error((e?'"'+e+'" ':" ")+"Should Not Nil")},assertString:O,assertStringOrSymbol:function(t,e){if(!d(t)&&!m(t))throw new Error(`${e?'"'+e+'" ':" "}Not String or Symbol: type=${typeof t} value=${JSON.stringify(t)}`)}};function O(t,e){if(!d(t))throw new Error(`${e?'"'+e+'" ':" "}Not String: type=${typeof t} value=${JSON.stringify(t)}`)}function $(t,e){if(!y(t))throw new Error(`${e?'"'+e+'" ':" "}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)}function E(t,e){if(!s(t))throw new Error(`${e?'"'+e+'" ':" "}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)}
2
2
 
3
3
  const DefaultOwner = 'DOwner$#$';
4
4
 
@@ -6,7 +6,7 @@ const DefaultOwner = 'DOwner$#$';
6
6
  // internal
7
7
 
8
8
  // module vars
9
- const { assertFunction: assertFunction$2, assertNotNil: assertNotNil$1 } = N;
9
+ const { assertFunction: assertFunction$2, assertNotNil: assertNotNil$1 } = b;
10
10
  /**
11
11
  * Wraps a function to be called when an event is fired.
12
12
  * @typedef {import('./event.js').default} Event
@@ -96,7 +96,7 @@ class Listener {
96
96
 
97
97
  // module vars
98
98
  const { isFunction, isNil: isNil$1 } = r;
99
- const { assertStringOrSymbol: assertStringOrSymbol$1, assertFunction: assertFunction$1 } = N;
99
+ const { assertStringOrSymbol: assertStringOrSymbol$1, assertFunction: assertFunction$1 } = b;
100
100
 
101
101
  /**
102
102
  * An Event definition
@@ -454,7 +454,7 @@ const { isNil } = r;
454
454
  const {
455
455
  assertString, assertFunction, assertNumber,
456
456
  assertStringOrSymbol, assertNotNil
457
- } = N;
457
+ } = b;
458
458
 
459
459
  /**
460
460
  * methods allowed to mixin other objects