tiny-essentials 1.28.19 → 1.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/changelog/1/28/19.md +24 -0
- package/changelog/1/29/0.md +58 -0
- package/changelog/1/29/1.md +11 -0
- package/dist/v1/ColorSafeStringify.min.js +1 -1
- package/dist/v1/TinyAdvancedRaffle.min.js +1 -1
- package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
- package/dist/v1/TinyAnalogClock.min.js +1 -1
- package/dist/v1/TinyArrayComparator.min.js +1 -1
- package/dist/v1/TinyArrayPaginator.min.js +1 -1
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyBrowserMonitor.min.js +1 -0
- package/dist/v1/TinyClassManager.min.js +1 -1
- package/dist/v1/TinyClipboard.min.js +1 -1
- package/dist/v1/TinyCloner.min.js +1 -0
- package/dist/v1/TinyColorConverter.min.js +1 -1
- package/dist/v1/TinyColorValidator.min.js +1 -1
- package/dist/v1/TinyCookieConsent.min.js +1 -1
- package/dist/v1/TinyDayNightCycle.min.js +1 -1
- package/dist/v1/TinyDebugger.min.js +1 -1
- package/dist/v1/TinyDomReadyManager.min.js +1 -1
- package/dist/v1/TinyDragDropDetector.min.js +1 -1
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyElementObserver.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyGamepad.min.js +1 -1
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinyHtmlTagRegexBuilder.min.js +1 -0
- package/dist/v1/TinyHttpResponseRegistry.min.js +1 -0
- package/dist/v1/TinyI18.min.js +1 -1
- package/dist/v1/TinyIframeEvents.min.js +1 -1
- package/dist/v1/TinyInventory.min.js +1 -1
- package/dist/v1/TinyInventoryTrader.min.js +1 -1
- package/dist/v1/TinyLevelUp.min.js +1 -1
- package/dist/v1/TinyLoadingScreen.min.js +1 -1
- package/dist/v1/TinyLocalStorage.min.js +1 -1
- package/dist/v1/TinyMaInSys.min.js +1 -1
- package/dist/v1/TinyMapCache.min.js +1 -0
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyNeedBar.min.js +1 -1
- package/dist/v1/TinyNewWinEvents.min.js +1 -1
- package/dist/v1/TinyNotificationAdapter.min.js +1 -0
- package/dist/v1/TinyNotifications.min.js +1 -1
- package/dist/v1/TinyNotifyCenter.min.js +1 -1
- package/dist/v1/TinyOPFSFileSystem.min.js +1 -0
- package/dist/v1/TinyPasswordValidator.min.js +1 -0
- package/dist/v1/TinyPluginPackage.min.js +1 -0
- package/dist/v1/TinyPromiseQueue.min.js +1 -1
- package/dist/v1/TinyPushManager.min.js +1 -0
- package/dist/v1/TinyPushPayload.min.js +1 -0
- package/dist/v1/TinyPushRouter.min.js +1 -0
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/TinyRateLimiter.min.js +1 -1
- package/dist/v1/TinyRegexEs.min.js +1 -0
- package/dist/v1/TinyRouter.min.js +1 -0
- package/dist/v1/TinyServiceWorker.min.js +1 -0
- package/dist/v1/TinyServiceWorkerEngine.min.js +1 -0
- package/dist/v1/TinySetMapPackage.min.js +1 -0
- package/dist/v1/TinySimpleDice.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyStorageBucketFileSystem.min.js +1 -0
- package/dist/v1/TinyTextDiffer.min.js +1 -1
- package/dist/v1/TinyTextRangeEditor.min.js +1 -1
- package/dist/v1/TinyTextarea.min.js +1 -1
- package/dist/v1/TinyThrottledApi.min.js +1 -0
- package/dist/v1/TinyTimeout.min.js +1 -1
- package/dist/v1/TinyToastNotify.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/TinyUriParser.min.js +1 -0
- package/dist/v1/TinyVersion.min.js +1 -0
- package/dist/v1/TinyWebWorker.min.js +1 -0
- package/dist/v1/TinyWebWorkerEngine.min.js +1 -0
- package/dist/v1/UltraRandomMsgGen.min.js +1 -1
- package/dist/v1/basics/array.cjs +2 -2
- package/dist/v1/basics/array.d.mts +2 -0
- package/dist/v1/basics/array.d.mts.map +1 -1
- package/dist/v1/basics/array.mjs +2 -1
- package/dist/v1/basics/browserDetector.cjs +37 -12
- package/dist/v1/basics/browserDetector.d.mts +8 -0
- package/dist/v1/basics/browserDetector.d.mts.map +1 -1
- package/dist/v1/basics/browserDetector.mjs +32 -13
- package/dist/v1/basics/crypto.cjs +23 -0
- package/dist/v1/basics/crypto.d.mts +10 -0
- package/dist/v1/basics/crypto.d.mts.map +1 -0
- package/dist/v1/basics/crypto.mjs +18 -0
- package/dist/v1/basics/html.cjs +0 -3
- package/dist/v1/basics/html.d.mts.map +1 -1
- package/dist/v1/basics/html.mjs +0 -2
- package/dist/v1/basics/index.cjs +8 -1
- package/dist/v1/basics/index.d.mts +6 -5
- package/dist/v1/basics/index.d.mts.map +1 -1
- package/dist/v1/basics/index.mjs +6 -5
- package/dist/v1/basics/objChecker.cjs +88 -0
- package/dist/v1/basics/objChecker.d.mts +26 -0
- package/dist/v1/basics/objChecker.d.mts.map +1 -1
- package/dist/v1/basics/objChecker.mjs +74 -0
- package/dist/v1/basics/objFilter.cjs +234 -93
- package/dist/v1/basics/objFilter.d.mts +96 -22
- package/dist/v1/basics/objFilter.d.mts.map +1 -1
- package/dist/v1/basics/objFilter.mjs +216 -92
- package/dist/v1/basics/promiseUtils.cjs +48 -12
- package/dist/v1/basics/promiseUtils.d.mts +45 -12
- package/dist/v1/basics/promiseUtils.d.mts.map +1 -1
- package/dist/v1/basics/promiseUtils.mjs +47 -12
- package/dist/v1/basics/text.cjs +0 -12
- package/dist/v1/basics/text.d.mts +0 -10
- package/dist/v1/basics/text.d.mts.map +1 -1
- package/dist/v1/basics/text.mjs +0 -10
- package/dist/v1/index.cjs +88 -3
- package/dist/v1/index.d.mts +31 -6
- package/dist/v1/index.d.mts.map +1 -1
- package/dist/v1/index.mjs +32 -7
- package/dist/v1/jsdoc/EventEmitter.cjs +4 -0
- package/dist/v1/jsdoc/EventEmitter.d.mts +33 -0
- package/dist/v1/jsdoc/EventEmitter.d.mts.map +1 -0
- package/dist/v1/jsdoc/EventEmitter.mjs +18 -0
- package/dist/v1/libs/array/TinyArrayComparator.cjs +240 -25
- package/dist/v1/libs/array/TinyArrayComparator.d.mts +130 -22
- package/dist/v1/libs/array/TinyArrayComparator.d.mts.map +1 -1
- package/dist/v1/libs/array/TinyArrayComparator.mjs +210 -24
- package/dist/v1/libs/fs/constants.cjs +74 -0
- package/dist/v1/libs/fs/constants.d.mts +22 -0
- package/dist/v1/libs/fs/constants.d.mts.map +1 -0
- package/dist/v1/libs/fs/constants.mjs +53 -0
- package/dist/v1/libs/fs/encoding.cjs +118 -0
- package/dist/v1/libs/fs/encoding.d.mts +50 -0
- package/dist/v1/libs/fs/encoding.d.mts.map +1 -0
- package/dist/v1/libs/fs/encoding.mjs +102 -0
- package/dist/v1/libs/fs/error.cjs +188 -0
- package/dist/v1/libs/fs/error.d.mts +105 -0
- package/dist/v1/libs/fs/error.d.mts.map +1 -0
- package/dist/v1/libs/fs/error.mjs +158 -0
- package/dist/v1/libs/fs/handle.cjs +121 -0
- package/dist/v1/libs/fs/handle.d.mts +56 -0
- package/dist/v1/libs/fs/handle.d.mts.map +1 -0
- package/dist/v1/libs/fs/handle.mjs +100 -0
- package/dist/v1/libs/fs/index.cjs +700 -0
- package/dist/v1/libs/fs/index.d.mts +377 -0
- package/dist/v1/libs/fs/index.d.mts.map +1 -0
- package/dist/v1/libs/fs/index.mjs +630 -0
- package/dist/v1/libs/fs/path.cjs +234 -0
- package/dist/v1/libs/fs/path.d.mts +176 -0
- package/dist/v1/libs/fs/path.d.mts.map +1 -0
- package/dist/v1/libs/fs/path.mjs +197 -0
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.cjs +202 -0
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts +121 -0
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts.map +1 -0
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.mjs +172 -0
- package/dist/v1/libs/fs/plugins/OPFS/index.cjs +334 -0
- package/dist/v1/libs/fs/plugins/OPFS/index.d.mts +98 -0
- package/dist/v1/libs/fs/plugins/OPFS/index.d.mts.map +1 -0
- package/dist/v1/libs/fs/plugins/OPFS/index.mjs +300 -0
- package/dist/v1/libs/fs/stats.cjs +245 -0
- package/dist/v1/libs/fs/stats.d.mts +226 -0
- package/dist/v1/libs/fs/stats.d.mts.map +1 -0
- package/dist/v1/libs/fs/stats.mjs +197 -0
- package/dist/v1/libs/html/events/TinyIframeEvents.cjs +10 -1
- package/dist/v1/libs/html/events/TinyIframeEvents.d.mts +9 -2
- package/dist/v1/libs/html/events/TinyIframeEvents.d.mts.map +1 -1
- package/dist/v1/libs/html/events/TinyIframeEvents.mjs +8 -1
- package/dist/v1/libs/html/events/TinyNewWinEvents.cjs +14 -3
- package/dist/v1/libs/html/events/TinyNewWinEvents.d.mts +21 -5
- package/dist/v1/libs/html/events/TinyNewWinEvents.d.mts.map +1 -1
- package/dist/v1/libs/html/events/TinyNewWinEvents.mjs +12 -3
- package/dist/v1/libs/html/scroll/TinySmartScroller.cjs +13 -1
- package/dist/v1/libs/html/scroll/TinySmartScroller.d.mts +29 -2
- package/dist/v1/libs/html/scroll/TinySmartScroller.d.mts.map +1 -1
- package/dist/v1/libs/html/scroll/TinySmartScroller.mjs +11 -1
- package/dist/v1/libs/math/TinyAdvancedRaffle.cjs +13 -1
- package/dist/v1/libs/math/TinyAdvancedRaffle.d.mts +32 -2
- package/dist/v1/libs/math/TinyAdvancedRaffle.d.mts.map +1 -1
- package/dist/v1/libs/math/TinyAdvancedRaffle.mjs +11 -1
- package/dist/v1/libs/math/TinyTimeout.cjs +0 -14
- package/dist/v1/libs/math/TinyTimeout.d.mts +0 -11
- package/dist/v1/libs/math/TinyTimeout.d.mts.map +1 -1
- package/dist/v1/libs/math/TinyTimeout.mjs +0 -13
- package/dist/v1/libs/media/TinyMediaPlayer/index.cjs +25 -1
- package/dist/v1/libs/media/TinyMediaPlayer/index.d.mts +35 -2
- package/dist/v1/libs/media/TinyMediaPlayer/index.d.mts.map +1 -1
- package/dist/v1/libs/media/TinyMediaPlayer/index.mjs +23 -1
- package/dist/v1/libs/media/TinyMediaPlayer.cjs +2 -2
- package/dist/v1/libs/media/TinyMediaPlayer.d.mts +2 -2
- package/dist/v1/libs/media/TinyMediaPlayer.d.mts.map +1 -1
- package/dist/v1/libs/media/TinyMediaPlayer.mjs +2 -2
- package/dist/v1/libs/media/TinyRadioFm.cjs +19 -1
- package/dist/v1/libs/media/TinyRadioFm.d.mts +78 -2
- package/dist/v1/libs/media/TinyRadioFm.d.mts.map +1 -1
- package/dist/v1/libs/media/TinyRadioFm.mjs +17 -1
- package/dist/v1/libs/plugin/TinyPlugin.cjs +1630 -0
- package/dist/v1/libs/plugin/TinyPlugin.d.mts +753 -0
- package/dist/v1/libs/plugin/TinyPlugin.d.mts.map +1 -0
- package/dist/v1/libs/plugin/TinyPlugin.mjs +1376 -0
- package/dist/v1/libs/plugin/TinyVersion.cjs +204 -0
- package/dist/v1/libs/plugin/TinyVersion.d.mts +70 -0
- package/dist/v1/libs/plugin/TinyVersion.d.mts.map +1 -0
- package/dist/v1/libs/plugin/TinyVersion.mjs +179 -0
- package/dist/v1/libs/router/TinyRouter.cjs +661 -0
- package/dist/v1/libs/router/TinyRouter.d.mts +320 -0
- package/dist/v1/libs/router/TinyRouter.d.mts.map +1 -0
- package/dist/v1/libs/router/TinyRouter.mjs +572 -0
- package/dist/v1/libs/storage/TinyLocalStorage.cjs +20 -1
- package/dist/v1/libs/storage/TinyLocalStorage.d.mts +64 -2
- package/dist/v1/libs/storage/TinyLocalStorage.d.mts.map +1 -1
- package/dist/v1/libs/storage/TinyLocalStorage.mjs +18 -1
- package/dist/v1/libs/storage/TinyMapCache.cjs +373 -0
- package/dist/v1/libs/storage/TinyMapCache.d.mts +274 -0
- package/dist/v1/libs/storage/TinyMapCache.d.mts.map +1 -0
- package/dist/v1/libs/storage/TinyMapCache.mjs +333 -0
- package/dist/v1/libs/storage/TinySetMapDatabase.cjs +1167 -0
- package/dist/v1/libs/storage/TinySetMapDatabase.d.mts +603 -0
- package/dist/v1/libs/storage/TinySetMapDatabase.d.mts.map +1 -0
- package/dist/v1/libs/storage/TinySetMapDatabase.mjs +1059 -0
- package/dist/v1/libs/sw/browser/TinyNotificationAdapter.cjs +126 -0
- package/dist/v1/libs/sw/browser/TinyNotificationAdapter.d.mts +132 -0
- package/dist/v1/libs/sw/browser/TinyNotificationAdapter.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/TinyNotificationAdapter.mjs +109 -0
- package/dist/v1/libs/sw/browser/TinyPushManager.cjs +310 -0
- package/dist/v1/libs/sw/browser/TinyPushManager.d.mts +168 -0
- package/dist/v1/libs/sw/browser/TinyPushManager.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/TinyPushManager.mjs +264 -0
- package/dist/v1/libs/sw/browser/TinyServiceWorker.cjs +1060 -0
- package/dist/v1/libs/sw/browser/TinyServiceWorker.d.mts +348 -0
- package/dist/v1/libs/sw/browser/TinyServiceWorker.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/TinyServiceWorker.mjs +933 -0
- package/dist/v1/libs/sw/browser/plugins/TabManager.cjs +315 -0
- package/dist/v1/libs/sw/browser/plugins/TabManager.d.mts +178 -0
- package/dist/v1/libs/sw/browser/plugins/TabManager.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/plugins/TabManager.mjs +274 -0
- package/dist/v1/libs/sw/browser/utils.cjs +28 -0
- package/dist/v1/libs/sw/browser/utils.d.mts +8 -0
- package/dist/v1/libs/sw/browser/utils.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/utils.mjs +21 -0
- package/dist/v1/libs/sw/service/TinyPushRouter.cjs +222 -0
- package/dist/v1/libs/sw/service/TinyPushRouter.d.mts +138 -0
- package/dist/v1/libs/sw/service/TinyPushRouter.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/TinyPushRouter.mjs +201 -0
- package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.cjs +3016 -0
- package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.d.mts +993 -0
- package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.mjs +2558 -0
- package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.cjs +88 -0
- package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.d.mts +32 -0
- package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.mjs +69 -0
- package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.cjs +112 -0
- package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.d.mts +31 -0
- package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.mjs +91 -0
- package/dist/v1/libs/sw/service/plugins/Ping.cjs +32 -0
- package/dist/v1/libs/sw/service/plugins/Ping.d.mts +9 -0
- package/dist/v1/libs/sw/service/plugins/Ping.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/Ping.mjs +25 -0
- package/dist/v1/libs/sw/service/plugins/TabManager.cjs +457 -0
- package/dist/v1/libs/sw/service/plugins/TabManager.d.mts +91 -0
- package/dist/v1/libs/sw/service/plugins/TabManager.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/TabManager.mjs +372 -0
- package/dist/v1/libs/sw/service/plugins/ViteFileDetector.cjs +180 -0
- package/dist/v1/libs/sw/service/plugins/ViteFileDetector.d.mts +28 -0
- package/dist/v1/libs/sw/service/plugins/ViteFileDetector.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/ViteFileDetector.mjs +148 -0
- package/dist/v1/libs/sw/service/shared/TinyPushPayload.cjs +199 -0
- package/dist/v1/libs/sw/service/shared/TinyPushPayload.d.mts +80 -0
- package/dist/v1/libs/sw/service/shared/TinyPushPayload.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/shared/TinyPushPayload.mjs +174 -0
- package/dist/v1/libs/sw/utils.cjs +57 -0
- package/dist/v1/libs/sw/utils.d.mts +173 -0
- package/dist/v1/libs/sw/utils.d.mts.map +1 -0
- package/dist/v1/libs/sw/utils.mjs +50 -0
- package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.cjs +57 -0
- package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.d.mts +39 -0
- package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.d.mts.map +1 -0
- package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.mjs +48 -0
- package/dist/v1/libs/text/TinyI18/Browser.cjs +64 -0
- package/dist/v1/libs/text/TinyI18/Browser.d.mts +47 -0
- package/dist/v1/libs/text/TinyI18/Browser.d.mts.map +1 -0
- package/dist/v1/libs/text/TinyI18/Browser.mjs +57 -0
- package/dist/v1/libs/text/TinyI18/Node.cjs +49 -0
- package/dist/v1/libs/text/TinyI18/Node.d.mts +38 -0
- package/dist/v1/libs/text/TinyI18/Node.d.mts.map +1 -0
- package/dist/v1/libs/text/TinyI18/Node.mjs +43 -0
- package/dist/v1/libs/text/TinyI18/browser-utils.cjs +17 -0
- package/dist/v1/libs/text/TinyI18/browser-utils.d.mts +8 -0
- package/dist/v1/libs/text/TinyI18/browser-utils.d.mts.map +1 -0
- package/dist/v1/libs/text/TinyI18/browser-utils.mjs +13 -0
- package/dist/v1/libs/text/{TinyI18.cjs → TinyI18/index.cjs} +205 -104
- package/dist/v1/libs/text/{TinyI18.d.mts → TinyI18/index.d.mts} +141 -92
- package/dist/v1/libs/text/TinyI18/index.d.mts.map +1 -0
- package/dist/v1/libs/text/{TinyI18.mjs → TinyI18/index.mjs} +195 -101
- package/dist/v1/libs/tools/TinyBrowserMonitor.cjs +1088 -0
- package/dist/v1/libs/tools/TinyBrowserMonitor.d.mts +621 -0
- package/dist/v1/libs/tools/TinyBrowserMonitor.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyBrowserMonitor.mjs +940 -0
- package/dist/v1/libs/tools/TinyDebugger.cjs +180 -19
- package/dist/v1/libs/tools/TinyDebugger.d.mts +220 -24
- package/dist/v1/libs/tools/TinyDebugger.d.mts.map +1 -1
- package/dist/v1/libs/tools/TinyDebugger.mjs +161 -19
- package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.cjs +256 -0
- package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.d.mts +125 -0
- package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.mjs +223 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.cjs +23 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.d.mts +17 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.mjs +19 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.cjs +23 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.d.mts +17 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.mjs +19 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.cjs +390 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.d.mts +9 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.mjs +387 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.cjs +2 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.d.mts +27 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.mjs +12 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/LICENSE +53 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.cjs +405 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.d.mts +34 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.mjs +342 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.cjs +23 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.d.mts +17 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.mjs +19 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.cjs +327 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.d.mts +9 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.mjs +324 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.cjs +268 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.d.mts +107 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.mjs +238 -0
- package/dist/v1/libs/tools/TinyPasswordValidator.cjs +491 -0
- package/dist/v1/libs/tools/TinyPasswordValidator.d.mts +246 -0
- package/dist/v1/libs/tools/TinyPasswordValidator.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyPasswordValidator.mjs +434 -0
- package/dist/v1/libs/tools/TinyPkgExportValidator.cjs +48 -0
- package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts +14 -0
- package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts.map +1 -1
- package/dist/v1/libs/tools/TinyPkgExportValidator.mjs +44 -0
- package/dist/v1/libs/tools/TinySiteMap.cjs +1029 -0
- package/dist/v1/libs/tools/TinySiteMap.d.mts +429 -0
- package/dist/v1/libs/tools/TinySiteMap.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinySiteMap.mjs +910 -0
- package/dist/v1/libs/tools/TinySiteMapStream.cjs +121 -0
- package/dist/v1/libs/tools/TinySiteMapStream.d.mts +51 -0
- package/dist/v1/libs/tools/TinySiteMapStream.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinySiteMapStream.mjs +85 -0
- package/dist/v1/libs/tools/TinyURLSecurityVerifier.cjs +444 -0
- package/dist/v1/libs/tools/TinyURLSecurityVerifier.d.mts +217 -0
- package/dist/v1/libs/tools/TinyURLSecurityVerifier.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyURLSecurityVerifier.mjs +394 -0
- package/dist/v1/libs/tools/TinyUriParser/BlueSky.cjs +613 -0
- package/dist/v1/libs/tools/TinyUriParser/BlueSky.d.mts +152 -0
- package/dist/v1/libs/tools/TinyUriParser/BlueSky.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyUriParser/BlueSky.mjs +527 -0
- package/dist/v1/libs/tools/TinyUriParser/Discord.cjs +1119 -0
- package/dist/v1/libs/tools/TinyUriParser/Discord.d.mts +306 -0
- package/dist/v1/libs/tools/TinyUriParser/Discord.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyUriParser/Discord.mjs +968 -0
- package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.cjs +469 -0
- package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.d.mts +80 -0
- package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.mjs +379 -0
- package/dist/v1/libs/tools/TinyUriParser.cjs +217 -0
- package/dist/v1/libs/tools/TinyUriParser.d.mts +109 -0
- package/dist/v1/libs/tools/TinyUriParser.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyUriParser.mjs +183 -0
- package/dist/v1/libs/utils/TinyCloner.cjs +466 -0
- package/dist/v1/libs/utils/TinyCloner.d.mts +221 -0
- package/dist/v1/libs/utils/TinyCloner.d.mts.map +1 -0
- package/dist/v1/libs/utils/TinyCloner.mjs +416 -0
- package/dist/v1/libs/utils/TinyPromiseQueue.cjs +1 -1
- package/dist/v1/libs/utils/TinyPromiseQueue.d.mts +2 -2
- package/dist/v1/libs/utils/TinyPromiseQueue.d.mts.map +1 -1
- package/dist/v1/libs/utils/TinyPromiseQueue.mjs +1 -1
- package/dist/v1/libs/utils/TinyThrottledApi.cjs +333 -0
- package/dist/v1/libs/utils/TinyThrottledApi.d.mts +163 -0
- package/dist/v1/libs/utils/TinyThrottledApi.d.mts.map +1 -0
- package/dist/v1/libs/utils/TinyThrottledApi.mjs +294 -0
- package/dist/v1/libs/worker/browser/TinyWebWorker.cjs +342 -0
- package/dist/v1/libs/worker/browser/TinyWebWorker.d.mts +97 -0
- package/dist/v1/libs/worker/browser/TinyWebWorker.d.mts.map +1 -0
- package/dist/v1/libs/worker/browser/TinyWebWorker.mjs +305 -0
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.cjs +346 -0
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts +127 -0
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts.map +1 -0
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.mjs +304 -0
- package/dist/v1/regexp/Email.cjs +185 -0
- package/dist/v1/regexp/Email.d.mts +73 -0
- package/dist/v1/regexp/Email.d.mts.map +1 -0
- package/dist/v1/regexp/Email.mjs +153 -0
- package/dist/v1/regexp/Glob.cjs +293 -0
- package/dist/v1/regexp/Glob.d.mts +45 -0
- package/dist/v1/regexp/Glob.d.mts.map +1 -0
- package/dist/v1/regexp/Glob.mjs +260 -0
- package/dist/v1/regexp/Ipv4.cjs +57 -0
- package/dist/v1/regexp/Ipv4.d.mts +29 -0
- package/dist/v1/regexp/Ipv4.d.mts.map +1 -0
- package/dist/v1/regexp/Ipv4.mjs +45 -0
- package/dist/v1/regexp/Ipv6.cjs +67 -0
- package/dist/v1/regexp/Ipv6.d.mts +29 -0
- package/dist/v1/regexp/Ipv6.d.mts.map +1 -0
- package/dist/v1/regexp/Ipv6.mjs +54 -0
- package/dist/v1/regexp/SegmentExtractor.cjs +145 -0
- package/dist/v1/regexp/SegmentExtractor.d.mts +91 -0
- package/dist/v1/regexp/SegmentExtractor.d.mts.map +1 -0
- package/dist/v1/regexp/SegmentExtractor.mjs +116 -0
- package/dist/v1/regexp/UrlDetector.cjs +125 -0
- package/dist/v1/regexp/UrlDetector.d.mts +67 -0
- package/dist/v1/regexp/UrlDetector.d.mts.map +1 -0
- package/dist/v1/regexp/UrlDetector.mjs +102 -0
- package/dist/v1/regexp/Username/index.cjs +233 -0
- package/dist/v1/regexp/Username/index.d.mts +77 -0
- package/dist/v1/regexp/Username/index.d.mts.map +1 -0
- package/dist/v1/regexp/Username/index.mjs +199 -0
- package/dist/v1/regexp/Username/jsDoc.cjs +2 -0
- package/dist/v1/regexp/Username/jsDoc.d.mts +57 -0
- package/dist/v1/regexp/Username/jsDoc.d.mts.map +1 -0
- package/dist/v1/regexp/Username/jsDoc.mjs +18 -0
- package/dist/v1/regexp/Username/templates/BlueSky.cjs +56 -0
- package/dist/v1/regexp/Username/templates/BlueSky.d.mts +35 -0
- package/dist/v1/regexp/Username/templates/BlueSky.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/BlueSky.mjs +52 -0
- package/dist/v1/regexp/Username/templates/Discord.cjs +505 -0
- package/dist/v1/regexp/Username/templates/Discord.d.mts +209 -0
- package/dist/v1/regexp/Username/templates/Discord.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/Discord.mjs +458 -0
- package/dist/v1/regexp/Username/templates/MatrixProtocol.cjs +143 -0
- package/dist/v1/regexp/Username/templates/MatrixProtocol.d.mts +70 -0
- package/dist/v1/regexp/Username/templates/MatrixProtocol.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/MatrixProtocol.mjs +128 -0
- package/dist/v1/regexp/Username/templates/deprecated/Discord.cjs +24 -0
- package/dist/v1/regexp/Username/templates/deprecated/Discord.d.mts +17 -0
- package/dist/v1/regexp/Username/templates/deprecated/Discord.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/deprecated/Discord.mjs +20 -0
- package/dist/v1/regexp/Username/templates/index.cjs +11 -0
- package/dist/v1/regexp/Username/templates/index.d.mts +5 -0
- package/dist/v1/regexp/Username/templates/index.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/index.mjs +4 -0
- package/dist/v1/regexp/index.cjs +41 -0
- package/dist/v1/regexp/index.d.mts +9 -0
- package/dist/v1/regexp/index.d.mts.map +1 -0
- package/dist/v1/regexp/index.mjs +8 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.cjs +64 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.d.mts +11 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.d.mts.map +1 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.mjs +51 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.cjs +66 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.d.mts +11 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.d.mts.map +1 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.mjs +51 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.cjs +39 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.d.mts +11 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.d.mts.map +1 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.mjs +28 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.cjs +494 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.d.mts +142 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.d.mts.map +1 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.mjs +445 -0
- package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.cjs +30 -4
- package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.d.mts +5 -2
- package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.d.mts.map +1 -1
- package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.mjs +29 -5
- package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.cjs +135 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.d.mts +83 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.d.mts.map +1 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.mjs +120 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.cjs +127 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.d.mts +95 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.d.mts.map +1 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.mjs +109 -0
- package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.cjs +83 -0
- package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.d.mts +46 -0
- package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.d.mts.map +1 -0
- package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.mjs +71 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.cjs +493 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.d.mts +67 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.d.mts.map +1 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.mjs +399 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.cjs +35 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.d.mts +6 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.d.mts.map +1 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.mjs +29 -0
- package/docs/info/RegExp.md +74 -0
- package/docs/v1/Exports.md +101 -0
- package/docs/v1/README.md +113 -15
- package/docs/v1/basics/asyncReplace.md +2 -0
- package/docs/v1/basics/browserDetector.md +28 -11
- package/docs/v1/basics/crypto.md +85 -0
- package/docs/v1/basics/deprecated/html.md +2 -0
- package/docs/v1/basics/deprecated/objFilter.md +2 -0
- package/docs/v1/basics/html.md +2 -0
- package/docs/v1/basics/objChecker.md +55 -0
- package/docs/v1/basics/objFilter.md +57 -86
- package/docs/v1/basics/promiseUtils.md +12 -3
- package/docs/v1/basics/text.md +0 -1
- package/docs/v1/libs/array/TinyArrayComparator.md +50 -39
- package/docs/v1/libs/fs/TinyFS.md +752 -0
- package/docs/v1/libs/fs/TinyOPFSFileSystem.md +495 -0
- package/docs/v1/libs/fs/TinyStorageBucketFileSystem.md +407 -0
- package/docs/v1/libs/plugin/TinyPlugin.md +441 -0
- package/docs/v1/libs/plugin/TinyVersion.md +145 -0
- package/docs/v1/libs/router/TinyRouter.md +216 -0
- package/docs/v1/libs/storage/TinyMapCache.md +219 -0
- package/docs/v1/libs/storage/TinySetMapDatabase.md +478 -0
- package/docs/v1/libs/sw/browser/TinyNotificationAdapter.md +280 -0
- package/docs/v1/libs/sw/browser/TinyPushManager.md +782 -0
- package/docs/v1/libs/sw/browser/TinyServiceWorker.md +365 -0
- package/docs/v1/libs/sw/browser/plugins/TabManager.md +133 -0
- package/docs/v1/libs/sw/service/TinyPushRouter.md +314 -0
- package/docs/v1/libs/sw/service/TinyServiceWorkerEngine.md +748 -0
- package/docs/v1/libs/sw/service/plugins/GlobBypassPlugin.md +229 -0
- package/docs/v1/libs/sw/service/plugins/GlobCachePlugin.md +91 -0
- package/docs/v1/libs/sw/service/plugins/Ping.md +36 -0
- package/docs/v1/libs/sw/service/plugins/TabManager.md +64 -0
- package/docs/v1/libs/sw/service/plugins/ViteFileDetector.md +92 -0
- package/docs/v1/libs/sw/service/shared/TinyPushPayload.md +316 -0
- package/docs/v1/libs/text/TinyI18.md +80 -56
- package/docs/v1/libs/tools/TinyBrowserMonitor.md +170 -0
- package/docs/v1/libs/tools/TinyDebugger.md +117 -1
- package/docs/v1/libs/tools/TinyHtmlTagRegexBuilder.md +141 -0
- package/docs/v1/libs/tools/TinyHttpResponseRegistry.md +129 -0
- package/docs/v1/libs/tools/TinyPasswordValidator.md +153 -0
- package/docs/v1/libs/tools/TinyPkgExportValidator.md +45 -1
- package/docs/v1/libs/tools/TinySiteMap.md +134 -0
- package/docs/v1/libs/tools/TinySiteMapStream.md +97 -0
- package/docs/v1/libs/tools/TinyURLSecurityVerifier.md +146 -0
- package/docs/v1/libs/tools/TinyUriParser/Discord.md +374 -0
- package/docs/v1/libs/tools/TinyUriParser/MatrixProtocol.md +54 -0
- package/docs/v1/libs/tools/TinyUriParser.md +128 -0
- package/docs/v1/libs/utils/TinyCloner.md +126 -0
- package/docs/v1/libs/utils/TinyPromiseQueue.md +1 -1
- package/docs/v1/libs/utils/TinyThrottledApi.md +219 -0
- package/docs/v1/libs/worker/browser/TinyWebWorker.md +331 -0
- package/docs/v1/libs/worker/engine/TinyWebWorkerEngine.md +137 -0
- package/docs/v1/regexp/Email.md +127 -0
- package/docs/v1/regexp/Glob.md +155 -0
- package/docs/v1/regexp/IPv4.md +103 -0
- package/docs/v1/regexp/IPv6.md +122 -0
- package/docs/v1/regexp/SegmentExtractor.md +120 -0
- package/docs/v1/regexp/UrlDetector.md +117 -0
- package/docs/v1/regexp/Username/Base.md +131 -0
- package/docs/v1/regexp/Username/Discord.md +267 -0
- package/docs/v1/regexp/Username/MatrixProtocol.md +131 -0
- package/docs/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters.md +565 -0
- package/docs/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.md +19 -7
- package/docs/v1/webTemplates/media/MediaValidator/v1/Browser.md +123 -0
- package/docs/v1/webTemplates/media/MediaValidator/v1/Node.md +136 -0
- package/docs/v1/webTemplates/multiformats/14.0/IPFSHasher.md +310 -0
- package/docs/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.md +131 -0
- package/docs/v1/webTemplates/vite/7.3/plugins/githubUtils.md +50 -0
- package/package.json +340 -22
- package/types/EventEmitter.d.ts +48 -0
- package/dist/v1/libs/text/TinyI18.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const e={d:(t,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var o=r[n++],a=r[n++];e.o(t,o)?0===a&&n++:0===a?Object.defineProperty(t,o,{enumerable:!0,value:r[n++]}):Object.defineProperty(t,o,{enumerable:!0,get:a})}else for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};function r(e){if(!Array.isArray(e))throw new TypeError("Argument 'items' must be an array.");let t,r=e.length;for(;0!==r;)t=Math.floor(Math.random()*r),r--,[e[r],e[t]]=[e[t],e[r]];return e}function n(e,t){if(!Array.isArray(e))throw new TypeError("Argument 'phases' must be an array.");if(!Array.isArray(t))throw new TypeError("Argument 'counts' must be an array.");if(e.length!==t.length)throw new RangeError("The 'phases' and 'counts' arrays must have the same length.");const r=[];for(let n=0;n<e.length;n++){if("number"!=typeof t[n]||Number.isNaN(t[n]))throw new TypeError(`Element at counts[${n}] must be a valid number.`);for(let o=0;o<t[n];o++)r.push(e[n])}return r}function o(e,t){if(!Array.isArray(e))throw new TypeError("Argument 'oldItems' must be an array.");if(!Array.isArray(t))throw new TypeError("Argument 'newItems' must be an array.");const r=e.filter(e=>!t.includes(e));return{added:t.filter(t=>!e.includes(t)),removed:r}}function a(e,t=!1){if(null!=e&&"string"!=typeof e)throw new TypeError("Argument 'item' must be a string or null.");if("boolean"!=typeof t)throw new TypeError("Argument 'isReverse' must be a boolean.");return t?function(t,r){return(e?t[e]:t)>(e?r[e]:r)?-1:(e?t[e]:t)<(e?r[e]:r)?1:0}:function(t,r){return(e?t[e]:t)<(e?r[e]:r)?-1:(e?t[e]:t)>(e?r[e]:r)?1:0}}function i(){const e=new Intl.DateTimeFormat(void 0,{hour:"numeric"}).resolvedOptions().hourCycle;return e?.startsWith("h12")?12:24}function s(e=new Date,t="asSeconds",r=null){if(!(e instanceof Date))throw new TypeError("The 'timeData' argument must be an instance of Date.");if("string"!=typeof t)throw new TypeError("The 'durationType' argument must be a string.");const n=["asMilliseconds","asSeconds","asMinutes","asHours","asDays"];if(!n.includes(t))throw new RangeError(`The 'durationType' must be one of: ${n.join(", ")}.`);if(null!==r&&!(r instanceof Date))throw new TypeError("The 'now' argument must be an instance of Date or null.");const o=r instanceof Date?r:new Date,a=e.getTime()-o.getTime();switch(t){case"asMilliseconds":return a;case"asSeconds":default:return a/1e3;case"asMinutes":return a/6e4;case"asHours":return a/36e5;case"asDays":return a/864e5}}function l(e,t="seconds",r="{time}"){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("The 'totalSeconds' argument must be a valid number.");if("string"!=typeof t)throw new TypeError("The 'level' argument must be a string.");const n=["seconds","minutes","hours","days","months","years"];if(!n.includes(t))throw new RangeError(`The 'level' must be one of: ${n.join(", ")}.`);if("string"!=typeof r)throw new TypeError("The 'format' argument must be a string.");e=Math.max(0,Math.floor(e));const o=n.indexOf(t),a=o>=5,i=o>=4,s=o>=3,l=o>=2,u=o>=1,f=o>=0,c={years:a?0:NaN,months:i?0:NaN,days:s?0:NaN,hours:l?0:NaN,minutes:u?0:NaN,seconds:f?0:NaN,total:NaN};let m=e;if(a||i||s){const e=new Date(1980,0,1),t=new Date(e.getTime()+1e3*m),r=new Date(e);if(a)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=t.getTime();)r.setFullYear(r.getFullYear()+1),c.years++;if(i)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=t.getTime();)r.setMonth(r.getMonth()+1),c.months++;if(s)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=t.getTime();)r.setDate(r.getDate()+1),c.days++;m=Math.floor((t.getTime()-r.getTime())/1e3)}l&&(c.hours=Math.floor(m/3600),m%=3600),u&&(c.minutes=Math.floor(m/60),m%=60),f&&(c.seconds=m),c.total=+e.toFixed(2).replace(/\.00$/,"");const d=e=>{const t="string"==typeof e?parseInt(e):e;return Number.isNaN(t)?"NaN":String(t).padStart(2,"0")},p=[l?d(c.hours):null,u?d(c.minutes):null,f?d(c.seconds):null].filter(e=>null!==e).join(":");return r.replace(/\{years\}/g,String(c.years)).replace(/\{months\}/g,String(c.months)).replace(/\{days\}/g,String(c.days)).replace(/\{hours\}/g,d(c.hours)).replace(/\{minutes\}/g,d(c.minutes)).replace(/\{seconds\}/g,d(c.seconds)).replace(/\{time\}/g,p).replace(/\{total\}/g,String(c.total)).trim()}function u(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("The 'seconds' argument must be a valid number.");return l(e,"hours","{hours}:{minutes}:{seconds}")}function f(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("The 'seconds' argument must be a valid number.");return l(e,"days","{days}d {hours}:{minutes}:{seconds}")}function c(e,t="milliseconds"){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("The 'totalMs' argument must be a valid number.");if("string"!=typeof t)throw new TypeError("The 'level' argument must be a string.");const r=["milliseconds","seconds","minutes","hours","days","months","years"];if(!r.includes(t))throw new RangeError(`The 'level' must be one of: ${r.join(", ")}.`);e=Math.max(0,Math.floor(e));const n=r.indexOf(t),o=n>=6,a=n>=5,i=n>=4,s=n>=3,l=n>=2,u=n>=1,f=n>=0,c={years:o?0:NaN,months:a?0:NaN,days:i?0:NaN,hours:s?0:NaN,minutes:l?0:NaN,seconds:u?0:NaN,milliseconds:f?0:NaN,total:NaN};let m=e;if(o||a||i){const e=new Date(1980,0,1),t=new Date(e.getTime()+m),r=new Date(e);if(o)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=t.getTime();)r.setFullYear(r.getFullYear()+1),c.years++;if(a)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=t.getTime();)r.setMonth(r.getMonth()+1),c.months++;if(i)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=t.getTime();)r.setDate(r.getDate()+1),c.days++;m=t.getTime()-r.getTime()}return s&&(c.hours=Math.floor(m/36e5),m%=36e5),l&&(c.minutes=Math.floor(m/6e4),m%=6e4),u&&(c.seconds=Math.floor(m/1e3),m%=1e3),f&&(c.milliseconds=m),c.total=+e,c}function m(e){if(!Array.isArray(e)&&!d(e))throw new TypeError("Argument must be either an Array or a pure JSON Object.");return Array.isArray(e)?e.length:Object.keys(e).length}function d(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}function p(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function y(e,t){if(!(e instanceof Blob))return Promise.reject(new TypeError('The "file" argument must be an instance of Blob or File.'));const r=["readAsArrayBuffer","readAsDataURL","readAsText","readAsBinaryString"];return"string"==typeof t&&r.includes(t)?new Promise((r,n)=>{const o=new FileReader;o.onload=()=>{try{r(o.result)}catch(e){n(e)}},o.onerror=()=>{n(o.error)},o[t](e)}):Promise.reject(new TypeError(`The "method" argument must be one of: ${r.join(", ")}.`))}function w(e,t=!1){return e instanceof Blob?"string"!=typeof t&&"boolean"!=typeof t?Promise.reject(new TypeError("The isDataUrl parameter must be a boolean or a string.")):new Promise((r,n)=>{y(e,"readAsDataURL").then(e=>{if("string"!=typeof e)throw new TypeError("Expected file content to be a string.");const n=e.match(/^data:(.+);base64,(.*)$/);if(!n||!n[2])throw new Error("Invalid data URL format or missing Base64 content.");const[,o,a]=n;if(!/^[\w/+]+=*$/.test(a))throw new Error("Base64 content is malformed.");if("boolean"==typeof t)return r(t?e:a);if(!/^[\w-]+\/[\w.+-]+$/.test(t))throw new Error(`Invalid MIME type string: ${t}`);return r(`data:${t};base64,${a}`)}).catch(n)}):Promise.reject(new TypeError('The "file" argument must be an instance of Blob or File.'))}function g(e){return e instanceof Blob?new Promise((t,r)=>y(e,"readAsText").then(e=>{if("string"!=typeof e)throw new TypeError("Expected file content to be a string.");const r=e.trim();if(0===r.length)throw new Error("File is empty or contains only whitespace.");const n=JSON.parse(r);if("object"!=typeof n||null===n)throw new Error("Parsed content is not a valid JSON object or array.");t(n)}).catch(r)):Promise.reject(new TypeError('The "file" argument must be an instance of Blob or File.'))}function b(e,t,r=2){if("string"!=typeof e)throw new TypeError('The "filename" argument must be a string.');if("number"!=typeof r||!Number.isInteger(r)||r<0)throw new TypeError('The "spaces" argument must be a non-negative integer.');const n=JSON.stringify(t,null,r),o=new Blob([n],{type:"application/json"}),a=URL.createObjectURL(o),i=document.createElement("a");i.href=a,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}function h(e,t,r=e=>({headers:e.headers,status:e.status,statusText:e.statusText})){if(!(e instanceof Response))throw new TypeError('The "response" argument must be an instance of Response.');if("function"!=typeof t)throw new TypeError('The "onProgress" argument must be a function.');if(!e.body)return e;const n=e.headers.get("content-length"),o=n?parseInt(n,10):0;let a=0;const i=e.body.getReader(),s=new ReadableStream({async start(e){for(;;){const{done:r,value:n}=await i.read();if(r)break;a+=n.byteLength,t(a,o),e.enqueue(n)}e.close()}});return new Response(s,r(e))}async function v(e,t,r){return"string"!=typeof e?Promise.reject(new TypeError('The "url" argument must be a string.')):void 0!==t&&"object"!=typeof t?Promise.reject(new TypeError('The "options" argument must be an object.')):void 0!==r&&"function"!=typeof r?Promise.reject(new TypeError('The "onProgress" option must be a function.')):new Promise((n,o)=>{fetch(e,t??void 0).then(async e=>{const t=r?h(e,r):e,o=t.headers.get("content-type")||"";if(!o.includes("application/json"))throw new Error(`Unexpected content-type: ${o}`);const a=await t.json();if(!Array.isArray(a)&&!d(a))throw new Error("Received invalid data instead of valid JSON.");return n(a)}).catch(o)})}async function E(e,t,r,n){return"string"!=typeof e?Promise.reject(new TypeError('The "url" argument must be a string.')):void 0===t||Array.isArray(t)?void 0!==r&&"object"!=typeof r?Promise.reject(new TypeError('The "options" argument must be an object.')):void 0!==n&&"function"!=typeof n?Promise.reject(new TypeError('The "onProgress" option must be a function.')):new Promise((o,a)=>{fetch(e,r??void 0).then(async e=>{const r=n?h(e,n):e,a=r.headers.get("content-type")||"";if(Array.isArray(t)&&t.length>0&&!t.some(e=>a.includes(e)))throw new Error(`Blocked MIME type: ${a}`);const i=await r.text();return o(i)}).catch(a)}):Promise.reject(new TypeError('The "allowedMimeTypes" argument must be an array of strings.'))}function T(e={}){if(null===e||"object"!=typeof e)throw new TypeError('The "settings" argument must be an object.');const{element:t=document.body,hiddenClass:r="windowHidden",visibleClass:n="windowVisible",onVisible:o,onHidden:a}=e;if(!(t instanceof Element))throw new TypeError('"element" must be an instance of Element.');if("string"!=typeof r)throw new TypeError('"hiddenClass" must be a string.');if("string"!=typeof n)throw new TypeError('"visibleClass" must be a string.');if(void 0!==o&&"function"!=typeof o)throw new TypeError('"onVisible" must be a function if provided.');if(void 0!==a&&"function"!=typeof a)throw new TypeError('"onHidden" must be a function if provided.');let i="",s="";const l=()=>{t.classList.remove(r),t.classList.remove(n)};let u=null;const f=["visibilitychange","mozvisibilitychange","webkitvisibilitychange","msvisibilitychange"],c=["hidden","mozHidden","webkitHidden","msHidden"];for(let e=0;e<c.length;e++)if(c[e]in document){u=c[e];break}const m=function(e){l();const f=e?.type,c=u&&document[u];["focus","focusin","pageshow"].includes(f)?(t.classList.add(n),o?.({type:f,oldClass:s,oldType:i}),s=n):["blur","focusout","pagehide"].includes(f)||c?(t.classList.add(r),a?.({type:f,oldClass:s,oldType:i}),s=r):(t.classList.add(n),o?.({type:f,oldClass:s,oldType:i}),s=n),i=f};let d=()=>{};if(u){const e=f[c.indexOf(u)];document.addEventListener(e,m),window.addEventListener("focus",m),window.addEventListener("blur",m),d=()=>{document.removeEventListener(e,m),window.removeEventListener("focus",m),window.removeEventListener("blur",m),l()}}else"onfocusin"in document?(document.onfocusin=document.onfocusout=m,d=()=>{document.onfocusin=document.onfocusout=null,l()}):(window.onpageshow=window.onpagehide=window.onfocus=window.onblur=m,d=()=>{window.onpageshow=window.onpagehide=window.onfocus=window.onblur=null,l()});const p=new Event(u&&document[u]?"blur":"focus");return m(p),d}e.r(t),e.d(t,{addAiMarkerShortcut:()=>G,areElsCollBottom:()=>te,areElsCollLeft:()=>re,areElsCollPerfBottom:()=>ae,areElsCollPerfLeft:()=>ie,areElsCollPerfRight:()=>se,areElsCollPerfTop:()=>oe,areElsCollRight:()=>ne,areElsCollTop:()=>ee,areElsColliding:()=>le,areElsPerfColliding:()=>ue,arraySortPositions:()=>a,asyncReplace:()=>J,breakdownDuration:()=>c,browserIs:()=>qe,calculateMarketcap:()=>V,cloneObjTypeOrder:()=>j,compareMarketcap:()=>z,countObj:()=>m,createSingletonTask:()=>Be,diffArrayList:()=>o,diffObjList:()=>Z,diffStrings:()=>Q,documentIsFullScreen:()=>D,exitFullScreen:()=>C,extendObjType:()=>A,extractMediaId3Tags:()=>Ce,fetchJson:()=>v,fetchText:()=>E,formatBytes:()=>H,formatCustomTimer:()=>l,formatDayTimer:()=>f,formatTimer:()=>u,genFibonacciSeq:()=>q,getAge:()=>Y,getBrowserCssPrefix:()=>Ue,getBrowserPings:()=>He,getDuckTyping:()=>Ye,getElsCollDetails:()=>ge,getElsCollDirDepth:()=>we,getElsCollOverlap:()=>me,getElsCollOverlapPos:()=>de,getElsColliding:()=>fe,getElsPerfColliding:()=>ce,getElsRelativeCenterOffset:()=>ye,getPercentage:()=>U,getRectCenter:()=>pe,getSimplePerc:()=>_,getTimeDuration:()=>s,getUserTimeFormat:()=>i,installWindowHiddenScript:()=>T,isBrowserAgent:()=>_e,isFullScreenMode:()=>O,isJsonObject:()=>d,isObjType:()=>M,isScreenFilled:()=>F,isValidObj:()=>p,jsonFilter:()=>be,jsonFilterByKeys:()=>ve,jsonFilterRecursive:()=>he,multiplyArrayBlocks:()=>n,objType:()=>S,objTypeName:()=>k,offFullScreenChange:()=>B,onFullScreenChange:()=>R,parseMediaMetadata:()=>Pe,readBase64Blob:()=>w,readFileBlob:()=>y,readJsonBlob:()=>g,reorderObjTypeOrder:()=>N,requestFullScreen:()=>L,ruleOfThree:()=>$,safeTextTrim:()=>K,saveJsonFile:()=>b,shuffleArray:()=>r,toTitleCase:()=>W,toTitleCaseLowerFirst:()=>X,valFetchMediaContent:()=>Oe,valMediaContentMetadata:()=>Le,waitForTrue:()=>Re});const I="undefined"!=typeof window&&void 0!==window.document,x={items:{},order:[]};function A(e,t){if("object"!=typeof e||null===e)throw new TypeError("Argument 'newItems' must be an object or an array.");if(void 0!==t&&"number"!=typeof t)throw new TypeError("Argument 'index' must be a number.");const r=[],n=Array.isArray(e)?e:Object.entries(e);for(const e of n){if(!Array.isArray(e)||e.length<2)throw new TypeError("Each item in 'newItems' array must be a [key, function] pair.");const[n,o]=e;if("string"!=typeof n)throw new TypeError("Validator key must be a string.");if("function"!=typeof o)throw new TypeError(`Validator for key '${n}' must be a function.`);if(!x.items.hasOwnProperty(n)){x.items[n]=o;let e="number"==typeof t?t:-1;if(-1===e){const t=x.order.indexOf("object");e=t>-1?t:x.order.length}e=Math.min(Math.max(0,e),x.order.length),x.order.splice(e,0,n),r.push(n)}}return r}function N(e){if(!Array.isArray(e))throw new TypeError("Argument 'newOrder' must be an array of strings.");if(!e.every(e=>"string"==typeof e))throw new TypeError("All elements in 'newOrder' must be strings.");const t=[...x.order];return!!e.every(e=>t.includes(e))&&(x.order=e.slice(),!0)}function j(){return[...x.order]}const k=e=>{if(null===e)return"null";for(const t of x.order)if("function"!=typeof x.items[t]||x.items[t](e))return t;return"unknown"};function M(e,t){if("string"!=typeof t)throw new TypeError("Argument 'type' must be a string.");return k(e)===t.toLowerCase()}function S(e,t){if(void 0===e)return null;if(void 0!==t&&"string"!=typeof t)throw new TypeError("Argument 'type' must be a string.");const r=k(e);return"string"==typeof t?r===t.toLowerCase():r}A([["undefined",e=>void 0===e],["null",e=>null===e],["boolean",e=>"boolean"==typeof e],["number",e=>"number"==typeof e&&!Number.isNaN(e)],["bigint",e=>"bigint"==typeof e],["string",e=>"string"==typeof e],["symbol",e=>"symbol"==typeof e],["function",e=>"function"==typeof e],["array",e=>Array.isArray(e)]]),I&&A([["file",e=>"undefined"!=typeof File&&e instanceof File]]),A([["date",e=>e instanceof Date],["regexp",e=>e instanceof RegExp],["map",e=>e instanceof Map],["set",e=>e instanceof Set],["weakmap",e=>e instanceof WeakMap],["weakset",e=>e instanceof WeakSet],["promise",e=>e instanceof Promise]]),I&&A([["htmlelement",e=>"undefined"!=typeof HTMLElement&&e instanceof HTMLElement]]),A([["object",e=>d(e)]]);const D=()=>!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen),F=()=>window.innerHeight===screen.height&&window.innerWidth===screen.width,O=()=>D()||F(),L=e=>new Promise(async(t,r)=>{const n=document.documentElement;try{n.requestFullscreen?await n.requestFullscreen(e):n.mozRequestFullScreen?n.mozRequestFullScreen(e):n.webkitRequestFullScreen?n.webkitRequestFullScreen(e):n.msRequestFullscreen&&n.msRequestFullscreen(e),t()}catch(e){r(e)}}),C=()=>new Promise((e,t)=>{if(document.exitFullscreen)document.exitFullscreen().then(e).catch(t);else try{if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else{if(!document.msExitFullscreen)throw new Error("Fullscreen API is not supported");document.msExitFullscreen()}e()}catch(e){t(e)}}),P=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],R=(e,t)=>{P.forEach(r=>{document.addEventListener(r,e,t)})},B=(e,t)=>{P.forEach(r=>{document.removeEventListener(r,e,t)})};function $(e,t,r,n=!1){if("number"!=typeof e||!Number.isFinite(e))throw new TypeError("val1 must be a finite number.");if("number"!=typeof t||!Number.isFinite(t))throw new TypeError("val2 must be a finite number.");if("number"!=typeof r||!Number.isFinite(r))throw new TypeError("val3 must be a finite number.");if("boolean"!=typeof n)throw new TypeError("inverse must be a boolean.");return n?Number(e*t)/r:Number(r*t)/e}function _(e,t){if("number"!=typeof e||!Number.isFinite(e))throw new TypeError("price must be a finite number.");if("number"!=typeof t||!Number.isFinite(t))throw new TypeError("percentage must be a finite number.");return e*(t/100)}function U(e,t){if("number"!=typeof e||!Number.isFinite(e))throw new TypeError("part must be a finite number.");if("number"!=typeof t||!Number.isFinite(t))throw new TypeError("total must be a finite number.");return 0===t?0:e/t*100}function Y(e=0,t=null){if("number"!=typeof e&&"string"!=typeof e&&!(e instanceof Date))throw new TypeError("timeData must be a number, string, or Date object.");if(null!==t&&!(t instanceof Date))throw new TypeError("now must be a Date object or null.");const r=new Date(e);if(Number.isNaN(r.getTime()))return null;const n=t instanceof Date?t:new Date;let o=n.getFullYear()-r.getFullYear();const a=n.getMonth(),i=r.getMonth(),s=n.getDate(),l=r.getDate();return(a<i||a===i&&s<l)&&o--,Math.abs(o)}function H(e,t=null,r=null){if("number"!=typeof e||!Number.isFinite(e)||e<0)throw new TypeError("bytes must be a positive number.");if(0===e)return{unit:"Bytes",value:0};if(null!==t&&("number"!=typeof t||!Number.isFinite(t)))throw new TypeError("decimals must be a number or null.");const n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];if(null!==r){if("string"!=typeof r)throw new TypeError("maxUnit must be a string or null.");if(!n.includes(r))throw new RangeError(`maxUnit must be one of: ${n.join(", ")}`)}const o=r&&n.includes(r)?n.indexOf(r):n.length-1,a=Math.min(Math.floor(Math.log(e)/Math.log(1024)),o);let i=e/Math.pow(1024,a);if(null!==t){const e=t<0?0:t;i=parseFloat(i.toFixed(e))}return{unit:n[a],value:i}}function q({baseValues:e=[0,1],length:t=10,combiner:r=(e,t)=>e+t}={}){if(!Array.isArray(e)||2!==e.length||!e.every(e=>"number"==typeof e))throw new Error("baseValues must be an array of exactly two numbers.");if("number"!=typeof t||!Number.isInteger(t))throw new RangeError("length must be an integer.");if("function"!=typeof r)throw new TypeError("combiner must be a function.");const n=[...e.slice(0,2)];for(let e=2;e<t;e++){const t=r(n[e-2],n[e-1],e);n.push(t)}return n}function V(e,t){if("number"!=typeof e||Number.isNaN(e)||!Number.isFinite(e))throw new TypeError("Original market cap must be a finite number.");if("number"!=typeof t||Number.isNaN(t)||!Number.isFinite(t))throw new TypeError("Circulating supply must be a finite number.");if(t<=0)throw new RangeError("Circulating supply must be greater than zero.");return e/t}function z(e,t,r){if("number"!=typeof r||Number.isNaN(r)||!Number.isFinite(r))throw new TypeError("New market cap must be a finite number.");const n=V(e,t),o="number"==typeof r?r/t:NaN;return{originalPrice:n,newPrice:o,priceChangePercent:"number"==typeof r?(o-n)/n*100:NaN}}async function J(e,t,r){if("string"!=typeof e)throw new TypeError("Expected a string for 'str', but received "+typeof e);if(!(t instanceof RegExp))throw new TypeError("Expected a RegExp for 'regex', but received "+typeof t);if("function"!=typeof r)throw new TypeError("Expected a function for 'asyncFn', but received "+typeof r);const n=[];e.replace(t,(e,...t)=>(n.push(r(e,...t)),e));const o=await Promise.all(n);return e.replace(t,()=>o.shift())}function W(e){if("string"!=typeof e)throw new TypeError("Expected a string for 'str', but received "+typeof e);return e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase())}function X(e){if("string"!=typeof e)throw new TypeError("Expected a string for 'str', but received "+typeof e);const t=e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase());return t.charAt(0).toLowerCase()+t.slice(1)}function G({key:e="a",className:t="detect-made-by-ai"}={}){if("undefined"==typeof HTMLElement)throw new Error("[AiMarkerShortcut] Environment does not support the DOM. This function must be run in a browser.");if("string"!=typeof e)throw new TypeError("Expected a string for 'config.key', but received "+typeof e);if("string"!=typeof t)throw new TypeError("Expected a string for 'config.className', but received "+typeof t);const r=function(r){if(r.ctrlKey&&r.altKey&&r.key.toLowerCase()===e){if(r.preventDefault(),!document.body)return void console.warn("[AiMarkerShortcut] <body> element not found. Cannot toggle class. Ensure the DOM is fully loaded when using the shortcut.");document.body.classList.toggle(t)}};return document.addEventListener("keydown",r),r}function K(e,t,r=.6){if("string"!=typeof e)throw new TypeError("Expected a string for 'text', but received "+typeof e);if(!Number.isInteger(t)||t<=0)throw new TypeError(`Expected 'limit' to be a positive integer, but received ${t}`);if("number"!=typeof r||r<0||r>1)throw new TypeError(`Expected 'safeCutZone' to be a number between 0 and 1, but received ${r}`);let n=e.trim();if(n.length>t){const e=n.lastIndexOf(" ",t);return e>0&&e>=t*r?`${n.substring(0,e).trim()}...`:`${n.substring(0,t).trim()}...`}return n}function Z(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("Expected an object for 'oldStrings', but received "+(null===e?"null":typeof e));if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("Expected an object for 'newStrings', but received "+(null===t?"null":typeof t));const r={added:{},removed:{},modified:{}};for(const n in e)n in t?e[n]!==t[n]&&(r.modified[n]={old:e[n],new:t[n]}):r.removed[n]=e[n];for(const n in t)n in e||(r.added[n]=t[n]);return r}const Q=Z,ee=(e,t)=>e.bottom<t.top,te=(e,t)=>e.top>t.bottom,re=(e,t)=>e.right<t.left,ne=(e,t)=>e.left>t.right,oe=(e,t)=>e.bottom<=t.top,ae=(e,t)=>e.top>=t.bottom,ie=(e,t)=>e.right<=t.left,se=(e,t)=>e.left>=t.right,le=(e,t)=>!(re(e,t)||ne(e,t)||ee(e,t)||te(e,t)),ue=(e,t)=>!(ie(e,t)||se(e,t)||oe(e,t)||ae(e,t)),fe=(e,t)=>re(e,t)?"left":ne(e,t)?"right":ee(e,t)?"top":te(e,t)?"bottom":null,ce=(e,t)=>ie(e,t)?"left":se(e,t)?"right":oe(e,t)?"top":ae(e,t)?"bottom":null,me=(e,t)=>({overlapLeft:t.right-e.left,overlapRight:e.right-t.left,overlapTop:t.bottom-e.top,overlapBottom:e.bottom-t.top}),de=({overlapLeft:e=-1,overlapRight:t=-1,overlapTop:r=-1,overlapBottom:n=-1}={})=>({dirX:e<t?"right":"left",dirY:r<n?"bottom":"top"}),pe=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function ye(e,t){const r=e.left+e.width/2,n=e.top+e.height/2;return{x:t.left+t.width/2-r,y:t.top+t.height/2-n}}function we(e,t){if(!ue(e,t))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:a}=me(e,t),{dirX:i,dirY:s}=de({overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:a}),l=Math.min(r,n),u=Math.min(o,a);let f;return f=l<u?i:s,{inDir:f,dirX:i,dirY:s,depthX:l,depthY:u}}function ge(e,t){const r=ue(e,t),n={in:null,x:null,y:null},o={y:null,x:null},a={top:0,bottom:0,left:0,right:0},{overlapLeft:i,overlapRight:s,overlapTop:l,overlapBottom:u}=me(t,e);a.top=l,a.bottom=u,a.left=i,a.right=s;const f=Object.entries(a).filter(([,e])=>e>0).sort((e,t)=>e[1]-t[1]),{dirX:c,dirY:m}=de({overlapLeft:s,overlapRight:i,overlapTop:u,overlapBottom:l});return n.y=m,n.x=c,a.bottom<0?o.y="bottom":a.top<0&&(o.y="top"),a.left<0?o.x="left":a.right<0&&(o.x="right"),n.in=r?a.top===a.bottom&&a.bottom===a.left&&a.left===a.right?"center":f.length?f[0][0]:"top":null,{dirs:n,depth:a,isNeg:o}}function be(e,t){if(!p(e))throw new TypeError("The first argument must be a non-null object.");if("function"!=typeof t)throw new TypeError("The second argument must be a function.");const r=Object.entries(e).filter(t);return Object.fromEntries(r)}function he(e,t){if(void 0!==t.obj&&"function"!=typeof t.obj)throw new TypeError("filter.obj must be a function if provided.");if(void 0!==t.value&&"function"!=typeof t.value)throw new TypeError("filter.value must be a function if provided.");if(void 0!==t.array&&"function"!=typeof t.array)throw new TypeError("filter.array must be a function if provided.");let r;r=e instanceof Map?new Map:e instanceof Set?new Set:{};const n=(o=e)instanceof Map?Array.from(o.entries()):o instanceof Set?Array.from(o.values()).map(e=>[void 0,e]):Object.entries(o);var o;const a=(e,r)=>{const n=[];for(let o=0;o<e.length;o++){const i=e[o];if(Array.isArray(i))n.push(a(i,r));else if(p(i)){const r=he(i,t);(void 0===t.obj||t.obj(r,o,e))&&n.push(r)}else(void 0===t.value||t.value([r,i],o,e))&&n.push(i)}return n};for(let e=0;e<n.length;e++){const[o,i]=n[e];if(Array.isArray(i)){const s=a(i,o);(void 0===t.array||t.array([o,s],e,n))&&(r instanceof Map||r instanceof Set?r instanceof Map?r.set(o,s):r.add(s):r[o]=s)}else if(p(i)){const a=he(i,t);(void 0===t.obj||t.obj(a,e,n))&&(r instanceof Map?r.set(o,a):r instanceof Set?r.add(a):r[o]=a)}else(void 0===t.value||t.value([o,i],e,n))&&(r instanceof Map?r.set(o,i):r instanceof Set?r.add(i):r[o]=i)}return r}function ve(e,t,r){if(!Array.isArray(t))throw new TypeError("The second argument must be an array.");if(void 0!==r&&!Array.isArray(r))throw new TypeError("The third argument must be an array.");return be(e,([e,n])=>t.length>0?t.some(t=>{if(Array.isArray(t)){const[r,o]=t,a=e===r,i="function"==typeof o?o(n):n===o;return a&&i}const o=e===t,a=void 0===r||r.some(e=>"function"==typeof e?e(n):e===n);return o&&a}):void 0!==r&&r.some(e=>"function"==typeof e?e(n):e===n))}const Ee=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("string"!=typeof e)throw new TypeError(`Expected "${t}" to be a string, but received ${typeof e}.`)},Te=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("function"!=typeof e)throw new TypeError(`Expected "${t}" to be a function, but received ${typeof e}.`)},Ie=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError(`Expected "${t}" to be a plain object, but received ${null===e?"null":Array.isArray(e)?"array":typeof e}.`)},xe=(e,t=!1)=>!t&&void 0===e,Ae=(e,t=!1)=>xe(e,t)||"string"==typeof e||!t&&null===e,Ne=(e,t=!1)=>xe(e,t)||"number"==typeof e||!t&&null===e,je=(e,t=!1)=>xe(e,t)||"boolean"==typeof e||!t&&null===e,ke=(e,t)=>!!xe(e)||(Te(t,"valueValidator"),Array.isArray(e)&&e.every(t)),Me=new Map;class Se extends Error{constructor(e,t,r){if(Ee(e,"message"),Ee(t,"url"),"string"!=typeof r)throw new TypeError(`Expected "stage" to be a string, but received ${typeof r}.`);super(e),this.name="MediaLoadingError",this.url=t,this.stage=r}}const De=async e=>{Ee(e,"str");const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,"0")).join("").substring(0,8)},Fe=(e,t="image/jpeg")=>{if(!(e instanceof Uint8Array)&&"string"!=typeof e)throw new TypeError(`Expected "data" to be an instance of Uint8Array or a string, but received ${typeof e}.`);Ee(t,"format");const r=e=>{const t=URL.createObjectURL(e),r=Me.get(t);return Me.set(t,"number"==typeof r?r+1:1),t};if(e instanceof Uint8Array)return r(new Blob([e],{type:t}));if("string"==typeof e&&e.startsWith("data:")){const n=e.split(",")[1],o=atob(n),a=new Uint8Array(o.length);for(let e=0;e<o.length;e++)a[e]=o.charCodeAt(e);return r(new Blob([a],{type:t}))}return"string"==typeof e?e:""},Oe=(e,t=!1)=>{if(d(e)){if(4!==m(e)){if(t)return!1;throw new TypeError("Invalid fetch data: Object must be an MediaContentFetchData.")}Le(e.common),Ie(e.native,"_fetchData.native"),Ie(e.format,"_fetchData.format"),Ie(e.quality,"_fetchData.quality");for(const r in e.native){const n=e.native[r];if(!ke(n,e=>"string"==typeof e.id)){if(t)return!1;throw new TypeError(`Invalid native data: "${r}" must be an array of native fetch data.`)}}}return!0},Le=e=>{if(Ie(e,"common"),Oe(e._fetchData),!Ae(e.title))throw new TypeError('Invalid metadata: "title" must be a string or null.');if(!Ae(e.album))throw new TypeError('Invalid metadata: "album" must be a string or null.');if(!Ae(e.albumartist))throw new TypeError('Invalid metadata: "albumartist" must be a a string or null.');if(!Ae(e.artist))throw new TypeError('Invalid metadata: "artist" must be a string or null.');if(!je(e.compilation))throw new TypeError('Invalid metadata: "compilation" must be a boolean or null.');if(!je(e.podcast))throw new TypeError('Invalid metadata: "podcast" must be a boolean or null.');if(!je(e.gapless))throw new TypeError('Invalid metadata: "gapless" must be a boolean or null.');if(!je(e.showMovement))throw new TypeError('Invalid metadata: "showMovement" must be a boolean or null.');if(!Ne(e.averageLevel))throw new TypeError('Invalid metadata: "averageLevel" must be a number or null.');if(!Ne(e.peakLevel))throw new TypeError('Invalid metadata: "peakLevel" must be a number or null.');if(!Ne(e.hdVideo))throw new TypeError('Invalid metadata: "hdVideo" must be a number or null.');if(!Ne(e.stik))throw new TypeError('Invalid metadata: "stik" must be a number or null.');if(!Ne(e.playCounter))throw new TypeError('Invalid metadata: "playCounter" must be a number or null.');if(!Ne(e.tvSeason))throw new TypeError('Invalid metadata: "tvSeason" must be a number or null.');if(!Ne(e.tvEpisode))throw new TypeError('Invalid metadata: "tvEpisode" must be a number or null.');if(!Ne(e.year))throw new TypeError('Invalid metadata: "year" must be a number or null.');if(!Ne(e.bpm))throw new TypeError('Invalid metadata: "bpm" must be a number or null.');if(!Ne(e.originalyear))throw new TypeError('Invalid metadata: "originalyear" must be a number or null.');if(!Ne(e.movementTotal))throw new TypeError('Invalid metadata: "movementTotal" must be a number or null.');if(!Ae(e.date))throw new TypeError('Invalid metadata: "date" must be a string or null.');if(!Ae(e.originaldate))throw new TypeError('Invalid metadata: "originaldate" must be a string or null.');if(!Ae(e.releasedate))throw new TypeError('Invalid metadata: "releasedate" must be a string or null.');if(!Ae(e.albumsort))throw new TypeError('Invalid metadata: "albumsort" must be a string or null.');if(!Ae(e.titlesort))throw new TypeError('Invalid metadata: "titlesort" must be a string or null.');if(!Ae(e.work))throw new TypeError('Invalid metadata: "work" must be a string or null.');if(!Ae(e.artistsort))throw new TypeError('Invalid metadata: "artistsort" must be a string or null.');if(!Ae(e.albumartistsort))throw new TypeError('Invalid metadata: "albumartistsort" must be a string or null.');if(!Ae(e.composersort))throw new TypeError('Invalid metadata: "composersort" must be a string or null.');if(!Ae(e.grouping))throw new TypeError('Invalid metadata: "grouping" must be a string or null.');if(!Ae(e.longDescription))throw new TypeError('Invalid metadata: "longDescription" must be a string or null.');if(!Ae(e.totaltracks))throw new TypeError('Invalid metadata: "totaltracks" must be a string or null.');if(!Ae(e.totaldiscs))throw new TypeError('Invalid metadata: "totaldiscs" must be a string or null.');if(!Ae(e.mood))throw new TypeError('Invalid metadata: "mood" must be a string or null.');if(!Ae(e.media))throw new TypeError('Invalid metadata: "media" must be a string or null.');if(!Ae(e.tvShow))throw new TypeError('Invalid metadata: "tvShow" must be a string or null.');if(!Ae(e.tvShowSort))throw new TypeError('Invalid metadata: "tvShowSort" must be a string or null.');if(!Ae(e.tvEpisodeId))throw new TypeError('Invalid metadata: "tvEpisodeId" must be a string or null.');if(!Ae(e.tvNetwork))throw new TypeError('Invalid metadata: "tvNetwork" must be a string or null.');if(!Ae(e.podcasturl))throw new TypeError('Invalid metadata: "podcasturl" must be a string or null.');if(!Ae(e.releasestatus))throw new TypeError('Invalid metadata: "releasestatus" must be a string or null.');if(!Ae(e.releasecountry))throw new TypeError('Invalid metadata: "releasecountry" must be a string or null.');if(!Ae(e.script))throw new TypeError('Invalid metadata: "script" must be a string or null.');if(!Ae(e.language))throw new TypeError('Invalid metadata: "language" must be a string or null.');if(!Ae(e.copyright))throw new TypeError('Invalid metadata: "copyright" must be a string or null.');if(!Ae(e.license))throw new TypeError('Invalid metadata: "license" must be a string or null.');if(!Ae(e.encodedby))throw new TypeError('Invalid metadata: "encodedby" must be a string or null.');if(!Ae(e.encodersettings))throw new TypeError('Invalid metadata: "encodersettings" must be a string or null.');if(!Ae(e.barcode))throw new TypeError('Invalid metadata: "barcode" must be a string or null.');if(!Ae(e.asin))throw new TypeError('Invalid metadata: "asin" must be a string or null.');if(!Ae(e.website))throw new TypeError('Invalid metadata: "website" must be a string or null.');if(!Ae(e.originalalbum))throw new TypeError('Invalid metadata: "originalalbum" must be a string or null.');if(!Ae(e.originalartist))throw new TypeError('Invalid metadata: "originalartist" must be a string or null.');if(!Ae(e.key))throw new TypeError('Invalid metadata: "key" must be a string or null.');if(!Ae(e.movement))throw new TypeError('Invalid metadata: "movement" must be a string or null.');if(!Ae(e.podcastId))throw new TypeError('Invalid metadata: "podcastId" must be a string or null.');if(!ke(e.albumartists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "albumartists" must be an array of strings.');if(!ke(e.genre,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "genre" must be an array of strings.');if(!ke(e.label,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "label" must be an array of strings.');if(!ke(e.composer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "composer" must be an array of strings.');if(!ke(e.artists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "artists" must be an array of strings.');if(!ke(e.lyricist,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "lyricist" must be an array of strings.');if(!ke(e.writer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "writer" must be an array of strings.');if(!ke(e.conductor,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "conductor" must be an array of strings.');if(!ke(e.remixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "remixer" must be an array of strings.');if(!ke(e.arranger,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "arranger" must be an array of strings.');if(!ke(e.engineer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "engineer" must be an array of strings.');if(!ke(e.publisher,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "publisher" must be an array of strings.');if(!ke(e.producer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "producer" must be an array of strings.');if(!ke(e.djmixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "djmixer" must be an array of strings.');if(!ke(e.mixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "mixer" must be an array of strings.');if(!ke(e.technician,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "technician" must be an array of strings.');if(!ke(e.subtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "subtitle" must be an array of strings.');if(!ke(e.description,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "description" must be an array of strings.');if(!ke(e.discsubtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "discsubtitle" must be an array of strings.');if(!ke(e.releasetype,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "releasetype" must be an array of strings.');if(!ke(e.isrc,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "isrc" must be an array of strings.');if(!ke(e.performer_instrument,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "performer_instrument" must be an array of strings.');if(!ke(e.notes,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "notes" must be an array of strings.');if(!ke(e.category,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "category" must be an array of strings.');if(!ke(e.keywords,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "keywords" must be an array of strings.');if(!ke(e.catalognumber,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "catalognumber" must be an array of strings.');if(!ke(e.picture,e=>e&&"object"==typeof e&&(void 0===e.description||"string"==typeof e.description)&&(void 0===e.name||"string"==typeof e.name)&&(void 0===e.type||"string"==typeof e.type)&&"string"==typeof e.format&&(e.data instanceof Uint8Array||"string"==typeof e.data)))throw new TypeError('Invalid metadata: "picture" must be an array of pictures.');if(!ke(e.comment,e=>null!==e&&"object"==typeof e&&Ae(e.descriptor)&&Ae(e.language)&&Ae(e.text)))throw new TypeError('Invalid metadata: "comment" must be an array of valid IComment objects.');if(!ke(e.lyrics,e=>null!==e&&"object"==typeof e&&Ae(e.text)&&Ae(e.descriptor)&&Ae(e.language)&&(!Array.isArray(e)||ke(e.syncText,e=>null!==e&&"object"==typeof e&&Ae(e.text)&&Ne(e.timestamp)))&&(e=>void 0===e||null!==e&&"object"==typeof e&&Ne(e.notSynchronized)&&Ne(e.mpegFrameNumber)&&Ne(e.milliseconds))(e.timeStampFormat)&&(e=>void 0===e||null!==e&&"object"==typeof e&&Ne(e.other)&&Ne(e.lyrics)&&Ne(e.text)&&Ne(e.movement_part)&&Ne(e.events)&&Ne(e.chord)&&Ne(e.trivia_pop))(e.contentType)))throw new TypeError('Invalid metadata: "lyrics" must be an array of valid ILyricsTag objects.');if(!ke(e.rating,e=>null!==e&&"object"==typeof e&&Ae(e.source)&&Ne(e.rating)))throw new TypeError('Invalid metadata: "rating" must be an array of valid IRating objects.');const t=(e,t)=>{if(!xe(t)&&null!==t){if("object"!=typeof t)throw new TypeError(`Invalid metadata: "${e}" must be an object or null.`);if("number"!=typeof t.no&&null!==t.no)throw new TypeError(`Invalid metadata: "${e}.no" must be a number or null.`);if("number"!=typeof t.of&&null!==t.of)throw new TypeError(`Invalid metadata: "${e}.of" must be a number or null.`)}};t("disk",e.disk),t("track",e.track),t("movementIndex",e.movementIndex)},Ce=async(e,t,r=!0)=>{Ee(e,"url"),Te(t,"parseFile");const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch audio file: ${n.status} ${n.statusText}`);const o=await n.blob(),a=await t(o);if(!a||"object"!=typeof a.common)throw new TypeError('Invalid metadata: "common" property is missing.');void 0!==typeof a.common["performer:instrument"]&&(a.common.performer_instrument=a.common["performer:instrument"]),Oe(a);const i=a.common;Le(i);const s=i?.picture?.map(e=>({...e,data:r?Fe(e.data,e.format):e.data}))??[];a.common={...a.common,picture:s.map(e=>({...e,data:""}))},r&&Object.keys(a.native).forEach(e=>{a.native[e]=a.native[e].map(e=>{if(e.value&&"object"==typeof e.value&&e.value.data instanceof Uint8Array){const t=i?.picture?.findIndex(t=>t.data===e.value.data&&t.format===e.value.format&&t.description===e.value.description&&t.name===e.value.name)??-1;if(s[t])return{...e,value:{...e.value,data:""}}}return e})});const l=he({title:i?.title,album:i?.album,albumartist:i?.albumartist,albumartists:i?.albumartists,genre:i?.genre,label:i?.label,composer:i?.composer,year:i?.year,artist:i?.artist,artists:i?.artists,disk:i?.disk?{no:i.disk.no,of:i.disk.of}:void 0,track:i?.track?{no:i.track.no,of:i.track.of}:void 0,movementIndex:i?.movementIndex?{no:i.movementIndex.no,of:i.movementIndex.of}:void 0,picture:s,date:i?.date,originaldate:i?.originaldate,originalyear:i?.originalyear,releasedate:i?.releasedate,comment:i?.comment,lyrics:i?.lyrics,albumsort:i?.albumsort,titlesort:i?.titlesort,work:i?.work,artistsort:i?.artistsort,albumartistsort:i?.albumartistsort,composersort:i?.composersort,lyricist:i?.lyricist,writer:i?.writer,conductor:i?.conductor,remixer:i?.remixer,arranger:i?.arranger,engineer:i?.engineer,publisher:i?.publisher,producer:i?.producer,djmixer:i?.djmixer,mixer:i?.mixer,technician:i?.technician,grouping:i?.grouping,subtitle:i?.subtitle,description:i?.description,longDescription:i?.longDescription,discsubtitle:i?.discsubtitle,totaltracks:i?.totaltracks,totaldiscs:i?.totaldiscs,movementTotal:i?.movementTotal,compilation:i?.compilation,rating:i?.rating,bpm:i?.bpm,mood:i?.mood,media:i?.media,catalognumber:i?.catalognumber,tvShow:i?.tvShow,tvShowSort:i?.tvShowSort,tvSeason:i?.tvSeason,tvEpisode:i?.tvEpisode,tvEpisodeId:i?.tvEpisodeId,tvNetwork:i?.tvNetwork,podcast:i?.podcast,podcasturl:i?.podcasturl,releasestatus:i?.releasestatus,releasetype:i?.releasetype,releasecountry:i?.releasecountry,script:i?.script,language:i?.language,copyright:i?.copyright,license:i?.license,encodedby:i?.encodedby,encodersettings:i?.encodersettings,gapless:i?.gapless,barcode:i?.barcode,isrc:i?.isrc,asin:i?.asin,website:i?.website,performer_instrument:i?.performer_instrument,averageLevel:i?.averageLevel,peakLevel:i?.peakLevel,notes:i?.notes,originalalbum:i?.originalalbum,originalartist:i?.originalartist,key:i?.key,category:i?.category,hdVideo:i?.hdVideo,keywords:i?.keywords,movement:i?.movement,podcastId:i?.podcastId,showMovement:i?.showMovement,stik:i?.stik,playCounter:i?.playCounter},{value:([e,t])=>null!=t,obj:e=>m(e)>0,array:([e,t])=>t.length>0});return l._fetchData=a,l},Pe=async(e,t={},r={},n=e=>{if(!(e instanceof Blob))throw new TypeError('Expected "data" to be a Blob.');return new Promise((e,t)=>t(new TypeError("parseFile library not found.")))},o={},a=!0,i="null")=>{if("string"!=typeof e&&!(e instanceof HTMLMediaElement))throw new TypeError("Source must be a string or an HTMLMediaElement.");if(Ie(t,"defaultMetadata"),Ie(r,"metadata"),Te(n,"parseFile"),Ie(o,"callbacks"),o.onProgress&&"function"!=typeof o.onProgress)throw new TypeError("callbacks.onProgress must be a function.");if(o.onError&&"function"!=typeof o.onError)throw new TypeError("callbacks.onError must be a function.");if("string"!=typeof i&&"function"!=typeof i)throw new TypeError("unknownArtist must be a string or a function returning a string.");let s,l="";const u=(t,r)=>{if(Ee(t,"stage"),void 0!==r&&!(r instanceof Event))throw new TypeError('Expected "event" to be an Event or undefined.');o.onProgress&&o.onProgress({event:r,status:"loading",stage:t,url:l||(e instanceof HTMLMediaElement?e.src:"unknown")})},f=(t,r)=>{if(!(t instanceof Error))throw new TypeError('Expected "error" to be an Error.');Ee(r,"stage"),o.onError&&o.onError({error:t instanceof Error?t:new Error(String(t)),url:l||(e instanceof HTMLMediaElement?e.src:"unknown"),stage:r})};try{u("INITIALIZING"),"string"==typeof e?(l=e,s=new Audio(l)):(s=e,l=s.src);try{await new Promise((e,t)=>{const r=e=>u("DOWNLOADING",e),n=()=>{a(),e(void 0)},o=e=>{a(),t(new Error(`HTMLMediaElement failed to load: ${e.message||"Unknown error"}`))},a=()=>{s.removeEventListener("progress",r),s.removeEventListener("loadedmetadata",n),s.removeEventListener("error",o)};s.addEventListener("progress",r),s.addEventListener("loadedmetadata",n),s.addEventListener("error",o),s.readyState>=1&&(a(),e(void 0))}),u("METADATA_LOADED")}catch(e){throw new Se(e instanceof Error?e.message:"UNKNOWN ERROR",l,"METADATA")}const c={id:r.id||await De(l),duration:Math.floor(1e3*s.duration),url:l,weight:r.weight??1};let m={};u("EXTRACTING_ID3");try{m=await Ce(l,n,a)}catch(e){f(e instanceof Error?e:new Error("Unknown Error"),"ID3"),console.warn(`[TinyAudioUtils] ID3 extraction failed for ${l}. Falling back to filename.`)}const p=e=>{Ee(e,"url");try{return(e.split(/[?#]/)[0].split("/").pop()??"").replace(/\.[^/.]+$/,"")||"Unknown Track"}catch{return"Unknown Track"}},y=e=>{const t={...e};return d(t._fetchData)&&(d(m._fetchData)&&(t._fetchData={...m._fetchData}),d(e._fetchData)&&(void 0!==e._fetchData.common&&(t._fetchData.common=e._fetchData.common),void 0!==e._fetchData.native&&(t._fetchData.native=e._fetchData.native),void 0!==e._fetchData.format&&(t._fetchData.format=e._fetchData.format),void 0!==e._fetchData.quality&&(t._fetchData.quality=e._fetchData.quality))),t},w={...c,...y(t),...m,...y(r),title:m.title||r.title||p(l),artist:m.artist||r.artist||("string"==typeof i?i:String(i()))};return o.onProgress&&o.onProgress({status:"success",stage:"COMPLETE",url:l}),w}catch(e){if(e instanceof Se)throw e;const t=new Se(e instanceof Error?e.message:"UNKNOWN ERROR",l,"INITIALIZING");throw f(t,"INITIALIZING"),t}},Re=(e,t=100)=>{if("function"!=typeof e)throw new TypeError("Expected 'getValue' to be a function.");if(!Number.isFinite(t)||t<=0)throw new TypeError("Expected 'checkInterval' to be a positive number.");return new Promise(r=>{const n=setInterval(()=>{e()&&(clearInterval(n),r())},t)})},Be=e=>{if("function"!=typeof e)throw new TypeError('The argument "baseFunction" must be a function.');let t=null;return{callback:async(...r)=>(null!==t||(t=(async()=>{try{const n=await e(...r);return t=null,n}catch(e){throw t=null,e}})()),t),getActivePromise:()=>t,resetActivePromise:()=>{t=null}}},$e=["chrome","firefox","ie","edge","safari","opera","yandex","other"];function _e(){const e=navigator.userAgent;return-1!==e.indexOf("Chrome")?"chrome":-1!==e.indexOf("Firefox")?"firefox":-1!==e.indexOf("MSIE")?"ie":-1!==e.indexOf("Edge")?"edge":-1!==e.indexOf("Safari")?"safari":-1!==e.indexOf("Opera")?"opera":-1!==e.indexOf("YaBrowser")?"yandex":"other"}function Ue(){const e=(Array.prototype.slice.call(window.getComputedStyle(document.documentElement,"")).join("").match(/-(moz|webkit|ms)-/)??["",""])[1];return"moz"===e?"gecko":"webkit"===e?"webkit":"ms"===e?"trident":"other"}function Ye(){const e=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,t="undefined"!=typeof InstallTrigger,r=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString(),n=!!document.documentMode,o=!n&&!!window.StyleMedia,a=!!window.chrome;return{isOpera:e,isFirefox:t,isSafari:r,isIE:n,isEdge:o,isChrome:a,isBlink:(a||e)&&!!window.CSS}}function He(e=[]){if(!Array.isArray(e))throw new TypeError('The "disable" argument must be an array.');for(const t of e)if(!$e.includes(t))throw new TypeError(`Invalid browser name provided in disable array: ${t}`);const t={chrome:0,firefox:0,ie:0,edge:0,safari:0,opera:0,yandex:0,other:0};t[_e()]++;const r=Ue();"gecko"===r?e.indexOf("firefox")<0&&t.firefox++:"webkit"===r?(e.indexOf("chrome")<0&&t.chrome++,e.indexOf("safari")<0&&t.safari++,e.indexOf("opera")<0&&t.opera++,e.indexOf("edge")<0&&t.edge++):"trident"===r?e.indexOf("ie")<0&&t.ie++:e.indexOf("other")<0&&t.other++;const n=Ye();return n.isOpera&&e.indexOf("opera")<0&&t.opera++,n.isFirefox&&e.indexOf("firefox")<0&&t.firefox++,n.isSafari&&e.indexOf("safari")<0&&t.safari++,n.isIE&&e.indexOf("ie")<0&&t.ie++,n.isEdge&&e.indexOf("edge")<0&&t.edge++,n.isChrome&&e.indexOf("chrome")<0&&t.chrome++,t}function qe(e=[]){const t=He(e);return Object.keys(t).reduce((e,r)=>t[r]>t[e]?r:e)}window.TinyBasicsEs=t})();
|
|
1
|
+
(()=>{"use strict";const e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};function r(e){if(!Array.isArray(e))throw new TypeError("Argument 'items' must be an array.");let t,r=e.length;for(;0!==r;)t=Math.floor(Math.random()*r),r--,[e[r],e[t]]=[e[t],e[r]];return e}function n(e,t){if(!Array.isArray(e))throw new TypeError("Argument 'phases' must be an array.");if(!Array.isArray(t))throw new TypeError("Argument 'counts' must be an array.");if(e.length!==t.length)throw new RangeError("The 'phases' and 'counts' arrays must have the same length.");const r=[];for(let n=0;n<e.length;n++){if("number"!=typeof t[n]||Number.isNaN(t[n]))throw new TypeError(`Element at counts[${n}] must be a valid number.`);for(let o=0;o<t[n];o++)r.push(e[n])}return r}function o(e,t){if(!Array.isArray(e))throw new TypeError("Argument 'oldItems' must be an array.");if(!Array.isArray(t))throw new TypeError("Argument 'newItems' must be an array.");const r=e.filter(e=>!t.includes(e));return{added:t.filter(t=>!e.includes(t)),removed:r}}function a(e,t=!1){if(null!=e&&"string"!=typeof e)throw new TypeError("Argument 'item' must be a string or null.");if("boolean"!=typeof t)throw new TypeError("Argument 'isReverse' must be a boolean.");return t?function(t,r){return(e?t[e]:t)>(e?r[e]:r)?-1:(e?t[e]:t)<(e?r[e]:r)?1:0}:function(t,r){return(e?t[e]:t)<(e?r[e]:r)?-1:(e?t[e]:t)>(e?r[e]:r)?1:0}}function i(){const e=new Intl.DateTimeFormat(void 0,{hour:"numeric"}).resolvedOptions().hourCycle;return e?.startsWith("h12")?12:24}function s(e=new Date,t="asSeconds",r=null){if(!(e instanceof Date))throw new TypeError("The 'timeData' argument must be an instance of Date.");if("string"!=typeof t)throw new TypeError("The 'durationType' argument must be a string.");const n=["asMilliseconds","asSeconds","asMinutes","asHours","asDays"];if(!n.includes(t))throw new RangeError(`The 'durationType' must be one of: ${n.join(", ")}.`);if(null!==r&&!(r instanceof Date))throw new TypeError("The 'now' argument must be an instance of Date or null.");const o=r instanceof Date?r:new Date,a=e.getTime()-o.getTime();switch(t){case"asMilliseconds":return a;case"asSeconds":default:return a/1e3;case"asMinutes":return a/6e4;case"asHours":return a/36e5;case"asDays":return a/864e5}}function l(e,t="seconds",r="{time}"){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("The 'totalSeconds' argument must be a valid number.");if("string"!=typeof t)throw new TypeError("The 'level' argument must be a string.");const n=["seconds","minutes","hours","days","months","years"];if(!n.includes(t))throw new RangeError(`The 'level' must be one of: ${n.join(", ")}.`);if("string"!=typeof r)throw new TypeError("The 'format' argument must be a string.");e=Math.max(0,Math.floor(e));const o=n.indexOf(t),a=o>=5,i=o>=4,s=o>=3,l=o>=2,u=o>=1,f=o>=0,c={years:a?0:NaN,months:i?0:NaN,days:s?0:NaN,hours:l?0:NaN,minutes:u?0:NaN,seconds:f?0:NaN,total:NaN};let d=e;if(a||i||s){const e=new Date(1980,0,1),t=new Date(e.getTime()+1e3*d),r=new Date(e);if(a)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=t.getTime();)r.setFullYear(r.getFullYear()+1),c.years++;if(i)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=t.getTime();)r.setMonth(r.getMonth()+1),c.months++;if(s)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=t.getTime();)r.setDate(r.getDate()+1),c.days++;d=Math.floor((t.getTime()-r.getTime())/1e3)}l&&(c.hours=Math.floor(d/3600),d%=3600),u&&(c.minutes=Math.floor(d/60),d%=60),f&&(c.seconds=d),c.total=+e.toFixed(2).replace(/\.00$/,"");const m=e=>{const t="string"==typeof e?parseInt(e):e;return Number.isNaN(t)?"NaN":String(t).padStart(2,"0")},p=[l?m(c.hours):null,u?m(c.minutes):null,f?m(c.seconds):null].filter(e=>null!==e).join(":");return r.replace(/\{years\}/g,String(c.years)).replace(/\{months\}/g,String(c.months)).replace(/\{days\}/g,String(c.days)).replace(/\{hours\}/g,m(c.hours)).replace(/\{minutes\}/g,m(c.minutes)).replace(/\{seconds\}/g,m(c.seconds)).replace(/\{time\}/g,p).replace(/\{total\}/g,String(c.total)).trim()}function u(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("The 'seconds' argument must be a valid number.");return l(e,"hours","{hours}:{minutes}:{seconds}")}function f(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("The 'seconds' argument must be a valid number.");return l(e,"days","{days}d {hours}:{minutes}:{seconds}")}function c(e,t="milliseconds"){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("The 'totalMs' argument must be a valid number.");if("string"!=typeof t)throw new TypeError("The 'level' argument must be a string.");const r=["milliseconds","seconds","minutes","hours","days","months","years"];if(!r.includes(t))throw new RangeError(`The 'level' must be one of: ${r.join(", ")}.`);e=Math.max(0,Math.floor(e));const n=r.indexOf(t),o=n>=6,a=n>=5,i=n>=4,s=n>=3,l=n>=2,u=n>=1,f=n>=0,c={years:o?0:NaN,months:a?0:NaN,days:i?0:NaN,hours:s?0:NaN,minutes:l?0:NaN,seconds:u?0:NaN,milliseconds:f?0:NaN,total:NaN};let d=e;if(o||a||i){const e=new Date(1980,0,1),t=new Date(e.getTime()+d),r=new Date(e);if(o)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=t.getTime();)r.setFullYear(r.getFullYear()+1),c.years++;if(a)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=t.getTime();)r.setMonth(r.getMonth()+1),c.months++;if(i)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=t.getTime();)r.setDate(r.getDate()+1),c.days++;d=t.getTime()-r.getTime()}return s&&(c.hours=Math.floor(d/36e5),d%=36e5),l&&(c.minutes=Math.floor(d/6e4),d%=6e4),u&&(c.seconds=Math.floor(d/1e3),d%=1e3),f&&(c.milliseconds=d),c.total=+e,c}function d(e){if(!Array.isArray(e)&&!m(e))throw new TypeError("Argument must be either an Array or a pure JSON Object.");return Array.isArray(e)?e.length:Object.keys(e).length}function m(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}function p(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}e.r(t),e.d(t,{addAiMarkerShortcut:()=>te,areElsCollBottom:()=>ie,areElsCollLeft:()=>se,areElsCollPerfBottom:()=>fe,areElsCollPerfLeft:()=>ce,areElsCollPerfRight:()=>de,areElsCollPerfTop:()=>ue,areElsCollRight:()=>le,areElsCollTop:()=>ae,areElsColliding:()=>me,areElsPerfColliding:()=>pe,arraySortPositions:()=>a,asyncReplace:()=>Z,breakdownDuration:()=>c,browserIs:()=>Ze,calculateMarketcap:()=>G,cloneObjTypeOrder:()=>S,compareMarketcap:()=>K,countObj:()=>d,createSingletonTask:()=>Ye,diffArrayList:()=>o,diffObjList:()=>ne,documentIsFullScreen:()=>P,exitFullScreen:()=>U,extendObjType:()=>k,extractMediaId3Tags:()=>Ue,fetchJson:()=>I,fetchText:()=>x,formatBytes:()=>W,formatCustomTimer:()=>l,formatDayTimer:()=>f,formatTimer:()=>u,genFibonacciSeq:()=>X,getAge:()=>J,getBrowserCssPrefix:()=>Xe,getBrowserPings:()=>Ke,getDuckTyping:()=>Ge,getElsCollDetails:()=>Te,getElsCollDirDepth:()=>Ee,getElsCollOverlap:()=>ge,getElsCollOverlapPos:()=>be,getElsColliding:()=>ye,getElsPerfColliding:()=>we,getElsRelativeCenterOffset:()=>ve,getObjTypeOrder:()=>C,getObjTypeRegistry:()=>L,getPercentage:()=>z,getRectCenter:()=>he,getSimplePerc:()=>V,getTimeDuration:()=>s,getUserTimeFormat:()=>i,hashText:()=>oe,installWindowHiddenScript:()=>A,isAnyClassInstance:()=>g,isBrowser:()=>qe,isBrowserAgent:()=>We,isClass:()=>y,isClassInstance:()=>w,isFullScreenMode:()=>B,isJsonObject:()=>m,isObjType:()=>D,isScreenFilled:()=>R,isValidObj:()=>p,jsonFilter:()=>Ie,jsonFilterByKeys:()=>Ae,jsonFilterRecursive:()=>xe,multiplyArrayBlocks:()=>n,objType:()=>F,objTypeName:()=>O,offFullScreenChange:()=>Y,onFullScreenChange:()=>H,parseMediaMetadata:()=>_e,readBase64Blob:()=>h,readFileBlob:()=>b,readJsonBlob:()=>v,reorderObjTypeOrder:()=>M,requestFullScreen:()=>$,ruleOfThree:()=>q,safeTextTrim:()=>re,saveJsonFile:()=>E,shuffleArray:()=>r,toTitleCase:()=>Q,toTitleCaseLowerFirst:()=>ee,valFetchMediaContent:()=>Be,valMediaContentMetadata:()=>$e,waitForTrue:()=>He});const y=e=>{if("function"!=typeof e)throw new TypeError("The 'target' argument must be a function. Received: "+typeof e);try{return e(),!1}catch(e){return e instanceof TypeError&&e.message.includes("Class constructor")}};function w(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!1;if("function"!=typeof e.constructor)return!1;const r=e.constructor.toString();return/^\s*class\b/.test(r)}function g(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null!==t&&t!==Object.prototype&&"function"==typeof e.constructor}function b(e,t){if(!(e instanceof Blob))return Promise.reject(new TypeError('The "file" argument must be an instance of Blob or File.'));const r=["readAsArrayBuffer","readAsDataURL","readAsText","readAsBinaryString"];return"string"==typeof t&&r.includes(t)?new Promise((r,n)=>{const o=new FileReader;o.onload=()=>{try{r(o.result)}catch(e){n(e)}},o.onerror=()=>{n(o.error)},o[t](e)}):Promise.reject(new TypeError(`The "method" argument must be one of: ${r.join(", ")}.`))}function h(e,t=!1){return e instanceof Blob?"string"!=typeof t&&"boolean"!=typeof t?Promise.reject(new TypeError("The isDataUrl parameter must be a boolean or a string.")):new Promise((r,n)=>{b(e,"readAsDataURL").then(e=>{if("string"!=typeof e)throw new TypeError("Expected file content to be a string.");const n=e.match(/^data:(.+);base64,(.*)$/);if(!n||!n[2])throw new Error("Invalid data URL format or missing Base64 content.");const[,o,a]=n;if(!/^[\w/+]+=*$/.test(a))throw new Error("Base64 content is malformed.");if("boolean"==typeof t)return r(t?e:a);if(!/^[\w-]+\/[\w.+-]+$/.test(t))throw new Error(`Invalid MIME type string: ${t}`);return r(`data:${t};base64,${a}`)}).catch(n)}):Promise.reject(new TypeError('The "file" argument must be an instance of Blob or File.'))}function v(e){return e instanceof Blob?new Promise((t,r)=>b(e,"readAsText").then(e=>{if("string"!=typeof e)throw new TypeError("Expected file content to be a string.");const r=e.trim();if(0===r.length)throw new Error("File is empty or contains only whitespace.");const n=JSON.parse(r);if("object"!=typeof n||null===n)throw new Error("Parsed content is not a valid JSON object or array.");t(n)}).catch(r)):Promise.reject(new TypeError('The "file" argument must be an instance of Blob or File.'))}function E(e,t,r=2){if("string"!=typeof e)throw new TypeError('The "filename" argument must be a string.');if("number"!=typeof r||!Number.isInteger(r)||r<0)throw new TypeError('The "spaces" argument must be a non-negative integer.');const n=JSON.stringify(t,null,r),o=new Blob([n],{type:"application/json"}),a=URL.createObjectURL(o),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function T(e,t,r=e=>({headers:e.headers,status:e.status,statusText:e.statusText})){if(!(e instanceof Response))throw new TypeError('The "response" argument must be an instance of Response.');if("function"!=typeof t)throw new TypeError('The "onProgress" argument must be a function.');if(!e.body)return e;const n=e.headers.get("content-length"),o=n?parseInt(n,10):0;let a=0;const i=e.body.getReader(),s=new ReadableStream({async start(e){for(;;){const{done:r,value:n}=await i.read();if(r)break;a+=n.byteLength,t(a,o),e.enqueue(n)}e.close()}});return new Response(s,r(e))}async function I(e,t,r){return"string"!=typeof e?Promise.reject(new TypeError('The "url" argument must be a string.')):void 0!==t&&"object"!=typeof t?Promise.reject(new TypeError('The "options" argument must be an object.')):void 0!==r&&"function"!=typeof r?Promise.reject(new TypeError('The "onProgress" option must be a function.')):new Promise((n,o)=>{fetch(e,t??void 0).then(async e=>{const t=r?T(e,r):e,o=t.headers.get("content-type")||"";if(!o.includes("application/json"))throw new Error(`Unexpected content-type: ${o}`);const a=await t.json();if(!Array.isArray(a)&&!m(a))throw new Error("Received invalid data instead of valid JSON.");return n(a)}).catch(o)})}async function x(e,t,r,n){return"string"!=typeof e?Promise.reject(new TypeError('The "url" argument must be a string.')):void 0===t||Array.isArray(t)?void 0!==r&&"object"!=typeof r?Promise.reject(new TypeError('The "options" argument must be an object.')):void 0!==n&&"function"!=typeof n?Promise.reject(new TypeError('The "onProgress" option must be a function.')):new Promise((o,a)=>{fetch(e,r??void 0).then(async e=>{const r=n?T(e,n):e,a=r.headers.get("content-type")||"";if(Array.isArray(t)&&t.length>0&&!t.some(e=>a.includes(e)))throw new Error(`Blocked MIME type: ${a}`);const i=await r.text();return o(i)}).catch(a)}):Promise.reject(new TypeError('The "allowedMimeTypes" argument must be an array of strings.'))}function A(e={}){if(null===e||"object"!=typeof e)throw new TypeError('The "settings" argument must be an object.');const{element:t=document.body,hiddenClass:r="windowHidden",visibleClass:n="windowVisible",onVisible:o,onHidden:a}=e;if(!(t instanceof Element))throw new TypeError('"element" must be an instance of Element.');if("string"!=typeof r)throw new TypeError('"hiddenClass" must be a string.');if("string"!=typeof n)throw new TypeError('"visibleClass" must be a string.');if(void 0!==o&&"function"!=typeof o)throw new TypeError('"onVisible" must be a function if provided.');if(void 0!==a&&"function"!=typeof a)throw new TypeError('"onHidden" must be a function if provided.');let i="",s="";const l=()=>{t.classList.remove(r),t.classList.remove(n)};let u=null;const f=["visibilitychange","mozvisibilitychange","webkitvisibilitychange","msvisibilitychange"],c=["hidden","mozHidden","webkitHidden","msHidden"];for(let e=0;e<c.length;e++)if(c[e]in document){u=c[e];break}const d=function(e){l();const f=e?.type,c=u&&document[u];["focus","focusin","pageshow"].includes(f)?(t.classList.add(n),o?.({type:f,oldClass:s,oldType:i}),s=n):["blur","focusout","pagehide"].includes(f)||c?(t.classList.add(r),a?.({type:f,oldClass:s,oldType:i}),s=r):(t.classList.add(n),o?.({type:f,oldClass:s,oldType:i}),s=n),i=f};let m=()=>{};if(u){const e=f[c.indexOf(u)];document.addEventListener(e,d),window.addEventListener("focus",d),window.addEventListener("blur",d),m=()=>{document.removeEventListener(e,d),window.removeEventListener("focus",d),window.removeEventListener("blur",d),l()}}else"onfocusin"in document?(document.onfocusin=document.onfocusout=d,m=()=>{document.onfocusin=document.onfocusout=null,l()}):(window.onpageshow=window.onpagehide=window.onfocus=window.onblur=d,m=()=>{window.onpageshow=window.onpagehide=window.onfocus=window.onblur=null,l()});const p=new Event(u&&document[u]?"blur":"focus");return d(p),m}const N="undefined"!=typeof window&&void 0!==window.document,j={items:{},order:[]};function k(e,t){if("object"!=typeof e||null===e)throw new TypeError("Argument 'ni' must be an object or an array.");if(void 0!==t&&"number"!=typeof t)throw new TypeError("Argument 'index' must be a number.");const r=[];let n;n=Array.isArray(e)?e.length>0&&Array.isArray(e[0])?e:e.length>0?[e]:[]:Object.entries(e);for(const e of n){if(!Array.isArray(e)||e.length<2)throw new TypeError("Each item in the input must be a [key, function] pair.");const[n,o,a]=e;if(void 0!==a&&"function"!=typeof a)throw new TypeError(`Cloner for key '${n}' must be a function.`);const i="function"==typeof a?a:e=>e;if("string"!=typeof n)throw new TypeError("Validator key must be a string.");if("function"!=typeof o)throw new TypeError(`Validator for key '${n}' must be a function.`);if(!j.items.hasOwnProperty(n)){j.items[n]={validator:o,cloner:i};let e="number"==typeof t?t:-1;if(-1===e){const t=j.order.indexOf("object");e=t>-1?t:j.order.length}e=Math.min(Math.max(0,e),j.order.length),j.order.splice(e,0,n),r.push(n)}}return r}function M(e){if(!Array.isArray(e))throw new TypeError("Argument 'newOrder' must be an array of strings.");if(!e.every(e=>"string"==typeof e))throw new TypeError("All elements in 'newOrder' must be strings.");const t=[...j.order];return!!e.every(e=>t.includes(e))&&(j.order=e.slice(),!0)}function S(){return[...j.order]}const O=e=>{if(null===e)return"null";for(const t of j.order)if("function"!=typeof j.items[t].validator||j.items[t].validator(e))return t;return"unknown"};function D(e,t){if("string"!=typeof t)throw new TypeError("Argument 'type' must be a string.");return O(e)===t.toLowerCase()}function F(e,t){if(void 0===e)return null;if(void 0!==t&&"string"!=typeof t)throw new TypeError("Argument 'type' must be a string.");const r=O(e);return"string"==typeof t?r===t.toLowerCase():r}function L(){return Object.fromEntries(Object.entries(j.items).map(([e,t])=>[e,{...t}]))}const C=()=>[...j.order];k([["undefined",e=>void 0===e],["null",e=>null===e],["boolean",e=>"boolean"==typeof e],["number",e=>"number"==typeof e&&!Number.isNaN(e)],["nannumber",e=>"number"==typeof e&&Number.isNaN(e)],["bigint",e=>"bigint"==typeof e],["string",e=>"string"==typeof e],["symbol",e=>"symbol"==typeof e],["function",e=>"function"==typeof e]]),k(["array",e=>Array.isArray(e),(e,t,r)=>e.map(e=>t?r.clone(e,t):e)]),N&&k(["file",e=>"undefined"!=typeof File&&e instanceof File,e=>new File([e],e.name,{type:e.type,lastModified:e.lastModified})]),k(["date",e=>e instanceof Date,e=>new Date(e.getTime())]),k(["regexp",e=>e instanceof RegExp,e=>new RegExp(e.source,e.flags)]),k(["map",e=>e instanceof Map,(e,t,r)=>{const n=new Map;for(const[o,a]of e.entries())n.set(o,t?r.clone(a,t):a);return n}]),k(["set",e=>e instanceof Set,(e,t,r)=>{const n=new Set;for(const o of e)n.add(t?r.clone(o,t):o);return n}]),k([["weakmap",e=>e instanceof WeakMap],["weakset",e=>e instanceof WeakSet],["promise",e=>e instanceof Promise]]),k(["url",e=>e instanceof URL,e=>new URL(e.href)]),N&&k(["htmlelement",e=>"undefined"!=typeof HTMLElement&&e instanceof HTMLElement,e=>e.cloneNode(!0)]),k(["object",e=>m(e),(e,t,r)=>{const n={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=t?r.clone(e[o],t):e[o]);return n}]);const P=()=>!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen),R=()=>window.innerHeight===screen.height&&window.innerWidth===screen.width,B=()=>P()||R(),$=e=>new Promise(async(t,r)=>{const n=document.documentElement;try{n.requestFullscreen?await n.requestFullscreen(e):n.mozRequestFullScreen?n.mozRequestFullScreen(e):n.webkitRequestFullScreen?n.webkitRequestFullScreen(e):n.msRequestFullscreen&&n.msRequestFullscreen(e),t()}catch(e){r(e)}}),U=()=>new Promise((e,t)=>{if(document.exitFullscreen)document.exitFullscreen().then(e).catch(t);else try{if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else{if(!document.msExitFullscreen)throw new Error("Fullscreen API is not supported");document.msExitFullscreen()}e()}catch(e){t(e)}}),_=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],H=(e,t)=>{_.forEach(r=>{document.addEventListener(r,e,t)})},Y=(e,t)=>{_.forEach(r=>{document.removeEventListener(r,e,t)})};function q(e,t,r,n=!1){if("number"!=typeof e||!Number.isFinite(e))throw new TypeError("val1 must be a finite number.");if("number"!=typeof t||!Number.isFinite(t))throw new TypeError("val2 must be a finite number.");if("number"!=typeof r||!Number.isFinite(r))throw new TypeError("val3 must be a finite number.");if("boolean"!=typeof n)throw new TypeError("inverse must be a boolean.");return n?Number(e*t)/r:Number(r*t)/e}function V(e,t){if("number"!=typeof e||!Number.isFinite(e))throw new TypeError("price must be a finite number.");if("number"!=typeof t||!Number.isFinite(t))throw new TypeError("percentage must be a finite number.");return e*(t/100)}function z(e,t){if("number"!=typeof e||!Number.isFinite(e))throw new TypeError("part must be a finite number.");if("number"!=typeof t||!Number.isFinite(t))throw new TypeError("total must be a finite number.");return 0===t?0:e/t*100}function J(e=0,t=null){if("number"!=typeof e&&"string"!=typeof e&&!(e instanceof Date))throw new TypeError("timeData must be a number, string, or Date object.");if(null!==t&&!(t instanceof Date))throw new TypeError("now must be a Date object or null.");const r=new Date(e);if(Number.isNaN(r.getTime()))return null;const n=t instanceof Date?t:new Date;let o=n.getFullYear()-r.getFullYear();const a=n.getMonth(),i=r.getMonth(),s=n.getDate(),l=r.getDate();return(a<i||a===i&&s<l)&&o--,Math.abs(o)}function W(e,t=null,r=null){if("number"!=typeof e||!Number.isFinite(e)||e<0)throw new TypeError("bytes must be a positive number.");if(0===e)return{unit:"Bytes",value:0};if(null!==t&&("number"!=typeof t||!Number.isFinite(t)))throw new TypeError("decimals must be a number or null.");const n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];if(null!==r){if("string"!=typeof r)throw new TypeError("maxUnit must be a string or null.");if(!n.includes(r))throw new RangeError(`maxUnit must be one of: ${n.join(", ")}`)}const o=r&&n.includes(r)?n.indexOf(r):n.length-1,a=Math.min(Math.floor(Math.log(e)/Math.log(1024)),o);let i=e/Math.pow(1024,a);if(null!==t){const e=t<0?0:t;i=parseFloat(i.toFixed(e))}return{unit:n[a],value:i}}function X({baseValues:e=[0,1],length:t=10,combiner:r=(e,t)=>e+t}={}){if(!Array.isArray(e)||2!==e.length||!e.every(e=>"number"==typeof e))throw new Error("baseValues must be an array of exactly two numbers.");if("number"!=typeof t||!Number.isInteger(t))throw new RangeError("length must be an integer.");if("function"!=typeof r)throw new TypeError("combiner must be a function.");const n=[...e.slice(0,2)];for(let e=2;e<t;e++){const t=r(n[e-2],n[e-1],e);n.push(t)}return n}function G(e,t){if("number"!=typeof e||Number.isNaN(e)||!Number.isFinite(e))throw new TypeError("Original market cap must be a finite number.");if("number"!=typeof t||Number.isNaN(t)||!Number.isFinite(t))throw new TypeError("Circulating supply must be a finite number.");if(t<=0)throw new RangeError("Circulating supply must be greater than zero.");return e/t}function K(e,t,r){if("number"!=typeof r||Number.isNaN(r)||!Number.isFinite(r))throw new TypeError("New market cap must be a finite number.");const n=G(e,t),o="number"==typeof r?r/t:NaN;return{originalPrice:n,newPrice:o,priceChangePercent:"number"==typeof r?(o-n)/n*100:NaN}}async function Z(e,t,r){if("string"!=typeof e)throw new TypeError("Expected a string for 'str', but received "+typeof e);if(!(t instanceof RegExp))throw new TypeError("Expected a RegExp for 'regex', but received "+typeof t);if("function"!=typeof r)throw new TypeError("Expected a function for 'asyncFn', but received "+typeof r);const n=[];e.replace(t,(e,...t)=>(n.push(r(e,...t)),e));const o=await Promise.all(n);return e.replace(t,()=>o.shift())}function Q(e){if("string"!=typeof e)throw new TypeError("Expected a string for 'str', but received "+typeof e);return e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase())}function ee(e){if("string"!=typeof e)throw new TypeError("Expected a string for 'str', but received "+typeof e);const t=e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase());return t.charAt(0).toLowerCase()+t.slice(1)}function te({key:e="a",className:t="detect-made-by-ai"}={}){if("undefined"==typeof HTMLElement)throw new Error("[AiMarkerShortcut] Environment does not support the DOM. This function must be run in a browser.");if("string"!=typeof e)throw new TypeError("Expected a string for 'config.key', but received "+typeof e);if("string"!=typeof t)throw new TypeError("Expected a string for 'config.className', but received "+typeof t);const r=function(r){if(r.ctrlKey&&r.altKey&&r.key.toLowerCase()===e){if(r.preventDefault(),!document.body)return void console.warn("[AiMarkerShortcut] <body> element not found. Cannot toggle class. Ensure the DOM is fully loaded when using the shortcut.");document.body.classList.toggle(t)}};return document.addEventListener("keydown",r),r}function re(e,t,r=.6){if("string"!=typeof e)throw new TypeError("Expected a string for 'text', but received "+typeof e);if(!Number.isInteger(t)||t<=0)throw new TypeError(`Expected 'limit' to be a positive integer, but received ${t}`);if("number"!=typeof r||r<0||r>1)throw new TypeError(`Expected 'safeCutZone' to be a number between 0 and 1, but received ${r}`);let n=e.trim();if(n.length>t){const e=n.lastIndexOf(" ",t);return e>0&&e>=t*r?`${n.substring(0,e).trim()}...`:`${n.substring(0,t).trim()}...`}return n}function ne(e,t){if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("Expected an object for 'oldStrings', but received "+(null===e?"null":typeof e));if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("Expected an object for 'newStrings', but received "+(null===t?"null":typeof t));const r={added:{},removed:{},modified:{}};for(const n in e)n in t?e[n]!==t[n]&&(r.modified[n]={old:e[n],new:t[n]}):r.removed[n]=e[n];for(const n in t)n in e||(r.added[n]=t[n]);return r}async function oe(e,t){if("string"!=typeof e)throw new TypeError('The "text" parameter must be a string.');const r=(new TextEncoder).encode(e),n=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,"0")).join("")}const ae=(e,t)=>e.bottom<t.top,ie=(e,t)=>e.top>t.bottom,se=(e,t)=>e.right<t.left,le=(e,t)=>e.left>t.right,ue=(e,t)=>e.bottom<=t.top,fe=(e,t)=>e.top>=t.bottom,ce=(e,t)=>e.right<=t.left,de=(e,t)=>e.left>=t.right,me=(e,t)=>!(se(e,t)||le(e,t)||ae(e,t)||ie(e,t)),pe=(e,t)=>!(ce(e,t)||de(e,t)||ue(e,t)||fe(e,t)),ye=(e,t)=>se(e,t)?"left":le(e,t)?"right":ae(e,t)?"top":ie(e,t)?"bottom":null,we=(e,t)=>ce(e,t)?"left":de(e,t)?"right":ue(e,t)?"top":fe(e,t)?"bottom":null,ge=(e,t)=>({overlapLeft:t.right-e.left,overlapRight:e.right-t.left,overlapTop:t.bottom-e.top,overlapBottom:e.bottom-t.top}),be=({overlapLeft:e=-1,overlapRight:t=-1,overlapTop:r=-1,overlapBottom:n=-1}={})=>({dirX:e<t?"right":"left",dirY:r<n?"bottom":"top"}),he=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function ve(e,t){const r=e.left+e.width/2,n=e.top+e.height/2;return{x:t.left+t.width/2-r,y:t.top+t.height/2-n}}function Ee(e,t){if(!pe(e,t))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:a}=ge(e,t),{dirX:i,dirY:s}=be({overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:a}),l=Math.min(r,n),u=Math.min(o,a);let f;return f=l<u?i:s,{inDir:f,dirX:i,dirY:s,depthX:l,depthY:u}}function Te(e,t){const r=pe(e,t),n={in:null,x:null,y:null},o={y:null,x:null},a={top:0,bottom:0,left:0,right:0},{overlapLeft:i,overlapRight:s,overlapTop:l,overlapBottom:u}=ge(t,e);a.top=l,a.bottom=u,a.left=i,a.right=s;const f=Object.entries(a).filter(([,e])=>e>0).sort((e,t)=>e[1]-t[1]),{dirX:c,dirY:d}=be({overlapLeft:s,overlapRight:i,overlapTop:u,overlapBottom:l});return n.y=d,n.x=c,a.bottom<0?o.y="bottom":a.top<0&&(o.y="top"),a.left<0?o.x="left":a.right<0&&(o.x="right"),n.in=r?a.top===a.bottom&&a.bottom===a.left&&a.left===a.right?"center":f.length?f[0][0]:"top":null,{dirs:n,depth:a,isNeg:o}}function Ie(e,t){if(!p(e))throw new TypeError("The first argument must be a non-null object.");if("function"!=typeof t)throw new TypeError("The second argument must be a function.");const r=Object.entries(e).filter(t);return Object.fromEntries(r)}function xe(e,t){if(void 0!==t.obj&&"function"!=typeof t.obj)throw new TypeError("filter.obj must be a function if provided.");if(void 0!==t.value&&"function"!=typeof t.value)throw new TypeError("filter.value must be a function if provided.");if(void 0!==t.array&&"function"!=typeof t.array)throw new TypeError("filter.array must be a function if provided.");let r;r=e instanceof Map?new Map:e instanceof Set?new Set:{};const n=(o=e)instanceof Map?Array.from(o.entries()):o instanceof Set?Array.from(o.values()).map(e=>[void 0,e]):Object.entries(o);var o;const a=(e,r)=>{const n=[];for(let o=0;o<e.length;o++){const i=e[o];if(Array.isArray(i))n.push(a(i,r));else if(p(i)){const r=xe(i,t);(void 0===t.obj||t.obj(r,o,e))&&n.push(r)}else(void 0===t.value||t.value([r,i],o,e))&&n.push(i)}return n};for(let e=0;e<n.length;e++){const[o,i]=n[e];if(Array.isArray(i)){const s=a(i,o);(void 0===t.array||t.array([o,s],e,n))&&(r instanceof Map||r instanceof Set?r instanceof Map?r.set(o,s):r.add(s):r[o]=s)}else if(p(i)){const a=xe(i,t);(void 0===t.obj||t.obj(a,e,n))&&(r instanceof Map?r.set(o,a):r instanceof Set?r.add(a):r[o]=a)}else(void 0===t.value||t.value([o,i],e,n))&&(r instanceof Map?r.set(o,i):r instanceof Set?r.add(i):r[o]=i)}return r}function Ae(e,t,r){if(!Array.isArray(t))throw new TypeError("The second argument must be an array.");if(void 0!==r&&!Array.isArray(r))throw new TypeError("The third argument must be an array.");return Ie(e,([e,n])=>t.length>0?t.some(t=>{if(Array.isArray(t)){const[r,o]=t,a=e===r,i="function"==typeof o?o(n):n===o;return a&&i}const o=e===t,a=void 0===r||r.some(e=>"function"==typeof e?e(n):e===n);return o&&a}):void 0!==r&&r.some(e=>"function"==typeof e?e(n):e===n))}const Ne=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("string"!=typeof e)throw new TypeError(`Expected "${t}" to be a string, but received ${typeof e}.`)},je=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("function"!=typeof e)throw new TypeError(`Expected "${t}" to be a function, but received ${typeof e}.`)},ke=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError(`Expected "${t}" to be a plain object, but received ${null===e?"null":Array.isArray(e)?"array":typeof e}.`)},Me=(e,t=!1)=>!t&&void 0===e,Se=(e,t=!1)=>Me(e,t)||"string"==typeof e||!t&&null===e,Oe=(e,t=!1)=>Me(e,t)||"number"==typeof e||!t&&null===e,De=(e,t=!1)=>Me(e,t)||"boolean"==typeof e||!t&&null===e,Fe=(e,t)=>!!Me(e)||(je(t,"valueValidator"),Array.isArray(e)&&e.every(t)),Le=new Map;class Ce extends Error{constructor(e,t,r){if(Ne(e,"message"),Ne(t,"url"),"string"!=typeof r)throw new TypeError(`Expected "stage" to be a string, but received ${typeof r}.`);super(e),this.name="MediaLoadingError",this.url=t,this.stage=r}}const Pe=async e=>{Ne(e,"str");const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,"0")).join("").substring(0,8)},Re=(e,t="image/jpeg")=>{if(!(e instanceof Uint8Array)&&"string"!=typeof e)throw new TypeError(`Expected "data" to be an instance of Uint8Array or a string, but received ${typeof e}.`);Ne(t,"format");const r=e=>{const t=URL.createObjectURL(e),r=Le.get(t);return Le.set(t,"number"==typeof r?r+1:1),t};if(e instanceof Uint8Array)return r(new Blob([e],{type:t}));if("string"==typeof e&&e.startsWith("data:")){const n=e.split(",")[1],o=atob(n),a=new Uint8Array(o.length);for(let e=0;e<o.length;e++)a[e]=o.charCodeAt(e);return r(new Blob([a],{type:t}))}return"string"==typeof e?e:""},Be=(e,t=!1)=>{if(m(e)){if(4!==d(e)){if(t)return!1;throw new TypeError("Invalid fetch data: Object must be an MediaContentFetchData.")}$e(e.common),ke(e.native,"_fetchData.native"),ke(e.format,"_fetchData.format"),ke(e.quality,"_fetchData.quality");for(const r in e.native){const n=e.native[r];if(!Fe(n,e=>"string"==typeof e.id)){if(t)return!1;throw new TypeError(`Invalid native data: "${r}" must be an array of native fetch data.`)}}}return!0},$e=e=>{if(ke(e,"common"),Be(e._fetchData),!Se(e.title))throw new TypeError('Invalid metadata: "title" must be a string or null.');if(!Se(e.album))throw new TypeError('Invalid metadata: "album" must be a string or null.');if(!Se(e.albumartist))throw new TypeError('Invalid metadata: "albumartist" must be a a string or null.');if(!Se(e.artist))throw new TypeError('Invalid metadata: "artist" must be a string or null.');if(!De(e.compilation))throw new TypeError('Invalid metadata: "compilation" must be a boolean or null.');if(!De(e.podcast))throw new TypeError('Invalid metadata: "podcast" must be a boolean or null.');if(!De(e.gapless))throw new TypeError('Invalid metadata: "gapless" must be a boolean or null.');if(!De(e.showMovement))throw new TypeError('Invalid metadata: "showMovement" must be a boolean or null.');if(!Oe(e.averageLevel))throw new TypeError('Invalid metadata: "averageLevel" must be a number or null.');if(!Oe(e.peakLevel))throw new TypeError('Invalid metadata: "peakLevel" must be a number or null.');if(!Oe(e.hdVideo))throw new TypeError('Invalid metadata: "hdVideo" must be a number or null.');if(!Oe(e.stik))throw new TypeError('Invalid metadata: "stik" must be a number or null.');if(!Oe(e.playCounter))throw new TypeError('Invalid metadata: "playCounter" must be a number or null.');if(!Oe(e.tvSeason))throw new TypeError('Invalid metadata: "tvSeason" must be a number or null.');if(!Oe(e.tvEpisode))throw new TypeError('Invalid metadata: "tvEpisode" must be a number or null.');if(!Oe(e.year))throw new TypeError('Invalid metadata: "year" must be a number or null.');if(!Oe(e.bpm))throw new TypeError('Invalid metadata: "bpm" must be a number or null.');if(!Oe(e.originalyear))throw new TypeError('Invalid metadata: "originalyear" must be a number or null.');if(!Oe(e.movementTotal))throw new TypeError('Invalid metadata: "movementTotal" must be a number or null.');if(!Se(e.date))throw new TypeError('Invalid metadata: "date" must be a string or null.');if(!Se(e.originaldate))throw new TypeError('Invalid metadata: "originaldate" must be a string or null.');if(!Se(e.releasedate))throw new TypeError('Invalid metadata: "releasedate" must be a string or null.');if(!Se(e.albumsort))throw new TypeError('Invalid metadata: "albumsort" must be a string or null.');if(!Se(e.titlesort))throw new TypeError('Invalid metadata: "titlesort" must be a string or null.');if(!Se(e.work))throw new TypeError('Invalid metadata: "work" must be a string or null.');if(!Se(e.artistsort))throw new TypeError('Invalid metadata: "artistsort" must be a string or null.');if(!Se(e.albumartistsort))throw new TypeError('Invalid metadata: "albumartistsort" must be a string or null.');if(!Se(e.composersort))throw new TypeError('Invalid metadata: "composersort" must be a string or null.');if(!Se(e.grouping))throw new TypeError('Invalid metadata: "grouping" must be a string or null.');if(!Se(e.longDescription))throw new TypeError('Invalid metadata: "longDescription" must be a string or null.');if(!Se(e.totaltracks))throw new TypeError('Invalid metadata: "totaltracks" must be a string or null.');if(!Se(e.totaldiscs))throw new TypeError('Invalid metadata: "totaldiscs" must be a string or null.');if(!Se(e.mood))throw new TypeError('Invalid metadata: "mood" must be a string or null.');if(!Se(e.media))throw new TypeError('Invalid metadata: "media" must be a string or null.');if(!Se(e.tvShow))throw new TypeError('Invalid metadata: "tvShow" must be a string or null.');if(!Se(e.tvShowSort))throw new TypeError('Invalid metadata: "tvShowSort" must be a string or null.');if(!Se(e.tvEpisodeId))throw new TypeError('Invalid metadata: "tvEpisodeId" must be a string or null.');if(!Se(e.tvNetwork))throw new TypeError('Invalid metadata: "tvNetwork" must be a string or null.');if(!Se(e.podcasturl))throw new TypeError('Invalid metadata: "podcasturl" must be a string or null.');if(!Se(e.releasestatus))throw new TypeError('Invalid metadata: "releasestatus" must be a string or null.');if(!Se(e.releasecountry))throw new TypeError('Invalid metadata: "releasecountry" must be a string or null.');if(!Se(e.script))throw new TypeError('Invalid metadata: "script" must be a string or null.');if(!Se(e.language))throw new TypeError('Invalid metadata: "language" must be a string or null.');if(!Se(e.copyright))throw new TypeError('Invalid metadata: "copyright" must be a string or null.');if(!Se(e.license))throw new TypeError('Invalid metadata: "license" must be a string or null.');if(!Se(e.encodedby))throw new TypeError('Invalid metadata: "encodedby" must be a string or null.');if(!Se(e.encodersettings))throw new TypeError('Invalid metadata: "encodersettings" must be a string or null.');if(!Se(e.barcode))throw new TypeError('Invalid metadata: "barcode" must be a string or null.');if(!Se(e.asin))throw new TypeError('Invalid metadata: "asin" must be a string or null.');if(!Se(e.website))throw new TypeError('Invalid metadata: "website" must be a string or null.');if(!Se(e.originalalbum))throw new TypeError('Invalid metadata: "originalalbum" must be a string or null.');if(!Se(e.originalartist))throw new TypeError('Invalid metadata: "originalartist" must be a string or null.');if(!Se(e.key))throw new TypeError('Invalid metadata: "key" must be a string or null.');if(!Se(e.movement))throw new TypeError('Invalid metadata: "movement" must be a string or null.');if(!Se(e.podcastId))throw new TypeError('Invalid metadata: "podcastId" must be a string or null.');if(!Fe(e.albumartists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "albumartists" must be an array of strings.');if(!Fe(e.genre,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "genre" must be an array of strings.');if(!Fe(e.label,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "label" must be an array of strings.');if(!Fe(e.composer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "composer" must be an array of strings.');if(!Fe(e.artists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "artists" must be an array of strings.');if(!Fe(e.lyricist,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "lyricist" must be an array of strings.');if(!Fe(e.writer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "writer" must be an array of strings.');if(!Fe(e.conductor,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "conductor" must be an array of strings.');if(!Fe(e.remixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "remixer" must be an array of strings.');if(!Fe(e.arranger,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "arranger" must be an array of strings.');if(!Fe(e.engineer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "engineer" must be an array of strings.');if(!Fe(e.publisher,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "publisher" must be an array of strings.');if(!Fe(e.producer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "producer" must be an array of strings.');if(!Fe(e.djmixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "djmixer" must be an array of strings.');if(!Fe(e.mixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "mixer" must be an array of strings.');if(!Fe(e.technician,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "technician" must be an array of strings.');if(!Fe(e.subtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "subtitle" must be an array of strings.');if(!Fe(e.description,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "description" must be an array of strings.');if(!Fe(e.discsubtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "discsubtitle" must be an array of strings.');if(!Fe(e.releasetype,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "releasetype" must be an array of strings.');if(!Fe(e.isrc,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "isrc" must be an array of strings.');if(!Fe(e.performer_instrument,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "performer_instrument" must be an array of strings.');if(!Fe(e.notes,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "notes" must be an array of strings.');if(!Fe(e.category,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "category" must be an array of strings.');if(!Fe(e.keywords,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "keywords" must be an array of strings.');if(!Fe(e.catalognumber,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "catalognumber" must be an array of strings.');if(!Fe(e.picture,e=>e&&"object"==typeof e&&(void 0===e.description||"string"==typeof e.description)&&(void 0===e.name||"string"==typeof e.name)&&(void 0===e.type||"string"==typeof e.type)&&"string"==typeof e.format&&(e.data instanceof Uint8Array||"string"==typeof e.data)))throw new TypeError('Invalid metadata: "picture" must be an array of pictures.');if(!Fe(e.comment,e=>null!==e&&"object"==typeof e&&Se(e.descriptor)&&Se(e.language)&&Se(e.text)))throw new TypeError('Invalid metadata: "comment" must be an array of valid IComment objects.');if(!Fe(e.lyrics,e=>null!==e&&"object"==typeof e&&Se(e.text)&&Se(e.descriptor)&&Se(e.language)&&(!Array.isArray(e)||Fe(e.syncText,e=>null!==e&&"object"==typeof e&&Se(e.text)&&Oe(e.timestamp)))&&(e=>void 0===e||null!==e&&"object"==typeof e&&Oe(e.notSynchronized)&&Oe(e.mpegFrameNumber)&&Oe(e.milliseconds))(e.timeStampFormat)&&(e=>void 0===e||null!==e&&"object"==typeof e&&Oe(e.other)&&Oe(e.lyrics)&&Oe(e.text)&&Oe(e.movement_part)&&Oe(e.events)&&Oe(e.chord)&&Oe(e.trivia_pop))(e.contentType)))throw new TypeError('Invalid metadata: "lyrics" must be an array of valid ILyricsTag objects.');if(!Fe(e.rating,e=>null!==e&&"object"==typeof e&&Se(e.source)&&Oe(e.rating)))throw new TypeError('Invalid metadata: "rating" must be an array of valid IRating objects.');const t=(e,t)=>{if(!Me(t)&&null!==t){if("object"!=typeof t)throw new TypeError(`Invalid metadata: "${e}" must be an object or null.`);if("number"!=typeof t.no&&null!==t.no)throw new TypeError(`Invalid metadata: "${e}.no" must be a number or null.`);if("number"!=typeof t.of&&null!==t.of)throw new TypeError(`Invalid metadata: "${e}.of" must be a number or null.`)}};t("disk",e.disk),t("track",e.track),t("movementIndex",e.movementIndex)},Ue=async(e,t,r=!0)=>{Ne(e,"url"),je(t,"parseFile");const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch audio file: ${n.status} ${n.statusText}`);const o=await n.blob(),a=await t(o);if(!a||"object"!=typeof a.common)throw new TypeError('Invalid metadata: "common" property is missing.');void 0!==typeof a.common["performer:instrument"]&&(a.common.performer_instrument=a.common["performer:instrument"]),Be(a);const i=a.common;$e(i);const s=i?.picture?.map(e=>({...e,data:r?Re(e.data,e.format):e.data}))??[];a.common={...a.common,picture:s.map(e=>({...e,data:""}))},r&&Object.keys(a.native).forEach(e=>{a.native[e]=a.native[e].map(e=>{if(e.value&&"object"==typeof e.value&&e.value.data instanceof Uint8Array){const t=i?.picture?.findIndex(t=>t.data===e.value.data&&t.format===e.value.format&&t.description===e.value.description&&t.name===e.value.name)??-1;if(s[t])return{...e,value:{...e.value,data:""}}}return e})});const l=xe({title:i?.title,album:i?.album,albumartist:i?.albumartist,albumartists:i?.albumartists,genre:i?.genre,label:i?.label,composer:i?.composer,year:i?.year,artist:i?.artist,artists:i?.artists,disk:i?.disk?{no:i.disk.no,of:i.disk.of}:void 0,track:i?.track?{no:i.track.no,of:i.track.of}:void 0,movementIndex:i?.movementIndex?{no:i.movementIndex.no,of:i.movementIndex.of}:void 0,picture:s,date:i?.date,originaldate:i?.originaldate,originalyear:i?.originalyear,releasedate:i?.releasedate,comment:i?.comment,lyrics:i?.lyrics,albumsort:i?.albumsort,titlesort:i?.titlesort,work:i?.work,artistsort:i?.artistsort,albumartistsort:i?.albumartistsort,composersort:i?.composersort,lyricist:i?.lyricist,writer:i?.writer,conductor:i?.conductor,remixer:i?.remixer,arranger:i?.arranger,engineer:i?.engineer,publisher:i?.publisher,producer:i?.producer,djmixer:i?.djmixer,mixer:i?.mixer,technician:i?.technician,grouping:i?.grouping,subtitle:i?.subtitle,description:i?.description,longDescription:i?.longDescription,discsubtitle:i?.discsubtitle,totaltracks:i?.totaltracks,totaldiscs:i?.totaldiscs,movementTotal:i?.movementTotal,compilation:i?.compilation,rating:i?.rating,bpm:i?.bpm,mood:i?.mood,media:i?.media,catalognumber:i?.catalognumber,tvShow:i?.tvShow,tvShowSort:i?.tvShowSort,tvSeason:i?.tvSeason,tvEpisode:i?.tvEpisode,tvEpisodeId:i?.tvEpisodeId,tvNetwork:i?.tvNetwork,podcast:i?.podcast,podcasturl:i?.podcasturl,releasestatus:i?.releasestatus,releasetype:i?.releasetype,releasecountry:i?.releasecountry,script:i?.script,language:i?.language,copyright:i?.copyright,license:i?.license,encodedby:i?.encodedby,encodersettings:i?.encodersettings,gapless:i?.gapless,barcode:i?.barcode,isrc:i?.isrc,asin:i?.asin,website:i?.website,performer_instrument:i?.performer_instrument,averageLevel:i?.averageLevel,peakLevel:i?.peakLevel,notes:i?.notes,originalalbum:i?.originalalbum,originalartist:i?.originalartist,key:i?.key,category:i?.category,hdVideo:i?.hdVideo,keywords:i?.keywords,movement:i?.movement,podcastId:i?.podcastId,showMovement:i?.showMovement,stik:i?.stik,playCounter:i?.playCounter},{value:([e,t])=>null!=t,obj:e=>d(e)>0,array:([e,t])=>t.length>0});return l._fetchData=a,l},_e=async(e,t={},r={},n=e=>{if(!(e instanceof Blob))throw new TypeError('Expected "data" to be a Blob.');return new Promise((e,t)=>t(new TypeError("parseFile library not found.")))},o={},a=!0,i="null")=>{if("string"!=typeof e&&!(e instanceof HTMLMediaElement))throw new TypeError("Source must be a string or an HTMLMediaElement.");if(ke(t,"defaultMetadata"),ke(r,"metadata"),je(n,"parseFile"),ke(o,"callbacks"),o.onProgress&&"function"!=typeof o.onProgress)throw new TypeError("callbacks.onProgress must be a function.");if(o.onError&&"function"!=typeof o.onError)throw new TypeError("callbacks.onError must be a function.");if("string"!=typeof i&&"function"!=typeof i)throw new TypeError("unknownArtist must be a string or a function returning a string.");let s,l="";const u=(t,r)=>{if(Ne(t,"stage"),void 0!==r&&!(r instanceof Event))throw new TypeError('Expected "event" to be an Event or undefined.');o.onProgress&&o.onProgress({event:r,status:"loading",stage:t,url:l||(e instanceof HTMLMediaElement?e.src:"unknown")})},f=(t,r)=>{if(!(t instanceof Error))throw new TypeError('Expected "error" to be an Error.');Ne(r,"stage"),o.onError&&o.onError({error:t instanceof Error?t:new Error(String(t)),url:l||(e instanceof HTMLMediaElement?e.src:"unknown"),stage:r})};try{u("INITIALIZING"),"string"==typeof e?(l=e,s=new Audio(l)):(s=e,l=s.src);try{await new Promise((e,t)=>{const r=e=>u("DOWNLOADING",e),n=()=>{a(),e(void 0)},o=e=>{a(),t(new Error(`HTMLMediaElement failed to load: ${e.message||"Unknown error"}`))},a=()=>{s.removeEventListener("progress",r),s.removeEventListener("loadedmetadata",n),s.removeEventListener("error",o)};s.addEventListener("progress",r),s.addEventListener("loadedmetadata",n),s.addEventListener("error",o),s.readyState>=1&&(a(),e(void 0))}),u("METADATA_LOADED")}catch(e){throw new Ce(e instanceof Error?e.message:"UNKNOWN ERROR",l,"METADATA")}const c={id:r.id||await Pe(l),duration:Math.floor(1e3*s.duration),url:l,weight:r.weight??1};let d={};u("EXTRACTING_ID3");try{d=await Ue(l,n,a)}catch(e){f(e instanceof Error?e:new Error("Unknown Error"),"ID3"),console.warn(`[TinyAudioUtils] ID3 extraction failed for ${l}. Falling back to filename.`)}const p=e=>{Ne(e,"url");try{return(e.split(/[?#]/)[0].split("/").pop()??"").replace(/\.[^/.]+$/,"")||"Unknown Track"}catch{return"Unknown Track"}},y=e=>{const t={...e};return m(t._fetchData)&&(m(d._fetchData)&&(t._fetchData={...d._fetchData}),m(e._fetchData)&&(void 0!==e._fetchData.common&&(t._fetchData.common=e._fetchData.common),void 0!==e._fetchData.native&&(t._fetchData.native=e._fetchData.native),void 0!==e._fetchData.format&&(t._fetchData.format=e._fetchData.format),void 0!==e._fetchData.quality&&(t._fetchData.quality=e._fetchData.quality))),t},w={...c,...y(t),...d,...y(r),title:d.title||r.title||p(l),artist:d.artist||r.artist||("string"==typeof i?i:String(i()))};return o.onProgress&&o.onProgress({status:"success",stage:"COMPLETE",url:l}),w}catch(e){if(e instanceof Ce)throw e;const t=new Ce(e instanceof Error?e.message:"UNKNOWN ERROR",l,"INITIALIZING");throw f(t,"INITIALIZING"),t}},He=(e,t=100)=>{if("function"!=typeof e)throw new TypeError("Expected 'getValue' to be a function.");if(!Number.isFinite(t)||t<=0)throw new TypeError("Expected 'checkInterval' to be a positive number.");return new Promise(r=>{const n=setInterval(()=>{e()&&(clearInterval(n),r())},t)})},Ye=(e,t=!0)=>{if("function"!=typeof e)throw new TypeError('The argument "baseFunction" must be a function.');let r=null;const n={ended:!1,failed:!1,loading:!1};return{callback:async(...o)=>(null!==r||(n.loading=!0,r=(async()=>{try{const a=await e(...o);return n.ended=!0,n.failed=!1,n.loading=!1,t&&(r=null),a}catch(e){throw n.ended=!0,n.failed=!0,n.loading=!1,t&&(r=null),e}})()),r),getActivePromise:()=>r,resetActivePromise:()=>{n.ended=!1,n.failed=!1,n.loading=!1,r=null},isEnded:()=>n.ended,isFailed:()=>n.failed,isLoading:()=>n.loading}},qe=()=>"undefined"!=typeof window&&void 0!==window.document,Ve="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:null,ze="undefined"!=typeof document?document:null,Je=["chrome","firefox","ie","edge","safari","opera","yandex","other"];function We(){if("undefined"==typeof navigator)return"other";const e=navigator.userAgent;return-1!==e.indexOf("Chrome")?"chrome":-1!==e.indexOf("Firefox")?"firefox":-1!==e.indexOf("MSIE")?"ie":-1!==e.indexOf("Edge")?"edge":-1!==e.indexOf("Safari")?"safari":-1!==e.indexOf("Opera")?"opera":-1!==e.indexOf("YaBrowser")?"yandex":"other"}function Xe(){const e=Ve?.getComputedStyle?(Array.prototype.slice.call(Ve.getComputedStyle(document.documentElement,"")).join("").match(/-(moz|webkit|ms)-/)??["",""])[1]:"";return"moz"===e?"gecko":"webkit"===e?"webkit":"ms"===e?"trident":"other"}function Ge(){const e=!!Ve?.opr&&!!opr.addons||!!Ve?.opera||navigator.userAgent.indexOf(" OPR/")>=0,t="undefined"!=typeof InstallTrigger,r=!!Ve?.HTMLElement&&/constructor/i.test(Ve.HTMLElement)||"[object SafariRemoteNotification]"===(!Ve.safari||"undefined"!=typeof safari&&safari.pushNotification).toString(),n=!!ze?.documentMode,o=!n&&!!Ve?.StyleMedia,a=!!Ve?.chrome;return{isOpera:e,isFirefox:t,isSafari:r,isIE:n,isEdge:o,isChrome:a,isBlink:(a||e)&&!!Ve?.CSS}}function Ke(e=[]){if(!Array.isArray(e))throw new TypeError('The "disable" argument must be an array.');for(const t of e)if(!Je.includes(t))throw new TypeError(`Invalid browser name provided in disable array: ${t}`);const t={chrome:0,firefox:0,ie:0,edge:0,safari:0,opera:0,yandex:0,other:0};t[We()]++;const r=Xe();"gecko"===r?e.indexOf("firefox")<0&&t.firefox++:"webkit"===r?(e.indexOf("chrome")<0&&t.chrome++,e.indexOf("safari")<0&&t.safari++,e.indexOf("opera")<0&&t.opera++,e.indexOf("edge")<0&&t.edge++):"trident"===r?e.indexOf("ie")<0&&t.ie++:e.indexOf("other")<0&&t.other++;const n=Ge();return n.isOpera&&e.indexOf("opera")<0&&t.opera++,n.isFirefox&&e.indexOf("firefox")<0&&t.firefox++,n.isSafari&&e.indexOf("safari")<0&&t.safari++,n.isIE&&e.indexOf("ie")<0&&t.ie++,n.isEdge&&e.indexOf("edge")<0&&t.edge++,n.isChrome&&e.indexOf("chrome")<0&&t.chrome++,t}function Ze(e=[]){const t=Ke(e);return Object.keys(t).reduce((e,r)=>t[r]>t[e]?r:e)}window.TinyBasicsEs=t})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";const e={cw:e=>{var t;return()=>{if(e){var i=e;e=0,t={exports:{}},i.call(t.exports,t,t.exports)}return t.exports}},d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyBrowserMonitor:()=>c});var i=e.cw(function(e,t){var i,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(i,n){function r(i){e.removeListener(t,s),n(i)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",r),i([].slice.call(arguments))}m(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,r)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function h(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,i,n){var r,s,o,a;if(c(i),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),o=s[t]),void 0===o)o=s[t]=i,++e._eventsCount;else if("function"==typeof o?o=s[t]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(r=h(e))>0&&o.length>r&&!o.warned){o.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=o.length,a=d,console&&console.warn&&console.warn(a)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=l.bind(n);return r.listener=i,n.wrapFn=r,r}function f(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(r):u(r,r.length)}function y(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function u(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function m(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function r(s){n.once&&e.removeEventListener(t,r),i(s)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return h(this)},o.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var h=c.length,d=u(c,h);for(i=0;i<h;++i)r(d[i],this,t)}return!0},o.prototype.addListener=function(e,t){return d(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return d(this,e,t,!0)},o.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var i,n,r,s,o;if(c(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(r=-1,s=i.length-1;s>=0;s--)if(i[s]===t||i[s].listener===t){o=i[s].listener,r=s;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,r),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var r,s=Object.keys(i);for(n=0;n<s.length;++n)"removeListener"!==(r=s[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},o.prototype.listenerCount=y,o.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}});i();class n{static generateHash(e){let t;try{t="object"==typeof e&&null!==e?JSON.stringify(e):String(e)}catch(e){throw new TypeError("Failed to stringify item for hashing. Ensure the object does not have circular references.")}let i=0;for(let e=0,n=t.length;e<n;e++)i=(i<<5)-i+t.charCodeAt(e),i|=0;return i.toString(36)}#e=[];#t=null;#i=!0;get idKey(){return this.#t}set idKey(e){if(null!==e&&"string"!=typeof e)throw new TypeError("The idKey must be a string or null.");this.#t=e}get deepComparison(){return this.#i}set deepComparison(e){if("boolean"!=typeof e)throw new TypeError("The deepComparison option must be a boolean.");this.#i=e}get oldArray(){return this.#e}set oldArray(e){if(!Array.isArray(e))throw new TypeError("The provided oldArray must be a valid Array.");this.#e=e}constructor(e,t={}){void 0!==e&&(this.oldArray=e),"string"==typeof t.idKey&&(this.idKey=t.idKey),"boolean"==typeof t.deepComparison&&(this.deepComparison=t.deepComparison)}_generateHash(e){return n.generateHash(e)}#n(e,t){const i={added:{},deleted:{},modified:{},nested:{}},n=new Set([...Object.keys(e),...Object.keys(t)]);for(const r of n){const n=e[r],s=t[r];if(r in e)if(r in t)if("object"!=typeof n||null===n||"object"!=typeof s||null===s||Array.isArray(n)||Array.isArray(t))n!==s&&(i.modified[r]={oldValue:n,newValue:s});else{const e=this.#n(n,s);(Object.keys(e.added).length>0||Object.keys(e.deleted).length>0||Object.keys(e.modified).length>0||Object.keys(e.nested).length>0)&&(i.nested[r]=e)}else i.deleted[r]=n;else i.added[r]=s}return i}compare(e){if(!Array.isArray(e))throw new TypeError("The provided newArray must be a valid Array.");const t={oldItemsMap:new Map,affectedItems:[]};for(const e of this.#e){const i=this._generateHash(e),n=null!==this.#t&&null!==e&&"object"==typeof e&&this.#t in e?e[this.#t]:i;t.oldItemsMap.set(n,{item:e,hash:i})}for(const i of e){const e=this._generateHash(i),n=null!==this.#t&&null!==i&&"object"==typeof i&&this.#t in i?i[this.#t]:e,r=t.oldItemsMap.get(n);if(r)if(r.hash===e)t.oldItemsMap.delete(n);else{const e={item:i,oldItem:r.item,status:"edited"};this.#i&&"object"==typeof i&&null!==i&&"object"==typeof r.item&&null!==r.item&&(e.details=this.#n(r.item,i)),t.affectedItems.push(e),t.oldItemsMap.delete(n)}else t.affectedItems.push({item:i,status:"added"})}for(const e of t.oldItemsMap.values())t.affectedItems.push({item:e.item,status:"deleted"});return t.affectedItems}}const r=n,s=e=>{if(e)throw new Error("This TinyBrowserMonitor instance has been destroyed and can no longer be used.")};const o=i().EventEmitter;class a extends o{static#r=["connectivity","quality","battery","device","cpu","gpu","performance","resource","paint","navigation","layout-shift","lcp","longtask","memory-usage","fps","window","screen"];static get VALID_SYSTEMS(){return Object.freeze([...a.#r])}#s=!1;#o=new Set;#a={isOnline:navigator.onLine};#c=null;#h;#d;#l={usedJSHeapSize:0,totalJSHeapSize:0,jsHeapSizeLimit:0,enabled:!!performance.memory};#p={downlink:0,rtt:0,effectiveType:"unknown",saveData:!1,enabled:!!navigator.connection};#f=[];#y={level:1,charging:!0,chargingTime:0,dischargingTime:0,enabled:!1};#u={memory:0,cpu:{logicalCores:0},gpu:{vendor:"unknown",renderer:"unknown"},enabled:!!navigator.deviceMemory};#m={fps:60,timestamp:performance.now()};#v=null;#g={paint:{firstPaint:0,firstContentfulPaint:0},navigation:null,layoutShift:0,lcp:0,fps:this.#m,longTasks:[]};#w={width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio};#b={width:window.screen.width,height:window.screen.height,availWidth:window.screen.availWidth,availHeight:window.screen.availHeight,colorDepth:window.screen.colorDepth,pixelDepth:window.screen.pixelDepth,orientation:window.screen.orientation?.type||"unknown"};#S;#E=[];constructor(e={}){super();const{resourceLimit:t=1e3,systems:i=[],memoryIntervalMs:n=100,fpsIntervalMs:r=1e3}=e;if("number"!=typeof t||t<-1)throw new TypeError("The resourceLimit must be a number greater than or equal to -1.");if("number"!=typeof n||n<16)throw new TypeError("The memoryIntervalMs must be a number greater than or equal to 16.");if("number"!=typeof r||r<0)throw new TypeError("The fpsIntervalMs must be a number greater than or equal to 0.");if(!Array.isArray(i))throw new TypeError("The systems option must be an array.");for(const e of i)if(!a.#r.includes(e))throw new TypeError(`Invalid system identifier: "${e}". Must be one of: ${a.#r.join(", ")}`);this.#S=t,this.#h=n,this.#d=r,this.#o=0===i.length?new Set(a.#r):new Set(i),this.#L(),this.#M()}#L(){this.#o.has("connectivity")&&this.#j(),this.#o.has("quality")&&this.#O(),this.#o.has("battery")&&this.#T(),this.#o.has("memory-usage")&&this.#z(),this.#o.has("fps")&&this.#I(),this.#o.has("window")&&this.#D(),this.#o.has("screen")&&this.#_(),(this.#o.has("device")||this.#o.has("cpu")||this.#o.has("gpu"))&&this.#k();const e=this.#o.has("performance"),t=["resource","paint","navigation","layout-shift","lcp","longtask"].some(e=>this.#o.has(e));(e||t)&&this.#C(e)}get isDestroyed(){return this.#s}get connectivity(){return s(this.#s),Object.freeze({...this.#a})}get quality(){return s(this.#s),Object.freeze({...this.#p})}get resources(){return s(this.#s),Object.freeze(this.#f.map(e=>Object.freeze({...e})))}get battery(){return s(this.#s),Object.freeze({...this.#y})}get windowMetrics(){return s(this.#s),Object.freeze({...this.#w})}get screenMetrics(){return s(this.#s),Object.freeze({...this.#b})}get device(){return s(this.#s),Object.freeze({...this.#u})}get fps(){return s(this.#s),Object.freeze({...this.#m})}get performance(){return s(this.#s),Object.freeze({...this.#g,paint:Object.freeze({...this.#g.paint}),fps:Object.freeze({...this.#g.fps}),navigation:this.#g.navigation?Object.freeze({...this.#g.navigation}):null})}get memoryUsage(){return s(this.#s),Object.freeze({...this.#l})}get enabledSystems(){return s(this.#s),Object.freeze([...this.#o])}has(e){if(s(this.#s),"string"!=typeof e)throw new TypeError("The system identifier must be a string.");return this.#o.has(e)}get size(){return s(this.#s),this.#o.size}getFormattedMemoryUsage(e,t=this.#l){s(this.#s);const i=["bytes","KB","MB","GB"];if("string"!=typeof e||!i.includes(e))throw new TypeError(`Invalid format: "${e}". Must be one of: ${i.join(", ")}`);if("object"!=typeof t||null===t)throw new TypeError("The memoryUsage argument must be a non-null object.");const n=["usedJSHeapSize","totalJSHeapSize","jsHeapSizeLimit"];for(const e of n)if("number"!=typeof t[e]||Number.isNaN(t[e]))throw new TypeError(`Invalid memoryUsage: Property "${e}" must be a valid number.`);const r={bytes:1,KB:1024,MB:Math.pow(1024,2),GB:Math.pow(1024,3)}[e],o=e=>e/r;return{used:o(t.usedJSHeapSize),total:o(t.totalJSHeapSize),limit:o(t.jsHeapSizeLimit)}}#D(){window.addEventListener("resize",this.#A),this.#x()}#x(){this.#w={width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio}}#_(){this.#b={width:window.screen.width,height:window.screen.height,availWidth:window.screen.availWidth,availHeight:window.screen.availHeight,colorDepth:window.screen.colorDepth,pixelDepth:window.screen.pixelDepth,orientation:window.screen.orientation?.type||"unknown"}}#A=()=>{this.#x(),this.emit("WindowResize",Object.freeze({...this.#w}))};#j(){window.addEventListener("online",this.#P),window.addEventListener("offline",this.#P),navigator.connection&&navigator.connection.addEventListener("change",this.#P)}#I(){let e=0,t=performance.now();const i=n=>{e++,n-t>=this.#d&&(this.#m={fps:Math.round(1e3*e/(n-t)),timestamp:n},e=0,t=n,this.emit("FPS",Object.freeze({...this.#m}))),this.#v=requestAnimationFrame(i)};this.#v=requestAnimationFrame(i)}#k(){this.#u={memory:0,cpu:{logicalCores:0},gpu:{vendor:"unknown",renderer:"unknown"},enabled:!1};let e=!1;if(this.#o.has("device")&&("number"==typeof navigator.deviceMemory&&(this.#u.memory=navigator.deviceMemory,e=!0),this.#o.has("cpu")&&"number"==typeof navigator.hardwareConcurrency&&(this.#u.cpu.logicalCores=navigator.hardwareConcurrency,e=!0),this.#o.has("gpu")))try{const t=document.createElement("canvas"),i=t.getContext("webgl")||t.getContext("experimental-webgl");if(i instanceof WebGLRenderingContext){const t=i.getExtension("WEBGL_debug_renderer_info");t&&(this.#u.gpu.vendor=i.getParameter(t.UNMASKED_VENDOR_WEBGL)||"unknown",this.#u.gpu.renderer=i.getParameter(t.UNMASKED_RENDERER_WEBGL)||"unknown",e=!0)}}catch(e){console.warn("TinyBrowserMonitor: GPU retrieval failed.",e)}this.#u.enabled=e}async#T(){if(navigator.getBattery)try{const e=await navigator.getBattery();this.#y.enabled=!0;const t=()=>{this.#y={level:e.level,charging:e.charging,chargingTime:e.chargingTime,dischargingTime:e.dischargingTime,enabled:!0},this.emit("BatteryUpdated",Object.freeze({...this.#y})),this.#M()};e.addEventListener("levelchange",t),e.addEventListener("chargingchange",t),e.addEventListener("chargingtimechange",t),e.addEventListener("dischargingtimechange",t),t()}catch(e){console.warn("Battery Status API failed to initialize:",e)}}#z(){if(performance.memory){const e=()=>{const e=performance.memory;e&&(this.#l={usedJSHeapSize:e.usedJSHeapSize,totalJSHeapSize:e.totalJSHeapSize,jsHeapSizeLimit:e.jsHeapSizeLimit,enabled:!0},this.emit("MemoryUsage",Object.freeze({...this.#l})))};this.#c=setInterval(e,this.#h),e()}}#C(e=!1){const t=[{key:"resource",type:"resource",callback:this.#U.bind(this)},{key:"paint",type:"paint",callback:this.#R.bind(this)},{key:"navigation",type:"navigation",callback:this.#H.bind(this)},{key:"layout-shift",type:"layout-shift",callback:this.#q.bind(this)},{key:"lcp",type:"largest-contentful-paint",callback:this.#K.bind(this)},{key:"longtask",type:"longtask",callback:this.#B.bind(this)}];for(const i of t)if(e||this.#o.has(i.key))try{const e=new PerformanceObserver(i.callback);e.observe({type:i.type,buffered:!0}),this.#E.push(e)}catch(e){console.error(e)}}#U(e){const t=e.getEntries(),i=new r(this.#f.map(e=>({...e})),{idKey:"name"});t.forEach(e=>{this.#f.push({name:e.name,duration:e.duration,entryType:e.entryType})}),this.#S>0&&this.#f.length>this.#S&&this.#f.splice(0,this.#f.length-this.#S);const n=i.compare(this.#f);for(const e of n)this.emit("Resource"+("added"===e.status?"Added":"deleted"===e.status?"Deleted":"Edited"),e.oldItem,e.item);this.#M()}#R(e){e.getEntries().forEach(e=>{"first-paint"===e.name?this.#g.paint.firstPaint=e.startTime:"first-contentful-paint"===e.name&&(this.#g.paint.firstContentfulPaint=e.startTime)}),this.emit("PaintUpdated",Object.freeze({...this.#g.paint})),this.#M()}#H(e){const t=e.getEntries()[0];t&&(this.#g.navigation={ttfb:t.responseStart-t.requestStart,domContentLoaded:t.domContentLoadedEventEnd-t.startTime,loadEvent:t.loadEventEnd-t.startTime}),this.emit("NavigationUpdated",Object.freeze({...this.#g.navigation})),this.#M()}#q(e){e.getEntries().forEach(e=>{const t=e;t.hadRecentInput||(this.#g.layoutShift+=t.value)}),this.emit("LayoutShiftUpdated",{layoutShift:this.#g.layoutShift}),this.#M()}#K(e){const t=e.getEntries().pop();t&&(this.#g.lcp=t.startTime),this.emit("LcpUpdated",{lcp:this.#g.lcp}),this.#M()}#B(e){e.getEntries().forEach(e=>{this.#g.longTasks.push(e.duration)}),this.emit("LongTaskUpdated",{lcp:[...this.#g.longTasks]}),this.#M()}#P=e=>{this.#o.has("connectivity")&&this.#W(),this.#o.has("quality")&&this.#O(),this.#M(e)};#W(){this.#a={isOnline:navigator.onLine},this.emit("ConnectivityUpdated",{...this.#a})}#O(){if(navigator.connection){const{downlink:e,rtt:t,effectiveType:i,saveData:n}=navigator.connection;this.#p={downlink:"number"==typeof e?e:0,rtt:"number"==typeof t?t:0,effectiveType:"string"==typeof i?i:"unknown",saveData:"boolean"==typeof n&&n,enabled:!0}}}#M(e){this.#N();const t={connectivity:Object.freeze({...this.#a}),quality:Object.freeze({...this.#p}),resources:Object.freeze(this.#f.map(e=>Object.freeze({...e}))),battery:Object.freeze({...this.#y}),device:Object.freeze({...this.#u}),performance:this.performance,memoryUsage:Object.freeze({...this.#l}),windowMetrics:Object.freeze({...this.#w}),screenMetrics:Object.freeze({...this.#b}),event:e};this.emit("NetworkUpdated",t)}#N(){if("boolean"!=typeof this.#a.isOnline)throw new TypeError("Internal Error: Connectivity status is invalid.");if("number"!=typeof this.#p.downlink)throw new TypeError("Internal Error: Quality metrics are invalid.")}destroy(){this.#s||(this.#o.has("connectivity")&&(window.removeEventListener("online",this.#P),window.removeEventListener("offline",this.#P)),this.#o.has("window")&&window.removeEventListener("resize",this.#A),this.#o.has("quality")&&navigator.connection&&navigator.connection.removeEventListener("change",this.#P),this.#o.has("performance")&&(this.#E.forEach(e=>e.disconnect()),this.#E=[]),this.#c&&clearInterval(this.#c),this.#v&&cancelAnimationFrame(this.#v),this.removeAllListeners(),this.#s=!0,this.emit("Destroyed"))}}const c=a;window.TinyBrowserMonitor=t.TinyBrowserMonitor})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const
|
|
1
|
+
(()=>{"use strict";const s={d:(e,n)=>{for(var a in n)s.o(n,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(s,e)=>Object.prototype.hasOwnProperty.call(s,e)};let e={};s.d(e,{TinyClassManager:()=>a});class n{#s=new Set;get appliedPlugins(){if(this.#e)throw new Error("[TinyClassManager] Cannot get a consumed manager instance.");return[...this.#s]}#n=[];get appliedPluginClasses(){if(this.#e)throw new Error("[TinyClassManager] Cannot get a consumed manager instance.");return[...this.#n]}get size(){if(this.#e)throw new Error("[TinyClassManager] Cannot get a consumed manager instance.");return this.#n.length}#a;get currentClass(){if(this.#e)throw new Error("[TinyClassManager] Cannot get a consumed manager instance.");return this.#a}#e=!1;get used(){return this.#e}constructor(s,e=[]){this.#a=s,this.#n=[...e,s]}#i(s,e,a){if(this.#e)throw new Error("[TinyClassManager] Cannot reuse a consumed manager instance.");if(this.#s.has(s))throw new Error(`[TinyClassManager] Plugin conflict: "${s}" is already installed.`);for(const n of e)if(!this.#s.has(n))throw new Error(`[TinyClassManager] Missing Dependency: "${s}" requires "${n}" to be installed first.`);const i=new n(a,this.#n);return this.#s.forEach(s=>i.#s.add(s)),i.#s.add(s),this.#e=!0,this.#s.clear(),this.#n=[],i}use(s){const e=s.dependencies||[],n=s.apply(this.#a,this.appliedPluginClasses);return this.#i(s.name,e,n)}insert(s){const e=s(this.#a,this.appliedPluginClasses),n=e._tinyDepName;if(!n)throw new Error("[TinyClassManager] Plugin class must define a static '_tinyDepName' property.");const a=e._tinyDeps??[];if(!Array.isArray(a)||!a.every(s=>"string"==typeof s))throw new Error("[TinyClassManager] Plugin class must define a static array of strings in '_tinyDepName' property.");return this.#i(n,a,e)}build(){if(this.#e)throw new Error("[TinyClassManager] Cannot build from an already finalized manager.");return this.#e=!0,this.#s.clear(),this.#n=[],this.#a}}const a=n;window.TinyClassManager=e.TinyClassManager})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const e={d:(t,r)=>{
|
|
1
|
+
(()=>{"use strict";const e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyClipboard:()=>r});const r=class{#e=!1;#t=!1;#r=null;#o=null;constructor(){void 0!==navigator.clipboard&&null!==navigator.clipboard&&(this.#t=!0,this.#r=e=>navigator.clipboard.writeText(e),this.#o=e=>navigator.clipboard.write([new ClipboardItem({[e.type]:e})])),this.#e=void 0!==document.execCommand&&null!==document.execCommand}setCopyText(e){if("function"!=typeof e)throw new TypeError("setCopyText expected a function that returns Promise<void>.");this.#r=e}setCopyBlob(e){if("function"!=typeof e)throw new TypeError("setCopyBlob expected a function that returns Promise<void>.");this.#o=e}copyText(e){if("string"!=typeof e)throw new TypeError("copyText expected a string.");if(this.#r)return this.#r(e);if(this.#e){const t=document.body,r=document.createElement("input");return r.style.position="fixed",r.style.opacity="0",r.value=e,t.append(r),r.select(),r.setSelectionRange(0,99999),document.execCommand("Copy"),r.remove(),new Promise(e=>e(void 0))}throw new Error("Clipboard API not found!")}copyBlob(e){if(!(e instanceof Blob))throw new TypeError("copyBlob expected a Blob instance.");return new Promise((t,r)=>{if(this.#o)return this.#o(e).then(t).catch(r);throw new Error("Clipboard API not found!")})}_handleBlob(e,t){return t.getType(e)}_handleText(e,t){return this._handleBlob(e,t).then(e=>e.text())}_readData(e=0,t=null,r=null,o=!1){return new Promise((n,a)=>{this._read(e).then(i=>{if(!i)return n(null);const s=[];let l=!0;const c=async(e,n)=>{if(l)if(null!==t&&"custom"!==t||"string"!=typeof r||!(!o&&e.startsWith(r)||o&&e===r))if(null!==t&&"text"!==t||"text/plain"!==e){if(null===t){l=!1;const t=await this._handleBlob(e,n);t&&s.push(t)}}else{l=!1;const t=await this._handleText(e,n);t&&s.push(t)}else{l=!1;const t=await this._handleBlob(e,n);t&&s.push(t)}},d=[],u=e=>{if(!(e instanceof ClipboardItem))throw new Error("Expected ClipboardItem when reading data.");for(const t in e.types)d.push(c(e.types[t],e))};if("number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)&&e>-1)u(i),Promise.all(d).then(()=>{s[0]?n(s[0]):n(null)}).catch(a);else if(Array.isArray(i)){for(const e in i)u(i[e]);Promise.all(d).then(()=>n(s)).catch(a)}}).catch(a)})}async readText(e=0){const t=await this._readData(e,"text");if("string"!=typeof t)throw new Error("Failed to read text: expected string result.");return t}async readCustom(e=null,t=!1,r=0){const o=await this._readData(r,"custom",e,t);if(!(o instanceof Blob))throw new Error("Failed to read custom data: expected Blob.");return o}async readAllTexts(){const e=await this._readData(null,"text");if(!Array.isArray(e))throw new Error("Expected array of strings when reading all texts.");if(!e.every(e=>"string"==typeof e))throw new Error("Some values returned were not strings.");return e}async readAllCustom(e=null,t=!1){const r=await this._readData(null,"custom",e,t);if(!Array.isArray(r))throw new Error("Expected array of blobs when reading all custom items.");if(!r.every(e=>e instanceof Blob))throw new Error("Some values returned were not Blob instances.");return r}async readAllData(e=null,t=null){const r=await this._readData(null,e,t);if(!Array.isArray(r))throw new Error("Expected array result when reading all data.");return r}_read(e){return new Promise((t,r)=>{this.#t||r(new Error("Clipboard API not found!")),navigator.clipboard.read().then(r=>{if("number"==typeof e){if(Number.isNaN(e)||!Number.isFinite(e)||e<0)throw new Error(`Invalid index value: ${e}`);r[e]?t(r[e]):t(null)}t(r)}).catch(r)})}async readIndex(e){const t=await this._read(e);if(null!==t&&!(t instanceof ClipboardItem))throw new Error(`Value at index ${e} is not a ClipboardItem.`);return t}async readAll(){const e=await this._read(null);if(!Array.isArray(e))throw new Error("Expected array result from clipboard read.");for(const t of e)if(!(t instanceof ClipboardItem))throw new Error("Invalid item type found in clipboard result.");return e}isExecCommandAvailable(){return this.#e}isNavigatorClipboardAvailable(){return this.#t}getCopyTextFunc(){return this.#r}getCopyBlobFunc(){return this.#o}};window.TinyClipboard=t.TinyClipboard})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";const e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyCloner:()=>l});const n="undefined"!=typeof window&&void 0!==window.document,i={items:{},order:[]};function r(e,t){if("object"!=typeof e||null===e)throw new TypeError("Argument 'ni' must be an object or an array.");if(void 0!==t&&"number"!=typeof t)throw new TypeError("Argument 'index' must be a number.");const n=[];let r;r=Array.isArray(e)?e.length>0&&Array.isArray(e[0])?e:e.length>0?[e]:[]:Object.entries(e);for(const e of r){if(!Array.isArray(e)||e.length<2)throw new TypeError("Each item in the input must be a [key, function] pair.");const[r,o,s]=e;if(void 0!==s&&"function"!=typeof s)throw new TypeError(`Cloner for key '${r}' must be a function.`);const a="function"==typeof s?s:e=>e;if("string"!=typeof r)throw new TypeError("Validator key must be a string.");if("function"!=typeof o)throw new TypeError(`Validator for key '${r}' must be a function.`);if(!i.items.hasOwnProperty(r)){i.items[r]={validator:o,cloner:a};let e="number"==typeof t?t:-1;if(-1===e){const t=i.order.indexOf("object");e=t>-1?t:i.order.length}e=Math.min(Math.max(0,e),i.order.length),i.order.splice(e,0,r),n.push(r)}}return n}r([["undefined",e=>void 0===e],["null",e=>null===e],["boolean",e=>"boolean"==typeof e],["number",e=>"number"==typeof e&&!Number.isNaN(e)],["nannumber",e=>"number"==typeof e&&Number.isNaN(e)],["bigint",e=>"bigint"==typeof e],["string",e=>"string"==typeof e],["symbol",e=>"symbol"==typeof e],["function",e=>"function"==typeof e]]),r(["array",e=>Array.isArray(e),(e,t,n)=>e.map(e=>t?n.clone(e,t):e)]),n&&r(["file",e=>"undefined"!=typeof File&&e instanceof File,e=>new File([e],e.name,{type:e.type,lastModified:e.lastModified})]),r(["date",e=>e instanceof Date,e=>new Date(e.getTime())]),r(["regexp",e=>e instanceof RegExp,e=>new RegExp(e.source,e.flags)]),r(["map",e=>e instanceof Map,(e,t,n)=>{const i=new Map;for(const[r,o]of e.entries())i.set(r,t?n.clone(o,t):o);return i}]),r(["set",e=>e instanceof Set,(e,t,n)=>{const i=new Set;for(const r of e)i.add(t?n.clone(r,t):r);return i}]),r([["weakmap",e=>e instanceof WeakMap],["weakset",e=>e instanceof WeakSet],["promise",e=>e instanceof Promise]]),r(["url",e=>e instanceof URL,e=>new URL(e.href)]),n&&r(["htmlelement",e=>"undefined"!=typeof HTMLElement&&e instanceof HTMLElement,e=>e.cloneNode(!0)]),r(["object",e=>{return null!==(t=e)&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"===Object.prototype.toString.call(t);var t},(e,t,n)=>{const i={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t?n.clone(e[r],t):e[r]);return i}]);const o=Object.fromEntries(Object.entries(i.items).map(([e,t])=>[e,{...t}])),s=[...i.order];class a{#e=!1;get isolationMode(){return this.#e}static#t=!0;static get defaultIsDeep(){return a.#t}static set defaultIsDeep(e){if("boolean"!=typeof e)throw new TypeError("The defaultIsDeep property must be a boolean.");a.#t=e}constructor(e={isolationMode:!1}){if("object"!=typeof e||null===e)throw new TypeError("Options must be a non-null object.");if(void 0!==e.isolationMode&&"boolean"!=typeof e.isolationMode)throw new TypeError('The property "isolationMode" must be a boolean.');this.#e=!!e.isolationMode,this.#e&&(this.#n=a.#i.map(e=>({...e})))}static _createObjectPlugin(e){if("string"!=typeof e)throw new TypeError("Id must be a string.");return{id:e,canHandle:e=>null!==e&&"object"==typeof e,clone:(e,t,n)=>{const i={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t?n.clone(e[r],t):e[r]);return i}}}static#i=[];static validatePlugin(e){if("function"!=typeof e?.canHandle||"function"!=typeof e?.clone)throw new TypeError("Each plugin must implement the required interface: canHandle(item) and clone(item, cloner).");if("string"!=typeof e?.id)throw new TypeError("Each plugin must implement the required interface: the plugin id string.")}static get plugins(){return a.#i.map(e=>({...e}))}static get size(){return a.#i.length}static get ids(){return a.#i.map(e=>e.id)}static set plugins(e){if(!Array.isArray(e))throw new TypeError("The defaultPlugins property must be an array.");a.#i=e.map(e=>(a.validatePlugin(e),{...e}))}static addPlugin(e,t="start",n=0){if(a.validatePlugin(e),a.hasPlugin(e.id))throw new TypeError(`A plugin with the ID "${e.id}" already exists in the global registry.`);const i={...e};if("start"===t)a.#i.unshift(i);else if("end"===t)a.#i.push(i);else{if("index"!==t)throw new TypeError('Position must be "start", "end", or "index".');if(!Number.isInteger(n)||n<0)throw new TypeError('When position is "index", the index must be a non-negative integer.');a.#i.splice(n,0,i)}}static hasPlugin(e){if("string"!=typeof e)throw new TypeError("The ID must be a string.");return a.#i.some(t=>t.id===e)}static removePlugin(e){if("string"!=typeof e)throw new TypeError("The ID must be a string.");const t=a.#i.findIndex(t=>t.id===e);return-1!==t&&(a.#i.splice(t,1),!0)}static filterPlugins(e){if("function"!=typeof e)throw new TypeError("Predicate must be a function.");a.#i=a.#i.filter(t=>!e({...t}))}static updatePlugin(e,t){if(e<0||e>=a.#i.length)throw new RangeError("Index out of bounds.");a.validatePlugin(t),a.#i[e]={...t}}static reorderPlugins(e){a.#i=a.#i.sort(e?(t,n)=>e({...t},{...n}):void 0)}#n=[];get size(){return this.#n.length}get ids(){return this.#n.map(e=>e.id)}get plugins(){return this.#n.map(e=>({...e}))}set plugins(e){if(!Array.isArray(e))throw new TypeError("The plugins property must be an array.");this.#n=e.map(e=>(a.validatePlugin(e),{...e}))}addPlugin(e,t="start",n=0){if(a.validatePlugin(e),this.hasPlugin(e.id))throw new TypeError(`A plugin with the ID "${e.id}" already exists in this instance.`);const i={...e};if("start"===t)this.#n.unshift(i);else if("end"===t)this.#n.push(i);else{if("index"!==t)throw new TypeError('Position must be "start", "end", or "index".');if(!Number.isInteger(n)||n<0)throw new TypeError('When position is "index", the index must be a non-negative integer.');this.#n.splice(n,0,i)}}hasPlugin(e){if("string"!=typeof e)throw new TypeError("The ID must be a string.");return this.#n.some(t=>t.id===e)}removePlugin(e){if("string"!=typeof e)throw new TypeError("The ID must be a string.");const t=this.#n.findIndex(t=>t.id===e);return-1!==t&&(this.#n.splice(t,1),!0)}filterPlugins(e){if("function"!=typeof e)throw new TypeError("Predicate must be a function.");this.#n=this.#n.filter(t=>!e({...t}))}updatePlugin(e,t){if(e<0||e>=this.#n.length)throw new RangeError("Index out of bounds.");a.validatePlugin(t),this.#n[e]={...t}}reorderPlugins(e){this.#n=this.#n.sort(e?(t,n)=>e({...t},{...n}):void 0)}static clone(e,t=a.#t){for(const n of a.#i)if(n.canHandle(e))return n.clone(e,t,a);return e}clone(e,t=a.#t){for(const n of this.#n)if(n.canHandle(e))return n.clone(e,t,this);if(!this.#e)for(const n of a.#i)if(n.canHandle(e))return n.clone(e,t,this);return e}}a.plugins=s.filter(e=>o[e]).map(e=>({id:e,canHandle:o[e].validator,clone:o[e].cloner}));const l=a;window.TinyCloner=t.TinyCloner})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const t={d:(r,a)=>{
|
|
1
|
+
(()=>{"use strict";const t={d:(r,a)=>{for(var s in a)t.o(a,s)&&!t.o(r,s)&&Object.defineProperty(r,s,{enumerable:!0,get:a[s]})},o:(t,r)=>Object.prototype.hasOwnProperty.call(t,r)};let r={};t.d(r,{TinyColorConverter:()=>s});class a{static _rca(t,r,a){let s=127,o=128;void 0===t&&(t=24),void 0===r&&(r="rgb"),!0===a&&(s=55,o=200);const n=2*Math.PI/t,e=[];for(let a=0;a<t;++a){const t=Math.sin(n*a+2)*s+o,i=Math.sin(n*a+0)*s+o,h=Math.sin(n*a+4)*s+o;switch(r){case"hex":e.push({hex:this.rgbToHex(Math.round(t),Math.round(i),Math.round(h))});break;case"rgb":e.push({r:t,g:i,b:h});break;case"hsl":const[r,a,s]=this.rgbaToHsl(Math.round(t),Math.round(i),Math.round(h));e.push({h:r,s:a,l:s})}}return e}static rcaRgb(t,r){return a._rca(t,"rgb",r)}static rcaHsl(t,r){return a._rca(t,"hsl",r)}static rcaHex(t,r){return a._rca(t,"hex",r)}static randomColor(){return`#${Math.floor(16777216*Math.random()).toString(16).padStart(6,"0")}`}static parseInput(t,r){if("string"==typeof t){if((t=t.trim().toLowerCase()).startsWith("#"))return this.hexToRgba(t);if(t.startsWith("rgb"))return this.rgbStringToRgbaArray(t);if(t.startsWith("hsl"))return this.hslStringToRgbaArray(t)}if("number"==typeof t)return this.intToRgba(t);if(Array.isArray(t)&&(3===t.length||4===t.length)&&t.every(t=>"number"==typeof t)){if(r){const[r,a,s,o]=t;if(r<=360&&a<=100&&s<=100)return this.hslToRgba(r,a,s,o)}return[...t,1].slice(0,4)}throw new Error("Unsupported color format.")}static hslToInt(t,r,s){const[o,n,e]=a.hslToRgba(t,r,s);return a.rgbToInt(o,n,e)}static hslToHex(t,r,s){const[o,n,e]=a.hslToRgba(t,r,s);return a.rgbToHex(o,n,e)}static hslStringToRgbaArray(t){const r=t.match(/[\d.]+/g)?.map(Number);if(!r||r.length<3)return[0,0,0,1];const[a,s,o,n=1]=r;return this.hslToRgba(a,s,o,n)}static hslToRgba(t,r,a,s=1){a/=100;const o=r=>(r+t/30)%12,n=(r/=100)*Math.min(a,1-a),e=t=>a-n*Math.max(-1,Math.min(o(t)-3,Math.min(9-o(t),1)));return[Math.round(255*e(0)),Math.round(255*e(8)),Math.round(255*e(4)),s]}static hslToRgb(t,r,s,o=1){return a.hslToRgba(t,r,s,o).slice(0,3)}static hexToInt(t){return parseInt(t.replace(/^#/,""),16)}static hexToHsl(t){const[r,s,o,n]=a.hexToRgba(t);return a.rgbaToHsl(r,s,o,n)}static hexToHsla(t){const[r,s,o,n]=a.hexToRgba(t);return a.rgbaToHsla(r,s,o,n)}static hexToRgba(t){3===(t=t.replace(/^#/,"")).length&&(t=t.split("").map(t=>t+t).join(""));const r=parseInt(t,16);return[r>>16&255,r>>8&255,255&r,1]}static hexToRgb(t){return this.hexToRgba(t).slice(0,3)}static rgbToHex(t,r,a){return"#"+[t,r,a].map(t=>t.toString(16).padStart(2,"0")).join("")}static rgbToInt(t,r,a){return t<<16|r<<8|a}static rgbaToHsla(t,r,a,s=1){t/=255,r/=255,a/=255;const o=Math.max(t,r,a),n=Math.min(t,r,a);let e=0,i=0,h=(o+n)/2;const c=o-n;if(0!==c){switch(i=c/(1-Math.abs(2*h-1)),o){case t:e=(r-a)/c+(r<a?6:0);break;case r:e=(a-t)/c+2;break;case a:e=(t-r)/c+4}e*=60}return[Math.round(e),Math.round(100*i),Math.round(100*h),s]}static rgbaToHsl(t,r,a,s){return this.rgbaToHsla(t,r,a,s).slice(0,3)}static rgbStringToRgbaArray(t){const r=t.match(/[\d.]+/g)?.map(Number);return r?[...r,1].slice(0,4):[]}static intToHsl(t){const[r,s,o,n]=a.intToRgba(t);return a.rgbaToHsl(r,s,o,n)}static intToHsla(t){const[r,s,o,n]=a.intToRgba(t);return a.rgbaToHsla(r,s,o,n)}static intToHex(t){return"#"+t.toString(16).padStart(6,"0")}static intToRgba(t){return[t>>16&255,t>>8&255,255&t,1]}#t="#000000";#r=[0,0,0,0];#a;constructor(t=null,r=!1){this.#a=r,null!=t&&this.setColor(t)}setColor(t){this.#t=t;const r=this.#a&&Array.isArray(t)&&t[0]<=360&&t[1]<=100&&t[2]<=100;this.#r=a.parseInput(t,r)}toHslaArray(){const[t,r,s,o]=this.#r;return a.rgbaToHsla(t,r,s,o)}toHslString(){const[t,r,s]=this.#r,[o,n,e]=a.rgbaToHsl(t,r,s);return`hsl(${o}, ${n}%, ${e}%)`}toHslaString(){const[t,r,s,o]=this.#r,[n,e,i,h]=a.rgbaToHsla(t,r,s,o);return`hsla(${n}, ${e}%, ${i}%, ${h??1})`}toRgbaArray(){return[...this.#r]}toRgbString(){const[t,r,a]=this.#r;return`rgb(${t}, ${r}, ${a})`}toRgbaString(){const[t,r,a,s]=this.#r;return`rgba(${t}, ${r}, ${a}, ${s??1})`}toHex(){const[t,r,s]=this.#r;return a.rgbToHex(t,r,s)}toInt(){const[t,r,s]=this.#r;return a.rgbToInt(t,r,s)}getOriginal(){return this.#t}}const s=a;window.TinyColorConverter=r.TinyColorConverter})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const e={d:(r,t)=>{
|
|
1
|
+
(()=>{"use strict";const e={d:(r,t)=>{for(var s in t)e.o(t,s)&&!e.o(r,s)&&Object.defineProperty(r,s,{enumerable:!0,get:t[s]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};let r={};e.d(r,{TinyColorValidator:()=>s});class t{static#e=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;static#r=/^#([A-Fa-f0-9]{8})$/;static#t="(0|1|0?\\.\\d+)";static#s="(0|[1-9]\\d?|1\\d{2}|2[0-4]\\d|25[0-5])";static#a="(0|[1-9]\\d?|[1-2]\\d{2}|3[0-5]\\d|360)";static#i="(0|[1-9]?\\d|100)";static#n=new RegExp(`^rgb\\(\\s*${t.#s}\\s*,\\s*${t.#s}\\s*,\\s*${t.#s}\\s*\\)$`);static#o=new RegExp(`^rgba\\(\\s*${t.#s}\\s*,\\s*${t.#s}\\s*,\\s*${t.#s}\\s*,\\s*${t.#t}\\s*\\)$`);static#l=new RegExp(`^hsl\\(\\s*${t.#a}\\s*,\\s*${t.#i}%\\s*,\\s*${t.#i}%\\s*\\)$`);static#p=new RegExp(`^hsla\\(\\s*${t.#a}\\s*,\\s*${t.#i}%\\s*,\\s*${t.#i}%\\s*,\\s*${t.#t}\\s*\\)$`);static#u=new RegExp(`^hwb\\(\\s*${t.#a}(deg|grad|rad|turn)?\\s*${t.#i}%\\s*${t.#i}%\\s*\\)$`);static#c="(-?\\d+)";static#g=new RegExp(`^lab\\(\\s*${t.#i}%?\\s*${t.#c}%?\\s*${t.#c}%?\\s*\\)$`);static#d=new RegExp(`^lch\\(\\s*${t.#i}%?\\s*${t.#i}%?\\s*${t.#a}(deg|grad|rad|turn)?\\s*\\)$`);static#h=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);static#E=new Set(["transparent","currentColor"]);static getNames(){return Array.from(t.#h)}static addName(e){const r=t.#h.size;return t.#h.add(e.toLowerCase()),t.#h.size>r}static removeName(e){return t.#h.delete(e.toLowerCase())}static hasName(e){return t.#h.has(e.toLowerCase())}static getSpecialNames(){return Array.from(t.#E)}static addSpecialName(e){const r=t.#E.size;return t.#E.add(e),t.#E.size>r}static removeSpecialName(e){return t.#E.delete(e)}static hasSpecialName(e){return t.#E.has(e)}#m;get code(){return this.#m}#b;get type(){return this.#b}constructor(e){this.#m=e,this.#b=t.isColor(this.#m)}static isHex(e){if("string"!=typeof e)throw new TypeError("isHex: input must be a string.");return t.#e.test(e.trim())}isHex(){return t.isHex(this.#m)}static isHexa(e){if("string"!=typeof e)throw new TypeError("isHexa: input must be a string.");return t.#r.test(e.trim())}isHexa(){return t.isHexa(this.#m)}static isRgb(e){if("string"!=typeof e)throw new TypeError("isRgb: input must be a string.");return t.#n.test(e.trim())}isRgb(){return t.isRgb(this.#m)}static isRgba(e){if("string"!=typeof e)throw new TypeError("isRgba: input must be a string.");return t.#o.test(e.trim())}isRgba(){return t.isRgba(this.#m)}static isHsl(e){if("string"!=typeof e)throw new TypeError("isHsl: input must be a string.");return t.#l.test(e.trim())}isHsl(){return t.isHsl(this.#m)}static isHsla(e){if("string"!=typeof e)throw new TypeError("isHsla: input must be a string.");return t.#p.test(e.trim())}isHsla(){return t.isHsla(this.#m)}static isHwb(e){if("string"!=typeof e)throw new TypeError("isHwb: input must be a string.");return t.#u.test(e.trim())}isHwb(){return t.isHwb(this.#m)}static isLab(e){if("string"!=typeof e)throw new TypeError("isLab: input must be a string.");return t.#g.test(e.trim())}isLab(){return t.isLab(this.#m)}static isLch(e){if("string"!=typeof e)throw new TypeError("isLch: input must be a string.");return t.#d.test(e.trim())}isLch(){return t.isLch(this.#m)}static isName(e){if("string"!=typeof e)throw new TypeError("isName: input must be a string.");return t.#h.has(e.trim().toLowerCase())}isName(){return t.isName(this.#m)}static isSpecialName(e){if("string"!=typeof e)throw new TypeError("isSpecialName: input must be a string.");return t.#E.has(e.trim())}isSpecialName(){return t.isSpecialName(this.#m)}static isColor(e){if("string"!=typeof e)throw new TypeError("isColor: input must be a string.");return t.isHex(e)?"hex":t.isHexa(e)?"hexa":t.isRgb(e)?"rgb":t.isRgba(e)?"rgba":t.isHsl(e)?"hsl":t.isHsla(e)?"hsla":t.isHwb(e)?"hwb":t.isLab(e)?"lab":t.isLch(e)?"lch":t.isName(e)?"name":t.isSpecialName(e)?"specialName":null}parse(){switch(this.#b){case"hex":return t.parseHex(this.code);case"hexa":return t.parseHexa(this.code);case"rgb":return t.parseRgb(this.code);case"rgba":return t.parseRgba(this.code);case"hsl":return t.parseHsl(this.code);case"hsla":return t.parseHsla(this.code);case"hwb":return t.parseHwb(this.code);case"lab":return t.parseLab(this.code);case"lch":return t.parseLch(this.code);case"name":case"specialName":return this.#m.trim().toLowerCase();default:return null}}static parseHex(e){if("string"!=typeof e)throw new TypeError("parseHex: input must be a string.");const r=new RegExp(t.#e,"gm").exec(e.trim());return r?r[1]:null}parseHex(){return t.parseHex(this.#m)}static parseHexa(e){if("string"!=typeof e)throw new TypeError("parseHexa: input must be a string.");const r=new RegExp(t.#r,"gm").exec(e.trim());return r?r[1]:null}parseHexa(){return t.parseHexa(this.#m)}static parseRgb(e){if("string"!=typeof e)throw new TypeError("parseRgb: input must be a string.");const r=new RegExp(t.#n,"gm").exec(e.trim());return r?[parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3])]:null}parseRgb(){return t.parseRgb(this.#m)}static parseRgba(e){if("string"!=typeof e)throw new TypeError("parseRgba: input must be a string.");const r=new RegExp(t.#o,"gm").exec(e.trim());return r?[parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3]),parseFloat(r[4])]:null}parseRgba(){return t.parseRgba(this.#m)}static parseHsl(e){if("string"!=typeof e)throw new TypeError("parseHsl: input must be a string.");const r=new RegExp(t.#l,"gm").exec(e.trim());return r?[parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3])]:null}parseHsl(){return t.parseHsl(this.#m)}static parseHsla(e){if("string"!=typeof e)throw new TypeError("parseHsla: input must be a string.");const r=new RegExp(t.#p,"gm").exec(e.trim());return r?[parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3]),parseFloat(r[4])]:null}parseHsla(){return t.parseHsla(this.#m)}static parseHwb(e){if("string"!=typeof e)throw new TypeError("parseHwb: input must be a string.");const r=new RegExp(t.#u,"gm").exec(e.trim());return r?[parseFloat(r[1]),r[2]??null,parseFloat(r[3]),parseFloat(r[4])]:null}parseHwb(){return t.parseHwb(this.#m)}static parseLab(e){if("string"!=typeof e)throw new TypeError("parseLab: input must be a string.");const r=new RegExp(t.#g,"gm").exec(e.trim());return r?[parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3])]:null}parseLab(){return t.parseLab(this.#m)}static parseLch(e){if("string"!=typeof e)throw new TypeError("parseLch: input must be a string.");const r=new RegExp(t.#d,"gm").exec(e.trim());return r?[parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3]),r[4]??null]:null}parseLch(){return t.parseLch(this.#m)}}const s=t;window.TinyColorValidator=r.TinyColorValidator})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const e={d:(t,n)=>{
|
|
1
|
+
(()=>{"use strict";const e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyCookieConsent:()=>n});const n=class{#e;#t={message:"We use cookies to improve your experience.",acceptText:"Accept All",rejectText:"Reject All",settingsText:"Manage Settings",categories:[],storageKey:"cookie-consent-preferences",onSave:e=>console.log("Preferences saved:",e),animationDuration:400,renderBar:null,renderModal:null};get preferences(){const e=localStorage.getItem(this.#t.storageKey);return e?JSON.parse(e):{}}get config(){return{...this.#t,categories:[...this.#t.categories]}}set config(e){this.validateConfig(e),this.#t=Object.assign(this.#t,e)}constructor(e){if(!e||"object"!=typeof e)throw new TypeError("Config must be an object.");this.config=e;const t=this.loadPreferences();this.#e=t??{},t||this.showConsentBar()}validateConfig(e){if(void 0!==e.message&&"string"!=typeof e.message)throw new TypeError("Config.message must be a string.");if(["acceptText","rejectText","settingsText","storageKey"].forEach(t=>{if(void 0!==e[t]&&"string"!=typeof e[t])throw new TypeError(`Config.${t} must be a string.`)}),void 0!==e.categories){if(!Array.isArray(e.categories))throw new TypeError("Config.categories must be an array of Category objects.");e.categories.forEach((e,t)=>this.validateCategory(e,t))}if(void 0!==e.onSave&&"function"!=typeof e.onSave)throw new TypeError("Config.onSave must be a function.");if(void 0!==e.animationDuration&&("number"!=typeof e.animationDuration||e.animationDuration<0))throw new TypeError("Config.animationDuration must be a positive number.");if(void 0!==e.renderBar&&null!==e.renderBar&&"function"!=typeof e.renderBar)throw new TypeError("Config.renderBar must be a function or null.");if(void 0!==e.renderModal&&null!==e.renderModal&&"function"!=typeof e.renderModal)throw new TypeError("Config.renderModal must be a function or null.")}validateCategory(e,t){if(!e||"object"!=typeof e)throw new TypeError(`Category at index ${t} must be an object.`);if("string"!=typeof e.label)throw new TypeError(`Category.label at index ${t} must be a string.`);if("boolean"!=typeof e.required)throw new TypeError(`Category.required at index ${t} must be a boolean.`);if("boolean"!=typeof e.default)throw new TypeError(`Category.default at index ${t} must be a boolean.`)}loadPreferences(){const e=localStorage.getItem(this.#t.storageKey);return e?JSON.parse(e):null}removeWithAnimation(e){if(!(e instanceof HTMLElement))throw new TypeError("removeWithAnimation expects an HTMLElement.");e.classList.add("closing"),setTimeout(()=>e.remove(),this.#t.animationDuration)}savePreferences(e){if(!e||"object"!=typeof e)throw new TypeError("Preferences must be an object.");localStorage.setItem(this.#t.storageKey,JSON.stringify(e)),this.#t.onSave(e)}showConsentBar(){const e=document.createElement("div");e.className="cookie-consent-bar",e.innerHTML=this.#t.renderBar?this.#t.renderBar(this.#t):`\n <div><p>${this.#t.message}</p></div>\n <div><button class="accept">${this.#t.acceptText}</button></div>\n <div><button class="reject">${this.#t.rejectText}</button></div>\n <div><button class="settings">${this.#t.settingsText}</button></div>\n `,document.body.appendChild(e);const t=e.querySelector(".accept");t instanceof HTMLElement&&(t.onclick=()=>{const t={};this.#t.categories.forEach(e=>t[e.label]=!0),this.savePreferences(t),this.removeWithAnimation(e)});const n=e.querySelector(".reject");n instanceof HTMLElement&&(n.onclick=()=>{const t={};this.#t.categories.forEach(e=>t[e.label]=e.required),this.savePreferences(t),this.removeWithAnimation(e)});const o=e.querySelector(".settings");o instanceof HTMLElement&&(o.onclick=()=>this.showSettingsModal(e))}showSettingsModal(e){const t=document.createElement("div");t.className="cookie-consent-modal",t.innerHTML=this.#t.renderModal?this.#t.renderModal(this.#t):`\n <div class="modal-content">\n <h2>Cookie Settings</h2>\n <form class="settings-form">\n ${this.#t.categories.map(e=>`\n <label>\n <input type="checkbox" name="${e.label}" \n ${e.default?"checked":""} \n ${e.required?"disabled":""}>\n ${e.label}\n </label>\n `).join("")}\n </form>\n <button class="save">Save Preferences</button>\n </div>\n `,document.body.appendChild(t);const n=t.querySelector(".save");n instanceof HTMLElement&&(n.onclick=()=>{const n={};t.querySelectorAll("input[type=checkbox]").forEach(e=>{e instanceof HTMLInputElement&&(n[e.name]=e.checked)}),this.savePreferences(n),this.removeWithAnimation(t),e&&this.removeWithAnimation(e)})}isAllowed(e){if("string"!=typeof e)throw new TypeError("isAllowed expects a string as category.");return!!this.#e&&!!this.#e[e]}};window.TinyCookieConsent=t.TinyCookieConsent})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const e={d:(t,r)=>{if(Array.isArray(r))for(var s=0;s<r.length;){var i=r[s++],n=r[s++];e.o(t,i)?0===n&&s++:0===n?Object.defineProperty(t,i,{enumerable:!0,value:r[s++]}):Object.defineProperty(t,i,{enumerable:!0,get:n})}else for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyDayNightCycle:()=>s});const r=e=>{if(e)throw new Error("This TinyDayNightCycle instance has been destroyed and can no longer be used.")};const s=class{#e=!0;#t=86400;#r=3600;#s=60;#i=new Map;#n=[];#o;#h;#a={main:null};#u=0;#y=0;#c=0;#d="";#m=1;#f=1;#w=1;#S=!1;#g=[31,31,31,31,31,31,31,31,31,31,31,31];#D={default:{},day:{},night:{},hours:{},seasons:{}};#p={min:60,max:180};#l=0;get daySize(){return r(this.#S),this.#t}get autoSizeAdjuste(){return r(this.#S),this.#e}set autoSizeAdjuste(e){if(r(this.#S),"boolean"!=typeof e)throw new TypeError("autoSizeAdjuste must be a boolean.");this.#e=e}set daySize(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e)||e<=0)throw new Error("daySize must be a positive finite number.");const t=this.#r/this.#t,s=this.#s/this.#t;this.#t=e,this.#e&&(this.#r=e*t,this.#s=e*s)}get hourSize(){return r(this.#S),this.#r}set hourSize(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e)||e<=0)throw new Error("hourSize must be a positive finite number.");const t=this.#t/this.#r,s=this.#s/this.#r;this.#r=e,this.#e&&(this.#t=e*t,this.#s=e*s)}get minuteSize(){return r(this.#S),this.#s}set minuteSize(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e)||e<=0)throw new Error("minuteSize must be a positive finite number.");const t=this.#r/this.#s,s=this.#t/this.#s;this.#s=e,this.#e&&(this.#r=e*t,this.#t=e*s)}get isDestroyed(){return this.#S}get currentSeconds(){return r(this.#S),this.#u}set currentSeconds(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e))throw new TypeError("currentSeconds must be a finite number, received "+typeof e);if(e<0||e>=this.#t)throw new RangeError(`currentSeconds must be between 0 and 86399, received ${e}`);this.#u=Math.floor(e),this.#y=Math.floor(e/this.#s),this.#c=Math.floor(e/this.#r)}get currentMinutes(){return r(this.#S),this.#y}set currentMinutes(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e))throw new TypeError("currentMinutes must be a finite number, received "+typeof e);if(e<0||e>=1440)throw new RangeError(`currentMinutes must be between 0 and 1439, received ${e}`);this.#y=Math.floor(e),this.#c=Math.floor(e/this.#s),this.#u=Math.floor(e*this.#s)}get currentHours(){return r(this.#S),this.#c}set currentHours(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e))throw new TypeError("currentHours must be a finite number, received "+typeof e);if(e<0||e>=24)throw new RangeError(`currentHours must be between 0 and less than 24, received ${e}`);this.#c=Math.floor(e),this.#y=Math.floor(e*this.#s),this.#u=Math.floor(e*this.#r)}get moons(){return r(this.#S),this.#n.map(e=>this.getMoon(e))}get seasons(){return r(this.#S),Array.from(this.#i.keys())}get dayStart(){return r(this.#S),this.#o}get nightStart(){return r(this.#S),this.#h}get weather(){return r(this.#S),{...this.#a}}get currentSeason(){return r(this.#S),this.#d}get currentDay(){return r(this.#S),this.#m}get currentMonth(){return r(this.#S),this.#f}get currentYear(){return r(this.#S),this.#w}get monthDays(){return r(this.#S),[...this.#g]}get weatherDuration(){return r(this.#S),{...this.#p}}get weatherTimeLeft(){return r(this.#S),this.#l}set dayStart(e){if(r(this.#S),"number"!=typeof e||e<1)throw new TypeError("dayStart must be a positive non-zero number, received "+typeof e);this.#o=e}set nightStart(e){if(r(this.#S),"number"!=typeof e||e<1)throw new TypeError("nightStart must be a positive non-zero number, received "+typeof e);this.#h=e}set weather(e){if(r(this.#S),"object"!=typeof e||null===e||Array.isArray(e)||!Object.values(e).every(e=>"string"==typeof e))throw new TypeError("weather must be a object with strings, received "+typeof e);this.#a=e}set currentSeason(e){if(r(this.#S),"string"!=typeof e||!this.#i.has(e))throw new TypeError(`currentSeason must be one of ${Array.from(this.#i).map(e=>e[0]).join(", ")}, received ${e}`);this.#d=e}set currentDay(e){if(r(this.#S),"number"!=typeof e||e<1||e>this.#g[this.#f-1])throw new TypeError("currentDay must be a valid day number, received "+typeof e);this.#m=e}set currentMonth(e){if(r(this.#S),"number"!=typeof e||"number"!=typeof this.#g[e-1])throw new TypeError("currentMonth must be a valid month number, received "+typeof e);this.#f=e}set currentYear(e){if(r(this.#S),"number"!=typeof e||e<1)throw new TypeError("currentYear must be a positive number non-zero, received "+typeof e);this.#w=e}set monthDays(e){if(r(this.#S),!Array.isArray(e))throw new TypeError("monthDays must be a array");if(!e.every(e=>"number"==typeof e))throw new TypeError("monthDays must have number values");this.#g=[...e]}set weatherDuration(e){if(r(this.#S),"object"!=typeof e||null===e)throw new TypeError("weatherDuration must be a non-null object");if("number"!=typeof e.min||"number"!=typeof e.max)throw new TypeError("weatherDuration.min and weatherDuration.max must be numbers");this.#p={...e}}set weatherTimeLeft(e){if(r(this.#S),"number"!=typeof e)throw new TypeError("weatherTimeLeft must be a number, received "+typeof e);this.#l=e}get weatherConfig(){r(this.#S);const e={},t={};for(const t in this.#D.hours)e[t]={...this.#D.hours[t]};for(const e in this.#D.seasons)t[e]={...this.#D.seasons[e]};return{default:{...this.#D.default},day:{...this.#D.day},night:{...this.#D.night},hours:e,seasons:t}}set weatherConfig(e){if(r(this.#S),"object"!=typeof e||null===e)throw new TypeError(`weatherConfig must be a non-null object, received ${e}`);const t=["default","day","night","hours","seasons"];for(const r of t)if(!(r in e))throw new TypeError(`weatherConfig is missing required property "${r}".`);const s={},i={},n=(e,t)=>{if("object"!=typeof e||null===e)throw new TypeError(`${t} must be an object, received ${e}`);for(const r in e){const s=typeof e[r];if("number"!==s&&"function"!==s)throw new TypeError(`${t}["${r}"] must be a number or function, received ${s}`)}};for(const t in e.hours)n(e.hours[t],`hours["${t}"]`),s[t]={...e.hours[t]};for(const t in e.seasons)n(e.seasons[t],`seasons["${t}"]`),i[t]={...e.seasons[t]};const o=(e,t)=>(n(e,t),{...e});this.#D={default:o(e.default,"default"),day:o(e.day,"day"),night:o(e.night,"night"),hours:s,seasons:i}}constructor(e=6,t=18){this.#o=e,this.#h=t}addSeason(e,t){if(r(this.#S),"string"!=typeof e)throw new TypeError("Season name must be a string, received "+typeof e);if(!Array.isArray(t)||!t.every(e=>"number"==typeof e))throw new TypeError("Season values must be an array of numbers");this.#i.set(e,t)}removeSeason(e){if(r(this.#S),"string"!=typeof e)throw new TypeError("Season name must be a string, received "+typeof e);this.#i.delete(e),this.#d===e&&(this.#d="")}hasSeason(e){if(r(this.#S),"string"!=typeof e)throw new TypeError("Season name must be a string, received "+typeof e);return this.#i.has(e)}getSeason(e){if(r(this.#S),"string"!=typeof e)throw new TypeError("Season name must be a string, received "+typeof e);const t=this.#i.get(e);if(!t)throw new Error(`Season "${e}" not found`);return[...t]}setTime({hour:e=0,minute:t=0,second:s=0}){r(this.#S),this.currentSeconds=(e*this.#r+t*this.#s+s)%this.#t}addTime({hours:e=0,minutes:t=0,seconds:s=0}){r(this.#S);let i=this.currentSeconds+e*this.#r+t*this.#s+s;for(;i>=this.#t;)i-=this.#t,this.nextDay();for(;i<0;)i+=this.#t,this.prevDay();this.currentSeconds=i,this.updateWeatherTimer((e*this.#r+t*this.#s+s)/this.#s)}getTime({withSeconds:e=!1,hourSize:t=this.#r,minuteSize:s=this.#s}={}){r(this.#S);const i=Math.floor(this.currentSeconds/t),n=Math.floor(this.currentSeconds%t/s),o=this.currentSeconds%s;return{hour:i,minute:n,second:o,formatted:`${i.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`+(e?`:${o.toString().padStart(2,"0")}`:"")}}isDay(){return r(this.#S),this.#o<this.#h?this.#y>=this.#o*this.#s&&this.#y<this.#h*this.#s:this.#y>=this.#o*this.#s||this.#y<this.#h*this.#s}minutesUntilDay(){return this.timeUntil(this.#o,"minutes")}secondsUntilDay(){return this.timeUntil(this.#o,"seconds")}hoursUntilDay(){return this.timeUntil(this.#o,"hours")}minutesUntilNight(){return this.timeUntil(this.#h,"minutes")}secondsUntilNight(){return this.timeUntil(this.#h,"seconds")}hoursUntilNight(){return this.timeUntil(this.#h,"hours")}timeUntil(e,t){r(this.#S);let s=e*this.#r-this.#u;switch(s<=0&&(s+=this.#t),t){case"minutes":return s/this.#s;case"hours":return s/this.#r;default:return s}}setTo(e){r(this.#S),"day"===e?this.setTime({hour:this.#o}):"night"===e&&this.setTime({hour:this.#h})}nextDay(e=1){r(this.#S);for(let t=0;t<e;t++){this.#m++;const e=this.#g[this.#f-1];if(Number.isNaN(e)||!Number.isFinite(e))throw new Error("Invalid month day count: monthDays must be a finite number.");this.#m>e&&(this.#m=1,this.#f++,this.#f>this.#g.length&&(this.#f=1,this.#w++)),this.updateSeason(),this.advanceMoons(1)}}prevDay(e=1){r(this.#S);for(let t=0;t<e;t++)this.#m--,this.#m<1&&(this.#f--,this.#f<1&&(this.#f=this.#g.length,this.#w--),this.#m=this.#g[this.#f-1]||30),this.updateSeason(),this.rewindMoons(1)}updateSeason(){r(this.#S),this.#i.forEach((e,t)=>{e.includes(this.#f)&&(this.#d=t)})}setWeatherConfig(e){r(this.#S),this.#D={...this.#D,...e}}setWeatherDuration(e,t){r(this.#S),this.#p.min=e,this.#p.max=t}updateWeatherTimer(e){r(this.#S),this.#l-=e,this.#l<=0&&this.chooseNewWeather()}forceWeather({where:e="main",type:t,duration:s=null}){r(this.#S);const i=this.#a;i[e]=t,this.weather=i,this.#l=s??this._randomInRange(this.#p.min,this.#p.max)}chooseNewWeather({customWeather:e,where:t="main"}={}){r(this.#S);let s={};const i=e=>{for(const[t,r]of Object.entries(e)){let e=r;"function"==typeof e&&(e=e({hour:Math.floor(this.#y/this.#s),minute:this.#y%this.#s,currentMinutes:this.#y,isDay:this.isDay(),season:this.#d,weather:this.#a})),"number"!=typeof e||Number.isNaN(e)||(s[t]=(s[t]||0)+e)}};i(this.#D.default||{});for(const e in this.#D.hours){const[t,r]=e.split("-").map(e=>{const[t,r]=e.split(":").map(Number);return t*this.#s+(r||0)}),s=this.#y;(t<=r?s>=t&&s<=r:s>=t||s<=r)&&i(this.#D.hours[e])}this.isDay()&&this.#D.day?i(this.#D.day):!this.isDay()&&this.#D.night&&i(this.#D.night),this.#D.seasons?.[this.#d]&&i(this.#D.seasons[this.#d]),e&&"object"==typeof e&&i(e);const n=Object.entries(s).filter(([,e])=>e>0);if(!n.length)return this.#a[t]=null,null;const o=n.reduce((e,[,t])=>e+t,0);let h=Math.random()*o;for(const[e,r]of n){if(h<r)return this.#a[t]=e,this.#l=this._randomInRange(this.#p.min,this.#p.max),e;h-=r}return this.#a[t]=null,null}_randomInRange(e,t){return Math.floor(Math.random()*(t-e+1))+e}addMoon(e,t,s,i=0){r(this.#S);const n=Math.max(1,t);return this.#n.push({name:e,cycleLength:n,currentPhase:(i%n+n)%n,phaseNames:s}),this.#n.length-1}removeMoon(e){r(this.#S),this.#n=this.#n.filter(t=>t.name!==e)}advanceMoons(e=1){for(const t in this.#n)this.advanceMoon(parseInt(t),e)}rewindMoons(e=1){for(const t in this.#n)this.rewindMoon(parseInt(t),e)}advanceMoon(e,t=1){r(this.#S);const s=this.#n[e];if(!s)throw new RangeError(`No moon found at index ${e}`);s.currentPhase=(s.currentPhase+t)%s.cycleLength}rewindMoon(e,t=1){r(this.#S);const s=this.#n[e];if(!s)throw new RangeError(`No moon found at index ${e}`);s.currentPhase=(s.currentPhase-t+s.cycleLength)%s.cycleLength}moonExists(e){return r(this.#S),!!this.#n[e]}getMoon(e){let t;if(r(this.#S),"number"==typeof e){if(t=this.#n[e],!t)throw new RangeError(`No moon found at index ${e}`)}else{if(!e||"object"!=typeof e||"string"!=typeof e.name||"number"!=typeof e.cycleLength||"number"!=typeof e.currentPhase)throw new TypeError("Invalid moon reference. Expected a number index or a MoonRaw object, received "+typeof e);t=e}return{name:t.name,phaseIndex:t.currentPhase,phaseName:t.phaseNames?t.phaseNames[t.currentPhase]??String(t.currentPhase):String(t.currentPhase),cycleLength:t.cycleLength}}destroy(){this.#S||(this.#i.clear(),this.#n.length=0,this.#o=0,this.#h=0,this.#u=0,this.#y=0,this.#c=0,this.#m=1,this.#f=1,this.#w=1,this.#l=0,this.#d="",this.#a={main:null},this.#g=[],this.#D.default={},this.#D.day={},this.#D.night={},this.#D.hours={},this.#D.seasons={},this.#p={min:0,max:0},this.#S=!0)}};window.TinyDayNightCycle=t.TinyDayNightCycle})();
|
|
1
|
+
(()=>{"use strict";const e={d:(t,r)=>{for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyDayNightCycle:()=>s});const r=e=>{if(e)throw new Error("This TinyDayNightCycle instance has been destroyed and can no longer be used.")};const s=class{#e=!0;#t=86400;#r=3600;#s=60;#i=new Map;#n=[];#o;#h;#a={main:null};#u=0;#y=0;#c=0;#d="";#m=1;#f=1;#w=1;#S=!1;#g=[31,31,31,31,31,31,31,31,31,31,31,31];#D={default:{},day:{},night:{},hours:{},seasons:{}};#p={min:60,max:180};#l=0;get daySize(){return r(this.#S),this.#t}get autoSizeAdjuste(){return r(this.#S),this.#e}set autoSizeAdjuste(e){if(r(this.#S),"boolean"!=typeof e)throw new TypeError("autoSizeAdjuste must be a boolean.");this.#e=e}set daySize(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e)||e<=0)throw new Error("daySize must be a positive finite number.");const t=this.#r/this.#t,s=this.#s/this.#t;this.#t=e,this.#e&&(this.#r=e*t,this.#s=e*s)}get hourSize(){return r(this.#S),this.#r}set hourSize(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e)||e<=0)throw new Error("hourSize must be a positive finite number.");const t=this.#t/this.#r,s=this.#s/this.#r;this.#r=e,this.#e&&(this.#t=e*t,this.#s=e*s)}get minuteSize(){return r(this.#S),this.#s}set minuteSize(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e)||e<=0)throw new Error("minuteSize must be a positive finite number.");const t=this.#r/this.#s,s=this.#t/this.#s;this.#s=e,this.#e&&(this.#r=e*t,this.#t=e*s)}get isDestroyed(){return this.#S}get currentSeconds(){return r(this.#S),this.#u}set currentSeconds(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e))throw new TypeError("currentSeconds must be a finite number, received "+typeof e);if(e<0||e>=this.#t)throw new RangeError(`currentSeconds must be between 0 and 86399, received ${e}`);this.#u=Math.floor(e),this.#y=Math.floor(e/this.#s),this.#c=Math.floor(e/this.#r)}get currentMinutes(){return r(this.#S),this.#y}set currentMinutes(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e))throw new TypeError("currentMinutes must be a finite number, received "+typeof e);if(e<0||e>=1440)throw new RangeError(`currentMinutes must be between 0 and 1439, received ${e}`);this.#y=Math.floor(e),this.#c=Math.floor(e/this.#s),this.#u=Math.floor(e*this.#s)}get currentHours(){return r(this.#S),this.#c}set currentHours(e){if(r(this.#S),"number"!=typeof e||!Number.isFinite(e))throw new TypeError("currentHours must be a finite number, received "+typeof e);if(e<0||e>=24)throw new RangeError(`currentHours must be between 0 and less than 24, received ${e}`);this.#c=Math.floor(e),this.#y=Math.floor(e*this.#s),this.#u=Math.floor(e*this.#r)}get moons(){return r(this.#S),this.#n.map(e=>this.getMoon(e))}get seasons(){return r(this.#S),Array.from(this.#i.keys())}get dayStart(){return r(this.#S),this.#o}get nightStart(){return r(this.#S),this.#h}get weather(){return r(this.#S),{...this.#a}}get currentSeason(){return r(this.#S),this.#d}get currentDay(){return r(this.#S),this.#m}get currentMonth(){return r(this.#S),this.#f}get currentYear(){return r(this.#S),this.#w}get monthDays(){return r(this.#S),[...this.#g]}get weatherDuration(){return r(this.#S),{...this.#p}}get weatherTimeLeft(){return r(this.#S),this.#l}set dayStart(e){if(r(this.#S),"number"!=typeof e||e<1)throw new TypeError("dayStart must be a positive non-zero number, received "+typeof e);this.#o=e}set nightStart(e){if(r(this.#S),"number"!=typeof e||e<1)throw new TypeError("nightStart must be a positive non-zero number, received "+typeof e);this.#h=e}set weather(e){if(r(this.#S),"object"!=typeof e||null===e||Array.isArray(e)||!Object.values(e).every(e=>"string"==typeof e))throw new TypeError("weather must be a object with strings, received "+typeof e);this.#a=e}set currentSeason(e){if(r(this.#S),"string"!=typeof e||!this.#i.has(e))throw new TypeError(`currentSeason must be one of ${Array.from(this.#i).map(e=>e[0]).join(", ")}, received ${e}`);this.#d=e}set currentDay(e){if(r(this.#S),"number"!=typeof e||e<1||e>this.#g[this.#f-1])throw new TypeError("currentDay must be a valid day number, received "+typeof e);this.#m=e}set currentMonth(e){if(r(this.#S),"number"!=typeof e||"number"!=typeof this.#g[e-1])throw new TypeError("currentMonth must be a valid month number, received "+typeof e);this.#f=e}set currentYear(e){if(r(this.#S),"number"!=typeof e||e<1)throw new TypeError("currentYear must be a positive number non-zero, received "+typeof e);this.#w=e}set monthDays(e){if(r(this.#S),!Array.isArray(e))throw new TypeError("monthDays must be a array");if(!e.every(e=>"number"==typeof e))throw new TypeError("monthDays must have number values");this.#g=[...e]}set weatherDuration(e){if(r(this.#S),"object"!=typeof e||null===e)throw new TypeError("weatherDuration must be a non-null object");if("number"!=typeof e.min||"number"!=typeof e.max)throw new TypeError("weatherDuration.min and weatherDuration.max must be numbers");this.#p={...e}}set weatherTimeLeft(e){if(r(this.#S),"number"!=typeof e)throw new TypeError("weatherTimeLeft must be a number, received "+typeof e);this.#l=e}get weatherConfig(){r(this.#S);const e={},t={};for(const t in this.#D.hours)e[t]={...this.#D.hours[t]};for(const e in this.#D.seasons)t[e]={...this.#D.seasons[e]};return{default:{...this.#D.default},day:{...this.#D.day},night:{...this.#D.night},hours:e,seasons:t}}set weatherConfig(e){if(r(this.#S),"object"!=typeof e||null===e)throw new TypeError(`weatherConfig must be a non-null object, received ${e}`);const t=["default","day","night","hours","seasons"];for(const r of t)if(!(r in e))throw new TypeError(`weatherConfig is missing required property "${r}".`);const s={},i={},n=(e,t)=>{if("object"!=typeof e||null===e)throw new TypeError(`${t} must be an object, received ${e}`);for(const r in e){const s=typeof e[r];if("number"!==s&&"function"!==s)throw new TypeError(`${t}["${r}"] must be a number or function, received ${s}`)}};for(const t in e.hours)n(e.hours[t],`hours["${t}"]`),s[t]={...e.hours[t]};for(const t in e.seasons)n(e.seasons[t],`seasons["${t}"]`),i[t]={...e.seasons[t]};const o=(e,t)=>(n(e,t),{...e});this.#D={default:o(e.default,"default"),day:o(e.day,"day"),night:o(e.night,"night"),hours:s,seasons:i}}constructor(e=6,t=18){this.#o=e,this.#h=t}addSeason(e,t){if(r(this.#S),"string"!=typeof e)throw new TypeError("Season name must be a string, received "+typeof e);if(!Array.isArray(t)||!t.every(e=>"number"==typeof e))throw new TypeError("Season values must be an array of numbers");this.#i.set(e,t)}removeSeason(e){if(r(this.#S),"string"!=typeof e)throw new TypeError("Season name must be a string, received "+typeof e);this.#i.delete(e),this.#d===e&&(this.#d="")}hasSeason(e){if(r(this.#S),"string"!=typeof e)throw new TypeError("Season name must be a string, received "+typeof e);return this.#i.has(e)}getSeason(e){if(r(this.#S),"string"!=typeof e)throw new TypeError("Season name must be a string, received "+typeof e);const t=this.#i.get(e);if(!t)throw new Error(`Season "${e}" not found`);return[...t]}setTime({hour:e=0,minute:t=0,second:s=0}){r(this.#S),this.currentSeconds=(e*this.#r+t*this.#s+s)%this.#t}addTime({hours:e=0,minutes:t=0,seconds:s=0}){r(this.#S);let i=this.currentSeconds+e*this.#r+t*this.#s+s;for(;i>=this.#t;)i-=this.#t,this.nextDay();for(;i<0;)i+=this.#t,this.prevDay();this.currentSeconds=i,this.updateWeatherTimer((e*this.#r+t*this.#s+s)/this.#s)}getTime({withSeconds:e=!1,hourSize:t=this.#r,minuteSize:s=this.#s}={}){r(this.#S);const i=Math.floor(this.currentSeconds/t),n=Math.floor(this.currentSeconds%t/s),o=this.currentSeconds%s;return{hour:i,minute:n,second:o,formatted:`${i.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`+(e?`:${o.toString().padStart(2,"0")}`:"")}}isDay(){return r(this.#S),this.#o<this.#h?this.#y>=this.#o*this.#s&&this.#y<this.#h*this.#s:this.#y>=this.#o*this.#s||this.#y<this.#h*this.#s}minutesUntilDay(){return this.timeUntil(this.#o,"minutes")}secondsUntilDay(){return this.timeUntil(this.#o,"seconds")}hoursUntilDay(){return this.timeUntil(this.#o,"hours")}minutesUntilNight(){return this.timeUntil(this.#h,"minutes")}secondsUntilNight(){return this.timeUntil(this.#h,"seconds")}hoursUntilNight(){return this.timeUntil(this.#h,"hours")}timeUntil(e,t){r(this.#S);let s=e*this.#r-this.#u;switch(s<=0&&(s+=this.#t),t){case"minutes":return s/this.#s;case"hours":return s/this.#r;default:return s}}setTo(e){r(this.#S),"day"===e?this.setTime({hour:this.#o}):"night"===e&&this.setTime({hour:this.#h})}nextDay(e=1){r(this.#S);for(let t=0;t<e;t++){this.#m++;const e=this.#g[this.#f-1];if(Number.isNaN(e)||!Number.isFinite(e))throw new Error("Invalid month day count: monthDays must be a finite number.");this.#m>e&&(this.#m=1,this.#f++,this.#f>this.#g.length&&(this.#f=1,this.#w++)),this.updateSeason(),this.advanceMoons(1)}}prevDay(e=1){r(this.#S);for(let t=0;t<e;t++)this.#m--,this.#m<1&&(this.#f--,this.#f<1&&(this.#f=this.#g.length,this.#w--),this.#m=this.#g[this.#f-1]||30),this.updateSeason(),this.rewindMoons(1)}updateSeason(){r(this.#S),this.#i.forEach((e,t)=>{e.includes(this.#f)&&(this.#d=t)})}setWeatherConfig(e){r(this.#S),this.#D={...this.#D,...e}}setWeatherDuration(e,t){r(this.#S),this.#p.min=e,this.#p.max=t}updateWeatherTimer(e){r(this.#S),this.#l-=e,this.#l<=0&&this.chooseNewWeather()}forceWeather({where:e="main",type:t,duration:s=null}){r(this.#S);const i=this.#a;i[e]=t,this.weather=i,this.#l=s??this._randomInRange(this.#p.min,this.#p.max)}chooseNewWeather({customWeather:e,where:t="main"}={}){r(this.#S);let s={};const i=e=>{for(const[t,r]of Object.entries(e)){let e=r;"function"==typeof e&&(e=e({hour:Math.floor(this.#y/this.#s),minute:this.#y%this.#s,currentMinutes:this.#y,isDay:this.isDay(),season:this.#d,weather:this.#a})),"number"!=typeof e||Number.isNaN(e)||(s[t]=(s[t]||0)+e)}};i(this.#D.default||{});for(const e in this.#D.hours){const[t,r]=e.split("-").map(e=>{const[t,r]=e.split(":").map(Number);return t*this.#s+(r||0)}),s=this.#y;(t<=r?s>=t&&s<=r:s>=t||s<=r)&&i(this.#D.hours[e])}this.isDay()&&this.#D.day?i(this.#D.day):!this.isDay()&&this.#D.night&&i(this.#D.night),this.#D.seasons?.[this.#d]&&i(this.#D.seasons[this.#d]),e&&"object"==typeof e&&i(e);const n=Object.entries(s).filter(([,e])=>e>0);if(!n.length)return this.#a[t]=null,null;const o=n.reduce((e,[,t])=>e+t,0);let h=Math.random()*o;for(const[e,r]of n){if(h<r)return this.#a[t]=e,this.#l=this._randomInRange(this.#p.min,this.#p.max),e;h-=r}return this.#a[t]=null,null}_randomInRange(e,t){return Math.floor(Math.random()*(t-e+1))+e}addMoon(e,t,s,i=0){r(this.#S);const n=Math.max(1,t);return this.#n.push({name:e,cycleLength:n,currentPhase:(i%n+n)%n,phaseNames:s}),this.#n.length-1}removeMoon(e){r(this.#S),this.#n=this.#n.filter(t=>t.name!==e)}advanceMoons(e=1){for(const t in this.#n)this.advanceMoon(parseInt(t),e)}rewindMoons(e=1){for(const t in this.#n)this.rewindMoon(parseInt(t),e)}advanceMoon(e,t=1){r(this.#S);const s=this.#n[e];if(!s)throw new RangeError(`No moon found at index ${e}`);s.currentPhase=(s.currentPhase+t)%s.cycleLength}rewindMoon(e,t=1){r(this.#S);const s=this.#n[e];if(!s)throw new RangeError(`No moon found at index ${e}`);s.currentPhase=(s.currentPhase-t+s.cycleLength)%s.cycleLength}moonExists(e){return r(this.#S),!!this.#n[e]}getMoon(e){let t;if(r(this.#S),"number"==typeof e){if(t=this.#n[e],!t)throw new RangeError(`No moon found at index ${e}`)}else{if(!e||"object"!=typeof e||"string"!=typeof e.name||"number"!=typeof e.cycleLength||"number"!=typeof e.currentPhase)throw new TypeError("Invalid moon reference. Expected a number index or a MoonRaw object, received "+typeof e);t=e}return{name:t.name,phaseIndex:t.currentPhase,phaseName:t.phaseNames?t.phaseNames[t.currentPhase]??String(t.currentPhase):String(t.currentPhase),cycleLength:t.cycleLength}}destroy(){this.#S||(this.#i.clear(),this.#n.length=0,this.#o=0,this.#h=0,this.#u=0,this.#y=0,this.#c=0,this.#m=1,this.#f=1,this.#w=1,this.#l=0,this.#d="",this.#a={main:null},this.#g=[],this.#D.default={},this.#D.day={},this.#D.night={},this.#D.hours={},this.#D.seasons={},this.#p={min:0,max:0},this.#S=!0)}};window.TinyDayNightCycle=t.TinyDayNightCycle})();
|