@superutils/store 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -50
- package/dist/browser/index.min.js +2 -2
- package/dist/browser/index.min.js.map +1 -1
- package/dist/index.cjs +59 -25
- package/dist/index.d.cts +426 -330
- package/dist/index.d.ts +426 -330
- package/dist/index.js +59 -26
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../core/dist/index.js","../../../../node_modules/tslib/tslib.es6.mjs","../../../../node_modules/rxjs/src/internal/util/isFunction.ts","../../../../node_modules/rxjs/src/internal/util/createErrorClass.ts","../../../../node_modules/rxjs/src/internal/util/UnsubscriptionError.ts","../../../../node_modules/rxjs/src/internal/util/arrRemove.ts","../../../../node_modules/rxjs/src/internal/Subscription.ts","../../../../node_modules/rxjs/src/internal/config.ts","../../../../node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts","../../../../node_modules/rxjs/src/internal/util/reportUnhandledError.ts","../../../../node_modules/rxjs/src/internal/util/noop.ts","../../../../node_modules/rxjs/src/internal/util/errorContext.ts","../../../../node_modules/rxjs/src/internal/Subscriber.ts","../../../../node_modules/rxjs/src/internal/symbol/observable.ts","../../../../node_modules/rxjs/src/internal/util/identity.ts","../../../../node_modules/rxjs/src/internal/util/pipe.ts","../../../../node_modules/rxjs/src/internal/Observable.ts","../../../../node_modules/rxjs/src/internal/util/lift.ts","../../../../node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts","../../../../node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts","../../../../node_modules/rxjs/src/internal/Subject.ts","../../../../node_modules/rxjs/src/internal/BehaviorSubject.ts","../../../../node_modules/rxjs/src/internal/operators/filter.ts","../../../../node_modules/rxjs/src/internal/operators/skip.ts","../../src/types/types.ts","../../src/Store.ts","../../src/createStore.ts","../../src/createObjectStore.ts","../../src/index.ts"],"names":["isObj","x","strict","isArr","isArr2D","isArrLike","isInteger","isNumber","isPositiveInteger","isPositiveNumber","isEmpty","nonNumerable","fallback","proto","isFn","isMap","isDefined","isPromise","isRegExp","isSet","isStr","isSymbol","fallbackIfFails","target","args","result","err","fallbackIfFails_default","objKeys","obj","sorted","includeSymbols","objKeys_default","clone","value","objCopy","input","output","ignoreKeys","override","recursive","_output","_ignoreKeys","inKeys","_key","key","ignoreChildKeys","objCreate","keys","values","i","objToMap","entries","k","v","arrReverse","arr","reverse2","newArray","debounce","callback","delay","config","leading","onError","thisArg","tid","_callback","firstArgs","leadingGlobal","debounce_default","throttle","d","trailing","handleCallback","trailArgs","cbArgs","throttle_default","deferred","options","filter","data","predicate","limit","asMap","_a","item","filter_default","getSize","s","_","getSize_default","getValues","getValues_default","search","ignore","ignoreCase","matchAll","matchExact","ranked","query","qIsStr","qIsRegExp","qKeys","preRankedResults","dataKey","dataValue","matchIndex","matchObjOrProp","indexes","index","a","b","n","transform","propertyName","_b","global","keyword","propVal","valueStr","search_default","find","optsOrCb","getEntries","map","getKeys","sort","keyOrFn","dataType","asString","newInstance","undefinedFirst","alt","getVal","val","gt","lt","entry","mapJoin","inputs","extendStatics","p","__extends","__","__values","o","m","__read","r","ar","e","error","__spreadArray","to","from","pack","l","isFunction","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","arrRemove","Subscription","initialTeardown","_parentage","_parentage_1","_parentage_1_1","parent_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","teardown","parent","empty","EMPTY_SUBSCRIPTION","isSubscription","timeoutProvider","handler","timeout","_i","handle","reportUnhandledError","noop","errorContext","cb","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","handleStoppedNotification","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","defaultErrorHandler","notification","subscriber","observable","identity","pipeFromArray","fns","prev","fn","Observable","subscribe","operator","isSubscriber","source","sink","promiseCtor","getPromiseCtor","resolve","reject","operations","isObserver","hasLift","operate","init","liftedSource","createOperatorSubscriber","onNext","onComplete","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","_c","observer","observers","hasError","isStopped","thrownError","BehaviorSubject","_value","subscription","skip","count","Store_OnErrorType","forceUpdateCache$","_Store","name","predicateOrOptions","forceRead","wasInitialized","newData","initialValue","checkStorage","firstValue","dataStr","existingValue","skipNum","replace","replacer","spacing","str","type","returnValue","jsonStr","cacheDisabled","delayOptions","onChange","parse","spaces","storage","stringify","validate","_validate","Store","Store_default","createStore","store","createStore_default","createObjectStore","index_default"],"mappings":"0FAcA,IAAIA,CAAAA,CAAQ,CAACC,CAAAA,CAAGC,CAAAA,CAAS,OAAS,CAAC,CAACD,CAAAA,EAAK,OAAOA,CAAAA,EAAM,QAAA,GAAa,CAACC,CAAAA,EAAU,CAC5E,MAAA,CAAO,SAAA,CACP,IAEF,CAAA,CAAE,QAAA,CAAS,MAAA,CAAO,cAAA,CAAeD,CAAC,CAAC,CAAA,CAAA,CAInC,IAAIE,CAAAA,CAASF,CAAAA,EAAM,KAAA,CAAM,OAAA,CAAQA,CAAC,CAAA,CAElC,IAAIG,EAAAA,CAAWH,CAAAA,EAAME,CAAAA,CAAMF,CAAC,CAAA,EAAKA,CAAAA,CAAE,KAAA,CAAME,CAAK,EAC1CE,EAAAA,CAAaJ,CAAAA,EAAME,CAAAA,CAAMF,CAAC,CAAA,EAAKA,CAAAA,YAAa,GAAA,EAAOA,CAAAA,YAAa,IAwBpE,IAAIK,EAAAA,CAAaL,CAAAA,EAAM,MAAA,CAAO,SAAA,CAAUA,CAAC,CAAA,CAGzC,IAAIM,GAAYN,CAAAA,EAAM,OAAOA,CAAAA,EAAM,QAAA,EAAY,CAAC,MAAA,CAAO,KAAA,CAAMA,CAAC,GAAK,MAAA,CAAO,QAAA,CAASA,CAAC,CAAA,CAChFO,EAAAA,CAAqBP,CAAAA,EAAMK,EAAAA,CAAUL,CAAC,GAAKA,CAAA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AAI,CAAM,EACtD,SAAA,CAAW,SAAU5L,CAAAA,CAAM,CAC1B,OAAO,IAAA,CAAK,UAAU,IAAA,CAAK,QAAA,CAASA,CAAI,CAAC,CAC1C,CAAA,CACA,GAAIF,CAAAA,CACJ,YAAA,CAAe/E,CAAAA,CAAM+E,CAAAA,EAAA,IAAA,CAAA,MAAA,CAAAA,CAAAA,CAAS,aAAc,IAAI,CAAA,CAE7C5B,CAAAA,CAAY4B,CAAAA,CAAQ,YAAY,CAAA,CADhCA,GAAA,IAAA,CAAA,MAAA,CAAAA,CAAAA,CAAS,YAEb,CAAC,CAAA,CAED,OAAA8M,CAAAA,CAAM,IAAA,CAAO,QAAA,CAENA,CAKR,CC7JA,IAAOG,EAAAA,CAAQL","file":"index.min.js","sourcesContent":["// src/curry.ts\nfunction curry(func, ...[arity = func.length]) {\n const curriedFn = (...args) => {\n const _args = args;\n if (_args.length >= arity) return func(...args);\n return (...nextArgs) => curriedFn(\n ..._args,\n ...nextArgs\n );\n };\n return curriedFn;\n}\n\n// src/is/isObj.ts\nvar isObj = (x, strict = true) => !!x && typeof x === \"object\" && (!strict || [\n Object.prototype,\n null\n // when an object is created using `Object.create(null)`\n].includes(Object.getPrototypeOf(x)));\nvar isObj_default = isObj;\n\n// src/is/isArr.ts\nvar isArr = (x) => Array.isArray(x);\nvar isArrObj = (x, strict = true) => isArr(x) && x.every((x2) => isObj(x2, strict));\nvar isArr2D = (x) => isArr(x) && x.every(isArr);\nvar isArrLike = (x) => isArr(x) || x instanceof Set || x instanceof Map;\nvar isArrLikeSafe = (x) => [\"[object Array]\", \"[object Map]\", \"[object Set]\"].includes(\n Object.prototype.toString.call(x)\n);\nvar isArrUnique = (x) => isArr(x) && new Set(x).size === x.length;\nvar isUint8Arr = (x) => x instanceof Uint8Array;\nvar isArr_default = isArr;\n\n// src/is/isDate.ts\nvar isDate = (x) => x instanceof Date;\nvar isDateValid = (date) => {\n const dateIsStr = typeof date === \"string\";\n if (!dateIsStr && !isDate(date)) return false;\n const dateObj = new Date(date);\n if (Number.isNaN(dateObj.getTime())) return false;\n if (!dateIsStr) return true;\n const [original, converted] = [date, dateObj.toISOString()].map(\n (y) => y.replace(/[TZ]/g, \"\").substring(0, 10)\n );\n return original === converted;\n};\nvar isDate_default = isDate;\n\n// src/is/isNumber.ts\nvar isInteger = (x) => Number.isInteger(x);\nvar isNegativeInteger = (x) => Number.isInteger(x) && x < 0;\nvar isNegativeNumber = (x) => isNumber(x) && x < 0;\nvar isNumber = (x) => typeof x === \"number\" && !Number.isNaN(x) && Number.isFinite(x);\nvar isPositiveInteger = (x) => isInteger(x) && x > 0;\nvar isPositiveNumber = (x) => isNumber(x) && x > 0;\n\n// src/is/isEmpty.ts\nvar isEmpty = (x, nonNumerable = false, fallback = false) => {\n if (x === null || x === void 0) return true;\n switch (typeof x) {\n case \"number\":\n return !isNumber(x);\n case \"string\":\n return !x.replaceAll(\"\t\", \"\").trim().length;\n case \"boolean\":\n case \"bigint\":\n case \"symbol\":\n case \"function\":\n return false;\n }\n if (x instanceof Date) return Number.isNaN(x.getTime());\n if (x instanceof Map || x instanceof Set) return !x.size;\n if (Array.isArray(x) || x instanceof Uint8Array) return !x.length;\n if (x instanceof Error) return !x.message.length;\n const proto = typeof x === \"object\" && Object.getPrototypeOf(x);\n if (proto === Object.prototype || proto === null) {\n return nonNumerable ? !Object.getOwnPropertyNames(x).length : !Object.keys(x).length;\n }\n return fallback;\n};\nvar isEmptySafe = (x, numberableOnly = false) => {\n const empty = isEmpty(x, numberableOnly, 0);\n if (empty !== 0) return empty;\n switch (Object.prototype.toString.call(x)) {\n case \"[object Uint8Array]\":\n return !x.length;\n case \"[object Date]\":\n return Number.isNaN(x.getTime());\n case \"[object Map]\":\n return !x.size;\n case \"[object Object]\":\n return !Object.keys(x).length;\n case \"[object Set]\":\n return !x.size;\n default:\n return false;\n }\n};\nvar isEmpty_default = isEmpty;\n\n// src/is/isEnv.ts\nvar isEnvBrowser = () => typeof window !== \"undefined\" && typeof window.navigator !== \"undefined\" && typeof window.document !== \"undefined\";\nvar isEnvBun = () => {\n var _a;\n return Object.hasOwn(globalThis, \"Bun\") && typeof process !== \"undefined\" && !!((_a = process.versions) == null ? void 0 : _a.bun);\n};\nvar isEnvDeno = () => {\n var _a;\n return typeof ((_a = globalThis.Deno) == null ? void 0 : _a.version) === \"string\";\n};\nvar isEnvMobile = () => isEnvBrowser() && /Android|Adr|webOS|iPhone|iPad|iPod|iOS|BlackBerry|BB10|IEMobile|Opera Mini|Mobile|CriOS|FxiOS|Silk|Huawei|HUAWEI|Honor|EMUI|Mi(?:ui)?|Redmi|Poco|OPR\\/|Vivo|Oppo|Lenovo|Pixel|SM-|GT-|Moto|Nexus/i.test(\n String(\n navigator.userAgent || (window == null ? void 0 : window.opera)\n )\n);\nvar isEnvNode = (strict = false) => {\n var _a, _b;\n return typeof process !== \"undefined\" && !!((_a = process.versions) == null ? void 0 : _a.node) && (!strict || !((_b = process.versions) == null ? void 0 : _b.bun));\n};\nvar isEnvTouchable = () => {\n var _a, _b;\n return \"ontouchstart\" in ((_b = (_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement) != null ? _b : {});\n};\n\n// src/noop.ts\nfunction noop() {\n}\nasync function noopAsync() {\n}\n\n// src/is/isFn.ts\nvar isFn = (x) => typeof x === \"function\";\nvar isAsyncFn = (x) => x instanceof noopAsync.constructor && x[Symbol.toStringTag] === \"AsyncFunction\";\nvar isFn_default = isFn;\n\n// src/is/isMap.ts\nvar isMap = (x) => x instanceof Map;\nvar isMapObj = (x, strict = true) => isMap(x) && [...x.values()].every((value) => isObj_default(value, strict));\n\n// src/is/isUrl.ts\nvar isUrl = (x) => x instanceof URL;\nvar isUrlValid = (x, strict = true, tldExceptions = [\"localhost\"]) => {\n if (!x) return false;\n try {\n if (typeof x !== \"string\" && !isUrl(x)) return false;\n const url = isUrl(x) ? x : new URL(x);\n if (!strict) return true;\n const gotTld = tldExceptions.includes(url.hostname) || url.host.split(\".\").length > 1;\n if (!gotTld) return false;\n let y = `${x}`;\n if (y.endsWith(url.hostname)) y += \"/\";\n return url.href === y;\n } catch (_) {\n return false;\n }\n};\nvar isUrl_default = isUrl;\n\n// src/is/index.ts\nvar isBool = (x) => typeof x === \"boolean\" || x instanceof Boolean;\nvar isDefined = (x) => x !== void 0 && x !== null;\nvar isError = (x) => x instanceof Error;\nvar isPromise = (x) => x instanceof Promise;\nvar isRegExp = (x) => x instanceof RegExp;\nvar isSet = (x) => x instanceof Set;\nvar isStr = (x) => typeof x === \"string\";\nvar isSubjectLike = (x, withValue = false) => isObj_default(x, false) && isFn_default(x.subscribe) && isFn_default(x.next) && (!withValue || \"value\" in x);\nvar isSymbol = (x) => typeof x === \"symbol\";\nvar is = {\n arr: isArr_default,\n arr2D: isArr2D,\n arrLike: isArrLike,\n arrLikeSafe: isArrLikeSafe,\n arrObj: isArrObj,\n arrUnique: isArrUnique,\n asyncFn: isAsyncFn,\n bool: isBool,\n date: isDate_default,\n dateValid: isDateValid,\n defined: isDefined,\n empty: isEmpty_default,\n emptySafe: isEmptySafe,\n envBrowser: isEnvBrowser,\n envBun: isEnvBun,\n envDeno: isEnvDeno,\n envMobile: isEnvMobile,\n envNode: isEnvNode,\n envTouchable: isEnvTouchable,\n error: isError,\n fn: isFn_default,\n integer: isInteger,\n map: isMap,\n mapObj: isMapObj,\n negativeInteger: isNegativeInteger,\n negativeNumber: isNegativeNumber,\n number: isNumber,\n obj: isObj_default,\n positiveInteger: isPositiveInteger,\n positiveNumber: isPositiveNumber,\n promise: isPromise,\n regExp: isRegExp,\n set: isSet,\n str: isStr,\n subjectLike: isSubjectLike,\n symbol: isSymbol,\n uint8Arr: isUint8Arr,\n url: isUrl_default,\n urlValid: isUrlValid\n};\n\n// src/fallbackIfFails.ts\nvar fallbackIfFails = (target, args, fallback) => {\n try {\n const result = !isFn(target) ? target : target(...isFn(args) ? args() : args);\n if (!isPromise(result)) return result;\n return result.catch(\n (err) => isFn(fallback) ? fallback(err) : fallback\n );\n } catch (err) {\n return isFn(fallback) ? fallback(err) : fallback;\n }\n};\nvar fallbackIfFails_default = fallbackIfFails;\n\n// src/toDatetimeLocal.ts\nvar toDatetimeLocal = (dateStr) => {\n const date = new Date(dateStr);\n if (!isDateValid(date)) return \"\";\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, \"0\");\n const day = date.getDate().toString().padStart(2, \"0\");\n const hours = date.getHours().toString().padStart(2, \"0\");\n const minutes = date.getMinutes().toString().padStart(2, \"0\");\n const res = `${year}-${month}-${day}T${hours}:${minutes}`;\n return res;\n};\n(/* @__PURE__ */ new Date()).getTime();\n\n// src/obj/objClean.ts\nvar objClean = (obj, keys, ignoreIfNotExist = true) => {\n const result = {};\n if (!isObj(obj) || !isArr(keys)) return result;\n const uniqKeys = arrUnique(\n keys.map((x) => String(x).split(\".\")[0])\n ).sort();\n for (const key of uniqKeys) {\n if (ignoreIfNotExist && !obj.hasOwnProperty(key)) continue;\n const value = obj[key];\n if (!isObj(value) || isSymbol(key)) {\n result[key] = value;\n continue;\n }\n const childPrefix = `${key}.`;\n const childKeys = keys.filter((k) => {\n var _a;\n return (_a = k == null ? void 0 : k.startsWith) == null ? void 0 : _a.call(k, childPrefix);\n }).map((k) => k.split(childPrefix)[1]);\n if (!childKeys.length) {\n result[key] = value;\n continue;\n }\n result[key] = objClean(\n value,\n childKeys\n );\n }\n return result;\n};\n\n// src/obj/objKeys.ts\nvar objKeys = (obj, sorted = true, includeSymbols = true) => (\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n fallbackIfFails_default(\n () => [\n ...includeSymbols && Object.getOwnPropertySymbols(obj) || [],\n ...sorted ? Object.keys(obj).sort() : Object.keys(obj)\n ],\n [],\n []\n )\n);\nvar objKeys_default = objKeys;\n\n// src/obj/objCopy.ts\nvar clone = (value, fallback = \"null\") => JSON.parse(fallbackIfFails_default(JSON.stringify, [value], fallback));\nvar objCopy = (input, output, ignoreKeys, override = false, recursive = true) => {\n const _output = isObj(output, false) || isFn(output) ? output : {};\n if (!isObj(input, false) && !isFn(output)) return _output;\n const _ignoreKeys = new Set(ignoreKeys != null ? ignoreKeys : []);\n const inKeys = objKeys_default(input, true, true).filter(\n (x) => !_ignoreKeys.has(x)\n );\n for (const _key of inKeys) {\n const key = _key;\n const value = input[key];\n const skip = _output.hasOwnProperty(key) && (override === \"empty\" ? !isEmpty(_output[key]) : isFn(override) ? !override(key, _output[key], value) : true);\n if (skip) continue;\n const isPrimitive = [void 0, null, Infinity, NaN].includes(value) || !isObj(value, false);\n if (isPrimitive) {\n _output[key] = value;\n continue;\n }\n _output[key] = (() => {\n switch (Object.getPrototypeOf(value)) {\n case Array.prototype:\n return clone(value, \"[]\");\n case ArrayBuffer.prototype:\n return value.slice(0);\n case Date.prototype:\n return new Date(value.getTime());\n case Map.prototype:\n return new Map(\n clone(\n Array.from(\n value\n ),\n \"[]\"\n )\n );\n case RegExp.prototype:\n return new RegExp(value);\n case Set.prototype:\n return new Set(\n clone(Array.from(value))\n );\n case Uint8Array.prototype:\n return new Uint8Array([...value]);\n case URL.prototype:\n return new URL(value);\n default:\n break;\n }\n if (isSymbol(key) || !recursive) return clone(value);\n const ignoreChildKeys = [..._ignoreKeys].map(\n (x) => String(x).startsWith(String(key).concat(\".\")) && String(x).split(String(key).concat(\".\"))[1]\n ).filter(Boolean);\n if (!ignoreChildKeys.length) return clone(value);\n return objCopy(\n value,\n _output[key],\n ignoreChildKeys,\n override,\n recursive\n );\n })();\n }\n return _output;\n};\n\n// src/obj/objCreate.ts\nvar objCreate = (keys = [], values = [], result) => {\n if (!isObj(result)) result = {};\n for (let i = 0; i < (isArr(keys) ? keys : []).length; i++) {\n ;\n result[keys[i]] = values == null ? void 0 : values[i];\n }\n return result;\n};\n\n// src/obj/objHasKeys.ts\nfunction objHasKeys(input = {}, keys = [], requireValue = false) {\n if (!isObj(input) || !isArr(keys)) return false;\n for (const key of keys) {\n if (!input.hasOwnProperty(key)) return false;\n if (requireValue && isEmpty(input[key])) return false;\n }\n return true;\n}\n\n// src/obj/objReadOnly.ts\nvar objReadOnly = (obj, config) => {\n if (!isObj(obj, false)) obj = {};\n const { add, revocable, silent = true } = config != null ? config : {};\n const [typeTitle, keyTitle] = isArr(obj) ? [\"array\", \"index\"] : [\"object\", \"property name\"];\n function handleSetProp(obj2, key, value) {\n const isUpdate = obj2[key] !== void 0;\n if (isUpdate && silent) return true;\n const allowAddition = !isUpdate && (!isFn(add) ? add : add(obj2, key, value));\n const shouldThrow = !silent && (isUpdate || !allowAddition);\n if (shouldThrow)\n throw new TypeError(\n `Mutation not allow on read-only ${typeTitle} ${keyTitle}: ${key.toString()}`\n );\n if (!allowAddition) return true;\n obj2[key] = value;\n return true;\n }\n const proxyHandler = {\n get: (obj2, key) => obj2[key],\n set: handleSetProp,\n defineProperty: (obj2, key, { value }) => handleSetProp(obj2, key, value),\n // Prevent removal of properties\n deleteProperty: (obj2, key) => {\n if (!silent && obj2.hasOwnProperty(key)) {\n throw new Error(\n `Mutation not allow on read-only ${typeTitle} ${keyTitle}: ${key.toString()}`\n );\n }\n return true;\n }\n };\n return revocable ? Proxy.revocable(obj, proxyHandler) : new Proxy(obj, proxyHandler);\n};\n\n// src/obj/objSetProp.ts\nvar objSetProp = (obj, key, falsyValue, condition, truthyValue) => {\n var _a;\n const result = !isObj(obj, false) ? {} : obj;\n falsyValue != null ? falsyValue : falsyValue = result[key];\n condition = isFn(condition) ? condition((_a = result[key]) != null ? _a : falsyValue, key, obj) : condition;\n result[key] = !condition ? falsyValue : truthyValue;\n return result;\n};\nvar objSetPropUndefined = (...[obj, key, ...args]) => (obj == null ? void 0 : obj[key]) === void 0 && objSetProp(obj, key, ...args) || obj;\n\n// src/obj/objSort.ts\nvar objSort = (obj, recursive = true, _done = /* @__PURE__ */ new Map()) => {\n const sorted = {};\n if (!isObj(obj)) return sorted;\n for (const key of objKeys_default(obj)) {\n const value = obj[key];\n _done.set(value, true);\n sorted[key] = !recursive || !isObj(value) ? value : objSort(\n value,\n recursive,\n _done\n );\n }\n return sorted;\n};\n\n// src/obj/objToMap.ts\nfunction objToMap(input) {\n const entries = Object.entries(!isObj(input) ? {} : input);\n return new Map(entries.map(([k, v]) => [k, v]));\n}\n\n// src/obj/objWithoutKeys.ts\nvar objWithoutKeys = (input, keys, output) => {\n if (!isObj(input, false)) return {};\n if (!isArr(keys) || !keys.length) return input;\n output = {\n ...isObj(output, false) && output,\n ...input\n };\n for (const key of keys) delete output[key];\n return output;\n};\n\n// src/arr/arrReadOnly.ts\nvar arrReadOnly = (arr, config = {}) => objReadOnly(new ReadOnlyArrayHelper(config, arr), config);\nvar ReadOnlyArrayHelper = class extends Array {\n constructor(config, arr) {\n var _a;\n (_a = config.silent) != null ? _a : config.silent = true;\n super(...arr);\n this.config = config;\n this.ignoreOrThrow = (returnValue) => {\n if (this.config.silent) return returnValue;\n throw new Error(\"Mutation not allowed on read-only array\");\n };\n this.pop = () => this.ignoreOrThrow(this[this.length - 1]);\n this.push = (...items) => !this.config.add ? this.ignoreOrThrow(this.length) : super.push(...items);\n this.reverse = () => this.ignoreOrThrow(this);\n this.shift = () => this.ignoreOrThrow(this[0]);\n this.splice = (..._ignoredArgs) => this.ignoreOrThrow([]);\n this.unshift = (..._ignoredArgs) => this.ignoreOrThrow(this.length);\n }\n // fromAsync = super.fromAsync\n // reduce = super.reduce\n // reduceRight = super.reduceRight\n};\n\n// src/arr/arrReverse.ts\nvar arrReverse = (arr, reverse2 = true, newArray = false) => {\n if (!isArr(arr)) return [];\n if (newArray) arr = [...arr];\n return reverse2 ? arr.reverse() : arr;\n};\n\n// src/arr/arrToMap.ts\nfunction arrToMap(arr, key, flatDepth = 0) {\n ;\n [key, flatDepth] = isNumber(key) ? [void 0, key] : [key, flatDepth];\n const flatEntries = (!isArr(arr) ? [] : flatDepth > 0 ? arr.flat(flatDepth) : arr).map((item, i, flatArr) => {\n var _a;\n return [\n (_a = isFn(key) ? key(item, i, flatArr) : isObj(item) && isDefined(key) ? item[key] : i) != null ? _a : i,\n item\n ];\n });\n return new Map(flatEntries);\n}\n\n// src/arr/arrUnique.ts\nvar arrUnique = (arr, flatDepth = 0) => !isArr(arr) ? [] : Array.from(new Set(arr.flat(flatDepth)));\n\n// src/deferred/debounce.ts\nvar debounce = (callback, delay = 50, config = {}) => {\n const {\n leading = debounce.defaults.leading,\n onError = debounce.defaults.onError,\n thisArg\n } = config;\n let { tid } = config;\n if (thisArg !== void 0) callback = callback.bind(thisArg);\n const _callback = (...args) => fallbackIfFails_default(callback, args, onError);\n let firstArgs = null;\n const leadingGlobal = leading === \"global\";\n return (...args) => {\n clearTimeout(tid);\n tid = setTimeout(() => {\n firstArgs !== args && _callback(...args);\n firstArgs = leadingGlobal ? true : null;\n }, delay);\n if (!leading || firstArgs) return;\n firstArgs = args;\n _callback(...args);\n };\n};\ndebounce.defaults = {\n /**\n * Set the default value of argument `leading` for the `deferred` function.\n * This change is applicable application-wide and only applies to any new invocation of `deferred()`.\n */\n leading: false,\n /**\n * Set the default value of argument `onError` for the `deferred` function.\n * This change is applicable application-wide and only applies to any new invocation of `deferred()`.\n */\n onError: void 0\n};\nvar debounce_default = debounce;\n\n// src/deferred/throttle.ts\nvar throttle = (callback, delay = 50, config = {}) => {\n const { defaults: d } = throttle;\n const { onError = d.onError, trailing = d.trailing, thisArg } = config;\n let { tid } = config;\n const handleCallback = (...args) => fallbackIfFails_default(\n thisArg !== void 0 ? callback.bind(thisArg) : callback,\n args,\n !isFn(onError) ? void 0 : (err) => fallbackIfFails_default(onError, [err], void 0)\n );\n let trailArgs = null;\n return (...args) => {\n if (tid) {\n trailArgs = args;\n return;\n }\n tid = setTimeout(() => {\n tid = void 0;\n if (!trailing) return;\n const cbArgs = trailArgs;\n trailArgs = null;\n cbArgs && cbArgs !== args && handleCallback(...cbArgs);\n }, delay);\n handleCallback(...args);\n };\n};\nthrottle.defaults = {\n onError: void 0,\n trailing: false\n};\nvar throttled = throttle;\nvar throttle_default = throttle;\n\n// src/deferred/deferred.ts\nvar deferred = (callback, delay = 50, options = {}) => options.throttle ? throttle_default(callback, delay, options) : debounce_default(callback, delay, options);\n\n// src/iterable/filter.ts\nvar filter = (data, predicate, limit, asMap, result) => {\n var _a;\n if (!isMap(result)) result = /* @__PURE__ */ new Map();\n if (!isPositiveInteger(limit)) limit = Infinity;\n for (const [key, item] of ((_a = data == null ? void 0 : data.entries) == null ? void 0 : _a.call(data)) || []) {\n if (result.size >= limit) break;\n fallbackIfFails_default(predicate != null ? predicate : item, [item, key, data], false) && result.set(key, item);\n }\n return asMap ? result : [...result.values()];\n};\nvar filter_default = filter;\n\n// src/iterable/getSize.ts\nvar getSize = (x) => {\n if (!x) return 0;\n try {\n const s = \"size\" in x ? x.size : \"length\" in x ? x.length : 0;\n return isNumber(s) ? s : 0;\n } catch (_) {\n return 0;\n }\n};\nvar getSize_default = getSize;\n\n// src/iterable/getValues.ts\nvar getValues = (data) => {\n var _a;\n return [\n ...((_a = data == null ? void 0 : data.values) == null ? void 0 : _a.call(data)) || []\n ];\n};\nvar getValues_default = getValues;\n\n// src/iterable/search.ts\nvar search = (data, options) => {\n var _a;\n const ignore = !getSize_default(data) || isEmpty(options == null ? void 0 : options.query);\n const result = isMap(options == null ? void 0 : options.result) ? options.result : /* @__PURE__ */ new Map();\n const asMap = (_a = options == null ? void 0 : options.asMap) != null ? _a : search.defaults.asMap;\n if (ignore) return asMap ? result : getValues_default(result);\n options = objCopy(\n search.defaults,\n options,\n [],\n \"empty\"\n // override `option` property with default value when \"empty\" (undefined, null, '',....)\n );\n const {\n ignoreCase,\n limit = Infinity,\n matchAll,\n matchExact,\n ranked\n } = options;\n let { query } = options;\n const qIsStr = isStr(query);\n const qIsRegExp = isRegExp(query);\n const qKeys = fallbackIfFails_default(Object.keys, [query], []);\n if (ignoreCase && !matchExact && !qIsRegExp) {\n query = qIsStr ? query.toLowerCase() : objCreate(\n qKeys,\n Object.values(query).map(\n (x) => isRegExp(x) ? x : `${x}`.toLowerCase()\n )\n );\n }\n options.query = query;\n if (!ranked) {\n for (const [dataKey, dataValue] of data.entries()) {\n if (result.size >= limit) break;\n const matched = qIsStr || qIsRegExp ? (\n // global search across all properties\n matchObjOrProp(options, dataValue, void 0) >= 0\n ) : (\n // field-specific search\n qKeys[matchAll ? \"every\" : \"some\"](\n (key) => matchObjOrProp(options, dataValue, key) >= 0\n )\n );\n if (!matched) continue;\n result.set(dataKey, dataValue);\n }\n } else {\n const preRankedResults = [];\n for (const [dataKey, dataValue] of data.entries()) {\n let matchIndex = -1;\n if (qIsStr || qIsRegExp) {\n matchIndex = matchObjOrProp(options, dataValue, void 0);\n matchIndex >= 0 && preRankedResults.push([matchIndex, dataKey, dataValue]);\n continue;\n }\n const indexes = [];\n const match = qKeys[matchAll ? \"every\" : \"some\"](\n // field-specific search\n (key) => {\n const index = matchObjOrProp(options, dataValue, key);\n indexes.push(index);\n return index >= 0;\n }\n );\n if (!match) continue;\n matchIndex = // eslint-disable-next-line @typescript-eslint/prefer-find\n indexes.sort((a, b) => a - b).filter((n) => n !== -1)[0];\n matchIndex >= 0 && preRankedResults.push([matchIndex, dataKey, dataValue]);\n }\n preRankedResults.sort((a, b) => a[0] - b[0]).slice(0, limit).forEach(([_, key, value]) => result.set(key, value));\n }\n return asMap ? result : getValues_default(result);\n};\nsearch.defaults = {\n asMap: true,\n ignoreCase: true,\n limit: Infinity,\n matchAll: false,\n ranked: false,\n transform: true\n};\nfunction matchObjOrProp({\n query,\n ignoreCase,\n matchExact,\n transform = true\n}, item, propertyName) {\n var _a, _b;\n const global = isStr(query) || isRegExp(query) || propertyName === void 0;\n const keyword = global ? query : query[propertyName];\n const propVal = global || !isObj(item) ? item : item[propertyName];\n const value = fallbackIfFails_default(\n () => isFn(transform) ? transform(\n item,\n global ? void 0 : propVal,\n propertyName\n ) : matchExact && transform === false ? propVal : isObj(propVal, false) ? JSON.stringify(\n isArrLike(propVal) ? [...propVal.values()] : Object.values(propVal)\n ) : String(propVal != null ? propVal : \"\"),\n [],\n \"\"\n );\n if (value === keyword) return 0;\n if (matchExact && !isRegExp(keyword)) return -1;\n let valueStr = String(value);\n if (!valueStr.trim()) return -1;\n if (isRegExp(keyword)) return (_b = (_a = valueStr.match(keyword)) == null ? void 0 : _a.index) != null ? _b : -1;\n if (ignoreCase) valueStr = valueStr.toLowerCase();\n return valueStr.indexOf(String(keyword));\n}\nvar search_default = search;\n\n// src/iterable/find.ts\nfunction find(data, optsOrCb) {\n const result = isFn(optsOrCb) ? filter_default(data, optsOrCb, 1) : search_default(data, { ...optsOrCb, asMap: true, limit: 1 });\n return result[\n (optsOrCb == null ? void 0 : optsOrCb.includeKey) ? \"entries\" : \"values\"\n // returns: value\n ]().next().value;\n}\n\n// src/iterable/getEntries.ts\nvar getEntries = (map) => {\n var _a;\n return [\n ...((_a = map == null ? void 0 : map.entries) == null ? void 0 : _a.call(map)) || []\n ];\n};\n\n// src/iterable/getKeys.ts\nvar getKeys = (data) => {\n var _a;\n return [\n ...((_a = data == null ? void 0 : data.keys) == null ? void 0 : _a.call(data)) || []\n ];\n};\n\n// src/iterable/reverse.ts\nvar reverse = (data, reverse2 = true, newInstance = false) => {\n var _a, _b, _c;\n const dataType = isArr(data) ? 1 : isMap(data) ? 2 : isSet(data) ? 3 : 0;\n if (!dataType) return [];\n const arr = dataType === 1 ? !newInstance ? data : [...data] : dataType === 2 ? [...data.entries()] : [...data.values()];\n if (reverse2) arr.reverse();\n switch (dataType) {\n case 1:\n return arr;\n case 2:\n case 3:\n if (newInstance || !(\"clear\" in data && isFn(data.clear)))\n return dataType === 2 ? new Map(arr) : new Set(arr);\n }\n (_a = data == null ? void 0 : data.clear) == null ? void 0 : _a.call(data);\n for (const item of arr)\n \"set\" in data ? (_b = data.set) == null ? void 0 : _b.call(data, ...item) : \"add\" in data && ((_c = data == null ? void 0 : data.add) == null ? void 0 : _c.call(data, item));\n return data;\n};\n\n// src/iterable/sliceMap.ts\nvar sliceMap = (data, options) => {\n var _a;\n const {\n asMap = false,\n end,\n start = 0,\n transform,\n ignoreEmpty = true\n } = isFn(options) ? { transform: options } : isObj(options) ? options : {};\n const result = /* @__PURE__ */ new Map();\n const subset = [...((_a = data == null ? void 0 : data.entries) == null ? void 0 : _a.call(data)) || []].slice(start, end);\n for (const [_, [key, value]] of subset.entries()) {\n if (ignoreEmpty && isEmpty(value)) continue;\n const newValue = fallbackIfFails_default(\n transform != null ? transform : value,\n [value, key, data],\n void 0\n );\n newValue !== void 0 && result.set(key, newValue);\n }\n return asMap ? result : [...result.values()];\n};\n\n// src/iterable/sort.ts\nfunction sort(data, keyOrFn, options) {\n const dataType = isArr(data) ? 1 : isMap(data) ? 2 : isSet(data) ? 3 : 0;\n if (!dataType) return data;\n const { asString, ignoreCase, newInstance, reverse: reverse2, undefinedFirst } = {\n ...sort.defaults,\n ...isObj(options) ? options : isObj(keyOrFn) ? keyOrFn : {}\n };\n if (dataType === 1 && isFn(keyOrFn)) {\n return arrReverse(\n data.sort(keyOrFn),\n // use provided comparator function\n reverse2,\n newInstance\n );\n }\n const alt = asString ? undefinedFirst ? \"\" : \"Z\".repeat(10) : undefinedFirst ? -Infinity : Infinity;\n const sorted = isFn(keyOrFn) ? arrReverse(\n // handle Set with comparator function\n [...data.entries()].sort(keyOrFn),\n reverse2,\n false\n // not required because of entries() & spread\n ) : (() => {\n let index = 1;\n const getVal = (target) => {\n const val = isObj(target) && index !== 0 ? target[keyOrFn] : target;\n if (!asString) return val;\n const value = `${val != null ? val : alt}`;\n return ignoreCase ? value.toLowerCase() : value;\n };\n const [gt, lt] = reverse2 ? [-1, 1] : [1, -1];\n if ([1, 3].includes(dataType)) {\n return (dataType === 3 || newInstance ? [...data] : data).sort((a, b) => getVal(a) > getVal(b) ? gt : lt);\n }\n index = keyOrFn === true ? 0 : 1;\n return [...data.entries()].sort(\n (a, b) => getVal(a == null ? void 0 : a[index]) > getVal(b == null ? void 0 : b[index]) ? gt : lt\n );\n })();\n if (dataType === 1) return sorted;\n if (newInstance) {\n return dataType === 2 ? new Map(sorted) : new Set(sorted);\n }\n ;\n data.clear();\n for (const entry of sorted)\n dataType === 2 ? data.set(...entry) : data.add(entry);\n return data;\n}\nsort.defaults = {\n asString: true,\n ignoreCase: true,\n newInstance: false,\n reverse: false,\n undefinedFirst: false\n};\n\n// src/map/mapJoin.ts\nvar mapJoin = (...inputs) => {\n var _a;\n return new Map(\n (_a = inputs == null ? void 0 : inputs.flatMap) == null ? void 0 : _a.call(\n inputs,\n (input) => isMap(input) ? Array.from(input.entries()) : isArr2D(input) ? input : []\n )\n );\n};\n\n// src/number/randomInt.ts\nvar randomInt = (min = 0, max = Number.MAX_SAFE_INTEGER) => parseInt(`${Math.random() * (max - min) + min}`);\n\n// src/str/clearClutter.ts\nvar clearClutter = (text, lineSeparator = \" \") => `${text}`.split(\"\\n\").map((ln) => ln.trim()).filter(Boolean).join(lineSeparator);\n\n// src/str/copyToClipboard.ts\nvar copyToClipboard = (str) => fallbackIfFails(\n // First attempt: modern clipboard API\n () => navigator.clipboard.writeText(str).then(() => 1),\n [],\n // If clipboard API is not available or fails, use the fallback method\n () => Promise.resolve(copyLegacy(str) ? 2 : 0)\n);\nvar copyLegacy = (str) => fallbackIfFails(\n () => {\n const el = document.createElement(\"textarea\");\n el.value = str;\n el.setAttribute(\"readonly\", \"\");\n el.style.position = \"absolute\";\n el.style.left = \"-9999px\";\n document.body.appendChild(el);\n el.select();\n const success = document.execCommand(\"copy\");\n document.body.removeChild(el);\n return success;\n },\n [],\n false\n // On error, return false\n);\n\n// src/str/getUrlParam.ts\nvar getUrlParam = (name, url, asArray) => {\n var _a;\n url != null ? url : url = fallbackIfFails_default(() => window.location.href, [], \"\");\n const _asArray = isArr(asArray) ? asArray : asArray === true && isStr(name) ? [name] : [];\n const prepareResult = (value = \"\", values = {}) => name ? isArr(value) || !_asArray.includes(name) ? value : [value].filter(Boolean) : values;\n if (!url) return prepareResult();\n if (typeof URLSearchParams === \"undefined\" || !URLSearchParams) {\n const r = getUrlParamRegex(name, url, _asArray);\n return prepareResult(r, r);\n }\n const search2 = isUrl(url) ? url.search : ((_a = url.split(\"?\")) == null ? void 0 : _a[1]) || \"\";\n if (search2 === \"?\" || !search2) return prepareResult();\n const params = new URLSearchParams(search2);\n const getValue = (paramName) => {\n const value = arrUnique(params.getAll(paramName));\n return value.length > 1 || _asArray.includes(paramName) ? value : value[0];\n };\n if (name) return prepareResult(getValue(name));\n const result = {};\n for (const name2 of arrUnique([...params.keys()])) {\n result[name2] = getValue(name2);\n }\n return result;\n};\nvar getUrlParamRegex = (name, url, asArray = []) => {\n url != null ? url : url = fallbackIfFails_default(() => window.location.href, [], \"\");\n if (isUrl(url)) url = url.toString();\n const params = {};\n const regex = /[?&]+([^=&]+)=([^&]*)/gi;\n url == null ? void 0 : url.replace(regex, (_, name2, value) => {\n value = decodeURIComponent(value);\n if (asArray.includes(name2) || params[name2] !== void 0) {\n params[name2] = isArr(params[name2]) ? params[name2] : [params[name2]];\n params[name2] = arrUnique([...params[name2], value]).filter(Boolean);\n } else {\n params[name2] = value;\n }\n return \"\";\n });\n return name ? params[name] : params;\n};\n\n// src/str/regex.ts\nvar EMAIL_REGEX = new RegExp(\n /^((\"[\\w-\\s]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w-\\s]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,9}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)/i\n);\nvar HEX_REGEX = /^0x[0-9a-f]+$/i;\nvar HASH_REGEX = /^0x[0-9a-f]{64}$/i;\n\n// src/str/strToArr.ts\nvar strToArr = (value, seperator = \",\") => typeof value === \"string\" && value.split(seperator).filter(Boolean) || [];\nexport {\n EMAIL_REGEX,\n HASH_REGEX,\n HEX_REGEX,\n ReadOnlyArrayHelper,\n arrReadOnly,\n arrReverse,\n arrToMap,\n arrUnique,\n clearClutter,\n copyToClipboard,\n curry,\n debounce,\n deferred,\n fallbackIfFails,\n filter,\n find,\n getEntries,\n getKeys,\n getSize,\n getUrlParam,\n getValues,\n is,\n isArr,\n isArr2D,\n isArrLike,\n isArrLikeSafe,\n isArrObj,\n isArrUnique,\n isAsyncFn,\n isBool,\n isDate,\n isDateValid,\n isDefined,\n isEmpty,\n isEmptySafe,\n isEnvBrowser,\n isEnvBun,\n isEnvDeno,\n isEnvMobile,\n isEnvNode,\n isEnvTouchable,\n isError,\n isFn,\n isInteger,\n isMap,\n isMapObj,\n isNegativeInteger,\n isNegativeNumber,\n isNumber,\n isObj,\n isPositiveInteger,\n isPositiveNumber,\n isPromise,\n isRegExp,\n isSet,\n isStr,\n isSubjectLike,\n isSymbol,\n isUint8Arr,\n isUrl,\n isUrlValid,\n mapJoin,\n matchObjOrProp,\n noop,\n noopAsync,\n objClean,\n objCopy,\n objCreate,\n objHasKeys,\n objKeys,\n objReadOnly,\n objSetProp,\n objSetPropUndefined,\n objSort,\n objToMap,\n objWithoutKeys,\n randomInt,\n reverse,\n search,\n sliceMap,\n sort,\n strToArr,\n throttle,\n throttled,\n toDatetimeLocal\n};\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n","/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass<T>(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n","import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n","/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove<T>(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n */\nexport class Subscription implements SubscriptionLike {\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude<TeardownLogic, void>[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude<TeardownLogic, void>): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n","import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification<any>, subscriber: Subscriber<any>) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: PromiseConstructorLike;\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n","import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n","/* tslint:disable:no-empty */\nexport function noop() { }\n","import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n */\nexport class Subscriber<T> extends Subscription implements Observer<T> {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T> {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber<any> | Observer<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber<any> | Observer<any>) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param value The `next` value.\n */\n next(value: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value!);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param err The `error` exception.\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind<Fn extends (...args: any[]) => any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver<T> implements Observer<T> {\n constructor(private partialObserver: Partial<Observer<T>>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber<T> extends Subscriber<T> {\n constructor(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial<Observer<T>>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as ((value: T) => void) | undefined,\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent.\n * @param subscriber The stopped subscriber.\n */\nfunction handleStoppedNotification(notification: ObservableNotification<any>, subscriber: Subscriber<any>) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly<Observer<any>> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n","/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n","/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `<T>(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity<T>(x: T): T {\n return x;\n}\n","import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\nexport function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>;\nexport function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>;\nexport function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>;\nexport function pipe<T, A, B, C, D>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>\n): UnaryFunction<T, D>;\nexport function pipe<T, A, B, C, D, E>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>\n): UnaryFunction<T, E>;\nexport function pipe<T, A, B, C, D, E, F>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>\n): UnaryFunction<T, F>;\nexport function pipe<T, A, B, C, D, E, F, G>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>\n): UnaryFunction<T, G>;\nexport function pipe<T, A, B, C, D, E, F, G, H>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>\n): UnaryFunction<T, H>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>\n): UnaryFunction<T, I>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>,\n ...fns: UnaryFunction<any, any>[]\n): UnaryFunction<T, unknown>;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \n */\nexport function pipe(...fns: Array<UnaryFunction<any, any>>): UnaryFunction<any, any> {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R> {\n if (fns.length === 0) {\n return identity as UnaryFunction<any, any>;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction<T, R>) => fn(prev), input as any);\n };\n}\n","import { Operator } from './Operator';\nimport { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n */\nexport class Observable<T> implements Subscribable<T> {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable<any> | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator<any, T> | undefined;\n\n /**\n * @param subscribe The function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new Observable by calling the Observable constructor\n * @param subscribe the subscriber function to be passed to the Observable constructor\n * @return A new observable.\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {\n return new Observable<T>(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @param operator the operator defining the operation to take on the observable\n * @return A new observable with the Operator applied.\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\n */\n lift<R>(operator?: Operator<T, R>): Observable<R> {\n const observable = new Observable<R>();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * <span class=\"informal\">Use it when you have all these Observables, but still nothing is happening.</span>\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * });\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 'unsubscribed!' after 2.5s\n * ```\n *\n * @param observerOrNext Either an {@link Observer} with some or all callback methods,\n * or the `next` handler that is called for each value emitted from the subscribed Observable.\n * @param error A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param complete A handler for a terminal event resulting from successful completion.\n * @return A subscription reference to the registered handlers.\n */\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber<T>): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next A handler for each value emitted by the observable.\n * @return A promise that either resolves on observable completion or\n * rejects with the handled error.\n */\n forEach(next: (value: T) => void): Promise<void>;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor<void>((resolve, reject) => {\n const subscriber = new SafeSubscriber<T>({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise<void>;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<any>): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @return This instance of the observable.\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable<T>;\n pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;\n pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;\n pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;\n pipe<A, B, C, D>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>\n ): Observable<D>;\n pipe<A, B, C, D, E>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>\n ): Observable<E>;\n pipe<A, B, C, D, E, F>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>\n ): Observable<F>;\n pipe<A, B, C, D, E, F, G>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>\n ): Observable<G>;\n pipe<A, B, C, D, E, F, G, H>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>\n ): Observable<H>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>\n ): Observable<I>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>,\n ...operations: OperatorFunction<any, any>[]\n ): Observable<unknown>;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x));\n * ```\n *\n * @return The Observable result of all the operators having been called\n * in the order they were passed in.\n */\n pipe(...operations: OperatorFunction<any, any>[]): Observable<any> {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise<T | undefined> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise<T | undefined>;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver<T>(value: any): value is Observer<T> {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber<T>(value: any): value is Subscriber<T> {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n","import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\nimport { isFunction } from './isFunction';\n\n/**\n * Used to determine if an object is an Observable with a lift function.\n */\nexport function hasLift(source: any): source is { lift: InstanceType<typeof Observable>['lift'] } {\n return isFunction(source?.lift);\n}\n\n/**\n * Creates an `OperatorFunction`. Used to define operators throughout the library in a concise way.\n * @param init The logic to connect the liftedSource to the subscriber at the moment of subscription.\n */\nexport function operate<T, R>(\n init: (liftedSource: Observable<T>, subscriber: Subscriber<R>) => (() => void) | void\n): OperatorFunction<T, R> {\n return (source: Observable<T>) => {\n if (hasLift(source)) {\n return source.lift(function (this: Subscriber<R>, liftedSource: Observable<T>) {\n try {\n return init(liftedSource, this);\n } catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n","import { Subscriber } from '../Subscriber';\n\n/**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional teardown logic here. This will only be called on teardown if the\n * subscriber itself is not already closed. This is called after all other teardown logic is executed.\n */\nexport function createOperatorSubscriber<T>(\n destination: Subscriber<any>,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n onFinalize?: () => void\n): Subscriber<T> {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\n\n/**\n * A generic helper for allowing operators to be created with a Subscriber and\n * use closures to capture necessary state from the operator function itself.\n */\nexport class OperatorSubscriber<T> extends Subscriber<T> {\n /**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional finalization logic here. This will only be called on finalization if the\n * subscriber itself is not already closed. This is called after all other finalization logic is executed.\n * @param shouldUnsubscribe An optional check to see if an unsubscribe call should truly unsubscribe.\n * NOTE: This currently **ONLY** exists to support the strange behavior of {@link groupBy}, where unsubscription\n * to the resulting observable does not actually disconnect from the source if there are active subscriptions\n * to any grouped observable. (DO NOT EXPOSE OR USE EXTERNALLY!!!)\n */\n constructor(\n destination: Subscriber<any>,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n private onFinalize?: () => void,\n private shouldUnsubscribe?: () => boolean\n ) {\n // It's important - for performance reasons - that all of this class's\n // members are initialized and that they are always initialized in the same\n // order. This will ensure that all OperatorSubscriber instances have the\n // same hidden class in V8. This, in turn, will help keep the number of\n // hidden classes involved in property accesses within the base class as\n // low as possible. If the number of hidden classes involved exceeds four,\n // the property accesses will become megamorphic and performance penalties\n // will be incurred - i.e. inline caches won't be used.\n //\n // The reasons for ensuring all instances have the same hidden class are\n // further discussed in this blog post from Benedikt Meurer:\n // https://benediktmeurer.de/2018/03/23/impact-of-polymorphism-on-component-based-frameworks-like-react/\n super(destination);\n this._next = onNext\n ? function (this: OperatorSubscriber<T>, value: T) {\n try {\n onNext(value);\n } catch (err) {\n destination.error(err);\n }\n }\n : super._next;\n this._error = onError\n ? function (this: OperatorSubscriber<T>, err: any) {\n try {\n onError(err);\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._error;\n this._complete = onComplete\n ? function (this: OperatorSubscriber<T>) {\n try {\n onComplete();\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._complete;\n }\n\n unsubscribe() {\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const { closed } = this;\n super.unsubscribe();\n // Execute additional teardown if we have any and we didn't already do so.\n !closed && this.onFinalize?.();\n }\n }\n}\n","import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n","import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n */\nexport class Subject<T> extends Observable<T> implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer<T>[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer<T>[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {\n return new AnonymousSubject<T>(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber<T>): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber<any>) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber<any>) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return Observable that this Subject casts to.\n */\n asObservable(): Observable<T> {\n const observable: any = new Observable<T>();\n observable.source = this;\n return observable;\n }\n}\n\nexport class AnonymousSubject<T> extends Subject<T> {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer<T>,\n source?: Observable<T>\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n","import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n */\nexport class BehaviorSubject<T> extends Subject<T> {\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n\n getValue(): T {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n\n next(value: T): void {\n super.next((this._value = value));\n }\n}\n","import { OperatorFunction, MonoTypeOperatorFunction, TruthyTypesOf } from '../types';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\n\n/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */\nexport function filter<T, S extends T, A>(predicate: (this: A, value: T, index: number) => value is S, thisArg: A): OperatorFunction<T, S>;\nexport function filter<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;\nexport function filter<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;\n/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */\nexport function filter<T, A>(predicate: (this: A, value: T, index: number) => boolean, thisArg: A): MonoTypeOperatorFunction<T>;\nexport function filter<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T>;\n\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * <span class=\"informal\">Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.</span>\n *\n * \n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * ## Example\n *\n * Emit only click events whose target was a DIV element\n *\n * ```ts\n * import { fromEvent, filter } from 'rxjs';\n *\n * const div = document.createElement('div');\n * div.style.cssText = 'width: 200px; height: 200px; background: #09c;';\n * document.body.appendChild(div);\n *\n * const clicks = fromEvent(document, 'click');\n * const clicksOnDivs = clicks.pipe(filter(ev => (<HTMLElement>ev.target).tagName === 'DIV'));\n * clicksOnDivs.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param thisArg An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return A function that returns an Observable that emits items from the\n * source Observable that satisfy the specified `predicate`.\n */\nexport function filter<T>(predicate: (value: T, index: number) => boolean, thisArg?: any): MonoTypeOperatorFunction<T> {\n return operate((source, subscriber) => {\n // An index passed to our predicate function on each call.\n let index = 0;\n\n // Subscribe to the source, all errors and completions are\n // forwarded to the consumer.\n source.subscribe(\n // Call the predicate with the appropriate `this` context,\n // if the predicate returns `true`, then send the value\n // to the consumer.\n createOperatorSubscriber(subscriber, (value) => predicate.call(thisArg, value, index++) && subscriber.next(value))\n );\n });\n}\n","import { MonoTypeOperatorFunction } from '../types';\nimport { filter } from './filter';\n\n/**\n * Returns an Observable that skips the first `count` items emitted by the source Observable.\n *\n * \n *\n * Skips the values until the sent notifications are equal or less than provided skip count. It raises\n * an error if skip count is equal or more than the actual number of emits and source raises an error.\n *\n * ## Example\n *\n * Skip the values before the emission\n *\n * ```ts\n * import { interval, skip } from 'rxjs';\n *\n * // emit every half second\n * const source = interval(500);\n * // skip the first 10 emitted values\n * const result = source.pipe(skip(10));\n *\n * result.subscribe(value => console.log(value));\n * // output: 10...11...12...13...\n * ```\n *\n * @see {@link last}\n * @see {@link skipWhile}\n * @see {@link skipUntil}\n * @see {@link skipLast}\n *\n * @param count The number of times, items emitted by source Observable should be skipped.\n * @return A function that returns an Observable that skips the first `count`\n * values emitted by the source Observable.\n */\nexport function skip<T>(count: number): MonoTypeOperatorFunction<T> {\n return filter((_, index) => count <= index);\n}\n","import {\n\tDebounceOptions,\n\tDropFirst,\n\tsearch,\n\tsort,\n\tSortOptions,\n\tThrottleOptions,\n} from '@superutils/core'\nimport { IStore } from './IStore'\n\n/**\n * Represents the minimal subset of the `Storage` interface required for persistence.\n *\n * Any object implementing this type can be used as a storage engine, making the Store\n * compatible with `localStorage`, `sessionStorage`, or custom file-based implementations.\n */\nexport type StorageCompact = Pick<Storage, 'getItem' | 'setItem'>\n\n/**\n * Configuration for the timing strategy used when writing data to persistent storage.\n */\nexport type Store_DelayOptions =\n\t| ({\n\t\t\tthrottle: true\n\t } & Omit<ThrottleOptions, 'onError' | 'thisArg'>)\n\t| ({\n\t\t\tthrottle?: false\n\t } & Omit<DebounceOptions, 'onError' | 'thisArg'>)\n\n/**\n * Categorizes errors encountered during Store operations.\n *\n * These types are passed to the `onError` callback to help identify which phase of the\n * data lifecycle (reading, writing, or processing) failed.\n */\nexport enum Store_OnErrorType {\n\t/** Occurs when the user-provided `onChange` callback throws an exception. */\n\tonChange = 'onChange',\n\t/** Occurs when the user-provided `parse` function fails to process the raw storage string. */\n\tparse = 'parse',\n\t/**\n\t * Occurs when the default `JSON.parse` fallback fails.\n\t * This usually happens if the data in the underlying storage is corrupted or not valid JSON.\n\t */\n\tparse_json = 'parse-json',\n\t/** Occurs when the user-provided `stringify` function fails to serialize the data Map. */\n\tstringify = 'stringify',\n\t/**\n\t * Occurs when the default `JSON.stringify` fallback fails.\n\t * This may happen if the Map contains circular references or other non-serializable values.\n\t */\n\tstringify_json = 'stringify-json',\n\t/** Occurs when the attempt to save data to the underlying storage (e.g., `localStorage.setItem`) fails. */\n\twrite = 'write',\n}\n\n/**\n * Configuration options for initializing a {@link Store} or {@link ObjectStore}.\n *\n * These options define the behavior of caching, persistence, error handling, and validation.\n */\nexport type Store_Options<Key, Value, CacheDisabled extends boolean = false> = {\n\t/**\n\t * An optional `Map` used to seed the storage if no persistent data is found for the instance.\n\t *\n\t * **Data Precedence:**\n\t * Persistent data associated with the instance's specific `name` takes priority. This value is\n\t * only utilized if the storage entry for that `name` does not exist (e.g., first-time use).\n\t *\n\t * **Initialization Behavior:**\n\t * - If provided and non-empty, the instance initializes immediately during construction.\n\t * - Otherwise, initialization is lazy, occurring upon an explicit `init()` call or the first read/write operation.\n\t *\n\t * **Type Inference:**\n\t * When provided, it enables automatic inference of the `Key` and `Value` generic types.\n\t * If omitted, these default to `unknown` and `object` respectively, unless explicitly defined.\n\t *\n\t * Default: `undefined`\n\t */\n\tinitialValue?: Map<Key, Value>\n} & Pick<\n\tPartial<IStore<Key, Value, CacheDisabled>>,\n\t| 'cacheDisabled'\n\t| 'onChange'\n\t| 'onError'\n\t| 'parse'\n\t| 'spaces'\n\t| 'storage'\n\t| 'stringify'\n\t| 'validate'\n>\n\t& (CacheDisabled extends false\n\t\t? Pick<\n\t\t\t\tPartial<IStore<Key, Value, CacheDisabled>>,\n\t\t\t\t'delay' | 'delayOptions'\n\t\t\t>\n\t\t: { delay?: never; delayOptions?: never })\n\n/**\n * Function signature for custom data deserialization.\n *\n * @param text The raw string retrieved from the underlying storage.\n * @returns The parsed data structure (usually a Map) or `void` to trigger fallback behavior.\n */\nexport type Store_Parse<ResultMap, ThisArg> = (\n\tthis: ThisArg,\n\ttext: string | null | undefined,\n) => ResultMap | void\n\n/**\n * Function signature for the internal search utility.\n *\n * @template K - The type of keys.\n * @template V - The type of values.\n * @template MatchExact - Whether to perform exact matching.\n * @template AsMap - Whether to return results as a Map.\n */\nexport type Store_Search<\n\tK,\n\tV,\n\tMatchExact extends boolean = false,\n\tAsMap extends boolean = true,\n> = (\n\t...args: DropFirst<Parameters<typeof search<K, V, MatchExact, AsMap>>>\n) => ReturnType<typeof search<K, V, MatchExact, AsMap>>\n\n/**\n * Function Signature for the sort utility, supporting multiple sorting strategies:\n * 1. By a custom comparator function.\n * 2. By a specific property name (for object-like values).\n * 3. By the map keys.\n *\n * @template K - The type of keys.\n * @template V - The type of values.\n */\nexport type Store_Sort<K, V> = (\n\t...args:\n\t\t| Store_SortByComparator<K, V>\n\t\t| Store_SortByPropertyName<V>\n\t\t| Store_SortByKey\n) => Map<K, V>\nexport type Store_SortByComparator<K, V> = [\n\tcomparator: Parameters<typeof sort<K, V>>[1],\n\toptions?: Store_SortOptions,\n]\nexport type Store_SortByKey = [byKey: true, options?: Store_SortOptions]\nexport type Store_SortByPropertyName<V> = [\n\tpropertyName: keyof V & string,\n\toptions?: Store_SortOptions,\n]\n\n/** Configuration options for sorting, including whether to persist the result. */\nexport type Store_SortOptions = SortOptions & { save?: boolean }\n\n/**\n * Function signature for custom data serialization.\n *\n * @param data The current data structure to be serialized.\n * @returns A string representation of the data, or `void/undefined` to trigger fallback behavior.\n */\nexport type Store_Stringify<Data, ThisArg> = (\n\tthis: ThisArg,\n\tdata: Data,\n) => string | undefined | void\n\n/**\n * Function signature for exporting the store content as a JSON string.\n *\n * @param replacer - A function or array that transforms the results.\n * @param spacing - Indentation or whitespace formatting.\n * @param data - The specific Map to stringify (defaults to all entries).\n *\n * @template K - The type of keys.\n * @template V - The type of values.\n */\nexport type Store_ToJSON<K, V> = (\n\treplacer?: null | ((key: K, value: V) => unknown),\n\tspacing?: string | number,\n\tdata?: Map<K, V>,\n) => string\n","import {\n\tdeferred,\n\ttype EntryComparator,\n\tfallbackIfFails,\n\tfilter,\n\tfind,\n\tgetEntries,\n\tgetKeys,\n\tgetValues,\n\tisArr,\n\tisArr2D,\n\tisDefined,\n\tisFn,\n\tisMap,\n\tisPositiveNumber,\n\tisStr,\n\tmapJoin,\n\tsearch,\n\tsort,\n} from '@superutils/core'\nimport { BehaviorSubject, skip, Subject, Subscription } from 'rxjs'\nimport { type IStore, Store_OnErrorType, type Store_Options } from './types'\n\n/**\n * RxJS Subject to trigger forced update of cached data from underlying storage of {@link Store} instances.\n *\n * Accepted values:\n * - `string`: Updates the cache for the instance with the matching name.\n * - `string[]`: Updates the cache for all instances whose names are included in the array.\n * - `true`: Triggers a global cache update for all instances that have a `name` defined.\n * - `false`: No-op.\n *\n * @example\n * ```javascript\n * import { Store, forceUpdateCache$ } from '@superutils/store'\n *\n * const names = ['products', 'users']\n *\n * // Update all Store instances by a list of their names\n * forceUpdateCache$.next(names)\n * // alternatively: Store.forceUpdateCache(names)\n *\n * // Update all Store instances with a specific name\n * forceUpdateCache$.next(names[0])\n * // alternatively: Store.forceUpdateCache(names[0])\n *\n * // Update every single instance of Store that uses storage (has a \"name\" property)\n * forceUpdateCache$(true)\n * // alternatively: Store.forceUpdateCache(true)\n * ```\n *\n * @example\n *\n * #### Practical example\n * ```typescript\n * import { createStore, forceUpdateCache$ } from '@superutils/store'\n *\n * const name = 'user-profile'\n * const delay = 0 // delay is set to zero to simplify the example\n *\n * const userStore = createStore(name, { delay })\n * const userStore2 = createStore(name, { delay })\n *\n * userStore.init()\n * userStore2.init()\n *\n * userStore.set('name', 'John Doe')\n * console.log(userStore2.get('name')) // Prints: undefined\n *\n * forceUpdateCache$.next(name)\n * console.log(userStore2.get('name')) // Prints: 'John Doe'\n * ```\n */\nexport const forceUpdateCache$ = new Subject<string | string[] | boolean>()\n\n/**\n * A generic, reactive data storage class that provides a Map-like interface with advanced features\n * such as search, filtering, and sorting. Supports both in-memory caching and persistent storage\n * (LocalStorage in browsers, JSON files in NodeJS via `node-localstorage` NPM module).\n *\n * #### Notes:\n * - **Performance**: `Store` is optimized for small to medium datasets.\n * - For datasets > 1MB, consider increasing the `delay` option to reduce write frequency.\n * - It is **NOT** recommended for datasets larger than 3MB due to synchronous serialization costs.\n * - For one-off operations or standalone scripts, data size is constrained only by available system memory\n * and processing power.\n * - **RxJS Integration**: Built on RxJS for reactive data handling, though no prior RxJS knowledge is required.\n * - **Storage Behavior**:\n * - If `name` is omitted, the instance operates in-memory only and data is not persisted to storage.\n * - If `cacheDisabled` is `true`, data is not kept in memory; every read/write operation accesses the underlying\n * storage directly.\n *\n * @template Key The type of keys stored in the map.\n * @template Value The type of values stored in the map.\n * @template CacheDisabled A literal boolean type indicating whether in-memory caching is disabled.\n * @template This A self-referential interface type extending {@link IStore} used for accurate\n * method signature inference and type-safe property access. This allows method implementations to\n * reference their return types and other method signatures through the interface definition.\n *\n * @see {@link forceUpdateCache$} for cache invalidation across instances.\n * @see {@link Store.fromObject} for object-oriented storage initialization.\n *\n * @example\n * #### Browser Usage 1: use like a map\n * ```javascript\n * import { Store } from '@superutils/store'\n *\n * const userStorage = new Store('users')\n * userStorage.set(1, { name: 'Alice', age: 30 })\n * const user = userStorage.get(1)\n * console.log(user) // prints: {name: 'Alice', age: 30}\n * ```\n *\n * @example\n * #### Browser Usage 2:\n * ```javascript\n * import { Store } from '@superutils/store'\n * import fetch from '@superutils/fetch'\n *\n * const { products } = await fetch.get('[DUMMYJSON-DOT-COM]/products')\n * const storage = new Store('products', {\n * initialValue: new Map(products.map(p => [p.id, p])) // convert to Map\n * })\n *\n * // print product with id `1`\n * console.log(storage.get(1))\n *\n * // search for items\n * const searchResult = storage.search({\n * query: { availabilityStatus: 'low' }\n * })\n * console.log(searchResult)\n * ```\n * @example\n * #### NodeJS Usage\n * ```javascript\n * import { Store } from '@superutils/store'\n * import fetch from '@superutils/fetch'\n * import { LocalStorage } from 'node-localstorage'\n *\n * // Add localStorage alternative for NodeJS that reads and writes to JSON files.\n * // This is not necessary for browsers.\n * globalThis.localStorage = new LocalStorage('./data', 1e7)\n *\n * const storage = new Store('products')\n * const { products } = await fetch.get('[DUMMYJSON-DOT-COM]/products')\n * // save all items to storage\n * storage.setAll(\n * new Map(products.map(p => [p.id, p])), // convert to Map\n * )\n *\n * // print product with id `1`\n * console.log(storage.get(1))\n *\n * // search for items\n * const searchResult = storage.search({\n * query: { availabilityStatus: 'low' }\n * })\n * console.log(searchResult)\n * ```\n *\n * @example\n * #### Advanced: `onChange` and RxJS subject\n *\n * Internally, `Store` uses RxJS subject which is exposed as `subject$` property.\n * You can use this to subscribe to changes and do additional operations such as logging or sanitization etc.\n *\n * Alternatively, you can also set the `onChange` callback which is triggered whenever the subject changes and\n * does not require maintaining a subscription or knowledge of RxJS subject.\n *\n * ```javascript\n * import { Store } from '@superutils/store'\n *\n * const storage = new Store('my-data')\n * const sub = storage.subject$.subscribe(data => {\n * // Write to the database whenever data changes\n * console.log('Saving to database...', data)\n * })\n * // unsubscribe from subject\n * setTimeout(()=> sub.unsubscribe(), 1000)\n *\n * // add an entry to storage\n * storage.set('bob', { age: 99, id: 'bob', name: 'Bob' })\n * ```\n */\nexport class Store<\n\tKey,\n\tValue,\n\tCacheDisabled extends boolean = false,\n\t/**\n\t * @remarks\n\t * **On the `This` template parameter:**\n\t * Using `This` as a self-referential template is a **good practice** in this context because:\n\t * - It provides accurate **type inference** for method return types that depend on the generic parameters.\n\t * - It enables **type-safe property access** through `This['methodName']`, allowing the implementation\n\t * to reference interface contracts without circular dependencies or casting issues.\n\t * - It allows **fluent API chains** (returning `this`) while maintaining proper generic type information.\n\t * - It prevents **type widening** that would occur if methods returned the concrete class type instead\n\t * of the interface type, which is important for generic constraints and polymorphism.\n\t *\n\t * However, it increases **cognitive complexity** and is only warranted when:\n\t * - The class implements a complex generic interface with interdependent type parameters.\n\t * - Type-safe property references are essential to avoid runtime errors or casting.\n\t * - Fluent interfaces or chaining is a core API feature.\n\t */\n\tThis extends IStore<Key, Value, CacheDisabled> = IStore<\n\t\tKey,\n\t\tValue,\n\t\tCacheDisabled\n\t>,\n> implements IStore<Key, Value, CacheDisabled> {\n\treadonly cacheDisabled: This['cacheDisabled']\n\n\treadonly delay: This['delay']\n\n\t/** Debounce and throttle related options */\n\treadonly delayOptions?: This['delayOptions']\n\n\treadonly initialized: This['initialized'] = false\n\n\treadonly name: This['name']\n\n\tonChange?: This['onChange']\n\n\tonError?: This['onError']\n\n\tparse?: This['parse']\n\n\tget size() {\n\t\treturn this.getAll().size\n\t}\n\n\tspaces?: This['spaces']\n\n\treadonly storage?: This['storage']\n\n\tstringify?: This['stringify']\n\n\treadonly subject$!: This['subject$']\n\n\tprivate subscriptions = {\n\t\tsubject: undefined as Subscription | undefined,\n\t\tforceUpdateCache: undefined as Subscription | undefined,\n\t}\n\n\ttype: This['type'] = 'map'\n\n\tvalidate?: This['validate']\n\n\tconstructor(\n\t\tname?: This['name'],\n\t\toptions?: Store_Options<Key, Value, CacheDisabled>,\n\t) {\n\t\tthis.name = `${name ?? ''}`.trim() || null\n\t\tconst {\n\t\t\tcacheDisabled = false as CacheDisabled,\n\t\t\tdelay,\n\t\t\tdelayOptions,\n\t\t\tinitialValue,\n\t\t\tonError,\n\t\t\tonChange,\n\t\t\tparse,\n\t\t\tspaces,\n\t\t\tstorage = fallbackIfFails(\n\t\t\t\t() => (!name ? undefined : globalThis.localStorage),\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t),\n\t\t\tstringify,\n\t\t\tvalidate = {},\n\t\t} = options ?? {}\n\t\tif (this.name && !storage && storage !== null)\n\t\t\tthrow new Error(Store.messages.invalidStorageOptions)\n\n\t\tthis.cacheDisabled = (!!storage && cacheDisabled) as CacheDisabled\n\t\tthis.delay = delay === 0 || isPositiveNumber(delay) ? delay : 300\n\t\tthis.delayOptions = delayOptions\n\t\tthis.onError = onError\n\t\tthis.onChange = onChange\n\t\tthis.parse = parse?.bind(this)\n\t\tthis.spaces = spaces\n\t\tthis.storage = storage as This['storage']\n\t\tthis.stringify = stringify?.bind(this)\n\t\tthis.subject$ = (\n\t\t\tthis.cacheDisabled ? new Subject() : new BehaviorSubject(new Map())\n\t\t) as This['subject$']\n\n\t\tconst _validate = { ...validate } as Record<PropertyKey, unknown>\n\t\tfor (const [key, value] of Object.entries(_validate)) {\n\t\t\t_validate[key] = value\n\t\t}\n\t\tthis.validate = _validate\n\n\t\t// non-empty map provided - initiate the storage immediately\n\t\tisMap(initialValue)\n\t\t\t&& initialValue.size\n\t\t\t&& (this.init as (...args: unknown[]) => void)(initialValue, false)\n\t}\n\n\tclear: This['clear'] = () => {\n\t\tthis.validate?.clear?.call(this, [], 'clear')\n\t\treturn this.setAll(new Map<Key, Value>(), true)\n\t}\n\n\tdelete: This['delete'] = keys => {\n\t\tif (!isArr(keys)) keys = [keys]\n\n\t\tthis.validate?.delete?.call(this, [keys], 'delete')\n\n\t\tconst data = this.getAll()\n\t\tfor (const k of keys) data.delete(k)\n\n\t\tthis.setAll(data, true)\n\t\treturn this\n\t}\n\n\tstatic messages = Object.seal({\n\t\tinvalidJsonEntries:\n\t\t\t'Invalid JSON format. Parsed value must be a 2D array representing key-value pairs.',\n\t\tinvalidStorageOptions:\n\t\t\t'options.storage: LocalStorage instance or equivalent required. For NodeJS, use `node-localstorage` NPM module.',\n\t\tvalidationError: 'Validation failed. Action: ',\n\t})\n\n\tfilter: This['filter'] = (...args) => filter(this.getAll(), ...args)\n\n\tfind: This['find'] = predicateOrOptions =>\n\t\tfind(this.getAll(), predicateOrOptions as Parameters<typeof find>[0])\n\n\t/**\n\t * Trigger forced update of cached data from storage.\n\t *\n\t * @param name determines which cache-enabled storage instances to be updated.\n\t * - name (`string` | `string[]`): update all instances with a specific name(s)\n\t * - global (`true`): update all instances globally\n\t *\n\t * See {@link forceUpdateCache$} for more details.\n\t */\n\tstatic forceUpdateCache = (name: string | string[] | true) => {\n\t\tforceUpdateCache$.next(name)\n\t}\n\n\tget: This['get'] = key => this.getAll().get(key)\n\n\tgetAll: This['getAll'] = (forceRead = false) => {\n\t\tconst wasInitialized = this.initialized\n\t\tif (!wasInitialized) this.init()\n\n\t\tconst readFromStorage =\n\t\t\tthis.cacheDisabled || (this.storage && forceRead)\n\t\tif (readFromStorage) {\n\t\t\tconst data = this.read()\n\t\t\tconst shouldTrigger = forceRead || (!wasInitialized && !!data.size)\n\t\t\tshouldTrigger && this.subject$.next(data)\n\t\t\treturn data\n\t\t}\n\n\t\treturn (this.subject$ as BehaviorSubject<Map<Key, Value>>).value\n\t}\n\n\tprivate handleForceUpdateCache = (name: string | string[] | boolean) => {\n\t\tconst isTarget = !this.name\n\t\t\t? false\n\t\t\t: isArr(name)\n\t\t\t\t? name.includes(this.name)\n\t\t\t\t: isStr(name)\n\t\t\t\t\t? name === this.name\n\t\t\t\t\t: name === true\n\t\tif (!isTarget) return\n\n\t\tconst newData = this.read()\n\t\tthis.subject$.next(newData)\n\t}\n\n\tprivate handleSubjectChange = (data: Map<Key, Value>) => {\n\t\t// in-case non-map value is set, reset subject to an empty map\n\t\tif (!isMap(data)) return this.subject$.next(new Map())\n\n\t\t// write quietly\n\t\tfallbackIfFails(this.write, [data], null)\n\n\t\tfallbackIfFails(\n\t\t\tthis.onChange?.bind(this) as unknown,\n\t\t\t[data],\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.onChange),\n\t\t)\n\t}\n\n\thas: This['has'] = key => this.getAll().has(key)\n\n\tinit: This['init'] = (initialValue, checkStorage = true) => {\n\t\tif (this.initialized) return false\n\n\t\tif (this.name && checkStorage) {\n\t\t\tObject.defineProperty(this, 'storage', {\n\t\t\t\tvalue: fallbackIfFails(\n\t\t\t\t\t() => this.storage ?? globalThis.localStorage,\n\t\t\t\t\t[],\n\t\t\t\t\tundefined,\n\t\t\t\t),\n\t\t\t})\n\t\t\tif (!this.storage)\n\t\t\t\tthrow new Error(Store.messages.invalidStorageOptions)\n\t\t}\n\n\t\tObject.defineProperty(this, 'initialized', { value: true })\n\n\t\tlet firstValue = initialValue\n\t\tif (!!initialValue?.size || !this.cacheDisabled) {\n\t\t\tconst dataStr = this.name ? this.storage?.getItem(this.name) : null\n\t\t\tconst existingValue = this.read(dataStr ?? null)\n\n\t\t\t// If the entry exists in storage (even if it is empty), prioritize it over initialValue.\n\t\t\t// This prevents defaults from overwriting an intentionally cleared storage.\n\t\t\tif (isDefined(dataStr)) firstValue = existingValue\n\t\t}\n\n\t\tfirstValue?.size && this.subject$.next(firstValue)\n\n\t\tthis.unsubscribe()\n\t\t// update cached data from localStorage throughout the application only when triggered\n\t\tif (!this.cacheDisabled) {\n\t\t\tthis.subscriptions.forceUpdateCache = forceUpdateCache$.subscribe(\n\t\t\t\tthis.handleForceUpdateCache,\n\t\t\t)\n\t\t}\n\n\t\tconst skipNum =\n\t\t\tthis.subject$ instanceof BehaviorSubject\n\t\t\t&& firstValue?.size\n\t\t\t&& firstValue !== initialValue\n\t\t\t\t? 1\n\t\t\t\t: 0\n\t\t// Subscribe to data changes and write to storage.\n\t\tthis.subscriptions.subject = this.subject$\n\t\t\t.pipe(skip(skipNum))\n\t\t\t.subscribe(\n\t\t\t\t!this.cacheDisabled && this.delay > 0\n\t\t\t\t\t? deferred(this.handleSubjectChange, this.delay, {\n\t\t\t\t\t\t\tthisArg: this,\n\t\t\t\t\t\t\t...this.delayOptions,\n\t\t\t\t\t\t})\n\t\t\t\t\t: this.handleSubjectChange,\n\t\t\t)\n\n\t\treturn true\n\t}\n\n\tkeys: This['keys'] = () => getKeys(this.getAll())\n\n\tmap: This['map'] = callback =>\n\t\tthis.toArray().map(([key, value], index, entries) =>\n\t\t\tcallback(value, key, entries, index),\n\t\t)\n\n\tread: This['read'] = (\n\t\tdataStr = (this.name && this.storage?.getItem(this.name)) ?? null,\n\t) => {\n\t\tconst data = fallbackIfFails(\n\t\t\tthis.parse,\n\t\t\t[dataStr],\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.parse, undefined),\n\t\t)\n\n\t\tif (isMap(data) || !isStr(dataStr))\n\t\t\treturn (\n\t\t\t\t(isFn(this.parse)\n\t\t\t\t\t? data\n\t\t\t\t\t: (this.subject$ as BehaviorSubject<Map<Key, Value>>).value)\n\t\t\t\t?? new Map<Key, Value>()\n\t\t\t)\n\t\t// use fallback JSON.parse if this.parse is not provided, returns non-Map value or fails\n\t\treturn new Map<Key, Value>(\n\t\t\tfallbackIfFails(\n\t\t\t\t() => {\n\t\t\t\t\tconst entries = JSON.parse(dataStr) as [Key, Value][]\n\n\t\t\t\t\tif (!isArr2D(entries))\n\t\t\t\t\t\tthrow new Error(Store.messages.invalidJsonEntries)\n\n\t\t\t\t\treturn entries\n\t\t\t\t},\n\t\t\t\t[],\n\t\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.parse_json),\n\t\t\t),\n\t\t)\n\t}\n\n\tsearch: This['search'] = (...args) => search(this.getAll(), ...args)\n\n\tset: This['set'] = (key, value) => {\n\t\tconst data = this.getAll()\n\n\t\tconst _value = isFn(value) ? value(data.get(key)) : value\n\t\tthis.validate?.set?.call(this, [key, _value], 'set')\n\t\tdata.set(key, _value)\n\n\t\treturn this.setAll(data, true)\n\t}\n\n\tsetAll: This['setAll'] = (data, replace = false) => {\n\t\tif (!isMap(data)) return this\n\n\t\tthis.validate?.setAll?.call(this, [data, replace], 'setAll')\n\n\t\tdata = replace\n\t\t\t? data // override all entries\n\t\t\t: mapJoin(this.getAll(), data) // merge with existing entries and override only matching keys\n\t\tthis.subject$.next(new Map(data))\n\t\treturn this\n\t}\n\n\tsort: This['sort'] = (...args) => {\n\t\tconst result = sort(\n\t\t\tthis.getAll(),\n\t\t\targs[0] as EntryComparator<Key, Value>,\n\t\t\targs[1],\n\t\t)\n\t\targs[1]?.save && this.setAll(result, true)\n\n\t\treturn result\n\t}\n\n\ttoArray: This['toArray'] = () => getEntries(this.getAll())\n\n\ttoJSON: This['toJSON'] = (\n\t\treplacer,\n\t\tspacing = this.spaces,\n\t\tdata = this.getAll(),\n\t) => {\n\t\tconst str = fallbackIfFails(\n\t\t\tthis.stringify as unknown as string,\n\t\t\t[data],\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.stringify, ''), // if fails return empty string\n\t\t)\n\t\tif (isStr(str)) return str\n\n\t\t// use fallback JSON.stringify if this.stringify returns non-string value (undefined)\n\t\treturn fallbackIfFails(\n\t\t\t() =>\n\t\t\t\tJSON.stringify(\n\t\t\t\t\tArray.from(data),\n\t\t\t\t\treplacer as undefined,\n\t\t\t\t\tspacing,\n\t\t\t\t),\n\t\t\t[],\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.stringify_json, ''),\n\t\t)\n\t}\n\n\ttoObject: This['toObject'] = <T>(data = this.getAll()) => {\n\t\tconst obj = {} as T\n\t\tif (!isMap(data)) return obj\n\n\t\tfor (const [key, value] of data)\n\t\t\tobj[key as unknown as keyof T] = value as T[keyof T]\n\n\t\treturn obj\n\t}\n\n\ttoString: This['toString'] = (data = this.getAll()) =>\n\t\tthis.toJSON(undefined, undefined, data)\n\n\tprivate triggerOnErrorCb =\n\t\t<T = undefined>(\n\t\t\ttype: Store_OnErrorType,\n\t\t\treturnValue: T = undefined as T,\n\t\t) =>\n\t\t(err: unknown) => {\n\t\t\tfallbackIfFails(\n\t\t\t\tthis.onError?.bind(this) as unknown,\n\t\t\t\t[err, type],\n\t\t\t\t'',\n\t\t\t)\n\n\t\t\treturn returnValue\n\t\t}\n\n\tunsubscribe: This['unsubscribe'] = () => {\n\t\tthis.subscriptions.forceUpdateCache?.unsubscribe()\n\t\tthis.subscriptions.subject?.unsubscribe()\n\t\tthis.subscriptions = {\n\t\t\tforceUpdateCache: undefined,\n\t\t\tsubject: undefined,\n\t\t}\n\t}\n\n\tvalues: This['values'] = () => getValues(this.getAll())\n\n\twrite: This['write'] = data => {\n\t\tthis.init()\n\t\tdata ??= (this.subject$ as BehaviorSubject<Map<Key, Value>>)?.value\n\t\tif (!isMap(data) || !this.name || !this.storage) return false\n\n\t\tthis.validate?.write?.call(this, [data], 'write')\n\t\ttry {\n\t\t\tconst jsonStr = this.toString(data)\n\t\t\tthis.storage.setItem(this.name, jsonStr)\n\n\t\t\treturn true\n\t\t} catch (err) {\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.write)(err)\n\t\t\treturn false\n\t\t}\n\t}\n}\nexport default Store\n","import { isFn, isObj } from '@superutils/core'\nimport Store from './Store'\nimport { Store_Options } from './types'\nimport {\n\tIStoreWithContext,\n\tStore_Context,\n\tStore_ContextReturn,\n} from './types/context'\n\n/**\n * Factory function to create a {@link Store} instance with optional context.\n *\n * This function provides a convenient way to instantiate a store and attach supplemental\n * logic (context) to it. It supports full type inference for both the store's data\n * and the attached context.\n *\n * @param name - The name of the storage (e.g., localStorage key). If null/undefined, the store remains in-memory.\n * @param options - Configuration options for the store\n * @param options.context - (optional) A plain object or a factory function that returns an object.\n *\n * **Purpose:**\n * Use `context` to encapsulate domain-specific business logic, helper methods, or non-reactive state\n * directly alongside the store instance.\n *\n * **Behavior:**\n * - **Non-Reactive:** Updates to context properties do **not** trigger `onChange` or RxJS emissions.\n * - **Non-Persistent:** Context data is purely in-memory and is **not** saved to persistent storage.\n * - **Access to Store:** When a factory function is used, it receives the store instance as an argument.\n *\n * @template Context - The type of the context object or factory function.\n * @template Key - The type of keys stored in the map.\n * @template Value - The type of values stored in the map.\n * @template CacheDisabled - Literal type determining whether to disable in-memory caching.\n *\n * @returns A {@link Store} instance augmented with a `context` property.\n *\n * @example\n * #### Basic store without context\n * ```javascript\n * import { createStore } from '@superutils/store'\n *\n * const store = createStore<string, number>()\n * store.set('count', 1)\n * store.set('count', prevCount => prevCount + 1)\n * ```\n *\n * @example\n * #### Store with a static context object\n * ```javascript\n * import { createStore } from '@superutils/store'\n *\n * const store = createStore('user-settings', {\n * context: {\n * count: 0,\n * log(msg) {\n * console.log(`[${++this.count}] ${msg}`)\n * }\n * }\n * })\n *\n * store.context.log('Setting updated')\n * console.log(store.context.count)\n * ```\n *\n * @example\n * #### In-memory store\n * ```javascript\n * import fetch from '@superutils/fetch'\n * import { createStore } from '@superutils/store'\n *\n * const store = createStore({\n * context: store => ({\n * async getProducts() {\n * const { products } = await fetch.get('https://dummyjson.com/products')\n *\n * const productsMap = new Map(products.map(p => [p.id, p]))\n * store.setAll(productsMap)\n *\n * return productsMap\n * },\n * }),\n * })\n *\n * store.context.getProducts().then(() => {\n * console.log(store.getAll())\n * })\n * ```\n *\n * @example\n * #### Store with a functional context (access to store instance)\n * ```javascript\n * import { createStore } from '@superutils/store'\n *\n * const authStore = createStore('auth', {\n * context: store => ({\n * isAuthenticated: () => store.has('token'),\n * logout: () => store.delete('token')\n * })\n * })\n *\n * if (authStore.context.isAuthenticated()) {\n * authStore.context.logout()\n * }\n * ```\n */\nexport function createStore<\n\tContext extends Store_Context<Key, Value, CacheDisabled>,\n\tKey,\n\tValue,\n\tCacheDisabled extends boolean = false,\n>(\n\tname?: ConstructorParameters<typeof Store<Key, Value, CacheDisabled>>[0],\n\toptions?: Store_Options<Key, Value, CacheDisabled> & { context?: Context },\n): IStoreWithContext<Key, Value, CacheDisabled, Context>\n\nexport function createStore<\n\tContext extends Store_Context<Key, Value, CacheDisabled>,\n\tKey,\n\tValue,\n\tCacheDisabled extends boolean = false,\n>(\n\toptions: Store_Options<Key, Value, CacheDisabled> & { context?: Context },\n): IStoreWithContext<Key, Value, CacheDisabled, Context>\n\n/**\n * Factory method to create a {@link Store} instance.\n *\n * @param args - Arguments passed directly to the {@link Store} constructor.\n * @template Key - The type of keys stored in the map.\n * @template Value - The type of values stored in the map.\n * @template CacheDisabled - Whether to disable in-memory caching.\n */\nexport function createStore<Key, Value, CacheDisabled extends boolean = false>(\n\t...args: ConstructorParameters<typeof Store<Key, Value, CacheDisabled>>\n): Store<Key, Value, CacheDisabled>\n\nexport function createStore<\n\tContext extends Store_Context<Key, Value, CacheDisabled>,\n\tKey,\n\tValue,\n\tCacheDisabled extends boolean,\n>(\n\tname?:\n\t\t| string\n\t\t| null\n\t\t| (Store_Options<Key, Value, CacheDisabled> & { context?: Context }),\n\toptions?: Store_Options<Key, Value, CacheDisabled> & { context?: Context },\n) {\n\tif (isObj(name)) {\n\t\toptions = name\n\t\tname = null\n\t}\n\n\tconst store = new Store(name, options)\n\n\tObject.defineProperty(store, 'context', {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\tvalue: isFn(options?.context)\n\t\t\t? options.context(store)\n\t\t\t: options?.context,\n\t\twritable: false,\n\t})\n\n\treturn store as typeof store & Store_ContextReturn<Context>\n}\nexport default createStore\n","import { objToMap, isObj } from '@superutils/core'\nimport createStore from './createStore'\nimport Store from './Store'\nimport {\n\tStore_Options,\n\tIObjectStore,\n\tObjectStore_Context,\n\tObjectStore_Options,\n} from './types'\nimport { IObjectStoreWithContext } from './types/context'\n\n/**\n * Creates a {@link Store} instance initialized from a plain object.\n *\n * This factory method automatically configures `parse` and `stringify` logic to\n * treat the underlying storage as a serialized object, while providing a\n * type-safe Map-like interface for individual properties.\n *\n * This default behavior can be overridden by providing custom `parse` and `stringify` implementations in `options`.\n *\n * @param name (optional) The name for the storage (e.g., localStorage key or filename).\n * @param options (optional) Configuration options for the storage instance.\n * @param options.initialValue (optional) An optional object to populate the storage if it's currently empty.\n * @param options.context - (optional) A plain object or a factory function that returns an object.\n *\n * **Purpose:**\n * Use `context` to encapsulate domain-specific business logic, helper methods, or non-reactive state\n * directly alongside the store instance.\n *\n * **Behavior:**\n * - **Non-Reactive:** Updates to context properties do **not** trigger `onChange` or RxJS emissions.\n * - **Non-Persistent:** Context data is purely in-memory and is **not** saved to persistent storage.\n * - **Access to Store:** When a factory function is used, it receives the store instance as an argument.\n *\n * @template T (optional) The structure of the object being stored. Can auto-infer from `options.initialValue`.\n * @template CacheDisabled (optional) Literal type determining whether to disable in-memory caching.\n *\n * @returns A new Store instance mapped to the object's keys and values.\n *\n * @example\n * #### Basic property-based access\n *\n * ```typescript\n * import { createObjectStore } from '@superutils/store'\n *\n * const storage = createObjectStore('user-profile', {\n * initialValue: {\n * age: 99,\n * name: 'Ninety Nine'\n * }\n * })\n *\n * // Keys are strictly inferred from the interface\n * const name = storage.get('name') // Type: string | undefined\n * console.log(name) // Prints: 'Ninety Nine'\n *\n * // Update properties with type safety\n * storage.set('age', 100) // Only numbers are accepted for 'age'\n *\n * // Export the underlying data back to a plain object\n * const userObj = storage.toObject<User>()\n * console.log(userObj) // { age: 100, name: 'Ninety Nine' }\n * ```\n *\n * @example\n * #### Usage with context\n *\n * ```javascript\n * import { createObjectStore } from '@superutils/store'\n *\n * // Functional context allows you to attach business logic directly to the store\n * const userStore = createObjectStore('user-profile', {\n * initialValue: {\n * age: 25,\n * name: 'Jane Doe',\n * roles: ['guest']\n * },\n * context: store => ({\n * isAdmin: () => !!store.get('roles')?.includes('admin'),\n * promoteToAdmin() {\n * if (this.isAdmin()) return\n *\n * // Use functional updates to safely modify the roles array\n * store.set('roles', (prev = []) => [...prev, 'admin'])\n * }\n * })\n * })\n *\n * // Logic is encapsulated and easy to invoke\n * userStore.context.promoteToAdmin()\n * console.log(userStore.get('roles')) // ['guest', 'admin']\n * ```\n *\n */\nexport function createObjectStore<\n\tT extends object = Record<string, unknown>,\n\tCacheDisabled extends boolean = false,\n\tContext extends ObjectStore_Context<T, CacheDisabled> = ObjectStore_Context<\n\t\tT,\n\t\tCacheDisabled\n\t>,\n>(\n\tname?: string | null,\n\toptions?: ObjectStore_Options<T, CacheDisabled, Context>,\n): IObjectStoreWithContext<T, CacheDisabled, Context>\nexport function createObjectStore<\n\tT extends object = Record<string, unknown>,\n\tCacheDisabled extends boolean = false,\n\tContext extends ObjectStore_Context<T, CacheDisabled> = ObjectStore_Context<\n\t\tT,\n\t\tCacheDisabled\n\t>,\n>(\n\toptions: ObjectStore_Options<T, CacheDisabled, Context>,\n): IObjectStoreWithContext<T, CacheDisabled, Context>\n\n/**\n * Create a {@link Store} instance from an object using `options.initialValue`.\n */\nexport function createObjectStore<\n\tT extends object = Record<string, unknown>,\n\tKey extends keyof T = keyof T,\n\tValue extends T[Key] = T[Key],\n\tCacheDisabled extends boolean = false,\n>(\n\t...args: ConstructorParameters<typeof Store<Key, Value, CacheDisabled>>\n): IObjectStore<T, CacheDisabled>\n\nexport function createObjectStore<\n\tT extends object = Record<string, unknown>,\n\tCacheDisabled extends boolean = false,\n\tContext extends ObjectStore_Context<T, CacheDisabled> = ObjectStore_Context<\n\t\tT,\n\t\tCacheDisabled\n\t>,\n\tKey extends keyof T = keyof T,\n\tValue extends T[Key] = T[Key],\n>(\n\tname?: string | null | ObjectStore_Options<T, CacheDisabled, Context>,\n\toptions?: ObjectStore_Options<T, CacheDisabled, Context>,\n) {\n\tif (isObj(name)) {\n\t\toptions = name\n\t\tname = null\n\t}\n\n\tconst store = createStore(name, {\n\t\tparse: str => objToMap<T>(JSON.parse(str ?? '{}') as T),\n\t\tstringify: function (data) {\n\t\t\treturn JSON.stringify(this.toObject(data))\n\t\t},\n\t\t...(options as Store_Options<Key, Value, CacheDisabled>),\n\t\tinitialValue: !isObj(options?.initialValue, true)\n\t\t\t? options?.initialValue\n\t\t\t: objToMap<T>(options.initialValue),\n\t})\n\n\tstore.type = 'object'\n\n\treturn store as unknown as IObjectStoreWithContext<\n\t\tT,\n\t\tCacheDisabled,\n\t\tContext\n\t>\n}\n\nexport default createObjectStore\n","export * from './createObjectStore'\nexport * from './createStore'\nexport * from './Store'\nexport * from './types'\nimport Store from './Store'\n\nexport { objToMap, type TypedMap } from '@superutils/core'\nexport default Store\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../core/dist/index.js","../../../../node_modules/tslib/tslib.es6.mjs","../../../../node_modules/rxjs/src/internal/util/isFunction.ts","../../../../node_modules/rxjs/src/internal/util/createErrorClass.ts","../../../../node_modules/rxjs/src/internal/util/UnsubscriptionError.ts","../../../../node_modules/rxjs/src/internal/util/arrRemove.ts","../../../../node_modules/rxjs/src/internal/Subscription.ts","../../../../node_modules/rxjs/src/internal/config.ts","../../../../node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts","../../../../node_modules/rxjs/src/internal/util/reportUnhandledError.ts","../../../../node_modules/rxjs/src/internal/util/noop.ts","../../../../node_modules/rxjs/src/internal/util/errorContext.ts","../../../../node_modules/rxjs/src/internal/Subscriber.ts","../../../../node_modules/rxjs/src/internal/symbol/observable.ts","../../../../node_modules/rxjs/src/internal/util/identity.ts","../../../../node_modules/rxjs/src/internal/util/pipe.ts","../../../../node_modules/rxjs/src/internal/Observable.ts","../../../../node_modules/rxjs/src/internal/util/lift.ts","../../../../node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts","../../../../node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts","../../../../node_modules/rxjs/src/internal/Subject.ts","../../../../node_modules/rxjs/src/internal/BehaviorSubject.ts","../../../../node_modules/rxjs/src/internal/operators/filter.ts","../../../../node_modules/rxjs/src/internal/operators/skip.ts","../../src/types/types.ts","../../src/Store.ts","../../src/createStore.ts","../../src/createObjectStore.ts","../../src/index.ts"],"names":["isObj","x","strict","isArr","isArr2D","isArrLike","isInteger","isNumber","isPositiveInteger","isPositiveNumber","isEmpty","nonNumerable","fallback","proto","isFn","isMap","isDefined","isPromise","isRegExp","isSet","isStr","isSymbol","fallbackIfFails","target","args","result","err","fallbackIfFails_default","objKeys","obj","sorted","includeSymbols","objKeys_default","clone","value","objCopy","input","output","ignoreKeys","override","recursive","_output","_ignoreKeys","inKeys","_key","key","ignoreChildKeys","objCreate","keys","values","i","objToMap","entries","k","v","arrReverse","arr","reverse2","newArray","debounce","callback","delay","config","leading","onError","thisArg","tid","_callback","firstArgs","leadingGlobal","debounce_default","throttle","d","trailing","handleCallback","trailArgs","cbArgs","throttle_default","deferred","options","filter","data","predicate","limit","asMap","_a","item","filter_default","getSize","s","_","getSize_default","getValues","getValues_default","search","ignore","ignoreCase","matchAll","matchExact","ranked","query","qIsStr","qIsRegExp","qKeys","preRankedResults","dataKey","dataValue","matchIndex","matchObjOrProp","indexes","index","a","b","n","transform","propertyName","_b","global","keyword","propVal","valueStr","search_default","find","optsOrCb","getEntries","map","getKeys","sort","keyOrFn","dataType","asString","newInstance","undefinedFirst","alt","getVal","val","gt","lt","entry","mapJoin","inputs","extendStatics","p","__extends","__","__values","o","m","__read","r","ar","e","error","__spreadArray","to","from","pack","l","isFunction","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","arrRemove","Subscription","initialTeardown","_parentage","_parentage_1","_parentage_1_1","parent_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","teardown","parent","empty","EMPTY_SUBSCRIPTION","isSubscription","timeoutProvider","handler","timeout","_i","handle","reportUnhandledError","noop","errorContext","cb","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","handleStoppedNotification","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","defaultErrorHandler","notification","subscriber","observable","identity","pipeFromArray","fns","prev","fn","Observable","subscribe","operator","isSubscriber","source","sink","promiseCtor","getPromiseCtor","resolve","reject","operations","isObserver","hasLift","operate","init","liftedSource","createOperatorSubscriber","onNext","onComplete","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","_c","observer","observers","hasError","isStopped","thrownError","BehaviorSubject","_value","subscription","skip","count","Store_OnErrorType","forceUpdateCache$","_Store","name","predicateOrOptions","forceRead","wasInitialized","newData","initialValue","checkStorage","firstValue","dataStr","existingValue","skipNum","replace","replacer","spacing","str","type","returnValue","jsonStr","cacheDisabled","delayOptions","onChange","parse","spaces","storage","stringify","validate","_validate","Store","Store_default","isStoreKey","store","OPTIONAL_STORE_PROPS","createStore","context","_context","receiver","createStore_default","createObjectStore","setAll","index_default"],"mappings":"0FAcA,IAAIA,CAAAA,CAAQ,CAACC,CAAAA,CAAGC,CAAAA,CAAS,OAAS,CAAC,CAACD,CAAAA,EAAK,OAAOA,CAAAA,EAAM,QAAA,GAAa,CAACC,CAAAA,EAAU,CAC5E,MAAA,CAAO,SAAA,CACP,IAEF,CAAA,CAAE,QAAA,CAAS,MAAA,CAAO,cAAA,CAAeD,CAAC,CAAC,CAAA,CAAA,CAInC,IAAIE,CAAAA,CAASF,CAAAA,EAAM,KAAA,CAAM,OAAA,CAAQA,CAAC,CAAA,CAElC,IAAIG,EAAAA,CAAWH,CAAAA,EAAME,CAAAA,CAAMF,CAAC,CAAA,EAAKA,CAAAA,CAAE,KAAA,CAAME,CAAK,EAC1CE,EAAAA,CAAaJ,CAAAA,EAAME,CAAAA,CAAMF,CAAC,CAAA,EAAKA,CAAAA,YAAa,GAAA,EAAOA,CAAAA,YAAa,IAwBpE,IAAIK,EAAAA,CAAaL,CAAAA,EAAM,MAAA,CAAO,SAAA,CAAUA,CAAC,CAAA,CAGzC,IAAIM,GAAYN,CAAAA,EAAM,OAAOA,CAAAA,EAAM,QAAA,EAAY,CAAC,MAAA,CAAO,KAAA,CAAMA,CAAC,G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AAQ,CACpB,KAAA,CAAO8L,CAAAA,EAAO1N,CAAAA,CAAS,IAAA,CAAK,KAAA,CAAM0N,GAAA,IAAA,CAAAA,CAAAA,CAAO,IAAI,CAAM,CAAA,CACnD,SAAA,CAAU5L,EAAM,CACf,OAAO,IAAA,CAAK,SAAA,CAAU,IAAA,CAAK,QAAA,CAASA,CAAI,CAAC,CAC1C,CACD,CAAA,CACA,GAAGF,CAAAA,CACH,YAAA,CAAe/E,CAAAA,CAAM+E,CAAAA,EAAA,IAAA,CAAA,MAAA,CAAAA,CAAAA,CAAS,YAAA,CAAc,IAAI,CAAA,CAE7C5B,EAAS4B,CAAAA,CAAQ,YAAY,CAAA,CAD7BA,CAAAA,EAAA,IAAA,CAAA,MAAA,CAAAA,CAAAA,CAAS,YAEb,CAAA,CAEA,IAAM8M,CAAAA,CAAQM,EAAAA,CACRpN,CAAAA,CAASiN,CACf,EAEAH,CAAAA,CAAM,IAAA,CAAO,QAAA,CAEb,IAAMQ,CAAAA,CAASR,CAAAA,CAAM,MAAA,CAAO,IAAA,CAAKA,CAAK,CAAA,CACtC,OAAAA,CAAAA,CAAM,MAAA,CAAS,CAAChQ,EAAK6O,CAAAA,IAChB7O,CAAAA,EAAO,CAACd,CAAAA,CAAMc,CAAG,CAAA,GAAGA,CAAAA,CAAMsB,CAAAA,CAAStB,CAAG,CAAA,CAAA,CAEnCwQ,CAAAA,CAAOxQ,CAAAA,CAAK6O,CAAO,CAAA,CAAA,CAG3BmB,EAAM,KAAA,CAAQ5M,CAAAA,EAAUA,CAAAA,CAAwB9B,CAAAA,CAAS8B,CAAI,CAAA,CAA9B4M,CAAAA,CAAM,MAAA,EAAO,CAErCA,CACR,CC7IA,IAAOS,EAAAA,CAAQX","file":"index.min.js","sourcesContent":["// src/curry.ts\nfunction curry(func, ...[arity = func.length]) {\n const curriedFn = (...args) => {\n const _args = args;\n if (_args.length >= arity) return func(...args);\n return (...nextArgs) => curriedFn(\n ..._args,\n ...nextArgs\n );\n };\n return curriedFn;\n}\n\n// src/is/isObj.ts\nvar isObj = (x, strict = true) => !!x && typeof x === \"object\" && (!strict || [\n Object.prototype,\n null\n // when an object is created using `Object.create(null)`\n].includes(Object.getPrototypeOf(x)));\nvar isObj_default = isObj;\n\n// src/is/isArr.ts\nvar isArr = (x) => Array.isArray(x);\nvar isArrObj = (x, strict = true) => isArr(x) && x.every((x2) => isObj(x2, strict));\nvar isArr2D = (x) => isArr(x) && x.every(isArr);\nvar isArrLike = (x) => isArr(x) || x instanceof Set || x instanceof Map;\nvar isArrLikeSafe = (x) => [\"[object Array]\", \"[object Map]\", \"[object Set]\"].includes(\n Object.prototype.toString.call(x)\n);\nvar isArrUnique = (x) => isArr(x) && new Set(x).size === x.length;\nvar isUint8Arr = (x) => x instanceof Uint8Array;\nvar isArr_default = isArr;\n\n// src/is/isDate.ts\nvar isDate = (x) => x instanceof Date;\nvar isDateValid = (date) => {\n const dateIsStr = typeof date === \"string\";\n if (!dateIsStr && !isDate(date)) return false;\n const dateObj = new Date(date);\n if (Number.isNaN(dateObj.getTime())) return false;\n if (!dateIsStr) return true;\n const [original, converted] = [date, dateObj.toISOString()].map(\n (y) => y.replace(/[TZ]/g, \"\").substring(0, 10)\n );\n return original === converted;\n};\nvar isDate_default = isDate;\n\n// src/is/isNumber.ts\nvar isInteger = (x) => Number.isInteger(x);\nvar isNegativeInteger = (x) => Number.isInteger(x) && x < 0;\nvar isNegativeNumber = (x) => isNumber(x) && x < 0;\nvar isNumber = (x) => typeof x === \"number\" && !Number.isNaN(x) && Number.isFinite(x);\nvar isPositiveInteger = (x) => isInteger(x) && x > 0;\nvar isPositiveNumber = (x) => isNumber(x) && x > 0;\n\n// src/is/isEmpty.ts\nvar isEmpty = (x, nonNumerable = false, fallback = false) => {\n if (x === null || x === void 0) return true;\n switch (typeof x) {\n case \"number\":\n return !isNumber(x);\n case \"string\":\n return !x.replaceAll(\"\t\", \"\").trim().length;\n case \"boolean\":\n case \"bigint\":\n case \"symbol\":\n case \"function\":\n return false;\n }\n if (x instanceof Date) return Number.isNaN(x.getTime());\n if (x instanceof Map || x instanceof Set) return !x.size;\n if (Array.isArray(x) || x instanceof Uint8Array) return !x.length;\n if (x instanceof Error) return !x.message.length;\n const proto = typeof x === \"object\" && Object.getPrototypeOf(x);\n if (proto === Object.prototype || proto === null) {\n return nonNumerable ? !Object.getOwnPropertyNames(x).length : !Object.keys(x).length;\n }\n return fallback;\n};\nvar isEmptySafe = (x, numberableOnly = false) => {\n const empty = isEmpty(x, numberableOnly, 0);\n if (empty !== 0) return empty;\n switch (Object.prototype.toString.call(x)) {\n case \"[object Uint8Array]\":\n return !x.length;\n case \"[object Date]\":\n return Number.isNaN(x.getTime());\n case \"[object Map]\":\n return !x.size;\n case \"[object Object]\":\n return !Object.keys(x).length;\n case \"[object Set]\":\n return !x.size;\n default:\n return false;\n }\n};\nvar isEmpty_default = isEmpty;\n\n// src/is/isEnv.ts\nvar isEnvBrowser = () => typeof window !== \"undefined\" && typeof window.navigator !== \"undefined\" && typeof window.document !== \"undefined\";\nvar isEnvBun = () => {\n var _a;\n return Object.hasOwn(globalThis, \"Bun\") && typeof process !== \"undefined\" && !!((_a = process.versions) == null ? void 0 : _a.bun);\n};\nvar isEnvDeno = () => {\n var _a;\n return typeof ((_a = globalThis.Deno) == null ? void 0 : _a.version) === \"string\";\n};\nvar isEnvMobile = () => isEnvBrowser() && /Android|Adr|webOS|iPhone|iPad|iPod|iOS|BlackBerry|BB10|IEMobile|Opera Mini|Mobile|CriOS|FxiOS|Silk|Huawei|HUAWEI|Honor|EMUI|Mi(?:ui)?|Redmi|Poco|OPR\\/|Vivo|Oppo|Lenovo|Pixel|SM-|GT-|Moto|Nexus/i.test(\n String(\n navigator.userAgent || (window == null ? void 0 : window.opera)\n )\n);\nvar isEnvNode = (strict = false) => {\n var _a, _b;\n return typeof process !== \"undefined\" && !!((_a = process.versions) == null ? void 0 : _a.node) && (!strict || !((_b = process.versions) == null ? void 0 : _b.bun));\n};\nvar isEnvTouchable = () => {\n var _a, _b;\n return \"ontouchstart\" in ((_b = (_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement) != null ? _b : {});\n};\n\n// src/noop.ts\nfunction noop() {\n}\nasync function noopAsync() {\n}\n\n// src/is/isFn.ts\nvar isFn = (x) => typeof x === \"function\";\nvar isAsyncFn = (x) => x instanceof noopAsync.constructor && x[Symbol.toStringTag] === \"AsyncFunction\";\nvar isFn_default = isFn;\n\n// src/is/isMap.ts\nvar isMap = (x) => x instanceof Map;\nvar isMapObj = (x, strict = true) => isMap(x) && [...x.values()].every((value) => isObj_default(value, strict));\n\n// src/is/isUrl.ts\nvar isUrl = (x) => x instanceof URL;\nvar isUrlValid = (x, strict = true, tldExceptions = [\"localhost\"]) => {\n if (!x) return false;\n try {\n if (typeof x !== \"string\" && !isUrl(x)) return false;\n const url = isUrl(x) ? x : new URL(x);\n if (!strict) return true;\n const gotTld = tldExceptions.includes(url.hostname) || url.host.split(\".\").length > 1;\n if (!gotTld) return false;\n let y = `${x}`;\n if (y.endsWith(url.hostname)) y += \"/\";\n return url.href === y;\n } catch (_) {\n return false;\n }\n};\nvar isUrl_default = isUrl;\n\n// src/is/index.ts\nvar isBool = (x) => typeof x === \"boolean\" || x instanceof Boolean;\nvar isDefined = (x) => x !== void 0 && x !== null;\nvar isError = (x) => x instanceof Error;\nvar isPromise = (x) => x instanceof Promise;\nvar isRegExp = (x) => x instanceof RegExp;\nvar isSet = (x) => x instanceof Set;\nvar isStr = (x) => typeof x === \"string\";\nvar isSubjectLike = (x, withValue = false) => isObj_default(x, false) && isFn_default(x.subscribe) && isFn_default(x.next) && (!withValue || \"value\" in x);\nvar isSymbol = (x) => typeof x === \"symbol\";\nvar is = {\n arr: isArr_default,\n arr2D: isArr2D,\n arrLike: isArrLike,\n arrLikeSafe: isArrLikeSafe,\n arrObj: isArrObj,\n arrUnique: isArrUnique,\n asyncFn: isAsyncFn,\n bool: isBool,\n date: isDate_default,\n dateValid: isDateValid,\n defined: isDefined,\n empty: isEmpty_default,\n emptySafe: isEmptySafe,\n envBrowser: isEnvBrowser,\n envBun: isEnvBun,\n envDeno: isEnvDeno,\n envMobile: isEnvMobile,\n envNode: isEnvNode,\n envTouchable: isEnvTouchable,\n error: isError,\n fn: isFn_default,\n integer: isInteger,\n map: isMap,\n mapObj: isMapObj,\n negativeInteger: isNegativeInteger,\n negativeNumber: isNegativeNumber,\n number: isNumber,\n obj: isObj_default,\n positiveInteger: isPositiveInteger,\n positiveNumber: isPositiveNumber,\n promise: isPromise,\n regExp: isRegExp,\n set: isSet,\n str: isStr,\n subjectLike: isSubjectLike,\n symbol: isSymbol,\n uint8Arr: isUint8Arr,\n url: isUrl_default,\n urlValid: isUrlValid\n};\n\n// src/fallbackIfFails.ts\nvar fallbackIfFails = (target, args, fallback) => {\n try {\n const result = !isFn(target) ? target : target(...isFn(args) ? args() : args);\n if (!isPromise(result)) return result;\n return result.catch(\n (err) => isFn(fallback) ? fallback(err) : fallback\n );\n } catch (err) {\n return isFn(fallback) ? fallback(err) : fallback;\n }\n};\nvar fallbackIfFails_default = fallbackIfFails;\n\n// src/toDatetimeLocal.ts\nvar toDatetimeLocal = (dateStr) => {\n const date = new Date(dateStr);\n if (!isDateValid(date)) return \"\";\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, \"0\");\n const day = date.getDate().toString().padStart(2, \"0\");\n const hours = date.getHours().toString().padStart(2, \"0\");\n const minutes = date.getMinutes().toString().padStart(2, \"0\");\n const res = `${year}-${month}-${day}T${hours}:${minutes}`;\n return res;\n};\n(/* @__PURE__ */ new Date()).getTime();\n\n// src/obj/objClean.ts\nvar objClean = (obj, keys, ignoreIfNotExist = true) => {\n const result = {};\n if (!isObj(obj) || !isArr(keys)) return result;\n const uniqKeys = arrUnique(\n keys.map((x) => String(x).split(\".\")[0])\n ).sort();\n for (const key of uniqKeys) {\n if (ignoreIfNotExist && !obj.hasOwnProperty(key)) continue;\n const value = obj[key];\n if (!isObj(value) || isSymbol(key)) {\n result[key] = value;\n continue;\n }\n const childPrefix = `${key}.`;\n const childKeys = keys.filter((k) => {\n var _a;\n return (_a = k == null ? void 0 : k.startsWith) == null ? void 0 : _a.call(k, childPrefix);\n }).map((k) => k.split(childPrefix)[1]);\n if (!childKeys.length) {\n result[key] = value;\n continue;\n }\n result[key] = objClean(\n value,\n childKeys\n );\n }\n return result;\n};\n\n// src/obj/objKeys.ts\nvar objKeys = (obj, sorted = true, includeSymbols = true) => (\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n fallbackIfFails_default(\n () => [\n ...includeSymbols && Object.getOwnPropertySymbols(obj) || [],\n ...sorted ? Object.keys(obj).sort() : Object.keys(obj)\n ],\n [],\n []\n )\n);\nvar objKeys_default = objKeys;\n\n// src/obj/objCopy.ts\nvar clone = (value, fallback = \"null\") => JSON.parse(fallbackIfFails_default(JSON.stringify, [value], fallback));\nvar objCopy = (input, output, ignoreKeys, override = false, recursive = true) => {\n const _output = isObj(output, false) || isFn(output) ? output : {};\n if (!isObj(input, false) && !isFn(output)) return _output;\n const _ignoreKeys = new Set(ignoreKeys != null ? ignoreKeys : []);\n const inKeys = objKeys_default(input, true, true).filter(\n (x) => !_ignoreKeys.has(x)\n );\n for (const _key of inKeys) {\n const key = _key;\n const value = input[key];\n const skip = _output.hasOwnProperty(key) && (override === \"empty\" ? !isEmpty(_output[key]) : isFn(override) ? !override(key, _output[key], value) : true);\n if (skip) continue;\n const isPrimitive = [void 0, null, Infinity, NaN].includes(value) || !isObj(value, false);\n if (isPrimitive) {\n _output[key] = value;\n continue;\n }\n _output[key] = (() => {\n switch (Object.getPrototypeOf(value)) {\n case Array.prototype:\n return clone(value, \"[]\");\n case ArrayBuffer.prototype:\n return value.slice(0);\n case Date.prototype:\n return new Date(value.getTime());\n case Map.prototype:\n return new Map(\n clone(\n Array.from(\n value\n ),\n \"[]\"\n )\n );\n case RegExp.prototype:\n return new RegExp(value);\n case Set.prototype:\n return new Set(\n clone(Array.from(value))\n );\n case Uint8Array.prototype:\n return new Uint8Array([...value]);\n case URL.prototype:\n return new URL(value);\n default:\n break;\n }\n if (isSymbol(key) || !recursive) return clone(value);\n const ignoreChildKeys = [..._ignoreKeys].map(\n (x) => String(x).startsWith(String(key).concat(\".\")) && String(x).split(String(key).concat(\".\"))[1]\n ).filter(Boolean);\n if (!ignoreChildKeys.length) return clone(value);\n return objCopy(\n value,\n _output[key],\n ignoreChildKeys,\n override,\n recursive\n );\n })();\n }\n return _output;\n};\n\n// src/obj/objCreate.ts\nvar objCreate = (keys = [], values = [], result) => {\n if (!isObj(result)) result = {};\n for (let i = 0; i < (isArr(keys) ? keys : []).length; i++) {\n ;\n result[keys[i]] = values == null ? void 0 : values[i];\n }\n return result;\n};\n\n// src/obj/objHasKeys.ts\nfunction objHasKeys(input = {}, keys = [], requireValue = false) {\n if (!isObj(input) || !isArr(keys)) return false;\n for (const key of keys) {\n if (!input.hasOwnProperty(key)) return false;\n if (requireValue && isEmpty(input[key])) return false;\n }\n return true;\n}\n\n// src/obj/objReadOnly.ts\nvar objReadOnly = (obj, config) => {\n if (!isObj(obj, false)) obj = {};\n const { add, revocable, silent = true } = config != null ? config : {};\n const [typeTitle, keyTitle] = isArr(obj) ? [\"array\", \"index\"] : [\"object\", \"property name\"];\n function handleSetProp(obj2, key, value) {\n const isUpdate = obj2[key] !== void 0;\n if (isUpdate && silent) return true;\n const allowAddition = !isUpdate && (!isFn(add) ? add : add(obj2, key, value));\n const shouldThrow = !silent && (isUpdate || !allowAddition);\n if (shouldThrow)\n throw new TypeError(\n `Mutation not allow on read-only ${typeTitle} ${keyTitle}: ${key.toString()}`\n );\n if (!allowAddition) return true;\n obj2[key] = value;\n return true;\n }\n const proxyHandler = {\n get: (obj2, key) => obj2[key],\n set: handleSetProp,\n defineProperty: (obj2, key, { value }) => handleSetProp(obj2, key, value),\n // Prevent removal of properties\n deleteProperty: (obj2, key) => {\n if (!silent && obj2.hasOwnProperty(key)) {\n throw new Error(\n `Mutation not allow on read-only ${typeTitle} ${keyTitle}: ${key.toString()}`\n );\n }\n return true;\n }\n };\n return revocable ? Proxy.revocable(obj, proxyHandler) : new Proxy(obj, proxyHandler);\n};\n\n// src/obj/objSetProp.ts\nvar objSetProp = (obj, key, falsyValue, condition, truthyValue) => {\n var _a;\n const result = !isObj(obj, false) ? {} : obj;\n falsyValue != null ? falsyValue : falsyValue = result[key];\n condition = isFn(condition) ? condition((_a = result[key]) != null ? _a : falsyValue, key, obj) : condition;\n result[key] = !condition ? falsyValue : truthyValue;\n return result;\n};\nvar objSetPropUndefined = (...[obj, key, ...args]) => (obj == null ? void 0 : obj[key]) === void 0 && objSetProp(obj, key, ...args) || obj;\n\n// src/obj/objSort.ts\nvar objSort = (obj, recursive = true, _done = /* @__PURE__ */ new Map()) => {\n const sorted = {};\n if (!isObj(obj)) return sorted;\n for (const key of objKeys_default(obj)) {\n const value = obj[key];\n _done.set(value, true);\n sorted[key] = !recursive || !isObj(value) ? value : objSort(\n value,\n recursive,\n _done\n );\n }\n return sorted;\n};\n\n// src/obj/objToMap.ts\nfunction objToMap(input) {\n const entries = Object.entries(!isObj(input) ? {} : input);\n return new Map(entries.map(([k, v]) => [k, v]));\n}\n\n// src/obj/objWithoutKeys.ts\nvar objWithoutKeys = (input, keys, output) => {\n if (!isObj(input, false)) return {};\n if (!isArr(keys) || !keys.length) return input;\n output = {\n ...isObj(output, false) && output,\n ...input\n };\n for (const key of keys) delete output[key];\n return output;\n};\n\n// src/arr/arrReadOnly.ts\nvar arrReadOnly = (arr, config = {}) => objReadOnly(new ReadOnlyArrayHelper(config, arr), config);\nvar ReadOnlyArrayHelper = class extends Array {\n constructor(config, arr) {\n var _a;\n (_a = config.silent) != null ? _a : config.silent = true;\n super(...arr);\n this.config = config;\n this.ignoreOrThrow = (returnValue) => {\n if (this.config.silent) return returnValue;\n throw new Error(\"Mutation not allowed on read-only array\");\n };\n this.pop = () => this.ignoreOrThrow(this[this.length - 1]);\n this.push = (...items) => !this.config.add ? this.ignoreOrThrow(this.length) : super.push(...items);\n this.reverse = () => this.ignoreOrThrow(this);\n this.shift = () => this.ignoreOrThrow(this[0]);\n this.splice = (..._ignoredArgs) => this.ignoreOrThrow([]);\n this.unshift = (..._ignoredArgs) => this.ignoreOrThrow(this.length);\n }\n // fromAsync = super.fromAsync\n // reduce = super.reduce\n // reduceRight = super.reduceRight\n};\n\n// src/arr/arrReverse.ts\nvar arrReverse = (arr, reverse2 = true, newArray = false) => {\n if (!isArr(arr)) return [];\n if (newArray) arr = [...arr];\n return reverse2 ? arr.reverse() : arr;\n};\n\n// src/arr/arrToMap.ts\nfunction arrToMap(arr, key, flatDepth = 0) {\n ;\n [key, flatDepth] = isNumber(key) ? [void 0, key] : [key, flatDepth];\n const flatEntries = (!isArr(arr) ? [] : flatDepth > 0 ? arr.flat(flatDepth) : arr).map((item, i, flatArr) => {\n var _a;\n return [\n (_a = isFn(key) ? key(item, i, flatArr) : isObj(item) && isDefined(key) ? item[key] : i) != null ? _a : i,\n item\n ];\n });\n return new Map(flatEntries);\n}\n\n// src/arr/arrUnique.ts\nvar arrUnique = (arr, flatDepth = 0) => !isArr(arr) ? [] : Array.from(new Set(arr.flat(flatDepth)));\n\n// src/deferred/debounce.ts\nvar debounce = (callback, delay = 50, config = {}) => {\n const {\n leading = debounce.defaults.leading,\n onError = debounce.defaults.onError,\n thisArg\n } = config;\n let { tid } = config;\n if (thisArg !== void 0) callback = callback.bind(thisArg);\n const _callback = (...args) => fallbackIfFails_default(callback, args, onError);\n let firstArgs = null;\n const leadingGlobal = leading === \"global\";\n return (...args) => {\n clearTimeout(tid);\n tid = setTimeout(() => {\n firstArgs !== args && _callback(...args);\n firstArgs = leadingGlobal ? true : null;\n }, delay);\n if (!leading || firstArgs) return;\n firstArgs = args;\n _callback(...args);\n };\n};\ndebounce.defaults = {\n /**\n * Set the default value of argument `leading` for the `deferred` function.\n * This change is applicable application-wide and only applies to any new invocation of `deferred()`.\n */\n leading: false,\n /**\n * Set the default value of argument `onError` for the `deferred` function.\n * This change is applicable application-wide and only applies to any new invocation of `deferred()`.\n */\n onError: void 0\n};\nvar debounce_default = debounce;\n\n// src/deferred/throttle.ts\nvar throttle = (callback, delay = 50, config = {}) => {\n const { defaults: d } = throttle;\n const { onError = d.onError, trailing = d.trailing, thisArg } = config;\n let { tid } = config;\n const handleCallback = (...args) => fallbackIfFails_default(\n thisArg !== void 0 ? callback.bind(thisArg) : callback,\n args,\n !isFn(onError) ? void 0 : (err) => fallbackIfFails_default(onError, [err], void 0)\n );\n let trailArgs = null;\n return (...args) => {\n if (tid) {\n trailArgs = args;\n return;\n }\n tid = setTimeout(() => {\n tid = void 0;\n if (!trailing) return;\n const cbArgs = trailArgs;\n trailArgs = null;\n cbArgs && cbArgs !== args && handleCallback(...cbArgs);\n }, delay);\n handleCallback(...args);\n };\n};\nthrottle.defaults = {\n onError: void 0,\n trailing: false\n};\nvar throttled = throttle;\nvar throttle_default = throttle;\n\n// src/deferred/deferred.ts\nvar deferred = (callback, delay = 50, options = {}) => options.throttle ? throttle_default(callback, delay, options) : debounce_default(callback, delay, options);\n\n// src/iterable/filter.ts\nvar filter = (data, predicate, limit, asMap, result) => {\n var _a;\n if (!isMap(result)) result = /* @__PURE__ */ new Map();\n if (!isPositiveInteger(limit)) limit = Infinity;\n for (const [key, item] of ((_a = data == null ? void 0 : data.entries) == null ? void 0 : _a.call(data)) || []) {\n if (result.size >= limit) break;\n fallbackIfFails_default(predicate != null ? predicate : item, [item, key, data], false) && result.set(key, item);\n }\n return asMap ? result : [...result.values()];\n};\nvar filter_default = filter;\n\n// src/iterable/getSize.ts\nvar getSize = (x) => {\n if (!x) return 0;\n try {\n const s = \"size\" in x ? x.size : \"length\" in x ? x.length : 0;\n return isNumber(s) ? s : 0;\n } catch (_) {\n return 0;\n }\n};\nvar getSize_default = getSize;\n\n// src/iterable/getValues.ts\nvar getValues = (data) => {\n var _a;\n return [\n ...((_a = data == null ? void 0 : data.values) == null ? void 0 : _a.call(data)) || []\n ];\n};\nvar getValues_default = getValues;\n\n// src/iterable/search.ts\nvar search = (data, options) => {\n var _a;\n const ignore = !getSize_default(data) || isEmpty(options == null ? void 0 : options.query);\n const result = isMap(options == null ? void 0 : options.result) ? options.result : /* @__PURE__ */ new Map();\n const asMap = (_a = options == null ? void 0 : options.asMap) != null ? _a : search.defaults.asMap;\n if (ignore) return asMap ? result : getValues_default(result);\n options = objCopy(\n search.defaults,\n options,\n [],\n \"empty\"\n // override `option` property with default value when \"empty\" (undefined, null, '',....)\n );\n const {\n ignoreCase,\n limit = Infinity,\n matchAll,\n matchExact,\n ranked\n } = options;\n let { query } = options;\n const qIsStr = isStr(query);\n const qIsRegExp = isRegExp(query);\n const qKeys = fallbackIfFails_default(Object.keys, [query], []);\n if (ignoreCase && !matchExact && !qIsRegExp) {\n query = qIsStr ? query.toLowerCase() : objCreate(\n qKeys,\n Object.values(query).map(\n (x) => isRegExp(x) ? x : `${x}`.toLowerCase()\n )\n );\n }\n options.query = query;\n if (!ranked) {\n for (const [dataKey, dataValue] of data.entries()) {\n if (result.size >= limit) break;\n const matched = qIsStr || qIsRegExp ? (\n // global search across all properties\n matchObjOrProp(options, dataValue, void 0) >= 0\n ) : (\n // field-specific search\n qKeys[matchAll ? \"every\" : \"some\"](\n (key) => matchObjOrProp(options, dataValue, key) >= 0\n )\n );\n if (!matched) continue;\n result.set(dataKey, dataValue);\n }\n } else {\n const preRankedResults = [];\n for (const [dataKey, dataValue] of data.entries()) {\n let matchIndex = -1;\n if (qIsStr || qIsRegExp) {\n matchIndex = matchObjOrProp(options, dataValue, void 0);\n matchIndex >= 0 && preRankedResults.push([matchIndex, dataKey, dataValue]);\n continue;\n }\n const indexes = [];\n const match = qKeys[matchAll ? \"every\" : \"some\"](\n // field-specific search\n (key) => {\n const index = matchObjOrProp(options, dataValue, key);\n indexes.push(index);\n return index >= 0;\n }\n );\n if (!match) continue;\n matchIndex = // eslint-disable-next-line @typescript-eslint/prefer-find\n indexes.sort((a, b) => a - b).filter((n) => n !== -1)[0];\n matchIndex >= 0 && preRankedResults.push([matchIndex, dataKey, dataValue]);\n }\n preRankedResults.sort((a, b) => a[0] - b[0]).slice(0, limit).forEach(([_, key, value]) => result.set(key, value));\n }\n return asMap ? result : getValues_default(result);\n};\nsearch.defaults = {\n asMap: true,\n ignoreCase: true,\n limit: Infinity,\n matchAll: false,\n ranked: false,\n transform: true\n};\nfunction matchObjOrProp({\n query,\n ignoreCase,\n matchExact,\n transform = true\n}, item, propertyName) {\n var _a, _b;\n const global = isStr(query) || isRegExp(query) || propertyName === void 0;\n const keyword = global ? query : query[propertyName];\n const propVal = global || !isObj(item) ? item : item[propertyName];\n const value = fallbackIfFails_default(\n () => isFn(transform) ? transform(\n item,\n global ? void 0 : propVal,\n propertyName\n ) : matchExact && transform === false ? propVal : isObj(propVal, false) ? JSON.stringify(\n isArrLike(propVal) ? [...propVal.values()] : Object.values(propVal)\n ) : String(propVal != null ? propVal : \"\"),\n [],\n \"\"\n );\n if (value === keyword) return 0;\n if (matchExact && !isRegExp(keyword)) return -1;\n let valueStr = String(value);\n if (!valueStr.trim()) return -1;\n if (isRegExp(keyword)) return (_b = (_a = valueStr.match(keyword)) == null ? void 0 : _a.index) != null ? _b : -1;\n if (ignoreCase) valueStr = valueStr.toLowerCase();\n return valueStr.indexOf(String(keyword));\n}\nvar search_default = search;\n\n// src/iterable/find.ts\nfunction find(data, optsOrCb) {\n const result = isFn(optsOrCb) ? filter_default(data, optsOrCb, 1) : search_default(data, { ...optsOrCb, asMap: true, limit: 1 });\n return result[\n (optsOrCb == null ? void 0 : optsOrCb.includeKey) ? \"entries\" : \"values\"\n // returns: value\n ]().next().value;\n}\n\n// src/iterable/getEntries.ts\nvar getEntries = (map) => {\n var _a;\n return [\n ...((_a = map == null ? void 0 : map.entries) == null ? void 0 : _a.call(map)) || []\n ];\n};\n\n// src/iterable/getKeys.ts\nvar getKeys = (data) => {\n var _a;\n return [\n ...((_a = data == null ? void 0 : data.keys) == null ? void 0 : _a.call(data)) || []\n ];\n};\n\n// src/iterable/reverse.ts\nvar reverse = (data, reverse2 = true, newInstance = false) => {\n var _a, _b, _c;\n const dataType = isArr(data) ? 1 : isMap(data) ? 2 : isSet(data) ? 3 : 0;\n if (!dataType) return [];\n const arr = dataType === 1 ? !newInstance ? data : [...data] : dataType === 2 ? [...data.entries()] : [...data.values()];\n if (reverse2) arr.reverse();\n switch (dataType) {\n case 1:\n return arr;\n case 2:\n case 3:\n if (newInstance || !(\"clear\" in data && isFn(data.clear)))\n return dataType === 2 ? new Map(arr) : new Set(arr);\n }\n (_a = data == null ? void 0 : data.clear) == null ? void 0 : _a.call(data);\n for (const item of arr)\n \"set\" in data ? (_b = data.set) == null ? void 0 : _b.call(data, ...item) : \"add\" in data && ((_c = data == null ? void 0 : data.add) == null ? void 0 : _c.call(data, item));\n return data;\n};\n\n// src/iterable/sliceMap.ts\nvar sliceMap = (data, options) => {\n var _a;\n const {\n asMap = false,\n end,\n start = 0,\n transform,\n ignoreEmpty = true\n } = isFn(options) ? { transform: options } : isObj(options) ? options : {};\n const result = /* @__PURE__ */ new Map();\n const subset = [...((_a = data == null ? void 0 : data.entries) == null ? void 0 : _a.call(data)) || []].slice(start, end);\n for (const [_, [key, value]] of subset.entries()) {\n if (ignoreEmpty && isEmpty(value)) continue;\n const newValue = fallbackIfFails_default(\n transform != null ? transform : value,\n [value, key, data],\n void 0\n );\n newValue !== void 0 && result.set(key, newValue);\n }\n return asMap ? result : [...result.values()];\n};\n\n// src/iterable/sort.ts\nfunction sort(data, keyOrFn, options) {\n const dataType = isArr(data) ? 1 : isMap(data) ? 2 : isSet(data) ? 3 : 0;\n if (!dataType) return data;\n const { asString, ignoreCase, newInstance, reverse: reverse2, undefinedFirst } = {\n ...sort.defaults,\n ...isObj(options) ? options : isObj(keyOrFn) ? keyOrFn : {}\n };\n if (dataType === 1 && isFn(keyOrFn)) {\n return arrReverse(\n data.sort(keyOrFn),\n // use provided comparator function\n reverse2,\n newInstance\n );\n }\n const alt = asString ? undefinedFirst ? \"\" : \"Z\".repeat(10) : undefinedFirst ? -Infinity : Infinity;\n const sorted = isFn(keyOrFn) ? arrReverse(\n // handle Set with comparator function\n [...data.entries()].sort(keyOrFn),\n reverse2,\n false\n // not required because of entries() & spread\n ) : (() => {\n let index = 1;\n const getVal = (target) => {\n const val = isObj(target) && index !== 0 ? target[keyOrFn] : target;\n if (!asString) return val;\n const value = `${val != null ? val : alt}`;\n return ignoreCase ? value.toLowerCase() : value;\n };\n const [gt, lt] = reverse2 ? [-1, 1] : [1, -1];\n if ([1, 3].includes(dataType)) {\n return (dataType === 3 || newInstance ? [...data] : data).sort((a, b) => getVal(a) > getVal(b) ? gt : lt);\n }\n index = keyOrFn === true ? 0 : 1;\n return [...data.entries()].sort(\n (a, b) => getVal(a == null ? void 0 : a[index]) > getVal(b == null ? void 0 : b[index]) ? gt : lt\n );\n })();\n if (dataType === 1) return sorted;\n if (newInstance) {\n return dataType === 2 ? new Map(sorted) : new Set(sorted);\n }\n ;\n data.clear();\n for (const entry of sorted)\n dataType === 2 ? data.set(...entry) : data.add(entry);\n return data;\n}\nsort.defaults = {\n asString: true,\n ignoreCase: true,\n newInstance: false,\n reverse: false,\n undefinedFirst: false\n};\n\n// src/map/mapJoin.ts\nvar mapJoin = (...inputs) => {\n var _a;\n return new Map(\n (_a = inputs == null ? void 0 : inputs.flatMap) == null ? void 0 : _a.call(\n inputs,\n (input) => isMap(input) ? Array.from(input.entries()) : isArr2D(input) ? input : []\n )\n );\n};\n\n// src/number/randomInt.ts\nvar randomInt = (min = 0, max = Number.MAX_SAFE_INTEGER) => parseInt(`${Math.random() * (max - min) + min}`);\n\n// src/str/clearClutter.ts\nvar clearClutter = (text, lineSeparator = \" \") => `${text}`.split(\"\\n\").map((ln) => ln.trim()).filter(Boolean).join(lineSeparator);\n\n// src/str/copyToClipboard.ts\nvar copyToClipboard = (str) => fallbackIfFails(\n // First attempt: modern clipboard API\n () => navigator.clipboard.writeText(str).then(() => 1),\n [],\n // If clipboard API is not available or fails, use the fallback method\n () => Promise.resolve(copyLegacy(str) ? 2 : 0)\n);\nvar copyLegacy = (str) => fallbackIfFails(\n () => {\n const el = document.createElement(\"textarea\");\n el.value = str;\n el.setAttribute(\"readonly\", \"\");\n el.style.position = \"absolute\";\n el.style.left = \"-9999px\";\n document.body.appendChild(el);\n el.select();\n const success = document.execCommand(\"copy\");\n document.body.removeChild(el);\n return success;\n },\n [],\n false\n // On error, return false\n);\n\n// src/str/getUrlParam.ts\nvar getUrlParam = (name, url, asArray) => {\n var _a;\n url != null ? url : url = fallbackIfFails_default(() => window.location.href, [], \"\");\n const _asArray = isArr(asArray) ? asArray : asArray === true && isStr(name) ? [name] : [];\n const prepareResult = (value = \"\", values = {}) => name ? isArr(value) || !_asArray.includes(name) ? value : [value].filter(Boolean) : values;\n if (!url) return prepareResult();\n if (typeof URLSearchParams === \"undefined\" || !URLSearchParams) {\n const r = getUrlParamRegex(name, url, _asArray);\n return prepareResult(r, r);\n }\n const search2 = isUrl(url) ? url.search : ((_a = url.split(\"?\")) == null ? void 0 : _a[1]) || \"\";\n if (search2 === \"?\" || !search2) return prepareResult();\n const params = new URLSearchParams(search2);\n const getValue = (paramName) => {\n const value = arrUnique(params.getAll(paramName));\n return value.length > 1 || _asArray.includes(paramName) ? value : value[0];\n };\n if (name) return prepareResult(getValue(name));\n const result = {};\n for (const name2 of arrUnique([...params.keys()])) {\n result[name2] = getValue(name2);\n }\n return result;\n};\nvar getUrlParamRegex = (name, url, asArray = []) => {\n url != null ? url : url = fallbackIfFails_default(() => window.location.href, [], \"\");\n if (isUrl(url)) url = url.toString();\n const params = {};\n const regex = /[?&]+([^=&]+)=([^&]*)/gi;\n url == null ? void 0 : url.replace(regex, (_, name2, value) => {\n value = decodeURIComponent(value);\n if (asArray.includes(name2) || params[name2] !== void 0) {\n params[name2] = isArr(params[name2]) ? params[name2] : [params[name2]];\n params[name2] = arrUnique([...params[name2], value]).filter(Boolean);\n } else {\n params[name2] = value;\n }\n return \"\";\n });\n return name ? params[name] : params;\n};\n\n// src/str/regex.ts\nvar EMAIL_REGEX = new RegExp(\n /^((\"[\\w-\\s]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w-\\s]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,9}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)/i\n);\nvar HEX_REGEX = /^0x[0-9a-f]+$/i;\nvar HASH_REGEX = /^0x[0-9a-f]{64}$/i;\n\n// src/str/strToArr.ts\nvar strToArr = (value, seperator = \",\") => typeof value === \"string\" && value.split(seperator).filter(Boolean) || [];\nexport {\n EMAIL_REGEX,\n HASH_REGEX,\n HEX_REGEX,\n ReadOnlyArrayHelper,\n arrReadOnly,\n arrReverse,\n arrToMap,\n arrUnique,\n clearClutter,\n copyToClipboard,\n curry,\n debounce,\n deferred,\n fallbackIfFails,\n filter,\n find,\n getEntries,\n getKeys,\n getSize,\n getUrlParam,\n getValues,\n is,\n isArr,\n isArr2D,\n isArrLike,\n isArrLikeSafe,\n isArrObj,\n isArrUnique,\n isAsyncFn,\n isBool,\n isDate,\n isDateValid,\n isDefined,\n isEmpty,\n isEmptySafe,\n isEnvBrowser,\n isEnvBun,\n isEnvDeno,\n isEnvMobile,\n isEnvNode,\n isEnvTouchable,\n isError,\n isFn,\n isInteger,\n isMap,\n isMapObj,\n isNegativeInteger,\n isNegativeNumber,\n isNumber,\n isObj,\n isPositiveInteger,\n isPositiveNumber,\n isPromise,\n isRegExp,\n isSet,\n isStr,\n isSubjectLike,\n isSymbol,\n isUint8Arr,\n isUrl,\n isUrlValid,\n mapJoin,\n matchObjOrProp,\n noop,\n noopAsync,\n objClean,\n objCopy,\n objCreate,\n objHasKeys,\n objKeys,\n objReadOnly,\n objSetProp,\n objSetPropUndefined,\n objSort,\n objToMap,\n objWithoutKeys,\n randomInt,\n reverse,\n search,\n sliceMap,\n sort,\n strToArr,\n throttle,\n throttled,\n toDatetimeLocal\n};\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n","/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass<T>(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n","import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n","/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove<T>(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n */\nexport class Subscription implements SubscriptionLike {\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude<TeardownLogic, void>[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude<TeardownLogic, void>): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n","import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification<any>, subscriber: Subscriber<any>) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: PromiseConstructorLike;\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n","import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n","/* tslint:disable:no-empty */\nexport function noop() { }\n","import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n */\nexport class Subscriber<T> extends Subscription implements Observer<T> {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T> {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber<any> | Observer<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber<any> | Observer<any>) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param value The `next` value.\n */\n next(value: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value!);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param err The `error` exception.\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind<Fn extends (...args: any[]) => any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver<T> implements Observer<T> {\n constructor(private partialObserver: Partial<Observer<T>>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber<T> extends Subscriber<T> {\n constructor(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial<Observer<T>>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as ((value: T) => void) | undefined,\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent.\n * @param subscriber The stopped subscriber.\n */\nfunction handleStoppedNotification(notification: ObservableNotification<any>, subscriber: Subscriber<any>) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly<Observer<any>> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n","/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n","/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `<T>(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity<T>(x: T): T {\n return x;\n}\n","import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\nexport function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>;\nexport function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>;\nexport function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>;\nexport function pipe<T, A, B, C, D>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>\n): UnaryFunction<T, D>;\nexport function pipe<T, A, B, C, D, E>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>\n): UnaryFunction<T, E>;\nexport function pipe<T, A, B, C, D, E, F>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>\n): UnaryFunction<T, F>;\nexport function pipe<T, A, B, C, D, E, F, G>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>\n): UnaryFunction<T, G>;\nexport function pipe<T, A, B, C, D, E, F, G, H>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>\n): UnaryFunction<T, H>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>\n): UnaryFunction<T, I>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>,\n ...fns: UnaryFunction<any, any>[]\n): UnaryFunction<T, unknown>;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \n */\nexport function pipe(...fns: Array<UnaryFunction<any, any>>): UnaryFunction<any, any> {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R> {\n if (fns.length === 0) {\n return identity as UnaryFunction<any, any>;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction<T, R>) => fn(prev), input as any);\n };\n}\n","import { Operator } from './Operator';\nimport { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n */\nexport class Observable<T> implements Subscribable<T> {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable<any> | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator<any, T> | undefined;\n\n /**\n * @param subscribe The function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new Observable by calling the Observable constructor\n * @param subscribe the subscriber function to be passed to the Observable constructor\n * @return A new observable.\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {\n return new Observable<T>(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @param operator the operator defining the operation to take on the observable\n * @return A new observable with the Operator applied.\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\n */\n lift<R>(operator?: Operator<T, R>): Observable<R> {\n const observable = new Observable<R>();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * <span class=\"informal\">Use it when you have all these Observables, but still nothing is happening.</span>\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * });\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 'unsubscribed!' after 2.5s\n * ```\n *\n * @param observerOrNext Either an {@link Observer} with some or all callback methods,\n * or the `next` handler that is called for each value emitted from the subscribed Observable.\n * @param error A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param complete A handler for a terminal event resulting from successful completion.\n * @return A subscription reference to the registered handlers.\n */\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber<T>): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next A handler for each value emitted by the observable.\n * @return A promise that either resolves on observable completion or\n * rejects with the handled error.\n */\n forEach(next: (value: T) => void): Promise<void>;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor<void>((resolve, reject) => {\n const subscriber = new SafeSubscriber<T>({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise<void>;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<any>): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @return This instance of the observable.\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable<T>;\n pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;\n pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;\n pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;\n pipe<A, B, C, D>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>\n ): Observable<D>;\n pipe<A, B, C, D, E>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>\n ): Observable<E>;\n pipe<A, B, C, D, E, F>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>\n ): Observable<F>;\n pipe<A, B, C, D, E, F, G>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>\n ): Observable<G>;\n pipe<A, B, C, D, E, F, G, H>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>\n ): Observable<H>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>\n ): Observable<I>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>,\n ...operations: OperatorFunction<any, any>[]\n ): Observable<unknown>;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x));\n * ```\n *\n * @return The Observable result of all the operators having been called\n * in the order they were passed in.\n */\n pipe(...operations: OperatorFunction<any, any>[]): Observable<any> {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise<T | undefined> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise<T | undefined>;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver<T>(value: any): value is Observer<T> {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber<T>(value: any): value is Subscriber<T> {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n","import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\nimport { isFunction } from './isFunction';\n\n/**\n * Used to determine if an object is an Observable with a lift function.\n */\nexport function hasLift(source: any): source is { lift: InstanceType<typeof Observable>['lift'] } {\n return isFunction(source?.lift);\n}\n\n/**\n * Creates an `OperatorFunction`. Used to define operators throughout the library in a concise way.\n * @param init The logic to connect the liftedSource to the subscriber at the moment of subscription.\n */\nexport function operate<T, R>(\n init: (liftedSource: Observable<T>, subscriber: Subscriber<R>) => (() => void) | void\n): OperatorFunction<T, R> {\n return (source: Observable<T>) => {\n if (hasLift(source)) {\n return source.lift(function (this: Subscriber<R>, liftedSource: Observable<T>) {\n try {\n return init(liftedSource, this);\n } catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n","import { Subscriber } from '../Subscriber';\n\n/**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional teardown logic here. This will only be called on teardown if the\n * subscriber itself is not already closed. This is called after all other teardown logic is executed.\n */\nexport function createOperatorSubscriber<T>(\n destination: Subscriber<any>,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n onFinalize?: () => void\n): Subscriber<T> {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\n\n/**\n * A generic helper for allowing operators to be created with a Subscriber and\n * use closures to capture necessary state from the operator function itself.\n */\nexport class OperatorSubscriber<T> extends Subscriber<T> {\n /**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional finalization logic here. This will only be called on finalization if the\n * subscriber itself is not already closed. This is called after all other finalization logic is executed.\n * @param shouldUnsubscribe An optional check to see if an unsubscribe call should truly unsubscribe.\n * NOTE: This currently **ONLY** exists to support the strange behavior of {@link groupBy}, where unsubscription\n * to the resulting observable does not actually disconnect from the source if there are active subscriptions\n * to any grouped observable. (DO NOT EXPOSE OR USE EXTERNALLY!!!)\n */\n constructor(\n destination: Subscriber<any>,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n private onFinalize?: () => void,\n private shouldUnsubscribe?: () => boolean\n ) {\n // It's important - for performance reasons - that all of this class's\n // members are initialized and that they are always initialized in the same\n // order. This will ensure that all OperatorSubscriber instances have the\n // same hidden class in V8. This, in turn, will help keep the number of\n // hidden classes involved in property accesses within the base class as\n // low as possible. If the number of hidden classes involved exceeds four,\n // the property accesses will become megamorphic and performance penalties\n // will be incurred - i.e. inline caches won't be used.\n //\n // The reasons for ensuring all instances have the same hidden class are\n // further discussed in this blog post from Benedikt Meurer:\n // https://benediktmeurer.de/2018/03/23/impact-of-polymorphism-on-component-based-frameworks-like-react/\n super(destination);\n this._next = onNext\n ? function (this: OperatorSubscriber<T>, value: T) {\n try {\n onNext(value);\n } catch (err) {\n destination.error(err);\n }\n }\n : super._next;\n this._error = onError\n ? function (this: OperatorSubscriber<T>, err: any) {\n try {\n onError(err);\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._error;\n this._complete = onComplete\n ? function (this: OperatorSubscriber<T>) {\n try {\n onComplete();\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._complete;\n }\n\n unsubscribe() {\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const { closed } = this;\n super.unsubscribe();\n // Execute additional teardown if we have any and we didn't already do so.\n !closed && this.onFinalize?.();\n }\n }\n}\n","import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n","import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n */\nexport class Subject<T> extends Observable<T> implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer<T>[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer<T>[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {\n return new AnonymousSubject<T>(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber<T>): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber<any>) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber<any>) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return Observable that this Subject casts to.\n */\n asObservable(): Observable<T> {\n const observable: any = new Observable<T>();\n observable.source = this;\n return observable;\n }\n}\n\nexport class AnonymousSubject<T> extends Subject<T> {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer<T>,\n source?: Observable<T>\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n","import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n */\nexport class BehaviorSubject<T> extends Subject<T> {\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n\n getValue(): T {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n\n next(value: T): void {\n super.next((this._value = value));\n }\n}\n","import { OperatorFunction, MonoTypeOperatorFunction, TruthyTypesOf } from '../types';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\n\n/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */\nexport function filter<T, S extends T, A>(predicate: (this: A, value: T, index: number) => value is S, thisArg: A): OperatorFunction<T, S>;\nexport function filter<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;\nexport function filter<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;\n/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */\nexport function filter<T, A>(predicate: (this: A, value: T, index: number) => boolean, thisArg: A): MonoTypeOperatorFunction<T>;\nexport function filter<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T>;\n\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * <span class=\"informal\">Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.</span>\n *\n * \n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * ## Example\n *\n * Emit only click events whose target was a DIV element\n *\n * ```ts\n * import { fromEvent, filter } from 'rxjs';\n *\n * const div = document.createElement('div');\n * div.style.cssText = 'width: 200px; height: 200px; background: #09c;';\n * document.body.appendChild(div);\n *\n * const clicks = fromEvent(document, 'click');\n * const clicksOnDivs = clicks.pipe(filter(ev => (<HTMLElement>ev.target).tagName === 'DIV'));\n * clicksOnDivs.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param thisArg An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return A function that returns an Observable that emits items from the\n * source Observable that satisfy the specified `predicate`.\n */\nexport function filter<T>(predicate: (value: T, index: number) => boolean, thisArg?: any): MonoTypeOperatorFunction<T> {\n return operate((source, subscriber) => {\n // An index passed to our predicate function on each call.\n let index = 0;\n\n // Subscribe to the source, all errors and completions are\n // forwarded to the consumer.\n source.subscribe(\n // Call the predicate with the appropriate `this` context,\n // if the predicate returns `true`, then send the value\n // to the consumer.\n createOperatorSubscriber(subscriber, (value) => predicate.call(thisArg, value, index++) && subscriber.next(value))\n );\n });\n}\n","import { MonoTypeOperatorFunction } from '../types';\nimport { filter } from './filter';\n\n/**\n * Returns an Observable that skips the first `count` items emitted by the source Observable.\n *\n * \n *\n * Skips the values until the sent notifications are equal or less than provided skip count. It raises\n * an error if skip count is equal or more than the actual number of emits and source raises an error.\n *\n * ## Example\n *\n * Skip the values before the emission\n *\n * ```ts\n * import { interval, skip } from 'rxjs';\n *\n * // emit every half second\n * const source = interval(500);\n * // skip the first 10 emitted values\n * const result = source.pipe(skip(10));\n *\n * result.subscribe(value => console.log(value));\n * // output: 10...11...12...13...\n * ```\n *\n * @see {@link last}\n * @see {@link skipWhile}\n * @see {@link skipUntil}\n * @see {@link skipLast}\n *\n * @param count The number of times, items emitted by source Observable should be skipped.\n * @return A function that returns an Observable that skips the first `count`\n * values emitted by the source Observable.\n */\nexport function skip<T>(count: number): MonoTypeOperatorFunction<T> {\n return filter((_, index) => count <= index);\n}\n","import {\n\tDebounceOptions,\n\tDropFirst,\n\tsearch,\n\tsort,\n\tSortOptions,\n\tThrottleOptions,\n} from '@superutils/core'\n\n/**\n * Represents the minimal subset of the `Storage` interface required for persistence.\n *\n * Any object implementing this type can be used as a storage engine, making the Store\n * compatible with `localStorage`, `sessionStorage`, or custom file-based implementations.\n */\nexport type StorageCompact = Pick<Storage, 'getItem' | 'setItem'>\n\n/**\n * Configuration for the timing strategy used when writing data to persistent storage.\n */\nexport type Store_DelayOptions =\n\t| ({\n\t\t\tthrottle: true\n\t } & Omit<ThrottleOptions, 'onError' | 'thisArg'>)\n\t| ({\n\t\t\tthrottle?: false\n\t } & Omit<DebounceOptions, 'onError' | 'thisArg'>)\n\n/**\n * Categorizes errors encountered during Store operations.\n *\n * These types are passed to the `onError` callback to help identify which phase of the\n * data lifecycle (reading, writing, or processing) failed.\n */\nexport enum Store_OnErrorType {\n\t/** Occurs when the user-provided `onChange` callback throws an exception. */\n\tonChange = 'onChange',\n\t/** Occurs when the user-provided `parse` function fails to process the raw storage string. */\n\tparse = 'parse',\n\t/**\n\t * Occurs when the default `JSON.parse` fallback fails.\n\t * This usually happens if the data in the underlying storage is corrupted or not valid JSON.\n\t */\n\tparse_json = 'parse-json',\n\t/** Occurs when the user-provided `stringify` function fails to serialize the data Map. */\n\tstringify = 'stringify',\n\t/**\n\t * Occurs when the default `JSON.stringify` fallback fails.\n\t * This may happen if the Map contains circular references or other non-serializable values.\n\t */\n\tstringify_json = 'stringify-json',\n\t/** Occurs when the attempt to save data to the underlying storage (e.g., `localStorage.setItem`) fails. */\n\twrite = 'write',\n}\n\n/**\n * Function signature for custom data deserialization.\n *\n * @param text The raw string retrieved from the underlying storage.\n * @returns The parsed data structure (usually a Map) or `void` to trigger fallback behavior.\n */\nexport type Store_Parse<ResultMap, ThisArg> = (\n\tthis: ThisArg,\n\ttext: string | null | undefined,\n) => ResultMap | void\n\n/**\n * Function signature for the internal search utility.\n *\n * @template K - The type of keys.\n * @template V - The type of values.\n * @template MatchExact - Whether to perform exact matching.\n * @template AsMap - Whether to return results as a Map.\n */\nexport type Store_Search<\n\tK,\n\tV,\n\tMatchExact extends boolean = false,\n\tAsMap extends boolean = true,\n> = (\n\t...args: DropFirst<Parameters<typeof search<K, V, MatchExact, AsMap>>>\n) => ReturnType<typeof search<K, V, MatchExact, AsMap>>\n\n/**\n * Function Signature for the sort utility, supporting multiple sorting strategies:\n * 1. By a custom comparator function.\n * 2. By a specific property name (for object-like values).\n * 3. By the map keys.\n *\n * @template K - The type of keys.\n * @template V - The type of values.\n */\nexport type Store_Sort<K, V> = (\n\t...args:\n\t\t| Store_SortByComparator<K, V>\n\t\t| Store_SortByPropertyName<V>\n\t\t| Store_SortByKey\n) => Map<K, V>\nexport type Store_SortByComparator<K, V> = [\n\tcomparator: Parameters<typeof sort<K, V>>[1],\n\toptions?: Store_SortOptions,\n]\nexport type Store_SortByKey = [byKey: true, options?: Store_SortOptions]\nexport type Store_SortByPropertyName<V> = [\n\tpropertyName: keyof V & string,\n\toptions?: Store_SortOptions,\n]\n\n/** Configuration options for sorting, including whether to persist the result. */\nexport type Store_SortOptions = SortOptions & { save?: boolean }\n\n/**\n * Function signature for custom data serialization.\n *\n * @param data The current data structure to be serialized.\n * @returns A string representation of the data, or `void/undefined` to trigger fallback behavior.\n */\nexport type Store_Stringify<Data, ThisArg> = (\n\tthis: ThisArg,\n\tdata: Data,\n) => string | undefined | void\n\n/**\n * Function signature for exporting the store content as a JSON string.\n *\n * @param replacer - A function or array that transforms the results.\n * @param spacing - Indentation or whitespace formatting.\n * @param data - The specific Map to stringify (defaults to all entries).\n *\n * @template K - The type of keys.\n * @template V - The type of values.\n */\nexport type Store_ToJSON<K, V> = (\n\treplacer?: null | ((key: K, value: V) => unknown),\n\tspacing?: string | number,\n\tdata?: Map<K, V>,\n) => string\n","import {\n\tdeferred,\n\ttype EntryComparator,\n\tfallbackIfFails,\n\tfilter,\n\tfind,\n\tgetEntries,\n\tgetKeys,\n\tgetValues,\n\tisArr,\n\tisArr2D,\n\tisDefined,\n\tisFn,\n\tisMap,\n\tisPositiveNumber,\n\tisStr,\n\tmapJoin,\n\tsearch,\n\tsort,\n} from '@superutils/core'\nimport { BehaviorSubject, skip, Subject, Subscription } from 'rxjs'\nimport { type IStore, Store_OnErrorType, type Store_Options } from './types'\n\n/**\n * RxJS Subject to trigger forced update of cached data from underlying storage of {@link Store} instances.\n *\n * Accepted values:\n * - `string`: Updates the cache for the instance with the matching name.\n * - `string[]`: Updates the cache for all instances whose names are included in the array.\n * - `true`: Triggers a global cache update for all instances that have a `name` defined.\n * - `false`: No-op.\n *\n * @example\n * ```javascript\n * import { Store, forceUpdateCache$ } from '@superutils/store'\n *\n * const names = ['products', 'users']\n *\n * // Update all Store instances by a list of their names\n * forceUpdateCache$.next(names)\n * // alternatively: Store.forceUpdateCache(names)\n *\n * // Update all Store instances with a specific name\n * forceUpdateCache$.next(names[0])\n * // alternatively: Store.forceUpdateCache(names[0])\n *\n * // Update every single instance of Store that uses storage (has a \"name\" property)\n * forceUpdateCache$(true)\n * // alternatively: Store.forceUpdateCache(true)\n * ```\n *\n * @example\n *\n * #### Practical example\n * ```typescript\n * import { createStore, forceUpdateCache$ } from '@superutils/store'\n *\n * const name = 'user-profile'\n * const delay = 0 // delay is set to zero to simplify the example\n *\n * const userStore = createStore(name, { delay })\n * const userStore2 = createStore(name, { delay })\n *\n * userStore.init()\n * userStore2.init()\n *\n * userStore.set('name', 'John Doe')\n * console.log(userStore2.get('name')) // Prints: undefined\n *\n * forceUpdateCache$.next(name)\n * console.log(userStore2.get('name')) // Prints: 'John Doe'\n * ```\n */\nexport const forceUpdateCache$ = new Subject<string | string[] | boolean>()\n\n/**\n * A generic, reactive data storage class that provides a Map-like interface with advanced features\n * such as search, filtering, and sorting. Supports both in-memory caching and persistent storage\n * (LocalStorage in browsers, JSON files in NodeJS via `node-localstorage` NPM module).\n *\n * #### Notes:\n * - **Performance**: `Store` is optimized for small to medium datasets.\n * - For datasets > 1MB, consider increasing the `delay` option to reduce write frequency.\n * - It is **NOT** recommended for datasets larger than 3MB due to synchronous serialization costs.\n * - For one-off operations or standalone scripts, data size is constrained only by available system memory\n * and processing power.\n * - **RxJS Integration**: Built on RxJS for reactive data handling, though no prior RxJS knowledge is required.\n * - **Storage Behavior**:\n * - If `name` is omitted, the instance operates in-memory only and data is not persisted to storage.\n * - If `cacheDisabled` is `true`, data is not kept in memory; every read/write operation accesses the underlying\n * storage directly.\n *\n * @template Key The type of keys stored in the map.\n * @template Value The type of values stored in the map.\n * @template CacheDisabled A literal boolean type indicating whether in-memory caching is disabled.\n * @template This A self-referential interface type extending {@link IStore} used for accurate\n * method signature inference and type-safe property access. This allows method implementations to\n * reference their return types and other method signatures through the interface definition.\n *\n * @see {@link forceUpdateCache$} for cache invalidation across instances.\n *\n * @example\n * #### Browser Usage 1: use like a map\n * ```javascript\n * import { Store } from '@superutils/store'\n *\n * const userStore = new Store('users')\n * userStore.set(1, { name: 'Alice', age: 30 })\n * const user = userStore.get(1)\n * console.log(user) // prints: {name: 'Alice', age: 30}\n * ```\n *\n * @example\n * #### Browser Usage 2:\n * ```javascript\n * import { Store } from '@superutils/store'\n * import fetch from '@superutils/fetch'\n *\n * const { products } = await fetch.get('[DUMMYJSON-DOT-COM]/products')\n * const storage = new Store('products', {\n * initialValue: new Map(products.map(p => [p.id, p])) // convert to Map\n * })\n *\n * // print product with id `1`\n * console.log(storage.get(1))\n *\n * // search for items\n * const searchResult = storage.search({\n * query: { availabilityStatus: 'low' }\n * })\n * console.log(searchResult)\n * ```\n * @example\n * #### NodeJS Usage\n * ```javascript\n * import { Store } from '@superutils/store'\n * import fetch from '@superutils/fetch'\n * import { LocalStorage } from 'node-localstorage'\n *\n * // Add localStorage alternative for NodeJS that reads and writes to JSON files.\n * // This is not necessary for browsers.\n * globalThis.localStorage = new LocalStorage('./data', 1e7)\n *\n * const storage = new Store('products')\n * const { products } = await fetch.get('[DUMMYJSON-DOT-COM]/products')\n * // save all items to storage\n * storage.setAll(\n * new Map(products.map(p => [p.id, p])), // convert to Map\n * )\n *\n * // print product with id `1`\n * console.log(storage.get(1))\n *\n * // search for items\n * const searchResult = storage.search({\n * query: { availabilityStatus: 'low' }\n * })\n * console.log(searchResult)\n * ```\n *\n * @example\n * #### Advanced: `onChange` and RxJS subject\n *\n * Internally, `Store` uses RxJS subject which is exposed as `subject$` property.\n * You can use this to subscribe to changes and do additional operations such as logging or sanitization etc.\n *\n * Alternatively, you can also set the `onChange` callback which is triggered whenever the subject changes and\n * does not require maintaining a subscription or knowledge of RxJS subject.\n *\n * ```javascript\n * import { Store } from '@superutils/store'\n *\n * const storage = new Store('my-data')\n * const sub = storage.subject$.subscribe(data => {\n * // Write to the database whenever data changes\n * console.log('Saving to database...', data)\n * })\n * // unsubscribe from subject\n * setTimeout(()=> sub.unsubscribe(), 1000)\n *\n * // add an entry to storage\n * storage.set('bob', { age: 99, id: 'bob', name: 'Bob' })\n * ```\n */\nexport class Store<\n\tKey,\n\tValue,\n\tCacheDisabled extends boolean = false,\n\t/**\n\t * @remarks\n\t * **On the `This` template parameter:**\n\t * Using `This` as a self-referential template is a **good practice** in this context because:\n\t * - It provides accurate **type inference** for method return types that depend on the generic parameters.\n\t * - It enables **type-safe property access** through `This['methodName']`, allowing the implementation\n\t * to reference interface contracts without circular dependencies or casting issues.\n\t * - It allows **fluent API chains** (returning `this`) while maintaining proper generic type information.\n\t * - It prevents **type widening** that would occur if methods returned the concrete class type instead\n\t * of the interface type, which is important for generic constraints and polymorphism.\n\t *\n\t * However, it increases **cognitive complexity** and is only warranted when:\n\t * - The class implements a complex generic interface with interdependent type parameters.\n\t * - Type-safe property references are essential to avoid runtime errors or casting.\n\t * - Fluent interfaces or chaining is a core API feature.\n\t */\n\tThis extends IStore<Key, Value, CacheDisabled> = IStore<\n\t\tKey,\n\t\tValue,\n\t\tCacheDisabled\n\t>,\n> implements IStore<Key, Value, CacheDisabled> {\n\treadonly cacheDisabled: This['cacheDisabled']\n\n\treadonly delay: This['delay']\n\n\t/** Debounce and throttle related options */\n\treadonly delayOptions?: This['delayOptions']\n\n\treadonly initialized: This['initialized'] = false\n\n\treadonly name: This['name']\n\n\tonChange?: This['onChange']\n\n\tonError?: This['onError']\n\n\tparse?: This['parse']\n\n\tget size() {\n\t\treturn this.getAll().size\n\t}\n\n\tspaces?: This['spaces']\n\n\treadonly storage?: This['storage']\n\n\tstringify?: This['stringify']\n\n\treadonly subject$!: This['subject$']\n\n\tprivate subscriptions = {\n\t\tsubject: undefined as Subscription | undefined,\n\t\tforceUpdateCache: undefined as Subscription | undefined,\n\t}\n\n\ttype: This['type'] = 'map'\n\n\tvalidate?: This['validate']\n\n\tconstructor(\n\t\tname?: This['name'],\n\t\toptions?: Store_Options<Key, Value, CacheDisabled> | null,\n\t) {\n\t\tthis.name = `${name ?? options?.name ?? ''}`.trim() || null\n\t\tconst {\n\t\t\tcacheDisabled = false as CacheDisabled,\n\t\t\tdelay,\n\t\t\tdelayOptions,\n\t\t\tinitialValue,\n\t\t\tonError,\n\t\t\tonChange,\n\t\t\tparse,\n\t\t\tspaces,\n\t\t\tstorage = fallbackIfFails(\n\t\t\t\t() => (!this.name ? undefined : globalThis.localStorage),\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t),\n\t\t\tstringify,\n\t\t\tvalidate = {},\n\t\t} = options ?? {}\n\t\tif (this.name && !storage && storage !== null)\n\t\t\tthrow new Error(Store.messages.invalidStorageOptions)\n\n\t\tthis.cacheDisabled = (!!storage && cacheDisabled) as CacheDisabled\n\t\tthis.delay = delay === 0 || isPositiveNumber(delay) ? delay : 300\n\t\tthis.delayOptions = delayOptions\n\t\tthis.onError = onError\n\t\tthis.onChange = onChange\n\t\tthis.parse = parse?.bind(this)\n\t\tthis.spaces = spaces\n\t\tthis.storage = storage as This['storage']\n\t\tthis.stringify = stringify?.bind(this)\n\t\tthis.subject$ = (\n\t\t\tthis.cacheDisabled ? new Subject() : new BehaviorSubject(new Map())\n\t\t) as This['subject$']\n\n\t\tconst _validate = { ...validate } as Record<PropertyKey, unknown>\n\t\tfor (const [key, value] of Object.entries(_validate)) {\n\t\t\t_validate[key] = value\n\t\t}\n\t\tthis.validate = _validate\n\n\t\t// non-empty map provided - initiate the storage immediately\n\t\tisMap(initialValue)\n\t\t\t&& initialValue.size\n\t\t\t&& (this.init as (...args: unknown[]) => void)(initialValue, false)\n\t}\n\n\tclear: This['clear'] = () => {\n\t\tthis.validate?.clear?.call(this, [], 'clear')\n\t\treturn this.setAll(new Map<Key, Value>(), true)\n\t}\n\n\tdelete: This['delete'] = keys => {\n\t\tif (!isArr(keys)) keys = [keys]\n\n\t\tthis.validate?.delete?.call(this, [keys], 'delete')\n\n\t\tconst data = this.getAll()\n\t\tfor (const k of keys) data.delete(k)\n\n\t\tthis.setAll(data, true)\n\t\treturn this\n\t}\n\n\tstatic messages = Object.seal({\n\t\tinvalidJsonEntries:\n\t\t\t'Invalid JSON format. Parsed value must be a 2D array representing key-value pairs.',\n\t\tinvalidStorageOptions:\n\t\t\t'options.storage: LocalStorage instance or equivalent required. For NodeJS, use `node-localstorage` NPM module.',\n\t\tvalidationError: 'Validation failed. Action: ',\n\t})\n\n\tfilter: This['filter'] = (...args) => filter(this.getAll(), ...args)\n\n\tfind: This['find'] = predicateOrOptions =>\n\t\tfind(this.getAll(), predicateOrOptions as Parameters<typeof find>[0])\n\n\t/**\n\t * Trigger forced update of cached data from storage.\n\t *\n\t * @param name determines which cache-enabled storage instances to be updated.\n\t * - name (`string` | `string[]`): update all instances with a specific name(s)\n\t * - global (`true`): update all instances globally\n\t *\n\t * See {@link forceUpdateCache$} for more details.\n\t */\n\tstatic forceUpdateCache = (name: string | string[] | true) => {\n\t\tforceUpdateCache$.next(name)\n\t}\n\n\tget: This['get'] = key => this.getAll().get(key)\n\n\tgetAll: This['getAll'] = (forceRead = false) => {\n\t\tconst wasInitialized = this.initialized\n\t\tif (!wasInitialized) this.init()\n\n\t\tconst readFromStorage =\n\t\t\tthis.cacheDisabled || (this.storage && forceRead)\n\t\tif (readFromStorage) {\n\t\t\tconst data = this.read()\n\t\t\tconst shouldTrigger = forceRead || (!wasInitialized && !!data.size)\n\t\t\tshouldTrigger && this.subject$.next(data)\n\t\t\treturn data\n\t\t}\n\n\t\treturn (this.subject$ as BehaviorSubject<Map<Key, Value>>).value\n\t}\n\n\tprivate handleForceUpdateCache = (name: string | string[] | boolean) => {\n\t\tconst isTarget = !this.name\n\t\t\t? false\n\t\t\t: isArr(name)\n\t\t\t\t? name.includes(this.name)\n\t\t\t\t: isStr(name)\n\t\t\t\t\t? name === this.name\n\t\t\t\t\t: name === true\n\t\tif (!isTarget) return\n\n\t\tconst newData = this.read()\n\t\tthis.subject$.next(newData)\n\t}\n\n\tprivate handleSubjectChange = (data: Map<Key, Value>) => {\n\t\t// in-case non-map value is set, reset subject to an empty map\n\t\tif (!isMap(data)) return this.subject$.next(new Map())\n\n\t\t// write quietly\n\t\tfallbackIfFails(\n\t\t\tthis.write,\n\t\t\t[data],\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.write),\n\t\t)\n\n\t\tfallbackIfFails(\n\t\t\tthis.onChange?.bind(this) as unknown,\n\t\t\t[data],\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.onChange),\n\t\t)\n\t}\n\n\thas: This['has'] = key => this.getAll().has(key)\n\n\tinit: This['init'] = (initialValue, checkStorage = true) => {\n\t\tif (this.initialized) return false\n\n\t\tif (this.name && checkStorage) {\n\t\t\tObject.defineProperty(this, 'storage', {\n\t\t\t\tvalue: fallbackIfFails(\n\t\t\t\t\t() => this.storage ?? globalThis.localStorage,\n\t\t\t\t\t[],\n\t\t\t\t\tundefined,\n\t\t\t\t),\n\t\t\t})\n\t\t\tif (!this.storage)\n\t\t\t\tthrow new Error(Store.messages.invalidStorageOptions)\n\t\t}\n\n\t\tObject.defineProperty(this, 'initialized', { value: true })\n\n\t\tlet firstValue = initialValue\n\t\tif (!!initialValue?.size || !this.cacheDisabled) {\n\t\t\tconst dataStr = this.name ? this.storage?.getItem(this.name) : null\n\t\t\tconst existingValue = this.read(dataStr ?? null)\n\n\t\t\t// If the entry exists in storage (even if it is empty), prioritize it over initialValue.\n\t\t\t// This prevents defaults from overwriting an intentionally cleared storage.\n\t\t\tif (isDefined(dataStr)) firstValue = existingValue\n\t\t}\n\n\t\tfirstValue?.size && this.subject$.next(firstValue)\n\n\t\tthis.unsubscribe()\n\t\t// update cached data from localStorage throughout the application only when triggered\n\t\tif (!this.cacheDisabled) {\n\t\t\tthis.subscriptions.forceUpdateCache = forceUpdateCache$.subscribe(\n\t\t\t\tthis.handleForceUpdateCache,\n\t\t\t)\n\t\t}\n\n\t\tconst skipNum =\n\t\t\tthis.subject$ instanceof BehaviorSubject\n\t\t\t&& firstValue?.size\n\t\t\t&& firstValue !== initialValue\n\t\t\t\t? 1\n\t\t\t\t: 0\n\t\t// Subscribe to data changes and write to storage.\n\t\tthis.subscriptions.subject = this.subject$\n\t\t\t.pipe(skip(skipNum))\n\t\t\t.subscribe(\n\t\t\t\t!this.cacheDisabled && this.delay > 0\n\t\t\t\t\t? deferred(this.handleSubjectChange, this.delay, {\n\t\t\t\t\t\t\tthisArg: this,\n\t\t\t\t\t\t\t...this.delayOptions,\n\t\t\t\t\t\t})\n\t\t\t\t\t: this.handleSubjectChange,\n\t\t\t)\n\n\t\treturn true\n\t}\n\n\tkeys: This['keys'] = () => getKeys(this.getAll())\n\n\tmap: This['map'] = callback =>\n\t\tthis.toArray().map(([key, value], index, entries) =>\n\t\t\tcallback(value, key, entries, index),\n\t\t)\n\n\tread: This['read'] = (\n\t\tdataStr = (this.name && this.storage?.getItem(this.name)) ?? null,\n\t) => {\n\t\tconst data = fallbackIfFails(\n\t\t\tthis.parse,\n\t\t\t[dataStr],\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.parse, undefined),\n\t\t)\n\n\t\tif (isMap(data) || !isStr(dataStr))\n\t\t\treturn (\n\t\t\t\t(isFn(this.parse)\n\t\t\t\t\t? data\n\t\t\t\t\t: (this.subject$ as BehaviorSubject<Map<Key, Value>>).value)\n\t\t\t\t?? new Map<Key, Value>()\n\t\t\t)\n\t\t// use fallback JSON.parse if this.parse is not provided, returns non-Map value or fails\n\t\treturn new Map<Key, Value>(\n\t\t\tfallbackIfFails(\n\t\t\t\t() => {\n\t\t\t\t\tconst entries = JSON.parse(dataStr) as [Key, Value][]\n\n\t\t\t\t\tif (!isArr2D(entries))\n\t\t\t\t\t\tthrow new Error(Store.messages.invalidJsonEntries)\n\n\t\t\t\t\treturn entries\n\t\t\t\t},\n\t\t\t\t[],\n\t\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.parse_json),\n\t\t\t),\n\t\t)\n\t}\n\n\tsearch: This['search'] = (...args) => search(this.getAll(), ...args)\n\n\tset: This['set'] = (key, value) => {\n\t\tconst data = this.getAll()\n\n\t\tconst _value = isFn(value) ? value(data.get(key)) : value\n\t\tthis.validate?.set?.call(this, [key, _value], 'set')\n\t\tdata.set(key, _value)\n\n\t\treturn this.setAll(data, true)\n\t}\n\n\tsetAll: This['setAll'] = (data, replace = false) => {\n\t\tif (!isMap(data)) return this\n\n\t\tthis.validate?.setAll?.call(this, [data, replace], 'setAll')\n\n\t\tdata = replace\n\t\t\t? data // override all entries\n\t\t\t: mapJoin(this.getAll(), data) // merge with existing entries and override only matching keys\n\t\tthis.subject$.next(new Map(data))\n\t\treturn this\n\t}\n\n\tsort: This['sort'] = (...args) => {\n\t\tconst result = sort(\n\t\t\tthis.getAll(),\n\t\t\targs[0] as EntryComparator<Key, Value>,\n\t\t\targs[1],\n\t\t)\n\t\targs[1]?.save && this.setAll(result, true)\n\n\t\treturn result\n\t}\n\n\ttoArray: This['toArray'] = () => getEntries(this.getAll())\n\n\ttoJSON: This['toJSON'] = (\n\t\treplacer,\n\t\tspacing = this.spaces,\n\t\tdata = this.getAll(),\n\t) => {\n\t\tconst str = fallbackIfFails(\n\t\t\tthis.stringify as unknown as string,\n\t\t\t[data],\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.stringify, ''), // if fails return empty string\n\t\t)\n\t\tif (isStr(str)) return str\n\n\t\t// use fallback JSON.stringify if this.stringify returns non-string value (undefined)\n\t\treturn fallbackIfFails(\n\t\t\t() =>\n\t\t\t\tJSON.stringify(\n\t\t\t\t\tArray.from(data),\n\t\t\t\t\treplacer as undefined,\n\t\t\t\t\tspacing,\n\t\t\t\t),\n\t\t\t[],\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.stringify_json, ''),\n\t\t)\n\t}\n\n\ttoObject: This['toObject'] = <T>(data = this.getAll()) => {\n\t\tconst obj = {} as T\n\t\tif (!isMap(data)) return obj\n\n\t\tfor (const [key, value] of data)\n\t\t\tobj[key as unknown as keyof T] = value as T[keyof T]\n\n\t\treturn obj\n\t}\n\n\ttoString: This['toString'] = (data = this.getAll()) =>\n\t\tthis.toJSON(undefined, undefined, data)\n\n\tprivate triggerOnErrorCb =\n\t\t<T = undefined>(\n\t\t\ttype: Store_OnErrorType,\n\t\t\treturnValue: T = undefined as T,\n\t\t) =>\n\t\t(err: unknown) => {\n\t\t\tfallbackIfFails(\n\t\t\t\tthis.onError?.bind(this) as unknown,\n\t\t\t\t[err, type],\n\t\t\t\t'',\n\t\t\t)\n\n\t\t\treturn returnValue\n\t\t}\n\n\tunsubscribe: This['unsubscribe'] = () => {\n\t\tthis.subscriptions.forceUpdateCache?.unsubscribe()\n\t\tthis.subscriptions.subject?.unsubscribe()\n\t\tthis.subscriptions = {\n\t\t\tforceUpdateCache: undefined,\n\t\t\tsubject: undefined,\n\t\t}\n\t}\n\n\tvalues: This['values'] = () => getValues(this.getAll())\n\n\twrite: This['write'] = data => {\n\t\tthis.init()\n\t\tdata ??= (this.subject$ as BehaviorSubject<Map<Key, Value>>)?.value\n\t\tif (!isMap(data) || !this.name || !this.storage) return false\n\n\t\tthis.validate?.write?.call(this, [data], 'write')\n\t\ttry {\n\t\t\tconst jsonStr = this.toString(data)\n\t\t\tthis.storage.setItem(this.name, jsonStr)\n\n\t\t\treturn true\n\t\t} catch (err) {\n\t\t\tthis.triggerOnErrorCb(Store_OnErrorType.write)(err)\n\t\t\treturn false\n\t\t}\n\t}\n}\nexport default Store\n","import { isFn, isObj } from '@superutils/core'\nimport Store from './Store'\nimport { Store_Options, ContextValidate, IStore, ContextReturn } from './types'\n\nconst isStoreKey = <S extends object>(store: S, key: unknown) =>\n\tOPTIONAL_STORE_PROPS.includes(key as (typeof OPTIONAL_STORE_PROPS)[number])\n\t|| store[key as keyof S] !== undefined\n\n/**\n * Store property names that are optional/user-provided and should not be allowed in context.\n *\n * This is used to avoid optional store properties being overriden by context properties\n */\nexport const OPTIONAL_STORE_PROPS = [\n\t'delayOptions',\n\t'name',\n\t'onChange',\n\t'onError',\n\t'parse',\n\t'spaces',\n\t'storage',\n\t'stringify',\n\t'validate',\n] as const\n\n/**\n * Factory function to create a {@link Store} instance with optional business logic augmented into the store instance.\n *\n * This function provides a convenient way to instantiate a store and attach supplemental\n * logic (context) to it. It supports full type inference for both the store's data\n * and the attached context.\n *\n * @param options - (optional) Configuration options for the store.\n * @param context - (optional) A plain object or a factory function that returns an object.\n * If function provided, it is executed only once during instantiation.\n *\n * **Purpose:**\n * Use `context` to encapsulate domain-specific business logic, helper methods, or non-reactive state\n * directly into the store instance.\n *\n * **Behavior:**\n * - **Non-Reactive:** Updates to context properties do **not** trigger `onChange` or RxJS emissions.\n * - **Non-Persistent:** Context data is purely in-memory and is **not** saved to persistent storage.\n * - **Access to Store:** When a factory function is used, it receives the store instance as an argument.\n * - **Notes**:\n * - Built-in store properties are not allowed\n * - Augmented methods' \"thisArg\" will be the context as per default JavaScript behavior.\n * - Custom class instances are supported as context. Built-in {@link Store} properties take precedence\n * in the event of a naming conflict.\n *\n * @template Key - The type of keys stored in the map.\n * @template Value - The type of values stored in the map.\n * @template CacheDisabled - Whether store data caching is disabled.\n * @template Context - The type of the context object or factory function.\n *\n * @returns A {@link Store} instance with augmented properties (if any).\n *\n * @example\n * #### Basic usage\n * ```javascript\n * import { createStore } from '@superutils/store'\n *\n * const store = createStore({ initialValue: new Map([['count', 0]])})\n * store.set('count', 1)\n * store.set('count', prevCount => prevCount + 1)\n * console.log(store.get('count')) // 2\n * ```\n *\n * @example\n * #### Store augmented with custom business logic\n * ```javascript\n * import { createStore } from '@superutils/store'\n *\n * const store = createStore({ name: 'user-settings'}, {\n * count: 0,\n * log(msg) {\n * console.log(`[${++this.count}] ${msg}`)\n * }\n * })\n *\n * store.log('Settings updated')\n * console.log(store.count)\n * ```\n *\n * @example\n * #### In-memory store\n * ```javascript\n * import fetch from '@superutils/fetch'\n * import { createStore } from '@superutils/store'\n *\n * // Bypass the name property to create an in-memory store\n * const store = createStore()\n *\n * // This will NOT save the data to localStorage\n * store.set('key', 'value')\n * ```\n *\n * @example\n * #### Store with a functional context\n * ```javascript\n * import { createStore } from '@superutils/store'\n *\n * const authStore = createStore(null, store => ({\n * isAuthenticated: () => store.has('token'),\n * logout: () => {\n * store.delete('token')\n * console.log('logged out')\n * }\n * }))\n *\n * if (authStore.isAuthenticated()) {\n * authStore.logout()\n * }\n * ```\n *\n * @example\n * #### Augmenting with a custom class instance\n *\n * ```typescript\n * import { createStore } from '@superutils/store'\n *\n * class MyCustomClass {\n * private _count = 0\n * get count() {\n * return this._count\n * }\n * increment = () => this._count++\n * decrement() {\n * return --this._count\n * }\n * }\n *\n * const store = createStore(null, new MyCustomClass())\n * console.log(\n * store.count, // 0\n * store.increment(),// function\n * store.count,\t // 1\n * store.decrement(), // undefined\n * )\n *```\n */\nexport function createStore<\n\tContext extends\n\t\t| object\n\t\t| ((store: IStore<Key, Value, CacheDisabled>) => object),\n\tKey,\n\tValue,\n\tCacheDisabled extends boolean = false,\n>(\n\toptions: undefined | null | Store_Options<Key, Value, CacheDisabled>,\n\tcontext: Context\n\t\t& ContextValidate<Context, IStore<Key, Value, CacheDisabled>>,\n): IStore<Key, Value, CacheDisabled> & ContextReturn<Context>\n\n// without context\nexport function createStore<Key, Value, CacheDisabled extends boolean = false>(\n\toptions?: Store_Options<Key, Value, CacheDisabled>,\n): IStore<Key, Value, CacheDisabled>\n\nexport function createStore<Context, Key, Value, CacheDisabled extends boolean>(\n\toptions?: null | Store_Options<Key, Value, CacheDisabled>,\n\tcontext?: Context,\n) {\n\tconst store = new Store(options?.name, options)\n\tconst _context = isFn(context) ? (context(store) as object) : context\n\n\tif (!isObj(_context, false)) return store\n\n\treturn new Proxy(store, {\n\t\tget: (store, key, receiver) =>\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\tReflect.get(\n\t\t\t\tisStoreKey(store, key) ? store : _context,\n\t\t\t\tkey,\n\t\t\t\treceiver,\n\t\t\t),\n\t\tset: (store, key, value, receiver) =>\n\t\t\tReflect.set(\n\t\t\t\tisStoreKey(store, key) ? store : _context,\n\t\t\t\tkey,\n\t\t\t\tvalue,\n\t\t\t\treceiver,\n\t\t\t),\n\t})\n}\nexport default createStore\n","import { objToMap, isObj, isMap } from '@superutils/core'\nimport createStore from './createStore'\nimport type {\n\tIObjectStore,\n\tObjectStore_Options,\n\tContextReturn,\n\tContextValidate,\n} from './types'\n\n/**\n * Creates a {@link IObjectStore} instance initialized from a plain object.\n *\n * This factory method automatically configures `parse` and `stringify` logic to\n * treat the underlying storage as a serialized object, while providing a\n * type-safe Map-like interface for individual properties.\n *\n * This default behavior can be overridden by providing custom `parse` and `stringify` implementations in `options`.\n *\n * @param options (optional) Configuration options for the storage instance. See {@link ObjectStore_Options} for more.\n * @param options.initialValue (optional) An optional object to populate the storage if it's currently empty.\n * @param options.name (optional) locaStorage key (or JSON filename in NodeJS) for persistence storage.\n * @param context - (optional) A plain object or a factory function that returns an object.\n *\n * **Purpose:**\n * Use `context` to encapsulate domain-specific business logic, helper methods, or non-reactive state\n * directly into the store instance.\n *\n * **Behavior:** See {@link createStore}.\n *\n * @template T (optional) The structure of the object being stored. Can auto-infer from `options.initialValue`.\n * @template CacheDisabled - Whether store data caching is disabled.\n * @template Context - The type of the context object or factory function.\n *\n * @returns A new Store instance mapped to the object's keys and values.\n *\n * @example\n * #### Basic property-based access\n *\n * ```javascript\n * import { createObjectStore } from '@superutils/store'\n *\n * const userStore = createObjectStore('user', {\n * initialValue: {\n * age: 99,\n * name: 'Ninety Nine'\n * }\n * })\n *\n * // Keys are strictly inferred from the interface\n * const name = userStore.get('name') // Type: string | undefined\n * console.log(name) // Prints: 'Ninety Nine'\n *\n * // Update properties with type safety\n * userStore.set('age', 100) // Only numbers are accepted for 'age'\n *\n * // Export the underlying data back to a plain object\n * const user = userStore.toObject()\n * console.log(user) // { age: 100, name: 'Ninety Nine' }\n * ```\n *\n * @example\n * #### Usage with context\n *\n * ```javascript\n * import { createObjectStore } from '@superutils/store'\n *\n * const getContext = store => ({\n * isAdmin: () => !!store.get('roles')?.includes('admin'),\n * promoteToAdmin() {\n * if (this.isAdmin()) return\n *\n * // Use functional updates to safely modify the roles array\n * store.set('roles', (prev = []) => [...prev, 'admin'])\n * }\n * }\n * // Functional context allows you to attach business logic directly to the store\n * const userStore = createObjectStore(\n * 'user',\n * {\n * initialValue: {\n * age: 25,\n * name: 'Jane Doe',\n * roles: ['guest']\n * },\n * },\n * getContext\n * )\n *\n * // Logic is encapsulated and easy to invoke\n * userStore.promoteToAdmin()\n * console.log(userStore.get('roles')) // ['guest', 'admin']\n * ```\n *\n */\nexport function createObjectStore<\n\tContext extends\n\t\t| object\n\t\t| ((store: IObjectStore<T, CacheDisabled>) => object),\n\tT extends object = Record<string, unknown>,\n\tCacheDisabled extends boolean = false,\n>(\n\toptions: undefined | null | ObjectStore_Options<T, CacheDisabled>,\n\tcontext: Context & ContextValidate<Context, IObjectStore<T, CacheDisabled>>,\n): IObjectStore<T, CacheDisabled> & ContextReturn<Context>\n\n// Without context\nexport function createObjectStore<\n\tT extends object = Record<string, unknown>,\n\tCacheDisabled extends boolean = false,\n>(\n\toptions?: ObjectStore_Options<T, CacheDisabled>,\n): IObjectStore<T, CacheDisabled>\n\nexport function createObjectStore<\n\tContext,\n\tT extends object,\n\tCacheDisabled extends boolean,\n>(options?: null | ObjectStore_Options<T, CacheDisabled>, context?: Context) {\n\toptions = {\n\t\t// only required for persistent store and can be overriden by options\n\t\t...(options?.name && {\n\t\t\tparse: str => objToMap(JSON.parse(str ?? '{}') as T),\n\t\t\tstringify(data) {\n\t\t\t\treturn JSON.stringify(this.toObject(data))\n\t\t\t},\n\t\t}),\n\t\t...options,\n\t\tinitialValue: !isObj(options?.initialValue, true)\n\t\t\t? options?.initialValue\n\t\t\t: objToMap(options.initialValue),\n\t} as ObjectStore_Options<T, CacheDisabled>\n\n\tconst store = createStore(\n\t\t...([options, context] as unknown as Parameters<typeof createStore>),\n\t) as unknown as IObjectStore<T, CacheDisabled>\n\n\tstore.type = 'object'\n\n\tconst setAll = store.setAll.bind(store)\n\tstore.setAll = (obj, replace) => {\n\t\tif (obj && !isMap(obj)) obj = objToMap(obj)\n\n\t\treturn setAll(obj, replace)\n\t}\n\n\tstore.toMap = data => (!data ? store.getAll() : objToMap(data))\n\n\treturn store\n}\nexport default createObjectStore\n","export * from './createObjectStore'\nexport * from './createStore'\nexport * from './Store'\nexport * from './types'\nimport Store from './Store'\n\nexport { objToMap, type TypedMap } from '@superutils/core'\nexport default Store\n"]}
|