quasar-ui-danx 0.2.11 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/danx.es.js +11 -9
- package/dist/danx.es.js.map +1 -0
- package/dist/danx.umd.js +3 -2
- package/dist/danx.umd.js.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/ActionTable/Filters/FilterToolbarLayout.vue +1 -2
- package/src/components/ActionTable/listControls.ts +2 -2
- package/src/components/PanelsDrawer/PanelsDrawerTabs.vue +2 -7
- package/src/components/Utility/Formats/IconWithTextFormat.vue +1 -1
- package/src/helpers/FlashMessages.ts +65 -65
- package/src/helpers/actions.ts +22 -16
- package/src/vue-plugin.js +0 -2
- package/vite.config.js +1 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"danx.es.js","sources":["../src/config/index.ts","../src/helpers/array.ts","../node_modules/@vueuse/shared/index.mjs","../node_modules/@vueuse/core/index.mjs","../src/helpers/utils.ts","../src/helpers/compatibility.ts","../node_modules/luxon/src/errors.js","../node_modules/luxon/src/impl/formats.js","../node_modules/luxon/src/zone.js","../node_modules/luxon/src/zones/systemZone.js","../node_modules/luxon/src/zones/IANAZone.js","../node_modules/luxon/src/impl/locale.js","../node_modules/luxon/src/zones/fixedOffsetZone.js","../node_modules/luxon/src/zones/invalidZone.js","../node_modules/luxon/src/impl/zoneUtil.js","../node_modules/luxon/src/settings.js","../node_modules/luxon/src/impl/invalid.js","../node_modules/luxon/src/impl/conversions.js","../node_modules/luxon/src/impl/util.js","../node_modules/luxon/src/impl/english.js","../node_modules/luxon/src/impl/formatter.js","../node_modules/luxon/src/impl/regexParser.js","../node_modules/luxon/src/duration.js","../node_modules/luxon/src/interval.js","../node_modules/luxon/src/info.js","../node_modules/luxon/src/impl/diff.js","../node_modules/luxon/src/impl/digits.js","../node_modules/luxon/src/impl/tokenParser.js","../node_modules/luxon/src/datetime.js","../src/helpers/formats.ts","../src/helpers/date.ts","../src/helpers/download.ts","../src/helpers/downloadPdf.ts","../node_modules/exifreader/src/dataview.js","../node_modules/exifreader/src/utils.js","../node_modules/exifreader/src/constants.js","../node_modules/exifreader/src/tag-names-utils.js","../node_modules/exifreader/src/byte-order.js","../node_modules/exifreader/src/image-header-tiff.js","../node_modules/exifreader/src/image-header-jpeg.js","../node_modules/exifreader/src/image-header-png.js","../node_modules/exifreader/src/image-header-iso-bmff-utils.js","../node_modules/exifreader/src/image-header-iso-bmff-iloc.js","../node_modules/exifreader/src/image-header-iso-bmff.js","../node_modules/exifreader/src/image-header-heic.js","../node_modules/exifreader/src/image-header-avif.js","../node_modules/exifreader/src/image-header-webp.js","../node_modules/exifreader/src/image-header-gif.js","../node_modules/exifreader/src/image-header.js","../node_modules/exifreader/src/tag-names-common.js","../node_modules/exifreader/src/tag-names-0th-ifd.js","../node_modules/exifreader/src/tag-names-exif-ifd.js","../node_modules/exifreader/src/tag-names-gps-ifd.js","../node_modules/exifreader/src/tag-names-interoperability-ifd.js","../node_modules/exifreader/src/tag-names-mpf-ifd.js","../node_modules/exifreader/src/tag-names.js","../node_modules/exifreader/src/types.js","../node_modules/exifreader/src/tags-helpers.js","../node_modules/exifreader/src/tags.js","../node_modules/exifreader/src/mpf-tags.js","../node_modules/exifreader/src/file-tags.js","../node_modules/exifreader/src/jfif-tags.js","../node_modules/exifreader/src/iptc-tag-names.js","../node_modules/exifreader/src/text-decoder.js","../node_modules/exifreader/src/tag-decoder.js","../node_modules/exifreader/src/iptc-tags.js","../node_modules/exifreader/src/xmp-tag-names.js","../node_modules/exifreader/src/dom-parser.js","../node_modules/exifreader/src/xmp-tags.js","../node_modules/exifreader/src/photoshop-tag-names.js","../node_modules/exifreader/src/photoshop-tags.js","../node_modules/exifreader/src/icc-tag-names.js","../node_modules/exifreader/src/icc-tags.js","../node_modules/exifreader/src/png-file-tags.js","../node_modules/exifreader/src/png-text-tags.js","../node_modules/exifreader/src/png-tags.js","../node_modules/exifreader/src/vp8x-tags.js","../node_modules/exifreader/src/gif-file-tags.js","../node_modules/exifreader/src/thumbnail.js","../node_modules/exifreader/src/errors.js","../node_modules/exifreader/src/exif-reader.js","../src/helpers/FlashMessages.ts","../src/helpers/files.ts","../src/helpers/FileUpload.ts","../src/helpers/http.ts","../src/helpers/multiFileUpload.ts","../src/helpers/actions.ts","../src/helpers/singleFileUpload.ts","../src/helpers/storage.ts","../node_modules/@heroicons/vue/outline/esm/CalendarIcon.js","../node_modules/@heroicons/vue/outline/esm/ChevronDownIcon.js","../node_modules/@heroicons/vue/outline/esm/ChevronLeftIcon.js","../node_modules/@heroicons/vue/outline/esm/CurrencyDollarIcon.js","../node_modules/@heroicons/vue/outline/esm/DocumentTextIcon.js","../node_modules/@heroicons/vue/outline/esm/DotsVerticalIcon.js","../node_modules/@heroicons/vue/outline/esm/DownloadIcon.js","../node_modules/@heroicons/vue/outline/esm/EyeOffIcon.js","../node_modules/@heroicons/vue/outline/esm/EyeIcon.js","../node_modules/@heroicons/vue/outline/esm/HashtagIcon.js","../node_modules/@heroicons/vue/outline/esm/LockClosedIcon.js","../node_modules/@heroicons/vue/outline/esm/PlayIcon.js","../node_modules/@heroicons/vue/outline/esm/PlusIcon.js","../node_modules/@heroicons/vue/outline/esm/XIcon.js","../node_modules/@heroicons/vue/solid/esm/DownloadIcon.js","../node_modules/@heroicons/vue/solid/esm/ExclamationCircleIcon.js","../node_modules/@heroicons/vue/solid/esm/LocationMarkerIcon.js","../node_modules/@heroicons/vue/solid/esm/PencilIcon.js","../node_modules/@heroicons/vue/solid/esm/RefreshIcon.js","../node_modules/@heroicons/vue/solid/esm/StarIcon.js","../node_modules/@heroicons/vue/solid/esm/XCircleIcon.js","../src/components/DragAndDrop/dragAndDrop.ts","../src/components/DragAndDrop/HandleDraggable.vue","../src/svg/CaretDownIcon.svg","../src/svg/DragHandleDotsIcon.svg","../src/svg/DragHandleIcon.svg","../src/svg/FilterIcon.svg","../src/svg/ImageIcon.svg","../src/svg/PdfIcon.svg","../src/svg/PercentIcon.svg","../src/svg/SkipNextIcon.svg","../src/svg/SkipPreviousIcon.svg","../src/svg/TrashIcon.svg","../src/svg/WarningIcon.svg","../src/svg/XIcon.svg","../src/components/Utility/Buttons/ExportButton.vue","../src/components/Utility/Dialogs/ConfirmDialog.vue","../src/components/Utility/Dialogs/FullscreenCarouselDialog.vue","../src/components/Utility/Dialogs/FullScreenDialog.vue","../src/components/Utility/Dialogs/InfoDialog.vue","../src/components/Utility/Dialogs/InputDialog.vue","../src/components/Utility/Files/FilePreview.vue","../src/components/Utility/Files/SvgImg.vue","../src/components/Utility/Layouts/CollapsableSidebar.vue","../src/components/Utility/Layouts/ContentDrawer.vue","../src/components/Utility/Tools/RenderVnode.vue","../src/components/Utility/Tools/ActionVnode.vue","../src/components/Utility/Tools/RenderComponent.vue","../src/components/Utility/Popovers/PopoverMenu.vue","../src/components/Utility/Popovers/InteractiveTooltip.vue","../node_modules/gsap/gsap-core.js","../node_modules/gsap/CSSPlugin.js","../node_modules/gsap/index.js","../src/components/Utility/Transitions/StaggeredListTransition.vue","../src/components/DragAndDrop/listDragAndDrop.ts","../src/components/DragAndDrop/ListItemDraggable.vue","../src/components/ActionTable/Columns/ColumnSettingsDialog.vue","../src/components/ActionTable/Columns/TitleColumnFormat.vue","../src/components/ActionTable/Columns/VisibleColumnsToggleButtons.vue","../src/components/ActionTable/Form/Fields/FieldLabel.vue","../src/components/ActionTable/Form/Fields/ConfirmPasswordField.vue","../src/components/ActionTable/Form/Fields/DateField.vue","../src/components/ActionTable/Form/Fields/DateRangeField.vue","../src/components/ActionTable/Form/Fields/DateTimePicker.vue","../src/components/ActionTable/Form/Fields/DateTimeField.vue","../src/components/ActionTable/Form/Fields/EditableDiv.vue","../src/components/ActionTable/Form/Fields/FileUploadButton.vue","../src/components/ActionTable/Form/Fields/InlineDateTimeField.vue","../src/components/ActionTable/Form/Fields/NumberField.vue","../src/components/ActionTable/Form/Fields/MultiFileField.vue","../src/components/ActionTable/Form/Fields/SelectField.vue","../src/components/ActionTable/Form/Fields/MultiKeywordField.vue","../src/components/ActionTable/Form/Fields/NewPasswordField.vue","../src/components/ActionTable/Form/Fields/NumberRangeField.vue","../src/components/ActionTable/Form/Fields/SelectDrawer.vue","../src/components/ActionTable/Form/Fields/SelectWithChildrenField.vue","../src/components/ActionTable/Form/Fields/SingleFileField.vue","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js","../node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js","../src/vendor/tinymce-config.ts","../src/components/ActionTable/Filters/FilterableField.vue","../src/components/ActionTable/Filters/FilterFieldList.vue","../src/components/ActionTable/Filters/FilterListToggle.vue","../src/components/ActionTable/Form/RenderedForm.vue","../src/components/ActionTable/Layouts/ActionTableLayout.vue","../src/components/ActionTable/listHelpers.ts","../src/components/ActionTable/listControls.ts","../src/components/ActionTable/tableColumns.ts","../src/components/ActionTable/ActionMenu.vue","../src/components/ActionTable/ActionTableColumn.vue","../src/components/ActionTable/TableSummaryRow.vue","../src/components/ActionTable/ActionTable.vue","../src/components/AuditHistory/AuditHistoryItemValue.vue","../src/components/AuditHistory/AuditHistoryItem.vue","../src/components/PanelsDrawer/PanelsDrawer.vue","../src/vue-plugin.js"],"sourcesContent":["export let danxOptions = {\n fileUpload: {\n directory: \"file-upload\",\n presignedUploadUrl: null,\n uploadCompletedUrl: null\n }\n};\n\nexport function configure(options) {\n danxOptions = {\n ...danxOptions,\n ...options\n };\n}\n","/**\n *\n * @param array\n * @param item\n * @param newItem\n * @returns {*[]}\n */\nexport function replace(array, item, newItem = undefined) {\n const index =\n typeof item === \"function\" ? array.findIndex(item) : array.indexOf(item);\n if (index === false) {\n console.error(\"Item not found in array\", item, array);\n throw new Error(\"Item not found in array\");\n }\n const newArray = [...array];\n newItem !== undefined\n ? newArray.splice(index, 1, newItem)\n : newArray.splice(index, 1);\n return newArray;\n}\n\nexport function remove(array, item) {\n return replace(array, item);\n}\n\n/**\n * Remove duplicate items from an array using a callback to compare 2 elements\n * @param array\n * @param cb\n * @returns {*}\n */\nexport function uniqueBy(array, cb) {\n return array.filter((a, index, self) => {\n // Check if the current element 'a' is the first occurrence in the array\n return index === self.findIndex((b) => cb(a, b));\n });\n}\n","import { shallowRef, watchEffect, readonly, ref, watch, customRef, getCurrentScope, onScopeDispose, effectScope, getCurrentInstance, provide, inject, isVue3, version, isRef, unref, computed, reactive, toRefs as toRefs$1, toRef as toRef$1, isVue2, set as set$1, onBeforeMount, nextTick, onBeforeUnmount, onMounted, onUnmounted, isReactive } from 'vue-demi';\n\nfunction computedEager(fn, options) {\n var _a;\n const result = shallowRef();\n watchEffect(() => {\n result.value = fn();\n }, {\n ...options,\n flush: (_a = options == null ? void 0 : options.flush) != null ? _a : \"sync\"\n });\n return readonly(result);\n}\n\nfunction computedWithControl(source, fn) {\n let v = void 0;\n let track;\n let trigger;\n const dirty = ref(true);\n const update = () => {\n dirty.value = true;\n trigger();\n };\n watch(source, update, { flush: \"sync\" });\n const get = typeof fn === \"function\" ? fn : fn.get;\n const set = typeof fn === \"function\" ? void 0 : fn.set;\n const result = customRef((_track, _trigger) => {\n track = _track;\n trigger = _trigger;\n return {\n get() {\n if (dirty.value) {\n v = get();\n dirty.value = false;\n }\n track();\n return v;\n },\n set(v2) {\n set == null ? void 0 : set(v2);\n }\n };\n });\n if (Object.isExtensible(result))\n result.trigger = update;\n return result;\n}\n\nfunction tryOnScopeDispose(fn) {\n if (getCurrentScope()) {\n onScopeDispose(fn);\n return true;\n }\n return false;\n}\n\nfunction createEventHook() {\n const fns = /* @__PURE__ */ new Set();\n const off = (fn) => {\n fns.delete(fn);\n };\n const on = (fn) => {\n fns.add(fn);\n const offFn = () => off(fn);\n tryOnScopeDispose(offFn);\n return {\n off: offFn\n };\n };\n const trigger = (...args) => {\n return Promise.all(Array.from(fns).map((fn) => fn(...args)));\n };\n return {\n on,\n off,\n trigger\n };\n}\n\nfunction createGlobalState(stateFactory) {\n let initialized = false;\n let state;\n const scope = effectScope(true);\n return (...args) => {\n if (!initialized) {\n state = scope.run(() => stateFactory(...args));\n initialized = true;\n }\n return state;\n };\n}\n\nconst localProvidedStateMap = /* @__PURE__ */ new WeakMap();\n\nconst provideLocal = (key, value) => {\n var _a;\n const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;\n if (instance == null)\n throw new Error(\"provideLocal must be called in setup\");\n if (!localProvidedStateMap.has(instance))\n localProvidedStateMap.set(instance, /* @__PURE__ */ Object.create(null));\n const localProvidedState = localProvidedStateMap.get(instance);\n localProvidedState[key] = value;\n provide(key, value);\n};\n\nconst injectLocal = (...args) => {\n var _a;\n const key = args[0];\n const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;\n if (instance == null)\n throw new Error(\"injectLocal must be called in setup\");\n if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))\n return localProvidedStateMap.get(instance)[key];\n return inject(...args);\n};\n\nfunction createInjectionState(composable, options) {\n const key = (options == null ? void 0 : options.injectionKey) || Symbol(composable.name || \"InjectionState\");\n const useProvidingState = (...args) => {\n const state = composable(...args);\n provideLocal(key, state);\n return state;\n };\n const useInjectedState = () => injectLocal(key);\n return [useProvidingState, useInjectedState];\n}\n\nfunction createSharedComposable(composable) {\n let subscribers = 0;\n let state;\n let scope;\n const dispose = () => {\n subscribers -= 1;\n if (scope && subscribers <= 0) {\n scope.stop();\n state = void 0;\n scope = void 0;\n }\n };\n return (...args) => {\n subscribers += 1;\n if (!state) {\n scope = effectScope(true);\n state = scope.run(() => composable(...args));\n }\n tryOnScopeDispose(dispose);\n return state;\n };\n}\n\nfunction extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {\n if (!isVue3 && !version.startsWith(\"2.7.\")) {\n if (process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] extendRef only works in Vue 2.7 or above.\");\n return;\n }\n for (const [key, value] of Object.entries(extend)) {\n if (key === \"value\")\n continue;\n if (isRef(value) && unwrap) {\n Object.defineProperty(ref, key, {\n get() {\n return value.value;\n },\n set(v) {\n value.value = v;\n },\n enumerable\n });\n } else {\n Object.defineProperty(ref, key, { value, enumerable });\n }\n }\n return ref;\n}\n\nfunction get(obj, key) {\n if (key == null)\n return unref(obj);\n return unref(obj)[key];\n}\n\nfunction isDefined(v) {\n return unref(v) != null;\n}\n\nfunction makeDestructurable(obj, arr) {\n if (typeof Symbol !== \"undefined\") {\n const clone = { ...obj };\n Object.defineProperty(clone, Symbol.iterator, {\n enumerable: false,\n value() {\n let index = 0;\n return {\n next: () => ({\n value: arr[index++],\n done: index > arr.length\n })\n };\n }\n });\n return clone;\n } else {\n return Object.assign([...arr], obj);\n }\n}\n\nfunction toValue(r) {\n return typeof r === \"function\" ? r() : unref(r);\n}\nconst resolveUnref = toValue;\n\nfunction reactify(fn, options) {\n const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? unref : toValue;\n return function(...args) {\n return computed(() => fn.apply(this, args.map((i) => unrefFn(i))));\n };\n}\n\nfunction reactifyObject(obj, optionsOrKeys = {}) {\n let keys = [];\n let options;\n if (Array.isArray(optionsOrKeys)) {\n keys = optionsOrKeys;\n } else {\n options = optionsOrKeys;\n const { includeOwnProperties = true } = optionsOrKeys;\n keys.push(...Object.keys(obj));\n if (includeOwnProperties)\n keys.push(...Object.getOwnPropertyNames(obj));\n }\n return Object.fromEntries(\n keys.map((key) => {\n const value = obj[key];\n return [\n key,\n typeof value === \"function\" ? reactify(value.bind(obj), options) : value\n ];\n })\n );\n}\n\nfunction toReactive(objectRef) {\n if (!isRef(objectRef))\n return reactive(objectRef);\n const proxy = new Proxy({}, {\n get(_, p, receiver) {\n return unref(Reflect.get(objectRef.value, p, receiver));\n },\n set(_, p, value) {\n if (isRef(objectRef.value[p]) && !isRef(value))\n objectRef.value[p].value = value;\n else\n objectRef.value[p] = value;\n return true;\n },\n deleteProperty(_, p) {\n return Reflect.deleteProperty(objectRef.value, p);\n },\n has(_, p) {\n return Reflect.has(objectRef.value, p);\n },\n ownKeys() {\n return Object.keys(objectRef.value);\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n }\n });\n return reactive(proxy);\n}\n\nfunction reactiveComputed(fn) {\n return toReactive(computed(fn));\n}\n\nfunction reactiveOmit(obj, ...keys) {\n const flatKeys = keys.flat();\n const predicate = flatKeys[0];\n return reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e) => !flatKeys.includes(e[0]))));\n}\n\nconst isClient = typeof window !== \"undefined\" && typeof document !== \"undefined\";\nconst isWorker = typeof WorkerGlobalScope !== \"undefined\" && globalThis instanceof WorkerGlobalScope;\nconst isDef = (val) => typeof val !== \"undefined\";\nconst notNullish = (val) => val != null;\nconst assert = (condition, ...infos) => {\n if (!condition)\n console.warn(...infos);\n};\nconst toString = Object.prototype.toString;\nconst isObject = (val) => toString.call(val) === \"[object Object]\";\nconst now = () => Date.now();\nconst timestamp = () => +Date.now();\nconst clamp = (n, min, max) => Math.min(max, Math.max(min, n));\nconst noop = () => {\n};\nconst rand = (min, max) => {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n};\nconst hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);\nconst isIOS = /* @__PURE__ */ getIsIOS();\nfunction getIsIOS() {\n var _a, _b;\n return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));\n}\n\nfunction createFilterWrapper(filter, fn) {\n function wrapper(...args) {\n return new Promise((resolve, reject) => {\n Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);\n });\n }\n return wrapper;\n}\nconst bypassFilter = (invoke) => {\n return invoke();\n};\nfunction debounceFilter(ms, options = {}) {\n let timer;\n let maxTimer;\n let lastRejector = noop;\n const _clearTimeout = (timer2) => {\n clearTimeout(timer2);\n lastRejector();\n lastRejector = noop;\n };\n const filter = (invoke) => {\n const duration = toValue(ms);\n const maxDuration = toValue(options.maxWait);\n if (timer)\n _clearTimeout(timer);\n if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {\n if (maxTimer) {\n _clearTimeout(maxTimer);\n maxTimer = null;\n }\n return Promise.resolve(invoke());\n }\n return new Promise((resolve, reject) => {\n lastRejector = options.rejectOnCancel ? reject : resolve;\n if (maxDuration && !maxTimer) {\n maxTimer = setTimeout(() => {\n if (timer)\n _clearTimeout(timer);\n maxTimer = null;\n resolve(invoke());\n }, maxDuration);\n }\n timer = setTimeout(() => {\n if (maxTimer)\n _clearTimeout(maxTimer);\n maxTimer = null;\n resolve(invoke());\n }, duration);\n });\n };\n return filter;\n}\nfunction throttleFilter(...args) {\n let lastExec = 0;\n let timer;\n let isLeading = true;\n let lastRejector = noop;\n let lastValue;\n let ms;\n let trailing;\n let leading;\n let rejectOnCancel;\n if (!isRef(args[0]) && typeof args[0] === \"object\")\n ({ delay: ms, trailing = true, leading = true, rejectOnCancel = false } = args[0]);\n else\n [ms, trailing = true, leading = true, rejectOnCancel = false] = args;\n const clear = () => {\n if (timer) {\n clearTimeout(timer);\n timer = void 0;\n lastRejector();\n lastRejector = noop;\n }\n };\n const filter = (_invoke) => {\n const duration = toValue(ms);\n const elapsed = Date.now() - lastExec;\n const invoke = () => {\n return lastValue = _invoke();\n };\n clear();\n if (duration <= 0) {\n lastExec = Date.now();\n return invoke();\n }\n if (elapsed > duration && (leading || !isLeading)) {\n lastExec = Date.now();\n invoke();\n } else if (trailing) {\n lastValue = new Promise((resolve, reject) => {\n lastRejector = rejectOnCancel ? reject : resolve;\n timer = setTimeout(() => {\n lastExec = Date.now();\n isLeading = true;\n resolve(invoke());\n clear();\n }, Math.max(0, duration - elapsed));\n });\n }\n if (!leading && !timer)\n timer = setTimeout(() => isLeading = true, duration);\n isLeading = false;\n return lastValue;\n };\n return filter;\n}\nfunction pausableFilter(extendFilter = bypassFilter) {\n const isActive = ref(true);\n function pause() {\n isActive.value = false;\n }\n function resume() {\n isActive.value = true;\n }\n const eventFilter = (...args) => {\n if (isActive.value)\n extendFilter(...args);\n };\n return { isActive: readonly(isActive), pause, resume, eventFilter };\n}\n\nconst directiveHooks = {\n mounted: isVue3 ? \"mounted\" : \"inserted\",\n updated: isVue3 ? \"updated\" : \"componentUpdated\",\n unmounted: isVue3 ? \"unmounted\" : \"unbind\"\n};\n\nfunction cacheStringFunction(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n}\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction((str) => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\n\nfunction promiseTimeout(ms, throwOnTimeout = false, reason = \"Timeout\") {\n return new Promise((resolve, reject) => {\n if (throwOnTimeout)\n setTimeout(() => reject(reason), ms);\n else\n setTimeout(resolve, ms);\n });\n}\nfunction identity(arg) {\n return arg;\n}\nfunction createSingletonPromise(fn) {\n let _promise;\n function wrapper() {\n if (!_promise)\n _promise = fn();\n return _promise;\n }\n wrapper.reset = async () => {\n const _prev = _promise;\n _promise = void 0;\n if (_prev)\n await _prev;\n };\n return wrapper;\n}\nfunction invoke(fn) {\n return fn();\n}\nfunction containsProp(obj, ...props) {\n return props.some((k) => k in obj);\n}\nfunction increaseWithUnit(target, delta) {\n var _a;\n if (typeof target === \"number\")\n return target + delta;\n const value = ((_a = target.match(/^-?[0-9]+\\.?[0-9]*/)) == null ? void 0 : _a[0]) || \"\";\n const unit = target.slice(value.length);\n const result = Number.parseFloat(value) + delta;\n if (Number.isNaN(result))\n return target;\n return result + unit;\n}\nfunction objectPick(obj, keys, omitUndefined = false) {\n return keys.reduce((n, k) => {\n if (k in obj) {\n if (!omitUndefined || obj[k] !== void 0)\n n[k] = obj[k];\n }\n return n;\n }, {});\n}\nfunction objectOmit(obj, keys, omitUndefined = false) {\n return Object.fromEntries(Object.entries(obj).filter(([key, value]) => {\n return (!omitUndefined || value !== void 0) && !keys.includes(key);\n }));\n}\nfunction objectEntries(obj) {\n return Object.entries(obj);\n}\nfunction getLifeCycleTarget(target) {\n return target || getCurrentInstance();\n}\n\nfunction toRef(...args) {\n if (args.length !== 1)\n return toRef$1(...args);\n const r = args[0];\n return typeof r === \"function\" ? readonly(customRef(() => ({ get: r, set: noop }))) : ref(r);\n}\nconst resolveRef = toRef;\n\nfunction reactivePick(obj, ...keys) {\n const flatKeys = keys.flat();\n const predicate = flatKeys[0];\n return reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));\n}\n\nfunction refAutoReset(defaultValue, afterMs = 1e4) {\n return customRef((track, trigger) => {\n let value = toValue(defaultValue);\n let timer;\n const resetAfter = () => setTimeout(() => {\n value = toValue(defaultValue);\n trigger();\n }, toValue(afterMs));\n tryOnScopeDispose(() => {\n clearTimeout(timer);\n });\n return {\n get() {\n track();\n return value;\n },\n set(newValue) {\n value = newValue;\n trigger();\n clearTimeout(timer);\n timer = resetAfter();\n }\n };\n });\n}\n\nfunction useDebounceFn(fn, ms = 200, options = {}) {\n return createFilterWrapper(\n debounceFilter(ms, options),\n fn\n );\n}\n\nfunction refDebounced(value, ms = 200, options = {}) {\n const debounced = ref(value.value);\n const updater = useDebounceFn(() => {\n debounced.value = value.value;\n }, ms, options);\n watch(value, () => updater());\n return debounced;\n}\n\nfunction refDefault(source, defaultValue) {\n return computed({\n get() {\n var _a;\n return (_a = source.value) != null ? _a : defaultValue;\n },\n set(value) {\n source.value = value;\n }\n });\n}\n\nfunction useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {\n return createFilterWrapper(\n throttleFilter(ms, trailing, leading, rejectOnCancel),\n fn\n );\n}\n\nfunction refThrottled(value, delay = 200, trailing = true, leading = true) {\n if (delay <= 0)\n return value;\n const throttled = ref(value.value);\n const updater = useThrottleFn(() => {\n throttled.value = value.value;\n }, delay, trailing, leading);\n watch(value, () => updater());\n return throttled;\n}\n\nfunction refWithControl(initial, options = {}) {\n let source = initial;\n let track;\n let trigger;\n const ref = customRef((_track, _trigger) => {\n track = _track;\n trigger = _trigger;\n return {\n get() {\n return get();\n },\n set(v) {\n set(v);\n }\n };\n });\n function get(tracking = true) {\n if (tracking)\n track();\n return source;\n }\n function set(value, triggering = true) {\n var _a, _b;\n if (value === source)\n return;\n const old = source;\n if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)\n return;\n source = value;\n (_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);\n if (triggering)\n trigger();\n }\n const untrackedGet = () => get(false);\n const silentSet = (v) => set(v, false);\n const peek = () => get(false);\n const lay = (v) => set(v, false);\n return extendRef(\n ref,\n {\n get,\n set,\n untrackedGet,\n silentSet,\n peek,\n lay\n },\n { enumerable: true }\n );\n}\nconst controlledRef = refWithControl;\n\nfunction set(...args) {\n if (args.length === 2) {\n const [ref, value] = args;\n ref.value = value;\n }\n if (args.length === 3) {\n if (isVue2) {\n set$1(...args);\n } else {\n const [target, key, value] = args;\n target[key] = value;\n }\n }\n}\n\nfunction watchWithFilter(source, cb, options = {}) {\n const {\n eventFilter = bypassFilter,\n ...watchOptions\n } = options;\n return watch(\n source,\n createFilterWrapper(\n eventFilter,\n cb\n ),\n watchOptions\n );\n}\n\nfunction watchPausable(source, cb, options = {}) {\n const {\n eventFilter: filter,\n ...watchOptions\n } = options;\n const { eventFilter, pause, resume, isActive } = pausableFilter(filter);\n const stop = watchWithFilter(\n source,\n cb,\n {\n ...watchOptions,\n eventFilter\n }\n );\n return { stop, pause, resume, isActive };\n}\n\nfunction syncRef(left, right, ...[options]) {\n const {\n flush = \"sync\",\n deep = false,\n immediate = true,\n direction = \"both\",\n transform = {}\n } = options || {};\n const watchers = [];\n const transformLTR = \"ltr\" in transform && transform.ltr || ((v) => v);\n const transformRTL = \"rtl\" in transform && transform.rtl || ((v) => v);\n if (direction === \"both\" || direction === \"ltr\") {\n watchers.push(watchPausable(\n left,\n (newValue) => {\n watchers.forEach((w) => w.pause());\n right.value = transformLTR(newValue);\n watchers.forEach((w) => w.resume());\n },\n { flush, deep, immediate }\n ));\n }\n if (direction === \"both\" || direction === \"rtl\") {\n watchers.push(watchPausable(\n right,\n (newValue) => {\n watchers.forEach((w) => w.pause());\n left.value = transformRTL(newValue);\n watchers.forEach((w) => w.resume());\n },\n { flush, deep, immediate }\n ));\n }\n const stop = () => {\n watchers.forEach((w) => w.stop());\n };\n return stop;\n}\n\nfunction syncRefs(source, targets, options = {}) {\n const {\n flush = \"sync\",\n deep = false,\n immediate = true\n } = options;\n if (!Array.isArray(targets))\n targets = [targets];\n return watch(\n source,\n (newValue) => targets.forEach((target) => target.value = newValue),\n { flush, deep, immediate }\n );\n}\n\nfunction toRefs(objectRef, options = {}) {\n if (!isRef(objectRef))\n return toRefs$1(objectRef);\n const result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};\n for (const key in objectRef.value) {\n result[key] = customRef(() => ({\n get() {\n return objectRef.value[key];\n },\n set(v) {\n var _a;\n const replaceRef = (_a = toValue(options.replaceRef)) != null ? _a : true;\n if (replaceRef) {\n if (Array.isArray(objectRef.value)) {\n const copy = [...objectRef.value];\n copy[key] = v;\n objectRef.value = copy;\n } else {\n const newObject = { ...objectRef.value, [key]: v };\n Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));\n objectRef.value = newObject;\n }\n } else {\n objectRef.value[key] = v;\n }\n }\n }));\n }\n return result;\n}\n\nfunction tryOnBeforeMount(fn, sync = true, target) {\n const instance = getLifeCycleTarget(target);\n if (instance)\n onBeforeMount(fn, target);\n else if (sync)\n fn();\n else\n nextTick(fn);\n}\n\nfunction tryOnBeforeUnmount(fn, target) {\n const instance = getLifeCycleTarget(target);\n if (instance)\n onBeforeUnmount(fn, target);\n}\n\nfunction tryOnMounted(fn, sync = true, target) {\n const instance = getLifeCycleTarget();\n if (instance)\n onMounted(fn, target);\n else if (sync)\n fn();\n else\n nextTick(fn);\n}\n\nfunction tryOnUnmounted(fn, target) {\n const instance = getLifeCycleTarget(target);\n if (instance)\n onUnmounted(fn, target);\n}\n\nfunction createUntil(r, isNot = false) {\n function toMatch(condition, { flush = \"sync\", deep = false, timeout, throwOnTimeout } = {}) {\n let stop = null;\n const watcher = new Promise((resolve) => {\n stop = watch(\n r,\n (v) => {\n if (condition(v) !== isNot) {\n stop == null ? void 0 : stop();\n resolve(v);\n }\n },\n {\n flush,\n deep,\n immediate: true\n }\n );\n });\n const promises = [watcher];\n if (timeout != null) {\n promises.push(\n promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop == null ? void 0 : stop())\n );\n }\n return Promise.race(promises);\n }\n function toBe(value, options) {\n if (!isRef(value))\n return toMatch((v) => v === value, options);\n const { flush = \"sync\", deep = false, timeout, throwOnTimeout } = options != null ? options : {};\n let stop = null;\n const watcher = new Promise((resolve) => {\n stop = watch(\n [r, value],\n ([v1, v2]) => {\n if (isNot !== (v1 === v2)) {\n stop == null ? void 0 : stop();\n resolve(v1);\n }\n },\n {\n flush,\n deep,\n immediate: true\n }\n );\n });\n const promises = [watcher];\n if (timeout != null) {\n promises.push(\n promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {\n stop == null ? void 0 : stop();\n return toValue(r);\n })\n );\n }\n return Promise.race(promises);\n }\n function toBeTruthy(options) {\n return toMatch((v) => Boolean(v), options);\n }\n function toBeNull(options) {\n return toBe(null, options);\n }\n function toBeUndefined(options) {\n return toBe(void 0, options);\n }\n function toBeNaN(options) {\n return toMatch(Number.isNaN, options);\n }\n function toContains(value, options) {\n return toMatch((v) => {\n const array = Array.from(v);\n return array.includes(value) || array.includes(toValue(value));\n }, options);\n }\n function changed(options) {\n return changedTimes(1, options);\n }\n function changedTimes(n = 1, options) {\n let count = -1;\n return toMatch(() => {\n count += 1;\n return count >= n;\n }, options);\n }\n if (Array.isArray(toValue(r))) {\n const instance = {\n toMatch,\n toContains,\n changed,\n changedTimes,\n get not() {\n return createUntil(r, !isNot);\n }\n };\n return instance;\n } else {\n const instance = {\n toMatch,\n toBe,\n toBeTruthy,\n toBeNull,\n toBeNaN,\n toBeUndefined,\n changed,\n changedTimes,\n get not() {\n return createUntil(r, !isNot);\n }\n };\n return instance;\n }\n}\nfunction until(r) {\n return createUntil(r);\n}\n\nfunction defaultComparator(value, othVal) {\n return value === othVal;\n}\nfunction useArrayDifference(...args) {\n var _a;\n const list = args[0];\n const values = args[1];\n let compareFn = (_a = args[2]) != null ? _a : defaultComparator;\n if (typeof compareFn === \"string\") {\n const key = compareFn;\n compareFn = (value, othVal) => value[key] === othVal[key];\n }\n return computed(() => toValue(list).filter((x) => toValue(values).findIndex((y) => compareFn(x, y)) === -1));\n}\n\nfunction useArrayEvery(list, fn) {\n return computed(() => toValue(list).every((element, index, array) => fn(toValue(element), index, array)));\n}\n\nfunction useArrayFilter(list, fn) {\n return computed(() => toValue(list).map((i) => toValue(i)).filter(fn));\n}\n\nfunction useArrayFind(list, fn) {\n return computed(() => toValue(\n toValue(list).find((element, index, array) => fn(toValue(element), index, array))\n ));\n}\n\nfunction useArrayFindIndex(list, fn) {\n return computed(() => toValue(list).findIndex((element, index, array) => fn(toValue(element), index, array)));\n}\n\nfunction findLast(arr, cb) {\n let index = arr.length;\n while (index-- > 0) {\n if (cb(arr[index], index, arr))\n return arr[index];\n }\n return void 0;\n}\nfunction useArrayFindLast(list, fn) {\n return computed(() => toValue(\n !Array.prototype.findLast ? findLast(toValue(list), (element, index, array) => fn(toValue(element), index, array)) : toValue(list).findLast((element, index, array) => fn(toValue(element), index, array))\n ));\n}\n\nfunction isArrayIncludesOptions(obj) {\n return isObject(obj) && containsProp(obj, \"formIndex\", \"comparator\");\n}\nfunction useArrayIncludes(...args) {\n var _a;\n const list = args[0];\n const value = args[1];\n let comparator = args[2];\n let formIndex = 0;\n if (isArrayIncludesOptions(comparator)) {\n formIndex = (_a = comparator.fromIndex) != null ? _a : 0;\n comparator = comparator.comparator;\n }\n if (typeof comparator === \"string\") {\n const key = comparator;\n comparator = (element, value2) => element[key] === toValue(value2);\n }\n comparator = comparator != null ? comparator : (element, value2) => element === toValue(value2);\n return computed(() => toValue(list).slice(formIndex).some((element, index, array) => comparator(\n toValue(element),\n toValue(value),\n index,\n toValue(array)\n )));\n}\n\nfunction useArrayJoin(list, separator) {\n return computed(() => toValue(list).map((i) => toValue(i)).join(toValue(separator)));\n}\n\nfunction useArrayMap(list, fn) {\n return computed(() => toValue(list).map((i) => toValue(i)).map(fn));\n}\n\nfunction useArrayReduce(list, reducer, ...args) {\n const reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);\n return computed(() => {\n const resolved = toValue(list);\n return args.length ? resolved.reduce(reduceCallback, toValue(args[0])) : resolved.reduce(reduceCallback);\n });\n}\n\nfunction useArraySome(list, fn) {\n return computed(() => toValue(list).some((element, index, array) => fn(toValue(element), index, array)));\n}\n\nfunction uniq(array) {\n return Array.from(new Set(array));\n}\nfunction uniqueElementsBy(array, fn) {\n return array.reduce((acc, v) => {\n if (!acc.some((x) => fn(v, x, array)))\n acc.push(v);\n return acc;\n }, []);\n}\nfunction useArrayUnique(list, compareFn) {\n return computed(() => {\n const resolvedList = toValue(list).map((element) => toValue(element));\n return compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);\n });\n}\n\nfunction useCounter(initialValue = 0, options = {}) {\n let _initialValue = unref(initialValue);\n const count = ref(initialValue);\n const {\n max = Number.POSITIVE_INFINITY,\n min = Number.NEGATIVE_INFINITY\n } = options;\n const inc = (delta = 1) => count.value = Math.max(Math.min(max, count.value + delta), min);\n const dec = (delta = 1) => count.value = Math.min(Math.max(min, count.value - delta), max);\n const get = () => count.value;\n const set = (val) => count.value = Math.max(min, Math.min(max, val));\n const reset = (val = _initialValue) => {\n _initialValue = val;\n return set(val);\n };\n return { count, inc, dec, get, set, reset };\n}\n\nconst REGEX_PARSE = /^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/;\nconst REGEX_FORMAT = /[YMDHhms]o|\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;\nfunction defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {\n let m = hours < 12 ? \"AM\" : \"PM\";\n if (hasPeriod)\n m = m.split(\"\").reduce((acc, curr) => acc += `${curr}.`, \"\");\n return isLowercase ? m.toLowerCase() : m;\n}\nfunction formatOrdinal(num) {\n const suffixes = [\"th\", \"st\", \"nd\", \"rd\"];\n const v = num % 100;\n return num + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);\n}\nfunction formatDate(date, formatStr, options = {}) {\n var _a;\n const years = date.getFullYear();\n const month = date.getMonth();\n const days = date.getDate();\n const hours = date.getHours();\n const minutes = date.getMinutes();\n const seconds = date.getSeconds();\n const milliseconds = date.getMilliseconds();\n const day = date.getDay();\n const meridiem = (_a = options.customMeridiem) != null ? _a : defaultMeridiem;\n const matches = {\n Yo: () => formatOrdinal(years),\n YY: () => String(years).slice(-2),\n YYYY: () => years,\n M: () => month + 1,\n Mo: () => formatOrdinal(month + 1),\n MM: () => `${month + 1}`.padStart(2, \"0\"),\n MMM: () => date.toLocaleDateString(options.locales, { month: \"short\" }),\n MMMM: () => date.toLocaleDateString(options.locales, { month: \"long\" }),\n D: () => String(days),\n Do: () => formatOrdinal(days),\n DD: () => `${days}`.padStart(2, \"0\"),\n H: () => String(hours),\n Ho: () => formatOrdinal(hours),\n HH: () => `${hours}`.padStart(2, \"0\"),\n h: () => `${hours % 12 || 12}`.padStart(1, \"0\"),\n ho: () => formatOrdinal(hours % 12 || 12),\n hh: () => `${hours % 12 || 12}`.padStart(2, \"0\"),\n m: () => String(minutes),\n mo: () => formatOrdinal(minutes),\n mm: () => `${minutes}`.padStart(2, \"0\"),\n s: () => String(seconds),\n so: () => formatOrdinal(seconds),\n ss: () => `${seconds}`.padStart(2, \"0\"),\n SSS: () => `${milliseconds}`.padStart(3, \"0\"),\n d: () => day,\n dd: () => date.toLocaleDateString(options.locales, { weekday: \"narrow\" }),\n ddd: () => date.toLocaleDateString(options.locales, { weekday: \"short\" }),\n dddd: () => date.toLocaleDateString(options.locales, { weekday: \"long\" }),\n A: () => meridiem(hours, minutes),\n AA: () => meridiem(hours, minutes, false, true),\n a: () => meridiem(hours, minutes, true),\n aa: () => meridiem(hours, minutes, true, true)\n };\n return formatStr.replace(REGEX_FORMAT, (match, $1) => {\n var _a2, _b;\n return (_b = $1 != null ? $1 : (_a2 = matches[match]) == null ? void 0 : _a2.call(matches)) != null ? _b : match;\n });\n}\nfunction normalizeDate(date) {\n if (date === null)\n return new Date(Number.NaN);\n if (date === void 0)\n return /* @__PURE__ */ new Date();\n if (date instanceof Date)\n return new Date(date);\n if (typeof date === \"string\" && !/Z$/i.test(date)) {\n const d = date.match(REGEX_PARSE);\n if (d) {\n const m = d[2] - 1 || 0;\n const ms = (d[7] || \"0\").substring(0, 3);\n return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);\n }\n }\n return new Date(date);\n}\nfunction useDateFormat(date, formatStr = \"HH:mm:ss\", options = {}) {\n return computed(() => formatDate(normalizeDate(toValue(date)), toValue(formatStr), options));\n}\n\nfunction useIntervalFn(cb, interval = 1e3, options = {}) {\n const {\n immediate = true,\n immediateCallback = false\n } = options;\n let timer = null;\n const isActive = ref(false);\n function clean() {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n }\n function pause() {\n isActive.value = false;\n clean();\n }\n function resume() {\n const intervalValue = toValue(interval);\n if (intervalValue <= 0)\n return;\n isActive.value = true;\n if (immediateCallback)\n cb();\n clean();\n timer = setInterval(cb, intervalValue);\n }\n if (immediate && isClient)\n resume();\n if (isRef(interval) || typeof interval === \"function\") {\n const stopWatch = watch(interval, () => {\n if (isActive.value && isClient)\n resume();\n });\n tryOnScopeDispose(stopWatch);\n }\n tryOnScopeDispose(pause);\n return {\n isActive,\n pause,\n resume\n };\n}\n\nfunction useInterval(interval = 1e3, options = {}) {\n const {\n controls: exposeControls = false,\n immediate = true,\n callback\n } = options;\n const counter = ref(0);\n const update = () => counter.value += 1;\n const reset = () => {\n counter.value = 0;\n };\n const controls = useIntervalFn(\n callback ? () => {\n update();\n callback(counter.value);\n } : update,\n interval,\n { immediate }\n );\n if (exposeControls) {\n return {\n counter,\n reset,\n ...controls\n };\n } else {\n return counter;\n }\n}\n\nfunction useLastChanged(source, options = {}) {\n var _a;\n const ms = ref((_a = options.initialValue) != null ? _a : null);\n watch(\n source,\n () => ms.value = timestamp(),\n options\n );\n return ms;\n}\n\nfunction useTimeoutFn(cb, interval, options = {}) {\n const {\n immediate = true\n } = options;\n const isPending = ref(false);\n let timer = null;\n function clear() {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n }\n function stop() {\n isPending.value = false;\n clear();\n }\n function start(...args) {\n clear();\n isPending.value = true;\n timer = setTimeout(() => {\n isPending.value = false;\n timer = null;\n cb(...args);\n }, toValue(interval));\n }\n if (immediate) {\n isPending.value = true;\n if (isClient)\n start();\n }\n tryOnScopeDispose(stop);\n return {\n isPending: readonly(isPending),\n start,\n stop\n };\n}\n\nfunction useTimeout(interval = 1e3, options = {}) {\n const {\n controls: exposeControls = false,\n callback\n } = options;\n const controls = useTimeoutFn(\n callback != null ? callback : noop,\n interval,\n options\n );\n const ready = computed(() => !controls.isPending.value);\n if (exposeControls) {\n return {\n ready,\n ...controls\n };\n } else {\n return ready;\n }\n}\n\nfunction useToNumber(value, options = {}) {\n const {\n method = \"parseFloat\",\n radix,\n nanToZero\n } = options;\n return computed(() => {\n let resolved = toValue(value);\n if (typeof resolved === \"string\")\n resolved = Number[method](resolved, radix);\n if (nanToZero && Number.isNaN(resolved))\n resolved = 0;\n return resolved;\n });\n}\n\nfunction useToString(value) {\n return computed(() => `${toValue(value)}`);\n}\n\nfunction useToggle(initialValue = false, options = {}) {\n const {\n truthyValue = true,\n falsyValue = false\n } = options;\n const valueIsRef = isRef(initialValue);\n const _value = ref(initialValue);\n function toggle(value) {\n if (arguments.length) {\n _value.value = value;\n return _value.value;\n } else {\n const truthy = toValue(truthyValue);\n _value.value = _value.value === truthy ? toValue(falsyValue) : truthy;\n return _value.value;\n }\n }\n if (valueIsRef)\n return toggle;\n else\n return [_value, toggle];\n}\n\nfunction watchArray(source, cb, options) {\n let oldList = (options == null ? void 0 : options.immediate) ? [] : [...source instanceof Function ? source() : Array.isArray(source) ? source : toValue(source)];\n return watch(source, (newList, _, onCleanup) => {\n const oldListRemains = Array.from({ length: oldList.length });\n const added = [];\n for (const obj of newList) {\n let found = false;\n for (let i = 0; i < oldList.length; i++) {\n if (!oldListRemains[i] && obj === oldList[i]) {\n oldListRemains[i] = true;\n found = true;\n break;\n }\n }\n if (!found)\n added.push(obj);\n }\n const removed = oldList.filter((_2, i) => !oldListRemains[i]);\n cb(newList, oldList, added, removed, onCleanup);\n oldList = [...newList];\n }, options);\n}\n\nfunction watchAtMost(source, cb, options) {\n const {\n count,\n ...watchOptions\n } = options;\n const current = ref(0);\n const stop = watchWithFilter(\n source,\n (...args) => {\n current.value += 1;\n if (current.value >= toValue(count))\n nextTick(() => stop());\n cb(...args);\n },\n watchOptions\n );\n return { count: current, stop };\n}\n\nfunction watchDebounced(source, cb, options = {}) {\n const {\n debounce = 0,\n maxWait = void 0,\n ...watchOptions\n } = options;\n return watchWithFilter(\n source,\n cb,\n {\n ...watchOptions,\n eventFilter: debounceFilter(debounce, { maxWait })\n }\n );\n}\n\nfunction watchDeep(source, cb, options) {\n return watch(\n source,\n cb,\n {\n ...options,\n deep: true\n }\n );\n}\n\nfunction watchIgnorable(source, cb, options = {}) {\n const {\n eventFilter = bypassFilter,\n ...watchOptions\n } = options;\n const filteredCb = createFilterWrapper(\n eventFilter,\n cb\n );\n let ignoreUpdates;\n let ignorePrevAsyncUpdates;\n let stop;\n if (watchOptions.flush === \"sync\") {\n const ignore = ref(false);\n ignorePrevAsyncUpdates = () => {\n };\n ignoreUpdates = (updater) => {\n ignore.value = true;\n updater();\n ignore.value = false;\n };\n stop = watch(\n source,\n (...args) => {\n if (!ignore.value)\n filteredCb(...args);\n },\n watchOptions\n );\n } else {\n const disposables = [];\n const ignoreCounter = ref(0);\n const syncCounter = ref(0);\n ignorePrevAsyncUpdates = () => {\n ignoreCounter.value = syncCounter.value;\n };\n disposables.push(\n watch(\n source,\n () => {\n syncCounter.value++;\n },\n { ...watchOptions, flush: \"sync\" }\n )\n );\n ignoreUpdates = (updater) => {\n const syncCounterPrev = syncCounter.value;\n updater();\n ignoreCounter.value += syncCounter.value - syncCounterPrev;\n };\n disposables.push(\n watch(\n source,\n (...args) => {\n const ignore = ignoreCounter.value > 0 && ignoreCounter.value === syncCounter.value;\n ignoreCounter.value = 0;\n syncCounter.value = 0;\n if (ignore)\n return;\n filteredCb(...args);\n },\n watchOptions\n )\n );\n stop = () => {\n disposables.forEach((fn) => fn());\n };\n }\n return { stop, ignoreUpdates, ignorePrevAsyncUpdates };\n}\n\nfunction watchImmediate(source, cb, options) {\n return watch(\n source,\n cb,\n {\n ...options,\n immediate: true\n }\n );\n}\n\nfunction watchOnce(source, cb, options) {\n const stop = watch(source, (...args) => {\n nextTick(() => stop());\n return cb(...args);\n }, options);\n return stop;\n}\n\nfunction watchThrottled(source, cb, options = {}) {\n const {\n throttle = 0,\n trailing = true,\n leading = true,\n ...watchOptions\n } = options;\n return watchWithFilter(\n source,\n cb,\n {\n ...watchOptions,\n eventFilter: throttleFilter(throttle, trailing, leading)\n }\n );\n}\n\nfunction watchTriggerable(source, cb, options = {}) {\n let cleanupFn;\n function onEffect() {\n if (!cleanupFn)\n return;\n const fn = cleanupFn;\n cleanupFn = void 0;\n fn();\n }\n function onCleanup(callback) {\n cleanupFn = callback;\n }\n const _cb = (value, oldValue) => {\n onEffect();\n return cb(value, oldValue, onCleanup);\n };\n const res = watchIgnorable(source, _cb, options);\n const { ignoreUpdates } = res;\n const trigger = () => {\n let res2;\n ignoreUpdates(() => {\n res2 = _cb(getWatchSources(source), getOldValue(source));\n });\n return res2;\n };\n return {\n ...res,\n trigger\n };\n}\nfunction getWatchSources(sources) {\n if (isReactive(sources))\n return sources;\n if (Array.isArray(sources))\n return sources.map((item) => toValue(item));\n return toValue(sources);\n}\nfunction getOldValue(source) {\n return Array.isArray(source) ? source.map(() => void 0) : void 0;\n}\n\nfunction whenever(source, cb, options) {\n const stop = watch(\n source,\n (v, ov, onInvalidate) => {\n if (v) {\n if (options == null ? void 0 : options.once)\n nextTick(() => stop());\n cb(v, ov, onInvalidate);\n }\n },\n {\n ...options,\n once: false\n }\n );\n return stop;\n}\n\nexport { assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, directiveHooks, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };\n","import { noop, makeDestructurable, camelize, toValue, isClient, isObject, tryOnScopeDispose, isIOS, tryOnMounted, objectOmit, promiseTimeout, until, increaseWithUnit, objectEntries, createSingletonPromise, useTimeoutFn, pausableWatch, toRef, createEventHook, notNullish, computedWithControl, timestamp, pausableFilter, watchIgnorable, debounceFilter, createFilterWrapper, bypassFilter, toRefs, useIntervalFn, containsProp, hasOwn, throttleFilter, useDebounceFn, useThrottleFn, clamp, syncRef, objectPick, tryOnUnmounted, watchWithFilter, tryOnBeforeUnmount, identity, isDef, isWorker } from '@vueuse/shared';\nexport * from '@vueuse/shared';\nimport { isRef, ref, shallowRef, watchEffect, computed, inject, isVue3, version, defineComponent, h, TransitionGroup, shallowReactive, Fragment, watch, getCurrentInstance, customRef, onUpdated, onMounted, isVue2, readonly, nextTick, reactive, markRaw, unref, getCurrentScope, set, del, isReadonly, onBeforeUpdate } from 'vue-demi';\n\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n let options;\n if (isRef(optionsOrRef)) {\n options = {\n evaluating: optionsOrRef\n };\n } else {\n options = optionsOrRef || {};\n }\n const {\n lazy = false,\n evaluating = void 0,\n shallow = true,\n onError = noop\n } = options;\n const started = ref(!lazy);\n const current = shallow ? shallowRef(initialState) : ref(initialState);\n let counter = 0;\n watchEffect(async (onInvalidate) => {\n if (!started.value)\n return;\n counter++;\n const counterAtBeginning = counter;\n let hasFinished = false;\n if (evaluating) {\n Promise.resolve().then(() => {\n evaluating.value = true;\n });\n }\n try {\n const result = await evaluationCallback((cancelCallback) => {\n onInvalidate(() => {\n if (evaluating)\n evaluating.value = false;\n if (!hasFinished)\n cancelCallback();\n });\n });\n if (counterAtBeginning === counter)\n current.value = result;\n } catch (e) {\n onError(e);\n } finally {\n if (evaluating && counterAtBeginning === counter)\n evaluating.value = false;\n hasFinished = true;\n }\n });\n if (lazy) {\n return computed(() => {\n started.value = true;\n return current.value;\n });\n } else {\n return current;\n }\n}\n\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n let source = inject(key);\n if (defaultSource)\n source = inject(key, defaultSource);\n if (treatDefaultAsFactory)\n source = inject(key, defaultSource, treatDefaultAsFactory);\n if (typeof options === \"function\") {\n return computed((ctx) => options(source, ctx));\n } else {\n return computed({\n get: (ctx) => options.get(source, ctx),\n set: options.set\n });\n }\n}\n\nfunction createReusableTemplate(options = {}) {\n if (!isVue3 && !version.startsWith(\"2.7.\")) {\n if (process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] createReusableTemplate only works in Vue 2.7 or above.\");\n return;\n }\n const {\n inheritAttrs = true\n } = options;\n const render = shallowRef();\n const define = /* #__PURE__ */ defineComponent({\n setup(_, { slots }) {\n return () => {\n render.value = slots.default;\n };\n }\n });\n const reuse = /* #__PURE__ */ defineComponent({\n inheritAttrs,\n setup(_, { attrs, slots }) {\n return () => {\n var _a;\n if (!render.value && process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] Failed to find the definition of reusable template\");\n const vnode = (_a = render.value) == null ? void 0 : _a.call(render, { ...keysToCamelKebabCase(attrs), $slots: slots });\n return inheritAttrs && (vnode == null ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;\n };\n }\n });\n return makeDestructurable(\n { define, reuse },\n [define, reuse]\n );\n}\nfunction keysToCamelKebabCase(obj) {\n const newObj = {};\n for (const key in obj)\n newObj[camelize(key)] = obj[key];\n return newObj;\n}\n\nfunction createTemplatePromise(options = {}) {\n if (!isVue3) {\n if (process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] createTemplatePromise only works in Vue 3 or above.\");\n return;\n }\n let index = 0;\n const instances = ref([]);\n function create(...args) {\n const props = shallowReactive({\n key: index++,\n args,\n promise: void 0,\n resolve: () => {\n },\n reject: () => {\n },\n isResolving: false,\n options\n });\n instances.value.push(props);\n props.promise = new Promise((_resolve, _reject) => {\n props.resolve = (v) => {\n props.isResolving = true;\n return _resolve(v);\n };\n props.reject = _reject;\n }).finally(() => {\n props.promise = void 0;\n const index2 = instances.value.indexOf(props);\n if (index2 !== -1)\n instances.value.splice(index2, 1);\n });\n return props.promise;\n }\n function start(...args) {\n if (options.singleton && instances.value.length > 0)\n return instances.value[0].promise;\n return create(...args);\n }\n const component = /* #__PURE__ */ defineComponent((_, { slots }) => {\n const renderList = () => instances.value.map((props) => {\n var _a;\n return h(Fragment, { key: props.key }, (_a = slots.default) == null ? void 0 : _a.call(slots, props));\n });\n if (options.transition)\n return () => h(TransitionGroup, options.transition, renderList);\n return renderList;\n });\n component.start = start;\n return component;\n}\n\nfunction createUnrefFn(fn) {\n return function(...args) {\n return fn.apply(this, args.map((i) => toValue(i)));\n };\n}\n\nfunction unrefElement(elRef) {\n var _a;\n const plain = toValue(elRef);\n return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;\n}\n\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n\nfunction useEventListener(...args) {\n let target;\n let events;\n let listeners;\n let options;\n if (typeof args[0] === \"string\" || Array.isArray(args[0])) {\n [events, listeners, options] = args;\n target = defaultWindow;\n } else {\n [target, events, listeners, options] = args;\n }\n if (!target)\n return noop;\n if (!Array.isArray(events))\n events = [events];\n if (!Array.isArray(listeners))\n listeners = [listeners];\n const cleanups = [];\n const cleanup = () => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n };\n const register = (el, event, listener, options2) => {\n el.addEventListener(event, listener, options2);\n return () => el.removeEventListener(event, listener, options2);\n };\n const stopWatch = watch(\n () => [unrefElement(target), toValue(options)],\n ([el, options2]) => {\n cleanup();\n if (!el)\n return;\n const optionsClone = isObject(options2) ? { ...options2 } : options2;\n cleanups.push(\n ...events.flatMap((event) => {\n return listeners.map((listener) => register(el, event, listener, optionsClone));\n })\n );\n },\n { immediate: true, flush: \"post\" }\n );\n const stop = () => {\n stopWatch();\n cleanup();\n };\n tryOnScopeDispose(stop);\n return stop;\n}\n\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;\n if (!window)\n return noop;\n if (isIOS && !_iOSWorkaround) {\n _iOSWorkaround = true;\n Array.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop));\n window.document.documentElement.addEventListener(\"click\", noop);\n }\n let shouldListen = true;\n const shouldIgnore = (event) => {\n return ignore.some((target2) => {\n if (typeof target2 === \"string\") {\n return Array.from(window.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));\n } else {\n const el = unrefElement(target2);\n return el && (event.target === el || event.composedPath().includes(el));\n }\n });\n };\n const listener = (event) => {\n const el = unrefElement(target);\n if (!el || el === event.target || event.composedPath().includes(el))\n return;\n if (event.detail === 0)\n shouldListen = !shouldIgnore(event);\n if (!shouldListen) {\n shouldListen = true;\n return;\n }\n handler(event);\n };\n const cleanup = [\n useEventListener(window, \"click\", listener, { passive: true, capture }),\n useEventListener(window, \"pointerdown\", (e) => {\n const el = unrefElement(target);\n shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));\n }, { passive: true }),\n detectIframe && useEventListener(window, \"blur\", (event) => {\n setTimeout(() => {\n var _a;\n const el = unrefElement(target);\n if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === \"IFRAME\" && !(el == null ? void 0 : el.contains(window.document.activeElement)))\n handler(event);\n }, 0);\n })\n ].filter(Boolean);\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nfunction createKeyPredicate(keyFilter) {\n if (typeof keyFilter === \"function\")\n return keyFilter;\n else if (typeof keyFilter === \"string\")\n return (event) => event.key === keyFilter;\n else if (Array.isArray(keyFilter))\n return (event) => keyFilter.includes(event.key);\n return () => true;\n}\nfunction onKeyStroke(...args) {\n let key;\n let handler;\n let options = {};\n if (args.length === 3) {\n key = args[0];\n handler = args[1];\n options = args[2];\n } else if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n key = true;\n handler = args[0];\n options = args[1];\n } else {\n key = args[0];\n handler = args[1];\n }\n } else {\n key = true;\n handler = args[0];\n }\n const {\n target = defaultWindow,\n eventName = \"keydown\",\n passive = false,\n dedupe = false\n } = options;\n const predicate = createKeyPredicate(key);\n const listener = (e) => {\n if (e.repeat && toValue(dedupe))\n return;\n if (predicate(e))\n handler(e);\n };\n return useEventListener(target, eventName, listener, passive);\n}\nfunction onKeyDown(key, handler, options = {}) {\n return onKeyStroke(key, handler, { ...options, eventName: \"keydown\" });\n}\nfunction onKeyPressed(key, handler, options = {}) {\n return onKeyStroke(key, handler, { ...options, eventName: \"keypress\" });\n}\nfunction onKeyUp(key, handler, options = {}) {\n return onKeyStroke(key, handler, { ...options, eventName: \"keyup\" });\n}\n\nconst DEFAULT_DELAY = 500;\nconst DEFAULT_THRESHOLD = 10;\nfunction onLongPress(target, handler, options) {\n var _a, _b;\n const elementRef = computed(() => unrefElement(target));\n let timeout;\n let posStart;\n function clear() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = void 0;\n }\n posStart = void 0;\n }\n function onDown(ev) {\n var _a2, _b2, _c, _d;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n clear();\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n posStart = {\n x: ev.x,\n y: ev.y\n };\n timeout = setTimeout(\n () => handler(ev),\n (_d = options == null ? void 0 : options.delay) != null ? _d : DEFAULT_DELAY\n );\n }\n function onMove(ev) {\n var _a2, _b2, _c, _d;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n if (!posStart || (options == null ? void 0 : options.distanceThreshold) === false)\n return;\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n const dx = ev.x - posStart.x;\n const dy = ev.y - posStart.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n if (distance >= ((_d = options == null ? void 0 : options.distanceThreshold) != null ? _d : DEFAULT_THRESHOLD))\n clear();\n }\n const listenerOptions = {\n capture: (_a = options == null ? void 0 : options.modifiers) == null ? void 0 : _a.capture,\n once: (_b = options == null ? void 0 : options.modifiers) == null ? void 0 : _b.once\n };\n const cleanup = [\n useEventListener(elementRef, \"pointerdown\", onDown, listenerOptions),\n useEventListener(elementRef, \"pointermove\", onMove, listenerOptions),\n useEventListener(elementRef, [\"pointerup\", \"pointerleave\"], clear, listenerOptions)\n ];\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nfunction isFocusedElementEditable() {\n const { activeElement, body } = document;\n if (!activeElement)\n return false;\n if (activeElement === body)\n return false;\n switch (activeElement.tagName) {\n case \"INPUT\":\n case \"TEXTAREA\":\n return true;\n }\n return activeElement.hasAttribute(\"contenteditable\");\n}\nfunction isTypedCharValid({\n keyCode,\n metaKey,\n ctrlKey,\n altKey\n}) {\n if (metaKey || ctrlKey || altKey)\n return false;\n if (keyCode >= 48 && keyCode <= 57)\n return true;\n if (keyCode >= 65 && keyCode <= 90)\n return true;\n if (keyCode >= 97 && keyCode <= 122)\n return true;\n return false;\n}\nfunction onStartTyping(callback, options = {}) {\n const { document: document2 = defaultDocument } = options;\n const keydown = (event) => {\n !isFocusedElementEditable() && isTypedCharValid(event) && callback(event);\n };\n if (document2)\n useEventListener(document2, \"keydown\", keydown, { passive: true });\n}\n\nfunction templateRef(key, initialValue = null) {\n const instance = getCurrentInstance();\n let _trigger = () => {\n };\n const element = customRef((track, trigger) => {\n _trigger = trigger;\n return {\n get() {\n var _a, _b;\n track();\n return (_b = (_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.$refs[key]) != null ? _b : initialValue;\n },\n set() {\n }\n };\n });\n tryOnMounted(_trigger);\n onUpdated(_trigger);\n return element;\n}\n\nfunction useActiveElement(options = {}) {\n var _a;\n const {\n window = defaultWindow,\n deep = true\n } = options;\n const document = (_a = options.document) != null ? _a : window == null ? void 0 : window.document;\n const getDeepActiveElement = () => {\n var _a2;\n let element = document == null ? void 0 : document.activeElement;\n if (deep) {\n while (element == null ? void 0 : element.shadowRoot)\n element = (_a2 = element == null ? void 0 : element.shadowRoot) == null ? void 0 : _a2.activeElement;\n }\n return element;\n };\n const activeElement = ref();\n const trigger = () => {\n activeElement.value = getDeepActiveElement();\n };\n if (window) {\n useEventListener(window, \"blur\", (event) => {\n if (event.relatedTarget !== null)\n return;\n trigger();\n }, true);\n useEventListener(window, \"focus\", trigger, true);\n }\n trigger();\n return activeElement;\n}\n\nfunction useMounted() {\n const isMounted = ref(false);\n const instance = getCurrentInstance();\n if (instance) {\n onMounted(() => {\n isMounted.value = true;\n }, isVue2 ? null : instance);\n }\n return isMounted;\n}\n\nfunction useSupported(callback) {\n const isMounted = useMounted();\n return computed(() => {\n isMounted.value;\n return Boolean(callback());\n });\n}\n\nfunction useRafFn(fn, options = {}) {\n const {\n immediate = true,\n fpsLimit = void 0,\n window = defaultWindow\n } = options;\n const isActive = ref(false);\n const intervalLimit = fpsLimit ? 1e3 / fpsLimit : null;\n let previousFrameTimestamp = 0;\n let rafId = null;\n function loop(timestamp) {\n if (!isActive.value || !window)\n return;\n if (!previousFrameTimestamp)\n previousFrameTimestamp = timestamp;\n const delta = timestamp - previousFrameTimestamp;\n if (intervalLimit && delta < intervalLimit) {\n rafId = window.requestAnimationFrame(loop);\n return;\n }\n previousFrameTimestamp = timestamp;\n fn({ delta, timestamp });\n rafId = window.requestAnimationFrame(loop);\n }\n function resume() {\n if (!isActive.value && window) {\n isActive.value = true;\n previousFrameTimestamp = 0;\n rafId = window.requestAnimationFrame(loop);\n }\n }\n function pause() {\n isActive.value = false;\n if (rafId != null && window) {\n window.cancelAnimationFrame(rafId);\n rafId = null;\n }\n }\n if (immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive: readonly(isActive),\n pause,\n resume\n };\n}\n\nfunction useAnimate(target, keyframes, options) {\n let config;\n let animateOptions;\n if (isObject(options)) {\n config = options;\n animateOptions = objectOmit(options, [\"window\", \"immediate\", \"commitStyles\", \"persist\", \"onReady\", \"onError\"]);\n } else {\n config = { duration: options };\n animateOptions = options;\n }\n const {\n window = defaultWindow,\n immediate = true,\n commitStyles,\n persist,\n playbackRate: _playbackRate = 1,\n onReady,\n onError = (e) => {\n console.error(e);\n }\n } = config;\n const isSupported = useSupported(() => window && HTMLElement && \"animate\" in HTMLElement.prototype);\n const animate = shallowRef(void 0);\n const store = shallowReactive({\n startTime: null,\n currentTime: null,\n timeline: null,\n playbackRate: _playbackRate,\n pending: false,\n playState: immediate ? \"idle\" : \"paused\",\n replaceState: \"active\"\n });\n const pending = computed(() => store.pending);\n const playState = computed(() => store.playState);\n const replaceState = computed(() => store.replaceState);\n const startTime = computed({\n get() {\n return store.startTime;\n },\n set(value) {\n store.startTime = value;\n if (animate.value)\n animate.value.startTime = value;\n }\n });\n const currentTime = computed({\n get() {\n return store.currentTime;\n },\n set(value) {\n store.currentTime = value;\n if (animate.value) {\n animate.value.currentTime = value;\n syncResume();\n }\n }\n });\n const timeline = computed({\n get() {\n return store.timeline;\n },\n set(value) {\n store.timeline = value;\n if (animate.value)\n animate.value.timeline = value;\n }\n });\n const playbackRate = computed({\n get() {\n return store.playbackRate;\n },\n set(value) {\n store.playbackRate = value;\n if (animate.value)\n animate.value.playbackRate = value;\n }\n });\n const play = () => {\n if (animate.value) {\n try {\n animate.value.play();\n syncResume();\n } catch (e) {\n syncPause();\n onError(e);\n }\n } else {\n update();\n }\n };\n const pause = () => {\n var _a;\n try {\n (_a = animate.value) == null ? void 0 : _a.pause();\n syncPause();\n } catch (e) {\n onError(e);\n }\n };\n const reverse = () => {\n var _a;\n !animate.value && update();\n try {\n (_a = animate.value) == null ? void 0 : _a.reverse();\n syncResume();\n } catch (e) {\n syncPause();\n onError(e);\n }\n };\n const finish = () => {\n var _a;\n try {\n (_a = animate.value) == null ? void 0 : _a.finish();\n syncPause();\n } catch (e) {\n onError(e);\n }\n };\n const cancel = () => {\n var _a;\n try {\n (_a = animate.value) == null ? void 0 : _a.cancel();\n syncPause();\n } catch (e) {\n onError(e);\n }\n };\n watch(() => unrefElement(target), (el) => {\n el && update();\n });\n watch(() => keyframes, (value) => {\n !animate.value && update();\n if (!unrefElement(target) && animate.value) {\n animate.value.effect = new KeyframeEffect(\n unrefElement(target),\n toValue(value),\n animateOptions\n );\n }\n }, { deep: true });\n tryOnMounted(() => {\n nextTick(() => update(true));\n });\n tryOnScopeDispose(cancel);\n function update(init) {\n const el = unrefElement(target);\n if (!isSupported.value || !el)\n return;\n if (!animate.value)\n animate.value = el.animate(toValue(keyframes), animateOptions);\n if (commitStyles)\n animate.value.commitStyles();\n if (persist)\n animate.value.persist();\n if (_playbackRate !== 1)\n animate.value.playbackRate = _playbackRate;\n if (init && !immediate)\n animate.value.pause();\n else\n syncResume();\n onReady == null ? void 0 : onReady(animate.value);\n }\n useEventListener(animate, [\"cancel\", \"finish\", \"remove\"], syncPause);\n const { resume: resumeRef, pause: pauseRef } = useRafFn(() => {\n if (!animate.value)\n return;\n store.pending = animate.value.pending;\n store.playState = animate.value.playState;\n store.replaceState = animate.value.replaceState;\n store.startTime = animate.value.startTime;\n store.currentTime = animate.value.currentTime;\n store.timeline = animate.value.timeline;\n store.playbackRate = animate.value.playbackRate;\n }, { immediate: false });\n function syncResume() {\n if (isSupported.value)\n resumeRef();\n }\n function syncPause() {\n if (isSupported.value && window)\n window.requestAnimationFrame(pauseRef);\n }\n return {\n isSupported,\n animate,\n // actions\n play,\n pause,\n reverse,\n finish,\n cancel,\n // state\n pending,\n playState,\n replaceState,\n startTime,\n currentTime,\n timeline,\n playbackRate\n };\n}\n\nfunction useAsyncQueue(tasks, options) {\n const {\n interrupt = true,\n onError = noop,\n onFinished = noop,\n signal\n } = options || {};\n const promiseState = {\n aborted: \"aborted\",\n fulfilled: \"fulfilled\",\n pending: \"pending\",\n rejected: \"rejected\"\n };\n const initialResult = Array.from(Array.from({ length: tasks.length }), () => ({ state: promiseState.pending, data: null }));\n const result = reactive(initialResult);\n const activeIndex = ref(-1);\n if (!tasks || tasks.length === 0) {\n onFinished();\n return {\n activeIndex,\n result\n };\n }\n function updateResult(state, res) {\n activeIndex.value++;\n result[activeIndex.value].data = res;\n result[activeIndex.value].state = state;\n }\n tasks.reduce((prev, curr) => {\n return prev.then((prevRes) => {\n var _a;\n if (signal == null ? void 0 : signal.aborted) {\n updateResult(promiseState.aborted, new Error(\"aborted\"));\n return;\n }\n if (((_a = result[activeIndex.value]) == null ? void 0 : _a.state) === promiseState.rejected && interrupt) {\n onFinished();\n return;\n }\n const done = curr(prevRes).then((currentRes) => {\n updateResult(promiseState.fulfilled, currentRes);\n activeIndex.value === tasks.length - 1 && onFinished();\n return currentRes;\n });\n if (!signal)\n return done;\n return Promise.race([done, whenAborted(signal)]);\n }).catch((e) => {\n if (signal == null ? void 0 : signal.aborted) {\n updateResult(promiseState.aborted, e);\n return e;\n }\n updateResult(promiseState.rejected, e);\n onError();\n return e;\n });\n }, Promise.resolve());\n return {\n activeIndex,\n result\n };\n}\nfunction whenAborted(signal) {\n return new Promise((resolve, reject) => {\n const error = new Error(\"aborted\");\n if (signal.aborted)\n reject(error);\n else\n signal.addEventListener(\"abort\", () => reject(error), { once: true });\n });\n}\n\nfunction useAsyncState(promise, initialState, options) {\n const {\n immediate = true,\n delay = 0,\n onError = noop,\n onSuccess = noop,\n resetOnExecute = true,\n shallow = true,\n throwError\n } = options != null ? options : {};\n const state = shallow ? shallowRef(initialState) : ref(initialState);\n const isReady = ref(false);\n const isLoading = ref(false);\n const error = shallowRef(void 0);\n async function execute(delay2 = 0, ...args) {\n if (resetOnExecute)\n state.value = initialState;\n error.value = void 0;\n isReady.value = false;\n isLoading.value = true;\n if (delay2 > 0)\n await promiseTimeout(delay2);\n const _promise = typeof promise === \"function\" ? promise(...args) : promise;\n try {\n const data = await _promise;\n state.value = data;\n isReady.value = true;\n onSuccess(data);\n } catch (e) {\n error.value = e;\n onError(e);\n if (throwError)\n throw e;\n } finally {\n isLoading.value = false;\n }\n return state.value;\n }\n if (immediate)\n execute(delay);\n const shell = {\n state,\n isReady,\n isLoading,\n error,\n execute\n };\n function waitUntilIsLoaded() {\n return new Promise((resolve, reject) => {\n until(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);\n });\n }\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilIsLoaded().then(onFulfilled, onRejected);\n }\n };\n}\n\nconst defaults = {\n array: (v) => JSON.stringify(v),\n object: (v) => JSON.stringify(v),\n set: (v) => JSON.stringify(Array.from(v)),\n map: (v) => JSON.stringify(Object.fromEntries(v)),\n null: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n if (!target)\n return defaults.null;\n if (target instanceof Map)\n return defaults.map;\n else if (target instanceof Set)\n return defaults.set;\n else if (Array.isArray(target))\n return defaults.array;\n else\n return defaults.object;\n}\n\nfunction useBase64(target, options) {\n const base64 = ref(\"\");\n const promise = ref();\n function execute() {\n if (!isClient)\n return;\n promise.value = new Promise((resolve, reject) => {\n try {\n const _target = toValue(target);\n if (_target == null) {\n resolve(\"\");\n } else if (typeof _target === \"string\") {\n resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n } else if (_target instanceof Blob) {\n resolve(blobToBase64(_target));\n } else if (_target instanceof ArrayBuffer) {\n resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n } else if (_target instanceof HTMLCanvasElement) {\n resolve(_target.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n } else if (_target instanceof HTMLImageElement) {\n const img = _target.cloneNode(false);\n img.crossOrigin = \"Anonymous\";\n imgLoaded(img).then(() => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n resolve(canvas.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n }).catch(reject);\n } else if (typeof _target === \"object\") {\n const _serializeFn = (options == null ? void 0 : options.serializer) || getDefaultSerialization(_target);\n const serialized = _serializeFn(_target);\n return resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n } else {\n reject(new Error(\"target is unsupported types\"));\n }\n } catch (error) {\n reject(error);\n }\n });\n promise.value.then((res) => base64.value = res);\n return promise.value;\n }\n if (isRef(target) || typeof target === \"function\")\n watch(target, execute, { immediate: true });\n else\n execute();\n return {\n base64,\n promise,\n execute\n };\n}\nfunction imgLoaded(img) {\n return new Promise((resolve, reject) => {\n if (!img.complete) {\n img.onload = () => {\n resolve();\n };\n img.onerror = reject;\n } else {\n resolve();\n }\n });\n}\nfunction blobToBase64(blob) {\n return new Promise((resolve, reject) => {\n const fr = new FileReader();\n fr.onload = (e) => {\n resolve(e.target.result);\n };\n fr.onerror = reject;\n fr.readAsDataURL(blob);\n });\n}\n\nfunction useBattery(options = {}) {\n const { navigator = defaultNavigator } = options;\n const events = [\"chargingchange\", \"chargingtimechange\", \"dischargingtimechange\", \"levelchange\"];\n const isSupported = useSupported(() => navigator && \"getBattery\" in navigator && typeof navigator.getBattery === \"function\");\n const charging = ref(false);\n const chargingTime = ref(0);\n const dischargingTime = ref(0);\n const level = ref(1);\n let battery;\n function updateBatteryInfo() {\n charging.value = this.charging;\n chargingTime.value = this.chargingTime || 0;\n dischargingTime.value = this.dischargingTime || 0;\n level.value = this.level;\n }\n if (isSupported.value) {\n navigator.getBattery().then((_battery) => {\n battery = _battery;\n updateBatteryInfo.call(battery);\n useEventListener(battery, events, updateBatteryInfo, { passive: true });\n });\n }\n return {\n isSupported,\n charging,\n chargingTime,\n dischargingTime,\n level\n };\n}\n\nfunction useBluetooth(options) {\n let {\n acceptAllDevices = false\n } = options || {};\n const {\n filters = void 0,\n optionalServices = void 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => navigator && \"bluetooth\" in navigator);\n const device = shallowRef(void 0);\n const error = shallowRef(null);\n watch(device, () => {\n connectToBluetoothGATTServer();\n });\n async function requestDevice() {\n if (!isSupported.value)\n return;\n error.value = null;\n if (filters && filters.length > 0)\n acceptAllDevices = false;\n try {\n device.value = await (navigator == null ? void 0 : navigator.bluetooth.requestDevice({\n acceptAllDevices,\n filters,\n optionalServices\n }));\n } catch (err) {\n error.value = err;\n }\n }\n const server = ref();\n const isConnected = computed(() => {\n var _a;\n return ((_a = server.value) == null ? void 0 : _a.connected) || false;\n });\n async function connectToBluetoothGATTServer() {\n error.value = null;\n if (device.value && device.value.gatt) {\n device.value.addEventListener(\"gattserverdisconnected\", () => {\n });\n try {\n server.value = await device.value.gatt.connect();\n } catch (err) {\n error.value = err;\n }\n }\n }\n tryOnMounted(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.connect();\n });\n tryOnScopeDispose(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.disconnect();\n });\n return {\n isSupported,\n isConnected,\n // Device:\n device,\n requestDevice,\n // Server:\n server,\n // Errors:\n error\n };\n}\n\nfunction useMediaQuery(query, options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n let mediaQuery;\n const matches = ref(false);\n const handler = (event) => {\n matches.value = event.matches;\n };\n const cleanup = () => {\n if (!mediaQuery)\n return;\n if (\"removeEventListener\" in mediaQuery)\n mediaQuery.removeEventListener(\"change\", handler);\n else\n mediaQuery.removeListener(handler);\n };\n const stopWatch = watchEffect(() => {\n if (!isSupported.value)\n return;\n cleanup();\n mediaQuery = window.matchMedia(toValue(query));\n if (\"addEventListener\" in mediaQuery)\n mediaQuery.addEventListener(\"change\", handler);\n else\n mediaQuery.addListener(handler);\n matches.value = mediaQuery.matches;\n });\n tryOnScopeDispose(() => {\n stopWatch();\n cleanup();\n mediaQuery = void 0;\n });\n return matches;\n}\n\nconst breakpointsTailwind = {\n \"sm\": 640,\n \"md\": 768,\n \"lg\": 1024,\n \"xl\": 1280,\n \"2xl\": 1536\n};\nconst breakpointsBootstrapV5 = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400\n};\nconst breakpointsVuetifyV2 = {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1264,\n xl: 1904\n};\nconst breakpointsVuetifyV3 = {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560\n};\nconst breakpointsVuetify = breakpointsVuetifyV2;\nconst breakpointsAntDesign = {\n xs: 480,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1600\n};\nconst breakpointsQuasar = {\n xs: 0,\n sm: 600,\n md: 1024,\n lg: 1440,\n xl: 1920\n};\nconst breakpointsSematic = {\n mobileS: 320,\n mobileM: 375,\n mobileL: 425,\n tablet: 768,\n laptop: 1024,\n laptopL: 1440,\n desktop4K: 2560\n};\nconst breakpointsMasterCss = {\n \"3xs\": 360,\n \"2xs\": 480,\n \"xs\": 600,\n \"sm\": 768,\n \"md\": 1024,\n \"lg\": 1280,\n \"xl\": 1440,\n \"2xl\": 1600,\n \"3xl\": 1920,\n \"4xl\": 2560\n};\nconst breakpointsPrimeFlex = {\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200\n};\n\nfunction useBreakpoints(breakpoints, options = {}) {\n function getValue(k, delta) {\n let v = toValue(breakpoints[toValue(k)]);\n if (delta != null)\n v = increaseWithUnit(v, delta);\n if (typeof v === \"number\")\n v = `${v}px`;\n return v;\n }\n const { window = defaultWindow, strategy = \"min-width\" } = options;\n function match(query) {\n if (!window)\n return false;\n return window.matchMedia(query).matches;\n }\n const greaterOrEqual = (k) => {\n return useMediaQuery(() => `(min-width: ${getValue(k)})`, options);\n };\n const smallerOrEqual = (k) => {\n return useMediaQuery(() => `(max-width: ${getValue(k)})`, options);\n };\n const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n Object.defineProperty(shortcuts, k, {\n get: () => strategy === \"min-width\" ? greaterOrEqual(k) : smallerOrEqual(k),\n enumerable: true,\n configurable: true\n });\n return shortcuts;\n }, {});\n function current() {\n const points = Object.keys(breakpoints).map((i) => [i, greaterOrEqual(i)]);\n return computed(() => points.filter(([, v]) => v.value).map(([k]) => k));\n }\n return Object.assign(shortcutMethods, {\n greaterOrEqual,\n smallerOrEqual,\n greater(k) {\n return useMediaQuery(() => `(min-width: ${getValue(k, 0.1)})`, options);\n },\n smaller(k) {\n return useMediaQuery(() => `(max-width: ${getValue(k, -0.1)})`, options);\n },\n between(a, b) {\n return useMediaQuery(() => `(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`, options);\n },\n isGreater(k) {\n return match(`(min-width: ${getValue(k, 0.1)})`);\n },\n isGreaterOrEqual(k) {\n return match(`(min-width: ${getValue(k)})`);\n },\n isSmaller(k) {\n return match(`(max-width: ${getValue(k, -0.1)})`);\n },\n isSmallerOrEqual(k) {\n return match(`(max-width: ${getValue(k)})`);\n },\n isInBetween(a, b) {\n return match(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`);\n },\n current,\n active() {\n const bps = current();\n return computed(() => bps.value.length === 0 ? \"\" : bps.value.at(-1));\n }\n });\n}\n\nfunction useBroadcastChannel(options) {\n const {\n name,\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"BroadcastChannel\" in window);\n const isClosed = ref(false);\n const channel = ref();\n const data = ref();\n const error = shallowRef(null);\n const post = (data2) => {\n if (channel.value)\n channel.value.postMessage(data2);\n };\n const close = () => {\n if (channel.value)\n channel.value.close();\n isClosed.value = true;\n };\n if (isSupported.value) {\n tryOnMounted(() => {\n error.value = null;\n channel.value = new BroadcastChannel(name);\n channel.value.addEventListener(\"message\", (e) => {\n data.value = e.data;\n }, { passive: true });\n channel.value.addEventListener(\"messageerror\", (e) => {\n error.value = e;\n }, { passive: true });\n channel.value.addEventListener(\"close\", () => {\n isClosed.value = true;\n });\n });\n }\n tryOnScopeDispose(() => {\n close();\n });\n return {\n isSupported,\n channel,\n data,\n post,\n close,\n error,\n isClosed\n };\n}\n\nconst WRITABLE_PROPERTIES = [\n \"hash\",\n \"host\",\n \"hostname\",\n \"href\",\n \"pathname\",\n \"port\",\n \"protocol\",\n \"search\"\n];\nfunction useBrowserLocation(options = {}) {\n const { window = defaultWindow } = options;\n const refs = Object.fromEntries(\n WRITABLE_PROPERTIES.map((key) => [key, ref()])\n );\n for (const [key, ref2] of objectEntries(refs)) {\n watch(ref2, (value) => {\n if (!(window == null ? void 0 : window.location) || window.location[key] === value)\n return;\n window.location[key] = value;\n });\n }\n const buildState = (trigger) => {\n var _a;\n const { state: state2, length } = (window == null ? void 0 : window.history) || {};\n const { origin } = (window == null ? void 0 : window.location) || {};\n for (const key of WRITABLE_PROPERTIES)\n refs[key].value = (_a = window == null ? void 0 : window.location) == null ? void 0 : _a[key];\n return reactive({\n trigger,\n state: state2,\n length,\n origin,\n ...refs\n });\n };\n const state = ref(buildState(\"load\"));\n if (window) {\n useEventListener(window, \"popstate\", () => state.value = buildState(\"popstate\"), { passive: true });\n useEventListener(window, \"hashchange\", () => state.value = buildState(\"hashchange\"), { passive: true });\n }\n return state;\n}\n\nfunction useCached(refValue, comparator = (a, b) => a === b, watchOptions) {\n const cachedValue = ref(refValue.value);\n watch(() => refValue.value, (value) => {\n if (!comparator(value, cachedValue.value))\n cachedValue.value = value;\n }, watchOptions);\n return cachedValue;\n}\n\nfunction usePermission(permissionDesc, options = {}) {\n const {\n controls = false,\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"permissions\" in navigator);\n let permissionStatus;\n const desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n const state = ref();\n const onChange = () => {\n if (permissionStatus)\n state.value = permissionStatus.state;\n };\n const query = createSingletonPromise(async () => {\n if (!isSupported.value)\n return;\n if (!permissionStatus) {\n try {\n permissionStatus = await navigator.permissions.query(desc);\n useEventListener(permissionStatus, \"change\", onChange);\n onChange();\n } catch (e) {\n state.value = \"prompt\";\n }\n }\n return permissionStatus;\n });\n query();\n if (controls) {\n return {\n state,\n isSupported,\n query\n };\n } else {\n return state;\n }\n}\n\nfunction useClipboard(options = {}) {\n const {\n navigator = defaultNavigator,\n read = false,\n source,\n copiedDuring = 1500,\n legacy = false\n } = options;\n const isClipboardApiSupported = useSupported(() => navigator && \"clipboard\" in navigator);\n const permissionRead = usePermission(\"clipboard-read\");\n const permissionWrite = usePermission(\"clipboard-write\");\n const isSupported = computed(() => isClipboardApiSupported.value || legacy);\n const text = ref(\"\");\n const copied = ref(false);\n const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);\n function updateText() {\n if (isClipboardApiSupported.value && isAllowed(permissionRead.value)) {\n navigator.clipboard.readText().then((value) => {\n text.value = value;\n });\n } else {\n text.value = legacyRead();\n }\n }\n if (isSupported.value && read)\n useEventListener([\"copy\", \"cut\"], updateText);\n async function copy(value = toValue(source)) {\n if (isSupported.value && value != null) {\n if (isClipboardApiSupported.value && isAllowed(permissionWrite.value))\n await navigator.clipboard.writeText(value);\n else\n legacyCopy(value);\n text.value = value;\n copied.value = true;\n timeout.start();\n }\n }\n function legacyCopy(value) {\n const ta = document.createElement(\"textarea\");\n ta.value = value != null ? value : \"\";\n ta.style.position = \"absolute\";\n ta.style.opacity = \"0\";\n document.body.appendChild(ta);\n ta.select();\n document.execCommand(\"copy\");\n ta.remove();\n }\n function legacyRead() {\n var _a, _b, _c;\n return (_c = (_b = (_a = document == null ? void 0 : document.getSelection) == null ? void 0 : _a.call(document)) == null ? void 0 : _b.toString()) != null ? _c : \"\";\n }\n function isAllowed(status) {\n return status === \"granted\" || status === \"prompt\";\n }\n return {\n isSupported,\n text,\n copied,\n copy\n };\n}\n\nfunction useClipboardItems(options = {}) {\n const {\n navigator = defaultNavigator,\n read = false,\n source,\n copiedDuring = 1500\n } = options;\n const isSupported = useSupported(() => navigator && \"clipboard\" in navigator);\n const content = ref([]);\n const copied = ref(false);\n const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);\n function updateContent() {\n if (isSupported.value) {\n navigator.clipboard.read().then((items) => {\n content.value = items;\n });\n }\n }\n if (isSupported.value && read)\n useEventListener([\"copy\", \"cut\"], updateContent);\n async function copy(value = toValue(source)) {\n if (isSupported.value && value != null) {\n await navigator.clipboard.write(value);\n content.value = value;\n copied.value = true;\n timeout.start();\n }\n }\n return {\n isSupported,\n content,\n copied,\n copy\n };\n}\n\nfunction cloneFnJSON(source) {\n return JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n const cloned = ref({});\n const {\n manual,\n clone = cloneFnJSON,\n // watch options\n deep = true,\n immediate = true\n } = options;\n function sync() {\n cloned.value = clone(toValue(source));\n }\n if (!manual && (isRef(source) || typeof source === \"function\")) {\n watch(source, sync, {\n ...options,\n deep,\n immediate\n });\n } else {\n sync();\n }\n return { cloned, sync };\n}\n\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\nconst handlers = /* @__PURE__ */ getHandlers();\nfunction getHandlers() {\n if (!(globalKey in _global))\n _global[globalKey] = _global[globalKey] || {};\n return _global[globalKey];\n}\nfunction getSSRHandler(key, fallback) {\n return handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n handlers[key] = fn;\n}\n\nfunction guessSerializerType(rawInit) {\n return rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n\nconst StorageSerializers = {\n boolean: {\n read: (v) => v === \"true\",\n write: (v) => String(v)\n },\n object: {\n read: (v) => JSON.parse(v),\n write: (v) => JSON.stringify(v)\n },\n number: {\n read: (v) => Number.parseFloat(v),\n write: (v) => String(v)\n },\n any: {\n read: (v) => v,\n write: (v) => String(v)\n },\n string: {\n read: (v) => v,\n write: (v) => String(v)\n },\n map: {\n read: (v) => new Map(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v.entries()))\n },\n set: {\n read: (v) => new Set(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v))\n },\n date: {\n read: (v) => new Date(v),\n write: (v) => v.toISOString()\n }\n};\nconst customStorageEventName = \"vueuse-storage\";\nfunction useStorage(key, defaults, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n },\n initOnMounted\n } = options;\n const data = (shallow ? shallowRef : ref)(typeof defaults === \"function\" ? defaults() : defaults);\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorage\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n if (!storage)\n return data;\n const rawInit = toValue(defaults);\n const type = guessSerializerType(rawInit);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n const { pause: pauseWatch, resume: resumeWatch } = pausableWatch(\n data,\n () => write(data.value),\n { flush, deep, eventFilter }\n );\n if (window && listenToStorageChanges) {\n tryOnMounted(() => {\n useEventListener(window, \"storage\", update);\n useEventListener(window, customStorageEventName, updateFromCustomEvent);\n if (initOnMounted)\n update();\n });\n }\n if (!initOnMounted)\n update();\n function dispatchWriteEvent(oldValue, newValue) {\n if (window) {\n window.dispatchEvent(new CustomEvent(customStorageEventName, {\n detail: {\n key,\n oldValue,\n newValue,\n storageArea: storage\n }\n }));\n }\n }\n function write(v) {\n try {\n const oldValue = storage.getItem(key);\n if (v == null) {\n dispatchWriteEvent(oldValue, null);\n storage.removeItem(key);\n } else {\n const serialized = serializer.write(v);\n if (oldValue !== serialized) {\n storage.setItem(key, serialized);\n dispatchWriteEvent(oldValue, serialized);\n }\n }\n } catch (e) {\n onError(e);\n }\n }\n function read(event) {\n const rawValue = event ? event.newValue : storage.getItem(key);\n if (rawValue == null) {\n if (writeDefaults && rawInit != null)\n storage.setItem(key, serializer.write(rawInit));\n return rawInit;\n } else if (!event && mergeDefaults) {\n const value = serializer.read(rawValue);\n if (typeof mergeDefaults === \"function\")\n return mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n return { ...rawInit, ...value };\n return value;\n } else if (typeof rawValue !== \"string\") {\n return rawValue;\n } else {\n return serializer.read(rawValue);\n }\n }\n function update(event) {\n if (event && event.storageArea !== storage)\n return;\n if (event && event.key == null) {\n data.value = rawInit;\n return;\n }\n if (event && event.key !== key)\n return;\n pauseWatch();\n try {\n if ((event == null ? void 0 : event.newValue) !== serializer.write(data.value))\n data.value = read(event);\n } catch (e) {\n onError(e);\n } finally {\n if (event)\n nextTick(resumeWatch);\n else\n resumeWatch();\n }\n }\n function updateFromCustomEvent(event) {\n update(event.detail);\n }\n return data;\n}\n\nfunction usePreferredDark(options) {\n return useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n\nfunction useColorMode(options = {}) {\n const {\n selector = \"html\",\n attribute = \"class\",\n initialValue = \"auto\",\n window = defaultWindow,\n storage,\n storageKey = \"vueuse-color-scheme\",\n listenToStorageChanges = true,\n storageRef,\n emitAuto,\n disableTransition = true\n } = options;\n const modes = {\n auto: \"\",\n light: \"light\",\n dark: \"dark\",\n ...options.modes || {}\n };\n const preferredDark = usePreferredDark({ window });\n const system = computed(() => preferredDark.value ? \"dark\" : \"light\");\n const store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, { window, listenToStorageChanges }));\n const state = computed(() => store.value === \"auto\" ? system.value : store.value);\n const updateHTMLAttrs = getSSRHandler(\n \"updateHTMLAttrs\",\n (selector2, attribute2, value) => {\n const el = typeof selector2 === \"string\" ? window == null ? void 0 : window.document.querySelector(selector2) : unrefElement(selector2);\n if (!el)\n return;\n let style;\n if (disableTransition) {\n style = window.document.createElement(\"style\");\n const styleString = \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\";\n style.appendChild(document.createTextNode(styleString));\n window.document.head.appendChild(style);\n }\n if (attribute2 === \"class\") {\n const current = value.split(/\\s/g);\n Object.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n if (current.includes(v))\n el.classList.add(v);\n else\n el.classList.remove(v);\n });\n } else {\n el.setAttribute(attribute2, value);\n }\n if (disableTransition) {\n window.getComputedStyle(style).opacity;\n document.head.removeChild(style);\n }\n }\n );\n function defaultOnChanged(mode) {\n var _a;\n updateHTMLAttrs(selector, attribute, (_a = modes[mode]) != null ? _a : mode);\n }\n function onChanged(mode) {\n if (options.onChanged)\n options.onChanged(mode, defaultOnChanged);\n else\n defaultOnChanged(mode);\n }\n watch(state, onChanged, { flush: \"post\", immediate: true });\n tryOnMounted(() => onChanged(state.value));\n const auto = computed({\n get() {\n return emitAuto ? store.value : state.value;\n },\n set(v) {\n store.value = v;\n }\n });\n try {\n return Object.assign(auto, { store, system, state });\n } catch (e) {\n return auto;\n }\n}\n\nfunction useConfirmDialog(revealed = ref(false)) {\n const confirmHook = createEventHook();\n const cancelHook = createEventHook();\n const revealHook = createEventHook();\n let _resolve = noop;\n const reveal = (data) => {\n revealHook.trigger(data);\n revealed.value = true;\n return new Promise((resolve) => {\n _resolve = resolve;\n });\n };\n const confirm = (data) => {\n revealed.value = false;\n confirmHook.trigger(data);\n _resolve({ data, isCanceled: false });\n };\n const cancel = (data) => {\n revealed.value = false;\n cancelHook.trigger(data);\n _resolve({ data, isCanceled: true });\n };\n return {\n isRevealed: computed(() => revealed.value),\n reveal,\n confirm,\n cancel,\n onReveal: revealHook.on,\n onConfirm: confirmHook.on,\n onCancel: cancelHook.on\n };\n}\n\nfunction useMutationObserver(target, callback, options = {}) {\n const { window = defaultWindow, ...mutationOptions } = options;\n let observer;\n const isSupported = useSupported(() => window && \"MutationObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const targets = computed(() => {\n const value = toValue(target);\n const items = (Array.isArray(value) ? value : [value]).map(unrefElement).filter(notNullish);\n return new Set(items);\n });\n const stopWatch = watch(\n () => targets.value,\n (targets2) => {\n cleanup();\n if (isSupported.value && window && targets2.size) {\n observer = new MutationObserver(callback);\n targets2.forEach((el) => observer.observe(el, mutationOptions));\n }\n },\n { immediate: true, flush: \"post\" }\n );\n const takeRecords = () => {\n return observer == null ? void 0 : observer.takeRecords();\n };\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop,\n takeRecords\n };\n}\n\nfunction useCssVar(prop, target, options = {}) {\n const { window = defaultWindow, initialValue = \"\", observe = false } = options;\n const variable = ref(initialValue);\n const elRef = computed(() => {\n var _a;\n return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);\n });\n function updateCssVar() {\n var _a;\n const key = toValue(prop);\n const el = toValue(elRef);\n if (el && window) {\n const value = (_a = window.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim();\n variable.value = value || initialValue;\n }\n }\n if (observe) {\n useMutationObserver(elRef, updateCssVar, {\n attributeFilter: [\"style\", \"class\"],\n window\n });\n }\n watch(\n [elRef, () => toValue(prop)],\n updateCssVar,\n { immediate: true }\n );\n watch(\n variable,\n (val) => {\n var _a;\n if ((_a = elRef.value) == null ? void 0 : _a.style)\n elRef.value.style.setProperty(toValue(prop), val);\n }\n );\n return variable;\n}\n\nfunction useCurrentElement(rootComponent) {\n const vm = getCurrentInstance();\n const currentElement = computedWithControl(\n () => null,\n () => rootComponent ? unrefElement(rootComponent) : vm.proxy.$el\n );\n onUpdated(currentElement.trigger);\n onMounted(currentElement.trigger);\n return currentElement;\n}\n\nfunction useCycleList(list, options) {\n const state = shallowRef(getInitialValue());\n const listRef = toRef(list);\n const index = computed({\n get() {\n var _a;\n const targetList = listRef.value;\n let index2 = (options == null ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, targetList) : targetList.indexOf(state.value);\n if (index2 < 0)\n index2 = (_a = options == null ? void 0 : options.fallbackIndex) != null ? _a : 0;\n return index2;\n },\n set(v) {\n set(v);\n }\n });\n function set(i) {\n const targetList = listRef.value;\n const length = targetList.length;\n const index2 = (i % length + length) % length;\n const value = targetList[index2];\n state.value = value;\n return value;\n }\n function shift(delta = 1) {\n return set(index.value + delta);\n }\n function next(n = 1) {\n return shift(n);\n }\n function prev(n = 1) {\n return shift(-n);\n }\n function getInitialValue() {\n var _a, _b;\n return (_b = toValue((_a = options == null ? void 0 : options.initialValue) != null ? _a : toValue(list)[0])) != null ? _b : void 0;\n }\n watch(listRef, () => set(index.value));\n return {\n state,\n index,\n next,\n prev,\n go: set\n };\n}\n\nfunction useDark(options = {}) {\n const {\n valueDark = \"dark\",\n valueLight = \"\",\n window = defaultWindow\n } = options;\n const mode = useColorMode({\n ...options,\n onChanged: (mode2, defaultHandler) => {\n var _a;\n if (options.onChanged)\n (_a = options.onChanged) == null ? void 0 : _a.call(options, mode2 === \"dark\", defaultHandler, mode2);\n else\n defaultHandler(mode2);\n },\n modes: {\n dark: valueDark,\n light: valueLight\n }\n });\n const system = computed(() => {\n if (mode.system) {\n return mode.system.value;\n } else {\n const preferredDark = usePreferredDark({ window });\n return preferredDark.value ? \"dark\" : \"light\";\n }\n });\n const isDark = computed({\n get() {\n return mode.value === \"dark\";\n },\n set(v) {\n const modeVal = v ? \"dark\" : \"light\";\n if (system.value === modeVal)\n mode.value = \"auto\";\n else\n mode.value = modeVal;\n }\n });\n return isDark;\n}\n\nfunction fnBypass(v) {\n return v;\n}\nfunction fnSetSource(source, value) {\n return source.value = value;\n}\nfunction defaultDump(clone) {\n return clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n return clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction useManualRefHistory(source, options = {}) {\n const {\n clone = false,\n dump = defaultDump(clone),\n parse = defaultParse(clone),\n setSource = fnSetSource\n } = options;\n function _createHistoryRecord() {\n return markRaw({\n snapshot: dump(source.value),\n timestamp: timestamp()\n });\n }\n const last = ref(_createHistoryRecord());\n const undoStack = ref([]);\n const redoStack = ref([]);\n const _setSource = (record) => {\n setSource(source, parse(record.snapshot));\n last.value = record;\n };\n const commit = () => {\n undoStack.value.unshift(last.value);\n last.value = _createHistoryRecord();\n if (options.capacity && undoStack.value.length > options.capacity)\n undoStack.value.splice(options.capacity, Number.POSITIVE_INFINITY);\n if (redoStack.value.length)\n redoStack.value.splice(0, redoStack.value.length);\n };\n const clear = () => {\n undoStack.value.splice(0, undoStack.value.length);\n redoStack.value.splice(0, redoStack.value.length);\n };\n const undo = () => {\n const state = undoStack.value.shift();\n if (state) {\n redoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const redo = () => {\n const state = redoStack.value.shift();\n if (state) {\n undoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const reset = () => {\n _setSource(last.value);\n };\n const history = computed(() => [last.value, ...undoStack.value]);\n const canUndo = computed(() => undoStack.value.length > 0);\n const canRedo = computed(() => redoStack.value.length > 0);\n return {\n source,\n undoStack,\n redoStack,\n last,\n history,\n canUndo,\n canRedo,\n clear,\n commit,\n reset,\n undo,\n redo\n };\n}\n\nfunction useRefHistory(source, options = {}) {\n const {\n deep = false,\n flush = \"pre\",\n eventFilter\n } = options;\n const {\n eventFilter: composedFilter,\n pause,\n resume: resumeTracking,\n isActive: isTracking\n } = pausableFilter(eventFilter);\n const {\n ignoreUpdates,\n ignorePrevAsyncUpdates,\n stop\n } = watchIgnorable(\n source,\n commit,\n { deep, flush, eventFilter: composedFilter }\n );\n function setSource(source2, value) {\n ignorePrevAsyncUpdates();\n ignoreUpdates(() => {\n source2.value = value;\n });\n }\n const manualHistory = useManualRefHistory(source, { ...options, clone: options.clone || deep, setSource });\n const { clear, commit: manualCommit } = manualHistory;\n function commit() {\n ignorePrevAsyncUpdates();\n manualCommit();\n }\n function resume(commitNow) {\n resumeTracking();\n if (commitNow)\n commit();\n }\n function batch(fn) {\n let canceled = false;\n const cancel = () => canceled = true;\n ignoreUpdates(() => {\n fn(cancel);\n });\n if (!canceled)\n commit();\n }\n function dispose() {\n stop();\n clear();\n }\n return {\n ...manualHistory,\n isTracking,\n pause,\n resume,\n commit,\n batch,\n dispose\n };\n}\n\nfunction useDebouncedRefHistory(source, options = {}) {\n const filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n const history = useRefHistory(source, { ...options, eventFilter: filter });\n return {\n ...history\n };\n}\n\nfunction useDeviceMotion(options = {}) {\n const {\n window = defaultWindow,\n eventFilter = bypassFilter\n } = options;\n const acceleration = ref({ x: null, y: null, z: null });\n const rotationRate = ref({ alpha: null, beta: null, gamma: null });\n const interval = ref(0);\n const accelerationIncludingGravity = ref({\n x: null,\n y: null,\n z: null\n });\n if (window) {\n const onDeviceMotion = createFilterWrapper(\n eventFilter,\n (event) => {\n acceleration.value = event.acceleration;\n accelerationIncludingGravity.value = event.accelerationIncludingGravity;\n rotationRate.value = event.rotationRate;\n interval.value = event.interval;\n }\n );\n useEventListener(window, \"devicemotion\", onDeviceMotion);\n }\n return {\n acceleration,\n accelerationIncludingGravity,\n rotationRate,\n interval\n };\n}\n\nfunction useDeviceOrientation(options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"DeviceOrientationEvent\" in window);\n const isAbsolute = ref(false);\n const alpha = ref(null);\n const beta = ref(null);\n const gamma = ref(null);\n if (window && isSupported.value) {\n useEventListener(window, \"deviceorientation\", (event) => {\n isAbsolute.value = event.absolute;\n alpha.value = event.alpha;\n beta.value = event.beta;\n gamma.value = event.gamma;\n });\n }\n return {\n isSupported,\n isAbsolute,\n alpha,\n beta,\n gamma\n };\n}\n\nfunction useDevicePixelRatio(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const pixelRatio = ref(1);\n if (window) {\n let observe2 = function() {\n pixelRatio.value = window.devicePixelRatio;\n cleanup2();\n media = window.matchMedia(`(resolution: ${pixelRatio.value}dppx)`);\n media.addEventListener(\"change\", observe2, { once: true });\n }, cleanup2 = function() {\n media == null ? void 0 : media.removeEventListener(\"change\", observe2);\n };\n let media;\n observe2();\n tryOnScopeDispose(cleanup2);\n }\n return { pixelRatio };\n}\n\nfunction useDevicesList(options = {}) {\n const {\n navigator = defaultNavigator,\n requestPermissions = false,\n constraints = { audio: true, video: true },\n onUpdated\n } = options;\n const devices = ref([]);\n const videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n const audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n const audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n const isSupported = useSupported(() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);\n const permissionGranted = ref(false);\n let stream;\n async function update() {\n if (!isSupported.value)\n return;\n devices.value = await navigator.mediaDevices.enumerateDevices();\n onUpdated == null ? void 0 : onUpdated(devices.value);\n if (stream) {\n stream.getTracks().forEach((t) => t.stop());\n stream = null;\n }\n }\n async function ensurePermissions() {\n if (!isSupported.value)\n return false;\n if (permissionGranted.value)\n return true;\n const { state, query } = usePermission(\"camera\", { controls: true });\n await query();\n if (state.value !== \"granted\") {\n stream = await navigator.mediaDevices.getUserMedia(constraints);\n update();\n permissionGranted.value = true;\n } else {\n permissionGranted.value = true;\n }\n return permissionGranted.value;\n }\n if (isSupported.value) {\n if (requestPermissions)\n ensurePermissions();\n useEventListener(navigator.mediaDevices, \"devicechange\", update);\n update();\n }\n return {\n devices,\n ensurePermissions,\n permissionGranted,\n videoInputs,\n audioInputs,\n audioOutputs,\n isSupported\n };\n}\n\nfunction useDisplayMedia(options = {}) {\n var _a;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const video = options.video;\n const audio = options.audio;\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getDisplayMedia;\n });\n const constraint = { audio, video };\n const stream = shallowRef();\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getDisplayMedia(constraint);\n return stream.value;\n }\n async function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n watch(\n enabled,\n (v) => {\n if (v)\n _start();\n else\n _stop();\n },\n { immediate: true }\n );\n return {\n isSupported,\n stream,\n start,\n stop,\n enabled\n };\n}\n\nfunction useDocumentVisibility(options = {}) {\n const { document = defaultDocument } = options;\n if (!document)\n return ref(\"visible\");\n const visibility = ref(document.visibilityState);\n useEventListener(document, \"visibilitychange\", () => {\n visibility.value = document.visibilityState;\n });\n return visibility;\n}\n\nfunction useDraggable(target, options = {}) {\n var _a, _b;\n const {\n pointerTypes,\n preventDefault,\n stopPropagation,\n exact,\n onMove,\n onEnd,\n onStart,\n initialValue,\n axis = \"both\",\n draggingElement = defaultWindow,\n containerElement,\n handle: draggingHandle = target\n } = options;\n const position = ref(\n (_a = toValue(initialValue)) != null ? _a : { x: 0, y: 0 }\n );\n const pressedDelta = ref();\n const filterEvent = (e) => {\n if (pointerTypes)\n return pointerTypes.includes(e.pointerType);\n return true;\n };\n const handleEvent = (e) => {\n if (toValue(preventDefault))\n e.preventDefault();\n if (toValue(stopPropagation))\n e.stopPropagation();\n };\n const start = (e) => {\n var _a2;\n if (toValue(options.disabled) || !filterEvent(e))\n return;\n if (toValue(exact) && e.target !== toValue(target))\n return;\n const container = toValue(containerElement);\n const containerRect = (_a2 = container == null ? void 0 : container.getBoundingClientRect) == null ? void 0 : _a2.call(container);\n const targetRect = toValue(target).getBoundingClientRect();\n const pos = {\n x: e.clientX - (container ? targetRect.left - containerRect.left + container.scrollLeft : targetRect.left),\n y: e.clientY - (container ? targetRect.top - containerRect.top + container.scrollTop : targetRect.top)\n };\n if ((onStart == null ? void 0 : onStart(pos, e)) === false)\n return;\n pressedDelta.value = pos;\n handleEvent(e);\n };\n const move = (e) => {\n if (toValue(options.disabled) || !filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n const container = toValue(containerElement);\n const targetRect = toValue(target).getBoundingClientRect();\n let { x, y } = position.value;\n if (axis === \"x\" || axis === \"both\") {\n x = e.clientX - pressedDelta.value.x;\n if (container)\n x = Math.min(Math.max(0, x), container.scrollWidth - targetRect.width);\n }\n if (axis === \"y\" || axis === \"both\") {\n y = e.clientY - pressedDelta.value.y;\n if (container)\n y = Math.min(Math.max(0, y), container.scrollHeight - targetRect.height);\n }\n position.value = {\n x,\n y\n };\n onMove == null ? void 0 : onMove(position.value, e);\n handleEvent(e);\n };\n const end = (e) => {\n if (toValue(options.disabled) || !filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n pressedDelta.value = void 0;\n onEnd == null ? void 0 : onEnd(position.value, e);\n handleEvent(e);\n };\n if (isClient) {\n const config = { capture: (_b = options.capture) != null ? _b : true };\n useEventListener(draggingHandle, \"pointerdown\", start, config);\n useEventListener(draggingElement, \"pointermove\", move, config);\n useEventListener(draggingElement, \"pointerup\", end, config);\n }\n return {\n ...toRefs(position),\n position,\n isDragging: computed(() => !!pressedDelta.value),\n style: computed(\n () => `left:${position.value.x}px;top:${position.value.y}px;`\n )\n };\n}\n\nfunction useDropZone(target, options = {}) {\n const isOverDropZone = ref(false);\n const files = shallowRef(null);\n let counter = 0;\n let isDataTypeIncluded = true;\n if (isClient) {\n const _options = typeof options === \"function\" ? { onDrop: options } : options;\n const getFiles = (event) => {\n var _a, _b;\n const list = Array.from((_b = (_a = event.dataTransfer) == null ? void 0 : _a.files) != null ? _b : []);\n return files.value = list.length === 0 ? null : list;\n };\n useEventListener(target, \"dragenter\", (event) => {\n var _a, _b;\n const types = Array.from(((_a = event == null ? void 0 : event.dataTransfer) == null ? void 0 : _a.items) || []).map((i) => i.kind === \"file\" ? i.type : null).filter(notNullish);\n if (_options.dataTypes && event.dataTransfer) {\n const dataTypes = unref(_options.dataTypes);\n isDataTypeIncluded = typeof dataTypes === \"function\" ? dataTypes(types) : dataTypes ? dataTypes.some((item) => types.includes(item)) : true;\n if (!isDataTypeIncluded)\n return;\n }\n event.preventDefault();\n counter += 1;\n isOverDropZone.value = true;\n (_b = _options.onEnter) == null ? void 0 : _b.call(_options, getFiles(event), event);\n });\n useEventListener(target, \"dragover\", (event) => {\n var _a;\n if (!isDataTypeIncluded)\n return;\n event.preventDefault();\n (_a = _options.onOver) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n useEventListener(target, \"dragleave\", (event) => {\n var _a;\n if (!isDataTypeIncluded)\n return;\n event.preventDefault();\n counter -= 1;\n if (counter === 0)\n isOverDropZone.value = false;\n (_a = _options.onLeave) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n useEventListener(target, \"drop\", (event) => {\n var _a;\n event.preventDefault();\n counter = 0;\n isOverDropZone.value = false;\n (_a = _options.onDrop) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n }\n return {\n files,\n isOverDropZone\n };\n}\n\nfunction useResizeObserver(target, callback, options = {}) {\n const { window = defaultWindow, ...observerOptions } = options;\n let observer;\n const isSupported = useSupported(() => window && \"ResizeObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const targets = computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);\n const stopWatch = watch(\n targets,\n (els) => {\n cleanup();\n if (isSupported.value && window) {\n observer = new ResizeObserver(callback);\n for (const _el of els)\n _el && observer.observe(_el, observerOptions);\n }\n },\n { immediate: true, flush: \"post\" }\n );\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nfunction useElementBounding(target, options = {}) {\n const {\n reset = true,\n windowResize = true,\n windowScroll = true,\n immediate = true\n } = options;\n const height = ref(0);\n const bottom = ref(0);\n const left = ref(0);\n const right = ref(0);\n const top = ref(0);\n const width = ref(0);\n const x = ref(0);\n const y = ref(0);\n function update() {\n const el = unrefElement(target);\n if (!el) {\n if (reset) {\n height.value = 0;\n bottom.value = 0;\n left.value = 0;\n right.value = 0;\n top.value = 0;\n width.value = 0;\n x.value = 0;\n y.value = 0;\n }\n return;\n }\n const rect = el.getBoundingClientRect();\n height.value = rect.height;\n bottom.value = rect.bottom;\n left.value = rect.left;\n right.value = rect.right;\n top.value = rect.top;\n width.value = rect.width;\n x.value = rect.x;\n y.value = rect.y;\n }\n useResizeObserver(target, update);\n watch(() => unrefElement(target), (ele) => !ele && update());\n useMutationObserver(target, update, {\n attributeFilter: [\"style\", \"class\"]\n });\n if (windowScroll)\n useEventListener(\"scroll\", update, { capture: true, passive: true });\n if (windowResize)\n useEventListener(\"resize\", update, { passive: true });\n tryOnMounted(() => {\n if (immediate)\n update();\n });\n return {\n height,\n bottom,\n left,\n right,\n top,\n width,\n x,\n y,\n update\n };\n}\n\nfunction useElementByPoint(options) {\n const {\n x,\n y,\n document = defaultDocument,\n multiple,\n interval = \"requestAnimationFrame\",\n immediate = true\n } = options;\n const isSupported = useSupported(() => {\n if (toValue(multiple))\n return document && \"elementsFromPoint\" in document;\n return document && \"elementFromPoint\" in document;\n });\n const element = ref(null);\n const cb = () => {\n var _a, _b;\n element.value = toValue(multiple) ? (_a = document == null ? void 0 : document.elementsFromPoint(toValue(x), toValue(y))) != null ? _a : [] : (_b = document == null ? void 0 : document.elementFromPoint(toValue(x), toValue(y))) != null ? _b : null;\n };\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });\n return {\n isSupported,\n element,\n ...controls\n };\n}\n\nfunction useElementHover(el, options = {}) {\n const {\n delayEnter = 0,\n delayLeave = 0,\n window = defaultWindow\n } = options;\n const isHovered = ref(false);\n let timer;\n const toggle = (entering) => {\n const delay = entering ? delayEnter : delayLeave;\n if (timer) {\n clearTimeout(timer);\n timer = void 0;\n }\n if (delay)\n timer = setTimeout(() => isHovered.value = entering, delay);\n else\n isHovered.value = entering;\n };\n if (!window)\n return isHovered;\n useEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n useEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n return isHovered;\n}\n\nfunction useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {\n const { window = defaultWindow, box = \"content-box\" } = options;\n const isSVG = computed(() => {\n var _a, _b;\n return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes(\"svg\");\n });\n const width = ref(initialSize.width);\n const height = ref(initialSize.height);\n const { stop: stop1 } = useResizeObserver(\n target,\n ([entry]) => {\n const boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n if (window && isSVG.value) {\n const $elem = unrefElement(target);\n if ($elem) {\n const styles = window.getComputedStyle($elem);\n width.value = Number.parseFloat(styles.width);\n height.value = Number.parseFloat(styles.height);\n }\n } else {\n if (boxSize) {\n const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];\n width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n } else {\n width.value = entry.contentRect.width;\n height.value = entry.contentRect.height;\n }\n }\n },\n options\n );\n tryOnMounted(() => {\n const ele = unrefElement(target);\n if (ele) {\n width.value = \"offsetWidth\" in ele ? ele.offsetWidth : initialSize.width;\n height.value = \"offsetHeight\" in ele ? ele.offsetHeight : initialSize.height;\n }\n });\n const stop2 = watch(\n () => unrefElement(target),\n (ele) => {\n width.value = ele ? initialSize.width : 0;\n height.value = ele ? initialSize.height : 0;\n }\n );\n function stop() {\n stop1();\n stop2();\n }\n return {\n width,\n height,\n stop\n };\n}\n\nfunction useIntersectionObserver(target, callback, options = {}) {\n const {\n root,\n rootMargin = \"0px\",\n threshold = 0.1,\n window = defaultWindow,\n immediate = true\n } = options;\n const isSupported = useSupported(() => window && \"IntersectionObserver\" in window);\n const targets = computed(() => {\n const _target = toValue(target);\n return (Array.isArray(_target) ? _target : [_target]).map(unrefElement).filter(notNullish);\n });\n let cleanup = noop;\n const isActive = ref(immediate);\n const stopWatch = isSupported.value ? watch(\n () => [targets.value, unrefElement(root), isActive.value],\n ([targets2, root2]) => {\n cleanup();\n if (!isActive.value)\n return;\n if (!targets2.length)\n return;\n const observer = new IntersectionObserver(\n callback,\n {\n root: unrefElement(root2),\n rootMargin,\n threshold\n }\n );\n targets2.forEach((el) => el && observer.observe(el));\n cleanup = () => {\n observer.disconnect();\n cleanup = noop;\n };\n },\n { immediate, flush: \"post\" }\n ) : noop;\n const stop = () => {\n cleanup();\n stopWatch();\n isActive.value = false;\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n isActive,\n pause() {\n cleanup();\n isActive.value = false;\n },\n resume() {\n isActive.value = true;\n },\n stop\n };\n}\n\nfunction useElementVisibility(element, options = {}) {\n const { window = defaultWindow, scrollTarget, threshold = 0 } = options;\n const elementIsVisible = ref(false);\n useIntersectionObserver(\n element,\n (intersectionObserverEntries) => {\n let isIntersecting = elementIsVisible.value;\n let latestTime = 0;\n for (const entry of intersectionObserverEntries) {\n if (entry.time >= latestTime) {\n latestTime = entry.time;\n isIntersecting = entry.isIntersecting;\n }\n }\n elementIsVisible.value = isIntersecting;\n },\n {\n root: scrollTarget,\n window,\n threshold\n }\n );\n return elementIsVisible;\n}\n\nconst events = /* @__PURE__ */ new Map();\n\nfunction useEventBus(key) {\n const scope = getCurrentScope();\n function on(listener) {\n var _a;\n const listeners = events.get(key) || /* @__PURE__ */ new Set();\n listeners.add(listener);\n events.set(key, listeners);\n const _off = () => off(listener);\n (_a = scope == null ? void 0 : scope.cleanups) == null ? void 0 : _a.push(_off);\n return _off;\n }\n function once(listener) {\n function _listener(...args) {\n off(_listener);\n listener(...args);\n }\n return on(_listener);\n }\n function off(listener) {\n const listeners = events.get(key);\n if (!listeners)\n return;\n listeners.delete(listener);\n if (!listeners.size)\n reset();\n }\n function reset() {\n events.delete(key);\n }\n function emit(event, payload) {\n var _a;\n (_a = events.get(key)) == null ? void 0 : _a.forEach((v) => v(event, payload));\n }\n return { on, once, off, emit, reset };\n}\n\nfunction resolveNestedOptions$1(options) {\n if (options === true)\n return {};\n return options;\n}\nfunction useEventSource(url, events = [], options = {}) {\n const event = ref(null);\n const data = ref(null);\n const status = ref(\"CONNECTING\");\n const eventSource = ref(null);\n const error = shallowRef(null);\n const urlRef = toRef(url);\n let explicitlyClosed = false;\n let retried = 0;\n const {\n withCredentials = false,\n immediate = true\n } = options;\n const close = () => {\n if (isClient && eventSource.value) {\n eventSource.value.close();\n eventSource.value = null;\n status.value = \"CLOSED\";\n explicitlyClosed = true;\n }\n };\n const _init = () => {\n if (explicitlyClosed || typeof urlRef.value === \"undefined\")\n return;\n const es = new EventSource(urlRef.value, { withCredentials });\n status.value = \"CONNECTING\";\n eventSource.value = es;\n es.onopen = () => {\n status.value = \"OPEN\";\n error.value = null;\n };\n es.onerror = (e) => {\n status.value = \"CLOSED\";\n error.value = e;\n if (es.readyState === 2 && !explicitlyClosed && options.autoReconnect) {\n es.close();\n const {\n retries = -1,\n delay = 1e3,\n onFailed\n } = resolveNestedOptions$1(options.autoReconnect);\n retried += 1;\n if (typeof retries === \"number\" && (retries < 0 || retried < retries))\n setTimeout(_init, delay);\n else if (typeof retries === \"function\" && retries())\n setTimeout(_init, delay);\n else\n onFailed == null ? void 0 : onFailed();\n }\n };\n es.onmessage = (e) => {\n event.value = null;\n data.value = e.data;\n };\n for (const event_name of events) {\n useEventListener(es, event_name, (e) => {\n event.value = event_name;\n data.value = e.data || null;\n });\n }\n };\n const open = () => {\n if (!isClient)\n return;\n close();\n explicitlyClosed = false;\n retried = 0;\n _init();\n };\n if (immediate)\n watch(urlRef, open, { immediate: true });\n tryOnScopeDispose(close);\n return {\n eventSource,\n event,\n data,\n status,\n error,\n open,\n close\n };\n}\n\nfunction useEyeDropper(options = {}) {\n const { initialValue = \"\" } = options;\n const isSupported = useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n const sRGBHex = ref(initialValue);\n async function open(openOptions) {\n if (!isSupported.value)\n return;\n const eyeDropper = new window.EyeDropper();\n const result = await eyeDropper.open(openOptions);\n sRGBHex.value = result.sRGBHex;\n return result;\n }\n return { isSupported, sRGBHex, open };\n}\n\nfunction useFavicon(newIcon = null, options = {}) {\n const {\n baseUrl = \"\",\n rel = \"icon\",\n document = defaultDocument\n } = options;\n const favicon = toRef(newIcon);\n const applyIcon = (icon) => {\n const elements = document == null ? void 0 : document.head.querySelectorAll(`link[rel*=\"${rel}\"]`);\n if (!elements || elements.length === 0) {\n const link = document == null ? void 0 : document.createElement(\"link\");\n if (link) {\n link.rel = rel;\n link.href = `${baseUrl}${icon}`;\n link.type = `image/${icon.split(\".\").pop()}`;\n document == null ? void 0 : document.head.append(link);\n }\n return;\n }\n elements == null ? void 0 : elements.forEach((el) => el.href = `${baseUrl}${icon}`);\n };\n watch(\n favicon,\n (i, o) => {\n if (typeof i === \"string\" && i !== o)\n applyIcon(i);\n },\n { immediate: true }\n );\n return favicon;\n}\n\nconst payloadMapping = {\n json: \"application/json\",\n text: \"text/plain\"\n};\nfunction isFetchOptions(obj) {\n return obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\", \"updateDataOnError\");\n}\nfunction isAbsoluteURL(url) {\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\nfunction headersToObject(headers) {\n if (typeof Headers !== \"undefined\" && headers instanceof Headers)\n return Object.fromEntries(headers.entries());\n return headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n if (combination === \"overwrite\") {\n return async (ctx) => {\n const callback = callbacks[callbacks.length - 1];\n if (callback)\n return { ...ctx, ...await callback(ctx) };\n return ctx;\n };\n } else {\n return async (ctx) => {\n for (const callback of callbacks) {\n if (callback)\n ctx = { ...ctx, ...await callback(ctx) };\n }\n return ctx;\n };\n }\n}\nfunction createFetch(config = {}) {\n const _combination = config.combination || \"chain\";\n const _options = config.options || {};\n const _fetchOptions = config.fetchOptions || {};\n function useFactoryFetch(url, ...args) {\n const computedUrl = computed(() => {\n const baseUrl = toValue(config.baseUrl);\n const targetUrl = toValue(url);\n return baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n });\n let options = _options;\n let fetchOptions = _fetchOptions;\n if (args.length > 0) {\n if (isFetchOptions(args[0])) {\n options = {\n ...options,\n ...args[0],\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n };\n } else {\n fetchOptions = {\n ...fetchOptions,\n ...args[0],\n headers: {\n ...headersToObject(fetchOptions.headers) || {},\n ...headersToObject(args[0].headers) || {}\n }\n };\n }\n }\n if (args.length > 1 && isFetchOptions(args[1])) {\n options = {\n ...options,\n ...args[1],\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n };\n }\n return useFetch(computedUrl, fetchOptions, options);\n }\n return useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n var _a;\n const supportsAbort = typeof AbortController === \"function\";\n let fetchOptions = {};\n let options = {\n immediate: true,\n refetch: false,\n timeout: 0,\n updateDataOnError: false\n };\n const config = {\n method: \"GET\",\n type: \"text\",\n payload: void 0\n };\n if (args.length > 0) {\n if (isFetchOptions(args[0]))\n options = { ...options, ...args[0] };\n else\n fetchOptions = args[0];\n }\n if (args.length > 1) {\n if (isFetchOptions(args[1]))\n options = { ...options, ...args[1] };\n }\n const {\n fetch = (_a = defaultWindow) == null ? void 0 : _a.fetch,\n initialData,\n timeout\n } = options;\n const responseEvent = createEventHook();\n const errorEvent = createEventHook();\n const finallyEvent = createEventHook();\n const isFinished = ref(false);\n const isFetching = ref(false);\n const aborted = ref(false);\n const statusCode = ref(null);\n const response = shallowRef(null);\n const error = shallowRef(null);\n const data = shallowRef(initialData || null);\n const canAbort = computed(() => supportsAbort && isFetching.value);\n let controller;\n let timer;\n const abort = () => {\n if (supportsAbort) {\n controller == null ? void 0 : controller.abort();\n controller = new AbortController();\n controller.signal.onabort = () => aborted.value = true;\n fetchOptions = {\n ...fetchOptions,\n signal: controller.signal\n };\n }\n };\n const loading = (isLoading) => {\n isFetching.value = isLoading;\n isFinished.value = !isLoading;\n };\n if (timeout)\n timer = useTimeoutFn(abort, timeout, { immediate: false });\n let executeCounter = 0;\n const execute = async (throwOnFailed = false) => {\n var _a2, _b;\n abort();\n loading(true);\n error.value = null;\n statusCode.value = null;\n aborted.value = false;\n executeCounter += 1;\n const currentExecuteCounter = executeCounter;\n const defaultFetchOptions = {\n method: config.method,\n headers: {}\n };\n if (config.payload) {\n const headers = headersToObject(defaultFetchOptions.headers);\n const payload = toValue(config.payload);\n if (!config.payloadType && payload && Object.getPrototypeOf(payload) === Object.prototype && !(payload instanceof FormData))\n config.payloadType = \"json\";\n if (config.payloadType)\n headers[\"Content-Type\"] = (_a2 = payloadMapping[config.payloadType]) != null ? _a2 : config.payloadType;\n defaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n }\n let isCanceled = false;\n const context = {\n url: toValue(url),\n options: {\n ...defaultFetchOptions,\n ...fetchOptions\n },\n cancel: () => {\n isCanceled = true;\n }\n };\n if (options.beforeFetch)\n Object.assign(context, await options.beforeFetch(context));\n if (isCanceled || !fetch) {\n loading(false);\n return Promise.resolve(null);\n }\n let responseData = null;\n if (timer)\n timer.start();\n return fetch(\n context.url,\n {\n ...defaultFetchOptions,\n ...context.options,\n headers: {\n ...headersToObject(defaultFetchOptions.headers),\n ...headersToObject((_b = context.options) == null ? void 0 : _b.headers)\n }\n }\n ).then(async (fetchResponse) => {\n response.value = fetchResponse;\n statusCode.value = fetchResponse.status;\n responseData = await fetchResponse.clone()[config.type]();\n if (!fetchResponse.ok) {\n data.value = initialData || null;\n throw new Error(fetchResponse.statusText);\n }\n if (options.afterFetch) {\n ({ data: responseData } = await options.afterFetch({\n data: responseData,\n response: fetchResponse\n }));\n }\n data.value = responseData;\n responseEvent.trigger(fetchResponse);\n return fetchResponse;\n }).catch(async (fetchError) => {\n let errorData = fetchError.message || fetchError.name;\n if (options.onFetchError) {\n ({ error: errorData, data: responseData } = await options.onFetchError({\n data: responseData,\n error: fetchError,\n response: response.value\n }));\n }\n error.value = errorData;\n if (options.updateDataOnError)\n data.value = responseData;\n errorEvent.trigger(fetchError);\n if (throwOnFailed)\n throw fetchError;\n return null;\n }).finally(() => {\n if (currentExecuteCounter === executeCounter)\n loading(false);\n if (timer)\n timer.stop();\n finallyEvent.trigger(null);\n });\n };\n const refetch = toRef(options.refetch);\n watch(\n [\n refetch,\n toRef(url)\n ],\n ([refetch2]) => refetch2 && execute(),\n { deep: true }\n );\n const shell = {\n isFinished: readonly(isFinished),\n isFetching: readonly(isFetching),\n statusCode,\n response,\n error,\n data,\n canAbort,\n aborted,\n abort,\n execute,\n onFetchResponse: responseEvent.on,\n onFetchError: errorEvent.on,\n onFetchFinally: finallyEvent.on,\n // method\n get: setMethod(\"GET\"),\n put: setMethod(\"PUT\"),\n post: setMethod(\"POST\"),\n delete: setMethod(\"DELETE\"),\n patch: setMethod(\"PATCH\"),\n head: setMethod(\"HEAD\"),\n options: setMethod(\"OPTIONS\"),\n // type\n json: setType(\"json\"),\n text: setType(\"text\"),\n blob: setType(\"blob\"),\n arrayBuffer: setType(\"arrayBuffer\"),\n formData: setType(\"formData\")\n };\n function setMethod(method) {\n return (payload, payloadType) => {\n if (!isFetching.value) {\n config.method = method;\n config.payload = payload;\n config.payloadType = payloadType;\n if (isRef(config.payload)) {\n watch(\n [\n refetch,\n toRef(config.payload)\n ],\n ([refetch2]) => refetch2 && execute(),\n { deep: true }\n );\n }\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n };\n }\n return void 0;\n };\n }\n function waitUntilFinished() {\n return new Promise((resolve, reject) => {\n until(isFinished).toBe(true).then(() => resolve(shell)).catch((error2) => reject(error2));\n });\n }\n function setType(type) {\n return () => {\n if (!isFetching.value) {\n config.type = type;\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n };\n }\n return void 0;\n };\n }\n if (options.immediate)\n Promise.resolve().then(() => execute());\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n };\n}\nfunction joinPaths(start, end) {\n if (!start.endsWith(\"/\") && !end.startsWith(\"/\"))\n return `${start}/${end}`;\n return `${start}${end}`;\n}\n\nconst DEFAULT_OPTIONS = {\n multiple: true,\n accept: \"*\",\n reset: false,\n directory: false\n};\nfunction useFileDialog(options = {}) {\n const {\n document = defaultDocument\n } = options;\n const files = ref(null);\n const { on: onChange, trigger } = createEventHook();\n let input;\n if (document) {\n input = document.createElement(\"input\");\n input.type = \"file\";\n input.onchange = (event) => {\n const result = event.target;\n files.value = result.files;\n trigger(files.value);\n };\n }\n const reset = () => {\n files.value = null;\n if (input) {\n input.value = \"\";\n trigger(null);\n }\n };\n const open = (localOptions) => {\n if (!input)\n return;\n const _options = {\n ...DEFAULT_OPTIONS,\n ...options,\n ...localOptions\n };\n input.multiple = _options.multiple;\n input.accept = _options.accept;\n input.webkitdirectory = _options.directory;\n if (hasOwn(_options, \"capture\"))\n input.capture = _options.capture;\n if (_options.reset)\n reset();\n input.click();\n };\n return {\n files: readonly(files),\n open,\n reset,\n onChange\n };\n}\n\nfunction useFileSystemAccess(options = {}) {\n const {\n window: _window = defaultWindow,\n dataType = \"Text\"\n } = options;\n const window = _window;\n const isSupported = useSupported(() => window && \"showSaveFilePicker\" in window && \"showOpenFilePicker\" in window);\n const fileHandle = ref();\n const data = ref();\n const file = ref();\n const fileName = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.name) != null ? _b : \"\";\n });\n const fileMIME = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.type) != null ? _b : \"\";\n });\n const fileSize = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.size) != null ? _b : 0;\n });\n const fileLastModified = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.lastModified) != null ? _b : 0;\n });\n async function open(_options = {}) {\n if (!isSupported.value)\n return;\n const [handle] = await window.showOpenFilePicker({ ...toValue(options), ..._options });\n fileHandle.value = handle;\n await updateData();\n }\n async function create(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker({ ...options, ..._options });\n data.value = void 0;\n await updateData();\n }\n async function save(_options = {}) {\n if (!isSupported.value)\n return;\n if (!fileHandle.value)\n return saveAs(_options);\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function saveAs(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker({ ...options, ..._options });\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function updateFile() {\n var _a;\n file.value = await ((_a = fileHandle.value) == null ? void 0 : _a.getFile());\n }\n async function updateData() {\n var _a, _b;\n await updateFile();\n const type = toValue(dataType);\n if (type === \"Text\")\n data.value = await ((_a = file.value) == null ? void 0 : _a.text());\n else if (type === \"ArrayBuffer\")\n data.value = await ((_b = file.value) == null ? void 0 : _b.arrayBuffer());\n else if (type === \"Blob\")\n data.value = file.value;\n }\n watch(() => toValue(dataType), updateData);\n return {\n isSupported,\n data,\n file,\n fileName,\n fileMIME,\n fileSize,\n fileLastModified,\n open,\n create,\n save,\n saveAs,\n updateData\n };\n}\n\nfunction useFocus(target, options = {}) {\n const { initialValue = false, focusVisible = false } = options;\n const innerFocused = ref(false);\n const targetElement = computed(() => unrefElement(target));\n useEventListener(targetElement, \"focus\", (event) => {\n var _a, _b;\n if (!focusVisible || ((_b = (_a = event.target).matches) == null ? void 0 : _b.call(_a, \":focus-visible\")))\n innerFocused.value = true;\n });\n useEventListener(targetElement, \"blur\", () => innerFocused.value = false);\n const focused = computed({\n get: () => innerFocused.value,\n set(value) {\n var _a, _b;\n if (!value && innerFocused.value)\n (_a = targetElement.value) == null ? void 0 : _a.blur();\n else if (value && !innerFocused.value)\n (_b = targetElement.value) == null ? void 0 : _b.focus();\n }\n });\n watch(\n targetElement,\n () => {\n focused.value = initialValue;\n },\n { immediate: true, flush: \"post\" }\n );\n return { focused };\n}\n\nfunction useFocusWithin(target, options = {}) {\n const activeElement = useActiveElement(options);\n const targetElement = computed(() => unrefElement(target));\n const focused = computed(() => targetElement.value && activeElement.value ? targetElement.value.contains(activeElement.value) : false);\n return { focused };\n}\n\nfunction useFps(options) {\n var _a;\n const fps = ref(0);\n if (typeof performance === \"undefined\")\n return fps;\n const every = (_a = options == null ? void 0 : options.every) != null ? _a : 10;\n let last = performance.now();\n let ticks = 0;\n useRafFn(() => {\n ticks += 1;\n if (ticks >= every) {\n const now = performance.now();\n const diff = now - last;\n fps.value = Math.round(1e3 / (diff / ticks));\n last = now;\n ticks = 0;\n }\n });\n return fps;\n}\n\nconst eventHandlers = [\n \"fullscreenchange\",\n \"webkitfullscreenchange\",\n \"webkitendfullscreen\",\n \"mozfullscreenchange\",\n \"MSFullscreenChange\"\n];\nfunction useFullscreen(target, options = {}) {\n const {\n document = defaultDocument,\n autoExit = false\n } = options;\n const targetRef = computed(() => {\n var _a;\n return (_a = unrefElement(target)) != null ? _a : document == null ? void 0 : document.querySelector(\"html\");\n });\n const isFullscreen = ref(false);\n const requestMethod = computed(() => {\n return [\n \"requestFullscreen\",\n \"webkitRequestFullscreen\",\n \"webkitEnterFullscreen\",\n \"webkitEnterFullScreen\",\n \"webkitRequestFullScreen\",\n \"mozRequestFullScreen\",\n \"msRequestFullscreen\"\n ].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n });\n const exitMethod = computed(() => {\n return [\n \"exitFullscreen\",\n \"webkitExitFullscreen\",\n \"webkitExitFullScreen\",\n \"webkitCancelFullScreen\",\n \"mozCancelFullScreen\",\n \"msExitFullscreen\"\n ].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n });\n const fullscreenEnabled = computed(() => {\n return [\n \"fullScreen\",\n \"webkitIsFullScreen\",\n \"webkitDisplayingFullscreen\",\n \"mozFullScreen\",\n \"msFullscreenElement\"\n ].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n });\n const fullscreenElementMethod = [\n \"fullscreenElement\",\n \"webkitFullscreenElement\",\n \"mozFullScreenElement\",\n \"msFullscreenElement\"\n ].find((m) => document && m in document);\n const isSupported = useSupported(() => targetRef.value && document && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0);\n const isCurrentElementFullScreen = () => {\n if (fullscreenElementMethod)\n return (document == null ? void 0 : document[fullscreenElementMethod]) === targetRef.value;\n return false;\n };\n const isElementFullScreen = () => {\n if (fullscreenEnabled.value) {\n if (document && document[fullscreenEnabled.value] != null) {\n return document[fullscreenEnabled.value];\n } else {\n const target2 = targetRef.value;\n if ((target2 == null ? void 0 : target2[fullscreenEnabled.value]) != null) {\n return Boolean(target2[fullscreenEnabled.value]);\n }\n }\n }\n return false;\n };\n async function exit() {\n if (!isSupported.value || !isFullscreen.value)\n return;\n if (exitMethod.value) {\n if ((document == null ? void 0 : document[exitMethod.value]) != null) {\n await document[exitMethod.value]();\n } else {\n const target2 = targetRef.value;\n if ((target2 == null ? void 0 : target2[exitMethod.value]) != null)\n await target2[exitMethod.value]();\n }\n }\n isFullscreen.value = false;\n }\n async function enter() {\n if (!isSupported.value || isFullscreen.value)\n return;\n if (isElementFullScreen())\n await exit();\n const target2 = targetRef.value;\n if (requestMethod.value && (target2 == null ? void 0 : target2[requestMethod.value]) != null) {\n await target2[requestMethod.value]();\n isFullscreen.value = true;\n }\n }\n async function toggle() {\n await (isFullscreen.value ? exit() : enter());\n }\n const handlerCallback = () => {\n const isElementFullScreenValue = isElementFullScreen();\n if (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen())\n isFullscreen.value = isElementFullScreenValue;\n };\n useEventListener(document, eventHandlers, handlerCallback, false);\n useEventListener(() => unrefElement(targetRef), eventHandlers, handlerCallback, false);\n if (autoExit)\n tryOnScopeDispose(exit);\n return {\n isSupported,\n isFullscreen,\n enter,\n exit,\n toggle\n };\n}\n\nfunction mapGamepadToXbox360Controller(gamepad) {\n return computed(() => {\n if (gamepad.value) {\n return {\n buttons: {\n a: gamepad.value.buttons[0],\n b: gamepad.value.buttons[1],\n x: gamepad.value.buttons[2],\n y: gamepad.value.buttons[3]\n },\n bumper: {\n left: gamepad.value.buttons[4],\n right: gamepad.value.buttons[5]\n },\n triggers: {\n left: gamepad.value.buttons[6],\n right: gamepad.value.buttons[7]\n },\n stick: {\n left: {\n horizontal: gamepad.value.axes[0],\n vertical: gamepad.value.axes[1],\n button: gamepad.value.buttons[10]\n },\n right: {\n horizontal: gamepad.value.axes[2],\n vertical: gamepad.value.axes[3],\n button: gamepad.value.buttons[11]\n }\n },\n dpad: {\n up: gamepad.value.buttons[12],\n down: gamepad.value.buttons[13],\n left: gamepad.value.buttons[14],\n right: gamepad.value.buttons[15]\n },\n back: gamepad.value.buttons[8],\n start: gamepad.value.buttons[9]\n };\n }\n return null;\n });\n}\nfunction useGamepad(options = {}) {\n const {\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"getGamepads\" in navigator);\n const gamepads = ref([]);\n const onConnectedHook = createEventHook();\n const onDisconnectedHook = createEventHook();\n const stateFromGamepad = (gamepad) => {\n const hapticActuators = [];\n const vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n if (vibrationActuator)\n hapticActuators.push(vibrationActuator);\n if (gamepad.hapticActuators)\n hapticActuators.push(...gamepad.hapticActuators);\n return {\n ...gamepad,\n id: gamepad.id,\n hapticActuators,\n axes: gamepad.axes.map((axes) => axes),\n buttons: gamepad.buttons.map((button) => ({ pressed: button.pressed, touched: button.touched, value: button.value })),\n index: gamepad.index\n };\n };\n const updateGamepadState = () => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n for (const gamepad of _gamepads) {\n if (gamepad && gamepads.value[gamepad.index])\n gamepads.value[gamepad.index] = stateFromGamepad(gamepad);\n }\n };\n const { isActive, pause, resume } = useRafFn(updateGamepadState);\n const onGamepadConnected = (gamepad) => {\n if (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n gamepads.value.push(stateFromGamepad(gamepad));\n onConnectedHook.trigger(gamepad.index);\n }\n resume();\n };\n const onGamepadDisconnected = (gamepad) => {\n gamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n onDisconnectedHook.trigger(gamepad.index);\n };\n useEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad));\n useEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad));\n tryOnMounted(() => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n for (const gamepad of _gamepads) {\n if (gamepad && gamepads.value[gamepad.index])\n onGamepadConnected(gamepad);\n }\n });\n pause();\n return {\n isSupported,\n onConnected: onConnectedHook.on,\n onDisconnected: onDisconnectedHook.on,\n gamepads,\n pause,\n resume,\n isActive\n };\n}\n\nfunction useGeolocation(options = {}) {\n const {\n enableHighAccuracy = true,\n maximumAge = 3e4,\n timeout = 27e3,\n navigator = defaultNavigator,\n immediate = true\n } = options;\n const isSupported = useSupported(() => navigator && \"geolocation\" in navigator);\n const locatedAt = ref(null);\n const error = shallowRef(null);\n const coords = ref({\n accuracy: 0,\n latitude: Number.POSITIVE_INFINITY,\n longitude: Number.POSITIVE_INFINITY,\n altitude: null,\n altitudeAccuracy: null,\n heading: null,\n speed: null\n });\n function updatePosition(position) {\n locatedAt.value = position.timestamp;\n coords.value = position.coords;\n error.value = null;\n }\n let watcher;\n function resume() {\n if (isSupported.value) {\n watcher = navigator.geolocation.watchPosition(\n updatePosition,\n (err) => error.value = err,\n {\n enableHighAccuracy,\n maximumAge,\n timeout\n }\n );\n }\n }\n if (immediate)\n resume();\n function pause() {\n if (watcher && navigator)\n navigator.geolocation.clearWatch(watcher);\n }\n tryOnScopeDispose(() => {\n pause();\n });\n return {\n isSupported,\n coords,\n locatedAt,\n error,\n resume,\n pause\n };\n}\n\nconst defaultEvents$1 = [\"mousemove\", \"mousedown\", \"resize\", \"keydown\", \"touchstart\", \"wheel\"];\nconst oneMinute = 6e4;\nfunction useIdle(timeout = oneMinute, options = {}) {\n const {\n initialState = false,\n listenForVisibilityChange = true,\n events = defaultEvents$1,\n window = defaultWindow,\n eventFilter = throttleFilter(50)\n } = options;\n const idle = ref(initialState);\n const lastActive = ref(timestamp());\n let timer;\n const reset = () => {\n idle.value = false;\n clearTimeout(timer);\n timer = setTimeout(() => idle.value = true, timeout);\n };\n const onEvent = createFilterWrapper(\n eventFilter,\n () => {\n lastActive.value = timestamp();\n reset();\n }\n );\n if (window) {\n const document = window.document;\n for (const event of events)\n useEventListener(window, event, onEvent, { passive: true });\n if (listenForVisibilityChange) {\n useEventListener(document, \"visibilitychange\", () => {\n if (!document.hidden)\n onEvent();\n });\n }\n reset();\n }\n return {\n idle,\n lastActive,\n reset\n };\n}\n\nasync function loadImage(options) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n const { src, srcset, sizes, class: clazz, loading, crossorigin, referrerPolicy } = options;\n img.src = src;\n if (srcset)\n img.srcset = srcset;\n if (sizes)\n img.sizes = sizes;\n if (clazz)\n img.className = clazz;\n if (loading)\n img.loading = loading;\n if (crossorigin)\n img.crossOrigin = crossorigin;\n if (referrerPolicy)\n img.referrerPolicy = referrerPolicy;\n img.onload = () => resolve(img);\n img.onerror = reject;\n });\n}\nfunction useImage(options, asyncStateOptions = {}) {\n const state = useAsyncState(\n () => loadImage(toValue(options)),\n void 0,\n {\n resetOnExecute: true,\n ...asyncStateOptions\n }\n );\n watch(\n () => toValue(options),\n () => state.execute(asyncStateOptions.delay),\n { deep: true }\n );\n return state;\n}\n\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\nfunction useScroll(element, options = {}) {\n const {\n throttle = 0,\n idle = 200,\n onStop = noop,\n onScroll = noop,\n offset = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n },\n eventListenerOptions = {\n capture: false,\n passive: true\n },\n behavior = \"auto\",\n window = defaultWindow,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const internalX = ref(0);\n const internalY = ref(0);\n const x = computed({\n get() {\n return internalX.value;\n },\n set(x2) {\n scrollTo(x2, void 0);\n }\n });\n const y = computed({\n get() {\n return internalY.value;\n },\n set(y2) {\n scrollTo(void 0, y2);\n }\n });\n function scrollTo(_x, _y) {\n var _a, _b, _c;\n if (!window)\n return;\n const _element = toValue(element);\n if (!_element)\n return;\n (_c = _element instanceof Document ? window.document.body : _element) == null ? void 0 : _c.scrollTo({\n top: (_a = toValue(_y)) != null ? _a : y.value,\n left: (_b = toValue(_x)) != null ? _b : x.value,\n behavior: toValue(behavior)\n });\n }\n const isScrolling = ref(false);\n const arrivedState = reactive({\n left: true,\n right: false,\n top: true,\n bottom: false\n });\n const directions = reactive({\n left: false,\n right: false,\n top: false,\n bottom: false\n });\n const onScrollEnd = (e) => {\n if (!isScrolling.value)\n return;\n isScrolling.value = false;\n directions.left = false;\n directions.right = false;\n directions.top = false;\n directions.bottom = false;\n onStop(e);\n };\n const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n const setArrivedState = (target) => {\n var _a;\n if (!window)\n return;\n const el = ((_a = target == null ? void 0 : target.document) == null ? void 0 : _a.documentElement) || (target == null ? void 0 : target.documentElement) || unrefElement(target);\n const { display, flexDirection } = getComputedStyle(el);\n const scrollLeft = el.scrollLeft;\n directions.left = scrollLeft < internalX.value;\n directions.right = scrollLeft > internalX.value;\n const left = Math.abs(scrollLeft) <= (offset.left || 0);\n const right = Math.abs(scrollLeft) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n if (display === \"flex\" && flexDirection === \"row-reverse\") {\n arrivedState.left = right;\n arrivedState.right = left;\n } else {\n arrivedState.left = left;\n arrivedState.right = right;\n }\n internalX.value = scrollLeft;\n let scrollTop = el.scrollTop;\n if (target === window.document && !scrollTop)\n scrollTop = window.document.body.scrollTop;\n directions.top = scrollTop < internalY.value;\n directions.bottom = scrollTop > internalY.value;\n const top = Math.abs(scrollTop) <= (offset.top || 0);\n const bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n if (display === \"flex\" && flexDirection === \"column-reverse\") {\n arrivedState.top = bottom;\n arrivedState.bottom = top;\n } else {\n arrivedState.top = top;\n arrivedState.bottom = bottom;\n }\n internalY.value = scrollTop;\n };\n const onScrollHandler = (e) => {\n var _a;\n if (!window)\n return;\n const eventTarget = (_a = e.target.documentElement) != null ? _a : e.target;\n setArrivedState(eventTarget);\n isScrolling.value = true;\n onScrollEndDebounced(e);\n onScroll(e);\n };\n useEventListener(\n element,\n \"scroll\",\n throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler,\n eventListenerOptions\n );\n tryOnMounted(() => {\n try {\n const _element = toValue(element);\n if (!_element)\n return;\n setArrivedState(_element);\n } catch (e) {\n onError(e);\n }\n });\n useEventListener(\n element,\n \"scrollend\",\n onScrollEnd,\n eventListenerOptions\n );\n return {\n x,\n y,\n isScrolling,\n arrivedState,\n directions,\n measure() {\n const _element = toValue(element);\n if (window && _element)\n setArrivedState(_element);\n }\n };\n}\n\nfunction resolveElement(el) {\n if (typeof Window !== \"undefined\" && el instanceof Window)\n return el.document.documentElement;\n if (typeof Document !== \"undefined\" && el instanceof Document)\n return el.documentElement;\n return el;\n}\n\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n var _a;\n const {\n direction = \"bottom\",\n interval = 100,\n canLoadMore = () => true\n } = options;\n const state = reactive(useScroll(\n element,\n {\n ...options,\n offset: {\n [direction]: (_a = options.distance) != null ? _a : 0,\n ...options.offset\n }\n }\n ));\n const promise = ref();\n const isLoading = computed(() => !!promise.value);\n const observedElement = computed(() => {\n return resolveElement(toValue(element));\n });\n const isElementVisible = useElementVisibility(observedElement);\n function checkAndLoad() {\n state.measure();\n if (!observedElement.value || !isElementVisible.value || !canLoadMore(observedElement.value))\n return;\n const { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;\n const isNarrower = direction === \"bottom\" || direction === \"top\" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;\n if (state.arrivedState[direction] || isNarrower) {\n if (!promise.value) {\n promise.value = Promise.all([\n onLoadMore(state),\n new Promise((resolve) => setTimeout(resolve, interval))\n ]).finally(() => {\n promise.value = null;\n nextTick(() => checkAndLoad());\n });\n }\n }\n }\n watch(\n () => [state.arrivedState[direction], isElementVisible.value],\n checkAndLoad,\n { immediate: true }\n );\n return {\n isLoading\n };\n}\n\nconst defaultEvents = [\"mousedown\", \"mouseup\", \"keydown\", \"keyup\"];\nfunction useKeyModifier(modifier, options = {}) {\n const {\n events = defaultEvents,\n document = defaultDocument,\n initial = null\n } = options;\n const state = ref(initial);\n if (document) {\n events.forEach((listenerEvent) => {\n useEventListener(document, listenerEvent, (evt) => {\n if (typeof evt.getModifierState === \"function\")\n state.value = evt.getModifierState(modifier);\n });\n });\n }\n return state;\n}\n\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.localStorage, options);\n}\n\nconst DefaultMagicKeysAliasMap = {\n ctrl: \"control\",\n command: \"meta\",\n cmd: \"meta\",\n option: \"alt\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\"\n};\n\nfunction useMagicKeys(options = {}) {\n const {\n reactive: useReactive = false,\n target = defaultWindow,\n aliasMap = DefaultMagicKeysAliasMap,\n passive = true,\n onEventFired = noop\n } = options;\n const current = reactive(/* @__PURE__ */ new Set());\n const obj = {\n toJSON() {\n return {};\n },\n current\n };\n const refs = useReactive ? reactive(obj) : obj;\n const metaDeps = /* @__PURE__ */ new Set();\n const usedKeys = /* @__PURE__ */ new Set();\n function setRefs(key, value) {\n if (key in refs) {\n if (useReactive)\n refs[key] = value;\n else\n refs[key].value = value;\n }\n }\n function reset() {\n current.clear();\n for (const key of usedKeys)\n setRefs(key, false);\n }\n function updateRefs(e, value) {\n var _a, _b;\n const key = (_a = e.key) == null ? void 0 : _a.toLowerCase();\n const code = (_b = e.code) == null ? void 0 : _b.toLowerCase();\n const values = [code, key].filter(Boolean);\n if (key) {\n if (value)\n current.add(key);\n else\n current.delete(key);\n }\n for (const key2 of values) {\n usedKeys.add(key2);\n setRefs(key2, value);\n }\n if (key === \"meta\" && !value) {\n metaDeps.forEach((key2) => {\n current.delete(key2);\n setRefs(key2, false);\n });\n metaDeps.clear();\n } else if (typeof e.getModifierState === \"function\" && e.getModifierState(\"Meta\") && value) {\n [...current, ...values].forEach((key2) => metaDeps.add(key2));\n }\n }\n useEventListener(target, \"keydown\", (e) => {\n updateRefs(e, true);\n return onEventFired(e);\n }, { passive });\n useEventListener(target, \"keyup\", (e) => {\n updateRefs(e, false);\n return onEventFired(e);\n }, { passive });\n useEventListener(\"blur\", reset, { passive: true });\n useEventListener(\"focus\", reset, { passive: true });\n const proxy = new Proxy(\n refs,\n {\n get(target2, prop, rec) {\n if (typeof prop !== \"string\")\n return Reflect.get(target2, prop, rec);\n prop = prop.toLowerCase();\n if (prop in aliasMap)\n prop = aliasMap[prop];\n if (!(prop in refs)) {\n if (/[+_-]/.test(prop)) {\n const keys = prop.split(/[+_-]/g).map((i) => i.trim());\n refs[prop] = computed(() => keys.every((key) => toValue(proxy[key])));\n } else {\n refs[prop] = ref(false);\n }\n }\n const r = Reflect.get(target2, prop, rec);\n return useReactive ? toValue(r) : r;\n }\n }\n );\n return proxy;\n}\n\nfunction usingElRef(source, cb) {\n if (toValue(source))\n cb(toValue(source));\n}\nfunction timeRangeToArray(timeRanges) {\n let ranges = [];\n for (let i = 0; i < timeRanges.length; ++i)\n ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n return ranges;\n}\nfunction tracksToArray(tracks) {\n return Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({ id, label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }));\n}\nconst defaultOptions = {\n src: \"\",\n tracks: []\n};\nfunction useMediaControls(target, options = {}) {\n options = {\n ...defaultOptions,\n ...options\n };\n const {\n document = defaultDocument\n } = options;\n const currentTime = ref(0);\n const duration = ref(0);\n const seeking = ref(false);\n const volume = ref(1);\n const waiting = ref(false);\n const ended = ref(false);\n const playing = ref(false);\n const rate = ref(1);\n const stalled = ref(false);\n const buffered = ref([]);\n const tracks = ref([]);\n const selectedTrack = ref(-1);\n const isPictureInPicture = ref(false);\n const muted = ref(false);\n const supportsPictureInPicture = document && \"pictureInPictureEnabled\" in document;\n const sourceErrorEvent = createEventHook();\n const disableTrack = (track) => {\n usingElRef(target, (el) => {\n if (track) {\n const id = typeof track === \"number\" ? track : track.id;\n el.textTracks[id].mode = \"disabled\";\n } else {\n for (let i = 0; i < el.textTracks.length; ++i)\n el.textTracks[i].mode = \"disabled\";\n }\n selectedTrack.value = -1;\n });\n };\n const enableTrack = (track, disableTracks = true) => {\n usingElRef(target, (el) => {\n const id = typeof track === \"number\" ? track : track.id;\n if (disableTracks)\n disableTrack();\n el.textTracks[id].mode = \"showing\";\n selectedTrack.value = id;\n });\n };\n const togglePictureInPicture = () => {\n return new Promise((resolve, reject) => {\n usingElRef(target, async (el) => {\n if (supportsPictureInPicture) {\n if (!isPictureInPicture.value) {\n el.requestPictureInPicture().then(resolve).catch(reject);\n } else {\n document.exitPictureInPicture().then(resolve).catch(reject);\n }\n }\n });\n });\n };\n watchEffect(() => {\n if (!document)\n return;\n const el = toValue(target);\n if (!el)\n return;\n const src = toValue(options.src);\n let sources = [];\n if (!src)\n return;\n if (typeof src === \"string\")\n sources = [{ src }];\n else if (Array.isArray(src))\n sources = src;\n else if (isObject(src))\n sources = [src];\n el.querySelectorAll(\"source\").forEach((e) => {\n e.removeEventListener(\"error\", sourceErrorEvent.trigger);\n e.remove();\n });\n sources.forEach(({ src: src2, type }) => {\n const source = document.createElement(\"source\");\n source.setAttribute(\"src\", src2);\n source.setAttribute(\"type\", type || \"\");\n source.addEventListener(\"error\", sourceErrorEvent.trigger);\n el.appendChild(source);\n });\n el.load();\n });\n tryOnScopeDispose(() => {\n const el = toValue(target);\n if (!el)\n return;\n el.querySelectorAll(\"source\").forEach((e) => e.removeEventListener(\"error\", sourceErrorEvent.trigger));\n });\n watch([target, volume], () => {\n const el = toValue(target);\n if (!el)\n return;\n el.volume = volume.value;\n });\n watch([target, muted], () => {\n const el = toValue(target);\n if (!el)\n return;\n el.muted = muted.value;\n });\n watch([target, rate], () => {\n const el = toValue(target);\n if (!el)\n return;\n el.playbackRate = rate.value;\n });\n watchEffect(() => {\n if (!document)\n return;\n const textTracks = toValue(options.tracks);\n const el = toValue(target);\n if (!textTracks || !textTracks.length || !el)\n return;\n el.querySelectorAll(\"track\").forEach((e) => e.remove());\n textTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n const track = document.createElement(\"track\");\n track.default = isDefault || false;\n track.kind = kind;\n track.label = label;\n track.src = src;\n track.srclang = srcLang;\n if (track.default)\n selectedTrack.value = i;\n el.appendChild(track);\n });\n });\n const { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n const el = toValue(target);\n if (!el)\n return;\n el.currentTime = time;\n });\n const { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n const el = toValue(target);\n if (!el)\n return;\n isPlaying ? el.play() : el.pause();\n });\n useEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = toValue(target).currentTime));\n useEventListener(target, \"durationchange\", () => duration.value = toValue(target).duration);\n useEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(toValue(target).buffered));\n useEventListener(target, \"seeking\", () => seeking.value = true);\n useEventListener(target, \"seeked\", () => seeking.value = false);\n useEventListener(target, [\"waiting\", \"loadstart\"], () => {\n waiting.value = true;\n ignorePlayingUpdates(() => playing.value = false);\n });\n useEventListener(target, \"loadeddata\", () => waiting.value = false);\n useEventListener(target, \"playing\", () => {\n waiting.value = false;\n ended.value = false;\n ignorePlayingUpdates(() => playing.value = true);\n });\n useEventListener(target, \"ratechange\", () => rate.value = toValue(target).playbackRate);\n useEventListener(target, \"stalled\", () => stalled.value = true);\n useEventListener(target, \"ended\", () => ended.value = true);\n useEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false));\n useEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true));\n useEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true);\n useEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false);\n useEventListener(target, \"volumechange\", () => {\n const el = toValue(target);\n if (!el)\n return;\n volume.value = el.volume;\n muted.value = el.muted;\n });\n const listeners = [];\n const stop = watch([target], () => {\n const el = toValue(target);\n if (!el)\n return;\n stop();\n listeners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks));\n });\n tryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n return {\n currentTime,\n duration,\n waiting,\n seeking,\n ended,\n stalled,\n buffered,\n playing,\n rate,\n // Volume\n volume,\n muted,\n // Tracks\n tracks,\n selectedTrack,\n enableTrack,\n disableTrack,\n // Picture in Picture\n supportsPictureInPicture,\n togglePictureInPicture,\n isPictureInPicture,\n // Events\n onSourceError: sourceErrorEvent.on\n };\n}\n\nfunction getMapVue2Compat() {\n const data = shallowReactive({});\n return {\n get: (key) => data[key],\n set: (key, value) => set(data, key, value),\n has: (key) => hasOwn(data, key),\n delete: (key) => del(data, key),\n clear: () => {\n Object.keys(data).forEach((key) => {\n del(data, key);\n });\n }\n };\n}\nfunction useMemoize(resolver, options) {\n const initCache = () => {\n if (options == null ? void 0 : options.cache)\n return shallowReactive(options.cache);\n if (isVue2)\n return getMapVue2Compat();\n return shallowReactive(/* @__PURE__ */ new Map());\n };\n const cache = initCache();\n const generateKey = (...args) => (options == null ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n const _loadData = (key, ...args) => {\n cache.set(key, resolver(...args));\n return cache.get(key);\n };\n const loadData = (...args) => _loadData(generateKey(...args), ...args);\n const deleteData = (...args) => {\n cache.delete(generateKey(...args));\n };\n const clearData = () => {\n cache.clear();\n };\n const memoized = (...args) => {\n const key = generateKey(...args);\n if (cache.has(key))\n return cache.get(key);\n return _loadData(key, ...args);\n };\n memoized.load = loadData;\n memoized.delete = deleteData;\n memoized.clear = clearData;\n memoized.generateKey = generateKey;\n memoized.cache = cache;\n return memoized;\n}\n\nfunction useMemory(options = {}) {\n const memory = ref();\n const isSupported = useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n if (isSupported.value) {\n const { interval = 1e3 } = options;\n useIntervalFn(() => {\n memory.value = performance.memory;\n }, interval, { immediate: options.immediate, immediateCallback: options.immediateCallback });\n }\n return { isSupported, memory };\n}\n\nconst UseMouseBuiltinExtractors = {\n page: (event) => [event.pageX, event.pageY],\n client: (event) => [event.clientX, event.clientY],\n screen: (event) => [event.screenX, event.screenY],\n movement: (event) => event instanceof Touch ? null : [event.movementX, event.movementY]\n};\nfunction useMouse(options = {}) {\n const {\n type = \"page\",\n touch = true,\n resetOnTouchEnds = false,\n initialValue = { x: 0, y: 0 },\n window = defaultWindow,\n target = window,\n scroll = true,\n eventFilter\n } = options;\n let _prevMouseEvent = null;\n const x = ref(initialValue.x);\n const y = ref(initialValue.y);\n const sourceType = ref(null);\n const extractor = typeof type === \"function\" ? type : UseMouseBuiltinExtractors[type];\n const mouseHandler = (event) => {\n const result = extractor(event);\n _prevMouseEvent = event;\n if (result) {\n [x.value, y.value] = result;\n sourceType.value = \"mouse\";\n }\n };\n const touchHandler = (event) => {\n if (event.touches.length > 0) {\n const result = extractor(event.touches[0]);\n if (result) {\n [x.value, y.value] = result;\n sourceType.value = \"touch\";\n }\n }\n };\n const scrollHandler = () => {\n if (!_prevMouseEvent || !window)\n return;\n const pos = extractor(_prevMouseEvent);\n if (_prevMouseEvent instanceof MouseEvent && pos) {\n x.value = pos[0] + window.scrollX;\n y.value = pos[1] + window.scrollY;\n }\n };\n const reset = () => {\n x.value = initialValue.x;\n y.value = initialValue.y;\n };\n const mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);\n const touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);\n const scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();\n if (target) {\n const listenerOptions = { passive: true };\n useEventListener(target, [\"mousemove\", \"dragover\"], mouseHandlerWrapper, listenerOptions);\n if (touch && type !== \"movement\") {\n useEventListener(target, [\"touchstart\", \"touchmove\"], touchHandlerWrapper, listenerOptions);\n if (resetOnTouchEnds)\n useEventListener(target, \"touchend\", reset, listenerOptions);\n }\n if (scroll && type === \"page\")\n useEventListener(window, \"scroll\", scrollHandlerWrapper, { passive: true });\n }\n return {\n x,\n y,\n sourceType\n };\n}\n\nfunction useMouseInElement(target, options = {}) {\n const {\n handleOutside = true,\n window = defaultWindow\n } = options;\n const type = options.type || \"page\";\n const { x, y, sourceType } = useMouse(options);\n const targetRef = ref(target != null ? target : window == null ? void 0 : window.document.body);\n const elementX = ref(0);\n const elementY = ref(0);\n const elementPositionX = ref(0);\n const elementPositionY = ref(0);\n const elementHeight = ref(0);\n const elementWidth = ref(0);\n const isOutside = ref(true);\n let stop = () => {\n };\n if (window) {\n stop = watch(\n [targetRef, x, y],\n () => {\n const el = unrefElement(targetRef);\n if (!el)\n return;\n const {\n left,\n top,\n width,\n height\n } = el.getBoundingClientRect();\n elementPositionX.value = left + (type === \"page\" ? window.pageXOffset : 0);\n elementPositionY.value = top + (type === \"page\" ? window.pageYOffset : 0);\n elementHeight.value = height;\n elementWidth.value = width;\n const elX = x.value - elementPositionX.value;\n const elY = y.value - elementPositionY.value;\n isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n if (handleOutside || !isOutside.value) {\n elementX.value = elX;\n elementY.value = elY;\n }\n },\n { immediate: true }\n );\n useEventListener(document, \"mouseleave\", () => {\n isOutside.value = true;\n });\n }\n return {\n x,\n y,\n sourceType,\n elementX,\n elementY,\n elementPositionX,\n elementPositionY,\n elementHeight,\n elementWidth,\n isOutside,\n stop\n };\n}\n\nfunction useMousePressed(options = {}) {\n const {\n touch = true,\n drag = true,\n capture = false,\n initialValue = false,\n window = defaultWindow\n } = options;\n const pressed = ref(initialValue);\n const sourceType = ref(null);\n if (!window) {\n return {\n pressed,\n sourceType\n };\n }\n const onPressed = (srcType) => () => {\n pressed.value = true;\n sourceType.value = srcType;\n };\n const onReleased = () => {\n pressed.value = false;\n sourceType.value = null;\n };\n const target = computed(() => unrefElement(options.target) || window);\n useEventListener(target, \"mousedown\", onPressed(\"mouse\"), { passive: true, capture });\n useEventListener(window, \"mouseleave\", onReleased, { passive: true, capture });\n useEventListener(window, \"mouseup\", onReleased, { passive: true, capture });\n if (drag) {\n useEventListener(target, \"dragstart\", onPressed(\"mouse\"), { passive: true, capture });\n useEventListener(window, \"drop\", onReleased, { passive: true, capture });\n useEventListener(window, \"dragend\", onReleased, { passive: true, capture });\n }\n if (touch) {\n useEventListener(target, \"touchstart\", onPressed(\"touch\"), { passive: true, capture });\n useEventListener(window, \"touchend\", onReleased, { passive: true, capture });\n useEventListener(window, \"touchcancel\", onReleased, { passive: true, capture });\n }\n return {\n pressed,\n sourceType\n };\n}\n\nfunction useNavigatorLanguage(options = {}) {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"language\" in navigator);\n const language = ref(navigator == null ? void 0 : navigator.language);\n useEventListener(window, \"languagechange\", () => {\n if (navigator)\n language.value = navigator.language;\n });\n return {\n isSupported,\n language\n };\n}\n\nfunction useNetwork(options = {}) {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"connection\" in navigator);\n const isOnline = ref(true);\n const saveData = ref(false);\n const offlineAt = ref(void 0);\n const onlineAt = ref(void 0);\n const downlink = ref(void 0);\n const downlinkMax = ref(void 0);\n const rtt = ref(void 0);\n const effectiveType = ref(void 0);\n const type = ref(\"unknown\");\n const connection = isSupported.value && navigator.connection;\n function updateNetworkInformation() {\n if (!navigator)\n return;\n isOnline.value = navigator.onLine;\n offlineAt.value = isOnline.value ? void 0 : Date.now();\n onlineAt.value = isOnline.value ? Date.now() : void 0;\n if (connection) {\n downlink.value = connection.downlink;\n downlinkMax.value = connection.downlinkMax;\n effectiveType.value = connection.effectiveType;\n rtt.value = connection.rtt;\n saveData.value = connection.saveData;\n type.value = connection.type;\n }\n }\n if (window) {\n useEventListener(window, \"offline\", () => {\n isOnline.value = false;\n offlineAt.value = Date.now();\n });\n useEventListener(window, \"online\", () => {\n isOnline.value = true;\n onlineAt.value = Date.now();\n });\n }\n if (connection)\n useEventListener(connection, \"change\", updateNetworkInformation, false);\n updateNetworkInformation();\n return {\n isSupported,\n isOnline,\n saveData,\n offlineAt,\n onlineAt,\n downlink,\n downlinkMax,\n effectiveType,\n rtt,\n type\n };\n}\n\nfunction useNow(options = {}) {\n const {\n controls: exposeControls = false,\n interval = \"requestAnimationFrame\"\n } = options;\n const now = ref(/* @__PURE__ */ new Date());\n const update = () => now.value = /* @__PURE__ */ new Date();\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(update, { immediate: true }) : useIntervalFn(update, interval, { immediate: true });\n if (exposeControls) {\n return {\n now,\n ...controls\n };\n } else {\n return now;\n }\n}\n\nfunction useObjectUrl(object) {\n const url = ref();\n const release = () => {\n if (url.value)\n URL.revokeObjectURL(url.value);\n url.value = void 0;\n };\n watch(\n () => toValue(object),\n (newObject) => {\n release();\n if (newObject)\n url.value = URL.createObjectURL(newObject);\n },\n { immediate: true }\n );\n tryOnScopeDispose(release);\n return readonly(url);\n}\n\nfunction useClamp(value, min, max) {\n if (typeof value === \"function\" || isReadonly(value))\n return computed(() => clamp(toValue(value), toValue(min), toValue(max)));\n const _value = ref(value);\n return computed({\n get() {\n return _value.value = clamp(_value.value, toValue(min), toValue(max));\n },\n set(value2) {\n _value.value = clamp(value2, toValue(min), toValue(max));\n }\n });\n}\n\nfunction useOffsetPagination(options) {\n const {\n total = Number.POSITIVE_INFINITY,\n pageSize = 10,\n page = 1,\n onPageChange = noop,\n onPageSizeChange = noop,\n onPageCountChange = noop\n } = options;\n const currentPageSize = useClamp(pageSize, 1, Number.POSITIVE_INFINITY);\n const pageCount = computed(() => Math.max(\n 1,\n Math.ceil(toValue(total) / toValue(currentPageSize))\n ));\n const currentPage = useClamp(page, 1, pageCount);\n const isFirstPage = computed(() => currentPage.value === 1);\n const isLastPage = computed(() => currentPage.value === pageCount.value);\n if (isRef(page)) {\n syncRef(page, currentPage, {\n direction: isReadonly(page) ? \"ltr\" : \"both\"\n });\n }\n if (isRef(pageSize)) {\n syncRef(pageSize, currentPageSize, {\n direction: isReadonly(pageSize) ? \"ltr\" : \"both\"\n });\n }\n function prev() {\n currentPage.value--;\n }\n function next() {\n currentPage.value++;\n }\n const returnValue = {\n currentPage,\n currentPageSize,\n pageCount,\n isFirstPage,\n isLastPage,\n prev,\n next\n };\n watch(currentPage, () => {\n onPageChange(reactive(returnValue));\n });\n watch(currentPageSize, () => {\n onPageSizeChange(reactive(returnValue));\n });\n watch(pageCount, () => {\n onPageCountChange(reactive(returnValue));\n });\n return returnValue;\n}\n\nfunction useOnline(options = {}) {\n const { isOnline } = useNetwork(options);\n return isOnline;\n}\n\nfunction usePageLeave(options = {}) {\n const { window = defaultWindow } = options;\n const isLeft = ref(false);\n const handler = (event) => {\n if (!window)\n return;\n event = event || window.event;\n const from = event.relatedTarget || event.toElement;\n isLeft.value = !from;\n };\n if (window) {\n useEventListener(window, \"mouseout\", handler, { passive: true });\n useEventListener(window.document, \"mouseleave\", handler, { passive: true });\n useEventListener(window.document, \"mouseenter\", handler, { passive: true });\n }\n return isLeft;\n}\n\nfunction useScreenOrientation(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"screen\" in window && \"orientation\" in window.screen);\n const screenOrientation = isSupported.value ? window.screen.orientation : {};\n const orientation = ref(screenOrientation.type);\n const angle = ref(screenOrientation.angle || 0);\n if (isSupported.value) {\n useEventListener(window, \"orientationchange\", () => {\n orientation.value = screenOrientation.type;\n angle.value = screenOrientation.angle;\n });\n }\n const lockOrientation = (type) => {\n if (isSupported.value && typeof screenOrientation.lock === \"function\")\n return screenOrientation.lock(type);\n return Promise.reject(new Error(\"Not supported\"));\n };\n const unlockOrientation = () => {\n if (isSupported.value && typeof screenOrientation.unlock === \"function\")\n screenOrientation.unlock();\n };\n return {\n isSupported,\n orientation,\n angle,\n lockOrientation,\n unlockOrientation\n };\n}\n\nfunction useParallax(target, options = {}) {\n const {\n deviceOrientationTiltAdjust = (i) => i,\n deviceOrientationRollAdjust = (i) => i,\n mouseTiltAdjust = (i) => i,\n mouseRollAdjust = (i) => i,\n window = defaultWindow\n } = options;\n const orientation = reactive(useDeviceOrientation({ window }));\n const screenOrientation = reactive(useScreenOrientation({ window }));\n const {\n elementX: x,\n elementY: y,\n elementWidth: width,\n elementHeight: height\n } = useMouseInElement(target, { handleOutside: false, window });\n const source = computed(() => {\n if (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0))\n return \"deviceOrientation\";\n return \"mouse\";\n });\n const roll = computed(() => {\n if (source.value === \"deviceOrientation\") {\n let value;\n switch (screenOrientation.orientation) {\n case \"landscape-primary\":\n value = orientation.gamma / 90;\n break;\n case \"landscape-secondary\":\n value = -orientation.gamma / 90;\n break;\n case \"portrait-primary\":\n value = -orientation.beta / 90;\n break;\n case \"portrait-secondary\":\n value = orientation.beta / 90;\n break;\n default:\n value = -orientation.beta / 90;\n }\n return deviceOrientationRollAdjust(value);\n } else {\n const value = -(y.value - height.value / 2) / height.value;\n return mouseRollAdjust(value);\n }\n });\n const tilt = computed(() => {\n if (source.value === \"deviceOrientation\") {\n let value;\n switch (screenOrientation.orientation) {\n case \"landscape-primary\":\n value = orientation.beta / 90;\n break;\n case \"landscape-secondary\":\n value = -orientation.beta / 90;\n break;\n case \"portrait-primary\":\n value = orientation.gamma / 90;\n break;\n case \"portrait-secondary\":\n value = -orientation.gamma / 90;\n break;\n default:\n value = orientation.gamma / 90;\n }\n return deviceOrientationTiltAdjust(value);\n } else {\n const value = (x.value - width.value / 2) / width.value;\n return mouseTiltAdjust(value);\n }\n });\n return { roll, tilt, source };\n}\n\nfunction useParentElement(element = useCurrentElement()) {\n const parentElement = shallowRef();\n const update = () => {\n const el = unrefElement(element);\n if (el)\n parentElement.value = el.parentElement;\n };\n tryOnMounted(update);\n watch(() => toValue(element), update);\n return parentElement;\n}\n\nfunction usePerformanceObserver(options, callback) {\n const {\n window = defaultWindow,\n immediate = true,\n ...performanceOptions\n } = options;\n const isSupported = useSupported(() => window && \"PerformanceObserver\" in window);\n let observer;\n const stop = () => {\n observer == null ? void 0 : observer.disconnect();\n };\n const start = () => {\n if (isSupported.value) {\n stop();\n observer = new PerformanceObserver(callback);\n observer.observe(performanceOptions);\n }\n };\n tryOnScopeDispose(stop);\n if (immediate)\n start();\n return {\n isSupported,\n start,\n stop\n };\n}\n\nconst defaultState = {\n x: 0,\n y: 0,\n pointerId: 0,\n pressure: 0,\n tiltX: 0,\n tiltY: 0,\n width: 0,\n height: 0,\n twist: 0,\n pointerType: null\n};\nconst keys = /* @__PURE__ */ Object.keys(defaultState);\nfunction usePointer(options = {}) {\n const {\n target = defaultWindow\n } = options;\n const isInside = ref(false);\n const state = ref(options.initialValue || {});\n Object.assign(state.value, defaultState, state.value);\n const handler = (event) => {\n isInside.value = true;\n if (options.pointerTypes && !options.pointerTypes.includes(event.pointerType))\n return;\n state.value = objectPick(event, keys, false);\n };\n if (target) {\n const listenerOptions = { passive: true };\n useEventListener(target, [\"pointerdown\", \"pointermove\", \"pointerup\"], handler, listenerOptions);\n useEventListener(target, \"pointerleave\", () => isInside.value = false, listenerOptions);\n }\n return {\n ...toRefs(state),\n isInside\n };\n}\n\nfunction usePointerLock(target, options = {}) {\n const { document = defaultDocument } = options;\n const isSupported = useSupported(() => document && \"pointerLockElement\" in document);\n const element = ref();\n const triggerElement = ref();\n let targetElement;\n if (isSupported.value) {\n useEventListener(document, \"pointerlockchange\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n element.value = document.pointerLockElement;\n if (!element.value)\n targetElement = triggerElement.value = null;\n }\n });\n useEventListener(document, \"pointerlockerror\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n const action = document.pointerLockElement ? \"release\" : \"acquire\";\n throw new Error(`Failed to ${action} pointer lock.`);\n }\n });\n }\n async function lock(e) {\n var _a;\n if (!isSupported.value)\n throw new Error(\"Pointer Lock API is not supported by your browser.\");\n triggerElement.value = e instanceof Event ? e.currentTarget : null;\n targetElement = e instanceof Event ? (_a = unrefElement(target)) != null ? _a : triggerElement.value : unrefElement(e);\n if (!targetElement)\n throw new Error(\"Target element undefined.\");\n targetElement.requestPointerLock();\n return await until(element).toBe(targetElement);\n }\n async function unlock() {\n if (!element.value)\n return false;\n document.exitPointerLock();\n await until(element).toBeNull();\n return true;\n }\n return {\n isSupported,\n element,\n triggerElement,\n lock,\n unlock\n };\n}\n\nfunction usePointerSwipe(target, options = {}) {\n const targetRef = toRef(target);\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart,\n disableTextSelect = false\n } = options;\n const posStart = reactive({ x: 0, y: 0 });\n const updatePosStart = (x, y) => {\n posStart.x = x;\n posStart.y = y;\n };\n const posEnd = reactive({ x: 0, y: 0 });\n const updatePosEnd = (x, y) => {\n posEnd.x = x;\n posEnd.y = y;\n };\n const distanceX = computed(() => posStart.x - posEnd.x);\n const distanceY = computed(() => posStart.y - posEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n const isSwiping = ref(false);\n const isPointerDown = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return \"none\";\n if (abs(distanceX.value) > abs(distanceY.value)) {\n return distanceX.value > 0 ? \"left\" : \"right\";\n } else {\n return distanceY.value > 0 ? \"up\" : \"down\";\n }\n });\n const eventIsAllowed = (e) => {\n var _a, _b, _c;\n const isReleasingButton = e.buttons === 0;\n const isPrimaryButton = e.buttons === 1;\n return (_c = (_b = (_a = options.pointerTypes) == null ? void 0 : _a.includes(e.pointerType)) != null ? _b : isReleasingButton || isPrimaryButton) != null ? _c : true;\n };\n const stops = [\n useEventListener(target, \"pointerdown\", (e) => {\n if (!eventIsAllowed(e))\n return;\n isPointerDown.value = true;\n const eventTarget = e.target;\n eventTarget == null ? void 0 : eventTarget.setPointerCapture(e.pointerId);\n const { clientX: x, clientY: y } = e;\n updatePosStart(x, y);\n updatePosEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }),\n useEventListener(target, \"pointermove\", (e) => {\n if (!eventIsAllowed(e))\n return;\n if (!isPointerDown.value)\n return;\n const { clientX: x, clientY: y } = e;\n updatePosEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }),\n useEventListener(target, \"pointerup\", (e) => {\n if (!eventIsAllowed(e))\n return;\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isPointerDown.value = false;\n isSwiping.value = false;\n })\n ];\n tryOnMounted(() => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n (_b = (_a = targetRef.value) == null ? void 0 : _a.style) == null ? void 0 : _b.setProperty(\"touch-action\", \"none\");\n if (disableTextSelect) {\n (_d = (_c = targetRef.value) == null ? void 0 : _c.style) == null ? void 0 : _d.setProperty(\"-webkit-user-select\", \"none\");\n (_f = (_e = targetRef.value) == null ? void 0 : _e.style) == null ? void 0 : _f.setProperty(\"-ms-user-select\", \"none\");\n (_h = (_g = targetRef.value) == null ? void 0 : _g.style) == null ? void 0 : _h.setProperty(\"user-select\", \"none\");\n }\n });\n const stop = () => stops.forEach((s) => s());\n return {\n isSwiping: readonly(isSwiping),\n direction: readonly(direction),\n posStart: readonly(posStart),\n posEnd: readonly(posEnd),\n distanceX,\n distanceY,\n stop\n };\n}\n\nfunction usePreferredColorScheme(options) {\n const isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n const isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n return computed(() => {\n if (isDark.value)\n return \"dark\";\n if (isLight.value)\n return \"light\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredContrast(options) {\n const isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n const isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n const isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n return computed(() => {\n if (isMore.value)\n return \"more\";\n if (isLess.value)\n return \"less\";\n if (isCustom.value)\n return \"custom\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredLanguages(options = {}) {\n const { window = defaultWindow } = options;\n if (!window)\n return ref([\"en\"]);\n const navigator = window.navigator;\n const value = ref(navigator.languages);\n useEventListener(window, \"languagechange\", () => {\n value.value = navigator.languages;\n });\n return value;\n}\n\nfunction usePreferredReducedMotion(options) {\n const isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n return computed(() => {\n if (isReduced.value)\n return \"reduce\";\n return \"no-preference\";\n });\n}\n\nfunction usePrevious(value, initialValue) {\n const previous = shallowRef(initialValue);\n watch(\n toRef(value),\n (_, oldValue) => {\n previous.value = oldValue;\n },\n { flush: \"sync\" }\n );\n return readonly(previous);\n}\n\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\nfunction useScreenSafeArea() {\n const top = ref(\"\");\n const right = ref(\"\");\n const bottom = ref(\"\");\n const left = ref(\"\");\n if (isClient) {\n const topCssVar = useCssVar(topVarName);\n const rightCssVar = useCssVar(rightVarName);\n const bottomCssVar = useCssVar(bottomVarName);\n const leftCssVar = useCssVar(leftVarName);\n topCssVar.value = \"env(safe-area-inset-top, 0px)\";\n rightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n bottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n leftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n update();\n useEventListener(\"resize\", useDebounceFn(update));\n }\n function update() {\n top.value = getValue(topVarName);\n right.value = getValue(rightVarName);\n bottom.value = getValue(bottomVarName);\n left.value = getValue(leftVarName);\n }\n return {\n top,\n right,\n bottom,\n left,\n update\n };\n}\nfunction getValue(position) {\n return getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n const {\n immediate = true,\n manual = false,\n type = \"text/javascript\",\n async = true,\n crossOrigin,\n referrerPolicy,\n noModule,\n defer,\n document = defaultDocument,\n attrs = {}\n } = options;\n const scriptTag = ref(null);\n let _promise = null;\n const loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n const resolveWithElement = (el2) => {\n scriptTag.value = el2;\n resolve(el2);\n return el2;\n };\n if (!document) {\n resolve(false);\n return;\n }\n let shouldAppend = false;\n let el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n if (!el) {\n el = document.createElement(\"script\");\n el.type = type;\n el.async = async;\n el.src = toValue(src);\n if (defer)\n el.defer = defer;\n if (crossOrigin)\n el.crossOrigin = crossOrigin;\n if (noModule)\n el.noModule = noModule;\n if (referrerPolicy)\n el.referrerPolicy = referrerPolicy;\n Object.entries(attrs).forEach(([name, value]) => el == null ? void 0 : el.setAttribute(name, value));\n shouldAppend = true;\n } else if (el.hasAttribute(\"data-loaded\")) {\n resolveWithElement(el);\n }\n el.addEventListener(\"error\", (event) => reject(event));\n el.addEventListener(\"abort\", (event) => reject(event));\n el.addEventListener(\"load\", () => {\n el.setAttribute(\"data-loaded\", \"true\");\n onLoaded(el);\n resolveWithElement(el);\n });\n if (shouldAppend)\n el = document.head.appendChild(el);\n if (!waitForScriptLoad)\n resolveWithElement(el);\n });\n const load = (waitForScriptLoad = true) => {\n if (!_promise)\n _promise = loadScript(waitForScriptLoad);\n return _promise;\n };\n const unload = () => {\n if (!document)\n return;\n _promise = null;\n if (scriptTag.value)\n scriptTag.value = null;\n const el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n if (el)\n document.head.removeChild(el);\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnUnmounted(unload);\n return { scriptTag, load, unload };\n}\n\nfunction checkOverflowScroll(ele) {\n const style = window.getComputedStyle(ele);\n if (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) {\n return true;\n } else {\n const parent = ele.parentNode;\n if (!parent || parent.tagName === \"BODY\")\n return false;\n return checkOverflowScroll(parent);\n }\n}\nfunction preventDefault(rawEvent) {\n const e = rawEvent || window.event;\n const _target = e.target;\n if (checkOverflowScroll(_target))\n return false;\n if (e.touches.length > 1)\n return true;\n if (e.preventDefault)\n e.preventDefault();\n return false;\n}\nconst elInitialOverflow = /* @__PURE__ */ new WeakMap();\nfunction useScrollLock(element, initialState = false) {\n const isLocked = ref(initialState);\n let stopTouchMoveListener = null;\n watch(toRef(element), (el) => {\n const target = resolveElement(toValue(el));\n if (target) {\n const ele = target;\n if (!elInitialOverflow.get(ele))\n elInitialOverflow.set(ele, ele.style.overflow);\n if (isLocked.value)\n ele.style.overflow = \"hidden\";\n }\n }, {\n immediate: true\n });\n const lock = () => {\n const el = resolveElement(toValue(element));\n if (!el || isLocked.value)\n return;\n if (isIOS) {\n stopTouchMoveListener = useEventListener(\n el,\n \"touchmove\",\n (e) => {\n preventDefault(e);\n },\n { passive: false }\n );\n }\n el.style.overflow = \"hidden\";\n isLocked.value = true;\n };\n const unlock = () => {\n var _a;\n const el = resolveElement(toValue(element));\n if (!el || !isLocked.value)\n return;\n isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());\n el.style.overflow = (_a = elInitialOverflow.get(el)) != null ? _a : \"\";\n elInitialOverflow.delete(el);\n isLocked.value = false;\n };\n tryOnScopeDispose(unlock);\n return computed({\n get() {\n return isLocked.value;\n },\n set(v) {\n if (v)\n lock();\n else\n unlock();\n }\n });\n}\n\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.sessionStorage, options);\n}\n\nfunction useShare(shareOptions = {}, options = {}) {\n const { navigator = defaultNavigator } = options;\n const _navigator = navigator;\n const isSupported = useSupported(() => _navigator && \"canShare\" in _navigator);\n const share = async (overrideOptions = {}) => {\n if (isSupported.value) {\n const data = {\n ...toValue(shareOptions),\n ...toValue(overrideOptions)\n };\n let granted = true;\n if (data.files && _navigator.canShare)\n granted = _navigator.canShare({ files: data.files });\n if (granted)\n return _navigator.share(data);\n }\n };\n return {\n isSupported,\n share\n };\n}\n\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n var _a, _b, _c, _d;\n const [source] = args;\n let compareFn = defaultCompare;\n let options = {};\n if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n options = args[1];\n compareFn = (_a = options.compareFn) != null ? _a : defaultCompare;\n } else {\n compareFn = (_b = args[1]) != null ? _b : defaultCompare;\n }\n } else if (args.length > 2) {\n compareFn = (_c = args[1]) != null ? _c : defaultCompare;\n options = (_d = args[2]) != null ? _d : {};\n }\n const {\n dirty = false,\n sortFn = defaultSortFn\n } = options;\n if (!dirty)\n return computed(() => sortFn([...toValue(source)], compareFn));\n watchEffect(() => {\n const result = sortFn(toValue(source), compareFn);\n if (isRef(source))\n source.value = result;\n else\n source.splice(0, source.length, ...result);\n });\n return source;\n}\n\nfunction useSpeechRecognition(options = {}) {\n const {\n interimResults = true,\n continuous = true,\n window = defaultWindow\n } = options;\n const lang = toRef(options.lang || \"en-US\");\n const isListening = ref(false);\n const isFinal = ref(false);\n const result = ref(\"\");\n const error = shallowRef(void 0);\n const toggle = (value = !isListening.value) => {\n isListening.value = value;\n };\n const start = () => {\n isListening.value = true;\n };\n const stop = () => {\n isListening.value = false;\n };\n const SpeechRecognition = window && (window.SpeechRecognition || window.webkitSpeechRecognition);\n const isSupported = useSupported(() => SpeechRecognition);\n let recognition;\n if (isSupported.value) {\n recognition = new SpeechRecognition();\n recognition.continuous = continuous;\n recognition.interimResults = interimResults;\n recognition.lang = toValue(lang);\n recognition.onstart = () => {\n isFinal.value = false;\n };\n watch(lang, (lang2) => {\n if (recognition && !isListening.value)\n recognition.lang = lang2;\n });\n recognition.onresult = (event) => {\n const transcript = Array.from(event.results).map((result2) => {\n isFinal.value = result2.isFinal;\n return result2[0];\n }).map((result2) => result2.transcript).join(\"\");\n result.value = transcript;\n error.value = void 0;\n };\n recognition.onerror = (event) => {\n error.value = event;\n };\n recognition.onend = () => {\n isListening.value = false;\n recognition.lang = toValue(lang);\n };\n watch(isListening, () => {\n if (isListening.value)\n recognition.start();\n else\n recognition.stop();\n });\n }\n tryOnScopeDispose(() => {\n isListening.value = false;\n });\n return {\n isSupported,\n isListening,\n isFinal,\n recognition,\n result,\n error,\n toggle,\n start,\n stop\n };\n}\n\nfunction useSpeechSynthesis(text, options = {}) {\n const {\n pitch = 1,\n rate = 1,\n volume = 1,\n window = defaultWindow\n } = options;\n const synth = window && window.speechSynthesis;\n const isSupported = useSupported(() => synth);\n const isPlaying = ref(false);\n const status = ref(\"init\");\n const spokenText = toRef(text || \"\");\n const lang = toRef(options.lang || \"en-US\");\n const error = shallowRef(void 0);\n const toggle = (value = !isPlaying.value) => {\n isPlaying.value = value;\n };\n const bindEventsForUtterance = (utterance2) => {\n utterance2.lang = toValue(lang);\n utterance2.voice = toValue(options.voice) || null;\n utterance2.pitch = toValue(pitch);\n utterance2.rate = toValue(rate);\n utterance2.volume = volume;\n utterance2.onstart = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onpause = () => {\n isPlaying.value = false;\n status.value = \"pause\";\n };\n utterance2.onresume = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onend = () => {\n isPlaying.value = false;\n status.value = \"end\";\n };\n utterance2.onerror = (event) => {\n error.value = event;\n };\n };\n const utterance = computed(() => {\n isPlaying.value = false;\n status.value = \"init\";\n const newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n bindEventsForUtterance(newUtterance);\n return newUtterance;\n });\n const speak = () => {\n synth.cancel();\n utterance && synth.speak(utterance.value);\n };\n const stop = () => {\n synth.cancel();\n isPlaying.value = false;\n };\n if (isSupported.value) {\n bindEventsForUtterance(utterance.value);\n watch(lang, (lang2) => {\n if (utterance.value && !isPlaying.value)\n utterance.value.lang = lang2;\n });\n if (options.voice) {\n watch(options.voice, () => {\n synth.cancel();\n });\n }\n watch(isPlaying, () => {\n if (isPlaying.value)\n synth.resume();\n else\n synth.pause();\n });\n }\n tryOnScopeDispose(() => {\n isPlaying.value = false;\n });\n return {\n isSupported,\n isPlaying,\n status,\n utterance,\n error,\n stop,\n toggle,\n speak\n };\n}\n\nfunction useStepper(steps, initialStep) {\n const stepsRef = ref(steps);\n const stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n const index = ref(stepNames.value.indexOf(initialStep != null ? initialStep : stepNames.value[0]));\n const current = computed(() => at(index.value));\n const isFirst = computed(() => index.value === 0);\n const isLast = computed(() => index.value === stepNames.value.length - 1);\n const next = computed(() => stepNames.value[index.value + 1]);\n const previous = computed(() => stepNames.value[index.value - 1]);\n function at(index2) {\n if (Array.isArray(stepsRef.value))\n return stepsRef.value[index2];\n return stepsRef.value[stepNames.value[index2]];\n }\n function get(step) {\n if (!stepNames.value.includes(step))\n return;\n return at(stepNames.value.indexOf(step));\n }\n function goTo(step) {\n if (stepNames.value.includes(step))\n index.value = stepNames.value.indexOf(step);\n }\n function goToNext() {\n if (isLast.value)\n return;\n index.value++;\n }\n function goToPrevious() {\n if (isFirst.value)\n return;\n index.value--;\n }\n function goBackTo(step) {\n if (isAfter(step))\n goTo(step);\n }\n function isNext(step) {\n return stepNames.value.indexOf(step) === index.value + 1;\n }\n function isPrevious(step) {\n return stepNames.value.indexOf(step) === index.value - 1;\n }\n function isCurrent(step) {\n return stepNames.value.indexOf(step) === index.value;\n }\n function isBefore(step) {\n return index.value < stepNames.value.indexOf(step);\n }\n function isAfter(step) {\n return index.value > stepNames.value.indexOf(step);\n }\n return {\n steps: stepsRef,\n stepNames,\n index,\n current,\n next,\n previous,\n isFirst,\n isLast,\n at,\n get,\n goTo,\n goToNext,\n goToPrevious,\n goBackTo,\n isNext,\n isPrevious,\n isCurrent,\n isBefore,\n isAfter\n };\n}\n\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const rawInit = toValue(initialValue);\n const type = guessSerializerType(rawInit);\n const data = (shallow ? shallowRef : ref)(initialValue);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorageAsync\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n async function read(event) {\n if (!storage || event && event.key !== key)\n return;\n try {\n const rawValue = event ? event.newValue : await storage.getItem(key);\n if (rawValue == null) {\n data.value = rawInit;\n if (writeDefaults && rawInit !== null)\n await storage.setItem(key, await serializer.write(rawInit));\n } else if (mergeDefaults) {\n const value = await serializer.read(rawValue);\n if (typeof mergeDefaults === \"function\")\n data.value = mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n data.value = { ...rawInit, ...value };\n else\n data.value = value;\n } else {\n data.value = await serializer.read(rawValue);\n }\n } catch (e) {\n onError(e);\n }\n }\n read();\n if (window && listenToStorageChanges)\n useEventListener(window, \"storage\", (e) => Promise.resolve().then(() => read(e)));\n if (storage) {\n watchWithFilter(\n data,\n async () => {\n try {\n if (data.value == null)\n await storage.removeItem(key);\n else\n await storage.setItem(key, await serializer.write(data.value));\n } catch (e) {\n onError(e);\n }\n },\n {\n flush,\n deep,\n eventFilter\n }\n );\n }\n return data;\n}\n\nlet _id = 0;\nfunction useStyleTag(css, options = {}) {\n const isLoaded = ref(false);\n const {\n document = defaultDocument,\n immediate = true,\n manual = false,\n id = `vueuse_styletag_${++_id}`\n } = options;\n const cssRef = ref(css);\n let stop = () => {\n };\n const load = () => {\n if (!document)\n return;\n const el = document.getElementById(id) || document.createElement(\"style\");\n if (!el.isConnected) {\n el.id = id;\n if (options.media)\n el.media = options.media;\n document.head.appendChild(el);\n }\n if (isLoaded.value)\n return;\n stop = watch(\n cssRef,\n (value) => {\n el.textContent = value;\n },\n { immediate: true }\n );\n isLoaded.value = true;\n };\n const unload = () => {\n if (!document || !isLoaded.value)\n return;\n stop();\n document.head.removeChild(document.getElementById(id));\n isLoaded.value = false;\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnScopeDispose(unload);\n return {\n id,\n css: cssRef,\n unload,\n load,\n isLoaded: readonly(isLoaded)\n };\n}\n\nfunction useSwipe(target, options = {}) {\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart,\n passive = true,\n window = defaultWindow\n } = options;\n const coordsStart = reactive({ x: 0, y: 0 });\n const coordsEnd = reactive({ x: 0, y: 0 });\n const diffX = computed(() => coordsStart.x - coordsEnd.x);\n const diffY = computed(() => coordsStart.y - coordsEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n const isSwiping = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return \"none\";\n if (abs(diffX.value) > abs(diffY.value)) {\n return diffX.value > 0 ? \"left\" : \"right\";\n } else {\n return diffY.value > 0 ? \"up\" : \"down\";\n }\n });\n const getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n const updateCoordsStart = (x, y) => {\n coordsStart.x = x;\n coordsStart.y = y;\n };\n const updateCoordsEnd = (x, y) => {\n coordsEnd.x = x;\n coordsEnd.y = y;\n };\n let listenerOptions;\n const isPassiveEventSupported = checkPassiveEventSupport(window == null ? void 0 : window.document);\n if (!passive)\n listenerOptions = isPassiveEventSupported ? { passive: false, capture: true } : { capture: true };\n else\n listenerOptions = isPassiveEventSupported ? { passive: true } : { capture: false };\n const onTouchEnd = (e) => {\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isSwiping.value = false;\n };\n const stops = [\n useEventListener(target, \"touchstart\", (e) => {\n if (e.touches.length !== 1)\n return;\n if (listenerOptions.capture && !listenerOptions.passive)\n e.preventDefault();\n const [x, y] = getTouchEventCoords(e);\n updateCoordsStart(x, y);\n updateCoordsEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }, listenerOptions),\n useEventListener(target, \"touchmove\", (e) => {\n if (e.touches.length !== 1)\n return;\n const [x, y] = getTouchEventCoords(e);\n updateCoordsEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }, listenerOptions),\n useEventListener(target, [\"touchend\", \"touchcancel\"], onTouchEnd, listenerOptions)\n ];\n const stop = () => stops.forEach((s) => s());\n return {\n isPassiveEventSupported,\n isSwiping,\n direction,\n coordsStart,\n coordsEnd,\n lengthX: diffX,\n lengthY: diffY,\n stop\n };\n}\nfunction checkPassiveEventSupport(document) {\n if (!document)\n return false;\n let supportsPassive = false;\n const optionsBlock = {\n get passive() {\n supportsPassive = true;\n return false;\n }\n };\n document.addEventListener(\"x\", noop, optionsBlock);\n document.removeEventListener(\"x\", noop);\n return supportsPassive;\n}\n\nfunction useTemplateRefsList() {\n const refs = ref([]);\n refs.value.set = (el) => {\n if (el)\n refs.value.push(el);\n };\n onBeforeUpdate(() => {\n refs.value.length = 0;\n });\n return refs;\n}\n\nfunction useTextDirection(options = {}) {\n const {\n document = defaultDocument,\n selector = \"html\",\n observe = false,\n initialValue = \"ltr\"\n } = options;\n function getValue() {\n var _a, _b;\n return (_b = (_a = document == null ? void 0 : document.querySelector(selector)) == null ? void 0 : _a.getAttribute(\"dir\")) != null ? _b : initialValue;\n }\n const dir = ref(getValue());\n tryOnMounted(() => dir.value = getValue());\n if (observe && document) {\n useMutationObserver(\n document.querySelector(selector),\n () => dir.value = getValue(),\n { attributes: true }\n );\n }\n return computed({\n get() {\n return dir.value;\n },\n set(v) {\n var _a, _b;\n dir.value = v;\n if (!document)\n return;\n if (dir.value)\n (_a = document.querySelector(selector)) == null ? void 0 : _a.setAttribute(\"dir\", dir.value);\n else\n (_b = document.querySelector(selector)) == null ? void 0 : _b.removeAttribute(\"dir\");\n }\n });\n}\n\nfunction getRangesFromSelection(selection) {\n var _a;\n const rangeCount = (_a = selection.rangeCount) != null ? _a : 0;\n return Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n}\nfunction useTextSelection(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const selection = ref(null);\n const text = computed(() => {\n var _a, _b;\n return (_b = (_a = selection.value) == null ? void 0 : _a.toString()) != null ? _b : \"\";\n });\n const ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n const rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n function onSelectionChange() {\n selection.value = null;\n if (window)\n selection.value = window.getSelection();\n }\n if (window)\n useEventListener(window.document, \"selectionchange\", onSelectionChange);\n return {\n text,\n rects,\n ranges,\n selection\n };\n}\n\nfunction useTextareaAutosize(options) {\n var _a;\n const textarea = ref(options == null ? void 0 : options.element);\n const input = ref(options == null ? void 0 : options.input);\n const styleProp = (_a = options == null ? void 0 : options.styleProp) != null ? _a : \"height\";\n const textareaScrollHeight = ref(1);\n function triggerResize() {\n var _a2, _b;\n if (!textarea.value)\n return;\n let height = \"\";\n textarea.value.style[styleProp] = \"1px\";\n textareaScrollHeight.value = (_a2 = textarea.value) == null ? void 0 : _a2.scrollHeight;\n if (options == null ? void 0 : options.styleTarget)\n toValue(options.styleTarget).style[styleProp] = `${textareaScrollHeight.value}px`;\n else\n height = `${textareaScrollHeight.value}px`;\n textarea.value.style[styleProp] = height;\n (_b = options == null ? void 0 : options.onResize) == null ? void 0 : _b.call(options);\n }\n watch([input, textarea], () => nextTick(triggerResize), { immediate: true });\n useResizeObserver(textarea, () => triggerResize());\n if (options == null ? void 0 : options.watch)\n watch(options.watch, triggerResize, { immediate: true, deep: true });\n return {\n textarea,\n input,\n triggerResize\n };\n}\n\nfunction useThrottledRefHistory(source, options = {}) {\n const { throttle = 200, trailing = true } = options;\n const filter = throttleFilter(throttle, trailing);\n const history = useRefHistory(source, { ...options, eventFilter: filter });\n return {\n ...history\n };\n}\n\nconst DEFAULT_UNITS = [\n { max: 6e4, value: 1e3, name: \"second\" },\n { max: 276e4, value: 6e4, name: \"minute\" },\n { max: 72e6, value: 36e5, name: \"hour\" },\n { max: 5184e5, value: 864e5, name: \"day\" },\n { max: 24192e5, value: 6048e5, name: \"week\" },\n { max: 28512e6, value: 2592e6, name: \"month\" },\n { max: Number.POSITIVE_INFINITY, value: 31536e6, name: \"year\" }\n];\nconst DEFAULT_MESSAGES = {\n justNow: \"just now\",\n past: (n) => n.match(/\\d/) ? `${n} ago` : n,\n future: (n) => n.match(/\\d/) ? `in ${n}` : n,\n month: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n year: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n day: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n week: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n hour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n minute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n second: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n invalid: \"\"\n};\nfunction DEFAULT_FORMATTER(date) {\n return date.toISOString().slice(0, 10);\n}\nfunction useTimeAgo(time, options = {}) {\n const {\n controls: exposeControls = false,\n updateInterval = 3e4\n } = options;\n const { now, ...controls } = useNow({ interval: updateInterval, controls: true });\n const timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options, toValue(now)));\n if (exposeControls) {\n return {\n timeAgo,\n ...controls\n };\n } else {\n return timeAgo;\n }\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n var _a;\n const {\n max,\n messages = DEFAULT_MESSAGES,\n fullDateFormatter = DEFAULT_FORMATTER,\n units = DEFAULT_UNITS,\n showSecond = false,\n rounding = \"round\"\n } = options;\n const roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n const diff = +now - +from;\n const absDiff = Math.abs(diff);\n function getValue(diff2, unit) {\n return roundFn(Math.abs(diff2) / unit.value);\n }\n function format(diff2, unit) {\n const val = getValue(diff2, unit);\n const past = diff2 > 0;\n const str = applyFormat(unit.name, val, past);\n return applyFormat(past ? \"past\" : \"future\", str, past);\n }\n function applyFormat(name, val, isPast) {\n const formatter = messages[name];\n if (typeof formatter === \"function\")\n return formatter(val, isPast);\n return formatter.replace(\"{0}\", val.toString());\n }\n if (absDiff < 6e4 && !showSecond)\n return messages.justNow;\n if (typeof max === \"number\" && absDiff > max)\n return fullDateFormatter(new Date(from));\n if (typeof max === \"string\") {\n const unitMax = (_a = units.find((i) => i.name === max)) == null ? void 0 : _a.max;\n if (unitMax && absDiff > unitMax)\n return fullDateFormatter(new Date(from));\n }\n for (const [idx, unit] of units.entries()) {\n const val = getValue(diff, unit);\n if (val <= 0 && units[idx - 1])\n return format(diff, units[idx - 1]);\n if (absDiff < unit.max)\n return format(diff, unit);\n }\n return messages.invalid;\n}\n\nfunction useTimeoutPoll(fn, interval, timeoutPollOptions) {\n const { start } = useTimeoutFn(loop, interval, { immediate: false });\n const isActive = ref(false);\n async function loop() {\n if (!isActive.value)\n return;\n await fn();\n start();\n }\n function resume() {\n if (!isActive.value) {\n isActive.value = true;\n loop();\n }\n }\n function pause() {\n isActive.value = false;\n }\n if (timeoutPollOptions == null ? void 0 : timeoutPollOptions.immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive,\n pause,\n resume\n };\n}\n\nfunction useTimestamp(options = {}) {\n const {\n controls: exposeControls = false,\n offset = 0,\n immediate = true,\n interval = \"requestAnimationFrame\",\n callback\n } = options;\n const ts = ref(timestamp() + offset);\n const update = () => ts.value = timestamp() + offset;\n const cb = callback ? () => {\n update();\n callback(ts.value);\n } : update;\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });\n if (exposeControls) {\n return {\n timestamp: ts,\n ...controls\n };\n } else {\n return ts;\n }\n}\n\nfunction useTitle(newTitle = null, options = {}) {\n var _a, _b, _c;\n const {\n document = defaultDocument,\n restoreOnUnmount = (t) => t\n } = options;\n const originalTitle = (_a = document == null ? void 0 : document.title) != null ? _a : \"\";\n const title = toRef((_b = newTitle != null ? newTitle : document == null ? void 0 : document.title) != null ? _b : null);\n const isReadonly = newTitle && typeof newTitle === \"function\";\n function format(t) {\n if (!(\"titleTemplate\" in options))\n return t;\n const template = options.titleTemplate || \"%s\";\n return typeof template === \"function\" ? template(t) : toValue(template).replace(/%s/g, t);\n }\n watch(\n title,\n (t, o) => {\n if (t !== o && document)\n document.title = format(typeof t === \"string\" ? t : \"\");\n },\n { immediate: true }\n );\n if (options.observe && !options.titleTemplate && document && !isReadonly) {\n useMutationObserver(\n (_c = document.head) == null ? void 0 : _c.querySelector(\"title\"),\n () => {\n if (document && document.title !== title.value)\n title.value = format(document.title);\n },\n { childList: true }\n );\n }\n tryOnBeforeUnmount(() => {\n if (restoreOnUnmount) {\n const restoredTitle = restoreOnUnmount(originalTitle, title.value || \"\");\n if (restoredTitle != null && document)\n document.title = restoredTitle;\n }\n });\n return title;\n}\n\nconst _TransitionPresets = {\n easeInSine: [0.12, 0, 0.39, 0],\n easeOutSine: [0.61, 1, 0.88, 1],\n easeInOutSine: [0.37, 0, 0.63, 1],\n easeInQuad: [0.11, 0, 0.5, 0],\n easeOutQuad: [0.5, 1, 0.89, 1],\n easeInOutQuad: [0.45, 0, 0.55, 1],\n easeInCubic: [0.32, 0, 0.67, 0],\n easeOutCubic: [0.33, 1, 0.68, 1],\n easeInOutCubic: [0.65, 0, 0.35, 1],\n easeInQuart: [0.5, 0, 0.75, 0],\n easeOutQuart: [0.25, 1, 0.5, 1],\n easeInOutQuart: [0.76, 0, 0.24, 1],\n easeInQuint: [0.64, 0, 0.78, 0],\n easeOutQuint: [0.22, 1, 0.36, 1],\n easeInOutQuint: [0.83, 0, 0.17, 1],\n easeInExpo: [0.7, 0, 0.84, 0],\n easeOutExpo: [0.16, 1, 0.3, 1],\n easeInOutExpo: [0.87, 0, 0.13, 1],\n easeInCirc: [0.55, 0, 1, 0.45],\n easeOutCirc: [0, 0.55, 0.45, 1],\n easeInOutCirc: [0.85, 0, 0.15, 1],\n easeInBack: [0.36, 0, 0.66, -0.56],\n easeOutBack: [0.34, 1.56, 0.64, 1],\n easeInOutBack: [0.68, -0.6, 0.32, 1.6]\n};\nconst TransitionPresets = /* @__PURE__ */ Object.assign({}, { linear: identity }, _TransitionPresets);\nfunction createEasingFunction([p0, p1, p2, p3]) {\n const a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n const b = (a1, a2) => 3 * a2 - 6 * a1;\n const c = (a1) => 3 * a1;\n const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n const getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n const getTforX = (x) => {\n let aGuessT = x;\n for (let i = 0; i < 4; ++i) {\n const currentSlope = getSlope(aGuessT, p0, p2);\n if (currentSlope === 0)\n return aGuessT;\n const currentX = calcBezier(aGuessT, p0, p2) - x;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n };\n return (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction lerp(a, b, alpha) {\n return a + alpha * (b - a);\n}\nfunction toVec(t) {\n return (typeof t === \"number\" ? [t] : t) || [];\n}\nfunction executeTransition(source, from, to, options = {}) {\n var _a, _b;\n const fromVal = toValue(from);\n const toVal = toValue(to);\n const v1 = toVec(fromVal);\n const v2 = toVec(toVal);\n const duration = (_a = toValue(options.duration)) != null ? _a : 1e3;\n const startedAt = Date.now();\n const endAt = Date.now() + duration;\n const trans = typeof options.transition === \"function\" ? options.transition : (_b = toValue(options.transition)) != null ? _b : identity;\n const ease = typeof trans === \"function\" ? trans : createEasingFunction(trans);\n return new Promise((resolve) => {\n source.value = fromVal;\n const tick = () => {\n var _a2;\n if ((_a2 = options.abort) == null ? void 0 : _a2.call(options)) {\n resolve();\n return;\n }\n const now = Date.now();\n const alpha = ease((now - startedAt) / duration);\n const arr = toVec(source.value).map((n, i) => lerp(v1[i], v2[i], alpha));\n if (Array.isArray(source.value))\n source.value = arr.map((n, i) => {\n var _a3, _b2;\n return lerp((_a3 = v1[i]) != null ? _a3 : 0, (_b2 = v2[i]) != null ? _b2 : 0, alpha);\n });\n else if (typeof source.value === \"number\")\n source.value = arr[0];\n if (now < endAt) {\n requestAnimationFrame(tick);\n } else {\n source.value = toVal;\n resolve();\n }\n };\n tick();\n });\n}\nfunction useTransition(source, options = {}) {\n let currentId = 0;\n const sourceVal = () => {\n const v = toValue(source);\n return typeof v === \"number\" ? v : v.map(toValue);\n };\n const outputRef = ref(sourceVal());\n watch(sourceVal, async (to) => {\n var _a, _b;\n if (toValue(options.disabled))\n return;\n const id = ++currentId;\n if (options.delay)\n await promiseTimeout(toValue(options.delay));\n if (id !== currentId)\n return;\n const toVal = Array.isArray(to) ? to.map(toValue) : toValue(to);\n (_a = options.onStarted) == null ? void 0 : _a.call(options);\n await executeTransition(outputRef, outputRef.value, toVal, {\n ...options,\n abort: () => {\n var _a2;\n return id !== currentId || ((_a2 = options.abort) == null ? void 0 : _a2.call(options));\n }\n });\n (_b = options.onFinished) == null ? void 0 : _b.call(options);\n }, { deep: true });\n watch(() => toValue(options.disabled), (disabled) => {\n if (disabled) {\n currentId++;\n outputRef.value = sourceVal();\n }\n });\n tryOnScopeDispose(() => {\n currentId++;\n });\n return computed(() => toValue(options.disabled) ? sourceVal() : outputRef.value);\n}\n\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n const {\n initialValue = {},\n removeNullishValues = true,\n removeFalsyValues = false,\n write: enableWrite = true,\n window = defaultWindow\n } = options;\n if (!window)\n return reactive(initialValue);\n const state = reactive({});\n function getRawParams() {\n if (mode === \"history\") {\n return window.location.search || \"\";\n } else if (mode === \"hash\") {\n const hash = window.location.hash || \"\";\n const index = hash.indexOf(\"?\");\n return index > 0 ? hash.slice(index) : \"\";\n } else {\n return (window.location.hash || \"\").replace(/^#/, \"\");\n }\n }\n function constructQuery(params) {\n const stringified = params.toString();\n if (mode === \"history\")\n return `${stringified ? `?${stringified}` : \"\"}${window.location.hash || \"\"}`;\n if (mode === \"hash-params\")\n return `${window.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n const hash = window.location.hash || \"#\";\n const index = hash.indexOf(\"?\");\n if (index > 0)\n return `${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n return `${hash}${stringified ? `?${stringified}` : \"\"}`;\n }\n function read() {\n return new URLSearchParams(getRawParams());\n }\n function updateState(params) {\n const unusedKeys = new Set(Object.keys(state));\n for (const key of params.keys()) {\n const paramsForKey = params.getAll(key);\n state[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n unusedKeys.delete(key);\n }\n Array.from(unusedKeys).forEach((key) => delete state[key]);\n }\n const { pause, resume } = pausableWatch(\n state,\n () => {\n const params = new URLSearchParams(\"\");\n Object.keys(state).forEach((key) => {\n const mapEntry = state[key];\n if (Array.isArray(mapEntry))\n mapEntry.forEach((value) => params.append(key, value));\n else if (removeNullishValues && mapEntry == null)\n params.delete(key);\n else if (removeFalsyValues && !mapEntry)\n params.delete(key);\n else\n params.set(key, mapEntry);\n });\n write(params);\n },\n { deep: true }\n );\n function write(params, shouldUpdate) {\n pause();\n if (shouldUpdate)\n updateState(params);\n window.history.replaceState(\n window.history.state,\n window.document.title,\n window.location.pathname + constructQuery(params)\n );\n resume();\n }\n function onChanged() {\n if (!enableWrite)\n return;\n write(read(), true);\n }\n useEventListener(window, \"popstate\", onChanged, false);\n if (mode !== \"history\")\n useEventListener(window, \"hashchange\", onChanged, false);\n const initial = read();\n if (initial.keys().next().value)\n updateState(initial);\n else\n Object.assign(state, initialValue);\n return state;\n}\n\nfunction useUserMedia(options = {}) {\n var _a, _b;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const autoSwitch = ref((_b = options.autoSwitch) != null ? _b : true);\n const constraints = ref(options.constraints);\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getUserMedia;\n });\n const stream = shallowRef();\n function getDeviceOptions(type) {\n switch (type) {\n case \"video\": {\n if (constraints.value)\n return constraints.value.video || false;\n break;\n }\n case \"audio\": {\n if (constraints.value)\n return constraints.value.audio || false;\n break;\n }\n }\n }\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getUserMedia({\n video: getDeviceOptions(\"video\"),\n audio: getDeviceOptions(\"audio\")\n });\n return stream.value;\n }\n function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n async function restart() {\n _stop();\n return await start();\n }\n watch(\n enabled,\n (v) => {\n if (v)\n _start();\n else\n _stop();\n },\n { immediate: true }\n );\n watch(\n constraints,\n () => {\n if (autoSwitch.value && stream.value)\n restart();\n },\n { immediate: true }\n );\n tryOnScopeDispose(() => {\n stop();\n });\n return {\n isSupported,\n stream,\n start,\n stop,\n restart,\n constraints,\n enabled,\n autoSwitch\n };\n}\n\nfunction useVModel(props, key, emit, options = {}) {\n var _a, _b, _c, _d, _e;\n const {\n clone = false,\n passive = false,\n eventName,\n deep = false,\n defaultValue,\n shouldEmit\n } = options;\n const vm = getCurrentInstance();\n const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));\n let event = eventName;\n if (!key) {\n if (isVue2) {\n const modelOptions = (_e = (_d = vm == null ? void 0 : vm.proxy) == null ? void 0 : _d.$options) == null ? void 0 : _e.model;\n key = (modelOptions == null ? void 0 : modelOptions.value) || \"value\";\n if (!eventName)\n event = (modelOptions == null ? void 0 : modelOptions.event) || \"input\";\n } else {\n key = \"modelValue\";\n }\n }\n event = event || `update:${key.toString()}`;\n const cloneFn = (val) => !clone ? val : typeof clone === \"function\" ? clone(val) : cloneFnJSON(val);\n const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n const triggerEmit = (value) => {\n if (shouldEmit) {\n if (shouldEmit(value))\n _emit(event, value);\n } else {\n _emit(event, value);\n }\n };\n if (passive) {\n const initialValue = getValue();\n const proxy = ref(initialValue);\n let isUpdating = false;\n watch(\n () => props[key],\n (v) => {\n if (!isUpdating) {\n isUpdating = true;\n proxy.value = cloneFn(v);\n nextTick(() => isUpdating = false);\n }\n }\n );\n watch(\n proxy,\n (v) => {\n if (!isUpdating && (v !== props[key] || deep))\n triggerEmit(v);\n },\n { deep }\n );\n return proxy;\n } else {\n return computed({\n get() {\n return getValue();\n },\n set(value) {\n triggerEmit(value);\n }\n });\n }\n}\n\nfunction useVModels(props, emit, options = {}) {\n const ret = {};\n for (const key in props) {\n ret[key] = useVModel(\n props,\n key,\n emit,\n options\n );\n }\n return ret;\n}\n\nfunction useVibrate(options) {\n const {\n pattern = [],\n interval = 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => typeof navigator !== \"undefined\" && \"vibrate\" in navigator);\n const patternRef = toRef(pattern);\n let intervalControls;\n const vibrate = (pattern2 = patternRef.value) => {\n if (isSupported.value)\n navigator.vibrate(pattern2);\n };\n const stop = () => {\n if (isSupported.value)\n navigator.vibrate(0);\n intervalControls == null ? void 0 : intervalControls.pause();\n };\n if (interval > 0) {\n intervalControls = useIntervalFn(\n vibrate,\n interval,\n {\n immediate: false,\n immediateCallback: false\n }\n );\n }\n return {\n isSupported,\n pattern,\n intervalControls,\n vibrate,\n stop\n };\n}\n\nfunction useVirtualList(list, options) {\n const { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n return {\n list: currentList,\n scrollTo,\n containerProps: {\n ref: containerRef,\n onScroll: () => {\n calculateRange();\n },\n style: containerStyle\n },\n wrapperProps\n };\n}\nfunction useVirtualListResources(list) {\n const containerRef = ref(null);\n const size = useElementSize(containerRef);\n const currentList = ref([]);\n const source = shallowRef(list);\n const state = ref({ start: 0, end: 10 });\n return { state, source, currentList, size, containerRef };\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n return (containerSize) => {\n if (typeof itemSize === \"number\")\n return Math.ceil(containerSize / itemSize);\n const { start = 0 } = state.value;\n let sum = 0;\n let capacity = 0;\n for (let i = start; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n capacity = i;\n if (sum > containerSize)\n break;\n }\n return capacity - start;\n };\n}\nfunction createGetOffset(source, itemSize) {\n return (scrollDirection) => {\n if (typeof itemSize === \"number\")\n return Math.floor(scrollDirection / itemSize) + 1;\n let sum = 0;\n let offset = 0;\n for (let i = 0; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n if (sum >= scrollDirection) {\n offset = i;\n break;\n }\n }\n return offset + 1;\n };\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n return () => {\n const element = containerRef.value;\n if (element) {\n const offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n const viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n const from = offset - overscan;\n const to = offset + viewCapacity + overscan;\n state.value = {\n start: from < 0 ? 0 : from,\n end: to > source.value.length ? source.value.length : to\n };\n currentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n data: ele,\n index: index + state.value.start\n }));\n }\n };\n}\nfunction createGetDistance(itemSize, source) {\n return (index) => {\n if (typeof itemSize === \"number\") {\n const size2 = index * itemSize;\n return size2;\n }\n const size = source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n return size;\n };\n}\nfunction useWatchForSizes(size, list, calculateRange) {\n watch([size.width, size.height, list], () => {\n calculateRange();\n });\n}\nfunction createComputedTotalSize(itemSize, source) {\n return computed(() => {\n if (typeof itemSize === \"number\")\n return source.value.length * itemSize;\n return source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n });\n}\nconst scrollToDictionaryForElementScrollKey = {\n horizontal: \"scrollLeft\",\n vertical: \"scrollTop\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef) {\n return (index) => {\n if (containerRef.value) {\n containerRef.value[scrollToDictionaryForElementScrollKey[type]] = getDistance(index);\n calculateRange();\n }\n };\n}\nfunction useHorizontalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowX: \"auto\" };\n const { itemWidth, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n const getOffset = createGetOffset(source, itemWidth);\n const calculateRange = createCalculateRange(\"horizontal\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceLeft = createGetDistance(itemWidth, source);\n const offsetLeft = computed(() => getDistanceLeft(state.value.start));\n const totalWidth = createComputedTotalSize(itemWidth, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n height: \"100%\",\n width: `${totalWidth.value - offsetLeft.value}px`,\n marginLeft: `${offsetLeft.value}px`,\n display: \"flex\"\n }\n };\n });\n return {\n scrollTo,\n calculateRange,\n wrapperProps,\n containerStyle,\n currentList,\n containerRef\n };\n}\nfunction useVerticalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowY: \"auto\" };\n const { itemHeight, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n const getOffset = createGetOffset(source, itemHeight);\n const calculateRange = createCalculateRange(\"vertical\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceTop = createGetDistance(itemHeight, source);\n const offsetTop = computed(() => getDistanceTop(state.value.start));\n const totalHeight = createComputedTotalSize(itemHeight, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n width: \"100%\",\n height: `${totalHeight.value - offsetTop.value}px`,\n marginTop: `${offsetTop.value}px`\n }\n };\n });\n return {\n calculateRange,\n scrollTo,\n containerStyle,\n wrapperProps,\n currentList,\n containerRef\n };\n}\n\nfunction useWakeLock(options = {}) {\n const {\n navigator = defaultNavigator,\n document = defaultDocument\n } = options;\n let wakeLock;\n const isSupported = useSupported(() => navigator && \"wakeLock\" in navigator);\n const isActive = ref(false);\n async function onVisibilityChange() {\n if (!isSupported.value || !wakeLock)\n return;\n if (document && document.visibilityState === \"visible\")\n wakeLock = await navigator.wakeLock.request(\"screen\");\n isActive.value = !wakeLock.released;\n }\n if (document)\n useEventListener(document, \"visibilitychange\", onVisibilityChange, { passive: true });\n async function request(type) {\n if (!isSupported.value)\n return;\n wakeLock = await navigator.wakeLock.request(type);\n isActive.value = !wakeLock.released;\n }\n async function release() {\n if (!isSupported.value || !wakeLock)\n return;\n await wakeLock.release();\n isActive.value = !wakeLock.released;\n wakeLock = null;\n }\n return {\n isSupported,\n isActive,\n request,\n release\n };\n}\n\nfunction useWebNotification(options = {}) {\n const {\n window = defaultWindow,\n requestPermissions: _requestForPermissions = true\n } = options;\n const defaultWebNotificationOptions = options;\n const isSupported = useSupported(() => !!window && \"Notification\" in window);\n const permissionGranted = ref(isSupported.value && \"permission\" in Notification && Notification.permission === \"granted\");\n const notification = ref(null);\n const ensurePermissions = async () => {\n if (!isSupported.value)\n return;\n if (!permissionGranted.value && Notification.permission !== \"denied\") {\n const result = await Notification.requestPermission();\n if (result === \"granted\")\n permissionGranted.value = true;\n }\n return permissionGranted.value;\n };\n const { on: onClick, trigger: clickTrigger } = createEventHook();\n const { on: onShow, trigger: showTrigger } = createEventHook();\n const { on: onError, trigger: errorTrigger } = createEventHook();\n const { on: onClose, trigger: closeTrigger } = createEventHook();\n const show = async (overrides) => {\n if (!isSupported.value || !permissionGranted.value)\n return;\n const options2 = Object.assign({}, defaultWebNotificationOptions, overrides);\n notification.value = new Notification(options2.title || \"\", options2);\n notification.value.onclick = clickTrigger;\n notification.value.onshow = showTrigger;\n notification.value.onerror = errorTrigger;\n notification.value.onclose = closeTrigger;\n return notification.value;\n };\n const close = () => {\n if (notification.value)\n notification.value.close();\n notification.value = null;\n };\n if (_requestForPermissions)\n tryOnMounted(ensurePermissions);\n tryOnScopeDispose(close);\n if (isSupported.value && window) {\n const document = window.document;\n useEventListener(document, \"visibilitychange\", (e) => {\n e.preventDefault();\n if (document.visibilityState === \"visible\") {\n close();\n }\n });\n }\n return {\n isSupported,\n notification,\n ensurePermissions,\n permissionGranted,\n show,\n close,\n onClick,\n onShow,\n onError,\n onClose\n };\n}\n\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n if (options === true)\n return {};\n return options;\n}\nfunction useWebSocket(url, options = {}) {\n const {\n onConnected,\n onDisconnected,\n onError,\n onMessage,\n immediate = true,\n autoClose = true,\n protocols = []\n } = options;\n const data = ref(null);\n const status = ref(\"CLOSED\");\n const wsRef = ref();\n const urlRef = toRef(url);\n let heartbeatPause;\n let heartbeatResume;\n let explicitlyClosed = false;\n let retried = 0;\n let bufferedData = [];\n let pongTimeoutWait;\n const _sendBuffer = () => {\n if (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n for (const buffer of bufferedData)\n wsRef.value.send(buffer);\n bufferedData = [];\n }\n };\n const resetHeartbeat = () => {\n clearTimeout(pongTimeoutWait);\n pongTimeoutWait = void 0;\n };\n const close = (code = 1e3, reason) => {\n if (!isClient || !wsRef.value)\n return;\n explicitlyClosed = true;\n resetHeartbeat();\n heartbeatPause == null ? void 0 : heartbeatPause();\n wsRef.value.close(code, reason);\n wsRef.value = void 0;\n };\n const send = (data2, useBuffer = true) => {\n if (!wsRef.value || status.value !== \"OPEN\") {\n if (useBuffer)\n bufferedData.push(data2);\n return false;\n }\n _sendBuffer();\n wsRef.value.send(data2);\n return true;\n };\n const _init = () => {\n if (explicitlyClosed || typeof urlRef.value === \"undefined\")\n return;\n const ws = new WebSocket(urlRef.value, protocols);\n wsRef.value = ws;\n status.value = \"CONNECTING\";\n ws.onopen = () => {\n status.value = \"OPEN\";\n onConnected == null ? void 0 : onConnected(ws);\n heartbeatResume == null ? void 0 : heartbeatResume();\n _sendBuffer();\n };\n ws.onclose = (ev) => {\n status.value = \"CLOSED\";\n onDisconnected == null ? void 0 : onDisconnected(ws, ev);\n if (!explicitlyClosed && options.autoReconnect) {\n const {\n retries = -1,\n delay = 1e3,\n onFailed\n } = resolveNestedOptions(options.autoReconnect);\n retried += 1;\n if (typeof retries === \"number\" && (retries < 0 || retried < retries))\n setTimeout(_init, delay);\n else if (typeof retries === \"function\" && retries())\n setTimeout(_init, delay);\n else\n onFailed == null ? void 0 : onFailed();\n }\n };\n ws.onerror = (e) => {\n onError == null ? void 0 : onError(ws, e);\n };\n ws.onmessage = (e) => {\n if (options.heartbeat) {\n resetHeartbeat();\n const {\n message = DEFAULT_PING_MESSAGE\n } = resolveNestedOptions(options.heartbeat);\n if (e.data === message)\n return;\n }\n data.value = e.data;\n onMessage == null ? void 0 : onMessage(ws, e);\n };\n };\n if (options.heartbeat) {\n const {\n message = DEFAULT_PING_MESSAGE,\n interval = 1e3,\n pongTimeout = 1e3\n } = resolveNestedOptions(options.heartbeat);\n const { pause, resume } = useIntervalFn(\n () => {\n send(message, false);\n if (pongTimeoutWait != null)\n return;\n pongTimeoutWait = setTimeout(() => {\n close();\n explicitlyClosed = false;\n }, pongTimeout);\n },\n interval,\n { immediate: false }\n );\n heartbeatPause = pause;\n heartbeatResume = resume;\n }\n if (autoClose) {\n if (isClient)\n useEventListener(\"beforeunload\", () => close());\n tryOnScopeDispose(close);\n }\n const open = () => {\n if (!isClient && !isWorker)\n return;\n close();\n explicitlyClosed = false;\n retried = 0;\n _init();\n };\n if (immediate)\n open();\n return {\n data,\n status,\n close,\n send,\n open,\n ws: wsRef\n };\n}\n\nfunction useWebWorker(arg0, workerOptions, options) {\n const {\n window = defaultWindow\n } = options != null ? options : {};\n const data = ref(null);\n const worker = shallowRef();\n const post = (...args) => {\n if (!worker.value)\n return;\n worker.value.postMessage(...args);\n };\n const terminate = function terminate2() {\n if (!worker.value)\n return;\n worker.value.terminate();\n };\n if (window) {\n if (typeof arg0 === \"string\")\n worker.value = new Worker(arg0, workerOptions);\n else if (typeof arg0 === \"function\")\n worker.value = arg0();\n else\n worker.value = arg0;\n worker.value.onmessage = (e) => {\n data.value = e.data;\n };\n tryOnScopeDispose(() => {\n if (worker.value)\n worker.value.terminate();\n });\n }\n return {\n data,\n post,\n terminate,\n worker\n };\n}\n\nfunction jobRunner(userFunc) {\n return (e) => {\n const userFuncArgs = e.data[0];\n return Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n postMessage([\"SUCCESS\", result]);\n }).catch((error) => {\n postMessage([\"ERROR\", error]);\n });\n };\n}\n\nfunction depsParser(deps) {\n if (deps.length === 0)\n return \"\";\n const depsString = deps.map((dep) => `'${dep}'`).toString();\n return `importScripts(${depsString})`;\n}\n\nfunction createWorkerBlobUrl(fn, deps) {\n const blobCode = `${depsParser(deps)}; onmessage=(${jobRunner})(${fn})`;\n const blob = new Blob([blobCode], { type: \"text/javascript\" });\n const url = URL.createObjectURL(blob);\n return url;\n}\n\nfunction useWebWorkerFn(fn, options = {}) {\n const {\n dependencies = [],\n timeout,\n window = defaultWindow\n } = options;\n const worker = ref();\n const workerStatus = ref(\"PENDING\");\n const promise = ref({});\n const timeoutId = ref();\n const workerTerminate = (status = \"PENDING\") => {\n if (worker.value && worker.value._url && window) {\n worker.value.terminate();\n URL.revokeObjectURL(worker.value._url);\n promise.value = {};\n worker.value = void 0;\n window.clearTimeout(timeoutId.value);\n workerStatus.value = status;\n }\n };\n workerTerminate();\n tryOnScopeDispose(workerTerminate);\n const generateWorker = () => {\n const blobUrl = createWorkerBlobUrl(fn, dependencies);\n const newWorker = new Worker(blobUrl);\n newWorker._url = blobUrl;\n newWorker.onmessage = (e) => {\n const { resolve = () => {\n }, reject = () => {\n } } = promise.value;\n const [status, result] = e.data;\n switch (status) {\n case \"SUCCESS\":\n resolve(result);\n workerTerminate(status);\n break;\n default:\n reject(result);\n workerTerminate(\"ERROR\");\n break;\n }\n };\n newWorker.onerror = (e) => {\n const { reject = () => {\n } } = promise.value;\n e.preventDefault();\n reject(e);\n workerTerminate(\"ERROR\");\n };\n if (timeout) {\n timeoutId.value = setTimeout(\n () => workerTerminate(\"TIMEOUT_EXPIRED\"),\n timeout\n );\n }\n return newWorker;\n };\n const callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n promise.value = {\n resolve,\n reject\n };\n worker.value && worker.value.postMessage([[...fnArgs]]);\n workerStatus.value = \"RUNNING\";\n });\n const workerFn = (...fnArgs) => {\n if (workerStatus.value === \"RUNNING\") {\n console.error(\n \"[useWebWorkerFn] You can only run one instance of the worker at a time.\"\n );\n return Promise.reject();\n }\n worker.value = generateWorker();\n return callWorker(...fnArgs);\n };\n return {\n workerFn,\n workerStatus,\n workerTerminate\n };\n}\n\nfunction useWindowFocus(options = {}) {\n const { window = defaultWindow } = options;\n if (!window)\n return ref(false);\n const focused = ref(window.document.hasFocus());\n useEventListener(window, \"blur\", () => {\n focused.value = false;\n });\n useEventListener(window, \"focus\", () => {\n focused.value = true;\n });\n return focused;\n}\n\nfunction useWindowScroll(options = {}) {\n const { window = defaultWindow, behavior = \"auto\" } = options;\n if (!window) {\n return {\n x: ref(0),\n y: ref(0)\n };\n }\n const internalX = ref(window.scrollX);\n const internalY = ref(window.scrollY);\n const x = computed({\n get() {\n return internalX.value;\n },\n set(x2) {\n scrollTo({ left: x2, behavior });\n }\n });\n const y = computed({\n get() {\n return internalY.value;\n },\n set(y2) {\n scrollTo({ top: y2, behavior });\n }\n });\n useEventListener(\n window,\n \"scroll\",\n () => {\n internalX.value = window.scrollX;\n internalY.value = window.scrollY;\n },\n {\n capture: false,\n passive: true\n }\n );\n return { x, y };\n}\n\nfunction useWindowSize(options = {}) {\n const {\n window = defaultWindow,\n initialWidth = Number.POSITIVE_INFINITY,\n initialHeight = Number.POSITIVE_INFINITY,\n listenOrientation = true,\n includeScrollbar = true\n } = options;\n const width = ref(initialWidth);\n const height = ref(initialHeight);\n const update = () => {\n if (window) {\n if (includeScrollbar) {\n width.value = window.innerWidth;\n height.value = window.innerHeight;\n } else {\n width.value = window.document.documentElement.clientWidth;\n height.value = window.document.documentElement.clientHeight;\n }\n }\n };\n update();\n tryOnMounted(update);\n useEventListener(\"resize\", update, { passive: true });\n if (listenOrientation) {\n const matches = useMediaQuery(\"(orientation: portrait)\");\n watch(matches, () => update());\n }\n return { width, height };\n}\n\nexport { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, computedAsync as asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, breakpointsVuetifyV2, breakpointsVuetifyV3, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, getSSRHandler, mapGamepadToXbox360Controller, onClickOutside, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, setSSRHandler, templateRef, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useClipboardItems, useCloned, useColorMode, useConfirmDialog, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useRafFn, useRefHistory, useResizeObserver, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };\n","import { watch } from \"vue\";\n\n/**\n * Sleep function to be used in conjuction with async await:\n *\n * eg: await sleep(5000);\n *\n * @param delay\n * @returns {Promise<any>}\n */\nexport function sleep(delay) {\n return new Promise((resolve) => setTimeout(resolve, delay));\n}\n\n/**\n * Wait for a ref to have a value and then resolve the promise\n *\n * @param ref\n * @param value\n * @returns {Promise<void>}\n */\nexport function waitForRef(ref, value) {\n return new Promise<void>((resolve) => {\n watch(ref, (newValue) => {\n if (newValue === value) {\n resolve();\n }\n });\n });\n}\n\n/**\n * Returns a number that is constrained to the given range.\n * @param min\n * @param max\n * @param value\n * @returns {number}\n */\nexport function minmax(min, max, value) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * Convert meters to miles\n * @param meters\n * @returns {number}\n */\nexport function metersToMiles(meters) {\n return meters * 0.000621371;\n}\n\n/**\n * Convert miles to meters\n * @param miles\n * @returns {number}\n */\nexport function milesToMeters(miles) {\n return miles / 0.000621371;\n}\n\n/**\n * Parses a string for Lat and Long coords\n * @param location\n * @returns {null|{lng: number, lat: number}}\n */\nexport function parseCoords(location) {\n const latLong = location.split(\",\");\n\n if (latLong.length === 2) {\n const lat = parseFloat(latLong[0].trim());\n const lng = parseFloat(latLong[1].trim());\n\n if (!isNaN(lat) && !isNaN(lng)) {\n return {\n lat,\n lng,\n };\n }\n }\n\n return null;\n}\n","import { useGeolocation } from \"@vueuse/core\";\nimport { computed } from \"vue\";\nimport { sleep } from \"./utils\";\n\nlet isLoaded = false;\nlet hasAlreadyWaited = false;\nlet geolocationError = null;\nlet hasLocation = null;\nlet geolocation = null;\n\nexport function useCompatibility(requestLocation = true) {\n if (!isLoaded && requestLocation) {\n const { coords, error, locatedAt } = useGeolocation();\n geolocationError = error;\n hasLocation = locatedAt;\n geolocation = coords;\n isLoaded = true;\n }\n\n const isLocationSupported = \"geolocation\" in navigator;\n\n const location = computed(() => {\n if (hasLocation?.value) {\n return geolocation?.value;\n }\n return null;\n });\n\n const isCompatible = computed(() => !geolocationError?.value && !!hasLocation?.value);\n\n /**\n * Wait for location to be available and returns the location when it is or null after the wait period times out.\n * @param maxWait\n */\n const waitForLocation = async (maxWait = 3000) => {\n // We only should wait once, if we already waited and failed, its unlikely the location will be available at a\n // later time\n if (hasAlreadyWaited) {\n return location;\n }\n\n hasAlreadyWaited = true;\n let waitTime = 0;\n while (!location.value) {\n await sleep(100);\n waitTime += 100;\n\n if (waitTime > maxWait) {\n return null;\n }\n }\n\n return location;\n };\n\n return {\n isLocationSupported,\n isCompatible,\n geolocationError,\n hasLocation,\n location,\n waitForLocation\n };\n}\n","// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import { DateTime, IANAZone } from \"luxon\";\n\nconst SERVER_TZ = new IANAZone(\"America/Chicago\");\n\n/**\n * Converts a date string from the server's time zone to the user's time zone.\n * @param {String} dateTimeString\n * @returns {DateTime}\n */\nexport function localizedDateTime(dateTimeString) {\n dateTimeString = dateTimeString?.replace(\"T\", \" \");\n // noinspection JSCheckFunctionSignatures\n return DateTime.fromSQL(dateTimeString, { zone: SERVER_TZ }).setZone(\"local\");\n}\n\n/**\n * Converts a date string from the user's time zone to the server's time zone.\n * @param dateTimeString\n * @returns {DateTime}\n */\nexport function remoteDateTime(dateTimeString) {\n dateTimeString = dateTimeString?.replace(\"T\", \" \");\n // noinspection JSCheckFunctionSignatures\n return DateTime.fromSQL(dateTimeString, { zone: \"local\" }).setZone(SERVER_TZ);\n}\n\n/**\n * @param {DateTime|String} dateTime\n * @returns {DateTime|*}\n */\nexport function parseDateTime(dateTime) {\n if (typeof dateTime === \"string\") {\n dateTime = dateTime.replace(\"T\", \" \").replace(/\\//g, \"-\");\n return DateTime.fromSQL(dateTime);\n }\n return dateTime || DateTime.fromSQL(\"0000-00-00 00:00:00\");\n}\n\n/**\n * Parses a Quasar formatted date string into a Luxon DateTime object\n * @param date\n * @param format\n * @returns {DateTime}\n */\nexport function parseQDate(date, format = \"yyyy/MM/dd\") {\n return DateTime.fromFormat(date, format);\n}\n\n/**\n * Parses a Quasar formatted date/time string into a Luxon DateTime object\n * @param date\n * @param format\n * @returns {DateTime}\n */\nexport function parseQDateTime(date, format = \"yyyy/MM/dd HH:mm:ss\") {\n return DateTime.fromFormat(date, format);\n}\n\n/**\n * Formats a Luxon DateTime object into a Quasar formatted date string\n * @param date\n * @returns {string}\n */\nexport function fQDate(date) {\n return fDate(date, { format: \"yyyy/MM/dd\" });\n}\n\n/**\n *\n * @param {String} dateTimeString\n * @param options\n * @returns {string}\n */\nexport function fLocalizedDateTime(dateTimeString, options = {}) {\n return fDateTime(localizedDateTime(dateTimeString), options);\n}\n\n/**\n * Formats a date/time object or string into a human-readable format\n *\n * @param {String|Object} dateTime\n * @param format\n * @param {String|null} empty\n * @returns {string}\n */\nexport function fDateTime(\n dateTime = null,\n { format = \"M/d/yy h:mma\", empty = \"- -\" } = {}\n) {\n const formatted = (dateTime ? parseDateTime(dateTime) : DateTime.now()).toFormat(format).toLowerCase();\n return formatted === \"invalid datetime\" ? empty : formatted;\n}\n\n/**\n * Formats a date/time object or string into the best format for DB input\n * @param dateTime\n * @returns {string}\n */\nexport function dbDateTime(dateTime = null) {\n return fDateTime(dateTime, { format: \"yyyy-MM-dd HH:mm:ss\", empty: null });\n}\n\n/**\n * Formats a date object or string into a human-readable format\n * @param {String|Object} dateTime\n * @param {String|null} empty\n * @param format\n * @returns {string}\n */\nexport function fDate(dateTime, { empty = \"--\", format = \"M/d/yy\" } = {}) {\n const formatted = parseDateTime(dateTime).toFormat(format);\n return [\"Invalid DateTime\", \"invalid datetime\"].includes(formatted) ? empty : formatted;\n}\n\n/**\n * Formats a number of seconds into Hours / Minutes / Seconds or just Minutes and Seconds\n *\n * @param second\n * @returns {string}\n */\nexport function fSecondsToTime(second) {\n const time = DateTime.now().setZone(\"UTC\").startOf(\"year\").set({ second });\n const hours = Math.floor(second / 3600);\n return (hours ? hours + \":\" : \"\") + time.toFormat(\"mm:ss\");\n}\n\n/**\n * Formats an amount into USD currency format\n * @param amount\n * @returns {string}\n */\nexport function fCurrency(amount) {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\"\n }).format(amount);\n}\n\n/**\n * Formats a number into a human-readable format\n * @param number\n * @param options\n * @returns {string}\n */\nexport function fNumber(number, options = {}) {\n return new Intl.NumberFormat(\"en-US\", options).format(number);\n}\n\n/**\n * Truncates the string by removing chars from the middle of the string\n * @param str\n * @param maxLength\n * @returns {string|*}\n */\nexport function centerTruncate(str, maxLength) {\n if (str.length > maxLength) {\n const frontCharCount = Math.floor((maxLength - 3) / 2);\n const backCharCount = maxLength - frontCharCount - 3;\n return (\n str.substring(0, frontCharCount) +\n \"...\" +\n str.substring(str.length - backCharCount)\n );\n } else {\n return str;\n }\n}\n\n/**\n * Formats a number into a percentage\n * @param num\n * @param options\n * @returns {string}\n */\nexport function fPercent(num, options = { multiplier: 100, maximumFractionDigits: 1, NaN: \"N/A\" }) {\n num = parseFloat(num);\n\n if (isNaN(num)) {\n return options.NaN;\n }\n\n return fNumber(num * options.multiplier, options) + \"%\";\n}\n\n\nexport function fPhone(value) {\n if (!value || typeof value !== \"string\") {\n return value || \"\";\n }\n\n const input = value.replace(/\\D/g, \"\").split(\"\");\n let phone = \"\";\n\n const startsWithOne = input.length > 0 && input[0] === \"1\";\n const shift = startsWithOne ? 1 : 0;\n\n input.map((number, index) => {\n switch (index) {\n case shift:\n phone += \"(\";\n break;\n case shift + 3:\n phone += \") \";\n break;\n case shift + 6:\n phone += \"-\";\n break;\n case shift + 10:\n phone += \" x\";\n break;\n }\n if (index === 0 && number === \"1\") {\n phone += \"+1 \";\n } else {\n phone += number;\n }\n });\n\n if (value === \"+1 (\") {\n return \"\";\n }\n\n return phone;\n}\n","import { parseDateTime } from \"./formats\";\n\nexport function diffInDays(date1, date2) {\n return parseDateTime(date2).diff(parseDateTime(date1), [\"days\"]).days;\n}\n","// download.js v4.2, by dandavis; 2008-2016. [CCBY2] see http://danml.com/download.html for tests/usage\n// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and\n// optional mime v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for\n// larger+faster saves than dataURLs v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback\n// was improved with force-download mime and base64 support. 3.1 improved safari handling. v4 adds AMD/UMD, commonJS,\n// and plain browser support v4.1 adds url download capability via solo URL argument (same domain/CORS only) v4.2 adds\n// semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors\n// https://github.com/rndme/download\n\n/* eslint-disable */\nexport function download(data, strFileName, strMimeType) {\n var self = window;\n // this script is only for browsers anyway...\n\n var defaultMime = \"application/octet-stream\";\n // this default mime also triggers iframe downloads\n\n var mimeType = strMimeType || defaultMime;\n\n var payload = data;\n\n var url = !strFileName && !strMimeType && payload;\n\n var anchor = document.createElement(\"a\");\n\n var toString = function (a) {\n return String(a);\n };\n\n // @ts-ignore\n var myBlob = self.Blob || self.MozBlob || self.WebKitBlob || toString;\n\n var fileName = strFileName || \"download\";\n\n var blob;\n\n var reader;\n myBlob = myBlob.call ? myBlob.bind(self) : Blob;\n\n if (String(this) === \"true\") {\n // reverse arguments, allowing download.bind(true, \"text/xml\", \"export.xml\") to act as a callback\n payload = [payload, mimeType];\n mimeType = payload[0];\n payload = payload[1];\n }\n\n if (url && url.length < 2048) {\n // if no filename and no mime, assume a url was passed as the only argument\n fileName = url.split(\"/\").pop().split(\"?\")[0];\n anchor.href = url; // assign href prop to temp anchor\n\n // if the browser determines that it's a potentially valid url path:\n if (\n anchor.href.indexOf(url) !== -1 ||\n anchor.href.indexOf(encodeURI(url)) !== -1 ||\n anchor.href === encodeURI(url)\n ) {\n var ajax = new XMLHttpRequest();\n ajax.open(\"GET\", url + \"?no-cache=\" + Date.now(), true);\n ajax.responseType = \"blob\";\n ajax.onload = function (e) {\n // @ts-ignore\n download(e.target.response, fileName, defaultMime);\n };\n ajax.onerror = function (e) {\n // As a fallback, just open the request in a new tab\n window.open(url, \"_blank\").focus();\n };\n setTimeout(function () {\n ajax.send();\n }, 0); // allows setting custom ajax headers using the return:\n return ajax;\n } else {\n throw new Error(\"Invalid URL given, cannot download file: \" + url);\n }\n } // end if url?\n\n // go ahead and download dataURLs right away\n if (/^data:[\\w+-]+\\/[\\w+-]+[,;]/.test(payload)) {\n if (payload.length > 1024 * 1024 * 1.999 && myBlob !== toString) {\n payload = dataUrlToBlob(payload);\n mimeType = payload.type || defaultMime;\n } else {\n // IE10 can't do a[download], only Blobs\n // everyone else can save dataURLs un-processed\n // @ts-ignore\n return navigator.msSaveBlob ? navigator.msSaveBlob(dataUrlToBlob(payload), fileName) : saver(payload);\n }\n } // end if dataURL passed?\n\n blob =\n payload instanceof myBlob\n ? payload\n : new myBlob([payload], { type: mimeType });\n\n function dataUrlToBlob(strUrl) {\n var parts = strUrl.split(/[:;,]/);\n\n var type = parts[1];\n\n var decoder = parts[2] === \"base64\" ? atob : decodeURIComponent;\n\n var binData = decoder(parts.pop());\n\n var mx = binData.length;\n\n var i = 0;\n\n var uiArr = new Uint8Array(mx);\n\n for (i; i < mx; ++i) uiArr[i] = binData.charCodeAt(i);\n\n return new myBlob([uiArr], { type: type });\n }\n\n function saver(url, winMode) {\n if (\"download\" in anchor) {\n // html5 A[download]\n anchor.href = url;\n anchor.setAttribute(\"download\", fileName);\n anchor.className = \"download-js-link\";\n anchor.innerHTML = \"downloading...\";\n anchor.style.display = \"none\";\n document.body.appendChild(anchor);\n setTimeout(function () {\n anchor.click();\n document.body.removeChild(anchor);\n if (winMode === true) {\n setTimeout(function () {\n self.URL.revokeObjectURL(anchor.href);\n }, 250);\n }\n }, 66);\n return true;\n }\n\n // handle non-a[download] safari as best we can:\n if (\n /(Version)\\/(\\d+)\\.(\\d+)(?:\\.(\\d+))?.*Safari\\//.test(navigator.userAgent)\n ) {\n url = url.replace(/^data:([\\w/\\-+]+)/, defaultMime);\n if (!window.open(url)) {\n // popup blocked, offer direct download:\n if (\n confirm(\n \"Displaying New Document\\n\\nUse Save As... to download, then click back to return to this page.\"\n )\n ) {\n location.href = url;\n }\n }\n return true;\n }\n\n // do iframe dataURL download (old ch+FF):\n var f = document.createElement(\"iframe\");\n document.body.appendChild(f);\n\n if (!winMode) {\n // force a mime that will download:\n url = \"data:\" + url.replace(/^data:([\\w/\\-+]+)/, defaultMime);\n }\n f.src = url;\n setTimeout(function () {\n document.body.removeChild(f);\n }, 333);\n } // end saver\n\n // @ts-ignore\n if (navigator.msSaveBlob) {\n // IE10+ : (has Blob, but not a[download] or URL)\n // @ts-ignore\n return navigator.msSaveBlob(blob, fileName);\n }\n\n if (self.URL) {\n // simple fast and modern way using Blob and URL:\n saver(self.URL.createObjectURL(blob), true);\n } else {\n // handle non-Blob()+non-URL browsers:\n if (typeof blob === \"string\" || blob.constructor === toString) {\n try {\n // @ts-ignore\n return saver(\"data:\" + mimeType + \";base64,\" + self.btoa(blob));\n } catch (y) {\n // @ts-ignore\n return saver(\"data:\" + mimeType + \",\" + encodeURIComponent(blob));\n }\n }\n\n // Blob but not URL support:\n reader = new FileReader();\n reader.onload = function (e) {\n // @ts-ignore\n saver(this.result);\n };\n reader.readAsDataURL(blob);\n }\n return true;\n}\n","import { download } from \"./download\";\n\n/**\n * Asynchronously load a file from the URL and trigger a download in the browser\n *\n * @param url\n * @param filename\n * @param postParams\n * @returns {Promise<void>}\n */\nexport async function downloadFile(url, filename = \"\", postParams = null) {\n let fetchOptions = undefined;\n\n if (postParams) {\n fetchOptions = {\n method: \"POST\",\n \"Content-Type\": \"application/json\",\n body: JSON.stringify(postParams)\n };\n }\n\n const response = await fetch(url, fetchOptions);\n\n if (!response.ok) {\n throw Error(\"File download failed: invalid response from server\");\n }\n\n let errorMessage;\n\n // Handle a JSON response (which indicates an error occurred)\n try {\n // @ts-expect-error data is defined on response\n const jsonResponse = JSON.parse(new TextDecoder().decode(response.data));\n console.error(\"Error downloading file:\", jsonResponse);\n errorMessage = jsonResponse.message;\n if (jsonResponse.errors) {\n errorMessage = jsonResponse.errors[0].message;\n }\n } catch (e) {\n // we expect an error thrown for invalid JSON when the response is a file\n }\n\n if (errorMessage) {\n throw new Error(\"Failed to download file: \" + errorMessage);\n }\n\n await downloadFileResponse(response, filename);\n}\n\n/**\n * Downloads a file from a response object w/ a file attachment\n *\n * @param response\n * @param filename\n */\nexport async function downloadFileResponse(response, filename = \"\") {\n const contentDisposition = getResponseHeader(\n response,\n \"content-disposition\",\n \"\"\n );\n\n const contentType = getResponseHeader(response, \"content-type\", \"\");\n\n const match = contentDisposition.match(/filename=\"([^\"]+)\"/);\n\n filename = filename || (match && match[1]) || \"download.pdf\";\n\n let data = response.data;\n if (!data) {\n data = await response.blob();\n }\n\n download(data, filename, contentType);\n}\n\n/**\n * Get a header from a response object\n * @param response\n * @param header\n * @param defaultValue\n * @returns {*}\n */\nexport function getResponseHeader(response, header, defaultValue) {\n if (response.headers) {\n if (typeof response.headers.get === \"function\") {\n return response.headers.get(header) || defaultValue;\n } else {\n return response.headers[header] || defaultValue;\n }\n }\n}\n","export default class DataView {\n constructor(buffer) {\n if (bufferTypeIsUnsupported(buffer)) {\n throw new Error('DataView: Passed buffer type is unsupported.');\n }\n\n this.buffer = buffer;\n this.byteLength = this.buffer.length;\n }\n\n getUint8(offset) {\n return this.buffer.readUInt8(offset);\n }\n\n getUint16(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readUInt16LE(offset);\n }\n return this.buffer.readUInt16BE(offset);\n }\n\n getUint32(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readUInt32LE(offset);\n }\n return this.buffer.readUInt32BE(offset);\n }\n\n getInt32(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readInt32LE(offset);\n }\n return this.buffer.readInt32BE(offset);\n }\n}\n\nfunction bufferTypeIsUnsupported(buffer) {\n return typeof buffer !== 'object'\n || buffer.length === undefined\n || buffer.readUInt8 === undefined\n || buffer.readUInt16LE === undefined\n || buffer.readUInt16BE === undefined\n || buffer.readUInt32LE === undefined\n || buffer.readUInt32BE === undefined\n || buffer.readInt32LE === undefined\n || buffer.readInt32BE === undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport DataViewWrapper from './dataview.js';\n\nexport function getDataView(data, byteOffset, byteLength) {\n try {\n return new DataView(data, byteOffset, byteLength);\n } catch (error) {\n return new DataViewWrapper(data, byteOffset, byteLength);\n }\n}\n\nexport function getStringFromDataView(dataView, offset, length) {\n const chars = [];\n for (let i = 0; i < length && offset + i < dataView.byteLength; i++) {\n chars.push(dataView.getUint8(offset + i));\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getNullTerminatedStringFromDataView(dataView, offset) {\n const chars = [];\n let i = 0;\n while (offset + i < dataView.byteLength) {\n const char = dataView.getUint8(offset + i);\n if (char === 0) {\n break;\n }\n chars.push(char);\n i++;\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getUnicodeStringFromDataView(dataView, offset, length) {\n const chars = [];\n for (let i = 0; i < length && offset + i < dataView.byteLength; i += 2) {\n chars.push(dataView.getUint16(offset + i));\n }\n if (chars[chars.length - 1] === 0) {\n chars.pop();\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getPascalStringFromDataView(dataView, offset) {\n const size = dataView.getUint8(offset);\n const string = getStringFromDataView(dataView, offset + 1, size);\n return [size, string];\n}\n\nexport function getStringValueFromArray(charArray) {\n return charArray.map((charCode) => String.fromCharCode(charCode)).join('');\n}\n\nexport function getCharacterArray(string) {\n return string.split('').map((character) => character.charCodeAt(0));\n}\n\nexport function objectAssign() {\n for (let i = 1; i < arguments.length; i++) {\n for (const property in arguments[i]) {\n arguments[0][property] = arguments[i][property];\n }\n }\n\n return arguments[0];\n}\n\nexport function deferInit(object, key, initializer) {\n let initialized = false;\n Object.defineProperty(object, key, {\n get() {\n if (!initialized) {\n initialized = true;\n Object.defineProperty(object, key, {\n configurable: true,\n enumerable: true,\n value: initializer.apply(object),\n writable: true\n });\n }\n return object[key];\n },\n configurable: true,\n enumerable: true\n });\n}\n\nexport function getBase64Image(image) {\n if (typeof btoa !== 'undefined') {\n if (typeof image === 'string') {\n // This only happens during the build tests using Node 16+ (npm run test:build).\n return btoa(image);\n }\n // IE11- does not implement reduce on the Uint8Array prototype.\n return btoa(Array.prototype.reduce.call(new Uint8Array(image), (data, byte) => data + String.fromCharCode(byte), ''));\n }\n if (typeof Buffer === 'undefined') {\n return undefined;\n }\n if (typeof Buffer.from !== 'undefined') { // eslint-disable-line no-undef\n return Buffer.from(image).toString('base64'); // eslint-disable-line no-undef\n }\n return (new Buffer(image)).toString('base64'); // eslint-disable-line no-undef\n}\n\nexport function dataUriToBuffer(dataUri) {\n const data = dataUri.substring(dataUri.indexOf(',') + 1);\n\n if (dataUri.indexOf(';base64') !== -1) {\n if (typeof atob !== 'undefined') {\n return Uint8Array.from(atob(data), (char) => char.charCodeAt(0)).buffer;\n }\n if (typeof Buffer === 'undefined') {\n return undefined;\n }\n if (typeof Buffer.from !== 'undefined') { // eslint-disable-line no-undef\n return Buffer.from(data, 'base64'); // eslint-disable-line no-undef\n }\n return new Buffer(data, 'base64'); // eslint-disable-line no-undef\n }\n\n const decodedData = decodeURIComponent(data);\n if (typeof Buffer !== 'undefined') {\n if (typeof Buffer.from !== 'undefined') { // eslint-disable-line no-undef\n return Buffer.from(decodedData); // eslint-disable-line no-undef\n }\n return new Buffer(decodedData); // eslint-disable-line no-undef\n }\n return Uint8Array.from(decodedData, (char) => char.charCodeAt(0)).buffer;\n}\n\nexport function padStart(string, length, character) {\n const padding = strRepeat(character, length - string.length);\n return padding + string;\n}\n\nexport function parseFloatRadix(string, radix) {\n return parseInt(string.replace('.', ''), radix)\n / Math.pow(radix, (string.split('.')[1] || '').length);\n}\n\nexport function strRepeat(string, num) {\n return new Array(num + 1).join(string);\n}\n\nexport const COMPRESSION_METHOD_NONE = undefined;\nexport const COMPRESSION_METHOD_DEFLATE = 0;\n\nexport function decompress(dataView, compressionMethod, returnType = 'string') {\n if (compressionMethod === COMPRESSION_METHOD_DEFLATE) {\n if (typeof DecompressionStream === 'function') {\n const decompressionStream = new DecompressionStream('deflate');\n const decompressedStream = new Blob([dataView]).stream().pipeThrough(decompressionStream);\n if (returnType === 'dataview') {\n return new Response(decompressedStream).arrayBuffer().then((arrayBuffer) => new DataView(arrayBuffer));\n }\n return new Response(decompressedStream).text();\n }\n }\n if (compressionMethod !== undefined) {\n return Promise.reject(`Unknown compression method ${compressionMethod}.`);\n }\n return dataView;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n USE_FILE: true,\n USE_JFIF: true,\n USE_PNG_FILE: true,\n USE_EXIF: true,\n USE_IPTC: true,\n USE_XMP: true,\n USE_ICC: true,\n USE_MPF: true,\n USE_PHOTOSHOP: true,\n USE_THUMBNAIL: true,\n USE_TIFF: true,\n USE_JPEG: true,\n USE_PNG: true,\n USE_HEIC: true,\n USE_AVIF: true,\n USE_WEBP: true,\n USE_GIF: true\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport function getStringValue(value) {\n return value.map((charCode) => String.fromCharCode(charCode)).join('');\n}\n\nexport function getEncodedString(value) {\n if (value.length >= 8) {\n const encoding = getStringValue(value.slice(0, 8));\n\n if (encoding === 'ASCII\\x00\\x00\\x00') {\n return getStringValue(value.slice(8));\n } else if (encoding === 'JIS\\x00\\x00\\x00\\x00\\x00') {\n return '[JIS encoded text]';\n } else if (encoding === 'UNICODE\\x00') {\n return '[Unicode encoded text]';\n } else if (encoding === '\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00') {\n return '[Undefined encoding]';\n }\n }\n\n return 'Undefined';\n}\n\nexport function getCalculatedGpsValue(value) {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nconst LITTLE_ENDIAN = 0x4949;\nconst BIG_ENDIAN = 0x4d4d;\n\nexport default {\n BIG_ENDIAN,\n LITTLE_ENDIAN,\n getByteOrder\n};\n\nfunction getByteOrder(dataView, tiffHeaderOffset) {\n if (dataView.getUint16(tiffHeaderOffset) === LITTLE_ENDIAN) {\n return LITTLE_ENDIAN;\n } else if (dataView.getUint16(tiffHeaderOffset) === BIG_ENDIAN) {\n return BIG_ENDIAN;\n }\n throw new Error('Illegal byte order value. Faulty image.');\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\nimport Constants from './constants.js';\n\nexport default {\n isTiffFile,\n findTiffOffsets\n};\n\nfunction isTiffFile(dataView) {\n const MIN_TIFF_DATA_BUFFER_LENGTH = 4;\n\n return !!dataView && (dataView.byteLength >= MIN_TIFF_DATA_BUFFER_LENGTH) && hasTiffMarker(dataView);\n}\n\nfunction hasTiffMarker(dataView) {\n const TIFF_ID = 0x2a;\n const TIFF_ID_OFFSET = 2;\n\n const littleEndian = dataView.getUint16(0) === ByteOrder.LITTLE_ENDIAN;\n return dataView.getUint16(TIFF_ID_OFFSET, littleEndian) === TIFF_ID;\n}\n\nfunction findTiffOffsets() {\n const TIFF_FILE_HEADER_OFFSET = 0;\n\n if (Constants.USE_EXIF) {\n return {\n hasAppMarkers: true,\n tiffHeaderOffset: TIFF_FILE_HEADER_OFFSET\n };\n }\n return {};\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isJpegFile,\n findJpegOffsets\n};\n\nconst MIN_JPEG_DATA_BUFFER_LENGTH = 2;\nconst JPEG_ID = 0xffd8;\nconst JPEG_ID_SIZE = 2;\nconst APP_ID_OFFSET = 4;\nconst APP_MARKER_SIZE = 2;\nconst JFIF_DATA_OFFSET = 2; // From start of APP0 marker.\nconst TIFF_HEADER_OFFSET = 10; // From start of APP1 marker.\nconst IPTC_DATA_OFFSET = 18; // From start of APP13 marker.\nconst XMP_DATA_OFFSET = 33; // From start of APP1 marker.\nconst XMP_EXTENDED_DATA_OFFSET = 79; // From start of APP1 marker including GUID, total length, and offset.\nconst APP2_ICC_DATA_OFFSET = 18; // From start of APP2 marker including marker and chunk/chunk total numbers.\nconst MPF_DATA_OFFSET = 8;\n\nconst APP2_ICC_IDENTIFIER = 'ICC_PROFILE\\0';\nconst ICC_CHUNK_NUMBER_OFFSET = APP_ID_OFFSET + APP2_ICC_IDENTIFIER.length;\nconst ICC_TOTAL_CHUNKS_OFFSET = ICC_CHUNK_NUMBER_OFFSET + 1;\n\nconst APP2_MPF_IDENTIFIER = 'MPF\\0';\n\nconst SOF0_MARKER = 0xffc0;\nconst SOF2_MARKER = 0xffc2;\nconst DHT_MARKER = 0xffc4;\nconst DQT_MARKER = 0xffdb;\nconst DRI_MARKER = 0xffdd;\nconst SOS_MARKER = 0xffda;\n\nconst APP0_MARKER = 0xffe0;\nconst APP1_MARKER = 0xffe1;\nconst APP2_MARKER = 0xffe2;\nconst APP13_MARKER = 0xffed;\nconst APP15_MARKER = 0xffef;\nconst COMMENT_MARKER = 0xfffe;\n\n// Any number of fill bytes can be placed before an app marker. It's actually the first 0xff that is the\n// fill byte and the next 0xff is either another fill byte or the first half of the next app marker.\nconst FILL_BYTE = 0xffff;\n\nconst APP0_JFIF_IDENTIFIER = 'JFIF';\nconst APP1_EXIF_IDENTIFIER = 'Exif';\nconst APP1_XMP_IDENTIFIER = 'http://ns.adobe.com/xap/1.0/\\x00';\nconst APP1_XMP_EXTENDED_IDENTIFIER = 'http://ns.adobe.com/xmp/extension/\\x00';\nconst APP13_IPTC_IDENTIFIER = 'Photoshop 3.0';\n\nfunction isJpegFile(dataView) {\n return !!dataView && (dataView.byteLength >= MIN_JPEG_DATA_BUFFER_LENGTH) && (dataView.getUint16(0) === JPEG_ID);\n}\n\nfunction findJpegOffsets(dataView) {\n let appMarkerPosition = JPEG_ID_SIZE;\n let fieldLength;\n let sof0DataOffset;\n let sof2DataOffset;\n let jfifDataOffset;\n let tiffHeaderOffset;\n let iptcDataOffset;\n let xmpChunks;\n let iccChunks;\n let mpfDataOffset;\n\n while (appMarkerPosition + APP_ID_OFFSET + 5 <= dataView.byteLength) {\n if (Constants.USE_FILE && isSOF0Marker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n sof0DataOffset = appMarkerPosition + APP_MARKER_SIZE;\n } else if (Constants.USE_FILE && isSOF2Marker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n sof2DataOffset = appMarkerPosition + APP_MARKER_SIZE;\n } else if (Constants.USE_JFIF && isApp0JfifMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n jfifDataOffset = appMarkerPosition + JFIF_DATA_OFFSET;\n } else if (Constants.USE_EXIF && isApp1ExifMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n tiffHeaderOffset = appMarkerPosition + TIFF_HEADER_OFFSET;\n } else if (Constants.USE_XMP && isApp1XmpMarker(dataView, appMarkerPosition)) {\n if (!xmpChunks) {\n xmpChunks = [];\n }\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n xmpChunks.push(getXmpChunkDetails(appMarkerPosition, fieldLength));\n } else if (Constants.USE_XMP && isApp1ExtendedXmpMarker(dataView, appMarkerPosition)) {\n if (!xmpChunks) {\n xmpChunks = [];\n }\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n xmpChunks.push(getExtendedXmpChunkDetails(appMarkerPosition, fieldLength));\n } else if (Constants.USE_IPTC && isApp13PhotoshopMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n iptcDataOffset = appMarkerPosition + IPTC_DATA_OFFSET;\n } else if (Constants.USE_ICC && isApp2ICCMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n const iccDataOffset = appMarkerPosition + APP2_ICC_DATA_OFFSET;\n const iccDataLength = fieldLength - (APP2_ICC_DATA_OFFSET - APP_MARKER_SIZE);\n\n const iccChunkNumber = dataView.getUint8(appMarkerPosition + ICC_CHUNK_NUMBER_OFFSET);\n const iccChunksTotal = dataView.getUint8(appMarkerPosition + ICC_TOTAL_CHUNKS_OFFSET);\n if (!iccChunks) {\n iccChunks = [];\n }\n iccChunks.push({offset: iccDataOffset, length: iccDataLength, chunkNumber: iccChunkNumber, chunksTotal: iccChunksTotal});\n } else if (Constants.USE_MPF && isApp2MPFMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n mpfDataOffset = appMarkerPosition + MPF_DATA_OFFSET;\n } else if (isAppMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n } else if (isFillByte(dataView, appMarkerPosition)) {\n appMarkerPosition++;\n continue;\n } else {\n break;\n }\n appMarkerPosition += APP_MARKER_SIZE + fieldLength;\n }\n\n return {\n hasAppMarkers: appMarkerPosition > JPEG_ID_SIZE,\n fileDataOffset: sof0DataOffset || sof2DataOffset,\n jfifDataOffset,\n tiffHeaderOffset,\n iptcDataOffset,\n xmpChunks,\n iccChunks,\n mpfDataOffset\n };\n}\n\nfunction isSOF0Marker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === SOF0_MARKER);\n}\n\nfunction isSOF2Marker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === SOF2_MARKER);\n}\n\nfunction isApp2ICCMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP2_ICC_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP2_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP2_ICC_IDENTIFIER);\n}\n\nfunction isApp2MPFMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP2_MPF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP2_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP2_MPF_IDENTIFIER);\n}\n\nfunction isApp0JfifMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP0_JFIF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP0_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP0_JFIF_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isApp1ExifMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP1_EXIF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_EXIF_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isApp1XmpMarker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && isXmpIdentifier(dataView, appMarkerPosition);\n}\n\nfunction isXmpIdentifier(dataView, appMarkerPosition) {\n const markerIdLength = APP1_XMP_IDENTIFIER.length;\n return getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_XMP_IDENTIFIER;\n}\n\nfunction isApp1ExtendedXmpMarker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && isExtendedXmpIdentifier(dataView, appMarkerPosition);\n}\n\nfunction isExtendedXmpIdentifier(dataView, appMarkerPosition) {\n const markerIdLength = APP1_XMP_EXTENDED_IDENTIFIER.length;\n return getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_XMP_EXTENDED_IDENTIFIER;\n}\n\nfunction getXmpChunkDetails(appMarkerPosition, fieldLength) {\n return {\n dataOffset: appMarkerPosition + XMP_DATA_OFFSET,\n length: fieldLength - (XMP_DATA_OFFSET - APP_MARKER_SIZE)\n };\n}\n\nfunction getExtendedXmpChunkDetails(appMarkerPosition, fieldLength) {\n return {\n dataOffset: appMarkerPosition + XMP_EXTENDED_DATA_OFFSET,\n length: fieldLength - (XMP_EXTENDED_DATA_OFFSET - APP_MARKER_SIZE)\n };\n}\n\nfunction isApp13PhotoshopMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP13_IPTC_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP13_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP13_IPTC_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isAppMarker(dataView, appMarkerPosition) {\n const appMarker = dataView.getUint16(appMarkerPosition);\n return ((appMarker >= APP0_MARKER) && (appMarker <= APP15_MARKER))\n || (appMarker === COMMENT_MARKER)\n || (appMarker === SOF0_MARKER)\n || (appMarker === SOF2_MARKER)\n || (appMarker === DHT_MARKER)\n || (appMarker === DQT_MARKER)\n || (appMarker === DRI_MARKER)\n || (appMarker === SOS_MARKER);\n}\n\nfunction isFillByte(dataView, appMarkerPosition) {\n return dataView.getUint16(appMarkerPosition) === FILL_BYTE;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// Specification: http://www.libpng.org/pub/png/spec/1.2/\n\nimport {getStringFromDataView, getNullTerminatedStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isPngFile,\n findPngOffsets\n};\n\nconst PNG_ID = '\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a';\nconst PNG_CHUNK_LENGTH_SIZE = 4;\nexport const PNG_CHUNK_TYPE_SIZE = 4;\nexport const PNG_CHUNK_LENGTH_OFFSET = 0;\nexport const PNG_CHUNK_TYPE_OFFSET = PNG_CHUNK_LENGTH_SIZE;\nexport const PNG_CHUNK_DATA_OFFSET = PNG_CHUNK_LENGTH_SIZE + PNG_CHUNK_TYPE_SIZE;\nconst PNG_XMP_PREFIX = 'XML:com.adobe.xmp\\x00';\nexport const TYPE_TEXT = 'tEXt';\nexport const TYPE_ITXT = 'iTXt';\nexport const TYPE_ZTXT = 'zTXt';\nexport const TYPE_PHYS = 'pHYs';\nexport const TYPE_TIME = 'tIME';\nexport const TYPE_EXIF = 'eXIf';\nexport const TYPE_ICCP = 'iCCP';\n\nfunction isPngFile(dataView) {\n return !!dataView && getStringFromDataView(dataView, 0, PNG_ID.length) === PNG_ID;\n}\n\nfunction findPngOffsets(dataView, async) {\n const PNG_CRC_SIZE = 4;\n\n const offsets = {\n hasAppMarkers: false\n };\n\n let offset = PNG_ID.length;\n\n while (offset + PNG_CHUNK_LENGTH_SIZE + PNG_CHUNK_TYPE_SIZE <= dataView.byteLength) {\n if (Constants.USE_PNG_FILE && isPngImageHeaderChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n offsets.pngHeaderOffset = offset + PNG_CHUNK_DATA_OFFSET;\n } else if (Constants.USE_XMP && isPngXmpChunk(dataView, offset)) {\n const dataOffset = getPngXmpDataOffset(dataView, offset);\n if (dataOffset !== undefined) {\n offsets.hasAppMarkers = true;\n offsets.xmpChunks = [{\n dataOffset,\n length: dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET) - (dataOffset - (offset + PNG_CHUNK_DATA_OFFSET))\n }];\n }\n } else if (isPngTextChunk(dataView, offset, async)) {\n offsets.hasAppMarkers = true;\n const chunkType = getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE);\n if (!offsets.pngTextChunks) {\n offsets.pngTextChunks = [];\n }\n offsets.pngTextChunks.push({\n length: dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET),\n type: chunkType,\n offset: offset + PNG_CHUNK_DATA_OFFSET\n });\n } else if (isPngExifChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n offsets.tiffHeaderOffset = offset + PNG_CHUNK_DATA_OFFSET;\n } else if (Constants.USE_ICC && async && isPngIccpChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n const chunkDataLength = dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET);\n const iccHeaderOffset = offset + PNG_CHUNK_DATA_OFFSET;\n const {profileName, compressionMethod, compressedProfileOffset} = parseIccHeader(dataView, iccHeaderOffset);\n if (!offsets.iccChunks) {\n offsets.iccChunks = [];\n }\n offsets.iccChunks.push({\n offset: compressedProfileOffset,\n length: chunkDataLength - (compressedProfileOffset - iccHeaderOffset),\n chunkNumber: 1,\n chunksTotal: 1,\n profileName,\n compressionMethod\n });\n } else if (isPngChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n if (!offsets.pngChunkOffsets) {\n offsets.pngChunkOffsets = [];\n }\n offsets.pngChunkOffsets.push(offset + PNG_CHUNK_LENGTH_OFFSET);\n }\n\n offset += dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET)\n + PNG_CHUNK_LENGTH_SIZE\n + PNG_CHUNK_TYPE_SIZE\n + PNG_CRC_SIZE;\n }\n\n return offsets;\n}\n\nfunction isPngImageHeaderChunk(dataView, offset) {\n const PNG_CHUNK_TYPE_IMAGE_HEADER = 'IHDR';\n return getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === PNG_CHUNK_TYPE_IMAGE_HEADER;\n}\n\nfunction isPngXmpChunk(dataView, offset) {\n return (getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === TYPE_ITXT)\n && (getStringFromDataView(dataView, offset + PNG_CHUNK_DATA_OFFSET, PNG_XMP_PREFIX.length) === PNG_XMP_PREFIX);\n}\n\nfunction isPngTextChunk(dataView, offset, async) {\n const chunkType = getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE);\n return chunkType === TYPE_TEXT || chunkType === TYPE_ITXT || (chunkType === TYPE_ZTXT && async);\n}\n\nfunction isPngExifChunk(dataView, offset) {\n return getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === TYPE_EXIF;\n}\n\nfunction isPngIccpChunk(dataView, offset) {\n return getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === TYPE_ICCP;\n}\n\nfunction isPngChunk(dataView, offset) {\n const SUPPORTED_PNG_CHUNK_TYPES = [TYPE_PHYS, TYPE_TIME];\n const chunkType = getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE);\n return SUPPORTED_PNG_CHUNK_TYPES.includes(chunkType);\n}\n\nfunction getPngXmpDataOffset(dataView, offset) {\n const COMPRESSION_FLAG_SIZE = 1;\n const COMPRESSION_METHOD_SIZE = 1;\n\n offset += PNG_CHUNK_DATA_OFFSET + PNG_XMP_PREFIX.length + COMPRESSION_FLAG_SIZE + COMPRESSION_METHOD_SIZE;\n\n let numberOfNullSeparators = 0;\n while (numberOfNullSeparators < 2 && offset < dataView.byteLength) {\n if (dataView.getUint8(offset) === 0x00) {\n numberOfNullSeparators++;\n }\n offset++;\n }\n if (numberOfNullSeparators < 2) {\n return undefined;\n }\n return offset;\n}\n\nfunction parseIccHeader(dataView, offset) {\n const NULL_SEPARATOR_SIZE = 1;\n const COMPRESSION_METHOD_SIZE = 1;\n\n const profileName = getNullTerminatedStringFromDataView(dataView, offset);\n offset += profileName.length + NULL_SEPARATOR_SIZE;\n\n const compressionMethod = dataView.getUint8(offset);\n offset += COMPRESSION_METHOD_SIZE;\n\n return {\n profileName,\n compressionMethod,\n compressedProfileOffset: offset\n };\n}\n","export function get64BitValue(dataView, offset) {\n // It's a bit tricky to handle 64 bit numbers in JavaScript. Let's\n // wait until there are real-world examples where it is necessary.\n return dataView.getUint32(offset + 4);\n}\n","import {get64BitValue} from './image-header-iso-bmff-utils.js';\n\nexport function parseItemLocationBox(dataView, version, contentOffset, boxLength) {\n const FLAGS_SIZE = 3;\n\n const {offsets, sizes} = getItemLocationBoxOffsetsAndSizes(version, contentOffset + FLAGS_SIZE);\n\n const offsetSize = dataView.getUint8(offsets.offsetSize) >> 4;\n sizes.item.extent.extentOffset = offsetSize;\n const lengthSize = dataView.getUint8(offsets.lengthSize) & 0x0f;\n sizes.item.extent.extentLength = lengthSize;\n const baseOffsetSize = dataView.getUint8(offsets.baseOffsetSize) >> 4;\n sizes.item.baseOffset = baseOffsetSize;\n const indexSize = getIndexSize(dataView, offsets.indexSize, version);\n sizes.item.extent.extentIndex = indexSize !== undefined ? indexSize : 0;\n const itemCount = getItemCount(dataView, offsets.itemCount, version);\n\n return {\n type: 'iloc',\n items: getItems(dataView, version, offsets, sizes, offsetSize, lengthSize, indexSize, itemCount),\n length: boxLength\n };\n}\n\nfunction getItemLocationBoxOffsetsAndSizes(version, contentOffset) {\n const sizes = {\n item: {\n dataReferenceIndex: 2,\n extentCount: 2,\n extent: {}\n }\n };\n if (version < 2) {\n sizes.itemCount = 2;\n sizes.item.itemId = 2;\n } else if (version === 2) {\n sizes.itemCount = 4;\n sizes.item.itemId = 4;\n }\n if (version === 1 || version === 2) {\n sizes.item.constructionMethod = 2;\n } else {\n sizes.item.constructionMethod = 0;\n }\n\n const offsets = {\n offsetSize: contentOffset,\n lengthSize: contentOffset,\n baseOffsetSize: contentOffset + 1,\n indexSize: contentOffset + 1\n };\n offsets.itemCount = contentOffset + 2;\n offsets.items = offsets.itemCount + sizes.itemCount;\n offsets.item = {\n itemId: 0\n };\n offsets.item.constructionMethod = offsets.item.itemId + sizes.item.itemId;\n offsets.item.dataReferenceIndex = offsets.item.constructionMethod + sizes.item.constructionMethod;\n\n return {offsets, sizes};\n}\n\nfunction getIndexSize(dataView, offset, version) {\n if (version === 1 || version === 2) {\n return dataView.getUint8(offset) & 0x0f;\n }\n return undefined;\n}\n\nfunction getItemCount(dataView, offset, version) {\n if (version < 2) {\n return dataView.getUint16(offset);\n } else if (version === 2) {\n return dataView.getUint32(offset);\n }\n return undefined;\n}\n\nfunction getItems(dataView, version, offsets, sizes, offsetSize, lengthSize, indexSize, itemCount) {\n if (itemCount === undefined) {\n return [];\n }\n\n const items = [];\n let offset = offsets.items;\n\n for (let i = 0; i < itemCount; i++) {\n const item = {extents: []};\n item.itemId = getItemId(dataView, offset, version);\n offset += sizes.item.itemId;\n item.constructionMethod = (version === 1) || (version === 2) ? dataView.getUint16(offset) & 0x0f : undefined;\n offset += sizes.item.constructionMethod;\n item.dataReferenceIndex = dataView.getUint16(offset);\n offset += sizes.item.dataReferenceIndex;\n item.baseOffset = getVariableSizedValue(dataView, offset, sizes.item.baseOffset);\n offset += sizes.item.baseOffset;\n item.extentCount = dataView.getUint16(offset);\n offset += sizes.item.extentCount;\n for (let j = 0; j < item.extentCount; j++) {\n const extent = {};\n\n extent.extentIndex = getExtentIndex(dataView, version, offset, indexSize);\n offset += sizes.item.extent.extentIndex;\n extent.extentOffset = getVariableSizedValue(dataView, offset, offsetSize);\n offset += sizes.item.extent.extentOffset;\n extent.extentLength = getVariableSizedValue(dataView, offset, lengthSize);\n offset += sizes.item.extent.extentLength;\n\n item.extents.push(extent);\n }\n\n items.push(item);\n }\n\n return items;\n}\n\nfunction getItemId(dataView, offset, version) {\n if (version < 2) {\n return dataView.getUint16(offset);\n } else if (version === 2) {\n return dataView.getUint32(offset);\n }\n return undefined;\n}\n\nfunction getExtentIndex(dataView, version, offset, indexSize) {\n if ((version === 1 || version === 2) && indexSize > 0) {\n return getVariableSizedValue(dataView, offset, indexSize);\n }\n return undefined;\n}\n\nfunction getVariableSizedValue(dataView, offset, size) {\n if (size === 4) {\n return dataView.getUint32(offset);\n }\n if (size === 8) {\n // eslint-disable-next-line no-console\n console.warn('This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed.');\n return get64BitValue(dataView, offset);\n }\n return 0;\n}\n","import Constants from './constants.js';\nimport {getNullTerminatedStringFromDataView, getStringFromDataView} from './utils.js';\n// import {get64BitValue} from './image-header-iso-bmff-utils.js';\nimport {parseItemLocationBox} from './image-header-iso-bmff-iloc.js';\n\n// HEIC and AVIF files are based on the ISO-BMFF format. This file format is\n// built up by boxes. There are boxes and full boxes. All box types have a\n// length (4 or 8 bytes) and a type (4 bytes). Full boxes also have a version\n// (1 byte) and flags (3 bytes). The boxes can be nested. Each box type has its\n// own structure that can be seen in the specification.\n//\n// For metadata we are interested in the meta box. The meta box contains sub\n// boxes. The sub box type iinf has info about which types of metadata are\n// present in the file. The item ID we get from there we then look up in the\n// iloc sub box to get the offset to the real location of the metadata.\n//\n// The ICC profiles is a bit more nested. We have to look in\n// meta > iprp > ipco > colr, and then the whole profile is stored there.\n\n// These are actually 32-bit strings, not random IDs, e.g. \"ftyp\" and \"meta\".\nconst TYPE_FTYP = 0x66747970;\nconst TYPE_IPRP = 0x69707270;\nconst TYPE_META = 0x6d657461;\nconst TYPE_ILOC = 0x696c6f63;\nconst TYPE_IINF = 0x69696e66;\nconst TYPE_INFE = 0x696e6665;\nconst TYPE_IPCO = 0x6970636f;\nconst TYPE_COLR = 0x636f6c72;\n\n// const EXTENSION_TYPE_FDEL = 0x6664656c;\n\nexport const ITEM_INFO_TYPE_EXIF = 0x45786966;\nexport const ITEM_INFO_TYPE_MIME = 0x6d696d65;\nconst ITEM_INFO_TYPE_URI = 0x75726920;\n\n/**\n * Parses a ISO-BMFF box from the provided data view starting at the given offset.\n *\n * @param {DataView} dataView - The DataView to parse.\n * @param {number} offset - The offset at which to start parsing.\n * @returns {Object} The parsed box.\n */\nexport function parseBox(dataView, offset) {\n const BOX_TYPE_OFFSET = 4;\n const BOX_MIN_LENGTH = 8;\n const VERSION_SIZE = 1;\n\n const {length, contentOffset} = getBoxLength(dataView, offset);\n if (length < BOX_MIN_LENGTH) {\n return undefined;\n }\n\n const type = dataView.getUint32(offset + BOX_TYPE_OFFSET);\n\n if (type === TYPE_FTYP) {\n return parseFileTypeBox(dataView, contentOffset, length);\n }\n if (type === TYPE_IPRP) {\n return parseItemPropertiesBox(dataView, offset, contentOffset, length);\n }\n if (type === TYPE_IPCO) {\n return parseItemPropertyContainerBox(dataView, offset, contentOffset, length);\n }\n if (type === TYPE_COLR) {\n return parseColorInformationBox(dataView, contentOffset, length);\n }\n\n // The following are full boxes, also containing version and flags.\n const version = dataView.getUint8(contentOffset);\n\n if (type === TYPE_META) {\n return parseMetadataBox(dataView, offset, contentOffset + VERSION_SIZE, length);\n }\n if (type === TYPE_ILOC) {\n return parseItemLocationBox(dataView, version, contentOffset + VERSION_SIZE, length);\n }\n if (type === TYPE_IINF) {\n return parseItemInformationBox(dataView, offset, version, contentOffset + VERSION_SIZE, length);\n }\n if (type === TYPE_INFE) {\n return parseItemInformationEntryBox(dataView, offset, version, contentOffset + VERSION_SIZE, length);\n }\n\n return {\n // type: getStringFromDataView(dataView, offset + BOX_TYPE_OFFSET, 4),\n type: undefined,\n length\n };\n}\n\n/**\n * @typedef {Object} BoxLength\n * @property {number} length The length of the box including length and type.\n * @property {number} contentOffset\n */\n\n/**\n * @param {DataView} dataView\n * @param {number} offset\n * @returns {BoxLength}\n */\nfunction getBoxLength(dataView, offset) {\n const BOX_LENGTH_SIZE = 4;\n const BOX_TYPE_SIZE = 4;\n const BOX_EXTENDED_SIZE = 8;\n const BOX_EXTENDED_SIZE_LOW_OFFSET = 12;\n\n const boxLength = dataView.getUint32(offset);\n if (extendsToEndOfFile(boxLength)) {\n return {\n length: dataView.byteLength - offset,\n contentOffset: offset + BOX_LENGTH_SIZE + BOX_TYPE_SIZE,\n };\n }\n if (hasExtendedSize(boxLength)) {\n if (hasEmptyHighBits(dataView, offset)) {\n // It's a bit tricky to handle 64 bit numbers in JavaScript. Let's\n // wait until there are real-world examples where it is necessary.\n return {\n length: dataView.getUint32(offset + BOX_EXTENDED_SIZE_LOW_OFFSET),\n contentOffset: offset + BOX_LENGTH_SIZE + BOX_TYPE_SIZE + BOX_EXTENDED_SIZE,\n };\n }\n }\n\n return {\n length: boxLength,\n contentOffset: offset + BOX_LENGTH_SIZE + BOX_TYPE_SIZE,\n };\n}\n\nfunction extendsToEndOfFile(boxLength) {\n return boxLength === 0;\n}\n\nfunction hasExtendedSize(boxLength) {\n return boxLength === 1;\n}\n\nfunction hasEmptyHighBits(dataView, offset) {\n const BOX_EXTENDED_SIZE_OFFSET = 8;\n return dataView.getUint32(offset + BOX_EXTENDED_SIZE_OFFSET) === 0;\n}\n\n/**\n * @typedef {Object} Offsets\n * @property {number} tiffHeaderOffset\n * @property {Array<Object>} xmpChunks\n * @property {Array<Object>} iccChunks\n * @property {boolean} hasAppMarkers\n */\n\n/**\n * Finds the offsets of ISO-BMFF-structued data in the provided data view.\n *\n * @param {DataView} dataView - The data view to find offsets in.\n * @returns {Offsets} An object containing the offsets of the TIFF header, XMP chunks, ICC chunks, and a boolean indicating if any of these exist.\n */\nexport function findOffsets(dataView) {\n if (Constants.USE_EXIF || Constants.USE_XMP || Constants.USE_ICC) {\n const offsets = {};\n const metaBox = findMetaBox(dataView);\n\n if (!metaBox) {\n return {hasAppMarkers: false};\n }\n\n if (Constants.USE_EXIF) {\n offsets.tiffHeaderOffset = findExifOffset(dataView, metaBox);\n }\n if (Constants.USE_XMP) {\n offsets.xmpChunks = findXmpChunks(metaBox);\n }\n if (Constants.USE_ICC) {\n offsets.iccChunks = findIccChunks(metaBox);\n }\n offsets.hasAppMarkers = (offsets.tiffHeaderOffset !== undefined) || (offsets.xmpChunks !== undefined) || (offsets.iccChunks !== undefined);\n return offsets;\n }\n\n return {};\n}\n\nfunction findMetaBox(dataView) {\n const BOX_LENGTH_SIZE = 4;\n const BOX_TYPE_SIZE = 4;\n\n let offset = 0;\n\n while (offset + BOX_LENGTH_SIZE + BOX_TYPE_SIZE <= dataView.byteLength) {\n const box = parseBox(dataView, offset);\n\n if (box === undefined) {\n break;\n }\n\n if (box.type === 'meta') {\n return box;\n }\n\n offset += box.length;\n }\n\n return undefined;\n}\n\nfunction findExifOffset(dataView, metaBox) {\n try {\n const exifItemId = findIinfExifItemId(metaBox).itemId;\n const ilocItem = findIlocItem(metaBox, exifItemId);\n const exifOffset = ilocItem.baseOffset + ilocItem.extents[0].extentOffset;\n return getTiffHeaderOffset(dataView, exifOffset);\n } catch (error) {\n return undefined;\n }\n}\n\nfunction findIinfExifItemId(metaBox) {\n return metaBox.subBoxes.find((box) => box.type === 'iinf').itemInfos.find((itemInfo) => itemInfo.itemType === ITEM_INFO_TYPE_EXIF);\n}\n\nfunction findIlocItem(metaBox, itemId) {\n return metaBox.subBoxes.find((box) => box.type === 'iloc').items.find((item) => item.itemId === itemId);\n}\n\nfunction getTiffHeaderOffset(dataView, exifOffset) {\n // ISO-BMFF formatted files store the Exif data as an \"Exif block\" where the\n // first 32 bits is the TIFF header offset.\n const TIFF_HEADER_OFFSET_SIZE = 4;\n return exifOffset + TIFF_HEADER_OFFSET_SIZE + dataView.getUint32(exifOffset);\n}\n\nfunction findXmpChunks(metaBox) {\n try {\n const xmpItemId = findIinfXmpItemId(metaBox).itemId;\n const ilocItem = findIlocItem(metaBox, xmpItemId);\n const ilocItemExtent = findIlocItem(metaBox, xmpItemId).extents[0];\n return [\n {\n dataOffset: ilocItem.baseOffset + ilocItemExtent.extentOffset,\n length: ilocItemExtent.extentLength,\n }\n ];\n } catch (error) {\n return undefined;\n }\n}\n\nfunction findIinfXmpItemId(metaBox) {\n return metaBox.subBoxes.find((box) => box.type === 'iinf')\n .itemInfos.find((itemInfo) => itemInfo.itemType === ITEM_INFO_TYPE_MIME && itemInfo.contentType === 'application/rdf+xml');\n}\n\nfunction findIccChunks(metaBox) {\n // This finds the first ICC chunk, but there could be one for each image\n // that is embedded in the file. If it turns out we need to match the ICC\n // chunk to a specific image, we need to check the \"ipma\" in addition to the\n // \"ipco\" (currently we only extract the \"ipco\" so more code would be\n // needed).\n try {\n const icc = metaBox.subBoxes.find((box) => box.type === 'iprp')\n .subBoxes.find((box) => box.type === 'ipco')\n .properties.find((box) => box.type === 'colr')\n .icc;\n if (icc) {\n return [icc];\n }\n } catch (error) {\n // Let it pass through.\n }\n return undefined;\n}\n\nfunction parseFileTypeBox(dataView, contentOffset, boxLength) {\n const MAJOR_BRAND_SIZE = 4;\n const majorBrand = getStringFromDataView(dataView, contentOffset, MAJOR_BRAND_SIZE);\n\n return {\n type: 'ftyp',\n majorBrand,\n length: boxLength\n };\n}\n\nfunction parseItemPropertiesBox(dataView, startOffset, contentOffset, length) {\n return {\n type: 'iprp',\n subBoxes: parseSubBoxes(dataView, contentOffset, length - (contentOffset - startOffset)),\n length,\n };\n}\n\nfunction parseItemPropertyContainerBox(dataView, startOffset, contentOffset, length) {\n return {\n type: 'ipco',\n properties: parseSubBoxes(dataView, contentOffset, length - (contentOffset - startOffset)),\n length,\n };\n}\n\nfunction parseColorInformationBox(dataView, contentOffset, length) {\n return {\n type: 'colr',\n icc: parseIcc(dataView, contentOffset),\n length,\n };\n}\n\nfunction parseIcc(dataView, contentOffset) {\n const COLOR_TYPE_SIZE = 4;\n\n const colorType = getStringFromDataView(dataView, contentOffset, COLOR_TYPE_SIZE);\n if (colorType !== 'prof' && colorType !== 'rICC') {\n // Support for nclx would require some restructuring for ICC handling.\n // Probably do it as a separate feature instead of combining with ICC.\n // Exiftool groups it under QuickTime. The test file test.avif has nclx.\n return undefined;\n }\n\n return {\n offset: contentOffset + COLOR_TYPE_SIZE,\n length: dataView.getUint32(contentOffset + COLOR_TYPE_SIZE),\n chunkNumber: 1,\n chunksTotal: 1\n };\n}\n\nfunction parseMetadataBox(dataView, startOffset, contentOffset, length) {\n const FLAGS_SIZE = 3;\n\n return {\n type: 'meta',\n subBoxes: parseSubBoxes(dataView, contentOffset + FLAGS_SIZE, length - (contentOffset + FLAGS_SIZE - startOffset)),\n length\n };\n}\n\n/**\n * @param {DataView} dataView\n * @param {number} offset The offset to start parsing from.\n * @param {number} length The length of all sub boxes combined.\n * @return {Array<Object>}\n */\nfunction parseSubBoxes(dataView, offset, length) {\n const ACCEPTED_ITEM_INFO_TYPES = [\n ITEM_INFO_TYPE_EXIF,\n ITEM_INFO_TYPE_MIME,\n ];\n\n const subBoxes = [];\n let currentOffset = offset;\n while (currentOffset < offset + length) {\n const box = parseBox(dataView, currentOffset);\n if (box === undefined) {\n break;\n }\n if (box.type !== undefined && (box.itemType === undefined || ACCEPTED_ITEM_INFO_TYPES.indexOf(box.itemType) !== -1)) {\n subBoxes.push(box);\n }\n currentOffset += box.length;\n }\n return subBoxes;\n}\n\nfunction parseItemInformationBox(dataView, startOffset, version, contentOffset, length) {\n const {offsets} = getItemInformationBoxOffsetsAndSizes(version, contentOffset);\n\n return {\n type: 'iinf',\n itemInfos: parseSubBoxes(dataView, offsets.itemInfos, length - (offsets.itemInfos - startOffset)),\n length\n };\n}\n\nfunction getItemInformationBoxOffsetsAndSizes(version, contentOffset) {\n const FLAGS_SIZE = 3;\n\n const offsets = {entryCount: contentOffset + FLAGS_SIZE};\n const sizes = {};\n\n if (version === 0) {\n sizes.entryCount = 2;\n } else {\n sizes.entryCount = 4;\n }\n\n offsets.itemInfos = offsets.entryCount + sizes.entryCount;\n\n return {offsets};\n}\n\nfunction parseItemInformationEntryBox(dataView, startOffset, version, contentOffset, length) {\n const FLAGS_SIZE = 3;\n\n contentOffset += FLAGS_SIZE;\n const entry = {type: 'infe', length};\n\n if (version === 0 || version === 1) {\n entry.itemId = dataView.getUint16(contentOffset);\n contentOffset += 2;\n entry.itemProtectionIndex = dataView.getUint16(contentOffset);\n contentOffset += 2;\n entry.itemName = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.itemName.length + 1;\n // entry.contentType = getNullTerminatedStringFromDataView(dataView, offset);\n // offset += entry.contentType.length + 1;\n // Since contentEncoding is optional we need to check the offset against length here.\n // entry.contentEncoding = getNullTerminatedStringFromDataView(dataView, offset);\n // offset += entry.contentEncoding.length + 1;\n }\n // The following code should be correct but we currently don't need it.\n // if (version === 1) {\n // // Everything here is optional, check the offset against length.\n // entry.extensionType = dataView.getUint32(contentOffset);\n // contentOffset += 4;\n // if (entry.extensionType === EXTENSION_TYPE_FDEL) {\n // entry.contentLocation = getNullTerminatedStringFromDataView(dataView, contentOffset);\n // contentOffset += entry.contentLocation.length + 1;\n // entry.contentMd5 = getNullTerminatedStringFromDataView(dataView, contentOffset);\n // contentOffset += entry.contentMd5.length + 1;\n // entry.contentLength = get64BitValue(dataView, contentOffset);\n // contentOffset += 8;\n // entry.transferLength = get64BitValue(dataView, contentOffset);\n // contentOffset += 8;\n // entry.entryCount = dataView.getUint8(contentOffset);\n // contentOffset += 1;\n // entry.entries = [];\n // for (let i = 0; i < entry.entryCount; i++) {\n // entry.entries.push({groupId: dataView.getUint32(contentOffset)});\n // contentOffset += 4;\n // }\n // }\n // }\n if (version >= 2) {\n if (version === 2) {\n entry.itemId = dataView.getUint16(contentOffset);\n contentOffset += 2;\n } else if (version === 3) {\n entry.itemId = dataView.getUint32(contentOffset);\n contentOffset += 4;\n }\n entry.itemProtectionIndex = dataView.getUint16(contentOffset);\n contentOffset += 2;\n // entry.itemTypeAscii = getStringFromDataView(dataView, offset, 4); // For testing.\n entry.itemType = dataView.getUint32(contentOffset);\n contentOffset += 4;\n entry.itemName = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.itemName.length + 1;\n if (entry.itemType === ITEM_INFO_TYPE_MIME) {\n entry.contentType = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.contentType.length + 1;\n if (startOffset + length > contentOffset) {\n entry.contentEncoding = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.contentEncoding.length + 1;\n }\n } else if (entry.itemType === ITEM_INFO_TYPE_URI) {\n entry.itemUri = getNullTerminatedStringFromDataView(dataView, contentOffset);\n contentOffset += entry.itemUri.length + 1;\n }\n }\n return entry;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {parseBox, findOffsets} from './image-header-iso-bmff.js';\n\nexport default {\n isHeicFile,\n findHeicOffsets\n};\n\n/**\n * Checks if the provided data view represents a HEIC/HEIF file.\n *\n * @param {DataView} dataView - The data view to check.\n * @returns {boolean} True if the data view represents a HEIC/HEIF file, false otherwise.\n */\nfunction isHeicFile(dataView) {\n if (!dataView) {\n return false;\n }\n\n const HEIC_MAJOR_BRANDS = ['heic', 'heix', 'hevc', 'hevx', 'heim', 'heis', 'hevm', 'hevs', 'mif1'];\n\n try {\n const headerBox = parseBox(dataView, 0);\n return headerBox && HEIC_MAJOR_BRANDS.indexOf(headerBox.majorBrand) !== -1;\n } catch (error) {\n return false;\n }\n}\n\n/**\n * Finds the offsets of a HEIC file in the provided data view.\n *\n * @param {DataView} dataView - The data view to find offsets in.\n * @returns {Object} An object containing the offsets of the TIFF header, XMP chunks, ICC chunks, and a boolean indicating if any of these exist.\n */\nfunction findHeicOffsets(dataView) {\n return findOffsets(dataView);\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// Specification:\n// https://aomediacodec.github.io/av1-avif\n\nimport {parseBox, findOffsets} from './image-header-iso-bmff.js';\n\nexport default {\n isAvifFile,\n findAvifOffsets\n};\n\n/**\n * Checks if the provided data view represents an AVIF file.\n *\n * @param {DataView} dataView - The data view to check.\n * @returns {boolean} True if the data view represents an AVIF file, false otherwise.\n */\nfunction isAvifFile(dataView) {\n if (!dataView) {\n return false;\n }\n\n try {\n const headerBox = parseBox(dataView, 0);\n return headerBox && headerBox.majorBrand === 'avif';\n } catch (error) {\n return false;\n }\n}\n\n/**\n * Finds the offsets of an AVIF file in the provided data view.\n *\n * @param {DataView} dataView - The data view to find offsets in.\n * @returns {Object} An object containing the offsets of the TIFF header, XMP chunks, ICC chunks, and a boolean indicating if any of these exist.\n */\nfunction findAvifOffsets(dataView) {\n return findOffsets(dataView);\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isWebpFile,\n findOffsets\n};\n\nfunction isWebpFile(dataView) {\n const RIFF_ID_OFFSET = 0;\n const RIFF_ID = 'RIFF';\n const WEBP_MARKER_OFFSET = 8;\n const WEBP_MARKER = 'WEBP';\n\n return !!dataView && getStringFromDataView(dataView, RIFF_ID_OFFSET, RIFF_ID.length) === RIFF_ID\n && getStringFromDataView(dataView, WEBP_MARKER_OFFSET, WEBP_MARKER.length) === WEBP_MARKER;\n}\n\nfunction findOffsets(dataView) {\n const SUB_CHUNK_START_OFFSET = 12;\n const CHUNK_SIZE_OFFSET = 4;\n const EXIF_IDENTIFIER = 'Exif\\x00\\x00';\n const CHUNK_HEADER_SIZE = 8;\n\n let offset = SUB_CHUNK_START_OFFSET;\n let hasAppMarkers = false;\n let tiffHeaderOffset;\n let xmpChunks;\n let iccChunks;\n let vp8xChunkOffset;\n\n while (offset + CHUNK_HEADER_SIZE < dataView.byteLength) {\n const chunkId = getStringFromDataView(dataView, offset, 4);\n const chunkSize = dataView.getUint32(offset + CHUNK_SIZE_OFFSET, true);\n\n if (Constants.USE_EXIF && (chunkId === 'EXIF')) {\n hasAppMarkers = true;\n if (getStringFromDataView(dataView, offset + CHUNK_HEADER_SIZE, EXIF_IDENTIFIER.length) === EXIF_IDENTIFIER) {\n tiffHeaderOffset = offset + CHUNK_HEADER_SIZE + EXIF_IDENTIFIER.length;\n } else {\n tiffHeaderOffset = offset + CHUNK_HEADER_SIZE;\n }\n } else if (Constants.USE_XMP && (chunkId === 'XMP ')) {\n hasAppMarkers = true;\n xmpChunks = [{\n dataOffset: offset + CHUNK_HEADER_SIZE,\n length: chunkSize\n }];\n } else if (Constants.USE_ICC && (chunkId === 'ICCP')) {\n hasAppMarkers = true;\n iccChunks = [{\n offset: offset + CHUNK_HEADER_SIZE,\n length: chunkSize,\n chunkNumber: 1,\n chunksTotal: 1\n }];\n } else if (chunkId === 'VP8X') {\n hasAppMarkers = true;\n vp8xChunkOffset = offset + CHUNK_HEADER_SIZE;\n }\n\n offset += CHUNK_HEADER_SIZE + (chunkSize % 2 === 0 ? chunkSize : chunkSize + 1);\n }\n\n return {\n hasAppMarkers,\n tiffHeaderOffset,\n xmpChunks,\n iccChunks,\n vp8xChunkOffset\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\n\nexport default {\n isGifFile,\n findOffsets\n};\n\nconst GIF_SIGNATURE_SIZE = 6;\nconst GIF_SIGNATURES = ['GIF87a', 'GIF89a'];\n\nfunction isGifFile(dataView) {\n return !!dataView && GIF_SIGNATURES.includes(getStringFromDataView(dataView, 0, GIF_SIGNATURE_SIZE));\n}\n\nfunction findOffsets() {\n return {\n gifHeaderOffset: 0\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Constants from './constants.js';\nimport Tiff from './image-header-tiff.js';\nimport Jpeg from './image-header-jpeg.js';\nimport Png from './image-header-png.js';\nimport Heic from './image-header-heic.js';\nimport Avif from './image-header-avif.js';\nimport Webp from './image-header-webp.js';\nimport Gif from './image-header-gif.js';\nimport {objectAssign} from './utils.js';\n\nexport default {\n parseAppMarkers\n};\n\nfunction parseAppMarkers(dataView, async) {\n if (Constants.USE_TIFF && Tiff.isTiffFile(dataView)) {\n return addFileType(Tiff.findTiffOffsets(), 'tiff', 'TIFF');\n }\n\n if (Constants.USE_JPEG && Jpeg.isJpegFile(dataView)) {\n return addFileType(Jpeg.findJpegOffsets(dataView), 'jpeg', 'JPEG');\n }\n\n if (Constants.USE_PNG && Png.isPngFile(dataView)) {\n return addFileType(Png.findPngOffsets(dataView, async), 'png', 'PNG');\n }\n\n if (Constants.USE_HEIC && Heic.isHeicFile(dataView)) {\n return addFileType(Heic.findHeicOffsets(dataView), 'heic', 'HEIC');\n }\n\n if (Constants.USE_AVIF && Avif.isAvifFile(dataView)) {\n return addFileType(Avif.findAvifOffsets(dataView), 'avif', 'AVIF');\n }\n\n if (Constants.USE_WEBP && Webp.isWebpFile(dataView)) {\n return addFileType(Webp.findOffsets(dataView), 'webp', 'WebP');\n }\n\n if (Constants.USE_GIF && Gif.isGifFile(dataView)) {\n return addFileType(Gif.findOffsets(dataView), 'gif', 'GIF');\n }\n\n throw new Error('Invalid image format');\n}\n\nfunction addFileType(offsets, fileType, fileTypeDescription) {\n return objectAssign({}, offsets, {fileType: {value: fileType, description: fileTypeDescription}});\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n ApertureValue: (value) => Math.pow(Math.sqrt(2), value[0] / value[1]).toFixed(2),\n ColorSpace(value) {\n if (value === 1) {\n return 'sRGB';\n } else if (value === 0xffff) {\n return 'Uncalibrated';\n }\n return 'Unknown';\n },\n ComponentsConfiguration(value) {\n return value.map((character) => {\n if (character === 0x31) {\n return 'Y';\n } else if (character === 0x32) {\n return 'Cb';\n } else if (character === 0x33) {\n return 'Cr';\n } else if (character === 0x34) {\n return 'R';\n } else if (character === 0x35) {\n return 'G';\n } else if (character === 0x36) {\n return 'B';\n }\n }).join('');\n },\n Contrast(value) {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Soft';\n } else if (value === 2) {\n return 'Hard';\n }\n return 'Unknown';\n },\n CustomRendered(value) {\n if (value === 0) {\n return 'Normal process';\n } else if (value === 1) {\n return 'Custom process';\n }\n return 'Unknown';\n },\n ExposureMode(value) {\n if (value === 0) {\n return 'Auto exposure';\n } else if (value === 1) {\n return 'Manual exposure';\n } else if (value === 2) {\n return 'Auto bracket';\n }\n return 'Unknown';\n },\n ExposureProgram(value) {\n if (value === 0) {\n return 'Undefined';\n } else if (value === 1) {\n return 'Manual';\n } else if (value === 2) {\n return 'Normal program';\n } else if (value === 3) {\n return 'Aperture priority';\n } else if (value === 4) {\n return 'Shutter priority';\n } else if (value === 5) {\n return 'Creative program';\n } else if (value === 6) {\n return 'Action program';\n } else if (value === 7) {\n return 'Portrait mode';\n } else if (value === 8) {\n return 'Landscape mode';\n } else if (value === 9) {\n return 'Bulb';\n }\n return 'Unknown';\n },\n ExposureTime(value) {\n if (value[0] / value[1] > 0.25) {\n const decimal = value[0] / value[1];\n if (Number.isInteger(decimal)) {\n return '' + decimal;\n }\n return decimal.toFixed(1);\n }\n if (value[0] !== 0) {\n return `1/${Math.round(value[1] / value[0])}`;\n }\n return `0/${value[1]}`;\n },\n FNumber: (value) => `f/${value[0] / value[1]}`,\n FocalLength: (value) => (value[0] / value[1]) + ' mm',\n FocalPlaneResolutionUnit(value) {\n if (value === 2) {\n return 'inches';\n } else if (value === 3) {\n return 'centimeters';\n }\n return 'Unknown';\n },\n LightSource: (value) => {\n if (value === 1) {\n return 'Daylight';\n } else if (value === 2) {\n return 'Fluorescent';\n } else if (value === 3) {\n return 'Tungsten (incandescent light)';\n } else if (value === 4) {\n return 'Flash';\n } else if (value === 9) {\n return 'Fine weather';\n } else if (value === 10) {\n return 'Cloudy weather';\n } else if (value === 11) {\n return 'Shade';\n } else if (value === 12) {\n return 'Daylight fluorescent (D 5700 – 7100K)';\n } else if (value === 13) {\n return 'Day white fluorescent (N 4600 – 5400K)';\n } else if (value === 14) {\n return 'Cool white fluorescent (W 3900 – 4500K)';\n } else if (value === 15) {\n return 'White fluorescent (WW 3200 – 3700K)';\n } else if (value === 17) {\n return 'Standard light A';\n } else if (value === 18) {\n return 'Standard light B';\n } else if (value === 19) {\n return 'Standard light C';\n } else if (value === 20) {\n return 'D55';\n } else if (value === 21) {\n return 'D65';\n } else if (value === 22) {\n return 'D75';\n } else if (value === 23) {\n return 'D50';\n } else if (value === 24) {\n return 'ISO studio tungsten';\n } else if (value === 255) {\n return 'Other light source';\n }\n return 'Unknown';\n },\n MeteringMode(value) {\n if (value === 1) {\n return 'Average';\n } else if (value === 2) {\n return 'CenterWeightedAverage';\n } else if (value === 3) {\n return 'Spot';\n } else if (value === 4) {\n return 'MultiSpot';\n } else if (value === 5) {\n return 'Pattern';\n } else if (value === 6) {\n return 'Partial';\n } else if (value === 255) {\n return 'Other';\n }\n return 'Unknown';\n },\n ResolutionUnit(value) {\n if (value === 2) {\n return 'inches';\n }\n if (value === 3) {\n return 'centimeters';\n }\n return 'Unknown';\n },\n Saturation(value) {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Low saturation';\n } else if (value === 2) {\n return 'High saturation';\n }\n return 'Unknown';\n },\n SceneCaptureType(value) {\n if (value === 0) {\n return 'Standard';\n } else if (value === 1) {\n return 'Landscape';\n } else if (value === 2) {\n return 'Portrait';\n } else if (value === 3) {\n return 'Night scene';\n }\n return 'Unknown';\n },\n Sharpness(value) {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Soft';\n } else if (value === 2) {\n return 'Hard';\n }\n return 'Unknown';\n },\n ShutterSpeedValue(value) {\n const denominator = Math.pow(2, value[0] / value[1]);\n if (denominator <= 1) {\n return `${Math.round(1 / denominator)}`;\n }\n return `1/${Math.round(denominator)}`;\n },\n WhiteBalance(value) {\n if (value === 0) {\n return 'Auto white balance';\n } else if (value === 1) {\n return 'Manual white balance';\n }\n return 'Unknown';\n },\n XResolution: (value) => '' + Math.round(value[0] / value[1]),\n YResolution: (value) => '' + Math.round(value[0] / value[1])\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 0x000b: 'ProcessingSoftware',\n 0x00fe: {\n name: 'SubfileType',\n description: (value) => ({\n 0x0: 'Full-resolution image',\n 0x1: 'Reduced-resolution image',\n 0x2: 'Single page of multi-page image',\n 0x3: 'Single page of multi-page reduced-resolution image',\n 0x4: 'Transparency mask',\n 0x5: 'Transparency mask of reduced-resolution image',\n 0x6: 'Transparency mask of multi-page image',\n 0x7: 'Transparency mask of reduced-resolution multi-page image',\n 0x10001: 'Alternate reduced-resolution image',\n 0xffffffff: 'Invalid'\n })[value] || 'Unknown'\n },\n 0x00ff: {\n name: 'OldSubfileType',\n description: (value) => ({\n 0: 'Full-resolution image',\n 1: 'Reduced-resolution image',\n 2: 'Single page of multi-page image'\n })[value] || 'Unknown'\n },\n 0x0100: 'ImageWidth',\n 0x0101: 'ImageLength',\n 0x0102: 'BitsPerSample',\n 0x0103: 'Compression',\n 0x0106: 'PhotometricInterpretation',\n 0x0107: {\n name: 'Thresholding',\n description: (value) => ({\n 1: 'No dithering or halftoning',\n 2: 'Ordered dither or halfton',\n 3: 'Randomized dither'\n })[value] || 'Unknown'\n },\n 0x0108: 'CellWidth',\n 0x0109: 'CellLength',\n 0x010a: {\n name: 'FillOrder',\n description: (value) => ({\n 1: 'Normal',\n 2: 'Reversed'\n })[value] || 'Unknown'\n },\n 0x010d: 'DocumentName',\n 0x010e: 'ImageDescription',\n 0x010f: 'Make',\n 0x0110: 'Model',\n 0x0111: 'StripOffsets',\n 0x0112: {\n name: 'Orientation',\n description: (value) => {\n if (value === 1) {\n return 'top-left';\n }\n if (value === 2) {\n return 'top-right';\n }\n if (value === 3) {\n return 'bottom-right';\n }\n if (value === 4) {\n return 'bottom-left';\n }\n if (value === 5) {\n return 'left-top';\n }\n if (value === 6) {\n return 'right-top';\n }\n if (value === 7) {\n return 'right-bottom';\n }\n if (value === 8) {\n return 'left-bottom';\n }\n return 'Undefined';\n }\n },\n 0x0115: 'SamplesPerPixel',\n 0x0116: 'RowsPerStrip',\n 0x0117: 'StripByteCounts',\n 0x0118: 'MinSampleValue',\n 0x0119: 'MaxSampleValue',\n 0x011a: {\n 'name': 'XResolution',\n 'description': TagNamesCommon.XResolution\n },\n 0x011b: {\n 'name': 'YResolution',\n 'description': TagNamesCommon.YResolution\n },\n 0x011c: 'PlanarConfiguration',\n 0x011d: 'PageName',\n 0x011e: {\n 'name': 'XPosition',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x011f: {\n 'name': 'YPosition',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x0122: {\n name: 'GrayResponseUnit',\n description: (value) => ({\n 1: '0.1',\n 2: '0.001',\n 3: '0.0001',\n 4: '1e-05',\n 5: '1e-06'\n })[value] || 'Unknown'\n },\n 0x0128: {\n name: 'ResolutionUnit',\n description: TagNamesCommon.ResolutionUnit\n },\n 0x0129: 'PageNumber',\n 0x012d: 'TransferFunction',\n 0x0131: 'Software',\n 0x0132: 'DateTime',\n 0x013b: 'Artist',\n 0x013c: 'HostComputer',\n 0x013d: 'Predictor',\n 0x013e: {\n 'name': 'WhitePoint',\n 'description': (values) => {\n return values.map((value) => `${value[0]}/${value[1]}`).join(', ');\n }\n },\n 0x013f: {\n 'name': 'PrimaryChromaticities',\n 'description': (values) => {\n return values.map((value) => `${value[0]}/${value[1]}`).join(', ');\n }\n },\n 0x0141: 'HalftoneHints',\n 0x0142: 'TileWidth',\n 0x0143: 'TileLength',\n 0x014a: 'A100DataOffset',\n 0x014c: {\n name: 'InkSet',\n description: (value) => ({\n 1: 'CMYK',\n 2: 'Not CMYK'\n })[value] || 'Unknown'\n },\n 0x0151: 'TargetPrinter',\n 0x0152: {\n name: 'ExtraSamples',\n description: (value) => ({\n 0: 'Unspecified',\n 1: 'Associated Alpha',\n 2: 'Unassociated Alpha',\n })[value] || 'Unknown'\n },\n 0x0153: {\n name: 'SampleFormat',\n description: (value) => {\n const formats = {\n 1: 'Unsigned',\n 2: 'Signed',\n 3: 'Float',\n 4: 'Undefined',\n 5: 'Complex int',\n 6: 'Complex float',\n };\n if (!Array.isArray(value)) {\n return 'Unknown';\n }\n return value.map((sample) => formats[sample] || 'Unknown').join(', ');\n }\n },\n 0x0201: 'JPEGInterchangeFormat',\n 0x0202: 'JPEGInterchangeFormatLength',\n 0x0211: {\n 'name': 'YCbCrCoefficients',\n 'description': (values) => {\n return values.map((value) => '' + value[0] / value[1]).join('/');\n }\n },\n 0x0212: 'YCbCrSubSampling',\n 0x0213: {\n name: 'YCbCrPositioning',\n description: (value) => {\n if (value === 1) {\n return 'centered';\n }\n if (value === 2) {\n return 'co-sited';\n }\n return 'undefined ' + value;\n }\n },\n 0x0214: {\n 'name': 'ReferenceBlackWhite',\n 'description': (values) => {\n return values.map((value) => '' + value[0] / value[1]).join(', ');\n }\n },\n 0x02bc: 'ApplicationNotes',\n 0x4746: 'Rating',\n 0x4749: 'RatingPercent',\n 0x8298: {\n name: 'Copyright',\n description: (value) => value.join('; ')\n },\n 0x830e: 'PixelScale',\n 0x83bb: 'IPTC-NAA',\n 0x8480: 'IntergraphMatrix',\n 0x8482: 'ModelTiePoint',\n 0x8546: 'SEMInfo',\n 0x85d8: 'ModelTransform',\n 0x8649: 'PhotoshopSettings',\n 0x8769: 'Exif IFD Pointer',\n 0x8773: 'ICC_Profile',\n 0x87af: 'GeoTiffDirectory',\n 0x87b0: 'GeoTiffDoubleParams',\n 0x87b1: 'GeoTiffAsciiParams',\n 0x8825: 'GPS Info IFD Pointer',\n 0x9c9b: 'XPTitle',\n 0x9c9c: 'XPComment',\n 0x9c9d: 'XPAuthor',\n 0x9c9e: 'XPKeywords',\n 0x9c9f: 'XPSubject',\n 0xa480: 'GDALMetadata',\n 0xa481: 'GDALNoData',\n 0xc4a5: 'PrintIM',\n 0xc613: 'DNGBackwardVersion',\n 0xc614: 'UniqueCameraModel',\n 0xc615: 'LocalizedCameraModel',\n 0xc621: 'ColorMatrix1',\n 0xc622: 'ColorMatrix2',\n 0xc623: 'CameraCalibration1',\n 0xc624: 'CameraCalibration2',\n 0xc625: 'ReductionMatrix1',\n 0xc626: 'ReductionMatrix2',\n 0xc627: 'AnalogBalance',\n 0xc628: 'AsShotNeutral',\n 0xc629: 'AsShotWhiteXY',\n 0xc62a: 'BaselineExposure',\n 0xc62b: 'BaselineNoise',\n 0xc62c: 'BaselineSharpness',\n 0xc62e: 'LinearResponseLimit',\n 0xc62f: 'CameraSerialNumber',\n 0xc630: 'DNGLensInfo',\n 0xc633: 'ShadowScale',\n 0xc635: {\n name: 'MakerNoteSafety',\n description: (value) => ({\n 0: 'Unsafe',\n 1: 'Safe'\n })[value] || 'Unknown'\n },\n 0xc65a: {\n name: 'CalibrationIlluminant1',\n description: TagNamesCommon['LightSource']\n },\n 0xc65b: {\n name: 'CalibrationIlluminant2',\n description: TagNamesCommon['LightSource']\n },\n 0xc65d: 'RawDataUniqueID',\n 0xc68b: 'OriginalRawFileName',\n 0xc68c: 'OriginalRawFileData',\n 0xc68f: 'AsShotICCProfile',\n 0xc690: 'AsShotPreProfileMatrix',\n 0xc691: 'CurrentICCProfile',\n 0xc692: 'CurrentPreProfileMatrix',\n 0xc6bf: 'ColorimetricReference',\n 0xc6c5: 'SRawType',\n 0xc6d2: 'PanasonicTitle',\n 0xc6d3: 'PanasonicTitle2',\n 0xc6f3: 'CameraCalibrationSig',\n 0xc6f4: 'ProfileCalibrationSig',\n 0xc6f5: 'ProfileIFD',\n 0xc6f6: 'AsShotProfileName',\n 0xc6f8: 'ProfileName',\n 0xc6f9: 'ProfileHueSatMapDims',\n 0xc6fa: 'ProfileHueSatMapData1',\n 0xc6fb: 'ProfileHueSatMapData2',\n 0xc6fc: 'ProfileToneCurve',\n 0xc6fd: {\n name: 'ProfileEmbedPolicy',\n description: (value) => ({\n 0: 'Allow Copying',\n 1: 'Embed if Used',\n 2: 'Never Embed',\n 3: 'No Restrictions'\n })[value] || 'Unknown'\n },\n 0xc6fe: 'ProfileCopyright',\n 0xc714: 'ForwardMatrix1',\n 0xc715: 'ForwardMatrix2',\n 0xc716: 'PreviewApplicationName',\n 0xc717: 'PreviewApplicationVersion',\n 0xc718: 'PreviewSettingsName',\n 0xc719: 'PreviewSettingsDigest',\n 0xc71a: {\n name: 'PreviewColorSpace',\n description: (value) => ({\n 1: 'Gray Gamma 2.2',\n 2: 'sRGB',\n 3: 'Adobe RGB',\n 4: 'ProPhoto RGB'\n })[value] || 'Unknown'\n },\n 0xc71b: 'PreviewDateTime',\n 0xc71c: 'RawImageDigest',\n 0xc71d: 'OriginalRawFileDigest',\n 0xc725: 'ProfileLookTableDims',\n 0xc726: 'ProfileLookTableData',\n 0xc763: 'TimeCodes',\n 0xc764: 'FrameRate',\n 0xc772: 'TStop',\n 0xc789: 'ReelName',\n 0xc791: 'OriginalDefaultFinalSize',\n 0xc792: 'OriginalBestQualitySize',\n 0xc793: 'OriginalDefaultCropSize',\n 0xc7a1: 'CameraLabel',\n 0xc7a3: {\n name: 'ProfileHueSatMapEncoding',\n description: (value) => ({\n 0: 'Linear',\n 1: 'sRGB'\n })[value] || 'Unknown'\n },\n 0xc7a4: {\n name: 'ProfileLookTableEncoding',\n description: (value) => ({\n 0: 'Linear',\n 1: 'sRGB'\n })[value] || 'Unknown'\n },\n 0xc7a5: 'BaselineExposureOffset',\n 0xc7a6: {\n name: 'DefaultBlackRender',\n description: (value) => ({\n 0: 'Auto',\n 1: 'None'\n })[value] || 'Unknown'\n },\n 0xc7a7: 'NewRawImageDigest',\n 0xc7a8: 'RawToPreviewGain'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue, getEncodedString} from './tag-names-utils.js';\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 0x829a: {\n 'name': 'ExposureTime',\n 'description': TagNamesCommon.ExposureTime\n },\n 0x829d: {\n 'name': 'FNumber',\n 'description': TagNamesCommon.FNumber\n },\n 0x8822: {\n 'name': 'ExposureProgram',\n 'description': TagNamesCommon.ExposureProgram\n },\n 0x8824: 'SpectralSensitivity',\n 0x8827: 'ISOSpeedRatings',\n 0x8828: {\n 'name': 'OECF',\n 'description': () => '[Raw OECF table data]'\n },\n 0x882a: 'TimeZoneOffset',\n 0x882b: 'SelfTimerMode',\n 0x8830: {\n name: 'SensitivityType',\n description: (value) => ({\n 1: 'Standard Output Sensitivity',\n 2: 'Recommended Exposure Index',\n 3: 'ISO Speed',\n 4: 'Standard Output Sensitivity and Recommended Exposure Index',\n 5: 'Standard Output Sensitivity and ISO Speed',\n 6: 'Recommended Exposure Index and ISO Speed',\n 7: 'Standard Output Sensitivity, Recommended Exposure Index and ISO Speed'\n })[value] || 'Unknown'\n },\n 0x8831: 'StandardOutputSensitivity',\n 0x8832: 'RecommendedExposureIndex',\n 0x8833: 'ISOSpeed',\n 0x8834: 'ISOSpeedLatitudeyyy',\n 0x8835: 'ISOSpeedLatitudezzz',\n 0x9000: {\n 'name': 'ExifVersion',\n 'description': (value) => getStringValue(value)\n },\n 0x9003: 'DateTimeOriginal',\n 0x9004: 'DateTimeDigitized',\n 0x9009: 'GooglePlusUploadCode',\n 0x9010: 'OffsetTime',\n 0x9011: 'OffsetTimeOriginal',\n 0x9012: 'OffsetTimeDigitized',\n 0x9101: {\n 'name': 'ComponentsConfiguration',\n 'description': TagNamesCommon.ComponentsConfiguration\n },\n 0x9102: 'CompressedBitsPerPixel',\n 0x9201: {\n 'name': 'ShutterSpeedValue',\n 'description': TagNamesCommon.ShutterSpeedValue\n },\n 0x9202: {\n 'name': 'ApertureValue',\n 'description': TagNamesCommon.ApertureValue\n },\n 0x9203: 'BrightnessValue',\n 0x9204: 'ExposureBiasValue',\n 0x9205: {\n 'name': 'MaxApertureValue',\n 'description': (value) => {\n return Math.pow(Math.sqrt(2), value[0] / value[1]).toFixed(2);\n }\n },\n 0x9206: {\n 'name': 'SubjectDistance',\n 'description': (value) => (value[0] / value[1]) + ' m'\n },\n 0x9207: {\n 'name': 'MeteringMode',\n 'description': TagNamesCommon.MeteringMode\n },\n 0x9208: {\n 'name': 'LightSource',\n description: TagNamesCommon.LightSource\n },\n 0x9209: {\n 'name': 'Flash',\n 'description': (value) => {\n if (value === 0x00) {\n return 'Flash did not fire';\n } else if (value === 0x01) {\n return 'Flash fired';\n } else if (value === 0x05) {\n return 'Strobe return light not detected';\n } else if (value === 0x07) {\n return 'Strobe return light detected';\n } else if (value === 0x09) {\n return 'Flash fired, compulsory flash mode';\n } else if (value === 0x0d) {\n return 'Flash fired, compulsory flash mode, return light not detected';\n } else if (value === 0x0f) {\n return 'Flash fired, compulsory flash mode, return light detected';\n } else if (value === 0x10) {\n return 'Flash did not fire, compulsory flash mode';\n } else if (value === 0x18) {\n return 'Flash did not fire, auto mode';\n } else if (value === 0x19) {\n return 'Flash fired, auto mode';\n } else if (value === 0x1d) {\n return 'Flash fired, auto mode, return light not detected';\n } else if (value === 0x1f) {\n return 'Flash fired, auto mode, return light detected';\n } else if (value === 0x20) {\n return 'No flash function';\n } else if (value === 0x41) {\n return 'Flash fired, red-eye reduction mode';\n } else if (value === 0x45) {\n return 'Flash fired, red-eye reduction mode, return light not detected';\n } else if (value === 0x47) {\n return 'Flash fired, red-eye reduction mode, return light detected';\n } else if (value === 0x49) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode';\n } else if (value === 0x4d) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected';\n } else if (value === 0x4f) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected';\n } else if (value === 0x59) {\n return 'Flash fired, auto mode, red-eye reduction mode';\n } else if (value === 0x5d) {\n return 'Flash fired, auto mode, return light not detected, red-eye reduction mode';\n } else if (value === 0x5f) {\n return 'Flash fired, auto mode, return light detected, red-eye reduction mode';\n }\n return 'Unknown';\n }\n },\n 0x920a: {\n 'name': 'FocalLength',\n 'description': TagNamesCommon.FocalLength\n },\n 0x9211: 'ImageNumber',\n 0x9212: {\n name: 'SecurityClassification',\n description: (value) => ({\n 'C': 'Confidential',\n 'R': 'Restricted',\n 'S': 'Secret',\n 'T': 'Top Secret',\n 'U': 'Unclassified'\n })[value] || 'Unknown'\n },\n 0x9213: 'ImageHistory',\n 0x9214: {\n 'name': 'SubjectArea',\n 'description': (value) => {\n if (value.length === 2) {\n return `Location; X: ${value[0]}, Y: ${value[1]}`;\n } else if (value.length === 3) {\n return `Circle; X: ${value[0]}, Y: ${value[1]}, diameter: ${value[2]}`;\n } else if (value.length === 4) {\n return `Rectangle; X: ${value[0]}, Y: ${value[1]}, width: ${value[2]}, height: ${value[3]}`;\n }\n return 'Unknown';\n }\n },\n 0x927c: {\n 'name': 'MakerNote',\n 'description': () => '[Raw maker note data]'\n },\n 0x9286: {\n 'name': 'UserComment',\n 'description': getEncodedString\n },\n 0x9290: 'SubSecTime',\n 0x9291: 'SubSecTimeOriginal',\n 0x9292: 'SubSecTimeDigitized',\n 0x935c: 'ImageSourceData',\n 0x9400: {\n 'name': 'AmbientTemperature',\n 'description': (value) => (value[0] / value[1]) + ' °C'\n },\n 0x9401: {\n 'name': 'Humidity',\n 'description': (value) => (value[0] / value[1]) + ' %'\n },\n 0x9402: {\n 'name': 'Pressure',\n 'description': (value) => (value[0] / value[1]) + ' hPa'\n },\n 0x9403: {\n 'name': 'WaterDepth',\n 'description': (value) => (value[0] / value[1]) + ' m'\n },\n 0x9404: {\n 'name': 'Acceleration',\n 'description': (value) => (value[0] / value[1]) + ' mGal'\n },\n 0x9405: {\n 'name': 'CameraElevationAngle',\n 'description': (value) => (value[0] / value[1]) + ' °'\n },\n 0xa000: {\n 'name': 'FlashpixVersion',\n 'description': (value) => value.map((charCode) => String.fromCharCode(charCode)).join('')\n },\n 0xa001: {\n 'name': 'ColorSpace',\n 'description': TagNamesCommon.ColorSpace\n },\n 0xa002: 'PixelXDimension',\n 0xa003: 'PixelYDimension',\n 0xa004: 'RelatedSoundFile',\n 0xa005: 'Interoperability IFD Pointer',\n 0xa20b: 'FlashEnergy',\n 0xa20c: {\n 'name': 'SpatialFrequencyResponse',\n 'description': () => '[Raw SFR table data]'\n },\n 0xa20e: 'FocalPlaneXResolution',\n 0xa20f: 'FocalPlaneYResolution',\n 0xa210: {\n 'name': 'FocalPlaneResolutionUnit',\n 'description': TagNamesCommon.FocalPlaneResolutionUnit\n },\n 0xa214: {\n 'name': 'SubjectLocation',\n 'description': ([x, y]) => `X: ${x}, Y: ${y}`\n },\n 0xa215: 'ExposureIndex',\n 0xa217: {\n 'name': 'SensingMethod',\n 'description': (value) => {\n if (value === 1) {\n return 'Undefined';\n } else if (value === 2) {\n return 'One-chip color area sensor';\n } else if (value === 3) {\n return 'Two-chip color area sensor';\n } else if (value === 4) {\n return 'Three-chip color area sensor';\n } else if (value === 5) {\n return 'Color sequential area sensor';\n } else if (value === 7) {\n return 'Trilinear sensor';\n } else if (value === 8) {\n return 'Color sequential linear sensor';\n }\n return 'Unknown';\n }\n },\n 0xa300: {\n 'name': 'FileSource',\n 'description': (value) => {\n if (value === 3) {\n return 'DSC';\n }\n return 'Unknown';\n }\n },\n 0xa301: {\n 'name': 'SceneType',\n 'description': (value) => {\n if (value === 1) {\n return 'A directly photographed image';\n }\n return 'Unknown';\n }\n },\n 0xa302: {\n 'name': 'CFAPattern',\n 'description': () => '[Raw CFA pattern table data]'\n },\n 0xa401: {\n 'name': 'CustomRendered',\n 'description': TagNamesCommon.CustomRendered\n },\n 0xa402: {\n 'name': 'ExposureMode',\n 'description': TagNamesCommon.ExposureMode\n },\n 0xa403: {\n 'name': 'WhiteBalance',\n 'description': TagNamesCommon.WhiteBalance\n },\n 0xa404: {\n 'name': 'DigitalZoomRatio',\n 'description': (value) => {\n if (value[0] === 0) {\n return 'Digital zoom was not used';\n }\n return '' + (value[0] / value[1]);\n }\n },\n 0xa405: {\n 'name': 'FocalLengthIn35mmFilm',\n 'description': (value) => {\n if (value === 0) {\n return 'Unknown';\n }\n return value;\n }\n },\n 0xa406: {\n 'name': 'SceneCaptureType',\n 'description': TagNamesCommon.SceneCaptureType\n },\n 0xa407: {\n 'name': 'GainControl',\n 'description': (value) => {\n if (value === 0) {\n return 'None';\n } else if (value === 1) {\n return 'Low gain up';\n } else if (value === 2) {\n return 'High gain up';\n } else if (value === 3) {\n return 'Low gain down';\n } else if (value === 4) {\n return 'High gain down';\n }\n return 'Unknown';\n }\n },\n 0xa408: {\n 'name': 'Contrast',\n 'description': TagNamesCommon.Contrast\n },\n 0xa409: {\n 'name': 'Saturation',\n 'description': TagNamesCommon.Saturation\n },\n 0xa40a: {\n 'name': 'Sharpness',\n 'description': TagNamesCommon.Sharpness\n },\n 0xa40b: {\n 'name': 'DeviceSettingDescription',\n 'description': () => '[Raw device settings table data]'\n },\n 0xa40c: {\n 'name': 'SubjectDistanceRange',\n 'description': (value) => {\n if (value === 1) {\n return 'Macro';\n } else if (value === 2) {\n return 'Close view';\n } else if (value === 3) {\n return 'Distant view';\n }\n return 'Unknown';\n }\n },\n 0xa420: 'ImageUniqueID',\n 0xa430: 'CameraOwnerName',\n 0xa431: 'BodySerialNumber',\n 0xa432: {\n 'name': 'LensSpecification',\n 'description': (value) => {\n const focalLengths = `${value[0][0] / value[0][1]}-${value[1][0] / value[1][1]} mm`;\n if (value[3][1] === 0) {\n return `${focalLengths} f/?`;\n }\n return `${focalLengths} f/${1 / ((value[2][1] / value[2][1]) / (value[3][0] / value[3][1]))}`;\n }\n },\n 0xa433: 'LensMake',\n 0xa434: 'LensModel',\n 0xa435: 'LensSerialNumber',\n 0xa460: {\n name: 'CompositeImage',\n description: (value) => ({\n 1: 'Not a Composite Image',\n 2: 'General Composite Image',\n 3: 'Composite Image Captured While Shooting',\n })[value] || 'Unknown'\n },\n 0xa461: 'SourceImageNumberOfCompositeImage',\n 0xa462: 'SourceExposureTimesOfCompositeImage',\n 0xa500: 'Gamma',\n 0xea1c: 'Padding',\n 0xea1d: 'OffsetSchema',\n 0xfde8: 'OwnerName',\n 0xfde9: 'SerialNumber',\n 0xfdea: 'Lens',\n 0xfe4c: 'RawFile',\n 0xfe4d: 'Converter',\n 0xfe4e: 'WhiteBalance',\n 0xfe51: 'Exposure',\n 0xfe52: 'Shadows',\n 0xfe53: 'Brightness',\n 0xfe54: 'Contrast',\n 0xfe55: 'Saturation',\n 0xfe56: 'Sharpness',\n 0xfe57: 'Smoothness',\n 0xfe58: 'MoireFilter'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getEncodedString, getCalculatedGpsValue} from './tag-names-utils.js';\n\nexport default {\n 0x0000: {\n 'name': 'GPSVersionID',\n 'description': (value) => {\n if (value[0] === 2 && value[1] === 2 && value[2] === 0 && value[3] === 0) {\n return 'Version 2.2';\n }\n return 'Unknown';\n }\n },\n 0x0001: {\n 'name': 'GPSLatitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'N') {\n return 'North latitude';\n } else if (ref === 'S') {\n return 'South latitude';\n }\n return 'Unknown';\n }\n },\n 0x0002: {\n 'name': 'GPSLatitude',\n 'description': getCalculatedGpsValue\n },\n 0x0003: {\n 'name': 'GPSLongitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'E') {\n return 'East longitude';\n } else if (ref === 'W') {\n return 'West longitude';\n }\n return 'Unknown';\n }\n },\n 0x0004: {\n 'name': 'GPSLongitude',\n 'description': getCalculatedGpsValue\n },\n 0x0005: {\n 'name': 'GPSAltitudeRef',\n 'description': (value) => {\n if (value === 0) {\n return 'Sea level';\n } else if (value === 1) {\n return 'Sea level reference (negative value)';\n }\n return 'Unknown';\n }\n },\n 0x0006: {\n 'name': 'GPSAltitude',\n 'description': (value) => {\n return (value[0] / value[1]) + ' m';\n }\n },\n 0x0007: {\n 'name': 'GPSTimeStamp',\n 'description': (values) => {\n return values.map(([numerator, denominator]) => {\n const num = numerator / denominator;\n if (/^\\d(\\.|$)/.test(`${num}`)) {\n return `0${num}`;\n }\n return num;\n }).join(':');\n }\n },\n 0x0008: 'GPSSatellites',\n 0x0009: {\n 'name': 'GPSStatus',\n 'description': (value) => {\n const status = value.join('');\n if (status === 'A') {\n return 'Measurement in progress';\n } else if (status === 'V') {\n return 'Measurement Interoperability';\n }\n return 'Unknown';\n }\n },\n 0x000a: {\n 'name': 'GPSMeasureMode',\n 'description': (value) => {\n const mode = value.join('');\n if (mode === '2') {\n return '2-dimensional measurement';\n } else if (mode === '3') {\n return '3-dimensional measurement';\n }\n return 'Unknown';\n }\n },\n 0x000b: 'GPSDOP',\n 0x000c: {\n 'name': 'GPSSpeedRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'K') {\n return 'Kilometers per hour';\n } else if (ref === 'M') {\n return 'Miles per hour';\n } else if (ref === 'N') {\n return 'Knots';\n }\n return 'Unknown';\n }\n },\n 0x000d: 'GPSSpeed',\n 0x000e: {\n 'name': 'GPSTrackRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x000f: 'GPSTrack',\n 0x0010: {\n 'name': 'GPSImgDirectionRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x0011: 'GPSImgDirection',\n 0x0012: 'GPSMapDatum',\n 0x0013: {\n 'name': 'GPSDestLatitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'N') {\n return 'North latitude';\n } else if (ref === 'S') {\n return 'South latitude';\n }\n return 'Unknown';\n }\n },\n 0x0014: {\n 'name': 'GPSDestLatitude',\n 'description': (value) => {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n }\n },\n 0x0015: {\n 'name': 'GPSDestLongitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'E') {\n return 'East longitude';\n } else if (ref === 'W') {\n return 'West longitude';\n }\n return 'Unknown';\n }\n },\n 0x0016: {\n 'name': 'GPSDestLongitude',\n 'description': (value) => {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n }\n },\n 0x0017: {\n 'name': 'GPSDestBearingRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x0018: 'GPSDestBearing',\n 0x0019: {\n 'name': 'GPSDestDistanceRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'K') {\n return 'Kilometers';\n } else if (ref === 'M') {\n return 'Miles';\n } else if (ref === 'N') {\n return 'Knots';\n }\n return 'Unknown';\n }\n },\n 0x001a: 'GPSDestDistance',\n 0x001b: {\n 'name': 'GPSProcessingMethod',\n 'description': getEncodedString\n },\n 0x001c: {\n 'name': 'GPSAreaInformation',\n 'description': getEncodedString\n },\n 0x001d: 'GPSDateStamp',\n 0x001e: {\n 'name': 'GPSDifferential',\n 'description': (value) => {\n if (value === 0) {\n return 'Measurement without differential correction';\n } else if (value === 1) {\n return 'Differential correction applied';\n }\n return 'Unknown';\n }\n },\n 0x001f: 'GPSHPositioningError'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 0x0001: 'InteroperabilityIndex',\n 0x0002: {\n name: 'InteroperabilityVersion',\n description: (value) => getStringValue(value)\n },\n 0x1000: 'RelatedImageFileFormat',\n 0x1001: 'RelatedImageWidth',\n 0x1002: 'RelatedImageHeight'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 0xb000: {\n 'name': 'MPFVersion',\n 'description': (value) => getStringValue(value)\n },\n 0xb001: 'NumberOfImages',\n 0xb002: 'MPEntry',\n 0xb003: 'ImageUIDList',\n 0xb004: 'TotalFrames'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {objectAssign} from './utils.js';\nimport Constants from './constants.js';\nimport TagNames0thIfd from './tag-names-0th-ifd.js';\nimport TagNamesExifIfd from './tag-names-exif-ifd.js';\nimport TagNamesGpsIfd from './tag-names-gps-ifd.js';\nimport TagNamesInteroperabilityIfd from './tag-names-interoperability-ifd.js';\nimport TagNamesMpfIfd from './tag-names-mpf-ifd.js';\n\nconst tagNames0thExifIfds = objectAssign({}, TagNames0thIfd, TagNamesExifIfd);\n\nexport const IFD_TYPE_0TH = '0th';\nexport const IFD_TYPE_1ST = '1st';\nexport const IFD_TYPE_EXIF = 'exif';\nexport const IFD_TYPE_GPS = 'gps';\nexport const IFD_TYPE_INTEROPERABILITY = 'interoperability';\nexport const IFD_TYPE_MPF = 'mpf';\n\nexport default {\n [IFD_TYPE_0TH]: tagNames0thExifIfds,\n [IFD_TYPE_1ST]: TagNames0thIfd,\n [IFD_TYPE_EXIF]: tagNames0thExifIfds,\n [IFD_TYPE_GPS]: TagNamesGpsIfd,\n [IFD_TYPE_INTEROPERABILITY]: TagNamesInteroperabilityIfd,\n [IFD_TYPE_MPF]: Constants.USE_MPF ? TagNamesMpfIfd : {},\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\n\nconst typeSizes = {\n 1: 1, // BYTE\n 2: 1, // ASCII\n 3: 2, // SHORT\n 4: 4, // LONG\n 5: 8, // RATIONAL\n 7: 1, // UNDEFINED\n 9: 4, // SLONG\n 10: 8, // SRATIONAL\n 13: 4 // IFD\n};\n\nconst tagTypes = {\n 'BYTE': 1,\n 'ASCII': 2,\n 'SHORT': 3,\n 'LONG': 4,\n 'RATIONAL': 5,\n 'UNDEFINED': 7,\n 'SLONG': 9,\n 'SRATIONAL': 10,\n 'IFD': 13\n};\n\nexport default {\n getAsciiValue,\n getByteAt,\n getAsciiAt,\n getShortAt,\n getLongAt,\n getRationalAt,\n getUndefinedAt,\n getSlongAt,\n getSrationalAt,\n getIfdPointerAt,\n typeSizes,\n tagTypes,\n getTypeSize\n};\n\nfunction getAsciiValue(charArray) {\n return charArray.map((charCode) => String.fromCharCode(charCode));\n}\n\nfunction getByteAt(dataView, offset) {\n return dataView.getUint8(offset);\n}\n\nfunction getAsciiAt(dataView, offset) {\n return dataView.getUint8(offset);\n}\n\nfunction getShortAt(dataView, offset, byteOrder) {\n return dataView.getUint16(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getLongAt(dataView, offset, byteOrder) {\n return dataView.getUint32(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getRationalAt(dataView, offset, byteOrder) {\n return [getLongAt(dataView, offset, byteOrder), getLongAt(dataView, offset + 4, byteOrder)];\n}\n\nfunction getUndefinedAt(dataView, offset) {\n return getByteAt(dataView, offset);\n}\n\nfunction getSlongAt(dataView, offset, byteOrder) {\n return dataView.getInt32(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getSrationalAt(dataView, offset, byteOrder) {\n return [getSlongAt(dataView, offset, byteOrder), getSlongAt(dataView, offset + 4, byteOrder)];\n}\n\nfunction getIfdPointerAt(dataView, offset, byteOrder) {\n return getLongAt(dataView, offset, byteOrder);\n}\n\nfunction getTypeSize(typeName) {\n if (tagTypes[typeName] === undefined) {\n throw new Error('No such type found.');\n }\n\n return typeSizes[tagTypes[typeName]];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Constants from './constants.js';\nimport Types from './types.js';\nimport TagNames, {IFD_TYPE_0TH, IFD_TYPE_1ST} from './tag-names.js';\n\nconst getTagValueAt = {\n 1: Types.getByteAt,\n 2: Types.getAsciiAt,\n 3: Types.getShortAt,\n 4: Types.getLongAt,\n 5: Types.getRationalAt,\n 7: Types.getUndefinedAt,\n 9: Types.getSlongAt,\n 10: Types.getSrationalAt,\n 13: Types.getIfdPointerAt\n};\n\nexport function get0thIfdOffset(dataView, tiffHeaderOffset, byteOrder) {\n return tiffHeaderOffset + Types.getLongAt(dataView, tiffHeaderOffset + 4, byteOrder);\n}\n\nexport function readIfd(dataView, ifdType, tiffHeaderOffset, offset, byteOrder, includeUnknown) {\n const FIELD_COUNT_SIZE = Types.getTypeSize('SHORT');\n const FIELD_SIZE = 12;\n\n const tags = {};\n const numberOfFields = getNumberOfFields(dataView, offset, byteOrder);\n\n offset += FIELD_COUNT_SIZE;\n for (let fieldIndex = 0; fieldIndex < numberOfFields; fieldIndex++) {\n if (offset + FIELD_SIZE > dataView.byteLength) {\n break;\n }\n\n const tag = readTag(dataView, ifdType, tiffHeaderOffset, offset, byteOrder, includeUnknown);\n if (tag !== undefined) {\n tags[tag.name] = {\n 'id': tag.id,\n 'value': tag.value,\n 'description': tag.description\n };\n }\n\n offset += FIELD_SIZE;\n }\n\n if (Constants.USE_THUMBNAIL && (offset < dataView.byteLength - Types.getTypeSize('LONG'))) {\n const nextIfdOffset = Types.getLongAt(dataView, offset, byteOrder);\n if (nextIfdOffset !== 0 && ifdType === IFD_TYPE_0TH) {\n tags['Thumbnail'] = readIfd(dataView, IFD_TYPE_1ST, tiffHeaderOffset, tiffHeaderOffset + nextIfdOffset, byteOrder, true);\n }\n }\n\n return tags;\n}\n\nfunction getNumberOfFields(dataView, offset, byteOrder) {\n if (offset + Types.getTypeSize('SHORT') <= dataView.byteLength) {\n return Types.getShortAt(dataView, offset, byteOrder);\n }\n return 0;\n}\n\nfunction readTag(dataView, ifdType, tiffHeaderOffset, offset, byteOrder, includeUnknown) {\n const TAG_CODE_IPTC_NAA = 0x83bb;\n const TAG_TYPE_OFFSET = Types.getTypeSize('SHORT');\n const TAG_COUNT_OFFSET = TAG_TYPE_OFFSET + Types.getTypeSize('SHORT');\n const TAG_VALUE_OFFSET = TAG_COUNT_OFFSET + Types.getTypeSize('LONG');\n\n const tagCode = Types.getShortAt(dataView, offset, byteOrder);\n const tagType = Types.getShortAt(dataView, offset + TAG_TYPE_OFFSET, byteOrder);\n const tagCount = Types.getLongAt(dataView, offset + TAG_COUNT_OFFSET, byteOrder);\n let tagValue;\n\n if (Types.typeSizes[tagType] === undefined || (!includeUnknown && TagNames[ifdType][tagCode] === undefined)) {\n return undefined;\n }\n\n if (tagValueFitsInOffsetSlot(tagType, tagCount)) {\n tagValue = getTagValue(dataView, offset + TAG_VALUE_OFFSET, tagType, tagCount, byteOrder);\n } else {\n const tagValueOffset = Types.getLongAt(dataView, offset + TAG_VALUE_OFFSET, byteOrder);\n if (tagValueFitsInDataView(dataView, tiffHeaderOffset, tagValueOffset, tagType, tagCount)) {\n const forceByteType = tagCode === TAG_CODE_IPTC_NAA;\n tagValue = getTagValue(dataView, tiffHeaderOffset + tagValueOffset, tagType, tagCount, byteOrder, forceByteType);\n } else {\n tagValue = '<faulty value>';\n }\n }\n\n if (tagType === Types.tagTypes['ASCII']) {\n tagValue = splitNullSeparatedAsciiString(tagValue);\n tagValue = decodeAsciiValue(tagValue);\n }\n\n let tagName = `undefined-${tagCode}`;\n let tagDescription = tagValue;\n\n if (TagNames[ifdType][tagCode] !== undefined) {\n if ((TagNames[ifdType][tagCode]['name'] !== undefined) && (TagNames[ifdType][tagCode]['description'] !== undefined)) {\n tagName = TagNames[ifdType][tagCode]['name'];\n try {\n tagDescription = TagNames[ifdType][tagCode]['description'](tagValue);\n } catch (error) {\n tagDescription = getDescriptionFromTagValue(tagValue);\n }\n } else if ((tagType === Types.tagTypes['RATIONAL']) || (tagType === Types.tagTypes['SRATIONAL'])) {\n tagName = TagNames[ifdType][tagCode];\n tagDescription = '' + (tagValue[0] / tagValue[1]);\n } else {\n tagName = TagNames[ifdType][tagCode];\n tagDescription = getDescriptionFromTagValue(tagValue);\n }\n }\n\n return {\n id: tagCode,\n name: tagName,\n value: tagValue,\n description: tagDescription\n };\n}\n\nfunction tagValueFitsInOffsetSlot(tagType, tagCount) {\n return Types.typeSizes[tagType] * tagCount <= Types.getTypeSize('LONG');\n}\n\nfunction getTagValue(dataView, offset, type, count, byteOrder, forceByteType = false) {\n let value = [];\n\n if (forceByteType) {\n count = count * Types.typeSizes[type];\n type = Types.tagTypes['BYTE'];\n }\n for (let valueIndex = 0; valueIndex < count; valueIndex++) {\n value.push(getTagValueAt[type](dataView, offset, byteOrder));\n offset += Types.typeSizes[type];\n }\n\n if (type === Types.tagTypes['ASCII']) {\n value = Types.getAsciiValue(value);\n } else if (value.length === 1) {\n value = value[0];\n }\n\n return value;\n}\n\nfunction tagValueFitsInDataView(dataView, tiffHeaderOffset, tagValueOffset, tagType, tagCount) {\n return tiffHeaderOffset + tagValueOffset + Types.typeSizes[tagType] * tagCount <= dataView.byteLength;\n}\n\nfunction splitNullSeparatedAsciiString(string) {\n const tagValue = [];\n let i = 0;\n\n for (let j = 0; j < string.length; j++) {\n if (string[j] === '\\x00') {\n i++;\n continue;\n }\n if (tagValue[i] === undefined) {\n tagValue[i] = '';\n }\n tagValue[i] += string[j];\n }\n\n return tagValue;\n}\n\nfunction decodeAsciiValue(asciiValue) {\n try {\n return asciiValue.map((value) => decodeURIComponent(escape(value)));\n } catch (error) {\n return asciiValue;\n }\n}\n\nfunction getDescriptionFromTagValue(tagValue) {\n if (tagValue instanceof Array) {\n return tagValue.join(', ');\n }\n return tagValue;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {objectAssign} from './utils.js';\nimport ByteOrder from './byte-order.js';\nimport {IFD_TYPE_0TH, IFD_TYPE_EXIF, IFD_TYPE_GPS, IFD_TYPE_INTEROPERABILITY} from './tag-names.js';\nimport {readIfd, get0thIfdOffset} from './tags-helpers.js';\n\nconst EXIF_IFD_POINTER_KEY = 'Exif IFD Pointer';\nconst GPS_INFO_IFD_POINTER_KEY = 'GPS Info IFD Pointer';\nconst INTEROPERABILITY_IFD_POINTER_KEY = 'Interoperability IFD Pointer';\n\nexport default {\n read,\n};\n\nfunction read(dataView, tiffHeaderOffset, includeUnknown) {\n const byteOrder = ByteOrder.getByteOrder(dataView, tiffHeaderOffset);\n let tags = read0thIfd(dataView, tiffHeaderOffset, byteOrder, includeUnknown);\n tags = readExifIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown);\n tags = readGpsIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown);\n tags = readInteroperabilityIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown);\n\n return tags;\n}\n\nfunction read0thIfd(dataView, tiffHeaderOffset, byteOrder, includeUnknown) {\n return readIfd(dataView, IFD_TYPE_0TH, tiffHeaderOffset, get0thIfdOffset(dataView, tiffHeaderOffset, byteOrder), byteOrder, includeUnknown);\n}\n\nfunction readExifIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown) {\n if (tags[EXIF_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, IFD_TYPE_EXIF, tiffHeaderOffset, tiffHeaderOffset + tags[EXIF_IFD_POINTER_KEY].value, byteOrder, includeUnknown));\n }\n\n return tags;\n}\n\nfunction readGpsIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown) {\n if (tags[GPS_INFO_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, IFD_TYPE_GPS, tiffHeaderOffset, tiffHeaderOffset + tags[GPS_INFO_IFD_POINTER_KEY].value, byteOrder, includeUnknown));\n }\n\n return tags;\n}\n\nfunction readInteroperabilityIfd(tags, dataView, tiffHeaderOffset, byteOrder, includeUnknown) {\n if (tags[INTEROPERABILITY_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, IFD_TYPE_INTEROPERABILITY, tiffHeaderOffset, tiffHeaderOffset + tags[INTEROPERABILITY_IFD_POINTER_KEY].value, byteOrder, includeUnknown));\n }\n\n return tags;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\nimport Types from './types.js';\nimport {IFD_TYPE_MPF} from './tag-names.js';\nimport {deferInit, getBase64Image} from './utils.js';\nimport {readIfd, get0thIfdOffset} from './tags-helpers.js';\n\nexport default {\n read\n};\n\nconst ENTRY_SIZE = 16;\n\nfunction read(dataView, dataOffset, includeUnknown) {\n const byteOrder = ByteOrder.getByteOrder(dataView, dataOffset);\n const tags = readIfd(dataView, IFD_TYPE_MPF, dataOffset, get0thIfdOffset(dataView, dataOffset, byteOrder), byteOrder, includeUnknown);\n return addMpfImages(dataView, dataOffset, tags, byteOrder);\n}\n\nfunction addMpfImages(dataView, dataOffset, tags, byteOrder) {\n if (!tags['MPEntry']) {\n return tags;\n }\n\n const images = [];\n for (let i = 0; i < Math.ceil(tags['MPEntry'].value.length / ENTRY_SIZE); i++) {\n images[i] = {};\n\n const attributes = getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE, Types.getTypeSize('LONG'), byteOrder);\n images[i]['ImageFlags'] = getImageFlags(attributes);\n images[i]['ImageFormat'] = getImageFormat(attributes);\n images[i]['ImageType'] = getImageType(attributes);\n\n const imageSize = getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 4, Types.getTypeSize('LONG'), byteOrder);\n images[i]['ImageSize'] = {\n value: imageSize,\n description: '' + imageSize\n };\n\n const imageOffset = getImageOffset(i, tags['MPEntry'], byteOrder, dataOffset);\n images[i]['ImageOffset'] = {\n value: imageOffset,\n description: '' + imageOffset\n };\n\n const dependentImage1EntryNumber =\n getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 12, Types.getTypeSize('SHORT'), byteOrder);\n images[i]['DependentImage1EntryNumber'] = {\n value: dependentImage1EntryNumber,\n description: '' + dependentImage1EntryNumber\n };\n\n const dependentImage2EntryNumber =\n getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 14, Types.getTypeSize('SHORT'), byteOrder);\n images[i]['DependentImage2EntryNumber'] = {\n value: dependentImage2EntryNumber,\n description: '' + dependentImage2EntryNumber\n };\n\n images[i].image = dataView.buffer.slice(imageOffset, imageOffset + imageSize);\n deferInit(images[i], 'base64', function () {\n return getBase64Image(this.image);\n });\n }\n\n tags['Images'] = images;\n\n return tags;\n}\n\nfunction getImageNumberValue(entries, offset, size, byteOrder) {\n if (byteOrder === ByteOrder.LITTLE_ENDIAN) {\n let value = 0;\n for (let i = 0; i < size; i++) {\n value += entries[offset + i] << (8 * i);\n }\n return value;\n }\n\n let value = 0;\n for (let i = 0; i < size; i++) {\n value += entries[offset + i] << (8 * (size - 1 - i));\n }\n return value;\n}\n\nfunction getImageFlags(attributes) {\n const flags = [\n (attributes >> 31) & 0x1,\n (attributes >> 30) & 0x1,\n (attributes >> 29) & 0x1\n ];\n\n const flagsDescription = [];\n\n if (flags[0]) {\n flagsDescription.push('Dependent Parent Image');\n }\n if (flags[1]) {\n flagsDescription.push('Dependent Child Image');\n }\n if (flags[2]) {\n flagsDescription.push('Representative Image');\n }\n\n return {\n value: flags,\n description: flagsDescription.join(', ') || 'None'\n };\n}\n\nfunction getImageFormat(attributes) {\n const imageFormat = attributes >> 24 & 0x7;\n return {\n value: imageFormat,\n description: imageFormat === 0 ? 'JPEG' : 'Unknown'\n };\n}\n\nfunction getImageType(attributes) {\n const type = attributes & 0xffffff;\n const descriptions = {\n 0x30000: 'Baseline MP Primary Image',\n 0x10001: 'Large Thumbnail (VGA equivalent)',\n 0x10002: 'Large Thumbnail (Full HD equivalent)',\n 0x20001: 'Multi-Frame Image (Panorama)',\n 0x20002: 'Multi-Frame Image (Disparity)',\n 0x20003: 'Multi-Frame Image (Multi-Angle)',\n 0x0: 'Undefined',\n };\n\n return {\n value: type,\n description: descriptions[type] || 'Unknown'\n };\n}\n\nfunction getImageOffset(imageIndex, mpEntry, byteOrder, dataOffset) {\n if (isFirstIndividualImage(imageIndex)) {\n return 0;\n }\n return getImageNumberValue(mpEntry.value, imageIndex * ENTRY_SIZE + 8, Types.getTypeSize('LONG'), byteOrder) + dataOffset;\n}\n\nfunction isFirstIndividualImage(imageIndex) {\n return imageIndex === 0;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, fileDataOffset) {\n const length = getLength(dataView, fileDataOffset);\n const numberOfColorComponents = getNumberOfColorComponents(dataView, fileDataOffset, length);\n return {\n 'Bits Per Sample': getDataPrecision(dataView, fileDataOffset, length),\n 'Image Height': getImageHeight(dataView, fileDataOffset, length),\n 'Image Width': getImageWidth(dataView, fileDataOffset, length),\n 'Color Components': numberOfColorComponents,\n 'Subsampling': numberOfColorComponents && getSubsampling(dataView, fileDataOffset, numberOfColorComponents.value, length)\n };\n}\n\nfunction getLength(dataView, fileDataOffset) {\n return Types.getShortAt(dataView, fileDataOffset);\n}\n\nfunction getDataPrecision(dataView, fileDataOffset, length) {\n const OFFSET = 2;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getImageHeight(dataView, fileDataOffset, length) {\n const OFFSET = 3;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageWidth(dataView, fileDataOffset, length) {\n const OFFSET = 5;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getNumberOfColorComponents(dataView, fileDataOffset, length) {\n const OFFSET = 7;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getSubsampling(dataView, fileDataOffset, numberOfColorComponents, length) {\n const OFFSET = 8;\n const SIZE = 3 * numberOfColorComponents;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const components = [];\n\n for (let i = 0; i < numberOfColorComponents; i++) {\n const componentOffset = fileDataOffset + OFFSET + i * 3;\n components.push([\n Types.getByteAt(dataView, componentOffset),\n Types.getByteAt(dataView, componentOffset + 1),\n Types.getByteAt(dataView, componentOffset + 2)\n ]);\n }\n\n return {\n value: components,\n description: components.length > 1 ? getComponentIds(components) + getSamplingType(components) : ''\n };\n}\n\nfunction getComponentIds(components) {\n const ids = {\n 0x01: 'Y',\n 0x02: 'Cb',\n 0x03: 'Cr',\n 0x04: 'I',\n 0x05: 'Q',\n };\n\n return components.map((compontent) => ids[compontent[0]]).join('');\n}\n\nfunction getSamplingType(components) {\n const types = {\n 0x11: '4:4:4 (1 1)',\n 0x12: '4:4:0 (1 2)',\n 0x14: '4:4:1 (1 4)',\n 0x21: '4:2:2 (2 1)',\n 0x22: '4:2:0 (2 2)',\n 0x24: '4:2:1 (2 4)',\n 0x41: '4:1:1 (4 1)',\n 0x42: '4:1:0 (4 2)'\n };\n\n if (components.length === 0 || components[0][1] === undefined || types[components[0][1]] === undefined) {\n return '';\n }\n\n return types[components[0][1]];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, jfifDataOffset) {\n const length = getLength(dataView, jfifDataOffset);\n const thumbnailWidth = getThumbnailWidth(dataView, jfifDataOffset, length);\n const thumbnailHeight = getThumbnailHeight(dataView, jfifDataOffset, length);\n const tags = {\n 'JFIF Version': getVersion(dataView, jfifDataOffset, length),\n 'Resolution Unit': getResolutionUnit(dataView, jfifDataOffset, length),\n 'XResolution': getXResolution(dataView, jfifDataOffset, length),\n 'YResolution': getYResolution(dataView, jfifDataOffset, length),\n 'JFIF Thumbnail Width': thumbnailWidth,\n 'JFIF Thumbnail Height': thumbnailHeight\n };\n\n if (thumbnailWidth !== undefined && thumbnailHeight !== undefined) {\n const thumbnail = getThumbnail(dataView, jfifDataOffset, 3 * thumbnailWidth.value * thumbnailHeight.value, length);\n if (thumbnail) {\n tags['JFIF Thumbnail'] = thumbnail;\n }\n }\n\n for (const tagName in tags) {\n if (tags[tagName] === undefined) {\n delete tags[tagName];\n }\n }\n\n return tags;\n}\n\nfunction getLength(dataView, jfifDataOffset) {\n return Types.getShortAt(dataView, jfifDataOffset);\n}\n\nfunction getVersion(dataView, jfifDataOffset, length) {\n const OFFSET = 7;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const majorVersion = Types.getByteAt(dataView, jfifDataOffset + OFFSET);\n const minorVersion = Types.getByteAt(dataView, jfifDataOffset + OFFSET + 1);\n return {\n value: majorVersion * 0x100 + minorVersion,\n description: majorVersion + '.' + minorVersion\n };\n}\n\nfunction getResolutionUnit(dataView, jfifDataOffset, length) {\n const OFFSET = 9;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: getResolutionUnitDescription(value)\n };\n}\n\nfunction getResolutionUnitDescription(value) {\n if (value === 0) {\n return 'None';\n }\n if (value === 1) {\n return 'inches';\n }\n if (value === 2) {\n return 'cm';\n }\n return 'Unknown';\n}\n\nfunction getXResolution(dataView, jfifDataOffset, length) {\n const OFFSET = 10;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getYResolution(dataView, jfifDataOffset, length) {\n const OFFSET = 12;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getThumbnailWidth(dataView, jfifDataOffset, length) {\n const OFFSET = 14;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getThumbnailHeight(dataView, jfifDataOffset, length) {\n const OFFSET = 15;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, jfifDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getThumbnail(dataView, jfifDataOffset, thumbnailLength, length) {\n const OFFSET = 16;\n\n if (thumbnailLength === 0 || OFFSET + thumbnailLength > length) {\n return undefined;\n }\n\n const value = dataView.buffer.slice(jfifDataOffset + OFFSET, jfifDataOffset + OFFSET + thumbnailLength);\n return {\n value,\n description: '<24-bit RGB pixel data>'\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 'iptc': {\n 0x0100: {\n 'name': 'Model Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0105: {\n 'name': 'Destination',\n 'repeatable': true\n },\n 0x0114: {\n 'name': 'File Format',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0116: {\n 'name': 'File Format Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x011e: 'Service Identifier',\n 0x0128: 'Envelope Number',\n 0x0132: 'Product ID',\n 0x013c: 'Envelope Priority',\n 0x0146: {\n 'name': 'Date Sent',\n 'description': getCreationDate\n },\n 0x0150: {\n 'name': 'Time Sent',\n 'description': getCreationTime\n },\n 0x015a: {\n 'name': 'Coded Character Set',\n 'description': getEncodingName,\n 'encoding_name': getEncodingName,\n },\n 0x0164: 'UNO',\n 0x0178: {\n 'name': 'ARM Identifier',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x017a: {\n 'name': 'ARM Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0200: {\n 'name': 'Record Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0203: 'Object Type Reference',\n 0x0204: 'Object Attribute Reference',\n 0x0205: 'Object Name',\n 0x0207: 'Edit Status',\n 0x0208: {\n 'name': 'Editorial Update',\n 'description': (value) => {\n if (getStringValue(value) === '01') {\n return 'Additional Language';\n }\n return 'Unknown';\n }\n },\n 0x020a: 'Urgency',\n 0x020c: {\n 'name': 'Subject Reference',\n 'repeatable': true,\n 'description': (value) => {\n const parts = getStringValue(value).split(':');\n return parts[2] + (parts[3] ? '/' + parts[3] : '') + (parts[4] ? '/' + parts[4] : '');\n }\n },\n 0x020f: 'Category',\n 0x0214: {\n 'name': 'Supplemental Category',\n 'repeatable': true\n },\n 0x0216: 'Fixture Identifier',\n 0x0219: {\n 'name': 'Keywords',\n 'repeatable': true\n },\n 0x021a: {\n 'name': 'Content Location Code',\n 'repeatable': true\n },\n 0x021b: {\n 'name': 'Content Location Name',\n 'repeatable': true\n },\n 0x021e: 'Release Date',\n 0x0223: 'Release Time',\n 0x0225: 'Expiration Date',\n 0x0226: 'Expiration Time',\n 0x0228: 'Special Instructions',\n 0x022a: {\n 'name': 'Action Advised',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === '01') {\n return 'Object Kill';\n } else if (string === '02') {\n return 'Object Replace';\n } else if (string === '03') {\n return 'Object Append';\n } else if (string === '04') {\n return 'Object Reference';\n }\n return 'Unknown';\n }\n },\n 0x022d: {\n 'name': 'Reference Service',\n 'repeatable': true\n },\n 0x022f: {\n 'name': 'Reference Date',\n 'repeatable': true\n },\n 0x0232: {\n 'name': 'Reference Number',\n 'repeatable': true\n },\n 0x0237: {\n 'name': 'Date Created',\n 'description': getCreationDate\n },\n 0x023c: {\n 'name': 'Time Created',\n 'description': getCreationTime\n },\n 0x023e: {\n 'name': 'Digital Creation Date',\n 'description': getCreationDate\n },\n 0x023f: {\n 'name': 'Digital Creation Time',\n 'description': getCreationTime\n },\n 0x0241: 'Originating Program',\n 0x0246: 'Program Version',\n 0x024b: {\n 'name': 'Object Cycle',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === 'a') {\n return 'morning';\n } else if (string === 'p') {\n return 'evening';\n } else if (string === 'b') {\n return 'both';\n }\n return 'Unknown';\n }\n },\n 0x0250: {\n 'name': 'By-line',\n 'repeatable': true\n },\n 0x0255: {\n 'name': 'By-line Title',\n 'repeatable': true\n },\n 0x025a: 'City',\n 0x025c: 'Sub-location',\n 0x025f: 'Province/State',\n 0x0264: 'Country/Primary Location Code',\n 0x0265: 'Country/Primary Location Name',\n 0x0267: 'Original Transmission Reference',\n 0x0269: 'Headline',\n 0x026e: 'Credit',\n 0x0273: 'Source',\n 0x0274: 'Copyright Notice',\n 0x0276: {\n 'name': 'Contact',\n 'repeatable': true\n },\n 0x0278: 'Caption/Abstract',\n 0x027a: {\n 'name': 'Writer/Editor',\n 'repeatable': true\n },\n 0x027d: {\n 'name': 'Rasterized Caption',\n 'description': (value) => value\n },\n 0x0282: 'Image Type',\n 0x0283: {\n 'name': 'Image Orientation',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === 'P') {\n return 'Portrait';\n } else if (string === 'L') {\n return 'Landscape';\n } else if (string === 'S') {\n return 'Square';\n }\n return 'Unknown';\n }\n },\n 0x0287: 'Language Identifier',\n 0x0296: {\n 'name': 'Audio Type',\n 'description': (value) => {\n const stringValue = getStringValue(value);\n const character0 = stringValue.charAt(0);\n const character1 = stringValue.charAt(1);\n let description = '';\n\n if (character0 === '1') {\n description += 'Mono';\n } else if (character0 === '2') {\n description += 'Stereo';\n }\n\n if (character1 === 'A') {\n description += ', actuality';\n } else if (character1 === 'C') {\n description += ', question and answer session';\n } else if (character1 === 'M') {\n description += ', music, transmitted by itself';\n } else if (character1 === 'Q') {\n description += ', response to a question';\n } else if (character1 === 'R') {\n description += ', raw sound';\n } else if (character1 === 'S') {\n description += ', scener';\n } else if (character1 === 'V') {\n description += ', voicer';\n } else if (character1 === 'W') {\n description += ', wrap';\n }\n\n if (description !== '') {\n return description;\n }\n return stringValue;\n }\n },\n 0x0297: {\n 'name': 'Audio Sampling Rate',\n 'description': (value) => parseInt(getStringValue(value), 10) + ' Hz'\n },\n 0x0298: {\n 'name': 'Audio Sampling Resolution',\n 'description': (value) => {\n const bits = parseInt(getStringValue(value), 10);\n return bits + (bits === 1 ? ' bit' : ' bits');\n }\n },\n 0x0299: {\n 'name': 'Audio Duration',\n 'description': (value) => {\n const duration = getStringValue(value);\n if (duration.length >= 6) {\n return duration.substr(0, 2) + ':' + duration.substr(2, 2) + ':' + duration.substr(4, 2);\n }\n return duration;\n }\n },\n 0x029a: 'Audio Outcue',\n 0x02ba: 'Short Document ID',\n 0x02bb: 'Unique Document ID',\n 0x02bc: 'Owner ID',\n 0x02c8: {\n 'name': (value) => {\n if (value.length === 2) {\n return 'ObjectData Preview File Format';\n }\n return 'Record 2 destination';\n },\n 'description': (value) => {\n if (value.length === 2) {\n const intValue = (value[0] << 8) + value[1];\n if (intValue === 0) {\n return 'No ObjectData';\n } else if (intValue === 1) {\n return 'IPTC-NAA Digital Newsphoto Parameter Record';\n } else if (intValue === 2) {\n return 'IPTC7901 Recommended Message Format';\n } else if (intValue === 3) {\n return 'Tagged Image File Format (Adobe/Aldus Image data)';\n } else if (intValue === 4) {\n return 'Illustrator (Adobe Graphics data)';\n } else if (intValue === 5) {\n return 'AppleSingle (Apple Computer Inc)';\n } else if (intValue === 6) {\n return 'NAA 89-3 (ANPA 1312)';\n } else if (intValue === 7) {\n return 'MacBinary II';\n } else if (intValue === 8) {\n return 'IPTC Unstructured Character Oriented File Format (UCOFF)';\n } else if (intValue === 9) {\n return 'United Press International ANPA 1312 variant';\n } else if (intValue === 10) {\n return 'United Press International Down-Load Message';\n } else if (intValue === 11) {\n return 'JPEG File Interchange (JFIF)';\n } else if (intValue === 12) {\n return 'Photo-CD Image-Pac (Eastman Kodak)';\n } else if (intValue === 13) {\n return 'Microsoft Bit Mapped Graphics File [*.BMP]';\n } else if (intValue === 14) {\n return 'Digital Audio File [*.WAV] (Microsoft & Creative Labs)';\n } else if (intValue === 15) {\n return 'Audio plus Moving Video [*.AVI] (Microsoft)';\n } else if (intValue === 16) {\n return 'PC DOS/Windows Executable Files [*.COM][*.EXE]';\n } else if (intValue === 17) {\n return 'Compressed Binary File [*.ZIP] (PKWare Inc)';\n } else if (intValue === 18) {\n return 'Audio Interchange File Format AIFF (Apple Computer Inc)';\n } else if (intValue === 19) {\n return 'RIFF Wave (Microsoft Corporation)';\n } else if (intValue === 20) {\n return 'Freehand (Macromedia/Aldus)';\n } else if (intValue === 21) {\n return 'Hypertext Markup Language \"HTML\" (The Internet Society)';\n } else if (intValue === 22) {\n return 'MPEG 2 Audio Layer 2 (Musicom), ISO/IEC';\n } else if (intValue === 23) {\n return 'MPEG 2 Audio Layer 3, ISO/IEC';\n } else if (intValue === 24) {\n return 'Portable Document File (*.PDF) Adobe';\n } else if (intValue === 25) {\n return 'News Industry Text Format (NITF)';\n } else if (intValue === 26) {\n return 'Tape Archive (*.TAR)';\n } else if (intValue === 27) {\n return 'Tidningarnas Telegrambyrå NITF version (TTNITF DTD)';\n } else if (intValue === 28) {\n return 'Ritzaus Bureau NITF version (RBNITF DTD)';\n } else if (intValue === 29) {\n return 'Corel Draw [*.CDR]';\n }\n return `Unknown format ${intValue}`;\n }\n return getStringValue(value);\n }\n },\n 0x02c9: {\n 'name': 'ObjectData Preview File Format Version',\n 'description': (value, tags) => {\n // Format ID, Version ID, Version Description\n const formatVersions = {\n '00': {'00': '1'},\n '01': {'01': '1', '02': '2', '03': '3', '04': '4'},\n '02': {'04': '4'},\n '03': {'01': '5.0', '02': '6.0'},\n '04': {'01': '1.40'},\n '05': {'01': '2'},\n '06': {'01': '1'},\n '11': {'01': '1.02'},\n '20': {'01': '3.1', '02': '4.0', '03': '5.0', '04': '5.5'},\n '21': {'02': '2.0'}\n };\n const stringValue = getStringValue(value);\n\n if (tags['ObjectData Preview File Format']) {\n const objectDataPreviewFileFormat = getStringValue(tags['ObjectData Preview File Format'].value);\n if (formatVersions[objectDataPreviewFileFormat]\n && formatVersions[objectDataPreviewFileFormat][stringValue]) {\n return formatVersions[objectDataPreviewFileFormat][stringValue];\n }\n }\n\n return stringValue;\n }\n },\n 0x02ca: 'ObjectData Preview Data',\n 0x070a: {\n 'name': 'Size Mode',\n 'description': (value) => {\n return (value[0]).toString();\n }\n },\n 0x0714: {\n 'name': 'Max Subfile Size',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n },\n 0x075a: {\n 'name': 'ObjectData Size Announced',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n },\n 0x075f: {\n 'name': 'Maximum ObjectData Size',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n }\n }\n};\n\nfunction getCreationDate(value) {\n const date = getStringValue(value);\n\n if (date.length >= 8) {\n return date.substr(0, 4) + '-' + date.substr(4, 2) + '-' + date.substr(6, 2);\n }\n\n return date;\n}\n\nfunction getCreationTime(value) {\n const time = getStringValue(value);\n let parsedTime = time;\n\n if (time.length >= 6) {\n parsedTime = time.substr(0, 2) + ':' + time.substr(2, 2) + ':' + time.substr(4, 2);\n if (time.length === 11) {\n parsedTime += time.substr(6, 1) + time.substr(7, 2) + ':' + time.substr(9, 2);\n }\n }\n\n return parsedTime;\n}\n\nfunction getEncodingName(value) {\n const string = getStringValue(value);\n if (string === '\\x1b%G') {\n return 'UTF-8';\n } else if (string === '\\x1b%5') {\n return 'Windows-1252';\n } else if (string === '\\x1b%/G') {\n return 'UTF-8 Level 1';\n } else if (string === '\\x1b%/H') {\n return 'UTF-8 Level 2';\n } else if (string === '\\x1b%/I') {\n return 'UTF-8 Level 3';\n } else if (string === '\\x1B/A') {\n return 'ISO-8859-1';\n } else if (string === '\\x1B/B') {\n return 'ISO-8859-2';\n } else if (string === '\\x1B/C') {\n return 'ISO-8859-3';\n } else if (string === '\\x1B/D') {\n return 'ISO-8859-4';\n } else if (string === '\\x1B/@') {\n return 'ISO-8859-5';\n } else if (string === '\\x1B/G') {\n return 'ISO-8859-6';\n } else if (string === '\\x1B/F') {\n return 'ISO-8859-7';\n } else if (string === '\\x1B/H') {\n return 'ISO-8859-8';\n }\n return 'Unknown';\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n get\n};\n\nfunction get() {\n if (typeof TextDecoder !== 'undefined') {\n return TextDecoder;\n }\n\n return undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TextDecoder from './text-decoder.js';\n\nconst TAG_HEADER_SIZE = 5;\n\nexport default {\n decode,\n TAG_HEADER_SIZE\n};\n\nfunction decode(encoding, tagValue) {\n const Decoder = TextDecoder.get();\n if ((typeof Decoder !== 'undefined') && (encoding !== undefined)) {\n try {\n return new Decoder(encoding).decode(tagValue instanceof DataView ? tagValue.buffer : Uint8Array.from(tagValue));\n } catch (error) {\n // Pass through and fall back to ASCII decoding.\n }\n }\n\n const stringValue = tagValue.map((charCode) => String.fromCharCode(charCode)).join('');\n return decodeAsciiValue(stringValue);\n}\n\nfunction decodeAsciiValue(asciiValue) {\n try {\n return decodeURIComponent(escape(asciiValue));\n } catch (error) {\n return asciiValue;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport IptcTagNames from './iptc-tag-names.js';\nimport TagDecoder from './tag-decoder.js';\n\nconst BYTES_8BIM = 0x3842494d;\nconst BYTES_8BIM_SIZE = 4;\nconst RESOURCE_BLOCK_HEADER_SIZE = BYTES_8BIM_SIZE + 8;\nconst NAA_RESOURCE_BLOCK_TYPE = 0x0404;\nconst TAG_HEADER_SIZE = 5;\n\nexport default {\n read\n};\n\nfunction read(dataView, dataOffset, includeUnknown) {\n try {\n if (Array.isArray(dataView)) {\n return parseTags(new DataView(Uint8Array.from(dataView).buffer), {size: dataView.length}, 0, includeUnknown);\n }\n const {naaBlock, dataOffset: newDataOffset} = getNaaResourceBlock(dataView, dataOffset);\n return parseTags(dataView, naaBlock, newDataOffset, includeUnknown);\n } catch (error) {\n return {};\n }\n}\n\nfunction getNaaResourceBlock(dataView, dataOffset) {\n while (dataOffset + RESOURCE_BLOCK_HEADER_SIZE <= dataView.byteLength) {\n const resourceBlock = getResourceBlock(dataView, dataOffset);\n if (isNaaResourceBlock(resourceBlock)) {\n return {naaBlock: resourceBlock, dataOffset: dataOffset + RESOURCE_BLOCK_HEADER_SIZE};\n }\n dataOffset += RESOURCE_BLOCK_HEADER_SIZE + resourceBlock.size + getBlockPadding(resourceBlock);\n }\n throw new Error('No IPTC NAA resource block.');\n}\n\nfunction getResourceBlock(dataView, dataOffset) {\n const RESOURCE_BLOCK_SIZE_OFFSET = 10;\n\n if (dataView.getUint32(dataOffset, false) !== BYTES_8BIM) {\n throw new Error('Not an IPTC resource block.');\n }\n\n return {\n type: dataView.getUint16(dataOffset + BYTES_8BIM_SIZE),\n size: dataView.getUint16(dataOffset + RESOURCE_BLOCK_SIZE_OFFSET)\n };\n}\n\nfunction isNaaResourceBlock(resourceBlock) {\n return resourceBlock.type === NAA_RESOURCE_BLOCK_TYPE;\n}\n\nfunction getBlockPadding(resourceBlock) {\n if (resourceBlock.size % 2 !== 0) {\n return 1;\n }\n return 0;\n}\n\nfunction parseTags(dataView, naaBlock, dataOffset, includeUnknown) {\n const tags = {};\n let encoding = undefined;\n\n const endOfBlockOffset = dataOffset + naaBlock['size'];\n\n while ((dataOffset < endOfBlockOffset) && (dataOffset < dataView.byteLength)) {\n const {tag, tagSize} = readTag(dataView, dataOffset, tags, encoding, includeUnknown);\n\n if (tag === null) {\n break;\n }\n\n if (tag) {\n if ('encoding' in tag) {\n encoding = tag.encoding;\n }\n\n if ((tags[tag.name] === undefined) || (tag['repeatable'] === undefined)) {\n tags[tag.name] = {\n id: tag.id,\n value: tag.value,\n description: tag.description\n };\n } else {\n if (!(tags[tag.name] instanceof Array)) {\n tags[tag.name] = [{\n id: tags[tag.name].id,\n value: tags[tag.name].value,\n description: tags[tag.name].description\n }];\n }\n tags[tag.name].push({\n id: tag.id,\n value: tag.value,\n description: tag.description\n });\n }\n }\n\n dataOffset += TAG_HEADER_SIZE + tagSize;\n }\n\n return tags;\n}\n\nfunction readTag(dataView, dataOffset, tags, encoding, includeUnknown) {\n const TAG_CODE_OFFSET = 1;\n const TAG_SIZE_OFFSET = 3;\n\n if (leadByteIsMissing(dataView, dataOffset)) {\n return {tag: null, tagSize: 0};\n }\n\n const tagCode = dataView.getUint16(dataOffset + TAG_CODE_OFFSET);\n const tagSize = dataView.getUint16(dataOffset + TAG_SIZE_OFFSET);\n\n if (!includeUnknown && !IptcTagNames['iptc'][tagCode]) {\n return {tag: undefined, tagSize};\n }\n\n const tagValue = getTagValue(dataView, dataOffset + TAG_HEADER_SIZE, tagSize);\n\n const tag = {\n id: tagCode,\n name: getTagName(IptcTagNames['iptc'][tagCode], tagCode, tagValue),\n value: tagValue,\n description: getTagDescription(IptcTagNames['iptc'][tagCode], tagValue, tags, encoding)\n };\n if (tagIsRepeatable(tagCode)) {\n tag['repeatable'] = true;\n }\n if (tagContainsEncoding(tagCode)) {\n tag['encoding'] = IptcTagNames['iptc'][tagCode]['encoding_name'](tagValue);\n }\n\n return {tag, tagSize};\n}\n\nfunction leadByteIsMissing(dataView, dataOffset) {\n const TAG_LEAD_BYTE = 0x1c;\n return dataView.getUint8(dataOffset) !== TAG_LEAD_BYTE;\n}\n\nfunction getTagValue(dataView, offset, size) {\n const value = [];\n\n for (let valueIndex = 0; valueIndex < size; valueIndex++) {\n value.push(dataView.getUint8(offset + valueIndex));\n }\n\n return value;\n}\n\nfunction getTagName(tag, tagCode, tagValue) {\n if (!tag) {\n return `undefined-${tagCode}`;\n }\n if (tagIsName(tag)) {\n return tag;\n }\n if (hasDynamicName(tag)) {\n return tag['name'](tagValue);\n }\n return tag['name'];\n}\n\nfunction tagIsName(tag) {\n return typeof tag === 'string';\n}\n\nfunction hasDynamicName(tag) {\n return typeof (tag['name']) === 'function';\n}\n\nfunction getTagDescription(tag, tagValue, tags, encoding) {\n if (hasDescriptionProperty(tag)) {\n try {\n return tag['description'](tagValue, tags);\n } catch (error) {\n // Fall through to next handler.\n }\n }\n if (tagValueIsText(tag, tagValue)) {\n return TagDecoder.decode(encoding, tagValue);\n }\n return tagValue;\n}\n\nfunction tagValueIsText(tag, tagValue) {\n return tag && tagValue instanceof Array;\n}\n\nfunction hasDescriptionProperty(tag) {\n return tag && tag['description'] !== undefined;\n}\n\nfunction tagIsRepeatable(tagCode) {\n return IptcTagNames['iptc'][tagCode] && IptcTagNames['iptc'][tagCode]['repeatable'];\n}\n\nfunction tagContainsEncoding(tagCode) {\n return IptcTagNames['iptc'][tagCode] && IptcTagNames['iptc'][tagCode]['encoding_name'] !== undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 'tiff:Orientation'(value) {\n if (value === '1') {\n return 'Horizontal (normal)';\n }\n if (value === '2') {\n return 'Mirror horizontal';\n }\n if (value === '3') {\n return 'Rotate 180';\n }\n if (value === '4') {\n return 'Mirror vertical';\n }\n if (value === '5') {\n return 'Mirror horizontal and rotate 270 CW';\n }\n if (value === '6') {\n return 'Rotate 90 CW';\n }\n if (value === '7') {\n return 'Mirror horizontal and rotate 90 CW';\n }\n if (value === '8') {\n return 'Rotate 270 CW';\n }\n return value;\n },\n 'tiff:ResolutionUnit': (value) => TagNamesCommon.ResolutionUnit(parseInt(value, 10)),\n 'tiff:XResolution': (value) => fraction(TagNamesCommon.XResolution, value),\n 'tiff:YResolution': (value) => fraction(TagNamesCommon.YResolution, value),\n 'exif:ApertureValue': (value) => fraction(TagNamesCommon.ApertureValue, value),\n 'exif:GPSLatitude': calculateGPSValue,\n 'exif:GPSLongitude': calculateGPSValue,\n 'exif:FNumber': (value) => fraction(TagNamesCommon.FNumber, value),\n 'exif:FocalLength': (value) => fraction(TagNamesCommon.FocalLength, value),\n 'exif:FocalPlaneResolutionUnit': (value) => TagNamesCommon.FocalPlaneResolutionUnit(parseInt(value, 10)),\n 'exif:ColorSpace': (value) => TagNamesCommon.ColorSpace(parseNumber(value)),\n 'exif:ComponentsConfiguration'(value, description) {\n if (/^\\d, \\d, \\d, \\d$/.test(description)) {\n const numbers = description.split(', ').map((number) => number.charCodeAt(0));\n return TagNamesCommon.ComponentsConfiguration(numbers);\n }\n return description;\n },\n 'exif:Contrast': (value) => TagNamesCommon.Contrast(parseInt(value, 10)),\n 'exif:CustomRendered': (value) => TagNamesCommon.CustomRendered(parseInt(value, 10)),\n 'exif:ExposureMode': (value) => TagNamesCommon.ExposureMode(parseInt(value, 10)),\n 'exif:ExposureProgram': (value) => TagNamesCommon.ExposureProgram(parseInt(value, 10)),\n 'exif:ExposureTime'(value) {\n if (isFraction(value)) {\n return TagNamesCommon.ExposureTime(value.split('/').map((number) => parseInt(number, 10)));\n }\n return value;\n },\n 'exif:MeteringMode': (value) => TagNamesCommon.MeteringMode(parseInt(value, 10)),\n 'exif:Saturation': (value) => TagNamesCommon.Saturation(parseInt(value, 10)),\n 'exif:SceneCaptureType': (value) => TagNamesCommon.SceneCaptureType(parseInt(value, 10)),\n 'exif:Sharpness': (value) => TagNamesCommon.Sharpness(parseInt(value, 10)),\n 'exif:ShutterSpeedValue': (value) => fraction(TagNamesCommon.ShutterSpeedValue, value),\n 'exif:WhiteBalance': (value) => TagNamesCommon.WhiteBalance(parseInt(value, 10))\n};\n\nfunction fraction(func, value) {\n if (isFraction(value)) {\n return func(value.split('/'));\n }\n return value;\n}\n\nfunction parseNumber(value) {\n if (value.substring(0, 2) === '0x') {\n return parseInt(value.substring(2), 16);\n }\n return parseInt(value, 10);\n}\n\nfunction isFraction(value) {\n return /^-?\\d+\\/-?\\d+$/.test(value);\n}\n\nfunction calculateGPSValue(value) {\n const [degreesString, minutesString] = value.split(',');\n if ((degreesString !== undefined) && (minutesString !== undefined)) {\n const degrees = parseFloat(degreesString);\n const minutes = parseFloat(minutesString);\n const ref = minutesString.charAt(minutesString.length - 1);\n if ((!Number.isNaN(degrees)) && (!Number.isNaN(minutes))) {\n return '' + (degrees + minutes / 60) + ref;\n }\n }\n return value;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n get\n};\n\nfunction get() {\n if (typeof DOMParser !== 'undefined') {\n return new DOMParser();\n }\n try {\n // eslint-disable-next-line no-undef\n return new (__non_webpack_require__('@xmldom/xmldom').DOMParser)({\n errorHandler: {\n error: () => {\n throw new Error('Faulty XML');\n }\n }\n });\n } catch (error) {\n return undefined;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView, objectAssign} from './utils.js';\nimport XmpTagNames from './xmp-tag-names.js';\nimport DOMParser from './dom-parser.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, chunks) {\n const tags = {};\n\n if (typeof dataView === 'string') {\n readTags(tags, dataView);\n return tags;\n }\n\n const [standardXmp, extendedXmp] = extractCompleteChunks(dataView, chunks);\n\n const hasStandardTags = readTags(tags, standardXmp);\n\n if (extendedXmp) {\n const hasExtendedTags = readTags(tags, extendedXmp);\n\n if (!hasStandardTags && !hasExtendedTags) {\n // Some writers are not spec-compliant in that they split an XMP\n // metadata tree over both the standard XMP block and the extended\n // XMP block. If we failed parsing both of the XMPs in the regular\n // way, we try to combine them to see if that works better.\n delete tags._raw;\n readTags(tags, combineChunks(dataView, chunks));\n }\n }\n\n return tags;\n}\n\n// The first chunk is always the regular XMP document. Then there is something\n// called extended XMP. The extended XMP is also a single XMP document but it\n// can be divided into multiple chunks that need to be combined into one.\nfunction extractCompleteChunks(dataView, chunks) {\n if (chunks.length === 0) {\n return [];\n }\n\n const completeChunks = [combineChunks(dataView, chunks.slice(0, 1))];\n if (chunks.length > 1) {\n completeChunks.push(combineChunks(dataView, chunks.slice(1)));\n }\n\n return completeChunks;\n}\n\nfunction combineChunks(dataView, chunks) {\n const totalLength = chunks.reduce((size, chunk) => size + chunk.length, 0);\n const combinedChunks = new Uint8Array(totalLength);\n let offset = 0;\n\n for (let i = 0; i < chunks.length; i++) {\n const chunk = chunks[i];\n const slice = dataView.buffer.slice(chunk.dataOffset, chunk.dataOffset + chunk.length);\n combinedChunks.set(new Uint8Array(slice), offset);\n offset += chunk.length;\n }\n\n return new DataView(combinedChunks.buffer);\n}\n\nfunction readTags(tags, chunkDataView) {\n try {\n const {doc, raw} = getDocument(chunkDataView);\n tags._raw = (tags._raw || '') + raw;\n const rdf = getRDF(doc);\n\n objectAssign(tags, parseXMPObject(convertToObject(rdf, true)));\n return true;\n } catch (error) {\n return false;\n }\n}\n\nfunction getDocument(chunkDataView) {\n const domParser = DOMParser.get();\n if (!domParser) {\n console.warn('Warning: DOMParser is not available. It is needed to be able to parse XMP tags.'); // eslint-disable-line no-console\n throw new Error();\n }\n\n const xmlString = typeof chunkDataView === 'string' ? chunkDataView : getStringFromDataView(chunkDataView, 0, chunkDataView.byteLength);\n const doc = domParser.parseFromString(trimXmlSource(xmlString), 'application/xml');\n\n if (doc.documentElement.nodeName === 'parsererror') {\n throw new Error(doc.documentElement.textContent);\n }\n\n return {\n doc,\n raw: xmlString,\n };\n}\n\nfunction trimXmlSource(xmlSource) {\n return xmlSource.replace(/^.+(<\\?xpacket begin)/, '$1').replace(/(<\\?xpacket end=\".*\"\\?>).+$/, '$1');\n}\n\nfunction getRDF(node) {\n for (let i = 0; i < node.childNodes.length; i++) {\n if (node.childNodes[i].tagName === 'x:xmpmeta') {\n return getRDF(node.childNodes[i]);\n }\n if (node.childNodes[i].tagName === 'rdf:RDF') {\n return node.childNodes[i];\n }\n }\n\n throw new Error();\n}\n\nfunction convertToObject(node, isTopNode = false) {\n const childNodes = getChildNodes(node);\n\n if (hasTextOnlyContent(childNodes)) {\n if (isTopNode) {\n return {};\n }\n return getTextValue(childNodes[0]);\n }\n\n return getElementsFromNodes(childNodes);\n}\n\nfunction getChildNodes(node) {\n const elements = [];\n\n for (let i = 0; i < node.childNodes.length; i++) {\n elements.push(node.childNodes[i]);\n }\n\n return elements;\n}\n\nfunction hasTextOnlyContent(nodes) {\n return (nodes.length === 1) && (nodes[0].nodeName === '#text');\n}\n\nfunction getTextValue(node) {\n return node.nodeValue;\n}\n\nfunction getElementsFromNodes(nodes) {\n const elements = {};\n\n nodes.forEach((node) => {\n if (isElement(node)) {\n const nodeElement = getElementFromNode(node);\n\n if (elements[node.nodeName] !== undefined) {\n if (!Array.isArray(elements[node.nodeName])) {\n elements[node.nodeName] = [elements[node.nodeName]];\n }\n elements[node.nodeName].push(nodeElement);\n } else {\n elements[node.nodeName] = nodeElement;\n }\n }\n });\n\n return elements;\n}\n\nfunction isElement(node) {\n return (node.nodeName) && (node.nodeName !== '#text');\n}\n\nfunction getElementFromNode(node) {\n return {\n attributes: getAttributes(node),\n value: convertToObject(node)\n };\n}\n\nfunction getAttributes(element) {\n const attributes = {};\n\n for (let i = 0; i < element.attributes.length; i++) {\n attributes[element.attributes[i].nodeName] = decodeURIComponent(escape(element.attributes[i].value));\n }\n\n return attributes;\n}\n\nfunction parseXMPObject(xmpObject) {\n const tags = {};\n\n if (typeof xmpObject === 'string') {\n return xmpObject;\n }\n\n for (const nodeName in xmpObject) {\n let nodes = xmpObject[nodeName];\n\n if (!Array.isArray(nodes)) {\n nodes = [nodes];\n }\n\n nodes.forEach((node) => {\n objectAssign(tags, parseNodeAttributesAsTags(node.attributes));\n if (typeof node.value === 'object') {\n objectAssign(tags, parseNodeChildrenAsTags(node.value));\n }\n });\n }\n\n return tags;\n}\n\nfunction parseNodeAttributesAsTags(attributes) {\n const tags = {};\n\n for (const name in attributes) {\n try {\n if (isTagAttribute(name)) {\n tags[getLocalName(name)] = {\n value: attributes[name],\n attributes: {},\n description: getDescription(attributes[name], name)\n };\n }\n } catch (error) {\n // Keep going and try to parse the rest of the tags.\n }\n }\n\n return tags;\n}\n\nfunction isTagAttribute(name) {\n return (name !== 'rdf:parseType') && (!isNamespaceDefinition(name));\n}\n\nfunction isNamespaceDefinition(name) {\n return name.split(':')[0] === 'xmlns';\n}\n\nfunction getLocalName(name) {\n if (/^MicrosoftPhoto(_\\d+_)?:Rating$/i.test(name)) {\n return 'RatingPercent';\n }\n return name.split(':')[1];\n}\n\nfunction getDescription(value, name = undefined) {\n if (Array.isArray(value)) {\n const arrayDescription = getDescriptionOfArray(value);\n if ((name) && (typeof XmpTagNames[name] === 'function')) {\n return XmpTagNames[name](value, arrayDescription);\n }\n return arrayDescription;\n }\n if (typeof value === 'object') {\n return getDescriptionOfObject(value);\n }\n\n try {\n if ((name) && (typeof XmpTagNames[name] === 'function')) {\n return XmpTagNames[name](value);\n }\n return decodeURIComponent(escape(value));\n } catch (error) {\n return value;\n }\n}\n\nfunction getDescriptionOfArray(value) {\n return value.map((item) => {\n if (item.value !== undefined) {\n return getDescription(item.value);\n }\n return getDescription(item);\n }).join(', ');\n}\n\nfunction getDescriptionOfObject(value) {\n const descriptions = [];\n\n for (const key in value) {\n descriptions.push(`${getClearTextKey(key)}: ${getDescription(value[key].value)}`);\n }\n\n return descriptions.join('; ');\n}\n\nfunction getClearTextKey(key) {\n if (key === 'CiAdrCity') {\n return 'CreatorCity';\n }\n if (key === 'CiAdrCtry') {\n return 'CreatorCountry';\n }\n if (key === 'CiAdrExtadr') {\n return 'CreatorAddress';\n }\n if (key === 'CiAdrPcode') {\n return 'CreatorPostalCode';\n }\n if (key === 'CiAdrRegion') {\n return 'CreatorRegion';\n }\n if (key === 'CiEmailWork') {\n return 'CreatorWorkEmail';\n }\n if (key === 'CiTelWork') {\n return 'CreatorWorkPhone';\n }\n if (key === 'CiUrlWork') {\n return 'CreatorWorkUrl';\n }\n return key;\n}\n\nfunction parseNodeChildrenAsTags(children) {\n const tags = {};\n\n for (const name in children) {\n try {\n if (!isNamespaceDefinition(name)) {\n tags[getLocalName(name)] = parseNodeAsTag(children[name], name);\n }\n } catch (error) {\n // Keep going and try to parse the rest of the tags.\n }\n }\n\n return tags;\n}\n\nfunction parseNodeAsTag(node, name) {\n if (isDuplicateTag(node)) {\n return parseNodeAsDuplicateTag(node, name);\n }\n if (isEmptyResourceTag(node)) {\n return {value: '', attributes: {}, description: ''};\n }\n if (hasNestedSimpleRdfDescription(node)) {\n return parseNodeAsSimpleRdfDescription(node, name);\n }\n if (hasNestedStructureRdfDescription(node)) {\n return parseNodeAsStructureRdfDescription(node, name);\n }\n if (isCompactStructure(node)) {\n return parseNodeAsCompactStructure(node, name);\n }\n if (isArray(node)) {\n return parseNodeAsArray(node, name);\n }\n return parseNodeAsSimpleValue(node, name);\n}\n\nfunction isEmptyResourceTag(node) {\n return (node.attributes['rdf:parseType'] === 'Resource')\n && (typeof node.value === 'string')\n && (node.value.trim() === '');\n}\n\nfunction isDuplicateTag(node) {\n return Array.isArray(node);\n}\n\nfunction parseNodeAsDuplicateTag(node, name) {\n return parseNodeAsSimpleValue(node[node.length - 1], name);\n}\n\nfunction hasNestedSimpleRdfDescription(node) {\n return ((node.attributes['rdf:parseType'] === 'Resource') && (node.value['rdf:value'] !== undefined))\n || ((node.value['rdf:Description'] !== undefined) && (node.value['rdf:Description'].value['rdf:value'] !== undefined));\n}\n\nfunction parseNodeAsSimpleRdfDescription(node, name) {\n const attributes = parseNodeAttributes(node);\n\n if (node.value['rdf:Description'] !== undefined) {\n node = node.value['rdf:Description'];\n }\n\n objectAssign(attributes, parseNodeAttributes(node), parseNodeChildrenAsAttributes(node));\n\n const value = parseRdfValue(node);\n\n return {\n value,\n attributes,\n description: getDescription(value, name)\n };\n}\n\nfunction parseNodeAttributes(node) {\n const attributes = {};\n\n for (const name in node.attributes) {\n if ((name !== 'rdf:parseType') && (name !== 'rdf:resource') && (!isNamespaceDefinition(name))) {\n attributes[getLocalName(name)] = node.attributes[name];\n }\n }\n\n return attributes;\n}\n\nfunction parseNodeChildrenAsAttributes(node) {\n const attributes = {};\n\n for (const name in node.value) {\n if ((name !== 'rdf:value') && (!isNamespaceDefinition(name))) {\n attributes[getLocalName(name)] = node.value[name].value;\n }\n }\n\n return attributes;\n}\n\nfunction parseRdfValue(node) {\n return getURIValue(node.value['rdf:value']) || node.value['rdf:value'].value;\n}\n\nfunction hasNestedStructureRdfDescription(node) {\n return (node.attributes['rdf:parseType'] === 'Resource')\n || ((node.value['rdf:Description'] !== undefined) && (node.value['rdf:Description'].value['rdf:value'] === undefined));\n}\n\nfunction parseNodeAsStructureRdfDescription(node, name) {\n const tag = {\n value: {},\n attributes: {}\n };\n\n if (node.value['rdf:Description'] !== undefined) {\n objectAssign(tag.value, parseNodeAttributesAsTags(node.value['rdf:Description'].attributes));\n objectAssign(tag.attributes, parseNodeAttributes(node));\n node = node.value['rdf:Description'];\n }\n\n objectAssign(tag.value, parseNodeChildrenAsTags(node.value));\n\n tag.description = getDescription(tag.value, name);\n\n return tag;\n}\n\nfunction isCompactStructure(node) {\n return (Object.keys(node.value).length === 0)\n && (node.attributes['xml:lang'] === undefined)\n && (node.attributes['rdf:resource'] === undefined);\n}\n\nfunction parseNodeAsCompactStructure(node, name) {\n const value = parseNodeAttributesAsTags(node.attributes);\n\n return {\n value,\n attributes: {},\n description: getDescription(value, name)\n };\n}\n\nfunction isArray(node) {\n return getArrayChild(node.value) !== undefined;\n}\n\nfunction getArrayChild(value) {\n return value['rdf:Bag'] || value['rdf:Seq'] || value['rdf:Alt'];\n}\n\nfunction parseNodeAsArray(node, name) {\n let items = getArrayChild(node.value).value['rdf:li'];\n const attributes = parseNodeAttributes(node);\n const value = [];\n\n if (items === undefined) {\n items = [];\n } else if (!Array.isArray(items)) {\n items = [items];\n }\n\n items.forEach((item) => {\n value.push(parseArrayValue(item));\n });\n\n return {\n value,\n attributes,\n description: getDescription(value, name)\n };\n}\n\nfunction parseArrayValue(item) {\n if (hasNestedSimpleRdfDescription(item)) {\n return parseNodeAsSimpleRdfDescription(item);\n }\n if (hasNestedStructureRdfDescription(item)) {\n return parseNodeAsStructureRdfDescription(item).value;\n }\n if (isCompactStructure(item)) {\n return parseNodeAsCompactStructure(item).value;\n }\n\n return parseNodeAsSimpleValue(item);\n}\n\nfunction parseNodeAsSimpleValue(node, name) {\n const value = getURIValue(node) || parseXMPObject(node.value);\n\n return {\n value,\n attributes: parseNodeAttributes(node),\n description: getDescription(value, name)\n };\n}\n\nfunction getURIValue(node) {\n return node.attributes && node.attributes['rdf:resource'];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\nimport {\n getPascalStringFromDataView,\n padStart,\n parseFloatRadix,\n strRepeat\n} from './utils.js';\n\n// export const OsTypeKeys = {\n// OBJC: 'Objc',\n// DOUB: 'doub',\n// UNTF: 'UntF',\n// TEXT: 'TEXT',\n// BOOL: 'bool',\n// ENUM: 'enum',\n// LONG: 'long'\n// };\n\nexport const PathRecordTypes = {\n CLOSED_SUBPATH_LENGTH: 0,\n CLOSED_SUBPATH_BEZIER_LINKED: 1,\n CLOSED_SUBPATH_BEZIER_UNLINKED: 2,\n OPEN_SUBPATH_LENGTH: 3,\n OPEN_SUBPATH_BEZIER_LINKED: 4,\n OPEN_SUBPATH_BEZIER_UNLINKED: 5,\n FILL_RULE: 6,\n CLIPBOARD: 7,\n INITIAL_FILL_RULE: 8\n};\n\nconst PATH_RECORD_SIZE = 24;\n\nexport default {\n // 0x0425: {\n // name: 'CaptionDigest',\n // description(dataView) {\n // let description = '';\n // for (let i = 0; i < dataView.byteLength; i++) {\n // const byte = dataView.getUint8(i);\n // description += padStart(byte.toString(16), 2, '0');\n // }\n // return description;\n // }\n // },\n // Commented out for now to lower bundle size until someone asks for it.\n // 0x043a: {\n // name: 'PrintInformation',\n // description: parseDescriptor\n // },\n // 0x043b: {\n // name: 'PrintStyle',\n // description: parseDescriptor\n // },\n 0x07d0: {\n name: 'PathInformation',\n description: pathResource\n },\n 0x0bb7: {\n name: 'ClippingPathName',\n description(dataView) {\n const [, string] = getPascalStringFromDataView(dataView, 0);\n return string;\n }\n },\n};\n\n// function parseDescriptor(dataView) {\n// const DESCRIPTOR_VERSION_SIZE = 4;\n// // This is a unicode string terminated with null. Unsure about the format though since in my example image it starts with 0x0000.\n// const UNCLEAR_CLASS_ID_NAME_PART_SIZE = 6;\n// let offset = 0;\n// offset += DESCRIPTOR_VERSION_SIZE + UNCLEAR_CLASS_ID_NAME_PART_SIZE;\n// const [classId, classIdSize] = getBlockValue(dataView, offset);\n// offset += classIdSize;\n// const numItems = Types.getLongAt(dataView, offset);\n// offset += 4;\n// const descriptor = {[classId]: {}};\n// for (let i = 0; i < numItems; i++) {\n// const [itemKey, itemKeySize] = getBlockValue(dataView, offset);\n// offset += itemKeySize;\n// const osTypeKey = getStringFromDataView(dataView, offset, 4);\n// offset += 4;\n// try {\n// const {itemValue, itemSize} = getItemValue(dataView, offset, osTypeKey);\n// offset += itemSize;\n// descriptor[classId][ITEM_KEY_TERMS[itemKey] || itemKey] = itemValue;\n// } catch (error) {\n// // We can't recover from unknown OS type key since we don't know\n// // where the next one starts.\n// break;\n// }\n// }\n// return JSON.stringify(descriptor);\n// }\n\n// function getBlockValue(dataView, offset, unicode = false) {\n// const length = (unicode ? 2 : 1) * Types.getLongAt(dataView, offset) || 4;\n// offset += 4;\n// const value = (unicode ? getUnicodeStringFromDataView : getStringFromDataView)(dataView, offset, length);\n// offset += length;\n// return [value, 4 + length];\n// }\n\n// function getItemValue(dataView, offset, osTypeKey) {\n// // Not all OSType keys are implemented yet because they are missing in the example image.\n// if (osTypeKey === OsTypeKeys.OBJC) {\n// const [classIdName, classIdNameSize] = getBlockValue(dataView, offset, true);\n// offset += classIdNameSize;\n// const [classId, classIdSize] = getBlockValue(dataView, offset);\n// offset += classIdSize;\n// const _offset = Types.getLongAt(dataView, offset);\n// return {\n// itemValue: {[classIdName]: {[classId]: _offset}},\n// itemSize: classIdNameSize + classIdSize + 4\n// };\n// }\n// if (osTypeKey === OsTypeKeys.DOUB) {\n// return {\n// itemValue: parseDouble(dataView, offset),\n// itemSize: 8\n// };\n// }\n// if (osTypeKey === OsTypeKeys.UNTF) {\n// const unit = getStringFromDataView(dataView, offset, 4);\n// return {\n// itemValue: {unit, value: parseDouble(dataView, offset + 4)},\n// itemSize: unit.length + 8\n// };\n// }\n// if (osTypeKey === OsTypeKeys.TEXT) {\n// const length = 2 * Types.getLongAt(dataView, offset);\n// offset += 4;\n// const text = getUnicodeStringFromDataView(dataView, offset, length);\n// return {\n// itemValue: text,\n// itemSize: 4 + length\n// };\n// }\n// if (osTypeKey === OsTypeKeys.BOOL) {\n// return {\n// itemValue: Types.getByteAt(dataView, offset) === 1,\n// itemSize: 1\n// };\n// }\n// if (osTypeKey === OsTypeKeys.ENUM) {\n// const [type, typeSize] = getBlockValue(dataView, offset);\n// offset += typeSize;\n// const [enumName, enumSize] = getBlockValue(dataView, offset);\n// return {\n// itemValue: {[type]: enumName},\n// itemSize: typeSize + enumSize\n// };\n// }\n// if (osTypeKey === OsTypeKeys.LONG) {\n// return {\n// itemValue: Types.getLongAt(dataView, offset),\n// itemSize: 4\n// };\n// }\n// throw new Error(`Unknown OS type key: ${osTypeKey}`);\n// }\n\n// function parseDouble(dataView, offset) {\n// const BIAS = 1023;\n// const sign = (Types.getByteAt(dataView, offset) & parseInt('10000000', 2)) === 0 ? 1 : -1;\n// const exponent = ((Types.getShortAt(dataView, offset) & parseInt('0111111111110000', 2)) >> 4) - BIAS;\n// const fractionHigh = padStart((Types.getLongAt(dataView, offset) & parseInt('00000000000011111111111111111111', 2)).toString(2), 20, '0');\n// const fractionLow = padStart(Types.getLongAt(dataView, offset + 4).toString(2), 32, '0');\n// const fraction = parseFloatRadix('1.' + fractionHigh + fractionLow, 2);\n// return sign * fraction * Math.pow(2, exponent);\n// }\n\nfunction pathResource(dataView) {\n const TYPE_SIZE = 2;\n const types = {};\n const paths = [];\n\n for (let offset = 0; offset < dataView.byteLength; offset += TYPE_SIZE + PATH_RECORD_SIZE) {\n const type = Types.getShortAt(dataView, offset);\n if (PATH_RECORD_TYPES[type]) {\n if (!types[type]) {\n types[type] = PATH_RECORD_TYPES[type].description;\n }\n paths.push({\n type,\n path: PATH_RECORD_TYPES[type].path(dataView, offset + TYPE_SIZE)\n });\n }\n }\n return JSON.stringify({types, paths});\n}\n\nconst PATH_RECORD_TYPES = {\n [PathRecordTypes.CLOSED_SUBPATH_LENGTH]: {\n description: 'Closed subpath length',\n path: (dataView, offset) => [Types.getShortAt(dataView, offset)]\n },\n [PathRecordTypes.CLOSED_SUBPATH_BEZIER_LINKED]: {\n description: 'Closed subpath Bezier knot, linked',\n path: parseBezierKnot\n },\n [PathRecordTypes.CLOSED_SUBPATH_BEZIER_UNLINKED]: {\n description: 'Closed subpath Bezier knot, unlinked',\n path: parseBezierKnot\n },\n [PathRecordTypes.OPEN_SUBPATH_LENGTH]: {\n description: 'Open subpath length',\n path: (dataView, offset) => [Types.getShortAt(dataView, offset)]\n },\n [PathRecordTypes.OPEN_SUBPATH_BEZIER_LINKED]: {\n description: 'Open subpath Bezier knot, linked',\n path: parseBezierKnot\n },\n [PathRecordTypes.OPEN_SUBPATH_BEZIER_UNLINKED]: {\n description: 'Open subpath Bezier knot, unlinked',\n path: parseBezierKnot\n },\n [PathRecordTypes.FILL_RULE]: {\n description: 'Path fill rule',\n path: () => []\n },\n [PathRecordTypes.INITIAL_FILL_RULE]: {\n description: 'Initial fill rule',\n path: (dataView, offset) => [Types.getShortAt(dataView, offset)]\n },\n [PathRecordTypes.CLIPBOARD]: {\n description: 'Clipboard',\n path: parseClipboard\n }\n};\n\nfunction parseBezierKnot(dataView, offset) {\n const PATH_POINT_SIZE = 8;\n const path = [];\n for (let i = 0; i < PATH_RECORD_SIZE; i += PATH_POINT_SIZE) {\n path.push(parsePathPoint(dataView, offset + i));\n }\n return path;\n}\n\nfunction parsePathPoint(dataView, offset) {\n const vertical = getFixedPointNumber(dataView, offset, 8);\n const horizontal = getFixedPointNumber(dataView, offset + 4, 8);\n return [horizontal, vertical];\n}\n\nfunction parseClipboard(dataView, offset) {\n return [\n [\n getFixedPointNumber(dataView, offset, 8), // Top\n getFixedPointNumber(dataView, offset + 4, 8), // Left\n getFixedPointNumber(dataView, offset + 8, 8), // Botton\n getFixedPointNumber(dataView, offset + 12, 8), // Right\n ],\n getFixedPointNumber(dataView, offset + 16, 8) // Resolution\n ];\n}\n\nfunction getFixedPointNumber(dataView, offset, binaryPoint) {\n const number = Types.getLongAt(dataView, offset);\n\n const sign = (number >>> 31) === 0 ? 1 : -1;\n const integer = (number & 0x7f000000) >>> (32 - binaryPoint);\n const fraction = number & parseInt(strRepeat('1', 32 - binaryPoint), 2);\n\n return sign * parseFloatRadix(integer.toString(2) + '.' + padStart(fraction.toString(2), 32 - binaryPoint, '0'), 2);\n}\n\n// Item key terminology: https://psd-tools.readthedocs.io/en/latest/reference/psd_tools.terminology.html\n// Are these correct? There are collisions that are commented out. A lot of code for little gain?\n// const ITEM_KEY_TERMS = {\n// 'A ': 'A',\n// 'Adjs': 'Adjustment',\n// 'Algd': 'Aligned',\n// 'Algn': 'Alignment',\n// 'AllE': 'AllExcept',\n// 'All ': 'AllPS',\n// 'AlTl': 'AllToolOptions',\n// 'AChn': 'AlphaChannelOptions',\n// 'AlpC': 'AlphaChannels',\n// 'AmbB': 'AmbientBrightness',\n// 'AmbC': 'AmbientColor',\n// 'Amnt': 'Amount',\n// 'AmMx': 'AmplitudeMax',\n// 'AmMn': 'AmplitudeMin',\n// 'Anch': 'Anchor',\n// 'Angl': 'Angle',\n// 'Ang1': 'Angle1',\n// 'Ang2': 'Angle2',\n// 'Ang3': 'Angle3',\n// 'Ang4': 'Angle4',\n// 'AntA': 'AntiAlias',\n// 'Appe': 'Append',\n// 'Aply': 'Apply',\n// 'Ar ': 'Area',\n// 'Arrw': 'Arrowhead',\n// 'As ': 'As',\n// 'Asst': 'AssetBin',\n// 'AssC': 'AssumedCMYK',\n// 'AssG': 'AssumedGray',\n// 'AssR': 'AssumedRGB',\n// 'At ': 'At',\n// 'Auto': 'Auto',\n// 'AuCo': 'AutoContrast',\n// 'Atrs': 'AutoErase',\n// 'AtKr': 'AutoKern',\n// 'AtUp': 'AutoUpdate',\n// 'Axis': 'Axis',\n// 'B ': 'B',\n// 'Bckg': 'Background',\n// 'BckC': 'BackgroundColor',\n// 'BckL': 'BackgroundLevel',\n// 'Bwd ': 'Backward',\n// 'Blnc': 'Balance',\n// 'Bsln': 'BaselineShift',\n// 'BpWh': 'BeepWhenDone',\n// 'BgnR': 'BeginRamp',\n// 'BgnS': 'BeginSustain',\n// 'bvlD': 'BevelDirection',\n// 'ebbl': 'BevelEmboss',\n// 'bvlS': 'BevelStyle',\n// 'bvlT': 'BevelTechnique',\n// 'BgNH': 'BigNudgeH',\n// 'BgNV': 'BigNudgeV',\n// 'BtDp': 'BitDepth',\n// 'Blck': 'Black',\n// 'BlcC': 'BlackClip',\n// 'Blcn': 'BlackGeneration',\n// 'BlcG': 'BlackGenerationCurve',\n// 'BlcI': 'BlackIntensity',\n// 'BlcL': 'BlackLevel',\n// // 'BlcL': 'BlackLimit',\n// 'Bld ': 'Bleed',\n// 'Blnd': 'BlendRange',\n// 'Bl ': 'Blue',\n// 'BlBl': 'BlueBlackPoint',\n// 'blueFloat': 'BlueFloat',\n// 'BlGm': 'BlueGamma',\n// 'BlWh': 'BlueWhitePoint',\n// 'BlX ': 'BlueX',\n// 'BlY ': 'BlueY',\n// 'blur': 'Blur',\n// 'BlrM': 'BlurMethod',\n// 'BlrQ': 'BlurQuality',\n// 'Bk ': 'Book',\n// 'BrdT': 'BorderThickness',\n// 'Btom': 'Bottom',\n// 'Brgh': 'Brightness',\n// 'BrsD': 'BrushDetail',\n// 'BrsS': 'BrushSize',\n// 'BrsT': 'BrushType',\n// 'Brsh': 'Brushes',\n// 'BmpA': 'BumpAmplitude',\n// 'BmpC': 'BumpChannel',\n// 'By ': 'By',\n// 'Byln': 'Byline',\n// 'BylT': 'BylineTitle',\n// 'BytO': 'ByteOrder',\n// 'CMYS': 'CMYKSetup',\n// 'CchP': 'CachePrefs',\n// 'Clcl': 'Calculation',\n// 'Clbr': 'CalibrationBars',\n// 'Cptn': 'Caption',\n// 'CptW': 'CaptionWriter',\n// 'Ctgr': 'Category',\n// 'ClSz': 'CellSize',\n// 'Cntr': 'Center',\n// 'CntC': 'CenterCropMarks',\n// 'ChlA': 'ChalkArea',\n// 'Chnl': 'Channel',\n// 'ChMx': 'ChannelMatrix',\n// 'ChnN': 'ChannelName',\n// 'Chns': 'Channels',\n// 'ChnI': 'ChannelsInterleaved',\n// 'ChAm': 'CharcoalAmount',\n// 'ChrA': 'CharcoalArea',\n// 'Ckmt': 'ChokeMatte',\n// 'ChFX': 'ChromeFX',\n// 'City': 'City',\n// 'ClrA': 'ClearAmount',\n// 'ClPt': 'ClippingPath',\n// 'ClpP': 'ClippingPathEPS',\n// 'ClpF': 'ClippingPathFlatness',\n// 'ClpI': 'ClippingPathIndex',\n// 'Clpg': 'ClippingPathInfo',\n// 'ClnS': 'CloneSource',\n// 'Clsp': 'ClosedSubpath',\n// 'Clr ': 'Color',\n// 'Clrh': 'ColorChannels',\n// 'ClrC': 'ColorCorrection',\n// 'ClrI': 'ColorIndicates',\n// 'ClMg': 'ColorManagement',\n// 'Clrr': 'ColorPickerPrefs',\n// 'ClrS': 'ColorSpace',\n// 'ClrT': 'ColorTable',\n// 'Clrz': 'Colorize',\n// 'Clrs': 'Colors',\n// 'ClrL': 'ColorsList',\n// 'ClmW': 'ColumnWidth',\n// 'CmdK': 'CommandKey',\n// 'Cmpn': 'Compensation',\n// 'Cmpr': 'Compression',\n// 'Cncv': 'Concavity',\n// 'Cndt': 'Condition',\n// 'Cnst': 'Constant',\n// // 'Cnst': 'Constrain',\n// 'CnsP': 'ConstrainProportions',\n// 'Cfov': 'ConstructionFOV',\n// 'Cntg': 'Contiguous',\n// 'Cntn': 'Continue',\n// 'Cnty': 'Continuity',\n// 'ShpC': 'ContourType',\n// // 'Cntr': 'Contrast',\n// 'Cnvr': 'Convert',\n// 'Cpy ': 'Copy',\n// 'Cpyr': 'Copyright',\n// 'CprN': 'CopyrightNotice',\n// 'CrnC': 'CornerCropMarks',\n// 'Cnt ': 'Count',\n// 'CntN': 'CountryName',\n// 'CrcB': 'CrackBrightness',\n// 'CrcD': 'CrackDepth',\n// 'CrcS': 'CrackSpacing',\n// 'blfl': 'CreateLayersFromLayerFX',\n// 'Crdt': 'Credit',\n// 'Crss': 'Crossover',\n// 'Crnt': 'Current',\n// 'CrnH': 'CurrentHistoryState',\n// 'CrnL': 'CurrentLight',\n// 'CrnT': 'CurrentToolOptions',\n// 'Crv ': 'Curve',\n// 'CrvF': 'CurveFile',\n// 'Cstm': 'Custom',\n// 'CstF': 'CustomForced',\n// 'CstM': 'CustomMatte',\n// 'CstP': 'CustomPalette',\n// 'Cyn ': 'Cyan',\n// 'DCS ': 'DCS',\n// 'DPXf': 'DPXFormat',\n// 'DrkI': 'DarkIntensity',\n// 'Drkn': 'Darkness',\n// 'DtCr': 'DateCreated',\n// 'Dt ': 'Datum',\n// 'Dfnt': 'Definition',\n// 'Dnst': 'Density',\n// 'Dpth': 'Depth',\n// 'Dstl': 'DestBlackMax',\n// 'DstB': 'DestBlackMin',\n// 'Dstt': 'DestWhiteMax',\n// 'DstW': 'DestWhiteMin',\n// 'DstM': 'DestinationMode',\n// 'Dtl ': 'Detail',\n// 'Dmtr': 'Diameter',\n// 'DffD': 'DiffusionDither',\n// 'Drct': 'Direction',\n// 'DrcB': 'DirectionBalance',\n// 'DspF': 'DisplaceFile',\n// 'DspM': 'DisplacementMap',\n// 'DspP': 'DisplayPrefs',\n// 'Dstn': 'Distance',\n// // 'Dstr': 'Distortion',\n// // 'Dstr': 'Distribution',\n// 'Dthr': 'Dither',\n// 'DthA': 'DitherAmount',\n// 'Dthp': 'DitherPreserve',\n// 'Dthq': 'DitherQuality',\n// 'DocI': 'DocumentID',\n// 'DtGn': 'DotGain',\n// 'DtGC': 'DotGainCurves',\n// 'DrSh': 'DropShadow',\n// 'Dplc': 'Duplicate',\n// 'DnmC': 'DynamicColorSliders',\n// 'Edg ': 'Edge',\n// 'EdgB': 'EdgeBrightness',\n// 'EdgF': 'EdgeFidelity',\n// 'EdgI': 'EdgeIntensity',\n// 'EdgS': 'EdgeSimplicity',\n// 'EdgT': 'EdgeThickness',\n// 'EdgW': 'EdgeWidth',\n// 'Effc': 'Effect',\n// 'EmbC': 'EmbedCMYK',\n// 'EmbG': 'EmbedGray',\n// 'EmbL': 'EmbedLab',\n// 'EmbP': 'EmbedProfiles',\n// 'EmbR': 'EmbedRGB',\n// 'EmlD': 'EmulsionDown',\n// 'EGst': 'EnableGestures',\n// 'enab': 'Enabled',\n// 'Encd': 'Encoding',\n// 'End ': 'End',\n// 'EndA': 'EndArrowhead',\n// 'EndR': 'EndRamp',\n// 'EndS': 'EndSustain',\n// 'Engn': 'Engine',\n// 'ErsT': 'EraseToHistory',\n// 'ErsK': 'EraserKind',\n// 'ExcP': 'ExactPoints',\n// 'Expr': 'Export',\n// 'ExpC': 'ExportClipboard',\n// 'Exps': 'Exposure',\n// 'Extd': 'Extend',\n// 'EQlt': 'ExtendedQuality',\n// 'Extn': 'Extension',\n// 'ExtQ': 'ExtensionsQuery',\n// 'ExtD': 'ExtrudeDepth',\n// 'ExtM': 'ExtrudeMaskIncomplete',\n// 'ExtR': 'ExtrudeRandom',\n// 'ExtS': 'ExtrudeSize',\n// 'ExtF': 'ExtrudeSolidFace',\n// 'ExtT': 'ExtrudeType',\n// 'EyDr': 'EyeDropperSample',\n// 'FxCm': 'FPXCompress',\n// 'FxQl': 'FPXQuality',\n// 'FxSz': 'FPXSize',\n// 'FxVw': 'FPXView',\n// 'FdT ': 'FadeTo',\n// 'FdtS': 'FadeoutSteps',\n// 'FlOf': 'Falloff',\n// 'Fthr': 'Feather',\n// 'FbrL': 'FiberLength',\n// 'File': 'File',\n// 'FlCr': 'FileCreator',\n// 'FlIn': 'FileInfo',\n// 'FilR': 'FileReference',\n// 'FlSP': 'FileSavePrefs',\n// 'FlTy': 'FileType',\n// 'flst': 'FilesList',\n// 'Fl ': 'Fill',\n// 'FlCl': 'FillColor',\n// 'FlNt': 'FillNeutral',\n// 'FlPd': 'FilterLayerPersistentData',\n// 'FlRs': 'FilterLayerRandomSeed',\n// 'Fngr': 'Fingerpainting',\n// 'FlrC': 'FlareCenter',\n// 'Fltn': 'Flatness',\n// 'Fltt': 'Flatten',\n// 'FlpV': 'FlipVertical',\n// 'Fcs ': 'Focus',\n// 'Fldr': 'Folders',\n// 'FntD': 'FontDesignAxes',\n// 'FntV': 'FontDesignAxesVectors',\n// 'FntN': 'FontName',\n// 'Scrp': 'FontScript',\n// 'FntS': 'FontStyleName',\n// 'FntT': 'FontTechnology',\n// 'FrcC': 'ForcedColors',\n// 'FrgC': 'ForegroundColor',\n// 'FrgL': 'ForegroundLevel',\n// 'Fmt ': 'Format',\n// 'Fwd ': 'Forward',\n// 'FrFX': 'FrameFX',\n// 'FrmW': 'FrameWidth',\n// 'FTcs': 'FreeTransformCenterState',\n// 'Frqn': 'Frequency',\n// 'From': 'From',\n// 'FrmB': 'FromBuiltin',\n// 'FrmM': 'FromMode',\n// 'FncK': 'FunctionKey',\n// 'Fzns': 'Fuzziness',\n// 'GCR ': 'GCR',\n// 'GFPT': 'GIFColorFileType',\n// 'GFCL': 'GIFColorLimit',\n// 'GFEC': 'GIFExportCaption',\n// 'GFMI': 'GIFMaskChannelIndex',\n// 'GFMV': 'GIFMaskChannelInverted',\n// 'GFPF': 'GIFPaletteFile',\n// 'GFPL': 'GIFPaletteType',\n// 'GFCS': 'GIFRequiredColorSpaceType',\n// 'GFIT': 'GIFRowOrderType',\n// 'GFTC': 'GIFTransparentColor',\n// 'GFTB': 'GIFTransparentIndexBlue',\n// 'GFTG': 'GIFTransparentIndexGreen',\n// 'GFTR': 'GIFTransparentIndexRed',\n// 'GFBM': 'GIFUseBestMatch',\n// 'Gmm ': 'Gamma',\n// 'GmtW': 'GamutWarning',\n// 'GnrP': 'GeneralPrefs',\n// 'gblA': 'GlobalAngle',\n// 'gagl': 'GlobalLightingAngle',\n// 'Glos': 'Gloss',\n// 'GlwA': 'GlowAmount',\n// 'GlwT': 'GlowTechnique',\n// 'Grad': 'Gradient',\n// 'Grdf': 'GradientFill',\n// // 'Grn ': 'Grain',\n// 'Grnt': 'GrainType',\n// 'Grns': 'Graininess',\n// 'Gry ': 'Gray',\n// 'GrBh': 'GrayBehavior',\n// 'GrSt': 'GraySetup',\n// 'Grn ': 'Green',\n// 'GrnB': 'GreenBlackPoint',\n// 'greenFloat': 'GreenFloat',\n// 'GrnG': 'GreenGamma',\n// 'GrnW': 'GreenWhitePoint',\n// 'GrnX': 'GreenX',\n// 'GrnY': 'GreenY',\n// 'GrdC': 'GridColor',\n// 'Grds': 'GridCustomColor',\n// 'GrdM': 'GridMajor',\n// 'Grdn': 'GridMinor',\n// 'GrdS': 'GridStyle',\n// 'Grdt': 'GridUnits',\n// 'Grup': 'Group',\n// 'GrtW': 'GroutWidth',\n// 'GrwS': 'GrowSelection',\n// 'Gdes': 'Guides',\n// 'GdsC': 'GuidesColor',\n// 'Gdss': 'GuidesCustomColor',\n// 'GdPr': 'GuidesPrefs',\n// 'GdsS': 'GuidesStyle',\n// 'GttW': 'GutterWidth',\n// 'HlfF': 'HalftoneFile',\n// 'HlfS': 'HalftoneScreen',\n// 'HlSz': 'HalftoneSize',\n// 'Hlfp': 'HalftoneSpec',\n// 'Hrdn': 'Hardness',\n// 'HCdH': 'HasCmdHPreference',\n// 'Hdr ': 'Header',\n// 'Hdln': 'Headline',\n// 'Hght': 'Height',\n// 'HghA': 'HighlightArea',\n// 'hglC': 'HighlightColor',\n// 'HghL': 'HighlightLevels',\n// 'hglM': 'HighlightMode',\n// 'hglO': 'HighlightOpacity',\n// 'HghS': 'HighlightStrength',\n// 'HstB': 'HistoryBrushSource',\n// 'HstP': 'HistoryPrefs',\n// 'HsSS': 'HistoryStateSource',\n// 'HsSt': 'HistoryStates',\n// 'Hrzn': 'Horizontal',\n// 'HrzS': 'HorizontalScale',\n// 'HstN': 'HostName',\n// 'HstV': 'HostVersion',\n// 'H ': 'Hue',\n// 'ICCE': 'ICCEngine',\n// 'ICCt': 'ICCSetupName',\n// 'Idnt': 'ID',\n// 'Idle': 'Idle',\n// 'ImgB': 'ImageBalance',\n// 'Impr': 'Import',\n// 'Imps': 'Impressionist',\n// 'In ': 'In',\n// 'c@#^': 'Inherits',\n// 'InkC': 'InkColors',\n// 'Inks': 'Inks',\n// 'IrGl': 'InnerGlow',\n// 'glwS': 'InnerGlowSource',\n// 'IrSh': 'InnerShadow',\n// 'Inpt': 'Input',\n// 'kIBP': 'InputBlackPoint',\n// 'Inmr': 'InputMapRange',\n// 'Inpr': 'InputRange',\n// 'kIWP': 'InputWhitePoint',\n// 'Intn': 'Intensity',\n// 'Inte': 'Intent',\n// 'IntH': 'InterfaceBevelHighlight',\n// 'Intv': 'InterfaceBevelShadow',\n// 'IntB': 'InterfaceBlack',\n// 'Intd': 'InterfaceBorder',\n// 'Intk': 'InterfaceButtonDarkShadow',\n// 'Intt': 'InterfaceButtonDownFill',\n// 'InBF': 'InterfaceButtonUpFill',\n// 'ICBL': 'InterfaceColorBlue2',\n// 'ICBH': 'InterfaceColorBlue32',\n// 'ICGL': 'InterfaceColorGreen2',\n// 'ICGH': 'InterfaceColorGreen32',\n// 'ICRL': 'InterfaceColorRed2',\n// 'ICRH': 'InterfaceColorRed32',\n// 'IntI': 'InterfaceIconFillActive',\n// 'IntF': 'InterfaceIconFillDimmed',\n// 'Intc': 'InterfaceIconFillSelected',\n// 'Intm': 'InterfaceIconFrameActive',\n// // 'Intr': 'InterfaceIconFrameDimmed',\n// 'IntS': 'InterfaceIconFrameSelected',\n// 'IntP': 'InterfacePaletteFill',\n// 'IntR': 'InterfaceRed',\n// 'IntT': 'InterfaceToolTipBackground',\n// 'ITTT': 'InterfaceToolTipText',\n// 'ITBg': 'InterfaceTransparencyBackground',\n// 'ITFg': 'InterfaceTransparencyForeground',\n// 'IntW': 'InterfaceWhite',\n// // 'Intr': 'Interlace',\n// 'IntC': 'InterlaceCreateType',\n// 'IntE': 'InterlaceEliminateType',\n// // 'Intr': 'Interpolation',\n// 'IntM': 'InterpolationMethod',\n// 'Invr': 'Invert',\n// 'InvM': 'InvertMask',\n// 'InvS': 'InvertSource2',\n// 'InvT': 'InvertTexture',\n// 'IsDr': 'IsDirty',\n// 'ItmI': 'ItemIndex',\n// 'JPEQ': 'JPEGQuality',\n// 'Krng': 'Kerning',\n// 'Kywd': 'Keywords',\n// 'Knd ': 'Kind',\n// 'LTnm': 'LUTAnimation',\n// 'LZWC': 'LZWCompression',\n// 'Lbls': 'Labels',\n// 'Lnds': 'Landscape',\n// 'LstT': 'LastTransform',\n// 'Lyr ': 'Layer',\n// 'Lefx': 'LayerEffects',\n// 'lfxv': 'LayerFXVisible',\n// 'LyrI': 'LayerID',\n// 'LyrN': 'LayerName',\n// 'Lyrs': 'Layers',\n// 'Ldng': 'Leading',\n// 'Left': 'Left',\n// 'lSNs': 'LegacySerialString',\n// // 'Lngt': 'Length',\n// 'Lns ': 'Lens',\n// 'Lvl ': 'Level',\n// 'Lvls': 'Levels',\n// 'LgDr': 'LightDark',\n// 'LghD': 'LightDirection',\n// 'LghI': 'LightIntensity',\n// 'LghP': 'LightPosition',\n// 'LghS': 'LightSource',\n// 'LghT': 'LightType',\n// 'LghG': 'LightenGrout',\n// 'Lght': 'Lightness',\n// 'Line': 'Line',\n// 'lnkE': 'LinkEnable',\n// 'LnkL': 'LinkedLayerIDs',\n// 'Lald': 'LocalLightingAltitude',\n// 'lagl': 'LocalLightingAngle',\n// 'LclR': 'LocalRange',\n// 'Lctn': 'Location',\n// 'Log ': 'Log',\n// 'kLog': 'Logarithmic',\n// 'LwCs': 'LowerCase',\n// 'Lmnc': 'Luminance',\n// 'Mgnt': 'Magenta',\n// 'MkVs': 'MakeVisible',\n// 'Mfov': 'ManipulationFOV',\n// 'MpBl': 'MapBlack',\n// 'Mpng': 'Mapping',\n// 'MpgS': 'MappingShape',\n// 'Mtrl': 'Material',\n// 'Mtrx': 'Matrix',\n// 'MttC': 'MatteColor',\n// 'Mxm ': 'Maximum',\n// 'MxmS': 'MaximumStates',\n// 'MmrU': 'MemoryUsagePercent',\n// 'Mrge': 'Merge',\n// 'Mrgd': 'Merged',\n// 'Msge': 'Message',\n// 'Mthd': 'Method',\n// 'MztT': 'MezzotintType',\n// 'Mdpn': 'Midpoint',\n// 'MdtL': 'MidtoneLevels',\n// 'Mnm ': 'Minimum',\n// 'MsmC': 'MismatchCMYK',\n// 'MsmG': 'MismatchGray',\n// 'MsmR': 'MismatchRGB',\n// 'Md ': 'Mode',\n// 'Mnch': 'Monochromatic',\n// 'MvT ': 'MoveTo',\n// 'Nm ': 'Name',\n// 'Ngtv': 'Negative',\n// 'Nw ': 'New',\n// 'Nose': 'Noise',\n// 'NnIm': 'NonImageData',\n// 'NnLn': 'NonLinear',\n// 'null': 'Null',\n// 'Nm L': 'NumLights',\n// 'Nmbr': 'Number',\n// 'NCch': 'NumberOfCacheLevels',\n// 'NC64': 'NumberOfCacheLevels64',\n// 'NmbO': 'NumberOfChannels',\n// 'NmbC': 'NumberOfChildren',\n// 'NmbD': 'NumberOfDocuments',\n// 'NmbG': 'NumberOfGenerators',\n// // 'NmbL': 'NumberOfLayers',\n// // 'NmbL': 'NumberOfLevels',\n// 'NmbP': 'NumberOfPaths',\n// 'NmbR': 'NumberOfRipples',\n// 'NmbS': 'NumberOfSiblings',\n// 'ObjN': 'ObjectName',\n// 'Ofst': 'Offset',\n// 'Sftt': 'OldSmallFontType',\n// 'On ': 'On',\n// 'Opct': 'Opacity',\n// 'Optm': 'Optimized',\n// 'Ornt': 'Orientation',\n// 'OrgH': 'OriginalHeader',\n// 'OrgT': 'OriginalTransmissionReference',\n// 'OthC': 'OtherCursors',\n// 'OrGl': 'OuterGlow',\n// 'Otpt': 'Output',\n// 'kOBP': 'OutputBlackPoint',\n// 'kOWP': 'OutputWhitePoint',\n// 'OvrC': 'OverprintColors',\n// 'OvrO': 'OverrideOpen',\n// 'ObrP': 'OverridePrinter',\n// 'Ovrd': 'OverrideSave',\n// 'PNGf': 'PNGFilter',\n// 'PGIT': 'PNGInterlaceType',\n// 'PMpf': 'PageFormat',\n// 'PgNm': 'PageNumber',\n// 'PgPs': 'PagePosition',\n// 'PgSt': 'PageSetup',\n// 'PnCK': 'PaintCursorKind',\n// 'PntT': 'PaintType',\n// 'PntC': 'PaintingCursors',\n// 'Plt ': 'Palette',\n// 'PltF': 'PaletteFile',\n// 'PprB': 'PaperBrightness',\n// 'PrIn': 'ParentIndex',\n// 'PrNm': 'ParentName',\n// 'Path': 'Path',\n// 'PthC': 'PathContents',\n// 'PthN': 'PathName',\n// 'Pttn': 'Pattern',\n// 'Pncl': 'PencilWidth',\n// 'Prsp': 'PerspectiveIndex',\n// 'Phsp': 'Phosphors',\n// 'PckI': 'PickerID',\n// 'Pckr': 'PickerKind',\n// 'PPSz': 'PixelPaintSize',\n// 'Pltf': 'Platform',\n// 'PlgF': 'PluginFolder',\n// 'PlgP': 'PluginPrefs',\n// 'Pts ': 'Points',\n// 'Pstn': 'Position',\n// 'PstS': 'PostScriptColor',\n// 'Pstr': 'Posterization',\n// 'PrdC': 'PredefinedColors',\n// 'PrfB': 'PreferBuiltin',\n// 'Prfr': 'Preferences',\n// 'PrsA': 'PreserveAdditional',\n// 'PrsL': 'PreserveLuminosity',\n// 'PrsT': 'PreserveTransparency',\n// 'Prs ': 'Pressure',\n// 'Prvw': 'Preview',\n// 'PrvK': 'PreviewCMYK',\n// 'PrvF': 'PreviewFullSize',\n// 'PrvI': 'PreviewIcon',\n// 'PrvM': 'PreviewMacThumbnail',\n// 'PrvW': 'PreviewWinThumbnail',\n// 'PrvQ': 'PreviewsQuery',\n// 'PMps': 'PrintSettings',\n// 'PrfS': 'ProfileSetup',\n// 'PrvS': 'ProvinceState',\n// 'Qlty': 'Quality',\n// 'QucM': 'QuickMask',\n// 'RGBS': 'RGBSetup',\n// 'Rds ': 'Radius',\n// 'RndS': 'RandomSeed',\n// 'Rt ': 'Ratio',\n// 'Rcnf': 'RecentFiles',\n// 'Rd ': 'Red',\n// 'RdBl': 'RedBlackPoint',\n// 'redFloat': 'RedFloat',\n// 'RdGm': 'RedGamma',\n// 'RdWh': 'RedWhitePoint',\n// 'RdX ': 'RedX',\n// 'RdY ': 'RedY',\n// 'RgsM': 'RegistrationMarks',\n// 'Rltv': 'Relative',\n// 'Rlf ': 'Relief',\n// 'Rfid': 'RenderFidelity',\n// 'Rsmp': 'Resample',\n// 'RWOZ': 'ResizeWindowsOnZoom',\n// 'Rslt': 'Resolution',\n// 'RsrI': 'ResourceID',\n// 'Rspn': 'Response',\n// 'RtnH': 'RetainHeader',\n// 'Rvrs': 'Reverse',\n// 'Rght': 'Right',\n// 'RplM': 'RippleMagnitude',\n// 'RplS': 'RippleSize',\n// 'Rtt ': 'Rotate',\n// 'Rndn': 'Roundness',\n// 'RlrH': 'RulerOriginH',\n// 'RlrV': 'RulerOriginV',\n// 'RlrU': 'RulerUnits',\n// // 'Strt': 'Saturation',\n// 'SvAn': 'SaveAndClose',\n// 'SvCm': 'SaveComposite',\n// 'PltL': 'SavePaletteLocations',\n// 'SvPt': 'SavePaths',\n// 'SvPy': 'SavePyramids',\n// 'Svng': 'Saving',\n// 'Scl ': 'Scale',\n// 'SclH': 'ScaleHorizontal',\n// 'SclV': 'ScaleVertical',\n// 'Scln': 'Scaling',\n// 'Scns': 'Scans',\n// 'ScrD': 'ScratchDisks',\n// 'ScrF': 'ScreenFile',\n// 'ScrT': 'ScreenType',\n// 'Sprt': 'Separations',\n// 'SrlS': 'SerialString',\n// // 'ShdI': 'ShadingIntensity',\n// 'ShdN': 'ShadingNoise',\n// 'ShdS': 'ShadingShape',\n// 'sdwC': 'ShadowColor',\n// // 'ShdI': 'ShadowIntensity',\n// 'ShdL': 'ShadowLevels',\n// 'sdwM': 'ShadowMode',\n// 'sdwO': 'ShadowOpacity',\n// 'Shp ': 'Shape',\n// 'Shrp': 'Sharpness',\n// 'ShrE': 'ShearEd',\n// 'ShrP': 'ShearPoints',\n// 'ShrS': 'ShearSt',\n// 'ShfK': 'ShiftKey',\n// 'ShKT': 'ShiftKeyToolSwitch',\n// 'ShrN': 'ShortNames',\n// 'ShwE': 'ShowEnglishFontNames',\n// 'SwMC': 'ShowMenuColors',\n// 'ShwT': 'ShowToolTips',\n// 'ShTr': 'ShowTransparency',\n// 'Sz ': 'SizeKey',\n// 'Skew': 'Skew',\n// 'Sfts': 'SmallFontType',\n// 'SmBM': 'SmartBlurMode',\n// 'SmBQ': 'SmartBlurQuality',\n// 'Smoo': 'Smooth',\n// 'Smth': 'Smoothness',\n// 'SnpI': 'SnapshotInitial',\n// 'SfCl': 'SoftClip',\n// 'Sftn': 'Softness',\n// 'SoFi': 'SolidFill',\n// 'Srce': 'Source',\n// 'Src2': 'Source2',\n// 'SrcM': 'SourceMode',\n// 'Spcn': 'Spacing',\n// 'SpcI': 'SpecialInstructions',\n// 'SphM': 'SpherizeMode',\n// 'Spot': 'Spot',\n// 'SprR': 'SprayRadius',\n// 'SqrS': 'SquareSize',\n// 'Srcl': 'SrcBlackMax',\n// 'SrcB': 'SrcBlackMin',\n// 'Srcm': 'SrcWhiteMax',\n// 'SrcW': 'SrcWhiteMin',\n// // 'Strt': 'Start',\n// 'StrA': 'StartArrowhead',\n// 'Stte': 'State',\n// 'srgh': 'Strength',\n// 'srgR': 'StrengthRatio',\n// 'Strg': 'Strength_PLUGIN',\n// 'StDt': 'StrokeDetail',\n// 'SDir': 'StrokeDirection',\n// 'StrL': 'StrokeLength',\n// 'StrP': 'StrokePressure',\n// 'StrS': 'StrokeSize',\n// 'StrW': 'StrokeWidth',\n// 'Styl': 'Style',\n// 'Stys': 'Styles',\n// 'StlC': 'StylusIsColor',\n// 'StlO': 'StylusIsOpacity',\n// 'StlP': 'StylusIsPressure',\n// 'StlS': 'StylusIsSize',\n// 'SbpL': 'SubPathList',\n// 'SplC': 'SupplementalCategories',\n// 'SstI': 'SystemInfo',\n// 'SstP': 'SystemPalette',\n// // 'null': 'Target',\n// 'Trgp': 'TargetPath',\n// 'TrgP': 'TargetPathIndex',\n// // 'Lngt': 'TermLength',\n// 'Txt ': 'Text',\n// // 'TxtC': 'TextClickPoint',\n// 'TxtD': 'TextData',\n// 'TxtS': 'TextStyle',\n// 'Txtt': 'TextStyleRange',\n// 'Txtr': 'Texture',\n// // 'TxtC': 'TextureCoverage',\n// 'TxtF': 'TextureFile',\n// 'TxtT': 'TextureType',\n// 'Thsh': 'Threshold',\n// 'TlNm': 'TileNumber',\n// 'TlOf': 'TileOffset',\n// 'TlSz': 'TileSize',\n// 'Ttl ': 'Title',\n// 'T ': 'To',\n// 'TBl ': 'ToBuiltin',\n// 'ToLk': 'ToLinked',\n// 'TMd ': 'ToMode',\n// 'TglO': 'ToggleOthers',\n// 'Tlrn': 'Tolerance',\n// 'Top ': 'Top',\n// 'TtlL': 'TotalLimit',\n// 'Trck': 'Tracking',\n// 'TrnF': 'TransferFunction',\n// // 'TrnS': 'TransferSpec',\n// 'Trns': 'Transparency',\n// // 'TrnG': 'TransparencyGrid',\n// 'TrnC': 'TransparencyGridColors',\n// // 'TrnG': 'TransparencyGridSize',\n// 'TrnP': 'TransparencyPrefs',\n// // 'TrnS': 'TransparencyShape',\n// 'TrnI': 'TransparentIndex',\n// 'TrnW': 'TransparentWhites',\n// 'Twst': 'Twist',\n// 'Type': 'Type',\n// 'UC ': 'UCA',\n// 'URL ': 'URL',\n// 'UndA': 'UndefinedArea',\n// 'Undl': 'Underline',\n// 'UntP': 'UnitsPrefs',\n// 'Untl': 'Untitled',\n// 'UppY': 'UpperY',\n// 'Urgn': 'Urgency',\n// 'AcrS': 'UseAccurateScreens',\n// 'AdPl': 'UseAdditionalPlugins',\n// 'UsCc': 'UseCacheForHistograms',\n// 'UsCr': 'UseCurves',\n// 'UsDf': 'UseDefault',\n// 'uglg': 'UseGlobalAngle',\n// 'UsIC': 'UseICCProfile',\n// 'UsMs': 'UseMask',\n// 'UsrM': 'UserMaskEnabled',\n// 'Usrs': 'UserMaskLinked',\n// 'Usng': 'Using',\n// 'Vl ': 'Value',\n// 'Vrnc': 'Variance',\n// 'Vct0': 'Vector0',\n// 'Vct1': 'Vector1',\n// 'VctC': 'VectorColor',\n// 'VrsF': 'VersionFix',\n// 'VrsM': 'VersionMajor',\n// 'VrsN': 'VersionMinor',\n// 'Vrtc': 'Vertical',\n// 'VrtS': 'VerticalScale',\n// 'Vdlp': 'VideoAlpha',\n// 'Vsbl': 'Visible',\n// 'WtcS': 'WatchSuspension',\n// 'watr': 'Watermark',\n// 'Wvtp': 'WaveType',\n// 'WLMx': 'WavelengthMax',\n// 'WLMn': 'WavelengthMin',\n// 'WbdP': 'WebdavPrefs',\n// 'Wtdg': 'WetEdges',\n// 'What': 'What',\n// 'WhtC': 'WhiteClip',\n// 'WhtI': 'WhiteIntensity',\n// 'WhHi': 'WhiteIsHigh',\n// 'WhtL': 'WhiteLevel',\n// 'WhtP': 'WhitePoint',\n// 'WhPt': 'WholePath',\n// 'Wdth': 'Width',\n// 'WndM': 'WindMethod',\n// 'With': 'With',\n// 'WrPt': 'WorkPath',\n// 'WrkP': 'WorkPathIndex',\n// 'X ': 'X',\n// 'Y ': 'Y',\n// 'Ylw ': 'Yellow',\n// 'ZZTy': 'ZigZagType',\n// 'Alis': '_3DAntiAlias',\n// };\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// Specification: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/\n\nimport {getDataView, getStringFromDataView, getPascalStringFromDataView} from './utils.js';\nimport Types from './types.js';\nimport TagNames from './photoshop-tag-names.js';\n\nexport default {\n read\n};\n\nconst SIGNATURE = '8BIM';\nconst TAG_ID_SIZE = 2;\nconst RESOURCE_LENGTH_SIZE = 4;\n\nconst SIGNATURE_SIZE = SIGNATURE.length;\n\nfunction read(bytes, includeUnknown) {\n const dataView = getDataView(new Uint8Array(bytes).buffer);\n const tags = {};\n let offset = 0;\n\n while (offset < bytes.length) {\n const signature = getStringFromDataView(dataView, offset, SIGNATURE_SIZE);\n offset += SIGNATURE_SIZE;\n const tagId = Types.getShortAt(dataView, offset);\n offset += TAG_ID_SIZE;\n const {tagName, tagNameSize} = getTagName(dataView, offset);\n offset += tagNameSize;\n const resourceSize = Types.getLongAt(dataView, offset);\n offset += RESOURCE_LENGTH_SIZE;\n if (signature === SIGNATURE) {\n const valueDataView = getDataView(dataView.buffer, offset, resourceSize);\n const tag = {\n id: tagId,\n value: getStringFromDataView(valueDataView, 0, resourceSize),\n };\n if (TagNames[tagId]) {\n try {\n tag.description = TagNames[tagId].description(valueDataView);\n } catch (error) {\n tag.description = '<no description formatter>';\n }\n tags[tagName ? tagName : TagNames[tagId].name] = tag;\n } else if (includeUnknown) {\n tags[`undefined-${tagId}`] = tag;\n }\n }\n offset += resourceSize + (resourceSize % 2);\n }\n\n return tags;\n}\n\nfunction getTagName(dataView, offset) {\n // The name is encoded as a Pascal string (the string is prefixed with one\n // byte containing the length of the string) and everything is padded with a\n // null byte to make the size even.\n const [stringSize, string] = getPascalStringFromDataView(dataView, offset);\n return {\n tagName: string,\n tagNameSize: 1 + stringSize + (stringSize % 2 === 0 ? 1 : 0)\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\n\nexport const iccTags = {\n 'desc': {\n 'name': 'ICC Description',\n },\n 'cprt': {\n 'name': 'ICC Copyright',\n },\n 'dmdd': {\n 'name': 'ICC Device Model Description',\n },\n 'vued': {\n 'name': 'ICC Viewing Conditions Description',\n },\n 'dmnd': {\n 'name': 'ICC Device Manufacturer for Display',\n },\n 'tech': {\n 'name': 'Technology',\n },\n};\n\nexport const iccProfile = {\n 4: {\n 'name': 'Preferred CMM type',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => value !== null ? toCompany(value) : '',\n },\n 8: {\n 'name': 'Profile Version',\n 'value': (dataView, offset) => {\n return (dataView.getUint8(offset)).toString(10) + '.'\n + (dataView.getUint8(offset + 1) >> 4).toString(10) + '.'\n + (dataView.getUint8(offset + 1) % 16).toString(10);\n }\n },\n 12: {\n 'name': 'Profile/Device class',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => {\n switch (value.toLowerCase()) {\n case 'scnr': return 'Input Device profile';\n case 'mntr': return 'Display Device profile';\n case 'prtr': return 'Output Device profile';\n case 'link': return 'DeviceLink profile';\n case 'abst': return 'Abstract profile';\n case 'spac': return 'ColorSpace profile';\n case 'nmcl': return 'NamedColor profile';\n case 'cenc': return 'ColorEncodingSpace profile';\n case 'mid ': return 'MultiplexIdentification profile';\n case 'mlnk': return 'MultiplexLink profile';\n case 'mvis': return 'MultiplexVisualization profile';\n default: return value;\n }\n }\n },\n 16: {\n 'name': 'Color Space',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 20: {\n 'name': 'Connection Space',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 24: {\n 'name': 'ICC Profile Date',\n 'value': (dataView, offset) => parseDate(dataView, offset).toISOString()\n },\n 36: {\n 'name': 'ICC Signature',\n 'value': (dataView, offset) => sliceToString(dataView.buffer.slice(offset, offset + 4))\n },\n 40: {\n 'name': 'Primary Platform',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => toCompany(value)\n },\n 48: {\n 'name': 'Device Manufacturer',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => toCompany(value)\n },\n 52: {\n 'name': 'Device Model Number',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 64: {\n 'name': 'Rendering Intent',\n 'value': (dataView, offset) => dataView.getUint32(offset),\n 'description': (value) => {\n switch (value) {\n case 0: return 'Perceptual';\n case 1: return 'Relative Colorimetric';\n case 2: return 'Saturation';\n case 3: return 'Absolute Colorimetric';\n default: return value;\n }\n }\n },\n\n 80: {\n 'name': 'Profile Creator',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n};\n\nfunction parseDate(dataView, offset) {\n const year = dataView.getUint16(offset);\n const month = dataView.getUint16(offset + 2) - 1;\n const day = dataView.getUint16(offset + 4);\n const hours = dataView.getUint16(offset + 6);\n const minutes = dataView.getUint16(offset + 8);\n const seconds = dataView.getUint16(offset + 10);\n return new Date(Date.UTC(year, month, day, hours, minutes, seconds));\n}\n\nfunction sliceToString(slice) {\n return String.fromCharCode.apply(null, new Uint8Array(slice));\n}\n\nfunction toCompany(value) {\n switch (value.toLowerCase()) {\n case 'appl': return 'Apple';\n case 'adbe': return 'Adobe';\n case 'msft': return 'Microsoft';\n case 'sunw': return 'Sun Microsystems';\n case 'sgi': return 'Silicon Graphics';\n case 'tgnt': return 'Taligent';\n default: return value;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\nimport {iccTags, iccProfile} from './icc-tag-names.js';\nimport {getStringFromDataView, getUnicodeStringFromDataView, decompress, COMPRESSION_METHOD_NONE, COMPRESSION_METHOD_DEFLATE} from './utils.js';\n\nexport default {\n read\n};\n\nconst PROFILE_HEADER_LENGTH = 84;\nconst ICC_TAG_COUNT_OFFSET = 128;\nconst ICC_SIGNATURE = 'acsp';\nconst TAG_TYPE_DESC = 'desc';\nconst TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE = 'mluc';\nconst TAG_TYPE_TEXT = 'text';\nconst TAG_TYPE_SIGNATURE = 'sig ';\nconst TAG_TABLE_SINGLE_TAG_DATA = 12;\n\n// ICC profile data can be longer than application segment max length of ~64k.\n// so it can be split into multiple APP2 segments. Each segment includes\n// total chunk count and chunk number.\n// Here we read all chunks into single continuous array of bytes.\n// Compressed ICC profile data only has support for a single chunk.\nfunction read(dataView, iccData, async) {\n if (async && iccData[0].compressionMethod !== COMPRESSION_METHOD_NONE) {\n return readCompressedIcc(dataView, iccData);\n }\n\n return readIcc(dataView, iccData);\n}\n\nfunction readCompressedIcc(dataView, iccData) {\n if (!compressionMethodIsSupported(iccData[0].compressionMethod)) {\n return {};\n }\n const compressedDataView = new DataView(dataView.buffer.slice(iccData[0].offset, iccData[0].offset + iccData[0].length));\n return decompress(compressedDataView, iccData[0].compressionMethod, 'dataview')\n .then(parseTags)\n .catch(() => ({}));\n}\n\nfunction compressionMethodIsSupported(compressionMethod) {\n return compressionMethod === COMPRESSION_METHOD_DEFLATE;\n}\n\nfunction readIcc(dataView, iccData) {\n try {\n const totalIccProfileLength = iccData.reduce((sum, icc) => sum + icc.length, 0);\n\n const iccBinaryData = new Uint8Array(totalIccProfileLength);\n let offset = 0;\n const buffer = getBuffer(dataView);\n\n for (let chunkNumber = 1; chunkNumber <= iccData.length; chunkNumber++) {\n const iccDataChunk = iccData.find((x) => x.chunkNumber === chunkNumber);\n if (!iccDataChunk) {\n throw new Error(`ICC chunk ${chunkNumber} not found`);\n }\n\n const data = buffer.slice(iccDataChunk.offset, iccDataChunk.offset + iccDataChunk.length);\n const chunkData = new Uint8Array(data);\n\n iccBinaryData.set(chunkData, offset);\n offset += chunkData.length;\n }\n\n return parseTags(new DataView(iccBinaryData.buffer));\n } catch (error) {\n return {};\n }\n}\n\nfunction getBuffer(dataView) {\n if (Array.isArray(dataView)) {\n return (new DataView(Uint8Array.from(dataView).buffer)).buffer;\n }\n return dataView.buffer;\n}\n\nfunction iccDoesNotHaveTagCount(buffer) {\n return buffer.length < (ICC_TAG_COUNT_OFFSET + 4);\n}\n\nfunction hasTagsData(buffer, tagHeaderOffset) {\n return buffer.length < tagHeaderOffset + TAG_TABLE_SINGLE_TAG_DATA;\n}\n\nexport function parseTags(dataView) {\n const buffer = dataView.buffer;\n\n const length = dataView.getUint32();\n if (dataView.byteLength !== length) {\n throw new Error('ICC profile length not matching');\n }\n\n if (dataView.length < PROFILE_HEADER_LENGTH) {\n throw new Error('ICC profile too short');\n }\n\n const tags = {};\n\n const iccProfileKeys = Object.keys(iccProfile);\n for (let i = 0; i < iccProfileKeys.length; i++) {\n const offset = iccProfileKeys[i];\n const profileEntry = iccProfile[offset];\n const value = profileEntry.value(dataView, parseInt(offset, 10));\n let description = value;\n if (profileEntry.description) {\n description = profileEntry.description(value);\n }\n\n tags[profileEntry.name] = {\n value,\n description\n };\n }\n\n const signature = sliceToString(buffer.slice(36, 40));\n if (signature !== ICC_SIGNATURE) {\n throw new Error('ICC profile: missing signature');\n }\n\n /* ICC data is incomplete but we have header parsed so lets return it */\n if (iccDoesNotHaveTagCount(buffer)) {\n return tags;\n }\n\n const tagCount = dataView.getUint32(128);\n let tagHeaderOffset = 132;\n\n for (let i = 0; i < tagCount; i++) {\n if (hasTagsData(buffer, tagHeaderOffset)) {\n // Tags are corrupted (offset too far), return what we parsed until now\n return tags;\n }\n const tagSignature = getStringFromDataView(dataView, tagHeaderOffset, 4);\n const tagOffset = dataView.getUint32(tagHeaderOffset + 4);\n const tagSize = dataView.getUint32(tagHeaderOffset + 8);\n\n if (tagOffset > buffer.length) {\n // Tag data is invalid, lets return what we managed to parse\n return tags;\n }\n const tagType = getStringFromDataView(dataView, tagOffset, 4);\n\n if (tagType === TAG_TYPE_DESC) {\n const tagValueSize = dataView.getUint32(tagOffset + 8);\n if (tagValueSize > tagSize) {\n // Tag data is invalid, lets return what we managed to parse\n return tags;\n }\n\n const val = sliceToString(buffer.slice(tagOffset + 12, tagOffset + tagValueSize + 11));\n addTag(tags, tagSignature, val);\n } else if (tagType === TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE) {\n const numRecords = dataView.getUint32(tagOffset + 8);\n const recordSize = dataView.getUint32(tagOffset + 12);\n let offset = tagOffset + 16;\n const val = [];\n for (let recordNum = 0; recordNum < numRecords; recordNum++) {\n const languageCode = getStringFromDataView(dataView, offset + 0, 2);\n const countryCode = getStringFromDataView(dataView, offset + 2, 2);\n const textLength = dataView.getUint32(offset + 4);\n const textOffset = dataView.getUint32(offset + 8);\n\n const text = getUnicodeStringFromDataView(dataView, tagOffset + textOffset, textLength);\n val.push({languageCode, countryCode, text});\n offset += recordSize;\n }\n if (numRecords === 1) {\n addTag(tags, tagSignature, val[0].text);\n } else {\n const valObj = {};\n for (let valIndex = 0; valIndex < val.length; valIndex++) {\n valObj[`${val[valIndex].languageCode}-${val[valIndex].countryCode}`] = val[valIndex].text;\n }\n addTag(tags, tagSignature, valObj);\n }\n } else if (tagType === TAG_TYPE_TEXT) {\n const val = sliceToString(buffer.slice(tagOffset + 8, tagOffset + tagSize - 7));\n addTag(tags, tagSignature, val);\n } else if (tagType === TAG_TYPE_SIGNATURE) {\n const val = sliceToString(buffer.slice(tagOffset + 8, tagOffset + 12));\n addTag(tags, tagSignature, val);\n }\n tagHeaderOffset = tagHeaderOffset + 12;\n }\n\n return tags;\n}\n\nfunction sliceToString(slice) {\n return String.fromCharCode.apply(null, new Uint8Array(slice));\n}\n\nfunction addTag(tags, tagSignature, value) {\n if (iccTags[tagSignature]) {\n tags[iccTags[tagSignature].name] = {value, description: value};\n } else {\n tags[tagSignature] = {value, description: value};\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, fileDataOffset) {\n return {\n 'Image Width': getImageWidth(dataView, fileDataOffset),\n 'Image Height': getImageHeight(dataView, fileDataOffset),\n 'Bit Depth': getBitDepth(dataView, fileDataOffset),\n 'Color Type': getColorType(dataView, fileDataOffset),\n 'Compression': getCompression(dataView, fileDataOffset),\n 'Filter': getFilter(dataView, fileDataOffset),\n 'Interlace': getInterlace(dataView, fileDataOffset)\n };\n}\n\nfunction getImageWidth(dataView, fileDataOffset) {\n const OFFSET = 0;\n const SIZE = 4;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, fileDataOffset);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageHeight(dataView, fileDataOffset) {\n const OFFSET = 4;\n const SIZE = 4;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getBitDepth(dataView, fileDataOffset) {\n const OFFSET = 8;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}`\n };\n}\n\nfunction getColorType(dataView, fileDataOffset) {\n const OFFSET = 9;\n const SIZE = 1;\n const COLOR_TYPES = {\n 0: 'Grayscale',\n 2: 'RGB',\n 3: 'Palette',\n 4: 'Grayscale with Alpha',\n 6: 'RGB with Alpha'\n };\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: COLOR_TYPES[value] || 'Unknown'\n };\n}\n\nfunction getCompression(dataView, fileDataOffset) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: value === 0 ? 'Deflate/Inflate' : 'Unknown'\n };\n}\n\nfunction getFilter(dataView, fileDataOffset) {\n const OFFSET = 11;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: value === 0 ? 'Adaptive' : 'Unknown'\n };\n}\n\nfunction getInterlace(dataView, fileDataOffset) {\n const OFFSET = 12;\n const SIZE = 1;\n const INTERLACE_TYPES = {\n 0: 'Noninterlaced',\n 1: 'Adam7 Interlace'\n };\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: INTERLACE_TYPES[value] || 'Unknown'\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// Specification: http://www.libpng.org/pub/png/spec/1.2/\n\nimport {getStringValueFromArray, getStringFromDataView, decompress, COMPRESSION_METHOD_NONE} from './utils.js';\nimport TagDecoder from './tag-decoder.js';\nimport {TYPE_TEXT, TYPE_ITXT, TYPE_ZTXT} from './image-header-png.js';\nimport Tags from './tags.js';\nimport IptcTags from './iptc-tags.js';\nimport Constants from './constants.js';\n\nexport default {\n read\n};\n\nconst STATE_KEYWORD = 'STATE_KEYWORD';\nconst STATE_COMPRESSION = 'STATE_COMPRESSION';\nconst STATE_LANG = 'STATE_LANG';\nconst STATE_TRANSLATED_KEYWORD = 'STATE_TRANSLATED_KEYWORD';\nconst STATE_TEXT = 'STATE_TEXT';\nconst COMPRESSION_SECTION_ITXT_EXTRA_BYTE = 1;\nconst COMPRESSION_FLAG_COMPRESSED = 1;\nconst EXIF_OFFSET = 6;\n\nfunction read(dataView, pngTextChunks, async, includeUnknown) {\n const tags = {};\n const tagsPromises = [];\n for (let i = 0; i < pngTextChunks.length; i++) {\n const {offset, length, type} = pngTextChunks[i];\n const nameAndValue = getNameAndValue(dataView, offset, length, type, async);\n if (nameAndValue instanceof Promise) {\n tagsPromises.push(nameAndValue.then(({name, value, description}) => {\n try {\n if (Constants.USE_EXIF && isExifGroupTag(name, value)) {\n return {\n __exif: Tags.read(decodeRawData(value), EXIF_OFFSET, includeUnknown)\n };\n } else if (Constants.USE_IPTC && isIptcGroupTag(name, value)) {\n return {\n __iptc: IptcTags.read(decodeRawData(value), 0, includeUnknown)\n };\n } else if (name) {\n return {\n [name]: {\n value,\n description\n }\n };\n }\n } catch (error) {\n // Ignore the broken tag.\n }\n return {};\n }));\n } else {\n const {name, value, description} = nameAndValue;\n if (name) {\n tags[name] = {\n value,\n description\n };\n }\n }\n }\n\n return {\n readTags: tags,\n readTagsPromise: tagsPromises.length > 0 ? Promise.all(tagsPromises) : undefined\n };\n}\n\nfunction getNameAndValue(dataView, offset, length, type, async) {\n const keywordChars = [];\n const langChars = [];\n const translatedKeywordChars = [];\n let valueChars;\n let parsingState = STATE_KEYWORD;\n let compressionMethod = COMPRESSION_METHOD_NONE;\n\n for (let i = 0; i < length && offset + i < dataView.byteLength; i++) {\n if (parsingState === STATE_COMPRESSION) {\n compressionMethod = getCompressionMethod({type, dataView, offset: offset + i});\n if (type === TYPE_ITXT) {\n i += COMPRESSION_SECTION_ITXT_EXTRA_BYTE;\n }\n parsingState = moveToNextState(type, parsingState);\n continue;\n } else if (parsingState === STATE_TEXT) {\n valueChars = new DataView(dataView.buffer.slice(offset + i, offset + length));\n break;\n }\n const byte = dataView.getUint8(offset + i);\n if (byte === 0) {\n parsingState = moveToNextState(type, parsingState);\n } else if (parsingState === STATE_KEYWORD) {\n keywordChars.push(byte);\n } else if (parsingState === STATE_LANG) {\n langChars.push(byte);\n } else if (parsingState === STATE_TRANSLATED_KEYWORD) {\n translatedKeywordChars.push(byte);\n }\n }\n\n if (compressionMethod !== COMPRESSION_METHOD_NONE && !async) {\n return {};\n }\n const decompressedValueChars = decompress(valueChars, compressionMethod);\n if (decompressedValueChars instanceof Promise) {\n return decompressedValueChars\n .then((_decompressedValueChars) => constructTag(_decompressedValueChars, type, langChars, keywordChars))\n .catch(() => constructTag('<text using unknown compression>'.split(''), type, langChars, keywordChars));\n }\n return constructTag(decompressedValueChars, type, langChars, keywordChars);\n}\n\nfunction getCompressionMethod({type, dataView, offset}) {\n if (type === TYPE_ITXT) {\n if (dataView.getUint8(offset) === COMPRESSION_FLAG_COMPRESSED) {\n return dataView.getUint8(offset + 1);\n }\n } else if (type === TYPE_ZTXT) {\n return dataView.getUint8(offset);\n }\n return COMPRESSION_METHOD_NONE;\n}\n\nfunction moveToNextState(type, parsingState) {\n if (parsingState === STATE_KEYWORD && [TYPE_ITXT, TYPE_ZTXT].includes(type)) {\n return STATE_COMPRESSION;\n }\n if (parsingState === STATE_COMPRESSION) {\n if (type === TYPE_ITXT) {\n return STATE_LANG;\n }\n return STATE_TEXT;\n }\n if (parsingState === STATE_LANG) {\n return STATE_TRANSLATED_KEYWORD;\n }\n return STATE_TEXT;\n}\n\nfunction constructTag(valueChars, type, langChars, keywordChars) {\n const value = getValue(valueChars);\n return {\n name: getName(type, langChars, keywordChars),\n value,\n description: type === TYPE_ITXT ? getDescription(valueChars) : value\n };\n}\n\nfunction getName(type, langChars, keywordChars) {\n const name = getStringValueFromArray(keywordChars);\n if (type === TYPE_TEXT || langChars.length === 0) {\n return name;\n }\n const lang = getStringValueFromArray(langChars);\n return `${name} (${lang})`;\n}\n\nfunction getValue(valueChars) {\n if (valueChars instanceof DataView) {\n return getStringFromDataView(valueChars, 0, valueChars.byteLength);\n }\n return valueChars;\n}\n\nfunction getDescription(valueChars) {\n return TagDecoder.decode('UTF-8', valueChars);\n}\n\nfunction isExifGroupTag(name, value) {\n return name.toLowerCase() === 'raw profile type exif' && value.substring(1, 5) === 'exif';\n}\n\nfunction isIptcGroupTag(name, value) {\n return name.toLowerCase() === 'raw profile type iptc' && value.substring(1, 5) === 'iptc';\n}\n\nfunction decodeRawData(value) {\n const parts = value.match(/\\n(exif|iptc)\\n\\s*\\d+\\n([\\s\\S]*)$/);\n return hexToDataView(parts[2].replace(/\\n/g, ''));\n}\n\nfunction hexToDataView(hex) {\n const dataView = new DataView(new ArrayBuffer(hex.length / 2));\n for (let i = 0; i < hex.length; i += 2) {\n dataView.setUint8(i / 2, parseInt(hex.substring(i, i + 2), 16));\n }\n return dataView;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\nimport {PNG_CHUNK_LENGTH_OFFSET, PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_DATA_OFFSET, PNG_CHUNK_TYPE_SIZE, TYPE_PHYS, TYPE_TIME} from './image-header-png.js';\nimport {getStringFromDataView} from './utils.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, chunkOffsets) {\n const tags = {};\n\n for (let i = 0; i < chunkOffsets.length; i++) {\n const chunkLength = Types.getLongAt(dataView, chunkOffsets[i] + PNG_CHUNK_LENGTH_OFFSET);\n const chunkType = getStringFromDataView(dataView, chunkOffsets[i] + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE);\n\n if (chunkType === TYPE_PHYS) {\n tags['Pixels Per Unit X'] = getPixelsPerUnitX(dataView, chunkOffsets[i], chunkLength);\n tags['Pixels Per Unit Y'] = getPixelsPerUnitY(dataView, chunkOffsets[i], chunkLength);\n tags['Pixel Units'] = getPixelUnits(dataView, chunkOffsets[i], chunkLength);\n } else if (chunkType === TYPE_TIME) {\n tags['Modify Date'] = getModifyDate(dataView, chunkOffsets[i], chunkLength);\n }\n }\n\n return tags;\n}\n\nfunction getPixelsPerUnitX(dataView, chunkOffset, chunkLength) {\n const TAG_OFFSET = 0;\n const TAG_SIZE = 4;\n\n if (!tagFitsInBuffer(dataView, chunkOffset, chunkLength, TAG_OFFSET, TAG_SIZE)) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + TAG_OFFSET);\n\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getPixelsPerUnitY(dataView, chunkOffset, chunkLength) {\n const TAG_OFFSET = 4;\n const TAG_SIZE = 4;\n\n if (!tagFitsInBuffer(dataView, chunkOffset, chunkLength, TAG_OFFSET, TAG_SIZE)) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + TAG_OFFSET);\n\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getPixelUnits(dataView, chunkOffset, chunkLength) {\n const TAG_OFFSET = 8;\n const TAG_SIZE = 1;\n\n if (!tagFitsInBuffer(dataView, chunkOffset, chunkLength, TAG_OFFSET, TAG_SIZE)) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + TAG_OFFSET);\n\n return {\n value,\n description: value === 1 ? 'meters' : 'Unknown'\n };\n}\n\nfunction getModifyDate(dataView, chunkOffset, chunkLength) {\n const TIME_TAG_SIZE = 7;\n\n if (!tagFitsInBuffer(dataView, chunkOffset, chunkLength, 0, TIME_TAG_SIZE)) {\n return undefined;\n }\n\n const year = Types.getShortAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET);\n const month = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 2);\n const day = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 3);\n const hours = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 4);\n const minutes = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 5);\n const seconds = Types.getByteAt(dataView, chunkOffset + PNG_CHUNK_DATA_OFFSET + 6);\n\n return {\n value: [year, month, day, hours, minutes, seconds],\n description: `${pad(year, 4)}-${pad(month, 2)}-${pad(day, 2)} ${pad(hours, 2)}:${pad(minutes, 2)}:${pad(seconds, 2)}`\n };\n}\n\nfunction tagFitsInBuffer(dataView, chunkOffset, chunkLength, tagOffset, tagSize) {\n return tagOffset + tagSize <= chunkLength && chunkOffset + PNG_CHUNK_DATA_OFFSET + tagOffset + tagSize <= dataView.byteLength;\n}\n\nfunction pad(number, size) {\n return `${'0'.repeat(size - ('' + number).length)}${number}`;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nconst IMAGE_WIDTH_OFFSET = 4;\nconst IMAGE_HEIGHT_OFFSET = 7;\n\n// https://developers.google.com/speed/webp/docs/riff_container#extended_file_format\nfunction read(dataView, chunkOffset) {\n const tags = {};\n\n const flags = Types.getByteAt(dataView, chunkOffset);\n\n tags['Alpha'] = getAlpha(flags);\n tags['Animation'] = getAnimation(flags);\n tags['ImageWidth'] = getThreeByteValue(dataView, chunkOffset + IMAGE_WIDTH_OFFSET);\n tags['ImageHeight'] = getThreeByteValue(dataView, chunkOffset + IMAGE_HEIGHT_OFFSET);\n\n return tags;\n}\n\nfunction getAlpha(flags) {\n const value = flags & 0x10;\n return {\n value: value ? 1 : 0,\n description: value ? 'Yes' : 'No'\n };\n}\n\nfunction getAnimation(flags) {\n const value = flags & 0x02;\n return {\n value: value ? 1 : 0,\n description: value ? 'Yes' : 'No'\n };\n}\n\nfunction getThreeByteValue(dataView, offset) {\n // Values are stored little-endian.\n const value = Types.getByteAt(dataView, offset)\n + 256 * Types.getByteAt(dataView, offset + 1)\n + 256 * 256 * Types.getByteAt(dataView, offset + 2)\n + 1; // Value is 1-based, i.e. a value of 7 means 8px.\n\n return {\n value,\n description: value + 'px'\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n// https://www.w3.org/Graphics/GIF/spec-gif87.txt\n// https://www.w3.org/Graphics/GIF/spec-gif89a.txt\n\nimport {getStringFromDataView} from './utils.js';\n\nexport default {\n read\n};\n\nfunction read(dataView) {\n return {\n 'GIF Version': getGifVersion(dataView),\n 'Image Width': getImageWidth(dataView),\n 'Image Height': getImageHeight(dataView),\n 'Global Color Map': getGlobalColorMap(dataView),\n 'Bits Per Pixel': getBitDepth(dataView),\n 'Color Resolution Depth': getColorResolution(dataView)\n };\n}\n\nfunction getGifVersion(dataView) {\n const OFFSET = 3;\n const SIZE = 3;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = getStringFromDataView(dataView, OFFSET, SIZE);\n return {\n value,\n description: value\n };\n}\n\nfunction getImageWidth(dataView) {\n const OFFSET = 6;\n const SIZE = 2;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = dataView.getUint16(OFFSET, true);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageHeight(dataView) {\n const OFFSET = 8;\n const SIZE = 2;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = dataView.getUint16(OFFSET, true);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getGlobalColorMap(dataView) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const byteValue = dataView.getUint8(OFFSET);\n const value = (byteValue & 0b10000000) >>> 7;\n return {\n value,\n description: value === 1 ? 'Yes' : 'No'\n };\n}\n\nfunction getColorResolution(dataView) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const byteValue = dataView.getUint8(OFFSET);\n const value = ((byteValue & 0b01110000) >>> 4) + 1; // Zero-based.\n return {\n value,\n description: `${value} ${value === 1 ? 'bit' : 'bits'}`\n };\n}\n\nfunction getBitDepth(dataView) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const byteValue = dataView.getUint8(OFFSET);\n const value = (byteValue & 0b00000111) + 1; // Zero-based.\n return {\n value,\n description: `${value} ${value === 1 ? 'bit' : 'bits'}`\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {deferInit, getBase64Image} from './utils.js';\n\n// https://exiftool.org/TagNames/EXIF.html#Compression\nconst COMPRESSION_JPEG = [6, 7, 99];\n\nexport default {\n get,\n};\n\nfunction get(dataView, thumbnailTags, tiffHeaderOffset) {\n if (hasJpegThumbnail(thumbnailTags)) {\n thumbnailTags.type = 'image/jpeg';\n const offset = tiffHeaderOffset + thumbnailTags.JPEGInterchangeFormat.value;\n thumbnailTags.image = dataView.buffer.slice(offset, offset + thumbnailTags.JPEGInterchangeFormatLength.value);\n deferInit(thumbnailTags, 'base64', function () {\n return getBase64Image(this.image);\n });\n }\n\n // There is a small possibility of thumbnails in TIFF format but they are\n // not stored as a self-contained image file and would be much more\n // difficult to extract.\n // https://exiftool.org/forum/index.php?topic=3273.msg14778#msg14778\n\n return thumbnailTags;\n}\n\nfunction hasJpegThumbnail(tags) {\n return tags && ((tags.Compression === undefined) || (COMPRESSION_JPEG.includes(tags.Compression.value)))\n && tags.JPEGInterchangeFormat && tags.JPEGInterchangeFormat.value\n && tags.JPEGInterchangeFormatLength && tags.JPEGInterchangeFormatLength.value;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n/**\n * Thrown when no Exif metadata was found for the given image.\n *\n * @param {string} message The error message.\n */\nfunction MetadataMissingError(message) {\n this.name = 'MetadataMissingError';\n this.message = message || 'No Exif data';\n this.stack = (new Error()).stack;\n}\n\nMetadataMissingError.prototype = new Error;\n\nexport default {\n MetadataMissingError,\n};\n","/**\n * ExifReader\n * http://github.com/mattiasw/exifreader\n * Copyright (C) 2011-2023 Mattias Wallander <mattias@wallander.eu>\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n/* global Buffer, __non_webpack_require__ */\n\nimport {objectAssign, dataUriToBuffer} from './utils.js';\nimport DataViewWrapper from './dataview.js';\nimport Constants from './constants.js';\nimport {getStringValueFromArray} from './utils.js';\nimport {getCalculatedGpsValue} from './tag-names-utils.js';\nimport ImageHeader from './image-header.js';\nimport Tags from './tags.js';\nimport MpfTags from './mpf-tags.js';\nimport FileTags from './file-tags.js';\nimport JfifTags from './jfif-tags.js';\nimport IptcTags from './iptc-tags.js';\nimport XmpTags from './xmp-tags.js';\nimport PhotoshopTags from './photoshop-tags.js';\nimport IccTags from './icc-tags.js';\nimport PngFileTags from './png-file-tags.js';\nimport PngTextTags from './png-text-tags.js';\nimport PngTags from './png-tags.js';\nimport Vp8xTags from './vp8x-tags.js';\nimport GifFileTags from './gif-file-tags.js';\nimport Thumbnail from './thumbnail.js';\nimport exifErrors from './errors.js';\n\nexport default {\n load,\n loadView,\n errors: exifErrors,\n};\n\nexport const errors = exifErrors;\n\nexport function load(data, options = {}) {\n if (isFilePathOrURL(data)) {\n options.async = true;\n return loadFile(data, options).then((fileContents) => loadFromData(fileContents, options));\n }\n if (isBrowserFileObject(data)) {\n options.async = true;\n return loadFileObject(data).then((fileContents) => loadFromData(fileContents, options));\n }\n return loadFromData(data, options);\n}\n\nfunction isFilePathOrURL(data) {\n return typeof data === 'string';\n}\n\nfunction loadFile(filename, options) {\n if (/^\\w+:\\/\\//.test(filename)) {\n if (typeof fetch !== 'undefined') {\n return fetchRemoteFile(filename, options);\n }\n\n return nodeGetRemoteFile(filename, options);\n }\n\n if (isDataUri(filename)) {\n return Promise.resolve(dataUriToBuffer(filename));\n }\n\n return loadLocalFile(filename, options);\n}\n\nfunction fetchRemoteFile(url, {length} = {}) {\n const options = {method: 'GET'};\n if (Number.isInteger(length) && length >= 0) {\n options.headers = {\n range: `bytes=0-${length - 1}`,\n };\n }\n return fetch(url, options).then((response) => response.arrayBuffer());\n}\n\nfunction nodeGetRemoteFile(url, {length} = {}) {\n return new Promise((resolve, reject) => {\n const options = {};\n if (Number.isInteger(length) && length >= 0) {\n options.headers = {\n range: `bytes=0-${length - 1}`,\n };\n }\n\n const get = requireNodeGet(url);\n get(url, options, (response) => {\n if ((response.statusCode >= 200) && (response.statusCode <= 299)) {\n const data = [];\n response.on('data', (chunk) => data.push(Buffer.from(chunk)));\n response.on('error', (error) => reject(error));\n response.on('end', () => resolve(Buffer.concat(data)));\n } else {\n reject(`Could not fetch file: ${response.statusCode} ${response.statusMessage}`);\n response.resume();\n }\n }).on('error', (error) => reject(error));\n });\n}\n\nfunction requireNodeGet(url) {\n if (/^https:\\/\\//.test(url)) {\n return __non_webpack_require__('https').get;\n }\n return __non_webpack_require__('http').get;\n}\n\nfunction isDataUri(filename) {\n return /^data:[^;,]*(;base64)?,/.test(filename);\n}\n\nfunction loadLocalFile(filename, {length} = {}) {\n return new Promise((resolve, reject) => {\n const fs = requireNodeFs();\n fs.open(filename, (error, fd) => {\n if (error) {\n reject(error);\n } else {\n fs.stat(filename, (error, stat) => {\n if (error) {\n reject(error);\n } else {\n const size = Math.min(stat.size, length !== undefined ? length : stat.size);\n const buffer = Buffer.alloc(size);\n const options = {\n buffer,\n length: size\n };\n fs.read(fd, options, (error) => {\n if (error) {\n reject(error);\n } else {\n fs.close(fd, (error) => {\n if (error) {\n console.warn(`Could not close file ${filename}:`, error); // eslint-disable-line no-console\n }\n resolve(buffer);\n });\n }\n });\n }\n });\n }\n });\n });\n}\n\nfunction requireNodeFs() {\n try {\n return __non_webpack_require__('fs');\n } catch (error) {\n return undefined;\n }\n}\n\nfunction isBrowserFileObject(data) {\n return (typeof window !== 'undefined') && (typeof File !== 'undefined') && (data instanceof File);\n}\n\nfunction loadFileObject(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (readerEvent) => resolve(readerEvent.target.result);\n reader.onerror = () => reject(reader.error);\n reader.readAsArrayBuffer(file);\n });\n}\n\nfunction loadFromData(data, options) {\n if (isNodeBuffer(data)) {\n // File data read in Node can share the underlying buffer with other\n // data. Therefore it's safest to get a new one to avoid weird bugs.\n data = (new Uint8Array(data)).buffer;\n }\n return loadView(getDataView(data), options);\n}\n\nfunction isNodeBuffer(data) {\n try {\n return Buffer.isBuffer(data);\n } catch (error) {\n return false;\n }\n}\n\nfunction getDataView(data) {\n try {\n return new DataView(data);\n } catch (error) {\n return new DataViewWrapper(data);\n }\n}\n\nexport function loadView(\n dataView,\n {expanded = false, async = false, includeUnknown = false} = {expanded: false, async: false, includeUnknown: false}\n) {\n let foundMetaData = false;\n let tags = {};\n const tagsPromises = [];\n\n const {\n fileType,\n fileDataOffset,\n jfifDataOffset,\n tiffHeaderOffset,\n iptcDataOffset,\n xmpChunks,\n iccChunks,\n mpfDataOffset,\n pngHeaderOffset,\n pngTextChunks,\n pngChunkOffsets,\n vp8xChunkOffset,\n gifHeaderOffset\n } = ImageHeader.parseAppMarkers(dataView, async);\n\n if (Constants.USE_JPEG && Constants.USE_FILE && hasFileData(fileDataOffset)) {\n foundMetaData = true;\n const readTags = FileTags.read(dataView, fileDataOffset);\n if (expanded) {\n tags.file = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_JPEG && Constants.USE_JFIF && hasJfifData(jfifDataOffset)) {\n foundMetaData = true;\n const readTags = JfifTags.read(dataView, jfifDataOffset);\n if (expanded) {\n tags.jfif = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_EXIF && hasExifData(tiffHeaderOffset)) {\n foundMetaData = true;\n const readTags = Tags.read(dataView, tiffHeaderOffset, includeUnknown);\n if (readTags.Thumbnail) {\n tags.Thumbnail = readTags.Thumbnail;\n delete readTags.Thumbnail;\n }\n\n if (expanded) {\n tags.exif = readTags;\n addGpsGroup(tags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n\n if (Constants.USE_TIFF && Constants.USE_IPTC && readTags['IPTC-NAA'] && !hasIptcData(iptcDataOffset)) {\n const readIptcTags = IptcTags.read(readTags['IPTC-NAA'].value, 0, includeUnknown);\n if (expanded) {\n tags.iptc = readIptcTags;\n } else {\n tags = objectAssign({}, tags, readIptcTags);\n }\n }\n\n if (Constants.USE_TIFF && Constants.USE_XMP && readTags['ApplicationNotes'] && !hasXmpData(xmpChunks)) {\n const readXmpTags = XmpTags.read(getStringValueFromArray(readTags['ApplicationNotes'].value));\n if (expanded) {\n tags.xmp = readXmpTags;\n } else {\n delete readXmpTags._raw;\n tags = objectAssign({}, tags, readXmpTags);\n }\n }\n\n if (Constants.USE_PHOTOSHOP && readTags['ImageSourceData']) {\n const readPhotoshopTags = PhotoshopTags.read(readTags['PhotoshopSettings'].value, includeUnknown);\n if (expanded) {\n tags.photoshop = readPhotoshopTags;\n } else {\n tags = objectAssign({}, tags, readPhotoshopTags);\n }\n }\n\n if (Constants.USE_TIFF && Constants.USE_ICC && readTags['ICC_Profile'] && !hasIccData(iccChunks)) {\n const readIccTags = IccTags.read(\n readTags['ICC_Profile'].value,\n [{\n offset: 0,\n length: readTags['ICC_Profile'].value.length,\n chunkNumber: 1,\n chunksTotal: 1\n }]\n );\n if (expanded) {\n tags.icc = readIccTags;\n } else {\n tags = objectAssign({}, tags, readIccTags);\n }\n }\n }\n\n if (Constants.USE_JPEG && Constants.USE_IPTC && hasIptcData(iptcDataOffset)) {\n foundMetaData = true;\n const readTags = IptcTags.read(dataView, iptcDataOffset, includeUnknown);\n if (expanded) {\n tags.iptc = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_XMP && hasXmpData(xmpChunks)) {\n foundMetaData = true;\n const readTags = XmpTags.read(dataView, xmpChunks);\n if (expanded) {\n tags.xmp = readTags;\n } else {\n delete readTags._raw;\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if ((Constants.USE_JPEG || Constants.USE_WEBP) && Constants.USE_ICC && hasIccData(iccChunks)) {\n foundMetaData = true;\n const readTags = IccTags.read(dataView, iccChunks, async);\n if (readTags instanceof Promise) {\n tagsPromises.push(readTags.then(addIccTags));\n } else {\n addIccTags(readTags);\n }\n }\n\n if (Constants.USE_MPF && hasMpfData(mpfDataOffset)) {\n foundMetaData = true;\n const readMpfTags = MpfTags.read(dataView, mpfDataOffset, includeUnknown);\n if (expanded) {\n tags.mpf = readMpfTags;\n } else {\n tags = objectAssign({}, tags, readMpfTags);\n }\n }\n\n if (Constants.USE_PNG && Constants.USE_PNG_FILE && hasPngFileData(pngHeaderOffset)) {\n foundMetaData = true;\n const readTags = PngFileTags.read(dataView, pngHeaderOffset);\n if (expanded) {\n tags.png = !tags.png ? readTags : objectAssign({}, tags.png, readTags);\n tags.pngFile = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_PNG && hasPngTextData(pngTextChunks)) {\n foundMetaData = true;\n const {readTags, readTagsPromise} = PngTextTags.read(dataView, pngTextChunks, async, includeUnknown);\n addPngTextTags(readTags);\n if (readTagsPromise) {\n tagsPromises.push(readTagsPromise.then((tagList) => tagList.forEach(addPngTextTags)));\n }\n }\n\n if (Constants.USE_PNG && hasPngData(pngChunkOffsets)) {\n foundMetaData = true;\n const readTags = PngTags.read(dataView, pngChunkOffsets);\n if (expanded) {\n tags.png = !tags.png ? readTags : objectAssign({}, tags.png, readTags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_WEBP && hasVp8xData(vp8xChunkOffset)) {\n foundMetaData = true;\n const readTags = Vp8xTags.read(dataView, vp8xChunkOffset);\n if (expanded) {\n tags.riff = !tags.riff ? readTags : objectAssign({}, tags.riff, readTags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_GIF && hasGifFileData(gifHeaderOffset)) {\n foundMetaData = true;\n const readTags = GifFileTags.read(dataView, gifHeaderOffset);\n if (expanded) {\n tags.gif = !tags.gif ? readTags : objectAssign({}, tags.gif, readTags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n const thumbnail = (Constants.USE_JPEG || Constants.USE_WEBP)\n && Constants.USE_EXIF\n && Constants.USE_THUMBNAIL\n && Thumbnail.get(dataView, tags.Thumbnail, tiffHeaderOffset);\n if (thumbnail) {\n foundMetaData = true;\n tags.Thumbnail = thumbnail;\n } else {\n delete tags.Thumbnail;\n }\n\n if (fileType) {\n if (expanded) {\n if (!tags.file) {\n tags.file = {};\n }\n tags.file.FileType = fileType;\n } else {\n tags.FileType = fileType;\n }\n foundMetaData = true;\n }\n\n if (!foundMetaData) {\n throw new exifErrors.MetadataMissingError();\n }\n\n if (async) {\n return Promise.all(tagsPromises).then(() => tags);\n }\n return tags;\n\n function addIccTags(readTags) {\n if (expanded) {\n tags.icc = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n function addPngTextTags(readTags) {\n if (expanded) {\n for (const group of ['exif', 'iptc']) {\n const groupKey = `__${group}`;\n if (readTags[groupKey]) {\n tags[group] = !tags[group] ? readTags[groupKey] : objectAssign({}, tags.exif, readTags[groupKey]);\n delete readTags[groupKey];\n }\n }\n tags.png = !tags.png ? readTags : objectAssign({}, tags.png, readTags);\n tags.pngText = !tags.pngText ? readTags : objectAssign({}, tags.png, readTags);\n } else {\n tags = objectAssign(\n {},\n tags,\n readTags.__exif ? readTags.__exif : {},\n readTags.__iptc ? readTags.__iptc : {},\n readTags\n );\n }\n }\n}\n\nfunction hasFileData(fileDataOffset) {\n return fileDataOffset !== undefined;\n}\n\nfunction hasJfifData(jfifDataOffset) {\n return jfifDataOffset !== undefined;\n}\n\nfunction hasExifData(tiffHeaderOffset) {\n return tiffHeaderOffset !== undefined;\n}\n\nfunction addGpsGroup(tags) {\n if (tags.exif) {\n if (tags.exif.GPSLatitude && tags.exif.GPSLatitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Latitude = getCalculatedGpsValue(tags.exif.GPSLatitude.value);\n if (tags.exif.GPSLatitudeRef.value.join('') === 'S') {\n tags.gps.Latitude = -tags.gps.Latitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n\n if (tags.exif.GPSLongitude && tags.exif.GPSLongitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Longitude = getCalculatedGpsValue(tags.exif.GPSLongitude.value);\n if (tags.exif.GPSLongitudeRef.value.join('') === 'W') {\n tags.gps.Longitude = -tags.gps.Longitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n\n if (tags.exif.GPSAltitude && tags.exif.GPSAltitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Altitude = tags.exif.GPSAltitude.value[0] / tags.exif.GPSAltitude.value[1];\n if (tags.exif.GPSAltitudeRef.value === 1) {\n tags.gps.Altitude = -tags.gps.Altitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n }\n}\n\nfunction hasIptcData(iptcDataOffset) {\n return iptcDataOffset !== undefined;\n}\n\nfunction hasXmpData(xmpChunks) {\n return Array.isArray(xmpChunks) && xmpChunks.length > 0;\n}\n\nfunction hasIccData(iccDataOffsets) {\n return Array.isArray(iccDataOffsets) && iccDataOffsets.length > 0;\n}\n\nfunction hasMpfData(mpfDataOffset) {\n return mpfDataOffset !== undefined;\n}\n\nfunction hasPngFileData(pngFileDataOffset) {\n return pngFileDataOffset !== undefined;\n}\n\nfunction hasPngTextData(pngTextChunks) {\n return pngTextChunks !== undefined;\n}\n\nfunction hasPngData(pngChunkOffsets) {\n return pngChunkOffsets !== undefined;\n}\n\nfunction hasVp8xData(vp8xChunkOffset) {\n return vp8xChunkOffset !== undefined;\n}\n\nfunction hasGifFileData(gifHeaderOffset) {\n return gifHeaderOffset !== undefined;\n}\n","import { watch } from \"vue\";\n\nexport class FlashMessages {\n static notify;\n\n static PROP_DEFINITIONS = {\n successMsg: {\n type: String,\n default: \"\"\n },\n errorMsg: {\n type: String,\n default: \"\"\n },\n warningMsg: {\n type: String,\n default: \"\"\n }\n };\n\n static enable(msgProps) {\n FlashMessages.success(msgProps.successMsg);\n FlashMessages.error(msgProps.errorMsg);\n FlashMessages.warning(msgProps.warningMsg);\n watch(() => msgProps.successMsg, FlashMessages.success);\n watch(() => msgProps.errorMsg, FlashMessages.error);\n watch(() => msgProps.warningMsg, FlashMessages.warning);\n }\n\n static send(message, options = {}) {\n if (message) {\n FlashMessages.notify({\n message,\n timeout: 10000,\n color: \"gray-base\",\n textColor: \"white\",\n position: \"top\",\n closeBtn: \"X\",\n ...options\n });\n }\n }\n\n static success(message, options = {}) {\n FlashMessages.send(message, {\n color: \"green-light\",\n textColor: \"green-dark\",\n icon: \"hero:check-circle\",\n ...options\n });\n }\n\n static error(message, options = {}) {\n FlashMessages.send(message, {\n color: \"red-light\",\n textColor: \"red-dark\",\n icon: \"hero:alert\",\n ...options\n });\n }\n\n static warning(message, options = {}) {\n FlashMessages.send(message, {\n color: \"yellow-lighter\",\n textColor: \"yellow-base\",\n icon: \"hero:alert\",\n ...options\n });\n }\n\n static combine(type, messages, options = {}) {\n FlashMessages[type](messages.map(m => typeof m === \"string\" ? m : (m.message || m.Message)).join(\"<br/>\"), {\n ...options,\n html: true\n });\n }\n}\n\nexport const notify = new FlashMessages();\n","import ExifReader from \"exifreader\";\nimport { useCompatibility } from \"./compatibility\";\nimport { FlashMessages } from \"./FlashMessages\";\n\nexport async function resolveFileLocation(file, waitMessage = null) {\n if (file.location) {\n return file.location;\n }\n\n try {\n const tags = await ExifReader.load(file.blobUrl || file.url, {\n expanded: true\n });\n if (tags.gps) {\n return {\n latitude: tags.gps.Latitude,\n longitude: tags.gps.Longitude\n };\n }\n\n const { waitForLocation, location } = useCompatibility();\n\n // Show a waiting for location message if we have not returned within 1 second\n if (waitMessage) {\n setTimeout(() => {\n if (!location.value && waitMessage) {\n FlashMessages.warning(waitMessage);\n }\n }, 1000);\n }\n\n // Wait for the browser to return the location (https only as http will not return a location)\n if (window.location.protocol === \"https:\") {\n await waitForLocation();\n }\n // Ignore the wait message if we already returned\n waitMessage = false;\n if (!location.value) {\n return null;\n }\n\n return {\n latitude: location.value.latitude,\n longitude: location.value.longitude,\n accuracy: location.value.accuracy,\n altitude: location.value.altitude,\n altitudeAccuracy: location.value.altitudeAccuracy\n };\n } catch (error) {\n console.error(error);\n return null;\n }\n}\n","import { uid } from \"quasar\";\nimport { danxOptions } from \"../config\";\nimport { resolveFileLocation } from \"./files\";\nimport { FlashMessages } from \"./FlashMessages\";\n\nexport type FileUploadOptions = {\n directory?: string,\n presignedUploadUrl?: (...params: any) => \"\",\n uploadCompletedUrl?: (...params: any) => \"\",\n};\n\nexport type UploadedFile = {\n id: string,\n name: string,\n size: number,\n type: string,\n progress: number,\n location: string,\n blobUrl: string\n}\n\nexport class FileUpload {\n files: UploadedFile[] = [];\n fileUploads = [];\n onErrorCb = null;\n onProgressCb = null;\n onCompleteCb = null;\n onAllCompleteCb = null;\n options: FileUploadOptions = {};\n\n constructor(files: UploadedFile[] | UploadedFile, options: FileUploadOptions = {}) {\n if (!Array.isArray(files) && !(files instanceof FileList)) {\n files = [files];\n }\n this.files = files;\n this.fileUploads = [];\n this.onErrorCb = null;\n this.onProgressCb = null;\n this.onCompleteCb = null;\n this.onAllCompleteCb = null;\n\n this.options = {\n ...danxOptions.fileUpload,\n ...options\n };\n\n if (!this.options.presignedUploadUrl) {\n throw new Error(\"Please configure the danxOptions: import { configure } from 'quasar-ui-danx';\");\n }\n this.prepare();\n }\n\n /**\n * Prepares all files for upload and provides an id and blobUrl for each file\n */\n prepare() {\n // Prepare required attributes\n for (const file of this.files) {\n if (!(file instanceof File)) {\n throw Error(\n \"FileUpload constructor requires a File object or a list of File objects\"\n );\n }\n\n file.id = uid();\n file.blobUrl = URL.createObjectURL(file);\n\n // Prepare FormData\n const formData = new FormData();\n formData.append(\"file\", file);\n\n this.fileUploads.push({\n file,\n xhr: null, // NOTE: The XHR will be setup asynchronously right before sending file uploads\n formData,\n isComplete: false\n });\n }\n }\n\n /**\n * Callback for when all files have been uploaded\n */\n onAllComplete(cb) {\n this.onAllCompleteCb = cb;\n return this;\n }\n\n /**\n * Callback fired once for each file upon successful completion of upload\n * @param cb\n * @returns {FileUpload}\n */\n onComplete(cb) {\n this.onCompleteCb = cb;\n return this;\n }\n\n /**\n * Callback fired each time there is an upload progress update for a file\n * @param cb\n * @returns {FileUpload}\n */\n onProgress(cb) {\n this.onProgressCb = cb;\n return this;\n }\n\n /**\n * Callback fired when an error occurs during upload\n * @param cb\n * @returns {FileUpload}\n */\n onError(cb) {\n this.onErrorCb = cb;\n return this;\n }\n\n /**\n * Handles the error events / fires the callback if it is set\n * @param e\n * @param file\n * @param error\n */\n errorHandler(e, file, error = null) {\n if (this.onErrorCb) {\n this.onErrorCb({ e, file, error });\n }\n }\n\n /**\n * Resolve the locations of all the files\n * @returns {Promise<FileUpload>}\n */\n async resolveLocation(waitMessage = null) {\n for (const fileUpload of this.fileUploads) {\n fileUpload.file.location = await resolveFileLocation(\n fileUpload.file,\n waitMessage\n );\n fileUpload.formData.append(\n \"meta\",\n JSON.stringify(fileUpload.file.location)\n );\n }\n return this;\n }\n\n /**\n * Fires the progress callback\n * @param fileUpload\n * @param progress\n */\n fireProgressCallback(fileUpload, progress) {\n fileUpload.file.progress = progress;\n this.onProgressCb && this.onProgressCb({ file: this.wrapFile(fileUpload.file), progress });\n }\n\n /**\n * Fires the complete callback\n * @param fileUpload\n * @param uploadedFile\n */\n fireCompleteCallback(fileUpload, uploadedFile) {\n fileUpload.isComplete = true;\n fileUpload.file.progress = 1;\n this.onCompleteCb && this.onCompleteCb({ file: this.wrapFile(fileUpload.file), uploadedFile });\n }\n\n /**\n * Check if all files have been uploaded and call the callback if they have\n */\n checkAllComplete() {\n if (this.onAllCompleteCb) {\n if (this.fileUploads.every((fileUpload) => fileUpload.isComplete)) {\n this.onAllCompleteCb({ files: this.fileUploads });\n }\n }\n }\n\n /**\n * Returns a native JS object that is easier to work with than the File objects (no weird behavior of missing\n * properties, easily printable, etc.)\n * @param file\n * @returns {{size, name, progress, location, blobUrl: *, id, type}}\n */\n wrapFile(file) {\n return {\n id: file.id,\n name: file.name,\n size: file.size,\n type: file.type,\n progress: file.progress,\n location: file.location,\n blobUrl: file.blobUrl\n };\n }\n\n /**\n * Registers all the callbacks requested for the XHR / post-processing of file uploads\n */\n setXhrCallbacks() {\n // Set the error callbacks\n for (const fileUpload of this.fileUploads) {\n fileUpload.xhr.addEventListener(\n \"error\",\n (e) => this.errorHandler(e, fileUpload.file),\n false\n );\n }\n\n // Set the progress callbacks\n if (this.onProgressCb) {\n for (const fileUpload of this.fileUploads) {\n fileUpload.xhr.upload.addEventListener(\n \"progress\",\n (e) => {\n // Max of 95%, so we can indicate we are completing the signed URL process\n const progress = Math.min(.95, e.loaded / e.total);\n this.fireProgressCallback(fileUpload, progress);\n },\n false\n );\n }\n }\n\n // Set the load callbacks which registers the Complete / All Complete callbacks and handles non-xhr related\n // errors\n for (const fileUpload of this.fileUploads) {\n fileUpload.xhr.addEventListener(\n \"load\",\n async (e) => {\n try {\n // First complete the presigned upload to get the updated file resource data\n const uploadedFile = await this.completePresignedUpload(fileUpload);\n\n // Fire the file complete callbacks\n this.fireCompleteCallback(fileUpload, uploadedFile);\n this.checkAllComplete();\n } catch (error) {\n this.errorHandler(e, fileUpload.file, error);\n }\n },\n false\n );\n }\n }\n\n /**\n * Mark the presigned upload as completed and return the file resource from the platform server\n * @param fileUpload\n * @returns {Promise<void>}\n */\n async completePresignedUpload(fileUpload) {\n // Show 95% as the last 5% will be to complete the presigned upload\n this.fireProgressCallback(fileUpload, .95);\n\n // Let the platform know the presigned upload is complete\n return await fetch(this.options.uploadCompletedUrl(fileUpload.file.resource_id), { method: \"POST\" }).then(r => r.json());\n }\n\n /**\n * Start uploading all files\n */\n async upload() {\n for (const fileUpload of this.fileUploads) {\n const mimeType = fileUpload.file.mimeType || fileUpload.file.type;\n const presignedUrl = this.options.presignedUploadUrl(this.options.directory, fileUpload.file.name, mimeType);\n\n // Fetch presigned upload URL\n const fileResource = await fetch(presignedUrl).then(r => r.json());\n\n if (!fileResource.url) {\n FlashMessages.error(\"Could not fetch presigned upload URL for file \" + fileUpload.file.name);\n continue;\n }\n\n const isS3Upload = !fileResource.url.match(\"upload-presigned-url-contents\");\n\n // We need the file resource ID to complete the presigned upload\n fileUpload.file.resource_id = fileResource.id;\n\n // Prepare XHR request\n const xhr = new XMLHttpRequest();\n\n // The XHR request is different based on weather we're sending to S3 or the platform server\n if (isS3Upload) {\n xhr.open(\"PUT\", fileResource.url);\n xhr.setRequestHeader(\"Content-Type\", mimeType);\n fileUpload.body = fileUpload.file;\n } else {\n xhr.open(\"POST\", fileResource.url);\n fileUpload.body = fileUpload.formData;\n }\n\n fileUpload.xhr = xhr;\n }\n\n // Set all the callbacks on the XHR requests\n this.setXhrCallbacks();\n\n // Send all the XHR file uploads\n for (const fileUpload of this.fileUploads) {\n fileUpload.xhr.send(fileUpload.body);\n }\n }\n}\n","export const request = {\n async get(url, options = {}) {\n return fetch(url, {\n method: \"get\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n ...options\n }).then((r) => r.json());\n },\n\n async post(url, data = {}, options = {}) {\n return fetch(url, {\n method: \"post\",\n body: JSON.stringify(data),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n ...options\n }).then((r) => r.json());\n }\n};\n\n/**\n * Fetches a resource list applying the filter. If there is a selected resource,\n * stores that resource from the already populated list. If that resource does not exist\n * also fetches that resource record from the endpoint, then adds it to the list if it\n * does not exist in the filtered list\n *\n * @param fetchFn\n * @param list\n * @param id\n * @param filter\n * @returns {Promise<void>}\n */\nexport async function fetchResourceListWithSelected(fetchFn, list, id, filter) {\n // First make sure we have the selected record, so we can always add it to the list\n let selectedResource;\n if (id) {\n selectedResource = list.value.find((c) => c.id === id) || (await fetchFn({ id }))[0];\n }\n\n // Get the filtered campaign list\n list.value = await fetchFn(filter);\n\n // If our selected campaign is not in the filtered list, add it\n if (selectedResource && !list.value.find((c) => c.id === id)) {\n list.value.push(selectedResource);\n }\n}\n\n/**\n * Returns the value of the URL parameter (if it is set)\n * @param key\n * @param url\n */\nexport function getUrlParam(key, url = undefined) {\n const params = new URLSearchParams(url?.replace(/.*\\?/, \"\") || window.location.search);\n return params.get(key);\n}\n","import { ref } from \"vue\";\nimport { FileUpload, FileUploadOptions } from \"./FileUpload\";\n\nexport function useMultiFileUpload(options: FileUploadOptions) {\n const uploadedFiles = ref([]);\n const onCompleteCb = ref(null);\n const onFilesChangeCb = ref(null);\n const onFilesSelected = (e) => {\n uploadedFiles.value = [...uploadedFiles.value, ...e.target.files];\n new FileUpload(e.target.files, options)\n .onProgress(({ file }) => {\n updateFileInList(file);\n })\n .onComplete(({ file, uploadedFile }) => {\n updateFileInList(file, uploadedFile);\n })\n .onAllComplete(() => {\n onCompleteCb.value && onCompleteCb.value();\n onFilesChangeCb.value && onFilesChangeCb.value(uploadedFiles.value);\n })\n .upload();\n };\n\n function updateFileInList(file, replace = null) {\n const index = uploadedFiles.value.findIndex(f => f.id === file.id);\n if (index !== -1) {\n uploadedFiles.value.splice(index, 1, replace || file);\n }\n onFilesChangeCb.value && onFilesChangeCb.value(uploadedFiles.value);\n }\n\n const onDrop = (e) => {\n onFilesSelected({ target: { files: e.dataTransfer.files } });\n };\n\n const onFilesChange = (cb) => {\n onFilesChangeCb.value = cb;\n };\n\n const onComplete = (cb) => {\n onCompleteCb.value = cb;\n };\n\n const onClear = () => {\n uploadedFiles.value = [];\n onFilesChangeCb.value && onFilesChangeCb.value(uploadedFiles.value);\n onCompleteCb.value && onCompleteCb.value();\n };\n\n const onRemove = (file) => {\n const index = uploadedFiles.value.findIndex(f => f.id === file.id);\n if (index !== -1) {\n uploadedFiles.value.splice(index, 1);\n }\n onFilesChangeCb.value && onFilesChangeCb.value(uploadedFiles.value);\n onCompleteCb.value && onCompleteCb.value();\n };\n\n return {\n onClear,\n onRemove,\n onComplete,\n onFilesChange,\n onDrop,\n onFilesSelected,\n uploadedFiles\n };\n}\n","import { ref, shallowRef, VNode } from \"vue\";\nimport { FlashMessages } from \"./FlashMessages\";\n\ntype ActionTarget = object[] | object;\n\ninterface ActionOptions {\n name?: string;\n label?: string;\n menu?: boolean;\n batch?: boolean;\n category?: string;\n class?: string;\n trigger?: (target: ActionTarget, input: any) => Promise<any>;\n activeTarget?: any;\n vnode?: (target: ActionTarget) => VNode;\n enabled?: (target: object) => boolean;\n batchEnabled?: (targets: object[]) => boolean;\n optimistic?: (action: ActionOptions, target: object, input: any) => void;\n onAction?: (action: string | null | undefined, target: object, input: any) => Promise<any>;\n onBatchAction?: (action: string | null | undefined, targets: object[], input: any) => Promise<any>;\n onStart?: (action: ActionOptions | null, targets: ActionTarget, input: any) => boolean;\n onSuccess?: (result: any, targets: ActionTarget, input: any) => any;\n onError?: (result: any, targets: ActionTarget, input: any) => any;\n onFinish?: (result: any, targets: ActionTarget, input: any) => any;\n}\n\nexport const activeActionVnode: object = shallowRef(null);\n\n/**\n * Hook to perform an action on a set of targets\n * This helper allows you to perform actions by name on a set of targets using a provided list of actions\n *\n * @param actions\n * @param {ActionOptions | null} globalOptions\n */\nexport function useActions(actions: ActionOptions[], globalOptions: ActionOptions | null = null) {\n const mappedActions = actions.map(action => {\n const mappedAction: ActionOptions = { ...globalOptions, ...action };\n if (!mappedAction.trigger) {\n mappedAction.trigger = (target, input) => performAction(mappedAction, target, input);\n mappedAction.activeTarget = ref(null);\n }\n return mappedAction;\n });\n\n /**\n * Check if the provided target is currently being saved by any of the actions\n */\n function isSavingTarget(target: any): boolean {\n if (!target) return false;\n\n for (const action of mappedActions) {\n const activeTargets = (Array.isArray(action.activeTarget.value) ? action.activeTarget.value : [action.activeTarget.value]).filter(t => t);\n if (activeTargets.length === 0) continue;\n\n for (const activeTarget of activeTargets) {\n if (activeTarget === target || (activeTarget.id && activeTarget.id === target.id)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Perform an action on a set of targets\n *\n * @param {string} name - can either be a string or an action object\n * @param {object[]|object} target - an array of targets or a single target object\n * @param {any} input - The input data to pass to the action handler\n */\n async function performAction(name: string | object, target: ActionTarget, input: any = null) {\n const action: ActionOptions = typeof name === \"string\" ? mappedActions.find(a => a.name === name) : name;\n if (!action) {\n throw new Error(`Unknown action: ${name}`);\n }\n\n if (!action.activeTarget) {\n throw new Error(`Action ${action.name} does not have an activeTarget ref. Please use useActions() or manually set the activeTarget ref`);\n }\n\n const vnode = action.vnode && action.vnode(target);\n let result: any;\n\n action.activeTarget.value = target;\n\n // Run the onStart handler if it exists and quit the operation if it returns false\n if (action.onStart) {\n if (!action.onStart(action, target, input)) {\n return;\n }\n }\n\n // If additional input is required, first render the vnode and wait for the confirm or cancel action\n if (vnode) {\n // If the action requires an input, we set the activeActionVnode to the input component.\n // This will tell the ActionVnode to render the input component, and confirm or cancel the\n // action The confirm function has the input from the component passed and will resolve the promise\n // with the result of the action\n result = await new Promise((resolve, reject) => {\n activeActionVnode.value = {\n vnode,\n confirm: async (confirmInput: any) => {\n const result = await onConfirmAction(action, target, { ...input, ...confirmInput });\n\n // Only resolve when we have a non-error response, so we can show the error message w/o\n // hiding the dialog / vnode\n if (result === undefined || result === true || result?.success) {\n resolve(result);\n }\n },\n cancel: resolve\n };\n });\n\n activeActionVnode.value = null;\n } else {\n result = await onConfirmAction(action, target, input);\n }\n\n action.activeTarget.value = null;\n return result;\n }\n\n /**\n * Filter the list of actions based on the provided filters in key-value pairs\n * You can filter on any ActionOptions property by matching the value exactly or by providing an array of values\n *\n * @param filters\n * @returns {ActionOptions[]}\n */\n function filterActions(filters: object): ActionOptions[] {\n let filteredActions = [...mappedActions];\n\n for (const filter of Object.keys(filters)) {\n const filterValue = filters[filter];\n filteredActions = filteredActions.filter(a => a[filter] === filterValue || (Array.isArray(filterValue) && filterValue.includes(a[filter])));\n }\n return filteredActions;\n }\n\n return {\n actions: mappedActions,\n isSavingTarget,\n filterActions,\n performAction\n };\n}\n\nasync function onConfirmAction(action: ActionOptions, target: ActionTarget, input: any = null) {\n if (!action.onAction) {\n throw new Error(\"No onAction handler found for the selected action:\" + action.name);\n }\n\n let result: any;\n try {\n if (Array.isArray(target)) {\n if (action.onBatchAction) {\n result = await action.onBatchAction(action.name, target, input);\n } else {\n result = { error: `Action ${action.name} does not support batch actions` };\n }\n } else {\n // If the action has an optimistic callback, we call it before the actual action to immediately\n // update the UI\n if (action.optimistic) {\n action.optimistic(action, target, input);\n }\n\n result = await action.onAction(action.name, target, input);\n }\n } catch (e) {\n console.error(e);\n result = { error: `An error occurred while performing the action ${action.label}. Please try again later.` };\n }\n\n // If there is no return value or the result marks it as successful, we show a success message\n if (result === undefined || result === true || result?.success) {\n if (result?.success && Array.isArray(target)) {\n FlashMessages.success(`Successfully performed action ${action.label} on ${target.length} items`);\n }\n\n if (action.onSuccess) {\n action.onSuccess(result, target, input);\n }\n } else {\n const errors = [];\n if (result.errors) {\n errors.push(...result.errors);\n } else if (result.error) {\n errors.push(typeof result.error === \"string\" ? result.error : result.error.message);\n } else {\n errors.push(\"An unknown error occurred. Please try again later.\");\n }\n\n FlashMessages.combine(\"error\", errors);\n\n if (action.onError) {\n action.onError(result, target, input);\n }\n }\n\n if (action.onFinish) {\n action.onFinish(result, target, input);\n }\n\n return result;\n}\n","import { computed, ref } from \"vue\";\nimport { FileUpload, FileUploadOptions } from \"./FileUpload\";\n\nexport function useSingleFileUpload(options: FileUploadOptions = null) {\n const uploadedFile = ref(null);\n const onCompleteCb = ref(null);\n const onFileChangeCb = ref(null);\n\n const onFileSelected = (e) => {\n uploadedFile.value = null;\n new FileUpload(e.target.files[0], options)\n .onProgress(({ file }) => {\n uploadedFile.value = file;\n onFileChangeCb.value && onFileChangeCb.value(uploadedFile.value);\n })\n .onComplete(({ uploadedFile: completedFile }) => {\n uploadedFile.value = completedFile;\n onCompleteCb.value && onCompleteCb.value(uploadedFile.value);\n onFileChangeCb.value && onFileChangeCb.value(uploadedFile.value);\n })\n .upload();\n };\n\n const onDrop = (e) => {\n onFileSelected({ target: { files: e.dataTransfer.files } });\n };\n\n const isFileUploaded = computed(() => {\n return uploadedFile.value && uploadedFile.value.url;\n });\n\n const onFileChange = (cb) => {\n onFileChangeCb.value = cb;\n };\n\n const onComplete = (cb) => {\n onCompleteCb.value = cb;\n };\n\n const onClear = () => {\n uploadedFile.value = null;\n onFileChangeCb.value && onFileChangeCb.value(uploadedFile.value);\n };\n\n return {\n isFileUploaded,\n onClear,\n onComplete,\n onFileChange,\n onDrop,\n onFileSelected,\n uploadedFile\n };\n}\n","export function setItem(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n}\n\nexport function getItem(key, defaultValue = null) {\n const item = localStorage.getItem(key);\n return item ? JSON.parse(item) : defaultValue;\n}\n","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M19 9l-7 7-7-7\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M15 19l-7-7 7-7\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M15 12a3 3 0 11-6 0 3 3 0 016 0z\"\n }),\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M7 20l4-16m2 16l4-16M6 9h14M4 15h14\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z\"\n }),\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M12 4v16m8-8H4\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n \"stroke-width\": \"2\",\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n d: \"M6 18L18 6M6 6l12 12\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", { d: \"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z\" })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", { d: \"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z\" })\n ]))\n}","import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport default function render(_ctx, _cache) {\n return (_openBlock(), _createBlock(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\"\n }, [\n _createVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z\",\n \"clip-rule\": \"evenodd\"\n })\n ]))\n}","/**\n * Drag and Drop basic functionality for dragging elements and firing events on drag start, drag over and drag end\n */\nexport class DragAndDrop {\n options: {\n direction?: string,\n hideDragImage?: boolean,\n showPlaceholder?: boolean,\n } = { direction: \"vertical\", hideDragImage: false };\n\n // State\n startY = 0;\n startX = 0;\n startSize = 0;\n cursorY = 0;\n cursorX = 0;\n onStartCb = null;\n onEndCb = null;\n onDropCb = null;\n onDraggingCb = null;\n dropZoneResolver = null;\n currentDropZone = null;\n draggableData = null;\n // Used to abort dragging event listeners on the element\n abortController = null;\n\n constructor(options = {}) {\n // Options\n options = {\n direction: \"vertical\",\n hideDragImage: false,\n ...options,\n };\n\n this.setOptions(options);\n }\n\n /**\n * Set the options for the drag and drop instance\n * @param options\n * @returns {DragAndDrop}\n */\n setOptions(options = {}) {\n this.options = { ...this.options, ...options };\n return this;\n }\n\n /**\n * Returns if the list is stacked vertically or horizontally\n * @returns {boolean}\n */\n isVertical() {\n return this.options.direction === \"vertical\";\n }\n\n /**\n * Set the target drop zone for draggable elements\n * @param dropZone\n * @returns {DragAndDrop}\n */\n setDropZone(dropZone) {\n this.dropZoneResolver = dropZone;\n return this;\n }\n\n /**\n * Callback that fires when an element has started dragging\n * @param cb\n * @returns {DragAndDrop}\n */\n onStart(cb) {\n this.onStartCb = cb;\n return this;\n }\n\n /**\n * Callback that fires when an element has stopped dragging\n * @param cb\n * @returns {DragAndDrop}\n */\n onEnd(cb) {\n this.onEndCb = cb;\n return this;\n }\n\n /**\n * Callback that fires when the dragging element is moved\n * @param cb\n * @returns {DragAndDrop}\n */\n onDragging(cb) {\n this.onDraggingCb = cb;\n return this;\n }\n\n /**\n * Callback that fires when the dragging element has been dropped\n * @param cb\n * @returns {DragAndDrop}\n */\n onDrop(cb) {\n this.onDropCb = cb;\n return this;\n }\n\n /**\n * Start listening for drag events and prepare an element for drag/drop\n * @param e\n * @param data\n */\n dragStart(e, data) {\n this.currentDropZone = this.getDropZone(e);\n\n if (this.currentDropZone) {\n this.startY = e.clientY;\n this.startX = e.clientX;\n this.startSize = this.getDropZoneSize();\n e.dataTransfer.effectAllowed = \"move\";\n e.dataTransfer.dropEffect = \"move\";\n this.draggableData = data;\n this.abortController = new AbortController();\n const options = { signal: this.abortController.signal };\n document.addEventListener(\"dragenter\", (e) => this.dragEnter(e), options);\n document.addEventListener(\"dragover\", (e) => this.dragOver(e), options);\n document.addEventListener(\"drop\", (e) => this.drop(e), options);\n this.onStartCb && this.onStartCb(e);\n\n if (this.options.hideDragImage) {\n e.dataTransfer.setDragImage(new Image(), 0, 0);\n }\n } else {\n console.error(\"Drop zone was not found\", e, data);\n }\n }\n\n /**\n * Clean up event listeners after dragging is done\n */\n dragEnd(e) {\n this.currentDropZone = null;\n this.abortController.abort();\n this.draggableData = null;\n this.onEndCb && this.onEndCb(e);\n }\n\n /**\n * The dragging element has entered a new target\n * @param e\n */\n dragEnter(e) {\n e.preventDefault();\n }\n\n /**\n * The dragging element is moving\n * @param e\n */\n dragOver(e) {\n e.preventDefault();\n this.cursorY = e.clientY;\n this.cursorX = e.clientX;\n this.onDraggingCb && this.onDraggingCb(e);\n }\n\n /**\n * Handle dropping the element into its correct position\n * @param e\n */\n drop(e) {\n e.dataTransfer.dropEffect = \"move\";\n e.preventDefault();\n this.onDropCb && this.onDropCb(e, this.draggableData);\n }\n\n /**\n * Returns the drop zone if the current target element is or is inside the drop zone\n * @param e\n * @returns {HTMLElement|null}\n */\n getDropZone(e) {\n if (typeof this.dropZoneResolver === \"string\") {\n let target = e.target;\n while (target) {\n if (target.dataset?.dropZone === this.dropZoneResolver) {\n return target;\n }\n target = target.parentNode;\n }\n return null;\n } else if (typeof this.dropZoneResolver === \"function\") {\n return this.dropZoneResolver(e);\n } else {\n return document.body;\n }\n }\n\n /**\n * Returns the distance between the start and current cursor position\n * @returns {number}\n */\n getDistance() {\n return this.isVertical()\n ? this.cursorY - this.startY\n : this.cursorX - this.startX;\n }\n\n /**\n * Returns the size of the drop zone\n */\n getDropZoneSize() {\n return this.isVertical()\n ? this.currentDropZone?.offsetHeight\n : this.currentDropZone?.offsetWidth;\n }\n\n /**\n * Returns the percent change between the start and current cursor position relative to the drop zone size\n *\n * @returns {number}\n */\n getPercentChange() {\n const distance = this.getDistance();\n return (distance / this.startSize) * 100;\n }\n}\n","<template>\n <div\n :class=\"{\n 'cursor-ew-resize': direction === 'horizontal',\n 'cursor-ns-resize': direction === 'vertical',\n }\"\n class=\"flex justify-center items-center w-full h-full\"\n draggable=\"true\"\n @dragstart=\"dragAndDrop.dragStart\"\n @dragend=\"dragAndDrop.dragEnd\"\n >\n <slot />\n </div>\n</template>\n<script setup>\nimport { useDebounceFn } from '@vueuse/core';\nimport { DragAndDrop } from './dragAndDrop';\n\nconst emit = defineEmits(['start', 'end', 'resize']);\nconst props = defineProps({\n initialValue: {\n type: Number,\n default: null\n },\n dropZone: {\n type: [Function, String],\n required: true\n },\n direction: {\n type: String,\n default: 'horizontal',\n validator: (value) => ['vertical', 'horizontal'].includes(value)\n }\n});\n\nconst dragAndDrop = new DragAndDrop()\n .setDropZone(props.dropZone)\n .setOptions({\n showPlaceholder: true,\n direction: props.direction,\n hideDragImage: true\n })\n .onDragging(useDebounceFn(() => {\n emit('resize', {\n distance: dragAndDrop.getDistance(),\n percent: dragAndDrop.getPercentChange(),\n startDropZoneSize: dragAndDrop.startSize,\n dropZoneSize: dragAndDrop.getDropZoneSize()\n });\n }, 20, { maxWait: 30 }))\n .onStart(() => emit('start'))\n .onEnd(() => emit('end'));\n</script>\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M10 12 6 8h8z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M7.5 16q-.625 0-1.062-.438A1.44 1.44 0 0 1 6 14.5q0-.625.438-1.062A1.44 1.44 0 0 1 7.5 13q.625 0 1.062.438Q9 13.875 9 14.5t-.438 1.062A1.44 1.44 0 0 1 7.5 16m5 0q-.625 0-1.062-.438A1.44 1.44 0 0 1 11 14.5q0-.625.438-1.062A1.44 1.44 0 0 1 12.5 13q.625 0 1.062.438.438.437.438 1.062t-.438 1.062A1.44 1.44 0 0 1 12.5 16m-5-4.5q-.625 0-1.062-.438A1.44 1.44 0 0 1 6 10q0-.625.438-1.062A1.44 1.44 0 0 1 7.5 8.5q.625 0 1.062.438Q9 9.375 9 10t-.438 1.062A1.44 1.44 0 0 1 7.5 11.5m5 0q-.625 0-1.062-.438A1.44 1.44 0 0 1 11 10q0-.625.438-1.062A1.44 1.44 0 0 1 12.5 8.5q.625 0 1.062.438Q14 9.375 14 10t-.438 1.062a1.44 1.44 0 0 1-1.062.438M7.5 7q-.625 0-1.062-.438A1.44 1.44 0 0 1 6 5.5q0-.625.438-1.062A1.44 1.44 0 0 1 7.5 4q.625 0 1.062.438Q9 4.875 9 5.5t-.438 1.062A1.44 1.44 0 0 1 7.5 7m5 0q-.625 0-1.062-.438A1.44 1.44 0 0 1 11 5.5q0-.625.438-1.062A1.44 1.44 0 0 1 12.5 4q.625 0 1.062.438Q14 4.875 14 5.5t-.438 1.062A1.44 1.44 0 0 1 12.5 7\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 7 16\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M.5 1v14c0 .55.45 1 1 1s1-.45 1-1V1c0-.55-.45-1-1-1S.5.45.5 1m6 14V1c0-.55-.45-1-1-1s-1 .45-1 1v14c0 .55.45 1 1 1s1-.45 1-1\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M9.167 17.5v-5h1.666v1.667H17.5v1.666h-6.667V17.5zM2.5 15.833v-1.666h5v1.666zM5.833 12.5v-1.667H2.5V9.167h3.333V7.5H7.5v5zm3.334-1.667V9.167H17.5v1.666zM12.5 7.5v-5h1.667v1.667H17.5v1.666h-3.333V7.5zm-10-1.667V4.167h8.333v1.666z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M17.859 18.558c.394 0 .713-.32.713-.714V2.141a.714.714 0 0 0-.713-.713H2.156a.714.714 0 0 0-.714.713v15.703c0 .394.32.714.714.714zM20 17.844a2.14 2.14 0 0 1-2.141 2.141H2.156a2.14 2.14 0 0 1-2.141-2.14V2.14C.015.96.973.001 2.156.001h15.703C19.04 0 20 .958 20 2.14z\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M13.205 4.996a1.784 1.784 0 1 0 0 3.569 1.784 1.784 0 0 0 0-3.57M9.993 6.78a3.212 3.212 0 1 1 6.424 0 3.212 3.212 0 0 1-6.424 0M2.848 9.993A11.22 11.22 0 0 1 14.12 19.14a.714.714 0 0 1-1.403.264 9.79 9.79 0 0 0-9.846-7.984h-.018c-.673-.001-1.344.061-2.005.188a.714.714 0 1 1-.268-1.402 12 12 0 0 1 2.268-.213\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M10.954 13.82c1.5-.645 3.117-.976 4.75-.972 1.29 0 2.573.21 3.796.622a.714.714 0 1 1-.456 1.353 10.4 10.4 0 0 0-3.34-.548h-.002a10.55 10.55 0 0 0-4.185.856.714.714 0 1 1-.563-1.312\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_5 = [\n _hoisted_2,\n _hoisted_3,\n _hoisted_4\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_5]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 550.801 550.801\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M160.381 282.225c0-14.832-10.299-23.684-28.474-23.684-7.414 0-12.437.715-15.071 1.432V307.6c3.114.707 6.942.949 12.192.949 19.391 0 31.353-9.809 31.353-26.324M272.875 259.019c-8.145 0-13.397.717-16.519 1.435v105.523c3.116.729 8.142.729 12.69.729 33.017.231 54.554-17.946 54.554-56.474.242-33.513-19.385-51.213-50.725-51.213\" }, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M488.426 197.019H475.2v-63.816c0-.398-.063-.799-.116-1.202-.021-2.534-.827-5.023-2.562-6.995L366.325 3.694c-.032-.031-.063-.042-.085-.076-.633-.707-1.371-1.295-2.151-1.804a10 10 0 0 0-.706-.419 11 11 0 0 0-2.131-.896c-.2-.056-.38-.138-.58-.19A10.8 10.8 0 0 0 358.193 0H97.2C85.282 0 75.6 9.693 75.6 21.601v175.413H62.377c-17.049 0-30.873 13.818-30.873 30.873v160.545c0 17.043 13.824 30.87 30.873 30.87h13.224V529.2c0 11.907 9.682 21.601 21.6 21.601h356.4c11.907 0 21.6-9.693 21.6-21.601V419.302h13.226c17.044 0 30.871-13.827 30.871-30.87v-160.54c-.001-17.054-13.828-30.873-30.872-30.873M97.2 21.605h250.193v110.513c0 5.967 4.841 10.8 10.8 10.8H453.6v54.108H97.2zm265.159 287.418c0 30.876-11.243 52.165-26.82 65.333-16.971 14.117-42.82 20.814-74.396 20.814-18.9 0-32.297-1.197-41.401-2.389V234.365c13.399-2.149 30.878-3.346 49.304-3.346 30.612 0 50.478 5.508 66.039 17.226 16.743 12.445 27.274 32.302 27.274 60.778M80.7 393.499V234.365c11.241-1.904 27.042-3.346 49.296-3.346 22.491 0 38.527 4.308 49.291 12.928 10.292 8.131 17.215 21.534 17.215 37.328 0 15.799-5.25 29.198-14.829 38.285-12.442 11.728-30.865 16.996-52.407 16.996-4.778 0-9.1-.243-12.435-.723v57.67H80.7zm372.901 129.854H97.2V419.302h356.4v104.051zm31.297-261.226h-61.989v36.851h57.913v29.674h-57.913V393.5h-36.593V232.216h98.582z\" }, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_4]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n \"xml:space\": \"preserve\",\n fill: \"currentColor\",\n viewBox: \"0 0 394.4 394.4\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M37.4 377.4a20.33 20.33 0 0 1-14.423-5.977c-7.97-7.963-7.97-20.883 0-28.846l319.6-319.601c7.97-7.97 20.876-7.97 28.846 0 7.97 7.962 7.97 20.882 0 28.845l-319.6 319.601A20.32 20.32 0 0 1 37.4 377.4m357-78.201c0-52.496-42.704-95.199-95.2-95.199S204 246.703 204 299.199s42.704 95.201 95.2 95.201 95.2-42.705 95.2-95.201m-40.799 0c0 29.996-24.405 54.4-54.4 54.4s-54.4-24.404-54.4-54.4c0-29.994 24.405-54.398 54.4-54.398s54.4 24.404 54.4 54.398M190.4 95.2C190.4 42.704 147.696 0 95.2 0S0 42.704 0 95.2s42.704 95.2 95.2 95.2 95.2-42.704 95.2-95.2m-40.8 0c0 29.995-24.405 54.4-54.4 54.4s-54.4-24.405-54.4-54.4 24.405-54.4 54.4-54.4 54.4 24.406 54.4 54.4\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M16.5 18V6h2v12zm-11 0V6l9 6z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M5.5 18V6h2v12zm13 0-9-6 9-6z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"20\",\n fill: \"none\",\n viewBox: \"0 0 16 18\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n stroke: \"currentColor\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"stroke-width\": \"2\",\n d: \"m13.833 4.833-.722 10.119a1.667 1.667 0 0 1-1.663 1.548H4.552a1.667 1.667 0 0 1-1.663-1.548L2.167 4.833m4.166 3.334v5m3.334-5v5m.833-8.334v-2.5a.833.833 0 0 0-.833-.833H6.333a.833.833 0 0 0-.833.833v2.5m-4.167 0h13.334\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 20 20\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M0 18.273 10 1l10 17.273zm3.136-1.819h13.728L10 4.637zM10 15.545a.88.88 0 0 0 .648-.261.88.88 0 0 0 .261-.648.88.88 0 0 0-.26-.647.88.88 0 0 0-.649-.262.88.88 0 0 0-.647.262.88.88 0 0 0-.262.647q0 .387.262.648.261.261.647.261m-.91-2.727h1.82V8.273H9.09z\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_3]))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 17 17\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M16.822.178a.607.607 0 0 1 0 .858L1.036 16.822a.607.607 0 1 1-.858-.858L15.964.178a.607.607 0 0 1 .858 0\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\",\n d: \"M.178.178a.607.607 0 0 1 .858 0l15.786 15.786a.607.607 0 0 1-.858.858L.178 1.036a.607.607 0 0 1 0-.858\",\n \"clip-rule\": \"evenodd\"\n}, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [..._hoisted_4]))\n}\nexport default { render: render }","<template>\n <QBtn class=\"bg-slate-200\" :loading=\"isExporting\" @click=\"onExport\">\n <ExportIcon class=\"w-5\" />\n </QBtn>\n</template>\n<script setup>\nimport { DownloadIcon as ExportIcon } from '@heroicons/vue/solid';\nimport { ref } from 'vue';\nimport { FlashMessages } from '../../../helpers';\n\nconst props = defineProps({\n exporter: {\n type: Function,\n required: true\n }\n});\nconst isExporting = ref(false);\nasync function onExport() {\n isExporting.value = true;\n try {\n await props.exporter();\n } catch (error) {\n console.error(error);\n FlashMessages.error('Failed to export data');\n }\n isExporting.value = false;\n}\n</script>\n","<template>\n <QDialog\n :full-height=\"fullHeight\"\n :full-width=\"fullWidth\"\n :model-value=\"!!modelValue\"\n :no-backdrop-dismiss=\"!backdropDismiss\"\n :maximized=\"maximized\"\n @update:model-value=\"onClose\"\n >\n <QCard class=\"flex flex-col flex-nowrap\">\n <QCardSection\n v-if=\"title || $slots.title\"\n class=\"pl-6 pr-10 border-b border-gray-medium\"\n >\n <h3\n class=\"font-normal flex items-center\"\n :class=\"titleClass\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h3>\n <div\n v-if=\"subtitle\"\n class=\"mt-1 text-sm\"\n >{{ subtitle }}\n </div>\n </QCardSection>\n <QCardSection v-if=\"$slots.toolbar\">\n <slot name=\"toolbar\" />\n </QCardSection>\n <QCardSection\n v-if=\"content || $slots.default\"\n class=\"px-6 bg-neutral-plus-7 flex-grow max-h-full overflow-y-auto\"\n :class=\"contentClass\"\n >\n <slot>{{ content }}</slot>\n </QCardSection>\n <div class=\"flex px-6 py-4 border-t border-gray-medium\">\n <div class=\"flex-grow\">\n <QBtn\n :label=\"cancelText\"\n class=\"action-btn btn-white-gray\"\n @click=\"onClose\"\n >\n <slot name=\"cancel-text\" />\n </QBtn>\n </div>\n <slot name=\"actions\" />\n <div v-if=\"!hideConfirm\">\n <QBtn\n :label=\"$slots['confirm-text'] ? '' : confirmText\"\n class=\"action-btn ml-4\"\n :class=\"confirmClass\"\n :loading=\"isSaving\"\n :disable=\"disabled\"\n data-testid=\"confirm-button\"\n @click=\"onConfirm\"\n >\n <slot name=\"confirm-text\" />\n </QBtn>\n </div>\n </div>\n <a\n class=\"absolute top-0 right-0 p-4 text-black\"\n @click=\"onClose\"\n >\n <CloseIcon class=\"w-5\" />\n </a>\n </QCard>\n </QDialog>\n</template>\n\n<script setup>\nimport { XIcon as CloseIcon } from '@heroicons/vue/outline';\n\nconst emit = defineEmits(['update:model-value', 'confirm', 'close']);\nconst props = defineProps({\n modelValue: { type: [String, Boolean, Object], default: true },\n title: {\n type: String,\n default: ''\n },\n titleClass: {\n type: String,\n default: ''\n },\n subtitle: {\n type: String,\n default: ''\n },\n content: {\n type: String,\n default: ''\n },\n backdropDismiss: Boolean,\n maximized: Boolean,\n fullWidth: Boolean,\n fullHeight: Boolean,\n disabled: Boolean,\n isSaving: Boolean,\n closeOnConfirm: Boolean,\n hideConfirm: Boolean,\n confirmText: {\n type: String,\n default: 'Confirm'\n },\n cancelText: {\n type: String,\n default: 'Cancel'\n },\n confirmClass: {\n type: String,\n default: 'bg-blue-600 text-white'\n },\n contentClass: {\n type: String,\n default: ''\n }\n});\n\nfunction onConfirm() {\n emit('confirm');\n\n if (props.closeOnConfirm) {\n emit('close');\n }\n}\n\nfunction onClose() {\n emit('update:model-value', false);\n emit('close');\n}\n</script>\n","<template>\n <QDialog\n :model-value=\"true\"\n maximized\n @update:model-value=\"$emit('close')\"\n @keyup.left=\"carousel.previous()\"\n @keyup.right=\"carousel.next()\"\n >\n <div class=\"absolute top-0 left-0 w-full h-full\">\n <QCarousel\n ref=\"carousel\"\n v-model=\"currentSlide\"\n height=\"100%\"\n swipeable\n animated\n :thumbnails=\"files.length > 1\"\n infinite\n class=\"carousel\"\n >\n <QCarouselSlide\n v-for=\"file in files\"\n :key=\"'file-' + file.id\"\n :name=\"file.id\"\n :img-src=\"getThumbUrl(file)\"\n >\n <div class=\"slide-image\">\n <template v-if=\"isVideo(file)\">\n <video\n class=\"max-h-full w-full\"\n controls\n >\n <source\n :src=\"file.url + '#t=0.1'\"\n :type=\"file.mime\"\n />\n </video>\n </template>\n <img v-else :alt=\"file.filename\" :src=\"file.url\" />\n </div>\n </QCarouselSlide>\n </QCarousel>\n <CloseIcon\n class=\"absolute top-4 right-4 cursor-pointer text-white w-8 h-8\"\n @click=\"$emit('close')\"\n />\n </div>\n </QDialog>\n</template>\n<script setup>\nimport { ref } from 'vue';\nimport { XIcon as CloseIcon } from '../../../svg';\n\ndefineEmits(['close']);\nconst props = defineProps({\n files: {\n type: Array,\n default: () => []\n },\n defaultSlide: {\n type: String,\n default: ''\n }\n});\n\nconst carousel = ref(null);\nconst currentSlide = ref(props.defaultSlide);\nfunction isVideo(file) {\n return file.mime?.startsWith('video');\n}\nfunction getThumbUrl(file) {\n if (file.thumb) {\n return file.thumb.url;\n } else if (isVideo(file)) {\n // Base64 encode a PlayIcon for the placeholder image\n return `data:image/svg+xml;base64,${btoa(\n `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"white\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M8 5v14l11-7z\"/></svg>`\n )}`;\n } else {\n return file.url;\n }\n}\n</script>\n<style scoped lang=\"scss\">\n.slide-image {\n width: 100%;\n height: 100%;\n background: black;\n display: flex;\n justify-content: center;\n align-items: center;\n\n img {\n max-height: 100%;\n max-width: 100%;\n object-fit: contain;\n }\n}\n\n.carousel {\n :deep(.q-carousel__navigation--bottom) {\n position: relative;\n bottom: 8em;\n }\n}\n</style>\n","<template>\n <QDialog\n :model-value=\"modelValue\"\n maximized\n transition-show=\"slide-up\"\n transition-hide=\"slide-down\"\n @update:model-value=\"onClose\"\n >\n <div class=\"flex justify-center min-w-xs\" :class=\"computedClass\">\n <div\n v-if=\"closeable\"\n v-close-popup\n class=\"p-4 m-4 absolute-top-right top right cursor-pointer\"\n >\n <XIcon class=\"w-5 h-5\" />\n </div>\n <slot />\n </div>\n </QDialog>\n</template>\n\n<script setup>\nimport { computed } from 'vue';\nimport { XIcon } from '../../../svg';\n\nconst emit = defineEmits(['update:model-value', 'close']);\nconst props = defineProps({\n modelValue: Boolean,\n center: Boolean,\n blue: Boolean,\n closeable: Boolean\n});\n\nlet computedClass = computed(() => {\n return {\n 'bg-blue-600 text-white': props.blue,\n 'bg-white text-gray-base': !props.blue,\n 'items-center': props.center\n };\n});\n\nfunction onClose() {\n emit('update:model-value', false);\n emit('close');\n}\n</script>\n","<template>\n <QDialog\n :full-height=\"fullHeight\"\n :full-width=\"fullWidth\"\n :model-value=\"!!modelValue\"\n :no-backdrop-dismiss=\"!backdropDismiss\"\n :maximized=\"maximized\"\n @update:model-value=\"onClose\"\n >\n <QCard class=\"flex flex-col flex-nowrap\">\n <QCardSection\n v-if=\"title || $slots.title\"\n class=\"pl-6 pr-10 border-b border-gray-medium\"\n >\n <h3\n class=\"font-normal flex items-center\"\n :class=\"titleClass\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h3>\n <div\n v-if=\"subtitle\"\n class=\"mt-1 text-sm\"\n >{{ subtitle }}\n </div>\n </QCardSection>\n <QCardSection\n v-if=\"content || $slots.default\"\n class=\"px-6 bg-neutral-plus-7 flex-grow max-h-full overflow-y-auto\"\n >\n <slot>{{ content }}</slot>\n </QCardSection>\n <div\n class=\"flex items-center justify-center px-6 py-4 border-t border-gray-medium\"\n >\n <div class=\"flex-grow text-right\">\n <QBtn\n :label=\"doneText\"\n class=\"action-btn btn-white-gray\"\n @click=\"onClose\"\n >\n <slot name=\"done-text\" />\n </QBtn>\n </div>\n </div>\n <a\n class=\"absolute top-0 right-0 p-4 text-black\"\n @click=\"onClose\"\n >\n <CloseIcon class=\"w-5\" />\n </a>\n </QCard>\n </QDialog>\n</template>\n\n<script setup>\nimport { XIcon as CloseIcon } from '@heroicons/vue/outline';\n\nconst emit = defineEmits(['update:model-value', 'close']);\ndefineProps({\n modelValue: { type: [Boolean, Object], default: true },\n title: {\n type: String,\n default: ''\n },\n titleClass: {\n type: String,\n default: ''\n },\n subtitle: {\n type: String,\n default: ''\n },\n content: {\n type: String,\n default: ''\n },\n backdropDismiss: Boolean,\n maximized: Boolean,\n fullWidth: Boolean,\n fullHeight: Boolean,\n doneText: {\n type: String,\n default: 'Done'\n }\n});\n\nfunction onClose() {\n emit('update:model-value', false);\n emit('close');\n}\n</script>\n","<template>\n <ConfirmDialog\n v-bind=\"$props\"\n @confirm=\"$emit('confirm', newInput)\"\n @close=\"$emit('close', $event)\"\n >\n <slot>\n <QInput\n v-model=\"newInput\"\n type=\"number\"\n class=\"w-full\"\n @input=\"$emit('update:input', $event)\"\n />\n </slot>\n </ConfirmDialog>\n</template>\n<script setup>\nimport { ref } from 'vue';\nimport ConfirmDialog from './ConfirmDialog';\n\ndefineEmits(['confirm', 'close', 'update:input']);\nconst props = defineProps({\n ...ConfirmDialog.props,\n title: {\n type: String,\n default: 'Enter Value'\n },\n input: {\n type: [Number, String],\n default: ''\n }\n});\n\nconst newInput = ref(props.input);\n</script>\n","<template>\n <div class=\"relative flex justify-center bg-neutral-plus-7\" :class=\"{'rounded-2xl': !square}\">\n <template v-if=\"computedImage\">\n <div\n class=\"grow h-full overflow-hidden\"\n :class=\"{'rounded-2xl': !square}\"\n @click=\"showPreview = true\"\n >\n <div\n v-if=\"isVideo\"\n class=\"relative max-h-full max-w-full w-full flex justify-center\"\n >\n <video\n class=\"max-h-full\"\n preload=\"auto\"\n >\n <source\n :src=\"previewUrl + '#t=0.1'\"\n :type=\"mimeType\"\n />\n </video>\n <button class=\"play-button text-blue-lighter\">\n <PlayIcon class=\"w-16\" />\n </button>\n </div>\n <QImg\n v-if=\"thumbUrl || isPreviewable\"\n fit=\"scale-down\"\n class=\"non-selectable max-h-full max-w-full h-full\"\n :src=\"(thumbUrl || previewUrl) + '#t=0.1'\"\n preload=\"auto\"\n data-testid=\"previewed-image\"\n />\n <div\n v-else\n class=\"flex items-center justify-center h-full\"\n >\n <PdfIcon v-if=\"isPdf\" class=\"w-24\" />\n <TextFileIcon v-else class=\"w-24\" />\n </div>\n </div>\n <div\n v-if=\"$slots['action-button']\"\n class=\"action-button\"\n >\n <slot name=\"action-button\" />\n </div>\n <div\n v-if=\"image && image.progress !== undefined\"\n class=\"absolute-bottom w-full\"\n >\n <QLinearProgress\n :value=\"image.progress\"\n size=\"15px\"\n color=\"green-base\"\n stripe\n />\n </div>\n </template>\n <template v-else>\n <slot name=\"missing\">\n <component\n :is=\"missingIcon\"\n class=\"w-full h-full p-2 text-gray-medium\"\n />\n </slot>\n </template>\n\n <div class=\"absolute top-1 right-1 flex items-center justify-between space-x-1\">\n <QBtn\n v-if=\"downloadable && computedImage?.url\"\n size=\"sm\"\n class=\"!p-1 opacity-70 hover:opacity-100\"\n :class=\"downloadButtonClass\"\n @click.stop=\"download(computedImage.url)\"\n >\n <DownloadIcon class=\"w-4 h-5\" />\n </QBtn>\n\n <QBtn\n v-if=\"removable\"\n size=\"sm\"\n class=\"bg-red-dark text-white !p-1 opacity-50 hover:opacity-100\"\n @click.stop=\"onRemove\"\n >\n <div v-if=\"isConfirmingRemove\" class=\"font-bold text-[1rem] leading-[1.2rem]\">?</div>\n <RemoveIcon v-else class=\"w-3\" />\n </QBtn>\n </div>\n\n <FullScreenCarouselDialog\n v-if=\"showPreview && !disabled\"\n :files=\"relatedFiles || [computedImage]\"\n :default-slide=\"computedImage.id\"\n @close=\"showPreview = false\"\n />\n </div>\n</template>\n\n<script setup>\nimport { DocumentTextIcon as TextFileIcon, DownloadIcon, PlayIcon } from '@heroicons/vue/outline';\nimport { computed, ref } from 'vue';\nimport { download } from '../../../helpers';\nimport { ImageIcon, PdfIcon, TrashIcon as RemoveIcon } from '../../../svg';\nimport { FullScreenCarouselDialog } from '../Dialogs';\n\nconst emit = defineEmits(['remove']);\nconst props = defineProps({\n src: {\n type: String,\n default: ''\n },\n image: {\n type: Object,\n default: null\n },\n relatedFiles: {\n type: Array,\n default: null\n },\n missingIcon: {\n type: [Function, Object],\n default: ImageIcon\n },\n downloadButtonClass: {\n type: String,\n default: 'bg-blue-600 text-white'\n },\n downloadable: Boolean,\n removable: Boolean,\n disabled: Boolean,\n square: Boolean\n});\n\nconst showPreview = ref(false);\nconst computedImage = computed(() => {\n if (props.image) {\n return props.image;\n } else if (props.src) {\n return {\n id: props.src,\n url: props.src,\n type: 'image/' + props.src.split('.').pop().toLowerCase()\n };\n }\n return null;\n});\nconst mimeType = computed(\n () => computedImage.value.type || computedImage.value.mime\n);\nconst isImage = computed(() => mimeType.value.match(/^image\\//));\nconst isVideo = computed(() => mimeType.value.match(/^video\\//));\nconst isPdf = computed(() => mimeType.value.match(/^application\\/pdf/));\nconst previewUrl = computed(\n () => computedImage.value.transcodes?.compress?.url || computedImage.value.blobUrl || computedImage.value.url\n);\nconst thumbUrl = computed(() => {\n return computedImage.value.transcodes?.thumb?.url;\n});\nconst isPreviewable = computed(() => {\n return !!thumbUrl.value || isVideo.value || isImage.value;\n});\nconst isConfirmingRemove = ref(false);\nfunction onRemove() {\n if (!isConfirmingRemove.value) {\n isConfirmingRemove.value = true;\n setTimeout(() => {\n isConfirmingRemove.value = false;\n }, 2000);\n } else {\n emit('remove');\n }\n}\n</script>\n\n<style scoped lang=\"scss\">\n.action-button {\n position: absolute;\n bottom: 1.5em;\n right: 1em;\n z-index: 1;\n}\n\n.play-button {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n</style>\n","<template>\n <img\n v-if=\"isString\"\n :src=\"resolvedSvg\"\n :alt=\"alt\"\n />\n <component :is=\"resolvedSvg\" v-else />\n</template>\n<script setup>\nimport { computed } from \"vue\";\n\nconst props = defineProps({\n svg: {\n type: [String, Object, Function],\n required: true\n },\n alt: {\n type: String,\n default: \"\"\n }\n});\n\nconst resolvedSvg = computed(() => props.svg.default ? props.svg.default : props.svg);\nconst isString = computed(() => typeof resolvedSvg.value === \"string\");\n</script>\n","<template>\n <div\n class=\"collapsable-sidebar overflow-x-hidden overflow-y-scroll relative\"\n :class=\"{\n 'is-collapsed': isCollapsed,\n 'is-right-side': rightSide,\n [displayClass]: true,\n }\"\n :style=\"style\"\n >\n <div class=\"flex-grow max-w-full\">\n <slot :is-collapsed=\"isCollapsed\" />\n </div>\n <template v-if=\"!disabled && (!hideToggleOnCollapse || !isCollapsed)\">\n <div\n v-if=\"!toggleAtTop\"\n class=\"flex w-full p-4\"\n :class=\"rightSide ? 'justify-start' : 'justify-end'\"\n >\n <slot name=\"toggle\">\n <QBtn\n class=\"btn-secondary\"\n @click=\"toggleCollapse\"\n >\n <ToggleIcon\n class=\"w-5 transition-all\"\n :class=\"{ 'rotate-180': rightSide ? !isCollapsed : isCollapsed }\"\n />\n </QBtn>\n </slot>\n </div>\n <div\n v-else\n class=\"absolute top-0 right-0 cursor-pointer p-2\"\n :class=\"toggleClass\"\n @click=\"toggleCollapse\"\n >\n <ToggleIcon\n class=\"w-5 transition-all\"\n :class=\"{ 'rotate-180': rightSide ? !isCollapsed : isCollapsed }\"\n />\n </div>\n </template>\n </div>\n</template>\n<script setup>\nimport { ChevronLeftIcon as ToggleIcon } from '@heroicons/vue/outline';\nimport { computed, onMounted, ref, watch } from 'vue';\n\nconst emit = defineEmits(['collapse', 'update:collapse']);\nconst props = defineProps({\n rightSide: Boolean,\n displayClass: {\n type: String,\n default: 'flex flex-col'\n },\n maxWidth: {\n type: String,\n default: '13.5rem'\n },\n minWidth: {\n type: String,\n default: '5.5rem'\n },\n disabled: Boolean,\n collapse: Boolean,\n name: {\n type: String,\n default: 'sidebar'\n },\n toggleAtTop: Boolean,\n toggleClass: {\n type: String,\n default: ''\n },\n hideToggleOnCollapse: Boolean\n});\n\nconst isCollapsed = ref(props.collapse);\n\nconst stored = localStorage.getItem(props.name + '-is-collapsed');\n\nif (stored !== null) {\n isCollapsed.value = stored === '1';\n}\nfunction toggleCollapse() {\n setCollapse(!isCollapsed.value);\n emit('collapse', isCollapsed.value);\n emit('update:collapse', isCollapsed.value);\n}\n\nfunction setCollapse(state) {\n isCollapsed.value = state;\n localStorage.setItem(props.name + '-is-collapsed', isCollapsed.value ? '1' : '');\n}\n\nonMounted(() => {\n emit('collapse', isCollapsed.value);\n emit('update:collapse', isCollapsed.value);\n});\nconst style = computed(() => {\n return {\n width: isCollapsed.value ? props.minWidth : props.maxWidth\n };\n});\n\nwatch(() => props.collapse, () => {\n setCollapse(props.collapse);\n});\n</script>\n\n<style\n scoped\n lang=\"scss\"\n>\n.collapsable-sidebar {\n @apply overflow-y-auto scroll-smooth flex-shrink-0 border-r border-gray-200 transition-all;\n}\n</style>\n","<template>\n <QDialog\n v-model=\"isShowing\"\n maximized\n :position=\"position\"\n :seamless=\"seamless\"\n :class=\"{'hide-backdrop': !overlay}\"\n >\n <div>\n <div\n v-if=\"title\"\n class=\"dialog-title bg-slate-100 text-gray-500 border-gray-200\"\n @click.stop.prevent\n >\n {{ title }}\n </div>\n <div\n class=\"dialog-content bg-white\"\n :class=\"{ [contentClass]: true }\"\n >\n <slot />\n </div>\n </div>\n </QDialog>\n</template>\n\n<script setup>\nimport { computed } from 'vue';\n\nconst emit = defineEmits(['update:show']);\n\nconst props = defineProps({\n show: Boolean,\n seamless: Boolean,\n overlay: Boolean,\n position: {\n type: String,\n default: 'bottom'\n },\n contentClass: {\n type: String,\n default: 'py-8 px-12'\n },\n title: {\n type: String,\n default: 'Edit'\n }\n});\n\nconst isShowing = computed({\n get: () => props.show,\n set: (value) => emit('update:show', value)\n});\n</script>\n\n<style\n lang=\"scss\"\n scoped\n>\n.dialog-title {\n @apply font-medium uppercase text-xs px-6 py-3 border-b rounded-t-md;\n font-family: \"Roboto\", sans-serif;\n letter-spacing: 0.05em;\n box-shadow: 0px -4px 12px rgba(0, 0, 0, 0.25);\n}\n\n.dialog-content {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);\n}\n</style>\n","<script>\nconst RenderVnode = (props) => props.vnode;\nRenderVnode.props = { vnode: { type: Object, required: true } };\nexport default RenderVnode;\n</script>\n","<template>\n <div>\n <RenderVnode\n v-if=\"activeActionVnode\"\n :vnode=\"activeActionVnode.vnode\"\n :is-saving=\"isSaving\"\n @confirm=\"onConfirm\"\n @close=\"activeActionVnode.cancel\"\n />\n </div>\n</template>\n<script setup>\nimport { ref } from 'vue';\nimport { activeActionVnode } from '../../../helpers';\nimport RenderVnode from './RenderVnode';\n\nconst isSaving = ref(false);\nasync function onConfirm(input) {\n isSaving.value = true;\n await activeActionVnode.value.confirm(input);\n isSaving.value = false;\n}\n</script>\n","<template>\n <Component\n v-if=\"content\"\n :is=\"resolvedComponent.is\"\n v-bind=\"{...resolvedComponent.props, ...overrideProps}\"\n @action=\"$emit('action', $event)\"\n >{{ content }}</Component>\n <Component\n v-else\n :is=\"resolvedComponent.is\"\n v-bind=\"{...resolvedComponent.props, ...overrideProps}\"\n @action=\"$emit('action', $event)\"\n />\n</template>\n<script setup>\nimport { computed } from 'vue';\n\ndefineEmits(['action']);\nconst props = defineProps({\n component: {\n type: [Function, Object],\n required: true\n },\n params: {\n type: Array,\n default: () => []\n },\n overrideProps: {\n type: Object,\n default: () => ({})\n }\n});\n\nconst content = computed(() => resolvedComponent.value?.value || resolvedComponent.value?.props?.text);\nconst resolvedComponent = computed(() => {\n if (typeof props.component === 'function') {\n return props.component(...props.params);\n }\n return props.component;\n});\n</script>\n","<template>\n <a\n class=\"p-3 actionable\"\n :class=\"{'opacity-50 cursor-not-allowed': disabled}\"\n >\n <QTooltip v-if=\"$slots.tooltip || tooltip\">\n <slot name=\"tooltip\">{{ tooltip }}</slot>\n </QTooltip>\n <Transition\n mode=\"out-in\"\n :duration=\"150\"\n >\n <RenderComponent\n v-if=\"loading\"\n :component=\"loadingComponent\"\n />\n <MenuIcon\n v-else\n class=\"w-4 text-black\"\n />\n </Transition>\n <QMenu\n v-if=\"!disabled\"\n auto-close\n >\n <QList>\n <template v-for=\"item in items\">\n <a\n v-if=\"item.url\"\n :key=\"item.url\"\n class=\"q-item\"\n target=\"_blank\"\n :href=\"item.url\"\n :class=\"item.class\"\n >\n {{ item.label }}\n </a>\n <QItem\n v-else\n :key=\"item.name || item.action\"\n clickable\n :class=\"item.class\"\n @click=\"onAction(item)\"\n >\n {{ item.label }}\n </QItem>\n </template>\n </QList>\n </QMenu>\n </a>\n</template>\n<script setup>\nimport { DotsVerticalIcon as MenuIcon } from '@heroicons/vue/outline';\nimport { QSpinner } from 'quasar';\nimport { RenderComponent } from '../Tools';\n\nconst emit = defineEmits(['action', 'action-item']);\ndefineProps({\n items: {\n type: Array,\n required: true,\n validator(items) {\n return items.every((item) => item.url || item.action || item.name);\n }\n },\n tooltip: {\n type: String,\n default: null\n },\n disabled: Boolean,\n loading: Boolean,\n loadingComponent: {\n type: [Function, Object],\n default: () => ({\n is: QSpinner,\n props: { class: 'w-4 h-4 text-black' }\n })\n }\n});\n\nfunction onAction(item) {\n emit('action', item.name || item.action);\n emit('action-item', item);\n}\n</script>\n","<template>\n <QTooltip\n class=\"interactive-tooltip\"\n ref=\"tooltipBox\"\n v-model=\"show\"\n no-parent-event\n @mouseenter=\"onEnterTooltip\"\n @mouseleave=\"onLeaveTooltip\"\n :transition-duration=\"200\"\n >\n <slot>{{ tooltip }}</slot>\n </QTooltip>\n</template>\n<script setup>\nimport { onMounted, ref } from 'vue';\n\ndefineProps({ tooltip: { type: String, default: '' } });\nconst show = ref(false);\nconst tooltipBox = ref(null);\nconst isHovering = ref(false);\nconst isHoveringParent = ref(false);\nlet timeout = null;\nonMounted(() => {\n tooltipBox.value.$el.parentNode.addEventListener('mouseover', onEnterParent);\n tooltipBox.value.$el.parentNode.addEventListener('mouseleave', onLeaveParent);\n});\nfunction onEnterParent() {\n show.value = true;\n isHoveringParent.value = true;\n if (timeout) clearTimeout(timeout);\n}\nfunction onLeaveParent() {\n isHoveringParent.value = false;\n if (show.value) delayClose();\n}\nfunction onEnterTooltip() {\n isHovering.value = true;\n show.value = true;\n if (timeout) clearTimeout(timeout);\n}\nfunction onLeaveTooltip() {\n isHovering.value = false;\n if (show.value) delayClose();\n}\nfunction delayClose() {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n if (isHovering.value || isHoveringParent.value) {\n delayClose();\n } else {\n show.value = false;\n }\n }, 200);\n}\n\n</script>\n<style lang=\"scss\">\nbody .q-tooltip {\n &.interactive-tooltip {\n pointer-events: auto !important;\n background: white;\n color: inherit;\n box-shadow: 0 0 10px 3px rgba(0, 0, 0, 0.2);\n }\n}\n</style>\n","function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\n/*!\n * GSAP 3.12.5\n * https://gsap.com\n *\n * @license Copyright 2008-2024, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license or for\n * Club GSAP members, the agreement issued with that membership.\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nvar _config = {\n autoSleep: 120,\n force3D: \"auto\",\n nullTargetWarn: 1,\n units: {\n lineHeight: \"\"\n }\n},\n _defaults = {\n duration: .5,\n overwrite: false,\n delay: 0\n},\n _suppressOverwrites,\n _reverting,\n _context,\n _bigNum = 1e8,\n _tinyNum = 1 / _bigNum,\n _2PI = Math.PI * 2,\n _HALF_PI = _2PI / 4,\n _gsID = 0,\n _sqrt = Math.sqrt,\n _cos = Math.cos,\n _sin = Math.sin,\n _isString = function _isString(value) {\n return typeof value === \"string\";\n},\n _isFunction = function _isFunction(value) {\n return typeof value === \"function\";\n},\n _isNumber = function _isNumber(value) {\n return typeof value === \"number\";\n},\n _isUndefined = function _isUndefined(value) {\n return typeof value === \"undefined\";\n},\n _isObject = function _isObject(value) {\n return typeof value === \"object\";\n},\n _isNotFalse = function _isNotFalse(value) {\n return value !== false;\n},\n _windowExists = function _windowExists() {\n return typeof window !== \"undefined\";\n},\n _isFuncOrString = function _isFuncOrString(value) {\n return _isFunction(value) || _isString(value);\n},\n _isTypedArray = typeof ArrayBuffer === \"function\" && ArrayBuffer.isView || function () {},\n // note: IE10 has ArrayBuffer, but NOT ArrayBuffer.isView().\n_isArray = Array.isArray,\n _strictNumExp = /(?:-?\\.?\\d|\\.)+/gi,\n //only numbers (including negatives and decimals) but NOT relative values.\n_numExp = /[-+=.]*\\d+[.e\\-+]*\\d*[e\\-+]*\\d*/g,\n //finds any numbers, including ones that start with += or -=, negative numbers, and ones in scientific notation like 1e-8.\n_numWithUnitExp = /[-+=.]*\\d+[.e-]*\\d*[a-z%]*/g,\n _complexStringNumExp = /[-+=.]*\\d+\\.?\\d*(?:e-|e\\+)?\\d*/gi,\n //duplicate so that while we're looping through matches from exec(), it doesn't contaminate the lastIndex of _numExp which we use to search for colors too.\n_relExp = /[+-]=-?[.\\d]+/,\n _delimitedValueExp = /[^,'\"\\[\\]\\s]+/gi,\n // previously /[#\\-+.]*\\b[a-z\\d\\-=+%.]+/gi but didn't catch special characters.\n_unitExp = /^[+\\-=e\\s\\d]*\\d+[.\\d]*([a-z]*|%)\\s*$/i,\n _globalTimeline,\n _win,\n _coreInitted,\n _doc,\n _globals = {},\n _installScope = {},\n _coreReady,\n _install = function _install(scope) {\n return (_installScope = _merge(scope, _globals)) && gsap;\n},\n _missingPlugin = function _missingPlugin(property, value) {\n return console.warn(\"Invalid property\", property, \"set to\", value, \"Missing plugin? gsap.registerPlugin()\");\n},\n _warn = function _warn(message, suppress) {\n return !suppress && console.warn(message);\n},\n _addGlobal = function _addGlobal(name, obj) {\n return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals;\n},\n _emptyFunc = function _emptyFunc() {\n return 0;\n},\n _startAtRevertConfig = {\n suppressEvents: true,\n isStart: true,\n kill: false\n},\n _revertConfigNoKill = {\n suppressEvents: true,\n kill: false\n},\n _revertConfig = {\n suppressEvents: true\n},\n _reservedProps = {},\n _lazyTweens = [],\n _lazyLookup = {},\n _lastRenderedFrame,\n _plugins = {},\n _effects = {},\n _nextGCFrame = 30,\n _harnessPlugins = [],\n _callbackNames = \"\",\n _harness = function _harness(targets) {\n var target = targets[0],\n harnessPlugin,\n i;\n _isObject(target) || _isFunction(target) || (targets = [targets]);\n\n if (!(harnessPlugin = (target._gsap || {}).harness)) {\n // find the first target with a harness. We assume targets passed into an animation will be of similar type, meaning the same kind of harness can be used for them all (performance optimization)\n i = _harnessPlugins.length;\n\n while (i-- && !_harnessPlugins[i].targetTest(target)) {}\n\n harnessPlugin = _harnessPlugins[i];\n }\n\n i = targets.length;\n\n while (i--) {\n targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1);\n }\n\n return targets;\n},\n _getCache = function _getCache(target) {\n return target._gsap || _harness(toArray(target))[0]._gsap;\n},\n _getProperty = function _getProperty(target, property, v) {\n return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v;\n},\n _forEachName = function _forEachName(names, func) {\n return (names = names.split(\",\")).forEach(func) || names;\n},\n //split a comma-delimited list of names into an array, then run a forEach() function and return the split array (this is just a way to consolidate/shorten some code).\n_round = function _round(value) {\n return Math.round(value * 100000) / 100000 || 0;\n},\n _roundPrecise = function _roundPrecise(value) {\n return Math.round(value * 10000000) / 10000000 || 0;\n},\n // increased precision mostly for timing values.\n_parseRelative = function _parseRelative(start, value) {\n var operator = value.charAt(0),\n end = parseFloat(value.substr(2));\n start = parseFloat(start);\n return operator === \"+\" ? start + end : operator === \"-\" ? start - end : operator === \"*\" ? start * end : start / end;\n},\n _arrayContainsAny = function _arrayContainsAny(toSearch, toFind) {\n //searches one array to find matches for any of the items in the toFind array. As soon as one is found, it returns true. It does NOT return all the matches; it's simply a boolean search.\n var l = toFind.length,\n i = 0;\n\n for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l;) {}\n\n return i < l;\n},\n _lazyRender = function _lazyRender() {\n var l = _lazyTweens.length,\n a = _lazyTweens.slice(0),\n i,\n tween;\n\n _lazyLookup = {};\n _lazyTweens.length = 0;\n\n for (i = 0; i < l; i++) {\n tween = a[i];\n tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0);\n }\n},\n _lazySafeRender = function _lazySafeRender(animation, time, suppressEvents, force) {\n _lazyTweens.length && !_reverting && _lazyRender();\n animation.render(time, suppressEvents, force || _reverting && time < 0 && (animation._initted || animation._startAt));\n _lazyTweens.length && !_reverting && _lazyRender(); //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.\n},\n _numericIfPossible = function _numericIfPossible(value) {\n var n = parseFloat(value);\n return (n || n === 0) && (value + \"\").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value;\n},\n _passThrough = function _passThrough(p) {\n return p;\n},\n _setDefaults = function _setDefaults(obj, defaults) {\n for (var p in defaults) {\n p in obj || (obj[p] = defaults[p]);\n }\n\n return obj;\n},\n _setKeyframeDefaults = function _setKeyframeDefaults(excludeDuration) {\n return function (obj, defaults) {\n for (var p in defaults) {\n p in obj || p === \"duration\" && excludeDuration || p === \"ease\" || (obj[p] = defaults[p]);\n }\n };\n},\n _merge = function _merge(base, toMerge) {\n for (var p in toMerge) {\n base[p] = toMerge[p];\n }\n\n return base;\n},\n _mergeDeep = function _mergeDeep(base, toMerge) {\n for (var p in toMerge) {\n p !== \"__proto__\" && p !== \"constructor\" && p !== \"prototype\" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]);\n }\n\n return base;\n},\n _copyExcluding = function _copyExcluding(obj, excluding) {\n var copy = {},\n p;\n\n for (p in obj) {\n p in excluding || (copy[p] = obj[p]);\n }\n\n return copy;\n},\n _inheritDefaults = function _inheritDefaults(vars) {\n var parent = vars.parent || _globalTimeline,\n func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults;\n\n if (_isNotFalse(vars.inherit)) {\n while (parent) {\n func(vars, parent.vars.defaults);\n parent = parent.parent || parent._dp;\n }\n }\n\n return vars;\n},\n _arraysMatch = function _arraysMatch(a1, a2) {\n var i = a1.length,\n match = i === a2.length;\n\n while (match && i-- && a1[i] === a2[i]) {}\n\n return i < 0;\n},\n _addLinkedListItem = function _addLinkedListItem(parent, child, firstProp, lastProp, sortBy) {\n if (firstProp === void 0) {\n firstProp = \"_first\";\n }\n\n if (lastProp === void 0) {\n lastProp = \"_last\";\n }\n\n var prev = parent[lastProp],\n t;\n\n if (sortBy) {\n t = child[sortBy];\n\n while (prev && prev[sortBy] > t) {\n prev = prev._prev;\n }\n }\n\n if (prev) {\n child._next = prev._next;\n prev._next = child;\n } else {\n child._next = parent[firstProp];\n parent[firstProp] = child;\n }\n\n if (child._next) {\n child._next._prev = child;\n } else {\n parent[lastProp] = child;\n }\n\n child._prev = prev;\n child.parent = child._dp = parent;\n return child;\n},\n _removeLinkedListItem = function _removeLinkedListItem(parent, child, firstProp, lastProp) {\n if (firstProp === void 0) {\n firstProp = \"_first\";\n }\n\n if (lastProp === void 0) {\n lastProp = \"_last\";\n }\n\n var prev = child._prev,\n next = child._next;\n\n if (prev) {\n prev._next = next;\n } else if (parent[firstProp] === child) {\n parent[firstProp] = next;\n }\n\n if (next) {\n next._prev = prev;\n } else if (parent[lastProp] === child) {\n parent[lastProp] = prev;\n }\n\n child._next = child._prev = child.parent = null; // don't delete the _dp just so we can revert if necessary. But parent should be null to indicate the item isn't in a linked list.\n},\n _removeFromParent = function _removeFromParent(child, onlyIfParentHasAutoRemove) {\n child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove && child.parent.remove(child);\n child._act = 0;\n},\n _uncache = function _uncache(animation, child) {\n if (animation && (!child || child._end > animation._dur || child._start < 0)) {\n // performance optimization: if a child animation is passed in we should only uncache if that child EXTENDS the animation (its end time is beyond the end)\n var a = animation;\n\n while (a) {\n a._dirty = 1;\n a = a.parent;\n }\n }\n\n return animation;\n},\n _recacheAncestors = function _recacheAncestors(animation) {\n var parent = animation.parent;\n\n while (parent && parent.parent) {\n //sometimes we must force a re-sort of all children and update the duration/totalDuration of all ancestor timelines immediately in case, for example, in the middle of a render loop, one tween alters another tween's timeScale which shoves its startTime before 0, forcing the parent timeline to shift around and shiftChildren() which could affect that next tween's render (startTime). Doesn't matter for the root timeline though.\n parent._dirty = 1;\n parent.totalDuration();\n parent = parent.parent;\n }\n\n return animation;\n},\n _rewindStartAt = function _rewindStartAt(tween, totalTime, suppressEvents, force) {\n return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force));\n},\n _hasNoPausedAncestors = function _hasNoPausedAncestors(animation) {\n return !animation || animation._ts && _hasNoPausedAncestors(animation.parent);\n},\n _elapsedCycleDuration = function _elapsedCycleDuration(animation) {\n return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0;\n},\n // feed in the totalTime and cycleDuration and it'll return the cycle (iteration minus 1) and if the playhead is exactly at the very END, it will NOT bump up to the next cycle.\n_animationCycle = function _animationCycle(tTime, cycleDuration) {\n var whole = Math.floor(tTime /= cycleDuration);\n return tTime && whole === tTime ? whole - 1 : whole;\n},\n _parentToChildTotalTime = function _parentToChildTotalTime(parentTime, child) {\n return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur);\n},\n _setEnd = function _setEnd(animation) {\n return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0));\n},\n _alignPlayhead = function _alignPlayhead(animation, totalTime) {\n // adjusts the animation's _start and _end according to the provided totalTime (only if the parent's smoothChildTiming is true and the animation isn't paused). It doesn't do any rendering or forcing things back into parent timelines, etc. - that's what totalTime() is for.\n var parent = animation._dp;\n\n if (parent && parent.smoothChildTiming && animation._ts) {\n animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts));\n\n _setEnd(animation);\n\n parent._dirty || _uncache(parent, animation); //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here.\n }\n\n return animation;\n},\n\n/*\n_totalTimeToTime = (clampedTotalTime, duration, repeat, repeatDelay, yoyo) => {\n\tlet cycleDuration = duration + repeatDelay,\n\t\ttime = _round(clampedTotalTime % cycleDuration);\n\tif (time > duration) {\n\t\ttime = duration;\n\t}\n\treturn (yoyo && (~~(clampedTotalTime / cycleDuration) & 1)) ? duration - time : time;\n},\n*/\n_postAddChecks = function _postAddChecks(timeline, child) {\n var t;\n\n if (child._time || !child._dur && child._initted || child._start < timeline._time && (child._dur || !child.add)) {\n // in case, for example, the _start is moved on a tween that has already rendered, or if it's being inserted into a timeline BEFORE where the playhead is currently. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. Special case: if it's a timeline (has .add() method) and no duration, we can skip rendering because the user may be populating it AFTER adding it to a parent timeline (unconventional, but possible, and we wouldn't want it to get removed if the parent's autoRemoveChildren is true).\n t = _parentToChildTotalTime(timeline.rawTime(), child);\n\n if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) {\n child.render(t, true);\n }\n } //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.\n\n\n if (_uncache(timeline, child)._dp && timeline._initted && timeline._time >= timeline._dur && timeline._ts) {\n //in case any of the ancestors had completed but should now be enabled...\n if (timeline._dur < timeline.duration()) {\n t = timeline;\n\n while (t._dp) {\n t.rawTime() >= 0 && t.totalTime(t._tTime); //moves the timeline (shifts its startTime) if necessary, and also enables it. If it's currently zero, though, it may not be scheduled to render until later so there's no need to force it to align with the current playhead position. Only move to catch up with the playhead.\n\n t = t._dp;\n }\n }\n\n timeline._zTime = -_tinyNum; // helps ensure that the next render() will be forced (crossingStart = true in render()), even if the duration hasn't changed (we're adding a child which would need to get rendered). Definitely an edge case. Note: we MUST do this AFTER the loop above where the totalTime() might trigger a render() because this _addToTimeline() method gets called from the Animation constructor, BEFORE tweens even record their targets, etc. so we wouldn't want things to get triggered in the wrong order.\n }\n},\n _addToTimeline = function _addToTimeline(timeline, child, position, skipChecks) {\n child.parent && _removeFromParent(child);\n child._start = _roundPrecise((_isNumber(position) ? position : position || timeline !== _globalTimeline ? _parsePosition(timeline, position, child) : timeline._time) + child._delay);\n child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0));\n\n _addLinkedListItem(timeline, child, \"_first\", \"_last\", timeline._sort ? \"_start\" : 0);\n\n _isFromOrFromStart(child) || (timeline._recent = child);\n skipChecks || _postAddChecks(timeline, child);\n timeline._ts < 0 && _alignPlayhead(timeline, timeline._tTime); // if the timeline is reversed and the new child makes it longer, we may need to adjust the parent's _start (push it back)\n\n return timeline;\n},\n _scrollTrigger = function _scrollTrigger(animation, trigger) {\n return (_globals.ScrollTrigger || _missingPlugin(\"scrollTrigger\", trigger)) && _globals.ScrollTrigger.create(trigger, animation);\n},\n _attemptInitTween = function _attemptInitTween(tween, time, force, suppressEvents, tTime) {\n _initTween(tween, time, tTime);\n\n if (!tween._initted) {\n return 1;\n }\n\n if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) {\n _lazyTweens.push(tween);\n\n tween._lazy = [tTime, suppressEvents];\n return 1;\n }\n},\n _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart(_ref) {\n var parent = _ref.parent;\n return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart(parent));\n},\n // check parent's _lock because when a timeline repeats/yoyos and does its artificial wrapping, we shouldn't force the ratio back to 0\n_isFromOrFromStart = function _isFromOrFromStart(_ref2) {\n var data = _ref2.data;\n return data === \"isFromStart\" || data === \"isStart\";\n},\n _renderZeroDurationTween = function _renderZeroDurationTween(tween, totalTime, suppressEvents, force) {\n var prevRatio = tween.ratio,\n ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1,\n // if the tween or its parent is reversed and the totalTime is 0, we should go to a ratio of 0. Edge case: if a from() or fromTo() stagger tween is placed later in a timeline, the \"startAt\" zero-duration tween could initially render at a time when the parent timeline's playhead is technically BEFORE where this tween is, so make sure that any \"from\" and \"fromTo\" startAt tweens are rendered the first time at a ratio of 1.\n repeatDelay = tween._rDelay,\n tTime = 0,\n pt,\n iteration,\n prevIteration;\n\n if (repeatDelay && tween._repeat) {\n // in case there's a zero-duration tween that has a repeat with a repeatDelay\n tTime = _clamp(0, tween._tDur, totalTime);\n iteration = _animationCycle(tTime, repeatDelay);\n tween._yoyo && iteration & 1 && (ratio = 1 - ratio);\n\n if (iteration !== _animationCycle(tween._tTime, repeatDelay)) {\n // if iteration changed\n prevRatio = 1 - ratio;\n tween.vars.repeatRefresh && tween._initted && tween.invalidate();\n }\n }\n\n if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) {\n if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) {\n // if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.\n return;\n }\n\n prevIteration = tween._zTime;\n tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0); // when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.\n\n suppressEvents || (suppressEvents = totalTime && !prevIteration); // if it was rendered previously at exactly 0 (_zTime) and now the playhead is moving away, DON'T fire callbacks otherwise they'll seem like duplicates.\n\n tween.ratio = ratio;\n tween._from && (ratio = 1 - ratio);\n tween._time = 0;\n tween._tTime = tTime;\n pt = tween._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n\n totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true);\n tween._onUpdate && !suppressEvents && _callback(tween, \"onUpdate\");\n tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, \"onRepeat\");\n\n if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) {\n ratio && _removeFromParent(tween, 1);\n\n if (!suppressEvents && !_reverting) {\n _callback(tween, ratio ? \"onComplete\" : \"onReverseComplete\", true);\n\n tween._prom && tween._prom();\n }\n }\n } else if (!tween._zTime) {\n tween._zTime = totalTime;\n }\n},\n _findNextPauseTween = function _findNextPauseTween(animation, prevTime, time) {\n var child;\n\n if (time > prevTime) {\n child = animation._first;\n\n while (child && child._start <= time) {\n if (child.data === \"isPause\" && child._start > prevTime) {\n return child;\n }\n\n child = child._next;\n }\n } else {\n child = animation._last;\n\n while (child && child._start >= time) {\n if (child.data === \"isPause\" && child._start < prevTime) {\n return child;\n }\n\n child = child._prev;\n }\n }\n},\n _setDuration = function _setDuration(animation, duration, skipUncache, leavePlayhead) {\n var repeat = animation._repeat,\n dur = _roundPrecise(duration) || 0,\n totalProgress = animation._tTime / animation._tDur;\n totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur);\n animation._dur = dur;\n animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat);\n totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress);\n animation.parent && _setEnd(animation);\n skipUncache || _uncache(animation.parent, animation);\n return animation;\n},\n _onUpdateTotalDuration = function _onUpdateTotalDuration(animation) {\n return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur);\n},\n _zeroPosition = {\n _start: 0,\n endTime: _emptyFunc,\n totalDuration: _emptyFunc\n},\n _parsePosition = function _parsePosition(animation, position, percentAnimation) {\n var labels = animation.labels,\n recent = animation._recent || _zeroPosition,\n clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur,\n //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead.\n i,\n offset,\n isPercent;\n\n if (_isString(position) && (isNaN(position) || position in labels)) {\n //if the string is a number like \"1\", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).\n offset = position.charAt(0);\n isPercent = position.substr(-1) === \"%\";\n i = position.indexOf(\"=\");\n\n if (offset === \"<\" || offset === \">\") {\n i >= 0 && (position = position.replace(/=/, \"\"));\n return (offset === \"<\" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1);\n }\n\n if (i < 0) {\n position in labels || (labels[position] = clippedDuration);\n return labels[position];\n }\n\n offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1));\n\n if (isPercent && percentAnimation) {\n offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration();\n }\n\n return i > 1 ? _parsePosition(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset;\n }\n\n return position == null ? clippedDuration : +position;\n},\n _createTweenType = function _createTweenType(type, params, timeline) {\n var isLegacy = _isNumber(params[1]),\n varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1),\n vars = params[varsIndex],\n irVars,\n parent;\n\n isLegacy && (vars.duration = params[1]);\n vars.parent = timeline;\n\n if (type) {\n irVars = vars;\n parent = timeline;\n\n while (parent && !(\"immediateRender\" in irVars)) {\n // inheritance hasn't happened yet, but someone may have set a default in an ancestor timeline. We could do vars.immediateRender = _isNotFalse(_inheritDefaults(vars).immediateRender) but that'd exact a slight performance penalty because _inheritDefaults() also runs in the Tween constructor. We're paying a small kb price here to gain speed.\n irVars = parent.vars.defaults || {};\n parent = _isNotFalse(parent.vars.inherit) && parent.parent;\n }\n\n vars.immediateRender = _isNotFalse(irVars.immediateRender);\n type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1]; // \"from\" vars\n }\n\n return new Tween(params[0], vars, params[varsIndex + 1]);\n},\n _conditionalReturn = function _conditionalReturn(value, func) {\n return value || value === 0 ? func(value) : func;\n},\n _clamp = function _clamp(min, max, value) {\n return value < min ? min : value > max ? max : value;\n},\n getUnit = function getUnit(value, v) {\n return !_isString(value) || !(v = _unitExp.exec(value)) ? \"\" : v[1];\n},\n // note: protect against padded numbers as strings, like \"100.100\". That shouldn't return \"00\" as the unit. If it's numeric, return no unit.\nclamp = function clamp(min, max, value) {\n return _conditionalReturn(value, function (v) {\n return _clamp(min, max, v);\n });\n},\n _slice = [].slice,\n _isArrayLike = function _isArrayLike(value, nonEmpty) {\n return value && _isObject(value) && \"length\" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win;\n},\n _flatten = function _flatten(ar, leaveStrings, accumulator) {\n if (accumulator === void 0) {\n accumulator = [];\n }\n\n return ar.forEach(function (value) {\n var _accumulator;\n\n return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value);\n }) || accumulator;\n},\n //takes any value and returns an array. If it's a string (and leaveStrings isn't true), it'll use document.querySelectorAll() and convert that to an array. It'll also accept iterables like jQuery objects.\ntoArray = function toArray(value, scope, leaveStrings) {\n return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : [];\n},\n selector = function selector(value) {\n value = toArray(value)[0] || _warn(\"Invalid scope\") || {};\n return function (v) {\n var el = value.current || value.nativeElement || value;\n return toArray(v, el.querySelectorAll ? el : el === value ? _warn(\"Invalid scope\") || _doc.createElement(\"div\") : value);\n };\n},\n shuffle = function shuffle(a) {\n return a.sort(function () {\n return .5 - Math.random();\n });\n},\n // alternative that's a bit faster and more reliably diverse but bigger: for (let j, v, i = a.length; i; j = Math.floor(Math.random() * i), v = a[--i], a[i] = a[j], a[j] = v); return a;\n//for distributing values across an array. Can accept a number, a function or (most commonly) a function which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array. Recognizes the following\ndistribute = function distribute(v) {\n if (_isFunction(v)) {\n return v;\n }\n\n var vars = _isObject(v) ? v : {\n each: v\n },\n //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total \"amount\" that's chunked out among them all.\n ease = _parseEase(vars.ease),\n from = vars.from || 0,\n base = parseFloat(vars.base) || 0,\n cache = {},\n isDecimal = from > 0 && from < 1,\n ratios = isNaN(from) || isDecimal,\n axis = vars.axis,\n ratioX = from,\n ratioY = from;\n\n if (_isString(from)) {\n ratioX = ratioY = {\n center: .5,\n edges: .5,\n end: 1\n }[from] || 0;\n } else if (!isDecimal && ratios) {\n ratioX = from[0];\n ratioY = from[1];\n }\n\n return function (i, target, a) {\n var l = (a || vars).length,\n distances = cache[l],\n originX,\n originY,\n x,\n y,\n d,\n j,\n max,\n min,\n wrapAt;\n\n if (!distances) {\n wrapAt = vars.grid === \"auto\" ? 0 : (vars.grid || [1, _bigNum])[1];\n\n if (!wrapAt) {\n max = -_bigNum;\n\n while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {}\n\n wrapAt < l && wrapAt--;\n }\n\n distances = cache[l] = [];\n originX = ratios ? Math.min(wrapAt, l) * ratioX - .5 : from % wrapAt;\n originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - .5 : from / wrapAt | 0;\n max = 0;\n min = _bigNum;\n\n for (j = 0; j < l; j++) {\n x = j % wrapAt - originX;\n y = originY - (j / wrapAt | 0);\n distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === \"y\" ? y : x);\n d > max && (max = d);\n d < min && (min = d);\n }\n\n from === \"random\" && shuffle(distances);\n distances.max = max - min;\n distances.min = min;\n distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === \"y\" ? l / wrapAt : wrapAt) || 0) * (from === \"edges\" ? -1 : 1);\n distances.b = l < 0 ? base - l : base;\n distances.u = getUnit(vars.amount || vars.each) || 0; //unit\n\n ease = ease && l < 0 ? _invertEase(ease) : ease;\n }\n\n l = (distances[i] - distances.min) / distances.max || 0;\n return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u; //round in order to work around floating point errors\n };\n},\n _roundModifier = function _roundModifier(v) {\n //pass in 0.1 get a function that'll round to the nearest tenth, or 5 to round to the closest 5, or 0.001 to the closest 1000th, etc.\n var p = Math.pow(10, ((v + \"\").split(\".\")[1] || \"\").length); //to avoid floating point math errors (like 24 * 0.1 == 2.4000000000000004), we chop off at a specific number of decimal places (much faster than toFixed())\n\n return function (raw) {\n var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p);\n\n return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw)); // n - n % 1 replaces Math.floor() in order to handle negative values properly. For example, Math.floor(-150.00000000000003) is 151!\n };\n},\n snap = function snap(snapTo, value) {\n var isArray = _isArray(snapTo),\n radius,\n is2D;\n\n if (!isArray && _isObject(snapTo)) {\n radius = isArray = snapTo.radius || _bigNum;\n\n if (snapTo.values) {\n snapTo = toArray(snapTo.values);\n\n if (is2D = !_isNumber(snapTo[0])) {\n radius *= radius; //performance optimization so we don't have to Math.sqrt() in the loop.\n }\n } else {\n snapTo = _roundModifier(snapTo.increment);\n }\n }\n\n return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function (raw) {\n is2D = snapTo(raw);\n return Math.abs(is2D - raw) <= radius ? is2D : raw;\n } : function (raw) {\n var x = parseFloat(is2D ? raw.x : raw),\n y = parseFloat(is2D ? raw.y : 0),\n min = _bigNum,\n closest = 0,\n i = snapTo.length,\n dx,\n dy;\n\n while (i--) {\n if (is2D) {\n dx = snapTo[i].x - x;\n dy = snapTo[i].y - y;\n dx = dx * dx + dy * dy;\n } else {\n dx = Math.abs(snapTo[i] - x);\n }\n\n if (dx < min) {\n min = dx;\n closest = i;\n }\n }\n\n closest = !radius || min <= radius ? snapTo[closest] : raw;\n return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw);\n });\n},\n random = function random(min, max, roundingIncrement, returnFunction) {\n return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function () {\n return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + \"\").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * .99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction;\n });\n},\n pipe = function pipe() {\n for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) {\n functions[_key] = arguments[_key];\n }\n\n return function (value) {\n return functions.reduce(function (v, f) {\n return f(v);\n }, value);\n };\n},\n unitize = function unitize(func, unit) {\n return function (value) {\n return func(parseFloat(value)) + (unit || getUnit(value));\n };\n},\n normalize = function normalize(min, max, value) {\n return mapRange(min, max, 0, 1, value);\n},\n _wrapArray = function _wrapArray(a, wrapper, value) {\n return _conditionalReturn(value, function (index) {\n return a[~~wrapper(index)];\n });\n},\n wrap = function wrap(min, max, value) {\n // NOTE: wrap() CANNOT be an arrow function! A very odd compiling bug causes problems (unrelated to GSAP).\n var range = max - min;\n return _isArray(min) ? _wrapArray(min, wrap(0, min.length), max) : _conditionalReturn(value, function (value) {\n return (range + (value - min) % range) % range + min;\n });\n},\n wrapYoyo = function wrapYoyo(min, max, value) {\n var range = max - min,\n total = range * 2;\n return _isArray(min) ? _wrapArray(min, wrapYoyo(0, min.length - 1), max) : _conditionalReturn(value, function (value) {\n value = (total + (value - min) % total) % total || 0;\n return min + (value > range ? total - value : value);\n });\n},\n _replaceRandom = function _replaceRandom(value) {\n //replaces all occurrences of random(...) in a string with the calculated random value. can be a range like random(-100, 100, 5) or an array like random([0, 100, 500])\n var prev = 0,\n s = \"\",\n i,\n nums,\n end,\n isArray;\n\n while (~(i = value.indexOf(\"random(\", prev))) {\n end = value.indexOf(\")\", i);\n isArray = value.charAt(i + 7) === \"[\";\n nums = value.substr(i + 7, end - i - 7).match(isArray ? _delimitedValueExp : _strictNumExp);\n s += value.substr(prev, i - prev) + random(isArray ? nums : +nums[0], isArray ? 0 : +nums[1], +nums[2] || 1e-5);\n prev = end + 1;\n }\n\n return s + value.substr(prev, value.length - prev);\n},\n mapRange = function mapRange(inMin, inMax, outMin, outMax, value) {\n var inRange = inMax - inMin,\n outRange = outMax - outMin;\n return _conditionalReturn(value, function (value) {\n return outMin + ((value - inMin) / inRange * outRange || 0);\n });\n},\n interpolate = function interpolate(start, end, progress, mutate) {\n var func = isNaN(start + end) ? 0 : function (p) {\n return (1 - p) * start + p * end;\n };\n\n if (!func) {\n var isString = _isString(start),\n master = {},\n p,\n i,\n interpolators,\n l,\n il;\n\n progress === true && (mutate = 1) && (progress = null);\n\n if (isString) {\n start = {\n p: start\n };\n end = {\n p: end\n };\n } else if (_isArray(start) && !_isArray(end)) {\n interpolators = [];\n l = start.length;\n il = l - 2;\n\n for (i = 1; i < l; i++) {\n interpolators.push(interpolate(start[i - 1], start[i])); //build the interpolators up front as a performance optimization so that when the function is called many times, it can just reuse them.\n }\n\n l--;\n\n func = function func(p) {\n p *= l;\n var i = Math.min(il, ~~p);\n return interpolators[i](p - i);\n };\n\n progress = end;\n } else if (!mutate) {\n start = _merge(_isArray(start) ? [] : {}, start);\n }\n\n if (!interpolators) {\n for (p in end) {\n _addPropTween.call(master, start, p, \"get\", end[p]);\n }\n\n func = function func(p) {\n return _renderPropTweens(p, master) || (isString ? start.p : start);\n };\n }\n }\n\n return _conditionalReturn(progress, func);\n},\n _getLabelInDirection = function _getLabelInDirection(timeline, fromTime, backward) {\n //used for nextLabel() and previousLabel()\n var labels = timeline.labels,\n min = _bigNum,\n p,\n distance,\n label;\n\n for (p in labels) {\n distance = labels[p] - fromTime;\n\n if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) {\n label = p;\n min = distance;\n }\n }\n\n return label;\n},\n _callback = function _callback(animation, type, executeLazyFirst) {\n var v = animation.vars,\n callback = v[type],\n prevContext = _context,\n context = animation._ctx,\n params,\n scope,\n result;\n\n if (!callback) {\n return;\n }\n\n params = v[type + \"Params\"];\n scope = v.callbackScope || animation;\n executeLazyFirst && _lazyTweens.length && _lazyRender(); //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values.\n\n context && (_context = context);\n result = params ? callback.apply(scope, params) : callback.call(scope);\n _context = prevContext;\n return result;\n},\n _interrupt = function _interrupt(animation) {\n _removeFromParent(animation);\n\n animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting);\n animation.progress() < 1 && _callback(animation, \"onInterrupt\");\n return animation;\n},\n _quickTween,\n _registerPluginQueue = [],\n _createPlugin = function _createPlugin(config) {\n if (!config) return;\n config = !config.name && config[\"default\"] || config; // UMD packaging wraps things oddly, so for example MotionPathHelper becomes {MotionPathHelper:MotionPathHelper, default:MotionPathHelper}.\n\n if (_windowExists() || config.headless) {\n // edge case: some build tools may pass in a null/undefined value\n var name = config.name,\n isFunc = _isFunction(config),\n Plugin = name && !isFunc && config.init ? function () {\n this._props = [];\n } : config,\n //in case someone passes in an object that's not a plugin, like CustomEase\n instanceDefaults = {\n init: _emptyFunc,\n render: _renderPropTweens,\n add: _addPropTween,\n kill: _killPropTweensOf,\n modifier: _addPluginModifier,\n rawVars: 0\n },\n statics = {\n targetTest: 0,\n get: 0,\n getSetter: _getSetter,\n aliases: {},\n register: 0\n };\n\n _wake();\n\n if (config !== Plugin) {\n if (_plugins[name]) {\n return;\n }\n\n _setDefaults(Plugin, _setDefaults(_copyExcluding(config, instanceDefaults), statics)); //static methods\n\n\n _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config, statics))); //instance methods\n\n\n _plugins[Plugin.prop = name] = Plugin;\n\n if (config.targetTest) {\n _harnessPlugins.push(Plugin);\n\n _reservedProps[name] = 1;\n }\n\n name = (name === \"css\" ? \"CSS\" : name.charAt(0).toUpperCase() + name.substr(1)) + \"Plugin\"; //for the global name. \"motionPath\" should become MotionPathPlugin\n }\n\n _addGlobal(name, Plugin);\n\n config.register && config.register(gsap, Plugin, PropTween);\n } else {\n _registerPluginQueue.push(config);\n }\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * COLORS\n * --------------------------------------------------------------------------------------\n */\n_255 = 255,\n _colorLookup = {\n aqua: [0, _255, _255],\n lime: [0, _255, 0],\n silver: [192, 192, 192],\n black: [0, 0, 0],\n maroon: [128, 0, 0],\n teal: [0, 128, 128],\n blue: [0, 0, _255],\n navy: [0, 0, 128],\n white: [_255, _255, _255],\n olive: [128, 128, 0],\n yellow: [_255, _255, 0],\n orange: [_255, 165, 0],\n gray: [128, 128, 128],\n purple: [128, 0, 128],\n green: [0, 128, 0],\n red: [_255, 0, 0],\n pink: [_255, 192, 203],\n cyan: [0, _255, _255],\n transparent: [_255, _255, _255, 0]\n},\n // possible future idea to replace the hard-coded color name values - put this in the ticker.wake() where we set the _doc:\n// let ctx = _doc.createElement(\"canvas\").getContext(\"2d\");\n// _forEachName(\"aqua,lime,silver,black,maroon,teal,blue,navy,white,olive,yellow,orange,gray,purple,green,red,pink,cyan\", color => {ctx.fillStyle = color; _colorLookup[color] = splitColor(ctx.fillStyle)});\n_hue = function _hue(h, m1, m2) {\n h += h < 0 ? 1 : h > 1 ? -1 : 0;\n return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < .5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + .5 | 0;\n},\n splitColor = function splitColor(v, toHSL, forceAlpha) {\n var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0,\n r,\n g,\n b,\n h,\n s,\n l,\n max,\n min,\n d,\n wasHSL;\n\n if (!a) {\n if (v.substr(-1) === \",\") {\n //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:\"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)\" - in this example \"blue,\" has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value.\n v = v.substr(0, v.length - 1);\n }\n\n if (_colorLookup[v]) {\n a = _colorLookup[v];\n } else if (v.charAt(0) === \"#\") {\n if (v.length < 6) {\n //for shorthand like #9F0 or #9F0F (could have alpha)\n r = v.charAt(1);\n g = v.charAt(2);\n b = v.charAt(3);\n v = \"#\" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : \"\");\n }\n\n if (v.length === 9) {\n // hex with alpha, like #fd5e53ff\n a = parseInt(v.substr(1, 6), 16);\n return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255];\n }\n\n v = parseInt(v.substr(1), 16);\n a = [v >> 16, v >> 8 & _255, v & _255];\n } else if (v.substr(0, 3) === \"hsl\") {\n a = wasHSL = v.match(_strictNumExp);\n\n if (!toHSL) {\n h = +a[0] % 360 / 360;\n s = +a[1] / 100;\n l = +a[2] / 100;\n g = l <= .5 ? l * (s + 1) : l + s - l * s;\n r = l * 2 - g;\n a.length > 3 && (a[3] *= 1); //cast as number\n\n a[0] = _hue(h + 1 / 3, r, g);\n a[1] = _hue(h, r, g);\n a[2] = _hue(h - 1 / 3, r, g);\n } else if (~v.indexOf(\"=\")) {\n //if relative values are found, just return the raw strings with the relative prefixes in place.\n a = v.match(_numExp);\n forceAlpha && a.length < 4 && (a[3] = 1);\n return a;\n }\n } else {\n a = v.match(_strictNumExp) || _colorLookup.transparent;\n }\n\n a = a.map(Number);\n }\n\n if (toHSL && !wasHSL) {\n r = a[0] / _255;\n g = a[1] / _255;\n b = a[2] / _255;\n max = Math.max(r, g, b);\n min = Math.min(r, g, b);\n l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0;\n } else {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4;\n h *= 60;\n }\n\n a[0] = ~~(h + .5);\n a[1] = ~~(s * 100 + .5);\n a[2] = ~~(l * 100 + .5);\n }\n\n forceAlpha && a.length < 4 && (a[3] = 1);\n return a;\n},\n _colorOrderData = function _colorOrderData(v) {\n // strips out the colors from the string, finds all the numeric slots (with units) and returns an array of those. The Array also has a \"c\" property which is an Array of the index values where the colors belong. This is to help work around issues where there's a mis-matched order of color/numeric data like drop-shadow(#f00 0px 1px 2px) and drop-shadow(0x 1px 2px #f00). This is basically a helper function used in _formatColors()\n var values = [],\n c = [],\n i = -1;\n v.split(_colorExp).forEach(function (v) {\n var a = v.match(_numWithUnitExp) || [];\n values.push.apply(values, a);\n c.push(i += a.length + 1);\n });\n values.c = c;\n return values;\n},\n _formatColors = function _formatColors(s, toHSL, orderMatchData) {\n var result = \"\",\n colors = (s + result).match(_colorExp),\n type = toHSL ? \"hsla(\" : \"rgba(\",\n i = 0,\n c,\n shell,\n d,\n l;\n\n if (!colors) {\n return s;\n }\n\n colors = colors.map(function (color) {\n return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + \",\" + color[1] + \"%,\" + color[2] + \"%,\" + color[3] : color.join(\",\")) + \")\";\n });\n\n if (orderMatchData) {\n d = _colorOrderData(s);\n c = orderMatchData.c;\n\n if (c.join(result) !== d.c.join(result)) {\n shell = s.replace(_colorExp, \"1\").split(_numWithUnitExp);\n l = shell.length - 1;\n\n for (; i < l; i++) {\n result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + \"0,0,0,0)\" : (d.length ? d : colors.length ? colors : orderMatchData).shift());\n }\n }\n }\n\n if (!shell) {\n shell = s.split(_colorExp);\n l = shell.length - 1;\n\n for (; i < l; i++) {\n result += shell[i] + colors[i];\n }\n }\n\n return result + shell[l];\n},\n _colorExp = function () {\n var s = \"(?:\\\\b(?:(?:rgb|rgba|hsl|hsla)\\\\(.+?\\\\))|\\\\B#(?:[0-9a-f]{3,4}){1,2}\\\\b\",\n //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc.,\n p;\n\n for (p in _colorLookup) {\n s += \"|\" + p + \"\\\\b\";\n }\n\n return new RegExp(s + \")\", \"gi\");\n}(),\n _hslExp = /hsl[a]?\\(/,\n _colorStringFilter = function _colorStringFilter(a) {\n var combined = a.join(\" \"),\n toHSL;\n _colorExp.lastIndex = 0;\n\n if (_colorExp.test(combined)) {\n toHSL = _hslExp.test(combined);\n a[1] = _formatColors(a[1], toHSL);\n a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1])); // make sure the order of numbers/colors match with the END value.\n\n return true;\n }\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * TICKER\n * --------------------------------------------------------------------------------------\n */\n_tickerActive,\n _ticker = function () {\n var _getTime = Date.now,\n _lagThreshold = 500,\n _adjustedLag = 33,\n _startTime = _getTime(),\n _lastUpdate = _startTime,\n _gap = 1000 / 240,\n _nextTime = _gap,\n _listeners = [],\n _id,\n _req,\n _raf,\n _self,\n _delta,\n _i,\n _tick = function _tick(v) {\n var elapsed = _getTime() - _lastUpdate,\n manual = v === true,\n overlap,\n dispatch,\n time,\n frame;\n\n (elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag);\n _lastUpdate += elapsed;\n time = _lastUpdate - _startTime;\n overlap = time - _nextTime;\n\n if (overlap > 0 || manual) {\n frame = ++_self.frame;\n _delta = time - _self.time * 1000;\n _self.time = time = time / 1000;\n _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap);\n dispatch = 1;\n }\n\n manual || (_id = _req(_tick)); //make sure the request is made before we dispatch the \"tick\" event so that timing is maintained. Otherwise, if processing the \"tick\" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise.\n\n if (dispatch) {\n for (_i = 0; _i < _listeners.length; _i++) {\n // use _i and check _listeners.length instead of a variable because a listener could get removed during the loop, and if that happens to an element less than the current index, it'd throw things off in the loop.\n _listeners[_i](time, _delta, frame, v);\n }\n }\n };\n\n _self = {\n time: 0,\n frame: 0,\n tick: function tick() {\n _tick(true);\n },\n deltaRatio: function deltaRatio(fps) {\n return _delta / (1000 / (fps || 60));\n },\n wake: function wake() {\n if (_coreReady) {\n if (!_coreInitted && _windowExists()) {\n _win = _coreInitted = window;\n _doc = _win.document || {};\n _globals.gsap = gsap;\n (_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version);\n\n _install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {});\n\n _registerPluginQueue.forEach(_createPlugin);\n }\n\n _raf = typeof requestAnimationFrame !== \"undefined\" && requestAnimationFrame;\n _id && _self.sleep();\n\n _req = _raf || function (f) {\n return setTimeout(f, _nextTime - _self.time * 1000 + 1 | 0);\n };\n\n _tickerActive = 1;\n\n _tick(2);\n }\n },\n sleep: function sleep() {\n (_raf ? cancelAnimationFrame : clearTimeout)(_id);\n _tickerActive = 0;\n _req = _emptyFunc;\n },\n lagSmoothing: function lagSmoothing(threshold, adjustedLag) {\n _lagThreshold = threshold || Infinity; // zero should be interpreted as basically unlimited\n\n _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold);\n },\n fps: function fps(_fps) {\n _gap = 1000 / (_fps || 240);\n _nextTime = _self.time * 1000 + _gap;\n },\n add: function add(callback, once, prioritize) {\n var func = once ? function (t, d, f, v) {\n callback(t, d, f, v);\n\n _self.remove(func);\n } : callback;\n\n _self.remove(callback);\n\n _listeners[prioritize ? \"unshift\" : \"push\"](func);\n\n _wake();\n\n return func;\n },\n remove: function remove(callback, i) {\n ~(i = _listeners.indexOf(callback)) && _listeners.splice(i, 1) && _i >= i && _i--;\n },\n _listeners: _listeners\n };\n return _self;\n}(),\n _wake = function _wake() {\n return !_tickerActive && _ticker.wake();\n},\n //also ensures the core classes are initialized.\n\n/*\n* -------------------------------------------------\n* EASING\n* -------------------------------------------------\n*/\n_easeMap = {},\n _customEaseExp = /^[\\d.\\-M][\\d.\\-,\\s]/,\n _quotesExp = /[\"']/g,\n _parseObjectInString = function _parseObjectInString(value) {\n //takes a string like \"{wiggles:10, type:anticipate})\" and turns it into a real object. Notice it ends in \")\" and includes the {} wrappers. This is because we only use this function for parsing ease configs and prioritized optimization rather than reusability.\n var obj = {},\n split = value.substr(1, value.length - 3).split(\":\"),\n key = split[0],\n i = 1,\n l = split.length,\n index,\n val,\n parsedVal;\n\n for (; i < l; i++) {\n val = split[i];\n index = i !== l - 1 ? val.lastIndexOf(\",\") : val.length;\n parsedVal = val.substr(0, index);\n obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, \"\").trim() : +parsedVal;\n key = val.substr(index + 1).trim();\n }\n\n return obj;\n},\n _valueInParentheses = function _valueInParentheses(value) {\n var open = value.indexOf(\"(\") + 1,\n close = value.indexOf(\")\"),\n nested = value.indexOf(\"(\", open);\n return value.substring(open, ~nested && nested < close ? value.indexOf(\")\", close + 1) : close);\n},\n _configEaseFromString = function _configEaseFromString(name) {\n //name can be a string like \"elastic.out(1,0.5)\", and pass in _easeMap as obj and it'll parse it out and call the actual function like _easeMap.Elastic.easeOut.config(1,0.5). It will also parse custom ease strings as long as CustomEase is loaded and registered (internally as _easeMap._CE).\n var split = (name + \"\").split(\"(\"),\n ease = _easeMap[split[0]];\n return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf(\"{\") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(\",\").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE(\"\", name) : ease;\n},\n _invertEase = function _invertEase(ease) {\n return function (p) {\n return 1 - ease(1 - p);\n };\n},\n // allow yoyoEase to be set in children and have those affected when the parent/ancestor timeline yoyos.\n_propagateYoyoEase = function _propagateYoyoEase(timeline, isYoyo) {\n var child = timeline._first,\n ease;\n\n while (child) {\n if (child instanceof Timeline) {\n _propagateYoyoEase(child, isYoyo);\n } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) {\n if (child.timeline) {\n _propagateYoyoEase(child.timeline, isYoyo);\n } else {\n ease = child._ease;\n child._ease = child._yEase;\n child._yEase = ease;\n child._yoyo = isYoyo;\n }\n }\n\n child = child._next;\n }\n},\n _parseEase = function _parseEase(ease, defaultEase) {\n return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase;\n},\n _insertEase = function _insertEase(names, easeIn, easeOut, easeInOut) {\n if (easeOut === void 0) {\n easeOut = function easeOut(p) {\n return 1 - easeIn(1 - p);\n };\n }\n\n if (easeInOut === void 0) {\n easeInOut = function easeInOut(p) {\n return p < .5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2;\n };\n }\n\n var ease = {\n easeIn: easeIn,\n easeOut: easeOut,\n easeInOut: easeInOut\n },\n lowercaseName;\n\n _forEachName(names, function (name) {\n _easeMap[name] = _globals[name] = ease;\n _easeMap[lowercaseName = name.toLowerCase()] = easeOut;\n\n for (var p in ease) {\n _easeMap[lowercaseName + (p === \"easeIn\" ? \".in\" : p === \"easeOut\" ? \".out\" : \".inOut\")] = _easeMap[name + \".\" + p] = ease[p];\n }\n });\n\n return ease;\n},\n _easeInOutFromOut = function _easeInOutFromOut(easeOut) {\n return function (p) {\n return p < .5 ? (1 - easeOut(1 - p * 2)) / 2 : .5 + easeOut((p - .5) * 2) / 2;\n };\n},\n _configElastic = function _configElastic(type, amplitude, period) {\n var p1 = amplitude >= 1 ? amplitude : 1,\n //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1.\n p2 = (period || (type ? .3 : .45)) / (amplitude < 1 ? amplitude : 1),\n p3 = p2 / _2PI * (Math.asin(1 / p1) || 0),\n easeOut = function easeOut(p) {\n return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1;\n },\n ease = type === \"out\" ? easeOut : type === \"in\" ? function (p) {\n return 1 - easeOut(1 - p);\n } : _easeInOutFromOut(easeOut);\n\n p2 = _2PI / p2; //precalculate to optimize\n\n ease.config = function (amplitude, period) {\n return _configElastic(type, amplitude, period);\n };\n\n return ease;\n},\n _configBack = function _configBack(type, overshoot) {\n if (overshoot === void 0) {\n overshoot = 1.70158;\n }\n\n var easeOut = function easeOut(p) {\n return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0;\n },\n ease = type === \"out\" ? easeOut : type === \"in\" ? function (p) {\n return 1 - easeOut(1 - p);\n } : _easeInOutFromOut(easeOut);\n\n ease.config = function (overshoot) {\n return _configBack(type, overshoot);\n };\n\n return ease;\n}; // a cheaper (kb and cpu) but more mild way to get a parameterized weighted ease by feeding in a value between -1 (easeIn) and 1 (easeOut) where 0 is linear.\n// _weightedEase = ratio => {\n// \tlet y = 0.5 + ratio / 2;\n// \treturn p => (2 * (1 - p) * p * y + p * p);\n// },\n// a stronger (but more expensive kb/cpu) parameterized weighted ease that lets you feed in a value between -1 (easeIn) and 1 (easeOut) where 0 is linear.\n// _weightedEaseStrong = ratio => {\n// \tratio = .5 + ratio / 2;\n// \tlet o = 1 / 3 * (ratio < .5 ? ratio : 1 - ratio),\n// \t\tb = ratio - o,\n// \t\tc = ratio + o;\n// \treturn p => p === 1 ? p : 3 * b * (1 - p) * (1 - p) * p + 3 * c * (1 - p) * p * p + p * p * p;\n// };\n\n\n_forEachName(\"Linear,Quad,Cubic,Quart,Quint,Strong\", function (name, i) {\n var power = i < 5 ? i + 1 : i;\n\n _insertEase(name + \",Power\" + (power - 1), i ? function (p) {\n return Math.pow(p, power);\n } : function (p) {\n return p;\n }, function (p) {\n return 1 - Math.pow(1 - p, power);\n }, function (p) {\n return p < .5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2;\n });\n});\n\n_easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn;\n\n_insertEase(\"Elastic\", _configElastic(\"in\"), _configElastic(\"out\"), _configElastic());\n\n(function (n, c) {\n var n1 = 1 / c,\n n2 = 2 * n1,\n n3 = 2.5 * n1,\n easeOut = function easeOut(p) {\n return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + .75 : p < n3 ? n * (p -= 2.25 / c) * p + .9375 : n * Math.pow(p - 2.625 / c, 2) + .984375;\n };\n\n _insertEase(\"Bounce\", function (p) {\n return 1 - easeOut(1 - p);\n }, easeOut);\n})(7.5625, 2.75);\n\n_insertEase(\"Expo\", function (p) {\n return p ? Math.pow(2, 10 * (p - 1)) : 0;\n});\n\n_insertEase(\"Circ\", function (p) {\n return -(_sqrt(1 - p * p) - 1);\n});\n\n_insertEase(\"Sine\", function (p) {\n return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1;\n});\n\n_insertEase(\"Back\", _configBack(\"in\"), _configBack(\"out\"), _configBack());\n\n_easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = {\n config: function config(steps, immediateStart) {\n if (steps === void 0) {\n steps = 1;\n }\n\n var p1 = 1 / steps,\n p2 = steps + (immediateStart ? 0 : 1),\n p3 = immediateStart ? 1 : 0,\n max = 1 - _tinyNum;\n return function (p) {\n return ((p2 * _clamp(0, max, p) | 0) + p3) * p1;\n };\n }\n};\n_defaults.ease = _easeMap[\"quad.out\"];\n\n_forEachName(\"onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt\", function (name) {\n return _callbackNames += name + \",\" + name + \"Params,\";\n});\n/*\n * --------------------------------------------------------------------------------------\n * CACHE\n * --------------------------------------------------------------------------------------\n */\n\n\nexport var GSCache = function GSCache(target, harness) {\n this.id = _gsID++;\n target._gsap = this;\n this.target = target;\n this.harness = harness;\n this.get = harness ? harness.get : _getProperty;\n this.set = harness ? harness.getSetter : _getSetter;\n};\n/*\n * --------------------------------------------------------------------------------------\n * ANIMATION\n * --------------------------------------------------------------------------------------\n */\n\nexport var Animation = /*#__PURE__*/function () {\n function Animation(vars) {\n this.vars = vars;\n this._delay = +vars.delay || 0;\n\n if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) {\n // TODO: repeat: Infinity on a timeline's children must flag that timeline internally and affect its totalDuration, otherwise it'll stop in the negative direction when reaching the start.\n this._rDelay = vars.repeatDelay || 0;\n this._yoyo = !!vars.yoyo || !!vars.yoyoEase;\n }\n\n this._ts = 1;\n\n _setDuration(this, +vars.duration, 1, 1);\n\n this.data = vars.data;\n\n if (_context) {\n this._ctx = _context;\n\n _context.data.push(this);\n }\n\n _tickerActive || _ticker.wake();\n }\n\n var _proto = Animation.prototype;\n\n _proto.delay = function delay(value) {\n if (value || value === 0) {\n this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);\n this._delay = value;\n return this;\n }\n\n return this._delay;\n };\n\n _proto.duration = function duration(value) {\n return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur;\n };\n\n _proto.totalDuration = function totalDuration(value) {\n if (!arguments.length) {\n return this._tDur;\n }\n\n this._dirty = 0;\n return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1));\n };\n\n _proto.totalTime = function totalTime(_totalTime, suppressEvents) {\n _wake();\n\n if (!arguments.length) {\n return this._tTime;\n }\n\n var parent = this._dp;\n\n if (parent && parent.smoothChildTiming && this._ts) {\n _alignPlayhead(this, _totalTime);\n\n !parent._dp || parent.parent || _postAddChecks(parent, this); // edge case: if this is a child of a timeline that already completed, for example, we must re-activate the parent.\n //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The start of that child would get pushed out, but one of the ancestors may have completed.\n\n while (parent && parent.parent) {\n if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) {\n parent.totalTime(parent._tTime, true);\n }\n\n parent = parent.parent;\n }\n\n if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) {\n //if the animation doesn't have a parent, put it back into its last parent (recorded as _dp for exactly cases like this). Limit to parents with autoRemoveChildren (like globalTimeline) so that if the user manually removes an animation from a timeline and then alters its playhead, it doesn't get added back in.\n _addToTimeline(this._dp, this, this._start - this._delay);\n }\n }\n\n if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) {\n // check for _ptLookup on a Tween instance to ensure it has actually finished being instantiated, otherwise if this.reverse() gets called in the Animation constructor, it could trigger a render() here even though the _targets weren't populated, thus when _init() is called there won't be any PropTweens (it'll act like the tween is non-functional)\n this._ts || (this._pTime = _totalTime); // otherwise, if an animation is paused, then the playhead is moved back to zero, then resumed, it'd revert back to the original time at the pause\n //if (!this._lock) { // avoid endless recursion (not sure we need this yet or if it's worth the performance hit)\n // this._lock = 1;\n\n _lazySafeRender(this, _totalTime, suppressEvents); // this._lock = 0;\n //}\n\n }\n\n return this;\n };\n\n _proto.time = function time(value, suppressEvents) {\n return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time; // note: if the modulus results in 0, the playhead could be exactly at the end or the beginning, and we always defer to the END with a non-zero value, otherwise if you set the time() to the very end (duration()), it would render at the START!\n };\n\n _proto.totalProgress = function totalProgress(value, suppressEvents) {\n return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() > 0 ? 1 : 0;\n };\n\n _proto.progress = function progress(value, suppressEvents) {\n return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0;\n };\n\n _proto.iteration = function iteration(value, suppressEvents) {\n var cycleDuration = this.duration() + this._rDelay;\n\n return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1;\n } // potential future addition:\n // isPlayingBackwards() {\n // \tlet animation = this,\n // \t\torientation = 1; // 1 = forward, -1 = backward\n // \twhile (animation) {\n // \t\torientation *= animation.reversed() || (animation.repeat() && !(animation.iteration() & 1)) ? -1 : 1;\n // \t\tanimation = animation.parent;\n // \t}\n // \treturn orientation < 0;\n // }\n ;\n\n _proto.timeScale = function timeScale(value, suppressEvents) {\n if (!arguments.length) {\n return this._rts === -_tinyNum ? 0 : this._rts; // recorded timeScale. Special case: if someone calls reverse() on an animation with timeScale of 0, we assign it -_tinyNum to remember it's reversed.\n }\n\n if (this._rts === value) {\n return this;\n }\n\n var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; // make sure to do the parentToChildTotalTime() BEFORE setting the new _ts because the old one must be used in that calculation.\n // future addition? Up side: fast and minimal file size. Down side: only works on this animation; if a timeline is reversed, for example, its childrens' onReverse wouldn't get called.\n //(+value < 0 && this._rts >= 0) && _callback(this, \"onReverse\", true);\n // prioritize rendering where the parent's playhead lines up instead of this._tTime because there could be a tween that's animating another tween's timeScale in the same rendering loop (same parent), thus if the timeScale tween renders first, it would alter _start BEFORE _tTime was set on that tick (in the rendering loop), effectively freezing it until the timeScale tween finishes.\n\n this._rts = +value || 0;\n this._ts = this._ps || value === -_tinyNum ? 0 : this._rts; // _ts is the functional timeScale which would be 0 if the animation is paused.\n\n this.totalTime(_clamp(-Math.abs(this._delay), this._tDur, tTime), suppressEvents !== false);\n\n _setEnd(this); // if parent.smoothChildTiming was false, the end time didn't get updated in the _alignPlayhead() method, so do it here.\n\n\n return _recacheAncestors(this);\n };\n\n _proto.paused = function paused(value) {\n if (!arguments.length) {\n return this._ps;\n }\n\n if (this._ps !== value) {\n this._ps = value;\n\n if (value) {\n this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()); // if the pause occurs during the delay phase, make sure that's factored in when resuming.\n\n this._ts = this._act = 0; // _ts is the functional timeScale, so a paused tween would effectively have a timeScale of 0. We record the \"real\" timeScale as _rts (recorded time scale)\n } else {\n _wake();\n\n this._ts = this._rts; //only defer to _pTime (pauseTime) if tTime is zero. Remember, someone could pause() an animation, then scrub the playhead and resume(). If the parent doesn't have smoothChildTiming, we render at the rawTime() because the startTime won't get updated.\n\n this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum)); // edge case: animation.progress(1).pause().play() wouldn't render again because the playhead is already at the end, but the call to totalTime() below will add it back to its parent...and not remove it again (since removing only happens upon rendering at a new time). Offsetting the _tTime slightly is done simply to cause the final render in totalTime() that'll pop it off its timeline (if autoRemoveChildren is true, of course). Check to make sure _zTime isn't -_tinyNum to avoid an edge case where the playhead is pushed to the end but INSIDE a tween/callback, the timeline itself is paused thus halting rendering and leaving a few unrendered. When resuming, it wouldn't render those otherwise.\n }\n }\n\n return this;\n };\n\n _proto.startTime = function startTime(value) {\n if (arguments.length) {\n this._start = value;\n var parent = this.parent || this._dp;\n parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay);\n return this;\n }\n\n return this._start;\n };\n\n _proto.endTime = function endTime(includeRepeats) {\n return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1);\n };\n\n _proto.rawTime = function rawTime(wrapRepeats) {\n var parent = this.parent || this._dp; // _dp = detached parent\n\n return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this);\n };\n\n _proto.revert = function revert(config) {\n if (config === void 0) {\n config = _revertConfig;\n }\n\n var prevIsReverting = _reverting;\n _reverting = config;\n\n if (this._initted || this._startAt) {\n this.timeline && this.timeline.revert(config);\n this.totalTime(-0.01, config.suppressEvents);\n }\n\n this.data !== \"nested\" && config.kill !== false && this.kill();\n _reverting = prevIsReverting;\n return this;\n };\n\n _proto.globalTime = function globalTime(rawTime) {\n var animation = this,\n time = arguments.length ? rawTime : animation.rawTime();\n\n while (animation) {\n time = animation._start + time / (Math.abs(animation._ts) || 1);\n animation = animation._dp;\n }\n\n return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time; // the _startAt tweens for .fromTo() and .from() that have immediateRender should always be FIRST in the timeline (important for context.revert()). \"_sat\" stands for _startAtTween, referring to the parent tween that created the _startAt. We must discern if that tween had immediateRender so that we can know whether or not to prioritize it in revert().\n };\n\n _proto.repeat = function repeat(value) {\n if (arguments.length) {\n this._repeat = value === Infinity ? -2 : value;\n return _onUpdateTotalDuration(this);\n }\n\n return this._repeat === -2 ? Infinity : this._repeat;\n };\n\n _proto.repeatDelay = function repeatDelay(value) {\n if (arguments.length) {\n var time = this._time;\n this._rDelay = value;\n\n _onUpdateTotalDuration(this);\n\n return time ? this.time(time) : this;\n }\n\n return this._rDelay;\n };\n\n _proto.yoyo = function yoyo(value) {\n if (arguments.length) {\n this._yoyo = value;\n return this;\n }\n\n return this._yoyo;\n };\n\n _proto.seek = function seek(position, suppressEvents) {\n return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents));\n };\n\n _proto.restart = function restart(includeDelay, suppressEvents) {\n return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));\n };\n\n _proto.play = function play(from, suppressEvents) {\n from != null && this.seek(from, suppressEvents);\n return this.reversed(false).paused(false);\n };\n\n _proto.reverse = function reverse(from, suppressEvents) {\n from != null && this.seek(from || this.totalDuration(), suppressEvents);\n return this.reversed(true).paused(false);\n };\n\n _proto.pause = function pause(atTime, suppressEvents) {\n atTime != null && this.seek(atTime, suppressEvents);\n return this.paused(true);\n };\n\n _proto.resume = function resume() {\n return this.paused(false);\n };\n\n _proto.reversed = function reversed(value) {\n if (arguments.length) {\n !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0)); // in case timeScale is zero, reversing would have no effect so we use _tinyNum.\n\n return this;\n }\n\n return this._rts < 0;\n };\n\n _proto.invalidate = function invalidate() {\n this._initted = this._act = 0;\n this._zTime = -_tinyNum;\n return this;\n };\n\n _proto.isActive = function isActive() {\n var parent = this.parent || this._dp,\n start = this._start,\n rawTime;\n return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum);\n };\n\n _proto.eventCallback = function eventCallback(type, callback, params) {\n var vars = this.vars;\n\n if (arguments.length > 1) {\n if (!callback) {\n delete vars[type];\n } else {\n vars[type] = callback;\n params && (vars[type + \"Params\"] = params);\n type === \"onUpdate\" && (this._onUpdate = callback);\n }\n\n return this;\n }\n\n return vars[type];\n };\n\n _proto.then = function then(onFulfilled) {\n var self = this;\n return new Promise(function (resolve) {\n var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough,\n _resolve = function _resolve() {\n var _then = self.then;\n self.then = null; // temporarily null the then() method to avoid an infinite loop (see https://github.com/greensock/GSAP/issues/322)\n\n _isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then);\n resolve(f);\n self.then = _then;\n };\n\n if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) {\n _resolve();\n } else {\n self._prom = _resolve;\n }\n });\n };\n\n _proto.kill = function kill() {\n _interrupt(this);\n };\n\n return Animation;\n}();\n\n_setDefaults(Animation.prototype, {\n _time: 0,\n _start: 0,\n _end: 0,\n _tTime: 0,\n _tDur: 0,\n _dirty: 0,\n _repeat: 0,\n _yoyo: false,\n parent: null,\n _initted: false,\n _rDelay: 0,\n _ts: 1,\n _dp: 0,\n ratio: 0,\n _zTime: -_tinyNum,\n _prom: 0,\n _ps: false,\n _rts: 1\n});\n/*\n * -------------------------------------------------\n * TIMELINE\n * -------------------------------------------------\n */\n\n\nexport var Timeline = /*#__PURE__*/function (_Animation) {\n _inheritsLoose(Timeline, _Animation);\n\n function Timeline(vars, position) {\n var _this;\n\n if (vars === void 0) {\n vars = {};\n }\n\n _this = _Animation.call(this, vars) || this;\n _this.labels = {};\n _this.smoothChildTiming = !!vars.smoothChildTiming;\n _this.autoRemoveChildren = !!vars.autoRemoveChildren;\n _this._sort = _isNotFalse(vars.sortChildren);\n _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position);\n vars.reversed && _this.reverse();\n vars.paused && _this.paused(true);\n vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger);\n return _this;\n }\n\n var _proto2 = Timeline.prototype;\n\n _proto2.to = function to(targets, vars, position) {\n _createTweenType(0, arguments, this);\n\n return this;\n };\n\n _proto2.from = function from(targets, vars, position) {\n _createTweenType(1, arguments, this);\n\n return this;\n };\n\n _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) {\n _createTweenType(2, arguments, this);\n\n return this;\n };\n\n _proto2.set = function set(targets, vars, position) {\n vars.duration = 0;\n vars.parent = this;\n _inheritDefaults(vars).repeatDelay || (vars.repeat = 0);\n vars.immediateRender = !!vars.immediateRender;\n new Tween(targets, vars, _parsePosition(this, position), 1);\n return this;\n };\n\n _proto2.call = function call(callback, params, position) {\n return _addToTimeline(this, Tween.delayedCall(0, callback, params), position);\n } //ONLY for backward compatibility! Maybe delete?\n ;\n\n _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {\n vars.duration = duration;\n vars.stagger = vars.stagger || stagger;\n vars.onComplete = onCompleteAll;\n vars.onCompleteParams = onCompleteAllParams;\n vars.parent = this;\n new Tween(targets, vars, _parsePosition(this, position));\n return this;\n };\n\n _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {\n vars.runBackwards = 1;\n _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender);\n return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams);\n };\n\n _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) {\n toVars.startAt = fromVars;\n _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender);\n return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams);\n };\n\n _proto2.render = function render(totalTime, suppressEvents, force) {\n var prevTime = this._time,\n tDur = this._dirty ? this.totalDuration() : this._tDur,\n dur = this._dur,\n tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime),\n // if a paused timeline is resumed (or its _start is updated for another reason...which rounds it), that could result in the playhead shifting a **tiny** amount and a zero-duration child at that spot may get rendered at a different ratio, like its totalTime in render() may be 1e-17 instead of 0, for example.\n crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur),\n time,\n child,\n next,\n iteration,\n cycleDuration,\n prevPaused,\n pauseTween,\n timeScale,\n prevStart,\n prevIteration,\n yoyo,\n isYoyo;\n this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur);\n\n if (tTime !== this._tTime || force || crossingStart) {\n if (prevTime !== this._time && dur) {\n //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump).\n tTime += this._time - prevTime;\n totalTime += this._time - prevTime;\n }\n\n time = tTime;\n prevStart = this._start;\n timeScale = this._ts;\n prevPaused = !timeScale;\n\n if (crossingStart) {\n dur || (prevTime = this._zTime); //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.\n\n (totalTime || !suppressEvents) && (this._zTime = totalTime);\n }\n\n if (this._repeat) {\n //adjust the time for repeats and yoyos\n yoyo = this._yoyo;\n cycleDuration = dur + this._rDelay;\n\n if (this._repeat < -1 && totalTime < 0) {\n return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);\n }\n\n time = _roundPrecise(tTime % cycleDuration); //round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)\n\n if (tTime === tDur) {\n // the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)\n iteration = this._repeat;\n time = dur;\n } else {\n iteration = ~~(tTime / cycleDuration);\n\n if (iteration && iteration === tTime / cycleDuration) {\n time = dur;\n iteration--;\n }\n\n time > dur && (time = dur);\n }\n\n prevIteration = _animationCycle(this._tTime, cycleDuration);\n !prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration); // edge case - if someone does addPause() at the very beginning of a repeating timeline, that pause is technically at the same spot as the end which causes this._time to get set to 0 when the totalTime would normally place the playhead at the end. See https://gsap.com/forums/topic/23823-closing-nav-animation-not-working-on-ie-and-iphone-6-maybe-other-older-browser/?tab=comments#comment-113005 also, this._tTime - prevIteration * cycleDuration - this._dur <= 0 just checks to make sure it wasn't previously in the \"repeatDelay\" portion\n\n if (yoyo && iteration & 1) {\n time = dur - time;\n isYoyo = 1;\n }\n /*\n make sure children at the end/beginning of the timeline are rendered properly. If, for example,\n a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which\n would get translated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there\n could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So\n we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must\n ensure that zero-duration tweens at the very beginning or end of the Timeline work.\n */\n\n\n if (iteration !== prevIteration && !this._lock) {\n var rewinding = yoyo && prevIteration & 1,\n doesWrap = rewinding === (yoyo && iteration & 1);\n iteration < prevIteration && (rewinding = !rewinding);\n prevTime = rewinding ? 0 : tTime % dur ? dur : tTime; // if the playhead is landing exactly at the end of an iteration, use that totalTime rather than only the duration, otherwise it'll skip the 2nd render since it's effectively at the same time.\n\n this._lock = 1;\n this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0;\n this._tTime = tTime; // if a user gets the iteration() inside the onRepeat, for example, it should be accurate.\n\n !suppressEvents && this.parent && _callback(this, \"onRepeat\");\n this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1);\n\n if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) {\n // if prevTime is 0 and we render at the very end, _time will be the end, thus won't match. So in this edge case, prevTime won't match _time but that's okay. If it gets killed in the onRepeat, eject as well.\n return this;\n }\n\n dur = this._dur; // in case the duration changed in the onRepeat\n\n tDur = this._tDur;\n\n if (doesWrap) {\n this._lock = 2;\n prevTime = rewinding ? dur : -0.0001;\n this.render(prevTime, true);\n this.vars.repeatRefresh && !isYoyo && this.invalidate();\n }\n\n this._lock = 0;\n\n if (!this._ts && !prevPaused) {\n return this;\n } //in order for yoyoEase to work properly when there's a stagger, we must swap out the ease in each sub-tween.\n\n\n _propagateYoyoEase(this, isYoyo);\n }\n }\n\n if (this._hasPause && !this._forcing && this._lock < 2) {\n pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time));\n\n if (pauseTween) {\n tTime -= time - (time = pauseTween._start);\n }\n }\n\n this._tTime = tTime;\n this._time = time;\n this._act = !timeScale; //as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.\n\n if (!this._initted) {\n this._onUpdate = this.vars.onUpdate;\n this._initted = 1;\n this._zTime = totalTime;\n prevTime = 0; // upon init, the playhead should always go forward; someone could invalidate() a completed timeline and then if they restart(), that would make child tweens render in reverse order which could lock in the wrong starting values if they build on each other, like tl.to(obj, {x: 100}).to(obj, {x: 0}).\n }\n\n if (!prevTime && time && !suppressEvents && !iteration) {\n _callback(this, \"onStart\");\n\n if (this._tTime !== tTime) {\n // in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.\n return this;\n }\n }\n\n if (time >= prevTime && totalTime >= 0) {\n child = this._first;\n\n while (child) {\n next = child._next;\n\n if ((child._act || time >= child._start) && child._ts && pauseTween !== child) {\n if (child.parent !== this) {\n // an extreme edge case - the child's render could do something like kill() the \"next\" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.\n return this.render(totalTime, suppressEvents, force);\n }\n\n child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force);\n\n if (time !== this._time || !this._ts && !prevPaused) {\n //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete\n pauseTween = 0;\n next && (tTime += this._zTime = -_tinyNum); // it didn't finish rendering, so flag zTime as negative so that so that the next time render() is called it'll be forced (to render any remaining children)\n\n break;\n }\n }\n\n child = next;\n }\n } else {\n child = this._last;\n var adjustedTime = totalTime < 0 ? totalTime : time; //when the playhead goes backward beyond the start of this timeline, we must pass that information down to the child animations so that zero-duration tweens know whether to render their starting or ending values.\n\n while (child) {\n next = child._prev;\n\n if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) {\n if (child.parent !== this) {\n // an extreme edge case - the child's render could do something like kill() the \"next\" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.\n return this.render(totalTime, suppressEvents, force);\n }\n\n child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting && (child._initted || child._startAt)); // if reverting, we should always force renders of initted tweens (but remember that .fromTo() or .from() may have a _startAt but not _initted yet). If, for example, a .fromTo() tween with a stagger (which creates an internal timeline) gets reverted BEFORE some of its child tweens render for the first time, it may not properly trigger them to revert.\n\n if (time !== this._time || !this._ts && !prevPaused) {\n //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete\n pauseTween = 0;\n next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum); // it didn't finish rendering, so adjust zTime so that so that the next time render() is called it'll be forced (to render any remaining children)\n\n break;\n }\n }\n\n child = next;\n }\n }\n\n if (pauseTween && !suppressEvents) {\n this.pause();\n pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1;\n\n if (this._ts) {\n //the callback resumed playback! So since we may have held back the playhead due to where the pause is positioned, go ahead and jump to where it's SUPPOSED to be (if no pause happened).\n this._start = prevStart; //if the pause was at an earlier time and the user resumed in the callback, it could reposition the timeline (changing its startTime), throwing things off slightly, so we make sure the _start doesn't shift.\n\n _setEnd(this);\n\n return this.render(totalTime, suppressEvents, force);\n }\n }\n\n this._onUpdate && !suppressEvents && _callback(this, \"onUpdate\", true);\n if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) if (!this._lock) {\n // remember, a child's callback may alter this timeline's playhead or timeScale which is why we need to add some of these checks.\n (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); // don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.\n\n if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) {\n _callback(this, tTime === tDur && totalTime >= 0 ? \"onComplete\" : \"onReverseComplete\", true);\n\n this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();\n }\n }\n }\n\n return this;\n };\n\n _proto2.add = function add(child, position) {\n var _this2 = this;\n\n _isNumber(position) || (position = _parsePosition(this, position, child));\n\n if (!(child instanceof Animation)) {\n if (_isArray(child)) {\n child.forEach(function (obj) {\n return _this2.add(obj, position);\n });\n return this;\n }\n\n if (_isString(child)) {\n return this.addLabel(child, position);\n }\n\n if (_isFunction(child)) {\n child = Tween.delayedCall(0, child);\n } else {\n return this;\n }\n }\n\n return this !== child ? _addToTimeline(this, child, position) : this; //don't allow a timeline to be added to itself as a child!\n };\n\n _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) {\n if (nested === void 0) {\n nested = true;\n }\n\n if (tweens === void 0) {\n tweens = true;\n }\n\n if (timelines === void 0) {\n timelines = true;\n }\n\n if (ignoreBeforeTime === void 0) {\n ignoreBeforeTime = -_bigNum;\n }\n\n var a = [],\n child = this._first;\n\n while (child) {\n if (child._start >= ignoreBeforeTime) {\n if (child instanceof Tween) {\n tweens && a.push(child);\n } else {\n timelines && a.push(child);\n nested && a.push.apply(a, child.getChildren(true, tweens, timelines));\n }\n }\n\n child = child._next;\n }\n\n return a;\n };\n\n _proto2.getById = function getById(id) {\n var animations = this.getChildren(1, 1, 1),\n i = animations.length;\n\n while (i--) {\n if (animations[i].vars.id === id) {\n return animations[i];\n }\n }\n };\n\n _proto2.remove = function remove(child) {\n if (_isString(child)) {\n return this.removeLabel(child);\n }\n\n if (_isFunction(child)) {\n return this.killTweensOf(child);\n }\n\n _removeLinkedListItem(this, child);\n\n if (child === this._recent) {\n this._recent = this._last;\n }\n\n return _uncache(this);\n };\n\n _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) {\n if (!arguments.length) {\n return this._tTime;\n }\n\n this._forcing = 1;\n\n if (!this._dp && this._ts) {\n //special case for the global timeline (or any other that has no parent or detached parent).\n this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts));\n }\n\n _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents);\n\n this._forcing = 0;\n return this;\n };\n\n _proto2.addLabel = function addLabel(label, position) {\n this.labels[label] = _parsePosition(this, position);\n return this;\n };\n\n _proto2.removeLabel = function removeLabel(label) {\n delete this.labels[label];\n return this;\n };\n\n _proto2.addPause = function addPause(position, callback, params) {\n var t = Tween.delayedCall(0, callback || _emptyFunc, params);\n t.data = \"isPause\";\n this._hasPause = 1;\n return _addToTimeline(this, t, _parsePosition(this, position));\n };\n\n _proto2.removePause = function removePause(position) {\n var child = this._first;\n position = _parsePosition(this, position);\n\n while (child) {\n if (child._start === position && child.data === \"isPause\") {\n _removeFromParent(child);\n }\n\n child = child._next;\n }\n };\n\n _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) {\n var tweens = this.getTweensOf(targets, onlyActive),\n i = tweens.length;\n\n while (i--) {\n _overwritingTween !== tweens[i] && tweens[i].kill(targets, props);\n }\n\n return this;\n };\n\n _proto2.getTweensOf = function getTweensOf(targets, onlyActive) {\n var a = [],\n parsedTargets = toArray(targets),\n child = this._first,\n isGlobalTime = _isNumber(onlyActive),\n // a number is interpreted as a global time. If the animation spans\n children;\n\n while (child) {\n if (child instanceof Tween) {\n if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) {\n // note: if this is for overwriting, it should only be for tweens that aren't paused and are initted.\n a.push(child);\n }\n } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) {\n a.push.apply(a, children);\n }\n\n child = child._next;\n }\n\n return a;\n } // potential future feature - targets() on timelines\n // targets() {\n // \tlet result = [];\n // \tthis.getChildren(true, true, false).forEach(t => result.push(...t.targets()));\n // \treturn result.filter((v, i) => result.indexOf(v) === i);\n // }\n ;\n\n _proto2.tweenTo = function tweenTo(position, vars) {\n vars = vars || {};\n\n var tl = this,\n endTime = _parsePosition(tl, position),\n _vars = vars,\n startAt = _vars.startAt,\n _onStart = _vars.onStart,\n onStartParams = _vars.onStartParams,\n immediateRender = _vars.immediateRender,\n initted,\n tween = Tween.to(tl, _setDefaults({\n ease: vars.ease || \"none\",\n lazy: false,\n immediateRender: false,\n time: endTime,\n overwrite: \"auto\",\n duration: vars.duration || Math.abs((endTime - (startAt && \"time\" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum,\n onStart: function onStart() {\n tl.pause();\n\n if (!initted) {\n var duration = vars.duration || Math.abs((endTime - (startAt && \"time\" in startAt ? startAt.time : tl._time)) / tl.timeScale());\n tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true);\n initted = 1;\n }\n\n _onStart && _onStart.apply(tween, onStartParams || []); //in case the user had an onStart in the vars - we don't want to overwrite it.\n }\n }, vars));\n\n return immediateRender ? tween.render(0) : tween;\n };\n\n _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) {\n return this.tweenTo(toPosition, _setDefaults({\n startAt: {\n time: _parsePosition(this, fromPosition)\n }\n }, vars));\n };\n\n _proto2.recent = function recent() {\n return this._recent;\n };\n\n _proto2.nextLabel = function nextLabel(afterTime) {\n if (afterTime === void 0) {\n afterTime = this._time;\n }\n\n return _getLabelInDirection(this, _parsePosition(this, afterTime));\n };\n\n _proto2.previousLabel = function previousLabel(beforeTime) {\n if (beforeTime === void 0) {\n beforeTime = this._time;\n }\n\n return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1);\n };\n\n _proto2.currentLabel = function currentLabel(value) {\n return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum);\n };\n\n _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) {\n if (ignoreBeforeTime === void 0) {\n ignoreBeforeTime = 0;\n }\n\n var child = this._first,\n labels = this.labels,\n p;\n\n while (child) {\n if (child._start >= ignoreBeforeTime) {\n child._start += amount;\n child._end += amount;\n }\n\n child = child._next;\n }\n\n if (adjustLabels) {\n for (p in labels) {\n if (labels[p] >= ignoreBeforeTime) {\n labels[p] += amount;\n }\n }\n }\n\n return _uncache(this);\n };\n\n _proto2.invalidate = function invalidate(soft) {\n var child = this._first;\n this._lock = 0;\n\n while (child) {\n child.invalidate(soft);\n child = child._next;\n }\n\n return _Animation.prototype.invalidate.call(this, soft);\n };\n\n _proto2.clear = function clear(includeLabels) {\n if (includeLabels === void 0) {\n includeLabels = true;\n }\n\n var child = this._first,\n next;\n\n while (child) {\n next = child._next;\n this.remove(child);\n child = next;\n }\n\n this._dp && (this._time = this._tTime = this._pTime = 0);\n includeLabels && (this.labels = {});\n return _uncache(this);\n };\n\n _proto2.totalDuration = function totalDuration(value) {\n var max = 0,\n self = this,\n child = self._last,\n prevStart = _bigNum,\n prev,\n start,\n parent;\n\n if (arguments.length) {\n return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value));\n }\n\n if (self._dirty) {\n parent = self.parent;\n\n while (child) {\n prev = child._prev; //record it here in case the tween changes position in the sequence...\n\n child._dirty && child.totalDuration(); //could change the tween._startTime, so make sure the animation's cache is clean before analyzing it.\n\n start = child._start;\n\n if (start > prevStart && self._sort && child._ts && !self._lock) {\n //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence\n self._lock = 1; //prevent endless recursive calls - there are methods that get triggered that check duration/totalDuration when we add().\n\n _addToTimeline(self, child, start - child._delay, 1)._lock = 0;\n } else {\n prevStart = start;\n }\n\n if (start < 0 && child._ts) {\n //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found.\n max -= start;\n\n if (!parent && !self._dp || parent && parent.smoothChildTiming) {\n self._start += start / self._ts;\n self._time -= start;\n self._tTime -= start;\n }\n\n self.shiftChildren(-start, false, -1e999);\n prevStart = 0;\n }\n\n child._end > max && child._ts && (max = child._end);\n child = prev;\n }\n\n _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1);\n\n self._dirty = 0;\n }\n\n return self._tDur;\n };\n\n Timeline.updateRoot = function updateRoot(time) {\n if (_globalTimeline._ts) {\n _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline));\n\n _lastRenderedFrame = _ticker.frame;\n }\n\n if (_ticker.frame >= _nextGCFrame) {\n _nextGCFrame += _config.autoSleep || 120;\n var child = _globalTimeline._first;\n if (!child || !child._ts) if (_config.autoSleep && _ticker._listeners.length < 2) {\n while (child && !child._ts) {\n child = child._next;\n }\n\n child || _ticker.sleep();\n }\n }\n };\n\n return Timeline;\n}(Animation);\n\n_setDefaults(Timeline.prototype, {\n _lock: 0,\n _hasPause: 0,\n _forcing: 0\n});\n\nvar _addComplexStringPropTween = function _addComplexStringPropTween(target, prop, start, end, setter, stringFilter, funcParam) {\n //note: we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter),\n index = 0,\n matchIndex = 0,\n result,\n startNums,\n color,\n endNum,\n chunk,\n startNum,\n hasRandom,\n a;\n pt.b = start;\n pt.e = end;\n start += \"\"; //ensure values are strings\n\n end += \"\";\n\n if (hasRandom = ~end.indexOf(\"random(\")) {\n end = _replaceRandom(end);\n }\n\n if (stringFilter) {\n a = [start, end];\n stringFilter(a, target, prop); //pass an array with the starting and ending values and let the filter do whatever it needs to the values.\n\n start = a[0];\n end = a[1];\n }\n\n startNums = start.match(_complexStringNumExp) || [];\n\n while (result = _complexStringNumExp.exec(end)) {\n endNum = result[0];\n chunk = end.substring(index, result.index);\n\n if (color) {\n color = (color + 1) % 5;\n } else if (chunk.substr(-5) === \"rgba(\") {\n color = 1;\n }\n\n if (endNum !== startNums[matchIndex++]) {\n startNum = parseFloat(startNums[matchIndex - 1]) || 0; //these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.\n\n pt._pt = {\n _next: pt._pt,\n p: chunk || matchIndex === 1 ? chunk : \",\",\n //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n s: startNum,\n c: endNum.charAt(1) === \"=\" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum,\n m: color && color < 4 ? Math.round : 0\n };\n index = _complexStringNumExp.lastIndex;\n }\n }\n\n pt.c = index < end.length ? end.substring(index, end.length) : \"\"; //we use the \"c\" of the PropTween to store the final part of the string (after the last number)\n\n pt.fp = funcParam;\n\n if (_relExp.test(end) || hasRandom) {\n pt.e = 0; //if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).\n }\n\n this._pt = pt; //start the linked list with this new PropTween. Remember, we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n\n return pt;\n},\n _addPropTween = function _addPropTween(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) {\n _isFunction(end) && (end = end(index || 0, target, targets));\n var currentValue = target[prop],\n parsedStart = start !== \"get\" ? start : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf(\"set\") || !_isFunction(target[\"get\" + prop.substr(3)]) ? prop : \"get\" + prop.substr(3)](funcParam) : target[prop](),\n setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc,\n pt;\n\n if (_isString(end)) {\n if (~end.indexOf(\"random(\")) {\n end = _replaceRandom(end);\n }\n\n if (end.charAt(1) === \"=\") {\n pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0);\n\n if (pt || pt === 0) {\n // to avoid isNaN, like if someone passes in a value like \"!= whatever\"\n end = pt;\n }\n }\n }\n\n if (!optional || parsedStart !== end || _forceAllPropTweens) {\n if (!isNaN(parsedStart * end) && end !== \"\") {\n // fun fact: any number multiplied by \"\" is evaluated as the number 0!\n pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === \"boolean\" ? _renderBoolean : _renderPlain, 0, setter);\n funcParam && (pt.fp = funcParam);\n modifier && pt.modifier(modifier, this, target);\n return this._pt = pt;\n }\n\n !currentValue && !(prop in target) && _missingPlugin(prop, end);\n return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam);\n }\n},\n //creates a copy of the vars object and processes any function-based values (putting the resulting values directly into the copy) as well as strings with \"random()\" in them. It does NOT process relative values.\n_processVars = function _processVars(vars, index, target, targets, tween) {\n _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets));\n\n if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) {\n return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars;\n }\n\n var copy = {},\n p;\n\n for (p in vars) {\n copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets);\n }\n\n return copy;\n},\n _checkPlugin = function _checkPlugin(property, vars, tween, index, target, targets) {\n var plugin, pt, ptLookup, i;\n\n if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) {\n tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority);\n\n if (tween !== _quickTween) {\n ptLookup = tween._ptLookup[tween._targets.indexOf(target)]; //note: we can't use tween._ptLookup[index] because for staggered tweens, the index from the fullTargets array won't match what it is in each individual tween that spawns from the stagger.\n\n i = plugin._props.length;\n\n while (i--) {\n ptLookup[plugin._props[i]] = pt;\n }\n }\n }\n\n return plugin;\n},\n _overwritingTween,\n //store a reference temporarily so we can avoid overwriting itself.\n_forceAllPropTweens,\n _initTween = function _initTween(tween, time, tTime) {\n var vars = tween.vars,\n ease = vars.ease,\n startAt = vars.startAt,\n immediateRender = vars.immediateRender,\n lazy = vars.lazy,\n onUpdate = vars.onUpdate,\n runBackwards = vars.runBackwards,\n yoyoEase = vars.yoyoEase,\n keyframes = vars.keyframes,\n autoRevert = vars.autoRevert,\n dur = tween._dur,\n prevStartAt = tween._startAt,\n targets = tween._targets,\n parent = tween.parent,\n fullTargets = parent && parent.data === \"nested\" ? parent.vars.targets : targets,\n autoOverwrite = tween._overwrite === \"auto\" && !_suppressOverwrites,\n tl = tween.timeline,\n cleanVars,\n i,\n p,\n pt,\n target,\n hasPriority,\n gsData,\n harness,\n plugin,\n ptLookup,\n index,\n harnessVars,\n overwritten;\n tl && (!keyframes || !ease) && (ease = \"none\");\n tween._ease = _parseEase(ease, _defaults.ease);\n tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0;\n\n if (yoyoEase && tween._yoyo && !tween._repeat) {\n //there must have been a parent timeline with yoyo:true that is currently in its yoyo phase, so flip the eases.\n yoyoEase = tween._yEase;\n tween._yEase = tween._ease;\n tween._ease = yoyoEase;\n }\n\n tween._from = !tl && !!vars.runBackwards; //nested timelines should never run backwards - the backwards-ness is in the child tweens.\n\n if (!tl || keyframes && !vars.stagger) {\n //if there's an internal timeline, skip all the parsing because we passed that task down the chain.\n harness = targets[0] ? _getCache(targets[0]).harness : 0;\n harnessVars = harness && vars[harness.prop]; //someone may need to specify CSS-specific values AND non-CSS values, like if the element has an \"x\" property plus it's a standard DOM element. We allow people to distinguish by wrapping plugin-specific stuff in a css:{} object for example.\n\n cleanVars = _copyExcluding(vars, _reservedProps);\n\n if (prevStartAt) {\n prevStartAt._zTime < 0 && prevStartAt.progress(1); // in case it's a lazy startAt that hasn't rendered yet.\n\n time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig); // if it's a \"startAt\" (not \"from()\" or runBackwards: true), we only need to do a shallow revert (keep transforms cached in CSSPlugin)\n // don't just _removeFromParent(prevStartAt.render(-1, true)) because that'll leave inline styles. We're creating a new _startAt for \"startAt\" tweens that re-capture things to ensure that if the pre-tween values changed since the tween was created, they're recorded.\n\n prevStartAt._lazy = 0;\n }\n\n if (startAt) {\n _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({\n data: \"isStart\",\n overwrite: false,\n parent: parent,\n immediateRender: true,\n lazy: !prevStartAt && _isNotFalse(lazy),\n startAt: null,\n delay: 0,\n onUpdate: onUpdate && function () {\n return _callback(tween, \"onUpdate\");\n },\n stagger: 0\n }, startAt))); //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, from, to).fromTo(e, to, from);\n\n\n tween._startAt._dp = 0; // don't allow it to get put back into root timeline! Like when revert() is called and totalTime() gets set.\n\n tween._startAt._sat = tween; // used in globalTime(). _sat stands for _startAtTween\n\n time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill); // rare edge case, like if a render is forced in the negative direction of a non-initted tween.\n\n if (immediateRender) {\n if (dur && time <= 0 && tTime <= 0) {\n // check tTime here because in the case of a yoyo tween whose playhead gets pushed to the end like tween.progress(1), we should allow it through so that the onComplete gets fired properly.\n time && (tween._zTime = time);\n return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a Timeline, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting.\n }\n }\n } else if (runBackwards && dur) {\n //from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards)\n if (!prevStartAt) {\n time && (immediateRender = false); //in rare cases (like if a from() tween runs and then is invalidate()-ed), immediateRender could be true but the initial forced-render gets skipped, so there's no need to force the render in this context when the _time is greater than 0\n\n p = _setDefaults({\n overwrite: false,\n data: \"isFromStart\",\n //we tag the tween with as \"isFromStart\" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a \"from()\" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:\"height\", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.\n lazy: immediateRender && !prevStartAt && _isNotFalse(lazy),\n immediateRender: immediateRender,\n //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)\n stagger: 0,\n parent: parent //ensures that nested tweens that had a stagger are handled properly, like gsap.from(\".class\", {y: gsap.utils.wrap([-100,100]), stagger: 0.5})\n\n }, cleanVars);\n harnessVars && (p[harness.prop] = harnessVars); // in case someone does something like .from(..., {css:{}})\n\n _removeFromParent(tween._startAt = Tween.set(targets, p));\n\n tween._startAt._dp = 0; // don't allow it to get put back into root timeline!\n\n tween._startAt._sat = tween; // used in globalTime()\n\n time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true));\n tween._zTime = time;\n\n if (!immediateRender) {\n _initTween(tween._startAt, _tinyNum, _tinyNum); //ensures that the initial values are recorded\n\n } else if (!time) {\n return;\n }\n }\n }\n\n tween._pt = tween._ptCache = 0;\n lazy = dur && _isNotFalse(lazy) || lazy && !dur;\n\n for (i = 0; i < targets.length; i++) {\n target = targets[i];\n gsData = target._gsap || _harness(targets)[i]._gsap;\n tween._ptLookup[i] = ptLookup = {};\n _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender(); //if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end)\n\n index = fullTargets === targets ? i : fullTargets.indexOf(target);\n\n if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) {\n tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority);\n\n plugin._props.forEach(function (name) {\n ptLookup[name] = pt;\n });\n\n plugin.priority && (hasPriority = 1);\n }\n\n if (!harness || harnessVars) {\n for (p in cleanVars) {\n if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) {\n plugin.priority && (hasPriority = 1);\n } else {\n ptLookup[p] = pt = _addPropTween.call(tween, target, p, \"get\", cleanVars[p], index, fullTargets, 0, vars.stringFilter);\n }\n }\n }\n\n tween._op && tween._op[i] && tween.kill(target, tween._op[i]);\n\n if (autoOverwrite && tween._pt) {\n _overwritingTween = tween;\n\n _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time)); // make sure the overwriting doesn't overwrite THIS tween!!!\n\n\n overwritten = !tween.parent;\n _overwritingTween = 0;\n }\n\n tween._pt && lazy && (_lazyLookup[gsData.id] = 1);\n }\n\n hasPriority && _sortPropTweensByPriority(tween);\n tween._onInit && tween._onInit(tween); //plugins like RoundProps must wait until ALL of the PropTweens are instantiated. In the plugin's init() function, it sets the _onInit on the tween instance. May not be pretty/intuitive, but it's fast and keeps file size down.\n }\n\n tween._onUpdate = onUpdate;\n tween._initted = (!tween._op || tween._pt) && !overwritten; // if overwrittenProps resulted in the entire tween being killed, do NOT flag it as initted or else it may render for one tick.\n\n keyframes && time <= 0 && tl.render(_bigNum, true, true); // if there's a 0% keyframe, it'll render in the \"before\" state for any staggered/delayed animations thus when the following tween initializes, it'll use the \"before\" state instead of the \"after\" state as the initial values.\n},\n _updatePropTweens = function _updatePropTweens(tween, property, value, start, startIsRelative, ratio, time, skipRecursion) {\n var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property],\n pt,\n rootPT,\n lookup,\n i;\n\n if (!ptCache) {\n ptCache = tween._ptCache[property] = [];\n lookup = tween._ptLookup;\n i = tween._targets.length;\n\n while (i--) {\n pt = lookup[i][property];\n\n if (pt && pt.d && pt.d._pt) {\n // it's a plugin, so find the nested PropTween\n pt = pt.d._pt;\n\n while (pt && pt.p !== property && pt.fp !== property) {\n // \"fp\" is functionParam for things like setting CSS variables which require .setProperty(\"--var-name\", value)\n pt = pt._next;\n }\n }\n\n if (!pt) {\n // there is no PropTween associated with that property, so we must FORCE one to be created and ditch out of this\n // if the tween has other properties that already rendered at new positions, we'd normally have to rewind to put them back like tween.render(0, true) before forcing an _initTween(), but that can create another edge case like tweening a timeline's progress would trigger onUpdates to fire which could move other things around. It's better to just inform users that .resetTo() should ONLY be used for tweens that already have that property. For example, you can't gsap.to(...{ y: 0 }) and then tween.restTo(\"x\", 200) for example.\n _forceAllPropTweens = 1; // otherwise, when we _addPropTween() and it finds no change between the start and end values, it skips creating a PropTween (for efficiency...why tween when there's no difference?) but in this case we NEED that PropTween created so we can edit it.\n\n tween.vars[property] = \"+=0\";\n\n _initTween(tween, time);\n\n _forceAllPropTweens = 0;\n return skipRecursion ? _warn(property + \" not eligible for reset\") : 1; // if someone tries to do a quickTo() on a special property like borderRadius which must get split into 4 different properties, that's not eligible for .resetTo().\n }\n\n ptCache.push(pt);\n }\n }\n\n i = ptCache.length;\n\n while (i--) {\n rootPT = ptCache[i];\n pt = rootPT._pt || rootPT; // complex values may have nested PropTweens. We only accommodate the FIRST value.\n\n pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c;\n pt.c = value - pt.s;\n rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e)); // mainly for CSSPlugin (end value)\n\n rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b)); // (beginning value)\n }\n},\n _addAliasesToVars = function _addAliasesToVars(targets, vars) {\n var harness = targets[0] ? _getCache(targets[0]).harness : 0,\n propertyAliases = harness && harness.aliases,\n copy,\n p,\n i,\n aliases;\n\n if (!propertyAliases) {\n return vars;\n }\n\n copy = _merge({}, vars);\n\n for (p in propertyAliases) {\n if (p in copy) {\n aliases = propertyAliases[p].split(\",\");\n i = aliases.length;\n\n while (i--) {\n copy[aliases[i]] = copy[p];\n }\n }\n }\n\n return copy;\n},\n // parses multiple formats, like {\"0%\": {x: 100}, {\"50%\": {x: -20}} and { x: {\"0%\": 100, \"50%\": -20} }, and an \"ease\" can be set on any object. We populate an \"allProps\" object with an Array for each property, like {x: [{}, {}], y:[{}, {}]} with data for each property tween. The objects have a \"t\" (time), \"v\", (value), and \"e\" (ease) property. This allows us to piece together a timeline later.\n_parseKeyframe = function _parseKeyframe(prop, obj, allProps, easeEach) {\n var ease = obj.ease || easeEach || \"power1.inOut\",\n p,\n a;\n\n if (_isArray(obj)) {\n a = allProps[prop] || (allProps[prop] = []); // t = time (out of 100), v = value, e = ease\n\n obj.forEach(function (value, i) {\n return a.push({\n t: i / (obj.length - 1) * 100,\n v: value,\n e: ease\n });\n });\n } else {\n for (p in obj) {\n a = allProps[p] || (allProps[p] = []);\n p === \"ease\" || a.push({\n t: parseFloat(prop),\n v: obj[p],\n e: ease\n });\n }\n }\n},\n _parseFuncOrString = function _parseFuncOrString(value, tween, i, target, targets) {\n return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf(\"random(\") ? _replaceRandom(value) : value;\n},\n _staggerTweenProps = _callbackNames + \"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert\",\n _staggerPropsToSkip = {};\n\n_forEachName(_staggerTweenProps + \",id,stagger,delay,duration,paused,scrollTrigger\", function (name) {\n return _staggerPropsToSkip[name] = 1;\n});\n/*\n * --------------------------------------------------------------------------------------\n * TWEEN\n * --------------------------------------------------------------------------------------\n */\n\n\nexport var Tween = /*#__PURE__*/function (_Animation2) {\n _inheritsLoose(Tween, _Animation2);\n\n function Tween(targets, vars, position, skipInherit) {\n var _this3;\n\n if (typeof vars === \"number\") {\n position.duration = vars;\n vars = position;\n position = null;\n }\n\n _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this;\n var _this3$vars = _this3.vars,\n duration = _this3$vars.duration,\n delay = _this3$vars.delay,\n immediateRender = _this3$vars.immediateRender,\n stagger = _this3$vars.stagger,\n overwrite = _this3$vars.overwrite,\n keyframes = _this3$vars.keyframes,\n defaults = _this3$vars.defaults,\n scrollTrigger = _this3$vars.scrollTrigger,\n yoyoEase = _this3$vars.yoyoEase,\n parent = vars.parent || _globalTimeline,\n parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : \"length\" in vars) ? [targets] : toArray(targets),\n tl,\n i,\n copy,\n l,\n p,\n curTarget,\n staggerFunc,\n staggerVarsToMerge;\n _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn(\"GSAP target \" + targets + \" not found. https://gsap.com\", !_config.nullTargetWarn) || [];\n _this3._ptLookup = []; //PropTween lookup. An array containing an object for each target, having keys for each tweening property\n\n _this3._overwrite = overwrite;\n\n if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {\n vars = _this3.vars;\n tl = _this3.timeline = new Timeline({\n data: \"nested\",\n defaults: defaults || {},\n targets: parent && parent.data === \"nested\" ? parent.vars.targets : parsedTargets\n }); // we need to store the targets because for staggers and keyframes, we end up creating an individual tween for each but function-based values need to know the index and the whole Array of targets.\n\n tl.kill();\n tl.parent = tl._dp = _assertThisInitialized(_this3);\n tl._start = 0;\n\n if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {\n l = parsedTargets.length;\n staggerFunc = stagger && distribute(stagger);\n\n if (_isObject(stagger)) {\n //users can pass in callbacks like onStart/onComplete in the stagger object. These should fire with each individual tween.\n for (p in stagger) {\n if (~_staggerTweenProps.indexOf(p)) {\n staggerVarsToMerge || (staggerVarsToMerge = {});\n staggerVarsToMerge[p] = stagger[p];\n }\n }\n }\n\n for (i = 0; i < l; i++) {\n copy = _copyExcluding(vars, _staggerPropsToSkip);\n copy.stagger = 0;\n yoyoEase && (copy.yoyoEase = yoyoEase);\n staggerVarsToMerge && _merge(copy, staggerVarsToMerge);\n curTarget = parsedTargets[i]; //don't just copy duration or delay because if they're a string or function, we'd end up in an infinite loop because _isFuncOrString() would evaluate as true in the child tweens, entering this loop, etc. So we parse the value straight from vars and default to 0.\n\n copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets);\n copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay;\n\n if (!stagger && l === 1 && copy.delay) {\n // if someone does delay:\"random(1, 5)\", repeat:-1, for example, the delay shouldn't be inside the repeat.\n _this3._delay = delay = copy.delay;\n _this3._start += delay;\n copy.delay = 0;\n }\n\n tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0);\n tl._ease = _easeMap.none;\n }\n\n tl.duration() ? duration = delay = 0 : _this3.timeline = 0; // if the timeline's duration is 0, we don't need a timeline internally!\n } else if (keyframes) {\n _inheritDefaults(_setDefaults(tl.vars.defaults, {\n ease: \"none\"\n }));\n\n tl._ease = _parseEase(keyframes.ease || vars.ease || \"none\");\n var time = 0,\n a,\n kf,\n v;\n\n if (_isArray(keyframes)) {\n keyframes.forEach(function (frame) {\n return tl.to(parsedTargets, frame, \">\");\n });\n tl.duration(); // to ensure tl._dur is cached because we tap into it for performance purposes in the render() method.\n } else {\n copy = {};\n\n for (p in keyframes) {\n p === \"ease\" || p === \"easeEach\" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach);\n }\n\n for (p in copy) {\n a = copy[p].sort(function (a, b) {\n return a.t - b.t;\n });\n time = 0;\n\n for (i = 0; i < a.length; i++) {\n kf = a[i];\n v = {\n ease: kf.e,\n duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration\n };\n v[p] = kf.v;\n tl.to(parsedTargets, v, time);\n time += v.duration;\n }\n }\n\n tl.duration() < duration && tl.to({}, {\n duration: duration - tl.duration()\n }); // in case keyframes didn't go to 100%\n }\n }\n\n duration || _this3.duration(duration = tl.duration());\n } else {\n _this3.timeline = 0; //speed optimization, faster lookups (no going up the prototype chain)\n }\n\n if (overwrite === true && !_suppressOverwrites) {\n _overwritingTween = _assertThisInitialized(_this3);\n\n _globalTimeline.killTweensOf(parsedTargets);\n\n _overwritingTween = 0;\n }\n\n _addToTimeline(parent, _assertThisInitialized(_this3), position);\n\n vars.reversed && _this3.reverse();\n vars.paused && _this3.paused(true);\n\n if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== \"nested\") {\n _this3._tTime = -_tinyNum; //forces a render without having to set the render() \"force\" parameter to true because we want to allow lazying by default (using the \"force\" parameter always forces an immediate full render)\n\n _this3.render(Math.max(0, -delay) || 0); //in case delay is negative\n\n }\n\n scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger);\n return _this3;\n }\n\n var _proto3 = Tween.prototype;\n\n _proto3.render = function render(totalTime, suppressEvents, force) {\n var prevTime = this._time,\n tDur = this._tDur,\n dur = this._dur,\n isNegative = totalTime < 0,\n tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime,\n time,\n pt,\n iteration,\n cycleDuration,\n prevIteration,\n isYoyo,\n ratio,\n timeline,\n yoyoEase;\n\n if (!dur) {\n _renderZeroDurationTween(this, totalTime, suppressEvents, force);\n } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) {\n //this senses if we're crossing over the start time, in which case we must record _zTime and force the render, but we do it in this lengthy conditional way for performance reasons (usually we can skip the calculations): this._initted && (this._zTime < 0) !== (totalTime < 0)\n time = tTime;\n timeline = this.timeline;\n\n if (this._repeat) {\n //adjust the time for repeats and yoyos\n cycleDuration = dur + this._rDelay;\n\n if (this._repeat < -1 && isNegative) {\n return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);\n }\n\n time = _roundPrecise(tTime % cycleDuration); //round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)\n\n if (tTime === tDur) {\n // the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)\n iteration = this._repeat;\n time = dur;\n } else {\n iteration = ~~(tTime / cycleDuration);\n\n if (iteration && iteration === _roundPrecise(tTime / cycleDuration)) {\n time = dur;\n iteration--;\n }\n\n time > dur && (time = dur);\n }\n\n isYoyo = this._yoyo && iteration & 1;\n\n if (isYoyo) {\n yoyoEase = this._yEase;\n time = dur - time;\n }\n\n prevIteration = _animationCycle(this._tTime, cycleDuration);\n\n if (time === prevTime && !force && this._initted && iteration === prevIteration) {\n //could be during the repeatDelay part. No need to render and fire callbacks.\n this._tTime = tTime;\n return this;\n }\n\n if (iteration !== prevIteration) {\n timeline && this._yEase && _propagateYoyoEase(timeline, isYoyo); //repeatRefresh functionality\n\n if (this.vars.repeatRefresh && !isYoyo && !this._lock && this._time !== cycleDuration && this._initted) {\n // this._time will === cycleDuration when we render at EXACTLY the end of an iteration. Without this condition, it'd often do the repeatRefresh render TWICE (again on the very next tick).\n this._lock = force = 1; //force, otherwise if lazy is true, the _attemptInitTween() will return and we'll jump out and get caught bouncing on each tick.\n\n this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;\n }\n }\n }\n\n if (!this._initted) {\n if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) {\n this._tTime = 0; // in constructor if immediateRender is true, we set _tTime to -_tinyNum to have the playhead cross the starting point but we can't leave _tTime as a negative number.\n\n return this;\n }\n\n if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) {\n // rare edge case - during initialization, an onUpdate in the _startAt (.fromTo()) might force this tween to render at a different spot in which case we should ditch this render() call so that it doesn't revert the values. But we also don't want to dump if we're doing a repeatRefresh render!\n return this;\n }\n\n if (dur !== this._dur) {\n // while initting, a plugin like InertiaPlugin might alter the duration, so rerun from the start to ensure everything renders as it should.\n return this.render(totalTime, suppressEvents, force);\n }\n }\n\n this._tTime = tTime;\n this._time = time;\n\n if (!this._act && this._ts) {\n this._act = 1; //as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.\n\n this._lazy = 0;\n }\n\n this.ratio = ratio = (yoyoEase || this._ease)(time / dur);\n\n if (this._from) {\n this.ratio = ratio = 1 - ratio;\n }\n\n if (time && !prevTime && !suppressEvents && !iteration) {\n _callback(this, \"onStart\");\n\n if (this._tTime !== tTime) {\n // in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.\n return this;\n }\n }\n\n pt = this._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n\n timeline && timeline.render(totalTime < 0 ? totalTime : timeline._dur * timeline._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime);\n\n if (this._onUpdate && !suppressEvents) {\n isNegative && _rewindStartAt(this, totalTime, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.\n\n _callback(this, \"onUpdate\");\n }\n\n this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, \"onRepeat\");\n\n if ((tTime === this._tDur || !tTime) && this._tTime === tTime) {\n isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true);\n (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); // don't remove if we're rendering at exactly a time of 0, as there could be autoRevert values that should get set on the next tick (if the playhead goes backward beyond the startTime, negative totalTime). Don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.\n\n if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) {\n // if prevTime and tTime are zero, we shouldn't fire the onReverseComplete. This could happen if you gsap.to(... {paused:true}).play();\n _callback(this, tTime === tDur ? \"onComplete\" : \"onReverseComplete\", true);\n\n this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();\n }\n }\n }\n\n return this;\n };\n\n _proto3.targets = function targets() {\n return this._targets;\n };\n\n _proto3.invalidate = function invalidate(soft) {\n // \"soft\" gives us a way to clear out everything EXCEPT the recorded pre-\"from\" portion of from() tweens. Otherwise, for example, if you tween.progress(1).render(0, true true).invalidate(), the \"from\" values would persist and then on the next render, the from() tweens would initialize and the current value would match the \"from\" values, thus animate from the same value to the same value (no animation). We tap into this in ScrollTrigger's refresh() where we must push a tween to completion and then back again but honor its init state in case the tween is dependent on another tween further up on the page.\n (!soft || !this.vars.runBackwards) && (this._startAt = 0);\n this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0;\n this._ptLookup = [];\n this.timeline && this.timeline.invalidate(soft);\n return _Animation2.prototype.invalidate.call(this, soft);\n };\n\n _proto3.resetTo = function resetTo(property, value, start, startIsRelative, skipRecursion) {\n _tickerActive || _ticker.wake();\n this._ts || this.play();\n var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts),\n ratio;\n this._initted || _initTween(this, time);\n ratio = this._ease(time / this._dur); // don't just get tween.ratio because it may not have rendered yet.\n // possible future addition to allow an object with multiple values to update, like tween.resetTo({x: 100, y: 200}); At this point, it doesn't seem worth the added kb given the fact that most users will likely opt for the convenient gsap.quickTo() way of interacting with this method.\n // if (_isObject(property)) { // performance optimization\n // \tfor (p in property) {\n // \t\tif (_updatePropTweens(this, p, property[p], value ? value[p] : null, start, ratio, time)) {\n // \t\t\treturn this.resetTo(property, value, start, startIsRelative); // if a PropTween wasn't found for the property, it'll get forced with a re-initialization so we need to jump out and start over again.\n // \t\t}\n // \t}\n // } else {\n\n if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time, skipRecursion)) {\n return this.resetTo(property, value, start, startIsRelative, 1); // if a PropTween wasn't found for the property, it'll get forced with a re-initialization so we need to jump out and start over again.\n } //}\n\n\n _alignPlayhead(this, 0);\n\n this.parent || _addLinkedListItem(this._dp, this, \"_first\", \"_last\", this._dp._sort ? \"_start\" : 0);\n return this.render(0);\n };\n\n _proto3.kill = function kill(targets, vars) {\n if (vars === void 0) {\n vars = \"all\";\n }\n\n if (!targets && (!vars || vars === \"all\")) {\n this._lazy = this._pt = 0;\n return this.parent ? _interrupt(this) : this;\n }\n\n if (this.timeline) {\n var tDur = this.timeline.totalDuration();\n this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this); // if nothing is left tweening, interrupt.\n\n this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1); // if a nested tween is killed that changes the duration, it should affect this tween's duration. We must use the ratio, though, because sometimes the internal timeline is stretched like for keyframes where they don't all add up to whatever the parent tween's duration was set to.\n\n return this;\n }\n\n var parsedTargets = this._targets,\n killingTargets = targets ? toArray(targets) : parsedTargets,\n propTweenLookup = this._ptLookup,\n firstPT = this._pt,\n overwrittenProps,\n curLookup,\n curOverwriteProps,\n props,\n p,\n pt,\n i;\n\n if ((!vars || vars === \"all\") && _arraysMatch(parsedTargets, killingTargets)) {\n vars === \"all\" && (this._pt = 0);\n return _interrupt(this);\n }\n\n overwrittenProps = this._op = this._op || [];\n\n if (vars !== \"all\") {\n //so people can pass in a comma-delimited list of property names\n if (_isString(vars)) {\n p = {};\n\n _forEachName(vars, function (name) {\n return p[name] = 1;\n });\n\n vars = p;\n }\n\n vars = _addAliasesToVars(parsedTargets, vars);\n }\n\n i = parsedTargets.length;\n\n while (i--) {\n if (~killingTargets.indexOf(parsedTargets[i])) {\n curLookup = propTweenLookup[i];\n\n if (vars === \"all\") {\n overwrittenProps[i] = vars;\n props = curLookup;\n curOverwriteProps = {};\n } else {\n curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {};\n props = vars;\n }\n\n for (p in props) {\n pt = curLookup && curLookup[p];\n\n if (pt) {\n if (!(\"kill\" in pt.d) || pt.d.kill(p) === true) {\n _removeLinkedListItem(this, pt, \"_pt\");\n }\n\n delete curLookup[p];\n }\n\n if (curOverwriteProps !== \"all\") {\n curOverwriteProps[p] = 1;\n }\n }\n }\n }\n\n this._initted && !this._pt && firstPT && _interrupt(this); //if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening.\n\n return this;\n };\n\n Tween.to = function to(targets, vars) {\n return new Tween(targets, vars, arguments[2]);\n };\n\n Tween.from = function from(targets, vars) {\n return _createTweenType(1, arguments);\n };\n\n Tween.delayedCall = function delayedCall(delay, callback, params, scope) {\n return new Tween(callback, 0, {\n immediateRender: false,\n lazy: false,\n overwrite: false,\n delay: delay,\n onComplete: callback,\n onReverseComplete: callback,\n onCompleteParams: params,\n onReverseCompleteParams: params,\n callbackScope: scope\n }); // we must use onReverseComplete too for things like timeline.add(() => {...}) which should be triggered in BOTH directions (forward and reverse)\n };\n\n Tween.fromTo = function fromTo(targets, fromVars, toVars) {\n return _createTweenType(2, arguments);\n };\n\n Tween.set = function set(targets, vars) {\n vars.duration = 0;\n vars.repeatDelay || (vars.repeat = 0);\n return new Tween(targets, vars);\n };\n\n Tween.killTweensOf = function killTweensOf(targets, props, onlyActive) {\n return _globalTimeline.killTweensOf(targets, props, onlyActive);\n };\n\n return Tween;\n}(Animation);\n\n_setDefaults(Tween.prototype, {\n _targets: [],\n _lazy: 0,\n _startAt: 0,\n _op: 0,\n _onInit: 0\n}); //add the pertinent timeline methods to Tween instances so that users can chain conveniently and create a timeline automatically. (removed due to concerns that it'd ultimately add to more confusion especially for beginners)\n// _forEachName(\"to,from,fromTo,set,call,add,addLabel,addPause\", name => {\n// \tTween.prototype[name] = function() {\n// \t\tlet tl = new Timeline();\n// \t\treturn _addToTimeline(tl, this)[name].apply(tl, toArray(arguments));\n// \t}\n// });\n//for backward compatibility. Leverage the timeline calls.\n\n\n_forEachName(\"staggerTo,staggerFrom,staggerFromTo\", function (name) {\n Tween[name] = function () {\n var tl = new Timeline(),\n params = _slice.call(arguments, 0);\n\n params.splice(name === \"staggerFromTo\" ? 5 : 4, 0, 0);\n return tl[name].apply(tl, params);\n };\n});\n/*\n * --------------------------------------------------------------------------------------\n * PROPTWEEN\n * --------------------------------------------------------------------------------------\n */\n\n\nvar _setterPlain = function _setterPlain(target, property, value) {\n return target[property] = value;\n},\n _setterFunc = function _setterFunc(target, property, value) {\n return target[property](value);\n},\n _setterFuncWithParam = function _setterFuncWithParam(target, property, value, data) {\n return target[property](data.fp, value);\n},\n _setterAttribute = function _setterAttribute(target, property, value) {\n return target.setAttribute(property, value);\n},\n _getSetter = function _getSetter(target, property) {\n return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain;\n},\n _renderPlain = function _renderPlain(ratio, data) {\n return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1000000) / 1000000, data);\n},\n _renderBoolean = function _renderBoolean(ratio, data) {\n return data.set(data.t, data.p, !!(data.s + data.c * ratio), data);\n},\n _renderComplexString = function _renderComplexString(ratio, data) {\n var pt = data._pt,\n s = \"\";\n\n if (!ratio && data.b) {\n //b = beginning string\n s = data.b;\n } else if (ratio === 1 && data.e) {\n //e = ending string\n s = data.e;\n } else {\n while (pt) {\n s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 10000) / 10000) + s; //we use the \"p\" property for the text inbetween (like a suffix). And in the context of a complex string, the modifier (m) is typically just Math.round(), like for RGB colors.\n\n pt = pt._next;\n }\n\n s += data.c; //we use the \"c\" of the PropTween to store the final chunk of non-numeric text.\n }\n\n data.set(data.t, data.p, s, data);\n},\n _renderPropTweens = function _renderPropTweens(ratio, data) {\n var pt = data._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n},\n _addPluginModifier = function _addPluginModifier(modifier, tween, target, property) {\n var pt = this._pt,\n next;\n\n while (pt) {\n next = pt._next;\n pt.p === property && pt.modifier(modifier, tween, target);\n pt = next;\n }\n},\n _killPropTweensOf = function _killPropTweensOf(property) {\n var pt = this._pt,\n hasNonDependentRemaining,\n next;\n\n while (pt) {\n next = pt._next;\n\n if (pt.p === property && !pt.op || pt.op === property) {\n _removeLinkedListItem(this, pt, \"_pt\");\n } else if (!pt.dep) {\n hasNonDependentRemaining = 1;\n }\n\n pt = next;\n }\n\n return !hasNonDependentRemaining;\n},\n _setterWithModifier = function _setterWithModifier(target, property, value, data) {\n data.mSet(target, property, data.m.call(data.tween, value, data.mt), data);\n},\n _sortPropTweensByPriority = function _sortPropTweensByPriority(parent) {\n var pt = parent._pt,\n next,\n pt2,\n first,\n last; //sorts the PropTween linked list in order of priority because some plugins need to do their work after ALL of the PropTweens were created (like RoundPropsPlugin and ModifiersPlugin)\n\n while (pt) {\n next = pt._next;\n pt2 = first;\n\n while (pt2 && pt2.pr > pt.pr) {\n pt2 = pt2._next;\n }\n\n if (pt._prev = pt2 ? pt2._prev : last) {\n pt._prev._next = pt;\n } else {\n first = pt;\n }\n\n if (pt._next = pt2) {\n pt2._prev = pt;\n } else {\n last = pt;\n }\n\n pt = next;\n }\n\n parent._pt = first;\n}; //PropTween key: t = target, p = prop, r = renderer, d = data, s = start, c = change, op = overwriteProperty (ONLY populated when it's different than p), pr = priority, _next/_prev for the linked list siblings, set = setter, m = modifier, mSet = modifierSetter (the original setter, before a modifier was added)\n\n\nexport var PropTween = /*#__PURE__*/function () {\n function PropTween(next, target, prop, start, change, renderer, data, setter, priority) {\n this.t = target;\n this.s = start;\n this.c = change;\n this.p = prop;\n this.r = renderer || _renderPlain;\n this.d = data || this;\n this.set = setter || _setterPlain;\n this.pr = priority || 0;\n this._next = next;\n\n if (next) {\n next._prev = this;\n }\n }\n\n var _proto4 = PropTween.prototype;\n\n _proto4.modifier = function modifier(func, tween, target) {\n this.mSet = this.mSet || this.set; //in case it was already set (a PropTween can only have one modifier)\n\n this.set = _setterWithModifier;\n this.m = func;\n this.mt = target; //modifier target\n\n this.tween = tween;\n };\n\n return PropTween;\n}(); //Initialization tasks\n\n_forEachName(_callbackNames + \"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger\", function (name) {\n return _reservedProps[name] = 1;\n});\n\n_globals.TweenMax = _globals.TweenLite = Tween;\n_globals.TimelineLite = _globals.TimelineMax = Timeline;\n_globalTimeline = new Timeline({\n sortChildren: false,\n defaults: _defaults,\n autoRemoveChildren: true,\n id: \"root\",\n smoothChildTiming: true\n});\n_config.stringFilter = _colorStringFilter;\n\nvar _media = [],\n _listeners = {},\n _emptyArray = [],\n _lastMediaTime = 0,\n _contextID = 0,\n _dispatch = function _dispatch(type) {\n return (_listeners[type] || _emptyArray).map(function (f) {\n return f();\n });\n},\n _onMediaChange = function _onMediaChange() {\n var time = Date.now(),\n matches = [];\n\n if (time - _lastMediaTime > 2) {\n _dispatch(\"matchMediaInit\");\n\n _media.forEach(function (c) {\n var queries = c.queries,\n conditions = c.conditions,\n match,\n p,\n anyMatch,\n toggled;\n\n for (p in queries) {\n match = _win.matchMedia(queries[p]).matches; // Firefox doesn't update the \"matches\" property of the MediaQueryList object correctly - it only does so as it calls its change handler - so we must re-create a media query here to ensure it's accurate.\n\n match && (anyMatch = 1);\n\n if (match !== conditions[p]) {\n conditions[p] = match;\n toggled = 1;\n }\n }\n\n if (toggled) {\n c.revert();\n anyMatch && matches.push(c);\n }\n });\n\n _dispatch(\"matchMediaRevert\");\n\n matches.forEach(function (c) {\n return c.onMatch(c, function (func) {\n return c.add(null, func);\n });\n });\n _lastMediaTime = time;\n\n _dispatch(\"matchMedia\");\n }\n};\n\nvar Context = /*#__PURE__*/function () {\n function Context(func, scope) {\n this.selector = scope && selector(scope);\n this.data = [];\n this._r = []; // returned/cleanup functions\n\n this.isReverted = false;\n this.id = _contextID++; // to work around issues that frameworks like Vue cause by making things into Proxies which make it impossible to do something like _media.indexOf(this) because \"this\" would no longer refer to the Context instance itself - it'd refer to a Proxy! We needed a way to identify the context uniquely\n\n func && this.add(func);\n }\n\n var _proto5 = Context.prototype;\n\n _proto5.add = function add(name, func, scope) {\n // possible future addition if we need the ability to add() an animation to a context and for whatever reason cannot create that animation inside of a context.add(() => {...}) function.\n // if (name && _isFunction(name.revert)) {\n // \tthis.data.push(name);\n // \treturn (name._ctx = this);\n // }\n if (_isFunction(name)) {\n scope = func;\n func = name;\n name = _isFunction;\n }\n\n var self = this,\n f = function f() {\n var prev = _context,\n prevSelector = self.selector,\n result;\n prev && prev !== self && prev.data.push(self);\n scope && (self.selector = selector(scope));\n _context = self;\n result = func.apply(self, arguments);\n _isFunction(result) && self._r.push(result);\n _context = prev;\n self.selector = prevSelector;\n self.isReverted = false;\n return result;\n };\n\n self.last = f;\n return name === _isFunction ? f(self, function (func) {\n return self.add(null, func);\n }) : name ? self[name] = f : f;\n };\n\n _proto5.ignore = function ignore(func) {\n var prev = _context;\n _context = null;\n func(this);\n _context = prev;\n };\n\n _proto5.getTweens = function getTweens() {\n var a = [];\n this.data.forEach(function (e) {\n return e instanceof Context ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === \"nested\") && a.push(e);\n });\n return a;\n };\n\n _proto5.clear = function clear() {\n this._r.length = this.data.length = 0;\n };\n\n _proto5.kill = function kill(revert, matchMedia) {\n var _this4 = this;\n\n if (revert) {\n (function () {\n var tweens = _this4.getTweens(),\n i = _this4.data.length,\n t;\n\n while (i--) {\n // Flip plugin tweens are very different in that they should actually be pushed to their end. The plugin replaces the timeline's .revert() method to do exactly that. But we also need to remove any of those nested tweens inside the flip timeline so that they don't get individually reverted.\n t = _this4.data[i];\n\n if (t.data === \"isFlip\") {\n t.revert();\n t.getChildren(true, true, false).forEach(function (tween) {\n return tweens.splice(tweens.indexOf(tween), 1);\n });\n }\n } // save as an object so that we can cache the globalTime for each tween to optimize performance during the sort\n\n\n tweens.map(function (t) {\n return {\n g: t._dur || t._delay || t._sat && !t._sat.vars.immediateRender ? t.globalTime(0) : -Infinity,\n t: t\n };\n }).sort(function (a, b) {\n return b.g - a.g || -Infinity;\n }).forEach(function (o) {\n return o.t.revert(revert);\n }); // note: all of the _startAt tweens should be reverted in reverse order that they were created, and they'll all have the same globalTime (-1) so the \" || -1\" in the sort keeps the order properly.\n\n i = _this4.data.length;\n\n while (i--) {\n // make sure we loop backwards so that, for example, SplitTexts that were created later on the same element get reverted first\n t = _this4.data[i];\n\n if (t instanceof Timeline) {\n if (t.data !== \"nested\") {\n t.scrollTrigger && t.scrollTrigger.revert();\n t.kill(); // don't revert() the timeline because that's duplicating efforts since we already reverted all the tweens\n }\n } else {\n !(t instanceof Tween) && t.revert && t.revert(revert);\n }\n }\n\n _this4._r.forEach(function (f) {\n return f(revert, _this4);\n });\n\n _this4.isReverted = true;\n })();\n } else {\n this.data.forEach(function (e) {\n return e.kill && e.kill();\n });\n }\n\n this.clear();\n\n if (matchMedia) {\n var i = _media.length;\n\n while (i--) {\n // previously, we checked _media.indexOf(this), but some frameworks like Vue enforce Proxy objects that make it impossible to get the proper result that way, so we must use a unique ID number instead.\n _media[i].id === this.id && _media.splice(i, 1);\n }\n }\n };\n\n _proto5.revert = function revert(config) {\n this.kill(config || {});\n };\n\n return Context;\n}();\n\nvar MatchMedia = /*#__PURE__*/function () {\n function MatchMedia(scope) {\n this.contexts = [];\n this.scope = scope;\n _context && _context.data.push(this);\n }\n\n var _proto6 = MatchMedia.prototype;\n\n _proto6.add = function add(conditions, func, scope) {\n _isObject(conditions) || (conditions = {\n matches: conditions\n });\n var context = new Context(0, scope || this.scope),\n cond = context.conditions = {},\n mq,\n p,\n active;\n _context && !context.selector && (context.selector = _context.selector); // in case a context is created inside a context. Like a gsap.matchMedia() that's inside a scoped gsap.context()\n\n this.contexts.push(context);\n func = context.add(\"onMatch\", func);\n context.queries = conditions;\n\n for (p in conditions) {\n if (p === \"all\") {\n active = 1;\n } else {\n mq = _win.matchMedia(conditions[p]);\n\n if (mq) {\n _media.indexOf(context) < 0 && _media.push(context);\n (cond[p] = mq.matches) && (active = 1);\n mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener(\"change\", _onMediaChange);\n }\n }\n }\n\n active && func(context, function (f) {\n return context.add(null, f);\n });\n return this;\n } // refresh() {\n // \tlet time = _lastMediaTime,\n // \t\tmedia = _media;\n // \t_lastMediaTime = -1;\n // \t_media = this.contexts;\n // \t_onMediaChange();\n // \t_lastMediaTime = time;\n // \t_media = media;\n // }\n ;\n\n _proto6.revert = function revert(config) {\n this.kill(config || {});\n };\n\n _proto6.kill = function kill(revert) {\n this.contexts.forEach(function (c) {\n return c.kill(revert, true);\n });\n };\n\n return MatchMedia;\n}();\n/*\n * --------------------------------------------------------------------------------------\n * GSAP\n * --------------------------------------------------------------------------------------\n */\n\n\nvar _gsap = {\n registerPlugin: function registerPlugin() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n args.forEach(function (config) {\n return _createPlugin(config);\n });\n },\n timeline: function timeline(vars) {\n return new Timeline(vars);\n },\n getTweensOf: function getTweensOf(targets, onlyActive) {\n return _globalTimeline.getTweensOf(targets, onlyActive);\n },\n getProperty: function getProperty(target, property, unit, uncache) {\n _isString(target) && (target = toArray(target)[0]); //in case selector text or an array is passed in\n\n var getter = _getCache(target || {}).get,\n format = unit ? _passThrough : _numericIfPossible;\n\n unit === \"native\" && (unit = \"\");\n return !target ? target : !property ? function (property, unit, uncache) {\n return format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));\n } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));\n },\n quickSetter: function quickSetter(target, property, unit) {\n target = toArray(target);\n\n if (target.length > 1) {\n var setters = target.map(function (t) {\n return gsap.quickSetter(t, property, unit);\n }),\n l = setters.length;\n return function (value) {\n var i = l;\n\n while (i--) {\n setters[i](value);\n }\n };\n }\n\n target = target[0] || {};\n\n var Plugin = _plugins[property],\n cache = _getCache(target),\n p = cache.harness && (cache.harness.aliases || {})[property] || property,\n // in case it's an alias, like \"rotate\" for \"rotation\".\n setter = Plugin ? function (value) {\n var p = new Plugin();\n _quickTween._pt = 0;\n p.init(target, unit ? value + unit : value, _quickTween, 0, [target]);\n p.render(1, p);\n _quickTween._pt && _renderPropTweens(1, _quickTween);\n } : cache.set(target, p);\n\n return Plugin ? setter : function (value) {\n return setter(target, p, unit ? value + unit : value, cache, 1);\n };\n },\n quickTo: function quickTo(target, property, vars) {\n var _merge2;\n\n var tween = gsap.to(target, _merge((_merge2 = {}, _merge2[property] = \"+=0.1\", _merge2.paused = true, _merge2), vars || {})),\n func = function func(value, start, startIsRelative) {\n return tween.resetTo(property, value, start, startIsRelative);\n };\n\n func.tween = tween;\n return func;\n },\n isTweening: function isTweening(targets) {\n return _globalTimeline.getTweensOf(targets, true).length > 0;\n },\n defaults: function defaults(value) {\n value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease));\n return _mergeDeep(_defaults, value || {});\n },\n config: function config(value) {\n return _mergeDeep(_config, value || {});\n },\n registerEffect: function registerEffect(_ref3) {\n var name = _ref3.name,\n effect = _ref3.effect,\n plugins = _ref3.plugins,\n defaults = _ref3.defaults,\n extendTimeline = _ref3.extendTimeline;\n (plugins || \"\").split(\",\").forEach(function (pluginName) {\n return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + \" effect requires \" + pluginName + \" plugin.\");\n });\n\n _effects[name] = function (targets, vars, tl) {\n return effect(toArray(targets), _setDefaults(vars || {}, defaults), tl);\n };\n\n if (extendTimeline) {\n Timeline.prototype[name] = function (targets, vars, position) {\n return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position);\n };\n }\n },\n registerEase: function registerEase(name, ease) {\n _easeMap[name] = _parseEase(ease);\n },\n parseEase: function parseEase(ease, defaultEase) {\n return arguments.length ? _parseEase(ease, defaultEase) : _easeMap;\n },\n getById: function getById(id) {\n return _globalTimeline.getById(id);\n },\n exportRoot: function exportRoot(vars, includeDelayedCalls) {\n if (vars === void 0) {\n vars = {};\n }\n\n var tl = new Timeline(vars),\n child,\n next;\n tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming);\n\n _globalTimeline.remove(tl);\n\n tl._dp = 0; //otherwise it'll get re-activated when adding children and be re-introduced into _globalTimeline's linked list (then added to itself).\n\n tl._time = tl._tTime = _globalTimeline._time;\n child = _globalTimeline._first;\n\n while (child) {\n next = child._next;\n\n if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) {\n _addToTimeline(tl, child, child._start - child._delay);\n }\n\n child = next;\n }\n\n _addToTimeline(_globalTimeline, tl, 0);\n\n return tl;\n },\n context: function context(func, scope) {\n return func ? new Context(func, scope) : _context;\n },\n matchMedia: function matchMedia(scope) {\n return new MatchMedia(scope);\n },\n matchMediaRefresh: function matchMediaRefresh() {\n return _media.forEach(function (c) {\n var cond = c.conditions,\n found,\n p;\n\n for (p in cond) {\n if (cond[p]) {\n cond[p] = false;\n found = 1;\n }\n }\n\n found && c.revert();\n }) || _onMediaChange();\n },\n addEventListener: function addEventListener(type, callback) {\n var a = _listeners[type] || (_listeners[type] = []);\n ~a.indexOf(callback) || a.push(callback);\n },\n removeEventListener: function removeEventListener(type, callback) {\n var a = _listeners[type],\n i = a && a.indexOf(callback);\n i >= 0 && a.splice(i, 1);\n },\n utils: {\n wrap: wrap,\n wrapYoyo: wrapYoyo,\n distribute: distribute,\n random: random,\n snap: snap,\n normalize: normalize,\n getUnit: getUnit,\n clamp: clamp,\n splitColor: splitColor,\n toArray: toArray,\n selector: selector,\n mapRange: mapRange,\n pipe: pipe,\n unitize: unitize,\n interpolate: interpolate,\n shuffle: shuffle\n },\n install: _install,\n effects: _effects,\n ticker: _ticker,\n updateRoot: Timeline.updateRoot,\n plugins: _plugins,\n globalTimeline: _globalTimeline,\n core: {\n PropTween: PropTween,\n globals: _addGlobal,\n Tween: Tween,\n Timeline: Timeline,\n Animation: Animation,\n getCache: _getCache,\n _removeLinkedListItem: _removeLinkedListItem,\n reverting: function reverting() {\n return _reverting;\n },\n context: function context(toAdd) {\n if (toAdd && _context) {\n _context.data.push(toAdd);\n\n toAdd._ctx = _context;\n }\n\n return _context;\n },\n suppressOverwrites: function suppressOverwrites(value) {\n return _suppressOverwrites = value;\n }\n }\n};\n\n_forEachName(\"to,from,fromTo,delayedCall,set,killTweensOf\", function (name) {\n return _gsap[name] = Tween[name];\n});\n\n_ticker.add(Timeline.updateRoot);\n\n_quickTween = _gsap.to({}, {\n duration: 0\n}); // ---- EXTRA PLUGINS --------------------------------------------------------\n\nvar _getPluginPropTween = function _getPluginPropTween(plugin, prop) {\n var pt = plugin._pt;\n\n while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) {\n pt = pt._next;\n }\n\n return pt;\n},\n _addModifiers = function _addModifiers(tween, modifiers) {\n var targets = tween._targets,\n p,\n i,\n pt;\n\n for (p in modifiers) {\n i = targets.length;\n\n while (i--) {\n pt = tween._ptLookup[i][p];\n\n if (pt && (pt = pt.d)) {\n if (pt._pt) {\n // is a plugin\n pt = _getPluginPropTween(pt, p);\n }\n\n pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p);\n }\n }\n }\n},\n _buildModifierPlugin = function _buildModifierPlugin(name, modifier) {\n return {\n name: name,\n rawVars: 1,\n //don't pre-process function-based values or \"random()\" strings.\n init: function init(target, vars, tween) {\n tween._onInit = function (tween) {\n var temp, p;\n\n if (_isString(vars)) {\n temp = {};\n\n _forEachName(vars, function (name) {\n return temp[name] = 1;\n }); //if the user passes in a comma-delimited list of property names to roundProps, like \"x,y\", we round to whole numbers.\n\n\n vars = temp;\n }\n\n if (modifier) {\n temp = {};\n\n for (p in vars) {\n temp[p] = modifier(vars[p]);\n }\n\n vars = temp;\n }\n\n _addModifiers(tween, vars);\n };\n }\n };\n}; //register core plugins\n\n\nexport var gsap = _gsap.registerPlugin({\n name: \"attr\",\n init: function init(target, vars, tween, index, targets) {\n var p, pt, v;\n this.tween = tween;\n\n for (p in vars) {\n v = target.getAttribute(p) || \"\";\n pt = this.add(target, \"setAttribute\", (v || 0) + \"\", vars[p], index, targets, 0, 0, p);\n pt.op = p;\n pt.b = v; // record the beginning value so we can revert()\n\n this._props.push(p);\n }\n },\n render: function render(ratio, data) {\n var pt = data._pt;\n\n while (pt) {\n _reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d); // if reverting, go back to the original (pt.b)\n\n pt = pt._next;\n }\n }\n}, {\n name: \"endArray\",\n init: function init(target, value) {\n var i = value.length;\n\n while (i--) {\n this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1);\n }\n }\n}, _buildModifierPlugin(\"roundProps\", _roundModifier), _buildModifierPlugin(\"modifiers\"), _buildModifierPlugin(\"snap\", snap)) || _gsap; //to prevent the core plugins from being dropped via aggressive tree shaking, we must include them in the variable declaration in this way.\n\nTween.version = Timeline.version = gsap.version = \"3.12.5\";\n_coreReady = 1;\n_windowExists() && _wake();\nvar Power0 = _easeMap.Power0,\n Power1 = _easeMap.Power1,\n Power2 = _easeMap.Power2,\n Power3 = _easeMap.Power3,\n Power4 = _easeMap.Power4,\n Linear = _easeMap.Linear,\n Quad = _easeMap.Quad,\n Cubic = _easeMap.Cubic,\n Quart = _easeMap.Quart,\n Quint = _easeMap.Quint,\n Strong = _easeMap.Strong,\n Elastic = _easeMap.Elastic,\n Back = _easeMap.Back,\n SteppedEase = _easeMap.SteppedEase,\n Bounce = _easeMap.Bounce,\n Sine = _easeMap.Sine,\n Expo = _easeMap.Expo,\n Circ = _easeMap.Circ;\nexport { Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ };\nexport { Tween as TweenMax, Tween as TweenLite, Timeline as TimelineMax, Timeline as TimelineLite, gsap as default, wrap, wrapYoyo, distribute, random, snap, normalize, getUnit, clamp, splitColor, toArray, selector, mapRange, pipe, unitize, interpolate, shuffle }; //export some internal methods/orojects for use in CSSPlugin so that we can externalize that file and allow custom builds that exclude it.\n\nexport { _getProperty, _numExp, _numWithUnitExp, _isString, _isUndefined, _renderComplexString, _relExp, _setDefaults, _removeLinkedListItem, _forEachName, _sortPropTweensByPriority, _colorStringFilter, _replaceRandom, _checkPlugin, _plugins, _ticker, _config, _roundModifier, _round, _missingPlugin, _getSetter, _getCache, _colorExp, _parseRelative };","/*!\n * CSSPlugin 3.12.5\n * https://gsap.com\n *\n * Copyright 2008-2024, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license or for\n * Club GSAP members, the agreement issued with that membership.\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nimport { gsap, _getProperty, _numExp, _numWithUnitExp, getUnit, _isString, _isUndefined, _renderComplexString, _relExp, _forEachName, _sortPropTweensByPriority, _colorStringFilter, _checkPlugin, _replaceRandom, _plugins, GSCache, PropTween, _config, _ticker, _round, _missingPlugin, _getSetter, _getCache, _colorExp, _parseRelative, _setDefaults, _removeLinkedListItem //for the commented-out className feature.\n} from \"./gsap-core.js\";\n\nvar _win,\n _doc,\n _docElement,\n _pluginInitted,\n _tempDiv,\n _tempDivStyler,\n _recentSetterPlugin,\n _reverting,\n _windowExists = function _windowExists() {\n return typeof window !== \"undefined\";\n},\n _transformProps = {},\n _RAD2DEG = 180 / Math.PI,\n _DEG2RAD = Math.PI / 180,\n _atan2 = Math.atan2,\n _bigNum = 1e8,\n _capsExp = /([A-Z])/g,\n _horizontalExp = /(left|right|width|margin|padding|x)/i,\n _complexExp = /[\\s,\\(]\\S/,\n _propertyAliases = {\n autoAlpha: \"opacity,visibility\",\n scale: \"scaleX,scaleY\",\n alpha: \"opacity\"\n},\n _renderCSSProp = function _renderCSSProp(ratio, data) {\n return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data);\n},\n _renderPropWithEnd = function _renderPropWithEnd(ratio, data) {\n return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data);\n},\n _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning(ratio, data) {\n return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u : data.b, data);\n},\n //if units change, we need a way to render the original unit/value when the tween goes all the way back to the beginning (ratio:0)\n_renderRoundedCSSProp = function _renderRoundedCSSProp(ratio, data) {\n var value = data.s + data.c * ratio;\n data.set(data.t, data.p, ~~(value + (value < 0 ? -.5 : .5)) + data.u, data);\n},\n _renderNonTweeningValue = function _renderNonTweeningValue(ratio, data) {\n return data.set(data.t, data.p, ratio ? data.e : data.b, data);\n},\n _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd(ratio, data) {\n return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data);\n},\n _setterCSSStyle = function _setterCSSStyle(target, property, value) {\n return target.style[property] = value;\n},\n _setterCSSProp = function _setterCSSProp(target, property, value) {\n return target.style.setProperty(property, value);\n},\n _setterTransform = function _setterTransform(target, property, value) {\n return target._gsap[property] = value;\n},\n _setterScale = function _setterScale(target, property, value) {\n return target._gsap.scaleX = target._gsap.scaleY = value;\n},\n _setterScaleWithRender = function _setterScaleWithRender(target, property, value, data, ratio) {\n var cache = target._gsap;\n cache.scaleX = cache.scaleY = value;\n cache.renderTransform(ratio, cache);\n},\n _setterTransformWithRender = function _setterTransformWithRender(target, property, value, data, ratio) {\n var cache = target._gsap;\n cache[property] = value;\n cache.renderTransform(ratio, cache);\n},\n _transformProp = \"transform\",\n _transformOriginProp = _transformProp + \"Origin\",\n _saveStyle = function _saveStyle(property, isNotCSS) {\n var _this = this;\n\n var target = this.target,\n style = target.style,\n cache = target._gsap;\n\n if (property in _transformProps && style) {\n this.tfm = this.tfm || {};\n\n if (property !== \"transform\") {\n property = _propertyAliases[property] || property;\n ~property.indexOf(\",\") ? property.split(\",\").forEach(function (a) {\n return _this.tfm[a] = _get(target, a);\n }) : this.tfm[property] = cache.x ? cache[property] : _get(target, property); // note: scale would map to \"scaleX,scaleY\", thus we loop and apply them both.\n\n property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin);\n } else {\n return _propertyAliases.transform.split(\",\").forEach(function (p) {\n return _saveStyle.call(_this, p, isNotCSS);\n });\n }\n\n if (this.props.indexOf(_transformProp) >= 0) {\n return;\n }\n\n if (cache.svg) {\n this.svgo = target.getAttribute(\"data-svg-origin\");\n this.props.push(_transformOriginProp, isNotCSS, \"\");\n }\n\n property = _transformProp;\n }\n\n (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]);\n},\n _removeIndependentTransforms = function _removeIndependentTransforms(style) {\n if (style.translate) {\n style.removeProperty(\"translate\");\n style.removeProperty(\"scale\");\n style.removeProperty(\"rotate\");\n }\n},\n _revertStyle = function _revertStyle() {\n var props = this.props,\n target = this.target,\n style = target.style,\n cache = target._gsap,\n i,\n p;\n\n for (i = 0; i < props.length; i += 3) {\n // stored like this: property, isNotCSS, value\n props[i + 1] ? target[props[i]] = props[i + 2] : props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].substr(0, 2) === \"--\" ? props[i] : props[i].replace(_capsExp, \"-$1\").toLowerCase());\n }\n\n if (this.tfm) {\n for (p in this.tfm) {\n cache[p] = this.tfm[p];\n }\n\n if (cache.svg) {\n cache.renderTransform();\n target.setAttribute(\"data-svg-origin\", this.svgo || \"\");\n }\n\n i = _reverting();\n\n if ((!i || !i.isStart) && !style[_transformProp]) {\n _removeIndependentTransforms(style);\n\n if (cache.zOrigin && style[_transformOriginProp]) {\n style[_transformOriginProp] += \" \" + cache.zOrigin + \"px\"; // since we're uncaching, we must put the zOrigin back into the transformOrigin so that we can pull it out accurately when we parse again. Otherwise, we'd lose the z portion of the origin since we extract it to protect from Safari bugs.\n\n cache.zOrigin = 0;\n cache.renderTransform();\n }\n\n cache.uncache = 1; // if it's a startAt that's being reverted in the _initTween() of the core, we don't need to uncache transforms. This is purely a performance optimization.\n }\n }\n},\n _getStyleSaver = function _getStyleSaver(target, properties) {\n var saver = {\n target: target,\n props: [],\n revert: _revertStyle,\n save: _saveStyle\n };\n target._gsap || gsap.core.getCache(target); // just make sure there's a _gsap cache defined because we read from it in _saveStyle() and it's more efficient to just check it here once.\n\n properties && properties.split(\",\").forEach(function (p) {\n return saver.save(p);\n });\n return saver;\n},\n _supports3D,\n _createElement = function _createElement(type, ns) {\n var e = _doc.createElementNS ? _doc.createElementNS((ns || \"http://www.w3.org/1999/xhtml\").replace(/^https/, \"http\"), type) : _doc.createElement(type); //some servers swap in https for http in the namespace which can break things, making \"style\" inaccessible.\n\n return e && e.style ? e : _doc.createElement(type); //some environments won't allow access to the element's style when created with a namespace in which case we default to the standard createElement() to work around the issue. Also note that when GSAP is embedded directly inside an SVG file, createElement() won't allow access to the style object in Firefox (see https://gsap.com/forums/topic/20215-problem-using-tweenmax-in-standalone-self-containing-svg-file-err-cannot-set-property-csstext-of-undefined/).\n},\n _getComputedProperty = function _getComputedProperty(target, property, skipPrefixFallback) {\n var cs = getComputedStyle(target);\n return cs[property] || cs.getPropertyValue(property.replace(_capsExp, \"-$1\").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty(target, _checkPropPrefix(property) || property, 1) || \"\"; //css variables may not need caps swapped out for dashes and lowercase.\n},\n _prefixes = \"O,Moz,ms,Ms,Webkit\".split(\",\"),\n _checkPropPrefix = function _checkPropPrefix(property, element, preferPrefix) {\n var e = element || _tempDiv,\n s = e.style,\n i = 5;\n\n if (property in s && !preferPrefix) {\n return property;\n }\n\n property = property.charAt(0).toUpperCase() + property.substr(1);\n\n while (i-- && !(_prefixes[i] + property in s)) {}\n\n return i < 0 ? null : (i === 3 ? \"ms\" : i >= 0 ? _prefixes[i] : \"\") + property;\n},\n _initCore = function _initCore() {\n if (_windowExists() && window.document) {\n _win = window;\n _doc = _win.document;\n _docElement = _doc.documentElement;\n _tempDiv = _createElement(\"div\") || {\n style: {}\n };\n _tempDivStyler = _createElement(\"div\");\n _transformProp = _checkPropPrefix(_transformProp);\n _transformOriginProp = _transformProp + \"Origin\";\n _tempDiv.style.cssText = \"border-width:0;line-height:0;position:absolute;padding:0\"; //make sure to override certain properties that may contaminate measurements, in case the user has overreaching style sheets.\n\n _supports3D = !!_checkPropPrefix(\"perspective\");\n _reverting = gsap.core.reverting;\n _pluginInitted = 1;\n }\n},\n _getBBoxHack = function _getBBoxHack(swapIfPossible) {\n //works around issues in some browsers (like Firefox) that don't correctly report getBBox() on SVG elements inside a <defs> element and/or <mask>. We try creating an SVG, adding it to the documentElement and toss the element in there so that it's definitely part of the rendering tree, then grab the bbox and if it works, we actually swap out the original getBBox() method for our own that does these extra steps whenever getBBox is needed. This helps ensure that performance is optimal (only do all these extra steps when absolutely necessary...most elements don't need it).\n var svg = _createElement(\"svg\", this.ownerSVGElement && this.ownerSVGElement.getAttribute(\"xmlns\") || \"http://www.w3.org/2000/svg\"),\n oldParent = this.parentNode,\n oldSibling = this.nextSibling,\n oldCSS = this.style.cssText,\n bbox;\n\n _docElement.appendChild(svg);\n\n svg.appendChild(this);\n this.style.display = \"block\";\n\n if (swapIfPossible) {\n try {\n bbox = this.getBBox();\n this._gsapBBox = this.getBBox; //store the original\n\n this.getBBox = _getBBoxHack;\n } catch (e) {}\n } else if (this._gsapBBox) {\n bbox = this._gsapBBox();\n }\n\n if (oldParent) {\n if (oldSibling) {\n oldParent.insertBefore(this, oldSibling);\n } else {\n oldParent.appendChild(this);\n }\n }\n\n _docElement.removeChild(svg);\n\n this.style.cssText = oldCSS;\n return bbox;\n},\n _getAttributeFallbacks = function _getAttributeFallbacks(target, attributesArray) {\n var i = attributesArray.length;\n\n while (i--) {\n if (target.hasAttribute(attributesArray[i])) {\n return target.getAttribute(attributesArray[i]);\n }\n }\n},\n _getBBox = function _getBBox(target) {\n var bounds;\n\n try {\n bounds = target.getBBox(); //Firefox throws errors if you try calling getBBox() on an SVG element that's not rendered (like in a <symbol> or <defs>). https://bugzilla.mozilla.org/show_bug.cgi?id=612118\n } catch (error) {\n bounds = _getBBoxHack.call(target, true);\n }\n\n bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true)); //some browsers (like Firefox) misreport the bounds if the element has zero width and height (it just assumes it's at x:0, y:0), thus we need to manually grab the position in that case.\n\n return bounds && !bounds.width && !bounds.x && !bounds.y ? {\n x: +_getAttributeFallbacks(target, [\"x\", \"cx\", \"x1\"]) || 0,\n y: +_getAttributeFallbacks(target, [\"y\", \"cy\", \"y1\"]) || 0,\n width: 0,\n height: 0\n } : bounds;\n},\n _isSVG = function _isSVG(e) {\n return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e));\n},\n //reports if the element is an SVG on which getBBox() actually works\n_removeProperty = function _removeProperty(target, property) {\n if (property) {\n var style = target.style,\n first2Chars;\n\n if (property in _transformProps && property !== _transformOriginProp) {\n property = _transformProp;\n }\n\n if (style.removeProperty) {\n first2Chars = property.substr(0, 2);\n\n if (first2Chars === \"ms\" || property.substr(0, 6) === \"webkit\") {\n //Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be \"ms-transform\" instead of \"-ms-transform\" for IE9, for example)\n property = \"-\" + property;\n }\n\n style.removeProperty(first2Chars === \"--\" ? property : property.replace(_capsExp, \"-$1\").toLowerCase());\n } else {\n //note: old versions of IE use \"removeAttribute()\" instead of \"removeProperty()\"\n style.removeAttribute(property);\n }\n }\n},\n _addNonTweeningPT = function _addNonTweeningPT(plugin, target, property, beginning, end, onlySetAtEnd) {\n var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue);\n plugin._pt = pt;\n pt.b = beginning;\n pt.e = end;\n\n plugin._props.push(property);\n\n return pt;\n},\n _nonConvertibleUnits = {\n deg: 1,\n rad: 1,\n turn: 1\n},\n _nonStandardLayouts = {\n grid: 1,\n flex: 1\n},\n //takes a single value like 20px and converts it to the unit specified, like \"%\", returning only the numeric amount.\n_convertToUnit = function _convertToUnit(target, property, value, unit) {\n var curValue = parseFloat(value) || 0,\n curUnit = (value + \"\").trim().substr((curValue + \"\").length) || \"px\",\n // some browsers leave extra whitespace at the beginning of CSS variables, hence the need to trim()\n style = _tempDiv.style,\n horizontal = _horizontalExp.test(property),\n isRootSVG = target.tagName.toLowerCase() === \"svg\",\n measureProperty = (isRootSVG ? \"client\" : \"offset\") + (horizontal ? \"Width\" : \"Height\"),\n amount = 100,\n toPixels = unit === \"px\",\n toPercent = unit === \"%\",\n px,\n parent,\n cache,\n isSVG;\n\n if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) {\n return curValue;\n }\n\n curUnit !== \"px\" && !toPixels && (curValue = _convertToUnit(target, property, value, \"px\"));\n isSVG = target.getCTM && _isSVG(target);\n\n if ((toPercent || curUnit === \"%\") && (_transformProps[property] || ~property.indexOf(\"adius\"))) {\n px = isSVG ? target.getBBox()[horizontal ? \"width\" : \"height\"] : target[measureProperty];\n return _round(toPercent ? curValue / px * amount : curValue / 100 * px);\n }\n\n style[horizontal ? \"width\" : \"height\"] = amount + (toPixels ? curUnit : unit);\n parent = ~property.indexOf(\"adius\") || unit === \"em\" && target.appendChild && !isRootSVG ? target : target.parentNode;\n\n if (isSVG) {\n parent = (target.ownerSVGElement || {}).parentNode;\n }\n\n if (!parent || parent === _doc || !parent.appendChild) {\n parent = _doc.body;\n }\n\n cache = parent._gsap;\n\n if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) {\n return _round(curValue / cache.width * amount);\n } else {\n if (toPercent && (property === \"height\" || property === \"width\")) {\n // if we're dealing with width/height that's inside a container with padding and/or it's a flexbox/grid container, we must apply it to the target itself rather than the _tempDiv in order to ensure complete accuracy, factoring in the parent's padding.\n var v = target.style[property];\n target.style[property] = amount + unit;\n px = target[measureProperty];\n v ? target.style[property] = v : _removeProperty(target, property);\n } else {\n (toPercent || curUnit === \"%\") && !_nonStandardLayouts[_getComputedProperty(parent, \"display\")] && (style.position = _getComputedProperty(target, \"position\"));\n parent === target && (style.position = \"static\"); // like for borderRadius, if it's a % we must have it relative to the target itself but that may not have position: relative or position: absolute in which case it'd go up the chain until it finds its offsetParent (bad). position: static protects against that.\n\n parent.appendChild(_tempDiv);\n px = _tempDiv[measureProperty];\n parent.removeChild(_tempDiv);\n style.position = \"absolute\";\n }\n\n if (horizontal && toPercent) {\n cache = _getCache(parent);\n cache.time = _ticker.time;\n cache.width = parent[measureProperty];\n }\n }\n\n return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0);\n},\n _get = function _get(target, property, unit, uncache) {\n var value;\n _pluginInitted || _initCore();\n\n if (property in _propertyAliases && property !== \"transform\") {\n property = _propertyAliases[property];\n\n if (~property.indexOf(\",\")) {\n property = property.split(\",\")[0];\n }\n }\n\n if (_transformProps[property] && property !== \"transform\") {\n value = _parseTransform(target, uncache);\n value = property !== \"transformOrigin\" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + \" \" + value.zOrigin + \"px\";\n } else {\n value = target.style[property];\n\n if (!value || value === \"auto\" || uncache || ~(value + \"\").indexOf(\"calc(\")) {\n value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === \"opacity\" ? 1 : 0); // note: some browsers, like Firefox, don't report borderRadius correctly! Instead, it only reports every corner like borderTopLeftRadius\n }\n }\n\n return unit && !~(value + \"\").trim().indexOf(\" \") ? _convertToUnit(target, property, value, unit) + unit : value;\n},\n _tweenComplexCSSString = function _tweenComplexCSSString(target, prop, start, end) {\n // note: we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n if (!start || start === \"none\") {\n // some browsers like Safari actually PREFER the prefixed property and mis-report the unprefixed value like clipPath (BUG). In other words, even though clipPath exists in the style (\"clipPath\" in target.style) and it's set in the CSS properly (along with -webkit-clip-path), Safari reports clipPath as \"none\" whereas WebkitClipPath reports accurately like \"ellipse(100% 0% at 50% 0%)\", so in this case we must SWITCH to using the prefixed property instead. See https://gsap.com/forums/topic/18310-clippath-doesnt-work-on-ios/\n var p = _checkPropPrefix(prop, target, 1),\n s = p && _getComputedProperty(target, p, 1);\n\n if (s && s !== start) {\n prop = p;\n start = s;\n } else if (prop === \"borderColor\") {\n start = _getComputedProperty(target, \"borderTopColor\"); // Firefox bug: always reports \"borderColor\" as \"\", so we must fall back to borderTopColor. See https://gsap.com/forums/topic/24583-how-to-return-colors-that-i-had-after-reverse/\n }\n }\n\n var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString),\n index = 0,\n matchIndex = 0,\n a,\n result,\n startValues,\n startNum,\n color,\n startValue,\n endValue,\n endNum,\n chunk,\n endUnit,\n startUnit,\n endValues;\n pt.b = start;\n pt.e = end;\n start += \"\"; // ensure values are strings\n\n end += \"\";\n\n if (end === \"auto\") {\n startValue = target.style[prop];\n target.style[prop] = end;\n end = _getComputedProperty(target, prop) || end;\n startValue ? target.style[prop] = startValue : _removeProperty(target, prop);\n }\n\n a = [start, end];\n\n _colorStringFilter(a); // pass an array with the starting and ending values and let the filter do whatever it needs to the values. If colors are found, it returns true and then we must match where the color shows up order-wise because for things like boxShadow, sometimes the browser provides the computed values with the color FIRST, but the user provides it with the color LAST, so flip them if necessary. Same for drop-shadow().\n\n\n start = a[0];\n end = a[1];\n startValues = start.match(_numWithUnitExp) || [];\n endValues = end.match(_numWithUnitExp) || [];\n\n if (endValues.length) {\n while (result = _numWithUnitExp.exec(end)) {\n endValue = result[0];\n chunk = end.substring(index, result.index);\n\n if (color) {\n color = (color + 1) % 5;\n } else if (chunk.substr(-5) === \"rgba(\" || chunk.substr(-5) === \"hsla(\") {\n color = 1;\n }\n\n if (endValue !== (startValue = startValues[matchIndex++] || \"\")) {\n startNum = parseFloat(startValue) || 0;\n startUnit = startValue.substr((startNum + \"\").length);\n endValue.charAt(1) === \"=\" && (endValue = _parseRelative(startNum, endValue) + startUnit);\n endNum = parseFloat(endValue);\n endUnit = endValue.substr((endNum + \"\").length);\n index = _numWithUnitExp.lastIndex - endUnit.length;\n\n if (!endUnit) {\n //if something like \"perspective:300\" is passed in and we must add a unit to the end\n endUnit = endUnit || _config.units[prop] || startUnit;\n\n if (index === end.length) {\n end += endUnit;\n pt.e += endUnit;\n }\n }\n\n if (startUnit !== endUnit) {\n startNum = _convertToUnit(target, prop, startValue, endUnit) || 0;\n } // these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.\n\n\n pt._pt = {\n _next: pt._pt,\n p: chunk || matchIndex === 1 ? chunk : \",\",\n //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n s: startNum,\n c: endNum - startNum,\n m: color && color < 4 || prop === \"zIndex\" ? Math.round : 0\n };\n }\n }\n\n pt.c = index < end.length ? end.substring(index, end.length) : \"\"; //we use the \"c\" of the PropTween to store the final part of the string (after the last number)\n } else {\n pt.r = prop === \"display\" && end === \"none\" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue;\n }\n\n _relExp.test(end) && (pt.e = 0); //if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).\n\n this._pt = pt; //start the linked list with this new PropTween. Remember, we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within another plugin too, thus \"this\" would refer to the plugin.\n\n return pt;\n},\n _keywordToPercent = {\n top: \"0%\",\n bottom: \"100%\",\n left: \"0%\",\n right: \"100%\",\n center: \"50%\"\n},\n _convertKeywordsToPercentages = function _convertKeywordsToPercentages(value) {\n var split = value.split(\" \"),\n x = split[0],\n y = split[1] || \"50%\";\n\n if (x === \"top\" || x === \"bottom\" || y === \"left\" || y === \"right\") {\n //the user provided them in the wrong order, so flip them\n value = x;\n x = y;\n y = value;\n }\n\n split[0] = _keywordToPercent[x] || x;\n split[1] = _keywordToPercent[y] || y;\n return split.join(\" \");\n},\n _renderClearProps = function _renderClearProps(ratio, data) {\n if (data.tween && data.tween._time === data.tween._dur) {\n var target = data.t,\n style = target.style,\n props = data.u,\n cache = target._gsap,\n prop,\n clearTransforms,\n i;\n\n if (props === \"all\" || props === true) {\n style.cssText = \"\";\n clearTransforms = 1;\n } else {\n props = props.split(\",\");\n i = props.length;\n\n while (--i > -1) {\n prop = props[i];\n\n if (_transformProps[prop]) {\n clearTransforms = 1;\n prop = prop === \"transformOrigin\" ? _transformOriginProp : _transformProp;\n }\n\n _removeProperty(target, prop);\n }\n }\n\n if (clearTransforms) {\n _removeProperty(target, _transformProp);\n\n if (cache) {\n cache.svg && target.removeAttribute(\"transform\");\n\n _parseTransform(target, 1); // force all the cached values back to \"normal\"/identity, otherwise if there's another tween that's already set to render transforms on this element, it could display the wrong values.\n\n\n cache.uncache = 1;\n\n _removeIndependentTransforms(style);\n }\n }\n }\n},\n // note: specialProps should return 1 if (and only if) they have a non-zero priority. It indicates we need to sort the linked list.\n_specialProps = {\n clearProps: function clearProps(plugin, target, property, endValue, tween) {\n if (tween.data !== \"isFromStart\") {\n var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps);\n pt.u = endValue;\n pt.pr = -10;\n pt.tween = tween;\n\n plugin._props.push(property);\n\n return 1;\n }\n }\n /* className feature (about 0.4kb gzipped).\n , className(plugin, target, property, endValue, tween) {\n \tlet _renderClassName = (ratio, data) => {\n \t\t\tdata.css.render(ratio, data.css);\n \t\t\tif (!ratio || ratio === 1) {\n \t\t\t\tlet inline = data.rmv,\n \t\t\t\t\ttarget = data.t,\n \t\t\t\t\tp;\n \t\t\t\ttarget.setAttribute(\"class\", ratio ? data.e : data.b);\n \t\t\t\tfor (p in inline) {\n \t\t\t\t\t_removeProperty(target, p);\n \t\t\t\t}\n \t\t\t}\n \t\t},\n \t\t_getAllStyles = (target) => {\n \t\t\tlet styles = {},\n \t\t\t\tcomputed = getComputedStyle(target),\n \t\t\t\tp;\n \t\t\tfor (p in computed) {\n \t\t\t\tif (isNaN(p) && p !== \"cssText\" && p !== \"length\") {\n \t\t\t\t\tstyles[p] = computed[p];\n \t\t\t\t}\n \t\t\t}\n \t\t\t_setDefaults(styles, _parseTransform(target, 1));\n \t\t\treturn styles;\n \t\t},\n \t\tstartClassList = target.getAttribute(\"class\"),\n \t\tstyle = target.style,\n \t\tcssText = style.cssText,\n \t\tcache = target._gsap,\n \t\tclassPT = cache.classPT,\n \t\tinlineToRemoveAtEnd = {},\n \t\tdata = {t:target, plugin:plugin, rmv:inlineToRemoveAtEnd, b:startClassList, e:(endValue.charAt(1) !== \"=\") ? endValue : startClassList.replace(new RegExp(\"(?:\\\\s|^)\" + endValue.substr(2) + \"(?![\\\\w-])\"), \"\") + ((endValue.charAt(0) === \"+\") ? \" \" + endValue.substr(2) : \"\")},\n \t\tchangingVars = {},\n \t\tstartVars = _getAllStyles(target),\n \t\ttransformRelated = /(transform|perspective)/i,\n \t\tendVars, p;\n \tif (classPT) {\n \t\tclassPT.r(1, classPT.d);\n \t\t_removeLinkedListItem(classPT.d.plugin, classPT, \"_pt\");\n \t}\n \ttarget.setAttribute(\"class\", data.e);\n \tendVars = _getAllStyles(target, true);\n \ttarget.setAttribute(\"class\", startClassList);\n \tfor (p in endVars) {\n \t\tif (endVars[p] !== startVars[p] && !transformRelated.test(p)) {\n \t\t\tchangingVars[p] = endVars[p];\n \t\t\tif (!style[p] && style[p] !== \"0\") {\n \t\t\t\tinlineToRemoveAtEnd[p] = 1;\n \t\t\t}\n \t\t}\n \t}\n \tcache.classPT = plugin._pt = new PropTween(plugin._pt, target, \"className\", 0, 0, _renderClassName, data, 0, -11);\n \tif (style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://gsap.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/.\n \t\tstyle.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity).\n \t}\n \t_parseTransform(target, true); //to clear the caching of transforms\n \tdata.css = new gsap.plugins.css();\n \tdata.css.init(target, changingVars, tween);\n \tplugin._props.push(...data.css._props);\n \treturn 1;\n }\n */\n\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * TRANSFORMS\n * --------------------------------------------------------------------------------------\n */\n_identity2DMatrix = [1, 0, 0, 1, 0, 0],\n _rotationalProperties = {},\n _isNullTransform = function _isNullTransform(value) {\n return value === \"matrix(1, 0, 0, 1, 0, 0)\" || value === \"none\" || !value;\n},\n _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray(target) {\n var matrixString = _getComputedProperty(target, _transformProp);\n\n return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round);\n},\n _getMatrix = function _getMatrix(target, force2D) {\n var cache = target._gsap || _getCache(target),\n style = target.style,\n matrix = _getComputedTransformMatrixAsArray(target),\n parent,\n nextSibling,\n temp,\n addedToDOM;\n\n if (cache.svg && target.getAttribute(\"transform\")) {\n temp = target.transform.baseVal.consolidate().matrix; //ensures that even complex values like \"translate(50,60) rotate(135,0,0)\" are parsed because it mashes it into a matrix.\n\n matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f];\n return matrix.join(\",\") === \"1,0,0,1,0,0\" ? _identity2DMatrix : matrix;\n } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) {\n //note: if offsetParent is null, that means the element isn't in the normal document flow, like if it has display:none or one of its ancestors has display:none). Firefox returns null for getComputedStyle() if the element is in an iframe that has display:none. https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not \"none\". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px).\n temp = style.display;\n style.display = \"block\";\n parent = target.parentNode;\n\n if (!parent || !target.offsetParent) {\n // note: in 3.3.0 we switched target.offsetParent to _doc.body.contains(target) to avoid [sometimes unnecessary] MutationObserver calls but that wasn't adequate because there are edge cases where nested position: fixed elements need to get reparented to accurately sense transforms. See https://github.com/greensock/GSAP/issues/388 and https://github.com/greensock/GSAP/issues/375\n addedToDOM = 1; //flag\n\n nextSibling = target.nextElementSibling;\n\n _docElement.appendChild(target); //we must add it to the DOM in order to get values properly\n\n }\n\n matrix = _getComputedTransformMatrixAsArray(target);\n temp ? style.display = temp : _removeProperty(target, \"display\");\n\n if (addedToDOM) {\n nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target);\n }\n }\n\n return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix;\n},\n _applySVGOrigin = function _applySVGOrigin(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) {\n var cache = target._gsap,\n matrix = matrixArray || _getMatrix(target, true),\n xOriginOld = cache.xOrigin || 0,\n yOriginOld = cache.yOrigin || 0,\n xOffsetOld = cache.xOffset || 0,\n yOffsetOld = cache.yOffset || 0,\n a = matrix[0],\n b = matrix[1],\n c = matrix[2],\n d = matrix[3],\n tx = matrix[4],\n ty = matrix[5],\n originSplit = origin.split(\" \"),\n xOrigin = parseFloat(originSplit[0]) || 0,\n yOrigin = parseFloat(originSplit[1]) || 0,\n bounds,\n determinant,\n x,\n y;\n\n if (!originIsAbsolute) {\n bounds = _getBBox(target);\n xOrigin = bounds.x + (~originSplit[0].indexOf(\"%\") ? xOrigin / 100 * bounds.width : xOrigin);\n yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf(\"%\") ? yOrigin / 100 * bounds.height : yOrigin); // if (!(\"xOrigin\" in cache) && (xOrigin || yOrigin)) { // added in 3.12.3, reverted in 3.12.4; requires more exploration\n // \txOrigin -= bounds.x;\n // \tyOrigin -= bounds.y;\n // }\n } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) {\n //if it's zero (like if scaleX and scaleY are zero), skip it to avoid errors with dividing by zero.\n x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant;\n y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant;\n xOrigin = x;\n yOrigin = y; // theory: we only had to do this for smoothing and it assumes that the previous one was not originIsAbsolute.\n }\n\n if (smooth || smooth !== false && cache.smooth) {\n tx = xOrigin - xOriginOld;\n ty = yOrigin - yOriginOld;\n cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx;\n cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty;\n } else {\n cache.xOffset = cache.yOffset = 0;\n }\n\n cache.xOrigin = xOrigin;\n cache.yOrigin = yOrigin;\n cache.smooth = !!smooth;\n cache.origin = origin;\n cache.originIsAbsolute = !!originIsAbsolute;\n target.style[_transformOriginProp] = \"0px 0px\"; //otherwise, if someone sets an origin via CSS, it will likely interfere with the SVG transform attribute ones (because remember, we're baking the origin into the matrix() value).\n\n if (pluginToAddPropTweensTo) {\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"xOrigin\", xOriginOld, xOrigin);\n\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"yOrigin\", yOriginOld, yOrigin);\n\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"xOffset\", xOffsetOld, cache.xOffset);\n\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"yOffset\", yOffsetOld, cache.yOffset);\n }\n\n target.setAttribute(\"data-svg-origin\", xOrigin + \" \" + yOrigin);\n},\n _parseTransform = function _parseTransform(target, uncache) {\n var cache = target._gsap || new GSCache(target);\n\n if (\"x\" in cache && !uncache && !cache.uncache) {\n return cache;\n }\n\n var style = target.style,\n invertedScaleX = cache.scaleX < 0,\n px = \"px\",\n deg = \"deg\",\n cs = getComputedStyle(target),\n origin = _getComputedProperty(target, _transformOriginProp) || \"0\",\n x,\n y,\n z,\n scaleX,\n scaleY,\n rotation,\n rotationX,\n rotationY,\n skewX,\n skewY,\n perspective,\n xOrigin,\n yOrigin,\n matrix,\n angle,\n cos,\n sin,\n a,\n b,\n c,\n d,\n a12,\n a22,\n t1,\n t2,\n t3,\n a13,\n a23,\n a33,\n a42,\n a43,\n a32;\n x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0;\n scaleX = scaleY = 1;\n cache.svg = !!(target.getCTM && _isSVG(target));\n\n if (cs.translate) {\n // accommodate independent transforms by combining them into normal ones.\n if (cs.translate !== \"none\" || cs.scale !== \"none\" || cs.rotate !== \"none\") {\n style[_transformProp] = (cs.translate !== \"none\" ? \"translate3d(\" + (cs.translate + \" 0 0\").split(\" \").slice(0, 3).join(\", \") + \") \" : \"\") + (cs.rotate !== \"none\" ? \"rotate(\" + cs.rotate + \") \" : \"\") + (cs.scale !== \"none\" ? \"scale(\" + cs.scale.split(\" \").join(\",\") + \") \" : \"\") + (cs[_transformProp] !== \"none\" ? cs[_transformProp] : \"\");\n }\n\n style.scale = style.rotate = style.translate = \"none\";\n }\n\n matrix = _getMatrix(target, cache.svg);\n\n if (cache.svg) {\n if (cache.uncache) {\n // if cache.uncache is true (and maybe if origin is 0,0), we need to set element.style.transformOrigin = (cache.xOrigin - bbox.x) + \"px \" + (cache.yOrigin - bbox.y) + \"px\". Previously we let the data-svg-origin stay instead, but when introducing revert(), it complicated things.\n t2 = target.getBBox();\n origin = cache.xOrigin - t2.x + \"px \" + (cache.yOrigin - t2.y) + \"px\";\n t1 = \"\";\n } else {\n t1 = !uncache && target.getAttribute(\"data-svg-origin\"); // Remember, to work around browser inconsistencies we always force SVG elements' transformOrigin to 0,0 and offset the translation accordingly.\n }\n\n _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix);\n }\n\n xOrigin = cache.xOrigin || 0;\n yOrigin = cache.yOrigin || 0;\n\n if (matrix !== _identity2DMatrix) {\n a = matrix[0]; //a11\n\n b = matrix[1]; //a21\n\n c = matrix[2]; //a31\n\n d = matrix[3]; //a41\n\n x = a12 = matrix[4];\n y = a22 = matrix[5]; //2D matrix\n\n if (matrix.length === 6) {\n scaleX = Math.sqrt(a * a + b * b);\n scaleY = Math.sqrt(d * d + c * c);\n rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist).\n\n skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0;\n skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD)));\n\n if (cache.svg) {\n x -= xOrigin - (xOrigin * a + yOrigin * c);\n y -= yOrigin - (xOrigin * b + yOrigin * d);\n } //3D matrix\n\n } else {\n a32 = matrix[6];\n a42 = matrix[7];\n a13 = matrix[8];\n a23 = matrix[9];\n a33 = matrix[10];\n a43 = matrix[11];\n x = matrix[12];\n y = matrix[13];\n z = matrix[14];\n angle = _atan2(a32, a33);\n rotationX = angle * _RAD2DEG; //rotationX\n\n if (angle) {\n cos = Math.cos(-angle);\n sin = Math.sin(-angle);\n t1 = a12 * cos + a13 * sin;\n t2 = a22 * cos + a23 * sin;\n t3 = a32 * cos + a33 * sin;\n a13 = a12 * -sin + a13 * cos;\n a23 = a22 * -sin + a23 * cos;\n a33 = a32 * -sin + a33 * cos;\n a43 = a42 * -sin + a43 * cos;\n a12 = t1;\n a22 = t2;\n a32 = t3;\n } //rotationY\n\n\n angle = _atan2(-c, a33);\n rotationY = angle * _RAD2DEG;\n\n if (angle) {\n cos = Math.cos(-angle);\n sin = Math.sin(-angle);\n t1 = a * cos - a13 * sin;\n t2 = b * cos - a23 * sin;\n t3 = c * cos - a33 * sin;\n a43 = d * sin + a43 * cos;\n a = t1;\n b = t2;\n c = t3;\n } //rotationZ\n\n\n angle = _atan2(b, a);\n rotation = angle * _RAD2DEG;\n\n if (angle) {\n cos = Math.cos(angle);\n sin = Math.sin(angle);\n t1 = a * cos + b * sin;\n t2 = a12 * cos + a22 * sin;\n b = b * cos - a * sin;\n a22 = a22 * cos - a12 * sin;\n a = t1;\n a12 = t2;\n }\n\n if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) {\n //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here.\n rotationX = rotation = 0;\n rotationY = 180 - rotationY;\n }\n\n scaleX = _round(Math.sqrt(a * a + b * b + c * c));\n scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32));\n angle = _atan2(a12, a22);\n skewX = Math.abs(angle) > 0.0002 ? angle * _RAD2DEG : 0;\n perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0;\n }\n\n if (cache.svg) {\n //sense if there are CSS transforms applied on an SVG element in which case we must overwrite them when rendering. The transform attribute is more reliable cross-browser, but we can't just remove the CSS ones because they may be applied in a CSS rule somewhere (not just inline).\n t1 = target.getAttribute(\"transform\");\n cache.forceCSS = target.setAttribute(\"transform\", \"\") || !_isNullTransform(_getComputedProperty(target, _transformProp));\n t1 && target.setAttribute(\"transform\", t1);\n }\n }\n\n if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {\n if (invertedScaleX) {\n scaleX *= -1;\n skewX += rotation <= 0 ? 180 : -180;\n rotation += rotation <= 0 ? 180 : -180;\n } else {\n scaleY *= -1;\n skewX += skewX <= 0 ? 180 : -180;\n }\n }\n\n uncache = uncache || cache.uncache;\n cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px;\n cache.y = y - ((cache.yPercent = y && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px;\n cache.z = z + px;\n cache.scaleX = _round(scaleX);\n cache.scaleY = _round(scaleY);\n cache.rotation = _round(rotation) + deg;\n cache.rotationX = _round(rotationX) + deg;\n cache.rotationY = _round(rotationY) + deg;\n cache.skewX = skewX + deg;\n cache.skewY = skewY + deg;\n cache.transformPerspective = perspective + px;\n\n if (cache.zOrigin = parseFloat(origin.split(\" \")[2]) || !uncache && cache.zOrigin || 0) {\n style[_transformOriginProp] = _firstTwoOnly(origin);\n }\n\n cache.xOffset = cache.yOffset = 0;\n cache.force3D = _config.force3D;\n cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms;\n cache.uncache = 0;\n return cache;\n},\n _firstTwoOnly = function _firstTwoOnly(value) {\n return (value = value.split(\" \"))[0] + \" \" + value[1];\n},\n //for handling transformOrigin values, stripping out the 3rd dimension\n_addPxTranslate = function _addPxTranslate(target, start, value) {\n var unit = getUnit(start);\n return _round(parseFloat(start) + parseFloat(_convertToUnit(target, \"x\", value + \"px\", unit))) + unit;\n},\n _renderNon3DTransforms = function _renderNon3DTransforms(ratio, cache) {\n cache.z = \"0px\";\n cache.rotationY = cache.rotationX = \"0deg\";\n cache.force3D = 0;\n\n _renderCSSTransforms(ratio, cache);\n},\n _zeroDeg = \"0deg\",\n _zeroPx = \"0px\",\n _endParenthesis = \") \",\n _renderCSSTransforms = function _renderCSSTransforms(ratio, cache) {\n var _ref = cache || this,\n xPercent = _ref.xPercent,\n yPercent = _ref.yPercent,\n x = _ref.x,\n y = _ref.y,\n z = _ref.z,\n rotation = _ref.rotation,\n rotationY = _ref.rotationY,\n rotationX = _ref.rotationX,\n skewX = _ref.skewX,\n skewY = _ref.skewY,\n scaleX = _ref.scaleX,\n scaleY = _ref.scaleY,\n transformPerspective = _ref.transformPerspective,\n force3D = _ref.force3D,\n target = _ref.target,\n zOrigin = _ref.zOrigin,\n transforms = \"\",\n use3D = force3D === \"auto\" && ratio && ratio !== 1 || force3D === true; // Safari has a bug that causes it not to render 3D transform-origin values properly, so we force the z origin to 0, record it in the cache, and then do the math here to offset the translate values accordingly (basically do the 3D transform-origin part manually)\n\n\n if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) {\n var angle = parseFloat(rotationY) * _DEG2RAD,\n a13 = Math.sin(angle),\n a33 = Math.cos(angle),\n cos;\n\n angle = parseFloat(rotationX) * _DEG2RAD;\n cos = Math.cos(angle);\n x = _addPxTranslate(target, x, a13 * cos * -zOrigin);\n y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin);\n z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin);\n }\n\n if (transformPerspective !== _zeroPx) {\n transforms += \"perspective(\" + transformPerspective + _endParenthesis;\n }\n\n if (xPercent || yPercent) {\n transforms += \"translate(\" + xPercent + \"%, \" + yPercent + \"%) \";\n }\n\n if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) {\n transforms += z !== _zeroPx || use3D ? \"translate3d(\" + x + \", \" + y + \", \" + z + \") \" : \"translate(\" + x + \", \" + y + _endParenthesis;\n }\n\n if (rotation !== _zeroDeg) {\n transforms += \"rotate(\" + rotation + _endParenthesis;\n }\n\n if (rotationY !== _zeroDeg) {\n transforms += \"rotateY(\" + rotationY + _endParenthesis;\n }\n\n if (rotationX !== _zeroDeg) {\n transforms += \"rotateX(\" + rotationX + _endParenthesis;\n }\n\n if (skewX !== _zeroDeg || skewY !== _zeroDeg) {\n transforms += \"skew(\" + skewX + \", \" + skewY + _endParenthesis;\n }\n\n if (scaleX !== 1 || scaleY !== 1) {\n transforms += \"scale(\" + scaleX + \", \" + scaleY + _endParenthesis;\n }\n\n target.style[_transformProp] = transforms || \"translate(0, 0)\";\n},\n _renderSVGTransforms = function _renderSVGTransforms(ratio, cache) {\n var _ref2 = cache || this,\n xPercent = _ref2.xPercent,\n yPercent = _ref2.yPercent,\n x = _ref2.x,\n y = _ref2.y,\n rotation = _ref2.rotation,\n skewX = _ref2.skewX,\n skewY = _ref2.skewY,\n scaleX = _ref2.scaleX,\n scaleY = _ref2.scaleY,\n target = _ref2.target,\n xOrigin = _ref2.xOrigin,\n yOrigin = _ref2.yOrigin,\n xOffset = _ref2.xOffset,\n yOffset = _ref2.yOffset,\n forceCSS = _ref2.forceCSS,\n tx = parseFloat(x),\n ty = parseFloat(y),\n a11,\n a21,\n a12,\n a22,\n temp;\n\n rotation = parseFloat(rotation);\n skewX = parseFloat(skewX);\n skewY = parseFloat(skewY);\n\n if (skewY) {\n //for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees.\n skewY = parseFloat(skewY);\n skewX += skewY;\n rotation += skewY;\n }\n\n if (rotation || skewX) {\n rotation *= _DEG2RAD;\n skewX *= _DEG2RAD;\n a11 = Math.cos(rotation) * scaleX;\n a21 = Math.sin(rotation) * scaleX;\n a12 = Math.sin(rotation - skewX) * -scaleY;\n a22 = Math.cos(rotation - skewX) * scaleY;\n\n if (skewX) {\n skewY *= _DEG2RAD;\n temp = Math.tan(skewX - skewY);\n temp = Math.sqrt(1 + temp * temp);\n a12 *= temp;\n a22 *= temp;\n\n if (skewY) {\n temp = Math.tan(skewY);\n temp = Math.sqrt(1 + temp * temp);\n a11 *= temp;\n a21 *= temp;\n }\n }\n\n a11 = _round(a11);\n a21 = _round(a21);\n a12 = _round(a12);\n a22 = _round(a22);\n } else {\n a11 = scaleX;\n a22 = scaleY;\n a21 = a12 = 0;\n }\n\n if (tx && !~(x + \"\").indexOf(\"px\") || ty && !~(y + \"\").indexOf(\"px\")) {\n tx = _convertToUnit(target, \"x\", x, \"px\");\n ty = _convertToUnit(target, \"y\", y, \"px\");\n }\n\n if (xOrigin || yOrigin || xOffset || yOffset) {\n tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset);\n ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset);\n }\n\n if (xPercent || yPercent) {\n //The SVG spec doesn't support percentage-based translation in the \"transform\" attribute, so we merge it into the translation to simulate it.\n temp = target.getBBox();\n tx = _round(tx + xPercent / 100 * temp.width);\n ty = _round(ty + yPercent / 100 * temp.height);\n }\n\n temp = \"matrix(\" + a11 + \",\" + a21 + \",\" + a12 + \",\" + a22 + \",\" + tx + \",\" + ty + \")\";\n target.setAttribute(\"transform\", temp);\n forceCSS && (target.style[_transformProp] = temp); //some browsers prioritize CSS transforms over the transform attribute. When we sense that the user has CSS transforms applied, we must overwrite them this way (otherwise some browser simply won't render the transform attribute changes!)\n},\n _addRotationalPropTween = function _addRotationalPropTween(plugin, target, property, startNum, endValue) {\n var cap = 360,\n isString = _isString(endValue),\n endNum = parseFloat(endValue) * (isString && ~endValue.indexOf(\"rad\") ? _RAD2DEG : 1),\n change = endNum - startNum,\n finalValue = startNum + change + \"deg\",\n direction,\n pt;\n\n if (isString) {\n direction = endValue.split(\"_\")[1];\n\n if (direction === \"short\") {\n change %= cap;\n\n if (change !== change % (cap / 2)) {\n change += change < 0 ? cap : -cap;\n }\n }\n\n if (direction === \"cw\" && change < 0) {\n change = (change + cap * _bigNum) % cap - ~~(change / cap) * cap;\n } else if (direction === \"ccw\" && change > 0) {\n change = (change - cap * _bigNum) % cap - ~~(change / cap) * cap;\n }\n }\n\n plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);\n pt.e = finalValue;\n pt.u = \"deg\";\n\n plugin._props.push(property);\n\n return pt;\n},\n _assign = function _assign(target, source) {\n // Internet Explorer doesn't have Object.assign(), so we recreate it here.\n for (var p in source) {\n target[p] = source[p];\n }\n\n return target;\n},\n _addRawTransformPTs = function _addRawTransformPTs(plugin, transforms, target) {\n //for handling cases where someone passes in a whole transform string, like transform: \"scale(2, 3) rotate(20deg) translateY(30em)\"\n var startCache = _assign({}, target._gsap),\n exclude = \"perspective,force3D,transformOrigin,svgOrigin\",\n style = target.style,\n endCache,\n p,\n startValue,\n endValue,\n startNum,\n endNum,\n startUnit,\n endUnit;\n\n if (startCache.svg) {\n startValue = target.getAttribute(\"transform\");\n target.setAttribute(\"transform\", \"\");\n style[_transformProp] = transforms;\n endCache = _parseTransform(target, 1);\n\n _removeProperty(target, _transformProp);\n\n target.setAttribute(\"transform\", startValue);\n } else {\n startValue = getComputedStyle(target)[_transformProp];\n style[_transformProp] = transforms;\n endCache = _parseTransform(target, 1);\n style[_transformProp] = startValue;\n }\n\n for (p in _transformProps) {\n startValue = startCache[p];\n endValue = endCache[p];\n\n if (startValue !== endValue && exclude.indexOf(p) < 0) {\n //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case.\n startUnit = getUnit(startValue);\n endUnit = getUnit(endValue);\n startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue);\n endNum = parseFloat(endValue);\n plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp);\n plugin._pt.u = endUnit || 0;\n\n plugin._props.push(p);\n }\n }\n\n _assign(endCache, startCache);\n}; // handle splitting apart padding, margin, borderWidth, and borderRadius into their 4 components. Firefox, for example, won't report borderRadius correctly - it will only do borderTopLeftRadius and the other corners. We also want to handle paddingTop, marginLeft, borderRightWidth, etc.\n\n\n_forEachName(\"padding,margin,Width,Radius\", function (name, index) {\n var t = \"Top\",\n r = \"Right\",\n b = \"Bottom\",\n l = \"Left\",\n props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function (side) {\n return index < 2 ? name + side : \"border\" + side + name;\n });\n\n _specialProps[index > 1 ? \"border\" + name : name] = function (plugin, target, property, endValue, tween) {\n var a, vars;\n\n if (arguments.length < 4) {\n // getter, passed target, property, and unit (from _get())\n a = props.map(function (prop) {\n return _get(plugin, prop, property);\n });\n vars = a.join(\" \");\n return vars.split(a[0]).length === 5 ? a[0] : vars;\n }\n\n a = (endValue + \"\").split(\" \");\n vars = {};\n props.forEach(function (prop, i) {\n return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0];\n });\n plugin.init(target, vars, tween);\n };\n});\n\nexport var CSSPlugin = {\n name: \"css\",\n register: _initCore,\n targetTest: function targetTest(target) {\n return target.style && target.nodeType;\n },\n init: function init(target, vars, tween, index, targets) {\n var props = this._props,\n style = target.style,\n startAt = tween.vars.startAt,\n startValue,\n endValue,\n endNum,\n startNum,\n type,\n specialProp,\n p,\n startUnit,\n endUnit,\n relative,\n isTransformRelated,\n transformPropTween,\n cache,\n smooth,\n hasPriority,\n inlineProps;\n _pluginInitted || _initCore(); // we may call init() multiple times on the same plugin instance, like when adding special properties, so make sure we don't overwrite the revert data or inlineProps\n\n this.styles = this.styles || _getStyleSaver(target);\n inlineProps = this.styles.props;\n this.tween = tween;\n\n for (p in vars) {\n if (p === \"autoRound\") {\n continue;\n }\n\n endValue = vars[p];\n\n if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) {\n // plugins\n continue;\n }\n\n type = typeof endValue;\n specialProp = _specialProps[p];\n\n if (type === \"function\") {\n endValue = endValue.call(tween, index, target, targets);\n type = typeof endValue;\n }\n\n if (type === \"string\" && ~endValue.indexOf(\"random(\")) {\n endValue = _replaceRandom(endValue);\n }\n\n if (specialProp) {\n specialProp(this, target, p, endValue, tween) && (hasPriority = 1);\n } else if (p.substr(0, 2) === \"--\") {\n //CSS variable\n startValue = (getComputedStyle(target).getPropertyValue(p) + \"\").trim();\n endValue += \"\";\n _colorExp.lastIndex = 0;\n\n if (!_colorExp.test(startValue)) {\n // colors don't have units\n startUnit = getUnit(startValue);\n endUnit = getUnit(endValue);\n }\n\n endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit);\n this.add(style, \"setProperty\", startValue, endValue, index, targets, 0, 0, p);\n props.push(p);\n inlineProps.push(p, 0, style[p]);\n } else if (type !== \"undefined\") {\n if (startAt && p in startAt) {\n // in case someone hard-codes a complex value as the start, like top: \"calc(2vh / 2)\". Without this, it'd use the computed value (always in px)\n startValue = typeof startAt[p] === \"function\" ? startAt[p].call(tween, index, target, targets) : startAt[p];\n _isString(startValue) && ~startValue.indexOf(\"random(\") && (startValue = _replaceRandom(startValue));\n getUnit(startValue + \"\") || startValue === \"auto\" || (startValue += _config.units[p] || getUnit(_get(target, p)) || \"\"); // for cases when someone passes in a unitless value like {x: 100}; if we try setting translate(100, 0px) it won't work.\n\n (startValue + \"\").charAt(1) === \"=\" && (startValue = _get(target, p)); // can't work with relative values\n } else {\n startValue = _get(target, p);\n }\n\n startNum = parseFloat(startValue);\n relative = type === \"string\" && endValue.charAt(1) === \"=\" && endValue.substr(0, 2);\n relative && (endValue = endValue.substr(2));\n endNum = parseFloat(endValue);\n\n if (p in _propertyAliases) {\n if (p === \"autoAlpha\") {\n //special case where we control the visibility along with opacity. We still allow the opacity value to pass through and get tweened.\n if (startNum === 1 && _get(target, \"visibility\") === \"hidden\" && endNum) {\n //if visibility is initially set to \"hidden\", we should interpret that as intent to make opacity 0 (a convenience)\n startNum = 0;\n }\n\n inlineProps.push(\"visibility\", 0, style.visibility);\n\n _addNonTweeningPT(this, style, \"visibility\", startNum ? \"inherit\" : \"hidden\", endNum ? \"inherit\" : \"hidden\", !endNum);\n }\n\n if (p !== \"scale\" && p !== \"transform\") {\n p = _propertyAliases[p];\n ~p.indexOf(\",\") && (p = p.split(\",\")[0]);\n }\n }\n\n isTransformRelated = p in _transformProps; //--- TRANSFORM-RELATED ---\n\n if (isTransformRelated) {\n this.styles.save(p);\n\n if (!transformPropTween) {\n cache = target._gsap;\n cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform); // if, for example, gsap.set(... {transform:\"translateX(50vw)\"}), the _get() call doesn't parse the transform, thus cache.renderTransform won't be set yet so force the parsing of the transform here.\n\n smooth = vars.smoothOrigin !== false && cache.smooth;\n transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1); //the first time through, create the rendering PropTween so that it runs LAST (in the linked list, we keep adding to the beginning)\n\n transformPropTween.dep = 1; //flag it as dependent so that if things get killed/overwritten and this is the only PropTween left, we can safely kill the whole tween.\n }\n\n if (p === \"scale\") {\n this._pt = new PropTween(this._pt, cache, \"scaleY\", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp);\n this._pt.u = 0;\n props.push(\"scaleY\", p);\n p += \"X\";\n } else if (p === \"transformOrigin\") {\n inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]);\n endValue = _convertKeywordsToPercentages(endValue); //in case something like \"left top\" or \"bottom right\" is passed in. Convert to percentages.\n\n if (cache.svg) {\n _applySVGOrigin(target, endValue, 0, smooth, 0, this);\n } else {\n endUnit = parseFloat(endValue.split(\" \")[2]) || 0; //handle the zOrigin separately!\n\n endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, \"zOrigin\", cache.zOrigin, endUnit);\n\n _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue));\n }\n\n continue;\n } else if (p === \"svgOrigin\") {\n _applySVGOrigin(target, endValue, 1, smooth, 0, this);\n\n continue;\n } else if (p in _rotationalProperties) {\n _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue);\n\n continue;\n } else if (p === \"smoothOrigin\") {\n _addNonTweeningPT(this, cache, \"smooth\", cache.smooth, endValue);\n\n continue;\n } else if (p === \"force3D\") {\n cache[p] = endValue;\n continue;\n } else if (p === \"transform\") {\n _addRawTransformPTs(this, endValue, target);\n\n continue;\n }\n } else if (!(p in style)) {\n p = _checkPropPrefix(p) || p;\n }\n\n if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) {\n startUnit = (startValue + \"\").substr((startNum + \"\").length);\n endNum || (endNum = 0); // protect against NaN\n\n endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit);\n startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit));\n this._pt = new PropTween(this._pt, isTransformRelated ? cache : style, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === \"px\" || p === \"zIndex\") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp);\n this._pt.u = endUnit || 0;\n\n if (startUnit !== endUnit && endUnit !== \"%\") {\n //when the tween goes all the way back to the beginning, we need to revert it to the OLD/ORIGINAL value (with those units). We record that as a \"b\" (beginning) property and point to a render method that handles that. (performance optimization)\n this._pt.b = startValue;\n this._pt.r = _renderCSSPropWithBeginning;\n }\n } else if (!(p in style)) {\n if (p in target) {\n //maybe it's not a style - it could be a property added directly to an element in which case we'll try to animate that.\n this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets);\n } else if (p !== \"parseTransform\") {\n _missingPlugin(p, endValue);\n\n continue;\n }\n } else {\n _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue);\n }\n\n isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : inlineProps.push(p, 1, startValue || target[p]));\n props.push(p);\n }\n }\n\n hasPriority && _sortPropTweensByPriority(this);\n },\n render: function render(ratio, data) {\n if (data.tween._time || !_reverting()) {\n var pt = data._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n } else {\n data.styles.revert();\n }\n },\n get: _get,\n aliases: _propertyAliases,\n getSetter: function getSetter(target, property, plugin) {\n //returns a setter function that accepts target, property, value and applies it accordingly. Remember, properties like \"x\" aren't as simple as target.style.property = value because they've got to be applied to a proxy object and then merged into a transform string in a renderer.\n var p = _propertyAliases[property];\n p && p.indexOf(\",\") < 0 && (property = p);\n return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get(target, \"x\")) ? plugin && _recentSetterPlugin === plugin ? property === \"scale\" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === \"scale\" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf(\"-\") ? _setterCSSProp : _getSetter(target, property);\n },\n core: {\n _removeProperty: _removeProperty,\n _getMatrix: _getMatrix\n }\n};\ngsap.utils.checkPrefix = _checkPropPrefix;\ngsap.core.getStyleSaver = _getStyleSaver;\n\n(function (positionAndScale, rotation, others, aliases) {\n var all = _forEachName(positionAndScale + \",\" + rotation + \",\" + others, function (name) {\n _transformProps[name] = 1;\n });\n\n _forEachName(rotation, function (name) {\n _config.units[name] = \"deg\";\n _rotationalProperties[name] = 1;\n });\n\n _propertyAliases[all[13]] = positionAndScale + \",\" + rotation;\n\n _forEachName(aliases, function (name) {\n var split = name.split(\":\");\n _propertyAliases[split[1]] = all[split[0]];\n });\n})(\"x,y,z,scale,scaleX,scaleY,xPercent,yPercent\", \"rotation,rotationX,rotationY,skewX,skewY\", \"transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective\", \"0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY\");\n\n_forEachName(\"x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective\", function (name) {\n _config.units[name] = \"px\";\n});\n\ngsap.registerPlugin(CSSPlugin);\nexport { CSSPlugin as default, _getBBox, _createElement, _checkPropPrefix as checkPrefix };","import { gsap, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ, TweenLite, TimelineLite, TimelineMax } from \"./gsap-core.js\";\nimport { CSSPlugin } from \"./CSSPlugin.js\";\nvar gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap,\n // to protect from tree shaking\nTweenMaxWithCSS = gsapWithCSS.core.Tween;\nexport { gsapWithCSS as gsap, gsapWithCSS as default, CSSPlugin, TweenMaxWithCSS as TweenMax, TweenLite, TimelineMax, TimelineLite, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ };","<template>\n <TransitionGroup\n ref=\"list\"\n tag=\"div\"\n appear\n :css=\"false\"\n @before-enter=\"onBeforeEnter\"\n @enter=\"onEnter\"\n @leave=\"onLeave\"\n >\n <slot />\n </TransitionGroup>\n</template>\n\n<script setup>\nimport gsap from 'gsap';\nimport { computed, ref } from 'vue';\n\nconst props = defineProps({\n height: {\n type: [String, Number],\n default: 'auto'\n },\n duration: {\n type: Number,\n default: 0.5\n },\n delayOffset: {\n type: Number,\n default: 0.5\n },\n disabled: Boolean\n});\n\nconst list = ref(null);\nconst indexDelay = computed(() => {\n return props.delayOffset / list.value.$el.children.length;\n});\n\nfunction onBeforeEnter(el) {\n if (props.disabled) {\n return;\n }\n el.style.opacity = 0;\n el.style.height = 0;\n}\n\nfunction onEnter(el, onComplete) {\n if (props.disabled) {\n onComplete();\n return;\n }\n\n gsap.to(el, {\n opacity: 1,\n duration: props.duration,\n height: props.height,\n delay: el.dataset.index * indexDelay.value,\n onComplete\n });\n}\n\nfunction onLeave(el, onComplete) {\n if (props.disabled) {\n onComplete();\n return;\n }\n\n gsap.to(el, {\n opacity: 0,\n height: 0,\n duration: props.duration,\n delay: el.dataset.index * indexDelay.value,\n onComplete\n });\n}\n</script>\n\n<style scoped lang=\"scss\">\n.list-move,\n.list-enter-active,\n.list-leave-active {\n transition: all 0.5s ease;\n}\n\n.list-enter-from,\n.list-leave-to {\n opacity: 0;\n transform: translateX(2em);\n}\n\n/* ensure leaving items are taken out of layout flow so that moving\n animations can be calculated correctly. */\n.list-leave-active {\n position: absolute;\n}\n</style>\n","import { DragAndDrop } from \"./dragAndDrop\";\n\n/**\n * ListDragAndDrop supports dragging elements in a list to new positions in the same list.\n * A placeholder is rendered to show the position the list item will be dropped.\n *\n * @class\n */\nexport class ListDragAndDrop extends DragAndDrop {\n listPosition = 0;\n cursorPosition = 0;\n initialPosition = 0;\n onPositionChangeCb = null;\n onDragPositionChangeCb = null;\n placeholder = null;\n\n constructor(options = {}) {\n super({\n showPlaceholder: true,\n ...options,\n });\n }\n\n /**\n * Callback that fires after dragging has ended and the list position has changed from the original\n * @param cb\n * @returns {ListDragAndDrop}\n */\n onPositionChange(cb) {\n this.onPositionChangeCb = cb;\n return this;\n }\n\n /**\n * Callback that fires while dragging the element when the cursor's position has changed in the list\n * @param cb\n * @returns {ListDragAndDrop}\n */\n onDragPositionChange(cb) {\n this.onDragPositionChangeCb = cb;\n return this;\n }\n\n /**\n * Start listening for drag events and prepare an element for drag/drop\n * @param e\n * @param data\n */\n dragStart(e, data) {\n super.dragStart(e, data);\n\n if (this.currentDropZone) {\n this.listPosition = this.getListPosition(e.target);\n this.initialPosition = this.listPosition;\n this.updateScrollPosition();\n }\n }\n\n /**\n * When dragging has ended, check for list position changes and fire the onPositionChange callback if it has\n */\n dragEnd(e) {\n const draggableData = this.draggableData;\n this.placeholder?.remove();\n super.dragEnd(e);\n\n // If our list position has changed, trigger the drop callback\n if (this.listPosition !== this.initialPosition) {\n this.onPositionChangeCb &&\n this.onPositionChangeCb(this.listPosition, this.initialPosition, draggableData);\n }\n }\n\n /**\n * The dragging element is moving\n * @param e\n */\n dragOver(e) {\n super.dragOver(e);\n this.updateListPosition(e);\n }\n\n /**\n * Notify if the targeted position of the cursor is different from the current position\n * @param e\n */\n updateListPosition(e) {\n const prevPosition = this.listPosition;\n const newPosition = this.getListPositionOfPoint({\n x: e.clientX,\n y: e.clientY,\n });\n\n // If the cursor position has changed, we should update the rendering and see if our actual list position has\n // changed\n if (this.cursorPosition !== newPosition) {\n this.cursorPosition = newPosition;\n this.listPosition =\n this.initialPosition < this.cursorPosition\n ? this.cursorPosition - 1\n : this.cursorPosition;\n if (this.options.showPlaceholder) {\n this.renderPlaceholder();\n }\n\n // The position has changed, trigger the callback\n if (this.listPosition !== prevPosition) {\n this.onDragPositionChangeCb &&\n this.onDragPositionChangeCb(this.listPosition, this.draggableData);\n }\n }\n }\n\n /**\n * Find the numeric position of the element in the children of the list\n * @returns {Number|null}\n * @param item\n */\n getListPosition(item) {\n let index = 0;\n for (const child of this.getChildren()) {\n if (child === item) {\n return index;\n }\n index++;\n }\n\n return null;\n }\n\n /**\n * Get all the children of the current drop zone, excluding the placeholder\n * @returns {*}\n */\n getChildren() {\n return [...this.currentDropZone.children].filter(\n (c) => c.className.match(/drag-placeholder/) === null\n );\n }\n\n /**\n * Find the element at the current cursor position in the given drop zone\n * @param point\n * @returns {null}\n */\n getListPositionOfPoint(point) {\n let index = 0;\n const children = this.getChildren();\n\n while (index < children.length) {\n const rect = children[index].getBoundingClientRect();\n if (this.isVertical()) {\n if (point.y < rect.top + rect.height / 2) {\n break;\n }\n } else {\n if (point.x < rect.left + rect.width / 2) {\n break;\n }\n }\n index++;\n }\n\n return index;\n }\n\n /**\n * Updates the scroll position while dragging an element so a user can navigate a longer list while dragging\n */\n updateScrollPosition() {\n if (this.currentDropZone) {\n const rect = this.currentDropZone.getBoundingClientRect();\n const threshold = 100;\n let velocity = 0;\n const velocityFn = (x) => x * 5;\n const cursorPos = this.isVertical() ? this.cursorY : this.cursorX;\n const rectStart = this.isVertical() ? rect.top : rect.left;\n const rectEnd = this.isVertical() ? rect.bottom : rect.right;\n const beforeDiff = rectStart + threshold - cursorPos;\n const afterDiff = cursorPos - (rectEnd - threshold);\n\n if (beforeDiff > 0) {\n velocity = -velocityFn(beforeDiff);\n } else if (afterDiff > 0) {\n velocity = velocityFn(afterDiff);\n }\n\n if (velocity) {\n if (this.isVertical()) {\n this.currentDropZone.scrollTo({\n top: this.currentDropZone.scrollTop + velocity,\n behavior: \"smooth\",\n });\n } else {\n this.currentDropZone.scrollTo({\n left: this.currentDropZone.scrollLeft + velocity,\n behavior: \"smooth\",\n });\n }\n }\n\n setTimeout(() => this.updateScrollPosition(), 500);\n }\n }\n\n /**\n * Render a placeholder element at the given position (in between the elements)\n */\n renderPlaceholder() {\n if (!this.placeholder) {\n this.placeholder = document.createElement(\"div\");\n this.placeholder.classList.add(\"drag-placeholder\");\n }\n\n // Make sure the placeholder is oriented correctly\n if (this.isVertical()) {\n this.placeholder.classList.add(\"direction-vertical\");\n this.placeholder.classList.remove(\"direction-horizontal\");\n this.placeholder.style.height = undefined;\n } else {\n this.placeholder.classList.add(\"direction-horizontal\");\n this.placeholder.classList.remove(\"direction-vertical\");\n this.placeholder.style.height =\n this.currentDropZone.getBoundingClientRect().height + \"px\";\n }\n\n const children = this.getChildren();\n if (this.cursorPosition < children.length) {\n this.currentDropZone.insertBefore(\n this.placeholder,\n children[this.cursorPosition]\n );\n } else {\n this.currentDropZone.appendChild(this.placeholder);\n }\n }\n}\n","<template>\n <div\n class=\"cursor-move\"\n draggable=\"true\"\n @dragstart=\"dragAndDrop.dragStart\"\n @dragend=\"dragAndDrop.dragEnd\"\n >\n <div class=\"flex items-center\">\n <div v-if=\"showHandle\">\n <SvgImg :svg=\"DragHandleIcon\" class=\"w-4 h-4\" alt=\"drag-handle\" />\n </div>\n <div class=\"flex-grow\">\n <slot />\n </div>\n </div>\n </div>\n</template>\n<script setup>\nimport { DragHandleDotsIcon as DragHandleIcon } from '../../svg';\nimport { SvgImg } from '../Utility';\nimport { ListDragAndDrop } from './listDragAndDrop';\n\nconst emit = defineEmits(['position', 'update:list-items']);\nconst props = defineProps({\n dropZone: {\n type: [Function, String],\n required: true\n },\n direction: {\n type: String,\n default: 'vertical',\n validator: (value) => ['vertical', 'horizontal'].includes(value)\n },\n showHandle: Boolean,\n listItems: {\n type: Array,\n default: null\n }\n});\n\nconst dragAndDrop = new ListDragAndDrop()\n .setDropZone(props.dropZone)\n .setOptions({ showPlaceholder: true, direction: props.direction })\n .onPositionChange((newPosition, oldPosition) => {\n emit('position', newPosition);\n\n if (props.listItems) {\n const items = [...props.listItems];\n items.splice(newPosition, 0, items.splice(oldPosition, 1)[0]);\n emit('update:list-items', items);\n }\n });\n</script>\n","<template>\n <InfoDialog\n title=\"Column Settings\"\n @close=\"$emit('close')\"\n >\n <div class=\"mb-4 text-sm\">\n Customize columns by visibility, order, or priority (maximum 3 additional).\n </div>\n <ColumnListItem\n v-for=\"column in lockedColumns\" :key=\"column.name\" locked visible :column=\"column\"\n class=\"px-2.5 border border-gray-200 bg-white rounded-t-lg\"\n />\n <ListTransition\n name=\"fade-down-list\"\n data-drop-zone=\"column-list\"\n >\n <ListItemDraggable\n v-for=\"(column, index) in sortableColumns\"\n :key=\"column.name\"\n :list-items=\"sortableColumns\"\n drop-zone=\"column-list\"\n class=\"px-2 border border-gray-200 bg-white\"\n :class=\"{'rounded-b-lg': index === sortableColumns.length - 1}\"\n show-handle\n @update:list-items=\"$emit('update:sortable-columns', $event)\"\n >\n <ColumnListItem\n :column=\"column\"\n :visible=\"isVisible(column)\"\n :is-title=\"isTitleColumn(column)\"\n @visible=\"onVisibilityChange(column, $event)\"\n @is-title=\"onTitleColumnChange(column, $event)\"\n />\n </ListItemDraggable>\n </ListTransition>\n </InfoDialog>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport { FlashMessages, remove } from '../../../helpers';\nimport { ListItemDraggable } from '../../DragAndDrop';\nimport { InfoDialog, ListTransition } from '../../Utility';\nimport ColumnListItem from './ColumnListItem';\n\nconst emit = defineEmits(['close', 'update:hidden-column-names', 'update:title-column-names', 'update:sortable-columns']);\nconst props = defineProps({\n hiddenColumnNames: {\n type: Array,\n required: true\n },\n titleColumnNames: {\n type: Array,\n required: true\n },\n lockedColumns: {\n type: Array,\n required: true\n },\n sortableColumns: {\n type: Array,\n required: true\n },\n titleColumnLimit: {\n type: Number,\n default: 3\n }\n});\n\nconst allowMoreTitleColumns = computed(() => {\n return props.titleColumnNames.length < props.titleColumnLimit;\n});\nfunction isVisible(column) {\n return !props.hiddenColumnNames.includes(column.name);\n}\nfunction onVisibilityChange(column, visible) {\n let hiddenColumnNames = [...props.hiddenColumnNames];\n\n if (visible && hiddenColumnNames.includes(column.name)) {\n hiddenColumnNames = remove(hiddenColumnNames, column.name);\n } else {\n hiddenColumnNames.push(column.name);\n }\n emit('update:hidden-column-names', [...new Set(hiddenColumnNames)]);\n}\n\nfunction isTitleColumn(column) {\n return props.titleColumnNames.includes(column.name);\n}\nfunction onTitleColumnChange(column, isTitle) {\n let titleColumnNames = [...props.titleColumnNames];\n if (isTitle && !titleColumnNames.includes(column.name)) {\n if (!allowMoreTitleColumns.value) {\n FlashMessages.warning(`You can only have ${props.titleColumnLimit} priority columns.`);\n return;\n }\n titleColumnNames.push(column.name);\n } else {\n titleColumnNames = remove(titleColumnNames, column.name);\n }\n emit('update:title-column-names', [...new Set(titleColumnNames)]);\n}\n</script>\n","<template>\n <div>\n <div\n v-for=\"column in columns\" :key=\"column.name\"\n class=\"overflow-hidden overflow-ellipsis text-xs text-gray-base\"\n >{{ format(row[column.name], column.format) }}\n </div>\n </div>\n</template>\n<script setup>\ndefineProps({\n row: {\n type: Object,\n required: true\n },\n columns: {\n type: Array,\n required: true\n }\n});\n\nfunction format(value, format) {\n if (typeof format === 'function') {\n return format(value);\n }\n return value;\n}\n</script>\n","<template>\n <div class=\"flex items-center flex-nowrap\">\n <div\n v-for=\"category in categories\"\n :key=\"category\"\n class=\"category-toggle border-gray-200\"\n :class=\"{'has-visible-columns text-white bg-blue-600': categoryHasVisibleColumns(category)}\"\n >\n <QCheckbox\n toggle-indeterminate\n size=\"20px\"\n :model-value=\"getCategoryCheckboxState(category)\"\n class=\"mr-2 cb-white-border\"\n @click=\"toggleColumns(columnsInCategory(category), !categoryHasVisibleColumns(category))\"\n />\n <div>\n {{ category }}\n </div>\n <CaretDownIcon\n class=\"ml-2 w-5 transition-all\"\n :class=\"{'rotate-180' : isShowingColumnToggle === category}\"\n />\n <QMenu\n @update:model-value=\"isShowingColumnToggle = $event ? category : ''\"\n >\n <QList>\n <div\n v-for=\"column in columnsInCategory(category)\"\n :key=\"column\"\n class=\"flex items-center flex-nowrap px-2 py-3 cursor-pointer\"\n @click=\"toggleColumn(column.name)\"\n >\n <QCheckbox\n :model-value=\"!hiddenColumnNames.includes(column.name)\"\n class=\"mr-3 cb-white-border\"\n size=\"20px\"\n :color=\"column.required ? 'gray-base': 'blue-600'\"\n :disable=\"column.required\"\n @click=\"toggleColumn(column.name)\"\n />\n <div class=\"text-xs\">{{ column.label }}</div>\n </div>\n </QList>\n </QMenu>\n </div>\n </div>\n</template>\n<script setup>\nimport { computed, ref } from 'vue';\nimport { remove } from '../../../helpers';\nimport { CaretDownIcon } from '../../../svg';\n\nconst emit = defineEmits(['update:hidden-column-names']);\nconst props = defineProps({\n columns: {\n type: Array,\n required: true\n },\n hiddenColumnNames: {\n type: Array,\n required: true\n }\n});\n\nconst isShowingColumnToggle = ref('');\nconst categories = computed(() => [...new Set(props.columns.map(c => c.category)).values()]);\n\n/**\n * Return a list of column names that belong to the category\n * @param category\n * @returns {(string|*)[]}\n */\nfunction columnsInCategory(category) {\n return props.columns.filter(c => c.category === category);\n}\n\n/**\n * Return true if any columns in the category are visible\n * @param category\n * @returns {boolean}\n */\nfunction categoryHasVisibleColumns(category) {\n // If there are any columns in the category that are not hidden, then the category has visible columns\n return columnsInCategory(category).filter(c => !c.required).map(c => c.name).some(c => !props.hiddenColumnNames.includes(c));\n}\n\n/**\n * Determines the state of the checkbox as either true, false or null (for the indeterminate state)\n * @param category\n * @returns {boolean|null}\n */\nfunction getCategoryCheckboxState(category) {\n let categoryColumns = columnsInCategory(category).filter(c => !c.required);\n const visibleColumns = categoryColumns.filter(c => !props.hiddenColumnNames.includes(c.name));\n if (visibleColumns.length === 0) {\n return false;\n } else if (visibleColumns.length === categoryColumns.length) {\n return true;\n }\n return null;\n}\n/**\n * Toggle all columns in a category\n * @param columns\n * @param showColumns\n */\nfunction toggleColumns(columns, showColumns) {\n // Ignore required columns\n columns = columns.filter(c => !c.required);\n\n let hiddenColumnNames = [...props.hiddenColumnNames];\n if (showColumns) {\n hiddenColumnNames = hiddenColumnNames.filter(c => !columns.map(c => c.name).includes(c));\n } else {\n hiddenColumnNames = [...new Set([...hiddenColumnNames, ...columns.map(c => c.name)])];\n }\n emit('update:hidden-column-names', hiddenColumnNames);\n}\n\n/**\n * Toggle a single column\n * @param columnName\n * @param showColumn\n */\nfunction toggleColumn(columnName, showColumn) {\n // Do not allow toggling required columns\n if (props.columns.find(c => c.name === columnName).required) return;\n\n // Determine weather to add (hide) or remove (show) the column\n showColumn = showColumn ?? props.hiddenColumnNames.includes(columnName);\n\n let hiddenColumnNames = [...props.hiddenColumnNames];\n\n // Add or remove the column from the hiddenColumnNames array\n if (showColumn) {\n hiddenColumnNames = remove(hiddenColumnNames, columnName);\n } else {\n hiddenColumnNames.push(columnName);\n hiddenColumnNames = [...new Set(hiddenColumnNames)];\n }\n\n emit('update:hidden-column-names', hiddenColumnNames);\n}\n</script>\n<style\n lang=\"scss\"\n scoped\n>\n.category-toggle {\n @apply text-xs font-bold rounded-lg border border-solid px-2 py-1 mx-1 cursor-pointer flex items-center;\n}\n</style>\n","<template>\n <span>\n <slot>\n {{ labelText }}\n <template v-if=\"showName\">({{ field?.name }})</template>\n </slot>\n <span\n v-if=\"requiredLabel\"\n class=\"text-red-dark ml-1 text-xs bottom-1 relative\"\n >{{ requiredLabel }}</span>\n </span>\n</template>\n\n<script setup>\nimport { computed } from \"vue\";\n\nconst props = defineProps({\n field: {\n type: Object,\n default: null\n },\n label: {\n type: String,\n default: null\n },\n showName: Boolean,\n required: Boolean\n});\n\nconst labelText = computed(() => props.label || props.field?.label);\nconst requiredLabel = computed(() => props.field?.required_group || (props.required || props.field?.required ? \"*\" : \"\"));\n</script>\n","<template>\n <LabeledInput\n type=\"password\"\n v-bind=\"props\"\n :name=\"name\"\n :model-value=\"modelValue\"\n :rules=\"rules\"\n @update:model-value=\"$emit('update:model-value', $event)\"\n />\n</template>\n\n<script setup>\nimport LabeledInput from './LabeledInput';\n\ndefineEmits(['update:model-value']);\nconst props = defineProps({\n name: {\n type: String,\n default: 'password_confirmation'\n },\n label: {\n type: String,\n default: 'Confirm Password'\n },\n placeholder: {\n type: String,\n default: 'Confirm Password'\n },\n modelValue: {\n type: [String, Number],\n required: true\n },\n error: {\n type: String,\n default: null\n },\n password: {\n type: String,\n default: ''\n },\n disabled: Boolean\n});\n\nconst rules = [\n (val) =>\n val === props.password || 'The password and confirmation do not match'\n];\n</script>\n","<template>\n <div>\n <div\n v-if=\"label\"\n class=\"font-bold text-xs mb-2\"\n >\n {{ label }}\n </div>\n <div class=\"flex items-center cursor-pointer\">\n <DateIcon class=\"w-5 text-blue-600\" />\n <div class=\"font-bold ml-3 hover:text-blue-600\">\n <template v-if=\"date\">\n {{ formattedDate }}\n </template>\n <template v-else>\n - -\n </template>\n </div>\n </div>\n <QPopupProxy>\n <QDate\n v-model=\"date\"\n @update:model-value=\"onSave\"\n />\n </QPopupProxy>\n </div>\n</template>\n\n<script setup>\nimport { CalendarIcon as DateIcon } from '@heroicons/vue/outline';\nimport { computed, ref, watch } from 'vue';\nimport { fDate, parseQDate } from '../../../../helpers';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: [String, Object],\n default: null\n },\n label: {\n type: String,\n default: null\n }\n});\n\nconst formattedDate = computed(() => {\n if (props.modelValue) {\n return fDate(parseQDate(props.modelValue || '0000-00-00'));\n }\n return null;\n});\n\nconst date = ref(props.modelValue);\nwatch(() => props.modelValue, val => date.value = val);\n\nfunction onSave() {\n emit('update:model-value', date.value);\n}\n</script>\n","<template>\n <div>\n <div\n v-if=\"label\"\n class=\"font-bold text-xs mb-2\"\n >\n {{ label }}\n </div>\n <template v-if=\"inline\">\n <QDate\n v-model=\"dateRange\"\n range\n class=\"reactive\"\n @update:model-value=\"onSave\"\n />\n </template>\n <template v-else>\n <div class=\"flex items-center cursor-pointer\">\n <DateIcon class=\"w-5 text-blue-600\" />\n <div class=\"font-bold ml-3 hover:text-blue-600\">\n <template v-if=\"dateRangeValue\">\n {{ formattedDates.from }} - {{ formattedDates.to }}\n </template>\n <template v-else>\n - -\n </template>\n </div>\n </div>\n <QPopupProxy>\n <QDate\n v-model=\"dateRange\"\n range\n @update:model-value=\"onSave\"\n />\n </QPopupProxy>\n </template>\n </div>\n</template>\n\n<script setup>\nimport { CalendarIcon as DateIcon } from '@heroicons/vue/outline';\nimport { computed, ref, watch } from 'vue';\nimport { fDate, parseQDate, parseQDateTime } from '../../../../helpers';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: Object,\n default: null\n },\n label: {\n type: String,\n default: null\n },\n inline: Boolean,\n withTime: Boolean\n});\n\nconst formattedDates = computed(() => {\n if (dateRangeValue.value) {\n if (props.withTime) {\n return {\n from: fDate(parseQDateTime(dateRangeValue.value.from || '0000-00-00')),\n to: fDate(parseQDateTime(dateRangeValue.value.to || '9999-12-31'))\n };\n }\n\n return {\n from: fDate(parseQDate(dateRangeValue.value.from || '0000-00-00')),\n to: fDate(parseQDate(dateRangeValue.value.to || '9999-12-31'))\n };\n }\n return {\n from: null,\n to: null\n };\n});\n\nconst dateRange = ref(toQDateValue(props.modelValue));\nwatch(() => props.modelValue, val => dateRange.value = toQDateValue(val));\n\nfunction toQDateValue(val) {\n if (val?.from && val?.to) {\n return fDate(val.from) === fDate(val.to) ? val.from : val;\n }\n return null;\n}\n\nconst dateRangeValue = computed(() => {\n let range;\n\n if (typeof dateRange.value === 'string') {\n range = {\n from: dateRange.value,\n to: dateRange.value\n };\n } else if (dateRange.value) {\n range = {\n from: dateRange.value.from,\n to: dateRange.value.to\n };\n }\n\n if (range?.from && range?.to && props.withTime && !range.from.includes('00:00:00')) {\n range.from += ' 00:00:00';\n range.to += ' 23:59:59';\n }\n\n return range;\n});\n\nfunction onSave() {\n emit('update:model-value', dateRangeValue.value);\n}\n</script>\n","<template>\n <QPopupProxy\n :model-value=\"true\"\n cover\n transition-show=\"scale\"\n transition-hide=\"scale\"\n class=\"bg-transparent shadow-none flex items-stretch\"\n >\n <QDate v-model=\"dateTime\" :mask=\"mask\" :color=\"color\">\n <div class=\"flex items-center justify-center\">\n <div v-if=\"nullable\" class=\"flex-grow\">\n <QBtn label=\"Clear\" color=\"blue-600\" flat @click=\"dateTime = null\" />\n </div>\n <div>\n <QBtn\n label=\"Cancel\"\n color=\"blue-600\"\n flat\n @click=\"$emit('cancel')\"\n />\n <QBtn label=\"Set\" color=\"blue-600\" flat @click=\"$emit('save')\" />\n </div>\n </div>\n </QDate>\n <QTime v-model=\"dateTime\" :mask=\"mask\" :color=\"color\" class=\"ml-3\" />\n </QPopupProxy>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport { dbDateTime, localizedDateTime, remoteDateTime } from '../../../../helpers';\n\nconst emit = defineEmits(['update:modelValue', 'save', 'cancel', 'clear']);\nconst props = defineProps({\n modelValue: {\n type: String,\n default: null\n },\n mask: {\n type: String,\n default: 'YYYY-MM-DD HH:mm'\n },\n color: {\n type: String,\n default: 'blue-600'\n },\n nullable: Boolean\n});\n\nconst dateTime = computed({\n get: () => dbDateTime(localizedDateTime(props.modelValue)),\n set(value) {\n const newValue = value ? dbDateTime(remoteDateTime(value)) : null;\n\n if (newValue || props.nullable) {\n emit('update:modelValue', newValue);\n }\n }\n});\n</script>\n","<template>\n <div>\n <QInput\n :model-value=\"fLocalizedDateTime(modelValue)\"\n :color=\"color\"\n class=\"bg-white rounded overflow-hidden px-2 w-48\"\n dense\n readonly\n @click=\"isShowing = true\"\n >\n <template #append>\n <QIcon name=\"event\" class=\"cursor-pointer\">\n <QPopupProxy v-model=\"isShowing\">\n <DateTimePicker\n v-model=\"dateTime\"\n @cancel=\"isShowing = false\"\n @save=\"onSave\"\n />\n </QPopupProxy>\n </QIcon>\n </template>\n </QInput>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue';\nimport { fLocalizedDateTime } from '../../../../helpers';\nimport DateTimePicker from './DateTimePicker';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: String,\n required: true\n },\n color: {\n type: String,\n default: 'blue-600'\n }\n});\n\nconst isShowing = ref(false);\nconst dateTime = ref(props.modelValue);\n\nfunction onSave() {\n emit('update:model-value', dateTime.value);\n isShowing.value = false;\n}\n</script>\n","<template>\n <div\n contenteditable\n class=\"inline-block hover:bg-blue-light focus:bg-blue-light transition duration-300 outline-none\"\n @input=\"onInput\"\n >\n {{ text }}\n </div>\n</template>\n\n<script setup>\nimport { useDebounceFn } from \"@vueuse/core\";\nimport { ref } from \"vue\";\n\nconst emit = defineEmits([\"update:model-value\", \"change\"]);\nconst props = defineProps({\n modelValue: {\n type: String,\n required: true\n },\n debounceDelay: {\n type: Number,\n default: 500\n }\n});\n\nconst text = ref(props.modelValue);\n\nconst debouncedChange = useDebounceFn(() => {\n emit(\"update:model-value\", text.value);\n emit(\"change\", text.value);\n}, props.debounceDelay);\n\nfunction onInput(e) {\n text.value = e.target.innerText;\n debouncedChange();\n}\n\n</script>\n","<template>\n <QBtn v-bind=\"$props\" @click=\"$refs.fileUpload.click()\">\n <slot>\n <PlusIcon class=\"w-5 mr-2\" />\n {{ text }}\n </slot>\n\n <input\n ref=\"fileUpload\"\n data-testid=\"file-upload\"\n type=\"file\"\n :accept=\"geolocation ? 'image/*;capture=camera' : undefined\"\n :capture=\"geolocation ? 'environment' : undefined\"\n class=\"hidden\"\n multiple\n @change=\"onAttachFiles\"\n />\n </QBtn>\n</template>\n<script setup>\nimport { PlusIcon } from '@heroicons/vue/outline';\nimport { QBtn } from 'quasar';\nimport { ref } from 'vue';\nimport { FileUpload } from '../../../../helpers';\n\ndefineExpose({ upload });\nconst emit = defineEmits([\n 'uploading',\n 'file-progress',\n 'file-complete',\n 'complete'\n]);\nconst props = defineProps({\n ...QBtn.props,\n text: {\n type: String,\n default: 'Add File'\n },\n locationWaitMessage: {\n type: String,\n default: 'Waiting for location...'\n },\n geolocation: Boolean\n});\n\nconst fileUpload = ref(null);\n\nfunction upload() {\n fileUpload.value.click();\n}\n\n/**\n * Upload newly attached files and emit events for progress / completion\n *\n * @param files\n * @returns {Promise<void>}\n */\nasync function onAttachFiles({ target: { files } }) {\n emit('uploading', files);\n let fileUpload = new FileUpload(files)\n .onProgress(({ file, progress }) => {\n file.progress = progress;\n emit('file-progress', file);\n })\n .onComplete(({ file, uploadedFile }) => {\n emit('file-complete', { file, uploadedFile });\n })\n .onAllComplete(() => {\n emit('complete', fileUpload.files);\n });\n\n if (props.geolocation) {\n await fileUpload.resolveLocation(props.locationWaitMessage);\n }\n\n fileUpload.upload();\n}\n</script>\n","<template>\n <div class=\"inline-block\">\n <div\n class=\"cursor-pointer py-2 hover:bg-blue-light flex items-center justify-end\"\n >\n {{ fLocalizedDateTime(modelValue, { empty: 'Never' }) }}\n <EditIcon class=\"w-4 font-bold ml-2 text-gray-base\" />\n <QPopupEdit\n v-slot=\"scope\"\n :model-value=\"modelValue\"\n touch-position\n :offset=\"[0, 20]\"\n class=\"bg-blue-600 text-white !min-w-0\"\n >\n <DateTimePicker\n v-model=\"scope.value\"\n :nullable=\"nullable\"\n @save=\"onSave(scope)\"\n @cancel=\"scope.cancel\"\n />\n </QPopupEdit>\n </div>\n </div>\n</template>\n<script setup>\nimport { PencilIcon as EditIcon } from '@heroicons/vue/solid';\nimport { fLocalizedDateTime } from '../../../../helpers';\nimport DateTimePicker from './DateTimePicker';\n\nconst emit = defineEmits(['close', 'save', 'update:model-value']);\ndefineProps({\n modelValue: {\n type: String,\n default: null\n },\n nullable: Boolean\n});\n\nfunction onSave(scope) {\n emit('update:model-value', scope.value);\n emit('save', scope.value);\n scope.set();\n}\n</script>\n","<template>\n <QInput\n :model-value=\"numberVal\"\n :data-testid=\"'number-field-' + fieldOptions.id\"\n :placeholder=\"fieldOptions.placeholder\"\n outlined\n dense\n inputmode=\"numeric\"\n :input-class=\"{[inputClass]: true, 'text-right bg-white': !hidePrependLabel, 'text-right !text-xs text-black font-normal': hidePrependLabel}\"\n :class=\"{'no-prepend-icon w-32': hidePrependLabel, 'prepend-label': !hidePrependLabel}\"\n @update:model-value=\"onInput\"\n >\n <template #prepend>\n <FieldLabel\n :field=\"fieldOptions\"\n :show-name=\"showName\"\n />\n </template>\n </QInput>\n</template>\n\n<script setup>\nimport { useDebounceFn } from '@vueuse/core';\nimport { computed, nextTick, ref, watch } from 'vue';\nimport { fNumber } from '../../../../helpers';\nimport FieldLabel from './FieldLabel';\n\nconst emit = defineEmits(['update:model-value', 'update']);\nconst props = defineProps({\n modelValue: {\n type: [String, Number],\n default: ''\n },\n precision: {\n type: Number,\n default: 2\n },\n label: {\n type: String,\n default: undefined\n },\n field: {\n type: Object,\n default: null\n },\n inputClass: {\n type: String,\n default: ''\n },\n delay: {\n type: Number,\n default: 1000\n },\n hidePrependLabel: Boolean,\n currency: Boolean,\n showName: Boolean\n});\n\nconst numberVal = ref(format(props.modelValue));\nwatch(() => props.modelValue, () => numberVal.value = format(props.modelValue));\n\nconst fieldOptions = computed(() => props.field || { label: props.label || '', placeholder: '', id: '' });\n\nfunction format(number) {\n if (!number && number !== 0 && number !== '0') return number;\n\n const minimumFractionDigits = Math.min(props.precision, ('' + number).split('.')[1]?.length || 0);\n let options = {\n minimumFractionDigits\n };\n\n if (props.currency) {\n options = {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits\n };\n }\n return fNumber(number, options);\n}\n\nconst onUpdateDebounced = useDebounceFn((val) => emit('update', val), props.delay);\n\nfunction onInput(value) {\n let number = '';\n\n // Prevent invalid characters\n if (value.match(/[^\\d.,$]/)) {\n const oldVal = numberVal.value;\n // XXX: To get QInput to show only the value we want\n numberVal.value += ' ';\n return nextTick(() => numberVal.value = oldVal);\n }\n\n if (value !== '') {\n value = value.replace(/[^\\d.]/g, '');\n number = Number(value);\n numberVal.value = format(number);\n }\n\n number = number === '' ? undefined : number;\n emit('update:model-value', number);\n\n // Delay the change event, so we only see the value after the user has finished\n onUpdateDebounced(number);\n}\n</script>\n","<template>\n <div\n class=\"max-w-full relative overflow-auto\"\n :class=\"{'p-4 border rounded border-gray-medium': !readonly}\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n >\n <FieldLabel\n :field=\"field\"\n :show-name=\"showName\"\n class=\"text-sm font-semibold\"\n />\n <div\n v-if=\"!disable && !readonly\"\n class=\"text-sm my-2\"\n >\n <a\n class=\"text-blue-600\"\n @click=\"$refs.file.click()\"\n >Upload</a>\n <a\n v-if=\"uploadedFiles.length > 0\"\n class=\"ml-3 text-red-dark\"\n @click=\"onClear\"\n >Clear</a>\n <input\n ref=\"file\"\n class=\"hidden\"\n type=\"file\"\n multiple\n @change=\"onFilesSelected\"\n />\n </div>\n\n <div class=\"max-w-[50em] flex items-stretch justify-start\">\n <FilePreview\n v-for=\"file in uploadedFiles\"\n :key=\"'file-upload-' + file.id\"\n class=\"w-32 m-2 cursor-pointer bg-gray-200\"\n :class=\"{'border border-dashed border-blue-600': !uploadedFiles.length}\"\n :image=\"file\"\n :related-files=\"uploadedFiles\"\n downloadable\n :removable=\"!readonly && !disable\"\n @remove=\"onRemove(file)\"\n />\n <FilePreview\n v-if=\"!disable && !readonly\"\n class=\"w-32 m-2 cursor-pointer border border-dashed border-blue-600\"\n disabled\n @click=\"$refs.file.click()\"\n />\n <div\n v-if=\"readonly && uploadedFiles.length === 0\"\n class=\"p-1\"\n >\n --\n </div>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { onMounted } from 'vue';\nimport { useMultiFileUpload } from '../../../../helpers';\nimport { FilePreview } from '../../../Utility';\nimport FieldLabel from './FieldLabel';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: [Object, String],\n default: null\n },\n field: {\n type: Object,\n required: true\n },\n showName: Boolean,\n disable: Boolean,\n readonly: Boolean\n});\n\nconst { onComplete, onDrop, onFilesSelected, uploadedFiles, onClear, onRemove } = useMultiFileUpload();\nonMounted(() => {\n if (props.modelValue) {\n uploadedFiles.value = props.modelValue;\n }\n});\nonComplete(() => emit('update:model-value', uploadedFiles.value));\n</script>\n","<template>\n <div>\n <QSelect\n ref=\"selectField\"\n v-bind=\"$props\"\n :model-value=\"selectedValue\"\n outlined\n hide-dropdown-icon\n dense\n emit-value\n :use-input=\"filterable\"\n :hide-selected=\"filterable && isShowing && !$props.multiple\"\n :input-debounce=\"100\"\n :options=\"filteredOptions\"\n option-label=\"label\"\n option-value=\"value\"\n placeholder=\"\"\n :input-class=\"{'is-hidden': !isShowing, [inputClass]: true}\"\n class=\"max-w-full\"\n @filter=\"onFilter\"\n @clear=\"onClear\"\n @popup-show=\"onShow\"\n @popup-hide=\"onHide\"\n @update:model-value=\"onUpdate\"\n >\n <template #append>\n <DropDownIcon\n class=\"w-4 transition\"\n :class=\"isShowing ? 'rotate-180' : ''\"\n />\n </template>\n <template #selected>\n <div\n v-if=\"$props.multiple\"\n class=\"flex gap-y-1 overflow-hidden\"\n :class=\"{'flex-nowrap gap-y-0': chipLimit === 1, [selectionClass]: true}\"\n >\n <template v-if=\"chipOptions.length > 0\">\n <QChip\n v-for=\"chipOption in chipOptions\"\n :key=\"'selected-' + chipOption.label\"\n class=\"!mr-1\"\n >{{ chipOption.label }}\n </QChip>\n <QChip\n v-if=\"selectedOptions.length > chipOptions.length\"\n class=\"!mr-1\"\n >\n +{{ selectedOptions.length - chipOptions.length }}\n </QChip>\n </template>\n <template v-else>\n {{ placeholder }}\n </template>\n </div>\n <div\n v-else\n :class=\"selectionClass\"\n >{{ selectedLabel }}\n </div>\n </template>\n </QSelect>\n </div>\n</template>\n<script setup>\nimport { ChevronDownIcon as DropDownIcon } from '@heroicons/vue/outline';\nimport { QSelect } from 'quasar';\nimport { computed, isRef, nextTick, ref } from 'vue';\n\nconst emit = defineEmits(['update:model-value', 'search', 'update']);\nconst props = defineProps({\n ...QSelect.props,\n modelValue: {\n type: [Array, String, Number, Object],\n default: undefined\n },\n placeholder: {\n type: String,\n default: ''\n },\n selectionLabel: {\n type: String,\n default: null\n },\n chipLimit: {\n type: Number,\n default: 3\n },\n inputClass: {\n type: String,\n default: ''\n },\n selectionClass: {\n type: String,\n default: ''\n },\n options: {\n type: Array,\n default: () => []\n },\n filterable: Boolean,\n filterFn: {\n type: Function,\n default: null\n }\n});\n\nconst selectField = ref(null);\n\n// The filter applied to the dropdown list of options\nconst filter = ref(null);\n// Is showing the dropdown list\nconst isShowing = ref(false);\n\n/**\n * The options formatted so each has a label, value and selectionLabel\n * @type {ComputedRef<{selectionLabel: string, label: string, value: string|*}[]>}\n */\nconst computedOptions = computed(() => {\n let options = props.options;\n if (props.placeholder && !props.multiple && !props.filterable) {\n options = [{ label: props.placeholder, value: null }, ...props.options];\n }\n options = options.map((o) => {\n let opt = isRef(o) ? o.value : o;\n return {\n label: resolveLabel(opt),\n value: resolveValue(opt),\n selectionLabel: resolveSelectionLabel(opt)\n };\n });\n return options;\n});\n\nconst filteredOptions = computed(() => {\n if (filter.value && !props.filterFn) {\n return computedOptions.value.filter(o => o.label.toLocaleLowerCase().indexOf(filter.value.toLowerCase()) > -1);\n } else {\n return computedOptions.value;\n }\n});\n\n/**\n * The value selected. Basically a wrapper to better handle null values (see onUpdate function for more details)\n * @type {ComputedRef<unknown>}\n */\nconst selectedValue = computed(() => {\n if (props.multiple) {\n const arrVal = Array.isArray(props.modelValue) ? props.modelValue : [];\n return arrVal.map((v) => {\n return v === null ? '__null__' : v;\n }) || [];\n } else {\n return props.modelValue === null ? '__null__' : props.modelValue;\n }\n});\n\n/**\n * The selected options. The list of options from the computedOptions list that are selected as defined by the modelValue\n * @type {ComputedRef<*>}\n */\nconst selectedOptions = computed(() => {\n let values = selectedValue.value;\n if (!props.multiple) {\n values = (values || values === 0) ? [values] : [];\n }\n return computedOptions.value.filter((o) => {\n return values.includes(o.value) || values.map(v => typeof v === 'object' && v.id).includes(o.value?.id);\n });\n});\n\n/**\n * The label to display in the input field of the dropdown for a selected state, non-selected state or an active filtering state.\n * NOTE: Only applies to single select (not multiselect)\n * @type {ComputedRef<unknown>}\n */\nconst selectedLabel = computed(() => {\n if (props.filterable && isShowing.value) return '';\n\n if (!selectedOptions.value || selectedOptions.value.length === 0) {\n return props.placeholder || '(Select Option)';\n }\n return selectedOptions.value[0].selectionLabel;\n});\n\n/**\n * The options to display as chips (limited by chipLimit prop)\n * @type {ComputedRef<*>}\n */\nconst chipOptions = computed(() => {\n return selectedOptions.value.slice(0, props.chipLimit);\n});\n\n/**\n * Resolve the label of the option. This will display as the text in the dropdown list\n * @param option\n * @returns {*|string}\n */\nfunction resolveLabel(option) {\n if (typeof option === 'string') {\n return option;\n }\n if (typeof props.optionLabel === 'string') {\n return option[props.optionLabel];\n }\n if (typeof props.optionLabel === 'function') {\n return props.optionLabel(option);\n }\n return option?.label;\n}\n\n/**\n * Resolve the label to display in the input field of the dropdown when an option is selected\n * NOTE: Does not apply to multiselect, single select only\n * @param option\n * @returns {*|{default: null, type: String | StringConstructor}|string}\n */\nfunction resolveSelectionLabel(option) {\n if (typeof option === 'string') {\n return option;\n }\n if (typeof props.selectionLabel === 'string') {\n return option[props.selectionLabel];\n }\n if (typeof props.selectionLabel === 'function') {\n return props.selectionLabel(option);\n }\n return option?.selectionLabel || option?.label;\n}\n\n/**\n * Resolve the value of the option using either defaults or the provided optionValue prop\n * @param option\n * @returns {string|*|string}\n */\nfunction resolveValue(option) {\n if (typeof option === 'string') {\n return option;\n }\n let value = option.value;\n if (typeof props.optionValue === 'string') {\n value = option[props.optionValue];\n } else if (typeof props.optionValue === 'function') {\n value = props.optionValue(option);\n }\n // Note the __null__ special case here. See the onUpdate function for more details\n return value === null ? '__null__' : value;\n}\n\n/**\n * Handle the update event from the QSelect\n * NOTE: casts all null values as a special __null__ string as the null character is handled the same as undefined by QSelect.\n * SelectField differentiates between these 2 to provide a null value selected state vs undefined is no value selected.\n * @param value\n */\nfunction onUpdate(value) {\n if (Array.isArray(value)) {\n value = value.map((v) => v === '__null__' ? null : v);\n }\n\n value = value === '__null__' ? null : value;\n\n emit('update', value);\n emit('update:model-value', value);\n}\n\n/** XXX: This tells us when we should apply the filter. QSelect likes to trigger a new filter everytime you open the dropdown\n * But most of the time when you open the dropdown it is already filtered and annoying to try and clear the previous filter\n **/\nconst shouldFilter = ref(false);\n\n/**\n * Filter the options list. Do this asynchronously for the update so that the QSelect can update its internal state first, then update SelectField\n * @param val\n * @param update\n */\nasync function onFilter(val, update) {\n if (!props.filterFn) {\n filter.value = val;\n await nextTick(update);\n } else {\n update();\n if (shouldFilter.value === false) return;\n if (val !== null && val !== filter.value) {\n filter.value = val;\n if (props.filterFn) {\n await props.filterFn(val);\n }\n }\n }\n}\n\n/**\n * Clear the selected value using undefined. SelectField differentiates between null and undefined.\n * See the onUpdate function for more details\n */\nfunction onClear() {\n emit('update:model-value', undefined);\n emit('update', undefined);\n}\n\n/**\n * Handle behavior when showing the dropdown\n */\nfunction onShow() {\n isShowing.value = true;\n\n // XXX: See description on shouldFilter declaration. Only allow filtering after dropdown is ALREADY opened\n shouldFilter.value = false;\n nextTick(() => {\n shouldFilter.value = true;\n selectField.value.focus();\n });\n}\n\n/**\n * Handle behavior when hiding the dropdown\n */\nfunction onHide() {\n isShowing.value = false;\n shouldFilter.value = false;\n}\n</script>\n","<template>\n <div>\n <SelectField\n v-model=\"selectedFieldName\"\n :label=\"undefined\"\n :options=\"field.options\"\n class=\"mb-2\"\n @update:model-value=\"onChange\"\n />\n <TextField\n v-model=\"textInput\"\n :field=\"field\"\n :no-label=\"!field.label\"\n label-class=\"text-xs font-bold text-gray-dark\"\n parent-class=\"tight-label\"\n input-class=\"!py-0\"\n dense\n type=\"textarea\"\n :debounce=\"500\"\n @update:model-value=\"onChange\"\n />\n </div>\n</template>\n\n<script setup>\nimport { computed, ref, watch } from 'vue';\nimport SelectField from './SelectField';\nimport TextField from './TextField';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: [String, Number, Object],\n default: ''\n },\n field: {\n type: Object,\n default: null\n }\n});\n\nconst selectedFieldName = ref(props.field.defaultOption);\nconst searchList = computed(() => props.modelValue && props.modelValue[selectedFieldName.value]);\nconst textInput = ref(formatModelValue());\nfunction onChange() {\n textInput.value = textInput.value?.replace(/\\n/g, ',').replace(/,{2,}/g, ',') || '';\n emit('update:model-value', textInput.value ? { [selectedFieldName.value]: textInput.value.split(',') } : undefined);\n}\n\nfunction formatModelValue() {\n return Array.isArray(searchList.value) ? searchList.value?.join(',') : '';\n}\n\nwatch(() => props.modelValue, () => {\n textInput.value = formatModelValue();\n});\n</script>\n","<template>\n <LabeledInput\n type=\"password\"\n v-bind=\"props\"\n :rules=\"rules\"\n @update:model-value=\"$emit('update:model-value', $event)\"\n />\n</template>\n\n<script setup>\nimport LabeledInput from './LabeledInput';\n\ndefineEmits(['update:model-value']);\nconst props = defineProps({\n name: {\n type: String,\n default: 'password'\n },\n label: {\n type: String,\n default: 'Password'\n },\n placeholder: {\n type: String,\n default: 'Enter Password'\n },\n modelValue: {\n type: [String, Number],\n required: true\n },\n error: {\n type: String,\n default: null\n },\n disabled: Boolean\n});\n\nconst rules = [(val) => val.length >= 8 || 'Please use at least 8 characters'];\n</script>\n","<template>\n <div>\n <div\n v-if=\"label\"\n class=\"font-bold text-xs mb-2\"\n >\n {{ label }}\n </div>\n <div class=\"flex items-center flex-nowrap cursor-pointer\">\n <component\n :is=\"previewIcon\"\n class=\"w-5 text-blue-600\"\n />\n <div class=\"text-sm ml-3 hover:text-blue-600 whitespace-nowrap\">\n <template v-if=\"range\">\n {{ formatNum(range.from || 0) }} - {{ formatNum(range.to) }}\n </template>\n <template v-else>\n No Limit\n </template>\n </div>\n </div>\n <QPopupProxy>\n <NumberField\n v-model=\"range.from\"\n :field=\"minField\"\n @update:model-value=\"onSave\"\n />\n <NumberField\n v-model=\"range.to\"\n class=\"mt-2\"\n :field=\"maxField\"\n @update:model-value=\"onSave\"\n />\n </QPopupProxy>\n </div>\n</template>\n\n<script setup>\nimport { CurrencyDollarIcon as CurrencyIcon, HashtagIcon as NumberIcon } from '@heroicons/vue/outline';\nimport { useDebounceFn } from '@vueuse/core';\nimport { computed, ref, watch } from 'vue';\nimport { fCurrency, fNumber, fPercent } from '../../../../helpers';\nimport { PercentIcon } from '../../../../svg';\nimport NumberField from './NumberField';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: Object,\n default: null\n },\n label: {\n type: String,\n default: null\n },\n icon: {\n type: Object,\n default: null\n },\n currency: Boolean,\n percent: Boolean,\n debounce: {\n type: Number,\n default: 0\n }\n});\n\nconst symbol = computed(() => {\n if (props.currency) {\n return '$';\n } else if (props.percent) {\n return '%';\n } else {\n return '';\n }\n});\nconst minField = computed(() => {\n return {\n id: 'min-field',\n name: 'from',\n label: 'Min' + symbol.value,\n placeholder: '0'\n };\n});\n\nconst maxField = computed(() => {\n return {\n id: 'max-field',\n name: 'to',\n label: 'Max' + symbol.value,\n placeholder: 'No Limit'\n };\n});\n\nconst previewIcon = computed(() => props.icon || (props.currency ? CurrencyIcon : (props.percent ? PercentIcon : NumberIcon)));\n\nconst range = ref({});\nwatch(() => props.modelValue, setRange);\nfunction setRange(val) {\n const multiplier = props.percent ? 100 : 1;\n range.value = {\n from: (val?.from ? val.from * multiplier : undefined),\n to: (val?.to ? val.to * multiplier : undefined)\n };\n}\nsetRange(props.modelValue || { from: undefined, to: undefined });\n\n/**\n * Convert the number into a nicely formatted string\n * @param num\n * @returns {string}\n */\nfunction formatNum(num) {\n if (num === undefined) return 'No Limit';\n if (props.currency) {\n return fCurrency(num);\n }\n if (props.percent) {\n return fPercent(num, { multiplier: 1, maximumFractionDigits: 2 });\n }\n return fNumber(num);\n}\n\n/**\n * Update the modelValue only after the debounce timeout\n * Empty values are converted to undefined so they will not be filtered on\n * @type {(function(): void)|*}\n */\nconst onSave = useDebounceFn(() => {\n if (range.value && (range.value.from || range.value.to)) {\n const multiplier = props.percent ? .01 : 1;\n let newVal = {\n from: (range.value.from ? range.value.from * multiplier : undefined),\n to: (range.value.to ? range.value.to * multiplier : undefined)\n };\n emit('update:model-value', newVal);\n }\n}, props.debounce);\n</script>\n","<template>\n <div>\n <ContentDrawer\n v-model:show=\"showDrawer\"\n content-class=\"\"\n position=\"bottom\"\n :title=\"'Filter ' + label\"\n >\n <div\n v-for=\"option in formattedOptions\"\n :key=\"'select-drawer-' + option.value\"\n :data-dusk=\"'drawer-opt-' + option.value\"\n class=\"cursor-pointer hover:bg-gray-light px-8 py-3 flex items-center border-b border-gray-light\"\n @click=\"toggleSelect(option)\"\n >\n <QCheckbox\n :model-value=\"isSelected(option)\"\n class=\"mr-2\"\n />\n <slot\n name=\"option\"\n :opt=\"option\"\n >{{ option.label }}\n </slot>\n </div>\n </ContentDrawer>\n\n <QChip\n ref=\"select\"\n outline\n clickable\n size=\"16px\"\n @click=\"showDrawer = true\"\n >\n <slot name=\"selected\">\n <slot name=\"label\">{{ label }}: </slot>\n <template v-if=\"modelValue && modelValue.length > 0\">\n <slot name=\"selection\">\n <template v-if=\"multiple\">\n {{ getOptionLabel(modelValue[0]) }}\n <template\n v-if=\"modelValue.length > 1\"\n >+ {{ modelValue.length - 1 }}\n </template\n >\n </template>\n <template v-else>\n {{ getOptionLabel(modelValue) }}\n </template>\n </slot>\n </template>\n <template v-else>\n <slot name=\"placeholder\">{{ placeholder }}</slot>\n </template>\n </slot>\n </QChip>\n </div>\n</template>\n\n<script setup>\nimport { computed, ref } from 'vue';\nimport { ContentDrawer } from '../../../Utility';\n\nconst emit = defineEmits(['update:modelValue']);\nconst props = defineProps({\n modelValue: {\n type: [Object, String, Array, null],\n required: true\n },\n options: {\n type: Array,\n default: () => []\n },\n multiple: Boolean,\n label: {\n type: String,\n default: 'Select'\n },\n placeholder: {\n type: String,\n default: 'All'\n }\n});\n\nconst showDrawer = ref(false);\nconst formattedOptions = computed(() =>\n props.options.map((opt) =>\n typeof opt === 'string'\n ? {\n label: opt,\n value: opt\n }\n : opt\n )\n);\n\nfunction getOptionValue(option) {\n return option.value === undefined ? option : option.value;\n}\n\nfunction getOptionLabel(value) {\n return formattedOptions.value.find((opt) => opt.value === value).label;\n}\n\nfunction isSelected(option) {\n const optionValue = getOptionValue(option);\n\n if (props.multiple) {\n return props.modelValue.includes(optionValue);\n } else {\n return props.modelValue === optionValue;\n }\n}\n\nfunction toggleSelect(option) {\n let optionValue = getOptionValue(option);\n\n let selection = optionValue;\n\n if (props.multiple) {\n selection = [...props.modelValue];\n if (isSelected(optionValue)) {\n selection = selection.filter((opt) => opt !== optionValue);\n } else {\n selection.push(optionValue);\n }\n } else {\n // Allow deselection on single select\n if (selection === props.modelValue) {\n selection = null;\n }\n }\n\n emit('update:modelValue', selection);\n}\n</script>\n","<template>\n <div>\n <template v-if=\"!loading && !options.length\">\n <div class=\"text-gray-silver\">No options available</div>\n </template>\n <SelectField\n v-model=\"selectedOption\"\n :options=\"options\"\n :label=\"label\"\n :placeholder=\"placeholder\"\n :option-value=\"opt => opt\"\n :loading=\"loading\"\n @update:model-value=\"onSelectOption\"\n />\n <div v-if=\"selectedOption\">\n <QCheckbox\n v-for=\"child in selectedOption.children\"\n :key=\"child.id\"\n :model-value=\"selectedChildren.includes(child.id)\"\n :field=\"child\"\n class=\"mt-3\"\n @update:model-value=\"onSelectChild(child)\"\n >\n <div>{{ child.label }}</div>\n <div class=\"text-xs text-gray-silver\">{{ child.name }}</div>\n </QCheckbox>\n </div>\n </div>\n</template>\n<script setup>\nimport { ref, watch } from 'vue';\nimport { remove } from '../../../../helpers';\nimport SelectField from './SelectField';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: Array,\n default: () => ([])\n },\n label: {\n type: String,\n default: 'Selection'\n },\n placeholder: {\n type: String,\n default: 'Select an option'\n },\n options: {\n type: Array,\n default: () => []\n },\n loading: Boolean\n});\n\nfunction resolveSelectedOption() {\n if (props.modelValue?.length > 0) {\n return props.options.find((option) => option.children.find(child => props.modelValue.includes(child.id)));\n }\n\n return null;\n}\nconst selectedOption = ref(resolveSelectedOption());\nconst selectedChildren = ref(props.modelValue || []);\nfunction onSelectChild(child) {\n if (selectedChildren.value.includes(child.id)) {\n selectedChildren.value = remove(selectedChildren.value, child.id);\n } else {\n selectedChildren.value.push(child.id);\n }\n emit('update:model-value', selectedChildren.value.length > 0 ? selectedChildren.value : undefined);\n}\nfunction onSelectOption() {\n selectedChildren.value = [];\n emit('update:model-value', undefined);\n}\nwatch(() => props.modelValue, (value) => {\n selectedOption.value = resolveSelectedOption();\n selectedChildren.value = value || [];\n});\n</script>\n","<template>\n <div\n class=\"max-w-full relative overflow-auto\"\n :class=\"{'p-4 border rounded border-gray-medium text-center': !readonly}\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n >\n <FieldLabel\n :field=\"field\"\n :show-name=\"showName\"\n class=\"text-sm font-semibold\"\n />\n <div\n v-if=\"!disable && !readonly\"\n class=\"text-sm mt-2\"\n >\n <a\n class=\"text-blue-600\"\n @click=\"$refs.file.click()\"\n >Upload</a>\n <a\n v-if=\"uploadedFile\"\n class=\"ml-3 text-red-dark\"\n @click=\"onClear\"\n >Clear</a>\n <input\n ref=\"file\"\n class=\"hidden\"\n type=\"file\"\n @change=\"onFileSelected\"\n />\n </div>\n\n <FilePreview\n v-if=\"!readonly || uploadedFile\"\n class=\"w-32 cursor-pointer mt-2\"\n :class=\"{'border border-dashed border-blue-600': !uploadedFile, 'mx-auto': !readonly}\"\n :image=\"uploadedFile\"\n downloadable\n @click=\"!disable && $refs.file.click()\"\n />\n <div\n v-else-if=\"readonly\"\n class=\"py-1\"\n >--\n </div>\n </div>\n</template>\n\n<script setup>\nimport { onMounted } from 'vue';\nimport { useSingleFileUpload } from '../../../../helpers';\nimport { FilePreview } from '../../../Utility';\nimport FieldLabel from './FieldLabel';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n modelValue: {\n type: [Object, String],\n default: null\n },\n field: {\n type: Object,\n required: true\n },\n showName: Boolean,\n disable: Boolean,\n readonly: Boolean\n});\nconst { onComplete, onDrop, onFileSelected, uploadedFile, onClear } = useSingleFileUpload();\nonComplete(() => emit('update:model-value', uploadedFile.value));\n\nonMounted(() => {\n if (props.modelValue) {\n uploadedFile.value = props.modelValue;\n }\n});\n</script>\n","/**\n * Copyright (c) 2018-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nimport { watch } from 'vue';\nvar validEvents = [\n 'onActivate',\n 'onAddUndo',\n 'onBeforeAddUndo',\n 'onBeforeExecCommand',\n 'onBeforeGetContent',\n 'onBeforeRenderUI',\n 'onBeforeSetContent',\n 'onBeforePaste',\n 'onBlur',\n 'onChange',\n 'onClearUndos',\n 'onClick',\n 'onContextMenu',\n 'onCopy',\n 'onCut',\n 'onDblclick',\n 'onDeactivate',\n 'onDirty',\n 'onDrag',\n 'onDragDrop',\n 'onDragEnd',\n 'onDragGesture',\n 'onDragOver',\n 'onDrop',\n 'onExecCommand',\n 'onFocus',\n 'onFocusIn',\n 'onFocusOut',\n 'onGetContent',\n 'onHide',\n 'onInit',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onLoadContent',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onNodeChange',\n 'onObjectResizeStart',\n 'onObjectResized',\n 'onObjectSelected',\n 'onPaste',\n 'onPostProcess',\n 'onPostRender',\n 'onPreProcess',\n 'onProgressState',\n 'onRedo',\n 'onRemove',\n 'onReset',\n 'onSaveContent',\n 'onSelectionChange',\n 'onSetAttrib',\n 'onSetContent',\n 'onShow',\n 'onSubmit',\n 'onUndo',\n 'onVisualAid'\n];\nvar isValidKey = function (key) {\n return validEvents.map(function (event) { return event.toLowerCase(); }).indexOf(key.toLowerCase()) !== -1;\n};\nvar bindHandlers = function (initEvent, listeners, editor) {\n Object.keys(listeners)\n .filter(isValidKey)\n .forEach(function (key) {\n var handler = listeners[key];\n if (typeof handler === 'function') {\n if (key === 'onInit') {\n handler(initEvent, editor);\n }\n else {\n editor.on(key.substring(2), function (e) { return handler(e, editor); });\n }\n }\n });\n};\nvar bindModelHandlers = function (props, ctx, editor, modelValue) {\n var modelEvents = props.modelEvents ? props.modelEvents : null;\n var normalizedEvents = Array.isArray(modelEvents) ? modelEvents.join(' ') : modelEvents;\n watch(modelValue, function (val, prevVal) {\n if (editor && typeof val === 'string' && val !== prevVal && val !== editor.getContent({ format: props.outputFormat })) {\n editor.setContent(val);\n }\n });\n editor.on(normalizedEvents ? normalizedEvents : 'change input undo redo', function () {\n ctx.emit('update:modelValue', editor.getContent({ format: props.outputFormat }));\n });\n};\nvar initEditor = function (initEvent, props, ctx, editor, modelValue, content) {\n editor.setContent(content());\n if (ctx.attrs['onUpdate:modelValue']) {\n bindModelHandlers(props, ctx, editor, modelValue);\n }\n bindHandlers(initEvent, ctx.attrs, editor);\n};\nvar unique = 0;\nvar uuid = function (prefix) {\n var time = Date.now();\n var random = Math.floor(Math.random() * 1000000000);\n unique++;\n return prefix + '_' + random + unique + String(time);\n};\nvar isTextarea = function (element) {\n return element !== null && element.tagName.toLowerCase() === 'textarea';\n};\nvar normalizePluginArray = function (plugins) {\n if (typeof plugins === 'undefined' || plugins === '') {\n return [];\n }\n return Array.isArray(plugins) ? plugins : plugins.split(' ');\n};\nvar mergePlugins = function (initPlugins, inputPlugins) {\n return normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));\n};\nvar isNullOrUndefined = function (value) {\n return value === null || value === undefined;\n};\nexport { bindHandlers, bindModelHandlers, initEditor, isValidKey, uuid, isTextarea, mergePlugins, isNullOrUndefined };\n","/**\n * Copyright (c) 2018-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nimport { uuid } from './Utils';\nvar createState = function () { return ({\n listeners: [],\n scriptId: uuid('tiny-script'),\n scriptLoaded: false\n}); };\nvar CreateScriptLoader = function () {\n var state = createState();\n var injectScriptTag = function (scriptId, doc, url, callback) {\n var scriptTag = doc.createElement('script');\n scriptTag.referrerPolicy = 'origin';\n scriptTag.type = 'application/javascript';\n scriptTag.id = scriptId;\n scriptTag.src = url;\n var handler = function () {\n scriptTag.removeEventListener('load', handler);\n callback();\n };\n scriptTag.addEventListener('load', handler);\n if (doc.head) {\n doc.head.appendChild(scriptTag);\n }\n };\n var load = function (doc, url, callback) {\n if (state.scriptLoaded) {\n callback();\n }\n else {\n state.listeners.push(callback);\n if (!doc.getElementById(state.scriptId)) {\n injectScriptTag(state.scriptId, doc, url, function () {\n state.listeners.forEach(function (fn) { return fn(); });\n state.scriptLoaded = true;\n });\n }\n }\n };\n // Only to be used by tests.\n var reinitialize = function () {\n state = createState();\n };\n return {\n load: load,\n reinitialize: reinitialize\n };\n};\nvar ScriptLoader = CreateScriptLoader();\nexport { ScriptLoader };\n","/**\n * Copyright (c) 2018-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nvar getGlobal = function () { return (typeof window !== 'undefined' ? window : global); };\nvar getTinymce = function () {\n var global = getGlobal();\n return global && global.tinymce ? global.tinymce : null;\n};\nexport { getTinymce };\n","export var editorProps = {\n apiKey: String,\n cloudChannel: String,\n id: String,\n init: Object,\n initialValue: String,\n inline: Boolean,\n modelEvents: [String, Array],\n plugins: [String, Array],\n tagName: String,\n toolbar: [String, Array],\n modelValue: String,\n disabled: Boolean,\n tinymceScriptSrc: String,\n outputFormat: {\n type: String,\n validator: function (prop) { return prop === 'html' || prop === 'text'; }\n },\n};\n","/**\n * Copyright (c) 2018-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { ScriptLoader } from '../ScriptLoader';\nimport { getTinymce } from '../TinyMCE';\nimport { isTextarea, mergePlugins, uuid, isNullOrUndefined, initEditor } from '../Utils';\nimport { editorProps } from './EditorPropTypes';\nimport { h, defineComponent, onMounted, ref, toRefs, nextTick, watch, onBeforeUnmount, onActivated, onDeactivated } from 'vue';\nvar renderInline = function (ce, id, elementRef, tagName) {\n return ce(tagName ? tagName : 'div', {\n id: id,\n ref: elementRef\n });\n};\nvar renderIframe = function (ce, id, elementRef) {\n return ce('textarea', {\n id: id,\n visibility: 'hidden',\n ref: elementRef\n });\n};\nvar defaultInitValues = { selector: undefined, target: undefined };\nexport var Editor = defineComponent({\n props: editorProps,\n setup: function (props, ctx) {\n var conf = props.init ? __assign(__assign({}, props.init), defaultInitValues) : __assign({}, defaultInitValues);\n var _a = toRefs(props), disabled = _a.disabled, modelValue = _a.modelValue, tagName = _a.tagName;\n var element = ref(null);\n var vueEditor = null;\n var elementId = props.id || uuid('tiny-vue');\n var inlineEditor = (props.init && props.init.inline) || props.inline;\n var modelBind = !!ctx.attrs['onUpdate:modelValue'];\n var mounting = true;\n var initialValue = props.initialValue ? props.initialValue : '';\n var cache = '';\n var getContent = function (isMounting) { return modelBind ?\n function () { return ((modelValue === null || modelValue === void 0 ? void 0 : modelValue.value) ? modelValue.value : ''); } :\n function () { return isMounting ? initialValue : cache; }; };\n var initWrapper = function () {\n var content = getContent(mounting);\n var finalInit = __assign(__assign({}, conf), { readonly: props.disabled, target: element.value, plugins: mergePlugins(conf.plugins, props.plugins), toolbar: props.toolbar || (conf.toolbar), inline: inlineEditor, setup: function (editor) {\n vueEditor = editor;\n editor.on('init', function (e) { return initEditor(e, props, ctx, editor, modelValue, content); });\n if (typeof conf.setup === 'function') {\n conf.setup(editor);\n }\n } });\n if (isTextarea(element.value)) {\n element.value.style.visibility = '';\n }\n getTinymce().init(finalInit);\n mounting = false;\n };\n watch(disabled, function (disable) {\n var _a;\n if (vueEditor !== null) {\n if (typeof ((_a = vueEditor.mode) === null || _a === void 0 ? void 0 : _a.set) === 'function') {\n vueEditor.mode.set(disable ? 'readonly' : 'design');\n }\n else {\n vueEditor.setMode(disable ? 'readonly' : 'design');\n }\n }\n });\n watch(tagName, function (_) {\n var _a;\n if (!modelBind) {\n cache = vueEditor.getContent();\n }\n (_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);\n nextTick(function () { return initWrapper(); });\n });\n onMounted(function () {\n if (getTinymce() !== null) {\n initWrapper();\n }\n else if (element.value && element.value.ownerDocument) {\n var channel = props.cloudChannel ? props.cloudChannel : '6';\n var apiKey = props.apiKey ? props.apiKey : 'no-api-key';\n var scriptSrc = isNullOrUndefined(props.tinymceScriptSrc) ?\n \"https://cdn.tiny.cloud/1/\".concat(apiKey, \"/tinymce/\").concat(channel, \"/tinymce.min.js\") :\n props.tinymceScriptSrc;\n ScriptLoader.load(element.value.ownerDocument, scriptSrc, initWrapper);\n }\n });\n onBeforeUnmount(function () {\n if (getTinymce() !== null) {\n getTinymce().remove(vueEditor);\n }\n });\n if (!inlineEditor) {\n onActivated(function () {\n if (!mounting) {\n initWrapper();\n }\n });\n onDeactivated(function () {\n var _a;\n if (!modelBind) {\n cache = vueEditor.getContent();\n }\n (_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);\n });\n }\n var rerender = function (init) {\n var _a;\n cache = vueEditor.getContent();\n (_a = getTinymce()) === null || _a === void 0 ? void 0 : _a.remove(vueEditor);\n conf = __assign(__assign(__assign({}, conf), init), defaultInitValues);\n nextTick(function () { return initWrapper(); });\n };\n ctx.expose({\n rerender: rerender,\n getEditor: function () { return vueEditor; }\n });\n return function () { return inlineEditor ?\n renderInline(h, elementId, element, props.tagName) :\n renderIframe(h, elementId, element); };\n }\n});\n","export const apiKey = \"YOUR_API_KEY\";\n","<template>\n <div>\n <template v-if=\"field.type === 'multi-select'\">\n <SelectField\n v-if=\"field.options?.length > 0 || loading\"\n :model-value=\"modelValue\"\n :options=\"field.options\"\n multiple\n :loading=\"loading\"\n :chip-limit=\"1\"\n filterable\n :placeholder=\"field.placeholder\"\n :label=\"field.label\"\n @update:model-value=\"onUpdate\"\n />\n <div\n v-else\n class=\"mt-2\"\n >\n <div class=\"text-xs font-bold\">{{ field.label }}</div>\n <div class=\"text-sm ml-3 py-2\">No Available Options</div>\n </div>\n </template>\n\n <SelectField\n v-else-if=\"field.type === 'single-select'\"\n :model-value=\"modelValue\"\n :options=\"field.options\"\n :placeholder=\"field.placeholder\"\n :loading=\"loading\"\n :label=\"field.label\"\n @update:model-value=\"onUpdate\"\n />\n <DateField\n v-else-if=\"field.type === 'date'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n class=\"mt-2\"\n @update:model-value=\"onUpdate\"\n />\n <DateRangeField\n v-else-if=\"field.type === 'date-range'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n :inline=\"field.inline\"\n with-time\n class=\"mt-2 reactive\"\n @update:model-value=\"onUpdate\"\n />\n <NumberRangeField\n v-else-if=\"field.type === 'number-range'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n class=\"mt-2\"\n :debounce=\"1000\"\n @update:model-value=\"onUpdate\"\n />\n <NumberRangeField\n v-else-if=\"field.type === 'currency-range'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n class=\"mt-2\"\n :debounce=\"1000\"\n currency\n @update:model-value=\"onUpdate\"\n />\n <NumberRangeField\n v-else-if=\"field.type === 'percent-range'\"\n :model-value=\"modelValue\"\n :label=\"field.label\"\n class=\"mt-2\"\n :debounce=\"1000\"\n percent\n @update:model-value=\"onUpdate\"\n />\n <BooleanField\n v-else-if=\"field.type === 'boolean'\"\n :field=\"field\"\n :model-value=\"modelValue\"\n class=\"mt-2\"\n label-class=\"text-xs font-bold\"\n @update:model-value=\"onUpdate\"\n />\n <MultiKeywordField\n v-else-if=\"field.type === 'multi-keywords'\"\n :model-value=\"modelValue\"\n :field=\"field\"\n @update:model-value=\"onUpdate\"\n />\n <SelectWithChildrenField\n v-else-if=\"field.type === 'select-with-children'\"\n :model-value=\"modelValue\"\n :options=\"field.options\"\n :loading=\"loading\"\n :label=\"field.label\"\n :placeholder=\"field.placeholder\"\n @update:model-value=\"onUpdate\"\n />\n <template v-else>\n Field "{{ field.name }}": Unknown filter type {{ field.type }}\n </template>\n </div>\n</template>\n<script setup>\nimport {\n BooleanField,\n DateField,\n DateRangeField,\n MultiKeywordField,\n NumberRangeField,\n SelectField,\n SelectWithChildrenField\n} from '../Form/Fields';\n\nconst emit = defineEmits(['update:model-value']);\nconst props = defineProps({\n field: {\n type: Object,\n required: true\n },\n modelValue: {\n type: [String, Array, Number, Object, Boolean],\n default: undefined\n },\n loading: Boolean\n});\n\nfunction onUpdate(val) {\n let newVal = val || undefined;\n\n switch (props.field.type) {\n case 'multi-select':\n newVal = val.length > 0 ? val : undefined;\n break;\n case 'single-select':\n case 'boolean':\n newVal = val === null ? undefined : val;\n break;\n }\n\n emit('update:model-value', newVal);\n}\n</script>\n","<template>\n <QList>\n <div class=\"px-4 py-2 max-w-full\">\n <template\n v-for=\"(group, index) in filterFields\"\n :key=\"'group-' + group.name\"\n >\n <template v-if=\"group.flat\">\n <FilterableField\n v-for=\"field in group.fields\"\n :key=\"'field-' + field.name\"\n :model-value=\"field.calcValue ? field.calcValue(filter) : filter[field.name]\"\n :field=\"field\"\n :loading=\"loading\"\n class=\"mb-4\"\n @update:model-value=\"updateFilter(field, $event)\"\n />\n </template>\n\n <FilterFieldItem\n v-else\n :name=\"group.name\"\n :count=\"activeCountByGroup[group.name]\"\n >\n <FilterableField\n v-for=\"field in group.fields\"\n :key=\"'field-' + field.name\"\n :model-value=\"field.calcValue ? field.calcValue(filter) : filter[field.name]\"\n :field=\"field\"\n :loading=\"loading\"\n class=\"mb-4\"\n @update:model-value=\"updateFilter(field, $event)\"\n />\n </FilterFieldItem>\n\n <QSeparator\n v-if=\"index < (filterFields.length - 1)\"\n class=\"my-2\"\n />\n </template>\n </div>\n </QList>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport FilterableField from './FilterableField';\nimport FilterFieldItem from './FilterFieldItem';\n\nconst emit = defineEmits(['update:filter']);\nconst props = defineProps({\n filterFields: {\n type: Array,\n required: true\n },\n filter: {\n type: Object,\n required: true\n },\n loading: Boolean\n});\n\nconst activeCountByGroup = computed(() => {\n const activeCountByGroup = {};\n for (const group of props.filterFields) {\n activeCountByGroup[group.name] = group.fields.filter(field => props.filter[field.name] !== undefined).length;\n }\n return activeCountByGroup;\n});\nfunction updateFilter(field, value) {\n let fieldFilter = { [field.name]: value };\n if (field.filterBy) {\n fieldFilter = field.filterBy(value);\n }\n emit('update:filter', { ...props.filter, ...fieldFilter });\n}\n</script>\n","<template>\n <div class=\"flex items-center transition-all\" :class=\"{'w-72': showFilters, 'w-[6.5rem]': !showFilters}\">\n <div class=\"flex-grow\">\n <QBtn\n class=\"btn-blue-highlight\"\n :class=\"{'highlighted': showFilters}\"\n @click=\"$emit('update:show-filters', !showFilters)\"\n >\n <FilterIcon class=\"w-5 mr-2\" />\n <QBadge\n :label=\"'' + activeCount\"\n rounded\n :color=\"activeCount > 0 ? 'blue-600' : 'gray-base'\"\n />\n </QBtn>\n </div>\n <a\n v-if=\"activeCount > 0\"\n class=\"text-blue-600 hover:text-blue-plus-1 text-sm ml-4\"\n @click=\"$emit('update:filter', {})\"\n >Clear All</a>\n </div>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport { FilterIcon } from '../../../svg';\n\ndefineEmits(['update:show-filters', 'update:filter']);\nconst props = defineProps({\n filter: {\n type: Object,\n required: true\n },\n showFilters: Boolean\n});\n\nconst activeCount = computed(() => Object.keys(props.filter).filter(key => props.filter[key] !== undefined).length);\n</script>\n","<template>\n <div class=\"rendered-form\">\n <div\n v-for=\"(field, index) in mappedFields\"\n :key=\"field.id\"\n :class=\"{ 'mt-4': index > 0 }\"\n >\n <Component\n :is=\"field.component\"\n v-model=\"fieldValues[field.name]\"\n :field=\"field\"\n :label=\"field.label || undefined\"\n :no-label=\"noLabel\"\n :show-name=\"showName\"\n :disable=\"disable\"\n :readonly=\"readonly\"\n @update:model-value=\"onInput(field.name, $event)\"\n />\n </div>\n </div>\n</template>\n<script setup>\nimport { reactive } from 'vue';\nimport {\n BooleanField,\n DateField,\n DateRangeField,\n IntegerField,\n MultiFileField,\n NumberField,\n SingleFileField,\n TextField,\n WysiwygField\n} from './Fields';\n\nconst emit = defineEmits(['update:values']);\nconst props = defineProps({\n values: {\n type: Object,\n default: null\n },\n fields: {\n type: Array,\n required: true\n },\n noLabel: Boolean,\n showName: Boolean,\n disable: Boolean,\n readonly: Boolean\n});\n\nconst FORM_FIELD_MAP = {\n BOOLEAN: BooleanField,\n DATE: DateField,\n DATE_RANGE: DateRangeField,\n INTEGER: IntegerField,\n NUMBER: NumberField,\n TEXT: TextField,\n SINGLE_FILE: SingleFileField,\n MULTI_FILE: MultiFileField,\n WYSIWYG: WysiwygField\n};\n\nconst mappedFields = props.fields.map((field) => ({\n placeholder: `Enter ${field.label}`,\n ...field,\n component: FORM_FIELD_MAP[field.type],\n default: field.type === 'BOOLEAN' ? false : ''\n}));\n\nconst fieldValues = reactive(props.values || {});\n\nfunction onInput(key, value) {\n emit('update:values', { ...fieldValues, [key]: value });\n}\n</script>\n","<template>\n <div class=\"flex flex-grow flex-col flex-nowrap overflow-hidden h-full bg-white\">\n <slot name=\"top\" />\n <slot name=\"toolbar\" />\n <div class=\"flex flex-nowrap flex-grow overflow-hidden w-full\">\n <slot name=\"filters\" />\n <slot />\n </div>\n </div>\n</template>\n","import { onMounted } from \"vue\";\nimport { getUrlParam } from \"../../helpers\";\n\nexport function registerStickyScrolling(tableRef) {\n onMounted(() => {\n const scrollEl = tableRef.value.$el.getElementsByClassName(\"q-table__middle\")[0];\n scrollEl.addEventListener(\"scroll\", onScroll);\n\n function onScroll({ target }) {\n // Add / remove scroll y class based on whether we're scrolling vertically\n if (target.scrollTop > 0) {\n scrollEl.classList.add(\"is-scrolling-y\");\n } else {\n scrollEl.classList.remove(\"is-scrolling-y\");\n }\n\n // Add / remove scroll x class based on whether we're scrolling horizontally\n if (target.scrollLeft > 0) {\n scrollEl.classList.add(\"is-scrolling-x\");\n } else {\n scrollEl.classList.remove(\"is-scrolling-x\");\n }\n }\n });\n}\n\nexport function mapSortBy(pagination, columns) {\n if (!pagination.sortBy) return null;\n\n const column = columns.find(c => c.name === pagination.sortBy);\n if (!column) return null;\n \n return [\n {\n column: column.sortBy || column.name,\n expression: column.sortByExpression || undefined,\n order: pagination.descending ? \"desc\" : \"asc\"\n }\n ];\n}\n\n/**\n * Returns the filter from the URL if it is set\n * @param url\n * @param allowedKeys\n */\nexport function getFilterFromUrl(url: string, allowedKeys = null) {\n const filter = {};\n const urlFilter = getUrlParam(\"filter\", url);\n if (urlFilter) {\n const fields = JSON.parse(urlFilter);\n Object.keys(fields).forEach((key) => {\n if (!allowedKeys || allowedKeys.includes(key)) {\n filter[key] = fields[key];\n }\n });\n }\n return filter;\n}\n","import { computed, ref, watch } from \"vue\";\nimport { getItem, setItem, waitForRef } from \"../../helpers\";\nimport { getFilterFromUrl } from \"./listHelpers\";\n\ninterface ListActionsOptions {\n listRoute: Function;\n summaryRoute?: Function;\n filterFieldOptionsRoute?: Function;\n moreRoute?: Function;\n itemDetailsRoute?: Function;\n urlPattern?: RegExp;\n filterDefaults?: Record<string, any>;\n refreshFilters?: boolean;\n}\n\nexport function useListControls(name: string, {\n listRoute,\n summaryRoute = null,\n filterFieldOptionsRoute = null,\n moreRoute = null,\n itemDetailsRoute = null,\n refreshFilters = false,\n urlPattern = null,\n filterDefaults = {}\n}: ListActionsOptions) {\n let isInitialized = false;\n const PAGE_SETTINGS_KEY = `${name}-pagination-settings`;\n const pagedItems = ref(null);\n const filter = ref({});\n const globalFilter = ref({});\n const showFilters = ref(getItem(`${name}-show-filters`, true));\n const selectedRows = ref([]);\n const isLoadingList = ref(false);\n const isLoadingSummary = ref(false);\n const summary = ref(null);\n\n const filterActiveCount = computed(() => Object.keys(filter.value).filter(key => filter.value[key] !== undefined).length);\n\n const PAGING_DEFAULT = {\n __sort: null,\n sortBy: null,\n descending: false,\n page: 1,\n rowsNumber: 0,\n rowsPerPage: 50\n };\n const quasarPagination = ref(PAGING_DEFAULT);\n\n const pager = computed(() => ({\n perPage: quasarPagination.value.rowsPerPage,\n page: quasarPagination.value.page,\n filter: { ...filter.value, ...globalFilter.value },\n sort: quasarPagination.value.__sort || undefined\n }));\n\n // When any part of the filter changes, get the new list of creatives\n watch(pager, () => {\n saveSettings();\n loadList();\n });\n watch(filter, () => {\n saveSettings();\n loadSummary();\n });\n watch(selectedRows, loadSummary);\n\n if (refreshFilters) {\n watch(filter, loadFilterFieldOptions);\n }\n\n async function loadList() {\n if (!isInitialized) return;\n isLoadingList.value = true;\n setPagedItems(await listRoute(pager.value));\n isLoadingList.value = false;\n }\n\n async function loadSummary() {\n if (!summaryRoute || !isInitialized) return;\n\n isLoadingSummary.value = true;\n const summaryFilter = { id: null, ...filter.value, ...globalFilter.value };\n if (selectedRows.value.length) {\n summaryFilter.id = selectedRows.value.map((row) => row.id);\n }\n summary.value = await summaryRoute(summaryFilter);\n isLoadingSummary.value = false;\n }\n\n // Filter fields are the field values available for the currently applied filter on Creative Groups\n // (ie: all states available under the current filter)\n const filterFieldOptions = ref({});\n const isLoadingFilters = ref(false);\n\n watch(() => showFilters.value, (show) => {\n setItem(`${name}-show-filters`, show);\n });\n\n async function loadFilterFieldOptions() {\n if (!filterFieldOptionsRoute || !isInitialized) return;\n isLoadingFilters.value = true;\n filterFieldOptions.value = await filterFieldOptionsRoute(filter.value);\n isLoadingFilters.value = false;\n }\n\n /**\n * Watches for a filter URL parameter and applies the filter if it is set.\n */\n function applyFilterFromUrl(url, filterFields = null) {\n if (url.match(urlPattern)) {\n // A flat list of valid filterable field names\n const validFilterKeys = filterFields?.value?.map(group => group.fields.map(field => field.name)).flat();\n\n const urlFilter = getFilterFromUrl(url, validFilterKeys);\n\n if (Object.keys(urlFilter).length > 0) {\n filter.value = urlFilter;\n\n // Override whatever is in local storage with this new filter\n updateSettings(\"filter\", filter.value);\n }\n }\n }\n\n // Set the reactive pager to map from the Laravel pagination to Quasar pagination\n // and automatically update the list of ads\n function setPagedItems(items) {\n if (Array.isArray(items)) {\n pagedItems.value = { data: items, meta: { total: items.length } };\n } else {\n pagedItems.value = items;\n if (items?.meta && items.meta.total !== quasarPagination.value.rowsNumber) {\n quasarPagination.value.rowsNumber = items.meta.total;\n }\n }\n }\n\n /**\n * Resets the filter and pagination settings to their defaults.\n */\n function resetPaging() {\n quasarPagination.value = PAGING_DEFAULT;\n }\n\n /**\n * Updates a row in the paged items list with the new item data. Uses the item's id to find the row.\n *\n * @param updatedItem\n */\n function setItemInPagedList(updatedItem) {\n const data = pagedItems.value?.data?.map(item => (item.id === updatedItem.id && (item.updated_at === null || item.updated_at <= updatedItem.updated_at)) ? updatedItem : item);\n pagedItems.value = { ...pagedItems.value, data };\n\n // Update the active item as well if it is set\n if (activeItem.value?.id === updatedItem.id) {\n activeItem.value = { ...activeItem.value, ...updatedItem };\n }\n }\n\n /**\n * Loads more items into the list.\n * @param index\n * @param perPage\n */\n async function loadMore(index, perPage = undefined) {\n const newItems = await moreRoute({\n page: index + 1,\n perPage,\n filter: { ...filter.value, ...globalFilter.value }\n });\n\n if (newItems && newItems.length > 0) {\n pagedItems.value.data = [...pagedItems.value.data, ...newItems];\n return true;\n }\n\n return false;\n }\n\n /**\n * Refreshes the list, summary, and filter field options.\n * @returns {Promise<Awaited<void>[]>}\n */\n async function refreshAll() {\n return Promise.all([loadList(), loadSummary(), loadFilterFieldOptions(), getActiveItemDetails()]);\n }\n\n /**\n * Updates the settings in local storage\n * @param key\n * @param value\n */\n function updateSettings(key, value) {\n const settings = getItem(PAGE_SETTINGS_KEY) || {};\n settings[key] = value;\n setItem(PAGE_SETTINGS_KEY, settings);\n }\n\n /**\n * Loads the filter and pagination settings from local storage.\n */\n function loadSettings() {\n // Only load settings when the class is fully initialized\n if (!isInitialized) return;\n\n const settings = getItem(PAGE_SETTINGS_KEY);\n\n // Load the filter settings from local storage\n if (settings) {\n filter.value = { ...settings.filter, ...filter.value };\n quasarPagination.value = settings.quasarPagination;\n } else {\n // If no local storage settings, apply the default filters\n filter.value = { ...filterDefaults, ...filter.value };\n }\n\n setTimeout(() => {\n if (!isLoadingList.value) {\n loadList();\n }\n\n if (!isLoadingSummary.value) {\n loadSummary();\n }\n\n if (!isLoadingFilters.value) {\n loadFilterFieldOptions();\n }\n }, 1);\n }\n\n /**\n * Saves the current filter and pagination settings to local storage.\n */\n async function saveSettings() {\n const settings = {\n filter: filter.value,\n quasarPagination: { ...quasarPagination.value, page: 1 }\n };\n // save in local storage\n setItem(PAGE_SETTINGS_KEY, settings);\n }\n\n // The active ad for viewing / editing\n const activeItem = ref(null);\n // Controls the active panel (ie: tab) if rendering a panels drawer or similar\n const activePanel = ref(null);\n\n /**\n * Gets the additional details for the currently active item.\n * (ie: data that is not normally loaded in the list because it is not needed for the list view)\n * @returns {Promise<void>}\n */\n async function getActiveItemDetails() {\n if (!activeItem.value || !itemDetailsRoute) return;\n\n const result = await itemDetailsRoute(activeItem.value);\n\n // Only set the ad details if we are the response for the currently loaded item\n // NOTE: race conditions might allow the finished loading item to be different to the currently\n // requested item\n if (result?.id === activeItem.value?.id) {\n activeItem.value = result;\n }\n }\n\n // Whenever the active item changes, fill the additional item details\n // (ie: tasks, verifications, creatives, etc.)\n if (itemDetailsRoute) {\n watch(() => activeItem.value, async (newItem, oldItem) => {\n if (newItem && oldItem?.id !== newItem.id) {\n await getActiveItemDetails();\n }\n });\n }\n\n /**\n * Opens the item's form with the given item and tab\n *\n * @param item\n * @param panel\n */\n function activatePanel(item, panel) {\n activeItem.value = item;\n activePanel.value = panel;\n }\n\n /**\n * Gets the next item in the list at the given offset (ie: 1 or -1) from the current position in the list of the\n * selected item. If the next item is on a previous or next page, it will load the page first then select the item\n * @param offset\n * @returns {Promise<void>}\n */\n async function getNextItem(offset) {\n const index = pagedItems.value?.data.findIndex(i => i.id === activeItem.value.id);\n if (index === undefined) return;\n let nextIndex = index + offset;\n\n // Load the previous page if the offset is before index 0\n if (nextIndex < 0) {\n if (quasarPagination.value.page > 1) {\n quasarPagination.value = { ...quasarPagination.value, page: quasarPagination.value.page - 1 };\n await waitForRef(isLoadingList, false);\n nextIndex = pagedItems.value.data.length - 1;\n } else {\n // There are no more previous pages\n return;\n }\n }\n\n // Load the next page if the offset is past the last index\n if (nextIndex >= pagedItems.value.data.length) {\n if (quasarPagination.value.page < pagedItems.value.meta.last_page) {\n quasarPagination.value = { ...quasarPagination.value, page: quasarPagination.value.page + 1 };\n await waitForRef(isLoadingList, false);\n nextIndex = 0;\n } else {\n // There are no more next pages\n return;\n }\n }\n\n activeItem.value = pagedItems.value.data[nextIndex];\n }\n\n // Initialize the list actions and load settings, lists, summaries, filter fields, etc.\n function initialize() {\n isInitialized = true;\n loadSettings();\n }\n\n return {\n // State\n pagedItems,\n filter,\n globalFilter,\n filterActiveCount,\n showFilters,\n summary,\n filterFieldOptions,\n selectedRows,\n isLoadingList,\n isLoadingFilters,\n isLoadingSummary,\n pager,\n quasarPagination,\n activeItem,\n activePanel,\n\n // Actions\n initialize,\n loadSummary,\n resetPaging,\n loadList,\n loadMore,\n refreshAll,\n getNextItem,\n activatePanel,\n applyFilterFromUrl,\n setItemInPagedList\n };\n}\n","import { computed, ref, watch } from \"vue\";\nimport { getItem, setItem } from \"../../helpers\";\n\nexport function useTableColumns(name, columns) {\n const COLUMN_ORDER_KEY = `${name}-column-order`;\n const VISIBLE_COLUMNS_KEY = `${name}-visible-columns`;\n const TITLE_COLUMNS_KEY = `${name}-title-columns`;\n\n // The list that defines the order the columns should appear in\n const columnOrder = ref(getItem(COLUMN_ORDER_KEY) || []);\n\n // Manages visible columns on the table\n const hiddenColumnNames = ref(getItem(VISIBLE_COLUMNS_KEY, []));\n\n // Title columns will have their name appear on the first column of the table as part of the records' title\n const titleColumnNames = ref(getItem(TITLE_COLUMNS_KEY, []));\n\n // Columns that should be locked to the left side of the table\n const lockedColumns = computed(() => orderedColumns.value.slice(0, 1));\n\n // The resolved list of columns in the order they should appear in\n const orderedColumns = computed(() => [...columns].sort((a, b) => {\n const aIndex = columnOrder.value.indexOf(a.name);\n const bIndex = columnOrder.value.indexOf(b.name);\n return aIndex === -1 ? 1 : bIndex === -1 ? -1 : aIndex - bIndex;\n }));\n\n // The ordered list of columns. The ordering of this list is editable and will be stored in localStorage\n const sortableColumns = computed({\n get() {\n return orderedColumns.value.slice(1);\n },\n set(newColumns) {\n columnOrder.value = [...lockedColumns.value.map(c => c.name), ...newColumns.map(c => c.name)];\n setItem(COLUMN_ORDER_KEY, columnOrder.value);\n }\n });\n\n // The list of columns that are visible. To edit the visible columns, edit the hiddenColumnNames list\n const visibleColumns = computed(() => orderedColumns.value.filter(c => !hiddenColumnNames.value.includes(c.name)));\n\n // The list of columns that should be included in the title of a row\n const orderedTitleColumns = computed(() => orderedColumns.value.filter(c => titleColumnNames.value.includes(c.name)));\n\n // Save changes to the list of hidden columns in localStorage\n watch(() => hiddenColumnNames.value, () => setItem(VISIBLE_COLUMNS_KEY, hiddenColumnNames.value));\n watch(() => titleColumnNames.value, () => setItem(TITLE_COLUMNS_KEY, titleColumnNames.value));\n\n return {\n sortableColumns,\n lockedColumns,\n visibleColumns,\n hiddenColumnNames,\n titleColumnNames,\n orderedTitleColumns\n };\n}\n","<template>\n <PopoverMenu\n class=\"px-2 flex action-button\"\n :items=\"activeActions\"\n :disabled=\"!hasTarget\"\n :tooltip=\"!hasTarget ? tooltip : null\"\n :loading=\"isSaving || loading\"\n :loading-component=\"loadingComponent\"\n @action-item=\"onAction\"\n />\n</template>\n<script setup>\nimport { computed, ref } from 'vue';\nimport { PopoverMenu } from '../Utility';\n\nconst props = defineProps({\n actions: {\n type: Array,\n required: true\n },\n target: {\n type: [Array, Object],\n default: () => []\n },\n tooltip: {\n type: String,\n default: 'First select records to perform a batch action'\n },\n loading: Boolean,\n loadingComponent: {\n type: [Function, Object],\n default: undefined\n }\n});\n\nconst hasTarget = computed(() => Array.isArray(props.target) ? props.target.length > 0 : !!props.target);\n\nconst activeActions = computed(() => props.actions.filter(action => {\n if (Array.isArray(props.target)) {\n return action.batchEnabled ? action.batchEnabled(props.target) : true;\n }\n\n return action.enabled ? action.enabled(props.target) : true;\n}));\n\nconst isSaving = ref(false);\nasync function onAction(action) {\n if (!action.trigger) {\n throw new Error('Action must have a trigger function! Make sure you are using useActions() or implement your own trigger function.');\n }\n isSaving.value = true;\n await action.trigger(props.target);\n isSaving.value = false;\n}\n</script>\n","<template>\n <QTd :key=\"rowProps.key\" :props=\"rowProps\" :style=\"columnStyle\">\n <div :style=\"columnStyle\">\n <div\n class=\"flex items-center flex-nowrap\"\n :class=\"columnClass\"\n >\n <div class=\"flex-grow\">\n <a\n v-if=\"column.onClick\"\n @click=\"column.onClick(row)\"\n >\n <RenderVnode v-if=\"column.vnode\" :vnode=\"column.vnode(row)\" />\n <slot v-else>{{ value }}</slot>\n </a>\n <div v-else>\n <RenderVnode v-if=\"column.vnode\" :vnode=\"column.vnode(row)\" />\n <slot v-else>{{ value }}</slot>\n </div>\n <TitleColumnFormat v-if=\"column.titleColumns\" :row=\"row\" :columns=\"column.titleColumns()\" />\n </div>\n <div v-if=\"column.actionMenu\" class=\"flex flex-shrink-0 pl-2\">\n <ActionMenu\n :actions=\"column.actionMenu\"\n :target=\"row\"\n :loading=\"isSaving\"\n />\n </div>\n </div>\n </div>\n </QTd>\n</template>\n<script setup>\nimport { QTd } from 'quasar';\nimport { computed } from 'vue';\nimport { RenderVnode } from '../Utility';\nimport ActionMenu from './ActionMenu';\nimport { TitleColumnFormat } from './Columns';\n\nconst props = defineProps({\n rowProps: {\n type: Object,\n required: true\n },\n settings: {\n type: Object,\n default: null\n }\n});\n\nconst row = computed(() => props.rowProps.row);\nconst column = computed(() => props.rowProps.col);\nconst value = computed(() => props.rowProps.value);\nconst isSaving = computed(() => column.value.isSaving && column.value.isSaving(row.value));\n\nconst columnStyle = computed(() => {\n const width = props.settings?.width || column.value.width;\n return width ? { width: `${width}px` } : null;\n});\n\nconst columnClass = computed(() => ({\n 'is-saving': isSaving.value,\n 'justify-end': column.value.align === 'right',\n 'justify-center': column.value.align === 'center',\n 'justify-start': column.value.align === 'left'\n}));\n</script>\n","<template>\n <QTr\n class=\"sticky-column-1 transition-all sticky-row\"\n :class=\"{'!bg-neutral-plus-7': !selectedCount, '!bg-blue-600 text-white selected': selectedCount, 'opacity-50': loading}\"\n >\n <QTd\n :colspan=\"stickyColspan\"\n class=\"font-bold transition-all\"\n :class=\"{'!bg-neutral-plus-7 !pl-5': !selectedCount, '!bg-blue-600 text-white !pl-4': selectedCount}\"\n >\n <div class=\"flex flex-nowrap items-center\">\n <div\n v-if=\"selectedCount\"\n class=\"flex items-center\"\n >\n <ClearIcon\n class=\"w-6 mr-3\"\n @click=\"$emit('clear')\"\n />\n {{ fNumber(selectedCount) }} {{ selectedLabel }}\n </div>\n <div v-else-if=\"itemCount\">\n {{ fNumber(itemCount) }} {{ label }}\n </div>\n <QSpinner\n v-if=\"loading\"\n class=\"ml-3\"\n size=\"18\"\n />\n </div>\n </QTd>\n <QTd\n v-for=\"column in summaryColumns\"\n :key=\"column.name\"\n :align=\"column.align || 'left'\"\n >\n <template v-if=\"summary\">\n {{ formatValue(column) }}\n </template>\n </QTd>\n </QTr>\n</template>\n<script setup>\nimport { XCircleIcon as ClearIcon } from '@heroicons/vue/solid';\nimport { QSpinner, QTd, QTr } from 'quasar';\nimport { computed } from 'vue';\nimport { fNumber } from '../../helpers';\n\ndefineEmits(['clear']);\nconst props = defineProps({\n loading: Boolean,\n label: {\n type: String,\n default: 'Rows'\n },\n selectedLabel: {\n type: String,\n default: 'Selected'\n },\n selectedCount: {\n type: Number,\n default: 0\n },\n itemCount: {\n type: Number,\n default: 0\n },\n summary: {\n type: Object,\n default: null\n },\n columns: {\n type: Array,\n required: true\n },\n stickyColspan: {\n type: Number,\n default: 2\n }\n});\n\nconst summaryColumns = computed(() => {\n // The sticky columns are where we display the selection count and should not be included in the summary columns\n return props.columns.slice(props.stickyColspan - 1);\n});\n\nfunction formatValue(column) {\n const value = props.summary[column.name];\n if (value === undefined) return '';\n\n if (column.format) {\n return column.format(value);\n }\n return value;\n}\n</script>\n","<template>\n <div class=\"overflow-hidden w-full\">\n <ActionVnode />\n <QTable\n ref=\"actionTable\"\n :selected=\"selectedRows\"\n :pagination=\"quasarPagination\"\n :columns=\"columns\"\n :loading=\"isLoadingList\"\n :rows=\"pagedItems?.data || []\"\n binary-state-sort\n selection=\"multiple\"\n :rows-per-page-options=\"rowsPerPageOptions\"\n class=\"sticky-column sticky-header w-full h-full !border-0\"\n color=\"blue-600\"\n @update:selected=\"$emit('update:selected-rows', $event)\"\n @update:pagination=\"() => {}\"\n @request=\"$emit('update:quasar-pagination', {...$event.pagination, __sort: mapSortBy($event.pagination, columns)})\"\n >\n <template #no-data>\n <slot name=\"empty\">\n <EmptyTableState :text=\"`There are no ${label.toLowerCase()} matching the applied filter`\" />\n </slot>\n </template>\n <template #top-row>\n <TableSummaryRow\n :label=\"label\"\n :item-count=\"summary?.count || 0\"\n :selected-count=\"selectedRows.length\"\n :loading=\"isLoadingSummary\"\n :summary=\"summary\"\n :columns=\"columns\"\n @clear=\"$emit('update:selected-rows', [])\"\n />\n </template>\n <template #header-cell=\"rowProps\">\n <QTh\n :key=\"rowProps.key\"\n :props=\"rowProps\"\n :data-drop-zone=\"`resize-column-` + rowProps.col.name\"\n >\n {{ rowProps.col.label }}\n <HandleDraggable\n v-if=\"rowProps.col.resizeable\"\n :drop-zone=\"`resize-column-` + rowProps.col.name\"\n class=\"resize-handle\"\n @resize=\"onResizeColumn(rowProps.col, $event)\"\n >\n <RowResizeIcon class=\"w-4 text-neutral-base\" />\n </HandleDraggable>\n </QTh>\n </template>\n <template #body-cell=\"rowProps\">\n <ActionTableColumn\n :key=\"rowProps.key\"\n :row-props=\"rowProps\"\n :settings=\"columnSettings[rowProps.col.name]\"\n >\n <slot :column-name=\"rowProps.col.name\" :row=\"rowProps.row\" :value=\"rowProps.value\" />\n </ActionTableColumn>\n </template>\n </QTable>\n </div>\n</template>\n\n<script setup>\nimport { QTable, QTh } from 'quasar';\nimport { ref } from 'vue';\nimport { getItem, setItem } from '../../helpers';\nimport { DragHandleIcon as RowResizeIcon } from '../../svg';\nimport { HandleDraggable } from '../DragAndDrop';\nimport { ActionVnode } from '../Utility';\nimport ActionTableColumn from './ActionTableColumn.vue';\nimport EmptyTableState from './EmptyTableState.vue';\nimport { mapSortBy, registerStickyScrolling } from './listHelpers';\nimport TableSummaryRow from './TableSummaryRow.vue';\n\ndefineEmits(['update:quasar-pagination', 'update:selected-rows']);\nconst props = defineProps({\n name: {\n type: String,\n required: true\n },\n label: {\n type: String,\n required: true\n },\n selectedRows: {\n type: Array,\n required: true\n },\n quasarPagination: {\n type: Object,\n required: true\n },\n isLoadingList: Boolean,\n pagedItems: {\n type: Object,\n default: null\n },\n isLoadingSummary: Boolean,\n summary: {\n type: Object,\n default: null\n },\n columns: {\n type: Array,\n required: true\n },\n rowsPerPageOptions: {\n type: Array,\n default: () => [10, 25, 50, 100]\n }\n});\nconst actionTable = ref(null);\nregisterStickyScrolling(actionTable);\n\nconst COLUMN_SETTINGS_KEY = `column-settings-${props.name}`;\nconst columnSettings = ref(getItem(COLUMN_SETTINGS_KEY) || {});\nfunction onResizeColumn(column, val) {\n columnSettings.value = {\n ...columnSettings.value,\n [column.name]: {\n width: Math.max(Math.min(val.distance + val.startDropZoneSize, column.maxWidth || 500), column.minWidth || 80)\n }\n };\n setItem(COLUMN_SETTINGS_KEY, columnSettings.value);\n}\n</script>\n\n<style lang=\"scss\" scoped>\n[data-drop-zone] {\n .resize-handle {\n position: absolute;\n top: 0;\n right: -.45em;\n width: .9em;\n opacity: 0;\n transition: all .3s;\n }\n\n &:hover {\n .resize-handle {\n opacity: 1;\n }\n }\n}\n</style>\n","<template>\n <div class=\"flex space-x-2\">\n <template v-if=\"type === 'SINGLE_FILE'\">\n <FilePreview\n :image=\"value\"\n class=\"w-24\"\n />\n </template>\n <template v-else-if=\"type === 'MULTI_FILE'\">\n <FilePreview\n v-for=\"file in value\"\n :key=\"'file-' + file.id\"\n :image=\"file\"\n class=\"w-24 mb-2\"\n />\n </template>\n <template v-else-if=\"type === 'WYSIWYG'\">\n <div v-html=\"value\" />\n </template>\n <template v-else>\n {{ format(value) }}\n </template>\n </div>\n</template>\n<script setup>\nimport { fCurrency, fDate, fLocalizedDateTime, fNumber } from '../../helpers';\nimport { FilePreview } from '../Utility';\n\nconst props = defineProps({\n type: {\n type: String,\n required: true\n },\n value: {\n type: [Number, String, Array, Object, Boolean],\n default: null\n }\n});\n\nfunction format(value) {\n if (value === null || value === '' || value === undefined) {\n return '';\n }\n\n switch (props.type) {\n case 'NUMBER':\n return fNumber(value);\n case 'CURRENCY':\n return fCurrency(value);\n case 'DATE':\n return fDate(value);\n case 'DATETIME':\n return fLocalizedDateTime(value);\n case 'BOOLEAN':\n return value ? 'Yes' : 'No';\n }\n\n return value;\n}\n</script>\n","<template>\n <div class=\"text-gray-shadow flex items-stretch flex-nowrap p-4\">\n <div class=\"flex-grow text-sm w-3/5 overflow-auto\">\n <h5>{{ change.label }} ({{ change.name }})</h5>\n <div class=\"flex flex-nowrap items-center mt-4\">\n <div class=\"bg-red-light line-through p-2\">\n <AuditHistoryItemValue\n :type=\"change.type\"\n :value=\"change.oldValue\"\n />\n </div>\n <div class=\"bg-green-plus-4 ml-2.5 p-2\">\n <AuditHistoryItemValue\n :type=\"change.type\"\n :value=\"change.newValue\"\n />\n </div>\n </div>\n </div>\n <div class=\"ml-4 text-sm w-2/5\">\n <template v-if=\"item.user\">\n <div>{{ item.user.name }}</div>\n <div>{{ item.user.email }}</div>\n </template>\n <div>{{ item.account }}</div>\n <div>\n <a v-if=\"item.audit_request_id\" :href=\"novaUrl\" target=\"_blank\">{{ fLocalizedDateTime(item.timestamp) }}</a>\n <template v-else>{{ fLocalizedDateTime(item.timestamp) }}</template>\n </div>\n </div>\n </div>\n</template>\n<script setup>\nimport { computed } from 'vue';\nimport { fLocalizedDateTime } from '../../helpers';\nimport AuditHistoryItemValue from './AuditHistoryItemValue';\n\nconst props = defineProps({\n item: {\n type: Object,\n required: true\n },\n change: {\n type: Object,\n required: true\n },\n novaUrl: {\n type: String,\n default: '/nova'\n }\n});\n\nconst novaUrl = computed(() => props.novaUrl + `/resources/audit-requests/${props.item.audit_request_id}`);\n</script>\n","<template>\n <ContentDrawer\n position=\"right\"\n :show=\"true\"\n overlay\n content-class=\"h-full\"\n title=\"\"\n @update:show=\"$emit('close')\"\n >\n <div class=\"flex flex-col flex-nowrap h-full\">\n <div class=\"flex items-center px-6 py-4 border-b\">\n <div class=\"flex-grow\">\n <slot name=\"header\" />\n </div>\n\n <div>\n <QBtn @click=\"$emit('close')\">\n <CloseIcon class=\"w-4\" />\n </QBtn>\n </div>\n </div>\n <div class=\"flex-grow overflow-hidden h-full\">\n <div class=\"flex items-stretch flex-nowrap h-full\">\n <div class=\"border-r w-[13.5em] overflow-y-auto\">\n <PanelsDrawerTabs\n v-model=\"activePanel\"\n :panels=\"panels\"\n @update:model-value=\"$emit('update:model-value', $event)\"\n />\n </div>\n <PanelsDrawerPanels :panels=\"panels\" :active-panel=\"activePanel\" :class=\"panelsClass\" />\n <div v-if=\"$slots['right-sidebar']\" class=\"border-l overflow-y-auto\">\n <slot name=\"right-sidebar\" />\n </div>\n </div>\n </div>\n </div>\n </ContentDrawer>\n</template>\n<script setup>\nimport { ref, watch } from 'vue';\nimport { XIcon as CloseIcon } from '../../svg';\nimport { ContentDrawer } from '../Utility';\nimport PanelsDrawerPanels from './PanelsDrawerPanels';\nimport PanelsDrawerTabs from './PanelsDrawerTabs';\n\ndefineEmits(['update:model-value', 'close']);\nconst props = defineProps({\n modelValue: {\n type: String,\n default: null\n },\n panelsClass: {\n type: [Object, String],\n default: 'w-[35.5rem]'\n },\n panels: {\n type: Array,\n required: true\n }\n});\n\nconst activePanel = ref(props.modelValue);\nwatch(() => props.modelValue, (value) => activePanel.value = value);\n</script>\n","export * from './config';\nexport * from './helpers';\nexport * from './components';\nexport * from './svg';\n\nimport packageJson from '../package.json';\n\nconst { version } = packageJson;\n\nfunction install(app) {\n console.log(`Installing Danx UI ${version}... Nothing to do really.`);\n}\n\nexport {\n version,\n install\n};\n"],"names":["danxOptions","configure","options","replace","array","item","newItem","index","newArray","remove","uniqueBy","cb","a","self","b","tryOnScopeDispose","fn","getCurrentScope","onScopeDispose","toValue","r","unref","isClient","noop","createFilterWrapper","filter","wrapper","args","resolve","reject","debounceFilter","ms","timer","maxTimer","lastRejector","_clearTimeout","timer2","invoke","duration","maxDuration","useDebounceFn","defaultNavigator","useMounted","isMounted","ref","instance","getCurrentInstance","onMounted","useSupported","callback","computed","useGeolocation","enableHighAccuracy","maximumAge","timeout","navigator","immediate","isSupported","locatedAt","error","shallowRef","coords","updatePosition","position","watcher","resume","err","pause","sleep","delay","waitForRef","value","watch","newValue","minmax","min","max","metersToMiles","meters","milesToMeters","miles","parseCoords","location","latLong","lat","lng","isLoaded","hasAlreadyWaited","geolocationError","hasLocation","geolocation","useCompatibility","requestLocation","isLocationSupported","isCompatible","maxWait","waitTime","LuxonError","InvalidDateTimeError","reason","InvalidIntervalError","InvalidDurationError","ConflictingSpecificationError","InvalidUnitError","unit","InvalidArgumentError","ZoneIsAbstractError","n","s","l","DATE_SHORT","DATE_MED","DATE_MED_WITH_WEEKDAY","DATE_FULL","DATE_HUGE","TIME_SIMPLE","TIME_WITH_SECONDS","TIME_WITH_SHORT_OFFSET","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","ts","opts","format","otherZone","singleton","SystemZone","locale","parseZoneInfo","formatOffset","dtfCache","makeDTF","zone","typeToPos","hackyOffset","dtf","date","formatted","parsed","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","filled","type","pos","isUndefined","ianaZoneCache","IANAZone","name","year","month","day","adOrBc","hour","minute","second","asUTC","objToLocalTS","asTS","over","intlLFCache","getCachedLF","locString","key","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","intlRelCache","getCachedRTF","base","cacheKeyOpts","sysLocaleCache","systemLocale","weekInfoCache","getCachedWeekInfo","data","parseLocaleString","localeStr","xIndex","uIndex","selectedStr","smaller","numberingSystem","calendar","intlConfigString","outputCalendar","mapMonths","f","i","dt","DateTime","mapWeekdays","listStuff","loc","length","englishFn","intlFn","mode","supportsFastNumbers","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","intlOpts","fixed","roundTo","padStart","PolyDateFormatter","z","gmtOffset","offsetZ","parts","part","offsetName","PolyRelFormatter","isEnglish","hasRelative","count","English.formatRelativeTime","fallbackWeekSettings","Locale","weekSettings","defaultToEN","specifiedLocale","Settings","localeR","numberingSystemR","outputCalendarR","weekSettingsR","validateWeekSettings","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","isActuallyEn","hasNoWeirdness","alts","English.months","formatStr","English.weekdays","English.meridiems","English.eras","field","df","results","matching","m","hasLocaleWeekInfo","other","FixedOffsetZone","offset","signedOffset","InvalidZone","zoneName","normalizeZone","input","defaultZone","isString","lowered","isNumber","now","defaultLocale","defaultNumberingSystem","defaultOutputCalendar","twoDigitCutoffYear","throwOnInvalid","defaultWeekSettings","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","js","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekday","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","usesLocalWeekValues","obj","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","millisecond","validHour","validMinute","validSecond","validMillisecond","o","isDate","maybeArray","thing","bestBy","arr","by","compare","best","next","pair","pick","keys","k","hasOwnProperty","prop","settings","v","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseMillis","fraction","number","digits","towardZero","factor","modMonth","modYear","firstWeekOffset","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","timeZone","modified","offHourStr","offMinuteStr","offHour","offMin","offMinSigned","asNumber","numericValue","normalizeObject","normalizer","normalized","u","hours","minutes","sign","monthsLong","monthsShort","monthsNarrow","months","weekdaysLong","weekdaysShort","weekdaysNarrow","weekdays","meridiems","erasLong","erasShort","erasNarrow","eras","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","numeric","narrow","units","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","token","macroTokenToFormatOpts","Formats.DATE_SHORT","Formats.DATE_MED","Formats.DATE_FULL","Formats.DATE_HUGE","Formats.TIME_SIMPLE","Formats.TIME_WITH_SECONDS","Formats.TIME_WITH_SHORT_OFFSET","Formats.TIME_WITH_LONG_OFFSET","Formats.TIME_24_SIMPLE","Formats.TIME_24_WITH_SECONDS","Formats.TIME_24_WITH_SHORT_OFFSET","Formats.TIME_24_WITH_LONG_OFFSET","Formats.DATETIME_SHORT","Formats.DATETIME_MED","Formats.DATETIME_FULL","Formats.DATETIME_HUGE","Formats.DATETIME_SHORT_WITH_SECONDS","Formats.DATETIME_MED_WITH_SECONDS","Formats.DATETIME_FULL_WITH_SECONDS","Formats.DATETIME_HUGE_WITH_SECONDS","Formatter","fmt","current","currentFull","bracketed","c","formatOpts","interval","p","knownEnglish","useDateTimeFormatter","extract","meridiem","English.meridiemForDateTime","standalone","English.monthForDateTime","English.weekdayForDateTime","maybeMacro","era","English.eraForDateTime","dur","tokenToField","lildur","mapped","tokens","realTokens","found","literal","val","collapsed","ianaRegex","combineRegexes","regexes","full","combineExtractors","extractors","mergedVals","mergedZone","cursor","ex","parse","patterns","regex","extractor","simpleParse","match","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","extractISOTime","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","num","force","obsOffsets","fromStrings","weekdayStr","result","English.monthsShort","English.weekdaysLong","English.weekdaysShort","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","clone","clear","conf","Duration","durationToMillis","matrix","vals","sum","normalizeValues","previous","previousVal","conv","rollUp","removeZeroes","newVals","config","accurate","durationLike","text","invalid","fmtOpts","millis","values","mixed","conversionAccuracy","built","accumulated","lastUnit","own","ak","negated","eq","v1","v2","validateStartEnd","start","end","Interval","builtStart","friendlyDateTime","builtEnd","validateError","e","startIsValid","endIsValid","dateTime","dateTimes","sorted","added","idx","numberOfParts","intervals","final","sofar","currentCount","ends","flattened","dateFormat","separator","mapFn","Info","proto","locObj","dayDiff","earlier","later","utcDayStart","highOrderDiffs","differs","days","lowestOrder","highWater","differ","diff","remainingMillis","lowerOrderUnits","numberingSystems","numberingSystemsUTF16","hanidecChars","parseDigits","str","code","digitRegex","append","MISSING_FTP","intUnit","post","NBSP","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","partTypeStyleToTokenVal","tokenForPart","resolvedOpts","isSpace","style","actualType","buildRegex","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","explainFromTokens","disqualifyingUnit","regexString","rawMatches","parseFromTokens","invalidReason","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","inst","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","objToTS","adjustTime","oPre","millisToAdd","parseDataToDateTime","parsedZone","setZone","interpretationZone","toTechFormat","allowZ","toISODate","extended","longFormat","toISOTime","suppressSeconds","suppressMilliseconds","includeOffset","extendedZone","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","normalizeUnit","normalizeUnitWithLocalWeeks","quickDT","tsNow","offsetProvis","diffRelative","round","lastOpts","argList","ot","zoneToUse","milliseconds","seconds","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","higherOrderInvalid","gregorian","tsFinal","offsetFinal","localeToUse","localeOpts","tokenList","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","keepLocalTime","keepCalendarTime","newTS","offsetGuess","asObj","settingWeekStuff","useLocaleWeeks","normalizedUnit","q","ext","includePrefix","includeZone","includeOffsetSpace","otherDateTime","durOpts","otherIsLater","diffed","inputMs","adjustedToZone","padding","Formats.DATE_MED_WITH_WEEKDAY","Formats.DATETIME_MED_WITH_WEEKDAY","dateTimeish","SERVER_TZ","localizedDateTime","dateTimeString","remoteDateTime","parseDateTime","parseQDate","parseQDateTime","fQDate","fDate","fLocalizedDateTime","fDateTime","empty","dbDateTime","fSecondsToTime","time","fCurrency","amount","fNumber","centerTruncate","maxLength","frontCharCount","backCharCount","fPercent","fPhone","phone","shift","diffInDays","date1","date2","download","strFileName","strMimeType","defaultMime","mimeType","payload","url","anchor","toString","myBlob","fileName","blob","reader","ajax","dataUrlToBlob","saver","strUrl","decoder","binData","mx","uiArr","winMode","downloadFile","filename","postParams","fetchOptions","response","errorMessage","jsonResponse","downloadFileResponse","contentDisposition","getResponseHeader","contentType","header","defaultValue","DataView$1","buffer","bufferTypeIsUnsupported","littleEndian","getDataView","byteOffset","byteLength","DataViewWrapper","getStringFromDataView","dataView","chars","getStringValueFromArray","getNullTerminatedStringFromDataView","char","getUnicodeStringFromDataView","getPascalStringFromDataView","size","charArray","charCode","objectAssign","property","deferInit","object","initializer","initialized","getBase64Image","image","byte","dataUriToBuffer","dataUri","decodedData","character","strRepeat","parseFloatRadix","radix","COMPRESSION_METHOD_NONE","COMPRESSION_METHOD_DEFLATE","decompress","compressionMethod","returnType","decompressionStream","decompressedStream","arrayBuffer","Constants","getStringValue","getEncodedString","encoding","getCalculatedGpsValue","LITTLE_ENDIAN","BIG_ENDIAN","ByteOrder","getByteOrder","tiffHeaderOffset","Tiff","isTiffFile","findTiffOffsets","hasTiffMarker","Jpeg","isJpegFile","findJpegOffsets","MIN_JPEG_DATA_BUFFER_LENGTH","JPEG_ID","JPEG_ID_SIZE","APP_ID_OFFSET","APP_MARKER_SIZE","JFIF_DATA_OFFSET","TIFF_HEADER_OFFSET","IPTC_DATA_OFFSET","XMP_DATA_OFFSET","XMP_EXTENDED_DATA_OFFSET","APP2_ICC_DATA_OFFSET","MPF_DATA_OFFSET","APP2_ICC_IDENTIFIER","ICC_CHUNK_NUMBER_OFFSET","ICC_TOTAL_CHUNKS_OFFSET","APP2_MPF_IDENTIFIER","SOF0_MARKER","SOF2_MARKER","DHT_MARKER","DQT_MARKER","DRI_MARKER","SOS_MARKER","APP0_MARKER","APP1_MARKER","APP2_MARKER","APP13_MARKER","APP15_MARKER","COMMENT_MARKER","FILL_BYTE","APP0_JFIF_IDENTIFIER","APP1_EXIF_IDENTIFIER","APP1_XMP_IDENTIFIER","APP1_XMP_EXTENDED_IDENTIFIER","APP13_IPTC_IDENTIFIER","appMarkerPosition","fieldLength","sof0DataOffset","sof2DataOffset","jfifDataOffset","iptcDataOffset","xmpChunks","iccChunks","mpfDataOffset","isSOF0Marker","isSOF2Marker","isApp0JfifMarker","isApp1ExifMarker","isApp1XmpMarker","getXmpChunkDetails","isApp1ExtendedXmpMarker","getExtendedXmpChunkDetails","isApp13PhotoshopMarker","isApp2ICCMarker","iccDataOffset","iccDataLength","iccChunkNumber","iccChunksTotal","isApp2MPFMarker","isAppMarker","isFillByte","markerIdLength","isXmpIdentifier","isExtendedXmpIdentifier","appMarker","Png","isPngFile","findPngOffsets","PNG_ID","PNG_CHUNK_LENGTH_SIZE","PNG_CHUNK_TYPE_SIZE","PNG_CHUNK_LENGTH_OFFSET","PNG_CHUNK_TYPE_OFFSET","PNG_CHUNK_DATA_OFFSET","PNG_XMP_PREFIX","TYPE_TEXT","TYPE_ITXT","TYPE_ZTXT","TYPE_PHYS","TYPE_TIME","TYPE_EXIF","TYPE_ICCP","async","offsets","isPngImageHeaderChunk","isPngXmpChunk","dataOffset","getPngXmpDataOffset","isPngTextChunk","chunkType","isPngExifChunk","isPngIccpChunk","chunkDataLength","iccHeaderOffset","profileName","compressedProfileOffset","parseIccHeader","isPngChunk","SUPPORTED_PNG_CHUNK_TYPES","numberOfNullSeparators","get64BitValue","parseItemLocationBox","version","contentOffset","boxLength","sizes","getItemLocationBoxOffsetsAndSizes","offsetSize","lengthSize","baseOffsetSize","indexSize","getIndexSize","itemCount","getItemCount","getItems","items","getItemId","getVariableSizedValue","j","extent","getExtentIndex","TYPE_FTYP","TYPE_IPRP","TYPE_META","TYPE_ILOC","TYPE_IINF","TYPE_INFE","TYPE_IPCO","TYPE_COLR","ITEM_INFO_TYPE_EXIF","ITEM_INFO_TYPE_MIME","ITEM_INFO_TYPE_URI","parseBox","getBoxLength","parseFileTypeBox","parseItemPropertiesBox","parseItemPropertyContainerBox","parseColorInformationBox","parseMetadataBox","parseItemInformationBox","parseItemInformationEntryBox","extendsToEndOfFile","hasExtendedSize","hasEmptyHighBits","findOffsets","metaBox","findMetaBox","findExifOffset","findXmpChunks","findIccChunks","box","exifItemId","findIinfExifItemId","ilocItem","findIlocItem","exifOffset","getTiffHeaderOffset","itemInfo","itemId","xmpItemId","findIinfXmpItemId","ilocItemExtent","icc","startOffset","parseSubBoxes","parseIcc","colorType","ACCEPTED_ITEM_INFO_TYPES","subBoxes","currentOffset","getItemInformationBoxOffsetsAndSizes","entry","Heic","isHeicFile","findHeicOffsets","HEIC_MAJOR_BRANDS","headerBox","Avif","isAvifFile","findAvifOffsets","Webp","isWebpFile","RIFF_ID","WEBP_MARKER","EXIF_IDENTIFIER","hasAppMarkers","vp8xChunkOffset","chunkId","chunkSize","Gif","isGifFile","GIF_SIGNATURE_SIZE","GIF_SIGNATURES","ImageHeader","parseAppMarkers","addFileType","fileType","fileTypeDescription","TagNamesCommon","decimal","denominator","TagNames0thIfd","formats","sample","TagNamesExifIfd","y","focalLengths","TagNamesGpsIfd","numerator","status","TagNamesInteroperabilityIfd","TagNamesMpfIfd","tagNames0thExifIfds","IFD_TYPE_0TH","IFD_TYPE_1ST","IFD_TYPE_EXIF","IFD_TYPE_GPS","IFD_TYPE_INTEROPERABILITY","IFD_TYPE_MPF","TagNames$1","typeSizes","tagTypes","Types","getAsciiValue","getByteAt","getAsciiAt","getShortAt","getLongAt","getRationalAt","getUndefinedAt","getSlongAt","getSrationalAt","getIfdPointerAt","getTypeSize","byteOrder","typeName","getTagValueAt","get0thIfdOffset","readIfd","ifdType","includeUnknown","FIELD_COUNT_SIZE","FIELD_SIZE","tags","numberOfFields","getNumberOfFields","fieldIndex","tag","readTag","nextIfdOffset","TAG_TYPE_OFFSET","TAG_COUNT_OFFSET","TAG_VALUE_OFFSET","tagCode","tagType","tagCount","tagValue","TagNames","tagValueFitsInOffsetSlot","getTagValue","tagValueOffset","tagValueFitsInDataView","forceByteType","splitNullSeparatedAsciiString","decodeAsciiValue","tagName","tagDescription","getDescriptionFromTagValue","valueIndex","asciiValue","EXIF_IFD_POINTER_KEY","GPS_INFO_IFD_POINTER_KEY","INTEROPERABILITY_IFD_POINTER_KEY","Tags","read","read0thIfd","readExifIfd","readGpsIfd","readInteroperabilityIfd","MpfTags","ENTRY_SIZE","addMpfImages","images","attributes","getImageNumberValue","getImageFlags","getImageFormat","getImageType","imageSize","imageOffset","getImageOffset","dependentImage1EntryNumber","dependentImage2EntryNumber","entries","flags","flagsDescription","imageFormat","imageIndex","mpEntry","isFirstIndividualImage","FileTags","fileDataOffset","getLength","numberOfColorComponents","getNumberOfColorComponents","getDataPrecision","getImageHeight","getImageWidth","getSubsampling","components","componentOffset","getComponentIds","getSamplingType","ids","compontent","types","JfifTags","thumbnailWidth","getThumbnailWidth","thumbnailHeight","getThumbnailHeight","getVersion","getResolutionUnit","getXResolution","getYResolution","thumbnail","getThumbnail","majorVersion","minorVersion","getResolutionUnitDescription","thumbnailLength","IptcTagNames","getCreationDate","getCreationTime","getEncodingName","stringValue","character0","character1","description","bits","intValue","formatVersions","objectDataPreviewFileFormat","parsedTime","TextDecoder$1","get","TAG_HEADER_SIZE","TagDecoder","decode","Decoder","TextDecoder","BYTES_8BIM","BYTES_8BIM_SIZE","RESOURCE_BLOCK_HEADER_SIZE","NAA_RESOURCE_BLOCK_TYPE","IptcTags","parseTags","naaBlock","newDataOffset","getNaaResourceBlock","resourceBlock","getResourceBlock","isNaaResourceBlock","getBlockPadding","endOfBlockOffset","tagSize","leadByteIsMissing","getTagName","getTagDescription","tagIsRepeatable","tagContainsEncoding","tagIsName","hasDynamicName","hasDescriptionProperty","tagValueIsText","XmpTagNames","calculateGPSValue","parseNumber","numbers","isFraction","func","degreesString","minutesString","degrees","DOMParser$1","XmpTags","chunks","readTags","standardXmp","extendedXmp","extractCompleteChunks","hasStandardTags","hasExtendedTags","combineChunks","completeChunks","totalLength","chunk","combinedChunks","slice","chunkDataView","doc","raw","getDocument","rdf","getRDF","parseXMPObject","convertToObject","domParser","DOMParser","xmlString","trimXmlSource","xmlSource","node","isTopNode","childNodes","getChildNodes","hasTextOnlyContent","getTextValue","getElementsFromNodes","elements","nodes","isElement","nodeElement","getElementFromNode","getAttributes","element","xmpObject","nodeName","parseNodeAttributesAsTags","parseNodeChildrenAsTags","isTagAttribute","getLocalName","getDescription","isNamespaceDefinition","arrayDescription","getDescriptionOfArray","getDescriptionOfObject","descriptions","getClearTextKey","children","parseNodeAsTag","isDuplicateTag","parseNodeAsDuplicateTag","isEmptyResourceTag","hasNestedSimpleRdfDescription","parseNodeAsSimpleRdfDescription","hasNestedStructureRdfDescription","parseNodeAsStructureRdfDescription","isCompactStructure","parseNodeAsCompactStructure","isArray","parseNodeAsArray","parseNodeAsSimpleValue","parseNodeAttributes","parseNodeChildrenAsAttributes","parseRdfValue","getURIValue","getArrayChild","parseArrayValue","PathRecordTypes","PATH_RECORD_SIZE","pathResource","paths","PATH_RECORD_TYPES","parseBezierKnot","parseClipboard","path","parsePathPoint","vertical","getFixedPointNumber","binaryPoint","integer","PhotoshopTags","SIGNATURE","TAG_ID_SIZE","RESOURCE_LENGTH_SIZE","SIGNATURE_SIZE","bytes","signature","tagId","tagNameSize","resourceSize","valueDataView","stringSize","iccTags","iccProfile","toCompany","parseDate","sliceToString","IccTags","PROFILE_HEADER_LENGTH","ICC_TAG_COUNT_OFFSET","ICC_SIGNATURE","TAG_TYPE_DESC","TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE","TAG_TYPE_TEXT","TAG_TYPE_SIGNATURE","TAG_TABLE_SINGLE_TAG_DATA","iccData","readCompressedIcc","readIcc","compressionMethodIsSupported","compressedDataView","totalIccProfileLength","iccBinaryData","getBuffer","chunkNumber","iccDataChunk","chunkData","iccDoesNotHaveTagCount","hasTagsData","tagHeaderOffset","iccProfileKeys","profileEntry","tagSignature","tagOffset","tagValueSize","addTag","numRecords","recordSize","recordNum","languageCode","countryCode","textLength","textOffset","valObj","valIndex","PngFileTags","getBitDepth","getColorType","getCompression","getFilter","getInterlace","COLOR_TYPES","INTERLACE_TYPES","PngTextTags","STATE_KEYWORD","STATE_COMPRESSION","STATE_LANG","STATE_TRANSLATED_KEYWORD","STATE_TEXT","COMPRESSION_SECTION_ITXT_EXTRA_BYTE","COMPRESSION_FLAG_COMPRESSED","EXIF_OFFSET","pngTextChunks","tagsPromises","nameAndValue","getNameAndValue","isExifGroupTag","decodeRawData","isIptcGroupTag","keywordChars","langChars","valueChars","parsingState","getCompressionMethod","moveToNextState","decompressedValueChars","_decompressedValueChars","constructTag","getValue","getName","lang","hexToDataView","hex","PngTags","chunkOffsets","chunkLength","getPixelsPerUnitX","getPixelsPerUnitY","getPixelUnits","getModifyDate","chunkOffset","tagFitsInBuffer","pad","Vp8xTags","IMAGE_WIDTH_OFFSET","IMAGE_HEIGHT_OFFSET","getAlpha","getAnimation","getThreeByteValue","GifFileTags","getGifVersion","getGlobalColorMap","getColorResolution","COMPRESSION_JPEG","Thumbnail","thumbnailTags","hasJpegThumbnail","MetadataMissingError","message","exifErrors","ExifReader","load","loadView","isFilePathOrURL","loadFile","fileContents","loadFromData","isBrowserFileObject","loadFileObject","fetchRemoteFile","nodeGetRemoteFile","isDataUri","loadLocalFile","requireNodeGet","fs","requireNodeFs","fd","stat","file","readerEvent","isNodeBuffer","expanded","foundMetaData","pngHeaderOffset","pngChunkOffsets","gifHeaderOffset","hasFileData","hasJfifData","hasExifData","addGpsGroup","hasIptcData","readIptcTags","hasXmpData","readXmpTags","readPhotoshopTags","hasIccData","readIccTags","addIccTags","hasMpfData","readMpfTags","hasPngFileData","hasPngTextData","readTagsPromise","addPngTextTags","tagList","hasPngData","hasVp8xData","hasGifFileData","group","groupKey","iccDataOffsets","pngFileDataOffset","_FlashMessages","msgProps","messages","__publicField","FlashMessages","notify","resolveFileLocation","waitMessage","waitForLocation","FileUpload","files","uid","formData","fileUpload","progress","uploadedFile","presignedUrl","fileResource","isS3Upload","xhr","request","fetchResourceListWithSelected","fetchFn","list","id","selectedResource","getUrlParam","useMultiFileUpload","uploadedFiles","onCompleteCb","onFilesChangeCb","onFilesSelected","updateFileInList","activeActionVnode","useActions","actions","globalOptions","mappedActions","action","mappedAction","target","performAction","isSavingTarget","activeTargets","activeTarget","vnode","confirmInput","onConfirmAction","filterActions","filters","filteredActions","filterValue","errors","useSingleFileUpload","onFileChangeCb","onFileSelected","completedFile","onDrop","setItem","getItem","render","_ctx","_cache","_openBlock","_createBlock","_createVNode","DragAndDrop","dropZone","_a","_b","emit","__emit","props","__props","dragAndDrop","_hoisted_1","_hoisted_2","_createElementVNode","_hoisted_3","_createElementBlock","CaretDownIcon","DragHandleIcon","RowResizeIcon","FilterIcon","_hoisted_4","_hoisted_5","ImageIcon","PdfIcon","PercentIcon","SkipNextIcon","SkipPreviousIcon","RemoveIcon","WarningIcon","CloseIcon","isExporting","onExport","onConfirm","onClose","carousel","currentSlide","isVideo","getThumbUrl","computedClass","newInput","showPreview","computedImage","isImage","isPdf","previewUrl","thumbUrl","isPreviewable","isConfirmingRemove","onRemove","resolvedSvg","isCollapsed","stored","toggleCollapse","setCollapse","state","isShowing","RenderVnode","isSaving","content","resolvedComponent","_c","onAction","show","tooltipBox","isHovering","isHoveringParent","onEnterParent","onLeaveParent","delayClose","onEnterTooltip","onLeaveTooltip","_assertThisInitialized","_inheritsLoose","subClass","superClass","_config","_defaults","_suppressOverwrites","_reverting","_context","_bigNum","_tinyNum","_2PI","_HALF_PI","_gsID","_sqrt","_cos","_sin","_isString","_isFunction","_isNumber","_isUndefined","_isObject","_isNotFalse","_windowExists","_isFuncOrString","_isTypedArray","_isArray","_strictNumExp","_numExp","_numWithUnitExp","_complexStringNumExp","_relExp","_delimitedValueExp","_unitExp","_globalTimeline","_win","_coreInitted","_doc","_globals","_installScope","_coreReady","_install","scope","_merge","gsap","_missingPlugin","_warn","suppress","_addGlobal","_emptyFunc","_startAtRevertConfig","_revertConfigNoKill","_revertConfig","_reservedProps","_lazyTweens","_lazyLookup","_lastRenderedFrame","_plugins","_effects","_nextGCFrame","_harnessPlugins","_callbackNames","_harness","targets","harnessPlugin","GSCache","_getCache","toArray","_getProperty","_forEachName","names","_round","_roundPrecise","_parseRelative","operator","_arrayContainsAny","toSearch","toFind","_lazyRender","tween","_lazySafeRender","animation","suppressEvents","_numericIfPossible","_passThrough","_setDefaults","defaults","_setKeyframeDefaults","excludeDuration","toMerge","_mergeDeep","_copyExcluding","excluding","copy","_inheritDefaults","vars","parent","_arraysMatch","a1","a2","_addLinkedListItem","child","firstProp","lastProp","sortBy","prev","_removeLinkedListItem","_removeFromParent","onlyIfParentHasAutoRemove","_uncache","_recacheAncestors","_rewindStartAt","totalTime","_hasNoPausedAncestors","_elapsedCycleDuration","_animationCycle","tTime","cycleDuration","whole","_parentToChildTotalTime","parentTime","_setEnd","_alignPlayhead","_postAddChecks","timeline","_clamp","_addToTimeline","skipChecks","_parsePosition","_isFromOrFromStart","_scrollTrigger","trigger","_attemptInitTween","_initTween","_ticker","_parentPlayheadIsBeforeStart","_ref","_ref2","_renderZeroDurationTween","prevRatio","ratio","repeatDelay","pt","iteration","prevIteration","_callback","_findNextPauseTween","prevTime","_setDuration","skipUncache","leavePlayhead","repeat","totalProgress","_onUpdateTotalDuration","Timeline","_zeroPosition","percentAnimation","labels","recent","clippedDuration","isPercent","_createTweenType","params","isLegacy","varsIndex","irVars","Tween","_conditionalReturn","getUnit","clamp","_slice","_isArrayLike","nonEmpty","_flatten","ar","leaveStrings","accumulator","_accumulator","_wake","selector","el","shuffle","distribute","ease","_parseEase","from","cache","isDecimal","ratios","axis","ratioX","ratioY","distances","originX","originY","wrapAt","_invertEase","_roundModifier","snap","snapTo","radius","is2D","closest","dx","dy","random","roundingIncrement","returnFunction","pipe","_len","functions","_key","unitize","normalize","mapRange","_wrapArray","wrap","range","wrapYoyo","total","_replaceRandom","nums","inMin","inMax","outMin","outMax","inRange","outRange","interpolate","mutate","master","interpolators","il","_addPropTween","_renderPropTweens","_getLabelInDirection","fromTime","backward","distance","label","executeLazyFirst","prevContext","context","_interrupt","_quickTween","_registerPluginQueue","_createPlugin","isFunc","Plugin","instanceDefaults","_killPropTweensOf","_addPluginModifier","statics","_getSetter","PropTween","_255","_colorLookup","_hue","m1","m2","splitColor","toHSL","forceAlpha","g","wasHSL","_colorOrderData","_colorExp","_formatColors","orderMatchData","colors","shell","color","_hslExp","_colorStringFilter","combined","_tickerActive","_getTime","_lagThreshold","_adjustedLag","_startTime","_lastUpdate","_gap","_nextTime","_listeners","_id","_req","_raf","_self","_delta","_i","_tick","elapsed","manual","overlap","dispatch","frame","fps","threshold","adjustedLag","_fps","once","prioritize","_easeMap","_customEaseExp","_quotesExp","_parseObjectInString","split","parsedVal","_valueInParentheses","open","close","nested","_configEaseFromString","_propagateYoyoEase","isYoyo","defaultEase","_insertEase","easeIn","easeOut","easeInOut","lowercaseName","_easeInOutFromOut","_configElastic","amplitude","period","p1","p2","p3","_configBack","overshoot","power","n1","n2","n3","steps","immediateStart","harness","Animation","_proto","_totalTime","includeRepeats","wrapRepeats","prevIsReverting","rawTime","includeDelay","atTime","onFulfilled","_resolve","_then","_Animation","_this","_proto2","fromVars","toVars","stagger","onCompleteAll","onCompleteAllParams","tDur","crossingStart","prevPaused","pauseTween","timeScale","prevStart","yoyo","rewinding","doesWrap","adjustedTime","_this2","tweens","timelines","ignoreBeforeTime","animations","_totalTime2","onlyActive","_overwritingTween","parsedTargets","isGlobalTime","tl","endTime","_vars","startAt","_onStart","onStartParams","immediateRender","initted","fromPosition","toPosition","afterTime","beforeTime","adjustLabels","soft","includeLabels","_addComplexStringPropTween","setter","stringFilter","funcParam","_renderComplexString","startNums","endNum","startNum","hasRandom","modifier","optional","currentValue","parsedStart","_setterFuncWithParam","_setterFunc","_setterPlain","_forceAllPropTweens","_renderBoolean","_renderPlain","_processVars","_parseFuncOrString","_checkPlugin","plugin","ptLookup","lazy","onUpdate","runBackwards","yoyoEase","keyframes","autoRevert","prevStartAt","fullTargets","autoOverwrite","cleanVars","hasPriority","gsData","harnessVars","overwritten","_sortPropTweensByPriority","_updatePropTweens","startIsRelative","skipRecursion","ptCache","rootPT","lookup","_addAliasesToVars","propertyAliases","aliases","_parseKeyframe","allProps","easeEach","_staggerTweenProps","_staggerPropsToSkip","_Animation2","skipInherit","_this3","_this3$vars","overwrite","scrollTrigger","curTarget","staggerFunc","staggerVarsToMerge","kf","_proto3","isNegative","killingTargets","propTweenLookup","firstPT","overwrittenProps","curLookup","curOverwriteProps","_setterAttribute","hasNonDependentRemaining","_setterWithModifier","pt2","first","last","change","renderer","priority","_proto4","_media","_emptyArray","_lastMediaTime","_contextID","_dispatch","_onMediaChange","queries","conditions","anyMatch","toggled","Context","_proto5","prevSelector","revert","matchMedia","_this4","MatchMedia","_proto6","cond","mq","active","_gsap","_len2","_key2","uncache","getter","setters","_merge2","_ref3","effect","plugins","extendTimeline","pluginName","includeDelayedCalls","toAdd","_getPluginPropTween","_addModifiers","modifiers","_buildModifierPlugin","temp","_docElement","_pluginInitted","_tempDiv","_recentSetterPlugin","_transformProps","_RAD2DEG","_DEG2RAD","_atan2","_capsExp","_horizontalExp","_complexExp","_propertyAliases","_renderCSSProp","_renderPropWithEnd","_renderCSSPropWithBeginning","_renderRoundedCSSProp","_renderNonTweeningValue","_renderNonTweeningValueOnlyAtEnd","_setterCSSStyle","_setterCSSProp","_setterTransform","_setterScale","_setterScaleWithRender","_setterTransformWithRender","_transformProp","_transformOriginProp","_saveStyle","isNotCSS","_get","_removeIndependentTransforms","_revertStyle","_getStyleSaver","properties","_supports3D","_createElement","ns","_getComputedProperty","skipPrefixFallback","cs","_checkPropPrefix","_prefixes","preferPrefix","_initCore","_getBBoxHack","swapIfPossible","svg","oldParent","oldSibling","oldCSS","bbox","_getAttributeFallbacks","attributesArray","_getBBox","bounds","_isSVG","_removeProperty","first2Chars","_addNonTweeningPT","beginning","onlySetAtEnd","_nonConvertibleUnits","_nonStandardLayouts","_convertToUnit","curValue","curUnit","horizontal","isRootSVG","measureProperty","toPixels","toPercent","px","isSVG","_parseTransform","_firstTwoOnly","_specialProps","_tweenComplexCSSString","startValues","startValue","endValue","endUnit","startUnit","endValues","_keywordToPercent","_convertKeywordsToPercentages","_renderClearProps","clearTransforms","_identity2DMatrix","_rotationalProperties","_isNullTransform","_getComputedTransformMatrixAsArray","matrixString","_getMatrix","force2D","nextSibling","addedToDOM","_applySVGOrigin","origin","originIsAbsolute","smooth","matrixArray","pluginToAddPropTweensTo","xOriginOld","yOriginOld","xOffsetOld","yOffsetOld","tx","ty","originSplit","xOrigin","yOrigin","determinant","invertedScaleX","deg","scaleX","scaleY","rotation","rotationX","rotationY","skewX","skewY","perspective","angle","cos","sin","a12","a22","t1","t2","t3","a13","a23","a33","a42","a43","a32","_renderSVGTransforms","_renderCSSTransforms","_renderNon3DTransforms","_addPxTranslate","_zeroDeg","_zeroPx","_endParenthesis","xPercent","yPercent","transformPerspective","force3D","zOrigin","transforms","use3D","xOffset","yOffset","forceCSS","a11","a21","_addRotationalPropTween","cap","finalValue","direction","_assign","source","_addRawTransformPTs","startCache","exclude","endCache","side","CSSPlugin","specialProp","relative","isTransformRelated","transformPropTween","inlineProps","positionAndScale","others","gsapWithCSS","indexDelay","onBeforeEnter","onEnter","onComplete","onLeave","ListDragAndDrop","draggableData","prevPosition","newPosition","point","rect","velocity","velocityFn","cursorPos","rectStart","rectEnd","beforeDiff","afterDiff","oldPosition","allowMoreTitleColumns","isVisible","column","onVisibilityChange","visible","hiddenColumnNames","isTitleColumn","onTitleColumnChange","isTitle","titleColumnNames","isShowingColumnToggle","categories","columnsInCategory","category","categoryHasVisibleColumns","getCategoryCheckboxState","categoryColumns","visibleColumns","toggleColumns","columns","showColumns","toggleColumn","columnName","showColumn","labelText","requiredLabel","rules","formattedDate","onSave","formattedDates","dateRangeValue","dateRange","toQDateValue","debouncedChange","onInput","__expose","upload","onAttachFiles","numberVal","fieldOptions","minimumFractionDigits","onUpdateDebounced","oldVal","nextTick","onClear","selectField","computedOptions","opt","isRef","resolveLabel","resolveValue","resolveSelectionLabel","filteredOptions","selectedValue","selectedOptions","selectedLabel","chipOptions","option","shouldFilter","onFilter","update","onShow","onHide","selectedFieldName","searchList","textInput","formatModelValue","onChange","symbol","minField","maxField","previewIcon","CurrencyIcon","NumberIcon","setRange","multiplier","formatNum","newVal","showDrawer","formattedOptions","getOptionValue","getOptionLabel","isSelected","optionValue","toggleSelect","selection","resolveSelectedOption","selectedOption","selectedChildren","onSelectChild","onSelectOption","validEvents","isValidKey","event","bindHandlers","initEvent","listeners","editor","handler","bindModelHandlers","ctx","modelValue","modelEvents","normalizedEvents","prevVal","initEditor","unique","uuid","prefix","isTextarea","normalizePluginArray","mergePlugins","initPlugins","inputPlugins","isNullOrUndefined","createState","CreateScriptLoader","injectScriptTag","scriptId","scriptTag","reinitialize","ScriptLoader","getGlobal","getTinymce","global","editorProps","__assign","renderInline","ce","elementRef","renderIframe","defaultInitValues","Editor","defineComponent","toRefs","disabled","vueEditor","elementId","inlineEditor","modelBind","mounting","initialValue","getContent","isMounting","initWrapper","finalInit","disable","_","channel","apiKey","scriptSrc","onBeforeUnmount","onActivated","onDeactivated","rerender","init","activeCountByGroup","updateFilter","fieldFilter","activeCount","FORM_FIELD_MAP","BooleanField","DateField","DateRangeField","IntegerField","NumberField","TextField","SingleFileField","MultiFileField","WysiwygField","mappedFields","fieldValues","reactive","_sfc_render","_renderSlot","registerStickyScrolling","tableRef","scrollEl","onScroll","mapSortBy","pagination","getFilterFromUrl","allowedKeys","urlFilter","fields","useListControls","listRoute","summaryRoute","filterFieldOptionsRoute","moreRoute","itemDetailsRoute","refreshFilters","urlPattern","filterDefaults","isInitialized","PAGE_SETTINGS_KEY","pagedItems","globalFilter","showFilters","selectedRows","isLoadingList","isLoadingSummary","summary","filterActiveCount","PAGING_DEFAULT","quasarPagination","pager","saveSettings","loadList","loadSummary","loadFilterFieldOptions","setPagedItems","summaryFilter","row","filterFieldOptions","isLoadingFilters","applyFilterFromUrl","filterFields","validFilterKeys","updateSettings","resetPaging","setItemInPagedList","updatedItem","activeItem","loadMore","perPage","newItems","refreshAll","getActiveItemDetails","loadSettings","activePanel","oldItem","activatePanel","panel","getNextItem","nextIndex","initialize","useTableColumns","COLUMN_ORDER_KEY","VISIBLE_COLUMNS_KEY","TITLE_COLUMNS_KEY","columnOrder","lockedColumns","orderedColumns","aIndex","bIndex","sortableColumns","newColumns","orderedTitleColumns","hasTarget","activeActions","columnStyle","width","columnClass","summaryColumns","formatValue","actionTable","COLUMN_SETTINGS_KEY","columnSettings","onResizeColumn","novaUrl","packageJson","install","app"],"mappings":";;;;;AAAO,IAAIA,KAAc;AAAA,EACrB,YAAY;AAAA,IACR,WAAW;AAAA,IACX,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,EACxB;AACJ;AAEO,SAASC,GAAUC,GAAS;AACjB,EAAAF,KAAA;AAAA,IACV,GAAGA;AAAA,IACH,GAAGE;AAAA,EAAA;AAEX;ACNO,SAASC,GAAQC,GAAOC,GAAMC,IAAU,QAAW;AAClD,QAAAC,IACJ,OAAOF,KAAS,aAAaD,EAAM,UAAUC,CAAI,IAAID,EAAM,QAAQC,CAAI;AACzE,MAAIE,MAAU;AACJ,kBAAA,MAAM,2BAA2BF,GAAMD,CAAK,GAC9C,IAAI,MAAM,yBAAyB;AAErC,QAAAI,IAAW,CAAC,GAAGJ,CAAK;AACd,SAAAE,MAAA,SACRE,EAAS,OAAOD,GAAO,GAAGD,CAAO,IACjCE,EAAS,OAAO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,EAAE,SAAAs8B,GAAS,IAAG4mD;AAEpB,SAASC,GAAQC,GAAK;AAClB,UAAQ,IAAI,sBAAsB9mD,EAAO,2BAA2B;AACxE;","x_google_ignoreList":[2,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,139,140,141,166,167,168,169,170]}
|