{"version":3,"file":"sequencer.js","sources":["../src/constants.js","../src/canvas-effects/ease.js","../src/lib/lib.js","../node_modules/@typhonjs-fvtt/runtime/_dist/util/object/index.js","../node_modules/svelte/src/runtime/internal/utils.js","../node_modules/svelte/src/runtime/internal/environment.js","../node_modules/svelte/src/runtime/internal/loop.js","../node_modules/svelte/src/runtime/internal/dom.js","../node_modules/svelte/src/runtime/internal/style_manager.js","../node_modules/svelte/src/runtime/internal/lifecycle.js","../node_modules/svelte/src/runtime/internal/scheduler.js","../node_modules/svelte/src/runtime/internal/transitions.js","../node_modules/svelte/src/runtime/internal/each.js","../node_modules/svelte/src/runtime/internal/spread.js","../node_modules/svelte/src/runtime/internal/Component.js","../node_modules/svelte/src/shared/version.js","../node_modules/svelte/src/runtime/store/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/store/util/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/util/browser/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/store/web-storage/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/store/writable-derived/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/util/index.js","../node_modules/svelte/src/runtime/easing/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/easing/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/util/a11y/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/math/util/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/math/interpolate/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/math/gl-matrix/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/util/dom/style/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/util/animate/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/store/position/index.js","../node_modules/svelte/src/runtime/internal/disclose-version/index.js","../node_modules/svelte/src/runtime/transition/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/application/cssVariables.js","../node_modules/@typhonjs-fvtt/runtime/_dist/util/dom/observer/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/action/dom/observer/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/action/dom/style/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/action/util/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/transition/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/application/AppShellContextInternal.js","../node_modules/@typhonjs-fvtt/runtime/_dist/util/i18n/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/application/TJSHeaderButton.svelte","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/application/TJSApplicationHeader.svelte","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/application/ResizeHandleTransform.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/application/ResizableHandle.svelte","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/internal/dom/TJSFocusWrap.svelte","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/application/ApplicationShell.svelte","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/application/TJSGlassPane.svelte","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/application/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/internal/dialog/DialogContent.svelte","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/component/internal/dialog/DialogShell.svelte","../node_modules/@typhonjs-fvtt/runtime/_dist/util/async/index.js","../node_modules/@typhonjs-fvtt/runtime/_dist/svelte/application/index.js","../src/utils/loadingBar.js","../src/utils/foundry-shim.js","../src/modules/sequencer-file-cache.js","../src/modules/sequencer-file.js","../src/modules/sequencer-database.js","../src/formapplications/database/TreeViewEntry.svelte","../src/formapplications/database/TreeViewSeparator.svelte","../src/formapplications/database/renderSpritesheet.js","../src/formapplications/database/DatabaseStore.js","../src/formapplications/database/DatabaseEntry.svelte","../node_modules/svelte-virtual-scroll-list/dist/virtual.js","../node_modules/svelte-virtual-scroll-list/dist/Item.svelte","../node_modules/svelte-virtual-scroll-list/dist/VirtualScroll.svelte","../src/formapplications/database/database-shell.svelte","../src/formapplications/database/database-viewer-app.js","../src/formapplications/effects-ui/HowTo.svelte","../src/formapplications/effects-ui/Tabs.svelte","../src/modules/sequence-manager.js","../src/lib/filters/color-matrix-filter.js","../src/lib/filters/blur-filter.js","../src/lib/filters/noise-filter.js","../src/lib/filters/glow-filter.js","../src/lib/filters/clip-filter.js","../src/lib/filters.js","../src/lib/filters/mask-filter.js","../src/modules/sequencer-animation-engine.js","../src/utils/flag-manager.js","../src/modules/sequencer-sound-manager.js","../src/modules/sequencer-foundry-replicator.js","../src/modules/sequencer-preloader.js","../src/sockets.js","../src/modules/sequencer-effect-manager.js","../src/canvas-effects/effects-layer.js","../src/lib/filters/vision-sampler-shader.js","../src/lib/meshes/TilingSpriteMesh.js","../src/lib/meshes/AnimatedSpriteMesh.js","../src/canvas-effects/sequencer-sprite-manager.js","../src/modules/sequencer-crosshair/CrosshairsPlaceable.js","../src/utils/plugins-manager.js","../src/canvas-effects/canvas-effect.js","../src/lib/canvas-lib.js","../src/formapplications/effects-ui/effect-player-store.js","../src/modules/sequencer-interaction-manager.js","../src/formapplications/effects-ui/components/EffectEntry.svelte","../src/formapplications/effects-ui/components/SoundEntry.svelte","../src/formapplications/effects-ui/Manager.svelte","../src/formapplications/effects-ui/components/SliderInput.svelte","../src/formapplications/effects-ui/components/Checkbox.svelte","../src/formapplications/effects-ui/components/NumberInput.svelte","../src/formapplications/effects-ui/components/SwitchToggle.svelte","../src/formapplications/effects-ui/Player.svelte","../src/formapplications/effects-ui/components/SequenceStatus.svelte","../src/formapplications/effects-ui/components/SequenceSection.svelte","../src/formapplications/effects-ui/components/Sequence.svelte","../src/formapplications/effects-ui/Sequences.svelte","../src/formapplications/effects-ui/effects-ui-shell.svelte","../src/formapplications/effects-ui/effects-ui-app.js","../src/settings.js","../src/layers.js","../src/batchShader.js","../src/hotkeys.js","../typings/typings.js","../src/modules/sequencer-presets.js","../src/sections/section.js","../src/sections/func.js","../src/sections/traits/animation.js","../src/sections/traits/audio.js","../src/sections/traits/files.js","../src/sections/traits/moves.js","../src/sections/traits/opacity.js","../src/sections/traits/rotation.js","../src/sections/traits/scale.js","../src/sections/traits/time.js","../src/sections/traits/users.js","../src/sections/traits/filter.js","../src/sections/traits/tint.js","../src/sections/traits/location.js","../src/sections/traits/offset.js","../src/sections/traits/text.js","../src/sections/traits/name.js","../src/sections/traits/_traits.js","../src/modules/sequencer-crosshair/CrosshairsDocument.js","../src/sections/effect.js","../src/sections/sound.js","../src/sections/animation.js","../src/sections/scrollingText.js","../src/sections/canvasPan.js","../src/sections/wait.js","../src/sections/crosshair.js","../src/modules/sequencer.js","../src/modules/sequencer-section-manager.js","../src/lib/libWrapper/shim.js","../src/libwrapper.js","../src/migrations.js","../src/modules/sequencer-crosshair/TokenCrosshairsDocument.js","../src/modules/sequencer-crosshair/sequencer-crosshair.js","../src/formapplications/support-dialog.svelte","../src/module.js"],"sourcesContent":["const CONSTANTS = {\n  MODULE_NAME: \"sequencer\",\n  EFFECTS_FLAG_NAME: \"effects\",\n  SOUNDS_FLAG_NAME: \"sounds\",\n\tEFFECTS_LAYER: \"sequencerEffects\",\n\tINTERFACE_LAYER: \"sequencerInterfaceLayer\",\n\tIS_V13: false,\n  COLOR: {\n    PRIMARY: 0xee442f,\n    SECONDARY: 0x601a4a,\n    TERTIARY: 0x601a4a,\n  },\n  SHAPES: {\n    POLY: \"polygon\",\n    RECT: \"rectangle\",\n    CIRC: \"circle\",\n    ELIP: \"ellipse\",\n    RREC: \"roundedRect\",\n  },\n  FEET_REGEX: new RegExp(/\\.[0-9]+ft\\.*/g),\n  ARRAY_REGEX: new RegExp(/\\.[0-9]$/g),\n  STATUS: {\n    READY: 0,\n    RUNNING: 1,\n    COMPLETE: 2,\n    SKIPPED: 3,\n    ABORTED: 4,\n  },\n\n\tPLACEMENT_RESTRICTIONS: {\n\t\tANYWHERE: \"anywhere\",\n\t\tLINE_OF_SIGHT: \"lineOfSight\",\n\t\tNO_COLLIDABLES: \"noCollidables\"\n\t},\n\n\tCALLBACKS: {\n\t\tSHOW: \"show\",\n\t\tMOUSE_MOVE: \"mouseMove\",\n\t\tMOVE: \"move\",\n\t\tCOLLIDE: \"collide\",\n\t\tSTOP_COLLIDING: \"stopColliding\",\n\t\tINVALID_PLACEMENT: \"invalidPlacement\",\n\t\tPLACED: \"placed\",\n\t\tCANCEL: \"cancel\"\n\t}\n};\n\nCONSTANTS.TOOLS = {\n\tSELECT: `${CONSTANTS.MODULE_NAME}-select-effect`,\n\tPLAY: `${CONSTANTS.MODULE_NAME}-play-effect`,\n\tVIEWER: `${CONSTANTS.MODULE_NAME}-effectviewer`,\n\tDATABASE: `${CONSTANTS.MODULE_NAME}-effectdatabase`\n}\n\nCONSTANTS.EFFECTS_FLAG = `flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.EFFECTS_FLAG_NAME}`;\nCONSTANTS.REMOVE_EFFECTS_FLAG = `flags.${CONSTANTS.MODULE_NAME}.-=${CONSTANTS.EFFECTS_FLAG_NAME}`;\nCONSTANTS.SOUNDS_FLAG = `flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.SOUNDS_FLAG_NAME}`;\nCONSTANTS.REMOVE_SOUNDS_FLAG = `flags.${CONSTANTS.MODULE_NAME}.-=${CONSTANTS.SOUNDS_FLAG_NAME}`;\n\nexport default CONSTANTS;\n","import * as lib from \"../lib/lib.js\";\n\nexport function registerEase(easeName, easeFunction, overwrite = false) {\n  if (typeof easeName !== \"string\")\n    throw lib.custom_error(\"registerEase\", \"easeName must be of type string\");\n  if (!lib.is_function(easeFunction))\n    throw lib.custom_error(\n      \"registerEase\",\n      \"easeFunction must be of type function\"\n    );\n  if (easeFunctions[easeName] !== undefined && !overwrite) return;\n  lib.debug(`registerEase | Registered ease function: ${easeName}`);\n  easeFunctions[easeName] = easeFunction;\n}\n\nexport const easeFunctions = {\n  linear: linear,\n  easeInSine: easeInSine,\n  easeOutSine: easeOutSine,\n  easeInOutSine: easeInOutSine,\n  easeInQuad: easeInQuad,\n  easeOutQuad: easeOutQuad,\n  easeInOutQuad: easeInOutQuad,\n  easeInCubic: easeInCubic,\n  easeOutCubic: easeOutCubic,\n  easeInOutCubic: easeInOutCubic,\n  easeInQuart: easeInQuart,\n  easeOutQuart: easeOutQuart,\n  easeInOutQuart: easeInOutQuart,\n  easeInQuint: easeInQuint,\n  easeOutQuint: easeOutQuint,\n  easeInOutQuint: easeInOutQuint,\n  easeInExpo: easeInExpo,\n  easeOutExpo: easeOutExpo,\n  easeInOutExpo: easeInOutExpo,\n  easeInCirc: easeInCirc,\n  easeOutCirc: easeOutCirc,\n  easeInOutCirc: easeInOutCirc,\n  easeInBack: easeInBack,\n  easeOutBack: easeOutBack,\n  easeInOutBack: easeInOutBack,\n  easeInElastic: easeInElastic,\n  easeOutElastic: easeOutElastic,\n  easeInOutElastic: easeInOutElastic,\n  easeInBounce: easeInBounce,\n  easeOutBounce: easeOutBounce,\n  easeInOutBounce: easeInOutBounce,\n};\n\nexport const EASE = {\n  LINEAR: \"linear\",\n  SINE_IN: \"easeInSine\",\n  SINE_OUT: \"easeOutSine\",\n  SINE_IN_OUT: \"easeInOutSine\",\n  QUAD_IN: \"easeInQuad\",\n  QUAD_OUT: \"easeOutQuad\",\n  QUAD_IN_OUT: \"easeInOutQuad\",\n  CUBIC_IN: \"easeInCubic\",\n  CUBIC_OUT: \"easeOutCubic\",\n  CUBIC_IN_OUT: \"easeInOutCubic\",\n  QUART_IN: \"easeInQuart\",\n  QUART_OUT: \"easeOutQuart\",\n  QUART_IN_OUT: \"easeInOutQuart\",\n  QUINT_IN: \"easeInQuint\",\n  QUINT_OUT: \"easeOutQuint\",\n  QUINT_IN_OUT: \"easeInOutQuint\",\n  EXPO_IN: \"easeInExpo\",\n  EXPO_OUT: \"easeOutExpo\",\n  EXPO_IN_OUT: \"easeInOutExpo\",\n  CIRC_IN: \"easeInCirc\",\n  CIRC_OUT: \"easeOutCirc\",\n  CIRC_IN_OUT: \"easeInOutCirc\",\n  BACK_IN: \"easeInBack\",\n  BACK_OUT: \"easeOutBack\",\n  BACK_IN_OUT: \"easeInOutBack\",\n  ELASTIC_IN: \"easeInElastic\",\n  ELASTIC_OUT: \"easeOutElastic\",\n  ELASTIC_IN_OUT: \"easeInOutElastic\",\n  BOUNCE_IN: \"easeInBounce\",\n  BOUNCE_OUT: \"easeOutBounce\",\n  BOUNCE_IN_OUT: \"easeInOutBounce\",\n};\n\nfunction linear(x) {\n  return x;\n}\n\nfunction easeInSine(x) {\n  return 1 - Math.cos((x * Math.PI) / 2);\n}\n\nfunction easeOutSine(x) {\n  return Math.sin((x * Math.PI) / 2);\n}\n\nfunction easeInOutSine(x) {\n  return -(Math.cos(Math.PI * x) - 1) / 2;\n}\n\nfunction easeInQuad(x) {\n  return x * x;\n}\n\nfunction easeOutQuad(x) {\n  return 1 - (1 - x) * (1 - x);\n}\n\nfunction easeInOutQuad(x) {\n  return x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2;\n}\n\nfunction easeInCubic(x) {\n  return x * x * x;\n}\n\nfunction easeOutCubic(x) {\n  return 1 - Math.pow(1 - x, 3);\n}\n\nfunction easeInOutCubic(x) {\n  return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;\n}\n\nfunction easeInQuart(x) {\n  return x * x * x * x;\n}\n\nfunction easeOutQuart(x) {\n  return 1 - Math.pow(1 - x, 4);\n}\n\nfunction easeInOutQuart(x) {\n  return x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2;\n}\n\nfunction easeInQuint(x) {\n  return x * x * x * x * x;\n}\n\nfunction easeOutQuint(x) {\n  return 1 - Math.pow(1 - x, 5);\n}\n\nfunction easeInOutQuint(x) {\n  return x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2;\n}\n\nfunction easeInExpo(x) {\n  return x === 0 ? 0 : Math.pow(2, 10 * x - 10);\n}\n\nfunction easeOutExpo(x) {\n  return x === 1 ? 1 : 1 - Math.pow(2, -10 * x);\n}\n\nfunction easeInOutExpo(x) {\n  return x === 0\n    ? 0\n    : x === 1\n    ? 1\n    : x < 0.5\n    ? Math.pow(2, 20 * x - 10) / 2\n    : (2 - Math.pow(2, -20 * x + 10)) / 2;\n}\n\nfunction easeInCirc(x) {\n  return 1 - Math.sqrt(1 - Math.pow(x, 2));\n}\n\nfunction easeOutCirc(x) {\n  return Math.sqrt(1 - Math.pow(x - 1, 2));\n}\n\nfunction easeInOutCirc(x) {\n  return x < 0.5\n    ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2\n    : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2;\n}\n\nfunction easeInBack(x) {\n  const c1 = 1.70158;\n  const c3 = c1 + 1;\n\n  return c3 * x * x * x - c1 * x * x;\n}\n\nfunction easeOutBack(x) {\n  const c1 = 1.70158;\n  const c3 = c1 + 1;\n\n  return 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2);\n}\n\nfunction easeInOutBack(x) {\n  const c1 = 1.70158;\n  const c2 = c1 * 1.525;\n\n  return x < 0.5\n    ? (Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2)) / 2\n    : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2;\n}\n\nfunction easeInElastic(x) {\n  const c4 = (2 * Math.PI) / 3;\n\n  return x === 0\n    ? 0\n    : x === 1\n    ? 1\n    : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4);\n}\n\nfunction easeOutElastic(x) {\n  const c4 = (2 * Math.PI) / 3;\n\n  return x === 0\n    ? 0\n    : x === 1\n    ? 1\n    : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1;\n}\n\nfunction easeInOutElastic(x) {\n  const c5 = (2 * Math.PI) / 4.5;\n\n  return x === 0\n    ? 0\n    : x === 1\n    ? 1\n    : x < 0.5\n    ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2\n    : (Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5)) / 2 + 1;\n}\n\nfunction easeInBounce(x) {\n  return 1 - easeOutBounce(1 - x);\n}\n\nfunction easeOutBounce(x) {\n  const n1 = 7.5625;\n  const d1 = 2.75;\n\n  if (x < 1 / d1) {\n    return n1 * x * x;\n  } else if (x < 2 / d1) {\n    return n1 * (x -= 1.5 / d1) * x + 0.75;\n  } else if (x < 2.5 / d1) {\n    return n1 * (x -= 2.25 / d1) * x + 0.9375;\n  } else {\n    return n1 * (x -= 2.625 / d1) * x + 0.984375;\n  }\n}\n\nfunction easeInOutBounce(x) {\n  return x < 0.5\n    ? (1 - easeOutBounce(1 - 2 * x)) / 2\n    : (1 + easeOutBounce(2 * x - 1)) / 2;\n}\n","import CONSTANTS from \"../constants.js\";\nimport { easeFunctions } from \"../canvas-effects/ease.js\";\n\n/**\n *  This function linearly interpolates between p1 and p2 based on a normalized value of t\n *\n * @param  {string}         inFile      The start value\n * @param  {object}         inOptions   The end value\n * @return {array|boolean}              Interpolated value\n */\nexport async function getFiles(\n  inFile,\n  { applyWildCard = false, softFail = false } = {}\n) {\n  let source = \"data\";\n  const browseOptions = { wildcard: applyWildCard };\n\n  if (/\\.s3\\./.test(inFile)) {\n    source = \"s3\";\n    const { bucket, keyPrefix } = foundry.utils.parseS3URL(inFile);\n    if (bucket) {\n      browseOptions.bucket = bucket;\n      inFile = keyPrefix;\n    }\n  }\n\n  try {\n    return (await FilePicker.browse(source, inFile, browseOptions)).files;\n  } catch (err) {\n    if (softFail) return false;\n    throw custom_error(\"Sequencer\", `getFiles | ${err}`);\n  }\n}\n\n/**\n *  This function interpolates between p1 and p2 based on a normalized value of t, determined by the ease provided (string or function)\n *\n * @param  {number}             p1      The start value\n * @param  {number}             p2      The end value\n * @param  {number}             t       The normalized percentage\n * @param  {string|function}    ease    Type of ease to interpolate\n * @return {number}                     Interpolated value\n */\nexport function interpolate(p1, p2, t, ease = \"linear\") {\n  const easeFunction = is_function(ease) ? ease : easeFunctions[ease];\n  return p1 + (p2 - p1) * easeFunction(t);\n}\n\n/**\n *  Returns a floating point number between a minimum and maximum value\n *\n * @param  {number}     min                     The minimum value\n * @param  {number}     max                     The maximum value\n * @param  {boolean|MersenneTwister} twister    The twister to generate the random results from\n * @return {number}                             A random value between the range given\n */\nexport function random_float_between(min, max, twister = false) {\n  const random = twister ? twister.random() : Math.random();\n  const _max = Math.max(max, min);\n  const _min = Math.min(max, min);\n  return random * (_max - _min) + _min;\n}\n\n/**\n *  Returns an integer between a minimum and maximum value\n *\n * @param  {number}     min                     The minimum value\n * @param  {number}     max                     The maximum value\n * @param  {boolean|MersenneTwister} twister    The twister to generate the random results from\n * @return {int}                                A random integer between the range given\n */\nexport function random_int_between(min, max, twister = false) {\n  return Math.floor(random_float_between(min, max, twister));\n}\n\nexport function flip_negate(num_1, num_2) {\n  if (num_1 > 0) {\n    num_1 -= num_2;\n  } else {\n    num_1 += num_2;\n  }\n  return num_1;\n}\n\n/**\n *  Returns a shuffled copy of the original array.\n *\n * @param  {array}   inArray\n * @param  {boolean|MersenneTwister} twister    The twister to generate the random results from\n * @return {array}\n */\nexport function shuffle_array(inArray, twister = false) {\n  let shuffled = [...inArray];\n  const randomMethod = twister?.random ?? Math.random;\n  for (let i = shuffled.length - 1; i > 0; i--) {\n    let j = Math.floor(randomMethod() * (i + 1));\n    let temp = shuffled[i];\n    shuffled[i] = shuffled[j];\n    shuffled[j] = temp;\n  }\n  return shuffled;\n}\n\n/**\n *  This function determines if the given parameter is a callable function\n *\n * @param  {function}   inFunc    The function object to be tested\n * @return {boolean}              A boolean whether the function is actually a function\n */\nexport function is_function(inFunc) {\n  return (\n    inFunc &&\n    ({}.toString.call(inFunc) === \"[object Function]\" ||\n      {}.toString.call(inFunc) === \"[object AsyncFunction]\")\n  );\n}\n\n/**\n *  Returns a random element in the given array\n *\n * @param  {array}   inArray                    An array\n * @param  {boolean} recurse                    Whether to recurse if the randomly chosen element is also an array\n * @param  {boolean|MersenneTwister} twister    The twister to generate the random results from\n * @param  {boolean} index                      Whether to return the chosen index instead\n * @return {object}                             A random element from the array\n */\nexport function random_array_element(\n  inArray,\n  { recurse = false, twister = false, index = false } = {}\n) {\n  const chosenIndex = random_int_between(0, inArray.length, twister);\n  let choice = inArray[chosenIndex];\n  if (recurse && Array.isArray(choice)) {\n    return random_array_element(choice, { recurse, twister, index });\n  }\n  if (index) {\n    return chosenIndex;\n  }\n  return choice;\n}\n\n/**\n *  Returns a random element in the given object\n *\n * @param  {object}   inObject                  An object\n * @param  {boolean}  recurse                   Whether to recurse if the randomly chosen element is also an object\n * @param  {boolean|MersenneTwister} twister    The twister to generate the random results from\n * @return {object}                             A random element from the object\n */\nexport function random_object_element(\n  inObject,\n  { recurse = false, twister = false } = {}\n) {\n  let keys = Object.keys(inObject).filter((k) => !k.startsWith(\"_\"));\n  let choice = inObject[random_array_element(keys, { twister })];\n  if (typeof choice === \"object\" && recurse) {\n    return random_object_element(choice, { recurse: true });\n  }\n  return choice;\n}\n\n/**\n *  Tests a parameter whether it is a real number\n *\n * @param  {any}        inNumber    The parameter to test\n * @return {boolean}                Whether it is of type number, not infinite, and not NaN\n */\nexport function is_real_number(inNumber) {\n  return !isNaN(inNumber) && typeof inNumber === \"number\" && isFinite(inNumber);\n}\n\n/**\n *  Coerces a number between 0 and 1\n *\n * @param  {any}        inNumber    The parameter to test\n * @return {number | undefined}     Number normalized between 0 and 1, or undefined if inNumber is NaN\n */\nexport function normalize_alpha_number(inNumber) {\n  if (!is_real_number(inNumber)) return undefined;\n\n  inNumber = Math.abs(inNumber);\n  while (inNumber > 1) inNumber /= 10;\n  return inNumber;\n}\n\n/**\n *  Gets a property in an object based on a path in dot-notated string\n *\n * @param   {object}         obj       The object to be queried\n * @param   {array|string}   path      The path in the object to the property in a dot-notated string\n * @returns {any}                      Property value, if found\n */\nexport function deep_get(obj, path) {\n  if (!Array.isArray(path)) path = path.split(\".\");\n  try {\n    let i;\n    for (i = 0; i < path.length - 1; i++) {\n      obj = obj[path[i]];\n    }\n    return obj[path[i]];\n  } catch (err) {}\n}\n\n/**\n *  Sets a property in an object based on a path in dot-notated string, example:\n *  let obj = { first: { second: { third: \"value\" } } }\n *  deep_set(obj, \"newValue\", \"first.second.third\")\n *  let obj = { first: { second: { third: \"newValue\" } } }\n *\n * @param  {object}         obj       The object to be modified\n * @param  {array|string}   path      The path in the object to the property in a dot-notated string\n * @param  {any}            value     The value to set\n */\nexport function deep_set(obj, path, value) {\n  if (!Array.isArray(path)) path = path.split(\".\");\n  try {\n    let i;\n    for (i = 0; i < path.length - 1; i++) {\n      obj = obj[path[i]];\n    }\n    if (is_function(obj[path[i]])) {\n      obj[path[i]](value);\n    } else {\n      obj[path[i]] = value;\n    }\n  } catch (err) {}\n}\n\n/**\n *  Flattens an object in a dot-notated format, like:\n *  { data: { entry: { thing: \"stuff\" } } }\n *  Becomes:\n *  [{ \"data.entry.thing\": \"stuff\" }]\n *\n * @param  {object}     obj       The object to be flattened\n * @return {object}               The flattened object\n */\nexport function flatten_object(obj) {\n  let toReturn = [];\n  for (let i in obj) {\n    if (i.startsWith(\"_\")) continue;\n    if (!obj.hasOwnProperty(i)) continue;\n    if (typeof obj[i] == \"object\") {\n      let flatObject = flatten_object(obj[i]);\n      for (let x in flatObject) {\n        if (!flatObject.hasOwnProperty(x)) continue;\n        toReturn[i + \".\" + x] = flatObject[x];\n      }\n    } else {\n      toReturn[i] = obj[i];\n    }\n  }\n  return toReturn;\n}\n\n/**\n *  Wait for a duration.\n *\n * @param  {number}     ms      Milliseconds to wait\n * @return {Promise}            A promise that resolves after a given amount of milliseconds\n */\nexport function wait(ms) {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n *  Clamps a value between two numbers\n *\n * @param  {number}     num     Number to clamp\n * @param  {number}     min     The minimum the number can be\n * @param  {number}     max     The maximum the number can be\n * @return {number}             The clamped number\n */\nexport function clamp(num, min, max) {\n  const _max = Math.max(min, max);\n  const _min = Math.min(min, max);\n  return Math.max(_min, Math.min(_max, num));\n}\n\n/**\n * Checks whether a given string is a valid UUID or not\n *\n * @param {string} inId\n * @returns {boolean}\n */\nexport function is_UUID(inId) {\n  return (\n    typeof inId === \"string\" &&\n    (inId.startsWith(\"Scene\") ||\n      inId.startsWith(\"Actor\") ||\n      inId.startsWith(\"Item\")) &&\n    (inId.match(/\\./g) || []).length &&\n    !inId.endsWith(\".\")\n  );\n}\n\n/**\n *  Gets an object by an unique identifier, such as an ID, name, tag, label\n *\n * @param  {String}     inObjectId  The object identifier to search for\n * @param  {String}     inSceneId   The scene ID to search within\n * @return {any}                    Object if found, else undefined\n */\nexport function get_object_from_scene(\n  inObjectId,\n  inSceneId = game.user.viewedScene\n) {\n  let tryUUID = is_UUID(inObjectId);\n  if (tryUUID) {\n    const obj = fromUuidSync(inObjectId);\n    if (obj) return obj;\n    tryUUID = false;\n  }\n\tconst allDocs = get_all_documents_from_scene(inSceneId);\n  return allDocs.find((obj) => {\n    return get_object_identifier(obj, tryUUID) === inObjectId;\n  });\n}\n\n/**\n * Gets all documents from the given scene\n *\n * @param {Boolean/String} inSceneId\n * @returns {Array<Document>}\n */\nexport function get_all_documents_from_scene(inSceneId = false) {\n  const scene = inSceneId\n    ? game.scenes.get(inSceneId)\n    : game.scenes.get(game.user?.viewedScene);\n  if (!scene) return [];\n  return [\n\t  ...canvas.layers.map(layer => layer?.children ?? [].concat(layer?.preview?.children ?? [])),\n    ...Array.from(scene?.tokens ?? []),\n    ...Array.from(scene?.lights ?? []),\n    ...Array.from(scene?.sounds ?? []),\n    ...Array.from(scene?.templates ?? []),\n    ...Array.from(scene?.tiles ?? []),\n    ...Array.from(scene?.walls ?? []),\n    ...Array.from(scene?.drawings ?? []),\n  ]\n    .deepFlatten()\n    .filter(Boolean);\n}\n\n/**\n * Gets the document from an object, if it has one\n *\n * @param inObject\n * @returns {Document|{document}|*}\n */\nexport function validate_document(inObject) {\n  const document = inObject?.document ?? inObject;\n  return is_UUID(document?.uuid) ? document : inObject;\n}\n\n/**\n *  Get the unique identifier from an object\n *\n * @param  {Object}     inObject    The object to get the unique identifier from\n * @param  {Boolean}    tryUUID     The object to get the unique identifier from\n * @return {String}                 The identifier\n */\nexport function get_object_identifier(inObject, tryUUID = true) {\n  const uuid = tryUUID && is_UUID(inObject?.uuid) ? inObject?.uuid : undefined;\n  return (\n    uuid ??\n    inObject?.id ??\n    inObject?.document?.name ??\n    inObject?.name ??\n    (inObject?.tag !== \"\" ? inObject?.tag : undefined) ??\n    (inObject?.label !== \"\" ? inObject?.label : undefined) ??\n    inObject?.sound_id\n  );\n}\n\n/**\n *  Turns an array containing multiples of the same string, objects, etc, and removes duplications, and returns a fresh array\n *\n * @param  {Array}     inArray     An array of multiple duplicate collections to be made unique\n * @return {Array}                 An array containing only unique objects\n */\nexport function make_array_unique(inArray) {\n  return Array.from(new Set(inArray));\n}\n\nexport function debug(msg, args = \"\") {\n  if (game.settings.get(CONSTANTS.MODULE_NAME, \"debug\"))\n    console.log(`DEBUG | Sequencer | ${msg}`, args);\n}\n\nexport function debug_error(msg, args) {\n  if (game.settings.get(CONSTANTS.MODULE_NAME, \"debug\"))\n    console.error(`DEBUG | Sequencer | ${msg}`, args);\n}\n\nexport function custom_warning(inClassName, warning, notify = false) {\n  inClassName =\n    inClassName !== \"Sequencer\"\n      ? \"Sequencer | Module: \" + inClassName\n      : inClassName;\n  warning = `${inClassName} | ${warning}`;\n  if (notify) ui.notifications.warn(warning, { console: false });\n  console.warn(warning.replace(\"<br>\", \"\\n\"));\n}\n\nconst throttledWarnings = {};\nexport function throttled_custom_warning(\n  inClassName,\n  warning,\n  delay = 10000,\n  notify = false\n) {\n  inClassName =\n    inClassName !== \"Sequencer\"\n      ? \"Sequencer | Module: \" + inClassName\n      : inClassName;\n  warning = `${inClassName} | ${warning}`;\n  if (throttledWarnings[warning]) return;\n  throttledWarnings[warning] = true;\n  if (notify) ui.notifications.warn(warning, { console: false });\n  console.warn(warning.replace(\"<br>\", \"\\n\"));\n  setTimeout(() => {\n    delete throttledWarnings[warning];\n  }, delay);\n}\n\nexport function custom_error(inClassName, error, notify = true) {\n  inClassName =\n    inClassName !== \"Sequencer\"\n      ? \"Sequencer | Module: \" + inClassName\n      : inClassName;\n  error = `${inClassName} | ${error}`;\n  if (notify) ui.notifications.error(error, { console: false });\n  return new Error(error.replace(\"<br>\", \"\\n\"));\n}\n\nexport function user_can_do(inSetting) {\n  return game.user.role > game.settings.get(CONSTANTS.MODULE_NAME, inSetting);\n}\n\nexport function group_by(xs, key) {\n  return xs.reduce(function (acc, obj) {\n    let property = foundry.utils.getProperty(obj, key);\n    acc[property] = acc[property] || [];\n    acc[property].push(obj);\n    return acc;\n  }, {});\n}\n\nfunction objHasProperty(obj, prop) {\n  return obj.constructor.prototype.hasOwnProperty(prop);\n}\n\nexport function sequence_proxy_wrap(inSequence) {\n  return new Proxy(inSequence, {\n    get: function (target, prop) {\n      if (!objHasProperty(target, prop)) {\n        if (Sequencer.SectionManager.externalSections[prop] === undefined) {\n          const section = target.sections[target.sections.length - 1];\n          if (section && objHasProperty(section, prop)) {\n            const targetProperty = Reflect.get(section, prop);\n            return is_function(targetProperty)\n              ? targetProperty.bind(section)\n              : targetProperty;\n          }\n          return Reflect.get(target, prop);\n        }\n        target.sectionToCreate =\n          Sequencer.SectionManager.externalSections[prop];\n        return Reflect.get(target, \"_createCustomSection\");\n      }\n      return Reflect.get(target, prop);\n    },\n  });\n}\n\nexport function section_proxy_wrap(inClass) {\n  return new Proxy(inClass, {\n    get: function (target, prop) {\n      if (\n        !objHasProperty(target, prop) &&\n        objHasProperty(target.sequence, prop)\n      ) {\n        const targetProperty = Reflect.get(target.sequence, prop);\n        return is_function(targetProperty)\n          ? targetProperty.bind(target.sequence)\n          : targetProperty;\n      }\n      return Reflect.get(target, prop);\n    },\n  });\n}\n\nexport function str_to_search_regex_str(str) {\n  return str\n    .trim()\n    .replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&')\n    .replace(/\\*+/g, \".*?\");\n}\n\nexport function safe_str(str) {\n  return str.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\");\n}\n\nexport function scroll_to_element(\n  scrollElement,\n  scrollToElement,\n  duration = 500\n) {\n  if (!duration) {\n    scrollElement.scrollTop(\n      scrollElement.scrollTop() -\n        scrollElement.offset().top +\n        scrollToElement.offset().top\n    );\n    return;\n  }\n\n  scrollElement.animate(\n    {\n      scrollTop:\n        scrollElement.scrollTop() -\n        scrollElement.offset().top +\n        scrollToElement.offset().top,\n    },\n    duration\n  );\n\n  return wait(duration);\n}\n\nexport async function highlight_element(\n  element,\n  { duration = false, color = \"#FF0000\", size = \"3px\" } = {}\n) {\n  element.prop(\n    \"style\",\n    `-webkit-box-shadow: inset 0px 0px ${size} ${size} ${color}; box-shadow: inset 0px 0px ${size} ${size} ${color};`\n  );\n  if (!duration) return;\n  await wait(duration);\n  element.prop(\"style\", \"\");\n}\n\nexport function get_hash(input) {\n  let hash = 0;\n  const len = input.length;\n  for (let i = 0; i < len; i++) {\n    hash = (hash << 5) - hash + input.charCodeAt(i);\n    hash |= 0; // to 32bit integer\n  }\n  return hash;\n}\n\nexport function parseColor(inColor) {\n  return {\n    hexadecimal: is_real_number(inColor) ? inColor.toString(16) : inColor,\n    decimal:\n      typeof inColor === \"string\" && inColor.startsWith(\"#\")\n        ? parseInt(inColor.slice(1), 16)\n        : inColor,\n  };\n}\n\nexport function getCanvasMouse() {\n  return canvas?.app?.renderer?.events?.pointer ?? canvas?.app?.renderer?.plugins?.interaction?.pointer;\n}\n\nexport function createMersenneTwister(seed){\n\tconst twister = foundry?.dice?.MersenneTwister ?? MersenneTwister;\n\treturn new twister(seed);\n}\n","function set(obj, key, val) {\n\tif (typeof val.value === 'object') val.value = klona(val.value);\n\tif (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {\n\t\tObject.defineProperty(obj, key, val);\n\t} else obj[key] = val.value;\n}\n\nfunction klona(x) {\n\tif (typeof x !== 'object') return x;\n\n\tvar i=0, k, list, tmp, str=Object.prototype.toString.call(x);\n\n\tif (str === '[object Object]') {\n\t\ttmp = Object.create(x.__proto__ || null);\n\t} else if (str === '[object Array]') {\n\t\ttmp = Array(x.length);\n\t} else if (str === '[object Set]') {\n\t\ttmp = new Set;\n\t\tx.forEach(function (val) {\n\t\t\ttmp.add(klona(val));\n\t\t});\n\t} else if (str === '[object Map]') {\n\t\ttmp = new Map;\n\t\tx.forEach(function (val, key) {\n\t\t\ttmp.set(klona(key), klona(val));\n\t\t});\n\t} else if (str === '[object Date]') {\n\t\ttmp = new Date(+x);\n\t} else if (str === '[object RegExp]') {\n\t\ttmp = new RegExp(x.source, x.flags);\n\t} else if (str === '[object DataView]') {\n\t\ttmp = new x.constructor( klona(x.buffer) );\n\t} else if (str === '[object ArrayBuffer]') {\n\t\ttmp = x.slice(0);\n\t} else if (str.slice(-6) === 'Array]') {\n\t\t// ArrayBuffer.isView(x)\n\t\t// ~> `new` bcuz `Buffer.slice` => ref\n\t\ttmp = new x.constructor(x);\n\t}\n\n\tif (tmp) {\n\t\tfor (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {\n\t\t\tset(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));\n\t\t}\n\n\t\tfor (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {\n\t\t\tif (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;\n\t\t\tset(tmp, k, Object.getOwnPropertyDescriptor(x, k));\n\t\t}\n\t}\n\n\treturn tmp || x;\n}\n\n/**\n * Provides common object manipulation utility functions and TypeScript type guards.\n *\n * @packageDocumentation\n */\n/**\n * Freezes all entries traversed that are objects including entries in arrays.\n *\n * @param data - An object or array.\n *\n * @param [options] - Options\n *\n * @param [options.skipKeys] - A Set of strings indicating keys of objects to not freeze.\n *\n * @returns The frozen object.\n *\n * @typeParam T - Type of data.\n */\nfunction deepFreeze(data, { skipKeys } = {}) {\n    if (typeof data !== 'object' || data === null) {\n        throw new TypeError(`deepFreeze error: 'data' is not an object or array.`);\n    }\n    if (skipKeys !== void 0 && Object.prototype.toString.call(skipKeys) !== '[object Set]') {\n        throw new TypeError(`deepFreeze error: 'options.skipKeys' is not a Set.`);\n    }\n    const stack = [data];\n    while (stack.length > 0) {\n        const obj = stack.pop();\n        if (typeof obj !== 'object' || obj === null || Object.isFrozen(obj)) {\n            continue;\n        }\n        // Collect nested properties before freezing.\n        const children = [];\n        if (Array.isArray(obj)) {\n            for (let cntr = 0; cntr < obj.length; cntr++) {\n                children.push(obj[cntr]);\n            }\n        }\n        else {\n            for (const key in obj) {\n                if (Object.hasOwn(obj, key) && !skipKeys?.has?.(key)) {\n                    children.push(obj[key]);\n                }\n            }\n        }\n        // Freeze after collecting children to avoid modifying a frozen object.\n        Object.freeze(obj);\n        // Push collected children onto the stack for further processing.\n        stack.push(...children);\n    }\n    return data;\n}\nfunction deepMerge(target, ...sourceObj) {\n    if (Object.prototype.toString.call(target) !== '[object Object]') {\n        throw new TypeError(`deepMerge error: 'target' is not an object.`);\n    }\n    if (sourceObj.length === 0) {\n        throw new TypeError(`deepMerge error: 'sourceObj' is not an object.`);\n    }\n    for (let cntr = 0; cntr < sourceObj.length; cntr++) {\n        if (Object.prototype.toString.call(sourceObj[cntr]) !== '[object Object]') {\n            throw new TypeError(`deepMerge error: 'sourceObj[${cntr}]' is not an object.`);\n        }\n    }\n    // When merging a single source object there is an implementation that is twice as fast as multiple source objects.\n    if (sourceObj.length === 1) {\n        const stack = [];\n        for (const obj of sourceObj) {\n            stack.push({ target, source: obj });\n        }\n        while (stack.length > 0) {\n            const { target, source } = stack.pop(); // LIFO but maintains correct merge order.\n            for (const prop in source) {\n                if (Object.hasOwn(source, prop)) {\n                    const sourceValue = source[prop];\n                    const targetValue = target[prop];\n                    // If both values are plain objects, enqueue for further merging.\n                    if (Object.hasOwn(target, prop) && targetValue?.constructor === Object &&\n                        sourceValue?.constructor === Object) {\n                        stack.push({ target: targetValue, source: sourceValue });\n                    }\n                    else {\n                        target[prop] = sourceValue;\n                    }\n                }\n            }\n        }\n    }\n    else // Stack implementation for multiple source objects.\n     {\n        const stack = [{ target, sources: sourceObj }];\n        while (stack.length > 0) {\n            const { target, sources } = stack.pop();\n            for (const source of sources) {\n                for (const prop in source) {\n                    if (Object.hasOwn(source, prop)) {\n                        const sourceValue = source[prop];\n                        const targetValue = target[prop];\n                        // If both values are plain objects, push for further merging with a new object.\n                        if (Object.hasOwn(target, prop) && targetValue?.constructor === Object &&\n                            sourceValue?.constructor === Object) {\n                            target[prop] = Object.assign({}, targetValue); // Copy existing target data.\n                            stack.push({ target: target[prop], sources: [sourceValue] });\n                        }\n                        else {\n                            target[prop] = sourceValue;\n                        }\n                    }\n                }\n            }\n        }\n    }\n    return target;\n}\n/**\n * Seals all entries traversed that are objects including entries in arrays.\n *\n * @param data - An object or array.\n *\n * @param [options] - Options\n *\n * @param [options.skipKeys] - A Set of strings indicating keys of objects to not seal.\n *\n * @returns The sealed object.\n *\n * @typeParam T - Type of data.\n */\nfunction deepSeal(data, { skipKeys } = {}) {\n    if (typeof data !== 'object' || data === null) {\n        throw new TypeError(`deepSeal error: 'data' is not an object or array.`);\n    }\n    if (skipKeys !== void 0 && Object.prototype.toString.call(skipKeys) !== '[object Set]') {\n        throw new TypeError(`deepSeal error: 'options.skipKeys' is not a Set.`);\n    }\n    const stack = [data];\n    while (stack.length > 0) {\n        const obj = stack.pop();\n        if (typeof obj !== 'object' || obj === null || Object.isSealed(obj)) {\n            continue;\n        }\n        // Collect nested properties before freezing.\n        const children = [];\n        if (Array.isArray(obj)) {\n            for (let cntr = 0; cntr < obj.length; cntr++) {\n                children.push(obj[cntr]);\n            }\n        }\n        else {\n            for (const key in obj) {\n                if (Object.hasOwn(obj, key) && !skipKeys?.has?.(key)) {\n                    children.push(obj[key]);\n                }\n            }\n        }\n        // Freeze after collecting children to avoid modifying a frozen object.\n        Object.seal(obj);\n        // Push collected children onto the stack for further processing.\n        stack.push(...children);\n    }\n    return data;\n}\n/**\n * Determine if the given object has a getter & setter accessor.\n *\n * @param object - An object.\n *\n * @param accessor - Accessor to test.\n *\n * @returns Whether the given object has the getter and setter for accessor.\n *\n * @typeParam T - Type of data.\n * @typeParam K - Accessor key.\n */\nfunction hasAccessor(object, accessor) {\n    if (typeof object !== 'object' || object === null || object === void 0) {\n        return false;\n    }\n    // Check for instance accessor.\n    const iDescriptor = Object.getOwnPropertyDescriptor(object, accessor);\n    if (iDescriptor !== void 0 && iDescriptor.get !== void 0 && iDescriptor.set !== void 0) {\n        return true;\n    }\n    // Walk parent prototype chain. Check for descriptor at each prototype level.\n    for (let o = Object.getPrototypeOf(object); o; o = Object.getPrototypeOf(o)) {\n        const descriptor = Object.getOwnPropertyDescriptor(o, accessor);\n        if (descriptor !== void 0 && descriptor.get !== void 0 && descriptor.set !== void 0) {\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * Determine if the given object has a getter accessor.\n *\n * @param object - An object.\n *\n * @param accessor - Accessor to test.\n *\n * @returns Whether the given object has the getter for accessor.\n *\n * @typeParam T - Type of data.\n * @typeParam K - Accessor key.\n */\nfunction hasGetter(object, accessor) {\n    if (typeof object !== 'object' || object === null || object === void 0) {\n        return false;\n    }\n    // Check for instance accessor.\n    const iDescriptor = Object.getOwnPropertyDescriptor(object, accessor);\n    if (iDescriptor !== void 0 && iDescriptor.get !== void 0) {\n        return true;\n    }\n    // Walk parent prototype chain. Check for descriptor at each prototype level.\n    for (let o = Object.getPrototypeOf(object); o; o = Object.getPrototypeOf(o)) {\n        const descriptor = Object.getOwnPropertyDescriptor(o, accessor);\n        if (descriptor !== void 0 && descriptor.get !== void 0) {\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * Returns whether the target is or has the given prototype walking up the prototype chain.\n *\n * @param target - Any target class / constructor function to test.\n *\n * @param Prototype - Class / constructor function to find.\n *\n * @returns Target matches prototype.\n *\n * @typeParam T - Prototype class / constructor.\n */\nfunction hasPrototype(target, Prototype) {\n    if (typeof target !== 'function') {\n        return false;\n    }\n    if (target === Prototype) {\n        return true;\n    }\n    // Walk parent prototype chain. Check for descriptor at each prototype level.\n    for (let proto = Object.getPrototypeOf(target); proto; proto = Object.getPrototypeOf(proto)) {\n        if (proto === Prototype) {\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * Determine if the given object has a setter accessor.\n *\n * @param object - An object.\n *\n * @param accessor - Accessor to test.\n *\n * @returns Whether the given object has the setter for accessor.\n *\n * @typeParam T - Type of data.\n * @typeParam K - Accessor key.\n */\nfunction hasSetter(object, accessor) {\n    if (typeof object !== 'object' || object === null || object === void 0) {\n        return false;\n    }\n    // Check for instance accessor.\n    const iDescriptor = Object.getOwnPropertyDescriptor(object, accessor);\n    if (iDescriptor !== void 0 && iDescriptor.set !== void 0) {\n        return true;\n    }\n    // Walk parent prototype chain. Check for descriptor at each prototype level.\n    for (let o = Object.getPrototypeOf(object); o; o = Object.getPrototypeOf(o)) {\n        const descriptor = Object.getOwnPropertyDescriptor(o, accessor);\n        if (descriptor !== void 0 && descriptor.set !== void 0) {\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * Tests for whether an object is async iterable.\n *\n * @param value - Any value.\n *\n * @returns Whether value is async iterable.\n */\nfunction isAsyncIterable(value) {\n    if (typeof value !== 'object' || value === null || value === void 0) {\n        return false;\n    }\n    return Symbol.asyncIterator in value;\n}\n/**\n * Tests for whether an object is iterable.\n *\n * @param value - Any value.\n *\n * @returns Whether object is iterable.\n */\nfunction isIterable(value) {\n    if (value === null || value === void 0 || typeof value !== 'object') {\n        return false;\n    }\n    return Symbol.iterator in value;\n}\n/**\n * Tests for whether object is not null, typeof object, and not an array.\n *\n * @param value - Any value.\n *\n * @returns Is it an object.\n */\nfunction isObject(value) {\n    return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n/**\n * Tests for whether the given value is a plain object.\n *\n * An object is plain if it is created by either: `{}`, `new Object()` or `Object.create(null)`.\n *\n * @param value - Any value\n *\n * @returns Is it a plain object.\n */\nfunction isPlainObject(value) {\n    if (Object.prototype.toString.call(value) !== '[object Object]') {\n        return false;\n    }\n    const prototype = Object.getPrototypeOf(value);\n    return prototype === null || prototype === Object.prototype;\n}\n/**\n * Safely returns keys on an object or an empty array if not an object.\n *\n * @param object - An object.\n *\n * @returns Object keys or empty array.\n */\nfunction objectKeys(object) {\n    return typeof object === 'object' && object !== null ? Object.keys(object) : [];\n}\n/**\n * Safely returns an objects size. Note for String objects Unicode is not taken into consideration.\n *\n * @param object - Any value, but size returned for object / Map / Set / arrays / strings.\n *\n * @returns Size of object.\n */\nfunction objectSize(object) {\n    if (object === void 0 || object === null || typeof object !== 'object') {\n        return 0;\n    }\n    const tag = Object.prototype.toString.call(object);\n    if (tag === '[object Map]' || tag === '[object Set]') {\n        return object.size;\n    }\n    if (tag === '[object String]') {\n        return object.length;\n    }\n    return Object.keys(object).length;\n}\n/**\n * Provides a way to safely access an objects data / entries given an accessor string which describes the\n * entries to walk. To access deeper entries into the object format the accessor string with `.` between entries\n * to walk.\n *\n * @param data - An object to access entry data.\n *\n * @param accessor - A string describing the entries to access with keys separated by `.`.\n *\n * @param [defaultValue] - (Optional) A default value to return if an entry for accessor is not found.\n *\n * @returns The value referenced by the accessor.\n *\n * @typeParam T - Type of data.\n * @typeParam P - Accessor type.\n * @typeParam R - Return value / Inferred deep access type or any provided default value type.\n */\nfunction safeAccess(data, accessor, defaultValue) {\n    if (typeof data !== 'object' || data === null) {\n        return defaultValue;\n    }\n    if (typeof accessor !== 'string') {\n        return defaultValue;\n    }\n    const keys = accessor.split('.');\n    let result = data;\n    // Walk through the given object by the accessor indexes.\n    for (let cntr = 0; cntr < keys.length; cntr++) {\n        // If the next level of object access is undefined or null then return the default value.\n        if (result[keys[cntr]] === void 0 || result[keys[cntr]] === null) {\n            return defaultValue;\n        }\n        result = result[keys[cntr]];\n    }\n    return result;\n}\n/**\n * Compares a source object and values of entries against a target object. If the entries in the source object match\n * the target object then `true` is returned otherwise `false`. If either object is undefined or null then false\n * is returned.\n *\n * Note: The source and target should be JSON objects.\n *\n * @param source - Source object.\n *\n * @param target - Target object.\n *\n * @param [options] - Options.\n *\n * @param [options.arrayIndex] - Set to `false` to exclude equality testing for array contents; default: `true`.\n *\n * @param [options.hasOwnOnly] - Set to `false` to include enumerable prototype properties; default: `true`.\n *\n * @returns True if equal.\n */\nfunction safeEqual(source, target, options) {\n    if (typeof source !== 'object' || source === null || typeof target !== 'object' || target === null) {\n        return false;\n    }\n    for (const accessor of safeKeyIterator(source, options)) {\n        const sourceObjectValue = safeAccess(source, accessor);\n        const targetObjectValue = safeAccess(target, accessor);\n        if (sourceObjectValue !== targetObjectValue) {\n            return false;\n        }\n    }\n    return true;\n}\n/**\n * Returns an iterator of safe keys useful with {@link safeAccess} and {@link safeSet} by traversing the given object.\n *\n * Note: Keys are only generated for JSON objects; {@link Map} and {@link Set} are not indexed.\n *\n * @param data - An object to traverse for accessor keys.\n *\n * @param [options] - Options.\n *\n * @param [options.arrayIndex] - Set to `false` to exclude safe keys for array indexing; default: `true`.\n *\n * @param [options.hasOwnOnly] - Set to `false` to include enumerable prototype properties; default: `true`.\n *\n * @returns Safe key iterator.\n */\nfunction* safeKeyIterator(data, { arrayIndex = true, hasOwnOnly = true } = {}) {\n    if (typeof data !== 'object' || data === null) {\n        throw new TypeError(`safeKeyIterator error: 'data' is not an object.`);\n    }\n    if (typeof arrayIndex !== 'boolean') {\n        throw new TypeError(`safeKeyIterator error: 'options.arrayIndex' is not a boolean.`);\n    }\n    if (typeof hasOwnOnly !== 'boolean') {\n        throw new TypeError(`safeKeyIterator error: 'options.hasOwnOnly' is not a boolean.`);\n    }\n    const stack = [{ obj: data, prefix: '' }];\n    while (stack.length > 0) {\n        const { obj, prefix } = stack.pop();\n        for (const key in obj) {\n            if (hasOwnOnly && !Object.hasOwn(obj, key)) {\n                continue;\n            }\n            const fullKey = prefix ? `${prefix}.${key}` : key;\n            const value = obj[key];\n            if (Array.isArray(value)) {\n                if (!arrayIndex) {\n                    continue;\n                }\n                for (let cntr = 0; cntr < value.length; cntr++) {\n                    yield `${fullKey}.${cntr}`;\n                }\n            }\n            else if (typeof value === 'object' && value !== null) {\n                stack.push({ obj: value, prefix: fullKey }); // Push to stack for DFS traversal.\n            }\n            else if (typeof value !== 'function') {\n                yield fullKey;\n            }\n        }\n    }\n}\n/**\n * Provides a way to safely set an objects data / entries given an accessor string which describes the\n * entries to walk. To access deeper entries into the object format the accessor string with `.` between entries\n * to walk.\n *\n * @param data - An object to access entry data.\n *\n * @param accessor - A string describing the entries to access.\n *\n * @param value - A new value to set if an entry for accessor is found.\n *\n * @param [options] - Options.\n *\n * @param [options.operation] - Operation to perform including: `add`, `div`, `mult`, `set`, `set-undefined`, `sub`;\n *        default: `set`.\n *\n * @param [options.createMissing] - If `true` missing accessor entries will be created as objects automatically;\n *        default: `false`.\n *\n * @returns True if successful.\n */\nfunction safeSet(data, accessor, value, { operation = 'set', createMissing = false } = {}) {\n    if (typeof data !== 'object' || data === null) {\n        throw new TypeError(`safeSet error: 'data' is not an object.`);\n    }\n    if (typeof accessor !== 'string') {\n        throw new TypeError(`safeSet error: 'accessor' is not a string.`);\n    }\n    if (typeof operation !== 'string') {\n        throw new TypeError(`safeSet error: 'options.operation' is not a string.`);\n    }\n    if (operation !== 'add' && operation !== 'div' && operation !== 'mult' && operation !== 'set' &&\n        operation !== 'set-undefined' && operation !== 'sub') {\n        throw new Error(`safeSet error: Unknown 'options.operation'.`);\n    }\n    if (typeof createMissing !== 'boolean') {\n        throw new TypeError(`safeSet error: 'options.createMissing' is not a boolean.`);\n    }\n    const access = accessor.split('.');\n    let result = false;\n    // Verify first level missing property.\n    if (access.length === 1 && !createMissing && !(access[0] in data)) {\n        return false;\n    }\n    // Walk through the given object by the accessor indexes.\n    for (let cntr = 0; cntr < access.length; cntr++) {\n        // If data is an array perform validation that the accessor is a positive integer otherwise quit.\n        if (Array.isArray(data)) {\n            const number = (+access[cntr]);\n            if (!Number.isInteger(number) || number < 0) {\n                return false;\n            }\n        }\n        if (cntr === access.length - 1) {\n            switch (operation) {\n                case 'add':\n                    data[access[cntr]] += value;\n                    result = true;\n                    break;\n                case 'div':\n                    data[access[cntr]] /= value;\n                    result = true;\n                    break;\n                case 'mult':\n                    data[access[cntr]] *= value;\n                    result = true;\n                    break;\n                case 'set':\n                    data[access[cntr]] = value;\n                    result = true;\n                    break;\n                case 'set-undefined':\n                    if (data[access[cntr]] === void 0) {\n                        data[access[cntr]] = value;\n                    }\n                    result = true;\n                    break;\n                case 'sub':\n                    data[access[cntr]] -= value;\n                    result = true;\n                    break;\n            }\n        }\n        else {\n            // If createMissing is true and the next level of object access is undefined then create a new object entry.\n            if (createMissing && data[access[cntr]] === void 0) {\n                data[access[cntr]] = {};\n            }\n            // Abort if the next level is null or not an object and containing a value.\n            if (data[access[cntr]] === null || typeof data[access[cntr]] !== 'object') {\n                return false;\n            }\n            data = data[access[cntr]];\n        }\n    }\n    return result;\n}\n\nexport { deepFreeze, deepMerge, deepSeal, hasAccessor, hasGetter, hasPrototype, hasSetter, isAsyncIterable, isIterable, isObject, isPlainObject, klona, objectKeys, objectSize, safeAccess, safeEqual, safeKeyIterator, safeSet };\n//# sourceMappingURL=index.js.map\n","/** @returns {void} */\nexport function noop() {}\n\nexport const identity = (x) => x;\n\n/**\n * @template T\n * @template S\n * @param {T} tar\n * @param {S} src\n * @returns {T & S}\n */\nexport function assign(tar, src) {\n\t// @ts-ignore\n\tfor (const k in src) tar[k] = src[k];\n\treturn /** @type {T & S} */ (tar);\n}\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n/**\n * @param {any} value\n * @returns {value is PromiseLike<any>}\n */\nexport function is_promise(value) {\n\treturn (\n\t\t!!value &&\n\t\t(typeof value === 'object' || typeof value === 'function') &&\n\t\ttypeof (/** @type {any} */ (value).then) === 'function'\n\t);\n}\n\n/** @returns {void} */\nexport function add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nexport function run(fn) {\n\treturn fn();\n}\n\nexport function blank_object() {\n\treturn Object.create(null);\n}\n\n/**\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function run_all(fns) {\n\tfns.forEach(run);\n}\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\n/** @returns {boolean} */\nexport function safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function';\n}\n\nlet src_url_equal_anchor;\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nexport function src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\tif (!src_url_equal_anchor) {\n\t\tsrc_url_equal_anchor = document.createElement('a');\n\t}\n\t// This is actually faster than doing URL(..).href\n\tsrc_url_equal_anchor.href = url;\n\treturn element_src === src_url_equal_anchor.href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element_srcset\n * @param {string | undefined | null} srcset\n * @returns {boolean}\n */\nexport function srcset_url_equal(element_srcset, srcset) {\n\tconst element_urls = split_srcset(element_srcset.srcset);\n\tconst urls = split_srcset(srcset || '');\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n\n/** @returns {boolean} */\nexport function not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\n/** @returns {boolean} */\nexport function is_empty(obj) {\n\treturn Object.keys(obj).length === 0;\n}\n\n/** @returns {void} */\nexport function validate_store(store, name) {\n\tif (store != null && typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nexport function subscribe(store, ...callbacks) {\n\tif (store == null) {\n\t\tfor (const callback of callbacks) {\n\t\t\tcallback(undefined);\n\t\t}\n\t\treturn noop;\n\t}\n\tconst unsub = store.subscribe(...callbacks);\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * https://svelte.dev/docs/svelte-store#get\n * @template T\n * @param {import('../store/public.js').Readable<T>} store\n * @returns {T}\n */\nexport function get_store_value(store) {\n\tlet value;\n\tsubscribe(store, (_) => (value = _))();\n\treturn value;\n}\n\n/** @returns {void} */\nexport function component_subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(subscribe(store, callback));\n}\n\nexport function create_slot(definition, ctx, $$scope, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n\treturn definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;\n}\n\nexport function get_slot_changes(definition, $$scope, dirty, fn) {\n\tif (definition[2] && fn) {\n\t\tconst lets = definition[2](fn(dirty));\n\t\tif ($$scope.dirty === undefined) {\n\t\t\treturn lets;\n\t\t}\n\t\tif (typeof lets === 'object') {\n\t\t\tconst merged = [];\n\t\t\tconst len = Math.max($$scope.dirty.length, lets.length);\n\t\t\tfor (let i = 0; i < len; i += 1) {\n\t\t\t\tmerged[i] = $$scope.dirty[i] | lets[i];\n\t\t\t}\n\t\t\treturn merged;\n\t\t}\n\t\treturn $$scope.dirty | lets;\n\t}\n\treturn $$scope.dirty;\n}\n\n/** @returns {void} */\nexport function update_slot_base(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tslot_changes,\n\tget_slot_context_fn\n) {\n\tif (slot_changes) {\n\t\tconst slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n\t\tslot.p(slot_context, slot_changes);\n\t}\n}\n\n/** @returns {void} */\nexport function update_slot(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tdirty,\n\tget_slot_changes_fn,\n\tget_slot_context_fn\n) {\n\tconst slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n\tupdate_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\n\n/** @returns {any[] | -1} */\nexport function get_all_dirty_from_scope($$scope) {\n\tif ($$scope.ctx.length > 32) {\n\t\tconst dirty = [];\n\t\tconst length = $$scope.ctx.length / 32;\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdirty[i] = -1;\n\t\t}\n\t\treturn dirty;\n\t}\n\treturn -1;\n}\n\n/** @returns {{}} */\nexport function exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\n/** @returns {{}} */\nexport function compute_rest_props(props, keys) {\n\tconst rest = {};\n\tkeys = new Set(keys);\n\tfor (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];\n\treturn rest;\n}\n\n/** @returns {{}} */\nexport function compute_slots(slots) {\n\tconst result = {};\n\tfor (const key in slots) {\n\t\tresult[key] = true;\n\t}\n\treturn result;\n}\n\n/** @returns {(this: any, ...args: any[]) => void} */\nexport function once(fn) {\n\tlet ran = false;\n\treturn function (...args) {\n\t\tif (ran) return;\n\t\tran = true;\n\t\tfn.call(this, ...args);\n\t};\n}\n\nexport function null_to_empty(value) {\n\treturn value == null ? '' : value;\n}\n\nexport function set_store_value(store, ret, value) {\n\tstore.set(value);\n\treturn ret;\n}\n\nexport const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\n\nexport function action_destroyer(action_result) {\n\treturn action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\n/** @param {number | string} value\n * @returns {[number, string]}\n */\nexport function split_css_unit(value) {\n\tconst split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n\treturn split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px'];\n}\n\nexport const contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n","import { noop } from './utils.js';\n\nexport const is_client = typeof window !== 'undefined';\n\n/** @type {() => number} */\nexport let now = is_client ? () => window.performance.now() : () => Date.now();\n\nexport let raf = is_client ? (cb) => requestAnimationFrame(cb) : noop;\n\n// used internally for testing\n/** @returns {void} */\nexport function set_now(fn) {\n\tnow = fn;\n}\n\n/** @returns {void} */\nexport function set_raf(fn) {\n\traf = fn;\n}\n","import { raf } from './environment.js';\n\nconst tasks = new Set();\n\n/**\n * @param {number} now\n * @returns {void}\n */\nfunction run_tasks(now) {\n\ttasks.forEach((task) => {\n\t\tif (!task.c(now)) {\n\t\t\ttasks.delete(task);\n\t\t\ttask.f();\n\t\t}\n\t});\n\tif (tasks.size !== 0) raf(run_tasks);\n}\n\n/**\n * For testing purposes only!\n * @returns {void}\n */\nexport function clear_loops() {\n\ttasks.clear();\n}\n\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n * @param {import('./private.js').TaskCallback} callback\n * @returns {import('./private.js').Task}\n */\nexport function loop(callback) {\n\t/** @type {import('./private.js').TaskEntry} */\n\tlet task;\n\tif (tasks.size === 0) raf(run_tasks);\n\treturn {\n\t\tpromise: new Promise((fulfill) => {\n\t\t\ttasks.add((task = { c: callback, f: fulfill }));\n\t\t}),\n\t\tabort() {\n\t\t\ttasks.delete(task);\n\t\t}\n\t};\n}\n","import { contenteditable_truthy_values, has_prop } from './utils.js';\n\nimport { ResizeObserverSingleton } from './ResizeObserverSingleton.js';\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\n\n/**\n * @returns {void}\n */\nexport function start_hydrating() {\n\tis_hydrating = true;\n}\n\n/**\n * @returns {void}\n */\nexport function end_hydrating() {\n\tis_hydrating = false;\n}\n\n/**\n * @param {number} low\n * @param {number} high\n * @param {(index: number) => number} key\n * @param {number} value\n * @returns {number}\n */\nfunction upper_bound(low, high, key, value) {\n\t// Return first index of value larger than input value in the range [low, high)\n\twhile (low < high) {\n\t\tconst mid = low + ((high - low) >> 1);\n\t\tif (key(mid) <= value) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\thigh = mid;\n\t\t}\n\t}\n\treturn low;\n}\n\n/**\n * @param {NodeEx} target\n * @returns {void}\n */\nfunction init_hydrate(target) {\n\tif (target.hydrate_init) return;\n\ttarget.hydrate_init = true;\n\t// We know that all children have claim_order values since the unclaimed have been detached if target is not <head>\n\n\tlet children = /** @type {ArrayLike<NodeEx2>} */ (target.childNodes);\n\t// If target is <head>, there may be children without claim_order\n\tif (target.nodeName === 'HEAD') {\n\t\tconst my_children = [];\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tconst node = children[i];\n\t\t\tif (node.claim_order !== undefined) {\n\t\t\t\tmy_children.push(node);\n\t\t\t}\n\t\t}\n\t\tchildren = my_children;\n\t}\n\t/*\n\t * Reorder claimed children optimally.\n\t * We can reorder claimed children optimally by finding the longest subsequence of\n\t * nodes that are already claimed in order and only moving the rest. The longest\n\t * subsequence of nodes that are claimed in order can be found by\n\t * computing the longest increasing subsequence of .claim_order values.\n\t *\n\t * This algorithm is optimal in generating the least amount of reorder operations\n\t * possible.\n\t *\n\t * Proof:\n\t * We know that, given a set of reordering operations, the nodes that do not move\n\t * always form an increasing subsequence, since they do not move among each other\n\t * meaning that they must be already ordered among each other. Thus, the maximal\n\t * set of nodes that do not move form a longest increasing subsequence.\n\t */\n\t// Compute longest increasing subsequence\n\t// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n\tconst m = new Int32Array(children.length + 1);\n\t// Predecessor indices + 1\n\tconst p = new Int32Array(children.length);\n\tm[0] = -1;\n\tlet longest = 0;\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst current = children[i].claim_order;\n\t\t// Find the largest subsequence length such that it ends in a value less than our current value\n\t\t// upper_bound returns first greater value, so we subtract one\n\t\t// with fast path for when we are on the current longest subsequence\n\t\tconst seq_len =\n\t\t\t(longest > 0 && children[m[longest]].claim_order <= current\n\t\t\t\t? longest + 1\n\t\t\t\t: upper_bound(1, longest, (idx) => children[m[idx]].claim_order, current)) - 1;\n\t\tp[i] = m[seq_len] + 1;\n\t\tconst new_len = seq_len + 1;\n\t\t// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n\t\tm[new_len] = i;\n\t\tlongest = Math.max(new_len, longest);\n\t}\n\t// The longest increasing subsequence of nodes (initially reversed)\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst lis = [];\n\t// The rest of the nodes, nodes that will be moved\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst to_move = [];\n\tlet last = children.length - 1;\n\tfor (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n\t\tlis.push(children[cur - 1]);\n\t\tfor (; last >= cur; last--) {\n\t\t\tto_move.push(children[last]);\n\t\t}\n\t\tlast--;\n\t}\n\tfor (; last >= 0; last--) {\n\t\tto_move.push(children[last]);\n\t}\n\tlis.reverse();\n\t// We sort the nodes being moved to guarantee that their insertion order matches the claim order\n\tto_move.sort((a, b) => a.claim_order - b.claim_order);\n\t// Finally, we move the nodes\n\tfor (let i = 0, j = 0; i < to_move.length; i++) {\n\t\twhile (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) {\n\t\t\tj++;\n\t\t}\n\t\tconst anchor = j < lis.length ? lis[j] : null;\n\t\ttarget.insertBefore(to_move[i], anchor);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @returns {void}\n */\nexport function append(target, node) {\n\ttarget.appendChild(node);\n}\n\n/**\n * @param {Node} target\n * @param {string} style_sheet_id\n * @param {string} styles\n * @returns {void}\n */\nexport function append_styles(target, style_sheet_id, styles) {\n\tconst append_styles_to = get_root_for_style(target);\n\tif (!append_styles_to.getElementById(style_sheet_id)) {\n\t\tconst style = element('style');\n\t\tstyle.id = style_sheet_id;\n\t\tstyle.textContent = styles;\n\t\tappend_stylesheet(append_styles_to, style);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {ShadowRoot | Document}\n */\nexport function get_root_for_style(node) {\n\tif (!node) return document;\n\tconst root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n\tif (root && /** @type {ShadowRoot} */ (root).host) {\n\t\treturn /** @type {ShadowRoot} */ (root);\n\t}\n\treturn node.ownerDocument;\n}\n\n/**\n * @param {Node} node\n * @returns {CSSStyleSheet}\n */\nexport function append_empty_stylesheet(node) {\n\tconst style_element = element('style');\n\t// For transitions to work without 'style-src: unsafe-inline' Content Security Policy,\n\t// these empty tags need to be allowed with a hash as a workaround until we move to the Web Animations API.\n\t// Using the hash for the empty string (for an empty tag) works in all browsers except Safari.\n\t// So as a workaround for the workaround, when we append empty style tags we set their content to /* empty */.\n\t// The hash 'sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=' will then work even in Safari.\n\tstyle_element.textContent = '/* empty */';\n\tappend_stylesheet(get_root_for_style(node), style_element);\n\treturn style_element.sheet;\n}\n\n/**\n * @param {ShadowRoot | Document} node\n * @param {HTMLStyleElement} style\n * @returns {CSSStyleSheet}\n */\nfunction append_stylesheet(node, style) {\n\tappend(/** @type {Document} */ (node).head || node, style);\n\treturn style.sheet;\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @returns {void}\n */\nexport function append_hydration(target, node) {\n\tif (is_hydrating) {\n\t\tinit_hydrate(target);\n\t\tif (\n\t\t\ttarget.actual_end_child === undefined ||\n\t\t\t(target.actual_end_child !== null && target.actual_end_child.parentNode !== target)\n\t\t) {\n\t\t\ttarget.actual_end_child = target.firstChild;\n\t\t}\n\t\t// Skip nodes of undefined ordering\n\t\twhile (target.actual_end_child !== null && target.actual_end_child.claim_order === undefined) {\n\t\t\ttarget.actual_end_child = target.actual_end_child.nextSibling;\n\t\t}\n\t\tif (node !== target.actual_end_child) {\n\t\t\t// We only insert if the ordering of this node should be modified or the parent node is not target\n\t\t\tif (node.claim_order !== undefined || node.parentNode !== target) {\n\t\t\t\ttarget.insertBefore(node, target.actual_end_child);\n\t\t\t}\n\t\t} else {\n\t\t\ttarget.actual_end_child = node.nextSibling;\n\t\t}\n\t} else if (node.parentNode !== target || node.nextSibling !== null) {\n\t\ttarget.appendChild(node);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @param {Node} [anchor]\n * @returns {void}\n */\nexport function insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor || null);\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @param {NodeEx} [anchor]\n * @returns {void}\n */\nexport function insert_hydration(target, node, anchor) {\n\tif (is_hydrating && !anchor) {\n\t\tappend_hydration(target, node);\n\t} else if (node.parentNode !== target || node.nextSibling != anchor) {\n\t\ttarget.insertBefore(node, anchor || null);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {void}\n */\nexport function detach(node) {\n\tif (node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function destroy_each(iterations, detaching) {\n\tfor (let i = 0; i < iterations.length; i += 1) {\n\t\tif (iterations[i]) iterations[i].d(detaching);\n\t}\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element(name) {\n\treturn document.createElement(name);\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @param {string} is\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element_is(name, is) {\n\treturn document.createElement(name, { is });\n}\n\n/**\n * @template T\n * @template {keyof T} K\n * @param {T} obj\n * @param {K[]} exclude\n * @returns {Pick<T, Exclude<keyof T, K>>}\n */\nexport function object_without_properties(obj, exclude) {\n\tconst target = /** @type {Pick<T, Exclude<keyof T, K>>} */ ({});\n\tfor (const k in obj) {\n\t\tif (\n\t\t\thas_prop(obj, k) &&\n\t\t\t// @ts-ignore\n\t\t\texclude.indexOf(k) === -1\n\t\t) {\n\t\t\t// @ts-ignore\n\t\t\ttarget[k] = obj[k];\n\t\t}\n\t}\n\treturn target;\n}\n\n/**\n * @template {keyof SVGElementTagNameMap} K\n * @param {K} name\n * @returns {SVGElement}\n */\nexport function svg_element(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n/**\n * @param {string} data\n * @returns {Text}\n */\nexport function text(data) {\n\treturn document.createTextNode(data);\n}\n\n/**\n * @returns {Text} */\nexport function space() {\n\treturn text(' ');\n}\n\n/**\n * @returns {Text} */\nexport function empty() {\n\treturn text('');\n}\n\n/**\n * @param {string} content\n * @returns {Comment}\n */\nexport function comment(content) {\n\treturn document.createComment(content);\n}\n\n/**\n * @param {EventTarget} node\n * @param {string} event\n * @param {EventListenerOrEventListenerObject} handler\n * @param {boolean | AddEventListenerOptions | EventListenerOptions} [options]\n * @returns {() => void}\n */\nexport function listen(node, event, handler, options) {\n\tnode.addEventListener(event, handler, options);\n\treturn () => node.removeEventListener(event, handler, options);\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function prevent_default(fn) {\n\treturn function (event) {\n\t\tevent.preventDefault();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopPropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_immediate_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopImmediatePropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function self(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.target === this) fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function trusted(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.isTrusted) fn.call(this, event);\n\t};\n}\n\n/**\n * @param {Element} node\n * @param {string} attribute\n * @param {string} [value]\n * @returns {void}\n */\nexport function attr(node, attribute, value) {\n\tif (value == null) node.removeAttribute(attribute);\n\telse if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_attributes(node, attributes) {\n\t// @ts-ignore\n\tconst descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n\tfor (const key in attributes) {\n\t\tif (attributes[key] == null) {\n\t\t\tnode.removeAttribute(key);\n\t\t} else if (key === 'style') {\n\t\t\tnode.style.cssText = attributes[key];\n\t\t} else if (key === '__value') {\n\t\t\t/** @type {any} */ (node).value = node[key] = attributes[key];\n\t\t} else if (\n\t\t\tdescriptors[key] &&\n\t\t\tdescriptors[key].set &&\n\t\t\talways_set_through_set_attribute.indexOf(key) === -1\n\t\t) {\n\t\t\tnode[key] = attributes[key];\n\t\t} else {\n\t\t\tattr(node, key, attributes[key]);\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_svg_attributes(node, attributes) {\n\tfor (const key in attributes) {\n\t\tattr(node, key, attributes[key]);\n\t}\n}\n\n/**\n * @param {Record<string, unknown>} data_map\n * @returns {void}\n */\nexport function set_custom_element_data_map(node, data_map) {\n\tObject.keys(data_map).forEach((key) => {\n\t\tset_custom_element_data(node, key, data_map[key]);\n\t});\n}\n\n/**\n * @returns {void} */\nexport function set_custom_element_data(node, prop, value) {\n\tconst lower = prop.toLowerCase(); // for backwards compatibility with existing behavior we do lowercase first\n\tif (lower in node) {\n\t\tnode[lower] = typeof node[lower] === 'boolean' && value === '' ? true : value;\n\t} else if (prop in node) {\n\t\tnode[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n\t} else {\n\t\tattr(node, prop, value);\n\t}\n}\n\n/**\n * @param {string} tag\n */\nexport function set_dynamic_element_data(tag) {\n\treturn /-/.test(tag) ? set_custom_element_data_map : set_attributes;\n}\n\n/**\n * @returns {void}\n */\nexport function xlink_attr(node, attribute, value) {\n\tnode.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @returns {string}\n */\nexport function get_svelte_dataset(node) {\n\treturn node.dataset.svelteH;\n}\n\n/**\n * @returns {unknown[]} */\nexport function get_binding_group_value(group, __value, checked) {\n\tconst value = new Set();\n\tfor (let i = 0; i < group.length; i += 1) {\n\t\tif (group[i].checked) value.add(group[i].__value);\n\t}\n\tif (!checked) {\n\t\tvalue.delete(__value);\n\t}\n\treturn Array.from(value);\n}\n\n/**\n * @param {HTMLInputElement[]} group\n * @returns {{ p(...inputs: HTMLInputElement[]): void; r(): void; }}\n */\nexport function init_binding_group(group) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\treturn {\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\t_inputs.forEach((input) => group.push(input));\n\t\t},\n\t\t/* remove */ r() {\n\t\t\t_inputs.forEach((input) => group.splice(group.indexOf(input), 1));\n\t\t}\n\t};\n}\n\n/**\n * @param {number[]} indexes\n * @returns {{ u(new_indexes: number[]): void; p(...inputs: HTMLInputElement[]): void; r: () => void; }}\n */\nexport function init_binding_group_dynamic(group, indexes) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _group = get_binding_group(group);\n\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\n\tfunction get_binding_group(group) {\n\t\tfor (let i = 0; i < indexes.length; i++) {\n\t\t\tgroup = group[indexes[i]] = group[indexes[i]] || [];\n\t\t}\n\t\treturn group;\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction push() {\n\t\t_inputs.forEach((input) => _group.push(input));\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction remove() {\n\t\t_inputs.forEach((input) => _group.splice(_group.indexOf(input), 1));\n\t}\n\treturn {\n\t\t/* update */ u(new_indexes) {\n\t\t\tindexes = new_indexes;\n\t\t\tconst new_group = get_binding_group(group);\n\t\t\tif (new_group !== _group) {\n\t\t\t\tremove();\n\t\t\t\t_group = new_group;\n\t\t\t\tpush();\n\t\t\t}\n\t\t},\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\tpush();\n\t\t},\n\t\t/* remove */ r: remove\n\t};\n}\n\n/** @returns {number} */\nexport function to_number(value) {\n\treturn value === '' ? null : +value;\n}\n\n/** @returns {any[]} */\nexport function time_ranges_to_array(ranges) {\n\tconst array = [];\n\tfor (let i = 0; i < ranges.length; i += 1) {\n\t\tarray.push({ start: ranges.start(i), end: ranges.end(i) });\n\t}\n\treturn array;\n}\n\n/**\n * @param {Element} element\n * @returns {ChildNode[]}\n */\nexport function children(element) {\n\treturn Array.from(element.childNodes);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {void}\n */\nfunction init_claim_info(nodes) {\n\tif (nodes.claim_info === undefined) {\n\t\tnodes.claim_info = { last_index: 0, total_claimed: 0 };\n\t}\n}\n\n/**\n * @template {ChildNodeEx} R\n * @param {ChildNodeArray} nodes\n * @param {(node: ChildNodeEx) => node is R} predicate\n * @param {(node: ChildNodeEx) => ChildNodeEx | undefined} process_node\n * @param {() => R} create_node\n * @param {boolean} dont_update_last_index\n * @returns {R}\n */\nfunction claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) {\n\t// Try to find nodes in an order such that we lengthen the longest increasing subsequence\n\tinit_claim_info(nodes);\n\tconst result_node = (() => {\n\t\t// We first try to find an element after the previous one\n\t\tfor (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// Otherwise, we try to find one before\n\t\t// We iterate in reverse so that we don't go too far back\n\t\tfor (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t} else if (replacement === undefined) {\n\t\t\t\t\t// Since we spliced before the last_index, we decrease it\n\t\t\t\t\tnodes.claim_info.last_index--;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// If we can't find any matching node, we create a new one\n\t\treturn create_node();\n\t})();\n\tresult_node.claim_order = nodes.claim_info.total_claimed;\n\tnodes.claim_info.total_claimed += 1;\n\treturn result_node;\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @param {(name: string) => Element | SVGElement} create_element\n * @returns {Element | SVGElement}\n */\nfunction claim_element_base(nodes, name, attributes, create_element) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Element | SVGElement} */\n\t\t(node) => node.nodeName === name,\n\t\t/** @param {Element} node */\n\t\t(node) => {\n\t\t\tconst remove = [];\n\t\t\tfor (let j = 0; j < node.attributes.length; j++) {\n\t\t\t\tconst attribute = node.attributes[j];\n\t\t\t\tif (!attributes[attribute.name]) {\n\t\t\t\t\tremove.push(attribute.name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tremove.forEach((v) => node.removeAttribute(v));\n\t\t\treturn undefined;\n\t\t},\n\t\t() => create_element(name)\n\t);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_svg_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, svg_element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Text}\n */\nexport function claim_text(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Text} */\n\t\t(node) => node.nodeType === 3,\n\t\t/** @param {Text} node */\n\t\t(node) => {\n\t\t\tconst data_str = '' + data;\n\t\t\tif (node.data.startsWith(data_str)) {\n\t\t\t\tif (node.data.length !== data_str.length) {\n\t\t\t\t\treturn node.splitText(data_str.length);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode.data = data_str;\n\t\t\t}\n\t\t},\n\t\t() => text(data),\n\t\ttrue // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n\t);\n}\n\n/**\n * @returns {Text} */\nexport function claim_space(nodes) {\n\treturn claim_text(nodes, ' ');\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Comment}\n */\nexport function claim_comment(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Comment} */\n\t\t(node) => node.nodeType === 8,\n\t\t/** @param {Comment} node */\n\t\t(node) => {\n\t\t\tnode.data = '' + data;\n\t\t\treturn undefined;\n\t\t},\n\t\t() => comment(data),\n\t\ttrue\n\t);\n}\n\nfunction get_comment_idx(nodes, text, start) {\n\tfor (let i = start; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * @param {boolean} is_svg\n * @returns {HtmlTagHydration}\n */\nexport function claim_html_tag(nodes, is_svg) {\n\t// find html opening tag\n\tconst start_index = get_comment_idx(nodes, 'HTML_TAG_START', 0);\n\tconst end_index = get_comment_idx(nodes, 'HTML_TAG_END', start_index + 1);\n\tif (start_index === -1 || end_index === -1) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\n\tinit_claim_info(nodes);\n\tconst html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n\tdetach(html_tag_nodes[0]);\n\tdetach(html_tag_nodes[html_tag_nodes.length - 1]);\n\tconst claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n\tif (claimed_nodes.length === 0) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\tfor (const n of claimed_nodes) {\n\t\tn.claim_order = nodes.claim_info.total_claimed;\n\t\tnodes.claim_info.total_claimed += 1;\n\t}\n\treturn new HtmlTagHydration(is_svg, claimed_nodes);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data(text, data) {\n\tdata = '' + data;\n\tif (text.data === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data_contenteditable(text, data) {\n\tdata = '' + data;\n\tif (text.wholeText === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @param {string} attr_value\n * @returns {void}\n */\nexport function set_data_maybe_contenteditable(text, data, attr_value) {\n\tif (~contenteditable_truthy_values.indexOf(attr_value)) {\n\t\tset_data_contenteditable(text, data);\n\t} else {\n\t\tset_data(text, data);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_input_value(input, value) {\n\tinput.value = value == null ? '' : value;\n}\n\n/**\n * @returns {void} */\nexport function set_input_type(input, type) {\n\ttry {\n\t\tinput.type = type;\n\t} catch (e) {\n\t\t// do nothing\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_style(node, key, value, important) {\n\tif (value == null) {\n\t\tnode.style.removeProperty(key);\n\t} else {\n\t\tnode.style.setProperty(key, value, important ? 'important' : '');\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_option(select, value, mounting) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\tif (option.__value === value) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_options(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\toption.selected = ~value.indexOf(option.__value);\n\t}\n}\n\nexport function select_value(select) {\n\tconst selected_option = select.querySelector(':checked');\n\treturn selected_option && selected_option.__value;\n}\n\nexport function select_multiple_value(select) {\n\treturn [].map.call(select.querySelectorAll(':checked'), (option) => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\n\n/**\n * @type {boolean} */\nlet crossorigin;\n\n/**\n * @returns {boolean} */\nexport function is_crossorigin() {\n\tif (crossorigin === undefined) {\n\t\tcrossorigin = false;\n\t\ttry {\n\t\t\tif (typeof window !== 'undefined' && window.parent) {\n\t\t\t\tvoid window.parent.document;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tcrossorigin = true;\n\t\t}\n\t}\n\treturn crossorigin;\n}\n\n/**\n * @param {HTMLElement} node\n * @param {() => void} fn\n * @returns {() => void}\n */\nexport function add_iframe_resize_listener(node, fn) {\n\tconst computed_style = getComputedStyle(node);\n\tif (computed_style.position === 'static') {\n\t\tnode.style.position = 'relative';\n\t}\n\tconst iframe = element('iframe');\n\tiframe.setAttribute(\n\t\t'style',\n\t\t'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n\t\t\t'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;'\n\t);\n\tiframe.setAttribute('aria-hidden', 'true');\n\tiframe.tabIndex = -1;\n\tconst crossorigin = is_crossorigin();\n\n\t/**\n\t * @type {() => void}\n\t */\n\tlet unsubscribe;\n\tif (crossorigin) {\n\t\tiframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n\t\tunsubscribe = listen(\n\t\t\twindow,\n\t\t\t'message',\n\t\t\t/** @param {MessageEvent} event */ (event) => {\n\t\t\t\tif (event.source === iframe.contentWindow) fn();\n\t\t\t}\n\t\t);\n\t} else {\n\t\tiframe.src = 'about:blank';\n\t\tiframe.onload = () => {\n\t\t\tunsubscribe = listen(iframe.contentWindow, 'resize', fn);\n\t\t\t// make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n\t\t\t// see https://github.com/sveltejs/svelte/issues/4233\n\t\t\tfn();\n\t\t};\n\t}\n\tappend(node, iframe);\n\treturn () => {\n\t\tif (crossorigin) {\n\t\t\tunsubscribe();\n\t\t} else if (unsubscribe && iframe.contentWindow) {\n\t\t\tunsubscribe();\n\t\t}\n\t\tdetach(iframe);\n\t};\n}\nexport const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'content-box'\n});\nexport const resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'border-box'\n});\nexport const resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton(\n\t{ box: 'device-pixel-content-box' }\n);\nexport { ResizeObserverSingleton };\n\n/**\n * @returns {void} */\nexport function toggle_class(element, name, toggle) {\n\t// The `!!` is required because an `undefined` flag means flipping the current state.\n\telement.classList.toggle(name, !!toggle);\n}\n\n/**\n * @template T\n * @param {string} type\n * @param {T} [detail]\n * @param {{ bubbles?: boolean, cancelable?: boolean }} [options]\n * @returns {CustomEvent<T>}\n */\nexport function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * @param {string} selector\n * @param {HTMLElement} parent\n * @returns {ChildNodeArray}\n */\nexport function query_selector_all(selector, parent = document.body) {\n\treturn Array.from(parent.querySelectorAll(selector));\n}\n\n/**\n * @param {string} nodeId\n * @param {HTMLElement} head\n * @returns {any[]}\n */\nexport function head_selector(nodeId, head) {\n\tconst result = [];\n\tlet started = 0;\n\tfor (const node of head.childNodes) {\n\t\tif (node.nodeType === 8 /* comment node */) {\n\t\t\tconst comment = node.textContent.trim();\n\t\t\tif (comment === `HEAD_${nodeId}_END`) {\n\t\t\t\tstarted -= 1;\n\t\t\t\tresult.push(node);\n\t\t\t} else if (comment === `HEAD_${nodeId}_START`) {\n\t\t\t\tstarted += 1;\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t} else if (started > 0) {\n\t\t\tresult.push(node);\n\t\t}\n\t}\n\treturn result;\n}\n/** */\nexport class HtmlTag {\n\t/**\n\t * @private\n\t * @default false\n\t */\n\tis_svg = false;\n\t/** parent for creating node */\n\te = undefined;\n\t/** html tag nodes */\n\tn = undefined;\n\t/** target */\n\tt = undefined;\n\t/** anchor */\n\ta = undefined;\n\tconstructor(is_svg = false) {\n\t\tthis.is_svg = is_svg;\n\t\tthis.e = this.n = null;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tthis.h(html);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @param {HTMLElement | SVGElement} target\n\t * @param {HTMLElement | SVGElement} anchor\n\t * @returns {void}\n\t */\n\tm(html, target, anchor = null) {\n\t\tif (!this.e) {\n\t\t\tif (this.is_svg)\n\t\t\t\tthis.e = svg_element(/** @type {keyof SVGElementTagNameMap} */ (target.nodeName));\n\t\t\t/** #7364  target for <template> may be provided as #document-fragment(11) */ else\n\t\t\t\tthis.e = element(\n\t\t\t\t\t/** @type {keyof HTMLElementTagNameMap} */ (\n\t\t\t\t\t\ttarget.nodeType === 11 ? 'TEMPLATE' : target.nodeName\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tthis.t =\n\t\t\t\ttarget.tagName !== 'TEMPLATE'\n\t\t\t\t\t? target\n\t\t\t\t\t: /** @type {HTMLTemplateElement} */ (target).content;\n\t\t\tthis.c(html);\n\t\t}\n\t\tthis.i(anchor);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\th(html) {\n\t\tthis.e.innerHTML = html;\n\t\tthis.n = Array.from(\n\t\t\tthis.e.nodeName === 'TEMPLATE' ? this.e.content.childNodes : this.e.childNodes\n\t\t);\n\t}\n\n\t/**\n\t * @returns {void} */\n\ti(anchor) {\n\t\tfor (let i = 0; i < this.n.length; i += 1) {\n\t\t\tinsert(this.t, this.n[i], anchor);\n\t\t}\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tp(html) {\n\t\tthis.d();\n\t\tthis.h(html);\n\t\tthis.i(this.a);\n\t}\n\n\t/**\n\t * @returns {void} */\n\td() {\n\t\tthis.n.forEach(detach);\n\t}\n}\n\nexport class HtmlTagHydration extends HtmlTag {\n\t/** @type {Element[]} hydration claimed nodes */\n\tl = undefined;\n\n\tconstructor(is_svg = false, claimed_nodes) {\n\t\tsuper(is_svg);\n\t\tthis.e = this.n = null;\n\t\tthis.l = claimed_nodes;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tif (this.l) {\n\t\t\tthis.n = this.l;\n\t\t} else {\n\t\t\tsuper.c(html);\n\t\t}\n\t}\n\n\t/**\n\t * @returns {void} */\n\ti(anchor) {\n\t\tfor (let i = 0; i < this.n.length; i += 1) {\n\t\t\tinsert_hydration(this.t, this.n[i], anchor);\n\t\t}\n\t}\n}\n\n/**\n * @param {NamedNodeMap} attributes\n * @returns {{}}\n */\nexport function attribute_to_object(attributes) {\n\tconst result = {};\n\tfor (const attribute of attributes) {\n\t\tresult[attribute.name] = attribute.value;\n\t}\n\treturn result;\n}\n\nconst escaped = {\n\t'\"': '&quot;',\n\t'&': '&amp;',\n\t'<': '&lt;'\n};\n\nconst regex_attribute_characters_to_escape = /[\"&<]/g;\n\n/**\n * Note that the attribute itself should be surrounded in double quotes\n * @param {any} attribute\n */\nfunction escape_attribute(attribute) {\n\treturn String(attribute).replace(regex_attribute_characters_to_escape, (match) => escaped[match]);\n}\n\n/**\n * @param {Record<string, string>} attributes\n */\nexport function stringify_spread(attributes) {\n\tlet str = ' ';\n\tfor (const key in attributes) {\n\t\tif (attributes[key] != null) {\n\t\t\tstr += `${key}=\"${escape_attribute(attributes[key])}\" `;\n\t\t}\n\t}\n\n\treturn str;\n}\n\n/**\n * @param {HTMLElement} element\n * @returns {{}}\n */\nexport function get_custom_elements_slots(element) {\n\tconst result = {};\n\telement.childNodes.forEach(\n\t\t/** @param {Element} node */ (node) => {\n\t\t\tresult[node.slot || 'default'] = true;\n\t\t}\n\t);\n\treturn result;\n}\n\nexport function construct_svelte_component(component, props) {\n\treturn new component(props);\n}\n\n/**\n * @typedef {Node & {\n * \tclaim_order?: number;\n * \thydrate_init?: true;\n * \tactual_end_child?: NodeEx;\n * \tchildNodes: NodeListOf<NodeEx>;\n * }} NodeEx\n */\n\n/** @typedef {ChildNode & NodeEx} ChildNodeEx */\n\n/** @typedef {NodeEx & { claim_order: number }} NodeEx2 */\n\n/**\n * @typedef {ChildNodeEx[] & {\n * \tclaim_info?: {\n * \t\tlast_index: number;\n * \t\ttotal_claimed: number;\n * \t};\n * }} ChildNodeArray\n */\n","import { append_empty_stylesheet, detach, get_root_for_style } from './dom.js';\nimport { raf } from './environment.js';\n\n// we need to store the information for multiple documents because a Svelte application could also contain iframes\n// https://github.com/sveltejs/svelte/issues/3624\n/** @type {Map<Document | ShadowRoot, import('./private.d.ts').StyleInformation>} */\nconst managed_styles = new Map();\n\nlet active = 0;\n\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\n/**\n * @param {string} str\n * @returns {number}\n */\nfunction hash(str) {\n\tlet hash = 5381;\n\tlet i = str.length;\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn hash >>> 0;\n}\n\n/**\n * @param {Document | ShadowRoot} doc\n * @param {Element & ElementCSSInlineStyle} node\n * @returns {{ stylesheet: any; rules: {}; }}\n */\nfunction create_style_information(doc, node) {\n\tconst info = { stylesheet: append_empty_stylesheet(node), rules: {} };\n\tmanaged_styles.set(doc, info);\n\treturn info;\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {number} a\n * @param {number} b\n * @param {number} duration\n * @param {number} delay\n * @param {(t: number) => number} ease\n * @param {(t: number, u: number) => string} fn\n * @param {number} uid\n * @returns {string}\n */\nexport function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n\tconst step = 16.666 / duration;\n\tlet keyframes = '{\\n';\n\tfor (let p = 0; p <= 1; p += step) {\n\t\tconst t = a + (b - a) * ease(p);\n\t\tkeyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n\t}\n\tconst rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n\tconst name = `__svelte_${hash(rule)}_${uid}`;\n\tconst doc = get_root_for_style(node);\n\tconst { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node);\n\tif (!rules[name]) {\n\t\trules[name] = true;\n\t\tstylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n\t}\n\tconst animation = node.style.animation || '';\n\tnode.style.animation = `${\n\t\tanimation ? `${animation}, ` : ''\n\t}${name} ${duration}ms linear ${delay}ms 1 both`;\n\tactive += 1;\n\treturn name;\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {string} [name]\n * @returns {void}\n */\nexport function delete_rule(node, name) {\n\tconst previous = (node.style.animation || '').split(', ');\n\tconst next = previous.filter(\n\t\tname\n\t\t\t? (anim) => anim.indexOf(name) < 0 // remove specific animation\n\t\t\t: (anim) => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n\t);\n\tconst deleted = previous.length - next.length;\n\tif (deleted) {\n\t\tnode.style.animation = next.join(', ');\n\t\tactive -= deleted;\n\t\tif (!active) clear_rules();\n\t}\n}\n\n/** @returns {void} */\nexport function clear_rules() {\n\traf(() => {\n\t\tif (active) return;\n\t\tmanaged_styles.forEach((info) => {\n\t\t\tconst { ownerNode } = info.stylesheet;\n\t\t\t// there is no ownerNode if it runs on jsdom.\n\t\t\tif (ownerNode) detach(ownerNode);\n\t\t});\n\t\tmanaged_styles.clear();\n\t});\n}\n","import { custom_event } from './dom.js';\n\nexport let current_component;\n\n/** @returns {void} */\nexport function set_current_component(component) {\n\tcurrent_component = component;\n}\n\nexport function get_current_component() {\n\tif (!current_component) throw new Error('Function called outside component initialization');\n\treturn current_component;\n}\n\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#beforeupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function beforeUpdate(fn) {\n\tget_current_component().$$.before_update.push(fn);\n}\n\n/**\n * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.\n * It must be called during the component's initialisation (but doesn't need to live *inside* the component;\n * it can be called from an external module).\n *\n * If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted.\n *\n * `onMount` does not run inside a [server-side component](https://svelte.dev/docs#run-time-server-side-component-api).\n *\n * https://svelte.dev/docs/svelte#onmount\n * @template T\n * @param {() => import('./private.js').NotFunction<T> | Promise<import('./private.js').NotFunction<T>> | (() => any)} fn\n * @returns {void}\n */\nexport function onMount(fn) {\n\tget_current_component().$$.on_mount.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#afterupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function afterUpdate(fn) {\n\tget_current_component().$$.after_update.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * https://svelte.dev/docs/svelte#ondestroy\n * @param {() => any} fn\n * @returns {void}\n */\nexport function onDestroy(fn) {\n\tget_current_component().$$.on_destroy.push(fn);\n}\n\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs#template-syntax-component-directives-on-eventname).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:\n * ```ts\n * const dispatch = createEventDispatcher<{\n *  loaded: never; // does not take a detail argument\n *  change: string; // takes a detail argument of type string, which is required\n *  optional: number | null; // takes an optional detail argument of type number\n * }>();\n * ```\n *\n * https://svelte.dev/docs/svelte#createeventdispatcher\n * @template {Record<string, any>} [EventMap=any]\n * @returns {import('./public.js').EventDispatcher<EventMap>}\n */\nexport function createEventDispatcher() {\n\tconst component = get_current_component();\n\treturn (type, detail, { cancelable = false } = {}) => {\n\t\tconst callbacks = component.$$.callbacks[type];\n\t\tif (callbacks) {\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = custom_event(/** @type {string} */ (type), detail, { cancelable });\n\t\t\tcallbacks.slice().forEach((fn) => {\n\t\t\t\tfn.call(component, event);\n\t\t\t});\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\t\treturn true;\n\t};\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#setcontext\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tget_current_component().$$.context.set(key, context);\n\treturn context;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#getcontext\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\treturn get_current_component().$$.context.get(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * https://svelte.dev/docs/svelte#getallcontexts\n * @template {Map<any, any>} [T=Map<any, any>]\n * @returns {T}\n */\nexport function getAllContexts() {\n\treturn get_current_component().$$.context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#hascontext\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\treturn get_current_component().$$.context.has(key);\n}\n\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\n/**\n * @param component\n * @param event\n * @returns {void}\n */\nexport function bubble(component, event) {\n\tconst callbacks = component.$$.callbacks[event.type];\n\tif (callbacks) {\n\t\t// @ts-ignore\n\t\tcallbacks.slice().forEach((fn) => fn.call(this, event));\n\t}\n}\n","import { run_all } from './utils.js';\nimport { current_component, set_current_component } from './lifecycle.js';\n\nexport const dirty_components = [];\nexport const intros = { enabled: false };\nexport const binding_callbacks = [];\n\nlet render_callbacks = [];\n\nconst flush_callbacks = [];\n\nconst resolved_promise = /* @__PURE__ */ Promise.resolve();\n\nlet update_scheduled = false;\n\n/** @returns {void} */\nexport function schedule_update() {\n\tif (!update_scheduled) {\n\t\tupdate_scheduled = true;\n\t\tresolved_promise.then(flush);\n\t}\n}\n\n/** @returns {Promise<void>} */\nexport function tick() {\n\tschedule_update();\n\treturn resolved_promise;\n}\n\n/** @returns {void} */\nexport function add_render_callback(fn) {\n\trender_callbacks.push(fn);\n}\n\n/** @returns {void} */\nexport function add_flush_callback(fn) {\n\tflush_callbacks.push(fn);\n}\n\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n//    for afterUpdates called during the initial onMount, which are called in\n//    reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n//    dirty_components array and will cause a reentrant call to flush(). Because\n//    the flush index is kept outside the function, the reentrant call will pick\n//    up where the earlier call left off and go through all dirty components. The\n//    current_component value is saved and restored so that the reentrant call will\n//    not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n//    callback called a second time; the seen_callbacks set, outside the flush()\n//    function, guarantees this behavior.\nconst seen_callbacks = new Set();\n\nlet flushidx = 0; // Do *not* move this inside the flush() function\n\n/** @returns {void} */\nexport function flush() {\n\t// Do not reenter flush while dirty components are updated, as this can\n\t// result in an infinite loop. Instead, let the inner flush handle it.\n\t// Reentrancy is ok afterwards for bindings etc.\n\tif (flushidx !== 0) {\n\t\treturn;\n\t}\n\tconst saved_component = current_component;\n\tdo {\n\t\t// first, call beforeUpdate functions\n\t\t// and update components\n\t\ttry {\n\t\t\twhile (flushidx < dirty_components.length) {\n\t\t\t\tconst component = dirty_components[flushidx];\n\t\t\t\tflushidx++;\n\t\t\t\tset_current_component(component);\n\t\t\t\tupdate(component.$$);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// reset dirty state to not end up in a deadlocked state and then rethrow\n\t\t\tdirty_components.length = 0;\n\t\t\tflushidx = 0;\n\t\t\tthrow e;\n\t\t}\n\t\tset_current_component(null);\n\t\tdirty_components.length = 0;\n\t\tflushidx = 0;\n\t\twhile (binding_callbacks.length) binding_callbacks.pop()();\n\t\t// then, once components are updated, call\n\t\t// afterUpdate functions. This may cause\n\t\t// subsequent updates...\n\t\tfor (let i = 0; i < render_callbacks.length; i += 1) {\n\t\t\tconst callback = render_callbacks[i];\n\t\t\tif (!seen_callbacks.has(callback)) {\n\t\t\t\t// ...so guard against infinite loops\n\t\t\t\tseen_callbacks.add(callback);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\t\trender_callbacks.length = 0;\n\t} while (dirty_components.length);\n\twhile (flush_callbacks.length) {\n\t\tflush_callbacks.pop()();\n\t}\n\tupdate_scheduled = false;\n\tseen_callbacks.clear();\n\tset_current_component(saved_component);\n}\n\n/** @returns {void} */\nfunction update($$) {\n\tif ($$.fragment !== null) {\n\t\t$$.update();\n\t\trun_all($$.before_update);\n\t\tconst dirty = $$.dirty;\n\t\t$$.dirty = [-1];\n\t\t$$.fragment && $$.fragment.p($$.ctx, dirty);\n\t\t$$.after_update.forEach(add_render_callback);\n\t}\n}\n\n/**\n * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function flush_render_callbacks(fns) {\n\tconst filtered = [];\n\tconst targets = [];\n\trender_callbacks.forEach((c) => (fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)));\n\ttargets.forEach((c) => c());\n\trender_callbacks = filtered;\n}\n","import { identity as linear, is_function, noop, run_all } from './utils.js';\nimport { now } from './environment.js';\nimport { loop } from './loop.js';\nimport { create_rule, delete_rule } from './style_manager.js';\nimport { custom_event } from './dom.js';\nimport { add_render_callback } from './scheduler.js';\n\n/**\n * @type {Promise<void> | null}\n */\nlet promise;\n\n/**\n * @returns {Promise<void>}\n */\nfunction wait() {\n\tif (!promise) {\n\t\tpromise = Promise.resolve();\n\t\tpromise.then(() => {\n\t\t\tpromise = null;\n\t\t});\n\t}\n\treturn promise;\n}\n\n/**\n * @param {Element} node\n * @param {INTRO | OUTRO | boolean} direction\n * @param {'start' | 'end'} kind\n * @returns {void}\n */\nfunction dispatch(node, direction, kind) {\n\tnode.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\n\nconst outroing = new Set();\n\n/**\n * @type {Outro}\n */\nlet outros;\n\n/**\n * @returns {void} */\nexport function group_outros() {\n\toutros = {\n\t\tr: 0,\n\t\tc: [],\n\t\tp: outros // parent group\n\t};\n}\n\n/**\n * @returns {void} */\nexport function check_outros() {\n\tif (!outros.r) {\n\t\trun_all(outros.c);\n\t}\n\toutros = outros.p;\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} [local]\n * @returns {void}\n */\nexport function transition_in(block, local) {\n\tif (block && block.i) {\n\t\toutroing.delete(block);\n\t\tblock.i(local);\n\t}\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} local\n * @param {0 | 1} [detach]\n * @param {() => void} [callback]\n * @returns {void}\n */\nexport function transition_out(block, local, detach, callback) {\n\tif (block && block.o) {\n\t\tif (outroing.has(block)) return;\n\t\toutroing.add(block);\n\t\toutros.c.push(() => {\n\t\t\toutroing.delete(block);\n\t\t\tif (callback) {\n\t\t\t\tif (detach) block.d(1);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t});\n\t\tblock.o(local);\n\t} else if (callback) {\n\t\tcallback();\n\t}\n}\n\n/**\n * @type {import('../transition/public.js').TransitionConfig}\n */\nconst null_transition = { duration: 0 };\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ start(): void; invalidate(): void; end(): void; }}\n */\nexport function create_in_transition(node, fn, params) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'in' };\n\tlet config = fn(node, params, options);\n\tlet running = false;\n\tlet animation_name;\n\tlet task;\n\tlet uid = 0;\n\n\t/**\n\t * @returns {void} */\n\tfunction cleanup() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\t\tif (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n\t\ttick(0, 1);\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tif (task) task.abort();\n\t\trunning = true;\n\t\tadd_render_callback(() => dispatch(node, true, 'start'));\n\t\ttask = loop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(1, 0);\n\t\t\t\t\tdispatch(node, true, 'end');\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn (running = false);\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\tlet started = false;\n\treturn {\n\t\tstart() {\n\t\t\tif (started) return;\n\t\t\tstarted = true;\n\t\t\tdelete_rule(node);\n\t\t\tif (is_function(config)) {\n\t\t\t\tconfig = config(options);\n\t\t\t\twait().then(go);\n\t\t\t} else {\n\t\t\t\tgo();\n\t\t\t}\n\t\t},\n\t\tinvalidate() {\n\t\t\tstarted = false;\n\t\t},\n\t\tend() {\n\t\t\tif (running) {\n\t\t\t\tcleanup();\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ end(reset: any): void; }}\n */\nexport function create_out_transition(node, fn, params) {\n\t/** @type {TransitionOptions} */\n\tconst options = { direction: 'out' };\n\tlet config = fn(node, params, options);\n\tlet running = true;\n\tlet animation_name;\n\tconst group = outros;\n\tgroup.r += 1;\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\tif (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tadd_render_callback(() => dispatch(node, false, 'start'));\n\n\t\tif ('inert' in node) {\n\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\tnode.inert = true;\n\t\t}\n\n\t\tloop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(0, 1);\n\t\t\t\t\tdispatch(node, false, 'end');\n\t\t\t\t\tif (!--group.r) {\n\t\t\t\t\t\t// this will result in `end()` being called,\n\t\t\t\t\t\t// so we don't need to clean up here\n\t\t\t\t\t\trun_all(group.c);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(1 - t, t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\n\tif (is_function(config)) {\n\t\twait().then(() => {\n\t\t\t// @ts-ignore\n\t\t\tconfig = config(options);\n\t\t\tgo();\n\t\t});\n\t} else {\n\t\tgo();\n\t}\n\n\treturn {\n\t\tend(reset) {\n\t\t\tif (reset && 'inert' in node) {\n\t\t\t\tnode.inert = original_inert_value;\n\t\t\t}\n\t\t\tif (reset && config.tick) {\n\t\t\t\tconfig.tick(1, 0);\n\t\t\t}\n\t\t\tif (running) {\n\t\t\t\tif (animation_name) delete_rule(node, animation_name);\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @param {boolean} intro\n * @returns {{ run(b: 0 | 1): void; end(): void; }}\n */\nexport function create_bidirectional_transition(node, fn, params, intro) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'both' };\n\tlet config = fn(node, params, options);\n\tlet t = intro ? 0 : 1;\n\n\t/**\n\t * @type {Program | null} */\n\tlet running_program = null;\n\n\t/**\n\t * @type {PendingProgram | null} */\n\tlet pending_program = null;\n\tlet animation_name = null;\n\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction clear_animation() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @param {PendingProgram} program\n\t * @param {number} duration\n\t * @returns {Program}\n\t */\n\tfunction init(program, duration) {\n\t\tconst d = /** @type {Program['d']} */ (program.b - t);\n\t\tduration *= Math.abs(d);\n\t\treturn {\n\t\t\ta: t,\n\t\t\tb: program.b,\n\t\t\td,\n\t\t\tduration,\n\t\t\tstart: program.start,\n\t\t\tend: program.start + duration,\n\t\t\tgroup: program.group\n\t\t};\n\t}\n\n\t/**\n\t * @param {INTRO | OUTRO} b\n\t * @returns {void}\n\t */\n\tfunction go(b) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\t/**\n\t\t * @type {PendingProgram} */\n\t\tconst program = {\n\t\t\tstart: now() + delay,\n\t\t\tb\n\t\t};\n\n\t\tif (!b) {\n\t\t\t// @ts-ignore todo: improve typings\n\t\t\tprogram.group = outros;\n\t\t\toutros.r += 1;\n\t\t}\n\n\t\tif ('inert' in node) {\n\t\t\tif (b) {\n\t\t\t\tif (original_inert_value !== undefined) {\n\t\t\t\t\t// aborted/reversed outro — restore previous inert value\n\t\t\t\t\tnode.inert = original_inert_value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\t\tnode.inert = true;\n\t\t\t}\n\t\t}\n\n\t\tif (running_program || pending_program) {\n\t\t\tpending_program = program;\n\t\t} else {\n\t\t\t// if this is an intro, and there's a delay, we need to do\n\t\t\t// an initial tick and/or apply CSS animation immediately\n\t\t\tif (css) {\n\t\t\t\tclear_animation();\n\t\t\t\tanimation_name = create_rule(node, t, b, duration, delay, easing, css);\n\t\t\t}\n\t\t\tif (b) tick(0, 1);\n\t\t\trunning_program = init(program, duration);\n\t\t\tadd_render_callback(() => dispatch(node, b, 'start'));\n\t\t\tloop((now) => {\n\t\t\t\tif (pending_program && now > pending_program.start) {\n\t\t\t\t\trunning_program = init(pending_program, duration);\n\t\t\t\t\tpending_program = null;\n\t\t\t\t\tdispatch(node, running_program.b, 'start');\n\t\t\t\t\tif (css) {\n\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\tanimation_name = create_rule(\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tt,\n\t\t\t\t\t\t\trunning_program.b,\n\t\t\t\t\t\t\trunning_program.duration,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\teasing,\n\t\t\t\t\t\t\tconfig.css\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (running_program) {\n\t\t\t\t\tif (now >= running_program.end) {\n\t\t\t\t\t\ttick((t = running_program.b), 1 - t);\n\t\t\t\t\t\tdispatch(node, running_program.b, 'end');\n\t\t\t\t\t\tif (!pending_program) {\n\t\t\t\t\t\t\t// we're done\n\t\t\t\t\t\t\tif (running_program.b) {\n\t\t\t\t\t\t\t\t// intro — we can tidy up immediately\n\t\t\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// outro — needs to be coordinated\n\t\t\t\t\t\t\t\tif (!--running_program.group.r) run_all(running_program.group.c);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trunning_program = null;\n\t\t\t\t\t} else if (now >= running_program.start) {\n\t\t\t\t\t\tconst p = now - running_program.start;\n\t\t\t\t\t\tt = running_program.a + running_program.d * easing(p / running_program.duration);\n\t\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn !!(running_program || pending_program);\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\trun(b) {\n\t\t\tif (is_function(config)) {\n\t\t\t\twait().then(() => {\n\t\t\t\t\tconst opts = { direction: b ? 'in' : 'out' };\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tconfig = config(opts);\n\t\t\t\t\tgo(b);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgo(b);\n\t\t\t}\n\t\t},\n\t\tend() {\n\t\t\tclear_animation();\n\t\t\trunning_program = pending_program = null;\n\t\t}\n\t};\n}\n\n/** @typedef {1} INTRO */\n/** @typedef {0} OUTRO */\n/** @typedef {{ direction: 'in' | 'out' | 'both' }} TransitionOptions */\n/** @typedef {(node: Element, params: any, options: TransitionOptions) => import('../transition/public.js').TransitionConfig} TransitionFn */\n\n/**\n * @typedef {Object} Outro\n * @property {number} r\n * @property {Function[]} c\n * @property {Object} p\n */\n\n/**\n * @typedef {Object} PendingProgram\n * @property {number} start\n * @property {INTRO|OUTRO} b\n * @property {Outro} [group]\n */\n\n/**\n * @typedef {Object} Program\n * @property {number} a\n * @property {INTRO|OUTRO} b\n * @property {1|-1} d\n * @property {number} duration\n * @property {number} start\n * @property {number} end\n * @property {Outro} [group]\n */\n","import { transition_in, transition_out } from './transitions.js';\nimport { run_all } from './utils.js';\n\n// general each functions:\n\nexport function ensure_array_like(array_like_or_iterator) {\n\treturn array_like_or_iterator?.length !== undefined\n\t\t? array_like_or_iterator\n\t\t: Array.from(array_like_or_iterator);\n}\n\n// keyed each functions:\n\n/** @returns {void} */\nexport function destroy_block(block, lookup) {\n\tblock.d(1);\n\tlookup.delete(block.key);\n}\n\n/** @returns {void} */\nexport function outro_and_destroy_block(block, lookup) {\n\ttransition_out(block, 1, 1, () => {\n\t\tlookup.delete(block.key);\n\t});\n}\n\n/** @returns {void} */\nexport function fix_and_destroy_block(block, lookup) {\n\tblock.f();\n\tdestroy_block(block, lookup);\n}\n\n/** @returns {void} */\nexport function fix_and_outro_and_destroy_block(block, lookup) {\n\tblock.f();\n\toutro_and_destroy_block(block, lookup);\n}\n\n/** @returns {any[]} */\nexport function update_keyed_each(\n\told_blocks,\n\tdirty,\n\tget_key,\n\tdynamic,\n\tctx,\n\tlist,\n\tlookup,\n\tnode,\n\tdestroy,\n\tcreate_each_block,\n\tnext,\n\tget_context\n) {\n\tlet o = old_blocks.length;\n\tlet n = list.length;\n\tlet i = o;\n\tconst old_indexes = {};\n\twhile (i--) old_indexes[old_blocks[i].key] = i;\n\tconst new_blocks = [];\n\tconst new_lookup = new Map();\n\tconst deltas = new Map();\n\tconst updates = [];\n\ti = n;\n\twhile (i--) {\n\t\tconst child_ctx = get_context(ctx, list, i);\n\t\tconst key = get_key(child_ctx);\n\t\tlet block = lookup.get(key);\n\t\tif (!block) {\n\t\t\tblock = create_each_block(key, child_ctx);\n\t\t\tblock.c();\n\t\t} else if (dynamic) {\n\t\t\t// defer updates until all the DOM shuffling is done\n\t\t\tupdates.push(() => block.p(child_ctx, dirty));\n\t\t}\n\t\tnew_lookup.set(key, (new_blocks[i] = block));\n\t\tif (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key]));\n\t}\n\tconst will_move = new Set();\n\tconst did_move = new Set();\n\t/** @returns {void} */\n\tfunction insert(block) {\n\t\ttransition_in(block, 1);\n\t\tblock.m(node, next);\n\t\tlookup.set(block.key, block);\n\t\tnext = block.first;\n\t\tn--;\n\t}\n\twhile (o && n) {\n\t\tconst new_block = new_blocks[n - 1];\n\t\tconst old_block = old_blocks[o - 1];\n\t\tconst new_key = new_block.key;\n\t\tconst old_key = old_block.key;\n\t\tif (new_block === old_block) {\n\t\t\t// do nothing\n\t\t\tnext = new_block.first;\n\t\t\to--;\n\t\t\tn--;\n\t\t} else if (!new_lookup.has(old_key)) {\n\t\t\t// remove old block\n\t\t\tdestroy(old_block, lookup);\n\t\t\to--;\n\t\t} else if (!lookup.has(new_key) || will_move.has(new_key)) {\n\t\t\tinsert(new_block);\n\t\t} else if (did_move.has(old_key)) {\n\t\t\to--;\n\t\t} else if (deltas.get(new_key) > deltas.get(old_key)) {\n\t\t\tdid_move.add(new_key);\n\t\t\tinsert(new_block);\n\t\t} else {\n\t\t\twill_move.add(old_key);\n\t\t\to--;\n\t\t}\n\t}\n\twhile (o--) {\n\t\tconst old_block = old_blocks[o];\n\t\tif (!new_lookup.has(old_block.key)) destroy(old_block, lookup);\n\t}\n\twhile (n) insert(new_blocks[n - 1]);\n\trun_all(updates);\n\treturn new_blocks;\n}\n\n/** @returns {void} */\nexport function validate_each_keys(ctx, list, get_context, get_key) {\n\tconst keys = new Map();\n\tfor (let i = 0; i < list.length; i++) {\n\t\tconst key = get_key(get_context(ctx, list, i));\n\t\tif (keys.has(key)) {\n\t\t\tlet value = '';\n\t\t\ttry {\n\t\t\t\tvalue = `with value '${String(key)}' `;\n\t\t\t} catch (e) {\n\t\t\t\t// can't stringify\n\t\t\t}\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot have duplicate keys in a keyed each: Keys at index ${keys.get(\n\t\t\t\t\tkey\n\t\t\t\t)} and ${i} ${value}are duplicates`\n\t\t\t);\n\t\t}\n\t\tkeys.set(key, i);\n\t}\n}\n","/** @returns {{}} */\nexport function get_spread_update(levels, updates) {\n\tconst update = {};\n\tconst to_null_out = {};\n\tconst accounted_for = { $$scope: 1 };\n\tlet i = levels.length;\n\twhile (i--) {\n\t\tconst o = levels[i];\n\t\tconst n = updates[i];\n\t\tif (n) {\n\t\t\tfor (const key in o) {\n\t\t\t\tif (!(key in n)) to_null_out[key] = 1;\n\t\t\t}\n\t\t\tfor (const key in n) {\n\t\t\t\tif (!accounted_for[key]) {\n\t\t\t\t\tupdate[key] = n[key];\n\t\t\t\t\taccounted_for[key] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlevels[i] = n;\n\t\t} else {\n\t\t\tfor (const key in o) {\n\t\t\t\taccounted_for[key] = 1;\n\t\t\t}\n\t\t}\n\t}\n\tfor (const key in to_null_out) {\n\t\tif (!(key in update)) update[key] = undefined;\n\t}\n\treturn update;\n}\n\nexport function get_spread_object(spread_props) {\n\treturn typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n","import {\n\tadd_render_callback,\n\tflush,\n\tflush_render_callbacks,\n\tschedule_update,\n\tdirty_components\n} from './scheduler.js';\nimport { current_component, set_current_component } from './lifecycle.js';\nimport { blank_object, is_empty, is_function, run, run_all, noop } from './utils.js';\nimport {\n\tchildren,\n\tdetach,\n\tstart_hydrating,\n\tend_hydrating,\n\tget_custom_elements_slots,\n\tinsert,\n\telement,\n\tattr\n} from './dom.js';\nimport { transition_in } from './transitions.js';\n\n/** @returns {void} */\nexport function bind(component, name, callback) {\n\tconst index = component.$$.props[name];\n\tif (index !== undefined) {\n\t\tcomponent.$$.bound[index] = callback;\n\t\tcallback(component.$$.ctx[index]);\n\t}\n}\n\n/** @returns {void} */\nexport function create_component(block) {\n\tblock && block.c();\n}\n\n/** @returns {void} */\nexport function claim_component(block, parent_nodes) {\n\tblock && block.l(parent_nodes);\n}\n\n/** @returns {void} */\nexport function mount_component(component, target, anchor) {\n\tconst { fragment, after_update } = component.$$;\n\tfragment && fragment.m(target, anchor);\n\t// onMount happens before the initial afterUpdate\n\tadd_render_callback(() => {\n\t\tconst new_on_destroy = component.$$.on_mount.map(run).filter(is_function);\n\t\t// if the component was destroyed immediately\n\t\t// it will update the `$$.on_destroy` reference to `null`.\n\t\t// the destructured on_destroy may still reference to the old array\n\t\tif (component.$$.on_destroy) {\n\t\t\tcomponent.$$.on_destroy.push(...new_on_destroy);\n\t\t} else {\n\t\t\t// Edge case - component was destroyed immediately,\n\t\t\t// most likely as a result of a binding initialising\n\t\t\trun_all(new_on_destroy);\n\t\t}\n\t\tcomponent.$$.on_mount = [];\n\t});\n\tafter_update.forEach(add_render_callback);\n}\n\n/** @returns {void} */\nexport function destroy_component(component, detaching) {\n\tconst $$ = component.$$;\n\tif ($$.fragment !== null) {\n\t\tflush_render_callbacks($$.after_update);\n\t\trun_all($$.on_destroy);\n\t\t$$.fragment && $$.fragment.d(detaching);\n\t\t// TODO null out other refs, including component.$$ (but need to\n\t\t// preserve final state?)\n\t\t$$.on_destroy = $$.fragment = null;\n\t\t$$.ctx = [];\n\t}\n}\n\n/** @returns {void} */\nfunction make_dirty(component, i) {\n\tif (component.$$.dirty[0] === -1) {\n\t\tdirty_components.push(component);\n\t\tschedule_update();\n\t\tcomponent.$$.dirty.fill(0);\n\t}\n\tcomponent.$$.dirty[(i / 31) | 0] |= 1 << i % 31;\n}\n\n// TODO: Document the other params\n/**\n * @param {SvelteComponent} component\n * @param {import('./public.js').ComponentConstructorOptions} options\n *\n * @param {import('./utils.js')['not_equal']} not_equal Used to compare props and state values.\n * @param {(target: Element | ShadowRoot) => void} [append_styles] Function that appends styles to the DOM when the component is first initialised.\n * This will be the `add_css` function from the compiled component.\n *\n * @returns {void}\n */\nexport function init(\n\tcomponent,\n\toptions,\n\tinstance,\n\tcreate_fragment,\n\tnot_equal,\n\tprops,\n\tappend_styles = null,\n\tdirty = [-1]\n) {\n\tconst parent_component = current_component;\n\tset_current_component(component);\n\t/** @type {import('./private.js').T$$} */\n\tconst $$ = (component.$$ = {\n\t\tfragment: null,\n\t\tctx: [],\n\t\t// state\n\t\tprops,\n\t\tupdate: noop,\n\t\tnot_equal,\n\t\tbound: blank_object(),\n\t\t// lifecycle\n\t\ton_mount: [],\n\t\ton_destroy: [],\n\t\ton_disconnect: [],\n\t\tbefore_update: [],\n\t\tafter_update: [],\n\t\tcontext: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n\t\t// everything else\n\t\tcallbacks: blank_object(),\n\t\tdirty,\n\t\tskip_bound: false,\n\t\troot: options.target || parent_component.$$.root\n\t});\n\tappend_styles && append_styles($$.root);\n\tlet ready = false;\n\t$$.ctx = instance\n\t\t? instance(component, options.props || {}, (i, ret, ...rest) => {\n\t\t\t\tconst value = rest.length ? rest[0] : ret;\n\t\t\t\tif ($$.ctx && not_equal($$.ctx[i], ($$.ctx[i] = value))) {\n\t\t\t\t\tif (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);\n\t\t\t\t\tif (ready) make_dirty(component, i);\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t  })\n\t\t: [];\n\t$$.update();\n\tready = true;\n\trun_all($$.before_update);\n\t// `false` as a special case of no DOM component\n\t$$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n\tif (options.target) {\n\t\tif (options.hydrate) {\n\t\t\tstart_hydrating();\n\t\t\t// TODO: what is the correct type here?\n\t\t\t// @ts-expect-error\n\t\t\tconst nodes = children(options.target);\n\t\t\t$$.fragment && $$.fragment.l(nodes);\n\t\t\tnodes.forEach(detach);\n\t\t} else {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t$$.fragment && $$.fragment.c();\n\t\t}\n\t\tif (options.intro) transition_in(component.$$.fragment);\n\t\tmount_component(component, options.target, options.anchor);\n\t\tend_hydrating();\n\t\tflush();\n\t}\n\tset_current_component(parent_component);\n}\n\nexport let SvelteElement;\n\nif (typeof HTMLElement === 'function') {\n\tSvelteElement = class extends HTMLElement {\n\t\t/** The Svelte component constructor */\n\t\t$$ctor;\n\t\t/** Slots */\n\t\t$$s;\n\t\t/** The Svelte component instance */\n\t\t$$c;\n\t\t/** Whether or not the custom element is connected */\n\t\t$$cn = false;\n\t\t/** Component props data */\n\t\t$$d = {};\n\t\t/** `true` if currently in the process of reflecting component props back to attributes */\n\t\t$$r = false;\n\t\t/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */\n\t\t$$p_d = {};\n\t\t/** @type {Record<string, Function[]>} Event listeners */\n\t\t$$l = {};\n\t\t/** @type {Map<Function, Function>} Event listener unsubscribe functions */\n\t\t$$l_u = new Map();\n\n\t\tconstructor($$componentCtor, $$slots, use_shadow_dom) {\n\t\t\tsuper();\n\t\t\tthis.$$ctor = $$componentCtor;\n\t\t\tthis.$$s = $$slots;\n\t\t\tif (use_shadow_dom) {\n\t\t\t\tthis.attachShadow({ mode: 'open' });\n\t\t\t}\n\t\t}\n\n\t\taddEventListener(type, listener, options) {\n\t\t\t// We can't determine upfront if the event is a custom event or not, so we have to\n\t\t\t// listen to both. If someone uses a custom event with the same name as a regular\n\t\t\t// browser event, this fires twice - we can't avoid that.\n\t\t\tthis.$$l[type] = this.$$l[type] || [];\n\t\t\tthis.$$l[type].push(listener);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t}\n\t\t\tsuper.addEventListener(type, listener, options);\n\t\t}\n\n\t\tremoveEventListener(type, listener, options) {\n\t\t\tsuper.removeEventListener(type, listener, options);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$l_u.get(listener);\n\t\t\t\tif (unsub) {\n\t\t\t\t\tunsub();\n\t\t\t\t\tthis.$$l_u.delete(listener);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync connectedCallback() {\n\t\t\tthis.$$cn = true;\n\t\t\tif (!this.$$c) {\n\t\t\t\t// We wait one tick to let possible child slot elements be created/mounted\n\t\t\t\tawait Promise.resolve();\n\t\t\t\tif (!this.$$cn || this.$$c) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfunction create_slot(name) {\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tlet node;\n\t\t\t\t\t\tconst obj = {\n\t\t\t\t\t\t\tc: function create() {\n\t\t\t\t\t\t\t\tnode = element('slot');\n\t\t\t\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\t\t\t\tattr(node, 'name', name);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * @param {HTMLElement} target\n\t\t\t\t\t\t\t * @param {HTMLElement} [anchor]\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tm: function mount(target, anchor) {\n\t\t\t\t\t\t\t\tinsert(target, node, anchor);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\td: function destroy(detaching) {\n\t\t\t\t\t\t\t\tif (detaching) {\n\t\t\t\t\t\t\t\t\tdetach(node);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst $$slots = {};\n\t\t\t\tconst existing_slots = get_custom_elements_slots(this);\n\t\t\t\tfor (const name of this.$$s) {\n\t\t\t\t\tif (name in existing_slots) {\n\t\t\t\t\t\t$$slots[name] = [create_slot(name)];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const attribute of this.attributes) {\n\t\t\t\t\t// this.$$data takes precedence over this.attributes\n\t\t\t\t\tconst name = this.$$g_p(attribute.name);\n\t\t\t\t\tif (!(name in this.$$d)) {\n\t\t\t\t\t\tthis.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, 'toProp');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Port over props that were set programmatically before ce was initialized\n\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\tif (!(key in this.$$d) && this[key] !== undefined) {\n\t\t\t\t\t\tthis.$$d[key] = this[key]; // don't transform, these were set through JavaScript\n\t\t\t\t\t\tdelete this[key]; // remove the property that shadows the getter/setter\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$c = new this.$$ctor({\n\t\t\t\t\ttarget: this.shadowRoot || this,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...this.$$d,\n\t\t\t\t\t\t$$slots,\n\t\t\t\t\t\t$$scope: {\n\t\t\t\t\t\t\tctx: []\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Reflect component props as attributes\n\t\t\t\tconst reflect_attributes = () => {\n\t\t\t\t\tthis.$$r = true;\n\t\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\t\tthis.$$d[key] = this.$$c.$$.ctx[this.$$c.$$.props[key]];\n\t\t\t\t\t\tif (this.$$p_d[key].reflect) {\n\t\t\t\t\t\t\tconst attribute_value = get_custom_element_value(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tthis.$$d[key],\n\t\t\t\t\t\t\t\tthis.$$p_d,\n\t\t\t\t\t\t\t\t'toAttribute'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (attribute_value == null) {\n\t\t\t\t\t\t\t\tthis.removeAttribute(this.$$p_d[key].attribute || key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.setAttribute(this.$$p_d[key].attribute || key, attribute_value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.$$r = false;\n\t\t\t\t};\n\t\t\t\tthis.$$c.$$.after_update.push(reflect_attributes);\n\t\t\t\treflect_attributes(); // once initially because after_update is added too late for first render\n\n\t\t\t\tfor (const type in this.$$l) {\n\t\t\t\t\tfor (const listener of this.$$l[type]) {\n\t\t\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$l = {};\n\t\t\t}\n\t\t}\n\n\t\t// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte\n\t\t// and setting attributes through setAttribute etc, this is helpful\n\t\tattributeChangedCallback(attr, _oldValue, newValue) {\n\t\t\tif (this.$$r) return;\n\t\t\tattr = this.$$g_p(attr);\n\t\t\tthis.$$d[attr] = get_custom_element_value(attr, newValue, this.$$p_d, 'toProp');\n\t\t\tthis.$$c?.$set({ [attr]: this.$$d[attr] });\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.$$cn = false;\n\t\t\t// In a microtask, because this could be a move within the DOM\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (!this.$$cn && this.$$c) {\n\t\t\t\t\tthis.$$c.$destroy();\n\t\t\t\t\tthis.$$c = undefined;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t$$g_p(attribute_name) {\n\t\t\treturn (\n\t\t\t\tObject.keys(this.$$p_d).find(\n\t\t\t\t\t(key) =>\n\t\t\t\t\t\tthis.$$p_d[key].attribute === attribute_name ||\n\t\t\t\t\t\t(!this.$$p_d[key].attribute && key.toLowerCase() === attribute_name)\n\t\t\t\t) || attribute_name\n\t\t\t);\n\t\t}\n\t};\n}\n\n/**\n * @param {string} prop\n * @param {any} value\n * @param {Record<string, CustomElementPropDefinition>} props_definition\n * @param {'toAttribute' | 'toProp'} [transform]\n */\nfunction get_custom_element_value(prop, value, props_definition, transform) {\n\tconst type = props_definition[prop]?.type;\n\tvalue = type === 'Boolean' && typeof value !== 'boolean' ? value != null : value;\n\tif (!transform || !props_definition[prop]) {\n\t\treturn value;\n\t} else if (transform === 'toAttribute') {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value == null ? null : JSON.stringify(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value ? '' : null;\n\t\t\tcase 'Number':\n\t\t\t\treturn value == null ? null : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t} else {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value && JSON.parse(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value; // conversion already handled above\n\t\t\tcase 'Number':\n\t\t\t\treturn value != null ? +value : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t}\n}\n\n/**\n * @internal\n *\n * Turn a Svelte component into a custom element.\n * @param {import('./public.js').ComponentType} Component  A Svelte component constructor\n * @param {Record<string, CustomElementPropDefinition>} props_definition  The props to observe\n * @param {string[]} slots  The slots to create\n * @param {string[]} accessors  Other accessors besides the ones for props the component has\n * @param {boolean} use_shadow_dom  Whether to use shadow DOM\n * @param {(ce: new () => HTMLElement) => new () => HTMLElement} [extend]\n */\nexport function create_custom_element(\n\tComponent,\n\tprops_definition,\n\tslots,\n\taccessors,\n\tuse_shadow_dom,\n\textend\n) {\n\tlet Class = class extends SvelteElement {\n\t\tconstructor() {\n\t\t\tsuper(Component, slots, use_shadow_dom);\n\t\t\tthis.$$p_d = props_definition;\n\t\t}\n\t\tstatic get observedAttributes() {\n\t\t\treturn Object.keys(props_definition).map((key) =>\n\t\t\t\t(props_definition[key].attribute || key).toLowerCase()\n\t\t\t);\n\t\t}\n\t};\n\tObject.keys(props_definition).forEach((prop) => {\n\t\tObject.defineProperty(Class.prototype, prop, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c && prop in this.$$c ? this.$$c[prop] : this.$$d[prop];\n\t\t\t},\n\t\t\tset(value) {\n\t\t\t\tvalue = get_custom_element_value(prop, value, props_definition);\n\t\t\t\tthis.$$d[prop] = value;\n\t\t\t\tthis.$$c?.$set({ [prop]: value });\n\t\t\t}\n\t\t});\n\t});\n\taccessors.forEach((accessor) => {\n\t\tObject.defineProperty(Class.prototype, accessor, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c?.[accessor];\n\t\t\t}\n\t\t});\n\t});\n\tif (extend) {\n\t\t// @ts-expect-error - assigning here is fine\n\t\tClass = extend(Class);\n\t}\n\tComponent.element = /** @type {any} */ (Class);\n\treturn Class;\n}\n\n/**\n * Base class for Svelte components. Used when dev=false.\n *\n * @template {Record<string, any>} [Props=any]\n * @template {Record<string, any>} [Events=any]\n */\nexport class SvelteComponent {\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$ = undefined;\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$set = undefined;\n\n\t/** @returns {void} */\n\t$destroy() {\n\t\tdestroy_component(this, 1);\n\t\tthis.$destroy = noop;\n\t}\n\n\t/**\n\t * @template {Extract<keyof Events, string>} K\n\t * @param {K} type\n\t * @param {((e: Events[K]) => void) | null | undefined} callback\n\t * @returns {() => void}\n\t */\n\t$on(type, callback) {\n\t\tif (!is_function(callback)) {\n\t\t\treturn noop;\n\t\t}\n\t\tconst callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);\n\t\tcallbacks.push(callback);\n\t\treturn () => {\n\t\t\tconst index = callbacks.indexOf(callback);\n\t\t\tif (index !== -1) callbacks.splice(index, 1);\n\t\t};\n\t}\n\n\t/**\n\t * @param {Partial<Props>} props\n\t * @returns {void}\n\t */\n\t$set(props) {\n\t\tif (this.$$set && !is_empty(props)) {\n\t\t\tthis.$$.skip_bound = true;\n\t\t\tthis.$$set(props);\n\t\t\tthis.$$.skip_bound = false;\n\t\t}\n\t}\n}\n\n/**\n * @typedef {Object} CustomElementPropDefinition\n * @property {string} [attribute]\n * @property {boolean} [reflect]\n * @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type]\n */\n","// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n *\n * https://svelte.dev/docs/svelte-compiler#svelte-version\n * @type {string}\n */\nexport const VERSION = '4.2.19';\nexport const PUBLIC_VERSION = '4';\n","import {\n\trun_all,\n\tsubscribe,\n\tnoop,\n\tsafe_not_equal,\n\tis_function,\n\tget_store_value\n} from '../internal/index.js';\n\nconst subscriber_queue = [];\n\n/**\n * Creates a `Readable` store that allows reading by subscription.\n *\n * https://svelte.dev/docs/svelte-store#readable\n * @template T\n * @param {T} [value] initial value\n * @param {import('./public.js').StartStopNotifier<T>} [start]\n * @returns {import('./public.js').Readable<T>}\n */\nexport function readable(value, start) {\n\treturn {\n\t\tsubscribe: writable(value, start).subscribe\n\t};\n}\n\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n *\n * https://svelte.dev/docs/svelte-store#writable\n * @template T\n * @param {T} [value] initial value\n * @param {import('./public.js').StartStopNotifier<T>} [start]\n * @returns {import('./public.js').Writable<T>}\n */\nexport function writable(value, start = noop) {\n\t/** @type {import('./public.js').Unsubscriber} */\n\tlet stop;\n\t/** @type {Set<import('./private.js').SubscribeInvalidateTuple<T>>} */\n\tconst subscribers = new Set();\n\t/** @param {T} new_value\n\t * @returns {void}\n\t */\n\tfunction set(new_value) {\n\t\tif (safe_not_equal(value, new_value)) {\n\t\t\tvalue = new_value;\n\t\t\tif (stop) {\n\t\t\t\t// store is ready\n\t\t\t\tconst run_queue = !subscriber_queue.length;\n\t\t\t\tfor (const subscriber of subscribers) {\n\t\t\t\t\tsubscriber[1]();\n\t\t\t\t\tsubscriber_queue.push(subscriber, value);\n\t\t\t\t}\n\t\t\t\tif (run_queue) {\n\t\t\t\t\tfor (let i = 0; i < subscriber_queue.length; i += 2) {\n\t\t\t\t\t\tsubscriber_queue[i][0](subscriber_queue[i + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tsubscriber_queue.length = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {import('./public.js').Updater<T>} fn\n\t * @returns {void}\n\t */\n\tfunction update(fn) {\n\t\tset(fn(value));\n\t}\n\n\t/**\n\t * @param {import('./public.js').Subscriber<T>} run\n\t * @param {import('./private.js').Invalidator<T>} [invalidate]\n\t * @returns {import('./public.js').Unsubscriber}\n\t */\n\tfunction subscribe(run, invalidate = noop) {\n\t\t/** @type {import('./private.js').SubscribeInvalidateTuple<T>} */\n\t\tconst subscriber = [run, invalidate];\n\t\tsubscribers.add(subscriber);\n\t\tif (subscribers.size === 1) {\n\t\t\tstop = start(set, update) || noop;\n\t\t}\n\t\trun(value);\n\t\treturn () => {\n\t\t\tsubscribers.delete(subscriber);\n\t\t\tif (subscribers.size === 0 && stop) {\n\t\t\t\tstop();\n\t\t\t\tstop = null;\n\t\t\t}\n\t\t};\n\t}\n\treturn { set, update, subscribe };\n}\n\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * https://svelte.dev/docs/svelte-store#derived\n * @template {import('./private.js').Stores} S\n * @template T\n * @overload\n * @param {S} stores - input stores\n * @param {(values: import('./private.js').StoresValues<S>, set: (value: T) => void, update: (fn: import('./public.js').Updater<T>) => void) => import('./public.js').Unsubscriber | void} fn - function callback that aggregates the values\n * @param {T} [initial_value] - initial value\n * @returns {import('./public.js').Readable<T>}\n */\n\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * https://svelte.dev/docs/svelte-store#derived\n * @template {import('./private.js').Stores} S\n * @template T\n * @overload\n * @param {S} stores - input stores\n * @param {(values: import('./private.js').StoresValues<S>) => T} fn - function callback that aggregates the values\n * @param {T} [initial_value] - initial value\n * @returns {import('./public.js').Readable<T>}\n */\n\n/**\n * @template {import('./private.js').Stores} S\n * @template T\n * @param {S} stores\n * @param {Function} fn\n * @param {T} [initial_value]\n * @returns {import('./public.js').Readable<T>}\n */\nexport function derived(stores, fn, initial_value) {\n\tconst single = !Array.isArray(stores);\n\t/** @type {Array<import('./public.js').Readable<any>>} */\n\tconst stores_array = single ? [stores] : stores;\n\tif (!stores_array.every(Boolean)) {\n\t\tthrow new Error('derived() expects stores as input, got a falsy value');\n\t}\n\tconst auto = fn.length < 2;\n\treturn readable(initial_value, (set, update) => {\n\t\tlet started = false;\n\t\tconst values = [];\n\t\tlet pending = 0;\n\t\tlet cleanup = noop;\n\t\tconst sync = () => {\n\t\t\tif (pending) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcleanup();\n\t\t\tconst result = fn(single ? values[0] : values, set, update);\n\t\t\tif (auto) {\n\t\t\t\tset(result);\n\t\t\t} else {\n\t\t\t\tcleanup = is_function(result) ? result : noop;\n\t\t\t}\n\t\t};\n\t\tconst unsubscribers = stores_array.map((store, i) =>\n\t\t\tsubscribe(\n\t\t\t\tstore,\n\t\t\t\t(value) => {\n\t\t\t\t\tvalues[i] = value;\n\t\t\t\t\tpending &= ~(1 << i);\n\t\t\t\t\tif (started) {\n\t\t\t\t\t\tsync();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tpending |= 1 << i;\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t\tstarted = true;\n\t\tsync();\n\t\treturn function stop() {\n\t\t\trun_all(unsubscribers);\n\t\t\tcleanup();\n\t\t\t// We need to set this to false because callbacks can still happen despite having unsubscribed:\n\t\t\t// Callbacks might already be placed in the queue which doesn't know it should no longer\n\t\t\t// invoke this derived store.\n\t\t\tstarted = false;\n\t\t};\n\t});\n}\n\n/**\n * Takes a store and returns a new one derived from the old one that is readable.\n *\n * https://svelte.dev/docs/svelte-store#readonly\n * @template T\n * @param {import('./public.js').Readable<T>} store  - store to make readonly\n * @returns {import('./public.js').Readable<T>}\n */\nexport function readonly(store) {\n\treturn {\n\t\tsubscribe: store.subscribe.bind(store)\n\t};\n}\n\nexport { get_store_value as get };\n","/**\n * Provides a basic test for a given variable to test if it has the shape of a readable store by having a `subscribe`\n * function.\n *\n * Note: functions are also objects, so test that the variable might be a function w/ a `subscribe` function.\n *\n * @param {*}  store - variable to test that might be a store.\n *\n * @returns {boolean} Whether the variable tested has the shape of a store.\n */\nfunction isReadableStore(store)\n{\n   if (store === null || store === void 0) { return false; }\n\n   switch (typeof store)\n   {\n      case 'function':\n      case 'object':\n         return typeof store.subscribe === 'function';\n   }\n\n   return false;\n}\n\n/**\n * Provides a basic test for a given variable to test if it has the shape of a minimal writable store by having a\n * `subscribe` and `set` functions.\n *\n * Note: functions are also objects, so test that the variable might be a function w/ `subscribe` & `set` functions.\n *\n * @param {*}  store - variable to test that might be a store.\n *\n * @returns {boolean} Whether the variable tested has the shape of a {@link MinimalWritable} store.\n */\nfunction isMinimalWritableStore(store)\n{\n   if (store === null || store === void 0) { return false; }\n\n   switch (typeof store)\n   {\n      case 'function':\n      case 'object':\n         return typeof store.subscribe === 'function' && typeof store.set === 'function';\n   }\n\n   return false;\n}\n\n/**\n * Provides a basic test for a given variable to test if it has the shape of a writable store by having a `subscribe`\n * `set`, and `update` functions.\n *\n * Note: functions are also objects, so test that the variable might be a function w/ `subscribe`, `set, and `update`\n * functions.\n *\n * @param {*}  store - variable to test that might be a store.\n *\n * @returns {boolean} Whether the variable tested has the shape of a store.\n */\nfunction isWritableStore(store)\n{\n   if (store === null || store === void 0) { return false; }\n\n   switch (typeof store)\n   {\n      case 'function':\n      case 'object':\n         return typeof store.subscribe === 'function' && typeof store.set === 'function' &&\n          typeof store.update === 'function';\n   }\n\n   return false;\n}\n\n/**\n * Subscribes to the given store with the update function provided and ignores the first automatic\n * update. All future updates are dispatched to the update function.\n *\n * @param {import('svelte/store').Readable | import('svelte/store').Writable} store -\n *  Store to subscribe to...\n *\n * @param {import('svelte/store').Updater} update - function to receive future updates.\n *\n * @returns {import('svelte/store').Unsubscriber} Store unsubscribe function.\n */\nfunction subscribeIgnoreFirst(store, update)\n{\n   let firedFirst = false;\n\n   return store.subscribe((value) =>\n   {\n      if (!firedFirst)\n      {\n         firedFirst = true;\n      }\n      else\n      {\n         update(value);\n      }\n   });\n}\n\n/**\n * Subscribes to the given store with two update functions provided. The first function is invoked on the initial\n * subscription. All future updates are dispatched to the update function.\n *\n * @param {import('svelte/store').Readable | import('svelte/store').Writable} store -\n *  Store to subscribe to...\n *\n * @param {import('svelte/store').Updater} first - Function to receive first update.\n *\n * @param {import('svelte/store').Updater} update - Function to receive future updates.\n *\n * @returns {import('svelte/store').Unsubscriber} Store unsubscribe function.\n */\nfunction subscribeFirstRest(store, first, update)\n{\n   let firedFirst = false;\n\n   return store.subscribe((value) =>\n   {\n      if (!firedFirst)\n      {\n         firedFirst = true;\n         first(value);\n      }\n      else\n      {\n         update(value);\n      }\n   });\n}\n\nexport { isMinimalWritableStore, isReadableStore, isWritableStore, subscribeFirstRest, subscribeIgnoreFirst };\n//# sourceMappingURL=index.js.map\n","import { isObject } from '@typhonjs-fvtt/runtime/util/object';\n\n/**\n * Provides utility methods for checking browser capabilities.\n *\n * @see https://kilianvalkhof.com/2021/web/detecting-media-query-support-in-css-and-javascript/\n *\n * @privateRemarks\n * TODO: perhaps add support for various standard media query checks for level 4 & 5.\n */\nclass BrowserSupports\n{\n   /**\n    * Check for container query support.\n    *\n    * @returns {boolean} True if container queries supported.\n    */\n   static get containerQueries()\n   {\n      return 'container' in document.documentElement.style;\n   }\n}\n\n/**\n * Provides cross window checks for DOM nodes / elements, events, and essential duck typing for any class based object\n * with a constructor name. The impetus is that certain browsers such as Chrome and Firefox behave differently when\n * performing `instanceof` checks when elements are moved between browser windows. With Firefox in particular the\n * entire JS runtime can not use `instanceof` checks as the instances of fundamental DOM elements differ between\n * windows.\n *\n * TRL supports moving applications from a main central browser window and popping them out into separate standalone\n * app instances in a separate browser window. In this case for essential DOM element and event checks it is necessary\n * to employ the workarounds found in `CrossWindow`.\n */\nclass CrossWindow\n{\n   /**\n    * @private\n    */\n   constructor() {} // eslint-disable-line no-useless-constructor\n\n   /**\n    * Class names for all focusable element types.\n    *\n    * @type {string[]}\n    */\n   static #FocusableElementClassNames = ['HTMLAnchorElement', 'HTMLButtonElement', 'HTMLDetailsElement',\n    'HTMLEmbedElement', 'HTMLIFrameElement', 'HTMLInputElement', 'HTMLObjectElement', 'HTMLSelectElement',\n     'HTMLTextAreaElement'];\n\n   /**\n    * DOM nodes with defined `ownerDocument` property.\n    *\n    * @type {Set<number>}\n    */\n   static #NodesWithOwnerDocument = new Set([Node.ELEMENT_NODE, Node.TEXT_NODE, Node.COMMENT_NODE,\n    Node.DOCUMENT_FRAGMENT_NODE]);\n\n   // Various UI Event sets for duck typing by constructor name.\n   /**\n    * Duck typing class names for pointer events.\n    *\n    * @type {Set<string>}\n    */\n   static #PointerEventSet = new Set(['MouseEvent', 'PointerEvent']);\n\n   /**\n    * Duck typing class names for all UIEvents.\n    *\n    * @type {Set<string>}\n    */\n   static #UIEventSet = new Set(['UIEvent', 'FocusEvent', 'MouseEvent', 'WheelEvent', 'KeyboardEvent', 'PointerEvent',\n    'TouchEvent', 'InputEvent', 'CompositionEvent', 'DragEvent']);\n\n   /**\n    * Duck typing class names for events considered as user input.\n    *\n    * @type {Set<string>}\n    */\n   static #UserInputEventSet = new Set(['KeyboardEvent', 'MouseEvent', 'PointerEvent']);\n\n   /**\n    * Internal options used by `#checkDOMInstanceType` when retrieving the Window reference from a Node that doesn't\n    * define `ownerDocument`.\n    *\n    * @type {{throws: boolean}}\n    */\n   static #optionsInternalCheckDOM = { throws: false };\n\n   // DOM Querying ---------------------------------------------------------------------------------------------------\n\n   /**\n    * Convenience method to retrieve the `document.activeElement` value in the current Window context of a DOM Node /\n    * Element, EventTarget, Document, or Window.\n    *\n    * @param {Document | EventTarget | Node | UIEvent | Window}  target - DOM Node / Element, EventTarget, Document,\n    *        UIEvent or Window to query.\n    *\n    * @param {object} [options] - Options.\n    *\n    * @param {boolean} [options.throws=true] - When `true` and target is invalid throw an exception. If `false` and the\n    *        target is invalid `undefined` is returned; default: `true`.\n    *\n    * @returns {Element | null} Active element or `undefined` when `throws` option is `false` and the target is invalid.\n    *\n    * @throws {@link TypeError} Target must be a DOM Node / Element, Document, UIEvent, or Window.\n    */\n   static getActiveElement(target, { throws = true } = {})\n   {\n      // Duck type if target has known defined `ownerDocument` property.\n      if (this.#NodesWithOwnerDocument.has(target?.nodeType)) { return target?.ownerDocument?.activeElement ?? null; }\n\n      // Duck type if target is a UIEvent.\n      if (this.isUIEvent(target) && isObject(target?.view)) { return target?.view?.document?.activeElement ?? null; }\n\n      // Duck type if target is a Document.\n      if (isObject(target?.defaultView)) { return target?.activeElement ?? null; }\n\n      // Duck type if target is a Window.\n      if (isObject(target?.document) && isObject(target?.location)) { return target?.document?.activeElement ?? null; }\n\n      if (throws) { throw new TypeError(`'target' must be a DOM Node / Element, Document, UIEvent, or Window.`); }\n\n      return void 0;\n   }\n\n   /**\n    * Convenience method to retrieve the `Document` value in the current context of a DOM Node / Element, EventTarget,\n    * Document, UIEvent, or Window.\n    *\n    * @param {Document | EventTarget | Node | UIEvent | Window}  target - DOM Node / Element, EventTarget, Document,\n    *        UIEvent or Window to query.\n    *\n    * @param {object} [options] - Options.\n    *\n    * @param {boolean} [options.throws=true] - When `true` and target is invalid throw an exception. If `false` and the\n    *        target is invalid `undefined` is returned; default: `true`.\n    *\n    * @returns {Document} Active document or `undefined` when `throws` option is `false` and the target is invalid.\n    *\n    * @throws {@link TypeError} Target must be a DOM Node / Element, Document, UIEvent, or Window.\n    */\n   static getDocument(target, { throws = true } = {})\n   {\n      // Duck type if target has known defined `ownerDocument` property.\n      if (this.#NodesWithOwnerDocument.has(target?.nodeType)) { return target?.ownerDocument; }\n\n      // Duck type if target is a UIEvent.\n      if (this.isUIEvent(target) && isObject(target?.view)) { return target?.view?.document; }\n\n      // Duck type if target is a Document.\n      if (isObject(target?.defaultView)) { return target; }\n\n      // Duck type if target is a Window.\n      if (isObject(target?.document) && isObject(target?.location)) { return target?.document; }\n\n      if (throws) { throw new TypeError(`'target' must be a DOM Node / Element, Document, UIEvent, or Window.`); }\n\n      return void 0;\n   }\n\n   /**\n    * Convenience method to retrieve the `Window` value in the current context of a DOM Node / Element, EventTarget,\n    * Document, or Window.\n    *\n    * @param {Document | EventTarget | Node | UIEvent | Window}  target - DOM Node / Element, EventTarget, Document,\n    *        UIEvent or Window to query.\n    *\n    * @param {object} [options] - Options.\n    *\n    * @param {boolean} [options.throws=true] - When `true` and target is invalid throw an exception. If `false` and the\n    *        target is invalid `undefined` is returned; default: `true`.\n    *\n    * @returns {Window} Active window or `undefined` when `throws` option is `false` and the target is invalid.\n    *\n    * @throws {@link TypeError} Target must be a DOM Node / Element, Document, UIEvent, or Window.\n    */\n   static getWindow(target, { throws = true } = {})\n   {\n      // Duck type if target has known defined `ownerDocument` property.\n      if (this.#NodesWithOwnerDocument.has(target?.nodeType))\n      {\n         return target.ownerDocument?.defaultView ?? globalThis;\n      }\n\n      // Duck type if target is a UIEvent.\n      if (this.isUIEvent(target) && isObject(target?.view)) { return target.view ?? globalThis; }\n\n      // Duck type if target is a Document.\n      if (isObject(target?.defaultView)) { return target.defaultView ?? globalThis; }\n\n      // Duck type if target is a Window.\n      if (isObject(target?.document) && isObject(target?.location)) { return target; }\n\n      if (throws) { throw new TypeError(`'target' must be a DOM Node / Element, Document, UIEvent, or Window.`); }\n\n      return void 0;\n   }\n\n   // ES / Browser API basic prototype tests -------------------------------------------------------------------------\n\n   /**\n    * Provides basic prototype string type checking if `target` is a Document.\n    *\n    * @param {unknown}  target - A potential Document to test.\n    *\n    * @returns {target is Document} Is `target` a Document.\n    */\n   static isDocument(target)\n   {\n      return isObject(target) && Object.prototype.toString.call(target) === '[object Document]';\n   }\n\n   /**\n    * Provides basic prototype string type checking if `target` is a Map.\n    *\n    * @param {unknown}  target - A potential Map to test.\n    *\n    * @returns {target is Map} Is `target` a Map.\n    */\n   static isMap(target)\n   {\n      return isObject(target) && Object.prototype.toString.call(target) === '[object Map]';\n   }\n\n   /**\n    * Provides basic prototype string type checking if `target` is a Promise.\n    *\n    * @param {unknown}  target - A potential Promise to test.\n    *\n    * @returns {target is Promise} Is `target` a Promise.\n    */\n   static isPromise(target)\n   {\n      return isObject(target) && Object.prototype.toString.call(target) === '[object Promise]';\n   }\n\n   /**\n    * Provides basic prototype string type checking if `target` is a RegExp.\n    *\n    * @param {unknown}  target - A potential RegExp to test.\n    *\n    * @returns {target is RegExp} Is `target` a RegExp.\n    */\n   static isRegExp(target)\n   {\n      return isObject(target) && Object.prototype.toString.call(target) === '[object RegExp]';\n   }\n\n   /**\n    * Provides basic prototype string type checking if `target` is a Set.\n    *\n    * @param {unknown}  target - A potential Set to test.\n    *\n    * @returns {target is Set} Is `target` a Set.\n    */\n   static isSet(target)\n   {\n      return isObject(target) && Object.prototype.toString.call(target) === '[object Set]';\n   }\n\n   /**\n    * Provides basic prototype string type checking if `target` is a URL.\n    *\n    * @param {unknown}  target - A potential URL to test.\n    *\n    * @returns {target is URL} Is `target` a URL.\n    */\n   static isURL(target)\n   {\n      return isObject(target) && Object.prototype.toString.call(target) === '[object URL]';\n   }\n\n   /**\n    * Provides basic prototype string type checking if `target` is a Window.\n    *\n    * @param {unknown}  target - A potential Window to test.\n    *\n    * @returns {target is Window} Is `target` a Window.\n    */\n   static isWindow(target)\n   {\n      return isObject(target) && Object.prototype.toString.call(target) === '[object Window]';\n   }\n\n   // DOM Element typing ---------------------------------------------------------------------------------------------\n\n   /**\n    * Ensures that the given target is an `instanceof` all known DOM elements that are focusable. Please note that\n    * additional checks are required regarding focusable state; use {@link A11yHelper.isFocusable} for a complete check.\n    *\n    * @param {unknown}  target - Target to test for `instanceof` focusable HTML element.\n    *\n    * @returns {boolean} Is target an `instanceof` a focusable DOM element.\n    */\n   static isFocusableHTMLElement(target)\n   {\n      for (let cntr = this.#FocusableElementClassNames.length; --cntr >= 0;)\n      {\n         if (this.#checkDOMInstanceType(target, Node.ELEMENT_NODE, this.#FocusableElementClassNames[cntr]))\n         {\n            return true;\n         }\n      }\n\n      return false;\n   }\n\n   /**\n    * Provides precise type checking if `target` is a DocumentFragment.\n    *\n    * @param {unknown}  target - A potential DocumentFragment to test.\n    *\n    * @returns {target is DocumentFragment} Is `target` a DocumentFragment.\n    */\n   static isDocumentFragment(target)\n   {\n      return this.#checkDOMInstanceType(target, Node.DOCUMENT_FRAGMENT_NODE, 'DocumentFragment');\n   }\n\n   /**\n    * Provides precise type checking if `target` is an Element.\n    *\n    * @param {unknown}  target - A potential Element to test.\n    *\n    * @returns {target is Element} Is `target` an Element.\n    */\n   static isElement(target)\n   {\n      return this.#checkDOMInstanceType(target, Node.ELEMENT_NODE, 'Element');\n   }\n\n   /**\n    * Provides precise type checking if `target` is a HTMLAnchorElement.\n    *\n    * @param {unknown}  target - A potential HTMLAnchorElement to test.\n    *\n    * @returns {target is HTMLAnchorElement} Is `target` a HTMLAnchorElement.\n    */\n   static isHTMLAnchorElement(target)\n   {\n      return this.#checkDOMInstanceType(target, Node.ELEMENT_NODE, 'HTMLAnchorElement');\n   }\n\n   /**\n    * Provides precise type checking if `target` is a HTMLElement.\n    *\n    * @param {unknown}  target - A potential HTMLElement to test.\n    *\n    * @returns {target is HTMLElement} Is `target` a HTMLElement.\n    */\n   static isHTMLElement(target)\n   {\n      return this.#checkDOMInstanceType(target, Node.ELEMENT_NODE, 'HTMLElement');\n   }\n\n   /**\n    * Provides precise type checking if `target` is a Node.\n    *\n    * @param {unknown}  target - A potential Node to test.\n    *\n    * @returns {target is Node} Is `target` a DOM Node.\n    */\n   static isNode(target)\n   {\n      if (typeof target?.nodeType !== 'number') { return false; }\n\n      if (target instanceof globalThis.Node) { return true; }\n\n      // Must retrieve window by a more thorough duck type via `getWindow` as not all Nodes have `ownerDocument`\n      // defined.\n      const activeWindow = this.getWindow(target, this.#optionsInternalCheckDOM);\n\n      const TargetNode = activeWindow?.Node;\n      return TargetNode && target instanceof TargetNode;\n   }\n\n   /**\n    * Provides precise type checking if `target` is a ShadowRoot.\n    *\n    * @param {unknown}  target - A potential ShadowRoot to test.\n    *\n    * @returns {target is ShadowRoot} Is `target` a ShadowRoot.\n    */\n   static isShadowRoot(target)\n   {\n      // ShadowRoot is a specialized type of DocumentFragment.\n      return this.#checkDOMInstanceType(target, Node.DOCUMENT_FRAGMENT_NODE, 'ShadowRoot');\n   }\n\n   /**\n    * Provides precise type checking if `target` is a SVGElement.\n    *\n    * @param {unknown}  target - A potential SVGElement to test.\n    *\n    * @returns {target is SVGElement} Is `target` a SVGElement.\n    */\n   static isSVGElement(target)\n   {\n      return this.#checkDOMInstanceType(target, Node.ELEMENT_NODE, 'SVGElement');\n   }\n\n   // Event typing ---------------------------------------------------------------------------------------------------\n\n   /**\n    * Provides basic duck type checking for `Event` signature and optional constructor name(s).\n    *\n    * @param {unknown}  target - A potential DOM event to test.\n    *\n    * @param {string | Set<string>} [types] Specific constructor name or Set of constructor names to match.\n    *\n    * @returns {target is Event} Is `target` an Event with optional constructor name check.\n    */\n   static isEvent(target, types)\n   {\n      if (typeof target?.type !== 'string' || typeof target?.defaultPrevented !== 'boolean' ||\n         typeof target?.stopPropagation !== 'function')\n      {\n         return false;\n      }\n\n      return types !== void 0 ? this.isCtorName(target, types) : true;\n   }\n\n   /**\n    * Provides basic duck type checking for `Event` signature for standard mouse / pointer events including\n    * `MouseEvent` and `PointerEvent`.\n    *\n    * @param {unknown}  target - A potential DOM event to test.\n    *\n    * @returns {target is PointerEvent} Is `target` a MouseEvent or PointerEvent.\n    */\n   static isPointerEvent(target)\n   {\n      return this.isEvent(target, this.#PointerEventSet);\n   }\n\n   /**\n    * Provides basic duck type checking for `Event` signature for all UI events.\n    *\n    * @param {unknown}  target - A potential DOM event to test.\n    *\n    * @returns {target is UIEvent} Is `target` a UIEvent.\n    * @see https://developer.mozilla.org/en-US/docs/Web/API/UIEvent\n    */\n   static isUIEvent(target)\n   {\n      return this.isEvent(target, this.#UIEventSet);\n   }\n\n   /**\n    * Provides basic duck type checking for `Event` signature for standard user input events including `KeyboardEvent`,\n    * `MouseEvent`, and `PointerEvent`.\n    *\n    * @param {unknown}  target - A potential DOM event to test.\n    *\n    * @returns {target is KeyboardEvent | MouseEvent | PointerEvent} Is `target` a Keyboard, MouseEvent, or\n    *          PointerEvent.\n    */\n   static isUserInputEvent(target)\n   {\n      return this.isEvent(target, this.#UserInputEventSet);\n   }\n\n   // Generic typing -------------------------------------------------------------------------------------------------\n\n   /**\n    * Provides basic type checking by constructor name(s) for objects. This can be useful when checking multiple\n    * constructor names against a provided Set.\n    *\n    * @param {unknown}  target - Object to test for constructor name.\n    *\n    * @param {string | Set<string>} types Specific constructor name or Set of constructor names to match.\n    *\n    * @returns {boolean} Does the provided object constructor name match the types provided.\n    */\n   static isCtorName(target, types)\n   {\n      if (!isObject(target)) { return false; }\n\n      if (typeof types === 'string' && target?.constructor?.name === types) { return true; }\n\n      return !!types?.has(target?.constructor?.name);\n   }\n\n   // Internal implementation ----------------------------------------------------------------------------------------\n\n   /**\n    * Internal generic DOM `instanceof` check. First will attempt to find the class name by `globalThis` falling back\n    * to the {@link Window} associated with the DOM node.\n    *\n    * @param {unknown}  target - Target to test.\n    *\n    * @param {number}   nodeType - Node type constant.\n    *\n    * @param {string}   className - DOM class name for instanceof check.\n    *\n    * @returns {boolean} Is the target the given nodeType and instance of class name.\n    */\n   static #checkDOMInstanceType(target, nodeType, className)\n   {\n      if (!isObject(target)) { return false; }\n\n      if (target.nodeType !== nodeType) { return false; }\n\n      const GlobalClass = globalThis[className];\n\n      if (GlobalClass && target instanceof GlobalClass) { return true; }\n\n      const activeWindow = this.#NodesWithOwnerDocument.has(target.nodeType) ? target?.ownerDocument?.defaultView :\n       this.getWindow(target, this.#optionsInternalCheckDOM);\n\n      const TargetClass = activeWindow?.[className];\n\n      return TargetClass && target instanceof TargetClass;\n   }\n}\n\n/**\n * Provides access to the Clipboard API for reading / writing text strings. This requires a secure context.\n *\n * Note: `writeText` will attempt to use the older `execCommand` if available when `navigator.clipboard` is not\n * available.\n */\nclass ClipboardAccess\n{\n   /**\n    * Uses `navigator.clipboard` if available to read text from the clipboard.\n    *\n    * Note: Always returns `undefined` when `navigator.clipboard` is not available or the clipboard contains the\n    * empty string.\n    *\n    * @param {Window} [activeWindow=globalThis] Optional active current window.\n    *\n    * @returns {Promise<string|undefined>} The current clipboard text or undefined.\n    */\n   static async readText(activeWindow = globalThis)\n   {\n      let result;\n\n      if (!CrossWindow.isWindow(activeWindow))\n      {\n         throw new TypeError(`ClipboardAccess.readText error: 'activeWindow' is not a Window.`);\n      }\n\n      if (activeWindow?.navigator?.clipboard)\n      {\n         try\n         {\n            result = await activeWindow.navigator.clipboard.readText();\n         }\n         catch (err) { /**/ }\n      }\n\n      return result === '' ? void 0 : result;\n   }\n\n   /**\n    * Uses `navigator.clipboard` if available then falls back to `document.execCommand('copy')` if available to copy\n    * the given text to the clipboard.\n    *\n    * @param {string}   text - Text to copy to the browser clipboard.\n    *\n    * @param {Window} [activeWindow=globalThis] Optional active current window.\n    *\n    * @returns {Promise<boolean>} Copy successful.\n    */\n   static async writeText(text, activeWindow = globalThis)\n   {\n      if (typeof text !== 'string')\n      {\n         throw new TypeError(`ClipboardAccess.writeText error: 'text' is not a string.`);\n      }\n\n      if (!CrossWindow.isWindow(activeWindow))\n      {\n         throw new TypeError(`ClipboardAccess.writeText error: 'activeWindow' is not a Window.`);\n      }\n\n      let success = false;\n\n      if (activeWindow?.navigator?.clipboard)\n      {\n         try\n         {\n            await activeWindow.navigator.clipboard.writeText(text);\n            success = true;\n         }\n         catch (err) { /**/ }\n      }\n      else if (typeof activeWindow?.document?.execCommand === 'function')\n      {\n         const textArea = activeWindow.document.createElement('textarea');\n\n         // Place in the top-left corner of screen regardless of scroll position.\n         textArea.style.position = 'fixed';\n         textArea.style.top = '0';\n         textArea.style.left = '0';\n\n         // Ensure it has a small width and height. Setting to 1px / 1em\n         // doesn't work as this gives a negative w/h on some browsers.\n         textArea.style.width = '2em';\n         textArea.style.height = '2em';\n\n         // We don't need padding, reducing the size if it does flash render.\n         textArea.style.padding = '0';\n\n         // Clean up any borders.\n         textArea.style.border = 'none';\n         textArea.style.outline = 'none';\n         textArea.style.boxShadow = 'none';\n\n         // Avoid flash of the white box if rendered for any reason.\n         textArea.style.background = 'transparent';\n\n         textArea.value = text;\n\n         activeWindow.document.body.appendChild(textArea);\n         textArea.focus();\n         textArea.select();\n\n         try\n         {\n            success = activeWindow.document.execCommand('copy');\n         }\n         catch (err) { /**/ }\n\n         activeWindow.document.body.removeChild(textArea);\n      }\n\n      return success;\n   }\n}\n\n/**\n * Provides a utility function to parse / construct fully qualified URL instances from a URL string.\n */\nclass URLParser\n{\n   /**\n    * Parses a URL string converting it to a fully qualified URL. If URL is an existing URL instance it is returned\n    * immediately. Optionally you may construct a fully qualified URL from a relative base origin / path or with a\n    * route prefix added to the current location origin.\n    *\n    * @param {object} options - Options.\n    *\n    * @param {string | URL}   options.url - URL string to convert to a URL.\n    *\n    * @param {string}   [options.base] - Optional fully qualified base path for relative URL construction.\n    *\n    * @param {string}   [options.routePrefix] - Optional route prefix to add to location origin for absolute URL strings\n    *        when `base` is not defined.\n    *\n    * @returns {URL | null} Parsed URL or null if `url` is not parsed.\n    */\n   static parse({ url, base, routePrefix })\n   {\n      if (CrossWindow.isURL(url)) { return url; }\n\n      if (typeof url !== 'string') { return null; }\n\n      if (base !== void 0 && typeof base !== 'string') { return null; }\n\n      if (routePrefix !== void 0 && typeof routePrefix !== 'string') { return null; }\n\n      const targetURL = this.#createURL(url);\n\n      // Parse and return already fully qualified `url` string.\n      if (targetURL) { return targetURL; }\n\n      let targetBase;\n\n      // Parse relative url string.\n      if (url.startsWith('./') || url.startsWith('../'))\n      {\n         // Relative from provided `base` or current path.\n         targetBase = base ? base : `${globalThis.location.origin}${globalThis.location.pathname}`;\n      }\n      else\n      {\n         let targetRoutePrefix = '';\n\n         // Relative to current origin, but include any defined route prefix.\n         if (routePrefix)\n         {\n            // Ensure route prefix starts and ends with `/` for proper URL parsing.\n            targetRoutePrefix = routePrefix.startsWith('/') ? routePrefix : `/${routePrefix}`;\n            targetRoutePrefix = targetRoutePrefix.endsWith('/') ? targetRoutePrefix : `${targetRoutePrefix}/`;\n         }\n\n         targetBase = `${globalThis.location.origin}${targetRoutePrefix}`;\n      }\n\n      return this.#createURL(url, targetBase);\n   }\n\n   // Internal implementation ----------------------------------------------------------------------------------------\n\n   /**\n    * Helper to create a URL and catch any exception. Useful until `URL.parse` and `URL.canParse` are more widespread.\n    *\n    * @param {string}   url - URL string.\n    *\n    * @param {string}   base - Base origin / path.\n    *\n    * @returns {URL | null} Valid URL or null.\n    */\n   static #createURL(url, base = '')\n   {\n      try { return new URL(url, base); }\n      catch(err) { return null; }\n   }\n}\n\nexport { BrowserSupports, ClipboardAccess, CrossWindow, URLParser };\n//# sourceMappingURL=index.js.map\n","import { writable, get } from 'svelte/store';\nimport { CrossWindow } from '@typhonjs-fvtt/runtime/util/browser';\n\n/**\n * Generates derived, readable, writable helper functions wrapping the given Storage API provided with any additional\n * customization for data serialization. By default, JSON serialization is used.\n *\n * @param {object}   opts - Generator options.\n *\n * @param {Storage}  opts.storage - The web storage source.\n *\n * @param {(value: any, ...rest: any[]) => string}  [opts.serialize] - Replace with custom serialization;\n *        default: `JSON.stringify`.\n *\n * @param {(value: string, ...rest: any[]) => any}  [opts.deserialize] - Replace with custom deserialization;\n *        default: `JSON.parse`.\n *\n * @returns {StorageStores} A complete set of store helper functions and associated storage API instance and\n *          serialization strategy.\n */\nfunction storeGenerator({ storage, serialize = JSON.stringify, deserialize = JSON.parse }) {\n    function isSimpleDeriver(deriver) {\n        return deriver.length < 2;\n    }\n    function storageReadable(key, value, start) {\n        return {\n            subscribe: storageWritable(key, value, start).subscribe\n        };\n    }\n    function storageWritable(key, value, start) {\n        function wrap_start(ogSet) {\n            return start(function wrap_set(new_value) {\n                if (storage) {\n                    storage.setItem(key, serialize(new_value));\n                }\n                return ogSet(new_value);\n            }, function wrap_update(fn) {\n                set(fn(get(ogStore)));\n            });\n        }\n        if (storage) {\n            const storageValue = storage.getItem(key);\n            try {\n                if (storageValue) {\n                    value = deserialize(storageValue);\n                }\n            }\n            catch (err) { /**/ }\n            storage.setItem(key, serialize(value));\n        }\n        const ogStore = writable(value, start ? wrap_start : void 0);\n        function set(new_value) {\n            if (storage) {\n                storage.setItem(key, serialize(new_value));\n            }\n            ogStore.set(new_value);\n        }\n        function update(fn) {\n            set(fn(get(ogStore)));\n        }\n        function subscribe(run, invalidate) {\n            return ogStore.subscribe(run, invalidate);\n        }\n        return { set, update, subscribe };\n    }\n    function storageDerived(key, stores, fn, initial_value) {\n        const single = !Array.isArray(stores);\n        const stores_array = single ? [stores] : stores;\n        if (storage && storage.getItem(key)) {\n            try {\n                initial_value = deserialize(storage.getItem(key));\n            }\n            catch (err) { /**/ }\n        }\n        return storageReadable(key, initial_value, (set, update) => {\n            let inited = false;\n            const values = [];\n            let pending = 0;\n            let cleanup;\n            const sync = () => {\n                if (pending) {\n                    return;\n                }\n                cleanup?.();\n                const input = single ? values[0] : values;\n                if (isSimpleDeriver(fn)) {\n                    set(fn(input));\n                }\n                else {\n                    const result = fn(input, set, update);\n                    if (typeof result === 'function') {\n                        cleanup = result;\n                    }\n                }\n            };\n            const unsubscribers = stores_array.map((store, i) => store.subscribe((value) => {\n                values[i] = value;\n                pending &= ~(1 << i);\n                if (inited) {\n                    sync();\n                }\n            }, () => { pending |= (1 << i); }));\n            inited = true;\n            sync();\n            return function stop() {\n                // Equivalent to run_all from Svelte internals.\n                unsubscribers.forEach((unsubscriber) => unsubscriber());\n                cleanup?.();\n            };\n        });\n    }\n    return {\n        readable: storageReadable,\n        writable: storageWritable,\n        derived: storageDerived,\n        storage,\n        serialize,\n        deserialize\n    };\n}\n\n/**\n * Provides all Storage API enabled `localStorage` store helper functions. Data is serialized as JSON.\n */\nconst localStores = storeGenerator({ storage: globalThis?.localStorage });\n/**\n * Provides the Storage API enabled derived `localStorage` store helper function. Data is serialized as JSON.\n */\nlocalStores.derived;\n/**\n * Provides the Storage API enabled readable `localStorage` store helper function. Data is serialized as JSON.\n */\nlocalStores.readable;\n/**\n * Provides the Storage API enabled writable `localStorage` store helper function. Data is serialized as JSON.\n */\nlocalStores.writable;\n\n/**\n * Provides all Storage API enabled `sessionStorage` store helper functions. Data is serialized as JSON.\n */\nconst sessionStores = storeGenerator({ storage: globalThis?.sessionStorage });\n/**\n * Provides the Storage API enabled derived `sessionStorage` store helper function. Data is serialized as JSON.\n */\nsessionStores.derived;\n/**\n * Provides the Storage API enabled readable `sessionStorage` store helper function. Data is serialized as JSON.\n */\nsessionStores.readable;\n/**\n * Provides the Storage API enabled writable `sessionStorage` store helper function. Data is serialized as JSON.\n */\nsessionStores.writable;\n\n/**\n * Provides the base Storage API store manager. It is recommended to use {@link TJSLocalStorage} &\n * {@link TJSSessionStorage} for standard browser local and session storage use cases. TJSWebStorage exists\n * to provide additional customization options for custom Storage API compatible storage instances and custom\n * serialization configuration.\n *\n * @implements {import('./types').WebStorage}\n */\nclass TJSWebStorage\n{\n   /** @type {import('./').StorageStores} */\n   #storageStores;\n\n   /**\n    * @type {(Map<string, {\n    *    store: import('svelte/store').Writable,\n    *    deserialize?: (value: string, ...rest: any[]) => any,\n    *    serialize?: (value: any, ...rest: any[]) => string\n    * }>)}\n    */\n   #stores = new Map();\n\n   /**\n    * @param {import('./').StorageStores} storageStores - Provides a complete set of\n    *        storage API store helper functions and the associated storage API instance and serializations strategy.\n    */\n   constructor(storageStores)\n   {\n      this.#storageStores = storageStores;\n   }\n\n   /**\n    * Creates a new store for the given key.\n    *\n    * @template T\n    *\n    * @param {string}   key - Key to lookup in stores map.\n    *\n    * @param {T}        [defaultValue] - A default value to set for the store.\n    *\n    * @param {import('./').StorageStores} [storageStores] - Additional store creation options.\n    *\n    * @returns {import('svelte/store').Writable<T>} The new store.\n    */\n   #createStore(key, defaultValue = void 0, storageStores)\n   {\n      try\n      {\n         const value = this.#storageStores.storage.getItem(key);\n         if (value !== null)\n         {\n            const deserialize = storageStores?.deserialize ?? this.#storageStores.deserialize;\n            defaultValue = deserialize(value);\n         }\n      }\n      catch (err) { /**/ }\n\n      const writable = storageStores?.writable ?? this.#storageStores.writable;\n\n      return writable(key, defaultValue);\n   }\n\n   /**\n    * @param {string}   key - Storage key.\n    *\n    * @returns {(value: string, ...rest: any[]) => any} Deserialize function.\n    */\n   #getDeserialize(key)\n   {\n      return this.#stores.get(key)?.deserialize ?? this.#storageStores.deserialize;\n   }\n\n   /**\n    * @param {string}   key - Storage key.\n    *\n    * @returns {(value: any, ...rest: any[]) => string} Serialize function.\n    */\n   #getSerialize(key)\n   {\n      return this.#stores.get(key)?.serialize ?? this.#storageStores.serialize;\n   }\n\n   /**\n    * Gets a store from the `stores` Map or creates a new store for the key and a given default value.\n    *\n    * @template T\n    *\n    * @param {string}   key - Key to lookup in stores map.\n    *\n    * @param {T}        [defaultValue] - A default value to set for the store.\n    *\n    * @param {import('./').StorageStores} [storageStores] - Additional store creation options.\n    *\n    * @returns {import('svelte/store').Writable<T>} The store for the given key.\n    */\n   #getStore(key, defaultValue = void 0, storageStores)\n   {\n      const storeEntry = this.#stores.get(key);\n      if (storeEntry) { return storeEntry.store; }\n\n      const store = this.#createStore(key, defaultValue, storageStores);\n\n      // Set any key specific storage helper details.\n      this.#stores.set(key, {\n         store,\n         deserialize: storageStores?.deserialize,\n         serialize: storageStores?.serialize\n      });\n\n      return store;\n   }\n\n   /**\n    * Get value from the storage API.\n    *\n    * @param {string}   key - Key to lookup in storage API.\n    *\n    * @param {*}        [defaultValue] - A default value to return if key not present in session storage.\n    *\n    * @returns {*} Value from session storage or if not defined any default value provided.\n    */\n   getItem(key, defaultValue)\n   {\n      let value = defaultValue;\n\n      const storageValue = this.#storageStores.storage.getItem(key);\n\n      if (storageValue !== null)\n      {\n         try\n         {\n            value = this.#getDeserialize(key)(storageValue);\n         }\n         catch (err)\n         {\n            value = defaultValue;\n         }\n      }\n      else if (defaultValue !== void 0)\n      {\n         try\n         {\n            const newValue = this.#getSerialize(key)(defaultValue);\n\n            // If there is no existing storage value and defaultValue is defined the storage value needs to be set.\n            this.#storageStores.storage.setItem(key, newValue);\n         }\n         catch (err) { /* */ }\n      }\n\n      return value;\n   }\n\n   /**\n    * Returns the backing Svelte store for the given key; potentially sets a default value if the key\n    * is not already set.\n    *\n    * @template T\n    *\n    * @param {string}   key - Key to lookup in storage API.\n    *\n    * @param {T}        [defaultValue] - A default value to return if key not present in session storage.\n    *\n    * @param {import('./').StorageStores} [storageStores] - Additional store creation options.\n    *\n    * @returns {import('svelte/store').Writable<T>} The Svelte store for this key.\n    */\n   getStore(key, defaultValue, storageStores)\n   {\n      return this.#getStore(key, defaultValue, storageStores);\n   }\n\n   /**\n    * Returns whether a store has already been created for the given key.\n    *\n    * @param {string}   key - Key to lookup in storage API.\n    */\n   hasStore(key)\n   {\n      return this.#stores.has(key);\n   }\n\n   /**\n    * Sets the value for the given key in storage API.\n    *\n    * @param {string}   key - Key to lookup in storage API.\n    *\n    * @param {*}        value - A value to set for this key.\n    */\n   setItem(key, value)\n   {\n      const store = this.#getStore(key);\n      store.set(value);\n   }\n\n   /**\n    * Convenience method to swap a boolean value stored in storage API updating the associated store value.\n    *\n    * @param {string}   key - Key to lookup in storage API.\n    *\n    * @param {boolean}  [defaultValue] - A default value to return if key not present in session storage.\n    *\n    * @returns {boolean} The boolean swap for the given key.\n    */\n   swapItemBoolean(key, defaultValue)\n   {\n      const store = this.#getStore(key, defaultValue);\n\n      let currentValue = false;\n\n      try\n      {\n         currentValue = !!this.#getDeserialize(key)(this.#storageStores.storage.getItem(key));\n      }\n      catch (err) { /**/ }\n\n      const newValue = typeof currentValue === 'boolean' ? !currentValue : false;\n\n      store.set(newValue);\n      return newValue;\n   }\n\n   // Iterators ------------------------------------------------------------------------------------------------------\n\n   /**\n    * @template T\n    *\n    * Returns an iterable for the session storage keys and stores.\n    *\n    * @param {RegExp} [regex] - Optional regular expression to filter by storage keys.\n    *\n    * @returns {IterableIterator<[string, import('svelte/store').Writable<T>]>} Iterable iterator of keys and stores.\n    * @yields {import('svelte/store').Writable<[string, Writable<T>]>}\n    */\n   *entries(regex = void 0)\n   {\n      if (regex !== void 0 && !CrossWindow.isRegExp(regex)) { throw new TypeError(`'regex' is not a RegExp`); }\n\n      if (!this.#stores.size) { return void 0; }\n\n      if (regex)\n      {\n         for (const key of this.#stores.keys())\n         {\n            if (regex.test(key)) { yield [key, this.getStore(key)]; }\n         }\n      }\n      else\n      {\n         for (const key of this.#stores.keys()) { yield [key, this.getStore(key)]; }\n      }\n   }\n\n   /**\n    * Returns an iterable for the session storage keys from existing stores.\n    *\n    * @param {RegExp} [regex] - Optional regular expression to filter by storage keys.\n    *\n    * @returns {IterableIterator<string>} Iterable iterator of session storage keys.\n    * @yields {string}\n    */\n   *keys(regex = void 0)\n   {\n      if (regex !== void 0 && !CrossWindow.isRegExp(regex)) { throw new TypeError(`'regex' is not a RegExp`); }\n\n      if (!this.#stores.size) { return void 0; }\n\n      if (regex)\n      {\n         for (const key of this.#stores.keys())\n         {\n            if (regex.test(key)) { yield key; }\n         }\n      }\n      else\n      {\n         for (const key of this.#stores.keys()) { yield key; }\n      }\n   }\n\n   /**\n    * @template T\n    *\n    * Returns an iterable for the session storage stores.\n    *\n    * @param {RegExp} [regex] - Optional regular expression to filter by storage keys.\n    *\n    * @returns {IterableIterator<import('svelte/store').Writable<T>>} Iterable iterator of stores.\n    * @yields {import('svelte/store').Writable<T>}\n    */\n   *stores(regex = void 0)\n   {\n      if (regex !== void 0 && !CrossWindow.isRegExp(regex)) { throw new TypeError(`'regex' is not a RegExp`); }\n\n      if (!this.#stores.size) { return void 0; }\n\n      if (regex)\n      {\n         for (const key of this.#stores.keys())\n         {\n            if (regex.test(key)) { yield this.getStore(key); }\n         }\n      }\n      else\n      {\n         for (const key of this.#stores.keys()) { yield this.getStore(key); }\n      }\n   }\n}\n\n/**\n * Provides a {@link TJSWebStorage} instance for standard browser local storage use cases.\n */\nclass TJSLocalStorage extends TJSWebStorage\n{\n   constructor()\n   {\n      super(localStores);\n   }\n}\n\n/**\n * Provides a {@link TJSWebStorage} instance for standard browser session storage use cases.\n */\nclass TJSSessionStorage extends TJSWebStorage\n{\n   constructor()\n   {\n      super(sessionStores);\n   }\n}\n\nexport { TJSLocalStorage, TJSSessionStorage, TJSWebStorage, localStores, sessionStores, storeGenerator };\n//# sourceMappingURL=index.js.map\n","import { derived, get } from 'svelte/store';\n\n/**\n * @external Store\n * @see [Svelte stores](https://svelte.dev/docs#component-format-script-4-prefix-stores-with-$-to-access-their-values-store-contract)\n */\n\n/**\n * Create a store similar to [Svelte's `derived`](https://svelte.dev/docs#run-time-svelte-store-writable),\n * but which has its own `set` and `update` methods and can send values back to the origin stores.\n * [Read more...](https://github.com/PixievoltNo1/svelte-writable-derived#default-export-writablederived)\n * \n * @param {Store|Store[]} origins One or more stores to derive from. Same as\n * [`derived`](https://svelte.dev/docs#run-time-svelte-store-writable)'s 1st parameter.\n * @param {!Function} derive The callback to determine the derived value. Same as\n * [`derived`](https://svelte.dev/docs#run-time-svelte-store-writable)'s 2nd parameter.\n * @param {!Function} reflect Called when the derived store gets a new value via its `set` or\n * `update` methods, and determines new values for the origin stores.\n * [Read more...](https://github.com/PixievoltNo1/svelte-writable-derived#new-parameter-reflect)\n * @param [initial] The new store's initial value. Same as\n * [`derived`](https://svelte.dev/docs#run-time-svelte-store-writable)'s 3rd parameter.\n * \n * @returns {Store} A writable store.\n */\nfunction writableDerived(origins, derive, reflect, initial) {\n\tvar childDerivedSetter, originValues, blockNextDerive = false;\n\tvar reflectOldValues = reflect.length >= 2;\n\tvar wrappedDerive = (got, set, update) => {\n\t\tchildDerivedSetter = set;\n\t\tif (reflectOldValues) {\n\t\t\toriginValues = got;\n\t\t}\n\t\tif (!blockNextDerive) {\n\t\t\tlet returned = derive(got, set, update);\n\t\t\tif (derive.length < 2) {\n\t\t\t\tset(returned);\n\t\t\t} else {\n\t\t\t\treturn returned;\n\t\t\t}\n\t\t}\n\t\tblockNextDerive = false;\n\t};\n\tvar childDerived = derived(origins, wrappedDerive, initial);\n\t\n\tvar singleOrigin = !Array.isArray(origins);\n\tfunction doReflect(reflecting) {\n\t\tvar setWith = reflect(reflecting, originValues);\n\t\tif (singleOrigin) {\n\t\t\tblockNextDerive = true;\n\t\t\torigins.set(setWith);\n\t\t} else {\n\t\t\tsetWith.forEach( (value, i) => {\n\t\t\t\tblockNextDerive = true;\n\t\t\t\torigins[i].set(value);\n\t\t\t} );\n\t\t}\n\t\tblockNextDerive = false;\n\t}\n\t\n\tvar tryingSet = false;\n\tfunction update(fn) {\n\t\tvar isUpdated, mutatedBySubscriptions, oldValue, newValue;\n\t\tif (tryingSet) {\n\t\t\tnewValue = fn( get(childDerived) );\n\t\t\tchildDerivedSetter(newValue);\n\t\t\treturn;\n\t\t}\n\t\tvar unsubscribe = childDerived.subscribe( (value) => {\n\t\t\tif (!tryingSet) {\n\t\t\t\toldValue = value;\n\t\t\t} else if (!isUpdated) {\n\t\t\t\tisUpdated = true;\n\t\t\t} else {\n\t\t\t\tmutatedBySubscriptions = true;\n\t\t\t}\n\t\t} );\n\t\tnewValue = fn(oldValue);\n\t\ttryingSet = true;\n\t\tchildDerivedSetter(newValue);\n\t\tunsubscribe();\n\t\ttryingSet = false;\n\t\tif (mutatedBySubscriptions) {\n\t\t\tnewValue = get(childDerived);\n\t\t}\n\t\tif (isUpdated) {\n\t\t\tdoReflect(newValue);\n\t\t}\n\t}\n\treturn {\n\t\tsubscribe: childDerived.subscribe,\n\t\tset(value) { update( () => value ); },\n\t\tupdate,\n\t};\n}\n\n/**\n * Create a store for a property value in an object contained in another store.\n * [Read more...](https://github.com/PixievoltNo1/svelte-writable-derived#named-export-propertystore)\n * \n * @param {Store} origin The store containing the object to get/set from.\n * @param {string|number|symbol|Array<string|number|symbol>} propName The property to get/set, or a path of\n * properties in nested objects.\n *\n * @returns {Store} A writable store.\n */\nfunction propertyStore(origin, propName) {\n\tif (!Array.isArray(propName)) {\n\t\treturn writableDerived(\n\t\t\torigin,\n\t\t\t(object) => object[propName],\n\t\t\t(reflecting, object) => {\n\t\t\t\tobject[propName] = reflecting;\n\t\t\t\treturn object;\n\t\t\t},\n\t\t);\n\t} else {\n\t\tlet props = propName.concat();\n\t\treturn writableDerived(\n\t\t\torigin,\n\t\t\t(value) => {\n\t\t\t\tfor (let i = 0; i < props.length; ++i) {\n\t\t\t\t\tvalue = value[ props[i] ];\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\t(reflecting, object) => {\n\t\t\t\tlet target = object;\n\t\t\t\tfor (let i = 0; i < props.length - 1; ++i) {\n\t\t\t\t\ttarget = target[ props[i] ];\n\t\t\t\t}\n\t\t\t\ttarget[ props[props.length - 1] ] = reflecting;\n\t\t\t\treturn object;\n\t\t\t},\n\t\t);\n\t}\n}\n\nexport { propertyStore, writableDerived };\n//# sourceMappingURL=index.js.map\n","import { CrossWindow } from '@typhonjs-fvtt/runtime/util/browser';\nimport { isObject } from '@typhonjs-fvtt/runtime/util/object';\nimport { group_outros, transition_out, check_outros } from 'svelte/internal';\n\n/**\n * Provides utilities to verify and parse {@link TJSSvelte.Config} configuration objects.\n */\nclass APIConfig {\n    constructor() { }\n    /**\n     * Validates `config` argument whether it is a valid {@link TJSSvelte.Config.Dynamic} or\n     * {@link TJSSvelte.Config.Standard} configuration object suitable for parsing by\n     * {@link TJSSvelte.API.Config.parseConfig}.\n     *\n     * @param config - The potential config object to validate.\n     *\n     * @param [options] - Options.\n     *\n     * @param [options.raiseException=false] - If validation fails raise an exception.\n     *\n     * @returns Is the config a valid TJSSvelte.Config.Dynamic or TJSSvelte.Config.Standard configuration object.\n     *\n     * @throws {TypeError}  Any validation error when `raiseException` is enabled.\n     */\n    static isConfig(config, { raiseException = false } = {}) {\n        if (!isObject(config)) {\n            if (raiseException) {\n                throw new TypeError(`TJSSvelte.config.isConfig error: 'config' is not an object.`);\n            }\n            return false;\n        }\n        if (!TJSSvelte.util.isComponent(config.class)) {\n            if (raiseException) {\n                throw new TypeError(`TJSSvelte.config.isConfig error: 'config.class' is not a Svelte component constructor.`);\n            }\n            return false;\n        }\n        return true;\n    }\n    /**\n     * Validates `config` argument whether it is a valid {@link TJSSvelte.Config.Embed} configuration object\n     * suitable for directly mounting via the `<svelte:component>` directive.\n     *\n     * @param config - The potential config object to validate.\n     *\n     * @param [options] - Options.\n     *\n     * @param [options.raiseException=false] - If validation fails raise an exception.\n     *\n     * @returns Is the config a valid TJSSvelte.Config.Embed configuration object.\n     *\n     * @throws {TypeError}  Any validation error when `raiseException` is enabled.\n     */\n    static isConfigEmbed(config, { raiseException = false } = {}) {\n        if (!isObject(config)) {\n            if (raiseException) {\n                throw new TypeError(`TJSSvelte.config.isConfigEmbed error: 'config' is not an object.`);\n            }\n            return false;\n        }\n        if (!TJSSvelte.util.isComponent(config.class)) {\n            if (raiseException) {\n                throw new TypeError(`TJSSvelte.config.isConfigEmbed error: 'config.class' is not a Svelte component constructor.`);\n            }\n            return false;\n        }\n        if (config.props !== void 0 && !isObject(config.props)) {\n            if (raiseException) {\n                throw new TypeError(`TJSSvelte.config.isConfigEmbed error: 'config.props' is not an object.`);\n            }\n            return false;\n        }\n        return true;\n    }\n    /**\n     * Parses a TyphonJS Svelte dynamic or standard config object ensuring that the class specified is a Svelte\n     * component, loads any dynamic defined `context` or `props` preparing the config object for loading into the\n     * Svelte component.\n     *\n     * @param config - Svelte config object.\n     *\n     * @param [options] - Options.\n     *\n     * @param [options.contextExternal] - When true any context data provided will be loaded into `#external`\n     *        context separating it from any internal context created by the component.\n     *\n     * @param [options.thisArg] - `This` reference to set for invoking any `context` or `props` defined as\n     *        functions for {@link Config.Dynamic} configuration objects.\n     *\n     * @returns The processed Svelte config object turned with parsed `props` & `context` converted into the format\n     *          supported by Svelte.\n     */\n    static parseConfig(config, { contextExternal = false, thisArg = void 0 } = {}) {\n        if (!isObject(config)) {\n            throw new TypeError(`TJSSvelte.config.parseConfig - 'config' is not an object:\\n${JSON.stringify(config)}.`);\n        }\n        if (!TJSSvelte.util.isComponent(config.class)) {\n            throw new TypeError(`TJSSvelte.config.parseConfig - 'class' is not a Svelte component constructor for config:\\n${JSON.stringify(config)}.`);\n        }\n        if (config.hydrate !== void 0 && typeof config.hydrate !== 'boolean') {\n            throw new TypeError(`TJSSvelte.config.parseConfig - 'hydrate' is not a boolean for config:\\n${JSON.stringify(config)}.`);\n        }\n        if (config.intro !== void 0 && typeof config.intro !== 'boolean') {\n            throw new TypeError(`TJSSvelte.config.parseConfig - 'intro' is not a boolean for config:\\n${JSON.stringify(config)}.`);\n        }\n        if (config.target !== void 0 && !CrossWindow.isElement(config.target) &&\n            !CrossWindow.isShadowRoot(config.target) && !CrossWindow.isDocumentFragment(config.target)) {\n            throw new TypeError(`TJSSvelte.config.parseConfig - 'target' is not a Element, ShadowRoot, or DocumentFragment for config:\\n${JSON.stringify(config)}.`);\n        }\n        if (config.anchor !== void 0 && !CrossWindow.isElement(config.anchor) &&\n            !CrossWindow.isShadowRoot(config.anchor) && !CrossWindow.isDocumentFragment(config.anchor)) {\n            throw new TypeError(`TJSSvelte.config.parseConfig - 'anchor' is not a string, Element for config:\\n${JSON.stringify(config)}.`);\n        }\n        if (config.context !== void 0 && typeof config.context !== 'function' && !isObject(config.context)) {\n            throw new TypeError(`TJSSvelte.config.parseConfig - 'context' is not a function or object for config:\\n${JSON.stringify(config)}.`);\n        }\n        const svelteConfig = { ...config };\n        let context = {};\n        // If a context callback function is provided then invoke it with `this` being the Foundry app.\n        // If an object is returned it adds the entries to external context.\n        if (typeof svelteConfig.context === 'function') {\n            const contextFunc = svelteConfig.context;\n            delete svelteConfig.context;\n            const result = contextFunc.call(thisArg);\n            if (isObject(result)) {\n                context = { ...result };\n            }\n            else {\n                throw new Error(`TJSSvelte.config.parseConfig - 'context' is a function that did not return an object for config:\\n${JSON.stringify(config)}`);\n            }\n        }\n        else if (isObject(svelteConfig.context)) {\n            context = svelteConfig.context;\n            delete svelteConfig.context;\n        }\n        // If a props is a function then invoke it with `this` being the Foundry app.\n        // If an object is returned set it as the props.\n        svelteConfig.props = this.#processProps(svelteConfig.props, thisArg, config);\n        if (contextExternal) {\n            svelteConfig.context = new Map();\n            svelteConfig.context.set('#external', context);\n        }\n        else {\n            svelteConfig.context = new Map(Object.entries(context));\n        }\n        return svelteConfig;\n    }\n    // Internal implementation ----------------------------------------------------------------------------------------\n    /**\n     * Processes Svelte props. Potentially props can be a function to invoke with `thisArg`.\n     *\n     * @param props - Svelte props.\n     *\n     * @param thisArg - `This` reference to set for invoking any props function.\n     *\n     * @param config - Svelte config\n     *\n     * @returns Svelte props.\n     */\n    static #processProps(props, thisArg, config) {\n        // If a props is a function then invoke it with `this` being the Foundry app.\n        // If an object is returned set it as the props.\n        if (typeof props === 'function') {\n            const result = props.call(thisArg);\n            if (isObject(result)) {\n                return result;\n            }\n            else {\n                throw new Error(`TJSSvelte.config.parseConfig - 'props' is a function that did not return an object for config:\\n${JSON.stringify(config)}`);\n            }\n        }\n        else if (isObject(props)) {\n            return props;\n        }\n        else if (props !== void 0) {\n            throw new Error(`TJSSvelte.config.parseConfig - 'props' is not a function or an object for config:\\n${JSON.stringify(config)}`);\n        }\n        return {};\n    }\n}\nObject.seal(APIConfig);\n\n// @ts-ignore\n/**\n * Various utilities to duck type / detect Svelte components and run outro transition while destroying a component\n * externally.\n */\nclass APIUtil {\n    constructor() { }\n    /**\n     * Provides basic duck typing to determine if the provided function is a constructor function for a Svelte\n     * component.\n     *\n     * @param comp - Data to check as a Svelte component.\n     *\n     * @returns Whether basic duck typing succeeds.\n     */\n    static isComponent(comp) {\n        if (comp === null || comp === void 0 || typeof comp !== 'function') {\n            return false;\n        }\n        // When using Vite in a developer build the SvelteComponent is wrapped in a ProxyComponent class.\n        // This class doesn't define methods on the prototype, so we must check if the constructor name\n        // starts with `Proxy<` as it provides the wrapped component as `Proxy<_wrapped component name_>`.\n        const prototypeName = comp?.prototype?.constructor?.name;\n        if (typeof prototypeName === 'string' && (prototypeName.startsWith('Proxy<') ||\n            prototypeName === 'ProxyComponent')) {\n            return true;\n        }\n        return typeof window !== 'undefined' ?\n            typeof comp?.prototype?.$destroy === 'function' && typeof comp?.prototype?.$on === 'function' : // client-side\n            typeof comp?.prototype?.render === 'function'; // server-side\n    }\n    /**\n     * Provides basic duck typing to determine if the provided object is a HMR ProxyComponent instance or class.\n     *\n     * @param {unknown}  comp - Data to check as a HMR proxy component.\n     *\n     * @returns {boolean} Whether basic duck typing succeeds.\n     */\n    static isHMRProxy(comp) {\n        const instanceName = comp?.constructor?.name;\n        if (typeof instanceName === 'string' && (instanceName.startsWith('Proxy<') || instanceName === 'ProxyComponent')) {\n            return true;\n        }\n        // @ts-ignore\n        const prototypeName = comp?.prototype?.constructor?.name;\n        return typeof prototypeName === 'string' && (prototypeName.startsWith('Proxy<') ||\n            prototypeName === 'ProxyComponent');\n    }\n    /**\n     * Runs outro transition then destroys Svelte component.\n     *\n     * Workaround for https://github.com/sveltejs/svelte/issues/4056\n     *\n     * @param instance - A Svelte component.\n     *\n     * @returns Promise returned after outro transition completed and component destroyed.\n     */\n    static async outroAndDestroy(instance) {\n        if (instance === void 0 || instance === null) {\n            return Promise.resolve();\n        }\n        return new Promise((resolve) => {\n            if (instance?.$$?.fragment && instance?.$$?.fragment?.o) {\n                group_outros();\n                transition_out(instance.$$.fragment, 0, 0, () => {\n                    instance?.$destroy?.();\n                    resolve();\n                });\n                check_outros();\n            }\n            else {\n                instance?.$destroy?.();\n                resolve();\n            }\n        });\n    }\n}\nObject.seal(APIUtil);\n\n/**\n * Provides utilities to verify and parse {@link TJSSvelte.Config} configuration objects and general verification of\n * Svelte components.\n */\nclass TJSSvelte {\n    constructor() { }\n    static get config() { return APIConfig; }\n    /**\n     * @returns The utility API.\n     */\n    static get util() { return APIUtil; }\n}\nObject.seal(TJSSvelte);\n\nexport { TJSSvelte };\n//# sourceMappingURL=index.js.map\n","/*\nAdapted from https://github.com/mattdesl\nDistributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md\n*/\nexport { identity as linear } from '../internal/index.js';\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function backInOut(t) {\n\tconst s = 1.70158 * 1.525;\n\tif ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));\n\treturn 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function backIn(t) {\n\tconst s = 1.70158;\n\treturn t * t * ((s + 1) * t - s);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function backOut(t) {\n\tconst s = 1.70158;\n\treturn --t * t * ((s + 1) * t + s) + 1;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function bounceOut(t) {\n\tconst a = 4.0 / 11.0;\n\tconst b = 8.0 / 11.0;\n\tconst c = 9.0 / 10.0;\n\tconst ca = 4356.0 / 361.0;\n\tconst cb = 35442.0 / 1805.0;\n\tconst cc = 16061.0 / 1805.0;\n\tconst t2 = t * t;\n\treturn t < a\n\t\t? 7.5625 * t2\n\t\t: t < b\n\t\t? 9.075 * t2 - 9.9 * t + 3.4\n\t\t: t < c\n\t\t? ca * t2 - cb * t + cc\n\t\t: 10.8 * t * t - 20.52 * t + 10.72;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function bounceInOut(t) {\n\treturn t < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0)) : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function bounceIn(t) {\n\treturn 1.0 - bounceOut(1.0 - t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function circInOut(t) {\n\tif ((t *= 2) < 1) return -0.5 * (Math.sqrt(1 - t * t) - 1);\n\treturn 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function circIn(t) {\n\treturn 1.0 - Math.sqrt(1.0 - t * t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function circOut(t) {\n\treturn Math.sqrt(1 - --t * t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function cubicInOut(t) {\n\treturn t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function cubicIn(t) {\n\treturn t * t * t;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function cubicOut(t) {\n\tconst f = t - 1.0;\n\treturn f * f * f + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function elasticInOut(t) {\n\treturn t < 0.5\n\t\t? 0.5 * Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) * Math.pow(2.0, 10.0 * (2.0 * t - 1.0))\n\t\t: 0.5 *\n\t\t\t\tMath.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) *\n\t\t\t\tMath.pow(2.0, -10.0 * (2.0 * t - 1.0)) +\n\t\t\t\t1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function elasticIn(t) {\n\treturn Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0));\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function elasticOut(t) {\n\treturn Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function expoInOut(t) {\n\treturn t === 0.0 || t === 1.0\n\t\t? t\n\t\t: t < 0.5\n\t\t? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)\n\t\t: -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function expoIn(t) {\n\treturn t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0));\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function expoOut(t) {\n\treturn t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quadInOut(t) {\n\tt /= 0.5;\n\tif (t < 1) return 0.5 * t * t;\n\tt--;\n\treturn -0.5 * (t * (t - 2) - 1);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quadIn(t) {\n\treturn t * t;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quadOut(t) {\n\treturn -t * (t - 2.0);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quartInOut(t) {\n\treturn t < 0.5 ? +8.0 * Math.pow(t, 4.0) : -8.0 * Math.pow(t - 1.0, 4.0) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quartIn(t) {\n\treturn Math.pow(t, 4.0);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quartOut(t) {\n\treturn Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quintInOut(t) {\n\tif ((t *= 2) < 1) return 0.5 * t * t * t * t * t;\n\treturn 0.5 * ((t -= 2) * t * t * t * t + 2);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quintIn(t) {\n\treturn t * t * t * t * t;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quintOut(t) {\n\treturn --t * t * t * t * t + 1;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function sineInOut(t) {\n\treturn -0.5 * (Math.cos(Math.PI * t) - 1);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function sineIn(t) {\n\tconst v = Math.cos(t * Math.PI * 0.5);\n\tif (Math.abs(v) < 1e-14) return 1;\n\telse return 1 - v;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function sineOut(t) {\n\treturn Math.sin((t * Math.PI) / 2);\n}\n","import * as svelteEasingFunc from 'svelte/easing';\n\n/**\n * Defines a read-only list of Svelte easing function names.\n *\n * @type {Readonly<import('./types').EasingFunctionName[]>}\n */\nconst easingList = Object.freeze([\n   'backIn',\n   'backInOut',\n   'backOut',\n   'bounceIn',\n   'bounceInOut',\n   'bounceOut',\n   'circIn',\n   'circInOut',\n   'circOut',\n   'cubicIn',\n   'cubicInOut',\n   'cubicOut',\n   'elasticIn',\n   'elasticInOut',\n   'elasticOut',\n   'expoIn',\n   'expoInOut',\n   'expoOut',\n   'linear',\n   'quadIn',\n   'quadInOut',\n   'quadOut',\n   'quartIn',\n   'quartInOut',\n   'quartOut',\n   'quintIn',\n   'quintInOut',\n   'quintOut',\n   'sineIn',\n   'sineInOut',\n   'sineOut'\n]);\n\n/**\n * @type {Readonly<{ [key in import('./types').EasingFunctionName]: import('#runtime/svelte/easing').EasingFunction }>}\n */\nconst easingFunc = svelteEasingFunc;\n\n/**\n * Performs a lookup for standard Svelte easing functions by name. For convenience if passing in a function it is\n * returned verbatim.\n *\n * @param {import('./types').EasingReference} easingRef - The name of a standard Svelte easing function or a supplied\n *        easing function.\n *\n * @param {object}   [options] - Optional parameters.\n *\n * @param {import('./types').EasingFunctionName | false} [options.default='linear'] - A default easing function by\n *        name to return. When specified as `false` no default fallback easing function is selected. The default value\n *        is `linear`.\n *\n * @returns {import('#runtime/svelte/easing').EasingFunction} The requested easing function.\n */\nfunction getEasingFunc(easingRef, options)\n{\n   if (typeof easingRef === 'function') { return easingRef; }\n\n   const easingFn = easingFunc[easingRef];\n\n   return easingFn ? easingFn : easingFunc[options?.default ?? 'linear'];\n}\n\nexport { easingFunc, easingList, getEasingFunc };\n//# sourceMappingURL=index.js.map\n","import { CrossWindow } from '@typhonjs-fvtt/runtime/util/browser';\nimport { isObject, isIterable } from '@typhonjs-fvtt/runtime/util/object';\n\n/**\n * Provides several helpful utility methods for accessibility and keyboard navigation.\n *\n * Note: Global debugging can be enabled by setting `A11yHelper.debug = true`.\n */\nclass A11yHelper\n{\n   /**\n    * You can set global focus debugging enabled by setting `A11yHelper.debug = true`.\n    *\n    * @type {boolean}\n    */\n   static #globalDebug = false;\n\n   /**\n    * @returns {boolean} Global debugging enabled.\n    */\n   static get debug() { return this.#globalDebug; }\n\n   /**\n    * @param {boolean}  debug - Global debug enabled\n    */\n   static set debug(debug)\n   {\n      if (typeof debug !== 'boolean') { throw new TypeError(`'debug' is not a boolean.`); }\n\n      this.#globalDebug = debug;\n   }\n\n   /**\n    * Runs a media query to determine if the user / OS configuration is set up for reduced motion / animation.\n    *\n    * @returns {boolean} User prefers reduced motion.\n    */\n   static get prefersReducedMotion()\n   {\n      return globalThis?.matchMedia('(prefers-reduced-motion: reduce)')?.matches ?? false;\n   }\n\n   /**\n    * Apply focus to the HTMLElement / SVGElement targets in a given A11yFocusSource data object. An iterable list\n    * `options.focusEl` can contain HTMLElement / SVGElements or selector strings. If multiple focus targets are\n    * provided in a list then the first valid target found will be focused. If focus target is a string then a lookup\n    * via `document.querySelector` is performed. In this case you should provide a unique selector for the desired\n    * focus target.\n    *\n    * Note: The body of this method is postponed to the next clock tick to allow any changes in the DOM to occur that\n    * might alter focus targets before applying.\n    *\n    * @param {A11yFocusSource | { focusSource: A11yFocusSource }}   options - The focus options instance to apply.\n    */\n   static applyFocusSource(options)\n   {\n      if (!isObject(options)) { return; }\n\n      // Handle the case of receiving an object with embedded `focusSource`.\n      const focusOpts = isObject(options?.focusSource) ? options.focusSource : options;\n\n      setTimeout(() =>\n      {\n         const debug = typeof focusOpts.debug === 'boolean' ? this.debug || focusOpts.debug : this.debug;\n\n         if (isIterable(focusOpts.focusEl))\n         {\n            if (debug)\n            {\n               console.debug(`A11yHelper.applyFocusSource debug - Attempting to apply focus target: `,\n                focusOpts.focusEl);\n            }\n\n            for (const target of focusOpts.focusEl)\n            {\n               if (target?.nodeType === Node.ELEMENT_NODE && target?.isConnected)\n               {\n                  target?.focus();\n                  if (debug)\n                  {\n                     console.debug(`A11yHelper.applyFocusSource debug - Applied focus to target: `, target);\n                  }\n                  break;\n               }\n               else if (typeof target === 'string')\n               {\n                  const element = document.querySelector(target);\n                  if (element?.nodeType === Node.ELEMENT_NODE && element?.isConnected)\n                  {\n                     element?.focus();\n                     if (debug)\n                     {\n                        console.debug(`A11yHelper.applyFocusSource debug - Applied focus to target: `, element);\n                     }\n                     break;\n                  }\n                  else if (debug)\n                  {\n                     console.debug(`A11yHelper.applyFocusSource debug - Could not query selector: `, target);\n                  }\n               }\n            }\n         }\n         else if (debug)\n         {\n            console.debug(`A11yHelper.applyFocusSource debug - No focus targets defined.`);\n         }\n      }, 0);\n   }\n\n   /**\n    * Returns first focusable element within a specified element.\n    *\n    * @param {Element | Document} [element=document] - Optional element to start query.\n    *\n    * @param {FocusableElementOptions} [options] - Optional parameters.\n    *\n    * @returns {FocusableElement} First focusable child element.\n    */\n   static getFirstFocusableElement(element = document, options)\n   {\n      const focusableElements = this.getFocusableElements(element, options);\n\n      return focusableElements.length > 0 ? focusableElements[0] : void 0;\n   }\n\n   /**\n    * Returns all focusable elements within a specified element.\n    *\n    * @param {Element | Document} [element=document] Optional element to start query.\n    *\n    * @param {FocusableElementOptions} [options] - Optional parameters.\n    *\n    * @returns {Array<FocusableElement>} Child keyboard focusable elements.\n    */\n   static getFocusableElements(element = document, { anchorHref = true, ignoreClasses, ignoreElements,\n    parentHidden = false, selectors } = {})\n   {\n      if (element?.nodeType !== Node.ELEMENT_NODE && element?.nodeType !== Node.DOCUMENT_NODE)\n      {\n         throw new TypeError(`'element' is not a HTMLElement, SVGElement, or Document instance.`);\n      }\n\n      if (typeof anchorHref !== 'boolean')\n      {\n         throw new TypeError(`'anchorHref' is not a boolean.`);\n      }\n\n      if (ignoreClasses !== void 0 && !isIterable(ignoreClasses))\n      {\n         throw new TypeError(`'ignoreClasses' is not an iterable list.`);\n      }\n\n      if (ignoreElements !== void 0 && !CrossWindow.isSet(ignoreElements))\n      {\n         throw new TypeError(`'ignoreElements' is not a Set.`);\n      }\n\n      if (selectors !== void 0 && typeof selectors !== 'string')\n      {\n         throw new TypeError(`'selectors' is not a string.`);\n      }\n\n      const selectorQuery = selectors ?? this.#getFocusableSelectors(anchorHref);\n\n      let allElements = [...element.querySelectorAll(selectorQuery)];\n\n      if (ignoreElements && ignoreClasses)\n      {\n         allElements = allElements.filter((el) =>\n         {\n            let hasIgnoreClass = false;\n            for (const ignoreClass of ignoreClasses)\n            {\n               if (el.classList.contains(ignoreClass))\n               {\n                  hasIgnoreClass = true;\n                  break;\n               }\n            }\n\n            return !hasIgnoreClass && !ignoreElements.has(el) && el.style.display !== 'none' &&\n             el.style.visibility !== 'hidden' && !el.hasAttribute('disabled') && !el.hasAttribute('inert') &&\n              el.getAttribute('aria-hidden') !== 'true';\n         });\n      }\n      else if (ignoreClasses)\n      {\n         allElements = allElements.filter((el) =>\n         {\n            let hasIgnoreClass = false;\n            for (const ignoreClass of ignoreClasses)\n            {\n               if (el.classList.contains(ignoreClass))\n               {\n                  hasIgnoreClass = true;\n                  break;\n               }\n            }\n\n            return !hasIgnoreClass && el.style.display !== 'none' && el.style.visibility !== 'hidden' &&\n             !el.hasAttribute('disabled') && !el.hasAttribute('inert') && el.getAttribute('aria-hidden') !== 'true';\n         });\n      }\n      else if (ignoreElements)\n      {\n         allElements = allElements.filter((el) =>\n         {\n            return !ignoreElements.has(el) && el.style.display !== 'none' && el.style.visibility !== 'hidden' &&\n             !el.hasAttribute('disabled') && !el.hasAttribute('inert') && el.getAttribute('aria-hidden') !== 'true';\n         });\n      }\n      else\n      {\n         allElements = allElements.filter((el) =>\n         {\n            return el.style.display !== 'none' && el.style.visibility !== 'hidden' && !el.hasAttribute('disabled') &&\n             !el.hasAttribute('inert') && el.getAttribute('aria-hidden') !== 'true';\n         });\n      }\n\n      if (parentHidden)\n      {\n         allElements = allElements.filter((el) =>\n         {\n            return !this.isParentHidden(el, element);\n         });\n      }\n\n      return allElements;\n   }\n\n   /**\n    * Returns the default focusable selectors query.\n    *\n    * @param {boolean}  [anchorHref=true] - When true anchors must have an HREF.\n    *\n    * @returns {string} Focusable selectors for `querySelectorAll`.\n    */\n   static #getFocusableSelectors(anchorHref = true)\n   {\n      return `button, [contenteditable=\"\"], [contenteditable=\"true\"], details summary:not([tabindex=\"-1\"]), embed, a${\n       anchorHref ? '[href]' : ''}, iframe, object, input:not([type=hidden]), select, textarea, ` +\n        `[tabindex]:not([tabindex=\"-1\"])`;\n   }\n\n   /**\n    * Gets a A11yFocusSource object from the given DOM event allowing for optional X / Y screen space overrides.\n    * Browsers (Firefox / Chrome) forwards a mouse event for the context menu keyboard button. Provides detection of\n    * when the context menu event is from the keyboard. Firefox as of (1/23) does not provide the correct screen space\n    * coordinates, so for keyboard context menu presses coordinates are generated from the centroid point of the\n    * element.\n    *\n    * A default fallback element or selector string may be provided to provide the focus target. If the event comes from\n    * the keyboard however the source focused element is inserted as the target with the fallback value appended to the\n    * list of focus targets. When A11yFocusSource is applied by {@link A11yHelper.applyFocusSource} the target focus\n    * list is iterated through until a connected target is found and focus applied.\n    *\n    * @param {object} options - Options\n    *\n    * @param {KeyboardEvent | MouseEvent}   [options.event] - The source DOM event.\n    *\n    * @param {boolean} [options.debug] - When true {@link A11yHelper.applyFocusSource} logs focus target data.\n    *\n    * @param {FocusableElement | string} [options.focusEl] - A specific HTMLElement / SVGElement or selector\n    *        string as the focus target.\n    *\n    * @param {number}   [options.x] - Used when an event isn't provided; integer of event source in screen space.\n    *\n    * @param {number}   [options.y] - Used when an event isn't provided; integer of event source in screen space.\n    *\n    * @returns {A11yFocusSource} A A11yFocusSource object.\n    *\n    * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1426671\n    * @see https://bugzilla.mozilla.org/show_bug.cgi?id=314314\n    *\n    * @privateRemarks\n    * TODO: Evaluate / test against touch input devices.\n    */\n   static getFocusSource({ event, x, y, focusEl, debug = false })\n   {\n      if (focusEl !== void 0 && !this.isFocusSource(focusEl))\n      {\n         throw new TypeError(\n          `A11yHelper.getFocusSource error: 'focusEl' is not a HTMLElement, SVGElement, or string.`);\n      }\n\n      if (debug !== void 0 && typeof debug !== 'boolean')\n      {\n         throw new TypeError(`A11yHelper.getFocusSource error: 'debug' is not a boolean.`);\n      }\n\n      const debugEnabled = typeof debug === 'boolean' ? this.debug || debug : this.debug;\n\n      // Handle the case when no event is provided and x, y, or focusEl is explicitly defined.\n      if (event === void 0)\n      {\n         if (typeof x !== 'number')\n         {\n            throw new TypeError(`A11yHelper.getFocusSource error: 'event' not defined and 'x' is not a number.`);\n         }\n\n         if (typeof y !== 'number')\n         {\n            throw new TypeError(`A11yHelper.getFocusSource error: 'event' not defined and 'y' is not a number.`);\n         }\n\n         const result = {\n            debug,\n            focusEl: focusEl !== void 0 ? [focusEl] : void 0,\n            x,\n            y,\n         };\n\n         if (debugEnabled)\n         {\n            console.debug(`A11yHelper.getFocusSource debug: generated 'focusSource' without event: `, result);\n         }\n\n         return result;\n      }\n\n      // Perform duck typing on event constructor name.\n      if (event !== void 0 && !CrossWindow.isUserInputEvent(event))\n      {\n         throw new TypeError(\n          `A11yHelper.getFocusSource error: 'event' is not a KeyboardEvent, MouseEvent, or PointerEvent.`);\n      }\n\n      if (x !== void 0 && !Number.isInteger(x))\n      {\n         throw new TypeError(`A11yHelper.getFocusSource error: 'x' is not a number.`);\n      }\n\n      if (y !== void 0 && !Number.isInteger(y))\n      {\n         throw new TypeError(`A11yHelper.getFocusSource error: 'y' is not a number.`);\n      }\n\n      /** @type {Element} */\n      let targetEl;\n\n      if (event)\n      {\n         if (A11yHelper.isFocusable(event.target))\n         {\n            targetEl = event.target;\n            if (debugEnabled)\n            {\n               console.debug(`A11yHelper.getFocusSource debug: 'targetEl' set to event.target: `, targetEl);\n            }\n         }\n         else if (A11yHelper.isFocusable(event.currentTarget))\n         {\n            targetEl = event.currentTarget;\n            if (debugEnabled)\n            {\n               console.debug(`A11yHelper.getFocusSource debug: 'targetEl' set to event.currentTarget: `, targetEl);\n            }\n         }\n         else\n         {\n            if (debugEnabled)\n            {\n               console.debug(\n                `A11yHelper.getFocusSource debug: 'event.target' / 'event.currentTarget' are not focusable.`);\n               console.debug(`A11yHelper.getFocusSource debug: 'event.target': `, event.target);\n               console.debug(`A11yHelper.getFocusSource debug: 'event.currentTarget': `, event.currentTarget);\n            }\n         }\n\n         if (targetEl)\n         {\n            if (targetEl?.nodeType !== Node.ELEMENT_NODE && typeof targetEl?.focus !== 'function')\n            {\n               throw new TypeError(`A11yHelper.getFocusSource error: 'targetEl' is not an HTMLElement or SVGElement.`);\n            }\n         }\n      }\n\n      const result = { debug };\n\n      // Perform duck typing on event constructor name.\n      if (CrossWindow.isPointerEvent(event))\n      {\n         // Firefox currently (11/24) does not correctly determine the location of a keyboard originated\n         // context menu location, so calculate position from middle of the event target.\n         // Firefox fires a mouse event for the context menu key.\n         if (event?.button !== 2 && event.type === 'contextmenu')\n         {\n            // Always include x / y coordinates and targetEl may not be defined.\n            const rectTarget = targetEl ?? event.target;\n\n            const rect = rectTarget.getBoundingClientRect();\n            result.source = 'keyboard';\n            result.x = x ?? rect.left + (rect.width / 2);\n            result.y = y ?? rect.top + (rect.height / 2);\n            result.focusEl = targetEl ? [targetEl] : [];\n\n            if (focusEl) { result.focusEl.push(focusEl); }\n         }\n         else\n         {\n            result.source = 'pointer';\n            result.x = x ?? event.pageX;\n            result.y = y ?? event.pageY;\n            result.focusEl = targetEl ? [targetEl] : [];\n\n            if (focusEl) { result.focusEl.push(focusEl); }\n         }\n      }\n      else\n      {\n         // Always include x / y coordinates and targetEl may not be defined.\n         const rectTarget = targetEl ?? event?.target;\n\n         if (rectTarget)\n         {\n            const rect = rectTarget.getBoundingClientRect();\n            result.source = 'keyboard';\n            result.x = x ?? rect.left + (rect.width / 2);\n            result.y = y ?? rect.top + (rect.height / 2);\n            result.focusEl = targetEl ? [targetEl] : [];\n         }\n\n         if (focusEl) { result.focusEl.push(focusEl); }\n      }\n\n      if (debugEnabled)\n      {\n         console.debug(`A11yHelper.getFocusSource debug: generated 'focusSource' with event: `, result);\n      }\n\n      return result;\n   }\n\n   /**\n    * Returns first focusable element within a specified element.\n    *\n    * @param {Element | Document} [element=document] - Optional element to start query.\n    *\n    * @param {FocusableElementOptions} [options] - Optional parameters.\n    *\n    * @returns {FocusableElement} Last focusable child element.\n    */\n   static getLastFocusableElement(element = document, options)\n   {\n      const focusableElements = this.getFocusableElements(element, options);\n\n      return focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : void 0;\n   }\n\n   /**\n    * Tests if the given element is focusable.\n    *\n    * @param {unknown} el - Element to test.\n    *\n    * @param {object} [options] - Optional parameters.\n    *\n    * @param {boolean} [options.anchorHref=true] - When true anchors must have an HREF.\n    *\n    * @param {Iterable<string>} [options.ignoreClasses] - Iterable list of classes to ignore elements.\n    *\n    * @returns {boolean} Element is focusable.\n    */\n   static isFocusable(el, { anchorHref = true, ignoreClasses } = {})\n   {\n      if (el === void 0 || el === null || el?.hidden || !el?.isConnected || el?.nodeType !== Node.ELEMENT_NODE ||\n       typeof el?.focus !== 'function')\n      {\n         return false;\n      }\n\n      if (typeof anchorHref !== 'boolean')\n      {\n         throw new TypeError(`'anchorHref' is not a boolean.`);\n      }\n\n      if (ignoreClasses !== void 0 && !isIterable(ignoreClasses))\n      {\n         throw new TypeError(`'ignoreClasses' is not an iterable list.`);\n      }\n\n      const contenteditableAttr = el.getAttribute('contenteditable');\n      const contenteditableFocusable = typeof contenteditableAttr === 'string' &&\n       (contenteditableAttr === '' || contenteditableAttr === 'true');\n\n      const tabindexAttr = globalThis.parseInt(el.getAttribute('tabindex'));\n      const tabindexFocusable = Number.isInteger(tabindexAttr) && tabindexAttr >= 0;\n\n      if (contenteditableFocusable || tabindexFocusable || CrossWindow.isFocusableHTMLElement(el))\n      {\n         // Ensure that an anchor element has an `href` attribute.\n         if (anchorHref && !tabindexFocusable && CrossWindow.isHTMLAnchorElement(el) &&\n          typeof el.getAttribute('href') !== 'string')\n         {\n            return false;\n         }\n\n         return el.style.display !== 'none' && el.style.visibility !== 'hidden' && !el.hasAttribute('disabled') &&\n          !el.hasAttribute('inert') && el.getAttribute('aria-hidden') !== 'true';\n      }\n\n      return false;\n   }\n\n   /**\n    * Convenience method to check if the given data is a valid focus source.\n    *\n    * @param {Element | EventTarget | string}   data - Either an HTMLElement, SVGElement, or selector string.\n    *\n    * @returns {boolean} Is valid focus source.\n    */\n   static isFocusSource(data)\n   {\n      return typeof data === 'string' || (data?.nodeType === Node.ELEMENT_NODE && typeof data?.focus === 'function');\n   }\n\n   /**\n    * Tests if the given `element` is a Element node and has a `focus` method.\n    *\n    * @param {unknown}  element - Element to test for focus method.\n    *\n    * @returns {element is FocusableElement} Whether the element has a focus method.\n    */\n   static isFocusTarget(element)\n   {\n      return element !== void 0 && element !== null && element?.nodeType === Node.ELEMENT_NODE &&\n       typeof element?.focus === 'function';\n   }\n\n   /**\n    * Perform a parent traversal from the current active element attempting to match the given element to test whether\n    * current active element is within that element.\n    *\n    * @param {Element}  element - An element to match in parent traversal from the active element.\n    *\n    * @returns {boolean} Whether there is focus within the given element.\n    */\n   static isFocusWithin(element)\n   {\n      if (!isObject(element) || element?.hidden || !element?.isConnected) { return false; }\n\n      let active = CrossWindow.getActiveElement(element);\n\n      if (!active) { return false; }\n\n      while (active)\n      {\n         if (active === element) { return true; }\n\n         active = active.parentElement;\n      }\n\n      return false;\n   }\n\n   /**\n    * Traverses the given element's parent elements to check if any parent has `offsetWidth` and `offsetHeight` of 0,\n    * indicating that a parent element is hidden. If a parent element is hidden, the given element is also considered\n    * hidden. This is a reasonably efficient check and can be enabled as a filter step in conjunction with focusable\n    * element detection methods like {@link A11yHelper.getFocusableElements}.\n    *\n    * @param {Element}  element - The starting element to check.\n    *\n    * @param {Element}  [stopElement] - The stopping parent element for traversal. If not defined, `document.body` is\n    *        used as the stopping element.\n    *\n    * @returns {boolean} `true` if a parent element of the given element is hidden; otherwise, `false`.\n    */\n   static isParentHidden(element, stopElement)\n   {\n      if (!CrossWindow.isElement(element)) { throw new TypeError(`'element' is not an Element.`); }\n\n      // Set `stopElement` to `document.body` if undefined.\n      stopElement = stopElement ?? CrossWindow.getDocument(element)?.body;\n\n      if (!CrossWindow.isElement(stopElement)) { throw new TypeError(`'stopElement' must be an Element.`); }\n\n      let current = element.parentElement;\n\n      while (current)\n      {\n         // Stop traversal if `stopElement` is reached.\n         if (current === stopElement) { break; }\n\n         // Check if the current parent is hidden by its size.\n         if (current.offsetWidth === 0 && current.offsetHeight === 0) { return true; }\n\n         current = current.parentElement;\n      }\n\n      // No parent is hidden.\n      return false;\n   }\n}\n\nexport { A11yHelper };\n//# sourceMappingURL=index.js.map\n","/**\n * Clamps a value between min / max values.\n *\n * @param {number}   value - Value to clamp.\n *\n * @param {number}   min - Minimum value.\n *\n * @param {number}   max - Maximum value.\n *\n * @returns {number} Clamped value.\n */\nfunction clamp(value = 0, min = 0, max = 0)\n{\n   return Math.min(Math.max(value, min), max);\n}\n\n/**\n * Converts the given number from degrees to radians.\n *\n * @param {number}   deg - Degree number to convert\n *\n * @returns {number} Degree as radians.\n */\nfunction degToRad(deg)\n{\n   return deg * (Math.PI / 180.0);\n}\n\n/**\n * Provides methods for retrieving pseudorandom values and other utilities using {@link Math.random}.\n */\nclass MathRandom\n{\n   /**\n    * Private constructor to prevent instantiation.\n    *\n    * @private\n    */\n   constructor()\n   {\n      throw new Error('This class should not be instantiated.');\n   }\n\n   /**\n    * Returns a random inclusive integer.\n    *\n    * @param {number}   min - Minimum value.\n    *\n    * @param {number}   max - Maximum value.\n    *\n    * @returns {number} Random inclusive integer.\n    */\n   static getInt(min, max)\n   {\n      min = Math.ceil(min);\n      max = Math.floor(max);\n\n      return Math.floor(Math.random() * (max - min + 1)) + min;\n   }\n\n   /**\n    * Returns a random floating point number between min (inclusive) and max (exclusive).\n    *\n    * @param {number}   min - Minimum value\n    *\n    * @param {number}   max - Maximum value.\n    *\n    * @returns {number} Random float.\n    */\n   static getFloat(min, max)\n   {\n      return Math.random() * (max - min) + min;\n   }\n\n   /**\n    * Returns a random boolean.\n    *\n    * @returns {boolean} Random boolean.\n    */\n   static getBoolean()\n   {\n      return Math.random() > 0.5;\n   }\n\n   /**\n    * Shuffles an array using the Fisher-Yates shuffle algorithm. Modifies the input array in place and returns it.\n    *\n    * @template T\n    *\n    * @param {T[]} arr - The array to shuffle.\n    *\n    * @returns {T[]} The shuffled array.\n    */\n   static shuffleArray(arr)\n   {\n      for (let i = arr.length - 1; i > 0; i--)\n      {\n         const j = MathRandom.getInt(0, i);\n         [arr[i], arr[j]] = [arr[j], arr[i]];\n      }\n\n      return arr;\n   }\n}\n\n/**\n * Converts the given number from radians to degrees.\n *\n * @param {number}   rad - Radian number to convert.\n *\n * @returns {number} Degree as radians.\n */\nfunction radToDeg(rad)\n{\n   return rad * (180.0 / Math.PI);\n}\n\nexport { MathRandom, clamp, degToRad, radToDeg };\n//# sourceMappingURL=index.js.map\n","/**\n * Performs linear interpolation between a start & end value by given amount between 0 - 1 inclusive.\n *\n * @param {number}   start - Start value.\n *\n * @param {number}   end - End value.\n *\n * @param {number}   amount - Current amount between 0 - 1 inclusive.\n *\n * @returns {number} Linear interpolated value between start & end.\n */\nfunction lerp(start, end, amount)\n{\n   return (1 - amount) * start + amount * end;\n}\n\nexport { lerp };\n//# sourceMappingURL=index.js.map\n","// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\n\nvar Mat2 = class _Mat2 extends Float32Array {\n  static #IDENTITY_2X2 = new Float32Array([\n    1,\n    0,\n    0,\n    1\n  ]);\n  /**\n   * Create a {@link Mat2}.\n   *\n   * @category Constructor\n   */\n  constructor(...values) {\n    switch (values.length) {\n      case 4:\n        super(values);\n        break;\n      case 2:\n        super(values[0], values[1], 4);\n        break;\n      case 1:\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([\n            v,\n            v,\n            v,\n            v\n          ]);\n        } else {\n          super(v, 0, 4);\n        }\n        break;\n      default:\n        super(_Mat2.#IDENTITY_2X2);\n        break;\n    }\n  }\n  // ============\n  // Accessors\n  // ============\n  /**\n   * A string representation of `this`\n   * Equivalent to `Mat2.str(this);`\n   *\n   * @category Accessors\n   */\n  get str() {\n    return _Mat2.str(this);\n  }\n  // ===================\n  // Instance methods\n  // ===================\n  /**\n   * Copy the values from another {@link Mat2} into `this`.\n   *\n   * @param a the source vector\n   * @returns `this`\n   * @category Methods\n   */\n  copy(a) {\n    this.set(a);\n    return this;\n  }\n  /**\n   * Set `this` to the identity matrix\n   * Equivalent to Mat2.identity(this)\n   *\n   * @returns `this`\n   * @category Methods\n   */\n  identity() {\n    this.set(_Mat2.#IDENTITY_2X2);\n    return this;\n  }\n  /**\n   * Multiplies this {@link Mat2} against another one\n   * Equivalent to `Mat2.multiply(this, this, b);`\n   *\n   * @param b - The second operand\n   * @returns `this`\n   * @category Methods\n   */\n  multiply(b) {\n    return _Mat2.multiply(this, this, b);\n  }\n  /**\n   * Alias for {@link Mat2.multiply}\n   * @category Methods\n   */\n  mul(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Transpose this {@link Mat2}\n   * Equivalent to `Mat2.transpose(this, this);`\n   *\n   * @returns `this`\n   * @category Methods\n   */\n  transpose() {\n    return _Mat2.transpose(this, this);\n  }\n  /**\n   * Inverts this {@link Mat2}\n   * Equivalent to `Mat4.invert(this, this);`\n   *\n   * @returns `this`\n   * @category Methods\n   */\n  invert() {\n    return _Mat2.invert(this, this);\n  }\n  /**\n   * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n   * Equivalent to `Mat2.scale(this, this, v);`\n   *\n   * @param v - The {@link Vec2} to scale the matrix by\n   * @returns `this`\n   * @category Methods\n   */\n  scale(v) {\n    return _Mat2.scale(this, this, v);\n  }\n  /**\n   * Rotates this {@link Mat2} by the given angle around the given axis\n   * Equivalent to `Mat2.rotate(this, this, rad);`\n   *\n   * @param rad - the angle to rotate the matrix by\n   * @returns `this`\n   * @category Methods\n   */\n  rotate(rad) {\n    return _Mat2.rotate(this, this, rad);\n  }\n  // ===================\n  // Static accessors\n  // ===================\n  /**\n   * @category Static\n   *\n   * @returns The number of bytes in a {@link Mat2}.\n   */\n  static get BYTE_LENGTH() {\n    return 4 * Float32Array.BYTES_PER_ELEMENT;\n  }\n  // ===================\n  // Static methods\n  // ===================\n  /**\n   * Creates a new, identity {@link Mat2}\n   * @category Static\n   *\n   * @returns A new {@link Mat2}\n   */\n  static create() {\n    return new _Mat2();\n  }\n  /**\n   * Creates a new {@link Mat2} initialized with values from an existing matrix\n   * @category Static\n   *\n   * @param a - Matrix to clone\n   * @returns A new {@link Mat2}\n   */\n  static clone(a) {\n    return new _Mat2(a);\n  }\n  /**\n   * Copy the values from one {@link Mat2} to another\n   * @category Static\n   *\n   * @param out - The receiving Matrix\n   * @param a - Matrix to copy\n   * @returns `out`\n   */\n  static copy(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    return out;\n  }\n  /**\n   * Create a new {@link Mat2} with the given values\n   * @category Static\n   *\n   * @param values - Matrix components\n   * @returns A new {@link Mat2}\n   */\n  static fromValues(...values) {\n    return new _Mat2(...values);\n  }\n  /**\n   * Set the components of a {@link Mat2} to the given values\n   * @category Static\n   *\n   * @param out - The receiving matrix\n   * @param values - Matrix components\n   * @returns `out`\n   */\n  static set(out, ...values) {\n    out[0] = values[0];\n    out[1] = values[1];\n    out[2] = values[2];\n    out[3] = values[3];\n    return out;\n  }\n  /**\n   * Set a {@link Mat2} to the identity matrix\n   * @category Static\n   *\n   * @param out - The receiving matrix\n   * @returns `out`\n   */\n  static identity(out) {\n    out[0] = 1;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 1;\n    return out;\n  }\n  /**\n   * Transpose the values of a {@link Mat2}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out`\n   */\n  static transpose(out, a) {\n    if (out === a) {\n      const a1 = a[1];\n      out[1] = a[2];\n      out[2] = a1;\n    } else {\n      out[0] = a[0];\n      out[1] = a[2];\n      out[2] = a[1];\n      out[3] = a[3];\n    }\n    return out;\n  }\n  /**\n   * Inverts a {@link Mat2}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out` or `null` if the matrix is not invertible\n   */\n  static invert(out, a) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    let det = a0 * a3 - a2 * a1;\n    if (!det) {\n      return null;\n    }\n    det = 1 / det;\n    out[0] = a3 * det;\n    out[1] = -a1 * det;\n    out[2] = -a2 * det;\n    out[3] = a0 * det;\n    return out;\n  }\n  /**\n   * Calculates the adjugate of a {@link Mat2}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out`\n   */\n  static adjoint(out, a) {\n    const a0 = a[0];\n    out[0] = a[3];\n    out[1] = -a[1];\n    out[2] = -a[2];\n    out[3] = a0;\n    return out;\n  }\n  /**\n   * Calculates the determinant of a {@link Mat2}\n   * @category Static\n   *\n   * @param a - the source matrix\n   * @returns determinant of a\n   */\n  static determinant(a) {\n    return a[0] * a[3] - a[2] * a[1];\n  }\n  /**\n   * Adds two {@link Mat2}'s\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static add(out, a, b) {\n    out[0] = a[0] + b[0];\n    out[1] = a[1] + b[1];\n    out[2] = a[2] + b[2];\n    out[3] = a[3] + b[3];\n    return out;\n  }\n  /**\n   * Subtracts matrix b from matrix a\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static subtract(out, a, b) {\n    out[0] = a[0] - b[0];\n    out[1] = a[1] - b[1];\n    out[2] = a[2] - b[2];\n    out[3] = a[3] - b[3];\n    return out;\n  }\n  /**\n   * Alias for {@link Mat2.subtract}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sub(out, a, b) {\n    return out;\n  }\n  /**\n   * Multiplies two {@link Mat2}s\n   * @category Static\n   *\n   * @param out - The receiving Matrix\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static multiply(out, a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const b0 = b[0];\n    const b1 = b[1];\n    const b2 = b[2];\n    const b3 = b[3];\n    out[0] = a0 * b0 + a2 * b1;\n    out[1] = a1 * b0 + a3 * b1;\n    out[2] = a0 * b2 + a2 * b3;\n    out[3] = a1 * b2 + a3 * b3;\n    return out;\n  }\n  /**\n   * Alias for {@link Mat2.multiply}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mul(out, a, b) {\n    return out;\n  }\n  /**\n   * Rotates a {@link Mat2} by the given angle\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to rotate\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static rotate(out, a, rad) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    out[0] = a0 * c + a2 * s;\n    out[1] = a1 * c + a3 * s;\n    out[2] = a0 * -s + a2 * c;\n    out[3] = a1 * -s + a3 * c;\n    return out;\n  }\n  /**\n   * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to scale\n   * @param v - the {@link Vec2} to scale the matrix by\n   * @returns `out`\n   **/\n  static scale(out, a, v) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const v0 = v[0];\n    const v1 = v[1];\n    out[0] = a0 * v0;\n    out[1] = a1 * v0;\n    out[2] = a2 * v1;\n    out[3] = a3 * v1;\n    return out;\n  }\n  /**\n   * Creates a {@link Mat2} from a given angle around a given axis\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat2.identity(dest);\n   *   mat2.rotate(dest, dest, rad);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat2} receiving operation result\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static fromRotation(out, rad) {\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    out[0] = c;\n    out[1] = s;\n    out[2] = -s;\n    out[3] = c;\n    return out;\n  }\n  /**\n   * Creates a {@link Mat2} from a vector scaling\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat2.identity(dest);\n   *   mat2.scale(dest, dest, vec);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat2} receiving operation result\n   * @param v - Scaling vector\n   * @returns `out`\n   */\n  static fromScaling(out, v) {\n    out[0] = v[0];\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = v[1];\n    return out;\n  }\n  /**\n   * Returns Frobenius norm of a {@link Mat2}\n   * @category Static\n   *\n   * @param a - the matrix to calculate Frobenius norm of\n   * @returns Frobenius norm\n   */\n  static frob(a) {\n    return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n  }\n  /**\n   * Multiply each element of a {@link Mat2} by a scalar.\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to scale\n   * @param b - amount to scale the matrix's elements by\n   * @returns `out`\n   */\n  static multiplyScalar(out, a, b) {\n    out[0] = a[0] * b;\n    out[1] = a[1] * b;\n    out[2] = a[2] * b;\n    out[3] = a[3] * b;\n    return out;\n  }\n  /**\n   * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param scale - the amount to scale b's elements by before adding\n   * @returns `out`\n   */\n  static multiplyScalarAndAdd(out, a, b, scale) {\n    out[0] = a[0] + b[0] * scale;\n    out[1] = a[1] + b[1] * scale;\n    out[2] = a[2] + b[2] * scale;\n    out[3] = a[3] + b[3] * scale;\n    return out;\n  }\n  /**\n   * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n   * @category Static\n   *\n   * @param L - the lower triangular matrix\n   * @param D - the diagonal matrix\n   * @param U - the upper triangular matrix\n   * @param a - the input matrix to factorize\n   */\n  static LDU(L, D, U, a) {\n    L[2] = a[2] / a[0];\n    U[0] = a[0];\n    U[1] = a[1];\n    U[3] = a[3] - L[2] * U[1];\n    return [L, D, U];\n  }\n  /**\n   * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n   * @category Static\n   *\n   * @param a - The first matrix.\n   * @param b - The second matrix.\n   * @returns True if the matrices are equal, false otherwise.\n   */\n  static exactEquals(a, b) {\n    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n  }\n  /**\n   * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n   * @category Static\n   *\n   * @param a - The first matrix.\n   * @param b - The second matrix.\n   * @returns True if the matrices are equal, false otherwise.\n   */\n  static equals(a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const b0 = b[0];\n    const b1 = b[1];\n    const b2 = b[2];\n    const b3 = b[3];\n    return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n  }\n  /**\n   * Returns a string representation of a {@link Mat2}\n   * @category Static\n   *\n   * @param a - matrix to represent as a string\n   * @returns string representation of the matrix\n   */\n  static str(a) {\n    return `Mat2(${a.join(\", \")})`;\n  }\n};\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\nvar Mat2d = class _Mat2d extends Float32Array {\n  static #IDENTITY_2X3 = new Float32Array([\n    1,\n    0,\n    0,\n    1,\n    0,\n    0\n  ]);\n  /**\n   * Create a {@link Mat2}.\n   *\n   * @category Constructor\n   */\n  constructor(...values) {\n    switch (values.length) {\n      case 6:\n        super(values);\n        break;\n      case 2:\n        super(values[0], values[1], 6);\n        break;\n      case 1:\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([\n            v,\n            v,\n            v,\n            v,\n            v,\n            v\n          ]);\n        } else {\n          super(v, 0, 6);\n        }\n        break;\n      default:\n        super(_Mat2d.#IDENTITY_2X3);\n        break;\n    }\n  }\n  // ============\n  // Accessors\n  // ============\n  /**\n   * A string representation of `this`\n   * Equivalent to `Mat2d.str(this);`\n   *\n   * @category Accessors\n   */\n  get str() {\n    return _Mat2d.str(this);\n  }\n  // ===================\n  // Instances methods\n  // ===================\n  /**\n   * Copy the values from another {@link Mat2d} into `this`.\n   * @category Methods\n   *\n   * @param a the source vector\n   * @returns `this`\n   */\n  copy(a) {\n    this.set(a);\n    return this;\n  }\n  /**\n   * Set `this` to the identity matrix\n   * Equivalent to Mat2d.identity(this)\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  identity() {\n    this.set(_Mat2d.#IDENTITY_2X3);\n    return this;\n  }\n  /**\n   * Multiplies this {@link Mat2d} against another one\n   * Equivalent to `Mat2d.multiply(this, this, b);`\n   * @category Methods\n   *\n   * @param out - The receiving Matrix\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `this`\n   */\n  multiply(b) {\n    return _Mat2d.multiply(this, this, b);\n  }\n  /**\n   * Alias for {@link Mat2d.multiply}\n   * @category Methods\n   */\n  mul(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Translate this {@link Mat2d} by the given vector\n   * Equivalent to `Mat2d.translate(this, this, v);`\n   * @category Methods\n   *\n   * @param v - The {@link Vec2} to translate by\n   * @returns `this`\n   */\n  translate(v) {\n    return _Mat2d.translate(this, this, v);\n  }\n  /**\n   * Rotates this {@link Mat2d} by the given angle around the given axis\n   * Equivalent to `Mat2d.rotate(this, this, rad);`\n   * @category Methods\n   *\n   * @param rad - the angle to rotate the matrix by\n   * @returns `this`\n   */\n  rotate(rad) {\n    return _Mat2d.rotate(this, this, rad);\n  }\n  /**\n   * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n   * Equivalent to `Mat2d.scale(this, this, v);`\n   * @category Methods\n   *\n   * @param v - The {@link Vec2} to scale the matrix by\n   * @returns `this`\n   */\n  scale(v) {\n    return _Mat2d.scale(this, this, v);\n  }\n  // ===================\n  // Static accessors\n  // ===================\n  /**\n   * @category Static\n   *\n   * @returns The number of bytes in a {@link Mat2d}.\n   */\n  static get BYTE_LENGTH() {\n    return 6 * Float32Array.BYTES_PER_ELEMENT;\n  }\n  // ===================\n  // Static methods\n  // ===================\n  /**\n   * Creates a new, identity {@link Mat2d}\n   * @category Static\n   *\n   * @returns A new {@link Mat2d}\n   */\n  static create() {\n    return new _Mat2d();\n  }\n  /**\n   * Creates a new {@link Mat2d} initialized with values from an existing matrix\n   * @category Static\n   *\n   * @param a - Matrix to clone\n   * @returns A new {@link Mat2d}\n   */\n  static clone(a) {\n    return new _Mat2d(a);\n  }\n  /**\n   * Copy the values from one {@link Mat2d} to another\n   * @category Static\n   *\n   * @param out - The receiving Matrix\n   * @param a - Matrix to copy\n   * @returns `out`\n   */\n  static copy(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    out[4] = a[4];\n    out[5] = a[5];\n    return out;\n  }\n  /**\n   * Create a new {@link Mat2d} with the given values\n   * @category Static\n   *\n   * @param values - Matrix components\n   * @returns A new {@link Mat2d}\n   */\n  static fromValues(...values) {\n    return new _Mat2d(...values);\n  }\n  /**\n   * Set the components of a {@link Mat2d} to the given values\n   * @category Static\n   *\n   * @param out - The receiving matrix\n   * @param values - Matrix components\n   * @returns `out`\n   */\n  static set(out, ...values) {\n    out[0] = values[0];\n    out[1] = values[1];\n    out[2] = values[2];\n    out[3] = values[3];\n    out[4] = values[4];\n    out[5] = values[5];\n    return out;\n  }\n  /**\n   * Set a {@link Mat2d} to the identity matrix\n   * @category Static\n   *\n   * @param out - The receiving matrix\n   * @returns `out`\n   */\n  static identity(out) {\n    out[0] = 1;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 1;\n    out[4] = 0;\n    out[5] = 0;\n    return out;\n  }\n  /**\n   * Inverts a {@link Mat2d}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out` or `null` if the matrix is not invertible\n   */\n  static invert(out, a) {\n    const aa = a[0];\n    const ab = a[1];\n    const ac = a[2];\n    const ad = a[3];\n    const atx = a[4];\n    const aty = a[5];\n    let det = aa * ad - ab * ac;\n    if (!det) {\n      return null;\n    }\n    det = 1 / det;\n    out[0] = ad * det;\n    out[1] = -ab * det;\n    out[2] = -ac * det;\n    out[3] = aa * det;\n    out[4] = (ac * aty - ad * atx) * det;\n    out[5] = (ab * atx - aa * aty) * det;\n    return out;\n  }\n  /**\n   * Calculates the determinant of a {@link Mat2d}\n   * @category Static\n   *\n   * @param a - the source matrix\n   * @returns determinant of a\n   */\n  static determinant(a) {\n    return a[0] * a[3] - a[1] * a[2];\n  }\n  /**\n   * Adds two {@link Mat2d}'s\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static add(out, a, b) {\n    out[0] = a[0] + b[0];\n    out[1] = a[1] + b[1];\n    out[2] = a[2] + b[2];\n    out[3] = a[3] + b[3];\n    out[4] = a[4] + b[4];\n    out[5] = a[5] + b[5];\n    return out;\n  }\n  /**\n   * Subtracts matrix b from matrix a\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static subtract(out, a, b) {\n    out[0] = a[0] - b[0];\n    out[1] = a[1] - b[1];\n    out[2] = a[2] - b[2];\n    out[3] = a[3] - b[3];\n    out[4] = a[4] - b[4];\n    out[5] = a[5] - b[5];\n    return out;\n  }\n  /**\n   * Alias for {@link Mat2d.subtract}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sub(out, a, b) {\n    return out;\n  }\n  /**\n   * Multiplies two {@link Mat2d}s\n   * @category Static\n   *\n   * @param out - The receiving Matrix\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static multiply(out, a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const a4 = a[4];\n    const a5 = a[5];\n    const b0 = b[0];\n    const b1 = b[1];\n    const b2 = b[2];\n    const b3 = b[3];\n    const b4 = b[4];\n    const b5 = b[5];\n    out[0] = a0 * b0 + a2 * b1;\n    out[1] = a1 * b0 + a3 * b1;\n    out[2] = a0 * b2 + a2 * b3;\n    out[3] = a1 * b2 + a3 * b3;\n    out[4] = a0 * b4 + a2 * b5 + a4;\n    out[5] = a1 * b4 + a3 * b5 + a5;\n    return out;\n  }\n  /**\n   * Alias for {@link Mat2d.multiply}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mul(out, a, b) {\n    return out;\n  }\n  /**\n   * Translate a {@link Mat2d} by the given vector\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to translate\n   * @param v - vector to translate by\n   * @returns `out`\n   */\n  static translate(out, a, v) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const a4 = a[4];\n    const a5 = a[5];\n    const v0 = v[0];\n    const v1 = v[1];\n    out[0] = a0;\n    out[1] = a1;\n    out[2] = a2;\n    out[3] = a3;\n    out[4] = a0 * v0 + a2 * v1 + a4;\n    out[5] = a1 * v0 + a3 * v1 + a5;\n    return out;\n  }\n  /**\n   * Rotates a {@link Mat2d} by the given angle\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to rotate\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static rotate(out, a, rad) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const a4 = a[4];\n    const a5 = a[5];\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    out[0] = a0 * c + a2 * s;\n    out[1] = a1 * c + a3 * s;\n    out[2] = a0 * -s + a2 * c;\n    out[3] = a1 * -s + a3 * c;\n    out[4] = a4;\n    out[5] = a5;\n    return out;\n  }\n  /**\n   * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to scale\n   * @param v - the {@link Vec2} to scale the matrix by\n   * @returns `out`\n   **/\n  static scale(out, a, v) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const a4 = a[4];\n    const a5 = a[5];\n    const v0 = v[0];\n    const v1 = v[1];\n    out[0] = a0 * v0;\n    out[1] = a1 * v0;\n    out[2] = a2 * v1;\n    out[3] = a3 * v1;\n    out[4] = a4;\n    out[5] = a5;\n    return out;\n  }\n  // TODO: Got to fromRotation\n  /**\n   * Creates a {@link Mat2d} from a vector translation\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   Mat2d.identity(dest);\n   *   Mat2d.translate(dest, dest, vec);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat2d} receiving operation result\n   * @param v - Translation vector\n   * @returns `out`\n   */\n  static fromTranslation(out, v) {\n    out[0] = 1;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 1;\n    out[4] = v[0];\n    out[5] = v[1];\n    return out;\n  }\n  /**\n   * Creates a {@link Mat2d} from a given angle around a given axis\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   Mat2d.identity(dest);\n   *   Mat2d.rotate(dest, dest, rad);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat2d} receiving operation result\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static fromRotation(out, rad) {\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    out[0] = c;\n    out[1] = s;\n    out[2] = -s;\n    out[3] = c;\n    out[4] = 0;\n    out[5] = 0;\n    return out;\n  }\n  /**\n   * Creates a {@link Mat2d} from a vector scaling\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   Mat2d.identity(dest);\n   *   Mat2d.scale(dest, dest, vec);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat2d} receiving operation result\n   * @param v - Scaling vector\n   * @returns `out`\n   */\n  static fromScaling(out, v) {\n    out[0] = v[0];\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = v[1];\n    out[4] = 0;\n    out[5] = 0;\n    return out;\n  }\n  /**\n   * Returns Frobenius norm of a {@link Mat2d}\n   * @category Static\n   *\n   * @param a - the matrix to calculate Frobenius norm of\n   * @returns Frobenius norm\n   */\n  static frob(a) {\n    return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n  }\n  /**\n   * Multiply each element of a {@link Mat2d} by a scalar.\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to scale\n   * @param b - amount to scale the matrix's elements by\n   * @returns `out`\n   */\n  static multiplyScalar(out, a, b) {\n    out[0] = a[0] * b;\n    out[1] = a[1] * b;\n    out[2] = a[2] * b;\n    out[3] = a[3] * b;\n    out[4] = a[4] * b;\n    out[5] = a[5] * b;\n    return out;\n  }\n  /**\n   * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param scale - the amount to scale b's elements by before adding\n   * @returns `out`\n   */\n  static multiplyScalarAndAdd(out, a, b, scale) {\n    out[0] = a[0] + b[0] * scale;\n    out[1] = a[1] + b[1] * scale;\n    out[2] = a[2] + b[2] * scale;\n    out[3] = a[3] + b[3] * scale;\n    out[4] = a[4] + b[4] * scale;\n    out[5] = a[5] + b[5] * scale;\n    return out;\n  }\n  /**\n   * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n   * @category Static\n   *\n   * @param a - The first matrix.\n   * @param b - The second matrix.\n   * @returns True if the matrices are equal, false otherwise.\n   */\n  static exactEquals(a, b) {\n    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n  }\n  /**\n   * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n   * @category Static\n   *\n   * @param a - The first matrix.\n   * @param b - The second matrix.\n   * @returns True if the matrices are equal, false otherwise.\n   */\n  static equals(a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const a4 = a[4];\n    const a5 = a[5];\n    const b0 = b[0];\n    const b1 = b[1];\n    const b2 = b[2];\n    const b3 = b[3];\n    const b4 = b[4];\n    const b5 = b[5];\n    return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n  }\n  /**\n   * Returns a string representation of a {@link Mat2d}\n   * @category Static\n   *\n   * @param a - matrix to represent as a string\n   * @returns string representation of the matrix\n   */\n  static str(a) {\n    return `Mat2d(${a.join(\", \")})`;\n  }\n};\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\nvar Mat3 = class _Mat3 extends Float32Array {\n  static #IDENTITY_3X3 = new Float32Array([\n    1,\n    0,\n    0,\n    0,\n    1,\n    0,\n    0,\n    0,\n    1\n  ]);\n  /**\n   * Create a {@link Mat3}.\n   *\n   * @category Constructor\n   */\n  constructor(...values) {\n    switch (values.length) {\n      case 9:\n        super(values);\n        break;\n      case 2:\n        super(values[0], values[1], 9);\n        break;\n      case 1:\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v\n          ]);\n        } else {\n          super(v, 0, 9);\n        }\n        break;\n      default:\n        super(_Mat3.#IDENTITY_3X3);\n        break;\n    }\n  }\n  // ============\n  // Accessors\n  // ============\n  /**\n   * A string representation of `this`\n   * Equivalent to `Mat3.str(this);`\n   *\n   * @category Accessors\n   */\n  get str() {\n    return _Mat3.str(this);\n  }\n  // ===================\n  // Instance methods\n  // ===================\n  /**\n   * Copy the values from another {@link Mat3} into `this`.\n   * @category Methods\n   *\n   * @param a the source vector\n   * @returns `this`\n   */\n  copy(a) {\n    this.set(a);\n    return this;\n  }\n  /**\n   * Set `this` to the identity matrix\n   * Equivalent to Mat3.identity(this)\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  identity() {\n    this.set(_Mat3.#IDENTITY_3X3);\n    return this;\n  }\n  /**\n   * Multiplies this {@link Mat3} against another one\n   * Equivalent to `Mat3.multiply(this, this, b);`\n   * @category Methods\n   *\n   * @param out - The receiving Matrix\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `this`\n   */\n  multiply(b) {\n    return _Mat3.multiply(this, this, b);\n  }\n  /**\n   * Alias for {@link Mat3.multiply}\n   * @category Methods\n   */\n  mul(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Transpose this {@link Mat3}\n   * Equivalent to `Mat3.transpose(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  transpose() {\n    return _Mat3.transpose(this, this);\n  }\n  /**\n   * Inverts this {@link Mat3}\n   * Equivalent to `Mat4.invert(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  invert() {\n    return _Mat3.invert(this, this);\n  }\n  /**\n   * Translate this {@link Mat3} by the given vector\n   * Equivalent to `Mat3.translate(this, this, v);`\n   * @category Methods\n   *\n   * @param v - The {@link Vec2} to translate by\n   * @returns `this`\n   */\n  translate(v) {\n    return _Mat3.translate(this, this, v);\n  }\n  /**\n   * Rotates this {@link Mat3} by the given angle around the given axis\n   * Equivalent to `Mat3.rotate(this, this, rad);`\n   * @category Methods\n   *\n   * @param rad - the angle to rotate the matrix by\n   * @returns `this`\n   */\n  rotate(rad) {\n    return _Mat3.rotate(this, this, rad);\n  }\n  /**\n   * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n   * Equivalent to `Mat3.scale(this, this, v);`\n   * @category Methods\n   *\n   * @param v - The {@link Vec2} to scale the matrix by\n   * @returns `this`\n   */\n  scale(v) {\n    return _Mat3.scale(this, this, v);\n  }\n  // ===================\n  // Static accessors\n  // ===================\n  /**\n   * @category Static\n   *\n   * @returns The number of bytes in a {@link Mat3}.\n   */\n  static get BYTE_LENGTH() {\n    return 9 * Float32Array.BYTES_PER_ELEMENT;\n  }\n  // ===================\n  // Static methods\n  // ===================\n  /**\n   * Creates a new, identity {@link Mat3}\n   * @category Static\n   *\n   * @returns A new {@link Mat3}\n   */\n  static create() {\n    return new _Mat3();\n  }\n  /**\n   * Creates a new {@link Mat3} initialized with values from an existing matrix\n   * @category Static\n   *\n   * @param a - Matrix to clone\n   * @returns A new {@link Mat3}\n   */\n  static clone(a) {\n    return new _Mat3(a);\n  }\n  /**\n   * Copy the values from one {@link Mat3} to another\n   * @category Static\n   *\n   * @param out - The receiving Matrix\n   * @param a - Matrix to copy\n   * @returns `out`\n   */\n  static copy(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    out[4] = a[4];\n    out[5] = a[5];\n    out[6] = a[6];\n    out[7] = a[7];\n    out[8] = a[8];\n    return out;\n  }\n  /**\n   * Create a new {@link Mat3} with the given values\n   * @category Static\n   *\n   * @param values - Matrix components\n   * @returns A new {@link Mat3}\n   */\n  static fromValues(...values) {\n    return new _Mat3(...values);\n  }\n  /**\n   * Set the components of a {@link Mat3} to the given values\n   * @category Static\n   *\n   * @param out - The receiving matrix\n   * @param values - Matrix components\n   * @returns `out`\n   */\n  static set(out, ...values) {\n    out[0] = values[0];\n    out[1] = values[1];\n    out[2] = values[2];\n    out[3] = values[3];\n    out[4] = values[4];\n    out[5] = values[5];\n    out[6] = values[6];\n    out[7] = values[7];\n    out[8] = values[8];\n    return out;\n  }\n  /**\n   * Set a {@link Mat3} to the identity matrix\n   * @category Static\n   *\n   * @param out - The receiving matrix\n   * @returns `out`\n   */\n  static identity(out) {\n    out[0] = 1;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 1;\n    out[5] = 0;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 1;\n    return out;\n  }\n  /**\n   * Transpose the values of a {@link Mat3}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out`\n   */\n  static transpose(out, a) {\n    if (out === a) {\n      const a01 = a[1], a02 = a[2], a12 = a[5];\n      out[1] = a[3];\n      out[2] = a[6];\n      out[3] = a01;\n      out[5] = a[7];\n      out[6] = a02;\n      out[7] = a12;\n    } else {\n      out[0] = a[0];\n      out[1] = a[3];\n      out[2] = a[6];\n      out[3] = a[1];\n      out[4] = a[4];\n      out[5] = a[7];\n      out[6] = a[2];\n      out[7] = a[5];\n      out[8] = a[8];\n    }\n    return out;\n  }\n  /**\n   * Inverts a {@link Mat3}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out` or `null` if the matrix is not invertible\n   */\n  static invert(out, a) {\n    const a00 = a[0], a01 = a[1], a02 = a[2];\n    const a10 = a[3], a11 = a[4], a12 = a[5];\n    const a20 = a[6], a21 = a[7], a22 = a[8];\n    const b01 = a22 * a11 - a12 * a21;\n    const b11 = -a22 * a10 + a12 * a20;\n    const b21 = a21 * a10 - a11 * a20;\n    let det = a00 * b01 + a01 * b11 + a02 * b21;\n    if (!det) {\n      return null;\n    }\n    det = 1 / det;\n    out[0] = b01 * det;\n    out[1] = (-a22 * a01 + a02 * a21) * det;\n    out[2] = (a12 * a01 - a02 * a11) * det;\n    out[3] = b11 * det;\n    out[4] = (a22 * a00 - a02 * a20) * det;\n    out[5] = (-a12 * a00 + a02 * a10) * det;\n    out[6] = b21 * det;\n    out[7] = (-a21 * a00 + a01 * a20) * det;\n    out[8] = (a11 * a00 - a01 * a10) * det;\n    return out;\n  }\n  /**\n   * Calculates the adjugate of a {@link Mat3}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out`\n   */\n  static adjoint(out, a) {\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a10 = a[3];\n    const a11 = a[4];\n    const a12 = a[5];\n    const a20 = a[6];\n    const a21 = a[7];\n    const a22 = a[8];\n    out[0] = a11 * a22 - a12 * a21;\n    out[1] = a02 * a21 - a01 * a22;\n    out[2] = a01 * a12 - a02 * a11;\n    out[3] = a12 * a20 - a10 * a22;\n    out[4] = a00 * a22 - a02 * a20;\n    out[5] = a02 * a10 - a00 * a12;\n    out[6] = a10 * a21 - a11 * a20;\n    out[7] = a01 * a20 - a00 * a21;\n    out[8] = a00 * a11 - a01 * a10;\n    return out;\n  }\n  /**\n   * Calculates the determinant of a {@link Mat3}\n   * @category Static\n   *\n   * @param a - the source matrix\n   * @returns determinant of a\n   */\n  static determinant(a) {\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a10 = a[3];\n    const a11 = a[4];\n    const a12 = a[5];\n    const a20 = a[6];\n    const a21 = a[7];\n    const a22 = a[8];\n    return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n  }\n  /**\n   * Adds two {@link Mat3}'s\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static add(out, a, b) {\n    out[0] = a[0] + b[0];\n    out[1] = a[1] + b[1];\n    out[2] = a[2] + b[2];\n    out[3] = a[3] + b[3];\n    out[4] = a[4] + b[4];\n    out[5] = a[5] + b[5];\n    out[6] = a[6] + b[6];\n    out[7] = a[7] + b[7];\n    out[8] = a[8] + b[8];\n    return out;\n  }\n  /**\n   * Subtracts matrix b from matrix a\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static subtract(out, a, b) {\n    out[0] = a[0] - b[0];\n    out[1] = a[1] - b[1];\n    out[2] = a[2] - b[2];\n    out[3] = a[3] - b[3];\n    out[4] = a[4] - b[4];\n    out[5] = a[5] - b[5];\n    out[6] = a[6] - b[6];\n    out[7] = a[7] - b[7];\n    out[8] = a[8] - b[8];\n    return out;\n  }\n  /**\n   * Alias for {@link Mat3.subtract}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sub(out, a, b) {\n    return out;\n  }\n  /**\n   * Multiplies two {@link Mat3}s\n   * @category Static\n   *\n   * @param out - The receiving Matrix\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static multiply(out, a, b) {\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a10 = a[3];\n    const a11 = a[4];\n    const a12 = a[5];\n    const a20 = a[6];\n    const a21 = a[7];\n    const a22 = a[8];\n    let b0 = b[0];\n    let b1 = b[1];\n    let b2 = b[2];\n    out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n    out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n    out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n    b0 = b[3];\n    b1 = b[4];\n    b2 = b[5];\n    out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n    out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n    out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n    b0 = b[6];\n    b1 = b[7];\n    b2 = b[8];\n    out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n    out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n    out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n    return out;\n  }\n  /**\n   * Alias for {@link Mat3.multiply}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mul(out, a, b) {\n    return out;\n  }\n  /**\n   * Translate a {@link Mat3} by the given vector\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to translate\n   * @param v - vector to translate by\n   * @returns `out`\n   */\n  static translate(out, a, v) {\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a10 = a[3];\n    const a11 = a[4];\n    const a12 = a[5];\n    const a20 = a[6];\n    const a21 = a[7];\n    const a22 = a[8];\n    const x = v[0];\n    const y = v[1];\n    out[0] = a00;\n    out[1] = a01;\n    out[2] = a02;\n    out[3] = a10;\n    out[4] = a11;\n    out[5] = a12;\n    out[6] = x * a00 + y * a10 + a20;\n    out[7] = x * a01 + y * a11 + a21;\n    out[8] = x * a02 + y * a12 + a22;\n    return out;\n  }\n  /**\n   * Rotates a {@link Mat3} by the given angle\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to rotate\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static rotate(out, a, rad) {\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a10 = a[3];\n    const a11 = a[4];\n    const a12 = a[5];\n    const a20 = a[6];\n    const a21 = a[7];\n    const a22 = a[8];\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    out[0] = c * a00 + s * a10;\n    out[1] = c * a01 + s * a11;\n    out[2] = c * a02 + s * a12;\n    out[3] = c * a10 - s * a00;\n    out[4] = c * a11 - s * a01;\n    out[5] = c * a12 - s * a02;\n    out[6] = a20;\n    out[7] = a21;\n    out[8] = a22;\n    return out;\n  }\n  /**\n   * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to scale\n   * @param v - the {@link Vec2} to scale the matrix by\n   * @returns `out`\n   **/\n  static scale(out, a, v) {\n    const x = v[0];\n    const y = v[1];\n    out[0] = x * a[0];\n    out[1] = x * a[1];\n    out[2] = x * a[2];\n    out[3] = y * a[3];\n    out[4] = y * a[4];\n    out[5] = y * a[5];\n    out[6] = a[6];\n    out[7] = a[7];\n    out[8] = a[8];\n    return out;\n  }\n  /**\n   * Creates a {@link Mat3} from a vector translation\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat3.identity(dest);\n   *   mat3.translate(dest, dest, vec);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat3} receiving operation result\n   * @param v - Translation vector\n   * @returns `out`\n   */\n  static fromTranslation(out, v) {\n    out[0] = 1;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 1;\n    out[5] = 0;\n    out[6] = v[0];\n    out[7] = v[1];\n    out[8] = 1;\n    return out;\n  }\n  /**\n   * Creates a {@link Mat3} from a given angle around a given axis\n   * This is equivalent to (but much faster than):\n   *\n   *     mat3.identity(dest);\n   *     mat3.rotate(dest, dest, rad);\n   * @category Static\n   *\n   * @param out - {@link Mat3} receiving operation result\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static fromRotation(out, rad) {\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    out[0] = c;\n    out[1] = s;\n    out[2] = 0;\n    out[3] = -s;\n    out[4] = c;\n    out[5] = 0;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 1;\n    return out;\n  }\n  /**\n   * Creates a {@link Mat3} from a vector scaling\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat3.identity(dest);\n   *   mat3.scale(dest, dest, vec);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat3} receiving operation result\n   * @param v - Scaling vector\n   * @returns `out`\n   */\n  static fromScaling(out, v) {\n    out[0] = v[0];\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = v[1];\n    out[5] = 0;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 1;\n    return out;\n  }\n  /**\n   * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n   * {@link Mat3}.\n   * @category Static\n   *\n   * @param out - the receiving 3x3 matrix\n   * @param a - the source 2x3 matrix\n   * @returns `out`\n   */\n  static fromMat2d(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = 0;\n    out[3] = a[2];\n    out[4] = a[3];\n    out[5] = 0;\n    out[6] = a[4];\n    out[7] = a[5];\n    out[8] = 1;\n    return out;\n  }\n  /**\n   * Calculates a {@link Mat3} from the given quaternion\n   * @category Static\n   *\n   * @param out - {@link Mat3} receiving operation result\n   * @param q - {@link Quat} to create matrix from\n   * @returns `out`\n   */\n  static fromQuat(out, q) {\n    const x = q[0];\n    const y = q[1];\n    const z = q[2];\n    const w = q[3];\n    const x2 = x + x;\n    const y2 = y + y;\n    const z2 = z + z;\n    const xx = x * x2;\n    const yx = y * x2;\n    const yy = y * y2;\n    const zx = z * x2;\n    const zy = z * y2;\n    const zz = z * z2;\n    const wx = w * x2;\n    const wy = w * y2;\n    const wz = w * z2;\n    out[0] = 1 - yy - zz;\n    out[3] = yx - wz;\n    out[6] = zx + wy;\n    out[1] = yx + wz;\n    out[4] = 1 - xx - zz;\n    out[7] = zy - wx;\n    out[2] = zx - wy;\n    out[5] = zy + wx;\n    out[8] = 1 - xx - yy;\n    return out;\n  }\n  /**\n   * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n   * {@link Mat3}.\n   * @category Static\n   *\n   * @param out - the receiving 3x3 matrix\n   * @param a - the source 4x4 matrix\n   * @returns `out`\n   */\n  static fromMat4(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[4];\n    out[4] = a[5];\n    out[5] = a[6];\n    out[6] = a[8];\n    out[7] = a[9];\n    out[8] = a[10];\n    return out;\n  }\n  /**\n   * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n   * @category Static\n   *\n   * @param {mat3} out mat3 receiving operation result\n   * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n   * @returns `out` or `null` if the matrix is not invertible\n   */\n  static normalFromMat4(out, a) {\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a03 = a[3];\n    const a10 = a[4];\n    const a11 = a[5];\n    const a12 = a[6];\n    const a13 = a[7];\n    const a20 = a[8];\n    const a21 = a[9];\n    const a22 = a[10];\n    const a23 = a[11];\n    const a30 = a[12];\n    const a31 = a[13];\n    const a32 = a[14];\n    const a33 = a[15];\n    const b00 = a00 * a11 - a01 * a10;\n    const b01 = a00 * a12 - a02 * a10;\n    const b02 = a00 * a13 - a03 * a10;\n    const b03 = a01 * a12 - a02 * a11;\n    const b04 = a01 * a13 - a03 * a11;\n    const b05 = a02 * a13 - a03 * a12;\n    const b06 = a20 * a31 - a21 * a30;\n    const b07 = a20 * a32 - a22 * a30;\n    const b08 = a20 * a33 - a23 * a30;\n    const b09 = a21 * a32 - a22 * a31;\n    const b10 = a21 * a33 - a23 * a31;\n    const b11 = a22 * a33 - a23 * a32;\n    let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n    if (!det) {\n      return null;\n    }\n    det = 1 / det;\n    out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n    out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n    out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n    out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n    out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n    out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n    out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n    out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n    out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n    return out;\n  }\n  /**\n   * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n   * This version omits the calculation of the constant factor (1/determinant), so\n   * any normals transformed with it will need to be renormalized.\n   * From https://stackoverflow.com/a/27616419/25968\n   * @category Static\n   *\n   * @param out - Matrix receiving operation result\n   * @param a - Mat4 to derive the normal matrix from\n   * @returns `out`\n   */\n  static normalFromMat4Fast(out, a) {\n    const ax = a[0];\n    const ay = a[1];\n    const az = a[2];\n    const bx = a[4];\n    const by = a[5];\n    const bz = a[6];\n    const cx = a[8];\n    const cy = a[9];\n    const cz = a[10];\n    out[0] = by * cz - cz * cy;\n    out[1] = bz * cx - cx * cz;\n    out[2] = bx * cy - cy * cx;\n    out[3] = cy * az - cz * ay;\n    out[4] = cz * ax - cx * az;\n    out[5] = cx * ay - cy * ax;\n    out[6] = ay * bz - az * by;\n    out[7] = az * bx - ax * bz;\n    out[8] = ax * by - ay * bx;\n    return out;\n  }\n  /**\n   * Generates a 2D projection matrix with the given bounds\n   * @category Static\n   *\n   * @param out mat3 frustum matrix will be written into\n   * @param width Width of your gl context\n   * @param height Height of gl context\n   * @returns `out`\n   */\n  static projection(out, width, height) {\n    out[0] = 2 / width;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = -2 / height;\n    out[5] = 0;\n    out[6] = -1;\n    out[7] = 1;\n    out[8] = 1;\n    return out;\n  }\n  /**\n   * Returns Frobenius norm of a {@link Mat3}\n   * @category Static\n   *\n   * @param a - the matrix to calculate Frobenius norm of\n   * @returns Frobenius norm\n   */\n  static frob(a) {\n    return Math.sqrt(\n      a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n    );\n  }\n  /**\n   * Multiply each element of a {@link Mat3} by a scalar.\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to scale\n   * @param b - amount to scale the matrix's elements by\n   * @returns `out`\n   */\n  static multiplyScalar(out, a, b) {\n    out[0] = a[0] * b;\n    out[1] = a[1] * b;\n    out[2] = a[2] * b;\n    out[3] = a[3] * b;\n    out[4] = a[4] * b;\n    out[5] = a[5] * b;\n    out[6] = a[6] * b;\n    out[7] = a[7] * b;\n    out[8] = a[8] * b;\n    return out;\n  }\n  /**\n   * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param scale - the amount to scale b's elements by before adding\n   * @returns `out`\n   */\n  static multiplyScalarAndAdd(out, a, b, scale) {\n    out[0] = a[0] + b[0] * scale;\n    out[1] = a[1] + b[1] * scale;\n    out[2] = a[2] + b[2] * scale;\n    out[3] = a[3] + b[3] * scale;\n    out[4] = a[4] + b[4] * scale;\n    out[5] = a[5] + b[5] * scale;\n    out[6] = a[6] + b[6] * scale;\n    out[7] = a[7] + b[7] * scale;\n    out[8] = a[8] + b[8] * scale;\n    return out;\n  }\n  /**\n   * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n   * @category Static\n   *\n   * @param a - The first matrix.\n   * @param b - The second matrix.\n   * @returns True if the matrices are equal, false otherwise.\n   */\n  static exactEquals(a, b) {\n    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n  }\n  /**\n   * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n   * @category Static\n   *\n   * @param a - The first matrix.\n   * @param b - The second matrix.\n   * @returns True if the matrices are equal, false otherwise.\n   */\n  static equals(a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const a4 = a[4];\n    const a5 = a[5];\n    const a6 = a[6];\n    const a7 = a[7];\n    const a8 = a[8];\n    const b0 = b[0];\n    const b1 = b[1];\n    const b2 = b[2];\n    const b3 = b[3];\n    const b4 = b[4];\n    const b5 = b[5];\n    const b6 = b[6];\n    const b7 = b[7];\n    const b8 = b[8];\n    return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n  }\n  /**\n   * Returns a string representation of a {@link Mat3}\n   * @category Static\n   *\n   * @param a - matrix to represent as a string\n   * @returns string representation of the matrix\n   */\n  static str(a) {\n    return `Mat3(${a.join(\", \")})`;\n  }\n};\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\nvar Mat4 = class _Mat4 extends Float32Array {\n  static #IDENTITY_4X4 = new Float32Array([\n    1,\n    0,\n    0,\n    0,\n    0,\n    1,\n    0,\n    0,\n    0,\n    0,\n    1,\n    0,\n    0,\n    0,\n    0,\n    1\n  ]);\n  /**\n   * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n   * These are declared as TypedArrays to aid in tree-shaking.\n   */\n  static #TMP_VEC3 = new Float32Array(3);\n  /**\n   * Create a {@link Mat4}.\n   *\n   * @category Constructor\n   */\n  constructor(...values) {\n    switch (values.length) {\n      case 16:\n        super(values);\n        break;\n      case 2:\n        super(values[0], values[1], 16);\n        break;\n      case 1:\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v,\n            v\n          ]);\n        } else {\n          super(v, 0, 16);\n        }\n        break;\n      default:\n        super(_Mat4.#IDENTITY_4X4);\n        break;\n    }\n  }\n  // ============\n  // Accessors\n  // ============\n  /**\n   * A string representation of `this`\n   * Equivalent to `Mat4.str(this);`\n   *\n   * @category Accessors\n   */\n  get str() {\n    return _Mat4.str(this);\n  }\n  // ===================\n  // Instance methods\n  // ===================\n  /**\n   * Copy the values from another {@link Mat4} into `this`.\n   * @category Methods\n   *\n   * @param a the source vector\n   * @returns `this`\n   */\n  copy(a) {\n    this.set(a);\n    return this;\n  }\n  /**\n   * Set `this` to the identity matrix\n   * Equivalent to Mat4.identity(this)\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  identity() {\n    this.set(_Mat4.#IDENTITY_4X4);\n    return this;\n  }\n  /**\n   * Multiplies this {@link Mat4} against another one\n   * Equivalent to `Mat4.multiply(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The second operand\n   * @returns `this`\n   */\n  multiply(b) {\n    return _Mat4.multiply(this, this, b);\n  }\n  /**\n   * Alias for {@link Mat4.multiply}\n   * @category Methods\n   */\n  mul(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Transpose this {@link Mat4}\n   * Equivalent to `Mat4.transpose(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  transpose() {\n    return _Mat4.transpose(this, this);\n  }\n  /**\n   * Inverts this {@link Mat4}\n   * Equivalent to `Mat4.invert(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  invert() {\n    return _Mat4.invert(this, this);\n  }\n  /**\n   * Translate this {@link Mat4} by the given vector\n   * Equivalent to `Mat4.translate(this, this, v);`\n   * @category Methods\n   *\n   * @param v - The {@link Vec3} to translate by\n   * @returns `this`\n   */\n  translate(v) {\n    return _Mat4.translate(this, this, v);\n  }\n  /**\n   * Rotates this {@link Mat4} by the given angle around the given axis\n   * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n   * @category Methods\n   *\n   * @param rad - the angle to rotate the matrix by\n   * @param axis - the axis to rotate around\n   * @returns `this`\n   */\n  rotate(rad, axis) {\n    return _Mat4.rotate(this, this, rad, axis);\n  }\n  /**\n   * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n   * Equivalent to `Mat4.scale(this, this, v);`\n   * @category Methods\n   *\n   * @param v - The {@link Vec3} to scale the matrix by\n   * @returns `this`\n   */\n  scale(v) {\n    return _Mat4.scale(this, this, v);\n  }\n  /**\n   * Rotates this {@link Mat4} by the given angle around the X axis\n   * Equivalent to `Mat4.rotateX(this, this, rad);`\n   * @category Methods\n   *\n   * @param rad - the angle to rotate the matrix by\n   * @returns `this`\n   */\n  rotateX(rad) {\n    return _Mat4.rotateX(this, this, rad);\n  }\n  /**\n   * Rotates this {@link Mat4} by the given angle around the Y axis\n   * Equivalent to `Mat4.rotateY(this, this, rad);`\n   * @category Methods\n   *\n   * @param rad - the angle to rotate the matrix by\n   * @returns `this`\n   */\n  rotateY(rad) {\n    return _Mat4.rotateY(this, this, rad);\n  }\n  /**\n   * Rotates this {@link Mat4} by the given angle around the Z axis\n   * Equivalent to `Mat4.rotateZ(this, this, rad);`\n   * @category Methods\n   *\n   * @param rad - the angle to rotate the matrix by\n   * @returns `this`\n   */\n  rotateZ(rad) {\n    return _Mat4.rotateZ(this, this, rad);\n  }\n  /**\n   * Generates a perspective projection matrix with the given bounds.\n   * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n   * which matches WebGL/OpenGL's clip volume.\n   * Passing null/undefined/no value for far will generate infinite projection matrix.\n   * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n   * @category Methods\n   *\n   * @param fovy - Vertical field of view in radians\n   * @param aspect - Aspect ratio. typically viewport width/height\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum, can be null or Infinity\n   * @returns `this`\n   */\n  perspectiveNO(fovy, aspect, near, far) {\n    return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n  }\n  /**\n   * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n   * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n   * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n   * Passing null/undefined/no value for far will generate infinite projection matrix.\n   * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n   * @category Methods\n   *\n   * @param fovy - Vertical field of view in radians\n   * @param aspect - Aspect ratio. typically viewport width/height\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum, can be null or Infinity\n   * @returns `this`\n   */\n  perspectiveZO(fovy, aspect, near, far) {\n    return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n  }\n  /**\n   * Generates a orthogonal projection matrix with the given bounds.\n   * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n   * which matches WebGL/OpenGL's clip volume.\n   * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n   * @category Methods\n   *\n   * @param left - Left bound of the frustum\n   * @param right - Right bound of the frustum\n   * @param bottom - Bottom bound of the frustum\n   * @param top - Top bound of the frustum\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum\n   * @returns `this`\n   */\n  orthoNO(left, right, bottom, top, near, far) {\n    return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n  }\n  /**\n   * Generates a orthogonal projection matrix with the given bounds.\n   * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n   * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n   * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n   * @category Methods\n   *\n   * @param left - Left bound of the frustum\n   * @param right - Right bound of the frustum\n   * @param bottom - Bottom bound of the frustum\n   * @param top - Top bound of the frustum\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum\n   * @returns `this`\n   */\n  orthoZO(left, right, bottom, top, near, far) {\n    return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n  }\n  // ===================\n  // Static accessors\n  // ===================\n  /**\n   * @category Static\n   *\n   * @returns The number of bytes in a {@link Mat4}.\n   */\n  static get BYTE_LENGTH() {\n    return 16 * Float32Array.BYTES_PER_ELEMENT;\n  }\n  // ===================\n  // Static methods\n  // ===================\n  /**\n   * Creates a new, identity {@link Mat4}\n   * @category Static\n   *\n   * @returns A new {@link Mat4}\n   */\n  static create() {\n    return new _Mat4();\n  }\n  /**\n   * Creates a new {@link Mat4} initialized with values from an existing matrix\n   * @category Static\n   *\n   * @param a - Matrix to clone\n   * @returns A new {@link Mat4}\n   */\n  static clone(a) {\n    return new _Mat4(a);\n  }\n  /**\n   * Copy the values from one {@link Mat4} to another\n   * @category Static\n   *\n   * @param out - The receiving Matrix\n   * @param a - Matrix to copy\n   * @returns `out`\n   */\n  static copy(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    out[4] = a[4];\n    out[5] = a[5];\n    out[6] = a[6];\n    out[7] = a[7];\n    out[8] = a[8];\n    out[9] = a[9];\n    out[10] = a[10];\n    out[11] = a[11];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n    return out;\n  }\n  /**\n   * Create a new mat4 with the given values\n   * @category Static\n   *\n   * @param values - Matrix components\n   * @returns A new {@link Mat4}\n   */\n  static fromValues(...values) {\n    return new _Mat4(...values);\n  }\n  /**\n   * Set the components of a mat4 to the given values\n   * @category Static\n   *\n   * @param out - The receiving matrix\n   * @param values - Matrix components\n   * @returns `out`\n   */\n  static set(out, ...values) {\n    out[0] = values[0];\n    out[1] = values[1];\n    out[2] = values[2];\n    out[3] = values[3];\n    out[4] = values[4];\n    out[5] = values[5];\n    out[6] = values[6];\n    out[7] = values[7];\n    out[8] = values[8];\n    out[9] = values[9];\n    out[10] = values[10];\n    out[11] = values[11];\n    out[12] = values[12];\n    out[13] = values[13];\n    out[14] = values[14];\n    out[15] = values[15];\n    return out;\n  }\n  /**\n   * Set a {@link Mat4} to the identity matrix\n   * @category Static\n   *\n   * @param out - The receiving Matrix\n   * @returns `out`\n   */\n  static identity(out) {\n    out[0] = 1;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = 1;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[10] = 1;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Transpose the values of a {@link Mat4}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out`\n   */\n  static transpose(out, a) {\n    if (out === a) {\n      const a01 = a[1], a02 = a[2], a03 = a[3];\n      const a12 = a[6], a13 = a[7];\n      const a23 = a[11];\n      out[1] = a[4];\n      out[2] = a[8];\n      out[3] = a[12];\n      out[4] = a01;\n      out[6] = a[9];\n      out[7] = a[13];\n      out[8] = a02;\n      out[9] = a12;\n      out[11] = a[14];\n      out[12] = a03;\n      out[13] = a13;\n      out[14] = a23;\n    } else {\n      out[0] = a[0];\n      out[1] = a[4];\n      out[2] = a[8];\n      out[3] = a[12];\n      out[4] = a[1];\n      out[5] = a[5];\n      out[6] = a[9];\n      out[7] = a[13];\n      out[8] = a[2];\n      out[9] = a[6];\n      out[10] = a[10];\n      out[11] = a[14];\n      out[12] = a[3];\n      out[13] = a[7];\n      out[14] = a[11];\n      out[15] = a[15];\n    }\n    return out;\n  }\n  /**\n   * Inverts a {@link Mat4}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out` or `null` if the matrix is not invertible\n   */\n  static invert(out, a) {\n    const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n    const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n    const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n    const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n    const b00 = a00 * a11 - a01 * a10;\n    const b01 = a00 * a12 - a02 * a10;\n    const b02 = a00 * a13 - a03 * a10;\n    const b03 = a01 * a12 - a02 * a11;\n    const b04 = a01 * a13 - a03 * a11;\n    const b05 = a02 * a13 - a03 * a12;\n    const b06 = a20 * a31 - a21 * a30;\n    const b07 = a20 * a32 - a22 * a30;\n    const b08 = a20 * a33 - a23 * a30;\n    const b09 = a21 * a32 - a22 * a31;\n    const b10 = a21 * a33 - a23 * a31;\n    const b11 = a22 * a33 - a23 * a32;\n    let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n    if (!det) {\n      return null;\n    }\n    det = 1 / det;\n    out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n    out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n    out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n    out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n    out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n    out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n    out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n    out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n    out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n    out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n    out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n    out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n    out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n    out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n    out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n    out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n    return out;\n  }\n  /**\n   * Calculates the adjugate of a {@link Mat4}\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the source matrix\n   * @returns `out`\n   */\n  static adjoint(out, a) {\n    const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n    const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n    const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n    const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n    const b00 = a00 * a11 - a01 * a10;\n    const b01 = a00 * a12 - a02 * a10;\n    const b02 = a00 * a13 - a03 * a10;\n    const b03 = a01 * a12 - a02 * a11;\n    const b04 = a01 * a13 - a03 * a11;\n    const b05 = a02 * a13 - a03 * a12;\n    const b06 = a20 * a31 - a21 * a30;\n    const b07 = a20 * a32 - a22 * a30;\n    const b08 = a20 * a33 - a23 * a30;\n    const b09 = a21 * a32 - a22 * a31;\n    const b10 = a21 * a33 - a23 * a31;\n    const b11 = a22 * a33 - a23 * a32;\n    out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n    out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n    out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n    out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n    out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n    out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n    out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n    out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n    out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n    out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n    out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n    out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n    out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n    out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n    out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n    out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n    return out;\n  }\n  /**\n   * Calculates the determinant of a {@link Mat4}\n   * @category Static\n   *\n   * @param a - the source matrix\n   * @returns determinant of a\n   */\n  static determinant(a) {\n    const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n    const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n    const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n    const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n    const b0 = a00 * a11 - a01 * a10;\n    const b1 = a00 * a12 - a02 * a10;\n    const b2 = a01 * a12 - a02 * a11;\n    const b3 = a20 * a31 - a21 * a30;\n    const b4 = a20 * a32 - a22 * a30;\n    const b5 = a21 * a32 - a22 * a31;\n    const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n    const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n    const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n    const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n    return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n  }\n  /**\n   * Multiplies two {@link Mat4}s\n   * @category Static\n   *\n   * @param out - The receiving Matrix\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static multiply(out, a, b) {\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a03 = a[3];\n    const a10 = a[4];\n    const a11 = a[5];\n    const a12 = a[6];\n    const a13 = a[7];\n    const a20 = a[8];\n    const a21 = a[9];\n    const a22 = a[10];\n    const a23 = a[11];\n    const a30 = a[12];\n    const a31 = a[13];\n    const a32 = a[14];\n    const a33 = a[15];\n    let b0 = b[0];\n    let b1 = b[1];\n    let b2 = b[2];\n    let b3 = b[3];\n    out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n    out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n    out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n    out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n    b0 = b[4];\n    b1 = b[5];\n    b2 = b[6];\n    b3 = b[7];\n    out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n    out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n    out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n    out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n    b0 = b[8];\n    b1 = b[9];\n    b2 = b[10];\n    b3 = b[11];\n    out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n    out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n    out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n    out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n    b0 = b[12];\n    b1 = b[13];\n    b2 = b[14];\n    b3 = b[15];\n    out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n    out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n    out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n    out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n    return out;\n  }\n  /**\n   * Alias for {@link Mat4.multiply}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mul(out, a, b) {\n    return out;\n  }\n  /**\n   * Translate a {@link Mat4} by the given vector\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to translate\n   * @param v - vector to translate by\n   * @returns `out`\n   */\n  static translate(out, a, v) {\n    const x = v[0];\n    const y = v[1];\n    const z = v[2];\n    if (a === out) {\n      out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n      out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n      out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n      out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n    } else {\n      const a00 = a[0];\n      const a01 = a[1];\n      const a02 = a[2];\n      const a03 = a[3];\n      const a10 = a[4];\n      const a11 = a[5];\n      const a12 = a[6];\n      const a13 = a[7];\n      const a20 = a[8];\n      const a21 = a[9];\n      const a22 = a[10];\n      const a23 = a[11];\n      out[0] = a00;\n      out[1] = a01;\n      out[2] = a02;\n      out[3] = a03;\n      out[4] = a10;\n      out[5] = a11;\n      out[6] = a12;\n      out[7] = a13;\n      out[8] = a20;\n      out[9] = a21;\n      out[10] = a22;\n      out[11] = a23;\n      out[12] = a00 * x + a10 * y + a20 * z + a[12];\n      out[13] = a01 * x + a11 * y + a21 * z + a[13];\n      out[14] = a02 * x + a12 * y + a22 * z + a[14];\n      out[15] = a03 * x + a13 * y + a23 * z + a[15];\n    }\n    return out;\n  }\n  /**\n   * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to scale\n   * @param v - the {@link Vec3} to scale the matrix by\n   * @returns `out`\n   **/\n  static scale(out, a, v) {\n    const x = v[0];\n    const y = v[1];\n    const z = v[2];\n    out[0] = a[0] * x;\n    out[1] = a[1] * x;\n    out[2] = a[2] * x;\n    out[3] = a[3] * x;\n    out[4] = a[4] * y;\n    out[5] = a[5] * y;\n    out[6] = a[6] * y;\n    out[7] = a[7] * y;\n    out[8] = a[8] * z;\n    out[9] = a[9] * z;\n    out[10] = a[10] * z;\n    out[11] = a[11] * z;\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n    return out;\n  }\n  /**\n   * Rotates a {@link Mat4} by the given angle around the given axis\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to rotate\n   * @param rad - the angle to rotate the matrix by\n   * @param axis - the axis to rotate around\n   * @returns `out` or `null` if axis has a length of 0\n   */\n  static rotate(out, a, rad, axis) {\n    let x = axis[0];\n    let y = axis[1];\n    let z = axis[2];\n    let len = Math.sqrt(x * x + y * y + z * z);\n    if (len < GLM_EPSILON) {\n      return null;\n    }\n    len = 1 / len;\n    x *= len;\n    y *= len;\n    z *= len;\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    const t = 1 - c;\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a03 = a[3];\n    const a10 = a[4];\n    const a11 = a[5];\n    const a12 = a[6];\n    const a13 = a[7];\n    const a20 = a[8];\n    const a21 = a[9];\n    const a22 = a[10];\n    const a23 = a[11];\n    const b00 = x * x * t + c;\n    const b01 = y * x * t + z * s;\n    const b02 = z * x * t - y * s;\n    const b10 = x * y * t - z * s;\n    const b11 = y * y * t + c;\n    const b12 = z * y * t + x * s;\n    const b20 = x * z * t + y * s;\n    const b21 = y * z * t - x * s;\n    const b22 = z * z * t + c;\n    out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n    out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n    out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n    out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n    out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n    out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n    out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n    out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n    out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n    out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n    out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n    out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n    if (a !== out) {\n      out[12] = a[12];\n      out[13] = a[13];\n      out[14] = a[14];\n      out[15] = a[15];\n    }\n    return out;\n  }\n  /**\n   * Rotates a matrix by the given angle around the X axis\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to rotate\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static rotateX(out, a, rad) {\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    const a10 = a[4];\n    const a11 = a[5];\n    const a12 = a[6];\n    const a13 = a[7];\n    const a20 = a[8];\n    const a21 = a[9];\n    const a22 = a[10];\n    const a23 = a[11];\n    if (a !== out) {\n      out[0] = a[0];\n      out[1] = a[1];\n      out[2] = a[2];\n      out[3] = a[3];\n      out[12] = a[12];\n      out[13] = a[13];\n      out[14] = a[14];\n      out[15] = a[15];\n    }\n    out[4] = a10 * c + a20 * s;\n    out[5] = a11 * c + a21 * s;\n    out[6] = a12 * c + a22 * s;\n    out[7] = a13 * c + a23 * s;\n    out[8] = a20 * c - a10 * s;\n    out[9] = a21 * c - a11 * s;\n    out[10] = a22 * c - a12 * s;\n    out[11] = a23 * c - a13 * s;\n    return out;\n  }\n  /**\n   * Rotates a matrix by the given angle around the Y axis\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to rotate\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static rotateY(out, a, rad) {\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a03 = a[3];\n    const a20 = a[8];\n    const a21 = a[9];\n    const a22 = a[10];\n    const a23 = a[11];\n    if (a !== out) {\n      out[4] = a[4];\n      out[5] = a[5];\n      out[6] = a[6];\n      out[7] = a[7];\n      out[12] = a[12];\n      out[13] = a[13];\n      out[14] = a[14];\n      out[15] = a[15];\n    }\n    out[0] = a00 * c - a20 * s;\n    out[1] = a01 * c - a21 * s;\n    out[2] = a02 * c - a22 * s;\n    out[3] = a03 * c - a23 * s;\n    out[8] = a00 * s + a20 * c;\n    out[9] = a01 * s + a21 * c;\n    out[10] = a02 * s + a22 * c;\n    out[11] = a03 * s + a23 * c;\n    return out;\n  }\n  /**\n   * Rotates a matrix by the given angle around the Z axis\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to rotate\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static rotateZ(out, a, rad) {\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a03 = a[3];\n    const a10 = a[4];\n    const a11 = a[5];\n    const a12 = a[6];\n    const a13 = a[7];\n    if (a !== out) {\n      out[8] = a[8];\n      out[9] = a[9];\n      out[10] = a[10];\n      out[11] = a[11];\n      out[12] = a[12];\n      out[13] = a[13];\n      out[14] = a[14];\n      out[15] = a[15];\n    }\n    out[0] = a00 * c + a10 * s;\n    out[1] = a01 * c + a11 * s;\n    out[2] = a02 * c + a12 * s;\n    out[3] = a03 * c + a13 * s;\n    out[4] = a10 * c - a00 * s;\n    out[5] = a11 * c - a01 * s;\n    out[6] = a12 * c - a02 * s;\n    out[7] = a13 * c - a03 * s;\n    return out;\n  }\n  /**\n   * Creates a {@link Mat4} from a vector translation\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat4.identity(dest);\n   *   mat4.translate(dest, dest, vec);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat4} receiving operation result\n   * @param v - Translation vector\n   * @returns `out`\n   */\n  static fromTranslation(out, v) {\n    out[0] = 1;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = 1;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[10] = 1;\n    out[11] = 0;\n    out[12] = v[0];\n    out[13] = v[1];\n    out[14] = v[2];\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Creates a {@link Mat4} from a vector scaling\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat4.identity(dest);\n   *   mat4.scale(dest, dest, vec);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat4} receiving operation result\n   * @param v - Scaling vector\n   * @returns `out`\n   */\n  static fromScaling(out, v) {\n    out[0] = v[0];\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = v[1];\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[10] = v[2];\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Creates a {@link Mat4} from a given angle around a given axis\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat4.identity(dest);\n   *   mat4.rotate(dest, dest, rad, axis);\n   * ```\n   * @category Static\n   *\n   * @param out - {@link Mat4} receiving operation result\n   * @param rad - the angle to rotate the matrix by\n   * @param axis - the axis to rotate around\n   * @returns `out` or `null` if `axis` has a length of 0\n   */\n  static fromRotation(out, rad, axis) {\n    let x = axis[0];\n    let y = axis[1];\n    let z = axis[2];\n    let len = Math.sqrt(x * x + y * y + z * z);\n    if (len < GLM_EPSILON) {\n      return null;\n    }\n    len = 1 / len;\n    x *= len;\n    y *= len;\n    z *= len;\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    const t = 1 - c;\n    out[0] = x * x * t + c;\n    out[1] = y * x * t + z * s;\n    out[2] = z * x * t - y * s;\n    out[3] = 0;\n    out[4] = x * y * t - z * s;\n    out[5] = y * y * t + c;\n    out[6] = z * y * t + x * s;\n    out[7] = 0;\n    out[8] = x * z * t + y * s;\n    out[9] = y * z * t - x * s;\n    out[10] = z * z * t + c;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Creates a matrix from the given angle around the X axis\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat4.identity(dest);\n   *   mat4.rotateX(dest, dest, rad);\n   * ```\n   * @category Static\n   *\n   * @param out - mat4 receiving operation result\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static fromXRotation(out, rad) {\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    out[0] = 1;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = c;\n    out[6] = s;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = -s;\n    out[10] = c;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Creates a matrix from the given angle around the Y axis\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat4.identity(dest);\n   *   mat4.rotateY(dest, dest, rad);\n   * ```\n   * @category Static\n   *\n   * @param out - mat4 receiving operation result\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static fromYRotation(out, rad) {\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    out[0] = c;\n    out[1] = 0;\n    out[2] = -s;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = 1;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = s;\n    out[9] = 0;\n    out[10] = c;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Creates a matrix from the given angle around the Z axis\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat4.identity(dest);\n   *   mat4.rotateZ(dest, dest, rad);\n   * ```\n   * @category Static\n   *\n   * @param out - mat4 receiving operation result\n   * @param rad - the angle to rotate the matrix by\n   * @returns `out`\n   */\n  static fromZRotation(out, rad) {\n    const s = Math.sin(rad);\n    const c = Math.cos(rad);\n    out[0] = c;\n    out[1] = s;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = -s;\n    out[5] = c;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[10] = 1;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Creates a matrix from a quaternion rotation and vector translation\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat4.identity(dest);\n   *   mat4.translate(dest, vec);\n   *   let quatMat = mat4.create();\n   *   quat4.toMat4(quat, quatMat);\n   *   mat4.multiply(dest, quatMat);\n   * ```\n   * @category Static\n   *\n   * @param out - mat4 receiving operation result\n   * @param q - Rotation quaternion\n   * @param v - Translation vector\n   * @returns `out`\n   */\n  static fromRotationTranslation(out, q, v) {\n    const x = q[0];\n    const y = q[1];\n    const z = q[2];\n    const w = q[3];\n    const x2 = x + x;\n    const y2 = y + y;\n    const z2 = z + z;\n    const xx = x * x2;\n    const xy = x * y2;\n    const xz = x * z2;\n    const yy = y * y2;\n    const yz = y * z2;\n    const zz = z * z2;\n    const wx = w * x2;\n    const wy = w * y2;\n    const wz = w * z2;\n    out[0] = 1 - (yy + zz);\n    out[1] = xy + wz;\n    out[2] = xz - wy;\n    out[3] = 0;\n    out[4] = xy - wz;\n    out[5] = 1 - (xx + zz);\n    out[6] = yz + wx;\n    out[7] = 0;\n    out[8] = xz + wy;\n    out[9] = yz - wx;\n    out[10] = 1 - (xx + yy);\n    out[11] = 0;\n    out[12] = v[0];\n    out[13] = v[1];\n    out[14] = v[2];\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Sets a {@link Mat4} from a {@link Quat2}.\n   * @category Static\n   *\n   * @param out - Matrix\n   * @param a - Dual Quaternion\n   * @returns `out`\n   */\n  static fromQuat2(out, a) {\n    const bx = -a[0];\n    const by = -a[1];\n    const bz = -a[2];\n    const bw = a[3];\n    const ax = a[4];\n    const ay = a[5];\n    const az = a[6];\n    const aw = a[7];\n    const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n    if (magnitude > 0) {\n      _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n      _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n      _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n    } else {\n      _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n      _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n      _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n    }\n    _Mat4.fromRotationTranslation(out, a, _Mat4.#TMP_VEC3);\n    return out;\n  }\n  /**\n   * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n   * @category Static\n   *\n   * @param out - Matrix receiving operation result\n   * @param a - Mat4 to derive the normal matrix from\n   * @returns `out` or `null` if the matrix is not invertible\n   */\n  static normalFromMat4(out, a) {\n    const a00 = a[0];\n    const a01 = a[1];\n    const a02 = a[2];\n    const a03 = a[3];\n    const a10 = a[4];\n    const a11 = a[5];\n    const a12 = a[6];\n    const a13 = a[7];\n    const a20 = a[8];\n    const a21 = a[9];\n    const a22 = a[10];\n    const a23 = a[11];\n    const a30 = a[12];\n    const a31 = a[13];\n    const a32 = a[14];\n    const a33 = a[15];\n    const b00 = a00 * a11 - a01 * a10;\n    const b01 = a00 * a12 - a02 * a10;\n    const b02 = a00 * a13 - a03 * a10;\n    const b03 = a01 * a12 - a02 * a11;\n    const b04 = a01 * a13 - a03 * a11;\n    const b05 = a02 * a13 - a03 * a12;\n    const b06 = a20 * a31 - a21 * a30;\n    const b07 = a20 * a32 - a22 * a30;\n    const b08 = a20 * a33 - a23 * a30;\n    const b09 = a21 * a32 - a22 * a31;\n    const b10 = a21 * a33 - a23 * a31;\n    const b11 = a22 * a33 - a23 * a32;\n    let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n    if (!det) {\n      return null;\n    }\n    det = 1 / det;\n    out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n    out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n    out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n    out[3] = 0;\n    out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n    out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n    out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n    out[7] = 0;\n    out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n    out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n    out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n   * This version omits the calculation of the constant factor (1/determinant), so\n   * any normals transformed with it will need to be renormalized.\n   * From https://stackoverflow.com/a/27616419/25968\n   * @category Static\n   *\n   * @param out - Matrix receiving operation result\n   * @param a - Mat4 to derive the normal matrix from\n   * @returns `out`\n   */\n  static normalFromMat4Fast(out, a) {\n    const ax = a[0];\n    const ay = a[1];\n    const az = a[2];\n    const bx = a[4];\n    const by = a[5];\n    const bz = a[6];\n    const cx = a[8];\n    const cy = a[9];\n    const cz = a[10];\n    out[0] = by * cz - cz * cy;\n    out[1] = bz * cx - cx * cz;\n    out[2] = bx * cy - cy * cx;\n    out[3] = 0;\n    out[4] = cy * az - cz * ay;\n    out[5] = cz * ax - cx * az;\n    out[6] = cx * ay - cy * ax;\n    out[7] = 0;\n    out[8] = ay * bz - az * by;\n    out[9] = az * bx - ax * bz;\n    out[10] = ax * by - ay * bx;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Returns the translation vector component of a transformation\n   * matrix. If a matrix is built with fromRotationTranslation,\n   * the returned vector will be the same as the translation vector\n   * originally supplied.\n   * @category Static\n   *\n   * @param  {vec3} out Vector to receive translation component\n   * @param  {ReadonlyMat4} mat Matrix to be decomposed (input)\n   * @return {vec3} out\n   */\n  static getTranslation(out, mat) {\n    out[0] = mat[12];\n    out[1] = mat[13];\n    out[2] = mat[14];\n    return out;\n  }\n  /**\n   * Returns the scaling factor component of a transformation\n   * matrix. If a matrix is built with fromRotationTranslationScale\n   * with a normalized Quaternion parameter, the returned vector will be\n   * the same as the scaling vector\n   * originally supplied.\n   * @category Static\n   *\n   * @param  {vec3} out Vector to receive scaling factor component\n   * @param  {ReadonlyMat4} mat Matrix to be decomposed (input)\n   * @return {vec3} out\n   */\n  static getScaling(out, mat) {\n    const m11 = mat[0];\n    const m12 = mat[1];\n    const m13 = mat[2];\n    const m21 = mat[4];\n    const m22 = mat[5];\n    const m23 = mat[6];\n    const m31 = mat[8];\n    const m32 = mat[9];\n    const m33 = mat[10];\n    out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n    out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n    out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n    return out;\n  }\n  /**\n   * Returns a quaternion representing the rotational component\n   * of a transformation matrix. If a matrix is built with\n   * fromRotationTranslation, the returned quaternion will be the\n   * same as the quaternion originally supplied.\n   * @category Static\n   *\n   * @param out - Quaternion to receive the rotation component\n   * @param mat - Matrix to be decomposed (input)\n   * @return `out`\n   */\n  static getRotation(out, mat) {\n    _Mat4.getScaling(_Mat4.#TMP_VEC3, mat);\n    const is1 = 1 / _Mat4.#TMP_VEC3[0];\n    const is2 = 1 / _Mat4.#TMP_VEC3[1];\n    const is3 = 1 / _Mat4.#TMP_VEC3[2];\n    const sm11 = mat[0] * is1;\n    const sm12 = mat[1] * is2;\n    const sm13 = mat[2] * is3;\n    const sm21 = mat[4] * is1;\n    const sm22 = mat[5] * is2;\n    const sm23 = mat[6] * is3;\n    const sm31 = mat[8] * is1;\n    const sm32 = mat[9] * is2;\n    const sm33 = mat[10] * is3;\n    const trace = sm11 + sm22 + sm33;\n    let S = 0;\n    if (trace > 0) {\n      S = Math.sqrt(trace + 1) * 2;\n      out[3] = 0.25 * S;\n      out[0] = (sm23 - sm32) / S;\n      out[1] = (sm31 - sm13) / S;\n      out[2] = (sm12 - sm21) / S;\n    } else if (sm11 > sm22 && sm11 > sm33) {\n      S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n      out[3] = (sm23 - sm32) / S;\n      out[0] = 0.25 * S;\n      out[1] = (sm12 + sm21) / S;\n      out[2] = (sm31 + sm13) / S;\n    } else if (sm22 > sm33) {\n      S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n      out[3] = (sm31 - sm13) / S;\n      out[0] = (sm12 + sm21) / S;\n      out[1] = 0.25 * S;\n      out[2] = (sm23 + sm32) / S;\n    } else {\n      S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n      out[3] = (sm12 - sm21) / S;\n      out[0] = (sm31 + sm13) / S;\n      out[1] = (sm23 + sm32) / S;\n      out[2] = 0.25 * S;\n    }\n    return out;\n  }\n  /**\n   * Decomposes a transformation matrix into its rotation, translation\n   * and scale components. Returns only the rotation component\n   * @category Static\n   *\n   * @param out_r - Quaternion to receive the rotation component\n   * @param out_t - Vector to receive the translation vector\n   * @param out_s - Vector to receive the scaling factor\n   * @param mat - Matrix to be decomposed (input)\n   * @returns `out_r`\n   */\n  static decompose(out_r, out_t, out_s, mat) {\n    out_t[0] = mat[12];\n    out_t[1] = mat[13];\n    out_t[2] = mat[14];\n    const m11 = mat[0];\n    const m12 = mat[1];\n    const m13 = mat[2];\n    const m21 = mat[4];\n    const m22 = mat[5];\n    const m23 = mat[6];\n    const m31 = mat[8];\n    const m32 = mat[9];\n    const m33 = mat[10];\n    out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n    out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n    out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n    const is1 = 1 / out_s[0];\n    const is2 = 1 / out_s[1];\n    const is3 = 1 / out_s[2];\n    const sm11 = m11 * is1;\n    const sm12 = m12 * is2;\n    const sm13 = m13 * is3;\n    const sm21 = m21 * is1;\n    const sm22 = m22 * is2;\n    const sm23 = m23 * is3;\n    const sm31 = m31 * is1;\n    const sm32 = m32 * is2;\n    const sm33 = m33 * is3;\n    const trace = sm11 + sm22 + sm33;\n    let S = 0;\n    if (trace > 0) {\n      S = Math.sqrt(trace + 1) * 2;\n      out_r[3] = 0.25 * S;\n      out_r[0] = (sm23 - sm32) / S;\n      out_r[1] = (sm31 - sm13) / S;\n      out_r[2] = (sm12 - sm21) / S;\n    } else if (sm11 > sm22 && sm11 > sm33) {\n      S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n      out_r[3] = (sm23 - sm32) / S;\n      out_r[0] = 0.25 * S;\n      out_r[1] = (sm12 + sm21) / S;\n      out_r[2] = (sm31 + sm13) / S;\n    } else if (sm22 > sm33) {\n      S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n      out_r[3] = (sm31 - sm13) / S;\n      out_r[0] = (sm12 + sm21) / S;\n      out_r[1] = 0.25 * S;\n      out_r[2] = (sm23 + sm32) / S;\n    } else {\n      S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n      out_r[3] = (sm12 - sm21) / S;\n      out_r[0] = (sm31 + sm13) / S;\n      out_r[1] = (sm23 + sm32) / S;\n      out_r[2] = 0.25 * S;\n    }\n    return out_r;\n  }\n  /**\n   * Creates a matrix from a quaternion rotation, vector translation and vector scale\n   * This is equivalent to (but much faster than):\n   * ```js\n   *   mat4.identity(dest);\n   *   mat4.translate(dest, vec);\n   *   let quatMat = mat4.create();\n   *   quat4.toMat4(quat, quatMat);\n   *   mat4.multiply(dest, quatMat);\n   *   mat4.scale(dest, scale);\n   * ```\n   * @category Static\n   *\n   * @param out - mat4 receiving operation result\n   * @param q - Rotation quaternion\n   * @param v - Translation vector\n   * @param s - Scaling vector\n   * @returns `out`\n   */\n  static fromRotationTranslationScale(out, q, v, s) {\n    const x = q[0];\n    const y = q[1];\n    const z = q[2];\n    const w = q[3];\n    const x2 = x + x;\n    const y2 = y + y;\n    const z2 = z + z;\n    const xx = x * x2;\n    const xy = x * y2;\n    const xz = x * z2;\n    const yy = y * y2;\n    const yz = y * z2;\n    const zz = z * z2;\n    const wx = w * x2;\n    const wy = w * y2;\n    const wz = w * z2;\n    const sx = s[0];\n    const sy = s[1];\n    const sz = s[2];\n    out[0] = (1 - (yy + zz)) * sx;\n    out[1] = (xy + wz) * sx;\n    out[2] = (xz - wy) * sx;\n    out[3] = 0;\n    out[4] = (xy - wz) * sy;\n    out[5] = (1 - (xx + zz)) * sy;\n    out[6] = (yz + wx) * sy;\n    out[7] = 0;\n    out[8] = (xz + wy) * sz;\n    out[9] = (yz - wx) * sz;\n    out[10] = (1 - (xx + yy)) * sz;\n    out[11] = 0;\n    out[12] = v[0];\n    out[13] = v[1];\n    out[14] = v[2];\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n   * given origin. This is equivalent to (but much faster than):\n   * ```js\n   *   mat4.identity(dest);\n   *   mat4.translate(dest, vec);\n   *   mat4.translate(dest, origin);\n   *   let quatMat = mat4.create();\n   *   quat4.toMat4(quat, quatMat);\n   *   mat4.multiply(dest, quatMat);\n   *   mat4.scale(dest, scale)\n   *   mat4.translate(dest, negativeOrigin);\n   * ```\n   * @category Static\n   *\n   * @param out - mat4 receiving operation result\n   * @param q - Rotation quaternion\n   * @param v - Translation vector\n   * @param s - Scaling vector\n   * @param o - The origin vector around which to scale and rotate\n   * @returns `out`\n   */\n  static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n    const x = q[0];\n    const y = q[1];\n    const z = q[2];\n    const w = q[3];\n    const x2 = x + x;\n    const y2 = y + y;\n    const z2 = z + z;\n    const xx = x * x2;\n    const xy = x * y2;\n    const xz = x * z2;\n    const yy = y * y2;\n    const yz = y * z2;\n    const zz = z * z2;\n    const wx = w * x2;\n    const wy = w * y2;\n    const wz = w * z2;\n    const sx = s[0];\n    const sy = s[1];\n    const sz = s[2];\n    const ox = o[0];\n    const oy = o[1];\n    const oz = o[2];\n    const out0 = (1 - (yy + zz)) * sx;\n    const out1 = (xy + wz) * sx;\n    const out2 = (xz - wy) * sx;\n    const out4 = (xy - wz) * sy;\n    const out5 = (1 - (xx + zz)) * sy;\n    const out6 = (yz + wx) * sy;\n    const out8 = (xz + wy) * sz;\n    const out9 = (yz - wx) * sz;\n    const out10 = (1 - (xx + yy)) * sz;\n    out[0] = out0;\n    out[1] = out1;\n    out[2] = out2;\n    out[3] = 0;\n    out[4] = out4;\n    out[5] = out5;\n    out[6] = out6;\n    out[7] = 0;\n    out[8] = out8;\n    out[9] = out9;\n    out[10] = out10;\n    out[11] = 0;\n    out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n    out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n    out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Calculates a 4x4 matrix from the given quaternion\n   * @category Static\n   *\n   * @param out - mat4 receiving operation result\n   * @param q - Quaternion to create matrix from\n   * @returns `out`\n   */\n  static fromQuat(out, q) {\n    const x = q[0];\n    const y = q[1];\n    const z = q[2];\n    const w = q[3];\n    const x2 = x + x;\n    const y2 = y + y;\n    const z2 = z + z;\n    const xx = x * x2;\n    const yx = y * x2;\n    const yy = y * y2;\n    const zx = z * x2;\n    const zy = z * y2;\n    const zz = z * z2;\n    const wx = w * x2;\n    const wy = w * y2;\n    const wz = w * z2;\n    out[0] = 1 - yy - zz;\n    out[1] = yx + wz;\n    out[2] = zx - wy;\n    out[3] = 0;\n    out[4] = yx - wz;\n    out[5] = 1 - xx - zz;\n    out[6] = zy + wx;\n    out[7] = 0;\n    out[8] = zx + wy;\n    out[9] = zy - wx;\n    out[10] = 1 - xx - yy;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Generates a frustum matrix with the given bounds\n   * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n   * which matches WebGL/OpenGL's clip volume.\n   * Passing null/undefined/no value for far will generate infinite projection matrix.\n   * @category Static\n   *\n   * @param out - mat4 frustum matrix will be written into\n   * @param left - Left bound of the frustum\n   * @param right - Right bound of the frustum\n   * @param bottom - Bottom bound of the frustum\n   * @param top - Top bound of the frustum\n   * @param near - Near bound of the frustum\n   * @param far -  Far bound of the frustum, can be null or Infinity\n   * @returns `out`\n   */\n  static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n    const rl = 1 / (right - left);\n    const tb = 1 / (top - bottom);\n    out[0] = near * 2 * rl;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = near * 2 * tb;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = (right + left) * rl;\n    out[9] = (top + bottom) * tb;\n    out[11] = -1;\n    out[12] = 0;\n    out[13] = 0;\n    out[15] = 0;\n    if (far != null && far !== Infinity) {\n      const nf = 1 / (near - far);\n      out[10] = (far + near) * nf;\n      out[14] = 2 * far * near * nf;\n    } else {\n      out[10] = -1;\n      out[14] = -2 * near;\n    }\n    return out;\n  }\n  /**\n   * Alias for {@link Mat4.frustumNO}\n   * @category Static\n   * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n   */\n  static frustum(out, left, right, bottom, top, near, far = Infinity) {\n    return out;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Generates a frustum matrix with the given bounds\n   * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n   * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n   * Passing null/undefined/no value for far will generate infinite projection matrix.\n   * @category Static\n   *\n   * @param out - mat4 frustum matrix will be written into\n   * @param left - Left bound of the frustum\n   * @param right - Right bound of the frustum\n   * @param bottom - Bottom bound of the frustum\n   * @param top - Top bound of the frustum\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum, can be null or Infinity\n   * @returns `out`\n   */\n  static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n    const rl = 1 / (right - left);\n    const tb = 1 / (top - bottom);\n    out[0] = near * 2 * rl;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = near * 2 * tb;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = (right + left) * rl;\n    out[9] = (top + bottom) * tb;\n    out[11] = -1;\n    out[12] = 0;\n    out[13] = 0;\n    out[15] = 0;\n    if (far != null && far !== Infinity) {\n      const nf = 1 / (near - far);\n      out[10] = far * nf;\n      out[14] = far * near * nf;\n    } else {\n      out[10] = -1;\n      out[14] = -near;\n    }\n    return out;\n  }\n  /**\n   * Generates a perspective projection matrix with the given bounds.\n   * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n   * which matches WebGL/OpenGL's clip volume.\n   * Passing null/undefined/no value for far will generate infinite projection matrix.\n   * @category Static\n   *\n   * @param out - mat4 frustum matrix will be written into\n   * @param fovy - Vertical field of view in radians\n   * @param aspect - Aspect ratio. typically viewport width/height\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum, can be null or Infinity\n   * @returns `out`\n   */\n  static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n    const f = 1 / Math.tan(fovy / 2);\n    out[0] = f / aspect;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = f;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[11] = -1;\n    out[12] = 0;\n    out[13] = 0;\n    out[15] = 0;\n    if (far != null && far !== Infinity) {\n      const nf = 1 / (near - far);\n      out[10] = (far + near) * nf;\n      out[14] = 2 * far * near * nf;\n    } else {\n      out[10] = -1;\n      out[14] = -2 * near;\n    }\n    return out;\n  }\n  /**\n   * Alias for {@link Mat4.perspectiveNO}\n   * @category Static\n   * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static perspective(out, fovy, aspect, near, far = Infinity) {\n    return out;\n  }\n  /**\n   * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n   * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n   * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n   * Passing null/undefined/no value for far will generate infinite projection matrix.\n   * @category Static\n   *\n   * @param out - mat4 frustum matrix will be written into\n   * @param fovy - Vertical field of view in radians\n   * @param aspect - Aspect ratio. typically viewport width/height\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum, can be null or Infinity\n   * @returns `out`\n   */\n  static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n    const f = 1 / Math.tan(fovy / 2);\n    out[0] = f / aspect;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = f;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[11] = -1;\n    out[12] = 0;\n    out[13] = 0;\n    out[15] = 0;\n    if (far != null && far !== Infinity) {\n      const nf = 1 / (near - far);\n      out[10] = far * nf;\n      out[14] = far * near * nf;\n    } else {\n      out[10] = -1;\n      out[14] = -near;\n    }\n    return out;\n  }\n  /**\n   * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n   * projection matrices to be used with the still experimental WebVR API.\n   * @category Static\n   *\n   * @param out - mat4 frustum matrix will be written into\n   * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum\n   * @returns `out`\n   * @deprecated\n   */\n  static perspectiveFromFieldOfView(out, fov, near, far) {\n    const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n    const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n    const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n    const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n    const xScale = 2 / (leftTan + rightTan);\n    const yScale = 2 / (upTan + downTan);\n    out[0] = xScale;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = yScale;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = -((leftTan - rightTan) * xScale * 0.5);\n    out[9] = (upTan - downTan) * yScale * 0.5;\n    out[10] = far / (near - far);\n    out[11] = -1;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = far * near / (near - far);\n    out[15] = 0;\n    return out;\n  }\n  /**\n   * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n   * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n   * @category Static\n   *\n   * @param out - mat4 frustum matrix will be written into\n   * @param left - Left bound of the frustum\n   * @param right - Right bound of the frustum\n   * @param bottom - Bottom bound of the frustum\n   * @param top - Top bound of the frustum\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum\n   * @returns `out`\n   */\n  static orthoNO(out, left, right, bottom, top, near, far) {\n    const lr = 1 / (left - right);\n    const bt = 1 / (bottom - top);\n    const nf = 1 / (near - far);\n    out[0] = -2 * lr;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = -2 * bt;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[10] = 2 * nf;\n    out[11] = 0;\n    out[12] = (left + right) * lr;\n    out[13] = (top + bottom) * bt;\n    out[14] = (far + near) * nf;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Alias for {@link Mat4.orthoNO}\n   * @category Static\n   * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static ortho(out, left, right, bottom, top, near, far) {\n    return out;\n  }\n  /**\n   * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n   * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n   * @category Static\n   *\n   * @param out - mat4 frustum matrix will be written into\n   * @param left - Left bound of the frustum\n   * @param right - Right bound of the frustum\n   * @param bottom - Bottom bound of the frustum\n   * @param top - Top bound of the frustum\n   * @param near - Near bound of the frustum\n   * @param far - Far bound of the frustum\n   * @returns `out`\n   */\n  static orthoZO(out, left, right, bottom, top, near, far) {\n    const lr = 1 / (left - right);\n    const bt = 1 / (bottom - top);\n    const nf = 1 / (near - far);\n    out[0] = -2 * lr;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[5] = -2 * bt;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[10] = nf;\n    out[11] = 0;\n    out[12] = (left + right) * lr;\n    out[13] = (top + bottom) * bt;\n    out[14] = near * nf;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n   * actually makes an object look at another object, you should use targetTo instead.\n   * @category Static\n   *\n   * @param out - mat4 frustum matrix will be written into\n   * @param eye - Position of the viewer\n   * @param center - Point the viewer is looking at\n   * @param up - vec3 pointing up\n   * @returns `out`\n   */\n  static lookAt(out, eye, center, up) {\n    const eyex = eye[0];\n    const eyey = eye[1];\n    const eyez = eye[2];\n    const upx = up[0];\n    const upy = up[1];\n    const upz = up[2];\n    const centerx = center[0];\n    const centery = center[1];\n    const centerz = center[2];\n    if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n      return _Mat4.identity(out);\n    }\n    let z0 = eyex - centerx;\n    let z1 = eyey - centery;\n    let z2 = eyez - centerz;\n    let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n    z0 *= len;\n    z1 *= len;\n    z2 *= len;\n    let x0 = upy * z2 - upz * z1;\n    let x1 = upz * z0 - upx * z2;\n    let x2 = upx * z1 - upy * z0;\n    len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n    if (!len) {\n      x0 = 0;\n      x1 = 0;\n      x2 = 0;\n    } else {\n      len = 1 / len;\n      x0 *= len;\n      x1 *= len;\n      x2 *= len;\n    }\n    let y0 = z1 * x2 - z2 * x1;\n    let y1 = z2 * x0 - z0 * x2;\n    let y2 = z0 * x1 - z1 * x0;\n    len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n    if (!len) {\n      y0 = 0;\n      y1 = 0;\n      y2 = 0;\n    } else {\n      len = 1 / len;\n      y0 *= len;\n      y1 *= len;\n      y2 *= len;\n    }\n    out[0] = x0;\n    out[1] = y0;\n    out[2] = z0;\n    out[3] = 0;\n    out[4] = x1;\n    out[5] = y1;\n    out[6] = z1;\n    out[7] = 0;\n    out[8] = x2;\n    out[9] = y2;\n    out[10] = z2;\n    out[11] = 0;\n    out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n    out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n    out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Generates a matrix that makes something look at something else.\n   * @category Static\n   *\n   * @param out - mat4 frustum matrix will be written into\n   * @param eye - Position of the viewer\n   * @param target - Point the viewer is looking at\n   * @param up - vec3 pointing up\n   * @returns `out`\n   */\n  static targetTo(out, eye, target, up) {\n    const eyex = eye[0];\n    const eyey = eye[1];\n    const eyez = eye[2];\n    const upx = up[0];\n    const upy = up[1];\n    const upz = up[2];\n    let z0 = eyex - target[0];\n    let z1 = eyey - target[1];\n    let z2 = eyez - target[2];\n    let len = z0 * z0 + z1 * z1 + z2 * z2;\n    if (len > 0) {\n      len = 1 / Math.sqrt(len);\n      z0 *= len;\n      z1 *= len;\n      z2 *= len;\n    }\n    let x0 = upy * z2 - upz * z1;\n    let x1 = upz * z0 - upx * z2;\n    let x2 = upx * z1 - upy * z0;\n    len = x0 * x0 + x1 * x1 + x2 * x2;\n    if (len > 0) {\n      len = 1 / Math.sqrt(len);\n      x0 *= len;\n      x1 *= len;\n      x2 *= len;\n    }\n    out[0] = x0;\n    out[1] = x1;\n    out[2] = x2;\n    out[3] = 0;\n    out[4] = z1 * x2 - z2 * x1;\n    out[5] = z2 * x0 - z0 * x2;\n    out[6] = z0 * x1 - z1 * x0;\n    out[7] = 0;\n    out[8] = z0;\n    out[9] = z1;\n    out[10] = z2;\n    out[11] = 0;\n    out[12] = eyex;\n    out[13] = eyey;\n    out[14] = eyez;\n    out[15] = 1;\n    return out;\n  }\n  /**\n   * Returns Frobenius norm of a {@link Mat4}\n   * @category Static\n   *\n   * @param a - the matrix to calculate Frobenius norm of\n   * @returns Frobenius norm\n   */\n  static frob(a) {\n    return Math.sqrt(\n      a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n    );\n  }\n  /**\n   * Adds two {@link Mat4}'s\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static add(out, a, b) {\n    out[0] = a[0] + b[0];\n    out[1] = a[1] + b[1];\n    out[2] = a[2] + b[2];\n    out[3] = a[3] + b[3];\n    out[4] = a[4] + b[4];\n    out[5] = a[5] + b[5];\n    out[6] = a[6] + b[6];\n    out[7] = a[7] + b[7];\n    out[8] = a[8] + b[8];\n    out[9] = a[9] + b[9];\n    out[10] = a[10] + b[10];\n    out[11] = a[11] + b[11];\n    out[12] = a[12] + b[12];\n    out[13] = a[13] + b[13];\n    out[14] = a[14] + b[14];\n    out[15] = a[15] + b[15];\n    return out;\n  }\n  /**\n   * Subtracts matrix b from matrix a\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static subtract(out, a, b) {\n    out[0] = a[0] - b[0];\n    out[1] = a[1] - b[1];\n    out[2] = a[2] - b[2];\n    out[3] = a[3] - b[3];\n    out[4] = a[4] - b[4];\n    out[5] = a[5] - b[5];\n    out[6] = a[6] - b[6];\n    out[7] = a[7] - b[7];\n    out[8] = a[8] - b[8];\n    out[9] = a[9] - b[9];\n    out[10] = a[10] - b[10];\n    out[11] = a[11] - b[11];\n    out[12] = a[12] - b[12];\n    out[13] = a[13] - b[13];\n    out[14] = a[14] - b[14];\n    out[15] = a[15] - b[15];\n    return out;\n  }\n  /**\n   * Alias for {@link Mat4.subtract}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sub(out, a, b) {\n    return out;\n  }\n  /**\n   * Multiply each element of the matrix by a scalar.\n   * @category Static\n   *\n   * @param out - the receiving matrix\n   * @param a - the matrix to scale\n   * @param b - amount to scale the matrix's elements by\n   * @returns `out`\n   */\n  static multiplyScalar(out, a, b) {\n    out[0] = a[0] * b;\n    out[1] = a[1] * b;\n    out[2] = a[2] * b;\n    out[3] = a[3] * b;\n    out[4] = a[4] * b;\n    out[5] = a[5] * b;\n    out[6] = a[6] * b;\n    out[7] = a[7] * b;\n    out[8] = a[8] * b;\n    out[9] = a[9] * b;\n    out[10] = a[10] * b;\n    out[11] = a[11] * b;\n    out[12] = a[12] * b;\n    out[13] = a[13] * b;\n    out[14] = a[14] * b;\n    out[15] = a[15] * b;\n    return out;\n  }\n  /**\n   * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param scale - the amount to scale b's elements by before adding\n   * @returns `out`\n   */\n  static multiplyScalarAndAdd(out, a, b, scale) {\n    out[0] = a[0] + b[0] * scale;\n    out[1] = a[1] + b[1] * scale;\n    out[2] = a[2] + b[2] * scale;\n    out[3] = a[3] + b[3] * scale;\n    out[4] = a[4] + b[4] * scale;\n    out[5] = a[5] + b[5] * scale;\n    out[6] = a[6] + b[6] * scale;\n    out[7] = a[7] + b[7] * scale;\n    out[8] = a[8] + b[8] * scale;\n    out[9] = a[9] + b[9] * scale;\n    out[10] = a[10] + b[10] * scale;\n    out[11] = a[11] + b[11] * scale;\n    out[12] = a[12] + b[12] * scale;\n    out[13] = a[13] + b[13] * scale;\n    out[14] = a[14] + b[14] * scale;\n    out[15] = a[15] + b[15] * scale;\n    return out;\n  }\n  /**\n   * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n   * @category Static\n   *\n   * @param a - The first matrix.\n   * @param b - The second matrix.\n   * @returns True if the matrices are equal, false otherwise.\n   */\n  static exactEquals(a, b) {\n    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n  }\n  /**\n   * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n   * @category Static\n   *\n   * @param a - The first matrix.\n   * @param b - The second matrix.\n   * @returns True if the matrices are equal, false otherwise.\n   */\n  static equals(a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const a4 = a[4];\n    const a5 = a[5];\n    const a6 = a[6];\n    const a7 = a[7];\n    const a8 = a[8];\n    const a9 = a[9];\n    const a10 = a[10];\n    const a11 = a[11];\n    const a12 = a[12];\n    const a13 = a[13];\n    const a14 = a[14];\n    const a15 = a[15];\n    const b0 = b[0];\n    const b1 = b[1];\n    const b2 = b[2];\n    const b3 = b[3];\n    const b4 = b[4];\n    const b5 = b[5];\n    const b6 = b[6];\n    const b7 = b[7];\n    const b8 = b[8];\n    const b9 = b[9];\n    const b10 = b[10];\n    const b11 = b[11];\n    const b12 = b[12];\n    const b13 = b[13];\n    const b14 = b[14];\n    const b15 = b[15];\n    return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n  }\n  /**\n   * Returns a string representation of a {@link Mat4}\n   * @category Static\n   *\n   * @param a - matrix to represent as a string\n   * @returns string representation of the matrix\n   */\n  static str(a) {\n    return `Mat4(${a.join(\", \")})`;\n  }\n};\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\nvar Vec3 = class _Vec3 extends Float32Array {\n  /**\n   * Create a {@link Vec3}.\n   *\n   * @category Constructor\n   */\n  constructor(...values) {\n    switch (values.length) {\n      case 3:\n        super(values);\n        break;\n      case 2:\n        super(values[0], values[1], 3);\n        break;\n      case 1: {\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([v, v, v]);\n        } else {\n          super(v, 0, 3);\n        }\n        break;\n      }\n      default:\n        super(3);\n        break;\n    }\n  }\n  // ============\n  // Accessors\n  // ============\n  // Getters and setters to make component access read better.\n  // These are likely to be a little bit slower than direct array access.\n  /**\n   * The x component of the vector. Equivalent to `this[0];`\n   * @category Vector Components\n   */\n  get x() {\n    return this[0];\n  }\n  set x(value) {\n    this[0] = value;\n  }\n  /**\n   * The y component of the vector. Equivalent to `this[1];`\n   * @category Vector Components\n   */\n  get y() {\n    return this[1];\n  }\n  set y(value) {\n    this[1] = value;\n  }\n  /**\n   * The z component of the vector. Equivalent to `this[2];`\n   * @category Vector Components\n   */\n  get z() {\n    return this[2];\n  }\n  set z(value) {\n    this[2] = value;\n  }\n  // Alternate set of getters and setters in case this is being used to define\n  // a color.\n  /**\n   * The r component of the vector. Equivalent to `this[0];`\n   * @category Color Components\n   */\n  get r() {\n    return this[0];\n  }\n  set r(value) {\n    this[0] = value;\n  }\n  /**\n   * The g component of the vector. Equivalent to `this[1];`\n   * @category Color Components\n   */\n  get g() {\n    return this[1];\n  }\n  set g(value) {\n    this[1] = value;\n  }\n  /**\n   * The b component of the vector. Equivalent to `this[2];`\n   * @category Color Components\n   */\n  get b() {\n    return this[2];\n  }\n  set b(value) {\n    this[2] = value;\n  }\n  /**\n   * The magnitude (length) of this.\n   * Equivalent to `Vec3.magnitude(this);`\n   *\n   * Magnitude is used because the `length` attribute is already defined by\n   * TypedArrays to mean the number of elements in the array.\n   *\n   * @category Accessors\n   */\n  get magnitude() {\n    const x = this[0];\n    const y = this[1];\n    const z = this[2];\n    return Math.sqrt(x * x + y * y + z * z);\n  }\n  /**\n   * Alias for {@link Vec3.magnitude}\n   *\n   * @category Accessors\n   */\n  get mag() {\n    return this.magnitude;\n  }\n  /**\n   * The squared magnitude (length) of `this`.\n   * Equivalent to `Vec3.squaredMagnitude(this);`\n   *\n   * @category Accessors\n   */\n  get squaredMagnitude() {\n    const x = this[0];\n    const y = this[1];\n    const z = this[2];\n    return x * x + y * y + z * z;\n  }\n  /**\n   * Alias for {@link Vec3.squaredMagnitude}\n   *\n   * @category Accessors\n   */\n  get sqrMag() {\n    return this.squaredMagnitude;\n  }\n  /**\n   * A string representation of `this`\n   * Equivalent to `Vec3.str(this);`\n   *\n   * @category Accessors\n   */\n  get str() {\n    return _Vec3.str(this);\n  }\n  // ===================\n  // Instances methods\n  // ===================\n  /**\n   * Copy the values from another {@link Vec3} into `this`.\n   * @category Methods\n   *\n   * @param a the source vector\n   * @returns `this`\n   */\n  copy(a) {\n    this.set(a);\n    return this;\n  }\n  /**\n   * Adds a {@link Vec3} to `this`.\n   * Equivalent to `Vec3.add(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to add to `this`\n   * @returns `this`\n   */\n  add(b) {\n    this[0] += b[0];\n    this[1] += b[1];\n    this[2] += b[2];\n    return this;\n  }\n  /**\n   * Subtracts a {@link Vec3} from `this`.\n   * Equivalent to `Vec3.subtract(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to subtract from `this`\n   * @returns `this`\n   */\n  subtract(b) {\n    this[0] -= b[0];\n    this[1] -= b[1];\n    this[2] -= b[2];\n    return this;\n  }\n  /**\n   * Alias for {@link Vec3.subtract}\n   * @category Methods\n   */\n  sub(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Multiplies `this` by a {@link Vec3}.\n   * Equivalent to `Vec3.multiply(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to multiply `this` by\n   * @returns `this`\n   */\n  multiply(b) {\n    this[0] *= b[0];\n    this[1] *= b[1];\n    this[2] *= b[2];\n    return this;\n  }\n  /**\n   * Alias for {@link Vec3.multiply}\n   * @category Methods\n   */\n  mul(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Divides `this` by a {@link Vec3}.\n   * Equivalent to `Vec3.divide(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to divide `this` by\n   * @returns `this`\n   */\n  divide(b) {\n    this[0] /= b[0];\n    this[1] /= b[1];\n    this[2] /= b[2];\n    return this;\n  }\n  /**\n   * Alias for {@link Vec3.divide}\n   * @category Methods\n   */\n  div(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Scales `this` by a scalar number.\n   * Equivalent to `Vec3.scale(this, this, b);`\n   * @category Methods\n   *\n   * @param b - Amount to scale `this` by\n   * @returns `this`\n   */\n  scale(b) {\n    this[0] *= b;\n    this[1] *= b;\n    this[2] *= b;\n    return this;\n  }\n  /**\n   * Calculates `this` scaled by a scalar value then adds the result to `this`.\n   * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n   * @category Methods\n   *\n   * @param b - The vector to add to `this`\n   * @param scale - The amount to scale `b` by before adding\n   * @returns `this`\n   */\n  scaleAndAdd(b, scale) {\n    this[0] += b[0] * scale;\n    this[1] += b[1] * scale;\n    this[2] += b[2] * scale;\n    return this;\n  }\n  /**\n   * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n   * Equivalent to `Vec3.distance(this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to calculate the distance to\n   * @returns Distance between `this` and `b`\n   */\n  distance(b) {\n    return _Vec3.distance(this, b);\n  }\n  /**\n   * Alias for {@link Vec3.distance}\n   * @category Methods\n   */\n  dist(b) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n   * Equivalent to `Vec3.squaredDistance(this, b);`\n   * @category Methods\n   *\n   * @param b The vector to calculate the squared distance to\n   * @returns Squared distance between `this` and `b`\n   */\n  squaredDistance(b) {\n    return _Vec3.squaredDistance(this, b);\n  }\n  /**\n   * Alias for {@link Vec3.squaredDistance}\n   * @category Methods\n   */\n  sqrDist(b) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Negates the components of `this`.\n   * Equivalent to `Vec3.negate(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  negate() {\n    this[0] *= -1;\n    this[1] *= -1;\n    this[2] *= -1;\n    return this;\n  }\n  /**\n   * Inverts the components of `this`.\n   * Equivalent to `Vec3.inverse(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  invert() {\n    this[0] = 1 / this[0];\n    this[1] = 1 / this[1];\n    this[2] = 1 / this[2];\n    return this;\n  }\n  /**\n   * Sets each component of `this` to its absolute value.\n   * Equivalent to `Vec3.abs(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  abs() {\n    this[0] = Math.abs(this[0]);\n    this[1] = Math.abs(this[1]);\n    this[2] = Math.abs(this[2]);\n    return this;\n  }\n  /**\n   * Calculates the dot product of this and another {@link Vec3}.\n   * Equivalent to `Vec3.dot(this, b);`\n   * @category Methods\n   *\n   * @param b - The second operand\n   * @returns Dot product of `this` and `b`\n   */\n  dot(b) {\n    return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n  }\n  /**\n   * Normalize `this`.\n   * Equivalent to `Vec3.normalize(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  normalize() {\n    return _Vec3.normalize(this, this);\n  }\n  // ===================\n  // Static accessors\n  // ===================\n  /**\n   * @category Static\n   *\n   * @returns The number of bytes in a {@link Vec3}.\n   */\n  static get BYTE_LENGTH() {\n    return 3 * Float32Array.BYTES_PER_ELEMENT;\n  }\n  // ===================\n  // Static methods\n  // ===================\n  /**\n   * Creates a new, empty vec3\n   * @category Static\n   *\n   * @returns a new 3D vector\n   */\n  static create() {\n    return new _Vec3();\n  }\n  /**\n   * Creates a new vec3 initialized with values from an existing vector\n   * @category Static\n   *\n   * @param a - vector to clone\n   * @returns a new 3D vector\n   */\n  static clone(a) {\n    return new _Vec3(a);\n  }\n  /**\n   * Calculates the magnitude (length) of a {@link Vec3}\n   * @category Static\n   *\n   * @param a - Vector to calculate magnitude of\n   * @returns Magnitude of a\n   */\n  static magnitude(a) {\n    const x = a[0];\n    const y = a[1];\n    const z = a[2];\n    return Math.sqrt(x * x + y * y + z * z);\n  }\n  /**\n   * Alias for {@link Vec3.magnitude}\n   * @category Static\n   */\n  static mag(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Alias for {@link Vec3.magnitude}\n   * @category Static\n   * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n   *\n   * @param a - vector to calculate length of\n   * @returns length of a\n   */\n  // Length conflicts with Function.length\n  static length(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Alias for {@link Vec3.magnitude}\n   * @category Static\n   * @deprecated Use {@link Vec3.mag}\n   */\n  static len(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Creates a new vec3 initialized with the given values\n   * @category Static\n   *\n   * @param x - X component\n   * @param y - Y component\n   * @param z - Z component\n   * @returns a new 3D vector\n   */\n  static fromValues(x, y, z) {\n    return new _Vec3(x, y, z);\n  }\n  /**\n   * Copy the values from one vec3 to another\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the source vector\n   * @returns `out`\n   */\n  static copy(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    return out;\n  }\n  /**\n   * Set the components of a vec3 to the given values\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param x - X component\n   * @param y - Y component\n   * @param z - Z component\n   * @returns `out`\n   */\n  static set(out, x, y, z) {\n    out[0] = x;\n    out[1] = y;\n    out[2] = z;\n    return out;\n  }\n  /**\n   * Adds two {@link Vec3}s\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static add(out, a, b) {\n    out[0] = a[0] + b[0];\n    out[1] = a[1] + b[1];\n    out[2] = a[2] + b[2];\n    return out;\n  }\n  /**\n   * Subtracts vector b from vector a\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static subtract(out, a, b) {\n    out[0] = a[0] - b[0];\n    out[1] = a[1] - b[1];\n    out[2] = a[2] - b[2];\n    return out;\n  }\n  /**\n   * Alias for {@link Vec3.subtract}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sub(out, a, b) {\n    return [0, 0, 0];\n  }\n  /**\n   * Multiplies two vec3's\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static multiply(out, a, b) {\n    out[0] = a[0] * b[0];\n    out[1] = a[1] * b[1];\n    out[2] = a[2] * b[2];\n    return out;\n  }\n  /**\n   * Alias for {@link Vec3.multiply}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mul(out, a, b) {\n    return [0, 0, 0];\n  }\n  /**\n   * Divides two vec3's\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static divide(out, a, b) {\n    out[0] = a[0] / b[0];\n    out[1] = a[1] / b[1];\n    out[2] = a[2] / b[2];\n    return out;\n  }\n  /**\n   * Alias for {@link Vec3.divide}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static div(out, a, b) {\n    return [0, 0, 0];\n  }\n  /**\n   * Math.ceil the components of a vec3\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to ceil\n   * @returns `out`\n   */\n  static ceil(out, a) {\n    out[0] = Math.ceil(a[0]);\n    out[1] = Math.ceil(a[1]);\n    out[2] = Math.ceil(a[2]);\n    return out;\n  }\n  /**\n   * Math.floor the components of a vec3\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to floor\n   * @returns `out`\n   */\n  static floor(out, a) {\n    out[0] = Math.floor(a[0]);\n    out[1] = Math.floor(a[1]);\n    out[2] = Math.floor(a[2]);\n    return out;\n  }\n  /**\n   * Returns the minimum of two vec3's\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static min(out, a, b) {\n    out[0] = Math.min(a[0], b[0]);\n    out[1] = Math.min(a[1], b[1]);\n    out[2] = Math.min(a[2], b[2]);\n    return out;\n  }\n  /**\n   * Returns the maximum of two vec3's\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static max(out, a, b) {\n    out[0] = Math.max(a[0], b[0]);\n    out[1] = Math.max(a[1], b[1]);\n    out[2] = Math.max(a[2], b[2]);\n    return out;\n  }\n  /**\n   * symmetric round the components of a vec3\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to round\n   * @returns `out`\n   */\n  /*\n    static round(out: Vec3Like, a: Readonly<Vec3Like>): Vec3Like {\n    out[0] = glMatrix.round(a[0]);\n    out[1] = glMatrix.round(a[1]);\n    out[2] = glMatrix.round(a[2]);\n    return out;\n  }*/\n  /**\n   * Scales a vec3 by a scalar number\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the vector to scale\n   * @param scale - amount to scale the vector by\n   * @returns `out`\n   */\n  static scale(out, a, scale) {\n    out[0] = a[0] * scale;\n    out[1] = a[1] * scale;\n    out[2] = a[2] * scale;\n    return out;\n  }\n  /**\n   * Adds two vec3's after scaling the second operand by a scalar value\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param scale - the amount to scale b by before adding\n   * @returns `out`\n   */\n  static scaleAndAdd(out, a, b, scale) {\n    out[0] = a[0] + b[0] * scale;\n    out[1] = a[1] + b[1] * scale;\n    out[2] = a[2] + b[2] * scale;\n    return out;\n  }\n  /**\n   * Calculates the Euclidean distance between two vec3's\n   * @category Static\n   *\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns distance between a and b\n   */\n  static distance(a, b) {\n    const x = b[0] - a[0];\n    const y = b[1] - a[1];\n    const z = b[2] - a[2];\n    return Math.sqrt(x * x + y * y + z * z);\n  }\n  /**\n   * Alias for {@link Vec3.distance}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static dist(a, b) {\n    return 0;\n  }\n  /**\n   * Calculates the squared Euclidean distance between two vec3's\n   * @category Static\n   *\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns squared distance between a and b\n   */\n  static squaredDistance(a, b) {\n    const x = b[0] - a[0];\n    const y = b[1] - a[1];\n    const z = b[2] - a[2];\n    return x * x + y * y + z * z;\n  }\n  /**\n   * Alias for {@link Vec3.squaredDistance}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sqrDist(a, b) {\n    return 0;\n  }\n  /**\n   * Calculates the squared length of a vec3\n   * @category Static\n   *\n   * @param a - vector to calculate squared length of\n   * @returns squared length of a\n   */\n  static squaredLength(a) {\n    const x = a[0];\n    const y = a[1];\n    const z = a[2];\n    return x * x + y * y + z * z;\n  }\n  /**\n   * Alias for {@link Vec3.squaredLength}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sqrLen(a, b) {\n    return 0;\n  }\n  /**\n   * Negates the components of a vec3\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to negate\n   * @returns `out`\n   */\n  static negate(out, a) {\n    out[0] = -a[0];\n    out[1] = -a[1];\n    out[2] = -a[2];\n    return out;\n  }\n  /**\n   * Returns the inverse of the components of a vec3\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to invert\n   * @returns `out`\n   */\n  static inverse(out, a) {\n    out[0] = 1 / a[0];\n    out[1] = 1 / a[1];\n    out[2] = 1 / a[2];\n    return out;\n  }\n  /**\n   * Returns the absolute value of the components of a {@link Vec3}\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - Vector to compute the absolute values of\n   * @returns `out`\n   */\n  static abs(out, a) {\n    out[0] = Math.abs(a[0]);\n    out[1] = Math.abs(a[1]);\n    out[2] = Math.abs(a[2]);\n    return out;\n  }\n  /**\n   * Normalize a vec3\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to normalize\n   * @returns `out`\n   */\n  static normalize(out, a) {\n    const x = a[0];\n    const y = a[1];\n    const z = a[2];\n    let len = x * x + y * y + z * z;\n    if (len > 0) {\n      len = 1 / Math.sqrt(len);\n    }\n    out[0] = a[0] * len;\n    out[1] = a[1] * len;\n    out[2] = a[2] * len;\n    return out;\n  }\n  /**\n   * Calculates the dot product of two vec3's\n   * @category Static\n   *\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns dot product of a and b\n   */\n  static dot(a, b) {\n    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n  }\n  /**\n   * Computes the cross product of two vec3's\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static cross(out, a, b) {\n    const ax = a[0], ay = a[1], az = a[2];\n    const bx = b[0], by = b[1], bz = b[2];\n    out[0] = ay * bz - az * by;\n    out[1] = az * bx - ax * bz;\n    out[2] = ax * by - ay * bx;\n    return out;\n  }\n  /**\n   * Performs a linear interpolation between two vec3's\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param t - interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  static lerp(out, a, b, t) {\n    const ax = a[0];\n    const ay = a[1];\n    const az = a[2];\n    out[0] = ax + t * (b[0] - ax);\n    out[1] = ay + t * (b[1] - ay);\n    out[2] = az + t * (b[2] - az);\n    return out;\n  }\n  /**\n   * Performs a spherical linear interpolation between two vec3's\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param t - interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  static slerp(out, a, b, t) {\n    const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n    const sinTotal = Math.sin(angle);\n    const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n    const ratioB = Math.sin(t * angle) / sinTotal;\n    out[0] = ratioA * a[0] + ratioB * b[0];\n    out[1] = ratioA * a[1] + ratioB * b[1];\n    out[2] = ratioA * a[2] + ratioB * b[2];\n    return out;\n  }\n  /**\n   * Performs a hermite interpolation with two control points\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param c - the third operand\n   * @param d - the fourth operand\n   * @param t - interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  static hermite(out, a, b, c, d, t) {\n    const factorTimes2 = t * t;\n    const factor1 = factorTimes2 * (2 * t - 3) + 1;\n    const factor2 = factorTimes2 * (t - 2) + t;\n    const factor3 = factorTimes2 * (t - 1);\n    const factor4 = factorTimes2 * (3 - 2 * t);\n    out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n    out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n    out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n    return out;\n  }\n  /**\n   * Performs a bezier interpolation with two control points\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param c - the third operand\n   * @param d - the fourth operand\n   * @param t - interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  static bezier(out, a, b, c, d, t) {\n    const inverseFactor = 1 - t;\n    const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n    const factorTimes2 = t * t;\n    const factor1 = inverseFactorTimesTwo * inverseFactor;\n    const factor2 = 3 * t * inverseFactorTimesTwo;\n    const factor3 = 3 * factorTimes2 * inverseFactor;\n    const factor4 = factorTimes2 * t;\n    out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n    out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n    out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n    return out;\n  }\n  /**\n   * Generates a random vector with the given scale\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n   * @returns `out`\n   */\n  /*\n      static random(out: Vec3Like, scale) {\n      scale = scale === undefined ? 1.0 : scale;\n  \n      let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n      let z = glMatrix.RANDOM() * 2.0 - 1.0;\n      let zScale = Math.sqrt(1.0 - z * z) * scale;\n  \n      out[0] = Math.cos(r) * zScale;\n      out[1] = Math.sin(r) * zScale;\n      out[2] = z * scale;\n      return out;\n    }*/\n  /**\n   * Transforms the vec3 with a mat4.\n   * 4th vector component is implicitly '1'\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the vector to transform\n   * @param m - matrix to transform with\n   * @returns `out`\n   */\n  static transformMat4(out, a, m) {\n    const x = a[0], y = a[1], z = a[2];\n    const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n    out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n    out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n    out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n    return out;\n  }\n  /**\n   * Transforms the vec3 with a mat3.\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the vector to transform\n   * @param m - the 3x3 matrix to transform with\n   * @returns `out`\n   */\n  static transformMat3(out, a, m) {\n    const x = a[0], y = a[1], z = a[2];\n    out[0] = x * m[0] + y * m[3] + z * m[6];\n    out[1] = x * m[1] + y * m[4] + z * m[7];\n    out[2] = x * m[2] + y * m[5] + z * m[8];\n    return out;\n  }\n  /**\n   * Transforms the vec3 with a quat\n   * Can also be used for dual quaternions. (Multiply it with the real part)\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the vector to transform\n   * @param q - quaternion to transform with\n   * @returns `out`\n   */\n  static transformQuat(out, a, q) {\n    const qx = q[0];\n    const qy = q[1];\n    const qz = q[2];\n    const w2 = q[3] * 2;\n    const x = a[0];\n    const y = a[1];\n    const z = a[2];\n    const uvx = qy * z - qz * y;\n    const uvy = qz * x - qx * z;\n    const uvz = qx * y - qy * x;\n    const uuvx = (qy * uvz - qz * uvy) * 2;\n    const uuvy = (qz * uvx - qx * uvz) * 2;\n    const uuvz = (qx * uvy - qy * uvx) * 2;\n    out[0] = x + uvx * w2 + uuvx;\n    out[1] = y + uvy * w2 + uuvy;\n    out[2] = z + uvz * w2 + uuvz;\n    return out;\n  }\n  /**\n   * Rotate a 3D vector around the x-axis\n   * @category Static\n   *\n   * @param out - The receiving vec3\n   * @param a - The vec3 point to rotate\n   * @param b - The origin of the rotation\n   * @param rad - The angle of rotation in radians\n   * @returns `out`\n   */\n  static rotateX(out, a, b, rad) {\n    const by = b[1];\n    const bz = b[2];\n    const py = a[1] - by;\n    const pz = a[2] - bz;\n    out[0] = a[0];\n    out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n    out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n    return out;\n  }\n  /**\n   * Rotate a 3D vector around the y-axis\n   * @category Static\n   *\n   * @param out - The receiving vec3\n   * @param a - The vec3 point to rotate\n   * @param b - The origin of the rotation\n   * @param rad - The angle of rotation in radians\n   * @returns `out`\n   */\n  static rotateY(out, a, b, rad) {\n    const bx = b[0];\n    const bz = b[2];\n    const px = a[0] - bx;\n    const pz = a[2] - bz;\n    out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n    out[1] = a[1];\n    out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n    return out;\n  }\n  /**\n   * Rotate a 3D vector around the z-axis\n   * @category Static\n   *\n   * @param out - The receiving vec3\n   * @param a - The vec3 point to rotate\n   * @param b - The origin of the rotation\n   * @param rad - The angle of rotation in radians\n   * @returns `out`\n   */\n  static rotateZ(out, a, b, rad) {\n    const bx = b[0];\n    const by = b[1];\n    const px = a[0] - bx;\n    const py = a[1] - by;\n    out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n    out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n    out[2] = b[2];\n    return out;\n  }\n  /**\n   * Get the angle between two 3D vectors\n   * @category Static\n   *\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns The angle in radians\n   */\n  static angle(a, b) {\n    const ax = a[0];\n    const ay = a[1];\n    const az = a[2];\n    const bx = b[0];\n    const by = b[1];\n    const bz = b[2];\n    const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n    const cosine = mag && _Vec3.dot(a, b) / mag;\n    return Math.acos(Math.min(Math.max(cosine, -1), 1));\n  }\n  /**\n   * Set the components of a vec3 to zero\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @returns `out`\n   */\n  static zero(out) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n    return out;\n  }\n  /**\n   * Returns a string representation of a vector\n   * @category Static\n   *\n   * @param a - vector to represent as a string\n   * @returns string representation of the vector\n   */\n  static str(a) {\n    return `Vec3(${a.join(\", \")})`;\n  }\n  /**\n   * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n   * @category Static\n   *\n   * @param a - The first vector.\n   * @param b - The second vector.\n   * @returns True if the vectors are equal, false otherwise.\n   */\n  static exactEquals(a, b) {\n    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n  }\n  /**\n   * Returns whether the vectors have approximately the same elements in the same position.\n   * @category Static\n   *\n   * @param a - The first vector.\n   * @param b - The second vector.\n   * @returns True if the vectors are equal, false otherwise.\n   */\n  static equals(a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const b0 = b[0];\n    const b1 = b[1];\n    const b2 = b[2];\n    return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n  }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\nvar Vec4 = class _Vec4 extends Float32Array {\n  /**\n   * Create a {@link Vec4}.\n   *\n   * @category Constructor\n   */\n  constructor(...values) {\n    switch (values.length) {\n      case 4:\n        super(values);\n        break;\n      case 2:\n        super(values[0], values[1], 4);\n        break;\n      case 1: {\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([v, v, v, v]);\n        } else {\n          super(v, 0, 4);\n        }\n        break;\n      }\n      default:\n        super(4);\n        break;\n    }\n  }\n  // ============\n  // Accessors\n  // ============\n  // Getters and setters to make component access read better.\n  // These are likely to be a little bit slower than direct array access.\n  /**\n   * The x component of the vector. Equivalent to `this[0];`\n   * @category Vector Components\n   */\n  get x() {\n    return this[0];\n  }\n  set x(value) {\n    this[0] = value;\n  }\n  /**\n   * The y component of the vector. Equivalent to `this[1];`\n   * @category Vector Components\n   */\n  get y() {\n    return this[1];\n  }\n  set y(value) {\n    this[1] = value;\n  }\n  /**\n   * The z component of the vector. Equivalent to `this[2];`\n   * @category Vector Components\n   */\n  get z() {\n    return this[2];\n  }\n  set z(value) {\n    this[2] = value;\n  }\n  /**\n   * The w component of the vector. Equivalent to `this[3];`\n   * @category Vector Components\n   */\n  get w() {\n    return this[3];\n  }\n  set w(value) {\n    this[3] = value;\n  }\n  // Alternate set of getters and setters in case this is being used to define\n  // a color.\n  /**\n   * The r component of the vector. Equivalent to `this[0];`\n   * @category Color Components\n   */\n  get r() {\n    return this[0];\n  }\n  set r(value) {\n    this[0] = value;\n  }\n  /**\n   * The g component of the vector. Equivalent to `this[1];`\n   * @category Color Components\n   */\n  get g() {\n    return this[1];\n  }\n  set g(value) {\n    this[1] = value;\n  }\n  /**\n   * The b component of the vector. Equivalent to `this[2];`\n   * @category Color Components\n   */\n  get b() {\n    return this[2];\n  }\n  set b(value) {\n    this[2] = value;\n  }\n  /**\n   * The a component of the vector. Equivalent to `this[3];`\n   * @category Color Components\n   */\n  get a() {\n    return this[3];\n  }\n  set a(value) {\n    this[3] = value;\n  }\n  /**\n   * The magnitude (length) of this.\n   * Equivalent to `Vec4.magnitude(this);`\n   *\n   * Magnitude is used because the `length` attribute is already defined by\n   * TypedArrays to mean the number of elements in the array.\n   *\n   * @category Accessors\n   */\n  get magnitude() {\n    const x = this[0];\n    const y = this[1];\n    const z = this[2];\n    const w = this[3];\n    return Math.sqrt(x * x + y * y + z * z + w * w);\n  }\n  /**\n   * Alias for {@link Vec4.magnitude}\n   *\n   * @category Accessors\n   */\n  get mag() {\n    return this.magnitude;\n  }\n  /**\n   * A string representation of `this`\n   * Equivalent to `Vec4.str(this);`\n   *\n   * @category Accessors\n   */\n  get str() {\n    return _Vec4.str(this);\n  }\n  // ===================\n  // Instances methods\n  // ===================\n  /**\n   * Copy the values from another {@link Vec4} into `this`.\n   * @category Methods\n   *\n   * @param a the source vector\n   * @returns `this`\n   */\n  copy(a) {\n    super.set(a);\n    return this;\n  }\n  /**\n   * Adds a {@link Vec4} to `this`.\n   * Equivalent to `Vec4.add(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to add to `this`\n   * @returns `this`\n   */\n  add(b) {\n    this[0] += b[0];\n    this[1] += b[1];\n    this[2] += b[2];\n    this[3] += b[3];\n    return this;\n  }\n  /**\n   * Subtracts a {@link Vec4} from `this`.\n   * Equivalent to `Vec4.subtract(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to subtract from `this`\n   * @returns `this`\n   */\n  subtract(b) {\n    this[0] -= b[0];\n    this[1] -= b[1];\n    this[2] -= b[2];\n    this[3] -= b[3];\n    return this;\n  }\n  /**\n   * Alias for {@link Vec4.subtract}\n   * @category Methods\n   */\n  sub(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Multiplies `this` by a {@link Vec4}.\n   * Equivalent to `Vec4.multiply(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to multiply `this` by\n   * @returns `this`\n   */\n  multiply(b) {\n    this[0] *= b[0];\n    this[1] *= b[1];\n    this[2] *= b[2];\n    this[3] *= b[3];\n    return this;\n  }\n  /**\n   * Alias for {@link Vec4.multiply}\n   * @category Methods\n   */\n  mul(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Divides `this` by a {@link Vec4}.\n   * Equivalent to `Vec4.divide(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to divide `this` by\n   * @returns `this`\n   */\n  divide(b) {\n    this[0] /= b[0];\n    this[1] /= b[1];\n    this[2] /= b[2];\n    this[3] /= b[3];\n    return this;\n  }\n  /**\n   * Alias for {@link Vec4.divide}\n   * @category Methods\n   */\n  div(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Scales `this` by a scalar number.\n   * Equivalent to `Vec4.scale(this, this, b);`\n   * @category Methods\n   *\n   * @param b - Amount to scale `this` by\n   * @returns `this`\n   */\n  scale(b) {\n    this[0] *= b;\n    this[1] *= b;\n    this[2] *= b;\n    this[3] *= b;\n    return this;\n  }\n  /**\n   * Calculates `this` scaled by a scalar value then adds the result to `this`.\n   * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n   * @category Methods\n   *\n   * @param b - The vector to add to `this`\n   * @param scale - The amount to scale `b` by before adding\n   * @returns `this`\n   */\n  scaleAndAdd(b, scale) {\n    this[0] += b[0] * scale;\n    this[1] += b[1] * scale;\n    this[2] += b[2] * scale;\n    this[3] += b[3] * scale;\n    return this;\n  }\n  /**\n   * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n   * Equivalent to `Vec4.distance(this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to calculate the distance to\n   * @returns Distance between `this` and `b`\n   */\n  distance(b) {\n    return _Vec4.distance(this, b);\n  }\n  /**\n   * Alias for {@link Vec4.distance}\n   * @category Methods\n   */\n  dist(b) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n   * Equivalent to `Vec4.squaredDistance(this, b);`\n   * @category Methods\n   *\n   * @param b The vector to calculate the squared distance to\n   * @returns Squared distance between `this` and `b`\n   */\n  squaredDistance(b) {\n    return _Vec4.squaredDistance(this, b);\n  }\n  /**\n   * Alias for {@link Vec4.squaredDistance}\n   * @category Methods\n   */\n  sqrDist(b) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Negates the components of `this`.\n   * Equivalent to `Vec4.negate(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  negate() {\n    this[0] *= -1;\n    this[1] *= -1;\n    this[2] *= -1;\n    this[3] *= -1;\n    return this;\n  }\n  /**\n   * Inverts the components of `this`.\n   * Equivalent to `Vec4.inverse(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  invert() {\n    this[0] = 1 / this[0];\n    this[1] = 1 / this[1];\n    this[2] = 1 / this[2];\n    this[3] = 1 / this[3];\n    return this;\n  }\n  /**\n   * Sets each component of `this` to it's absolute value.\n   * Equivalent to `Vec4.abs(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  abs() {\n    this[0] = Math.abs(this[0]);\n    this[1] = Math.abs(this[1]);\n    this[2] = Math.abs(this[2]);\n    this[3] = Math.abs(this[3]);\n    return this;\n  }\n  /**\n   * Calculates the dot product of this and another {@link Vec4}.\n   * Equivalent to `Vec4.dot(this, b);`\n   * @category Methods\n   *\n   * @param b - The second operand\n   * @returns Dot product of `this` and `b`\n   */\n  dot(b) {\n    return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n  }\n  /**\n   * Normalize `this`.\n   * Equivalent to `Vec4.normalize(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  normalize() {\n    return _Vec4.normalize(this, this);\n  }\n  // ===================\n  // Static accessors\n  // ===================\n  /**\n   * @category Static\n   *\n   * @returns The number of bytes in a {@link Vec4}.\n   */\n  static get BYTE_LENGTH() {\n    return 4 * Float32Array.BYTES_PER_ELEMENT;\n  }\n  // ===================\n  // Static methods\n  // ===================\n  /**\n   * Creates a new, empty {@link Vec4}\n   * @category Static\n   *\n   * @returns a new 4D vector\n   */\n  static create() {\n    return new _Vec4();\n  }\n  /**\n   * Creates a new {@link Vec4} initialized with values from an existing vector\n   * @category Static\n   *\n   * @param a - vector to clone\n   * @returns a new 4D vector\n   */\n  static clone(a) {\n    return new _Vec4(a);\n  }\n  /**\n   * Creates a new {@link Vec4} initialized with the given values\n   * @category Static\n   *\n   * @param x - X component\n   * @param y - Y component\n   * @param z - Z component\n   * @param w - W component\n   * @returns a new 4D vector\n   */\n  static fromValues(x, y, z, w) {\n    return new _Vec4(x, y, z, w);\n  }\n  /**\n   * Copy the values from one {@link Vec4} to another\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the source vector\n   * @returns `out`\n   */\n  static copy(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    return out;\n  }\n  /**\n   * Set the components of a {@link Vec4} to the given values\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param x - X component\n   * @param y - Y component\n   * @param z - Z component\n   * @param w - W component\n   * @returns `out`\n   */\n  static set(out, x, y, z, w) {\n    out[0] = x;\n    out[1] = y;\n    out[2] = z;\n    out[3] = w;\n    return out;\n  }\n  /**\n   * Adds two {@link Vec4}s\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static add(out, a, b) {\n    out[0] = a[0] + b[0];\n    out[1] = a[1] + b[1];\n    out[2] = a[2] + b[2];\n    out[3] = a[3] + b[3];\n    return out;\n  }\n  /**\n   * Subtracts vector b from vector a\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static subtract(out, a, b) {\n    out[0] = a[0] - b[0];\n    out[1] = a[1] - b[1];\n    out[2] = a[2] - b[2];\n    out[3] = a[3] - b[3];\n    return out;\n  }\n  /**\n   * Alias for {@link Vec4.subtract}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sub(out, a, b) {\n    return out;\n  }\n  /**\n   * Multiplies two {@link Vec4}'s\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static multiply(out, a, b) {\n    out[0] = a[0] * b[0];\n    out[1] = a[1] * b[1];\n    out[2] = a[2] * b[2];\n    out[3] = a[3] * b[3];\n    return out;\n  }\n  /**\n   * Alias for {@link Vec4.multiply}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mul(out, a, b) {\n    return out;\n  }\n  /**\n   * Divides two {@link Vec4}'s\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static divide(out, a, b) {\n    out[0] = a[0] / b[0];\n    out[1] = a[1] / b[1];\n    out[2] = a[2] / b[2];\n    out[3] = a[3] / b[3];\n    return out;\n  }\n  /**\n   * Alias for {@link Vec4.divide}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static div(out, a, b) {\n    return out;\n  }\n  /**\n   * Math.ceil the components of a {@link Vec4}\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to ceil\n   * @returns `out`\n   */\n  static ceil(out, a) {\n    out[0] = Math.ceil(a[0]);\n    out[1] = Math.ceil(a[1]);\n    out[2] = Math.ceil(a[2]);\n    out[3] = Math.ceil(a[3]);\n    return out;\n  }\n  /**\n   * Math.floor the components of a {@link Vec4}\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to floor\n   * @returns `out`\n   */\n  static floor(out, a) {\n    out[0] = Math.floor(a[0]);\n    out[1] = Math.floor(a[1]);\n    out[2] = Math.floor(a[2]);\n    out[3] = Math.floor(a[3]);\n    return out;\n  }\n  /**\n   * Returns the minimum of two {@link Vec4}'s\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static min(out, a, b) {\n    out[0] = Math.min(a[0], b[0]);\n    out[1] = Math.min(a[1], b[1]);\n    out[2] = Math.min(a[2], b[2]);\n    out[3] = Math.min(a[3], b[3]);\n    return out;\n  }\n  /**\n   * Returns the maximum of two {@link Vec4}'s\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static max(out, a, b) {\n    out[0] = Math.max(a[0], b[0]);\n    out[1] = Math.max(a[1], b[1]);\n    out[2] = Math.max(a[2], b[2]);\n    out[3] = Math.max(a[3], b[3]);\n    return out;\n  }\n  /**\n   * Math.round the components of a {@link Vec4}\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to round\n   * @returns `out`\n   */\n  static round(out, a) {\n    out[0] = Math.round(a[0]);\n    out[1] = Math.round(a[1]);\n    out[2] = Math.round(a[2]);\n    out[3] = Math.round(a[3]);\n    return out;\n  }\n  /**\n   * Scales a {@link Vec4} by a scalar number\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the vector to scale\n   * @param scale - amount to scale the vector by\n   * @returns `out`\n   */\n  static scale(out, a, scale) {\n    out[0] = a[0] * scale;\n    out[1] = a[1] * scale;\n    out[2] = a[2] * scale;\n    out[3] = a[3] * scale;\n    return out;\n  }\n  /**\n   * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param scale - the amount to scale b by before adding\n   * @returns `out`\n   */\n  static scaleAndAdd(out, a, b, scale) {\n    out[0] = a[0] + b[0] * scale;\n    out[1] = a[1] + b[1] * scale;\n    out[2] = a[2] + b[2] * scale;\n    out[3] = a[3] + b[3] * scale;\n    return out;\n  }\n  /**\n   * Calculates the Euclidean distance between two {@link Vec4}'s\n   * @category Static\n   *\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns distance between a and b\n   */\n  static distance(a, b) {\n    const x = b[0] - a[0];\n    const y = b[1] - a[1];\n    const z = b[2] - a[2];\n    const w = b[3] - a[3];\n    return Math.hypot(x, y, z, w);\n  }\n  /**\n   * Alias for {@link Vec4.distance}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static dist(a, b) {\n    return 0;\n  }\n  /**\n   * Calculates the squared Euclidean distance between two {@link Vec4}'s\n   * @category Static\n   *\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns squared distance between a and b\n   */\n  static squaredDistance(a, b) {\n    const x = b[0] - a[0];\n    const y = b[1] - a[1];\n    const z = b[2] - a[2];\n    const w = b[3] - a[3];\n    return x * x + y * y + z * z + w * w;\n  }\n  /**\n   * Alias for {@link Vec4.squaredDistance}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sqrDist(a, b) {\n    return 0;\n  }\n  /**\n   * Calculates the magnitude (length) of a {@link Vec4}\n   * @category Static\n   *\n   * @param a - vector to calculate length of\n   * @returns length of `a`\n   */\n  static magnitude(a) {\n    const x = a[0];\n    const y = a[1];\n    const z = a[2];\n    const w = a[3];\n    return Math.sqrt(x * x + y * y + z * z + w * w);\n  }\n  /**\n   * Alias for {@link Vec4.magnitude}\n   * @category Static\n   */\n  static mag(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Alias for {@link Vec4.magnitude}\n   * @category Static\n   * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n   */\n  // Length conflicts with Function.length\n  static length(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Alias for {@link Vec4.magnitude}\n   * @category Static\n   * @deprecated Use {@link Vec4.mag}\n   */\n  static len(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Calculates the squared length of a {@link Vec4}\n   * @category Static\n   *\n   * @param a - vector to calculate squared length of\n   * @returns squared length of a\n   */\n  static squaredLength(a) {\n    const x = a[0];\n    const y = a[1];\n    const z = a[2];\n    const w = a[3];\n    return x * x + y * y + z * z + w * w;\n  }\n  /**\n   * Alias for {@link Vec4.squaredLength}\n   * @category Static\n   */\n  static sqrLen(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Negates the components of a {@link Vec4}\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to negate\n   * @returns `out`\n   */\n  static negate(out, a) {\n    out[0] = -a[0];\n    out[1] = -a[1];\n    out[2] = -a[2];\n    out[3] = -a[3];\n    return out;\n  }\n  /**\n   * Returns the inverse of the components of a {@link Vec4}\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to invert\n   * @returns `out`\n   */\n  static inverse(out, a) {\n    out[0] = 1 / a[0];\n    out[1] = 1 / a[1];\n    out[2] = 1 / a[2];\n    out[3] = 1 / a[3];\n    return out;\n  }\n  /**\n   * Returns the absolute value of the components of a {@link Vec4}\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - Vector to compute the absolute values of\n   * @returns `out`\n   */\n  static abs(out, a) {\n    out[0] = Math.abs(a[0]);\n    out[1] = Math.abs(a[1]);\n    out[2] = Math.abs(a[2]);\n    out[3] = Math.abs(a[3]);\n    return out;\n  }\n  /**\n   * Normalize a {@link Vec4}\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - vector to normalize\n   * @returns `out`\n   */\n  static normalize(out, a) {\n    const x = a[0];\n    const y = a[1];\n    const z = a[2];\n    const w = a[3];\n    let len = x * x + y * y + z * z + w * w;\n    if (len > 0) {\n      len = 1 / Math.sqrt(len);\n    }\n    out[0] = x * len;\n    out[1] = y * len;\n    out[2] = z * len;\n    out[3] = w * len;\n    return out;\n  }\n  /**\n   * Calculates the dot product of two {@link Vec4}'s\n   * @category Static\n   *\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns dot product of a and b\n   */\n  static dot(a, b) {\n    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n  }\n  /**\n   * Returns the cross-product of three vectors in a 4-dimensional space\n   * @category Static\n   *\n   * @param out the receiving vector\n   * @param u - the first vector\n   * @param v - the second vector\n   * @param w - the third vector\n   * @returns result\n   */\n  static cross(out, u, v, w) {\n    const a = v[0] * w[1] - v[1] * w[0];\n    const b = v[0] * w[2] - v[2] * w[0];\n    const c = v[0] * w[3] - v[3] * w[0];\n    const d = v[1] * w[2] - v[2] * w[1];\n    const e = v[1] * w[3] - v[3] * w[1];\n    const f = v[2] * w[3] - v[3] * w[2];\n    const g = u[0];\n    const h = u[1];\n    const i = u[2];\n    const j = u[3];\n    out[0] = h * f - i * e + j * d;\n    out[1] = -(g * f) + i * c - j * b;\n    out[2] = g * e - h * c + j * a;\n    out[3] = -(g * d) + h * b - i * a;\n    return out;\n  }\n  /**\n   * Performs a linear interpolation between two {@link Vec4}'s\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param t - interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  static lerp(out, a, b, t) {\n    const ax = a[0];\n    const ay = a[1];\n    const az = a[2];\n    const aw = a[3];\n    out[0] = ax + t * (b[0] - ax);\n    out[1] = ay + t * (b[1] - ay);\n    out[2] = az + t * (b[2] - az);\n    out[3] = aw + t * (b[3] - aw);\n    return out;\n  }\n  /**\n   * Generates a random vector with the given scale\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n   * @returns `out`\n   */\n  /*\n      static random(out: Vec4Like, scale): Vec4Like {\n      scale = scale || 1.0;\n  \n      // Marsaglia, George. Choosing a Point from the Surface of a\n      // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n      // http://projecteuclid.org/euclid.aoms/1177692644;\n      var v1, v2, v3, v4;\n      var s1, s2;\n      do {\n        v1 = glMatrix.RANDOM() * 2 - 1;\n        v2 = glMatrix.RANDOM() * 2 - 1;\n        s1 = v1 * v1 + v2 * v2;\n      } while (s1 >= 1);\n      do {\n        v3 = glMatrix.RANDOM() * 2 - 1;\n        v4 = glMatrix.RANDOM() * 2 - 1;\n        s2 = v3 * v3 + v4 * v4;\n      } while (s2 >= 1);\n  \n      var d = Math.sqrt((1 - s1) / s2);\n      out[0] = scale * v1;\n      out[1] = scale * v2;\n      out[2] = scale * v3 * d;\n      out[3] = scale * v4 * d;\n      return out;\n    }*/\n  /**\n   * Transforms the {@link Vec4} with a {@link Mat4}.\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the vector to transform\n   * @param m - matrix to transform with\n   * @returns `out`\n   */\n  static transformMat4(out, a, m) {\n    const x = a[0];\n    const y = a[1];\n    const z = a[2];\n    const w = a[3];\n    out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n    out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n    out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n    out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n    return out;\n  }\n  /**\n   * Transforms the {@link Vec4} with a {@link Quat}\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the vector to transform\n   * @param q - quaternion to transform with\n   * @returns `out`\n   */\n  static transformQuat(out, a, q) {\n    const x = a[0];\n    const y = a[1];\n    const z = a[2];\n    const qx = q[0];\n    const qy = q[1];\n    const qz = q[2];\n    const qw = q[3];\n    const ix = qw * x + qy * z - qz * y;\n    const iy = qw * y + qz * x - qx * z;\n    const iz = qw * z + qx * y - qy * x;\n    const iw = -qx * x - qy * y - qz * z;\n    out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n    out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n    out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n    out[3] = a[3];\n    return out;\n  }\n  /**\n   * Set the components of a {@link Vec4} to zero\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @returns `out`\n   */\n  static zero(out) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    return out;\n  }\n  /**\n   * Returns a string representation of a {@link Vec4}\n   * @category Static\n   *\n   * @param a - vector to represent as a string\n   * @returns string representation of the vector\n   */\n  static str(a) {\n    return `Vec4(${a.join(\", \")})`;\n  }\n  /**\n   * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n   * @category Static\n   *\n   * @param a - The first vector.\n   * @param b - The second vector.\n   * @returns True if the vectors are equal, false otherwise.\n   */\n  static exactEquals(a, b) {\n    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n  }\n  /**\n   * Returns whether the vectors have approximately the same elements in the same position.\n   * @category Static\n   *\n   * @param a - The first vector.\n   * @param b - The second vector.\n   * @returns True if the vectors are equal, false otherwise.\n   */\n  static equals(a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const b0 = b[0];\n    const b1 = b[1];\n    const b2 = b[2];\n    const b3 = b[3];\n    return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n  }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\nvar Quat = class _Quat extends Float32Array {\n  static #DEFAULT_ANGLE_ORDER = \"zyx\";\n  // Temporary variables to prevent repeated allocations in the algorithms within Quat.\n  // These are declared as TypedArrays to aid in tree-shaking.\n  static #TMP_QUAT1 = new Float32Array(4);\n  static #TMP_QUAT2 = new Float32Array(4);\n  static #TMP_MAT3 = new Float32Array(9);\n  static #TMP_VEC3 = new Float32Array(3);\n  static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\n  static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\n  /**\n   * Create a {@link Quat}.\n   *\n   * @category Constructor\n   */\n  constructor(...values) {\n    switch (values.length) {\n      case 4:\n        super(values);\n        break;\n      case 2:\n        super(values[0], values[1], 4);\n        break;\n      case 1: {\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([v, v, v, v]);\n        } else {\n          super(v, 0, 4);\n        }\n        break;\n      }\n      default:\n        super(4);\n        this[3] = 1;\n        break;\n    }\n  }\n  // ============\n  // Accessors\n  // ============\n  // Getters and setters to make component access read better.\n  // These are likely to be a little bit slower than direct array access.\n  /**\n   * The x component of the quaternion. Equivalent to `this[0];`\n   * @category Quaternion Components\n   */\n  get x() {\n    return this[0];\n  }\n  set x(value) {\n    this[0] = value;\n  }\n  /**\n   * The y component of the quaternion. Equivalent to `this[1];`\n   * @category Quaternion Components\n   */\n  get y() {\n    return this[1];\n  }\n  set y(value) {\n    this[1] = value;\n  }\n  /**\n   * The z component of the quaternion. Equivalent to `this[2];`\n   * @category Quaternion Components\n   */\n  get z() {\n    return this[2];\n  }\n  set z(value) {\n    this[2] = value;\n  }\n  /**\n   * The w component of the quaternion. Equivalent to `this[3];`\n   * @category Quaternion Components\n   */\n  get w() {\n    return this[3];\n  }\n  set w(value) {\n    this[3] = value;\n  }\n  /**\n   * The magnitude (length) of this.\n   * Equivalent to `Quat.magnitude(this);`\n   *\n   * Magnitude is used because the `length` attribute is already defined by\n   * TypedArrays to mean the number of elements in the array.\n   *\n   * @category Accessors\n   */\n  get magnitude() {\n    const x = this[0];\n    const y = this[1];\n    const z = this[2];\n    const w = this[3];\n    return Math.sqrt(x * x + y * y + z * z + w * w);\n  }\n  /**\n   * Alias for {@link Quat.magnitude}\n   *\n   * @category Accessors\n   */\n  get mag() {\n    return this.magnitude;\n  }\n  /**\n   * A string representation of `this`\n   * Equivalent to `Quat.str(this);`\n   *\n   * @category Accessors\n   */\n  get str() {\n    return _Quat.str(this);\n  }\n  // ===================\n  // Instances methods\n  // ===================\n  /**\n   * Copy the values from another {@link Quat} into `this`.\n   * @category Methods\n   *\n   * @param a the source quaternion\n   * @returns `this`\n   */\n  copy(a) {\n    super.set(a);\n    return this;\n  }\n  /**\n   * Set `this` to the identity quaternion\n   * Equivalent to Quat.identity(this)\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  identity() {\n    this[0] = 0;\n    this[1] = 0;\n    this[2] = 0;\n    this[3] = 1;\n    return this;\n  }\n  /**\n   * Multiplies `this` by a {@link Quat}.\n   * Equivalent to `Quat.multiply(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to multiply `this` by\n   * @returns `this`\n   */\n  multiply(b) {\n    return _Quat.multiply(this, this, b);\n  }\n  /**\n   * Alias for {@link Quat.multiply}\n   * @category Methods\n   */\n  mul(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Rotates `this` by the given angle about the X axis\n   * Equivalent to `Quat.rotateX(this, this, rad);`\n   * @category Methods\n   *\n   * @param rad - angle (in radians) to rotate\n   * @returns `this`\n   */\n  rotateX(rad) {\n    return _Quat.rotateX(this, this, rad);\n  }\n  /**\n   * Rotates `this` by the given angle about the Y axis\n   * Equivalent to `Quat.rotateY(this, this, rad);`\n   * @category Methods\n   *\n   * @param rad - angle (in radians) to rotate\n   * @returns `this`\n   */\n  rotateY(rad) {\n    return _Quat.rotateY(this, this, rad);\n  }\n  /**\n   * Rotates `this` by the given angle about the Z axis\n   * Equivalent to `Quat.rotateZ(this, this, rad);`\n   * @category Methods\n   *\n   * @param rad - angle (in radians) to rotate\n   * @returns `this`\n   */\n  rotateZ(rad) {\n    return _Quat.rotateZ(this, this, rad);\n  }\n  /**\n   * Inverts `this`\n   * Equivalent to `Quat.invert(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  invert() {\n    return _Quat.invert(this, this);\n  }\n  /**\n   * Scales `this` by a scalar number\n   * Equivalent to `Quat.scale(this, this, scale);`\n   * @category Methods\n   *\n   * @param scale - amount to scale the vector by\n   * @returns `this`\n   */\n  scale(scale) {\n    this[0] *= scale;\n    this[1] *= scale;\n    this[2] *= scale;\n    this[3] *= scale;\n    return this;\n  }\n  /**\n   * Calculates the dot product of `this` and another {@link Quat}\n   * Equivalent to `Quat.dot(this, b);`\n   * @category Methods\n   *\n   * @param b - the second operand\n   * @returns dot product of `this` and b\n   */\n  dot(b) {\n    return _Quat.dot(this, b);\n  }\n  // ===================\n  // Static accessors\n  // ===================\n  /**\n   * @category Static\n   *\n   * @returns The number of bytes in a {@link Quat}.\n   */\n  static get BYTE_LENGTH() {\n    return 4 * Float32Array.BYTES_PER_ELEMENT;\n  }\n  // ===================\n  // Static methods\n  // ===================\n  /**\n   * Creates a new identity quat\n   * @category Static\n   *\n   * @returns a new quaternion\n   */\n  static create() {\n    return new _Quat();\n  }\n  /**\n   * Set a quat to the identity quaternion\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @returns `out`\n   */\n  static identity(out) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 1;\n    return out;\n  }\n  /**\n   * Sets a quat from the given angle and rotation axis,\n   * then returns it.\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param axis - the axis around which to rotate\n   * @param rad - the angle in radians\n   * @returns `out`\n   **/\n  static setAxisAngle(out, axis, rad) {\n    rad *= 0.5;\n    const s = Math.sin(rad);\n    out[0] = s * axis[0];\n    out[1] = s * axis[1];\n    out[2] = s * axis[2];\n    out[3] = Math.cos(rad);\n    return out;\n  }\n  /**\n   * Gets the rotation axis and angle for a given\n   *  quaternion. If a quaternion is created with\n   *  setAxisAngle, this method will return the same\n   *  values as provided in the original parameter list\n   *  OR functionally equivalent values.\n   * Example: The quaternion formed by axis [0, 0, 1] and\n   *  angle -90 is the same as the quaternion formed by\n   *  [0, 0, 1] and 270. This method favors the latter.\n   * @category Static\n   *\n   * @param out_axis - Vector receiving the axis of rotation\n   * @param q - Quaternion to be decomposed\n   * @return Angle, in radians, of the rotation\n   */\n  static getAxisAngle(out_axis, q) {\n    const rad = Math.acos(q[3]) * 2;\n    const s = Math.sin(rad / 2);\n    if (s > GLM_EPSILON) {\n      out_axis[0] = q[0] / s;\n      out_axis[1] = q[1] / s;\n      out_axis[2] = q[2] / s;\n    } else {\n      out_axis[0] = 1;\n      out_axis[1] = 0;\n      out_axis[2] = 0;\n    }\n    return rad;\n  }\n  /**\n   * Gets the angular distance between two unit quaternions\n   * @category Static\n   *\n   * @param  {ReadonlyQuat} a     Origin unit quaternion\n   * @param  {ReadonlyQuat} b     Destination unit quaternion\n   * @return {Number}     Angle, in radians, between the two quaternions\n   */\n  static getAngle(a, b) {\n    const dotproduct = _Quat.dot(a, b);\n    return Math.acos(2 * dotproduct * dotproduct - 1);\n  }\n  /**\n   * Multiplies two quaternions.\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static multiply(out, a, b) {\n    const ax = a[0];\n    const ay = a[1];\n    const az = a[2];\n    const aw = a[3];\n    const bx = b[0];\n    const by = b[1];\n    const bz = b[2];\n    const bw = b[3];\n    out[0] = ax * bw + aw * bx + ay * bz - az * by;\n    out[1] = ay * bw + aw * by + az * bx - ax * bz;\n    out[2] = az * bw + aw * bz + ax * by - ay * bx;\n    out[3] = aw * bw - ax * bx - ay * by - az * bz;\n    return out;\n  }\n  /**\n   * Rotates a quaternion by the given angle about the X axis\n   * @category Static\n   *\n   * @param out - quat receiving operation result\n   * @param a - quat to rotate\n   * @param rad - angle (in radians) to rotate\n   * @returns `out`\n   */\n  static rotateX(out, a, rad) {\n    rad *= 0.5;\n    const ax = a[0];\n    const ay = a[1];\n    const az = a[2];\n    const aw = a[3];\n    const bx = Math.sin(rad);\n    const bw = Math.cos(rad);\n    out[0] = ax * bw + aw * bx;\n    out[1] = ay * bw + az * bx;\n    out[2] = az * bw - ay * bx;\n    out[3] = aw * bw - ax * bx;\n    return out;\n  }\n  /**\n   * Rotates a quaternion by the given angle about the Y axis\n   * @category Static\n   *\n   * @param out - quat receiving operation result\n   * @param a - quat to rotate\n   * @param rad - angle (in radians) to rotate\n   * @returns `out`\n   */\n  static rotateY(out, a, rad) {\n    rad *= 0.5;\n    const ax = a[0];\n    const ay = a[1];\n    const az = a[2];\n    const aw = a[3];\n    const by = Math.sin(rad);\n    const bw = Math.cos(rad);\n    out[0] = ax * bw - az * by;\n    out[1] = ay * bw + aw * by;\n    out[2] = az * bw + ax * by;\n    out[3] = aw * bw - ay * by;\n    return out;\n  }\n  /**\n   * Rotates a quaternion by the given angle about the Z axis\n   * @category Static\n   *\n   * @param out - quat receiving operation result\n   * @param a - quat to rotate\n   * @param rad - angle (in radians) to rotate\n   * @returns `out`\n   */\n  static rotateZ(out, a, rad) {\n    rad *= 0.5;\n    const ax = a[0];\n    const ay = a[1];\n    const az = a[2];\n    const aw = a[3];\n    const bz = Math.sin(rad);\n    const bw = Math.cos(rad);\n    out[0] = ax * bw + ay * bz;\n    out[1] = ay * bw - ax * bz;\n    out[2] = az * bw + aw * bz;\n    out[3] = aw * bw - az * bz;\n    return out;\n  }\n  /**\n   * Calculates the W component of a quat from the X, Y, and Z components.\n   * Assumes that quaternion is 1 unit in length.\n   * Any existing W component will be ignored.\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - quat to calculate W component of\n   * @returns `out`\n   */\n  static calculateW(out, a) {\n    const x = a[0], y = a[1], z = a[2];\n    out[0] = x;\n    out[1] = y;\n    out[2] = z;\n    out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n    return out;\n  }\n  /**\n   * Calculate the exponential of a unit quaternion.\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - quat to calculate the exponential of\n   * @returns `out`\n   */\n  static exp(out, a) {\n    const x = a[0], y = a[1], z = a[2], w = a[3];\n    const r = Math.sqrt(x * x + y * y + z * z);\n    const et = Math.exp(w);\n    const s = r > 0 ? et * Math.sin(r) / r : 0;\n    out[0] = x * s;\n    out[1] = y * s;\n    out[2] = z * s;\n    out[3] = et * Math.cos(r);\n    return out;\n  }\n  /**\n   * Calculate the natural logarithm of a unit quaternion.\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - quat to calculate the exponential of\n   * @returns `out`\n   */\n  static ln(out, a) {\n    const x = a[0], y = a[1], z = a[2], w = a[3];\n    const r = Math.sqrt(x * x + y * y + z * z);\n    const t = r > 0 ? Math.atan2(r, w) / r : 0;\n    out[0] = x * t;\n    out[1] = y * t;\n    out[2] = z * t;\n    out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n    return out;\n  }\n  /**\n   * Calculate the scalar power of a unit quaternion.\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - quat to calculate the exponential of\n   * @param b - amount to scale the quaternion by\n   * @returns `out`\n   */\n  static pow(out, a, b) {\n    _Quat.ln(out, a);\n    _Quat.scale(out, out, b);\n    _Quat.exp(out, out);\n    return out;\n  }\n  /**\n   * Performs a spherical linear interpolation between two quat\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param t - interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  static slerp(out, a, b, t) {\n    const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n    let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n    let scale0;\n    let scale1;\n    let cosom = ax * bx + ay * by + az * bz + aw * bw;\n    if (cosom < 0) {\n      cosom = -cosom;\n      bx = -bx;\n      by = -by;\n      bz = -bz;\n      bw = -bw;\n    }\n    if (1 - cosom > GLM_EPSILON) {\n      const omega = Math.acos(cosom);\n      const sinom = Math.sin(omega);\n      scale0 = Math.sin((1 - t) * omega) / sinom;\n      scale1 = Math.sin(t * omega) / sinom;\n    } else {\n      scale0 = 1 - t;\n      scale1 = t;\n    }\n    out[0] = scale0 * ax + scale1 * bx;\n    out[1] = scale0 * ay + scale1 * by;\n    out[2] = scale0 * az + scale1 * bz;\n    out[3] = scale0 * aw + scale1 * bw;\n    return out;\n  }\n  /**\n   * Generates a random unit quaternion\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @returns `out`\n   */\n  /* static random(out: QuatLike): QuatLike {\n      // Implementation of http://planning.cs.uiuc.edu/node198.html\n      // TODO: Calling random 3 times is probably not the fastest solution\n      let u1 = glMatrix.RANDOM();\n      let u2 = glMatrix.RANDOM();\n      let u3 = glMatrix.RANDOM();\n  \n      let sqrt1MinusU1 = Math.sqrt(1 - u1);\n      let sqrtU1 = Math.sqrt(u1);\n  \n      out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n      out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n      out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n      out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n      return out;\n    }*/\n  /**\n   * Calculates the inverse of a quat\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - quat to calculate inverse of\n   * @returns `out`\n   */\n  static invert(out, a) {\n    const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n    const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n    const invDot = dot ? 1 / dot : 0;\n    out[0] = -a0 * invDot;\n    out[1] = -a1 * invDot;\n    out[2] = -a2 * invDot;\n    out[3] = a3 * invDot;\n    return out;\n  }\n  /**\n   * Calculates the conjugate of a quat\n   * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - quat to calculate conjugate of\n   * @returns `out`\n   */\n  static conjugate(out, a) {\n    out[0] = -a[0];\n    out[1] = -a[1];\n    out[2] = -a[2];\n    out[3] = a[3];\n    return out;\n  }\n  /**\n   * Creates a quaternion from the given 3x3 rotation matrix.\n   *\n   * NOTE: The resultant quaternion is not normalized, so you should be sure\n   * to re-normalize the quaternion yourself where necessary.\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param m - rotation matrix\n   * @returns `out`\n   */\n  static fromMat3(out, m) {\n    const fTrace = m[0] + m[4] + m[8];\n    let fRoot;\n    if (fTrace > 0) {\n      fRoot = Math.sqrt(fTrace + 1);\n      out[3] = 0.5 * fRoot;\n      fRoot = 0.5 / fRoot;\n      out[0] = (m[5] - m[7]) * fRoot;\n      out[1] = (m[6] - m[2]) * fRoot;\n      out[2] = (m[1] - m[3]) * fRoot;\n    } else {\n      let i = 0;\n      if (m[4] > m[0]) {\n        i = 1;\n      }\n      if (m[8] > m[i * 3 + i]) {\n        i = 2;\n      }\n      const j = (i + 1) % 3;\n      const k = (i + 2) % 3;\n      fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n      out[i] = 0.5 * fRoot;\n      fRoot = 0.5 / fRoot;\n      out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n      out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n      out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n    }\n    return out;\n  }\n  /**\n   * Creates a quaternion from the given euler angle x, y, z.\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param x - Angle to rotate around X axis in degrees.\n   * @param y - Angle to rotate around Y axis in degrees.\n   * @param z - Angle to rotate around Z axis in degrees.\n   * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n   * @returns `out`\n   */\n  static fromEuler(out, x, y, z, order = _Quat.#DEFAULT_ANGLE_ORDER) {\n    const halfToRad = 0.5 * Math.PI / 180;\n    x *= halfToRad;\n    y *= halfToRad;\n    z *= halfToRad;\n    const sx = Math.sin(x);\n    const cx = Math.cos(x);\n    const sy = Math.sin(y);\n    const cy = Math.cos(y);\n    const sz = Math.sin(z);\n    const cz = Math.cos(z);\n    switch (order) {\n      case \"xyz\":\n        out[0] = sx * cy * cz + cx * sy * sz;\n        out[1] = cx * sy * cz - sx * cy * sz;\n        out[2] = cx * cy * sz + sx * sy * cz;\n        out[3] = cx * cy * cz - sx * sy * sz;\n        break;\n      case \"xzy\":\n        out[0] = sx * cy * cz - cx * sy * sz;\n        out[1] = cx * sy * cz - sx * cy * sz;\n        out[2] = cx * cy * sz + sx * sy * cz;\n        out[3] = cx * cy * cz + sx * sy * sz;\n        break;\n      case \"yxz\":\n        out[0] = sx * cy * cz + cx * sy * sz;\n        out[1] = cx * sy * cz - sx * cy * sz;\n        out[2] = cx * cy * sz - sx * sy * cz;\n        out[3] = cx * cy * cz + sx * sy * sz;\n        break;\n      case \"yzx\":\n        out[0] = sx * cy * cz + cx * sy * sz;\n        out[1] = cx * sy * cz + sx * cy * sz;\n        out[2] = cx * cy * sz - sx * sy * cz;\n        out[3] = cx * cy * cz - sx * sy * sz;\n        break;\n      case \"zxy\":\n        out[0] = sx * cy * cz - cx * sy * sz;\n        out[1] = cx * sy * cz + sx * cy * sz;\n        out[2] = cx * cy * sz + sx * sy * cz;\n        out[3] = cx * cy * cz - sx * sy * sz;\n        break;\n      case \"zyx\":\n        out[0] = sx * cy * cz - cx * sy * sz;\n        out[1] = cx * sy * cz + sx * cy * sz;\n        out[2] = cx * cy * sz - sx * sy * cz;\n        out[3] = cx * cy * cz + sx * sy * sz;\n        break;\n      default:\n        throw new Error(`Unknown angle order ${order}`);\n    }\n    return out;\n  }\n  /**\n   * Returns a string representation of a quatenion\n   * @category Static\n   *\n   * @param a - vector to represent as a string\n   * @returns string representation of the vector\n   */\n  static str(a) {\n    return `Quat(${a.join(\", \")})`;\n  }\n  /**\n   * Creates a new quat initialized with values from an existing quaternion\n   * @category Static\n   *\n   * @param a - quaternion to clone\n   * @returns a new quaternion\n   */\n  static clone(a) {\n    return new _Quat(a);\n  }\n  /**\n   * Creates a new quat initialized with the given values\n   * @category Static\n   *\n   * @param x - X component\n   * @param y - Y component\n   * @param z - Z component\n   * @param w - W component\n   * @returns a new quaternion\n   */\n  static fromValues(x, y, z, w) {\n    return new _Quat(x, y, z, w);\n  }\n  /**\n   * Copy the values from one quat to another\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - the source quaternion\n   * @returns `out`\n   */\n  static copy(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    return out;\n  }\n  /**\n   * Set the components of a {@link Quat} to the given values\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param x - X component\n   * @param y - Y component\n   * @param z - Z component\n   * @param w - W component\n   * @returns `out`\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static set(out, x, y, z, w) {\n    return out;\n  }\n  /**\n   * Adds two {@link Quat}'s\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static add(out, a, b) {\n    return out;\n  }\n  /**\n   * Alias for {@link Quat.multiply}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mul(out, a, b) {\n    return out;\n  }\n  /**\n   * Scales a quat by a scalar number\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - the vector to scale\n   * @param b - amount to scale the vector by\n   * @returns `out`\n   */\n  static scale(out, a, scale) {\n    out[0] = a[0] * scale;\n    out[1] = a[1] * scale;\n    out[2] = a[2] * scale;\n    out[3] = a[3] * scale;\n    return out;\n  }\n  /**\n   * Calculates the dot product of two quat's\n   * @category Static\n   *\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns dot product of a and b\n   */\n  static dot(a, b) {\n    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n  }\n  /**\n   * Performs a linear interpolation between two quat's\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param t - interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static lerp(out, a, b, t) {\n    return out;\n  }\n  /**\n   * Calculates the magnitude (length) of a {@link Quat}\n   * @category Static\n   *\n   * @param a - quaternion to calculate length of\n   * @returns length of `a`\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static magnitude(a) {\n    return 0;\n  }\n  /**\n   * Alias for {@link Quat.magnitude}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mag(a) {\n    return 0;\n  }\n  /**\n   * Alias for {@link Quat.magnitude}\n   * @category Static\n   * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n   */\n  // Length conflicts with Function.length\n  static length(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Alias for {@link Quat.magnitude}\n   * @category Static\n   * @deprecated Use {@link Quat.mag}\n   */\n  static len(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Calculates the squared length of a {@link Quat}\n   * @category Static\n   *\n   * @param a - quaternion to calculate squared length of\n   * @returns squared length of a\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static squaredLength(a) {\n    return 0;\n  }\n  /**\n   * Alias for {@link Quat.squaredLength}\n   * @category Static\n   */\n  static sqrLen(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Normalize a {@link Quat}\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - quaternion to normalize\n   * @returns `out`\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static normalize(out, a) {\n    return out;\n  }\n  /**\n   * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n   * @category Static\n   *\n   * @param a - The first quaternion.\n   * @param b - The second quaternion.\n   * @returns True if the vectors are equal, false otherwise.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static exactEquals(a, b) {\n    return false;\n  }\n  /**\n   * Returns whether the quaternions have approximately the same elements in the same position.\n   * @category Static\n   *\n   * @param a - The first vector.\n   * @param b - The second vector.\n   * @returns True if the vectors are equal, false otherwise.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static equals(a, b) {\n    return false;\n  }\n  /**\n   * Sets a quaternion to represent the shortest rotation from one\n   * vector to another.\n   *\n   * Both vectors are assumed to be unit length.\n   * @category Static\n   *\n   * @param out - the receiving quaternion.\n   * @param a - the initial vector\n   * @param b - the destination vector\n   * @returns `out`\n   */\n  static rotationTo(out, a, b) {\n    const dot = Vec3.dot(a, b);\n    if (dot < -0.999999) {\n      Vec3.cross(_Quat.#TMP_VEC3, _Quat.#X_UNIT_VEC3, a);\n      if (Vec3.mag(_Quat.#TMP_VEC3) < 1e-6) {\n        Vec3.cross(_Quat.#TMP_VEC3, _Quat.#Y_UNIT_VEC3, a);\n      }\n      Vec3.normalize(_Quat.#TMP_VEC3, _Quat.#TMP_VEC3);\n      _Quat.setAxisAngle(out, _Quat.#TMP_VEC3, Math.PI);\n      return out;\n    } else if (dot > 0.999999) {\n      out[0] = 0;\n      out[1] = 0;\n      out[2] = 0;\n      out[3] = 1;\n      return out;\n    } else {\n      Vec3.cross(_Quat.#TMP_VEC3, a, b);\n      out[0] = _Quat.#TMP_VEC3[0];\n      out[1] = _Quat.#TMP_VEC3[1];\n      out[2] = _Quat.#TMP_VEC3[2];\n      out[3] = 1 + dot;\n      return _Quat.normalize(out, out);\n    }\n  }\n  /**\n   * Performs a spherical linear interpolation with two control points\n   * @category Static\n   *\n   * @param out - the receiving quaternion\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param c - the third operand\n   * @param d - the fourth operand\n   * @param t - interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  static sqlerp(out, a, b, c, d, t) {\n    _Quat.slerp(_Quat.#TMP_QUAT1, a, d, t);\n    _Quat.slerp(_Quat.#TMP_QUAT2, b, c, t);\n    _Quat.slerp(out, _Quat.#TMP_QUAT1, _Quat.#TMP_QUAT2, 2 * t * (1 - t));\n    return out;\n  }\n  /**\n   * Sets the specified quaternion with values corresponding to the given\n   * axes. Each axis is a vec3 and is expected to be unit length and\n   * perpendicular to all other specified axes.\n   * @category Static\n   *\n   * @param out - The receiving quaternion\n   * @param view - the vector representing the viewing direction\n   * @param right - the vector representing the local `right` direction\n   * @param up - the vector representing the local `up` direction\n   * @returns `out`\n   */\n  static setAxes(out, view, right, up) {\n    _Quat.#TMP_MAT3[0] = right[0];\n    _Quat.#TMP_MAT3[3] = right[1];\n    _Quat.#TMP_MAT3[6] = right[2];\n    _Quat.#TMP_MAT3[1] = up[0];\n    _Quat.#TMP_MAT3[4] = up[1];\n    _Quat.#TMP_MAT3[7] = up[2];\n    _Quat.#TMP_MAT3[2] = -view[0];\n    _Quat.#TMP_MAT3[5] = -view[1];\n    _Quat.#TMP_MAT3[8] = -view[2];\n    return _Quat.normalize(out, _Quat.fromMat3(out, _Quat.#TMP_MAT3));\n  }\n};\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\nvar Quat2 = class _Quat2 extends Float32Array {\n  // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n  // These are declared as TypedArrays to aid in tree-shaking.\n  static #TMP_QUAT = new Float32Array(4);\n  static #TMP_VEC3 = new Float32Array(3);\n  /**\n   * Create a {@link Quat2}.\n   *\n   * @category Constructor\n   */\n  constructor(...values) {\n    switch (values.length) {\n      case 8:\n        super(values);\n        break;\n      case 2:\n        super(values[0], values[1], 8);\n        break;\n      case 1: {\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([v, v, v, v, v, v, v, v]);\n        } else {\n          super(v, 0, 8);\n        }\n        break;\n      }\n      default:\n        super(8);\n        this[3] = 1;\n        break;\n    }\n  }\n  // ============\n  // Accessors\n  // ============\n  /**\n   * A string representation of `this`\n   * Equivalent to `Quat2.str(this);`\n   *\n   * @category Accessors\n   */\n  get str() {\n    return _Quat2.str(this);\n  }\n  // ===================\n  // Instances methods\n  // ===================\n  /**\n   * Copy the values from another {@link Quat2} into `this`.\n   * @category Methods\n   *\n   * @param a the source dual quaternion\n   * @returns `this`\n   */\n  copy(a) {\n    super.set(a);\n    return this;\n  }\n  // ===================\n  // Static accessors\n  // ===================\n  /**\n   * @category Static\n   *\n   * @returns The number of bytes in a {@link Quat2}.\n   */\n  static get BYTE_LENGTH() {\n    return 8 * Float32Array.BYTES_PER_ELEMENT;\n  }\n  // ===================\n  // Static methods\n  // ===================\n  /**\n   * Creates a new identity {@link Quat2}\n   * @category Static\n   *\n   * @returns a new dual quaternion [real -> rotation, dual -> translation]\n   */\n  static create() {\n    return new _Quat2();\n  }\n  /**\n   * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n   * @category Static\n   *\n   * @param a - dual quaternion to clone\n   * @returns a new dual quaternion\n   */\n  static clone(a) {\n    return new _Quat2(a);\n  }\n  /**\n   * Creates a new {@link Quat2}  initialized with the given values\n   * @category Static\n   *\n   * @param x1 - 1st X component\n   * @param y1 - 1st Y component\n   * @param z1 - 1st Z component\n   * @param w1 - 1st W component\n   * @param x2 - 2nd X component\n   * @param y2 - 2nd Y component\n   * @param z2 - 2nd Z component\n   * @param w2 - 2nd W component\n   * @returns a new dual quaternion\n   */\n  static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n    return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n  }\n  /**\n   * Creates a new {@link Quat2} from the given values (quat and translation)\n   * @category Static\n   *\n   * @param x1 - X component (rotation)\n   * @param y1 - Y component (rotation)\n   * @param z1 - Z component (rotation)\n   * @param w1 - W component (rotation)\n   * @param x2 - X component (translation)\n   * @param y2 - Y component (translation)\n   * @param z2 - Z component (translation)\n   * @returns a new dual quaternion\n   */\n  static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n    const ax = x2 * 0.5;\n    const ay = y2 * 0.5;\n    const az = z2 * 0.5;\n    return new _Quat2(\n      x1,\n      y1,\n      z1,\n      w1,\n      ax * w1 + ay * z1 - az * y1,\n      ay * w1 + az * x1 - ax * z1,\n      az * w1 + ax * y1 - ay * x1,\n      -ax * x1 - ay * y1 - az * z1\n    );\n  }\n  /**\n   * Sets a {@link Quat2} from a quaternion and a translation\n   * @category Static\n   *\n   * @param out - dual quaternion receiving operation result\n   * @param q - a normalized quaternion\n   * @param t - translation vector\n   * @returns `out`\n   */\n  static fromRotationTranslation(out, q, t) {\n    const ax = t[0] * 0.5;\n    const ay = t[1] * 0.5;\n    const az = t[2] * 0.5;\n    const bx = q[0];\n    const by = q[1];\n    const bz = q[2];\n    const bw = q[3];\n    out[0] = bx;\n    out[1] = by;\n    out[2] = bz;\n    out[3] = bw;\n    out[4] = ax * bw + ay * bz - az * by;\n    out[5] = ay * bw + az * bx - ax * bz;\n    out[6] = az * bw + ax * by - ay * bx;\n    out[7] = -ax * bx - ay * by - az * bz;\n    return out;\n  }\n  /**\n   * Sets a {@link Quat2} from a translation\n   * @category Static\n   *\n   * @param out - dual quaternion receiving operation result\n   * @param t - translation vector\n   * @returns `out`\n   */\n  static fromTranslation(out, t) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 1;\n    out[4] = t[0] * 0.5;\n    out[5] = t[1] * 0.5;\n    out[6] = t[2] * 0.5;\n    out[7] = 0;\n    return out;\n  }\n  /**\n   * Sets a {@link Quat2} from a quaternion\n   * @category Static\n   *\n   * @param out - dual quaternion receiving operation result\n   * @param q - a normalized quaternion\n   * @returns `out`\n   */\n  static fromRotation(out, q) {\n    out[0] = q[0];\n    out[1] = q[1];\n    out[2] = q[2];\n    out[3] = q[3];\n    out[4] = 0;\n    out[5] = 0;\n    out[6] = 0;\n    out[7] = 0;\n    return out;\n  }\n  /**\n   * Sets a {@link Quat2} from a quaternion\n   * @category Static\n   *\n   * @param out - dual quaternion receiving operation result\n   * @param a - the matrix\n   * @returns `out`\n   */\n  static fromMat4(out, a) {\n    Mat4.getRotation(_Quat2.#TMP_QUAT, a);\n    Mat4.getTranslation(_Quat2.#TMP_VEC3, a);\n    return _Quat2.fromRotationTranslation(out, _Quat2.#TMP_QUAT, _Quat2.#TMP_VEC3);\n  }\n  /**\n   * Copy the values from one {@link Quat2} to another\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - the source dual quaternion\n   * @returns `out`\n   */\n  static copy(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    out[4] = a[4];\n    out[5] = a[5];\n    out[6] = a[6];\n    out[7] = a[7];\n    return out;\n  }\n  /**\n   * Set a {@link Quat2} to the identity dual quaternion\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @returns `out`\n   */\n  static identity(out) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 1;\n    out[4] = 0;\n    out[5] = 0;\n    out[6] = 0;\n    out[7] = 0;\n    return out;\n  }\n  /**\n   * Set the components of a {@link Quat2} to the given values\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param x1 - 1st X component\n   * @param y1 - 1st Y component\n   * @param z1 - 1st Z component\n   * @param w1 - 1st W component\n   * @param x2 - 2nd X component\n   * @param y2 - 2nd Y component\n   * @param z2 - 2nd Z component\n   * @param w2 - 2nd W component\n   * @returns `out`\n   */\n  static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n    out[0] = x1;\n    out[1] = y1;\n    out[2] = z1;\n    out[3] = w1;\n    out[4] = x2;\n    out[5] = y2;\n    out[6] = z2;\n    out[7] = w2;\n    return out;\n  }\n  /**\n   * Gets the real part of a dual quat\n   * @category Static\n   *\n   * @param out - real part\n   * @param a - Dual Quaternion\n   * @return `out`\n   */\n  static getReal(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    return out;\n  }\n  /**\n   * Gets the dual part of a dual quat\n   * @category Static\n   *\n   * @param out - dual part\n   * @param a - Dual Quaternion\n   * @return `out`\n   */\n  static getDual(out, a) {\n    out[0] = a[4];\n    out[1] = a[5];\n    out[2] = a[6];\n    out[3] = a[7];\n    return out;\n  }\n  /**\n   * Set the real component of a {@link Quat2} to the given quaternion\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - a quaternion representing the real part\n   * @return `out`\n   */\n  static setReal(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    return out;\n  }\n  /**\n   * Set the dual component of a {@link Quat2} to the given quaternion\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - a quaternion representing the dual part\n   * @return `out`\n   */\n  static setDual(out, a) {\n    out[4] = a[0];\n    out[5] = a[1];\n    out[6] = a[2];\n    out[7] = a[3];\n    return out;\n  }\n  /**\n   * Gets the translation of a normalized {@link Quat2}\n   * @category Static\n   *\n   * @param out - the receiving translation vector\n   * @param a - Dual Quaternion to be decomposed\n   * @return `out`\n   */\n  static getTranslation(out, a) {\n    const ax = a[4];\n    const ay = a[5];\n    const az = a[6];\n    const aw = a[7];\n    const bx = -a[0];\n    const by = -a[1];\n    const bz = -a[2];\n    const bw = a[3];\n    out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n    out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n    out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n    return out;\n  }\n  /**\n   * Translates a {@link Quat2} by the given vector\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - the dual quaternion to translate\n   * @param v - vector to translate by\n   * @returns `out`\n   */\n  static translate(out, a, v) {\n    const ax1 = a[0];\n    const ay1 = a[1];\n    const az1 = a[2];\n    const aw1 = a[3];\n    const bx1 = v[0] * 0.5;\n    const by1 = v[1] * 0.5;\n    const bz1 = v[2] * 0.5;\n    const ax2 = a[4];\n    const ay2 = a[5];\n    const az2 = a[6];\n    const aw2 = a[7];\n    out[0] = ax1;\n    out[1] = ay1;\n    out[2] = az1;\n    out[3] = aw1;\n    out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n    out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n    out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n    out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n    return out;\n  }\n  /**\n   * Rotates a {@link Quat2} around the X axis\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - the dual quaternion to rotate\n   * @param rad - angle (in radians) to rotate\n   * @returns `out`\n   */\n  static rotateX(out, a, rad) {\n    let bx = -a[0];\n    let by = -a[1];\n    let bz = -a[2];\n    let bw = a[3];\n    const ax = a[4];\n    const ay = a[5];\n    const az = a[6];\n    const aw = a[7];\n    const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n    const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n    const az1 = az * bw + aw * bz + ax * by - ay * bx;\n    const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n    Quat.rotateX(out, a, rad);\n    bx = out[0];\n    by = out[1];\n    bz = out[2];\n    bw = out[3];\n    out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n    out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n    out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n    out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n    return out;\n  }\n  /**\n   * Rotates a {@link Quat2} around the Y axis\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - the dual quaternion to rotate\n   * @param rad - angle (in radians) to rotate\n   * @returns `out`\n   */\n  static rotateY(out, a, rad) {\n    let bx = -a[0];\n    let by = -a[1];\n    let bz = -a[2];\n    let bw = a[3];\n    const ax = a[4];\n    const ay = a[5];\n    const az = a[6];\n    const aw = a[7];\n    const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n    const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n    const az1 = az * bw + aw * bz + ax * by - ay * bx;\n    const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n    Quat.rotateY(out, a, rad);\n    bx = out[0];\n    by = out[1];\n    bz = out[2];\n    bw = out[3];\n    out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n    out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n    out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n    out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n    return out;\n  }\n  /**\n   * Rotates a {@link Quat2} around the Z axis\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - the dual quaternion to rotate\n   * @param rad - angle (in radians) to rotate\n   * @returns `out`\n   */\n  static rotateZ(out, a, rad) {\n    let bx = -a[0];\n    let by = -a[1];\n    let bz = -a[2];\n    let bw = a[3];\n    const ax = a[4];\n    const ay = a[5];\n    const az = a[6];\n    const aw = a[7];\n    const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n    const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n    const az1 = az * bw + aw * bz + ax * by - ay * bx;\n    const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n    Quat.rotateZ(out, a, rad);\n    bx = out[0];\n    by = out[1];\n    bz = out[2];\n    bw = out[3];\n    out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n    out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n    out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n    out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n    return out;\n  }\n  /**\n   * Rotates a {@link Quat2} by a given quaternion (a * q)\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - the dual quaternion to rotate\n   * @param q - quaternion to rotate by\n   * @returns `out`\n   */\n  static rotateByQuatAppend(out, a, q) {\n    const qx = q[0];\n    const qy = q[1];\n    const qz = q[2];\n    const qw = q[3];\n    let ax = a[0];\n    let ay = a[1];\n    let az = a[2];\n    let aw = a[3];\n    out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n    out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n    out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n    out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n    ax = a[4];\n    ay = a[5];\n    az = a[6];\n    aw = a[7];\n    out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n    out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n    out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n    out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n    return out;\n  }\n  /**\n   * Rotates a {@link Quat2} by a given quaternion (q * a)\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param q - quaternion to rotate by\n   * @param a - the dual quaternion to rotate\n   * @returns `out`\n   */\n  static rotateByQuatPrepend(out, q, a) {\n    const qx = q[0];\n    const qy = q[1];\n    const qz = q[2];\n    const qw = q[3];\n    let bx = a[0];\n    let by = a[1];\n    let bz = a[2];\n    let bw = a[3];\n    out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n    out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n    out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n    out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n    bx = a[4];\n    by = a[5];\n    bz = a[6];\n    bw = a[7];\n    out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n    out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n    out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n    out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n    return out;\n  }\n  /**\n   * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - the dual quaternion to rotate\n   * @param axis - the axis to rotate around\n   * @param rad - how far the rotation should be\n   * @returns `out`\n   */\n  static rotateAroundAxis(out, a, axis, rad) {\n    if (Math.abs(rad) < GLM_EPSILON) {\n      return _Quat2.copy(out, a);\n    }\n    const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n    rad *= 0.5;\n    const s = Math.sin(rad);\n    const bx = s * axis[0] / axisLength;\n    const by = s * axis[1] / axisLength;\n    const bz = s * axis[2] / axisLength;\n    const bw = Math.cos(rad);\n    const ax1 = a[0];\n    const ay1 = a[1];\n    const az1 = a[2];\n    const aw1 = a[3];\n    out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n    out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n    out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n    out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n    const ax = a[4];\n    const ay = a[5];\n    const az = a[6];\n    const aw = a[7];\n    out[4] = ax * bw + aw * bx + ay * bz - az * by;\n    out[5] = ay * bw + aw * by + az * bx - ax * bz;\n    out[6] = az * bw + aw * bz + ax * by - ay * bx;\n    out[7] = aw * bw - ax * bx - ay * by - az * bz;\n    return out;\n  }\n  /**\n   * Adds two {@link Quat2}s\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns `out`\n   */\n  static add(out, a, b) {\n    out[0] = a[0] + b[0];\n    out[1] = a[1] + b[1];\n    out[2] = a[2] + b[2];\n    out[3] = a[3] + b[3];\n    out[4] = a[4] + b[4];\n    out[5] = a[5] + b[5];\n    out[6] = a[6] + b[6];\n    out[7] = a[7] + b[7];\n    return out;\n  }\n  /**\n   * Multiplies two {@link Quat2}s\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns {quat2} out\n   */\n  static multiply(out, a, b) {\n    const ax0 = a[0];\n    const ay0 = a[1];\n    const az0 = a[2];\n    const aw0 = a[3];\n    const bx1 = b[4];\n    const by1 = b[5];\n    const bz1 = b[6];\n    const bw1 = b[7];\n    const ax1 = a[4];\n    const ay1 = a[5];\n    const az1 = a[6];\n    const aw1 = a[7];\n    const bx0 = b[0];\n    const by0 = b[1];\n    const bz0 = b[2];\n    const bw0 = b[3];\n    out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n    out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n    out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n    out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n    out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n    out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n    out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n    out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n    return out;\n  }\n  /**\n   * Alias for {@link Quat2.multiply}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mul(out, a, b) {\n    return out;\n  }\n  /**\n   * Scales a {@link Quat2} by a scalar value\n   * @category Static\n   *\n   * @param out - the receiving dual quaterion\n   * @param a - the dual quaternion to scale\n   * @param b - scalar value to scale the dual quaterion by\n   * @returns `out`\n   */\n  static scale(out, a, b) {\n    out[0] = a[0] * b;\n    out[1] = a[1] * b;\n    out[2] = a[2] * b;\n    out[3] = a[3] * b;\n    out[4] = a[4] * b;\n    out[5] = a[5] * b;\n    out[6] = a[6] * b;\n    out[7] = a[7] * b;\n    return out;\n  }\n  /**\n   * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n   * @category Static\n   *\n   * @param a - the first operand\n   * @param b - the second operand\n   * @returns dot product of a and b\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static dot(a, b) {\n    return 0;\n  }\n  /**\n   * Performs a linear interpolation between two {@link Quat2}s\n   * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n   * @category Static\n   *\n   * @param out - the receiving dual quat\n   * @param a - the first operand\n   * @param b - the second operand\n   * @param t - interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  static lerp(out, a, b, t) {\n    const mt = 1 - t;\n    if (_Quat2.dot(a, b) < 0) {\n      t = -t;\n    }\n    out[0] = a[0] * mt + b[0] * t;\n    out[1] = a[1] * mt + b[1] * t;\n    out[2] = a[2] * mt + b[2] * t;\n    out[3] = a[3] * mt + b[3] * t;\n    out[4] = a[4] * mt + b[4] * t;\n    out[5] = a[5] * mt + b[5] * t;\n    out[6] = a[6] * mt + b[6] * t;\n    out[7] = a[7] * mt + b[7] * t;\n    return out;\n  }\n  /**\n   * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - dual quat to calculate inverse of\n   * @returns `out`\n   */\n  static invert(out, a) {\n    const sqlen = _Quat2.squaredLength(a);\n    out[0] = -a[0] / sqlen;\n    out[1] = -a[1] / sqlen;\n    out[2] = -a[2] / sqlen;\n    out[3] = a[3] / sqlen;\n    out[4] = -a[4] / sqlen;\n    out[5] = -a[5] / sqlen;\n    out[6] = -a[6] / sqlen;\n    out[7] = a[7] / sqlen;\n    return out;\n  }\n  /**\n   * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n   * {@link Quat2.invert} and produces the same result.\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - dual quaternion to calculate conjugate of\n   * @returns `out`\n   */\n  static conjugate(out, a) {\n    out[0] = -a[0];\n    out[1] = -a[1];\n    out[2] = -a[2];\n    out[3] = a[3];\n    out[4] = -a[4];\n    out[5] = -a[5];\n    out[6] = -a[6];\n    out[7] = a[7];\n    return out;\n  }\n  /**\n   * Calculates the magnitude (length) of a {@link Quat2}\n   * @category Static\n   *\n   * @param a - dual quaternion to calculate length of\n   * @returns length of `a`\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static magnitude(a) {\n    return 0;\n  }\n  /**\n   * Alias for {@link Quat2.magnitude}\n   * @category Static\n   */\n  static mag(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Alias for {@link Quat2.magnitude}\n   * @category Static\n   * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n   */\n  // Length conflicts with Function.length\n  static length(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Alias for {@link Quat2.magnitude}\n   * @category Static\n   * @deprecated Use {@link Quat2.mag}\n   */\n  static len(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Calculates the squared length of a {@link Quat2}\n   * @category Static\n   *\n   * @param a - dual quaternion to calculate squared length of\n   * @returns squared length of a\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static squaredLength(a) {\n    return 0;\n  }\n  /**\n   * Alias for {@link Quat2.squaredLength}\n   * @category Static\n   */\n  static sqrLen(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Normalize a {@link Quat2}\n   * @category Static\n   *\n   * @param out - the receiving dual quaternion\n   * @param a - dual quaternion to normalize\n   * @returns `out`\n   */\n  static normalize(out, a) {\n    let magnitude = _Quat2.squaredLength(a);\n    if (magnitude > 0) {\n      magnitude = Math.sqrt(magnitude);\n      const a0 = a[0] / magnitude;\n      const a1 = a[1] / magnitude;\n      const a2 = a[2] / magnitude;\n      const a3 = a[3] / magnitude;\n      const b0 = a[4];\n      const b1 = a[5];\n      const b2 = a[6];\n      const b3 = a[7];\n      const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n      out[0] = a0;\n      out[1] = a1;\n      out[2] = a2;\n      out[3] = a3;\n      out[4] = (b0 - a0 * a_dot_b) / magnitude;\n      out[5] = (b1 - a1 * a_dot_b) / magnitude;\n      out[6] = (b2 - a2 * a_dot_b) / magnitude;\n      out[7] = (b3 - a3 * a_dot_b) / magnitude;\n    }\n    return out;\n  }\n  /**\n   * Returns a string representation of a {@link Quat2}\n   * @category Static\n   *\n   * @param a - dual quaternion to represent as a string\n   * @returns string representation of the vector\n   */\n  static str(a) {\n    return `Quat2(${a.join(\", \")})`;\n  }\n  /**\n   * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n   * @category Static\n   *\n   * @param a - The first dual quaternion.\n   * @param b - The second dual quaternion.\n   * @returns True if the dual quaternions are equal, false otherwise.\n   */\n  static exactEquals(a, b) {\n    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n  }\n  /**\n   * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n   * @category Static\n   *\n   * @param a - The first dual quaternion.\n   * @param b - The second dual quaternion.\n   * @returns True if the dual quaternions are equal, false otherwise.\n   */\n  static equals(a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const a2 = a[2];\n    const a3 = a[3];\n    const a4 = a[4];\n    const a5 = a[5];\n    const a6 = a[6];\n    const a7 = a[7];\n    const b0 = b[0];\n    const b1 = b[1];\n    const b2 = b[2];\n    const b3 = b[3];\n    const b4 = b[4];\n    const b5 = b[5];\n    const b6 = b[6];\n    const b7 = b[7];\n    return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n  }\n};\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\nvar Vec2 = class _Vec2 extends Float32Array {\n  /**\n   * Create a {@link Vec2}.\n   *\n   * @category Constructor\n   */\n  constructor(...values) {\n    switch (values.length) {\n      case 2: {\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([v, values[1]]);\n        } else {\n          super(v, values[1], 2);\n        }\n        break;\n      }\n      case 1: {\n        const v = values[0];\n        if (typeof v === \"number\") {\n          super([v, v]);\n        } else {\n          super(v, 0, 2);\n        }\n        break;\n      }\n      default:\n        super(2);\n        break;\n    }\n  }\n  // ============\n  // Accessors\n  // ============\n  // Getters and setters to make component access read better.\n  // These are likely to be a little bit slower than direct array access.\n  /**\n   * The x component of the vector. Equivalent to `this[0];`\n   * @category Vector Components\n   */\n  get x() {\n    return this[0];\n  }\n  set x(value) {\n    this[0] = value;\n  }\n  /**\n   * The y component of the vector. Equivalent to `this[1];`\n   * @category Vector Components\n   */\n  get y() {\n    return this[1];\n  }\n  set y(value) {\n    this[1] = value;\n  }\n  // Alternate set of getters and setters in case this is being used to define\n  // a color.\n  /**\n   * The r component of the vector. Equivalent to `this[0];`\n   * @category Color Components\n   */\n  get r() {\n    return this[0];\n  }\n  set r(value) {\n    this[0] = value;\n  }\n  /**\n   * The g component of the vector. Equivalent to `this[1];`\n   * @category Color Components\n   */\n  get g() {\n    return this[1];\n  }\n  set g(value) {\n    this[1] = value;\n  }\n  /**\n   * The magnitude (length) of this.\n   * Equivalent to `Vec2.magnitude(this);`\n   *\n   * Magnitude is used because the `length` attribute is already defined by\n   * TypedArrays to mean the number of elements in the array.\n   *\n   * @category Accessors\n   */\n  get magnitude() {\n    return Math.hypot(this[0], this[1]);\n  }\n  /**\n   * Alias for {@link Vec2.magnitude}\n   *\n   * @category Accessors\n   */\n  get mag() {\n    return this.magnitude;\n  }\n  /**\n   * The squared magnitude (length) of `this`.\n   * Equivalent to `Vec2.squaredMagnitude(this);`\n   *\n   * @category Accessors\n   */\n  get squaredMagnitude() {\n    const x = this[0];\n    const y = this[1];\n    return x * x + y * y;\n  }\n  /**\n   * Alias for {@link Vec2.squaredMagnitude}\n   *\n   * @category Accessors\n   */\n  get sqrMag() {\n    return this.squaredMagnitude;\n  }\n  /**\n   * A string representation of `this`\n   * Equivalent to `Vec2.str(this);`\n   *\n   * @category Accessors\n   */\n  get str() {\n    return _Vec2.str(this);\n  }\n  // ===================\n  // Instances methods\n  // ===================\n  /**\n   * Copy the values from another {@link Vec2} into `this`.\n   * @category Methods\n   *\n   * @param a the source vector\n   * @returns `this`\n   */\n  copy(a) {\n    this.set(a);\n    return this;\n  }\n  // Instead of zero(), use a.fill(0) for instances;\n  /**\n   * Adds a {@link Vec2} to `this`.\n   * Equivalent to `Vec2.add(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to add to `this`\n   * @returns `this`\n   */\n  add(b) {\n    this[0] += b[0];\n    this[1] += b[1];\n    return this;\n  }\n  /**\n   * Subtracts a {@link Vec2} from `this`.\n   * Equivalent to `Vec2.subtract(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to subtract from `this`\n   * @returns `this`\n   */\n  subtract(b) {\n    this[0] -= b[0];\n    this[1] -= b[1];\n    return this;\n  }\n  /**\n   * Alias for {@link Vec2.subtract}\n   * @category Methods\n   */\n  sub(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Multiplies `this` by a {@link Vec2}.\n   * Equivalent to `Vec2.multiply(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to multiply `this` by\n   * @returns `this`\n   */\n  multiply(b) {\n    this[0] *= b[0];\n    this[1] *= b[1];\n    return this;\n  }\n  /**\n   * Alias for {@link Vec2.multiply}\n   * @category Methods\n   */\n  mul(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Divides `this` by a {@link Vec2}.\n   * Equivalent to `Vec2.divide(this, this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to divide `this` by\n   * @returns `this`\n   */\n  divide(b) {\n    this[0] /= b[0];\n    this[1] /= b[1];\n    return this;\n  }\n  /**\n   * Alias for {@link Vec2.divide}\n   * @category Methods\n   */\n  div(b) {\n    return this;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Scales `this` by a scalar number.\n   * Equivalent to `Vec2.scale(this, this, b);`\n   * @category Methods\n   *\n   * @param b - Amount to scale `this` by\n   * @returns `this`\n   */\n  scale(b) {\n    this[0] *= b;\n    this[1] *= b;\n    return this;\n  }\n  /**\n   * Calculates `this` scaled by a scalar value then adds the result to `this`.\n   * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n   * @category Methods\n   *\n   * @param b - The vector to add to `this`\n   * @param scale - The amount to scale `b` by before adding\n   * @returns `this`\n   */\n  scaleAndAdd(b, scale) {\n    this[0] += b[0] * scale;\n    this[1] += b[1] * scale;\n    return this;\n  }\n  /**\n   * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n   * Equivalent to `Vec2.distance(this, b);`\n   * @category Methods\n   *\n   * @param b - The vector to calculate the distance to\n   * @returns Distance between `this` and `b`\n   */\n  distance(b) {\n    return _Vec2.distance(this, b);\n  }\n  /**\n   * Alias for {@link Vec2.distance}\n   * @category Methods\n   */\n  dist(b) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n   * Equivalent to `Vec2.squaredDistance(this, b);`\n   * @category Methods\n   *\n   * @param b The vector to calculate the squared distance to\n   * @returns Squared distance between `this` and `b`\n   */\n  squaredDistance(b) {\n    return _Vec2.squaredDistance(this, b);\n  }\n  /**\n   * Alias for {@link Vec2.squaredDistance}\n   * @category Methods\n   */\n  sqrDist(b) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Negates the components of `this`.\n   * Equivalent to `Vec2.negate(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  negate() {\n    this[0] *= -1;\n    this[1] *= -1;\n    return this;\n  }\n  /**\n   * Inverts the components of `this`.\n   * Equivalent to `Vec2.inverse(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  invert() {\n    this[0] = 1 / this[0];\n    this[1] = 1 / this[1];\n    return this;\n  }\n  /**\n   * Sets each component of `this` to it's absolute value.\n   * Equivalent to `Vec2.abs(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  abs() {\n    this[0] = Math.abs(this[0]);\n    this[1] = Math.abs(this[1]);\n    return this;\n  }\n  /**\n   * Calculates the dot product of this and another {@link Vec2}.\n   * Equivalent to `Vec2.dot(this, b);`\n   * @category Methods\n   *\n   * @param b - The second operand\n   * @returns Dot product of `this` and `b`\n   */\n  dot(b) {\n    return this[0] * b[0] + this[1] * b[1];\n  }\n  /**\n   * Normalize `this`.\n   * Equivalent to `Vec2.normalize(this, this);`\n   * @category Methods\n   *\n   * @returns `this`\n   */\n  normalize() {\n    return _Vec2.normalize(this, this);\n  }\n  // ===================\n  // Static accessors\n  // ===================\n  /**\n   * @category Static\n   *\n   * @returns The number of bytes in a {@link Vec2}.\n   */\n  static get BYTE_LENGTH() {\n    return 2 * Float32Array.BYTES_PER_ELEMENT;\n  }\n  // ===================\n  // Static methods\n  // ===================\n  /**\n   * Creates a new, empty {@link Vec2}\n   * @category Static\n   *\n   * @returns A new 2D vector\n   */\n  static create() {\n    return new _Vec2();\n  }\n  /**\n   * Creates a new {@link Vec2} initialized with values from an existing vector\n   * @category Static\n   *\n   * @param a - Vector to clone\n   * @returns A new 2D vector\n   */\n  static clone(a) {\n    return new _Vec2(a);\n  }\n  /**\n   * Creates a new {@link Vec2} initialized with the given values\n   * @category Static\n   *\n   * @param x - X component\n   * @param y - Y component\n   * @returns A new 2D vector\n   */\n  static fromValues(x, y) {\n    return new _Vec2(x, y);\n  }\n  /**\n   * Copy the values from one {@link Vec2} to another\n   * @category Static\n   *\n   * @param out - the receiving vector\n   * @param a - The source vector\n   * @returns `out`\n   */\n  static copy(out, a) {\n    out[0] = a[0];\n    out[1] = a[1];\n    return out;\n  }\n  /**\n   * Set the components of a {@link Vec2} to the given values\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param x - X component\n   * @param y - Y component\n   * @returns `out`\n   */\n  static set(out, x, y) {\n    out[0] = x;\n    out[1] = y;\n    return out;\n  }\n  /**\n   * Adds two {@link Vec2}s\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static add(out, a, b) {\n    out[0] = a[0] + b[0];\n    out[1] = a[1] + b[1];\n    return out;\n  }\n  /**\n   * Subtracts vector b from vector a\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static subtract(out, a, b) {\n    out[0] = a[0] - b[0];\n    out[1] = a[1] - b[1];\n    return out;\n  }\n  /**\n   * Alias for {@link Vec2.subtract}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sub(out, a, b) {\n    return [0, 0];\n  }\n  /**\n   * Multiplies two {@link Vec2}s\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static multiply(out, a, b) {\n    out[0] = a[0] * b[0];\n    out[1] = a[1] * b[1];\n    return out;\n  }\n  /**\n   * Alias for {@link Vec2.multiply}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static mul(out, a, b) {\n    return [0, 0];\n  }\n  /**\n   * Divides two {@link Vec2}s\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static divide(out, a, b) {\n    out[0] = a[0] / b[0];\n    out[1] = a[1] / b[1];\n    return out;\n  }\n  /**\n   * Alias for {@link Vec2.divide}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static div(out, a, b) {\n    return [0, 0];\n  }\n  /**\n   * Math.ceil the components of a {@link Vec2}\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - Vector to ceil\n   * @returns `out`\n   */\n  static ceil(out, a) {\n    out[0] = Math.ceil(a[0]);\n    out[1] = Math.ceil(a[1]);\n    return out;\n  }\n  /**\n   * Math.floor the components of a {@link Vec2}\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - Vector to floor\n   * @returns `out`\n   */\n  static floor(out, a) {\n    out[0] = Math.floor(a[0]);\n    out[1] = Math.floor(a[1]);\n    return out;\n  }\n  /**\n   * Returns the minimum of two {@link Vec2}s\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static min(out, a, b) {\n    out[0] = Math.min(a[0], b[0]);\n    out[1] = Math.min(a[1], b[1]);\n    return out;\n  }\n  /**\n   * Returns the maximum of two {@link Vec2}s\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static max(out, a, b) {\n    out[0] = Math.max(a[0], b[0]);\n    out[1] = Math.max(a[1], b[1]);\n    return out;\n  }\n  /**\n   * Math.round the components of a {@link Vec2}\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - Vector to round\n   * @returns `out`\n   */\n  static round(out, a) {\n    out[0] = Math.round(a[0]);\n    out[1] = Math.round(a[1]);\n    return out;\n  }\n  /**\n   * Scales a {@link Vec2} by a scalar number\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The vector to scale\n   * @param b - Amount to scale the vector by\n   * @returns `out`\n   */\n  static scale(out, a, b) {\n    out[0] = a[0] * b;\n    out[1] = a[1] * b;\n    return out;\n  }\n  /**\n   * Adds two Vec2's after scaling the second operand by a scalar value\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @param scale - The amount to scale b by before adding\n   * @returns `out`\n   */\n  static scaleAndAdd(out, a, b, scale) {\n    out[0] = a[0] + b[0] * scale;\n    out[1] = a[1] + b[1] * scale;\n    return out;\n  }\n  /**\n   * Calculates the Euclidean distance between two {@link Vec2}s\n   * @category Static\n   *\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns distance between `a` and `b`\n   */\n  static distance(a, b) {\n    return Math.hypot(b[0] - a[0], b[1] - a[1]);\n  }\n  /**\n   * Alias for {@link Vec2.distance}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static dist(a, b) {\n    return 0;\n  }\n  /**\n   * Calculates the squared Euclidean distance between two {@link Vec2}s\n   * @category Static\n   *\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns Squared distance between `a` and `b`\n   */\n  static squaredDistance(a, b) {\n    const x = b[0] - a[0];\n    const y = b[1] - a[1];\n    return x * x + y * y;\n  }\n  /**\n   * Alias for {@link Vec2.distance}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sqrDist(a, b) {\n    return 0;\n  }\n  /**\n   * Calculates the magnitude (length) of a {@link Vec2}\n   * @category Static\n   *\n   * @param a - Vector to calculate magnitude of\n   * @returns Magnitude of a\n   */\n  static magnitude(a) {\n    const x = a[0];\n    const y = a[1];\n    return Math.sqrt(x * x + y * y);\n  }\n  /**\n   * Alias for {@link Vec2.magnitude}\n   * @category Static\n   */\n  static mag(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Alias for {@link Vec2.magnitude}\n   * @category Static\n   * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n   *\n   * @param a - vector to calculate length of\n   * @returns length of a\n   */\n  // Length conflicts with Function.length\n  static length(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Alias for {@link Vec2.magnitude}\n   * @category Static\n   * @deprecated Use {@link Vec2.mag}\n   */\n  static len(a) {\n    return 0;\n  }\n  // eslint-disable-line @typescript-eslint/no-unused-vars\n  /**\n   * Calculates the squared length of a {@link Vec2}\n   * @category Static\n   *\n   * @param a - Vector to calculate squared length of\n   * @returns Squared length of a\n   */\n  static squaredLength(a) {\n    const x = a[0];\n    const y = a[1];\n    return x * x + y * y;\n  }\n  /**\n   * Alias for {@link Vec2.squaredLength}\n   * @category Static\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  static sqrLen(a, b) {\n    return 0;\n  }\n  /**\n   * Negates the components of a {@link Vec2}\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - Vector to negate\n   * @returns `out`\n   */\n  static negate(out, a) {\n    out[0] = -a[0];\n    out[1] = -a[1];\n    return out;\n  }\n  /**\n   * Returns the inverse of the components of a {@link Vec2}\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - Vector to invert\n   * @returns `out`\n   */\n  static inverse(out, a) {\n    out[0] = 1 / a[0];\n    out[1] = 1 / a[1];\n    return out;\n  }\n  /**\n   * Returns the absolute value of the components of a {@link Vec2}\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - Vector to compute the absolute values of\n   * @returns `out`\n   */\n  static abs(out, a) {\n    out[0] = Math.abs(a[0]);\n    out[1] = Math.abs(a[1]);\n    return out;\n  }\n  /**\n   * Normalize a {@link Vec2}\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - Vector to normalize\n   * @returns `out`\n   */\n  static normalize(out, a) {\n    const x = a[0];\n    const y = a[1];\n    let len = x * x + y * y;\n    if (len > 0) {\n      len = 1 / Math.sqrt(len);\n    }\n    out[0] = a[0] * len;\n    out[1] = a[1] * len;\n    return out;\n  }\n  /**\n   * Calculates the dot product of two {@link Vec2}s\n   * @category Static\n   *\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns Dot product of `a` and `b`\n   */\n  static dot(a, b) {\n    return a[0] * b[0] + a[1] * b[1];\n  }\n  /**\n   * Computes the cross product of two {@link Vec2}s\n   * Note that the cross product must by definition produce a 3D vector.\n   * For this reason there is also not instance equivalent for this function.\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns `out`\n   */\n  static cross(out, a, b) {\n    const z = a[0] * b[1] - a[1] * b[0];\n    out[0] = out[1] = 0;\n    out[2] = z;\n    return out;\n  }\n  /**\n   * Performs a linear interpolation between two {@link Vec2}s\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @param a - The first operand\n   * @param b - The second operand\n   * @param t - Interpolation amount, in the range [0-1], between the two inputs\n   * @returns `out`\n   */\n  static lerp(out, a, b, t) {\n    const ax = a[0];\n    const ay = a[1];\n    out[0] = ax + t * (b[0] - ax);\n    out[1] = ay + t * (b[1] - ay);\n    return out;\n  }\n  /**\n   * Transforms the {@link Vec2} with a {@link Mat2}\n   *\n   * @param out - The receiving vector\n   * @param a - The vector to transform\n   * @param m - Matrix to transform with\n   * @returns `out`\n   * @category Static\n   */\n  static transformMat2(out, a, m) {\n    const x = a[0];\n    const y = a[1];\n    out[0] = m[0] * x + m[2] * y;\n    out[1] = m[1] * x + m[3] * y;\n    return out;\n  }\n  /**\n   * Transforms the {@link Vec2} with a {@link Mat2d}\n   *\n   * @param out - The receiving vector\n   * @param a - The vector to transform\n   * @param m - Matrix to transform with\n   * @returns `out`\n   * @category Static\n   */\n  static transformMat2d(out, a, m) {\n    const x = a[0];\n    const y = a[1];\n    out[0] = m[0] * x + m[2] * y + m[4];\n    out[1] = m[1] * x + m[3] * y + m[5];\n    return out;\n  }\n  /**\n   * Transforms the {@link Vec2} with a {@link Mat3}\n   * 3rd vector component is implicitly '1'\n   *\n   * @param out - The receiving vector\n   * @param a - The vector to transform\n   * @param m - Matrix to transform with\n   * @returns `out`\n   * @category Static\n   */\n  static transformMat3(out, a, m) {\n    const x = a[0];\n    const y = a[1];\n    out[0] = m[0] * x + m[3] * y + m[6];\n    out[1] = m[1] * x + m[4] * y + m[7];\n    return out;\n  }\n  /**\n   * Transforms the {@link Vec2} with a {@link Mat4}\n   * 3rd vector component is implicitly '0'\n   * 4th vector component is implicitly '1'\n   *\n   * @param out - The receiving vector\n   * @param a - The vector to transform\n   * @param m - Matrix to transform with\n   * @returns `out`\n   * @category Static\n   */\n  static transformMat4(out, a, m) {\n    const x = a[0];\n    const y = a[1];\n    out[0] = m[0] * x + m[4] * y + m[12];\n    out[1] = m[1] * x + m[5] * y + m[13];\n    return out;\n  }\n  /**\n   * Rotate a 2D vector\n   * @category Static\n   *\n   * @param out - The receiving {@link Vec2}\n   * @param a - The {@link Vec2} point to rotate\n   * @param b - The origin of the rotation\n   * @param rad - The angle of rotation in radians\n   * @returns `out`\n   */\n  static rotate(out, a, b, rad) {\n    const p0 = a[0] - b[0];\n    const p1 = a[1] - b[1];\n    const sinC = Math.sin(rad);\n    const cosC = Math.cos(rad);\n    out[0] = p0 * cosC - p1 * sinC + b[0];\n    out[1] = p0 * sinC + p1 * cosC + b[1];\n    return out;\n  }\n  /**\n   * Get the angle between two 2D vectors\n   * @category Static\n   *\n   * @param a - The first operand\n   * @param b - The second operand\n   * @returns The angle in radians\n   */\n  static angle(a, b) {\n    const x1 = a[0];\n    const y1 = a[1];\n    const x2 = b[0];\n    const y2 = b[1];\n    const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n    const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n    return Math.acos(Math.min(Math.max(cosine, -1), 1));\n  }\n  /**\n   * Set the components of a {@link Vec2} to zero\n   * @category Static\n   *\n   * @param out - The receiving vector\n   * @returns `out`\n   */\n  static zero(out) {\n    out[0] = 0;\n    out[1] = 0;\n    return out;\n  }\n  /**\n   * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n   * @category Static\n   *\n   * @param a - The first vector.\n   * @param b - The second vector.\n   * @returns `true` if the vectors components are ===, `false` otherwise.\n   */\n  static exactEquals(a, b) {\n    return a[0] === b[0] && a[1] === b[1];\n  }\n  /**\n   * Returns whether the vectors have approximately the same elements in the same position.\n   * @category Static\n   *\n   * @param a - The first vector.\n   * @param b - The second vector.\n   * @returns `true` if the vectors are approximately equal, `false` otherwise.\n   */\n  static equals(a, b) {\n    const a0 = a[0];\n    const a1 = a[1];\n    const b0 = b[0];\n    const b1 = b[1];\n    return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n  }\n  /**\n   * Returns a string representation of a vector\n   * @category Static\n   *\n   * @param a - Vector to represent as a string\n   * @returns String representation of the vector\n   */\n  static str(a) {\n    return `Vec2(${a.join(\", \")})`;\n  }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\nexport { Mat2, Mat2d, Mat3, Mat4, Quat, Quat2, Vec2, Vec3, Vec4 };\n//# sourceMappingURL=index.js.map\n","import { isObject, isIterable } from '@typhonjs-fvtt/runtime/util/object';\n\n/**\n * Provides resources for parsing style strings.\n */\nclass StyleParse\n{\n   static #regexPixels = /(\\d+)\\s*px/;\n\n   /**\n    * Parses a pixel string / computed styles. Ex. `100px` returns `100`.\n    *\n    * @param {string}   value - Value to parse.\n    *\n    * @returns {number|undefined} The integer component of a pixel string.\n    */\n   static pixels(value)\n   {\n      if (typeof value !== 'string') { return void 0; }\n\n      const isPixels = this.#regexPixels.test(value);\n      const number = parseInt(value);\n\n      return isPixels && Number.isFinite(number) ? number : void 0;\n   }\n\n   /**\n    * Returns the pixel value for `1rem` based on the root document element. You may apply an optional multiplier.\n    *\n    * @param {number} [multiplier=1] - Optional multiplier to apply to `rem` pixel value; default: 1.\n    *\n    * @param {object} [options] - Optional parameters.\n    *\n    * @param {Document} [options.targetDocument=document] The target DOM {@link Document} if different from the main\n    *        browser global `document`.\n    *\n    * @returns {number} The pixel value for `1rem` with or without a multiplier based on the root document element.\n    */\n   static remPixels(multiplier = 1, { targetDocument = document } = {})\n   {\n      return targetDocument?.documentElement ?\n       multiplier * parseFloat(globalThis.getComputedStyle(targetDocument.documentElement).fontSize) : void 0;\n   }\n}\n\n/**\n * Provides a managed dynamic style sheet / element useful in configuring global CSS variables. When creating an\n * instance of TJSStyleManager you must provide a \"document key\" / string for the style element added. The style element\n * can be accessed via `document[docKey]`.\n *\n * Instances of TJSStyleManager can also be versioned by supplying a positive integer greater than or equal to `1` via\n * the 'version' option. This version number is assigned to the associated style element. When a TJSStyleManager\n * instance is created and there is an existing instance with a version that is lower than the current instance all CSS\n * rules are removed letting the higher version to take precedence. This isn't a perfect system and requires thoughtful\n * construction of CSS variables exposed, but allows multiple independently compiled TRL packages to load the latest\n * CSS variables. It is recommended to always set `overwrite` option of {@link TJSStyleManager.setProperty} and\n * {@link TJSStyleManager.setProperties} to `false` when loading initial values.\n */\nclass TJSStyleManager\n{\n   /** @type {CSSStyleRule} */\n   #cssRule;\n\n   /** @type {string} */\n   #docKey;\n\n   /** @type {string} */\n   #selector;\n\n   /** @type {HTMLStyleElement} */\n   #styleElement;\n\n   /** @type {number} */\n   #version;\n\n   /**\n    *\n    * @param {object}   opts - Options.\n    *\n    * @param {string}   opts.docKey - Required key providing a link to a specific style sheet element.\n    *\n    * @param {string}   [opts.selector=:root] - Selector element.\n    *\n    * @param {Document} [opts.document] - Target document to load styles into.\n    *\n    * @param {number}   [opts.version] - An integer representing the version / level of styles being managed.\n    */\n   constructor({ docKey, selector = ':root', document = globalThis.document, version } = {})\n   {\n      if (typeof docKey !== 'string') { throw new TypeError(`StyleManager error: 'docKey' is not a string.`); }\n\n      if (Object.prototype.toString.call(document) !== '[object HTMLDocument]')\n      {\n         throw new TypeError(`TJSStyleManager error: 'document' is not an instance of HTMLDocument.`);\n      }\n\n      if (typeof selector !== 'string') { throw new TypeError(`StyleManager error: 'selector' is not a string.`); }\n\n      if (version !== void 0 && !Number.isSafeInteger(version) && version < 1)\n      {\n         throw new TypeError(`StyleManager error: 'version' is defined and is not a positive integer >= 1.`);\n      }\n\n      this.#selector = selector;\n      this.#docKey = docKey;\n      this.#version = version;\n\n      if (document[this.#docKey] === void 0)\n      {\n         this.#styleElement = document.createElement('style');\n\n         document.head.append(this.#styleElement);\n\n         // Set initial style manager version if any supplied.\n         this.#styleElement._STYLE_MANAGER_VERSION = version;\n\n         this.#styleElement.sheet.insertRule(`${selector} {}`, 0);\n\n         this.#cssRule = this.#styleElement.sheet.cssRules[0];\n\n         document[docKey] = this.#styleElement;\n      }\n      else\n      {\n         this.#styleElement = document[docKey];\n         this.#cssRule = this.#styleElement.sheet.cssRules[0];\n\n         if (version)\n         {\n            const existingVersion = this.#styleElement._STYLE_MANAGER_VERSION ?? 0;\n\n            // Remove all existing CSS rules / text if version is greater than existing version.\n            if (version > existingVersion)\n            {\n               this.#cssRule.style.cssText = '';\n            }\n         }\n      }\n   }\n\n   /**\n    * @returns {string} Provides an accessor to get the `cssText` for the style sheet.\n    */\n   get cssText()\n   {\n      return this.#cssRule.style.cssText;\n   }\n\n   /**\n    * @returns {number} Returns the version of this instance.\n    */\n   get version()\n   {\n      return this.#version;\n   }\n\n   /**\n    * Provides a copy constructor to duplicate an existing TJSStyleManager instance into a new document.\n    *\n    * Note: This is used to support the `PopOut` module.\n    *\n    * @param {Document} [document] Target browser document to clone into.\n    *\n    * @returns {TJSStyleManager} New style manager instance.\n    */\n   clone(document = globalThis.document)\n   {\n      const newStyleManager = new TJSStyleManager({\n         selector: this.#selector,\n         docKey: this.#docKey,\n         document,\n         version: this.#version\n      });\n\n      newStyleManager.#cssRule.style.cssText = this.#cssRule.style.cssText;\n\n      return newStyleManager;\n   }\n\n   get()\n   {\n      const cssText = this.#cssRule.style.cssText;\n\n      const result = {};\n\n      if (cssText !== '')\n      {\n         for (const entry of cssText.split(';'))\n         {\n            if (entry !== '')\n            {\n               const values = entry.split(':');\n               result[values[0].trim()] = values[1];\n            }\n         }\n      }\n\n      return result;\n   }\n\n   /**\n    * Gets a particular CSS variable.\n    *\n    * @param {string}   key - CSS variable property key.\n    *\n    * @returns {string} Returns CSS variable value.\n    */\n   getProperty(key)\n   {\n      if (typeof key !== 'string') { throw new TypeError(`StyleManager error: 'key' is not a string.`); }\n\n      return this.#cssRule.style.getPropertyValue(key);\n   }\n\n   /**\n    * Set rules by property / value; useful for CSS variables.\n    *\n    * @param {{ [key: string]: string }}  rules - An object with property / value string pairs to load.\n    *\n    * @param {boolean}                 [overwrite=true] - When true overwrites any existing values.\n    */\n   setProperties(rules, overwrite = true)\n   {\n      if (!isObject(rules)) { throw new TypeError(`StyleManager error: 'rules' is not an object.`); }\n\n      if (typeof overwrite !== 'boolean') { throw new TypeError(`StyleManager error: 'overwrite' is not a boolean.`); }\n\n      if (overwrite)\n      {\n         for (const [key, value] of Object.entries(rules))\n         {\n            this.#cssRule.style.setProperty(key, value);\n         }\n      }\n      else\n      {\n         // Only set property keys for entries that don't have an existing rule set.\n         for (const [key, value] of Object.entries(rules))\n         {\n            if (this.#cssRule.style.getPropertyValue(key) === '')\n            {\n               this.#cssRule.style.setProperty(key, value);\n            }\n         }\n      }\n   }\n\n   /**\n    * Sets a particular property.\n    *\n    * @param {string}   key - CSS variable property key.\n    *\n    * @param {string}   value - CSS variable value.\n    *\n    * @param {boolean}  [overwrite=true] - Overwrite any existing value.\n    */\n   setProperty(key, value, overwrite = true)\n   {\n      if (typeof key !== 'string') { throw new TypeError(`StyleManager error: 'key' is not a string.`); }\n\n      if (typeof value !== 'string') { throw new TypeError(`StyleManager error: 'value' is not a string.`); }\n\n      if (typeof overwrite !== 'boolean') { throw new TypeError(`StyleManager error: 'overwrite' is not a boolean.`); }\n\n      if (overwrite)\n      {\n         this.#cssRule.style.setProperty(key, value);\n      }\n      else\n      {\n         if (this.#cssRule.style.getPropertyValue(key) === '')\n         {\n            this.#cssRule.style.setProperty(key, value);\n         }\n      }\n   }\n\n   /**\n    * Removes the property keys specified. If `keys` is an iterable list then all property keys in the list are removed.\n    *\n    * @param {Iterable<string>} keys - The property keys to remove.\n    */\n   removeProperties(keys)\n   {\n      if (!isIterable(keys)) { throw new TypeError(`StyleManager error: 'keys' is not an iterable list.`); }\n\n      for (const key of keys)\n      {\n         if (typeof key === 'string') { this.#cssRule.style.removeProperty(key); }\n      }\n   }\n\n   /**\n    * Removes a particular CSS variable.\n    *\n    * @param {string}   key - CSS variable property key.\n    *\n    * @returns {string} CSS variable value when removed.\n    */\n   removeProperty(key)\n   {\n      if (typeof key !== 'string') { throw new TypeError(`StyleManager error: 'key' is not a string.`); }\n\n      return this.#cssRule.style.removeProperty(key);\n   }\n}\n\nexport { StyleParse, TJSStyleManager };\n//# sourceMappingURL=index.js.map\n","/**\n * Awaits `requestAnimationFrame` calls by the counter specified. This allows asynchronous applications for direct /\n * inline style modification amongst other direct animation techniques.\n *\n * @param {number}   [cntr=1] - A positive integer greater than 0 for amount of requestAnimationFrames to wait.\n *\n * @returns {Promise<number>} Returns time of last `requestAnimationFrame` callback.\n */\nasync function nextAnimationFrame(cntr = 1)\n{\n   if (!Number.isInteger(cntr) || cntr < 1)\n   {\n      throw new TypeError(`nextAnimationFrame error: 'cntr' must be a positive integer greater than 0.`);\n   }\n\n   let currentTime;\n\n   // Await count of `rAF` callbacks.\n   for (;--cntr >= 0;) { currentTime = await new Promise((resolve) => requestAnimationFrame(resolve)); }\n\n   return currentTime;\n}\n\nexport { nextAnimationFrame };\n//# sourceMappingURL=index.js.map\n","import { hasSetter, isIterable, isObject, isPlainObject } from '@typhonjs-fvtt/runtime/util/object';\nimport { getEasingFunc } from '@typhonjs-fvtt/runtime/svelte/easing';\nimport { A11yHelper } from '@typhonjs-fvtt/runtime/util/a11y';\nimport { radToDeg, degToRad, clamp } from '@typhonjs-fvtt/runtime/math/util';\nimport { subscribeIgnoreFirst } from '@typhonjs-fvtt/runtime/svelte/store/util';\nimport { propertyStore } from '@typhonjs-fvtt/runtime/svelte/store/writable-derived';\nimport { lerp } from '@typhonjs-fvtt/runtime/math/interpolate';\nimport { CrossWindow } from '@typhonjs-fvtt/runtime/util/browser';\nimport { Mat4, Vec3 } from '@typhonjs-fvtt/runtime/math/gl-matrix';\nimport { writable } from 'svelte/store';\nimport { StyleParse } from '@typhonjs-fvtt/runtime/util/dom/style';\nimport { nextAnimationFrame } from '@typhonjs-fvtt/runtime/util/animate';\n\n/**\n * Provides an action to apply a TJSPosition instance to a HTMLElement and invoke `position.parent`\n *\n * @param node - The node associated with the action.\n *\n * @param position - A position or positionable instance.\n *\n * @returns The action lifecycle methods.\n */\nfunction applyPosition(node, position) {\n    /**\n     * Find actual position instance checking for a Positionable instance.\n     */\n    let actualPosition = (position?.position ?? position);\n    if (hasSetter(actualPosition, 'parent')) {\n        actualPosition.parent = node;\n    }\n    return {\n        update: (newPosition) => {\n            const newActualPosition = (newPosition?.position ?? position);\n            // Sanity case to short circuit update if positions are the same instance.\n            if (newActualPosition === actualPosition && newActualPosition.parent === actualPosition.parent) {\n                return;\n            }\n            if (hasSetter(actualPosition, 'parent')) {\n                actualPosition.parent = void 0;\n            }\n            actualPosition = newActualPosition;\n            if (hasSetter(actualPosition, 'parent')) {\n                actualPosition.parent = node;\n            }\n        },\n        destroy: () => { if (hasSetter(actualPosition, 'parent')) {\n            actualPosition.parent = void 0;\n        } }\n    };\n}\n\n/**\n * Provides an action to enable pointer dragging of an HTMLElement and invoke `position.set` on a given\n * {@link TJSPosition} instance provided. When the attached boolean store state changes the draggable action is enabled\n * or disabled.\n *\n * @param node - The node associated with the action.\n *\n * @param options - Draggable action options.\n *\n * @returns Action lifecycle functions.\n */\nfunction draggable(node, { position, enabled = true, button = 0, storeDragging = void 0, tween = false, tweenOptions = { duration: 1, ease: 'cubicOut' }, hasTargetClassList, ignoreTargetClassList }) {\n    if (hasTargetClassList !== void 0 && !isIterable(hasTargetClassList)) {\n        throw new TypeError(`'hasTargetClassList' is not iterable.`);\n    }\n    if (ignoreTargetClassList !== void 0 && !isIterable(ignoreTargetClassList)) {\n        throw new TypeError(`'ignoreTargetClassList' is not iterable.`);\n    }\n    /**\n     * Used for direct call to `position.set`.\n     */\n    const positionData = { left: 0, top: 0 };\n    /**\n     * Find actual position instance checking for a Positionable instance.\n     */\n    let actualPosition = (position?.position ?? position);\n    /**\n     * Duplicate the app / Positionable starting position to track differences.\n     */\n    let initialPosition = null;\n    /**\n     * Stores the initial X / Y on drag down.\n     */\n    let initialDragPoint = { x: 0, y: 0 };\n    /**\n     * Stores the current dragging state and gates the move pointer as the dragging store is not set until the first\n     * pointer move.\n     */\n    let dragging = false;\n    /**\n     * Stores the quickTo callback to use for optimized tweening when easing is enabled.\n     */\n    let quickTo = actualPosition.animate.quickTo(['top', 'left'], tweenOptions);\n    /**\n     * Event handlers associated with this action, so they may be later unregistered.\n     */\n    const handlers = {\n        dragDown: ['pointerdown', onDragPointerDown, false],\n        dragMove: ['pointermove', onDragPointerChange, false],\n        dragUp: ['pointerup', onDragPointerUp, false]\n    };\n    /**\n     * Activates listeners.\n     */\n    function activateListeners() {\n        // Drag handlers\n        node.addEventListener(...handlers.dragDown);\n        node.classList.add('draggable');\n    }\n    /**\n     * Removes listeners.\n     */\n    function removeListeners() {\n        if (typeof storeDragging?.set === 'function') {\n            storeDragging.set(false);\n        }\n        // Drag handlers\n        node.removeEventListener(...handlers.dragDown);\n        node.removeEventListener(...handlers.dragMove);\n        node.removeEventListener(...handlers.dragUp);\n        node.classList.remove('draggable');\n    }\n    if (enabled) {\n        activateListeners();\n    }\n    /**\n     * Handle the initial pointer down that activates dragging behavior for the positionable.\n     *\n     * @param event - The pointer down event.\n     */\n    function onDragPointerDown(event) {\n        if (event.button !== button || !event.isPrimary) {\n            return;\n        }\n        // Do not process if the position system is not enabled.\n        if (!actualPosition.enabled) {\n            return;\n        }\n        // Potentially ignore this event if `ignoreTargetClassList` is defined and the `event.target` has a matching\n        // class.\n        if (ignoreTargetClassList !== void 0 && A11yHelper.isFocusTarget(event.target)) {\n            for (const targetClass of ignoreTargetClassList) {\n                if (event.target.classList.contains(targetClass)) {\n                    return;\n                }\n            }\n        }\n        // Potentially ignore this event if `hasTargetClassList` is defined and the `event.target` does not have any\n        // matching class from the list.\n        if (hasTargetClassList !== void 0 && A11yHelper.isFocusTarget(event.target)) {\n            let foundTarget = false;\n            for (const targetClass of hasTargetClassList) {\n                if (event.target.classList.contains(targetClass)) {\n                    foundTarget = true;\n                    break;\n                }\n            }\n            if (!foundTarget) {\n                return;\n            }\n        }\n        event.preventDefault();\n        dragging = false;\n        // Record initial position.\n        initialPosition = actualPosition.get();\n        initialDragPoint = { x: event.clientX, y: event.clientY };\n        // Add move and pointer up handlers.\n        node.addEventListener(...handlers.dragMove);\n        node.addEventListener(...handlers.dragUp);\n        node.setPointerCapture(event.pointerId);\n    }\n    /**\n     * Move the positionable.\n     *\n     * @param event - The pointer move event.\n     */\n    function onDragPointerChange(event) {\n        // See chorded button presses for pointer events:\n        // https://www.w3.org/TR/pointerevents3/#chorded-button-interactions\n        // TODO: Support different button configurations for PointerEvents.\n        if ((event.buttons & 1) === 0) {\n            onDragPointerUp(event);\n            return;\n        }\n        if (event.button !== -1 || !event.isPrimary) {\n            return;\n        }\n        event.preventDefault();\n        // Only set store dragging on first move event.\n        if (!dragging && typeof storeDragging?.set === 'function') {\n            dragging = true;\n            storeDragging.set(true);\n        }\n        const newLeft = initialPosition?.left + (event.clientX - initialDragPoint.x);\n        const newTop = initialPosition?.top + (event.clientY - initialDragPoint.y);\n        if (tween) {\n            quickTo(newTop, newLeft);\n        }\n        else {\n            positionData.left = newLeft;\n            positionData.top = newTop;\n            actualPosition.set(positionData);\n        }\n    }\n    /**\n     * Finish dragging and set the final position and removing listeners.\n     *\n     * @param event - The pointer up event.\n     */\n    function onDragPointerUp(event) {\n        event.preventDefault();\n        dragging = false;\n        if (typeof storeDragging?.set === 'function') {\n            storeDragging.set(false);\n        }\n        node.removeEventListener(...handlers.dragMove);\n        node.removeEventListener(...handlers.dragUp);\n    }\n    return {\n        // The default of enabled being true won't automatically add listeners twice.\n        update: (options) => {\n            if (options.position !== void 0) {\n                // Find actual position instance checking for a Positionable instance.\n                const newPosition = (options.position?.position ?? options.position);\n                if (newPosition !== actualPosition) {\n                    actualPosition = newPosition;\n                    quickTo = actualPosition.animate.quickTo(['top', 'left'], tweenOptions);\n                }\n            }\n            if (typeof options.enabled === 'boolean') {\n                enabled = options.enabled;\n                if (enabled) {\n                    activateListeners();\n                }\n                else {\n                    removeListeners();\n                }\n            }\n            if (typeof options.button === 'number') {\n                button = options.button;\n            }\n            if (typeof options.tween === 'boolean') {\n                tween = options.tween;\n            }\n            if (isObject(options.tweenOptions)) {\n                tweenOptions = options.tweenOptions;\n                quickTo.options(tweenOptions);\n            }\n            if (options.hasTargetClassList !== void 0) {\n                if (!isIterable(options.hasTargetClassList)) {\n                    throw new TypeError(`'hasTargetClassList' is not iterable.`);\n                }\n                else {\n                    hasTargetClassList = options.hasTargetClassList;\n                }\n            }\n            if (options.ignoreTargetClassList !== void 0) {\n                if (!isIterable(options.ignoreTargetClassList)) {\n                    throw new TypeError(`'ignoreTargetClassList' is not iterable.`);\n                }\n                else {\n                    ignoreTargetClassList = options.ignoreTargetClassList;\n                }\n            }\n        },\n        destroy: () => removeListeners()\n    };\n}\n/**\n * Provides an instance of the {@link draggable} action options support / Readable store to make updating / setting\n * draggable options much easier. When subscribing to the options instance returned by {@link draggable.options} the\n * Subscriber handler receives the entire instance.\n */\nclass DraggableOptionsStore {\n    tween;\n    tweenOptions;\n    #initialTween;\n    /**\n     */\n    #initialTweenOptions;\n    #tween = false;\n    /**\n     */\n    #tweenOptions = { duration: 1, ease: 'cubicOut' };\n    /**\n     * Stores the subscribers.\n     */\n    #subscribers = [];\n    /**\n     * @param [opts] - Optional parameters.\n     *\n     * @param [opts.tween = false] - Tween enabled.\n     *\n     * @param [opts.tweenOptions] - Quick tween options.\n     */\n    constructor({ tween = false, tweenOptions } = {}) {\n        // Define the following getters directly on this instance and make them enumerable. This allows them to be\n        // picked up w/ `Object.assign`.\n        Object.defineProperty(this, 'tween', {\n            get: () => { return this.#tween; },\n            set: (newTween) => {\n                if (typeof newTween !== 'boolean') {\n                    throw new TypeError(`'tween' is not a boolean.`);\n                }\n                this.#tween = newTween;\n                this.#updateSubscribers();\n            },\n            enumerable: true\n        });\n        Object.defineProperty(this, 'tweenOptions', {\n            get: () => { return this.#tweenOptions; },\n            set: (newTweenOptions) => {\n                if (!isObject(newTweenOptions)) {\n                    throw new TypeError(`'tweenOptions' is not an object.`);\n                }\n                if (newTweenOptions.duration !== void 0) {\n                    if (!Number.isFinite(newTweenOptions.duration)) {\n                        throw new TypeError(`'tweenOptions.duration' is not a finite number.`);\n                    }\n                    if (newTweenOptions.duration < 0) {\n                        this.#tweenOptions.duration = 0;\n                    }\n                    else {\n                        this.#tweenOptions.duration = newTweenOptions.duration;\n                    }\n                }\n                if (newTweenOptions.ease !== void 0) {\n                    const easeFn = getEasingFunc(newTweenOptions.ease);\n                    if (typeof easeFn !== 'function') {\n                        throw new TypeError(`'tweenOptions.ease' is not a function or Svelte easing function name.`);\n                    }\n                    this.#tweenOptions.ease = newTweenOptions.ease;\n                }\n                this.#updateSubscribers();\n            },\n            enumerable: true\n        });\n        // Set default options.\n        if (tween !== void 0) {\n            this.tween = tween;\n        }\n        if (tweenOptions !== void 0) {\n            this.tweenOptions = tweenOptions;\n        }\n        this.#initialTween = this.#tween;\n        this.#initialTweenOptions = Object.assign({}, this.#tweenOptions);\n    }\n    /**\n     * @returns Get tween duration.\n     */\n    get tweenDuration() { return this.#tweenOptions.duration; }\n    /**\n     * @returns Get easing function or easing function name.\n     */\n    get tweenEase() { return this.#tweenOptions.ease; }\n    /**\n     * @param duration - Set tween duration.\n     */\n    set tweenDuration(duration) {\n        if (!Number.isFinite(duration)) {\n            throw new TypeError(`'duration' is not a finite number.`);\n        }\n        if (duration < 0) {\n            duration = 0;\n        }\n        this.#tweenOptions.duration = duration;\n        this.#updateSubscribers();\n    }\n    /**\n     * @param ease - Set easing function by name or direct function.\n     */\n    set tweenEase(ease) {\n        const easeFn = getEasingFunc(ease);\n        if (typeof easeFn !== 'function') {\n            throw new TypeError(`'ease' is not a function or Svelte easing function name.`);\n        }\n        this.#tweenOptions.ease = ease;\n        this.#updateSubscribers();\n    }\n    /**\n     * Resets all options data to initial values.\n     */\n    reset() {\n        this.#tween = this.#initialTween;\n        this.#tweenOptions = Object.assign({}, this.#initialTweenOptions);\n        this.#updateSubscribers();\n    }\n    /**\n     * Resets tween enabled state to initial value.\n     */\n    resetTween() {\n        this.#tween = this.#initialTween;\n        this.#updateSubscribers();\n    }\n    /**\n     * Resets tween options to initial values.\n     */\n    resetTweenOptions() {\n        this.#tweenOptions = Object.assign({}, this.#initialTweenOptions);\n        this.#updateSubscribers();\n    }\n    /**\n     * Store subscribe method.\n     *\n     * @param handler - Callback function that is invoked on update / changes. Receives the DraggableOptionsStore\n     *        instance.\n     *\n     * @returns Unsubscribe function.\n     */\n    subscribe(handler) {\n        const currentIdx = this.#subscribers.findIndex((entry) => entry === handler);\n        if (currentIdx === -1) {\n            this.#subscribers.push(handler); // add handler to the array of subscribers\n            handler(this); // call handler with current value\n        }\n        // Return unsubscribe function.\n        return () => {\n            const existingIdx = this.#subscribers.findIndex((entry) => entry === handler);\n            if (existingIdx !== -1) {\n                this.#subscribers.splice(existingIdx, 1);\n            }\n        };\n    }\n    #updateSubscribers() {\n        const subscriptions = this.#subscribers;\n        // Early out if there are no subscribers.\n        if (subscriptions.length > 0) {\n            for (let cntr = 0; cntr < subscriptions.length; cntr++) {\n                subscriptions[cntr](this);\n            }\n        }\n    }\n}\n/**\n * Define a function to get a DraggableOptionsStore instance.\n *\n * @param options - Initial options for DraggableOptionsStore.\n *\n * @returns A new options instance.\n */\ndraggable.options = (options) => new DraggableOptionsStore(options);\n\n/**\n * Provides a basic animation implementation for TJSPosition animation.\n */\nclass AnimationControl {\n    /**\n     */\n    #animationData;\n    /**\n     */\n    #finishedPromise;\n    /**\n     */\n    #willFinish;\n    /**\n     * Defines a static empty / void animation control.\n     */\n    static #voidControl = new AnimationControl(null);\n    /**\n     * Provides a static void / undefined AnimationControl that is automatically resolved.\n     */\n    static get voidControl() { return this.#voidControl; }\n    /**\n     * @param [animationData] - Animation data.\n     *\n     * @param [willFinish] - Promise that tracks animation finished state.\n     */\n    constructor(animationData, willFinish = false) {\n        this.#animationData = animationData;\n        this.#willFinish = willFinish;\n        // Set this control to animation data.\n        if (isObject(animationData)) {\n            animationData.control = this;\n        }\n    }\n    /**\n     * Get a promise that resolves when animation is finished.\n     *\n     * @returns Animation finished Promise.\n     */\n    get finished() {\n        if (!CrossWindow.isPromise(this.#finishedPromise)) {\n            this.#finishedPromise = this.#willFinish ? new Promise((resolve) => this.#animationData.resolve = resolve) :\n                Promise.resolve({ cancelled: false });\n        }\n        return this.#finishedPromise;\n    }\n    /**\n     * Returns whether this animation is currently active / animating.\n     *\n     * Note: a delayed animation may not be started / active yet. Use {@link AnimationControl.isFinished} to determine\n     * if an animation is actually finished.\n     *\n     * @returns Animation active state.\n     */\n    get isActive() { return this.#animationData?.active ?? false; }\n    /**\n     * Returns whether this animation is completely finished.\n     *\n     * @returns Animation finished state.\n     */\n    get isFinished() { return this.#animationData?.finished ?? true; }\n    /**\n     * Cancels the animation.\n     */\n    cancel() {\n        const animationData = this.#animationData;\n        if (animationData === null || animationData === void 0) {\n            return;\n        }\n        // Set cancelled state to true and this animation data instance will be removed from AnimationManager on next\n        // update.\n        animationData.cancelled = true;\n    }\n}\n\n/**\n * Provides animation management and scheduling allowing all TJSPosition instances to utilize one micro-task.\n */\nclass AnimationManager {\n    /**\n     * Cancels all animations except `quickTo` animations.\n     */\n    static cancelFn = (data) => data?.quickTo !== true;\n    /**\n     * Cancels all animations.\n     */\n    static cancelAllFn = () => true;\n    /**\n     * Defines the options used for {@link TJSPosition.set}.\n     */\n    static #tjsPositionSetOptions = Object.freeze({ immediateElementUpdate: true });\n    /**\n     */\n    static #activeList = [];\n    /**\n     * Provides the `this` context for {@link AnimationManager.animate} to be scheduled on rAF.\n     */\n    static #animateBound = (timeFrame) => this.animate(timeFrame);\n    /**\n     */\n    static #pendingList = [];\n    /**\n     * Tracks whether a requestAnimationFrame callback is pending via {@link AnimationManager.add};\n     */\n    static #rafPending = false;\n    /**\n     * Time of last `rAF` callback.\n     */\n    static #timeFrame;\n    /**\n     * Time of `performance.now()` at last `rAF` callback.\n     */\n    static #timeNow;\n    /**\n     * @returns Time of last `rAF` callback.\n     */\n    static get timeFrame() {\n        return this.#timeFrame;\n    }\n    /**\n     * @returns Time of `performance.now()` at last `rAF` callback.\n     */\n    static get timeNow() {\n        return this.#timeNow;\n    }\n    /**\n     * Add animation data.\n     *\n     * @param data -\n     */\n    static add(data) {\n        if (data.cancelled) {\n            this.#cleanupData(data);\n            return;\n        }\n        AnimationManager.#pendingList.push(data);\n        // If there is no rAF pending schedule one now.\n        if (!AnimationManager.#rafPending) {\n            AnimationManager.#rafPending = true;\n            globalThis.requestAnimationFrame(this.#animateBound);\n        }\n    }\n    /**\n     * Manage all animation.\n     *\n     * @param timeFrame - rAF callback time.\n     */\n    static animate(timeFrame) {\n        AnimationManager.#rafPending = false;\n        AnimationManager.#timeNow = globalThis.performance.now();\n        AnimationManager.#timeFrame = timeFrame;\n        // Early out of the continual rAF callback when there are no current animations scheduled.\n        if (AnimationManager.#activeList.length === 0 && AnimationManager.#pendingList.length === 0) {\n            return;\n        }\n        if (AnimationManager.#pendingList.length) {\n            // Process new data\n            for (let cntr = AnimationManager.#pendingList.length; --cntr >= 0;) {\n                const data = AnimationManager.#pendingList[cntr];\n                // If animation instance has been cancelled before start then remove it from new list and cleanup.\n                if (data.cancelled || (data.el !== void 0 && !data.el.isConnected)) {\n                    AnimationManager.#pendingList.splice(cntr, 1);\n                    this.#cleanupData(data);\n                }\n                // If data is active then process it now. Delayed animations start with `active` false.\n                if (data.active) {\n                    // Set any transform origin for the animation.\n                    if (data.transformOrigin) {\n                        data.position.set({ transformOrigin: data.transformOrigin });\n                    }\n                    data.start = AnimationManager.#timeFrame;\n                    // Remove from new list and add to active list.\n                    AnimationManager.#pendingList.splice(cntr, 1);\n                    AnimationManager.#activeList.push(data);\n                }\n            }\n        }\n        // Process active animations.\n        for (let cntr = AnimationManager.#activeList.length; --cntr >= 0;) {\n            const data = AnimationManager.#activeList[cntr];\n            // Remove any animations that have been canceled.\n            if (data.cancelled || (data.el !== void 0 && !data.el.isConnected)) {\n                AnimationManager.#activeList.splice(cntr, 1);\n                this.#cleanupData(data);\n                continue;\n            }\n            data.current = timeFrame - data.start;\n            // Remove this animation instance if current animating time exceeds duration.\n            if (data.current >= data.duration) {\n                // Prepare final update with end position data.\n                for (let dataCntr = data.keys.length; --dataCntr >= 0;) {\n                    const key = data.keys[dataCntr];\n                    data.newData[key] = data.destination[key];\n                }\n                data.position.set(data.newData, AnimationManager.#tjsPositionSetOptions);\n                AnimationManager.#activeList.splice(cntr, 1);\n                this.#cleanupData(data);\n                continue;\n            }\n            // Apply easing to create an eased time.\n            const easedTime = data.ease(data.current / data.duration);\n            for (let dataCntr = data.keys.length; --dataCntr >= 0;) {\n                const key = data.keys[dataCntr];\n                data.newData[key] = data.interpolate(data.initial[key], data.destination[key], easedTime);\n            }\n            data.position.set(data.newData, AnimationManager.#tjsPositionSetOptions);\n        }\n        globalThis.requestAnimationFrame(this.#animateBound);\n    }\n    /**\n     * Cancels all animations for given TJSPosition instance.\n     *\n     * @param position - TJSPosition instance.\n     *\n     * @param [cancelFn] - An optional function to control cancelling animations.\n     */\n    static cancel(position, cancelFn = AnimationManager.cancelFn) {\n        for (let cntr = AnimationManager.#activeList.length; --cntr >= 0;) {\n            const data = AnimationManager.#activeList[cntr];\n            if (data.position === position && cancelFn(data)) {\n                AnimationManager.#activeList.splice(cntr, 1);\n                data.cancelled = true;\n                this.#cleanupData(data);\n            }\n        }\n        for (let cntr = AnimationManager.#pendingList.length; --cntr >= 0;) {\n            const data = AnimationManager.#pendingList[cntr];\n            if (data.position === position && cancelFn(data)) {\n                AnimationManager.#pendingList.splice(cntr, 1);\n                data.cancelled = true;\n                this.#cleanupData(data);\n            }\n        }\n    }\n    /**\n     * Cancels all active and delayed animations.\n     */\n    static cancelAll() {\n        for (let cntr = AnimationManager.#activeList.length; --cntr >= 0;) {\n            const data = AnimationManager.#activeList[cntr];\n            data.cancelled = true;\n            this.#cleanupData(data);\n        }\n        for (let cntr = AnimationManager.#pendingList.length; --cntr >= 0;) {\n            const data = AnimationManager.#pendingList[cntr];\n            data.cancelled = true;\n            this.#cleanupData(data);\n        }\n        AnimationManager.#activeList.length = 0;\n        AnimationManager.#pendingList.length = 0;\n    }\n    /**\n     * @param data - Animation data to cleanup.\n     */\n    static #cleanupData(data) {\n        // Update state.\n        data.active = false;\n        data.finished = true;\n        // Reset any transform origin for the animation to initial value.\n        if (data.transformOriginInitial) {\n            data.position.set({ transformOrigin: data.transformOriginInitial });\n        }\n        if (typeof data.cleanup === 'function') {\n            data.cleanup(data);\n        }\n        if (typeof data.resolve === 'function') {\n            data.resolve({ cancelled: data.cancelled });\n        }\n        // Remove retained data if not a `quickTo` animation.\n        if (!data.quickTo) {\n            data.cleanup = void 0;\n            data.control = void 0;\n            data.destination = void 0;\n            data.el = void 0;\n            data.ease = void 0;\n            data.initial = void 0;\n            data.interpolate = void 0;\n            data.keys = void 0;\n            data.newData = void 0;\n            data.position = void 0;\n            data.resolve = void 0;\n        }\n    }\n    /**\n     * Gets all {@link AnimationControl} instances for a given TJSPosition instance.\n     *\n     * @param position - TJSPosition instance.\n     *\n     * @returns All scheduled AnimationControl instances for the given TJSPosition instance.\n     */\n    static getScheduled(position) {\n        const results = [];\n        for (let cntr = AnimationManager.#activeList.length; --cntr >= 0;) {\n            const data = AnimationManager.#activeList[cntr];\n            if (data.position === position && data.control) {\n                results.push(data.control);\n            }\n        }\n        for (let cntr = AnimationManager.#pendingList.length; --cntr >= 0;) {\n            const data = AnimationManager.#pendingList[cntr];\n            if (data.position === position && data.control) {\n                results.push(data.control);\n            }\n        }\n        return results;\n    }\n    /**\n     * Returns the status of any scheduled or pending animations for the given {@link TJSPosition} instance.\n     *\n     * @param position - TJSPosition instance.\n     *\n     * @param [options] - Scheduling options.\n     *\n     * @returns True if scheduled / false if not.\n     */\n    static isScheduled(position, { active = true, pending = true } = {}) {\n        if (active) {\n            for (let cntr = AnimationManager.#activeList.length; --cntr >= 0;) {\n                if (AnimationManager.#activeList[cntr].position === position) {\n                    return true;\n                }\n            }\n        }\n        if (pending) {\n            for (let cntr = AnimationManager.#pendingList.length; --cntr >= 0;) {\n                if (AnimationManager.#pendingList[cntr].position === position) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n}\n\n/**\n * Defines stored positional data.\n */\nclass TJSPositionData {\n    height;\n    left;\n    maxHeight;\n    maxWidth;\n    minHeight;\n    minWidth;\n    rotateX;\n    rotateY;\n    rotateZ;\n    scale;\n    top;\n    transformOrigin;\n    translateX;\n    translateY;\n    translateZ;\n    width;\n    zIndex;\n    /**\n     * @param [opts] - Options.\n     *\n     * @param [opts.height] -\n     *\n     * @param [opts.left] -\n     *\n     * @param [opts.maxHeight] -\n     *\n     * @param [opts.maxWidth] -\n     *\n     * @param [opts.minHeight] -\n     *\n     * @param [opts.minWidth] -\n     *\n     * @param [opts.rotateX] -\n     *\n     * @param [opts.rotateY] -\n     *\n     * @param [opts.rotateZ] -\n     *\n     * @param [opts.scale] -\n     *\n     * @param [opts.translateX] -\n     *\n     * @param [opts.translateY] -\n     *\n     * @param [opts.translateZ] -\n     *\n     * @param [opts.top] -\n     *\n     * @param [opts.transformOrigin] -\n     *\n     * @param [opts.width] -\n     *\n     * @param [opts.zIndex] -\n     *\n     * @param [opts.rotation] - Alias for `rotateZ`.\n     */\n    constructor({ height = null, left = null, maxHeight = null, maxWidth = null, minHeight = null, minWidth = null, rotateX = null, rotateY = null, rotateZ = null, scale = null, translateX = null, translateY = null, translateZ = null, top = null, transformOrigin = null, width = null, zIndex = null } = {}) {\n        this.height = height;\n        this.left = left;\n        this.maxHeight = maxHeight;\n        this.maxWidth = maxWidth;\n        this.minHeight = minHeight;\n        this.minWidth = minWidth;\n        this.rotateX = rotateX;\n        this.rotateY = rotateY;\n        this.rotateZ = rotateZ;\n        this.scale = scale;\n        this.top = top;\n        this.transformOrigin = transformOrigin;\n        this.translateX = translateX;\n        this.translateY = translateY;\n        this.translateZ = translateZ;\n        this.width = width;\n        this.zIndex = zIndex;\n    }\n}\n\n/**\n * Various internal utilities to work with {@link TJSPositionData}.\n */\nclass TJSPositionDataUtil {\n    /**\n     * Stores the TJSPositionData properties that can be animated.\n     */\n    static #animateKeys = Object.freeze(new Set([\n        // Main keys\n        'left', 'top', 'maxWidth', 'maxHeight', 'minWidth', 'minHeight', 'width', 'height',\n        'rotateX', 'rotateY', 'rotateZ', 'scale', 'translateX', 'translateY', 'translateZ', 'zIndex',\n        // Aliases\n        'rotation'\n    ]));\n    /**\n     * Stores the TJSPositionData property aliases that can be animated.\n     */\n    static #animateKeyAliases = Object.freeze(new Map([['rotation', 'rotateZ']]));\n    /**\n     * Provides numeric defaults for all parameters. This is used by {@link TJSPosition.get} to optionally provide\n     * numeric defaults.\n     */\n    static #numericDefaults = Object.freeze({\n        // Other keys\n        height: 0,\n        left: 0,\n        maxHeight: null,\n        maxWidth: null,\n        minHeight: null,\n        minWidth: null,\n        top: 0,\n        transformOrigin: null,\n        width: 0,\n        zIndex: null,\n        rotateX: 0,\n        rotateY: 0,\n        rotateZ: 0,\n        scale: 1,\n        translateX: 0,\n        translateY: 0,\n        translateZ: 0\n    });\n    /**\n     * Convenience to copy from source to target of two TJSPositionData like objects. If a target is not supplied a new\n     * {@link TJSPositionData} instance is created.\n     *\n     * @param source - The source instance to copy from.\n     *\n     * @param [target] - Target TJSPositionData like object; if one is not provided a new instance is created.\n     *\n     * @returns The target instance with all TJSPositionData fields.\n     */\n    static copyData(source, target = new TJSPositionData()) {\n        target.height = source.height ?? null;\n        target.left = source.left ?? null;\n        target.maxHeight = source.maxHeight ?? null;\n        target.maxWidth = source.maxWidth ?? null;\n        target.minHeight = source.minHeight ?? null;\n        target.minWidth = source.minWidth ?? null;\n        target.rotateX = source.rotateX ?? null;\n        target.rotateY = source.rotateY ?? null;\n        target.rotateZ = source.rotateZ ?? null;\n        target.scale = source.scale ?? null;\n        target.top = source.top ?? null;\n        target.transformOrigin = source.transformOrigin ?? null;\n        target.translateX = source.translateX ?? null;\n        target.translateY = source.translateY ?? null;\n        target.translateZ = source.translateZ ?? null;\n        target.width = source.width ?? null;\n        target.zIndex = source.zIndex ?? null;\n        return target;\n    }\n    /**\n     * Returns the non-aliased animation key.\n     *\n     * @param key - Animation key / possibly aliased key.\n     *\n     * @returns Actual non-aliased animation key.\n     */\n    static getAnimationKey(key) {\n        return this.#animateKeyAliases.get(key) ?? key;\n    }\n    /**\n     * Queries an object by the given key or otherwise returns any numeric default.\n     *\n     * @param data - An object to query for the given animation key.\n     *\n     * @param key - Animation key.\n     *\n     * @returns Data at key or numeric default.\n     */\n    static getDataOrDefault(data, key) {\n        key = this.#animateKeyAliases.get(key) ?? key;\n        return data[key] ?? this.#numericDefaults[key];\n    }\n    /**\n     * Tests if the given key is an animation key.\n     *\n     * @param key - A potential animation key.\n     *\n     * @returns Is animation key.\n     */\n    static isAnimationKey(key) {\n        return this.#animateKeys.has(key);\n    }\n    /**\n     * Sets numeric defaults for a {@link TJSPositionData} like object.\n     *\n     * @param data - A TJSPositionData like object.\n     */\n    static setNumericDefaults(data) {\n        // Transform keys\n        if (data.rotateX === null) {\n            data.rotateX = 0;\n        }\n        if (data.rotateY === null) {\n            data.rotateY = 0;\n        }\n        if (data.rotateZ === null) {\n            data.rotateZ = 0;\n        }\n        if (data.translateX === null) {\n            data.translateX = 0;\n        }\n        if (data.translateY === null) {\n            data.translateY = 0;\n        }\n        if (data.translateZ === null) {\n            data.translateZ = 0;\n        }\n        if (data.scale === null) {\n            data.scale = 1;\n        }\n    }\n}\n\n/**\n * Converts {@link TJSPositionData} properties defined as strings to number values. The string values can be defined\n * as relative adjustments with a leading operator. Various unit formats are supported as well.\n */\nclass ConvertStringData {\n    /**\n     * Animation keys for different processing categories.\n     */\n    static #animKeyTypes = {\n        // Animation keys that can be specified in `px` converted to a number.\n        numPx: Object.freeze(new Set(['left', 'top', 'maxWidth', 'maxHeight', 'minWidth', 'minHeight', 'width', 'height',\n            'translateX', 'translateY', 'translateZ'])),\n        // Animation keys that can be specified in percentage of parent element constraint.\n        percentParent: Object.freeze(new Set(['left', 'top', 'maxWidth', 'maxHeight', 'minWidth', 'minHeight', 'width',\n            'height'])),\n        // Only rotation animation keys can be specified in `rad` / `turn` converted to a number.\n        rotationRadTurn: Object.freeze(new Set(['rotateX', 'rotateY', 'rotateZ', 'rotation']))\n    };\n    /**\n     * Parses string data values. Relative values must start with leading values '+=', '-=', or '*=' followed by a\n     * float / numeric value. IE `+=45` or for percentage '+=10%'. Also handles exact percent value such as `10` or\n     * `10%`. Percentage values are based on the current value, parent element constraints, or constraints of the type\n     * of value like rotation being bound by 360 degrees.\n     *\n     * @privateRemarks\n     * TODO: In the future support more specific CSS unit types.\n     */\n    static #regexStringData = /^(?<operation>[-+*]=)?(?<value>-?\\d*\\.?\\d+)(?<unit>%|%~|px|rad|turn)?$/;\n    /**\n     * Stores the results for match groups from `regexStringData`;\n     */\n    static #matchResults = Object.seal({\n        operation: void 0,\n        value: 0,\n        unit: void 0\n    });\n    /**\n     * Converts any relative string values for animatable keys to actual updates performed against current data.\n     *\n     * @param data - position data.\n     *\n     * @param position - The source position data.\n     *\n     * @param el - Target positioned element.\n     *\n     * @returns Converted data.\n     */\n    static process(data, position, el) {\n        // Used in `%` calculations. The first `%` conversion that requires parent element height and width will attempt\n        // to cache the parent element client height & width of the given element.\n        let parentClientHeight = Number.NaN;\n        let parentClientWidth = Number.NaN;\n        for (const key in data) {\n            // Key is animatable / numeric.\n            if (TJSPositionDataUtil.isAnimationKey(key)) {\n                const value = data[key];\n                if (typeof value !== 'string') {\n                    continue;\n                }\n                // Ignore 'auto' and 'inherit' string values.\n                if (value === 'auto' || value === 'inherit') {\n                    continue;\n                }\n                const animKey = key;\n                const regexResults = this.#regexStringData.exec(value);\n                // Additional state indicating a particular key is handled.\n                let handled = false;\n                if (regexResults && regexResults.groups) {\n                    const results = this.#matchResults;\n                    results.operation = regexResults.groups.operation;\n                    results.value = parseFloat(regexResults.groups.value);\n                    results.unit = regexResults.groups.unit;\n                    // Retrieve current value, but if null use the numeric default.\n                    const current = TJSPositionDataUtil.getDataOrDefault(position, key);\n                    switch (results.unit) {\n                        // Animation keys that support percentage changes including constraints against the parent element.\n                        case '%':\n                            {\n                                // Cache parent client width / height on first parent percent based key.\n                                if (this.#animKeyTypes.percentParent.has(key) && (Number.isNaN(parentClientHeight) ||\n                                    Number.isNaN(parentClientWidth))) {\n                                    if (el?.parentElement?.isConnected) {\n                                        parentClientHeight = el.parentElement.clientHeight;\n                                        parentClientWidth = el.parentElement.clientWidth;\n                                    }\n                                    else {\n                                        parentClientHeight = 0;\n                                        parentClientWidth = 0;\n                                        console.warn(`TJSPosition - ConvertStringData warning: could not determine parent constraints for key '${key}' with value '${value}'.`);\n                                        data[key] = void 0;\n                                        continue;\n                                    }\n                                }\n                                handled = this.#handlePercent(animKey, current, data, results, parentClientHeight, parentClientWidth);\n                                break;\n                            }\n                        // Animation keys that support percentage changes from current values.\n                        case '%~':\n                            handled = this.#handleRelativePercent(animKey, current, data, results);\n                            break;\n                        // Animation keys that support `px` / treat as raw number.\n                        case 'px':\n                            handled = this.#animKeyTypes.numPx.has(key) ?\n                                this.#applyResultsValue(animKey, current, data, results) : false;\n                            break;\n                        // Only rotation animation keys support `rad` / `turn`.\n                        case 'rad':\n                        case 'turn':\n                            handled = this.#animKeyTypes.rotationRadTurn.has(key) ?\n                                this.#handleRotationRadTurn(animKey, current, data, results) : false;\n                            break;\n                        // No units / treat as raw number.\n                        default:\n                            handled = this.#applyResultsValue(animKey, current, data, results);\n                            break;\n                    }\n                }\n                if (!regexResults || !handled) {\n                    console.warn(`TJSPosition - ConvertStringData warning: malformed key '${key}' with value '${value}'.`);\n                    data[key] = void 0;\n                }\n            }\n        }\n        return data;\n    }\n    // Internal implementation ----------------------------------------------------------------------------------------\n    /**\n     * Provides the common update to source data after `results.value` has been converted to the proper value\n     * respectively.\n     *\n     * @param key - Animation key.\n     *\n     * @param current - Current value\n     *\n     * @param data - Source data to convert.\n     *\n     * @param results - Match results.\n     *\n     * @returns Adjustment successful.\n     */\n    static #applyResultsValue(key, current, data, results) {\n        if (!results.operation) {\n            data[key] = results.value;\n            return true;\n        }\n        switch (results.operation) {\n            case '-=':\n                data[key] = current - results.value;\n                break;\n            case '+=':\n                data[key] = current + results.value;\n                break;\n            case '*=':\n                data[key] = current * results.value;\n                break;\n            default:\n                return false;\n        }\n        return true;\n    }\n    /**\n     * Handles the `%` unit type where values are adjusted against the parent element client width / height or in the\n     * case of rotation the percentage of 360 degrees.\n     *\n     * @param key - Animation key.\n     *\n     * @param current - Current value\n     *\n     * @param data - Source data to convert.\n     *\n     * @param results - Match results.\n     *\n     * @param parentClientHeight - Parent element client height.\n     *\n     * @param parentClientWidth - Parent element client width.\n     *\n     * @returns Adjustment successful.\n     */\n    static #handlePercent(key, current, data, results, parentClientHeight, parentClientWidth) {\n        switch (key) {\n            // Calculate value; take into account keys that calculate parent client width.\n            case 'left':\n            case 'maxWidth':\n            case 'minWidth':\n            case 'width':\n            case 'translateX':\n                results.value = parentClientWidth * (results.value / 100);\n                break;\n            // Calculate value; take into account keys that calculate parent client height.\n            case 'top':\n            case 'maxHeight':\n            case 'minHeight':\n            case 'height':\n            case 'translateY':\n                results.value = parentClientHeight * (results.value / 100);\n                break;\n            // Calculate value; convert percentage into degrees\n            case 'rotateX':\n            case 'rotateY':\n            case 'rotateZ':\n            case 'rotation':\n                results.value = 360 * (results.value / 100);\n                break;\n            default:\n                return false;\n        }\n        return this.#applyResultsValue(key, current, data, results);\n    }\n    /**\n     * Handles the `%~` unit type where values are adjusted against the current value for the given key.\n     *\n     * @param key - Animation key.\n     *\n     * @param current - Current value\n     *\n     * @param data - Source data to convert.\n     *\n     * @param results - Match results.\n     *\n     * @returns Adjustment successful.\n     */\n    static #handleRelativePercent(key, current, data, results) {\n        // Normalize percentage.\n        results.value = results.value / 100;\n        if (!results.operation) {\n            data[key] = current * results.value;\n            return true;\n        }\n        switch (results.operation) {\n            case '-=':\n                data[key] = current - (current * results.value);\n                break;\n            case '+=':\n                data[key] = current + (current * results.value);\n                break;\n            case '*=':\n                data[key] = current * (current * results.value);\n                break;\n            default:\n                return false;\n        }\n        return true;\n    }\n    /**\n     * Handles the `rad` / `turn` unit types for rotation animation keys.\n     *\n     * @param key - Animation key.\n     *\n     * @param current - Current value\n     *\n     * @param data - Source data to convert.\n     *\n     * @param results - Match results.\n     *\n     * @returns Adjustment successful.\n     */\n    static #handleRotationRadTurn(key, current, data, results) {\n        // Convert radians / turn into degrees.\n        switch (results.unit) {\n            case 'rad':\n                results.value = radToDeg(results.value);\n                break;\n            case 'turn':\n                results.value = 360 * results.value;\n                break;\n        }\n        return this.#applyResultsValue(key, current, data, results);\n    }\n}\n\n/**\n * Provides the output data for {@link TransformAPI.getData}.\n */\nclass TJSTransformData {\n    constructor() {\n        Object.seal(this);\n    }\n    /**\n     * Stores the calculated bounding rectangle.\n     */\n    #boundingRect = new DOMRect();\n    /**\n     * Stores the individual transformed corner points of the window in screen space clockwise from:\n     * top left -> top right -> bottom right -> bottom left.\n     */\n    #corners = [new Vec3(), new Vec3(), new Vec3(), new Vec3()];\n    /**\n     * Stores the current gl-matrix Mat4 data.\n     */\n    #mat4 = new Mat4();\n    /**\n     * Stores the pre-origin & post-origin translations to apply to matrix transforms.\n     */\n    #originTranslations = [new Mat4(), new Mat4()];\n    /**\n     * @returns The bounding rectangle.\n     */\n    get boundingRect() { return this.#boundingRect; }\n    /**\n     * @returns The transformed corner points as Vec3 in screen space.\n     */\n    get corners() { return this.#corners; }\n    /**\n     * @returns Returns the CSS style string for the transform matrix.\n     */\n    get css() { return `matrix3d(${this.mat4.join(',')})`; }\n    /**\n     * @returns The transform matrix.\n     */\n    get mat4() { return this.#mat4; }\n    /**\n     * @returns The pre / post translation matrices for origin translation.\n     */\n    get originTranslations() { return this.#originTranslations; }\n}\n\n/**\n * Provides type guards for `Number`.\n */\nclass NumberGuard {\n    constructor() { }\n    static isFinite(value) {\n        return typeof value === 'number' && Number.isFinite(value);\n    }\n    static isFiniteOrNull(value) {\n        return value === null || (typeof value === 'number' && Number.isFinite(value));\n    }\n}\n\n/**\n * Caches computed styles of a {@link TJSPosition} target element.\n */\nclass TJSPositionStyleCache {\n    el;\n    computed;\n    marginLeft;\n    marginTop;\n    maxHeight;\n    maxWidth;\n    minHeight;\n    minWidth;\n    hasWillChange;\n    stores;\n    resizeObserved;\n    constructor() {\n        this.el = void 0;\n        this.computed = void 0;\n        this.marginLeft = void 0;\n        this.marginTop = void 0;\n        this.maxHeight = void 0;\n        this.maxWidth = void 0;\n        this.minHeight = void 0;\n        this.minWidth = void 0;\n        this.hasWillChange = false;\n        this.resizeObserved = Object.seal({\n            contentHeight: void 0,\n            contentWidth: void 0,\n            offsetHeight: void 0,\n            offsetWidth: void 0\n        });\n        /**\n         * Provides a writable store to track offset & content width / height from an associated `resizeObserver` action.\n         */\n        const storeResizeObserved = writable(this.resizeObserved);\n        this.stores = {\n            element: writable(this.el),\n            resizeContentHeight: propertyStore(storeResizeObserved, 'contentHeight'),\n            resizeContentWidth: propertyStore(storeResizeObserved, 'contentWidth'),\n            resizeObserved: storeResizeObserved,\n            resizeObservable: writable(false),\n            resizeOffsetHeight: propertyStore(storeResizeObserved, 'offsetHeight'),\n            resizeOffsetWidth: propertyStore(storeResizeObserved, 'offsetWidth')\n        };\n    }\n    /**\n     * Returns the cached offsetHeight from any attached `resizeObserver` action otherwise gets the offsetHeight from\n     * the element directly. The more optimized path is using `resizeObserver` as getting it from the element\n     * directly is more expensive and alters the execution order of an animation frame.\n     *\n     * @returns The element offsetHeight.\n     */\n    get offsetHeight() {\n        if (this.el !== void 0 && A11yHelper.isFocusTarget(this.el)) {\n            return this.resizeObserved.offsetHeight !== void 0 ? this.resizeObserved.offsetHeight : this.el.offsetHeight;\n        }\n        throw new Error(`TJSPositionStyleCache - get offsetHeight error: no element assigned.`);\n    }\n    /**\n     * Returns the cached offsetWidth from any attached `resizeObserver` action otherwise gets the offsetWidth from\n     * the element directly. The more optimized path is using `resizeObserver` as getting it from the element\n     * directly is more expensive and alters the execution order of an animation frame.\n     *\n     * @returns The element offsetHeight.\n     */\n    get offsetWidth() {\n        if (this.el !== void 0 && A11yHelper.isFocusTarget(this.el)) {\n            return this.resizeObserved.offsetWidth !== void 0 ? this.resizeObserved.offsetWidth : this.el.offsetWidth;\n        }\n        throw new Error(`TJSPositionStyleCache - get offsetWidth error: no element assigned.`);\n    }\n    /**\n     * @param el -\n     *\n     * @returns Does element match cached element.\n     */\n    hasData(el) { return this.el === el; }\n    /**\n     * Resets the style cache.\n     */\n    reset() {\n        // Remove will-change inline style from previous element if it is still connected.\n        if (this.el !== void 0 && A11yHelper.isFocusTarget(this.el) && this.el.isConnected && !this.hasWillChange) {\n            this.el.style.willChange = '';\n        }\n        this.el = void 0;\n        this.computed = void 0;\n        this.marginLeft = void 0;\n        this.marginTop = void 0;\n        this.maxHeight = void 0;\n        this.maxWidth = void 0;\n        this.minHeight = void 0;\n        this.minWidth = void 0;\n        this.hasWillChange = false;\n        // Silently reset `resizedObserved`; With proper usage the `resizeObserver` action issues an update on removal.\n        this.resizeObserved.contentHeight = void 0;\n        this.resizeObserved.contentWidth = void 0;\n        this.resizeObserved.offsetHeight = void 0;\n        this.resizeObserved.offsetWidth = void 0;\n        // Reset the tracked element this TJSPosition instance is modifying.\n        this.stores.element.set(void 0);\n    }\n    /**\n     * Updates the style cache with new data from the given element.\n     *\n     * @param el - An HTML element.\n     */\n    update(el) {\n        this.el = el;\n        this.computed = globalThis.getComputedStyle(el);\n        this.marginLeft = StyleParse.pixels(el.style.marginLeft) ?? StyleParse.pixels(this.computed.marginLeft);\n        this.marginTop = StyleParse.pixels(el.style.marginTop) ?? StyleParse.pixels(this.computed.marginTop);\n        this.maxHeight = StyleParse.pixels(el.style.maxHeight) ?? StyleParse.pixels(this.computed.maxHeight);\n        this.maxWidth = StyleParse.pixels(el.style.maxWidth) ?? StyleParse.pixels(this.computed.maxWidth);\n        // Note that the computed styles for below will always be 0px / 0 when no style is active.\n        this.minHeight = StyleParse.pixels(el.style.minHeight) ?? StyleParse.pixels(this.computed.minHeight);\n        this.minWidth = StyleParse.pixels(el.style.minWidth) ?? StyleParse.pixels(this.computed.minWidth);\n        // Tracks if there already is a will-change property on the inline or computed styles.\n        const willChange = el.style.willChange !== '' ? el.style.willChange : this.computed.willChange ?? '';\n        this.hasWillChange = willChange !== '' && willChange !== 'auto';\n        // Update the tracked element this TJSPosition instance is modifying.\n        this.stores.element.set(el);\n    }\n}\n\n/**\n *\n */\nclass TJSTransforms {\n    /**\n     * Stores transform data.\n     */\n    #data = {};\n    /**\n     * Stores the transform keys in the order added.\n     */\n    #orderList = [];\n    /**\n     * Defines the keys of TJSPositionData that are transform keys.\n     */\n    static #transformKeys = Object.freeze([\n        'rotateX', 'rotateY', 'rotateZ', 'scale', 'translateX', 'translateY', 'translateZ'\n    ]);\n    /**\n     * Validates that a given key is a transform key.\n     *\n     * @param key - A potential transform key.\n     */\n    static #isTransformKey(key) {\n        return this.#transformKeys.includes(key);\n    }\n    /**\n     * Defines bitwise keys for transforms used in {@link TJSTransforms.getMat4}.\n     */\n    static #transformKeysBitwise = Object.freeze({\n        rotateX: 1,\n        rotateY: 2,\n        rotateZ: 4,\n        scale: 8,\n        translateX: 16,\n        translateY: 32,\n        translateZ: 64\n    });\n    /**\n     * Defines the default transform origin.\n     */\n    static #transformOriginDefault = 'top left';\n    /**\n     * Defines the valid transform origins.\n     */\n    static #transformOrigins = Object.freeze([\n        'top left', 'top center', 'top right', 'center left', 'center', 'center right', 'bottom left', 'bottom center',\n        'bottom right'\n    ]);\n    /**\n     * Defines a valid Set of transform origins.\n     */\n    static #transformOriginsSet = Object.freeze(new Set(this.#transformOrigins));\n    // Temporary variables --------------------------------------------------------------------------------------------\n    /**\n     */\n    static #mat4Result = new Mat4();\n    /**\n     */\n    static #mat4Temp = new Mat4();\n    /**\n     */\n    static #vec3Temp = new Vec3();\n    /**\n     */\n    static #vectorScale = [1, 1, 1];\n    /**\n     */\n    static #vectorTranslate = [0, 0, 0];\n    /**\n     * Returns a list of supported transform origins.\n     *\n     * @returns The supported transform origin strings.\n     */\n    static get transformOrigins() {\n        return this.#transformOrigins;\n    }\n    /**\n     * Returns whether the given string is a {@link TransformAPI.TransformOrigin}.\n     *\n     * @param origin - A potential transform origin string.\n     *\n     * @returns True if origin is a TransformOrigin string.\n     */\n    static isTransformOrigin(origin) {\n        return this.#transformOriginsSet.has(origin);\n    }\n    /**\n     * @returns Whether there are active transforms in local data.\n     */\n    get isActive() { return this.#orderList.length > 0; }\n    /**\n     * @returns Any local rotateX data.\n     */\n    get rotateX() { return this.#data.rotateX; }\n    /**\n     * @returns Any local rotateY data.\n     */\n    get rotateY() { return this.#data.rotateY; }\n    /**\n     * @returns Any local rotateZ data.\n     */\n    get rotateZ() { return this.#data.rotateZ; }\n    /**\n     * @returns Any local rotateZ scale.\n     */\n    get scale() { return this.#data.scale; }\n    /**\n     * @returns Any local translateZ data.\n     */\n    get translateX() { return this.#data.translateX; }\n    /**\n     * @returns Any local translateZ data.\n     */\n    get translateY() { return this.#data.translateY; }\n    /**\n     * @returns Any local translateZ data.\n     */\n    get translateZ() { return this.#data.translateZ; }\n    /**\n     * Sets the local rotateX data if the value is a finite number otherwise removes the local data.\n     *\n     * @param value - A value to set.\n     */\n    set rotateX(value) {\n        if (Number.isFinite(value)) {\n            if (this.#data.rotateX === void 0) {\n                this.#orderList.push('rotateX');\n            }\n            this.#data.rotateX = value;\n        }\n        else {\n            if (this.#data.rotateX !== void 0) {\n                const index = this.#orderList.findIndex((entry) => entry === 'rotateX');\n                if (index >= 0) {\n                    this.#orderList.splice(index, 1);\n                }\n            }\n            delete this.#data.rotateX;\n        }\n    }\n    /**\n     * Sets the local rotateY data if the value is a finite number otherwise removes the local data.\n     *\n     * @param value - A value to set.\n     */\n    set rotateY(value) {\n        if (Number.isFinite(value)) {\n            if (this.#data.rotateY === void 0) {\n                this.#orderList.push('rotateY');\n            }\n            this.#data.rotateY = value;\n        }\n        else {\n            if (this.#data.rotateY !== void 0) {\n                const index = this.#orderList.findIndex((entry) => entry === 'rotateY');\n                if (index >= 0) {\n                    this.#orderList.splice(index, 1);\n                }\n            }\n            delete this.#data.rotateY;\n        }\n    }\n    /**\n     * Sets the local rotateZ data if the value is a finite number otherwise removes the local data.\n     *\n     * @param value - A value to set.\n     */\n    set rotateZ(value) {\n        if (Number.isFinite(value)) {\n            if (this.#data.rotateZ === void 0) {\n                this.#orderList.push('rotateZ');\n            }\n            this.#data.rotateZ = value;\n        }\n        else {\n            if (this.#data.rotateZ !== void 0) {\n                const index = this.#orderList.findIndex((entry) => entry === 'rotateZ');\n                if (index >= 0) {\n                    this.#orderList.splice(index, 1);\n                }\n            }\n            delete this.#data.rotateZ;\n        }\n    }\n    /**\n     * Sets the local scale data if the value is a finite number otherwise removes the local data.\n     *\n     * @param value - A value to set.\n     */\n    set scale(value) {\n        if (Number.isFinite(value)) {\n            if (this.#data.scale === void 0) {\n                this.#orderList.push('scale');\n            }\n            this.#data.scale = value;\n        }\n        else {\n            if (this.#data.scale !== void 0) {\n                const index = this.#orderList.findIndex((entry) => entry === 'scale');\n                if (index >= 0) {\n                    this.#orderList.splice(index, 1);\n                }\n            }\n            delete this.#data.scale;\n        }\n    }\n    /**\n     * Sets the local translateX data if the value is a finite number otherwise removes the local data.\n     *\n     * @param value - A value to set.\n     */\n    set translateX(value) {\n        if (Number.isFinite(value)) {\n            if (this.#data.translateX === void 0) {\n                this.#orderList.push('translateX');\n            }\n            this.#data.translateX = value;\n        }\n        else {\n            if (this.#data.translateX !== void 0) {\n                const index = this.#orderList.findIndex((entry) => entry === 'translateX');\n                if (index >= 0) {\n                    this.#orderList.splice(index, 1);\n                }\n            }\n            delete this.#data.translateX;\n        }\n    }\n    /**\n     * Sets the local translateY data if the value is a finite number otherwise removes the local data.\n     *\n     * @param value - A value to set.\n     */\n    set translateY(value) {\n        if (Number.isFinite(value)) {\n            if (this.#data.translateY === void 0) {\n                this.#orderList.push('translateY');\n            }\n            this.#data.translateY = value;\n        }\n        else {\n            if (this.#data.translateY !== void 0) {\n                const index = this.#orderList.findIndex((entry) => entry === 'translateY');\n                if (index >= 0) {\n                    this.#orderList.splice(index, 1);\n                }\n            }\n            delete this.#data.translateY;\n        }\n    }\n    /**\n     * Sets the local translateZ data if the value is a finite number otherwise removes the local data.\n     *\n     * @param value - A value to set.\n     */\n    set translateZ(value) {\n        if (Number.isFinite(value)) {\n            if (this.#data.translateZ === void 0) {\n                this.#orderList.push('translateZ');\n            }\n            this.#data.translateZ = value;\n        }\n        else {\n            if (this.#data.translateZ !== void 0) {\n                const index = this.#orderList.findIndex((entry) => entry === 'translateZ');\n                if (index >= 0) {\n                    this.#orderList.splice(index, 1);\n                }\n            }\n            delete this.#data.translateZ;\n        }\n    }\n    /**\n     * Returns the `matrix3d` CSS transform for the given position / transform data.\n     *\n     * @param [data] - Optional position data otherwise use local stored transform data.\n     *\n     * @returns The CSS `matrix3d` string.\n     */\n    getCSS(data = this.#data) {\n        return `matrix3d(${this.getMat4(data, TJSTransforms.#mat4Result).join(',')})`;\n    }\n    /**\n     * Returns the `matrix3d` CSS transform for the given position / transform data.\n     *\n     * @param [data] - Optional position data otherwise use local stored transform data.\n     *\n     * @returns The CSS `matrix3d` string.\n     */\n    getCSSOrtho(data = this.#data) {\n        return `matrix3d(${this.getMat4Ortho(data, TJSTransforms.#mat4Result).join(',')})`;\n    }\n    /**\n     * Collects all data including a bounding rect, transform matrix, and points array of the given\n     * {@link TJSPositionData} instance with the applied local transform data.\n     *\n     * @param position - The position data to process.\n     *\n     * @param [output] - Optional TJSTransformData output instance.\n     *\n     * @param [validationData] - Optional validation data for adjustment parameters.\n     *\n     * @returns The output TJSTransformData instance.\n     */\n    getData(position, output = new TJSTransformData(), validationData) {\n        const valWidth = validationData?.width ?? 0;\n        const valHeight = validationData?.height ?? 0;\n        const valOffsetTop = validationData?.offsetTop ?? validationData?.marginTop ?? 0;\n        const valOffsetLeft = validationData?.offsetLeft ?? validationData?.marginLeft ?? 0;\n        position.top += valOffsetTop;\n        position.left += valOffsetLeft;\n        const width = NumberGuard.isFinite(position.width) ? position.width : valWidth;\n        const height = NumberGuard.isFinite(position.height) ? position.height : valHeight;\n        const rect = output.corners;\n        if (this.hasTransform(position)) {\n            rect[0][0] = rect[0][1] = rect[0][2] = 0;\n            rect[1][0] = width;\n            rect[1][1] = rect[1][2] = 0;\n            rect[2][0] = width;\n            rect[2][1] = height;\n            rect[2][2] = 0;\n            rect[3][0] = 0;\n            rect[3][1] = height;\n            rect[3][2] = 0;\n            const matrix = this.getMat4(position, output.mat4);\n            const translate = TJSTransforms.#getOriginTranslation(position.transformOrigin, width, height, output.originTranslations);\n            if (TJSTransforms.#transformOriginDefault === position.transformOrigin) {\n                Vec3.transformMat4(rect[0], rect[0], matrix);\n                Vec3.transformMat4(rect[1], rect[1], matrix);\n                Vec3.transformMat4(rect[2], rect[2], matrix);\n                Vec3.transformMat4(rect[3], rect[3], matrix);\n            }\n            else {\n                Vec3.transformMat4(rect[0], rect[0], translate[0]);\n                Vec3.transformMat4(rect[0], rect[0], matrix);\n                Vec3.transformMat4(rect[0], rect[0], translate[1]);\n                Vec3.transformMat4(rect[1], rect[1], translate[0]);\n                Vec3.transformMat4(rect[1], rect[1], matrix);\n                Vec3.transformMat4(rect[1], rect[1], translate[1]);\n                Vec3.transformMat4(rect[2], rect[2], translate[0]);\n                Vec3.transformMat4(rect[2], rect[2], matrix);\n                Vec3.transformMat4(rect[2], rect[2], translate[1]);\n                Vec3.transformMat4(rect[3], rect[3], translate[0]);\n                Vec3.transformMat4(rect[3], rect[3], matrix);\n                Vec3.transformMat4(rect[3], rect[3], translate[1]);\n            }\n            rect[0][0] = position.left + rect[0][0];\n            rect[0][1] = position.top + rect[0][1];\n            rect[1][0] = position.left + rect[1][0];\n            rect[1][1] = position.top + rect[1][1];\n            rect[2][0] = position.left + rect[2][0];\n            rect[2][1] = position.top + rect[2][1];\n            rect[3][0] = position.left + rect[3][0];\n            rect[3][1] = position.top + rect[3][1];\n        }\n        else {\n            rect[0][0] = position.left;\n            rect[0][1] = position.top;\n            rect[1][0] = position.left + width;\n            rect[1][1] = position.top;\n            rect[2][0] = position.left + width;\n            rect[2][1] = position.top + height;\n            rect[3][0] = position.left;\n            rect[3][1] = position.top + height;\n            Mat4.identity(output.mat4);\n        }\n        let maxX = Number.MIN_SAFE_INTEGER;\n        let maxY = Number.MIN_SAFE_INTEGER;\n        let minX = Number.MAX_SAFE_INTEGER;\n        let minY = Number.MAX_SAFE_INTEGER;\n        for (let cntr = 4; --cntr >= 0;) {\n            if (rect[cntr][0] > maxX) {\n                maxX = rect[cntr][0];\n            }\n            if (rect[cntr][0] < minX) {\n                minX = rect[cntr][0];\n            }\n            if (rect[cntr][1] > maxY) {\n                maxY = rect[cntr][1];\n            }\n            if (rect[cntr][1] < minY) {\n                minY = rect[cntr][1];\n            }\n        }\n        const boundingRect = output.boundingRect;\n        boundingRect.x = minX;\n        boundingRect.y = minY;\n        boundingRect.width = maxX - minX;\n        boundingRect.height = maxY - minY;\n        position.top -= valOffsetTop;\n        position.left -= valOffsetLeft;\n        return output;\n    }\n    /**\n     * Creates a transform matrix based on local data applied in order it was added.\n     *\n     * If no data object is provided then the source is the local transform data. If another data object is supplied\n     * then the stored local transform order is applied then all remaining transform keys are applied. This allows the\n     * construction of a transform matrix in advance of setting local data and is useful in collision detection.\n     *\n     * @param [data] - TJSPositionData instance or local transform data.\n     *\n     * @param [output] - The output mat4 instance.\n     *\n     * @returns Transform matrix.\n     */\n    getMat4(data = this.#data, output = new Mat4()) {\n        const matrix = Mat4.identity(output);\n        // Bitwise tracks applied transform keys from local transform data.\n        let seenKeys = 0;\n        const orderList = this.#orderList;\n        // First apply ordered transforms from local transform data.\n        for (let cntr = 0; cntr < orderList.length; cntr++) {\n            const key = orderList[cntr];\n            switch (key) {\n                case 'rotateX':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.rotateX;\n                    Mat4.multiply(matrix, matrix, Mat4.fromXRotation(TJSTransforms.#mat4Temp, degToRad(data[key] ?? 0)));\n                    break;\n                case 'rotateY':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.rotateY;\n                    Mat4.multiply(matrix, matrix, Mat4.fromYRotation(TJSTransforms.#mat4Temp, degToRad(data[key] ?? 0)));\n                    break;\n                case 'rotateZ':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.rotateZ;\n                    Mat4.multiply(matrix, matrix, Mat4.fromZRotation(TJSTransforms.#mat4Temp, degToRad(data[key] ?? 0)));\n                    break;\n                case 'scale':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.scale;\n                    TJSTransforms.#vectorScale[0] = TJSTransforms.#vectorScale[1] = data[key] ?? 0;\n                    Mat4.multiply(matrix, matrix, Mat4.fromScaling(TJSTransforms.#mat4Temp, TJSTransforms.#vectorScale));\n                    break;\n                case 'translateX':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.translateX;\n                    TJSTransforms.#vectorTranslate[0] = data.translateX ?? 0;\n                    TJSTransforms.#vectorTranslate[1] = 0;\n                    TJSTransforms.#vectorTranslate[2] = 0;\n                    Mat4.multiply(matrix, matrix, Mat4.fromTranslation(TJSTransforms.#mat4Temp, TJSTransforms.#vectorTranslate));\n                    break;\n                case 'translateY':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.translateY;\n                    TJSTransforms.#vectorTranslate[0] = 0;\n                    TJSTransforms.#vectorTranslate[1] = data.translateY ?? 0;\n                    TJSTransforms.#vectorTranslate[2] = 0;\n                    Mat4.multiply(matrix, matrix, Mat4.fromTranslation(TJSTransforms.#mat4Temp, TJSTransforms.#vectorTranslate));\n                    break;\n                case 'translateZ':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.translateZ;\n                    TJSTransforms.#vectorTranslate[0] = 0;\n                    TJSTransforms.#vectorTranslate[1] = 0;\n                    TJSTransforms.#vectorTranslate[2] = data.translateZ ?? 0;\n                    Mat4.multiply(matrix, matrix, Mat4.fromTranslation(TJSTransforms.#mat4Temp, TJSTransforms.#vectorTranslate));\n                    break;\n            }\n        }\n        // Now apply any new keys not set in local transform data that have not been applied yet.\n        if (data !== this.#data) {\n            for (let cntr = 0; cntr < TJSTransforms.#transformKeys.length; cntr++) {\n                const key = TJSTransforms.#transformKeys[cntr];\n                // Reject bad / no data or if the key has already been applied.\n                if (data[key] === null || (seenKeys & TJSTransforms.#transformKeysBitwise[key]) > 0) {\n                    continue;\n                }\n                const value = data[key];\n                switch (key) {\n                    case 'rotateX':\n                        Mat4.multiply(matrix, matrix, Mat4.fromXRotation(TJSTransforms.#mat4Temp, degToRad(value)));\n                        break;\n                    case 'rotateY':\n                        Mat4.multiply(matrix, matrix, Mat4.fromYRotation(TJSTransforms.#mat4Temp, degToRad(value)));\n                        break;\n                    case 'rotateZ':\n                        Mat4.multiply(matrix, matrix, Mat4.fromZRotation(TJSTransforms.#mat4Temp, degToRad(value)));\n                        break;\n                    case 'scale':\n                        TJSTransforms.#vectorScale[0] = TJSTransforms.#vectorScale[1] = value;\n                        Mat4.multiply(matrix, matrix, Mat4.fromScaling(TJSTransforms.#mat4Temp, TJSTransforms.#vectorScale));\n                        break;\n                    case 'translateX':\n                        TJSTransforms.#vectorTranslate[0] = value;\n                        TJSTransforms.#vectorTranslate[1] = 0;\n                        TJSTransforms.#vectorTranslate[2] = 0;\n                        Mat4.multiply(matrix, matrix, Mat4.fromTranslation(TJSTransforms.#mat4Temp, TJSTransforms.#vectorTranslate));\n                        break;\n                    case 'translateY':\n                        TJSTransforms.#vectorTranslate[0] = 0;\n                        TJSTransforms.#vectorTranslate[1] = value;\n                        TJSTransforms.#vectorTranslate[2] = 0;\n                        Mat4.multiply(matrix, matrix, Mat4.fromTranslation(TJSTransforms.#mat4Temp, TJSTransforms.#vectorTranslate));\n                        break;\n                    case 'translateZ':\n                        TJSTransforms.#vectorTranslate[0] = 0;\n                        TJSTransforms.#vectorTranslate[1] = 0;\n                        TJSTransforms.#vectorTranslate[2] = value;\n                        Mat4.multiply(matrix, matrix, Mat4.fromTranslation(TJSTransforms.#mat4Temp, TJSTransforms.#vectorTranslate));\n                        break;\n                }\n            }\n        }\n        return matrix;\n    }\n    /**\n     * Provides an orthographic enhancement to convert left / top positional data to a translate operation.\n     *\n     * This transform matrix takes into account that the remaining operations are , but adds any left / top attributes\n     * from passed in data to translate X / Y.\n     *\n     * If no data object is provided then the source is the local transform data. If another data object is supplied\n     * then the stored local transform order is applied then all remaining transform keys are applied. This allows the\n     * construction of a transform matrix in advance of setting local data and is useful in collision detection.\n     *\n     * @param [data] - TJSPositionData instance or local transform data.\n     *\n     * @param [output] - The output mat4 instance.\n     *\n     * @returns Transform matrix.\n     */\n    getMat4Ortho(data = this.#data, output = new Mat4()) {\n        const matrix = Mat4.identity(output);\n        // Attempt to retrieve values from passed in data otherwise default to 0.\n        // Always perform the translation last regardless of order added to local transform data.\n        // Add data.left to translateX and data.top to translateY.\n        TJSTransforms.#vectorTranslate[0] = (data.left ?? 0) + (data.translateX ?? 0);\n        TJSTransforms.#vectorTranslate[1] = (data.top ?? 0) + (data.translateY ?? 0);\n        TJSTransforms.#vectorTranslate[2] = data.translateZ ?? 0;\n        Mat4.multiply(matrix, matrix, Mat4.fromTranslation(TJSTransforms.#mat4Temp, TJSTransforms.#vectorTranslate));\n        // Scale can also be applied out of order.\n        if (data.scale !== null && data.scale !== void 0) {\n            TJSTransforms.#vectorScale[0] = TJSTransforms.#vectorScale[1] = data.scale;\n            Mat4.multiply(matrix, matrix, Mat4.fromScaling(TJSTransforms.#mat4Temp, TJSTransforms.#vectorScale));\n        }\n        // Early out if there is no rotation data.\n        if (data.rotateX === null && data.rotateY === null && data.rotateZ === null) {\n            return matrix;\n        }\n        // Rotation transforms must be applied in the order they are added.\n        // Bitwise tracks applied transform keys from local transform data.\n        let seenKeys = 0;\n        const orderList = this.#orderList;\n        // First apply ordered transforms from local transform data.\n        for (let cntr = 0; cntr < orderList.length; cntr++) {\n            const key = orderList[cntr];\n            switch (key) {\n                case 'rotateX':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.rotateX;\n                    Mat4.multiply(matrix, matrix, Mat4.fromXRotation(TJSTransforms.#mat4Temp, degToRad(data[key] ?? 0)));\n                    break;\n                case 'rotateY':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.rotateY;\n                    Mat4.multiply(matrix, matrix, Mat4.fromYRotation(TJSTransforms.#mat4Temp, degToRad(data[key] ?? 0)));\n                    break;\n                case 'rotateZ':\n                    seenKeys |= TJSTransforms.#transformKeysBitwise.rotateZ;\n                    Mat4.multiply(matrix, matrix, Mat4.fromZRotation(TJSTransforms.#mat4Temp, degToRad(data[key] ?? 0)));\n                    break;\n            }\n        }\n        // Now apply any new keys not set in local transform data that have not been applied yet.\n        if (data !== this.#data) {\n            for (let cntr = 0; cntr < TJSTransforms.#transformKeys.length; cntr++) {\n                const key = TJSTransforms.#transformKeys[cntr];\n                // Reject bad / no data or if the key has already been applied.\n                if (data[key] === null || (seenKeys & TJSTransforms.#transformKeysBitwise[key]) > 0) {\n                    continue;\n                }\n                switch (key) {\n                    case 'rotateX':\n                        Mat4.multiply(matrix, matrix, Mat4.fromXRotation(TJSTransforms.#mat4Temp, degToRad(data[key] ?? 0)));\n                        break;\n                    case 'rotateY':\n                        Mat4.multiply(matrix, matrix, Mat4.fromYRotation(TJSTransforms.#mat4Temp, degToRad(data[key] ?? 0)));\n                        break;\n                    case 'rotateZ':\n                        Mat4.multiply(matrix, matrix, Mat4.fromZRotation(TJSTransforms.#mat4Temp, degToRad(data[key] ?? 0)));\n                        break;\n                }\n            }\n        }\n        return matrix;\n    }\n    /**\n     * Tests an object if it contains transform keys and the values are finite numbers.\n     *\n     * @param data - An object to test for transform data.\n     *\n     * @returns Whether the given TJSPositionData has transforms.\n     */\n    hasTransform(data) {\n        for (const key of TJSTransforms.#transformKeys) {\n            if (Number.isFinite(data[key])) {\n                return true;\n            }\n        }\n        return false;\n    }\n    /**\n     * Resets internal data from the given object containing valid transform keys.\n     *\n     * @param data - An object with transform data.\n     */\n    reset(data) {\n        for (const key in data) {\n            if (TJSTransforms.#isTransformKey(key)) {\n                const value = data[key];\n                if (NumberGuard.isFinite(value)) {\n                    this.#data[key] = value;\n                }\n                else {\n                    const index = this.#orderList.findIndex((entry) => entry === key);\n                    if (index >= 0) {\n                        this.#orderList.splice(index, 1);\n                    }\n                    delete this.#data[key];\n                }\n            }\n        }\n    }\n    // Internal implementation ----------------------------------------------------------------------------------------\n    /**\n     * Returns the translations necessary to translate a matrix operation based on the `transformOrigin` parameter of the\n     * given position instance. The first entry / index 0 is the pre-translation and last entry / index 1 is the post-\n     * translation.\n     *\n     * This method is used internally, but may be useful if you need the origin translation matrices to transform\n     * bespoke points based on any `transformOrigin` set in {@link TJSPositionData}.\n     *\n     * @param transformOrigin - The transform origin attribute from TJSPositionData.\n     *\n     * @param width - The TJSPositionData width or validation data width when 'auto'.\n     *\n     * @param height - The TJSPositionData height or validation data height when 'auto'.\n     *\n     * @param output - Output Mat4 array.\n     *\n     * @returns Output Mat4 array.\n     */\n    static #getOriginTranslation(transformOrigin, width, height, output) {\n        const vector = TJSTransforms.#vec3Temp;\n        switch (transformOrigin) {\n            case 'top left':\n                vector[0] = vector[1] = 0;\n                Mat4.fromTranslation(output[0], vector);\n                Mat4.fromTranslation(output[1], vector);\n                break;\n            case 'top center':\n                vector[0] = -width * 0.5;\n                vector[1] = 0;\n                Mat4.fromTranslation(output[0], vector);\n                vector[0] = width * 0.5;\n                Mat4.fromTranslation(output[1], vector);\n                break;\n            case 'top right':\n                vector[0] = -width;\n                vector[1] = 0;\n                Mat4.fromTranslation(output[0], vector);\n                vector[0] = width;\n                Mat4.fromTranslation(output[1], vector);\n                break;\n            case 'center left':\n                vector[0] = 0;\n                vector[1] = -height * 0.5;\n                Mat4.fromTranslation(output[0], vector);\n                vector[1] = height * 0.5;\n                Mat4.fromTranslation(output[1], vector);\n                break;\n            // By default, null / no transform is 'center'.\n            case null:\n            case 'center':\n                vector[0] = -width * 0.5;\n                vector[1] = -height * 0.5;\n                Mat4.fromTranslation(output[0], vector);\n                vector[0] = width * 0.5;\n                vector[1] = height * 0.5;\n                Mat4.fromTranslation(output[1], vector);\n                break;\n            case 'center right':\n                vector[0] = -width;\n                vector[1] = -height * 0.5;\n                Mat4.fromTranslation(output[0], vector);\n                vector[0] = width;\n                vector[1] = height * 0.5;\n                Mat4.fromTranslation(output[1], vector);\n                break;\n            case 'bottom left':\n                vector[0] = 0;\n                vector[1] = -height;\n                Mat4.fromTranslation(output[0], vector);\n                vector[1] = height;\n                Mat4.fromTranslation(output[1], vector);\n                break;\n            case 'bottom center':\n                vector[0] = -width * 0.5;\n                vector[1] = -height;\n                Mat4.fromTranslation(output[0], vector);\n                vector[0] = width * 0.5;\n                vector[1] = height;\n                Mat4.fromTranslation(output[1], vector);\n                break;\n            case 'bottom right':\n                vector[0] = -width;\n                vector[1] = -height;\n                Mat4.fromTranslation(output[0], vector);\n                vector[0] = width;\n                vector[1] = height;\n                Mat4.fromTranslation(output[1], vector);\n                break;\n            // No valid transform origin parameter; set identity.\n            default:\n                Mat4.identity(output[0]);\n                Mat4.identity(output[1]);\n                break;\n        }\n        return output;\n    }\n}\n\nclass AnimationScheduler {\n    /**\n     * Used to copy data from a TJSPosition instance.\n     */\n    static #data = {};\n    static #getEaseOptions = Object.freeze({ default: false });\n    /**\n     * Adds / schedules an animation w/ the AnimationManager. This contains the final steps common to all tweens.\n     *\n     * @param position -\n     *\n     * @param initial -\n     *\n     * @param destination -\n     *\n     * @param duration -\n     *\n     * @param el -\n     *\n     * @param delay -\n     *\n     * @param ease -\n     *\n     * @param [interpolate=lerp] -\n     *\n     * @param [transformOrigin] -\n     *\n     * @param [transformOriginInitial] -\n     *\n     * @param [cleanup] -\n     *\n     * @returns An AnimationControl instance or null if none created.\n     */\n    static #addAnimation(position, initial, destination, duration, el, delay, ease, interpolate = lerp, transformOrigin, transformOriginInitial, cleanup) {\n        // Set initial data for transform values that are often null by default.\n        TJSPositionDataUtil.setNumericDefaults(initial);\n        TJSPositionDataUtil.setNumericDefaults(destination);\n        // Reject all initial data that is not a number.\n        for (const key in initial) {\n            if (!Number.isFinite(initial[key])) {\n                delete initial[key];\n            }\n        }\n        const keys = Object.keys(initial);\n        const newData = Object.assign({}, initial);\n        // Nothing to animate, so return now.\n        // TODO handle in respective animation controls.\n        if (keys.length === 0) {\n            return null;\n        }\n        /**\n         */\n        const animationData = {\n            active: true,\n            cleanup,\n            cancelled: false,\n            control: void 0,\n            current: 0,\n            destination,\n            duration: duration * 1000, // Internally the AnimationManager works in ms.\n            ease,\n            el,\n            finished: false,\n            initial,\n            interpolate,\n            keys,\n            newData,\n            position,\n            resolve: void 0,\n            start: void 0,\n            transformOrigin,\n            transformOriginInitial,\n            quickTo: false\n        };\n        if (delay > 0) {\n            animationData.active = false;\n            // Delay w/ setTimeout and make active w/ AnimationManager.\n            setTimeout(() => animationData.active = true, delay * 1000);\n        }\n        // Schedule immediately w/ AnimationManager\n        AnimationManager.add(animationData);\n        // Create animation control\n        return new AnimationControl(animationData, true);\n    }\n    /**\n     * Provides a tween from given position data to the current position.\n     *\n     * @param position - The target position instance.\n     *\n     * @param fromData - The starting position.\n     *\n     * @param options - Tween options.\n     *\n     * @param [cleanup] - Custom animation cleanup function.\n     *\n     * @returns An AnimationControl instance or null if none created.\n     */\n    static from(position, fromData, options = {}, cleanup) {\n        if (!isObject(fromData)) {\n            throw new TypeError(`AnimationAPI.from error: 'fromData' is not an object.`);\n        }\n        // TJSPositionNS.PositionParent\n        const parent = position.parent;\n        // Early out if the application is not positionable.  TODO: THIS IS REFERENCING APPLICATION OPTIONS.\n        if (parent !== void 0 && typeof parent?.options?.positionable === 'boolean' && !parent?.options?.positionable) {\n            return null;\n        }\n        let { delay = 0, duration = 1, ease = 'cubicOut', strategy, transformOrigin } = options;\n        // Handle any defined scheduling strategy.\n        if (strategy !== void 0) {\n            if (this.#handleStrategy(position, strategy) === null) {\n                return null;\n            }\n        }\n        // Cache any target element allowing AnimationManager to stop animation if it becomes disconnected from DOM.\n        const targetEl = A11yHelper.isFocusTarget(parent) ? parent : parent?.elementTarget;\n        const el = A11yHelper.isFocusTarget(targetEl) && targetEl.isConnected ? targetEl :\n            void 0;\n        if (!Number.isFinite(delay) || delay < 0) {\n            throw new TypeError(`AnimationScheduler.from error: 'delay' is not a positive number.`);\n        }\n        if (!Number.isFinite(duration) || duration < 0) {\n            throw new TypeError(`AnimationScheduler.from error: 'duration' is not a positive number.`);\n        }\n        ease = getEasingFunc(ease, this.#getEaseOptions);\n        if (typeof ease !== 'function') {\n            throw new TypeError(`AnimationScheduler.from error: 'ease' is not a function or valid Svelte easing function name.`);\n        }\n        // TODO: In the future potentially support more interpolation functions besides `lerp`.\n        const initial = {};\n        const destination = {};\n        position.get(this.#data);\n        // Determine if any transform origin for the animation is valid.\n        transformOrigin = TJSTransforms.isTransformOrigin(transformOrigin) ? transformOrigin : void 0;\n        // Given a valid transform origin store the initial transform origin to be restored.\n        const transformOriginInitial = transformOrigin !== void 0 ?\n            this.#data.transformOrigin : void 0;\n        // Set initial data if the key / data is defined and the end position is not equal to current data.\n        for (const key in fromData) {\n            // Must use actual key from any aliases.\n            const animKey = TJSPositionDataUtil.getAnimationKey(key);\n            if (this.#data[animKey] !== void 0 && fromData[key] !== this.#data[animKey]) {\n                initial[key] = fromData[key];\n                destination[key] = this.#data[animKey];\n            }\n        }\n        ConvertStringData.process(initial, this.#data, el);\n        return this.#addAnimation(position, initial, destination, duration, el, delay, ease, lerp, transformOrigin, transformOriginInitial, cleanup);\n    }\n    /**\n     * Provides a tween from given position data to the given position.\n     *\n     * @param position - The target position instance.\n     *\n     * @param fromData - The starting position.\n     *\n     * @param toData - The ending position.\n     *\n     * @param options - Tween options.\n     *\n     * @param [cleanup] - Custom animation cleanup function.\n     *\n     * @returns An AnimationControl instance or null if none created.\n     */\n    static fromTo(position, fromData, toData, options = {}, cleanup) {\n        if (!isObject(fromData)) {\n            throw new TypeError(`AnimationScheduler.fromTo error: 'fromData' is not an object.`);\n        }\n        if (!isObject(toData)) {\n            throw new TypeError(`AnimationScheduler.fromTo error: 'toData' is not an object.`);\n        }\n        // TJSPositionNS.PositionParent\n        const parent = position.parent;\n        // Early out if the application is not positionable.  TODO: THIS IS REFERENCING APPLICATION OPTIONS.\n        if (parent !== void 0 && typeof parent?.options?.positionable === 'boolean' && !parent?.options?.positionable) {\n            return null;\n        }\n        let { delay = 0, duration = 1, ease = 'cubicOut', strategy, transformOrigin } = options;\n        // Handle any defined scheduling strategy.\n        if (strategy !== void 0) {\n            if (this.#handleStrategy(position, strategy) === null) {\n                return null;\n            }\n        }\n        // Cache any target element allowing AnimationManager to stop animation if it becomes disconnected from DOM.\n        const targetEl = A11yHelper.isFocusTarget(parent) ? parent : parent?.elementTarget;\n        const el = A11yHelper.isFocusTarget(targetEl) && targetEl.isConnected ? targetEl :\n            void 0;\n        if (!Number.isFinite(delay) || delay < 0) {\n            throw new TypeError(`AnimationScheduler.fromTo error: 'delay' is not a positive number.`);\n        }\n        if (!Number.isFinite(duration) || duration < 0) {\n            throw new TypeError(`AnimationScheduler.fromTo error: 'duration' is not a positive number.`);\n        }\n        ease = getEasingFunc(ease, this.#getEaseOptions);\n        if (typeof ease !== 'function') {\n            throw new TypeError(`AnimationScheduler.fromTo error: 'ease' is not a function or valid Svelte easing function name.`);\n        }\n        // TODO: In the future potentially support more interpolation functions besides `lerp`.\n        const initial = {};\n        const destination = {};\n        position.get(this.#data);\n        // Determine if any transform origin for the animation is valid.\n        transformOrigin = TJSTransforms.isTransformOrigin(transformOrigin) ? transformOrigin : void 0;\n        // Given a valid transform origin store the initial transform origin to be restored.\n        const transformOriginInitial = transformOrigin !== void 0 ?\n            this.#data.transformOrigin : void 0;\n        // Set initial data if the key / data is defined and the end position is not equal to current data.\n        for (const key in fromData) {\n            if (toData[key] === void 0) {\n                console.warn(`AnimationScheduler.fromTo warning: skipping key ('${key}') from 'fromData' as it is missing in 'toData'.`);\n                continue;\n            }\n            // Must use actual key from any aliases.\n            const animKey = TJSPositionDataUtil.getAnimationKey(key);\n            if (this.#data[animKey] !== void 0) {\n                initial[key] = fromData[key];\n                destination[key] = toData[key];\n            }\n        }\n        ConvertStringData.process(initial, this.#data, el);\n        ConvertStringData.process(destination, this.#data, el);\n        return this.#addAnimation(position, initial, destination, duration, el, delay, ease, lerp, transformOrigin, transformOriginInitial, cleanup);\n    }\n    /**\n     * Provides a tween to given position data from the current position.\n     *\n     * @param position - The target position instance.\n     *\n     * @param toData - The destination position.\n     *\n     * @param options - Tween options.\n     *\n     * @param [cleanup] - Custom animation cleanup function.\n     *\n     * @returns An AnimationControl instance or null if none created.\n     */\n    static to(position, toData, options, cleanup) {\n        if (!isObject(toData)) {\n            throw new TypeError(`AnimationScheduler.to error: 'toData' is not an object.`);\n        }\n        // TJSPositionNS.PositionParent\n        const parent = position.parent;\n        // Early out if the application is not positionable.  TODO: THIS IS REFERENCING APPLICATION OPTIONS.\n        if (parent !== void 0 && typeof parent?.options?.positionable === 'boolean' && !parent?.options?.positionable) {\n            return null;\n        }\n        let { delay = 0, duration = 1, ease = 'cubicOut', strategy, transformOrigin } = options;\n        // Handle any defined scheduling strategy.\n        if (strategy !== void 0) {\n            if (this.#handleStrategy(position, strategy) === null) {\n                return null;\n            }\n        }\n        // Cache any target element allowing AnimationManager to stop animation if it becomes disconnected from DOM.\n        const targetEl = A11yHelper.isFocusTarget(parent) ? parent : parent?.elementTarget;\n        const el = A11yHelper.isFocusTarget(targetEl) && targetEl.isConnected ? targetEl : void 0;\n        if (!Number.isFinite(delay) || delay < 0) {\n            throw new TypeError(`AnimationScheduler.to error: 'delay' is not a positive number.`);\n        }\n        if (!Number.isFinite(duration) || duration < 0) {\n            throw new TypeError(`AnimationScheduler.to error: 'duration' is not a positive number.`);\n        }\n        ease = getEasingFunc(ease, this.#getEaseOptions);\n        if (typeof ease !== 'function') {\n            throw new TypeError(`AnimationScheduler.to error: 'ease' is not a function or valid Svelte easing function name.`);\n        }\n        // TODO: In the future potentially support more interpolation functions besides `lerp`.\n        const initial = {};\n        const destination = {};\n        position.get(this.#data);\n        // Determine if any transform origin for the animation is valid.\n        transformOrigin = TJSTransforms.isTransformOrigin(transformOrigin) ? transformOrigin : void 0;\n        // Given a valid transform origin store the initial transform origin to be restored.\n        const transformOriginInitial = transformOrigin !== void 0 ?\n            this.#data.transformOrigin : void 0;\n        // Set initial data if the key / data is defined and the end position is not equal to current data.\n        for (const key in toData) {\n            // Must use actual key from any aliases.\n            const animKey = TJSPositionDataUtil.getAnimationKey(key);\n            if (this.#data[animKey] !== void 0 && toData[key] !== this.#data[animKey]) {\n                destination[key] = toData[key];\n                initial[key] = this.#data[animKey];\n            }\n        }\n        ConvertStringData.process(destination, this.#data, el);\n        return this.#addAnimation(position, initial, destination, duration, el, delay, ease, lerp, transformOrigin, transformOriginInitial, cleanup);\n    }\n    // Internal implementation ----------------------------------------------------------------------------------------\n    /**\n     * Handle any defined scheduling strategy allowing existing scheduled animations for the same position instance\n     * to be controlled.\n     *\n     * @param position - The target position instance.\n     *\n     * @param strategy - A scheduling strategy to apply.\n     *\n     * @returns Returns null to abort scheduling current animation.\n     */\n    static #handleStrategy(position, strategy) {\n        switch (strategy) {\n            case 'cancel':\n                if (AnimationManager.isScheduled(position)) {\n                    AnimationManager.cancel(position);\n                }\n                break;\n            case 'cancelAll':\n                if (AnimationManager.isScheduled(position)) {\n                    AnimationManager.cancel(position, AnimationManager.cancelAllFn);\n                }\n                break;\n            case 'exclusive':\n                if (AnimationManager.isScheduled(position)) {\n                    return null;\n                }\n                break;\n            default:\n                console.warn(`AnimationScheduler error: 'strategy' is not 'cancel', 'cancelAll', or 'exclusive'.`);\n                return null;\n        }\n    }\n}\n\n/**\n */\nclass AnimationAPIImpl {\n    static #getEaseOptions = Object.freeze({ default: false });\n    /**\n     */\n    #data;\n    #position;\n    /**\n     * @param position -\n     *\n     * @param data -\n     */\n    constructor(position, data) {\n        this.#position = position;\n        this.#data = data;\n        Object.seal(this);\n    }\n    /**\n     * Returns if there are scheduled animations whether active or pending for this TJSPosition instance.\n     *\n     * @returns Are there scheduled animations.\n     */\n    get isScheduled() {\n        return AnimationManager.isScheduled(this.#position);\n    }\n    /**\n     * Cancels all animation instances for this TJSPosition instance.\n     */\n    cancel() {\n        AnimationManager.cancel(this.#position, AnimationManager.cancelAllFn);\n    }\n    /**\n     * Returns all currently scheduled AnimationControl instances for this TJSPosition instance.\n     *\n     * @returns All currently scheduled animation controls for this TJSPosition instance.\n     */\n    getScheduled() {\n        return AnimationManager.getScheduled(this.#position);\n    }\n    /**\n     * Provides a tween from given position data to the current position.\n     *\n     * @param fromData - The starting position.\n     *\n     * @param [options] - Optional tween parameters.\n     *\n     * @returns A control object that can cancel animation and provides a `finished` Promise.\n     */\n    from(fromData, options) {\n        const animationControl = AnimationScheduler.from(this.#position, fromData, options);\n        return animationControl ? animationControl : AnimationControl.voidControl;\n    }\n    /**\n     * Provides a tween from given position data to the given position.\n     *\n     * @param fromData - The starting position.\n     *\n     * @param toData - The ending position.\n     *\n     * @param [options] - Optional tween parameters.\n     *\n     * @returns A control object that can cancel animation and provides a `finished` Promise.\n     */\n    fromTo(fromData, toData, options) {\n        const animationControl = AnimationScheduler.fromTo(this.#position, fromData, toData, options);\n        return animationControl ? animationControl : AnimationControl.voidControl;\n    }\n    /**\n     * Provides a tween to given position data from the current position.\n     *\n     * @param toData - The destination position.\n     *\n     * @param [options] - Optional tween parameters.\n     *\n     * @returns A control object that can cancel animation and provides a `finished` Promise.\n     */\n    to(toData, options) {\n        const animationControl = AnimationScheduler.to(this.#position, toData, options);\n        return animationControl ? animationControl : AnimationControl.voidControl;\n    }\n    /**\n     * Returns a function that provides an optimized way to constantly update a to-tween.\n     *\n     * @param keys - The keys for quickTo.\n     *\n     * @param [options] - Optional quick tween parameters.\n     *\n     * @returns quick-to tween function.\n     */\n    quickTo(keys, options = {}) {\n        if (!isIterable(keys)) {\n            throw new TypeError(`AnimationAPI.quickTo error: 'keys' is not an iterable list.`);\n        }\n        // TJSPosition.PositionParent\n        const parent = this.#position.parent;\n        // Early out if the application is not positionable.\n        if (parent !== void 0 && typeof parent?.options?.positionable === 'boolean' && !parent?.options?.positionable) {\n            throw new Error(`AnimationAPI.quickTo error: 'parent' is not positionable.`);\n        }\n        let { duration = 1, ease = 'cubicOut' } = options;\n        if (!Number.isFinite(duration) || duration < 0) {\n            throw new TypeError(`AnimationAPI.quickTo error: 'duration' is not a positive number.`);\n        }\n        ease = getEasingFunc(ease, AnimationAPIImpl.#getEaseOptions);\n        if (typeof ease !== 'function') {\n            throw new TypeError(`AnimationAPI.quickTo error: 'ease' is not a function or valid Svelte easing function name.`);\n        }\n        // TODO: In the future potentially support more interpolation functions besides `lerp`.\n        const initial = {};\n        const destination = {};\n        const data = this.#data;\n        // Set initial data if the key / data is defined and the end position is not equal to current data.\n        for (const key of keys) {\n            if (typeof key !== 'string') {\n                throw new TypeError(`AnimationAPI.quickTo error: key ('${key}') is not a string.`);\n            }\n            if (!TJSPositionDataUtil.isAnimationKey(key)) {\n                throw new Error(`AnimationAPI.quickTo error: key ('${key}') is not animatable.`);\n            }\n            // Must use actual key from any aliases.\n            const value = TJSPositionDataUtil.getDataOrDefault(data, key);\n            if (value !== null) {\n                destination[key] = value;\n                initial[key] = value;\n            }\n        }\n        const keysArray = [...keys];\n        Object.freeze(keysArray);\n        const newData = Object.assign({}, initial);\n        const animationData = {\n            active: true,\n            cancelled: false,\n            control: void 0,\n            current: 0,\n            destination,\n            duration: duration * 1000, // Internally the AnimationManager works in ms.\n            ease,\n            el: void 0,\n            finished: true, // Note: start in finished state to add to AnimationManager on first callback.\n            initial,\n            interpolate: lerp,\n            keys: keysArray,\n            newData,\n            position: this.#position,\n            resolve: void 0,\n            start: 0,\n            quickTo: true\n        };\n        const quickToCB = (...args) => {\n            const argsLength = args.length;\n            if (argsLength === 0) {\n                return;\n            }\n            for (let cntr = keysArray.length; --cntr >= 0;) {\n                const key = keysArray[cntr];\n                // Must use actual key from any aliases.\n                const animKey = TJSPositionDataUtil.getAnimationKey(key);\n                if (data[animKey] !== void 0) {\n                    initial[key] = data[animKey];\n                }\n            }\n            // Handle case where the first arg is an object. Update all quickTo keys from data contained in the object.\n            if (isObject(args[0])) {\n                const objData = args[0];\n                for (const key in objData) {\n                    if (destination[key] !== void 0) {\n                        destination[key] = objData[key];\n                    }\n                }\n            }\n            else // Assign each variable argument to the key specified in the initial `keys` array above.\n             {\n                for (let cntr = 0; cntr < argsLength && cntr < keysArray.length; cntr++) {\n                    const key = keysArray[cntr];\n                    if (destination[key] !== void 0) {\n                        destination[key] = args[cntr];\n                    }\n                }\n            }\n            // Set initial data for transform values that are often null by default.\n            TJSPositionDataUtil.setNumericDefaults(initial);\n            TJSPositionDataUtil.setNumericDefaults(destination);\n            // Set target element to animation data to track if it is removed from the DOM hence ending the animation.\n            const targetEl = A11yHelper.isFocusTarget(parent) ? parent : parent?.elementTarget;\n            animationData.el = A11yHelper.isFocusTarget(targetEl) && targetEl.isConnected ? targetEl : void 0;\n            ConvertStringData.process(destination, data, animationData.el);\n            // Reschedule the quickTo animation with AnimationManager as it is finished.\n            if (animationData.finished) {\n                animationData.cancelled = false;\n                animationData.finished = false;\n                animationData.active = true;\n                animationData.current = 0;\n                AnimationManager.add(animationData);\n            }\n            else // QuickTo animation is currently scheduled w/ AnimationManager so reset start and current time.\n             {\n                const now = globalThis.performance.now();\n                animationData.cancelled = false;\n                animationData.current = 0;\n                // Offset start time by delta between last rAF time. This allows a delayed tween to start from the\n                // precise delayed time.\n                animationData.start = now + (AnimationManager.timeNow - now);\n            }\n        };\n        Object.defineProperty(quickToCB, 'keys', {\n            value: keysArray,\n            writable: false,\n            configurable: false\n        });\n        Object.defineProperty(quickToCB, 'options', {\n            value: (optionsCB) => {\n                let { duration, ease } = optionsCB;\n                if (duration !== void 0 && (!Number.isFinite(duration) || duration < 0)) {\n                    throw new TypeError(`AnimationAPI.quickTo.options error: 'duration' is not a positive number.`);\n                }\n                ease = getEasingFunc(ease, AnimationAPIImpl.#getEaseOptions);\n                if (ease !== void 0 && typeof ease !== 'function') {\n                    throw new TypeError(`AnimationAPI.quickTo.options error: 'ease' is not a function or valid Svelte easing function name.`);\n                }\n                // TODO: In the future potentially support more interpolation functions besides `lerp`.\n                if (NumberGuard.isFinite(duration) && duration >= 0) {\n                    animationData.duration = duration * 1000;\n                }\n                if (ease) {\n                    animationData.ease = ease;\n                }\n                return quickToCB;\n            },\n            writable: false,\n            configurable: false\n        });\n        return quickToCB;\n    }\n}\n\n/**\n * Provides a implementation for a TJSPosition animation for a group of TJSPosition instances.\n */\nclass AnimationGroupControl {\n    /**\n     */\n    #animationControls;\n    /**\n     */\n    #finishedPromise;\n    /**\n     * Defines a static empty / void animation control.\n     */\n    static #voidControl = new AnimationGroupControl(null);\n    /**\n     * Provides a static void / undefined AnimationGroupControl that is automatically resolved.\n     */\n    static get voidControl() { return this.#voidControl; }\n    /**\n     * @param animationControls - A Set of AnimationControl instances.\n     */\n    constructor(animationControls) {\n        this.#animationControls = animationControls;\n    }\n    /**\n     * Get a promise that resolves when all animations are finished.\n     *\n     * @returns Finished Promise for all animations.\n     */\n    get finished() {\n        const animationControls = this.#animationControls;\n        if (!CrossWindow.isPromise(this.#finishedPromise)) {\n            if (animationControls === null || animationControls === void 0 || animationControls.size === 0) {\n                this.#finishedPromise = Promise.resolve({ cancelled: false });\n            }\n            else {\n                const promises = [];\n                for (const animationControl of animationControls) {\n                    promises.push(animationControl.finished);\n                }\n                this.#finishedPromise = Promise.allSettled(promises).then((results) => {\n                    // Check if any promises were rejected or resolved with `cancelled: true`.\n                    const anyCancelled = results.some((result) => result.status === 'rejected' ||\n                        (result.status === 'fulfilled' && result.value.cancelled));\n                    // Return a single BasicAnimationState based on the aggregation of individual results.\n                    return { cancelled: anyCancelled };\n                });\n            }\n        }\n        return this.#finishedPromise;\n    }\n    /**\n     * Returns whether there are active animation instances for this group.\n     *\n     * Note: a delayed animation may not be started / active yet. Use {@link AnimationGroupControl.isFinished} to\n     * determine if all animations in the group are finished.\n     *\n     * @returns Are there active animation instances.\n     */\n    get isActive() {\n        const animationControls = this.#animationControls;\n        if (animationControls === null || animationControls === void 0 || animationControls.size === 0) {\n            return false;\n        }\n        for (const animationControl of animationControls) {\n            if (animationControl.isActive) {\n                return true;\n            }\n        }\n        return false;\n    }\n    /**\n     * Returns whether all animations in the group are finished.\n     *\n     * @returns Are all animation instances finished.\n     */\n    get isFinished() {\n        const animationControls = this.#animationControls;\n        if (animationControls === null || animationControls === void 0 || animationControls.size === 0) {\n            return true;\n        }\n        for (const animationControl of animationControls) {\n            if (!animationControl.isFinished) {\n                return false;\n            }\n        }\n        return true;\n    }\n    /**\n     * Cancels the all animations.\n     */\n    cancel() {\n        const animationControls = this.#animationControls;\n        if (animationControls === null || animationControls === void 0 || animationControls.size === 0) {\n            return;\n        }\n        for (const animationControl of animationControls) {\n            animationControl.cancel();\n        }\n    }\n}\n\n/**\n * Provides a public API for grouping multiple {@link TJSPosition} animations together with the\n * AnimationManager.\n *\n * Note: To remove cyclic dependencies as this class provides the TJSPosition static / group Animation API `instanceof`\n * checks are not done against TJSPosition. Instead, a check for the animate property being an instanceof\n * {@link AnimationAPI} is performed in {@link AnimationGroupAPI.#getPosition}.\n *\n * Note: This is a static class that conforms to the {@link AnimationGroupAPI} interface.\n *\n * @see AnimationAPI\n */\nclass AnimationGroupAPIImpl {\n    constructor() { }\n    /**\n     * Returns the TJSPosition instance for the possible given positionable by checking the instance by checking for\n     * AnimationAPI.\n     *\n     * @param positionable - Possible position group entry.\n     *\n     * @returns Returns actual TJSPosition instance.\n     */\n    static #getPosition(positionable) {\n        if (!isObject(positionable)) {\n            return null;\n        }\n        if (positionable.animate instanceof AnimationAPIImpl) {\n            return positionable;\n        }\n        if (positionable.position?.animate instanceof AnimationAPIImpl) {\n            return positionable.position;\n        }\n        return null;\n    }\n    /**\n     * Cancels any animation for given TJSPosition.PositionGroup data.\n     *\n     * @param positionGroup - The position group to cancel.\n     */\n    static cancel(positionGroup) {\n        if (isIterable(positionGroup)) {\n            let index = -1;\n            for (const entry of positionGroup) {\n                index++;\n                const actualPosition = this.#getPosition(entry);\n                if (!actualPosition) {\n                    console.warn(`AnimationGroupAPI.cancel warning: No TJSPosition instance found at index: ${index}.`);\n                    continue;\n                }\n                AnimationManager.cancel(actualPosition);\n            }\n        }\n        else {\n            const actualPosition = this.#getPosition(positionGroup);\n            if (!actualPosition) {\n                console.warn(`AnimationGroupAPI.cancel warning: No TJSPosition instance found.`);\n                return;\n            }\n            AnimationManager.cancel(actualPosition);\n        }\n    }\n    /**\n     * Cancels all TJSPosition animation.\n     */\n    static cancelAll() { AnimationManager.cancelAll(); }\n    /**\n     * Gets all animation controls for the given position group data.\n     *\n     * @param positionGroup - A position group.\n     *\n     * @returns Results array.\n     */\n    static getScheduled(positionGroup) {\n        const results = [];\n        if (isIterable(positionGroup)) {\n            let index = -1;\n            for (const entry of positionGroup) {\n                index++;\n                const actualPosition = this.#getPosition(entry);\n                if (!actualPosition) {\n                    console.warn(`AnimationGroupAPI.getScheduled warning: No TJSPosition instance found at index: ${index}.`);\n                    continue;\n                }\n                const controls = AnimationManager.getScheduled(actualPosition);\n                results.push({\n                    position: actualPosition,\n                    entry: actualPosition !== entry ? entry : void 0,\n                    controls\n                });\n            }\n        }\n        else {\n            const actualPosition = this.#getPosition(positionGroup);\n            if (!actualPosition) {\n                console.warn(`AnimationGroupAPI.getScheduled warning: No TJSPosition instance found.`);\n                return results;\n            }\n            const controls = AnimationManager.getScheduled(actualPosition);\n            results.push({\n                position: actualPosition,\n                entry: actualPosition !== positionGroup ? positionGroup : void 0,\n                controls\n            });\n        }\n        return results;\n    }\n    /**\n     * Provides a type guard to test in the given key is an {@link AnimationAPIImpl.AnimationKey}.\n     *\n     * @param key - A key value to test.\n     *\n     * @returns Whether the given key is an animation key.\n     */\n    static isAnimationKey(key) {\n        return TJSPositionDataUtil.isAnimationKey(key);\n    }\n    /**\n     * Returns the status _for the entire position group_ specified if all position instances of the group are scheduled.\n     *\n     * @param positionGroup - A position group.\n     *\n     * @param [options] - Options.\n     *\n     * @returns True if all are scheduled / false if just one position instance in the group is not scheduled.\n     */\n    static isScheduled(positionGroup, options) {\n        if (isIterable(positionGroup)) {\n            let index = -1;\n            for (const entry of positionGroup) {\n                index++;\n                const actualPosition = this.#getPosition(entry);\n                if (!actualPosition) {\n                    console.warn(`AnimationGroupAPI.isScheduled warning: No TJSPosition instance found at index: ${index}.`);\n                    continue;\n                }\n                if (!AnimationManager.isScheduled(actualPosition, options)) {\n                    return false;\n                }\n            }\n        }\n        else {\n            const actualPosition = this.#getPosition(positionGroup);\n            if (!actualPosition) {\n                console.warn(`AnimationGroupAPI.isScheduled warning: No TJSPosition instance found.`);\n                return false;\n            }\n            if (!AnimationManager.isScheduled(actualPosition, options)) {\n                return false;\n            }\n        }\n        return true;\n    }\n    /**\n     * Provides the `from` animation tween for one or more positionable instances as a group.\n     *\n     * @param positionGroup - A position group.\n     *\n     * @param fromData - A position data object assigned to all positionable instances or a callback function invoked for\n     *        unique data for each instance.\n     *\n     * @param [options] - Tween options assigned to all positionable instances or a callback function invoked for unique\n     *        options for each instance.\n     *\n     * @returns Basic animation control.\n     */\n    static from(positionGroup, fromData, options) {\n        if (!isObject(fromData) && typeof fromData !== 'function') {\n            throw new TypeError(`AnimationGroupAPI.from error: 'fromData' is not an object or function.`);\n        }\n        if (options !== void 0 && !isObject(options) && typeof options !== 'function') {\n            throw new TypeError(`AnimationGroupAPI.from error: 'options' is not an object or function.`);\n        }\n        /**\n         */\n        const animationControls = new Set();\n        /**\n         */\n        const cleanupFn = (data) => animationControls.delete(data.control);\n        let index = -1;\n        /**\n         */\n        let callbackOptions;\n        const hasDataCallback = typeof fromData === 'function';\n        const hasOptionCallback = typeof options === 'function';\n        const hasCallback = hasDataCallback || hasOptionCallback;\n        if (hasCallback) {\n            callbackOptions = { index, position: void 0, entry: void 0 };\n        }\n        let actualFromData = fromData;\n        let actualOptions = isObject(options) ? options : void 0;\n        if (isIterable(positionGroup)) {\n            for (const entry of positionGroup) {\n                index++;\n                const actualPosition = this.#getPosition(entry);\n                if (!actualPosition) {\n                    console.warn(`AnimationGroupAPI.from warning: No TJSPosition instance found at index: ${index}.`);\n                    continue;\n                }\n                if (hasCallback) {\n                    callbackOptions.index = index;\n                    callbackOptions.position = actualPosition;\n                    callbackOptions.entry = actualPosition !== entry ? entry : void 0;\n                }\n                if (hasDataCallback && typeof fromData === 'function') {\n                    actualFromData = fromData(callbackOptions);\n                    // Returned data from callback is null / undefined, so skip this position instance.\n                    if (actualFromData === null || actualFromData === void 0) {\n                        continue;\n                    }\n                    if (!isObject(actualFromData)) {\n                        throw new TypeError(`AnimationGroupAPI.from error: 'fromData' callback function iteration(${index}) failed to return an object.`);\n                    }\n                }\n                if (hasOptionCallback && typeof options === 'function') {\n                    actualOptions = options(callbackOptions);\n                    // Returned data from callback is null / undefined, so skip this position instance.\n                    if (actualOptions === null || actualOptions === void 0) {\n                        continue;\n                    }\n                    if (!isObject(actualOptions)) {\n                        throw new TypeError(`AnimationGroupAPI.from error: 'options' callback function iteration(${index}) failed to return an object.`);\n                    }\n                }\n                const animationControl = AnimationScheduler.from(actualPosition, actualFromData, actualOptions, cleanupFn);\n                if (animationControl) {\n                    animationControls.add(animationControl);\n                }\n            }\n        }\n        else {\n            const actualPosition = this.#getPosition(positionGroup);\n            if (!actualPosition) {\n                console.warn(`AnimationGroupAPI.from warning: No TJSPosition instance found.`);\n                return AnimationGroupControl.voidControl;\n            }\n            if (hasCallback) {\n                callbackOptions.index = 0;\n                callbackOptions.position = actualPosition;\n                callbackOptions.entry = actualPosition !== positionGroup ? positionGroup :\n                    void 0;\n            }\n            if (hasDataCallback && typeof fromData === 'function') {\n                actualFromData = fromData(callbackOptions);\n                // Returned data from callback is null / undefined, so skip this position instance.\n                if (actualFromData === null || actualFromData === void 0) {\n                    return AnimationGroupControl.voidControl;\n                }\n                if (!isObject(actualFromData)) {\n                    throw new TypeError(`AnimationGroupAPI.from error: 'fromData' callback function failed to return an object.`);\n                }\n            }\n            if (hasOptionCallback && typeof options === 'function') {\n                actualOptions = options(callbackOptions);\n                // Returned data from callback is null / undefined, so skip this position instance.\n                if (actualOptions === null || actualOptions === void 0) {\n                    return AnimationGroupControl.voidControl;\n                }\n                if (!isObject(actualOptions)) {\n                    throw new TypeError(`AnimationGroupAPI.from error: 'options' callback function failed to return an object.`);\n                }\n            }\n            const animationControl = AnimationScheduler.from(actualPosition, actualFromData, actualOptions, cleanupFn);\n            if (animationControl) {\n                animationControls.add(animationControl);\n            }\n        }\n        return new AnimationGroupControl(animationControls);\n    }\n    /**\n     * Provides the `fromTo` animation tween for one or more positionable instances as a group.\n     *\n     * @param positionGroup - A position group.\n     *\n     * @param fromData - A position data object assigned to all positionable instances or a callback function invoked for\n     *        unique data for each instance.\n     *\n     * @param toData - A position data object assigned to all positionable instances or a callback function invoked for\n     *        unique data for each instance.\n     *\n     * @param [options] - Tween options assigned to all positionable instances or a callback function invoked for unique\n     *        options for each instance.\n     *\n     * @returns Basic animation control.\n     */\n    static fromTo(positionGroup, fromData, toData, options) {\n        if (!isObject(fromData) && typeof fromData !== 'function') {\n            throw new TypeError(`AnimationGroupAPI.fromTo error: 'fromData' is not an object or function.`);\n        }\n        if (!isObject(toData) && typeof toData !== 'function') {\n            throw new TypeError(`AnimationGroupAPI.fromTo error: 'toData' is not an object or function.`);\n        }\n        if (options !== void 0 && !isObject(options) && typeof options !== 'function') {\n            throw new TypeError(`AnimationGroupAPI.fromTo error: 'options' is not an object or function.`);\n        }\n        const animationControls = new Set();\n        /**\n         */\n        const cleanupFn = (data) => animationControls.delete(data.control);\n        let index = -1;\n        /**\n         */\n        let callbackOptions;\n        const hasFromCallback = typeof fromData === 'function';\n        const hasToCallback = typeof toData === 'function';\n        const hasOptionCallback = typeof options === 'function';\n        const hasCallback = hasFromCallback || hasToCallback || hasOptionCallback;\n        if (hasCallback) {\n            callbackOptions = { index, position: void 0, entry: void 0 };\n        }\n        let actualFromData = fromData;\n        let actualToData = toData;\n        let actualOptions = isObject(options) ? options : void 0;\n        if (isIterable(positionGroup)) {\n            for (const entry of positionGroup) {\n                index++;\n                const actualPosition = this.#getPosition(entry);\n                if (!actualPosition) {\n                    console.warn(`AnimationGroupAPI.fromTo warning: No TJSPosition instance found at index: ${index}.`);\n                    continue;\n                }\n                if (hasCallback) {\n                    callbackOptions.index = index;\n                    callbackOptions.position = actualPosition;\n                    callbackOptions.entry = actualPosition !== entry ? entry : void 0;\n                }\n                if (hasFromCallback && typeof fromData === 'function') {\n                    actualFromData = fromData(callbackOptions);\n                    // Returned data from callback is null / undefined, so skip this position instance.\n                    if (actualFromData === null || actualFromData === void 0) {\n                        continue;\n                    }\n                    if (!isObject(actualFromData)) {\n                        throw new TypeError(`AnimationGroupAPI.fromTo error: 'fromData' callback function iteration(${index}) failed to return an object.`);\n                    }\n                }\n                if (hasToCallback && typeof toData === 'function') {\n                    actualToData = toData(callbackOptions);\n                    // Returned data from callback is null / undefined, so skip this position instance.\n                    if (actualToData === null || actualToData === void 0) {\n                        continue;\n                    }\n                    if (!isObject(actualToData)) {\n                        throw new TypeError(`AnimationGroupAPI.fromTo error: 'toData' callback function iteration(${index}) failed to return an object.`);\n                    }\n                }\n                if (hasOptionCallback && typeof options === 'function') {\n                    actualOptions = options(callbackOptions);\n                    // Returned data from callback is null / undefined, so skip this position instance.\n                    if (actualOptions === null || actualOptions === void 0) {\n                        continue;\n                    }\n                    if (!isObject(actualOptions)) {\n                        throw new TypeError(`AnimationGroupAPI.fromTo error: 'options' callback function iteration(${index}) failed to return an object.`);\n                    }\n                }\n                const animationControl = AnimationScheduler.fromTo(actualPosition, actualFromData, actualToData, actualOptions, cleanupFn);\n                if (animationControl) {\n                    animationControls.add(animationControl);\n                }\n            }\n        }\n        else {\n            const actualPosition = this.#getPosition(positionGroup);\n            if (!actualPosition) {\n                console.warn(`AnimationGroupAPI.fromTo warning: No TJSPosition instance found.`);\n                return AnimationGroupControl.voidControl;\n            }\n            if (hasCallback) {\n                callbackOptions.index = 0;\n                callbackOptions.position = actualPosition;\n                callbackOptions.entry = actualPosition !== positionGroup ? positionGroup :\n                    void 0;\n            }\n            if (hasFromCallback && typeof fromData === 'function') {\n                actualFromData = fromData(callbackOptions);\n                // Returned data from callback is null / undefined, so skip this position instance.\n                if (actualFromData === null || actualFromData === void 0) {\n                    return AnimationGroupControl.voidControl;\n                }\n                if (!isObject(actualFromData)) {\n                    throw new TypeError(`AnimationGroupAPI.fromTo error: 'fromData' callback function failed to return an object.`);\n                }\n            }\n            if (hasToCallback && typeof toData === 'function') {\n                actualToData = toData(callbackOptions);\n                // Returned data from callback is null / undefined, so skip this position instance.\n                if (actualToData === null || actualToData === void 0) {\n                    return AnimationGroupControl.voidControl;\n                }\n                if (!isObject(actualToData)) {\n                    throw new TypeError(`AnimationGroupAPI.fromTo error: 'toData' callback function failed to return an object.`);\n                }\n            }\n            if (hasOptionCallback && typeof options === 'function') {\n                actualOptions = options(callbackOptions);\n                // Returned data from callback is null / undefined, so skip this position instance.\n                if (actualOptions === null || actualOptions === void 0) {\n                    return AnimationGroupControl.voidControl;\n                }\n                if (!isObject(actualOptions)) {\n                    throw new TypeError(`AnimationGroupAPI.fromTo error: 'options' callback function failed to return an object.`);\n                }\n            }\n            const animationControl = AnimationScheduler.fromTo(actualPosition, actualFromData, actualToData, actualOptions, cleanupFn);\n            if (animationControl) {\n                animationControls.add(animationControl);\n            }\n        }\n        return new AnimationGroupControl(animationControls);\n    }\n    /**\n     * Provides the `to` animation tween for one or more positionable instances as a group.\n     *\n     * @param positionGroup - A position group.\n     *\n     * @param toData - A position data object assigned to all positionable instances or a callback function invoked for\n     *        unique data for each instance.\n     *\n     * @param [options] - Tween options assigned to all positionable instances or a callback function invoked for unique\n     *        options for each instance.\n     *\n     * @returns Basic animation control.\n     */\n    static to(positionGroup, toData, options) {\n        if (!isObject(toData) && typeof toData !== 'function') {\n            throw new TypeError(`AnimationGroupAPI.to error: 'toData' is not an object or function.`);\n        }\n        if (options !== void 0 && !isObject(options) && typeof options !== 'function') {\n            throw new TypeError(`AnimationGroupAPI.to error: 'options' is not an object or function.`);\n        }\n        /**\n         */\n        const animationControls = new Set();\n        /**\n         */\n        const cleanupFn = (data) => animationControls.delete(data.control);\n        let index = -1;\n        /**\n         */\n        let callbackOptions;\n        const hasDataCallback = typeof toData === 'function';\n        const hasOptionCallback = typeof options === 'function';\n        const hasCallback = hasDataCallback || hasOptionCallback;\n        if (hasCallback) {\n            callbackOptions = { index, position: void 0, entry: void 0 };\n        }\n        let actualToData = toData;\n        let actualOptions = isObject(options) ? options : void 0;\n        if (isIterable(positionGroup)) {\n            for (const entry of positionGroup) {\n                index++;\n                const actualPosition = this.#getPosition(entry);\n                if (!actualPosition) {\n                    console.warn(`AnimationGroupAPI.to warning: No TJSPosition instance found at index: ${index}.`);\n                    continue;\n                }\n                if (hasCallback) {\n                    callbackOptions.index = index;\n                    callbackOptions.position = actualPosition;\n                    callbackOptions.entry = actualPosition !== entry ? entry : void 0;\n                }\n                if (hasDataCallback && typeof toData === 'function') {\n                    actualToData = toData(callbackOptions);\n                    // Returned data from callback is null / undefined, so skip this position instance.\n                    if (actualToData === null || actualToData === void 0) {\n                        continue;\n                    }\n                    if (!isObject(actualToData)) {\n                        throw new TypeError(`AnimationGroupAPI.to error: 'toData' callback function iteration(${index}) failed to return an object.`);\n                    }\n                }\n                if (hasOptionCallback && typeof options === 'function') {\n                    actualOptions = options(callbackOptions);\n                    // Returned data from callback is null / undefined, so skip this position instance.\n                    if (actualOptions === null || actualOptions === void 0) {\n                        continue;\n                    }\n                    if (!isObject(actualOptions)) {\n                        throw new TypeError(`AnimationGroupAPI.to error: 'options' callback function iteration(${index}) failed to return an object.`);\n                    }\n                }\n                const animationControl = AnimationScheduler.to(actualPosition, actualToData, actualOptions, cleanupFn);\n                if (animationControl) {\n                    animationControls.add(animationControl);\n                }\n            }\n        }\n        else {\n            const actualPosition = this.#getPosition(positionGroup);\n            if (!actualPosition) {\n                console.warn(`AnimationGroupAPI.to warning: No TJSPosition instance found.`);\n                return AnimationGroupControl.voidControl;\n            }\n            if (hasCallback) {\n                callbackOptions.index = 0;\n                callbackOptions.position = actualPosition;\n                callbackOptions.entry = actualPosition !== positionGroup ? positionGroup :\n                    void 0;\n            }\n            if (hasDataCallback && typeof toData === 'function') {\n                actualToData = toData(callbackOptions);\n                // Returned data from callback is null / undefined, so skip this position instance.\n                if (actualToData === null || actualToData === void 0) {\n                    return AnimationGroupControl.voidControl;\n                }\n                if (!isObject(actualToData)) {\n                    throw new TypeError(`AnimationGroupAPI.to error: 'toData' callback function failed to return an object.`);\n                }\n            }\n            if (hasOptionCallback && typeof options === 'function') {\n                actualOptions = options(callbackOptions);\n                // Returned data from callback is null / undefined, so skip this position instance.\n                if (actualOptions === null || actualOptions === void 0) {\n                    return AnimationGroupControl.voidControl;\n                }\n                if (!isObject(actualOptions)) {\n                    throw new TypeError(`AnimationGroupAPI.to error: 'options' callback function failed to return an object.`);\n                }\n            }\n            const animationControl = AnimationScheduler.to(actualPosition, actualToData, actualOptions, cleanupFn);\n            if (animationControl) {\n                animationControls.add(animationControl);\n            }\n        }\n        return new AnimationGroupControl(animationControls);\n    }\n    /**\n     * Provides the `quickTo` animation tweening function for one or more positionable instances as a group.\n     *\n     * @param positionGroup - A position group.\n     *\n     * @param keys - Animation keys to target.\n     *\n     * @param [options] - Quick tween options assigned to all positionable instances or a callback function invoked for\n     *        unique options for each instance.\n     *\n     * @returns quick-to tween function.\n     */\n    static quickTo(positionGroup, keys, options) {\n        if (!isIterable(keys)) {\n            throw new TypeError(`AnimationGroupAPI.quickTo error: 'keys' is not an iterable list.`);\n        }\n        if (options !== void 0 && !isObject(options) && typeof options !== 'function') {\n            throw new TypeError(`AnimationGroupAPI.quickTo error: 'options' is not an object or function.`);\n        }\n        /**\n         */\n        const quickToCallbacks = [];\n        let index = -1;\n        const hasOptionCallback = typeof options === 'function';\n        const callbackOptions = { index, position: void 0, entry: void 0 };\n        let actualOptions = isObject(options) ? options : void 0;\n        if (isIterable(positionGroup)) {\n            for (const entry of positionGroup) {\n                index++;\n                const actualPosition = this.#getPosition(entry);\n                if (!actualPosition) {\n                    console.warn(`AnimationGroupAPI.quickTo warning: No TJSPosition instance found at index: ${index}.`);\n                    continue;\n                }\n                callbackOptions.index = index;\n                callbackOptions.position = actualPosition;\n                callbackOptions.entry = actualPosition !== entry ? entry : void 0;\n                if (hasOptionCallback && typeof options === 'function') {\n                    actualOptions = options(callbackOptions);\n                    // Returned data from callback is null / undefined, so skip this position instance.\n                    if (actualOptions === null || actualOptions === void 0) {\n                        continue;\n                    }\n                    if (!isObject(actualOptions)) {\n                        throw new TypeError(`AnimationGroupAPI.quickTo error: 'options' callback function iteration(${index}) failed to return an object.`);\n                    }\n                }\n                quickToCallbacks.push(actualPosition.animate.quickTo(keys, actualOptions));\n            }\n        }\n        else {\n            const actualPosition = this.#getPosition(positionGroup);\n            if (!actualPosition) {\n                console.warn(`AnimationGroupAPI.quickTo warning: No TJSPosition instance found.`);\n                return;\n            }\n            callbackOptions.index = 0;\n            callbackOptions.position = actualPosition;\n            callbackOptions.entry = actualPosition !== positionGroup ? positionGroup : void 0;\n            if (hasOptionCallback && typeof options === 'function') {\n                actualOptions = options(callbackOptions);\n                // Returned data from callback is null / undefined, so skip this position instance.\n                if (actualOptions === null || actualOptions === void 0) {\n                    return;\n                }\n                if (!isObject(actualOptions)) {\n                    throw new TypeError(`AnimationGroupAPI.quickTo error: 'options' callback function failed to return an object.`);\n                }\n            }\n            quickToCallbacks.push(actualPosition.animate.quickTo(keys, actualOptions));\n        }\n        const keysArray = [...keys];\n        Object.freeze(keysArray);\n        const quickToCB = (...args) => {\n            const argsLength = args.length;\n            if (argsLength === 0) {\n                return;\n            }\n            if (typeof args[0] === 'function') {\n                const dataCallback = args[0];\n                index = -1;\n                let cntr = 0;\n                if (isIterable(positionGroup)) {\n                    for (const entry of positionGroup) {\n                        index++;\n                        const actualPosition = this.#getPosition(entry);\n                        if (!actualPosition) {\n                            continue;\n                        }\n                        callbackOptions.index = index;\n                        callbackOptions.position = actualPosition;\n                        callbackOptions.entry = actualPosition !== entry ? entry : void 0;\n                        const toData = dataCallback(callbackOptions);\n                        // Returned data from callback is null / undefined, so skip this position instance.\n                        if (toData === null || toData === void 0) {\n                            continue;\n                        }\n                        /**\n                         */\n                        const toDataIterable = isIterable(toData);\n                        if (!Number.isFinite(toData) && !toDataIterable && !isObject(toData)) {\n                            throw new TypeError(`AnimationGroupAPI.quickTo error: 'toData' callback function iteration(${index}) failed to return a finite number, iterable list, or object.`);\n                        }\n                        if (toDataIterable) {\n                            quickToCallbacks[cntr++](...toData);\n                        }\n                        else {\n                            quickToCallbacks[cntr++](toData);\n                        }\n                    }\n                }\n                else {\n                    const actualPosition = this.#getPosition(positionGroup);\n                    if (!actualPosition) {\n                        return;\n                    }\n                    callbackOptions.index = 0;\n                    callbackOptions.position = actualPosition;\n                    callbackOptions.entry = actualPosition !== positionGroup ? positionGroup : void 0;\n                    const toData = dataCallback(callbackOptions);\n                    // Returned data from callback is null / undefined, so skip this position instance.\n                    if (toData === null || toData === void 0) {\n                        return;\n                    }\n                    const toDataIterable = isIterable(toData);\n                    if (!Number.isFinite(toData) && !toDataIterable && !isObject(toData)) {\n                        throw new TypeError(`AnimationGroupAPI.quickTo error: 'toData' callback function iteration(${index}) failed to return a finite number, iterable list, or object.`);\n                    }\n                    if (toDataIterable) {\n                        quickToCallbacks[cntr++](...toData);\n                    }\n                    else {\n                        quickToCallbacks[cntr++](toData);\n                    }\n                }\n            }\n            else {\n                for (let cntr = quickToCallbacks.length; --cntr >= 0;) {\n                    quickToCallbacks[cntr](...args);\n                }\n            }\n        };\n        Object.defineProperty(quickToCB, 'keys', {\n            value: keysArray,\n            writable: false,\n            configurable: false\n        });\n        Object.defineProperty(quickToCB, 'options', {\n            /**\n             * Sets options of quickTo tween.\n             * @param options -\n             */\n            value: (options) => {\n                if (options !== void 0 && !isObject(options)) {\n                    throw new TypeError(`AnimationGroupAPI.quickTo error: 'options' is not an object.`);\n                }\n                // Set options object for each quickTo callback.\n                if (isObject(options)) {\n                    for (let cntr = quickToCallbacks.length; --cntr >= 0;) {\n                        quickToCallbacks[cntr].options(options);\n                    }\n                }\n                return quickToCB;\n            },\n            writable: false,\n            configurable: false\n        });\n        return quickToCB;\n    }\n}\nObject.seal(AnimationGroupAPIImpl);\n\n/**\n *\n */\nclass PositionStateAPI {\n    /**\n     */\n    #data;\n    /**\n     */\n    #dataSaved = new Map();\n    /**\n     */\n    #position;\n    /**\n     */\n    #transforms;\n    constructor(position, data, transforms) {\n        this.#position = position;\n        this.#data = data;\n        this.#transforms = transforms;\n        Object.seal(this);\n    }\n    /**\n     * Clears all saved position data except any default state.\n     */\n    clear() {\n        for (const key of this.#dataSaved.keys()) {\n            if (key !== '#defaultData') {\n                this.#dataSaved.delete(key);\n            }\n        }\n    }\n    /**\n     * Returns any stored save state by name.\n     *\n     * @param options - Options.\n     *\n     * @param options.name - Saved data name.\n     *\n     * @returns Any saved position data.\n     */\n    get({ name }) {\n        if (typeof name !== 'string') {\n            throw new TypeError(`TJSPosition - get error: 'name' is not a string.`);\n        }\n        return this.#dataSaved.get(name);\n    }\n    /**\n     * Returns any associated default position data.\n     *\n     * @returns Any saved default position data.\n     */\n    getDefault() {\n        return this.#dataSaved.get('#defaultData');\n    }\n    /**\n     * @returns The saved position data names / keys.\n     */\n    keys() {\n        return this.#dataSaved.keys();\n    }\n    /**\n     * Removes and returns any position data by name.\n     *\n     * @param options - Options.\n     *\n     * @param options.name - Name to remove and retrieve.\n     *\n     * @returns Any saved position data.\n     */\n    remove({ name }) {\n        if (typeof name !== 'string') {\n            throw new TypeError(`TJSPosition - remove: 'name' is not a string.`);\n        }\n        const data = this.#dataSaved.get(name);\n        this.#dataSaved.delete(name);\n        return data;\n    }\n    /**\n     * Resets position instance to default data and invokes set.\n     *\n     * @param [options] - Optional parameters.\n     *\n     * @param [options.keepZIndex=false] - When true keeps current z-index.\n     *\n     * @param [options.invokeSet=true] - When true invokes set method.\n     *\n     * @returns Operation successful.\n     */\n    reset({ keepZIndex = false, invokeSet = true } = {}) {\n        const defaultData = this.#dataSaved.get('#defaultData');\n        // Quit early if there is no saved default data.\n        if (!isObject(defaultData)) {\n            return false;\n        }\n        // Cancel all animations for TJSPosition if there are currently any scheduled.\n        if (this.#position.animate.isScheduled) {\n            this.#position.animate.cancel();\n        }\n        const zIndex = this.#position.zIndex;\n        const data = Object.assign({}, defaultData);\n        if (keepZIndex) {\n            data.zIndex = zIndex;\n        }\n        // Reset the transform data.\n        this.#transforms.reset(data);\n        const parent = this.#position.parent;\n        // If current minimized invoke `maximize`. TODO: REFACTOR FOR APPLICATION DIRECT ACCESS.\n        if (parent?.reactive?.minimized) {\n            parent?.maximize?.({ animate: false, duration: 0 });\n        }\n        // Note next clock tick scheduling.\n        if (invokeSet) {\n            setTimeout(() => this.#position.set(data), 0);\n        }\n        return true;\n    }\n    /**\n     * Restores a saved positional state returning the data. Several optional parameters are available to control\n     * whether the restore action occurs silently (no store / inline styles updates), animates to the stored data, or\n     * simply sets the stored data. Restoring via {@link AnimationAPI.to} allows specification of the duration and\n     * easing along with configuring a Promise to be returned if awaiting the end of the animation.\n     *\n     * @param options - Parameters\n     *\n     * @param options.name - Saved data set name.\n     *\n     * @param [options.remove=false] - Deletes data set.\n     *\n     * @param [options.properties] - Specific properties to set / animate.\n     *\n     * @param [options.silent] - Set position data directly; no store or style updates.\n     *\n     * @param [options.async=false] - If animating return a Promise that resolves with any saved data.\n     *\n     * @param [options.animateTo=false] - Animate to restore data.\n     *\n     * @param [options.duration=0.1] - Duration in seconds.\n     *\n     * @param [options.ease='linear'] - Easing function name or function.\n     *\n     * @returns Any saved position data.\n     */\n    restore({ name, remove = false, properties, silent = false, async = false, animateTo = false, duration = 0.1, ease = 'linear' }) {\n        if (typeof name !== 'string') {\n            throw new TypeError(`TJSPosition - restore error: 'name' is not a string.`);\n        }\n        const dataSaved = this.#dataSaved.get(name);\n        if (dataSaved) {\n            if (remove) {\n                this.#dataSaved.delete(name);\n            }\n            let data = dataSaved;\n            if (isIterable(properties)) {\n                data = {};\n                for (const property of properties) {\n                    data[property] = dataSaved[property];\n                }\n            }\n            // Update data directly with no store or inline style updates.\n            if (silent) {\n                for (const property in data) {\n                    if (property in this.#data) {\n                        this.#data[property] = data[property];\n                    }\n                }\n                return dataSaved;\n            }\n            else if (animateTo) // Animate to saved data.\n             {\n                // Provide special handling to potentially change transform origin as this parameter is not animated.\n                if (data.transformOrigin !== this.#position.transformOrigin) {\n                    this.#position.transformOrigin = data.transformOrigin;\n                }\n                // Return a Promise with saved data that resolves after animation ends.\n                if (async) {\n                    return this.#position.animate.to(data, { duration, ease }).finished.then(() => dataSaved);\n                }\n                else // Animate synchronously.\n                 {\n                    this.#position.animate.to(data, { duration, ease });\n                }\n            }\n            else {\n                // Default options is to set data for an immediate update.\n                this.#position.set(data);\n            }\n        }\n        // Saved data potentially not found, but must still return a Promise when async is true.\n        return async ? Promise.resolve(dataSaved) : dataSaved;\n    }\n    /**\n     * Saves current position state with the opportunity to add extra data to the saved state. Simply include extra\n     * properties in `options` to save extra data.\n     *\n     * @param options - Options.\n     *\n     * @param options.name - name to index this saved data.\n     *\n     * @param [optionsGet] - Additional options for {@link TJSPosition.get} when serializing position state. By default,\n     *        `nullable` values are included.\n     *\n     * @returns Current position data plus any extra data stored.\n     */\n    save({ name, ...extra }, optionsGet) {\n        if (typeof name !== 'string') {\n            throw new TypeError(`TJSPosition - save error: 'name' is not a string.`);\n        }\n        const data = this.#position.get(extra, optionsGet);\n        this.#dataSaved.set(name, data);\n        return data;\n    }\n    /**\n     * Directly sets a saved position state. Simply include extra properties in `options` to set extra data.\n     *\n     * @param opts - Options.\n     *\n     * @param opts.name - name to index this saved data.\n     */\n    set({ name, ...data }) {\n        if (typeof name !== 'string') {\n            throw new TypeError(`TJSPosition - set error: 'name' is not a string.`);\n        }\n        this.#dataSaved.set(name, data);\n    }\n}\n\n/**\n * Provides a base {@link System.SystemBase} implementation.\n */\nclass SystemBase {\n    /**\n     * When true constrains the min / max width or height to element.\n     */\n    #constrain;\n    /**\n     */\n    #element;\n    /**\n     * When true the validator is active.\n     */\n    #enabled;\n    /**\n     * Provides a manual setting of the element height. As things go `offsetHeight` causes a browser layout and is not\n     * performance oriented. If manually set this height is used instead of `offsetHeight`.\n     */\n    #height;\n    /**\n     * Set from an optional value in the constructor to lock accessors preventing modification.\n     */\n    #lock;\n    /**\n     * Stores the subscribers.\n     */\n    #subscribers = [];\n    /**\n     * Provides a manual setting of the element width. As things go `offsetWidth` causes a browser layout and is not\n     * performance oriented. If manually set this width is used instead of `offsetWidth`.\n     */\n    #width;\n    /**\n     * @param [options] - Initial options.\n     *\n     * @param [options.constrain=true] - Initial constrained state.\n     *\n     * @param [options.element] - Target element.\n     *\n     * @param [options.enabled=true] - Enabled state.\n     *\n     * @param [options.lock=false] - Lock parameters from being set.\n     *\n     * @param [options.width] - Manual width.\n     *\n     * @param [options.height] - Manual height.\n     */\n    constructor({ constrain = true, element, enabled = true, lock = false, width, height } = {}) {\n        this.#constrain = true;\n        this.#enabled = true;\n        this.constrain = constrain;\n        this.element = element;\n        this.enabled = enabled;\n        this.width = width;\n        this.height = height;\n        this.#lock = typeof lock === 'boolean' ? lock : false;\n    }\n    /**\n     * @returns The current constrain state.\n     */\n    get constrain() { return this.#constrain; }\n    /**\n     * @returns Target element.\n     */\n    get element() { return this.#element; }\n    /**\n     * @returns The current enabled state.\n     */\n    get enabled() { return this.#enabled; }\n    /**\n     * @returns Get manual height.\n     */\n    get height() { return this.#height; }\n    /**\n     * @return Get locked state.\n     */\n    get locked() { return this.#lock; }\n    /**\n     * @returns Get manual width.\n     */\n    get width() { return this.#width; }\n    /**\n     * @param constrain - New constrain state.\n     */\n    set constrain(constrain) {\n        if (this.#lock) {\n            return;\n        }\n        if (typeof constrain !== 'boolean') {\n            throw new TypeError(`'constrain' is not a boolean.`);\n        }\n        this.#constrain = constrain;\n        this.#updateSubscribers();\n    }\n    /**\n     * @param element - Set target element.\n     */\n    set element(element) {\n        if (this.#lock) {\n            return;\n        }\n        if (element === void 0 || element === null || A11yHelper.isFocusTarget(element)) {\n            this.#element = element;\n        }\n        else {\n            throw new TypeError(`'element' is not a HTMLElement, undefined, or null.`);\n        }\n        this.#updateSubscribers();\n    }\n    /**\n     * @param enabled - New enabled state.\n     */\n    set enabled(enabled) {\n        if (this.#lock) {\n            return;\n        }\n        if (typeof enabled !== 'boolean') {\n            throw new TypeError(`'enabled' is not a boolean.`);\n        }\n        this.#enabled = enabled;\n        this.#updateSubscribers();\n    }\n    /**\n     * @param height - Set manual height.\n     */\n    set height(height) {\n        if (this.#lock) {\n            return;\n        }\n        if (height === void 0 || Number.isFinite(height)) {\n            this.#height = height;\n        }\n        else {\n            throw new TypeError(`'height' is not a finite number or undefined.`);\n        }\n        this.#updateSubscribers();\n    }\n    /**\n     * @param width - Set manual width.\n     */\n    set width(width) {\n        if (this.#lock) {\n            return;\n        }\n        if (width === void 0 || Number.isFinite(width)) {\n            this.#width = width;\n        }\n        else {\n            throw new TypeError(`'width' is not a finite number or undefined.`);\n        }\n        this.#updateSubscribers();\n    }\n    /**\n     * Set manual width & height.\n     *\n     * @param width - New manual width.\n     *\n     * @param height - New manual height.\n     */\n    setDimension(width, height) {\n        if (this.#lock) {\n            return;\n        }\n        if (width === void 0 || Number.isFinite(width)) {\n            this.#width = width;\n        }\n        else {\n            throw new TypeError(`'width' is not a finite number or undefined.`);\n        }\n        if (height === void 0 || Number.isFinite(height)) {\n            this.#height = height;\n        }\n        else {\n            throw new TypeError(`'height' is not a finite number or undefined.`);\n        }\n        this.#updateSubscribers();\n    }\n    /**\n     * @param handler - Callback function that is invoked on update / changes. Receives a copy of the TJSPositionData.\n     *\n     * @returns Unsubscribe function.\n     */\n    subscribe(handler) {\n        const currentIdx = this.#subscribers.findIndex((entry) => entry === handler);\n        if (currentIdx === -1) {\n            this.#subscribers.push(handler); // add handler to the array of subscribers\n            handler(this); // call handler with current value\n        }\n        // Return unsubscribe function.\n        return () => {\n            const existingIdx = this.#subscribers.findIndex((entry) => entry === handler);\n            if (existingIdx !== -1) {\n                this.#subscribers.splice(existingIdx, 1);\n            }\n        };\n    }\n    /**\n     * Updates subscribers on changes.\n     */\n    #updateSubscribers() {\n        for (let cntr = 0; cntr < this.#subscribers.length; cntr++) {\n            this.#subscribers[cntr](this);\n        }\n    }\n}\n\n/**\n * Provides a {@link System.Initial.InitialSystem} implementation to center an element being positioned.\n */\nclass Centered extends SystemBase {\n    /**\n     * Get the left constraint based on any manual target values or the browser inner width.\n     *\n     * @param width - Target width.\n     *\n     * @returns Calculated left constraint.\n     */\n    getLeft(width) {\n        // Determine containing bounds from manual values; or any element; lastly the browser width / height.\n        const boundsWidth = this.width ?? this.element?.offsetWidth ?? globalThis.innerWidth;\n        return (boundsWidth - width) / 2;\n    }\n    /**\n     * Get the top constraint based on any manual target values or the browser inner height.\n     *\n     * @param height - Target height.\n     *\n     * @returns Calculated top constraint.\n     */\n    getTop(height) {\n        const boundsHeight = this.height ?? this.element?.offsetHeight ?? globalThis.innerHeight;\n        return (boundsHeight - height) / 2;\n    }\n}\n\n/**\n * Provides the storage and sequencing of managed position validators. Each validator added may be a bespoke function or\n * a {@link ValidatorData} object containing an `id`, `validator`, and `weight` attributes; `validator` is the only\n * required attribute.\n *\n * The `id` attribute can be anything that creates a unique ID for the validator; recommended strings or numbers. This\n * allows validators to be removed by ID easily.\n *\n * The `weight` attribute is a number between 0 and 1 inclusive that allows validators to be added in a predictable\n * order which is especially handy if they are manipulated at runtime. A lower weighted validator always runs before a\n * higher weighted validator. If no weight is specified the default of '1' is assigned, and it is appended to the end of\n * the validators list.\n *\n * This class forms the public API which is accessible from the {@link TJSPosition.validators} getter in the main\n * TJSPosition instance.\n * ```\n * const position = new TJSPosition();\n * position.validators.add(...);\n * position.validators.clear();\n * position.validators.length;\n * position.validators.remove(...);\n * position.validators.removeBy(...);\n * position.validators.removeById(...);\n * ```\n */\nclass AdapterValidators {\n    /**\n     */\n    #enabled = true;\n    /**\n     */\n    #validatorData;\n    /**\n     */\n    #mapUnsubscribe = new Map();\n    #updateFn;\n    /**\n     * @returns Returns this and internal storage for validator adapter.\n     */\n    static create(updateFn) {\n        const validatorAPI = new AdapterValidators(updateFn);\n        return [validatorAPI, validatorAPI.#validatorData];\n    }\n    /**\n     */\n    constructor(updateFn) {\n        this.#validatorData = [];\n        this.#updateFn = updateFn;\n        Object.seal(this);\n    }\n    /**\n     * @returns Returns the enabled state.\n     */\n    get enabled() { return this.#enabled; }\n    /**\n     * @returns Returns the length of the validators array.\n     */\n    get length() { return this.#validatorData.length; }\n    /**\n     * @param enabled - Sets enabled state.\n     */\n    set enabled(enabled) {\n        if (typeof enabled !== 'boolean') {\n            throw new TypeError(`'enabled' is not a boolean.`);\n        }\n        this.#enabled = enabled;\n    }\n    /**\n     * Provides an iterator for validators.\n     *\n     * @returns iterator.\n     */\n    *[Symbol.iterator]() {\n        if (this.#validatorData.length === 0) {\n            return;\n        }\n        for (const entry of this.#validatorData) {\n            yield { ...entry };\n        }\n    }\n    /**\n     * Adds the given validators.\n     *\n     * @param validators - Validators to add.\n     */\n    add(...validators) {\n        /**\n         * Tracks the number of validators added that have subscriber functionality.\n         */\n        let subscribeCount = 0;\n        for (const validator of validators) {\n            const validatorType = typeof validator;\n            if ((validatorType !== 'function' && validatorType !== 'object') || validator === null) {\n                throw new TypeError(`AdapterValidator error: 'validator' is not a function or object.`);\n            }\n            /**\n             */\n            let data = void 0;\n            /**\n             */\n            let subscribeFn = void 0;\n            switch (validatorType) {\n                case 'function':\n                    data = {\n                        id: void 0,\n                        validate: validator,\n                        weight: 1\n                    };\n                    subscribeFn = validator.subscribe;\n                    break;\n                case 'object':\n                    if ('validate' in validator) {\n                        if (typeof validator.validate !== 'function') {\n                            throw new TypeError(`AdapterValidator error: 'validate' attribute is not a function.`);\n                        }\n                        if (validator.weight !== void 0 && typeof validator.weight !== 'number' ||\n                            (validator?.weight < 0 || validator?.weight > 1)) {\n                            throw new TypeError(`AdapterValidator error: 'weight' attribute is not a number between '0 - 1' inclusive.`);\n                        }\n                        data = {\n                            id: validator.id !== void 0 ? validator.id : void 0,\n                            validate: validator.validate.bind(validator),\n                            weight: validator.weight || 1\n                        };\n                        subscribeFn = validator.validate.subscribe ?? validator.subscribe;\n                    }\n                    else {\n                        throw new TypeError(`AdapterValidator error: 'validate' attribute is not a function.`);\n                    }\n                    break;\n            }\n            // Find the index to insert where data.weight is less than existing values weight.\n            const index = this.#validatorData.findIndex((value) => data.weight < value.weight);\n            // If an index was found insert at that location.\n            if (index >= 0) {\n                this.#validatorData.splice(index, 0, data);\n            }\n            else // push to end of validators.\n             {\n                this.#validatorData.push(data);\n            }\n            if (typeof subscribeFn === 'function') {\n                const unsubscribe = subscribeFn.call(validator, this.#updateFn);\n                // Ensure that unsubscribe is a function.\n                if (typeof unsubscribe !== 'function') {\n                    throw new TypeError('AdapterValidator error: Validator has subscribe function, but no unsubscribe function is returned.');\n                }\n                // Ensure that the same validator is not subscribed to multiple times.\n                if (this.#mapUnsubscribe.has(data.validate)) {\n                    throw new Error('AdapterValidator error: Validator added already has an unsubscribe function registered.');\n                }\n                this.#mapUnsubscribe.set(data.validate, unsubscribe);\n                subscribeCount++;\n            }\n        }\n        // Validators with subscriber functionality are assumed to immediately invoke the `subscribe` callback. If the\n        // subscriber count is less than the amount of validators added then automatically trigger an update manually.\n        if (subscribeCount < validators.length) {\n            this.#updateFn();\n        }\n    }\n    /**\n     * Clears / removes all validators.\n     */\n    clear() {\n        this.#validatorData.length = 0;\n        // Unsubscribe from all validators with subscription support.\n        for (const unsubscribe of this.#mapUnsubscribe.values()) {\n            unsubscribe();\n        }\n        this.#mapUnsubscribe.clear();\n        this.#updateFn();\n    }\n    /**\n     * Removes one or more given validators.\n     *\n     * @param validators - Validators to remove.\n     */\n    remove(...validators) {\n        const length = this.#validatorData.length;\n        if (length === 0) {\n            return;\n        }\n        for (const data of validators) {\n            // Handle the case that the validator may either be a function or a validator entry / object.\n            const actualValidator = typeof data === 'function' ? data : isObject(data) ? data.validate : void 0;\n            if (!actualValidator) {\n                continue;\n            }\n            for (let cntr = this.#validatorData.length; --cntr >= 0;) {\n                if (this.#validatorData[cntr].validate === actualValidator) {\n                    this.#validatorData.splice(cntr, 1);\n                    // Invoke any unsubscribe function for given validator then remove from tracking.\n                    let unsubscribe = void 0;\n                    if (typeof (unsubscribe = this.#mapUnsubscribe.get(actualValidator)) === 'function') {\n                        unsubscribe();\n                        this.#mapUnsubscribe.delete(actualValidator);\n                    }\n                }\n            }\n        }\n        // Invoke update as a validator was removed.\n        if (length !== this.#validatorData.length) {\n            this.#updateFn();\n        }\n    }\n    /**\n     * Remove validators by the provided callback. The callback takes 3 parameters: `id`, `validator`, and `weight`.\n     * Any truthy value returned will remove that validator.\n     *\n     * @param callback - Callback function to evaluate each validator entry.\n     */\n    removeBy(callback) {\n        const length = this.#validatorData.length;\n        if (length === 0) {\n            return;\n        }\n        if (typeof callback !== 'function') {\n            throw new TypeError(`AdapterValidator error: 'callback' is not a function.`);\n        }\n        this.#validatorData = this.#validatorData.filter((data) => {\n            const remove = callback.call(callback, { ...data });\n            if (remove) {\n                let unsubscribe;\n                if (typeof (unsubscribe = this.#mapUnsubscribe.get(data.validate)) === 'function') {\n                    unsubscribe();\n                    this.#mapUnsubscribe.delete(data.validate);\n                }\n            }\n            // Reverse remove boolean to properly validator / remove this validator.\n            return !remove;\n        });\n        if (length !== this.#validatorData.length) {\n            this.#updateFn();\n        }\n    }\n    /**\n     * Removes any validators with matching IDs.\n     *\n     * @param ids - IDs to remove.\n     */\n    removeById(...ids) {\n        const length = this.#validatorData.length;\n        if (length === 0) {\n            return;\n        }\n        this.#validatorData = this.#validatorData.filter((data) => {\n            let remove = false;\n            for (const id of ids) {\n                remove ||= data.id === id;\n            }\n            // If not keeping invoke any unsubscribe function for given validator then remove from tracking.\n            if (remove) {\n                let unsubscribe;\n                if (typeof (unsubscribe = this.#mapUnsubscribe.get(data.validate)) === 'function') {\n                    unsubscribe();\n                    this.#mapUnsubscribe.delete(data.validate);\n                }\n            }\n            return !remove; // Swap here to actually remove the item via array validator method.\n        });\n        if (length !== this.#validatorData.length) {\n            this.#updateFn();\n        }\n    }\n}\n\nclass TransformBounds extends SystemBase {\n    static #TRANSFORM_DATA = new TJSTransformData();\n    /**\n     * Provides a validator that respects transforms in positional data constraining the position to within the target\n     * elements bounds.\n     *\n     * @param valData - The associated validation data for position updates.\n     *\n     * @returns Potentially adjusted position data.\n     */\n    validate(valData) {\n        // Early out if element is undefined or local enabled state is false.\n        if (!this.enabled) {\n            return valData.position;\n        }\n        // Determine containing bounds from manual values; or any element; lastly the browser width / height.\n        const boundsWidth = this.width ?? this.element?.offsetWidth ?? globalThis.innerWidth;\n        const boundsHeight = this.height ?? this.element?.offsetHeight ?? globalThis.innerHeight;\n        // Ensure min / max width constraints when position width is a number; not 'auto' or 'inherit'. If constrain is\n        // true cap width bounds.\n        if (typeof valData.position.width === 'number') {\n            const maxW = valData.maxWidth ?? (this.constrain ? boundsWidth : Number.MAX_SAFE_INTEGER);\n            valData.position.width = clamp(valData.width, valData.minWidth, maxW);\n        }\n        // Ensure min / max height constraints when position height is a number; not 'auto' or 'inherit'. If constrain\n        // is true cap height bounds.\n        if (typeof valData.position.height === 'number') {\n            const maxH = valData.maxHeight ?? (this.constrain ? boundsHeight : Number.MAX_SAFE_INTEGER);\n            valData.position.height = clamp(valData.height, valData.minHeight, maxH);\n        }\n        // Get transform data. First set constraints including any margin top / left as offsets and width / height. Used\n        // when position width / height is 'auto'.\n        const data = valData.transforms.getData(valData.position, TransformBounds.#TRANSFORM_DATA, valData);\n        // Check the bounding rectangle against browser height / width. Adjust position based on how far the overlap of\n        // the bounding rect is outside the bounds height / width. The order below matters as the constraints are top /\n        // left oriented, so perform those checks last.\n        const initialX = data.boundingRect.x;\n        const initialY = data.boundingRect.y;\n        const marginTop = valData.marginTop ?? 0;\n        const marginLeft = valData.marginLeft ?? 0;\n        if (data.boundingRect.bottom + marginTop > boundsHeight) {\n            data.boundingRect.y += boundsHeight - data.boundingRect.bottom - marginTop;\n        }\n        if (data.boundingRect.right + marginLeft > boundsWidth) {\n            data.boundingRect.x += boundsWidth - data.boundingRect.right - marginLeft;\n        }\n        if (data.boundingRect.top - marginTop < 0) {\n            data.boundingRect.y += Math.abs(data.boundingRect.top - marginTop);\n        }\n        if (data.boundingRect.left - marginLeft < 0) {\n            data.boundingRect.x += Math.abs(data.boundingRect.left - marginLeft);\n        }\n        valData.position.left -= initialX - data.boundingRect.x;\n        valData.position.top -= initialY - data.boundingRect.y;\n        return valData.position;\n    }\n}\n\n/**\n * Tracks changes to positional data during {@link TJSPosition.set} updates to minimize changes to the element style in\n * {@link UpdateElementManager}.\n */\nclass PositionChangeSet {\n    left;\n    top;\n    width;\n    height;\n    maxHeight;\n    maxWidth;\n    minHeight;\n    minWidth;\n    zIndex;\n    transform;\n    transformOrigin;\n    constructor() {\n        this.left = false;\n        this.top = false;\n        this.width = false;\n        this.height = false;\n        this.maxHeight = false;\n        this.maxWidth = false;\n        this.minHeight = false;\n        this.minWidth = false;\n        this.zIndex = false;\n        this.transform = false;\n        this.transformOrigin = false;\n    }\n    hasChange() {\n        return this.left || this.top || this.width || this.height || this.maxHeight || this.maxWidth || this.minHeight ||\n            this.minWidth || this.zIndex || this.transform || this.transformOrigin;\n    }\n    set(value) {\n        this.left = value;\n        this.top = value;\n        this.width = value;\n        this.height = value;\n        this.maxHeight = value;\n        this.maxWidth = value;\n        this.minHeight = value;\n        this.minWidth = value;\n        this.zIndex = value;\n        this.transform = value;\n        this.transformOrigin = value;\n    }\n}\n\n/**\n * Encapsulates internal data from a TJSPosition instance to be manipulated by {@link UpdateElementManager}.\n */\nclass UpdateElementData {\n    changeSet;\n    data;\n    dataSubscribers;\n    dimensionData;\n    options;\n    queued;\n    storeDimension;\n    storeTransform;\n    styleCache;\n    subscribers;\n    transforms;\n    transformData;\n    constructor(changeSet, data, options, styleCache, subscribers, transforms) {\n        /**\n         */\n        this.changeSet = changeSet;\n        /**\n         * Stores the private data from TJSPosition.\n         */\n        this.data = data;\n        /**\n         * Provides a copy of local data sent to subscribers.\n         */\n        this.dataSubscribers = Object.seal(new TJSPositionData());\n        /**\n         * Stores the current dimension data used for the readable `dimension` store.\n         */\n        this.dimensionData = Object.seal({ width: 0, height: 0 });\n        /**\n         */\n        this.options = options;\n        /**\n         * Stores if this TJSPosition / update data is queued for update.\n         */\n        this.queued = false;\n        /**\n         */\n        this.styleCache = styleCache;\n        /**\n         */\n        this.storeDimension = writable(this.dimensionData);\n        /**\n         */\n        this.subscribers = subscribers;\n        /**\n         */\n        this.transforms = transforms;\n        /**\n         * Stores the current transform data used for the readable `transform` store. It is only active when there are\n         * subscribers to the store or calculateTransform options is true.\n         */\n        this.transformData = new TJSTransformData();\n        /**\n         * When there are subscribers set option to calculate transform updates; set to false when no subscribers.\n         */\n        this.storeTransform = writable(this.transformData, () => {\n            this.options.transformSubscribed = true;\n            return () => this.options.transformSubscribed = false;\n        });\n    }\n}\n\n/**\n * Decouples updates to any parent target HTMLElement inline styles. Invoke {@link TJSPosition.elementUpdated} to await\n * on the returned promise that is resolved with the current render time via `nextAnimationFrame` /\n * `requestAnimationFrame`. This allows the underlying data model to be updated immediately while updates to the\n * element are in sync with the browser and potentially in the future be further throttled.\n */\nclass UpdateElementManager {\n    /**\n     * Stores the active list of all TJSPosition instances currently updating. The list entries are recycled between\n     * updates.\n     */\n    static list = [];\n    /**\n     * Tracks the current position in the list.\n     */\n    static listCntr = 0;\n    static updatePromise;\n    /**\n     * Potentially adds the given element and internal updateData instance to the list.\n     *\n     * @param el - An HTMLElement instance.\n     *\n     * @param updateData - An UpdateElementData instance.\n     *\n     * @returns The unified next frame update promise. Returns `currentTime`.\n     */\n    static add(el, updateData) {\n        if (this.listCntr < this.list.length) {\n            const entry = this.list[this.listCntr];\n            entry[0] = el;\n            entry[1] = updateData;\n        }\n        else {\n            this.list.push([el, updateData]);\n        }\n        this.listCntr++;\n        updateData.queued = true;\n        if (!this.updatePromise) {\n            this.updatePromise = this.wait();\n        }\n        return this.updatePromise;\n    }\n    /**\n     * Await on `nextAnimationFrame` and iterate over list map invoking callback functions.\n     *\n     * @returns The next frame Promise / currentTime from nextAnimationFrame.\n     */\n    static async wait() {\n        // Await the next animation frame. In the future this can be extended to multiple frames to divide update rate.\n        const currentTime = await nextAnimationFrame();\n        this.updatePromise = void 0;\n        for (let cntr = this.listCntr; --cntr >= 0;) {\n            // Obtain data for entry.\n            const entry = this.list[cntr];\n            const el = entry[0];\n            const updateData = entry[1];\n            // Clear entry data.\n            entry[0] = void 0;\n            entry[1] = void 0;\n            // Reset queued state.\n            updateData.queued = false;\n            // Early out if the element is no longer connected to the DOM / shadow root.\n            if (!el.isConnected) {\n                continue;\n            }\n            if (updateData.options.ortho) {\n                UpdateElementManager.#updateElementOrtho(el, updateData);\n            }\n            else {\n                UpdateElementManager.#updateElement(el, updateData);\n            }\n            // If calculate transform options is enabled then update the transform data and set the readable store.\n            if (updateData.options.calculateTransform || updateData.options.transformSubscribed) {\n                UpdateElementManager.#updateTransform(updateData);\n            }\n            // Update all subscribers with changed data.\n            this.updateSubscribers(updateData);\n        }\n        this.listCntr = 0;\n        return currentTime;\n    }\n    /**\n     * Potentially immediately updates the given element.\n     *\n     * @param el - An HTMLElement instance.\n     *\n     * @param updateData - An UpdateElementData instance.\n     */\n    static immediate(el, updateData) {\n        // Early out if the element is no longer connected to the DOM / shadow root.\n        if (!el.isConnected) {\n            return;\n        }\n        if (updateData.options.ortho) {\n            UpdateElementManager.#updateElementOrtho(el, updateData);\n        }\n        else {\n            UpdateElementManager.#updateElement(el, updateData);\n        }\n        // If calculate transform options is enabled then update the transform data and set the readable store.\n        if (updateData.options.calculateTransform || updateData.options.transformSubscribed) {\n            UpdateElementManager.#updateTransform(updateData);\n        }\n        // Update all subscribers with changed data.\n        this.updateSubscribers(updateData);\n    }\n    /**\n     * @param updateData - Data change set.\n     */\n    static updateSubscribers(updateData) {\n        const data = updateData.data;\n        const changeSet = updateData.changeSet;\n        if (!changeSet.hasChange()) {\n            return;\n        }\n        // Make a copy of the data.\n        const output = TJSPositionDataUtil.copyData(data, updateData.dataSubscribers);\n        const subscribers = updateData.subscribers;\n        // Early out if there are no subscribers.\n        if (subscribers.length > 0) {\n            for (let cntr = 0; cntr < subscribers.length; cntr++) {\n                subscribers[cntr](output);\n            }\n        }\n        // Update dimension data if width / height has changed.\n        if (changeSet.width || changeSet.height) {\n            updateData.dimensionData.width = data.width;\n            updateData.dimensionData.height = data.height;\n            updateData.storeDimension.set(updateData.dimensionData);\n        }\n        changeSet.set(false);\n    }\n    // Internal Implementation ----------------------------------------------------------------------------------------\n    /**\n     * Temporary data for validation.\n     */\n    static #validationData = Object.seal({\n        height: 0,\n        width: 0,\n        marginLeft: 0,\n        marginTop: 0\n    });\n    /**\n     * Decouples updates to any parent target HTMLElement inline styles. Invoke {@link TJSPosition.elementUpdated} to\n     * await on the returned promise that is resolved with the current render time via `nextAnimationFrame` /\n     * `requestAnimationFrame`. This allows the underlying data model to be updated immediately while updates to the\n     * element are in sync with the browser and potentially in the future be further throttled.\n     *\n     * @param el - The target HTMLElement.\n     *\n     * @param updateData - Update data.\n     */\n    static #updateElement(el, updateData) {\n        const changeSet = updateData.changeSet;\n        const data = updateData.data;\n        if (changeSet.left) {\n            el.style.left = `${data.left}px`;\n        }\n        if (changeSet.top) {\n            el.style.top = `${data.top}px`;\n        }\n        if (changeSet.zIndex) {\n            el.style.zIndex = typeof data.zIndex === 'number' ? `${data.zIndex}` : '';\n        }\n        if (changeSet.width) {\n            el.style.width = typeof data.width === 'number' ? `${data.width}px` : data.width;\n        }\n        if (changeSet.height) {\n            el.style.height = typeof data.height === 'number' ? `${data.height}px` : data.height;\n        }\n        if (changeSet.transformOrigin) {\n            el.style.transformOrigin = data.transformOrigin;\n        }\n        // Update all transforms in order added to transforms object.\n        if (changeSet.transform) {\n            el.style.transform = updateData.transforms.isActive ? updateData.transforms.getCSS() : '';\n        }\n    }\n    /**\n     * Decouples updates to any parent target HTMLElement inline styles. Invoke {@link TJSPosition.elementUpdated} to\n     * await on the returned promise that is resolved with the current render time via `nextAnimationFrame` /\n     * `requestAnimationFrame`. This allows the underlying data model to be updated immediately while updates to the\n     * element are in sync with the browser and potentially in the future be further throttled.\n     *\n     * @param el - The target HTMLElement.\n     *\n     * @param updateData - Update data.\n     */\n    static #updateElementOrtho(el, updateData) {\n        const changeSet = updateData.changeSet;\n        const data = updateData.data;\n        if (changeSet.zIndex) {\n            el.style.zIndex = typeof data.zIndex === 'number' ? `${data.zIndex}` : '';\n        }\n        if (changeSet.width) {\n            el.style.width = typeof data.width === 'number' ? `${data.width}px` : data.width;\n        }\n        if (changeSet.height) {\n            el.style.height = typeof data.height === 'number' ? `${data.height}px` : data.height;\n        }\n        if (changeSet.transformOrigin) {\n            el.style.transformOrigin = data.transformOrigin;\n        }\n        // Update all transforms in order added to transforms object.\n        if (changeSet.left || changeSet.top || changeSet.transform) {\n            el.style.transform = updateData.transforms.getCSSOrtho(data);\n        }\n    }\n    /**\n     * Updates the applied transform data and sets the readable `transform` store.\n     *\n     * @param updateData - Update element data.\n     */\n    static #updateTransform(updateData) {\n        const validationData = this.#validationData;\n        validationData.height = updateData.data.height !== 'auto' && updateData.data.height !== 'inherit' ?\n            updateData.data.height : updateData.styleCache.offsetHeight;\n        validationData.width = updateData.data.width !== 'auto' && updateData.data.width !== 'inherit' ?\n            updateData.data.width : updateData.styleCache.offsetWidth;\n        validationData.marginLeft = updateData.styleCache.marginLeft;\n        validationData.marginTop = updateData.styleCache.marginTop;\n        // Get transform data. First set constraints including any margin top / left as offsets and width / height. Used\n        // when position width / height is 'auto'.\n        updateData.transforms.getData(updateData.data, updateData.transformData, validationData);\n        updateData.storeTransform.set(updateData.transformData);\n    }\n}\n\nvar _a;\n/**\n * Provides an advanced compound store for positioning elements dynamically including an optimized pipeline for updating\n * an associated element. Essential tweening / animation is supported in addition to a validation API to constrain\n * positional updates.\n */\nclass TJSPosition {\n    /**\n     * Public API for {@link TJSPosition.Initial}.\n     */\n    static #positionInitial = Object.freeze({\n        browserCentered: new Centered({ lock: true }),\n        Centered\n    });\n    /**\n     * Public API for {@link TJSPosition.Validators}\n     */\n    static #positionValidators = Object.freeze({\n        TransformBounds,\n        transformWindow: new TransformBounds({ lock: true })\n    });\n    /**\n     * Stores all position data / properties.\n     */\n    #data = Object.seal(new TJSPositionData());\n    /**\n     * Provides the animation API.\n     */\n    #animate = new AnimationAPIImpl(this, this.#data);\n    /**\n     * Provides a way to turn on / off the position handling.\n     */\n    #enabled = true;\n    /**\n     * Stores ongoing options that are set in the constructor or by transform store subscription.\n     */\n    #options = {\n        calculateTransform: false,\n        initial: void 0,\n        ortho: true,\n        transformSubscribed: false,\n    };\n    /**\n     * The associated parent for positional data tracking. Used in validators.\n     */\n    #parent;\n    /**\n     * Stores the style attributes that changed on update.\n     */\n    #positionChangeSet = new PositionChangeSet();\n    /**\n     * Tracks the current state if this position instance is a candidate for resize observation by the `resizeObserver`\n     * action. This is `true` when `width` or `height` is `auto` or `inherit`.\n     */\n    #resizeObservable = false;\n    /**\n     */\n    #stores;\n    /**\n     * Stores an instance of the computer styles for the target element.\n     */\n    #styleCache;\n    /**\n     * Stores the subscribers.\n     */\n    #subscribers = [];\n    /**\n     */\n    #transforms = new TJSTransforms();\n    /**\n     */\n    #updateElementData;\n    /**\n     * Stores the UpdateElementManager wait promise.\n     */\n    #updateElementPromise;\n    /**\n     */\n    #validators;\n    /**\n     */\n    #validatorData;\n    /**\n     */\n    #state = new PositionStateAPI(this, this.#data, this.#transforms);\n    /**\n     * @returns Public Animation Group API.\n     */\n    static get Animate() { return AnimationGroupAPIImpl; }\n    /**\n     * @returns TJSPositionData constructor.\n     */\n    static get Data() { return TJSPositionData; }\n    /**\n     * @returns TJSPosition default initial systems.\n     */\n    static get Initial() { return this.#positionInitial; }\n    /**\n     * @returns `SystemBase` constructor.\n     */\n    static get SystemBase() { return SystemBase; }\n    /**\n     * Returns TJSTransformData class / constructor.\n     *\n     * @returns TransformData class / constructor.\n     */\n    static get TransformData() { return TJSTransformData; }\n    /**\n     * Returns default validator systems.\n     *\n     * @returns Available validators.\n     */\n    static get Validators() { return this.#positionValidators; }\n    /**\n     * Returns a list of supported transform origins.\n     *\n     * @returns The supported transform origin strings.\n     */\n    static get transformOrigins() {\n        return TJSTransforms.transformOrigins;\n    }\n    /**\n     * Convenience to copy from source to target of two TJSPositionData like objects. If a target is not supplied a new\n     * {@link TJSPositionData} instance is created.\n     *\n     * @param source - The source instance to copy from.\n     *\n     * @param [target] - Target TJSPositionData like object; if one is not provided a new instance is created.\n     *\n     * @returns The target instance with all TJSPositionData fields.\n     */\n    static copyData(source, target) {\n        return TJSPositionDataUtil.copyData(source, target);\n    }\n    /**\n     * Returns a duplicate of a given position instance copying any options and validators. The position parent is not\n     * copied and a new one must be set manually via the {@link TJSPosition.parent} setter.\n     *\n     * @param position - A position instance.\n     *\n     * @param [options] - Unique new options to set.\n     *\n     * @returns A duplicate position instance.\n     */\n    static duplicate(position, options = {}) {\n        if (!(position instanceof _a)) {\n            throw new TypeError(`'position' is not an instance of TJSPosition.`);\n        }\n        const newPosition = new _a(options);\n        newPosition.#options = Object.assign({}, position.#options, options);\n        newPosition.#validators.add(...position.#validators);\n        newPosition.set(position.#data);\n        return newPosition;\n    }\n    /**\n     * @param [parentOrOptions] - A  potential parent element or object w/ `elementTarget` accessor. You may also forego\n     *        setting the parent and pass in the options object.\n     *\n     * @param [options] - The options object.\n     */\n    constructor(parentOrOptions, options) {\n        // Test if `parent` is a plain object; if so treat as options object.\n        if (isPlainObject(parentOrOptions)) {\n            options = parentOrOptions;\n        }\n        else {\n            this.#parent = parentOrOptions;\n        }\n        this.#styleCache = new TJSPositionStyleCache();\n        const updateData = new UpdateElementData(this.#positionChangeSet, this.#data, this.#options, this.#styleCache, this.#subscribers, this.#transforms);\n        this.#updateElementData = updateData;\n        // Set TJSPosition options -------------------------------------------------------------------------------------\n        if (typeof options?.calculateTransform === 'boolean') {\n            this.#options.calculateTransform = options.calculateTransform;\n        }\n        if (typeof options?.ortho === 'boolean') {\n            this.#options.ortho = options.ortho;\n        }\n        // Initialize stores -------------------------------------------------------------------------------------------\n        this.#stores = Object.freeze({\n            // The main properties for manipulating TJSPosition.\n            height: propertyStore(this, 'height'),\n            left: propertyStore(this, 'left'),\n            rotateX: propertyStore(this, 'rotateX'),\n            rotateY: propertyStore(this, 'rotateY'),\n            rotateZ: propertyStore(this, 'rotateZ'),\n            scale: propertyStore(this, 'scale'),\n            top: propertyStore(this, 'top'),\n            transformOrigin: propertyStore(this, 'transformOrigin'),\n            translateX: propertyStore(this, 'translateX'),\n            translateY: propertyStore(this, 'translateY'),\n            translateZ: propertyStore(this, 'translateZ'),\n            width: propertyStore(this, 'width'),\n            zIndex: propertyStore(this, 'zIndex'),\n            // Stores that control validation when width / height is not `auto`.\n            maxHeight: propertyStore(this, 'maxHeight'),\n            maxWidth: propertyStore(this, 'maxWidth'),\n            minHeight: propertyStore(this, 'minHeight'),\n            minWidth: propertyStore(this, 'minWidth'),\n            // Readable stores based on updates or from resize observer changes.\n            dimension: { subscribe: updateData.storeDimension.subscribe },\n            element: { subscribe: this.#styleCache.stores.element.subscribe },\n            resizeContentHeight: { subscribe: this.#styleCache.stores.resizeContentHeight.subscribe },\n            resizeContentWidth: { subscribe: this.#styleCache.stores.resizeContentWidth.subscribe },\n            resizeObservable: { subscribe: this.#styleCache.stores.resizeObservable.subscribe },\n            resizeOffsetHeight: { subscribe: this.#styleCache.stores.resizeOffsetHeight.subscribe },\n            resizeOffsetWidth: { subscribe: this.#styleCache.stores.resizeOffsetWidth.subscribe },\n            transform: { subscribe: updateData.storeTransform.subscribe },\n            // Protected store that should only be set by resizeObserver action.\n            resizeObserved: this.#styleCache.stores.resizeObserved,\n        });\n        /**\n         * Define 'values' getter to retrieve static transform origins.\n         */\n        Object.defineProperty(this.#stores.transformOrigin, 'values', {\n            get: () => _a.transformOrigins\n        });\n        // When resize change from any applied `resizeObserver` action automatically set data for new validation run.\n        // A resizeObserver prop should be set to true for ApplicationShell components or usage of resizeObserver action\n        // to monitor for changes. This should only be used on elements that have 'auto' or `inherit` for width or height.\n        subscribeIgnoreFirst(this.#stores.resizeObserved, (resizeData) => {\n            const parent = this.#parent;\n            const el = A11yHelper.isFocusTarget(parent) ? parent : parent?.elementTarget;\n            // Only invoke set if there is a target element and the resize data has a valid offset width & height.\n            if (A11yHelper.isFocusTarget(el) && Number.isFinite(resizeData?.offsetWidth) &&\n                Number.isFinite(resizeData?.offsetHeight)) {\n                this.set();\n            }\n        });\n        [this.#validators, this.#validatorData] = AdapterValidators.create(() => this.set());\n        if (options?.initial) {\n            const initial = options.initial;\n            if (typeof initial?.getLeft !== 'function' || typeof initial?.getTop !== 'function') {\n                throw new Error(`'options.initial' position helper does not contain 'getLeft' and / or 'getTop' functions.`);\n            }\n            this.#options.initial = initial;\n        }\n        if (options?.validator) {\n            if (isIterable(options?.validator)) {\n                this.validators.add(...options.validator);\n            }\n            else {\n                /**\n                 */\n                const validatorFn = options.validator;\n                this.validators.add(validatorFn);\n            }\n        }\n        Object.seal(this);\n        // Set any remaining position data.\n        if (isObject(options)) {\n            this.set(options);\n        }\n    }\n    /**\n     * Returns the animation API.\n     *\n     * @returns Animation instance API.\n     */\n    get animate() {\n        return this.#animate;\n    }\n    /**\n     * Returns the dimension data for the readable store.\n     *\n     * @returns Dimension data.\n     */\n    get dimension() {\n        return this.#updateElementData.dimensionData;\n    }\n    /**\n     * Returns the enabled state.\n     *\n     * @returns Enabled state.\n     */\n    get enabled() {\n        return this.#enabled;\n    }\n    /**\n     * Returns the current HTMLElement being positioned.\n     *\n     * @returns Current HTMLElement being positioned.\n     */\n    get element() {\n        return this.#styleCache.el;\n    }\n    /**\n     * Returns a promise that is resolved on the next element update with the time of the update.\n     *\n     * @returns Promise resolved on element update.\n     */\n    get elementUpdated() {\n        return this.#updateElementPromise;\n    }\n    /**\n     * Returns the associated {@link TJSPosition.PositionParent} instance.\n     *\n     * @returns The current position parent instance.\n     */\n    get parent() { return this.#parent; }\n    /**\n     * Returns the state API.\n     *\n     * @returns TJSPosition state API.\n     */\n    get state() { return this.#state; }\n    /**\n     * Returns the derived writable stores for individual data variables.\n     *\n     * @returns Derived / writable stores.\n     */\n    get stores() { return this.#stores; }\n    /**\n     * Returns the transform data for the readable store.\n     *\n     * @returns Transform Data.\n     */\n    get transform() {\n        return this.#updateElementData.transformData;\n    }\n    /**\n     * Returns the validators.\n     *\n     * @returns Validators API\n     */\n    get validators() { return this.#validators; }\n    /**\n     * Sets the enabled state.\n     *\n     * @param enabled - New enabled state.\n     */\n    set enabled(enabled) {\n        if (typeof enabled !== 'boolean') {\n            throw new TypeError(`'enabled' is not a boolean.`);\n        }\n        this.#enabled = enabled;\n    }\n    /**\n     * Sets the associated {@link TJSPosition.PositionParent} instance. Resets the style cache and default data.\n     *\n     * @param parent - A PositionParent instance or undefined to disassociate\n     */\n    set parent(parent) {\n        if (parent !== void 0 && !A11yHelper.isFocusTarget(parent) && !isObject(parent)) {\n            throw new TypeError(`'parent' is not an HTMLElement, object, or undefined.`);\n        }\n        this.#parent = parent;\n        // Reset any stored default data & the style cache.\n        this.#state.remove({ name: '#defaultData' });\n        this.#styleCache.reset();\n        // If a parent is defined then invoke set to update any parent element.\n        if (parent) {\n            this.set(this.#data);\n        }\n    }\n    // Data accessors ----------------------------------------------------------------------------------------------------\n    /**\n     * @returns height\n     */\n    get height() { return this.#data.height; }\n    /**\n     * @returns left\n     */\n    get left() { return this.#data.left; }\n    /**\n     * @returns maxHeight\n     */\n    get maxHeight() { return this.#data.maxHeight; }\n    /**\n     * @returns maxWidth\n     */\n    get maxWidth() { return this.#data.maxWidth; }\n    /**\n     * @returns minHeight\n     */\n    get minHeight() { return this.#data.minHeight; }\n    /**\n     * @returns minWidth\n     */\n    get minWidth() { return this.#data.minWidth; }\n    /**\n     * @returns rotateX\n     */\n    get rotateX() { return this.#data.rotateX; }\n    /**\n     * @returns rotateY\n     */\n    get rotateY() { return this.#data.rotateY; }\n    /**\n     * @returns rotateZ\n     */\n    get rotateZ() { return this.#data.rotateZ; }\n    /**\n     * @returns Alias for rotateZ\n     */\n    get rotation() { return this.#data.rotateZ; }\n    /**\n     * @returns scale\n     */\n    get scale() { return this.#data.scale; }\n    /**\n     * @returns top\n     */\n    get top() { return this.#data.top; }\n    /**\n     * @returns transformOrigin\n     */\n    get transformOrigin() { return this.#data.transformOrigin; }\n    /**\n     * @returns translateX\n     */\n    get translateX() { return this.#data.translateX; }\n    /**\n     * @returns translateY\n     */\n    get translateY() { return this.#data.translateY; }\n    /**\n     * @returns translateZ\n     */\n    get translateZ() { return this.#data.translateZ; }\n    /**\n     * @returns width\n     */\n    get width() { return this.#data.width; }\n    /**\n     * @returns z-index\n     */\n    get zIndex() { return this.#data.zIndex; }\n    /**\n     * @param height -\n     */\n    set height(height) {\n        this.#stores.height.set(height);\n    }\n    /**\n     * @param left -\n     */\n    set left(left) {\n        this.#stores.left.set(left);\n    }\n    /**\n     * @param maxHeight -\n     */\n    set maxHeight(maxHeight) {\n        this.#stores.maxHeight.set(maxHeight);\n    }\n    /**\n     * @param maxWidth -\n     */\n    set maxWidth(maxWidth) {\n        this.#stores.maxWidth.set(maxWidth);\n    }\n    /**\n     * @param minHeight -\n     */\n    set minHeight(minHeight) {\n        this.#stores.minHeight.set(minHeight);\n    }\n    /**\n     * @param minWidth -\n     */\n    set minWidth(minWidth) {\n        this.#stores.minWidth.set(minWidth);\n    }\n    /**\n     * @param rotateX -\n     */\n    set rotateX(rotateX) {\n        this.#stores.rotateX.set(rotateX);\n    }\n    /**\n     * @param rotateY -\n     */\n    set rotateY(rotateY) {\n        this.#stores.rotateY.set(rotateY);\n    }\n    /**\n     * @param rotateZ -\n     */\n    set rotateZ(rotateZ) {\n        this.#stores.rotateZ.set(rotateZ);\n    }\n    /**\n     * @param  rotateZ - alias for rotateZ\n     */\n    set rotation(rotateZ) {\n        this.#stores.rotateZ.set(rotateZ);\n    }\n    /**\n     * @param scale -\n     */\n    set scale(scale) {\n        this.#stores.scale.set(scale);\n    }\n    /**\n     * @param top -\n     */\n    set top(top) {\n        this.#stores.top.set(top);\n    }\n    /**\n     * @param transformOrigin -\n     */\n    set transformOrigin(transformOrigin) {\n        if (TJSTransforms.transformOrigins.includes(transformOrigin)) {\n            this.#stores.transformOrigin.set(transformOrigin);\n        }\n    }\n    /**\n     * @param translateX -\n     */\n    set translateX(translateX) {\n        this.#stores.translateX.set(translateX);\n    }\n    /**\n     * @param translateY -\n     */\n    set translateY(translateY) {\n        this.#stores.translateY.set(translateY);\n    }\n    /**\n     * @param translateZ -\n     */\n    set translateZ(translateZ) {\n        this.#stores.translateZ.set(translateZ);\n    }\n    /**\n     * @param width -\n     */\n    set width(width) {\n        this.#stores.width.set(width);\n    }\n    /**\n     * @param zIndex -\n     */\n    set zIndex(zIndex) {\n        this.#stores.zIndex.set(zIndex);\n    }\n    /**\n     * Assigns current position data to given object `data` object. By default, `null` position data is not assigned.\n     * Other options allow configuration of the data assigned including setting default numeric values for any properties\n     * that are null.\n     *\n     * @param [data] - Target to assign current position data.\n     *\n     * @param [options] - Defines options for specific keys and substituting null for numeric default values. By\n     *        default, nullable keys are included.\n     *\n     * @returns Passed in object with current position data.\n     */\n    get(data = {}, options = {}) {\n        const keys = options?.keys;\n        const excludeKeys = options?.exclude;\n        const nullable = options?.nullable ?? true;\n        const numeric = options?.numeric ?? false;\n        if (isIterable(keys)) {\n            for (const key of keys) {\n                // Convert any null values to numeric defaults if `numeric` is true.\n                data[key] = numeric ? TJSPositionDataUtil.getDataOrDefault(this, key) : this[key];\n                // Potentially remove null keys.\n                if (!nullable && data[key] === null) {\n                    delete data[key];\n                }\n            }\n            // Remove any excluded keys.\n            if (isIterable(excludeKeys)) {\n                for (const key of excludeKeys) {\n                    delete data[key];\n                }\n            }\n            return data;\n        }\n        else {\n            data = Object.assign(data, this.#data);\n            // Remove any excluded keys.\n            if (isIterable(excludeKeys)) {\n                for (const key of excludeKeys) {\n                    delete data[key];\n                }\n            }\n            // Potentially set numeric defaults.\n            if (numeric) {\n                TJSPositionDataUtil.setNumericDefaults(data);\n            }\n            if (!nullable) {\n                for (const key in data) {\n                    if (data[key] === null) {\n                        delete data[key];\n                    }\n                }\n            }\n            return data;\n        }\n    }\n    /**\n     * @returns Current position data.\n     */\n    toJSON() {\n        return Object.assign({}, this.#data);\n    }\n    /**\n     * All calculation and updates of position are implemented in {@link TJSPosition}. This allows position to be fully\n     * reactive and in control of updating inline styles for a connected {@link HTMLElement}.\n     *\n     * The initial set call with a target element will always set width / height as this is necessary for correct\n     * calculations.\n     *\n     * When a target element is present updated styles are applied after validation. To modify the behavior of set\n     * implement one or more validator functions and add them via the validator API available from\n     * {@link TJSPosition.validators}.\n     *\n     * Updates to any target element are decoupled from the underlying TJSPosition data. This method returns this\n     * instance that you can then await on the target element inline style update by using\n     * {@link TJSPosition.elementUpdated}.\n     *\n     * Relative updates to any property of {@link TJSPositionData} are possible by specifying properties as strings.\n     * This string should be in the form of '+=', '-=', or '*=' and float / numeric value. IE '+=0.2'.\n     * {@link TJSPosition.set} will apply the `addition`, `subtraction`, or `multiplication` operation specified against\n     * the current value of the given property. Please see {@link Data.TJSPositionDataRelative} for a detailed\n     * description.\n     *\n     * @param [position] - TJSPosition data to set.\n     *\n     * @param [options] - Additional options.\n     *\n     * @returns This TJSPosition instance.\n     */\n    set(position = {}, options = {}) {\n        if (!isObject(position)) {\n            throw new TypeError(`TJSPosition - set error: 'position' is not an object.`);\n        }\n        // TJSPosition.PositionParent\n        const parent = this.#parent;\n        // An early out to prevent `set` from taking effect if not enabled.\n        if (!this.#enabled) {\n            return this;\n        }\n        // An early out to prevent `set` from taking effect if options `positionable` is false.\n        // TODO: THIS IS REFERENCING APPLICATION OPTIONS.\n        if (parent !== void 0 && typeof parent?.options?.positionable === 'boolean' && !parent?.options?.positionable) {\n            return this;\n        }\n        const immediateElementUpdate = options?.immediateElementUpdate ?? false;\n        const data = this.#data;\n        const transforms = this.#transforms;\n        // Find the target HTML element and verify that it is connected storing it in `el`.\n        const targetEl = A11yHelper.isFocusTarget(parent) ? parent : parent?.elementTarget;\n        const el = A11yHelper.isFocusTarget(targetEl) && targetEl.isConnected ? targetEl :\n            void 0;\n        const changeSet = this.#positionChangeSet;\n        const styleCache = this.#styleCache;\n        if (el) {\n            // Cache the computed styles of the element.\n            if (!styleCache.hasData(el)) {\n                styleCache.update(el);\n                // Add will-change property if not already set in inline or computed styles.\n                if (!styleCache.hasWillChange) ;\n                // Update all properties / clear queued state.\n                changeSet.set(true);\n                this.#updateElementData.queued = false;\n            }\n            // Converts any string position data to numeric inputs.\n            ConvertStringData.process(position, this.#data, el);\n            position = this.#updatePosition(position, parent, el, styleCache);\n            // Check if a validator cancelled the update.\n            if (position === null) {\n                return this;\n            }\n        }\n        if (NumberGuard.isFinite(position.left)) {\n            position.left = Math.round(position.left);\n            if (data.left !== position.left) {\n                data.left = position.left;\n                changeSet.left = true;\n            }\n        }\n        if (NumberGuard.isFinite(position.top)) {\n            position.top = Math.round(position.top);\n            if (data.top !== position.top) {\n                data.top = position.top;\n                changeSet.top = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.maxHeight)) {\n            position.maxHeight = typeof position.maxHeight === 'number' ? Math.round(position.maxHeight) : null;\n            if (data.maxHeight !== position.maxHeight) {\n                data.maxHeight = position.maxHeight;\n                changeSet.maxHeight = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.maxWidth)) {\n            position.maxWidth = typeof position.maxWidth === 'number' ? Math.round(position.maxWidth) : null;\n            if (data.maxWidth !== position.maxWidth) {\n                data.maxWidth = position.maxWidth;\n                changeSet.maxWidth = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.minHeight)) {\n            position.minHeight = typeof position.minHeight === 'number' ? Math.round(position.minHeight) : null;\n            if (data.minHeight !== position.minHeight) {\n                data.minHeight = position.minHeight;\n                changeSet.minHeight = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.minWidth)) {\n            position.minWidth = typeof position.minWidth === 'number' ? Math.round(position.minWidth) : null;\n            if (data.minWidth !== position.minWidth) {\n                data.minWidth = position.minWidth;\n                changeSet.minWidth = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.rotateX)) {\n            if (data.rotateX !== position.rotateX) {\n                data.rotateX = transforms.rotateX = position.rotateX;\n                changeSet.transform = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.rotateY)) {\n            if (data.rotateY !== position.rotateY) {\n                data.rotateY = transforms.rotateY = position.rotateY;\n                changeSet.transform = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.rotateZ)) {\n            if (data.rotateZ !== position.rotateZ) {\n                data.rotateZ = transforms.rotateZ = position.rotateZ;\n                changeSet.transform = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.scale)) {\n            position.scale = typeof position.scale === 'number' ? clamp(position.scale, 0, 1000) : null;\n            if (data.scale !== position.scale) {\n                data.scale = transforms.scale = position.scale;\n                changeSet.transform = true;\n            }\n        }\n        if ((typeof position.transformOrigin === 'string' && TJSTransforms.transformOrigins.includes(position.transformOrigin)) || position.transformOrigin === null) {\n            if (data.transformOrigin !== position.transformOrigin) {\n                data.transformOrigin = position.transformOrigin;\n                changeSet.transformOrigin = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.translateX)) {\n            if (data.translateX !== position.translateX) {\n                data.translateX = transforms.translateX = position.translateX;\n                changeSet.transform = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.translateY)) {\n            if (data.translateY !== position.translateY) {\n                data.translateY = transforms.translateY = position.translateY;\n                changeSet.transform = true;\n            }\n        }\n        if (NumberGuard.isFiniteOrNull(position.translateZ)) {\n            if (data.translateZ !== position.translateZ) {\n                data.translateZ = transforms.translateZ = position.translateZ;\n                changeSet.transform = true;\n            }\n        }\n        if (NumberGuard.isFinite(position.zIndex)) {\n            position.zIndex = Math.round(position.zIndex);\n            if (data.zIndex !== position.zIndex) {\n                data.zIndex = position.zIndex;\n                changeSet.zIndex = true;\n            }\n        }\n        const widthIsObservable = position.width === 'auto' || position.width === 'inherit';\n        if (NumberGuard.isFiniteOrNull(position.width) || widthIsObservable) {\n            position.width = typeof position.width === 'number' ? Math.round(position.width) : position.width;\n            if (data.width !== position.width) {\n                data.width = position.width;\n                changeSet.width = true;\n            }\n        }\n        const heightIsObservable = position.height === 'auto' || position.height === 'inherit';\n        if (NumberGuard.isFiniteOrNull(position.height) || heightIsObservable) {\n            position.height = typeof position.height === 'number' ? Math.round(position.height) : position.height;\n            if (data.height !== position.height) {\n                data.height = position.height;\n                changeSet.height = true;\n            }\n        }\n        // Potentially update the `resizeObservable` store when the state of `width` or `height` changes between\n        // `auto` / `inherit` to a number or null.\n        const resizeObservable = widthIsObservable || heightIsObservable;\n        if (this.#resizeObservable !== resizeObservable) {\n            this.#resizeObservable = resizeObservable;\n            // Set store on next clock tick.\n            // setTimeout(() => this.#styleCache.stores.resizeObservable.set(resizeObservable), 0);\n            this.#styleCache.stores.resizeObservable.set(resizeObservable);\n        }\n        if (el) {\n            const defaultData = this.#state.getDefault();\n            // Set default data after first set operation that has a target element.\n            if (!isObject(defaultData)) {\n                this.#state.save({ name: '#defaultData', ...Object.assign({}, data) });\n            }\n            // If `immediateElementUpdate` is true then update the element immediately. This is for rAF based library\n            // integrations like GSAP and updates coming from AnimationManager.\n            if (immediateElementUpdate) {\n                UpdateElementManager.immediate(el, this.#updateElementData);\n                this.#updateElementPromise = Promise.resolve(globalThis.performance.now());\n            }\n            // Else if not queued then queue an update for the next rAF callback.\n            else if (!this.#updateElementData.queued) {\n                this.#updateElementPromise = UpdateElementManager.add(el, this.#updateElementData);\n            }\n        }\n        else {\n            // Notify main store subscribers.\n            UpdateElementManager.updateSubscribers(this.#updateElementData);\n        }\n        return this;\n    }\n    /**\n     * @param handler - Callback function that is invoked on update / changes. Receives a readonly copy of the\n     *        TJSPositionData.\n     *\n     * @returns Unsubscribe function.\n     */\n    subscribe(handler) {\n        const currentIdx = this.#subscribers.findIndex((entry) => entry === handler);\n        if (currentIdx === -1) {\n            this.#subscribers.push(handler); // add handler to the array of subscribers\n            handler(Object.assign({}, this.#data)); // call handler with current value\n        }\n        // Return unsubscribe function.\n        return () => {\n            const existingIdx = this.#subscribers.findIndex((entry) => entry === handler);\n            if (existingIdx !== -1) {\n                this.#subscribers.splice(existingIdx, 1);\n            }\n        };\n    }\n    /**\n     * Provides the {@link Writable} store `update` method. Receive and return a {@link TJSPositionData} instance to\n     * update the position state. You may manipulate numeric properties by providing relative adjustments described in\n     * {@link TJSPositionDataRelative}.\n     *\n     * @param updater -\n     */\n    update(updater) {\n        const result = updater(this.get());\n        if (!isObject(result)) {\n            throw new TypeError(`'result' of 'updater' is not an object.`);\n        }\n        this.set(result);\n    }\n    // Internal Implementation ----------------------------------------------------------------------------------------\n    /**\n     * Temporary data storage for `TJSPosition.#updatePosition`.\n     */\n    static #updateDataCopy = Object.seal(new TJSPositionData());\n    /**\n     * Temporary data storage for `TJSPosition.#updatePosition`.\n     */\n    static #validationData = Object.seal({\n        position: void 0,\n        parent: void 0,\n        el: void 0,\n        computed: void 0,\n        transforms: void 0,\n        height: void 0,\n        width: void 0,\n        marginLeft: void 0,\n        marginTop: void 0,\n        maxHeight: void 0,\n        maxWidth: void 0,\n        minHeight: void 0,\n        minWidth: void 0,\n        rest: void 0\n    });\n    /**\n     * @param data -\n     *\n     * @param parent -\n     *\n     * @param el -\n     *\n     * @param styleCache -\n     *\n     * @returns Updated position data or null if validation fails.\n     */\n    #updatePosition({ \n    // Directly supported parameters\n    left, top, maxWidth, maxHeight, minWidth, minHeight, width, height, rotateX, rotateY, rotateZ, scale, transformOrigin, translateX, translateY, translateZ, zIndex, \n    // Aliased parameters\n    rotation, ...rest }, parent, el, styleCache) {\n        let currentPosition = TJSPositionDataUtil.copyData(this.#data, _a.#updateDataCopy);\n        // Update width if an explicit value is passed, or if no width value is set on the element.\n        if (width !== void 0 || el.style.width === '') {\n            const widthValid = width === null || Number.isFinite(width);\n            if (width === 'auto' || (currentPosition.width === 'auto' && !widthValid)) {\n                currentPosition.width = 'auto';\n                width = styleCache.offsetWidth;\n            }\n            else if (width === 'inherit' || (currentPosition.width === 'inherit' && !widthValid)) {\n                currentPosition.width = 'inherit';\n                width = styleCache.offsetWidth;\n            }\n            else {\n                const newWidth = NumberGuard.isFinite(width) ? width :\n                    currentPosition.width;\n                currentPosition.width = width = NumberGuard.isFinite(newWidth) ? Math.round(newWidth) :\n                    styleCache.offsetWidth;\n            }\n        }\n        else {\n            width = Number.isFinite(currentPosition.width) ? currentPosition.width : styleCache.offsetWidth;\n        }\n        // Update height if an explicit value is passed, or if no height value is set on the element.\n        if (height !== void 0 || el.style.height === '') {\n            const heightValid = height === null || Number.isFinite(height);\n            if (height === 'auto' || (currentPosition.height === 'auto' && !heightValid)) {\n                currentPosition.height = 'auto';\n                height = styleCache.offsetHeight;\n            }\n            else if (height === 'inherit' || (currentPosition.height === 'inherit' && !heightValid)) {\n                currentPosition.height = 'inherit';\n                height = styleCache.offsetHeight;\n            }\n            else {\n                const newHeight = NumberGuard.isFinite(height) ? height :\n                    currentPosition.height;\n                currentPosition.height = height = NumberGuard.isFinite(newHeight) ? Math.round(newHeight) :\n                    styleCache.offsetHeight;\n            }\n        }\n        else {\n            height = Number.isFinite(currentPosition.height) ? currentPosition.height : styleCache.offsetHeight;\n        }\n        // Update left\n        if (NumberGuard.isFinite(left)) {\n            currentPosition.left = left;\n        }\n        else if (!Number.isFinite(currentPosition.left)) {\n            // Potentially use any initial position helper if available or set to 0.\n            currentPosition.left = typeof this.#options?.initial?.getLeft === 'function' ?\n                this.#options.initial.getLeft(width) : 0;\n        }\n        // Update top\n        if (Number.isFinite(top)) {\n            currentPosition.top = top;\n        }\n        else if (!Number.isFinite(currentPosition.top)) {\n            // Potentially use any initial position helper if available or set to 0.\n            currentPosition.top = typeof this.#options?.initial?.getTop === 'function' ?\n                this.#options.initial.getTop(height) : 0;\n        }\n        if (NumberGuard.isFiniteOrNull(maxHeight)) {\n            currentPosition.maxHeight = NumberGuard.isFinite(maxHeight) ? Math.round(maxHeight) : null;\n        }\n        if (NumberGuard.isFiniteOrNull(maxWidth)) {\n            currentPosition.maxWidth = NumberGuard.isFinite(maxWidth) ? Math.round(maxWidth) : null;\n        }\n        if (NumberGuard.isFiniteOrNull(minHeight)) {\n            currentPosition.minHeight = NumberGuard.isFinite(minHeight) ? Math.round(minHeight) : null;\n        }\n        if (NumberGuard.isFiniteOrNull(minWidth)) {\n            currentPosition.minWidth = NumberGuard.isFinite(minWidth) ? Math.round(minWidth) : null;\n        }\n        // Update rotate X/Y/Z, scale, z-index\n        if (NumberGuard.isFiniteOrNull(rotateX)) {\n            currentPosition.rotateX = rotateX;\n        }\n        if (NumberGuard.isFiniteOrNull(rotateY)) {\n            currentPosition.rotateY = rotateY;\n        }\n        // Handle alias for rotateZ. First check if `rotateZ` is valid and different from the current value. Next check if\n        // `rotation` is valid and use it for `rotateZ`.\n        if (rotateZ !== currentPosition.rotateZ && (NumberGuard.isFiniteOrNull(rotateZ))) {\n            currentPosition.rotateZ = rotateZ;\n        }\n        else if (rotation !== currentPosition.rotateZ && (NumberGuard.isFiniteOrNull(rotation))) {\n            currentPosition.rotateZ = rotation;\n        }\n        if (NumberGuard.isFiniteOrNull(translateX)) {\n            currentPosition.translateX = translateX;\n        }\n        if (NumberGuard.isFiniteOrNull(translateY)) {\n            currentPosition.translateY = translateY;\n        }\n        if (NumberGuard.isFiniteOrNull(translateZ)) {\n            currentPosition.translateZ = translateZ;\n        }\n        if (NumberGuard.isFiniteOrNull(scale)) {\n            currentPosition.scale = typeof scale === 'number' ? clamp(scale, 0, 1000) : null;\n        }\n        if (typeof transformOrigin === 'string' || transformOrigin === null) {\n            currentPosition.transformOrigin = TJSTransforms.transformOrigins.includes(transformOrigin) ? transformOrigin :\n                null;\n        }\n        if (NumberGuard.isFiniteOrNull(zIndex)) {\n            currentPosition.zIndex = typeof zIndex === 'number' ? Math.round(zIndex) : zIndex;\n        }\n        const validatorData = this.#validatorData;\n        // If there are any validators allow them to potentially modify position data or reject the update.\n        if (this.#validators.enabled && validatorData.length) {\n            const validationData = _a.#validationData;\n            validationData.parent = parent;\n            validationData.el = el;\n            validationData.computed = styleCache.computed;\n            validationData.transforms = this.#transforms;\n            validationData.height = height;\n            validationData.width = width;\n            validationData.marginLeft = styleCache.marginLeft;\n            validationData.marginTop = styleCache.marginTop;\n            validationData.maxHeight = styleCache.maxHeight ?? currentPosition.maxHeight;\n            validationData.maxWidth = styleCache.maxWidth ?? currentPosition.maxWidth;\n            // Given a parent w/ reactive state and is minimized ignore styleCache min-width/height.\n            // TODO: THIS IS REFERENCING APPLICATION OPTIONS.\n            const isMinimized = parent?.reactive?.minimized ?? false;\n            // Note the use of || for accessing the style cache as the left hand is ignored w/ falsy values such as '0'.\n            validationData.minHeight = isMinimized ? currentPosition.minHeight ?? 0 :\n                styleCache.minHeight || (currentPosition.minHeight ?? 0);\n            validationData.minWidth = isMinimized ? currentPosition.minWidth ?? 0 :\n                styleCache.minWidth || (currentPosition.minWidth ?? 0);\n            for (let cntr = 0; cntr < validatorData.length; cntr++) {\n                validationData.position = currentPosition;\n                validationData.rest = rest;\n                currentPosition = validatorData[cntr].validate(validationData);\n                if (currentPosition === null) {\n                    return null;\n                }\n            }\n        }\n        // Return the updated position object.\n        return currentPosition;\n    }\n}\n_a = TJSPosition;\n\nexport { TJSPosition, applyPosition, draggable };\n//# sourceMappingURL=index.js.map\n","import { PUBLIC_VERSION } from '../../../shared/version.js';\n\nif (typeof window !== 'undefined')\n\t// @ts-ignore\n\t(window.__svelte || (window.__svelte = { v: new Set() })).v.add(PUBLIC_VERSION);\n","import { cubicOut, cubicInOut, linear } from '../easing/index.js';\nimport { assign, split_css_unit, is_function } from '../internal/index.js';\n\n/**\n * Animates a `blur` filter alongside an element's opacity.\n *\n * https://svelte.dev/docs/svelte-transition#blur\n * @param {Element} node\n * @param {import('./public').BlurParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function blur(\n\tnode,\n\t{ delay = 0, duration = 400, easing = cubicInOut, amount = 5, opacity = 0 } = {}\n) {\n\tconst style = getComputedStyle(node);\n\tconst target_opacity = +style.opacity;\n\tconst f = style.filter === 'none' ? '' : style.filter;\n\tconst od = target_opacity * (1 - opacity);\n\tconst [value, unit] = split_css_unit(amount);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (_t, u) => `opacity: ${target_opacity - od * u}; filter: ${f} blur(${u * value}${unit});`\n\t};\n}\n\n/**\n * Animates the opacity of an element from 0 to the current opacity for `in` transitions and from the current opacity to 0 for `out` transitions.\n *\n * https://svelte.dev/docs/svelte-transition#fade\n * @param {Element} node\n * @param {import('./public').FadeParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function fade(node, { delay = 0, duration = 400, easing = linear } = {}) {\n\tconst o = +getComputedStyle(node).opacity;\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (t) => `opacity: ${t * o}`\n\t};\n}\n\n/**\n * Animates the x and y positions and the opacity of an element. `in` transitions animate from the provided values, passed as parameters to the element's default values. `out` transitions animate from the element's default values to the provided values.\n *\n * https://svelte.dev/docs/svelte-transition#fly\n * @param {Element} node\n * @param {import('./public').FlyParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function fly(\n\tnode,\n\t{ delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}\n) {\n\tconst style = getComputedStyle(node);\n\tconst target_opacity = +style.opacity;\n\tconst transform = style.transform === 'none' ? '' : style.transform;\n\tconst od = target_opacity * (1 - opacity);\n\tconst [xValue, xUnit] = split_css_unit(x);\n\tconst [yValue, yUnit] = split_css_unit(y);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (t, u) => `\n\t\t\ttransform: ${transform} translate(${(1 - t) * xValue}${xUnit}, ${(1 - t) * yValue}${yUnit});\n\t\t\topacity: ${target_opacity - od * u}`\n\t};\n}\n\n/**\n * Slides an element in and out.\n *\n * https://svelte.dev/docs/svelte-transition#slide\n * @param {Element} node\n * @param {import('./public').SlideParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = 'y' } = {}) {\n\tconst style = getComputedStyle(node);\n\tconst opacity = +style.opacity;\n\tconst primary_property = axis === 'y' ? 'height' : 'width';\n\tconst primary_property_value = parseFloat(style[primary_property]);\n\tconst secondary_properties = axis === 'y' ? ['top', 'bottom'] : ['left', 'right'];\n\tconst capitalized_secondary_properties = secondary_properties.map(\n\t\t(e) => `${e[0].toUpperCase()}${e.slice(1)}`\n\t);\n\tconst padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);\n\tconst padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);\n\tconst margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);\n\tconst margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);\n\tconst border_width_start_value = parseFloat(\n\t\tstyle[`border${capitalized_secondary_properties[0]}Width`]\n\t);\n\tconst border_width_end_value = parseFloat(\n\t\tstyle[`border${capitalized_secondary_properties[1]}Width`]\n\t);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (t) =>\n\t\t\t'overflow: hidden;' +\n\t\t\t`opacity: ${Math.min(t * 20, 1) * opacity};` +\n\t\t\t`${primary_property}: ${t * primary_property_value}px;` +\n\t\t\t`padding-${secondary_properties[0]}: ${t * padding_start_value}px;` +\n\t\t\t`padding-${secondary_properties[1]}: ${t * padding_end_value}px;` +\n\t\t\t`margin-${secondary_properties[0]}: ${t * margin_start_value}px;` +\n\t\t\t`margin-${secondary_properties[1]}: ${t * margin_end_value}px;` +\n\t\t\t`border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;` +\n\t\t\t`border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`\n\t};\n}\n\n/**\n * Animates the opacity and scale of an element. `in` transitions animate from an element's current (default) values to the provided values, passed as parameters. `out` transitions animate from the provided values to an element's default values.\n *\n * https://svelte.dev/docs/svelte-transition#scale\n * @param {Element} node\n * @param {import('./public').ScaleParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function scale(\n\tnode,\n\t{ delay = 0, duration = 400, easing = cubicOut, start = 0, opacity = 0 } = {}\n) {\n\tconst style = getComputedStyle(node);\n\tconst target_opacity = +style.opacity;\n\tconst transform = style.transform === 'none' ? '' : style.transform;\n\tconst sd = 1 - start;\n\tconst od = target_opacity * (1 - opacity);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (_t, u) => `\n\t\t\ttransform: ${transform} scale(${1 - sd * u});\n\t\t\topacity: ${target_opacity - od * u}\n\t\t`\n\t};\n}\n\n/**\n * Animates the stroke of an SVG element, like a snake in a tube. `in` transitions begin with the path invisible and draw the path to the screen over time. `out` transitions start in a visible state and gradually erase the path. `draw` only works with elements that have a `getTotalLength` method, like `<path>` and `<polyline>`.\n *\n * https://svelte.dev/docs/svelte-transition#draw\n * @param {SVGElement & { getTotalLength(): number }} node\n * @param {import('./public').DrawParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function draw(node, { delay = 0, speed, duration, easing = cubicInOut } = {}) {\n\tlet len = node.getTotalLength();\n\tconst style = getComputedStyle(node);\n\tif (style.strokeLinecap !== 'butt') {\n\t\tlen += parseInt(style.strokeWidth);\n\t}\n\tif (duration === undefined) {\n\t\tif (speed === undefined) {\n\t\t\tduration = 800;\n\t\t} else {\n\t\t\tduration = len / speed;\n\t\t}\n\t} else if (typeof duration === 'function') {\n\t\tduration = duration(len);\n\t}\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (_, u) => `\n\t\t\tstroke-dasharray: ${len};\n\t\t\tstroke-dashoffset: ${u * len};\n\t\t`\n\t};\n}\n\n/**\n * The `crossfade` function creates a pair of [transitions](https://svelte.dev/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.\n *\n * https://svelte.dev/docs/svelte-transition#crossfade\n * @param {import('./public').CrossfadeParams & {\n * \tfallback?: (node: Element, params: import('./public').CrossfadeParams, intro: boolean) => import('./public').TransitionConfig;\n * }} params\n * @returns {[(node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig, (node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig]}\n */\nexport function crossfade({ fallback, ...defaults }) {\n\t/** @type {Map<any, Element>} */\n\tconst to_receive = new Map();\n\t/** @type {Map<any, Element>} */\n\tconst to_send = new Map();\n\t/**\n\t * @param {Element} from_node\n\t * @param {Element} node\n\t * @param {import('./public').CrossfadeParams} params\n\t * @returns {import('./public').TransitionConfig}\n\t */\n\tfunction crossfade(from_node, node, params) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = (d) => Math.sqrt(d) * 30,\n\t\t\teasing = cubicOut\n\t\t} = assign(assign({}, defaults), params);\n\t\tconst from = from_node.getBoundingClientRect();\n\t\tconst to = node.getBoundingClientRect();\n\t\tconst dx = from.left - to.left;\n\t\tconst dy = from.top - to.top;\n\t\tconst dw = from.width / to.width;\n\t\tconst dh = from.height / to.height;\n\t\tconst d = Math.sqrt(dx * dx + dy * dy);\n\t\tconst style = getComputedStyle(node);\n\t\tconst transform = style.transform === 'none' ? '' : style.transform;\n\t\tconst opacity = +style.opacity;\n\t\treturn {\n\t\t\tdelay,\n\t\t\tduration: is_function(duration) ? duration(d) : duration,\n\t\t\teasing,\n\t\t\tcss: (t, u) => `\n\t\t\t\topacity: ${t * opacity};\n\t\t\t\ttransform-origin: top left;\n\t\t\t\ttransform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${\n\t\t\t\tt + (1 - t) * dh\n\t\t\t});\n\t\t\t`\n\t\t};\n\t}\n\n\t/**\n\t * @param {Map<any, Element>} items\n\t * @param {Map<any, Element>} counterparts\n\t * @param {boolean} intro\n\t * @returns {(node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig}\n\t */\n\tfunction transition(items, counterparts, intro) {\n\t\treturn (node, params) => {\n\t\t\titems.set(params.key, node);\n\t\t\treturn () => {\n\t\t\t\tif (counterparts.has(params.key)) {\n\t\t\t\t\tconst other_node = counterparts.get(params.key);\n\t\t\t\t\tcounterparts.delete(params.key);\n\t\t\t\t\treturn crossfade(other_node, node, params);\n\t\t\t\t}\n\t\t\t\t// if the node is disappearing altogether\n\t\t\t\t// (i.e. wasn't claimed by the other list)\n\t\t\t\t// then we need to supply an outro\n\t\t\t\titems.delete(params.key);\n\t\t\t\treturn fallback && fallback(node, params, intro);\n\t\t\t};\n\t\t};\n\t}\n\treturn [transition(to_send, to_receive, false), transition(to_receive, to_send, true)];\n}\n","import { TJSStyleManager } from '@typhonjs-fvtt/runtime/util/dom/style';\n\nexport const cssVariables = new TJSStyleManager({ docKey: '#__trl-root-styles', version: 1 });\n","import { isWritableStore } from '@typhonjs-fvtt/runtime/svelte/store/util';\nimport { CrossWindow } from '@typhonjs-fvtt/runtime/util/browser';\nimport { StyleParse } from '@typhonjs-fvtt/runtime/util/dom/style';\nimport { isObject } from '@typhonjs-fvtt/runtime/util/object';\n\n/**\n * Provides an instance of {@link ResizeObserver} that can manage multiple elements and notify a wide range of\n * {@link ResizeObserverData.ResizeTarget} listeners. Offset width and height is also provided through caching the\n * margin and padding styles of the target element.\n *\n * The action, {@link resizeObserver}, utilizes ResizeObserverManager for automatic registration and removal\n * via Svelte.\n */\nclass ResizeObserverManager\n{\n   /** @type {Map<HTMLElement, import('./types-local').ResizeObserverSubscriber[]>} */\n   #elMap = new Map();\n\n   /** @type {ResizeObserver} */\n   #resizeObserver;\n\n   /**\n    * Defines the various shape / update type of the given target.\n    *\n    * @type {{ [key: string]: number }}\n    */\n   static #updateTypes = Object.freeze({\n      none: 0,\n      attribute: 1,\n      function: 2,\n      resizeObserved: 3,\n      setContentBounds: 4,\n      setDimension: 5,\n      storeObject: 6,\n      storesObject: 7\n   });\n\n   constructor()\n   {\n      this.#resizeObserver = new ResizeObserver((entries) =>\n      {\n         for (const entry of entries)\n         {\n            const subscribers = this.#elMap.get(entry?.target);\n\n            if (Array.isArray(subscribers))\n            {\n               const contentWidth = entry.contentRect.width;\n               const contentHeight = entry.contentRect.height;\n\n               for (const subscriber of subscribers)\n               {\n                  ResizeObserverManager.#updateSubscriber(subscriber, contentWidth, contentHeight);\n               }\n            }\n         }\n      });\n   }\n\n   /**\n    * Add an {@link HTMLElement} and {@link ResizeObserverData.ResizeTarget} instance for monitoring. Create cached\n    * style attributes for the given element include border & padding dimensions for offset width / height calculations.\n    *\n    * @param {HTMLElement}    el - The element to observe.\n    *\n    * @param {import('./types').ResizeObserverData.ResizeTarget} target - A target that contains one of several\n    *        mechanisms for updating resize data.\n    */\n   add(el, target)\n   {\n      if (!CrossWindow.isHTMLElement(el))\n      {\n         throw new TypeError(`ResizeObserverManager.add error: 'el' is not a HTMLElement.`);\n      }\n\n      // Verify that this target is not already added for this element.\n      if (this.#hasTarget(el, target)) { return; }\n\n      const updateType = ResizeObserverManager.#getUpdateType(target);\n\n      if (updateType === 0)\n      {\n         throw new Error(`ResizeObserverManager.add error: 'target' is not a valid ResizeObserverManager target.`);\n      }\n\n      const computed = globalThis.getComputedStyle(el);\n\n      // Cache styles first from any inline styles then computed styles defaulting to 0 otherwise.\n      // Used to create the offset width & height values from the context box ResizeObserver provides.\n      const borderBottom = StyleParse.pixels(el.style.borderBottom) ?? StyleParse.pixels(computed.borderBottom) ?? 0;\n      const borderLeft = StyleParse.pixels(el.style.borderLeft) ?? StyleParse.pixels(computed.borderLeft) ?? 0;\n      const borderRight = StyleParse.pixels(el.style.borderRight) ?? StyleParse.pixels(computed.borderRight) ?? 0;\n      const borderTop = StyleParse.pixels(el.style.borderTop) ?? StyleParse.pixels(computed.borderTop) ?? 0;\n      const paddingBottom = StyleParse.pixels(el.style.paddingBottom) ?? StyleParse.pixels(computed.paddingBottom) ?? 0;\n      const paddingLeft = StyleParse.pixels(el.style.paddingLeft) ?? StyleParse.pixels(computed.paddingLeft) ?? 0;\n      const paddingRight = StyleParse.pixels(el.style.paddingRight) ?? StyleParse.pixels(computed.paddingRight) ?? 0;\n      const paddingTop = StyleParse.pixels(el.style.paddingTop) ?? StyleParse.pixels(computed.paddingTop) ?? 0;\n\n      /** @type {import('./types-local').ResizeObserverSubscriber} */\n      const data = {\n         updateType,\n         target,\n\n         // Stores most recent contentRect.width and contentRect.height values from ResizeObserver.\n         contentWidth: 0,\n         contentHeight: 0,\n\n         // Convenience data for total border & padding for offset width & height calculations.\n         styles: {\n            additionalWidth: borderLeft + borderRight + paddingLeft + paddingRight,\n            additionalHeight: borderTop + borderBottom + paddingTop + paddingBottom\n         }\n      };\n\n      if (this.#elMap.has(el))\n      {\n         const subscribers = this.#elMap.get(el);\n         subscribers.push(data);\n      }\n      else\n      {\n         this.#elMap.set(el, [data]);\n      }\n\n      this.#resizeObserver.observe(el);\n   }\n\n   /**\n    * Clears and unobserves all currently tracked elements and managed targets.\n    */\n   clear()\n   {\n      for (const el of this.#elMap.keys()) { this.#resizeObserver.unobserve(el); }\n\n      this.#elMap.clear();\n   }\n\n   /**\n    * Removes all {@link ResizeObserverData.ResizeTarget} instances for the given element from monitoring when just an\n    * element is provided otherwise removes a specific target from the monitoring map. If no more targets remain then\n    * the element is removed from monitoring.\n    *\n    * @param {HTMLElement} el - Element to remove from monitoring.\n    *\n    * @param {import('./types').ResizeObserverData.ResizeTarget} [target] - A specific target to remove from monitoring.\n    */\n   remove(el, target = void 0)\n   {\n      const subscribers = this.#elMap.get(el);\n      if (Array.isArray(subscribers))\n      {\n         // Remove specific target from subscribers.\n         if (target !== void 0)\n         {\n            const index = subscribers.findIndex((entry) => entry.target === target);\n            if (index >= 0)\n            {\n               subscribers.splice(index, 1);\n            }\n         }\n         else\n         {\n            // Remove all subscribers.\n            subscribers.length = 0;\n         }\n\n         // Remove element monitoring if last target removed.\n         if (subscribers.length === 0)\n         {\n            this.#elMap.delete(el);\n            this.#resizeObserver.unobserve(el);\n         }\n      }\n   }\n\n   /**\n    * Provides a function that when invoked with an element updates the cached styles for each subscriber of the\n    * element.\n    *\n    * The style attributes cached to calculate offset height / width include border & padding dimensions. You only need\n    * to update the cache if you change border or padding attributes of the element.\n    *\n    * @param {HTMLElement} el - A HTML element.\n    */\n   updateCache(el)\n   {\n      const subscribers = this.#elMap.get(el);\n\n      if (Array.isArray(subscribers))\n      {\n         const computed = globalThis.getComputedStyle(el);\n\n         // Cache styles first from any inline styles then computed styles defaulting to 0 otherwise.\n         // Used to create the offset width & height values from the context box ResizeObserver provides.\n         const borderBottom = StyleParse.pixels(el.style.borderBottom) ?? StyleParse.pixels(computed.borderBottom) ?? 0;\n         const borderLeft = StyleParse.pixels(el.style.borderLeft) ?? StyleParse.pixels(computed.borderLeft) ?? 0;\n         const borderRight = StyleParse.pixels(el.style.borderRight) ?? StyleParse.pixels(computed.borderRight) ?? 0;\n         const borderTop = StyleParse.pixels(el.style.borderTop) ?? StyleParse.pixels(computed.borderTop) ?? 0;\n         const paddingBottom = StyleParse.pixels(el.style.paddingBottom) ??\n          StyleParse.pixels(computed.paddingBottom) ?? 0;\n         const paddingLeft = StyleParse.pixels(el.style.paddingLeft) ?? StyleParse.pixels(computed.paddingLeft) ?? 0;\n         const paddingRight = StyleParse.pixels(el.style.paddingRight) ?? StyleParse.pixels(computed.paddingRight) ?? 0;\n         const paddingTop = StyleParse.pixels(el.style.paddingTop) ?? StyleParse.pixels(computed.paddingTop) ?? 0;\n\n         const additionalWidth = borderLeft + borderRight + paddingLeft + paddingRight;\n         const additionalHeight = borderTop + borderBottom + paddingTop + paddingBottom;\n\n         for (const subscriber of subscribers)\n         {\n            subscriber.styles.additionalWidth = additionalWidth;\n            subscriber.styles.additionalHeight = additionalHeight;\n            ResizeObserverManager.#updateSubscriber(subscriber, subscriber.contentWidth, subscriber.contentHeight);\n         }\n      }\n   }\n\n   // Internal implementation ----------------------------------------------------------------------------------------\n\n   /**\n    * Determines the shape of the target instance regarding valid update mechanisms to set width & height changes.\n    *\n    * @param {import('./types').ResizeObserverData.ResizeTarget}  target - The target instance.\n    *\n    * @returns {number} Update type value.\n    */\n   static #getUpdateType(target)\n   {\n      if (typeof target?.resizeObserved === 'function') { return this.#updateTypes.resizeObserved; }\n      if (typeof target?.setDimension === 'function') { return this.#updateTypes.setDimension; }\n      if (typeof target?.setContentBounds === 'function') { return this.#updateTypes.setContentBounds; }\n\n      const targetType = typeof target;\n\n      // Does the target have resizeObserved writable store?\n      if (targetType !== null && (targetType === 'object' || targetType === 'function'))\n      {\n         if (isWritableStore(target.resizeObserved))\n         {\n            return this.#updateTypes.storeObject;\n         }\n\n         // Now check for a child stores object which is a common TRL pattern for exposing stores.\n         const stores = target?.stores;\n         if (isObject(stores) || typeof stores === 'function')\n         {\n            if (isWritableStore(stores.resizeObserved))\n            {\n               return this.#updateTypes.storesObject;\n            }\n         }\n      }\n\n      if (targetType !== null && targetType === 'object') { return this.#updateTypes.attribute; }\n\n      if (targetType === 'function') { return this.#updateTypes.function; }\n\n      return this.#updateTypes.none;\n   }\n\n   /**\n    * Determines if a given element and target is already being observed.\n    *\n    * @param {HTMLElement} el - A HTMLElement.\n    *\n    * @param {import('./types').ResizeObserverData.ResizeTarget} [target] - A specific target to find.\n    *\n    * @returns {boolean} Whether the target is already being tracked for the given element.\n    */\n   #hasTarget(el, target)\n   {\n      if (target === void 0 || target === null) { return false; }\n\n      const subscribers = this.#elMap.get(el);\n      if (Array.isArray(subscribers))\n      {\n         return subscribers.findIndex((entry) => entry.target === target) >= 0;\n      }\n\n      return false;\n   }\n\n   /**\n    * Updates a subscriber target with given content width & height values. Offset width & height is calculated from\n    * the content values + cached styles.\n    *\n    * @param {import('./types-local').ResizeObserverSubscriber} subscriber - Internal data about subscriber.\n    *\n    * @param {number|undefined}  contentWidth - ResizeObserver `contentRect.width` value or undefined.\n    *\n    * @param {number|undefined}  contentHeight - ResizeObserver `contentRect.height` value or undefined.\n    */\n   static #updateSubscriber(subscriber, contentWidth, contentHeight)\n   {\n      const styles = subscriber.styles;\n\n      subscriber.contentWidth = contentWidth;\n      subscriber.contentHeight = contentHeight;\n\n      const offsetWidth = Number.isFinite(contentWidth) ? contentWidth + styles.additionalWidth : void 0;\n      const offsetHeight = Number.isFinite(contentHeight) ? contentHeight + styles.additionalHeight : void 0;\n\n      const target = subscriber.target;\n\n      switch (subscriber.updateType)\n      {\n         case this.#updateTypes.attribute:\n            target.contentWidth = contentWidth;\n            target.contentHeight = contentHeight;\n            target.offsetWidth = offsetWidth;\n            target.offsetHeight = offsetHeight;\n            break;\n\n         case this.#updateTypes.function:\n            target?.(offsetWidth, offsetHeight, contentWidth, contentHeight);\n            break;\n\n         case this.#updateTypes.resizeObserved:\n            target.resizeObserved?.(offsetWidth, offsetHeight, contentWidth, contentHeight);\n            break;\n\n         case this.#updateTypes.setContentBounds:\n            target.setContentBounds?.(contentWidth, contentHeight);\n            break;\n\n         case this.#updateTypes.setDimension:\n            target.setDimension?.(offsetWidth, offsetHeight);\n            break;\n\n         case this.#updateTypes.storeObject:\n            target.resizeObserved.update((object) =>\n            {\n               object.contentHeight = contentHeight;\n               object.contentWidth = contentWidth;\n               object.offsetHeight = offsetHeight;\n               object.offsetWidth = offsetWidth;\n\n               return object;\n            });\n            break;\n\n         case this.#updateTypes.storesObject:\n            target.stores.resizeObserved.update((object) =>\n            {\n               object.contentHeight = contentHeight;\n               object.contentWidth = contentWidth;\n               object.offsetHeight = offsetHeight;\n               object.offsetWidth = offsetWidth;\n\n               return object;\n            });\n            break;\n      }\n   }\n}\n\nexport { ResizeObserverManager };\n//# sourceMappingURL=index.js.map\n","import { ResizeObserverManager } from '@typhonjs-fvtt/runtime/util/dom/observer';\n\n/**\n * Provides a single global ResizeObserverManager instance for the resizeObserver action.\n *\n * @type {ResizeObserverManager}\n */\nconst resizeObserverActionManager = new ResizeObserverManager();\n\n/**\n * Provides an action to monitor the given {@link HTMLElement} node with {@link ResizeObserver} via\n * {@link ResizeObserverManager} posting width / height changes to the {@link ResizeObserverData.ResizeTarget} in\n * various ways depending on the shape of the target. The target can be one of the following and the\n * precedence order is listed from top to bottom:\n *\n * - has a `resizeObserved` function as attribute; offset then content width / height are passed as parameters.\n * - has a `setContentBounds` function as attribute; content width / height are passed as parameters.\n * - has a `setDimension` function as attribute; offset width / height are passed as parameters.\n * - target is an object; offset and content width / height attributes directly set on target.\n * - target is a function; the function invoked with offset then content width / height parameters.\n * - has a writable store `resizeObserved` as an attribute; updated with offset & content width / height.\n * - has an object 'stores' that has a writable store `resizeObserved` as an attribute; updated with offset &\n *   content width / height.\n *\n * Note: Svelte currently uses an archaic IFrame based workaround to monitor offset / client width & height changes.\n * A more up to date way to do this is with ResizeObserver. To track when Svelte receives ResizeObserver support\n * monitor this issue: {@link https://github.com/sveltejs/svelte/issues/4233}\n *\n * Can-I-Use: {@link https://caniuse.com/resizeobserver}\n *\n * @param {HTMLElement} node - The node associated with the action.\n *\n * @param {import('#runtime/util/dom/observer').ResizeObserverData.ResizeTarget} target - A\n *        {@link ResizeObserverManager} target to update with observed width & height changes.\n *\n * @returns {(import('svelte/action').ActionReturn<\n *   import('#runtime/util/dom/observer').ResizeObserverData.ResizeTarget\n * >)} The action lifecycle methods.\n *\n * @see https://github.com/sveltejs/svelte/issues/4233\n */\nfunction resizeObserver(node, target)\n{\n   resizeObserverActionManager.add(node, target);\n\n   return {\n      /**\n       * @param {import('#runtime/util/dom/observer').ResizeObserverData.ResizeTarget} newTarget - A\n       *        {@link ResizeObserverManager} target to update with observed width & height changes.\n       */\n      update: (newTarget) =>\n      {\n         resizeObserverActionManager.remove(node, target);\n         target = newTarget;\n         resizeObserverActionManager.add(node, target);\n      },\n\n      destroy: () =>\n      {\n         resizeObserverActionManager.remove(node, target);\n      }\n   };\n}\n\n/**\n * Provides a function that when invoked with an element updates the cached styles for each subscriber of the element.\n *\n * The style attributes cached to calculate offset height / width include border & padding dimensions. You only need\n * to update the cache if you change border or padding attributes of the element.\n *\n * @param {HTMLElement} el - A HTML element.\n */\nresizeObserver.updateCache = function(el)\n{\n   resizeObserverActionManager.updateCache(el);\n};\n\nexport { resizeObserver };\n//# sourceMappingURL=index.js.map\n","import { isObject } from '@typhonjs-fvtt/runtime/util/object';\n\n/**\n * Provides an action to apply CSS style properties provided as an object.\n *\n * @param {HTMLElement} node - Target element\n *\n * @param {{ [key: string]: string | null }}  properties - Hyphen case CSS property key / value object of properties\n *        to set.\n *\n * @returns {import('svelte/action').ActionReturn<{ [key: string]: string | null }>} Lifecycle functions.\n */\nfunction applyStyles(node, properties)\n{\n   /** Sets properties on node. */\n   function setProperties()\n   {\n      if (!isObject(properties)) { return; }\n\n      for (const prop of Object.keys(properties))\n      {\n         node.style.setProperty(`${prop}`, properties[prop]);\n      }\n   }\n\n   setProperties();\n\n   return {\n      /**\n       * @param {{ [key: string]: string | null }}  newProperties - Key / value object of properties to set.\n       */\n      update: (newProperties) =>\n      {\n         properties = newProperties;\n         setProperties();\n      }\n   };\n}\n\nexport { applyStyles };\n//# sourceMappingURL=index.js.map\n","import { isObject } from '@typhonjs-fvtt/runtime/util/object';\n\n/**\n * Applies the given action dynamically allowing the hosted action to be updated reactively while still appropriately\n * handling the action lifecycle methods.\n *\n * @param {HTMLElement} node - The node associated with the action.\n *\n * @param {import('./types').DynamicActionOptions} options - Defines the action to dynamically mount.\n *\n * @returns {import('svelte/action').ActionReturn<import('./types').DynamicActionOptions>} The action lifecycle\n *          methods.\n */\nfunction dynamicAction(node, { action, data } = {})\n{\n   let actionResult;\n\n   if (typeof action === 'function') { actionResult = action(node, data); }\n\n   return {\n      /**\n       * @param {import('./types').DynamicActionOptions} newOptions - Defines the new action to dynamically mount.\n       */\n      update: (newOptions) =>\n      {\n         // If `newOptions` is not an object then destroy any old action.\n         if (!isObject(newOptions))\n         {\n            actionResult?.destroy?.();\n            action = void 0;\n            data = void 0;\n\n            return;\n         }\n\n         const { action: newAction, data: newData } = newOptions;\n\n         if (typeof newAction !== 'function')\n         {\n            console.warn(`dynamicAction.update warning: Aborting as 'action' is not a function.`);\n            return;\n         }\n\n         const hasNewData = newData !== data;\n\n         if (hasNewData) { data = newData; }\n\n         if (newAction !== action)\n         {\n            // If the action changes destroy the previous action and apply the new one.\n            actionResult?.destroy?.();\n\n            action = newAction;\n            actionResult = action(node, data);\n         }\n         else if (hasNewData)\n         {\n            actionResult?.update?.(data);\n         }\n      },\n\n      destroy: () =>\n      {\n         actionResult?.destroy?.();\n\n         action = void 0;\n         data = void 0;\n         actionResult = void 0;\n      }\n   };\n}\n\nexport { dynamicAction };\n//# sourceMappingURL=index.js.map\n","import { linear } from 'svelte/easing';\nimport { lerp } from '@typhonjs-fvtt/runtime/math/interpolate';\nimport { getEasingFunc } from '@typhonjs-fvtt/runtime/svelte/easing';\nimport { fade, slide } from 'svelte/transition';\n\n/**\n * Provides a rotate transition. For options `easing` is applied to the rotate transition. The default easing is\n * linear.\n *\n * Note: that when reversing the transition that time goes from `1 - 0`, so if specific options are applied for\n * rotating out transition then `end` and `initial` are swapped.\n *\n * @param {HTMLElement} node - The transition node.\n *\n * @param {object}      [options] - Optional parameters.\n *\n * @param {number}      [options.delay] - Delay in ms before start of transition.\n *\n * @param {number}      [options.duration] - Total transition length in ms.\n *\n * @param {import('#runtime/svelte/easing').EasingReference}   [options.easing='linear'] - Easing function name or\n *        function to apply to the rotate transition.\n *\n * @param {number}      [options.end=0] - End rotation in degrees.\n *\n * @param {number}      [options.initial=0] - Initial rotation in degrees.\n *\n * @returns {import('svelte/transition').TransitionConfig} Transition config.\n */\nfunction rotate(node, options)\n{\n   const easingRotate = getEasingFunc(options.easing);\n\n   const initialDeg = options.initial ?? 0;\n   const endDeg = options.end ?? 0;\n\n   return {\n      delay: options.delay ?? 0,\n      duration: options.duration ?? 500,\n      easing: linear,\n      css: (t) =>\n      {\n         const rotateT = easingRotate(t);\n         return `transform: rotate(${lerp(initialDeg, endDeg, rotateT)}deg)`;\n      }\n   };\n}\n\n/**\n * Combines rotate & fade transitions into a single transition. For options `easing` this is applied to both\n * transitions, however if provided `easingRotate` and / or `easingFade` will take precedence. The default easing is\n * linear.\n *\n * Note: that when reversing the transition that time goes from `1 - 0`, so if specific options are applied for\n * rotating out transition then `end` and `initial` are swapped.\n *\n * @param {HTMLElement} node - The transition node.\n *\n * @param {object}      [options] - Optional parameters.\n *\n * @param {number}      [options.delay] - Delay in ms before start of transition.\n *\n * @param {number}      [options.duration] - Total transition length in ms.\n *\n * @param {import('#runtime/svelte/easing').EasingReference}   [options.easing='linear'] - Easing function name or\n *        function to apply to both slide & fade transitions.\n *\n * @param {import('#runtime/svelte/easing').EasingReference}   [options.easingFade='linear'] - Easing function name or\n *        function to apply to the fade transition.\n *\n * @param {import('#runtime/svelte/easing').EasingReference}   [options.easingRotate='linear'] - Easing function name or\n *        function to apply to the rotate transition.\n *\n * @param {number}      [options.end=0] - End rotation in degrees.\n *\n * @param {number}      [options.initial=0] - Initial rotation in degrees.\n *\n * @returns {import('svelte/transition').TransitionConfig} Transition config.\n */\nfunction rotateFade(node, options)\n{\n   const easingFade = getEasingFunc(options.easingFade ?? options.easing);\n   const easingRotate = getEasingFunc(options.easingRotate ?? options.easing);\n\n   const fadeTransition = fade(node);\n\n   const initialDeg = options.initial ?? 0;\n   const endDeg = options.end ?? 0;\n\n   return {\n      delay: options.delay ?? 0,\n      duration: options.duration ?? 500,\n      easing: linear,\n      css: (t) =>\n      {\n         const fadeT = easingFade(t);\n         const rotateT = easingRotate(t);\n\n         return `transform: rotate(${lerp(initialDeg, endDeg, rotateT)}deg); ${fadeTransition.css(fadeT, 1 - fadeT)}`;\n      }\n   };\n}\n\n/**\n * Combines slide & fade transitions into a single transition. For options `easing` this is applied to both transitions,\n * however if provided `easingSlide` and / or `easingFade` will take precedence. The default easing is linear.\n *\n * @param {HTMLElement} node - The transition node.\n *\n * @param {object}      [options] - Optional parameters.\n *\n * @param {'x' | 'y'}   [options.axis] - The sliding axis.\n *\n * @param {number}      [options.delay] - Delay in ms before start of transition.\n *\n * @param {number}      [options.duration] - Total transition length in ms.\n *\n * @param {import('#runtime/svelte/easing').EasingReference}   [options.easing=linear] - Easing function name or\n *        function to apply to both slide & fade transitions.\n *\n * @param {import('#runtime/svelte/easing').EasingReference}   [options.easingFade=linear] - Easing function name or\n *        function to apply to the fade transition.\n *\n * @param {import('#runtime/svelte/easing').EasingReference}   [options.easingSlide=linear] - Easing function name or\n *        function to apply to the slide transition.\n *\n * @returns {import('svelte/transition').TransitionConfig} Transition config.\n */\nfunction slideFade(node, options)\n{\n   const fadeEasing = getEasingFunc(options.easingFade ?? options.easing);\n   const slideEasing = getEasingFunc(options.easingSlide ?? options.easing);\n\n   const fadeTransition = fade(node);\n   const slideTransition = slide(node, { axis: options.axis });\n\n   return {\n      delay: options.delay ?? 0,\n      duration: options.duration ?? 500,\n      easing: linear,\n      css: (t) =>\n      {\n         const fadeT = fadeEasing(t);\n         const slideT = slideEasing(t);\n         return `${slideTransition.css(slideT, 1 - slideT)}; ${fadeTransition.css(fadeT, 1 - fadeT)}`;\n      }\n   };\n}\n\n/**\n * Converts a Svelte transition to an animation. Both transitions & animations use the same CSS / styles solution and\n * resulting data so wrap the transition function with the signature of an animation.\n *\n * @param {(node: Element, ...rest: any[]) => import('svelte/transition').TransitionConfig} fn -\n *        A Svelte transition function.\n *\n * @returns {(\n *    node: Element,\n *    data: { from: DOMRect, to: DOMRect },\n *    ...rest: any\n * ) => import('svelte/animation').AnimationConfig} - Transition function converted to an animation.\n */\nfunction toAnimation(fn)\n{\n   return (node, animations, ...rest) => fn(node, ...rest);\n}\n\n/**\n * Provides static data useful for handling custom props / options to components that allow dynamic configuration of\n * transitions. This is used in all application shells and components that have configurable transitions.\n *\n * @ignore\n */\nclass TJSDefaultTransition\n{\n   static #options = {};\n\n   static #default = () => void 0;\n\n   /**\n    * @returns {() => undefined} Default empty transition.\n    */\n   static get default() { return this.#default; }\n\n   /**\n    * @returns {{}} Default empty options.\n    */\n   static get options() { return this.#options; }\n}\n\nexport { TJSDefaultTransition, rotate, rotateFade, slideFade, toAnimation };\n//# sourceMappingURL=index.js.map\n","import { writable } from 'svelte/store';\n\n/**\n * Provides the internal context to all application shells.\n *\n * @implements {import('./types').AppShell.Context.Internal}\n *\n * @internal\n */\nexport class AppShellContextInternal\n{\n   /** @type {import('./types').AppShell.Context.Internal.stores} */\n   #stores;\n\n   constructor()\n   {\n      this.#stores = {\n         elementContent: writable(void 0),\n         elementRoot: writable(void 0)\n      };\n\n      Object.freeze(this.#stores);\n      Object.seal(this);\n   }\n\n   /**\n    * @returns {import('./types').AppShell.Context.Internal.stores} The internal context stores for `elementContent` /\n    *          `elementRoot`\n    */\n   get stores()\n   {\n      return this.#stores;\n   }\n}\n","import { isObject } from '@typhonjs-fvtt/runtime/util/object';\n\n/**\n * Localize a string including variable formatting for input arguments. Provide a string ID which defines the localized\n * template. Variables can be included in the template enclosed in braces and will be substituted using those named\n * keys.\n *\n * @param {string}   stringId - The string ID to translate.\n *\n * @param {object}   [data] - Provided input data.\n *\n * @returns {string} The translated and formatted string\n */\nfunction localize(stringId, data)\n{\n   const result = !isObject(data) ? globalThis.game.i18n.localize(stringId) :\n    globalThis.game.i18n.format(stringId, data);\n\n   return result !== void 0 ? result : '';\n}\n\nexport { localize };\n//# sourceMappingURL=index.js.map\n","<script>\n   /**\n    * Provides an app header button conforming to the {@link SvelteAppNS.HeaderButton} type.\n    * Additionally, a `title` field is supported to give a tool tip for the button. For backward compatibility\n    * `onclick` is supported, but for uniformity across TRL defining an `onPress` function is recommended. If defined\n    * it is invoked when the button is clicked or `Enter` key pressed and state is updated accordingly.\n    *\n    * TRL also supports the following extra button data:\n    *\n    * - {keyCode='Enter'}           keyCode: A string conforming to `KeyboardEvent.code` to activate `onPress` callback.\n    *\n    * - {keepMinimized=false}       keepMinimized: When true the button is not removed when app minimized.\n    *\n    * - {Function}                  onContextMenu: Invoked when right mouse button or contextmenu key is pressed.\n    *\n    * - {Function}                  onPress: Invoked when left mouse button or `keyCode` key is pressed.\n    *\n    * - {{ [key: string]: string | null }}   styles: Additional inline styles to apply to button.\n    *\n    * - {string}                    title: Tooltip title.\n    *\n    * @componentDocumentation\n    * @internal\n    */\n   import { applyStyles }   from '@typhonjs-fvtt/runtime/svelte/action/dom/style';\n   import { localize }      from '@typhonjs-fvtt/runtime/util/i18n';\n   import { isObject }      from '@typhonjs-fvtt/runtime/util/object';\n\n   export let button = void 0;\n\n   const s_REGEX_HTML = /^\\s*<.*>$/;\n\n   $: title = isObject(button) && typeof button.title === 'string' ? localize(button.title) : '';\n\n   // Handle icon and treat bare strings as the icon class; otherwise assume the icon is fully formed HTML.\n   $: icon = isObject(button) && typeof button.icon !== 'string' ? void 0 : s_REGEX_HTML.test(button.icon) ?\n    button.icon : `<i class=\"${button.icon}\" title=\"${title}\"></i>`;\n\n   $: label = isObject(button) && typeof button.label === 'string' ? localize(button.label) : void 0;\n\n   $: keepMinimized = isObject(button) && typeof button.keepMinimized === 'boolean' ? button.keepMinimized : false;\n\n   $: keyCode = isObject(button) && typeof button.keyCode === 'string' ? button.keyCode : 'Enter';\n\n   $: styles = isObject(button) && isObject(button.styles) ? button.styles : void 0;\n\n   function onClick(event)\n   {\n      // Accept `onPress or `onclick` as the function / data to invoke. `onclick` is from Foundry defined buttons.\n      const invoke = button?.onPress ?? button?.onclick;\n\n      if (typeof invoke === 'function')\n      {\n         invoke({ button, event });\n         button = button; // This provides a reactive update if button data changes.\n      }\n   }\n\n   function onContextMenu(event)\n   {\n      if (button?.onContextMenu === 'function')\n      {\n         button.onContextMenu({ button, event });\n         button = button; // This provides a reactive update if button data changes.\n      }\n   }\n\n   /**\n    * Consume / stop propagation of key down when key codes match.\n    *\n    * @param {KeyboardEvent}    event -\n    */\n   function onKeydown(event)\n   {\n      if (event.code === keyCode)\n      {\n         event.preventDefault();\n         event.stopPropagation();\n      }\n   }\n\n   /**\n    * Handle press event if key codes match.\n    *\n    * @param {KeyboardEvent}    event -\n    */\n   function onKeyup(event)\n   {\n      if (event.code === keyCode)\n      {\n         // Accept `onPress or `onclick` as the function / data to invoke. `onclick` is from Foundry defined buttons.\n         const invoke = button.onPress ?? button.onclick;\n\n         if (typeof invoke === 'function')\n         {\n            invoke({ button, event });\n            button = button; // This provides a reactive update if button data changes.\n         }\n\n         event.preventDefault();\n         event.stopPropagation();\n      }\n   }\n</script>\n\n<svelte:options accessors={true}/>\n\n<!-- svelte-ignore a11y-missing-attribute -->\n<a on:click|preventDefault|stopPropagation={onClick}\n   on:contextmenu|preventDefault|stopPropagation={onContextMenu}\n   on:keydown={onKeydown}\n   on:keyup={onKeyup}\n   use:applyStyles={styles}\n   class=\"header-button {button.class}\"\n   class:keep-minimized={keepMinimized}\n   aria-label={label}\n   tabindex=0\n   role=button>\n    {@html icon}{#if label}<span class:has-icon={icon !== void 0}>{label}</span>{/if}\n</a>\n\n<style>\n   a {\n      padding: var(--tjs-app-header-button-padding, 0 3px);\n      user-select: none;\n      -webkit-tap-highlight-color: var(--tjs-default-webkit-tap-highlight-color, revert);\n   }\n\n   a :global(i) {\n      padding: var(--tjs-app-header-button-icon-padding, 0);\n   }\n\n   a:hover {\n      text-shadow: var(--tjs-app-header-button-text-shadow-hover, var(--tjs-default-text-shadow-focus-hover, inherit));\n   }\n\n   a:focus-visible {\n      box-shadow: var(--tjs-app-header-button-box-shadow-focus-visible, var(--tjs-default-box-shadow-focus-visible));\n      outline: var(--tjs-app-header-button-outline-focus-visible, var(--tjs-default-outline-focus-visible, revert));\n      transition: var(--tjs-app-header-button-transition-focus-visible, var(--tjs-default-transition-focus-visible));\n      text-shadow: var(--tjs-app-header-button-text-shadow-focus-visible, var(--tjs-default-text-shadow-focus-hover, inherit));\n   }\n\n   span {\n      padding: var(--tjs-app-header-button-label-padding, 0);\n   }\n\n   span.has-icon {\n      padding: var(--tjs-app-header-button-label-padding, 0 0 0 3px);\n   }\n</style>\n","<script>\n   /**\n    * @privateRemarks\n    * TODO: Add description\n    *\n    * @componentDocumentation\n    * @internal\n    */\n   import { getContext }         from 'svelte';\n\n   import { TJSSvelte }          from '@typhonjs-fvtt/runtime/svelte/util';\n   import { A11yHelper }         from '@typhonjs-fvtt/runtime/util/a11y';\n   import { localize }           from '@typhonjs-fvtt/runtime/util/i18n';\n   import { isObject }           from '@typhonjs-fvtt/runtime/util/object';\n\n   import {\n      draggable as dragDefault } from '@typhonjs-fvtt/runtime/svelte/store/position';\n\n   import TJSHeaderButton        from './TJSHeaderButton.svelte';\n\n   export let draggable = void 0;\n   export let draggableOptions = void 0;\n\n   /**\n    * @type {SvelteApp}\n    */\n   const application = getContext('#external')?.application;\n\n   // Focus related app options stores.\n   const { focusAuto, focusKeep } = application.reactive.storeAppOptions;\n\n   const { elementRoot } = getContext('#internal').stores;\n\n   const storeTitle = application.reactive.storeAppOptions.title;\n   const storeDraggable = application.reactive.storeAppOptions.draggable;\n   const storeDragging = application.reactive.storeUIState.dragging;\n   const storeHeaderButtons = application.reactive.storeUIState.headerButtons;\n   const storeHeaderIcon = application.reactive.storeAppOptions.headerIcon;\n   const storeHeaderNoTitleMinimized = application.reactive.storeAppOptions.headerNoTitleMinimized;\n   const storeMinimizable = application.reactive.storeAppOptions.minimizable;\n   const storeMinimized = application.reactive.storeUIState.minimized;\n\n   // These classes in the window header allow dragging.\n   const s_DRAG_TARGET_CLASSLIST = Object.freeze(['tjs-app-icon', 'tjs-window-header-spacer',\n    'window-header', 'window-title']);\n\n   let dragOptions;\n\n   $: draggable = typeof draggable === 'function' ? draggable : dragDefault;\n\n   // Combines external options with defaults for TJSApplicationHeader. By default, easing is turned on w/ duration of\n   // 0.06 seconds and cubicOut, but can be overridden by any provided `draggableOptions`. `position`, `active`, and\n   // `storeDragging` are always overridden by application position / stores.\n   $: dragOptions = Object.assign({}, { tween: true, tweenOptions: { duration: 0.06, ease: 'cubicOut' } },\n    isObject(draggableOptions) ? draggableOptions : {}, { position: application.position, enabled:\n     $storeDraggable, storeDragging, hasTargetClassList: s_DRAG_TARGET_CLASSLIST });\n\n   let displayHeaderTitle;\n\n   $: displayHeaderTitle = $storeHeaderNoTitleMinimized && $storeMinimized ? 'none' : null;\n\n   let buttonsLeft;\n   let buttonsRight;\n\n   $:\n   {\n      buttonsLeft = [];\n      buttonsRight = [];\n\n      for (const button of $storeHeaderButtons)\n      {\n         const buttonsList = typeof button?.alignLeft === 'boolean' && button?.alignLeft ? buttonsLeft : buttonsRight;\n\n         // If the button contains a TJSSvelte.Config.Minimal object in the `svelte` attribute then use it otherwise use\n         // `TJSHeaderButton` w/ button as props.\n         buttonsList.push(TJSSvelte.config.isConfigEmbed(button?.svelte) ? { ...button.svelte } :\n          { class: TJSHeaderButton, props: { button } });\n      }\n   }\n\n   function minimizable(node, booleanStore)\n   {\n      const callback = (event) =>\n      {\n         // Only toggle minimize state if window title or header is the event target. Also allow toggle state if the\n         // event target has 'keep-minimized' class.\n         if (event.target.classList.contains('window-title') || event.target.classList.contains('window-header') ||\n           event.target.classList.contains('keep-minimized'))\n         {\n            application._onToggleMinimize(event);\n         }\n      }\n\n      function activateListeners() { node.addEventListener('dblclick', callback); }\n      function removeListeners() { node.removeEventListener('dblclick', callback); }\n\n      if (booleanStore) { activateListeners(); }\n\n      return {\n         update: (booleanStore) =>  // eslint-disable-line no-shadow\n         {\n            if (booleanStore) { activateListeners(); }\n            else { removeListeners(); }\n         },\n\n         destroy: () => removeListeners()\n      };\n   }\n\n   /**\n    * Explicitly focus `elementRoot` if pointer event is not consumed by header buttons / components. This allows\n    * keyboard tab navigation to select header buttons.\n    *\n    * Note: if `focusKeep` app option store is set to true `elementRoot` is only focused if the current browser wide\n    * active element is not contained inside the app element.\n    */\n   function onPointerdown(event)\n   {\n      const rootEl = $elementRoot;\n\n      // Cancel any app animation in progress when dragging starts.\n      application.position.animate.cancel();\n\n      if ($focusAuto && A11yHelper.isFocusTarget(rootEl) && rootEl?.isConnected)\n      {\n         if ($focusKeep)\n         {\n            const activeWindow = application.reactive.activeWindow;\n\n            const focusOutside = A11yHelper.isFocusTarget(activeWindow.document.activeElement) &&\n             !rootEl.contains(activeWindow.document.activeElement);\n\n            // Only focus the content element if the active element is outside the app; maintaining internal focused\n            // element.\n            if (focusOutside)\n            {\n               rootEl.focus();\n            }\n            else\n            {\n               event.preventDefault();\n            }\n         }\n         else\n         {\n            rootEl.focus();\n         }\n      }\n   }\n</script>\n\n{#key draggable}\n   <header class=\"window-header flexrow\"\n           on:pointerdown={onPointerdown}\n           use:draggable={dragOptions}\n           use:minimizable={$storeMinimizable}>\n      {#if typeof $storeHeaderIcon === 'string'}\n         <img class=\"tjs-app-icon keep-minimized\" src={$storeHeaderIcon} alt=icon>\n      {/if}\n      <h4 class=window-title style:display={displayHeaderTitle}>\n         {localize($storeTitle)}\n      </h4>\n      {#each buttonsLeft as button}\n         <svelte:component this={button.class} {...button.props} />\n      {/each}\n      <span class=\"tjs-window-header-spacer keep-minimized\"></span>\n      {#each buttonsRight as button}\n         <svelte:component this={button.class} {...button.props} />\n      {/each}\n   </header>\n{/key}\n\n<style>\n   /**\n    * Provides a zero space element that expands to the right creating the gap between window title and left aligned\n    * buttons and right aligned buttons. Note the use of a negative left margin to remove the gap between elements.\n    */\n   .tjs-window-header-spacer {\n      flex: 0;\n      margin-left: calc(-1 * var(--tjs-app-header-gap, 5px));\n      margin-right: auto;\n   }\n\n   .window-header {\n      flex: var(--tjs-app-header-flex, 0 0 30px);\n      gap: var(--tjs-app-header-gap, 5px);\n      padding: var(--tjs-app-header-padding, 0 4px);\n      touch-action: none;\n   }\n\n   .window-header .tjs-app-icon {\n      align-self: center;\n      border-radius: var(--tjs-app-header-icon-border-radius, 4px);\n      flex: 0 0 var(--tjs-app-header-icon-width, 24px);\n      height: var(--tjs-app-header-icon-height, 24px);\n   }\n\n   .window-title {\n      gap: var(--tjs-app-header-gap, 5px);\n      max-width: fit-content;\n      overflow: hidden;\n      text-overflow: ellipsis;\n      white-space: nowrap;\n   }\n</style>\n","import { Mat4, Vec3 } from '@typhonjs-fvtt/runtime/math/gl-matrix';\n\n/**\n * Handles the projection of app resizing from screen to local space of the app transform for accurate resizing.\n */\nexport class ResizeHandleTransform\n{\n   /**\n    * Stores inverted app transform matrix.\n    */\n   static #invMat = new Mat4();\n\n   /**\n    * Stores converted world delta width & height change.\n    */\n   static #pDeltaLocal = new Vec3();\n\n   /**\n    * Stores point down in local space.\n    */\n   static #pLocalDown = new Vec3();\n\n   /**\n    * Stores point drag in local space.\n    */\n   static #pLocalDrag = new Vec3();\n\n   /**\n    * Stores point down in world space.\n    */\n   static #pScreenDown = new Vec3();\n\n   /**\n    * Stores point drag in world space.\n    */\n   static #pScreenDrag = new Vec3();\n\n   /**\n    * Compute the delta width and height in local space given the app transform matrix and initial pointer down and\n    * drag screen coordinates.\n    *\n    * @param {Mat4} transformMat - App transform matrix.\n    *\n    * @param {number} pScreenDownX - Pointer down X position in screen coords.\n    *\n    * @param {number} pScreenDownY - Pointer down Y position in screen coords.\n    *\n    * @param {number} pScreenDragX - Current pointer drag X position in screen coords.\n    *\n    * @param {number} pScreenDragY - Current pointer drag Y position in screen coords.\n    *\n    * @returns {Vec3} Output vector for width & height changes (x = deltaWidth, y = deltaHeight).\n    */\n   static computeDelta(transformMat, pScreenDownX, pScreenDownY, pScreenDragX, pScreenDragY)\n   {\n      // Invert the transform to go from SCREEN -> LOCAL.\n      Mat4.invert(this.#invMat, transformMat);\n\n      // Store screen down and drag coordinates in temp vectors.\n      this.#pScreenDown[0] = pScreenDownX;\n      this.#pScreenDown[1] = pScreenDownY;\n\n      this.#pScreenDrag[0] = pScreenDragX;\n      this.#pScreenDrag[1] = pScreenDragY;\n\n      // Transform both points to local space.\n      Vec3.transformMat4(this.#pLocalDown, this.#pScreenDown, this.#invMat);\n      Vec3.transformMat4(this.#pLocalDrag, this.#pScreenDrag, this.#invMat);\n\n      // Compute local delta.\n      this.#pDeltaLocal[0] = this.#pLocalDrag[0] - this.#pLocalDown[0];\n      this.#pDeltaLocal[1] = this.#pLocalDrag[1] - this.#pLocalDown[1];\n\n      return this.#pDeltaLocal;\n   }\n}\n","<script>\n   /**\n    * @privateRemarks\n    * TODO: Add description\n    *\n    * @componentDocumentation\n    */\n   import { getContext }            from 'svelte';\n\n   import { ResizeHandleTransform } from './ResizeHandleTransform.js';\n\n   export let isResizable = false;\n\n   const application = getContext('#external')?.application;\n\n   // Allows retrieval of the element root at runtime.\n   const storeElementRoot = getContext('#internal').stores.elementRoot;\n\n   const storeResizable = application.reactive.storeAppOptions.resizable;\n\n   const storeMinimized = application.reactive.storeUIState.minimized;\n   const storeResizing = application.reactive.storeUIState.resizing;\n\n   let elementResize;\n\n   $: if (elementResize)\n   {\n      // Instead of creating a derived store it is easier to use isResizable and the minimized store below.\n      elementResize.style.display = isResizable && !$storeMinimized ? 'block' : 'none';\n\n      // Add / remove `resizable` class from element root.\n      const elementRoot = $storeElementRoot;\n      if (elementRoot) { elementRoot.classList[isResizable ? 'add' : 'remove']('resizable'); }\n   }\n\n   /**\n    * Cancel any app animation in progress when dragging starts.\n    */\n   function onPointerdown()\n   {\n      application.position.animate.cancel();\n   }\n\n   /**\n    * Provides an action to handle resizing the application shell based on the resizable app option.\n    *\n    * @param {HTMLElement}       node - The node associated with the action.\n    *\n    * @param {object}            [opts] - Optional parameters.\n    *\n    * @param {boolean}           [opts.active=true] - A boolean value; attached to a readable store.\n    *\n    * @param {Writable<boolean>} [opts.storeResizing] - A writable store that tracks \"resizing\" state.\n    *\n    * @returns {{update: Function, destroy: Function}} The action lifecycle methods.\n    */\n   function resizable(node, { active = true, storeResizing = void 0 } = {})\n   {\n      /**\n       * Duplicate the app / Positionable starting position to track differences.\n       *\n       * @type {object}\n       */\n      let position = null;\n\n      /**\n       * Stores the current resizing state and gates the move pointer as the resizing store is not\n       * set until the first pointer move.\n       *\n       * @type {boolean}\n       */\n      let resizing = false;\n\n      /**\n       * Stores initial pointer down X in screen coordinates.\n       */\n      let pScreenDownX = 0;\n\n      /**\n       * Stores initial pointer down Y in screen coordinates.\n       */\n      let pScreenDownY = 0;\n\n      /**\n       * Remember event handlers associated with this action so they may be later unregistered.\n       *\n       * @type {Object}\n       */\n      const handlers = {\n         resizeDown: ['pointerdown', (e) => onResizePointerDown(e), false],\n         resizeMove: ['pointermove', (e) => onResizePointerMove(e), false],\n         resizeUp: ['pointerup', (e) => onResizePointerUp(e), false]\n      };\n\n      /**\n       * Activates listeners.\n       */\n      function activateListeners()\n      {\n         // Resize handlers\n         node.addEventListener(...handlers.resizeDown);\n\n         isResizable = true;\n\n         node.style.display = 'block';\n      }\n\n      /**\n       * Removes listeners.\n       */\n      function removeListeners()\n      {\n         if (typeof storeResizing?.set === 'function') { storeResizing.set(false); }\n\n         // Resize handlers\n         node.removeEventListener(...handlers.resizeDown);\n         node.removeEventListener(...handlers.resizeMove);\n         node.removeEventListener(...handlers.resizeUp);\n\n         node.style.display = 'none';\n\n         isResizable = false;\n      }\n\n      // On mount if resizable is true then activate listeners otherwise set element display to `none`.\n      if (active)\n      {\n         activateListeners();\n      }\n      else\n      {\n         node.style.display = 'none';\n      }\n\n      /**\n       * Handle the initial pointer down that activates resizing capture.\n       */\n      function onResizePointerDown(event)\n      {\n         event.preventDefault();\n\n         resizing = false;\n\n         // Record initial position\n         position = application.position.get();\n\n         if (position.height === 'auto') { position.height = $storeElementRoot.clientHeight; }\n         if (position.width === 'auto') { position.width = $storeElementRoot.clientWidth; }\n\n         pScreenDownX = event.clientX;\n         pScreenDownY = event.clientY;\n\n         // Add temporary handlers\n         node.addEventListener(...handlers.resizeMove);\n         node.addEventListener(...handlers.resizeUp);\n\n         node.setPointerCapture(event.pointerId);\n      }\n\n      /**\n       * Sets the width / height of the positionable application.\n       */\n      function onResizePointerMove(event)\n      {\n         event.preventDefault();\n\n         if (!resizing && typeof storeResizing?.set === 'function')\n         {\n            resizing = true;\n            storeResizing.set(true);\n         }\n\n         const pDeltaLocal = ResizeHandleTransform.computeDelta(application.position.transform.mat4, pScreenDownX,\n          pScreenDownY, event.clientX, event.clientY);\n\n         application.position.set({\n            width: position.width + pDeltaLocal[0],\n            height: position.height + pDeltaLocal[1]\n         });\n      }\n\n      /**\n       * Conclude the dragging behavior when the pointer is released setting the final position and\n       * removing listeners.\n       */\n      function onResizePointerUp(event)\n      {\n         resizing = false;\n         if (typeof storeResizing?.set === 'function') { storeResizing.set(false); }\n\n         event.preventDefault();\n         node.removeEventListener(...handlers.resizeMove);\n         node.removeEventListener(...handlers.resizeUp);\n\n         // TODO: Direct Foundry API access.\n         application?._onResize?.(event);\n      }\n\n      return {\n         update: ({ active }) =>  // eslint-disable-line no-shadow\n         {\n            if (active) { activateListeners(); }\n            else { removeListeners(); }\n         },\n\n         destroy: () => removeListeners()\n      };\n   }\n\n</script>\n\n<div class=\"window-resizable-handle\"\n     on:pointerdown={onPointerdown}\n     use:resizable={{ active: $storeResizable, storeResizing }}\n     bind:this={elementResize}>\n   <i class=\"fas fa-arrows-alt-h\"></i>\n</div>\n\n<style>\n   .window-resizable-handle {\n      display: block;\n      position: absolute;\n      width: var(--tjs-app-resizable-handle-width, 20px);\n      height: var(--tjs-app-resizable-handle-height, 20px);\n      top: var(--tjs-app-resizable-handle-top, unset);\n      bottom: var(--tjs-app-resizable-handle-bottom, -1px);\n      right: var(--tjs-app-resizable-handle-right, 0);\n      left: var(--tjs-app-resizable-handle-left, unset);\n      background: var(--tjs-app-resizable-handle-background, #444);\n      border: var(--tjs-app-resizable-handle-border, 1px solid #111);\n      border-radius: var(--tjs-app-resizable-handle-border-radius, 4px 0 0 0);\n      padding: var(--tjs-app-resizable-handle-padding, 2px);\n      touch-action: none;\n   }\n\n   .fa-arrows-alt-h {\n      color: var(--tjs-app-resizable-handle-icon-color, #f0f0e0);\n      transform: var(--tjs-app-resizable-handle-icon-transform, rotate(45deg));\n   }\n</style>\n","<script>\n   /**\n    * Provides a component to wrap focus to the first focusable element in the given `elementRoot` prop. Place this\n    * component as the last child in `elementRoot`.\n    *\n    * @componentDocumentation\n    */\n   import { A11yHelper }    from '@typhonjs-fvtt/runtime/util/a11y';\n\n   /** @type {HTMLElement} */\n   export let elementRoot = void 0;\n\n   /** @type {boolean} */\n   export let enabled = true;\n\n   let ignoreElements, wrapEl;\n\n   $: if (wrapEl) { ignoreElements = new Set([wrapEl]); }\n\n   function onFocus()\n   {\n      // Early out if not enabled.\n      if (!enabled) { return; }\n\n      if (A11yHelper.isFocusTarget(elementRoot))\n      {\n         const firstFocusEl = A11yHelper.getFirstFocusableElement(elementRoot, ignoreElements);\n\n         if (A11yHelper.isFocusTarget(firstFocusEl) && firstFocusEl !== wrapEl)\n         {\n            firstFocusEl.focus();\n         }\n         else\n         {\n            // No focus target found, so focus elementRoot.\n            elementRoot.focus();\n         }\n      }\n   }\n</script>\n\n<!-- svelte-ignore a11y-no-noninteractive-tabindex -->\n<div bind:this={wrapEl} class=tjs-focus-wrap tabindex=0 on:focus={onFocus}></div>\n\n<style>\n    div {\n        width: 0;\n        height: 0;\n        flex: 0;\n    }\n\n    div:focus {\n        outline: none;\n    }\n</style>\n","<script>\n   /**\n    * Provides an application shell is a main top level slotted component that provides a reactive\n    * outer wrapper and header bar for the main content component.\n    *\n    * @componentDocumentation\n    */\n\n   import {\n      getContext,\n      onMount,\n      setContext }                     from 'svelte';\n\n   import { resizeObserver }           from '@typhonjs-fvtt/runtime/svelte/action/dom/observer';\n   import { applyStyles }              from '@typhonjs-fvtt/runtime/svelte/action/dom/style';\n   import { dynamicAction }            from '@typhonjs-fvtt/runtime/svelte/action/util';\n   import { TJSDefaultTransition }     from '@typhonjs-fvtt/runtime/svelte/transition';\n   import { A11yHelper }               from '@typhonjs-fvtt/runtime/util/a11y';\n   import { isObject }                 from '@typhonjs-fvtt/runtime/util/object';\n\n   import { AppShellContextInternal }  from './AppShellContextInternal.js';\n   import TJSApplicationHeader         from './TJSApplicationHeader.svelte';\n   import ResizableHandle              from './ResizableHandle.svelte';\n\n   import TJSFocusWrap                 from '../internal/dom/TJSFocusWrap.svelte';\n\n   // Bound to the content and root elements. Can be used by parent components. SvelteApplication will also\n   // use 'elementRoot' to set the element of the Application. You can also provide `elementContent` and\n   // `elementTarget`. Please see SvelteApplication lifecycle documentation.\n   /** @type {HTMLElement} */\n   export let elementContent = void 0;\n   /** @type {HTMLElement} */\n   export let elementRoot = void 0;\n\n   // Allows custom draggable implementations to be forwarded to TJSApplicationHeader.\n   export let draggable = void 0;\n   export let draggableOptions = void 0;\n\n   // The children array can be specified by a parent via prop or is read below from the external context.\n   // export let children = void 0;\n\n   // Explicit style overrides for the main app and content elements. Uses action `applyStyles`.\n   export let stylesApp = void 0;\n   export let stylesContent = void 0;\n\n   /**\n    * Application reference.\n    *\n    * @type {SvelteApp}\n    */\n   const application = getContext('#external')?.application;\n\n   // Focus related app options stores.\n   const { focusAuto, focusKeep, focusTrap } = application.reactive.storeAppOptions;\n\n   const { minimized } = application.reactive.storeUIState;\n\n   // Is the backing app TJSPosition instance a candidate for the `resizeObserver` action? IE `width` or `height is\n   // `auto` or `inherit`.\n   const { resizeObservable } = application.position.stores;\n\n   // ----------------------------------------------------------------------------------------------------------------\n\n   // If a parent component binds and sets `appOffsetHeight` or `appOffsetWidth` to a truthy value then the\n   // `resizeObserver` action is enabled on the outer application `div`. Additionally, the SvelteApplication position\n   // resizeObserved store is updated.\n   export let appOffsetHeight = false;\n   export let appOffsetWidth = false;\n\n   // Tracks initial state if either of the above props are truthy otherwise a null operation.\n   const initialAppResizeObserver = !!appOffsetHeight || !!appOffsetWidth;\n\n   /**\n    * Reactive statement to control any dynamic action to apply for the app resize observer. It is always enabled when\n    * `initialAppResizeObserver` is true or when the position store `resizeObservable` is true when app position `width`\n    * or `height` is `auto` or `inherit`.\n    *\n    * @type {undefined | import('@typhonjs-fvtt/runtime/svelte/action/util').DynamicActionOptions}\n    */\n   $: appResizeObserver = initialAppResizeObserver || $resizeObservable ?\n    { action: resizeObserver, data: resizeObservedApp } : void 0;\n\n   // ----------------------------------------------------------------------------------------------------------------\n\n   // If a parent component binds and sets `contentOffsetHeight` or `contentOffsetWidth` to true then a\n   // resizeObserver action is enabled on the content `section`.\n   export let contentOffsetHeight = false;\n   export let contentOffsetWidth = false;\n\n   // Set to `resizeObserver` if either of the above props are truthy otherwise a null operation.\n   const contentResizeObserver = !!contentOffsetHeight || !!contentOffsetWidth ? resizeObserver : () => null;\n\n   // ----------------------------------------------------------------------------------------------------------------\n\n   // Provides the internal context for data / stores of the application shell.\n   const internal = new AppShellContextInternal();\n\n   // Provides options to `A11yHelper.getFocusableElements` to ignore TJSFocusWrap by CSS class.\n   const s_IGNORE_CLASSES = { ignoreClasses: ['tjs-focus-wrap'] };\n\n   // Internal context for `elementContent` / `elementRoot` stores.\n   setContext('#internal', internal);\n\n   // Only update the `elementContent` store if the new `elementContent` is not null or undefined.\n   $: if (elementContent !== void 0 && elementContent !== null)\n   {\n      getContext('#internal').stores.elementContent.set(elementContent);\n   }\n\n   // Only update the `elementRoot` store if the new `elementRoot` is not null or undefined.\n   $: if (elementRoot !== void 0 && elementRoot !== null)\n   {\n      getContext('#internal').stores.elementRoot.set(elementRoot);\n   }\n\n   let focusWrapEnabled;\n\n   // Enable TJSFocusWrap component when focus trapping app option is true and app is not minimized.\n   $: focusWrapEnabled = $focusAuto && $focusTrap && !$minimized;\n\n   // ---------------------------------------------------------------------------------------------------------------\n\n   // The following block is somewhat complex, but allows transition options to be updated reactively during\n   // runtime execution.\n\n   // Exports properties to set a transition w/ in / out options.\n   export let transition = TJSDefaultTransition.default;\n   export let inTransition = TJSDefaultTransition.default;\n   export let outTransition = TJSDefaultTransition.default;\n\n   // Exports properties to set options for any transitions.\n   export let transitionOptions = void 0;\n   export let inTransitionOptions = TJSDefaultTransition.options;\n   export let outTransitionOptions = TJSDefaultTransition.options;\n\n   // Tracks last transition state.\n   let oldTransition = TJSDefaultTransition.default;\n   let oldTransitionOptions = void 0\n\n   // Run this reactive block when the last transition state is not equal to the current state.\n   $: if (oldTransition !== transition)\n   {\n      // If transition is defined and not the default transition then set it to both in and out transition otherwise\n      // set the default transition to both in & out transitions.\n      const newTransition = typeof transition === 'function' ? transition : TJSDefaultTransition.default;\n\n      inTransition = newTransition;\n      outTransition = newTransition;\n\n      oldTransition = newTransition;\n   }\n\n   // Run this reactive block when the last transition options state is not equal to the current options state.\n   $: if (oldTransitionOptions !== transitionOptions)\n   {\n      const newOptions = transitionOptions !== TJSDefaultTransition.options && isObject(transitionOptions) ?\n       transitionOptions : TJSDefaultTransition.options;\n\n      inTransitionOptions = newOptions;\n      outTransitionOptions = newOptions;\n\n      oldTransitionOptions = newOptions;\n   }\n\n   // Handle cases if inTransition is unset; assign noop default transition function.\n   $: if (typeof inTransition !== 'function') { inTransition = TJSDefaultTransition.default; }\n\n   $:\n   {\n      // Handle cases if outTransition is unset; assign noop default transition function.\n      if (typeof outTransition !== 'function') { outTransition = TJSDefaultTransition.default; }\n\n      // Set close animation to `false` / not run when an out transition is defined.\n      const defaultCloseAnimation = application?.options?.defaultCloseAnimation;\n      if (typeof defaultCloseAnimation === 'boolean' && defaultCloseAnimation &&\n       outTransition !== TJSDefaultTransition.default)\n      {\n         application.options.defaultCloseAnimation = false;\n      }\n   }\n\n   // Handle cases if inTransitionOptions is unset; assign empty default transition options.\n   $: if (!isObject(inTransitionOptions)) { inTransitionOptions = TJSDefaultTransition.options; }\n\n   // Handle cases if outTransitionOptions is unset; assign empty default transition options.\n   $: if (!isObject(outTransitionOptions)) { outTransitionOptions = TJSDefaultTransition.options; }\n\n   // ---------------------------------------------------------------------------------------------------------------\n\n   // Focus `elementRoot` on mount to allow keyboard tab navigation of header buttons.\n   onMount(() => elementRoot.focus());\n\n   // ---------------------------------------------------------------------------------------------------------------\n\n   /**\n    * Provides a handler for the custom `close:popup` event fired by `svelte-standard` components like TJSMenu. The\n    * intention is to handle focus management of a component that is no longer connected in the DOM. If a target element\n    * that is the source of the close event is attached attempt to resolve internal focus to the application.\n    *\n    * @param {CustomEvent}  event - A custom event for `close:popup`.\n    */\n   function onClosePopup(event)\n   {\n      // Early out as automatic focus management is not enabled.\n      if (!$focusAuto) { return; }\n\n      const targetEl = event?.detail?.target;\n\n      // Early out if there is no target element.\n      if (!A11yHelper.isFocusTarget(targetEl)) { return; }\n\n      // Early out if the target element is focusable as it will gain focus naturally.\n      if (A11yHelper.isFocusable(targetEl)) { return; }\n\n      const elementRootContains = elementRoot.contains(targetEl);\n\n      // First check for if the target is elementRoot or elementContent then fallback to contains checks.\n      if (targetEl === elementRoot)\n      {\n         elementRoot.focus();\n      }\n      else if (targetEl === elementContent)\n      {\n         elementContent.focus();\n      }\n      else if (elementRootContains)\n      {\n         if (elementContent.contains(targetEl))\n         {\n            elementContent.focus();\n         }\n         else\n         {\n            elementRoot.focus();\n         }\n      }\n   }\n\n   /**\n    * Provides focus cycling inside the application capturing `<Shift-Tab>` and if `elementRoot` or `firstFocusEl` is\n    * the actively focused element then last focusable element is focused skipping `TJSFocusWrap`.\n    *\n    * Also, if a popout app all key down events will bring this application to the top such that when focus is trapped\n    * the app is top most.\n    *\n    * @param {KeyboardEvent} event - Keyboard Event.\n    */\n   function onKeydown(event)\n   {\n      // TODO: Note this handling is specifically for Foundry v11+ as the platform KeyboardManager uses\n      // `document.querySelector(':focus')` to short circuit keyboard handling internally to KeyboardManager.\n      // ApplicationShell manages containing focus programmatically and this prevents the Foundry KeyboardManager from\n      // activating. We need to check if this key event target is currently the `elementRoot` or `elementContent` and\n      // the event matches any KeyboardManager actions and if so blur current focus.\n      if ((event.target === elementRoot || event.target === elementContent) &&\n       KeyboardManager && KeyboardManager?._getMatchingActions?.(\n        KeyboardManager?.getKeyboardEventContext?.(event))?.length)\n      {\n         event.target?.blur();\n         return;\n      }\n\n      if (focusWrapEnabled && event.shiftKey && event.code === 'Tab')\n      {\n         // Collect all focusable elements from `elementRoot` and ignore TJSFocusWrap.\n         const allFocusable = A11yHelper.getFocusableElements(elementRoot, s_IGNORE_CLASSES);\n\n         // Find first and last focusable elements.\n         const firstFocusEl = allFocusable.length > 0 ? allFocusable[0] : void 0;\n         const lastFocusEl = allFocusable.length > 0 ? allFocusable[allFocusable.length - 1] : void 0;\n\n         const activeWindow = application.reactive.activeWindow;\n\n         // Only cycle focus to the last keyboard focusable app element if `elementRoot` or first focusable element\n         // is the active element.\n         if (elementRoot === activeWindow.document.activeElement ||\n          firstFocusEl === activeWindow.document.activeElement)\n         {\n            if (A11yHelper.isFocusTarget(lastFocusEl) && firstFocusEl !== lastFocusEl) { lastFocusEl.focus(); }\n\n            event.preventDefault();\n            event.stopPropagation();\n         }\n      }\n\n      // Make sure this application is top most when it receives keyboard events.\n      if (typeof application?.options?.popOut === 'boolean' && application.options.popOut &&\n       application !== globalThis.ui?.activeWindow)\n      {\n         application.bringToTop.call(application);\n      }\n   }\n\n   /**\n    * If the application is a popOut application then when clicked bring to top if not already the Foundry\n    * `activeWindow`.\n    *\n    * Note: `capture` is used so pointer down is always received. Be mindful as `onPointerdownApp` should only\n    * invoke `bringToTop`.\n    */\n   function onPointerdownApp()\n   {\n      if (typeof application?.options?.popOut === 'boolean' && application.options.popOut &&\n       application !== globalThis.ui?.activeWindow)\n      {\n         application.bringToTop.call(application);\n      }\n   }\n\n   /**\n    * Focus `elementContent` if the event target is not focusable and `focusAuto` is enabled.\n    *\n    * Note: `focusAuto` is an app option store. This check is a bit tricky as `section.window-content` has a tabindex\n    * of '-1', so it is focusable manually.\n    */\n   function onPointerdownContent(event)\n   {\n      // Note: the event target may not always be the element that will eventually receive focus.\n      const focusable = A11yHelper.isFocusable(event.target);\n\n      if (!focusable && $focusAuto)\n      {\n         if ($focusKeep)\n         {\n            const activeWindow = application.reactive.activeWindow;\n            const focusOutside = !elementRoot.contains(activeWindow.document.activeElement);\n\n            // Only focus the content element if the active element is outside the app; maintaining internal focused\n            // element.\n            if (focusOutside)\n            {\n               elementContent.focus();\n            }\n            else\n            {\n               event.preventDefault();\n            }\n         }\n         else\n         {\n            elementContent.focus();\n         }\n      }\n   }\n\n   /**\n    * Callback for content resizeObserver action. This is enabled when contentOffsetHeight or contentOffsetWidth is\n    * bound.\n    *\n    * @param {number}   offsetWidth - Observed offsetWidth.\n    *\n    * @param {number}   offsetHeight - Observed offsetHeight\n    */\n   function resizeObservedContent(offsetWidth, offsetHeight)\n   {\n      contentOffsetWidth = offsetWidth;\n      contentOffsetHeight = offsetHeight;\n   }\n\n   /**\n    * Callback for app resizeObserver action. This is enabled when appOffsetHeight or appOffsetWidth is\n    * bound. Additionally, the Application position resizeObserved store is updated.\n    *\n    * @param {number}   contentWidth - Observed contentWidth.\n    * @param {number}   contentHeight - Observed contentHeight\n    * @param {number}   offsetWidth - Observed offsetWidth.\n    * @param {number}   offsetHeight - Observed offsetHeight\n    */\n   function resizeObservedApp(offsetWidth, offsetHeight, contentWidth, contentHeight)\n   {\n      application.position.stores.resizeObserved.update((object) =>\n      {\n         object.contentWidth = contentWidth;\n         object.contentHeight = contentHeight;\n         object.offsetWidth = offsetWidth;\n         object.offsetHeight = offsetHeight;\n\n         return object;\n      });\n\n      appOffsetHeight = offsetHeight;\n      appOffsetWidth = offsetWidth;\n   }\n\n   /**\n    * Transitions can cause side effects. Work around this issue by using an if conditional.\n    * Due to timing issues and the onDestroy / outro transitions can cause elementRoot / elementContent to be set to\n    * null when swapped dynamically. There is a feature request to allow transition functions to be undefined:\n    *\n    * @see: https://github.com/sveltejs/svelte/issues/6942\n    */\n</script>\n\n<svelte:options accessors={true}/>\n\n{#if inTransition !== TJSDefaultTransition.default || outTransition !== TJSDefaultTransition.default}\n   <!-- svelte-ignore a11y-no-noninteractive-element-interactions -->\n   <div id={application.id}\n        class=\"app window-app {application.options.classes.join(' ')}\"\n        data-appid={application.appId}\n        bind:this={elementRoot}\n        in:inTransition|global={inTransitionOptions}\n        out:outTransition|global={outTransitionOptions}\n        on:close:popup|preventDefault|stopPropagation={onClosePopup}\n        on:keydown={onKeydown}\n        on:pointerdown|capture={onPointerdownApp}\n        use:applyStyles={stylesApp}\n        use:dynamicAction={appResizeObserver}\n        role=application\n        tabindex=-1>\n      <TJSApplicationHeader {draggable} {draggableOptions} />\n      <section class=window-content\n               bind:this={elementContent}\n               on:pointerdown={onPointerdownContent}\n               use:applyStyles={stylesContent}\n               use:contentResizeObserver={resizeObservedContent}\n               tabindex=-1>\n         <slot />\n      </section>\n      <ResizableHandle />\n      <TJSFocusWrap {elementRoot} />\n   </div>\n{:else}\n   <!-- svelte-ignore a11y-no-noninteractive-element-interactions -->\n   <div id={application.id}\n        class=\"app window-app {application.options.classes.join(' ')}\"\n        data-appid={application.appId}\n        bind:this={elementRoot}\n        on:close:popup|preventDefault|stopPropagation={onClosePopup}\n        on:keydown={onKeydown}\n        on:pointerdown|capture={onPointerdownApp}\n        use:applyStyles={stylesApp}\n        use:dynamicAction={appResizeObserver}\n        role=application\n        tabindex=-1>\n      <TJSApplicationHeader {draggable} {draggableOptions} />\n      <section class=window-content\n               bind:this={elementContent}\n               on:pointerdown={onPointerdownContent}\n               use:applyStyles={stylesContent}\n               use:contentResizeObserver={resizeObservedContent}\n               tabindex=-1>\n         <slot />\n      </section>\n      <ResizableHandle />\n      <TJSFocusWrap {elementRoot} enabled={focusWrapEnabled} />\n   </div>\n{/if}\n\n<style>\n   /* Note: this is different than stock Foundry and allows rounded corners from .app core styles */\n   .window-app {\n      contain: layout style paint;\n      overflow: var(--tjs-app-overflow, hidden);\n   }\n\n   .window-content {\n      gap: var(--tjs-app-content-gap);\n\n      /* For Firefox */\n      scrollbar-width: var(--tjs-app-content-scrollbar-width, thin);\n      scrollbar-color: var(--tjs-app-content-scrollbar-color, inherit);\n   }\n\n   .window-app:focus-visible {\n      outline: var(--tjs-app-outline-focus-visible, var(--tjs-default-a11y-outline-focus-visible, 2px solid transparent));\n   }\n\n   .window-content:focus-visible {\n      outline: var(--tjs-app-content-outline-focus-visible, var(--tjs-default-a11y-outline-focus-visible, 2px solid transparent));\n   }\n\n   /* Override Foundry default; adjust --tjs-app-header-gap to change gap size */\n   .window-app :global(.window-header a) {\n      flex: none;\n      margin: 0;\n   }\n\n   /* Override Foundry default; See TJSHeaderButton for CSS variables */\n   .window-app :global(.window-header i[class^=fa]) {\n      margin: 0\n   }\n</style>\n","<script>\n   /**\n    * @privateRemarks\n    * TODO: Add description\n    *\n    * @componentDocumentation\n    */\n   import { applyStyles }              from '@typhonjs-fvtt/runtime/svelte/action/dom/style';\n   import { TJSDefaultTransition }     from '@typhonjs-fvtt/runtime/svelte/transition';\n   import { CrossWindow }              from '@typhonjs-fvtt/runtime/util/browser';\n   import { isObject }                 from '@typhonjs-fvtt/runtime/util/object';\n\n   /** @type {string} */\n   export let background = '#50505080';\n\n   /** @type {boolean} */\n   export let captureInput = true;\n\n   /**\n    * When true any input fires an event `glasspane:close`.\n    *\n    * @type {boolean}\n    */\n   export let closeOnInput = void 0;\n\n   /** @type {string} */\n   export let id = void 0;\n\n   /** @type {boolean} */\n   export let slotSeparate = void 0;\n\n   /** @type {{ [key: string]: string | null }} */\n   export let styles = void 0;\n\n   /** @type {number} */\n   export let zIndex = Number.MAX_SAFE_INTEGER;\n\n   /** @type {HTMLDivElement} */\n   let backgroundEl, containerEl, glassPaneEl;\n\n   $: slotSeparate = typeof slotSeparate === 'boolean' ? slotSeparate : false;\n\n   // ---------------------------------------------------------------------------------------------------------------\n\n   // The following block is somewhat complex, but allows transition options to be updated reactively during\n   // runtime execution.\n\n   // Exports properties to set a transition w/ in / out options.\n   export let transition = void 0;\n   export let inTransition = void 0;\n   export let outTransition = void 0;\n\n   // Exports properties to set options for any transitions.\n   export let transitionOptions = void 0;\n   export let inTransitionOptions = TJSDefaultTransition.options;\n   export let outTransitionOptions = TJSDefaultTransition.options;\n\n   // Tracks last transition state.\n   let oldTransition = void 0;\n   let oldTransitionOptions = void 0\n\n   // Run this reactive block when the last transition state is not equal to the current state.\n   $: if (oldTransition !== transition)\n   {\n      // If transition is defined and not the default transition then set it to both in and out transition otherwise\n      // set the default transition to both in & out transitions.\n      const newTransition = typeof transition === 'function' ? transition : void 0;\n\n      inTransition = newTransition;\n      outTransition = newTransition;\n\n      oldTransition = newTransition;\n   }\n\n   // Run this reactive block when the last transition options state is not equal to the current options state.\n   $: if (oldTransitionOptions !== transitionOptions)\n   {\n      const newOptions = transitionOptions !== TJSDefaultTransition.options && isObject(transitionOptions) ?\n       transitionOptions : TJSDefaultTransition.options;\n\n      inTransitionOptions = newOptions;\n      outTransitionOptions = newOptions;\n\n      oldTransitionOptions = newOptions;\n   }\n\n   // Handle cases if inTransition is unset; assign noop default transition function.\n   $: if (typeof inTransition !== 'function') { inTransition = void 0; }\n\n   // Handle cases if outTransition is unset; assign noop default transition function.\n   $: if (typeof outTransition !== 'function') { outTransition = void 0; }\n\n   // Handle cases if inTransitionOptions is unset; assign empty default transition options.\n   $: if (!isObject(inTransitionOptions)) { inTransitionOptions = TJSDefaultTransition.options; }\n\n   // Handle cases if outTransitionOptions is unset; assign empty default transition options.\n   $: if (!isObject(outTransitionOptions)) { outTransitionOptions = TJSDefaultTransition.options; }\n\n   // ---------------------------------------------------------------------------------------------------------------\n\n   /**\n    * Swallows / stops propagation for all events where the event target is not contained by the glass pane element.\n    *\n    * @param {Event} event - The event to swallow.\n    */\n   function swallow(event)\n   {\n      const targetEl = event.target;\n\n      // Special handling of the Escape key pressed regardless of event target.\n      if (event?.type === 'keydown' && event?.code === 'Escape')\n      {\n         glassPaneEl.dispatchEvent(new CustomEvent('glasspane:keydown:escape', { bubbles: true, cancelable: true }));\n      }\n\n      // Ignore any events originating inside the glasspane. Return early if event target is not contained in glasspane.\n      // An `instanceof` check ensures that the target is a Node. There may be cases where the target could be the\n      // `window`, etc.\n      if (targetEl !== glassPaneEl && targetEl !== backgroundEl && targetEl !== containerEl &&\n       glassPaneEl.contains(CrossWindow.isNode(targetEl) ? targetEl : null))\n      {\n         return;\n      }\n\n      if (captureInput)\n      {\n         // `wheel` event types can't use `preventDefault` in capture / passive mode.\n         // see: https://chromestatus.com/feature/6662647093133312\n         if (event?.type !== 'wheel') { event.preventDefault(); }\n\n         event.stopImmediatePropagation();\n      }\n\n      if (event?.type === 'pointerdown')\n      {\n         glassPaneEl.dispatchEvent(new CustomEvent('glasspane:pointerdown', { bubbles: true, cancelable: true }));\n\n         if (closeOnInput)\n         {\n            glassPaneEl.dispatchEvent(new CustomEvent('glasspane:close', { bubbles: true, cancelable: true }));\n         }\n      }\n   }\n</script>\n\n<!-- Capture all input -->\n<svelte:window\n        on:contextmenu|capture={swallow}\n        on:dblclick|capture={swallow}\n        on:keydown|capture={swallow}\n        on:keyup|capture={swallow}\n        on:mousedown|capture={swallow}\n        on:mousemove|capture={swallow}\n        on:mouseup|capture={swallow}\n        on:pointerdown|capture={swallow}\n        on:pointermove|capture={swallow}\n        on:pointerup|capture={swallow}\n        on:touchend|capture={swallow}\n        on:touchmove|capture={swallow}\n        on:touchstart|capture={swallow}\n        on:wheel|capture={swallow}\n/>\n\n<div id={id}\n     bind:this={glassPaneEl}\n     class=tjs-glass-pane\n     style:z-index={zIndex}\n     on:glasspane:close\n     on:glasspane:keydown:escape\n     on:glasspane:pointerdown>\n\n   {#if slotSeparate}\n      <div class=tjs-glass-pane-background\n           bind:this={backgroundEl}\n           style:background={background}\n           in:inTransition|global={inTransitionOptions}\n           out:outTransition|global={outTransitionOptions}\n           use:applyStyles={styles}></div>\n\n      <div class=tjs-glass-pane-container bind:this={containerEl}>\n         <slot />\n      </div>\n   {:else}\n      <div class=\"tjs-glass-pane-background tjs-glass-pane-container\"\n           bind:this={backgroundEl}\n           style:background={background}\n           in:inTransition|global={inTransitionOptions}\n           out:outTransition|global={outTransitionOptions}\n           use:applyStyles={styles} >\n         <slot />\n      </div>\n   {/if}\n</div>\n\n<style>\n   .tjs-glass-pane, .tjs-glass-pane-background , .tjs-glass-pane-container {\n      position: absolute;\n      overflow: hidden;\n\n      height: 100%;\n      width: 100%;\n      max-height: 100%;\n      max-width: 100%;\n   }\n</style>\n","import { cssVariables }                      from './cssVariables.js';\n\nexport { default as ApplicationShell }       from './ApplicationShell.svelte';\nexport { default as EmptyApplicationShell }  from './EmptyApplicationShell.svelte';\nexport { default as TJSApplicationShell }    from './TJSApplicationShell.svelte';\nexport { default as TJSGlassPane }           from './TJSGlassPane.svelte';\n\n/**\n * Provides default CSS variables for core components.\n */\ncssVariables.setProperties({\n   // Anchor text shadow / header buttons\n   '--tjs-default-text-shadow-focus-hover': '0 0 8px var(--color-shadow-primary)',\n\n   // TJSApplicationShell app background.\n   '--tjs-app-background': `url(\"${globalThis.foundry.utils.getRoute('/ui/denim075.png')}\")`,\n}, false);\n","<script>\n   /**\n    * @privateRemarks\n    * TODO: Add description\n    *\n    * @componentDocumentation\n    * @internal\n    */\n   import {\n      getContext,\n      onDestroy,\n      onMount }               from 'svelte';\n\n   import { applyStyles }     from '@typhonjs-fvtt/runtime/svelte/action/dom/style';\n\n   import { TJSSvelte }       from '@typhonjs-fvtt/runtime/svelte/util';\n\n   import { A11yHelper }      from '@typhonjs-fvtt/runtime/util/a11y';\n   import { localize }        from '@typhonjs-fvtt/runtime/util/i18n';\n   import { isObject }        from '@typhonjs-fvtt/runtime/util/object';\n\n   export let data = void 0;\n   export let preventDefault = false;\n   export let stopPropagation = false;\n\n   export let dialogComponent = void 0;\n\n   const s_REGEX_HTML = /^\\s*<.*>$/;\n\n   const { elementRoot } = getContext('#internal').stores;\n\n   /**\n    * @type {TJSDialog}\n    */\n   const application = getContext('#external')?.application;\n\n   const managedPromise = getContext('#managedPromise');\n\n   let buttons;\n\n   /** @type {HTMLDivElement} */\n   let contentEl;\n\n   /** @type {HTMLDivElement} */\n   let buttonsEl;\n\n   let content = void 0;\n   let dialogClass;\n   let dialogProps = {};\n\n   let currentButtonId = data.default;\n\n   // Remove key listeners from elementRoot.\n   onDestroy(() =>\n   {\n      const rootEl = $elementRoot;\n      if (A11yHelper.isFocusTarget(rootEl))\n      {\n         rootEl.removeEventListener('keydown', onKeydown)\n         rootEl.removeEventListener('keyup', onKeyup)\n      }\n   })\n\n   // If `focusFirst` is true then focus first focusable element iin dialog content.\n   onMount(() =>\n   {\n      if (focusFirst)\n      {\n         const focusEl = A11yHelper.getFirstFocusableElement(contentEl);\n\n         if (A11yHelper.isFocusTarget(focusEl))\n         {\n            // Focus on next macrotask to allow application / dialog to mount to bypass ApplicationShell onMount focus\n            // handling.\n            setTimeout(() => focusEl.focus(), 0);\n         }\n      }\n   });\n\n   // Add key listeners to elementRoot when it is bound.\n   $: if ($elementRoot)\n   {\n      const rootEl = $elementRoot;\n      if (A11yHelper.isFocusTarget(rootEl))\n      {\n         rootEl.addEventListener('keydown', onKeydown)\n         rootEl.addEventListener('keyup', onKeyup)\n      }\n   }\n\n   // Automatically close the dialog on button click handler completion.\n   $: autoClose = typeof data.autoClose === 'boolean' ? data.autoClose : true;\n\n   // When true the first focusable element that isn't a button is focused.\n   $: focusFirst = typeof data.focusFirst === 'boolean' ? data.focusFirst : false;\n\n   // Focus current button when `buttonsEl` is bound.\n   $: if (!focusFirst && A11yHelper.isFocusTarget(buttonsEl))\n   {\n      const buttonEl = buttonsEl.querySelector(`.${currentButtonId}`);\n      if (A11yHelper.isFocusTarget(buttonEl)) { buttonEl.focus(); }\n   }\n\n   // When false the dialog does not automatically close when button selected.\n   $: resolveId = typeof data.resolveId === 'boolean' ? data.resolveId : false;\n\n   // If `data.buttons` is not an object then set an empty array otherwise reduce the button data.\n   $:\n   {\n      buttons = !isObject(data.buttons) ? [] : Object.keys(data.buttons).reduce((array, key) =>\n      {\n         const b = data.buttons[key];\n\n         // Handle icon and treat bare strings as the icon class; otherwise assume the icon is fully formed HTML.\n         const icon = typeof b.icon !== 'string' ? void 0 : s_REGEX_HTML.test(b.icon) ? b.icon :\n          `<i class=\"${b.icon}\"></i>`;\n\n         const autoClose = typeof b.autoClose === 'boolean' ? b.autoClose : true;\n\n         const disabled = typeof b.disabled === 'boolean' ? b.disabled : false;\n\n         const label = typeof b.label === 'string' ? `${icon !== void 0 ? ' ' : ''}${localize(b.label)}` : '';\n\n         const title = typeof b.title === 'string' ? localize(b.title) : void 0;\n\n         // Test any condition supplied otherwise default to true.\n         const condition = typeof b.condition === 'function' ? b.condition.call(b) : b.condition ?? true;\n\n         if (condition) { array.push({ ...b, id: key, autoClose, icon, label, title, disabled }); }\n\n         return array;\n      }, []);\n   }\n\n   /**\n    * This reactivity block will trigger on arrow left / right key presses _and_ when buttons change. It is OK for it to\n    * trigger on both.\n    */\n   $: if (!buttons.find((button) => button.id === currentButtonId)) { currentButtonId = void 0; }\n\n   $: if (content !== data.content) // Only update the content if it has changed.\n   {\n      content = data.content;\n\n      try\n      {\n         if (TJSSvelte.config.isConfigEmbed(content))\n         {\n            dialogClass = content.class;\n            dialogProps = content.props;\n         }\n         else\n         {\n            dialogClass = void 0;\n            dialogProps = {};\n         }\n      }\n      catch (err)\n      {\n         dialogClass = void 0;\n         dialogProps = {};\n\n         content = err.message;\n         console.error(err);\n      }\n   }\n\n   /**\n    * Handle button click.\n    *\n    * @privateRemarks\n    * TODO: When app eventbus is available send event for UI notification instead of Foundry API usage.\n    *\n    * @param {import('@typhonjs-fvtt/runtime/svelte/application').TJSDialogButtonData}   button - button data.\n    *\n    * @returns {*}\n    */\n   function onClick(button)\n   {\n      try\n      {\n         let result = void 0;\n\n         const callback = button?.onPress;\n\n         switch (typeof callback)\n         {\n            case 'function':\n               // Pass back the TJSDialog instance.\n               result = callback({ application });\n               break;\n\n            case 'string':\n               // Attempt lookup by function name in dialog instance component.\n               if (dialogComponent !== void 0 && typeof dialogComponent[callback] === 'function')\n               {\n                  result = dialogComponent[callback]({ application });\n               }\n               else\n               {\n                  if (dialogComponent === void 0)\n                  {\n                     console.warn(`[TRL] TJSDialog warning: 'onPress' defined as a string with no associated ` +\n                      `content Svelte component.`);\n                  }\n                  else if (typeof dialogComponent?.[callback] !== 'function')\n                  {\n                     console.warn(`[TRL] TJSDialog warning: The content Svelte component does not contain an ` +\n                      `associated function '${callback}'. Did you remember to add ` +\n                       `'<svelte:options accessors={true} />' and export the function?`);\n                  }\n               }\n               break;\n         }\n\n         // By default, both 'button.autoClose' & autoClose are true, so skip auto-closing when either is false.\n         if (button.autoClose && autoClose)\n         {\n            // If `resolveId` dialog option is true and current result is undefined then set result to the button ID.\n            if (resolveId && result === void 0) { result = button.id; }\n\n            managedPromise.resolve(result);\n         }\n      }\n      catch(err)\n      {\n         const notifyError = typeof data.notifyError === 'boolean' ? data.notifyError : true;\n         if (notifyError)\n         {\n            // TODO: When app eventbus is available send event for UI notification instead of Foundry API usage.\n            globalThis.ui.notifications.error(err, { console: false });\n         }\n\n         // Attempt to first reject the error with any current managed Promise otherwise rethrow error.\n         if (!managedPromise.reject(err)) { throw err; }\n      }\n      finally\n      {\n         // By default, both 'button.autoClose' & autoClose are true, so skip auto-closing when either is false.\n         if (button.autoClose && autoClose) { application.close(); }\n      }\n   }\n\n   /**\n    * Handles key down events for stopping propagation for arrow keys. Also handles tab / focus traversal with a timeout\n    * to update `currentButtonId` on the next clock tick comparing against `document.activeElement`.\n    *\n    * @param {KeyboardEvent}  event - A KeyboardEvent.\n    */\n   function onKeydown(event)\n   {\n      switch (event.code)\n      {\n         case 'ArrowLeft':\n         case 'ArrowRight':\n         case 'Enter':\n            event.stopPropagation();\n            break;\n\n         case 'Tab':\n            event.stopPropagation();\n\n            // Check `activeElement` on next macrotask to potentially update `currentButtonId` from tab / keyboard\n            // navigation.\n            setTimeout(() =>\n            {\n               const activeWindow = application.reactive.activeWindow;\n\n               const activeElement = activeWindow.document.activeElement;\n               if (A11yHelper.isFocusTarget(activeElement) && A11yHelper.isFocusTarget(buttonsEl) &&\n                buttonsEl.contains(activeElement))\n               {\n                  // Find class that isn't `dialog-button` or `default` and is a key in `data.buttons`.\n                  for (let cntr = 0; cntr < activeElement.classList.length; cntr++)\n                  {\n                     const item = activeElement.classList.item(cntr);\n                     if (item !== 'dialog-button' && item !== 'default' && typeof data.buttons[item] !== void 0)\n                     {\n                        currentButtonId = item;\n                        break;\n                     }\n                  }\n               }\n            }, 0);\n            break;\n\n         default:\n            if (preventDefault) { event.preventDefault(); }\n            if (stopPropagation) { event.stopPropagation(); }\n            break;\n      }\n   }\n\n   /**\n    * Handles key up events for arrow key button navigation.\n    *\n    * @param {KeyboardEvent}  event - A KeyboardEvent.\n    */\n   function onKeyup(event)\n   {\n      switch (event.code)\n      {\n         case 'ArrowLeft':\n         {\n            event.preventDefault();\n            event.stopPropagation();\n\n            const activeWindow = application.reactive.activeWindow;\n            const activeEl = activeWindow.document.activeElement;\n\n            if (A11yHelper.isFocusTarget(buttonsEl))\n            {\n               // Only advance button via arrow key if a button is already focused.\n               if (A11yHelper.isFocusTarget(activeEl) && buttonsEl.contains(activeEl))\n               {\n                  const currentIndex = buttons.findIndex((button) => button.id === currentButtonId);\n                  if (buttons.length && currentIndex > 0) { currentButtonId = buttons[currentIndex - 1].id; }\n               }\n\n               const buttonEl = buttonsEl.querySelector(`.${currentButtonId}`);\n               if (A11yHelper.isFocusTarget(buttonEl)) { buttonEl.focus(); }\n            }\n            break;\n         }\n\n         case 'ArrowRight':\n         {\n            event.preventDefault();\n            event.stopPropagation();\n\n            const activeWindow = application.reactive.activeWindow;\n            const activeEl = activeWindow.document.activeElement;\n\n            if (A11yHelper.isFocusTarget(buttonsEl))\n            {\n               // Only advance button via arrow key if a button is already focused  or there is no current button ID\n               if (A11yHelper.isFocusTarget(activeEl) && (buttonsEl.contains(activeEl) || currentButtonId === void 0))\n               {\n                  const currentIndex = buttons.findIndex((button) => button.id === currentButtonId);\n                  if (buttons.length && currentIndex < buttons.length - 1) { currentButtonId = buttons[currentIndex + 1].id; }\n               }\n\n               const buttonEl = buttonsEl.querySelector(`.${currentButtonId}`);\n               if (A11yHelper.isFocusTarget(buttonEl)) { buttonEl.focus(); }\n            }\n            break;\n         }\n\n         case 'Enter':\n            event.preventDefault();\n            event.stopPropagation();\n            break;\n\n         default:\n            if (preventDefault) { event.preventDefault(); }\n            if (stopPropagation) { event.stopPropagation(); }\n            break;\n      }\n   }\n</script>\n\n<main>\n   <div bind:this={contentEl} class=dialog-content>\n      {#if typeof content === 'string'}\n         {@html content}\n      {:else if dialogClass}\n         <svelte:component bind:this={dialogComponent} this={dialogClass} {...dialogProps} />\n      {/if}\n   </div>\n\n   {#if buttons.length}\n   <div bind:this={buttonsEl} class=\"dialog-buttons tjs-dialog-buttons\">\n      {#each buttons as button (button.id)}\n      <button class=\"dialog-button tjs-dialog-button {button.id}\"\n              on:click|preventDefault|stopPropagation={() => onClick(button)}\n              on:focus={() => currentButtonId = button.id}\n              disabled={button.disabled}\n              use:applyStyles={button.styles}>\n         <span title={button.title}>{#if button.icon}{@html button.icon}{/if}{button.label}</span>\n      </button>\n      {/each}\n   </div>\n   {/if}\n</main>\n\n<style>\n   .dialog-buttons {\n      padding-top: 8px;\n   }\n\n   .tjs-dialog-button:hover {\n      box-shadow: var(--tjs-dialog-button-box-shadow-focus-hover, var(--tjs-default-box-shadow-focus-hover));\n      outline: var(--tjs-dialog-button-outline-focus-hover, var(--tjs-default-outline-focus-hover, revert));\n      transition: var(--tjs-dialog-button-transition-focus-hover, var(--tjs-default-transition-focus-hover));\n      text-shadow: var(--tjs-dialog-button-text-shadow-focus-hover, var(--tjs-default-text-shadow-focus-hover, inherit));\n   }\n\n   .tjs-dialog-button:focus-visible {\n      box-shadow: var(--tjs-dialog-button-box-shadow-focus-visible, var(--tjs-default-box-shadow-focus-visible));\n      outline: var(--tjs-dialog-button-outline-focus-visible, var(--tjs-default-outline-focus-visible, revert));\n      transition: var(--tjs-dialog-button-transition-focus-visible, var(--tjs-default-transition-focus-visible));\n      text-shadow: var(--tjs-dialog-button-text-shadow-focus-visible, var(--tjs-default-text-shadow-focus-hover, inherit));\n   }\n</style>\n","<script>\n   /**\n    * TODO: Add description\n    *\n    * @componentDocumentation\n    * @internal\n    */\n   import {\n      getContext,\n      onDestroy,\n      onMount,\n      setContext }               from 'svelte';\n\n   import { writable }           from 'svelte/store';\n\n   import { fade }               from 'svelte/transition';\n\n   import {\n      ApplicationShell,\n      TJSGlassPane }             from '@typhonjs-fvtt/runtime/svelte/component/application';\n\n   import { A11yHelper }         from '@typhonjs-fvtt/runtime/util/a11y';\n   import { isObject }           from '@typhonjs-fvtt/runtime/util/object';\n\n   import DialogContent          from './DialogContent.svelte';\n\n   // ApplicationShell contract.\n   export let elementContent = void 0;\n   export let elementRoot = void 0;\n\n   // The dialog data.\n   export let data = {};\n\n   export let dialogComponent = void 0;\n\n   export let managedPromise = void 0;\n\n   /**\n    * @type {TJSDialog}\n    */\n   const application = getContext('#external')?.application;\n\n   const dialogOptions = writable({});\n\n   setContext('#managedPromise', managedPromise);\n   setContext('#dialogOptions', dialogOptions);\n\n   const s_MODAL_TRANSITION = fade;\n   const s_MODAL_TRANSITION_OPTIONS = { duration: 200 };\n   const s_MODAL_BACKGROUND = '#50505080'\n\n   let modal = void 0;\n\n   // Stores props for the ApplicationShell.\n   const appProps = {\n      // Stores any transition functions.\n      transition: void 0,\n      inTransition: void 0,\n      outTransition: void 0,\n\n      // Stores properties to set for options for any transitions.\n      transitionOptions: void 0,\n      inTransitionOptions: void 0,\n      outTransitionOptions: void 0,\n\n      // Stores any style overrides for application shell.\n      stylesApp: void 0,\n      stylesContent: void 0\n   }\n\n   const modalProps = {\n      // Background CSS style string.\n      background: void 0,\n      slotSeparate: void 0,\n      styles: void 0,\n\n      // Close modal on glasspane input.\n      closeOnInput: void 0,\n\n      // Stores any transition functions.\n      transition: void 0,\n      inTransition: void 0,\n      outTransition: void 0,\n\n      // Stores properties to set for options for any transitions.\n      transitionOptions: void 0,\n      inTransitionOptions: void 0,\n      outTransitionOptions: void 0,\n   }\n\n   let zIndex = void 0;\n\n   // Only set modal once on mount. You can't change between a modal an non-modal dialog during runtime.\n   if (modal === void 0) { modal = typeof data?.modal === 'boolean' ? data.modal : false; }\n\n   // Special modal handling -----------------------------------------------------------------------------------------\n\n   const activeWindow = application.reactive.activeWindow;\n\n   if (!modal)\n   {\n      // Add a listener on document keydown to act before or equal with other event listeners.\n      onDestroy(() => activeWindow.document.removeEventListener('keydown', onKeydown));\n      onMount(() => activeWindow.document.addEventListener('keydown', onKeydown));\n   }\n\n   // Aria Attributes ------------------------------------------------------------------------------------------------\n\n   $: if (A11yHelper.isFocusTarget(elementRoot))\n   {\n      elementRoot.setAttribute('role', 'dialog');\n\n      if (modal) { elementRoot.setAttribute('aria-modal', 'true'); }\n   }\n\n   // SvelteApplication options --------------------------------------------------------------------------------------\n\n   // Retrieve values from the DialogData object and also potentially set any SvelteApplication accessors.\n   // Explicit checks are performed against existing local variables as the only externally reactive variable is `data`.\n   // All of the checks below trigger when there are any external changes to the `data` prop.\n   // Prevent any unnecessary changing of local & `application` variables unless actual changes occur.\n\n   $: if (isObject(data))\n   {\n      // Update internal dialog options store / context with `data`.\n      dialogOptions.set(data);\n\n      const newZIndex = Number.isInteger(data.zIndex) || data.zIndex === null ? data.zIndex :\n       modal ? Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER - 1\n      if (zIndex !== newZIndex) { zIndex = newZIndex; }\n\n      // Update the main foundry options when data changes. Perform explicit checks against existing data in `application`.\n      const newDraggable = typeof data.draggable === 'boolean' ? data.draggable : void 0;\n      if (newDraggable !== void 0 && application.reactive.draggable !== newDraggable)\n      {\n         application.reactive.draggable = newDraggable;\n      }\n\n      const newFocusAuto = typeof data.focusAuto === 'boolean' ? data.focusAuto : void 0;\n      if (newFocusAuto !== void 0 && application.reactive.focusAuto !== newFocusAuto)\n      {\n         application.reactive.focusAuto = newFocusAuto;\n      }\n\n      const newFocusKeep = typeof data.focusKeep === 'boolean' ? data.focusKeep : void 0;\n      if (newFocusKeep !== void 0 && application.reactive.focusKeep !== newFocusKeep)\n      {\n         application.reactive.focusKeep = newFocusKeep;\n      }\n\n      const newFocusTrap = typeof data.focusTrap === 'boolean' ? data.focusTrap : void 0;\n      if (newFocusTrap !== void 0 && application.reactive.focusTrap !== newFocusTrap)\n      {\n         application.reactive.focusTrap = newFocusTrap;\n      }\n\n      const newMinimizable = typeof data.minimizable === 'boolean' ? data.minimizable : void 0;\n      if (newMinimizable !== void 0 && application.reactive.minimizable !== newMinimizable)\n      {\n         application.reactive.minimizable = newMinimizable;\n      }\n\n      const newResizable = typeof data.resizable === 'boolean' ? data.resizable : void 0;\n      if (newResizable !== void 0 && application.reactive.resizable !== newResizable)\n      {\n         application.reactive.resizable = newResizable;\n      }\n\n      // Note application.title from Application localizes `options.title`, so compare with `application.options.title`.\n      const newTitle = data.title ?? 'Dialog';\n      if (newTitle !== application?.options?.title) { application.reactive.title = newTitle; }\n\n      if (application.position.zIndex !== zIndex) { application.position.zIndex = zIndex; }\n   }\n\n   // ApplicationShell transition options ----------------------------------------------------------------------------\n\n   $: if (isObject(data?.transition))\n   {\n      // Store data.transitions to shorten statements below.\n      const d = data.transition;\n\n      if (d?.transition !== appProps.transition) { appProps.transition = d.transition; }\n      if (d?.inTransition !== appProps.inTransition) { appProps.inTransition = d.inTransition; }\n      if (d?.outTransition !== appProps.outTransition) { appProps.outTransition = d.outTransition; }\n      if (d?.transitionOptions !== appProps.transitionOptions) { appProps.transitionOptions = d.transitionOptions; }\n\n      if (d?.inTransitionOptions !== appProps.inTransitionOptions)\n      {\n         appProps.inTransitionOptions = d.inTransitionOptions;\n      }\n\n      if (d?.outTransitionOptions !== appProps.outTransitionOptions)\n      {\n         appProps.outTransitionOptions = d.outTransitionOptions;\n      }\n   }\n\n   // Modal options --------------------------------------------------------------------------------------------------\n\n   $:\n   {\n      const newModalBackground = typeof data?.modalOptions?.background === 'string' ? data.modalOptions.background :\n       s_MODAL_BACKGROUND;\n\n      if (newModalBackground !== modalProps.background) { modalProps.background = newModalBackground; }\n   }\n\n   $:\n   {\n      const newModalSlotSeparate = typeof data?.modalOptions?.slotSeparate === 'boolean' ?\n       data.modalOptions.slotSeparate : void 0;\n\n      if (newModalSlotSeparate !== modalProps.slotSeparate) { modalProps.slotSeparate = newModalSlotSeparate; }\n   }\n\n   $:\n   {\n      const newModalStyles = isObject(data?.modalOptions?.styles) ? data.modalOptions.styles : void 0;\n\n      if (newModalStyles !== modalProps.styles) { modalProps.styles = newModalStyles; }\n   }\n\n   $:\n   {\n      const newModalCloseOnInput = typeof data?.modalOptions?.closeOnInput === 'boolean' ?\n       data.modalOptions.closeOnInput : void 0;\n\n      if (newModalCloseOnInput !== modalProps.closeOnInput) { modalProps.closeOnInput = newModalCloseOnInput; }\n   }\n\n   $: if (isObject(data?.modalOptions?.transition))\n   {\n      // Store data.transitions to shorten statements below.\n      const d = data.modalOptions.transition;\n\n      if (d?.transition !== modalProps.transition)\n      {\n         modalProps.transition = typeof d?.transition === 'function' ? d.transition : s_MODAL_TRANSITION;\n      }\n\n      if (d?.inTransition !== modalProps.inTransition) { modalProps.inTransition = d.inTransition; }\n      if (d?.outTransition !== modalProps.outTransition) { modalProps.outTransition = d.outTransition; }\n\n      // Provide default transition options if not defined.\n      if (d?.transitionOptions !== modalProps.transitionOptions)\n      {\n         modalProps.transitionOptions = isObject(d?.transitionOptions) ? d.transitionOptions :\n          s_MODAL_TRANSITION_OPTIONS;\n      }\n\n      if (d?.inTransitionOptions !== modalProps.inTransitionOptions)\n      {\n         modalProps.inTransitionOptions = d.inTransitionOptions;\n      }\n\n      if (d?.outTransitionOptions !== modalProps.outTransitionOptions)\n      {\n         modalProps.outTransitionOptions = d.outTransitionOptions;\n      }\n   }\n   else  // Provide a fallback / default glass pane transition when `data.modalOptions.transition` is not defined.\n   {\n      const newModalTransition = typeof data?.modalOptions?.transition?.transition === 'function' ?\n       data.modalOptions.transition.transition : s_MODAL_TRANSITION;\n\n      if (newModalTransition !== modalProps.transition) { modalProps.transition = newModalTransition; }\n\n      const newModalTransitionOptions = isObject(data?.modalOptions?.transitionOptions) ?\n       data.modalOptions.transitionOptions : s_MODAL_TRANSITION_OPTIONS;\n\n      if (newModalTransitionOptions !== modalProps.transitionOptions)\n      {\n         modalProps.transitionOptions = newModalTransitionOptions;\n      }\n   }\n\n   /**\n    * Handles closing all open TJSDialog instances when <Esc> key is pressed.\n    *\n    * @param {KeyboardEvent}  event - A KeyboardEvent.\n    */\n   function onKeydown(event)\n   {\n      if (event.code === 'Escape')\n      {\n         event.preventDefault();\n         event.stopPropagation();\n         application.close();\n      }\n   }\n</script>\n\n<svelte:options accessors={true}/>\n\n{#if modal}\n   <TJSGlassPane id={`${application.id}-glasspane`} {...modalProps} {zIndex}\n                 on:glasspane:close={() => application.close()}\n                 on:glasspane:keydown:escape={() => application.close()}>\n      <ApplicationShell bind:elementRoot bind:elementContent {...appProps}>\n         <DialogContent bind:dialogComponent {data} stopPropagation={true} />\n      </ApplicationShell>\n   </TJSGlassPane>\n{:else}\n   <ApplicationShell bind:elementRoot bind:elementContent {...appProps}>\n      <DialogContent bind:dialogComponent {data} />\n   </ApplicationShell>\n{/if}\n","import { isIterable, isObject, safeAccess } from '@typhonjs-fvtt/runtime/util/object';\nimport { CrossWindow } from '@typhonjs-fvtt/runtime/util/browser';\n\n/**\n * Provides utility functions for retrieving data about images.\n */\nclass ImageData\n{\n   /**\n    * Loads given URLs into image elements returning those that resolved with width & height dimensions. This is useful\n    * when the size of an image is necessary before usage.\n    *\n    * @param {string | { url?: string } | Iterable<string | { url?: string }>} urls - A list of image URLS to load or\n    *        object with an `url` property.\n    *\n    * @param {object} [options] - Optional options.\n    *\n    * @param {string} [options.accessor='url'] - Accessor string to access child attribute when `urls` entry contains\n    *        objects.\n    *\n    * @param {boolean} [options.warn=false] - Log debug warnings when a target URL can not be determined; default: false.\n    *\n    * @returns {(Promise<{\n    *    fulfilled: { url: string, width: number, height: number }[],\n    *    rejected: { url: string }[]\n    * }>)} An object with `fulfilled` and `rejected` requests.\n    */\n   static async getDimensions(urls, { accessor = 'url', warn = false } = {})\n   {\n      const promises = [];\n      const fulfilled = [];\n      const rejected = [];\n\n      const targetURLs = isIterable(urls) ? urls : [urls];\n\n      for (const url of targetURLs)\n      {\n         let targetURL;\n\n         if (typeof url === 'string')\n         {\n            targetURL = url;\n         }\n         else if (isObject(url))\n         {\n            targetURL = safeAccess(url, accessor);\n         }\n\n         if (typeof targetURL !== 'string')\n         {\n            if (warn)\n            {\n               console.warn('ImageData.getDimensions warning: Failed to locate target URL.');\n            }\n\n            continue;\n         }\n\n         promises.push(new Promise((resolve, reject) =>\n         {\n            const img = new Image();\n            img.src = targetURL;\n\n            // Get the actual width / height of the image.\n            img.onload = () => resolve({ url: targetURL, width: img.naturalWidth, height: img.naturalHeight });\n            img.onerror = () => reject({ url: targetURL });\n         }));\n      }\n\n      const promiseResults = await Promise.allSettled(promises);\n\n      for (const result of promiseResults)\n      {\n         switch (result.status)\n         {\n            case 'fulfilled':\n               fulfilled.push(result.value);\n               break;\n\n            case 'rejected':\n               rejected.push(result.reason);\n               break;\n         }\n      }\n\n      return { fulfilled, rejected };\n   }\n}\n\n/**\n * Provides management of a single Promise that can be shared and accessed across JS & Svelte components. This allows a\n * Promise to be created and managed as part of the TRL application lifecycle and accessed safely in various control\n * flow scenarios. When resolution of the current managed Promise starts further interaction is prevented.\n *\n * Note: to enable debugging / log statements set the static `logging` variable to true.\n */\nclass ManagedPromise\n{\n   /** @type {boolean} */\n   static #logging = false;\n\n   /** @type {{ isProcessing?: boolean, promise?: Promise, reject: Function, resolve: Function }} */\n   #current;\n\n   /**\n    * @returns {boolean} Whether global logging is enabled.\n    */\n   static get logging()\n   {\n      return this.#logging;\n   }\n\n   /**\n    * @returns {boolean} Whether there is an active managed Promise.\n    */\n   get isActive()\n   {\n      return this.#current !== void 0;\n   }\n\n   /**\n    * @returns {boolean} Whether there is an active managed Promise and resolution is currently being processed.\n    */\n   get isProcessing()\n   {\n      return this.#current !== void 0 ? this.#current.isProcessing : false;\n   }\n\n   /**\n    * Sets global logging enabled state.\n    *\n    * @param {boolean}  logging - New logging enabled state.\n    */\n   static set logging(logging)\n   {\n      if (typeof logging !== 'boolean')\n      {\n         throw new TypeError(`[TRL] ManagedPromise.logging error: 'logging' is not a boolean.`);\n      }\n\n      this.#logging = logging;\n   }\n\n   // ----------------------------------------------------------------------------------------------------------------\n\n   /**\n    * Resolves any current Promise with undefined and creates a new current Promise.\n    *\n    * @template T\n    *\n    * @param {object} opts - Options.\n    *\n    * @param {boolean}  [opts.reuse=false] - When true if there is an existing live Promise it is returned immediately.\n    *\n    * @returns {Promise<T>} The new current managed Promise.\n    */\n   create({ reuse = false } = {})\n   {\n      if (typeof reuse !== 'boolean')\n      {\n         throw new TypeError(`[TRL] ManagedPromise.create error: 'reuse' is not a boolean.`);\n      }\n\n      if (reuse && this.#current !== void 0 && CrossWindow.isPromise(this.#current.promise))\n      {\n         if (ManagedPromise.#logging)\n         {\n            console.warn(`[TRL] ManagedPromise.create info: Reusing / returning existing managed Promise.`);\n         }\n\n         return this.#current.promise;\n      }\n\n      if (this.#current !== void 0)\n      {\n         if (ManagedPromise.#logging)\n         {\n            console.warn(\n             `[TRL] ManagedPromise.create info: Creating a new Promise and resolving existing immediately.`);\n         }\n\n         this.#current.resolve(void 0);\n         this.#current = void 0;\n      }\n\n      const promise = new Promise((resolve, reject) =>\n      {\n         this.#current = {\n            isProcessing: false,\n            reject,\n            resolve\n         };\n      });\n\n      this.#current.promise = promise;\n\n      return promise;\n   }\n\n   /**\n    * Gets the current Promise if any.\n    *\n    * @returns {Promise<any>} Current Promise.\n    */\n   get()\n   {\n      return this.#current ? this.#current.promise : void 0;\n   }\n\n   /**\n    * Rejects the current Promise if applicable.\n    *\n    * @param {*}  [result] - Result to reject.\n    *\n    * @returns {boolean} Was the promise rejected.\n    */\n   reject(result = void 0)\n   {\n      // Early out as Promise resolution is currently processing.\n      if (this.#current !== void 0 && this.#current.isProcessing)\n      {\n         if (ManagedPromise.#logging)\n         {\n            console.warn(`[TRL] ManagedPromise.reject info: Currently processing promise.`);\n         }\n\n         return true;\n      }\n\n      if (this.#current !== void 0)\n      {\n         this.#current.isProcessing = true;\n\n         if (CrossWindow.isPromise(result))\n         {\n            result.then((value) =>\n            {\n               this.#current.reject(value);\n               this.#current = void 0;\n            }).catch((err) =>\n            {\n               this.#current.reject(err);\n               this.#current = void 0;\n            });\n         }\n         else\n         {\n            this.#current.reject(result);\n            this.#current = void 0;\n         }\n\n         return true;\n      }\n      else\n      {\n         if (ManagedPromise.#logging)\n         {\n            console.warn(`[TRL] ManagedPromise.reject warning: No current managed Promise to reject.`);\n         }\n\n         return false;\n      }\n   }\n\n   /**\n    * Resolves the current Promise if applicable.\n    *\n    * @param {*}  [result] - Result to resolve.\n    *\n    * @returns {boolean} Was the promise resolved.\n    */\n   resolve(result = void 0)\n   {\n      // Early out as Promise resolution is currently processing.\n      if (this.#current !== void 0 && this.#current.isProcessing)\n      {\n         if (ManagedPromise.#logging)\n         {\n            console.warn(`[TRL] ManagedPromise.resolve info: Currently processing promise.`);\n         }\n\n         return true;\n      }\n\n      if (this.#current !== void 0)\n      {\n         if (CrossWindow.isPromise(result))\n         {\n            this.#current.isProcessing = true;\n\n            result.then((value) =>\n            {\n               this.#current.resolve(value);\n               this.#current = void 0;\n            }).catch((err) =>\n            {\n               this.#current.reject(err);\n               this.#current = void 0;\n            });\n         }\n         else\n         {\n            this.#current.resolve(result);\n            this.#current = void 0;\n         }\n\n         return true;\n      }\n      else\n      {\n         if (ManagedPromise.#logging)\n         {\n            console.warn(`[TRL] ManagedPromise.resolve warning: No current managed Promise to resolve.`);\n         }\n\n         return false;\n      }\n   }\n}\n\nexport { ImageData, ManagedPromise };\n//# sourceMappingURL=index.js.map\n","import { isObject, deepMerge, safeAccess, safeSet, hasGetter, klona } from '@typhonjs-fvtt/runtime/util/object';\nimport { writable, derived } from 'svelte/store';\nimport { subscribeIgnoreFirst } from '@typhonjs-fvtt/runtime/svelte/store/util';\nimport { TJSWebStorage, TJSSessionStorage } from '@typhonjs-fvtt/runtime/svelte/store/web-storage';\nimport { propertyStore } from '@typhonjs-fvtt/runtime/svelte/store/writable-derived';\nimport { TJSSvelte } from '@typhonjs-fvtt/runtime/svelte/util';\nimport { CrossWindow } from '@typhonjs-fvtt/runtime/util/browser';\nimport { TJSPosition } from '@typhonjs-fvtt/runtime/svelte/store/position';\nimport { A11yHelper } from '@typhonjs-fvtt/runtime/util/a11y';\nimport { DialogShell } from '@typhonjs-fvtt/runtime/svelte/component/internal';\nimport { ManagedPromise } from '@typhonjs-fvtt/runtime/util/async';\n\n/**\n * Provides the ability the save / restore / serialize application state for positional and UI state such as minimized\n * status.\n */\nclass ApplicationState\n{\n   /** @type {import('../../SvelteApp.js').SvelteApp} */\n   #application;\n\n   /**\n    * Stores the current save state key being restored by animating. When a restore is already being animated with the\n    * same name the subsequent restore animation is ignored.\n    *\n    * @type {string | undefined}\n    */\n   #currentRestoreKey;\n\n   /** @type {Map<string, import('../../types').SvelteApp.API.State.Data>} */\n   #dataSaved = new Map();\n\n   /**\n    * @param {import('../../SvelteApp.js').SvelteApp}   application - The application.\n    */\n   constructor(application)\n   {\n      this.#application = application;\n\n      Object.seal(this);\n   }\n\n   /**\n    * Clears all saved application state.\n    */\n   clear()\n   {\n      this.#dataSaved.clear();\n   }\n\n   /**\n    * Returns current application state along with any extra data passed into method.\n    *\n    * @param {object} [extra] - Extra data to add to application state.\n    *\n    * @returns {import('../../types').SvelteApp.API.State.Data} Passed in object with current application state.\n    */\n   current(extra = {})\n   {\n      return Object.assign(extra, {\n         position: this.#application?.position?.get(),\n         beforeMinimized: this.#application?.position?.state.get({ name: '#beforeMinimized' }),\n         options: this.#application?.reactive?.toJSON(),\n         ui: { minimized: this.#application?.reactive?.minimized }\n      });\n   }\n\n   /**\n    * Gets any saved application state by name.\n    *\n    * @param {object}   options - Options.\n    *\n    * @param {string}   options.name - Saved data set name.\n    *\n    * @returns {import('../../types').SvelteApp.API.State.Data | undefined} Any saved application state.\n    */\n   get({ name })\n   {\n      if (typeof name !== 'string')\n      {\n         throw new TypeError(`[SvelteApp.state.get] error: 'name' is not a string.`);\n      }\n\n      return this.#dataSaved.get(name);\n   }\n\n   /**\n    * @returns {IterableIterator<string>} The saved application state names / keys.\n    */\n   keys()\n   {\n      return this.#dataSaved.keys();\n   }\n\n   /**\n    * Removes and returns any saved application state by name.\n    *\n    * @param {object}   options - Options.\n    *\n    * @param {string}   options.name - Name to remove and retrieve.\n    *\n    * @returns {import('../../types').SvelteApp.API.State.Data | undefined} Any saved application state.\n    */\n   remove({ name })\n   {\n      if (typeof name !== 'string') { throw new TypeError(`[SvelteApp.state.remove] error: 'name' is not a string.`); }\n\n      const data = this.#dataSaved.get(name);\n      this.#dataSaved.delete(name);\n\n      return data;\n   }\n\n   /**\n    * Restores a previously saved application state by `name` returning the data. Several optional parameters are\n    * available to animate / tween to the new state. When `animateTo` is true an animation is scheduled via\n    * {@link #runtime/svelte/store/position!TJSPosition.API.Animation.to} and the duration and easing name or function may be\n    * specified.\n    *\n    * @param {object}            options - Options.\n    *\n    * @param {string}            options.name - Saved data set name.\n    *\n    * @param {boolean}           [options.remove=false] - Remove data set.\n    *\n    * @param {boolean}           [options.animateTo=false] - Animate to restore data.\n    *\n    * @param {number}            [options.duration=0.1] - Duration in seconds.\n    *\n    * @param {import('@typhonjs-fvtt/runtime/svelte/easing').EasingReference} [options.ease='linear'] - Easing function or easing\n    *        function name.\n    *\n    * @returns {import('../../types').SvelteApp.API.State.Data | undefined} Any saved application state.\n    */\n   restore({ name, remove = false, animateTo = false, duration = 0.1, ease = 'linear' })\n   {\n      if (typeof name !== 'string')\n      {\n         throw new TypeError(`[SvelteApp.state.restore] error: 'name' is not a string.`);\n      }\n\n      const dataSaved = this.#dataSaved.get(name);\n\n      if (dataSaved)\n      {\n         if (remove) { this.#dataSaved.delete(name); }\n\n         // Multiple invocations for animated restores are skipped when one is already in progress.\n         if (animateTo && name !== this.#currentRestoreKey)\n         {\n            // Track current restore key name.\n            this.#currentRestoreKey = name;\n\n            this.#setImpl(dataSaved, {\n               animateTo,\n               async: true,\n               duration,\n               ease\n            }).then(() =>\n            {\n               // Reset current restore key name for animation if the same as initial animation initiation.\n               if (name === this.#currentRestoreKey) { this.#currentRestoreKey = void 0; }\n            });\n         }\n      }\n\n      return dataSaved;\n   }\n\n   /**\n    * Saves current application state with the opportunity to add extra data to the saved state.\n    *\n    * @param {object}   options - Options.\n    *\n    * @param {string}   options.name - Name to index this saved state.\n    *\n    * @returns {import('../../types').SvelteApp.API.State.Data} Current saved application state.\n    */\n   save({ name, ...extra })\n   {\n      if (typeof name !== 'string') { throw new TypeError(`[SvelteApp.state.save] error: 'name' is not a string.`); }\n\n      const data = this.current(extra);\n\n      this.#dataSaved.set(name, data);\n\n      return data;\n   }\n\n   /**\n    * Sets application state from the given `SvelteApp.API.State.Data` instance. Several optional parameters are\n    * available to animate / tween to the new state. When `animateTo` is true an animation is scheduled via\n    * {@link #runtime/svelte/store/position!AnimationAPI.to} and the duration and easing name or function may be\n    * specified.\n    *\n    * Note: If serializing application state any minimized apps will use the before minimized state on initial render\n    * of the app as it is currently not possible to render apps with Foundry VTT core API in the minimized state.\n    *\n    * @param {import('../../types').SvelteApp.API.State.Data}   data - Saved data set name.\n    *\n    * @param {object}         [options] - Optional parameters\n    *\n    * @param {boolean}        [options.animateTo=false] - Animate to restore data.\n    *\n    * @param {number}         [options.duration=0.1] - Duration in seconds.\n    *\n    * @param {import('@typhonjs-fvtt/runtime/svelte/easing').EasingReference} [options.ease='linear'] - Easing function or easing\n    *        function name.\n    */\n   set(data, options = {})\n   {\n      this.#setImpl(data, { ...options, async: false });\n   }\n\n   // Internal implementation ----------------------------------------------------------------------------------------\n\n   /**\n    * Sets application state from the given `SvelteApp.API.State.Data` instance. Several optional parameters are\n    * available to animate / tween to the new state. When `animateTo` is true an animation is scheduled via\n    * {@link #runtime/svelte/store/position!AnimationAPI.to} and the duration and easing name or function may be\n    * specified.\n    *\n    * Note: If serializing application state any minimized apps will use the before minimized state on initial render\n    * of the app as it is currently not possible to render apps with Foundry VTT core API in the minimized state.\n    *\n    * @privateRemarks\n    * TODO: THIS METHOD NEEDS TO BE REFACTORED WHEN TRL IS MADE INTO A STANDALONE FRAMEWORK.\n    *\n    * @param {import('../../types').SvelteApp.API.State.Data}   data - Saved data set name.\n    *\n    * @param {object}            [opts] - Optional parameters\n    *\n    * @param {boolean}           [opts.async=false] - If animating return a Promise that resolves with any saved data.\n    *\n    * @param {boolean}           [opts.animateTo=false] - Animate to restore data.\n    *\n    * @param {number}            [opts.duration=0.1] - Duration in seconds.\n    *\n    * @param {import('@typhonjs-fvtt/runtime/svelte/easing').EasingReference} [opts.ease='linear'] - Easing function or easing\n    *        function name.\n    *\n    * @returns {undefined | Promise<void>} When asynchronous the animation Promise.\n    */\n   #setImpl(data, { async = false, animateTo = false, duration = 0.1, ease = 'linear' } = {})\n   {\n      if (!isObject(data))\n      {\n         throw new TypeError(`[SvelteApp.state.set] error: 'data' is not an object.`);\n      }\n\n      const application = this.#application;\n\n      if (!isObject(data?.position))\n      {\n         console.warn(`[SvelteApp.state.set] warning: 'data.position' is not an object.`);\n         return;\n      }\n\n      // TODO: TAKE NOTE THAT WE ARE ACCESSING A FOUNDRY APP v1 GETTER HERE TO DETERMINE IF APPLICATION IS RENDERED.\n      // TODO: THIS NEEDS TO BE REFACTORED WHEN CONVERTING TRL TO A GENERIC FRAMEWORK.\n      const rendered = application.rendered;\n\n      // Update data directly with no store or inline style updates.\n      if (animateTo)  // Animate to saved data.\n      {\n         if (!rendered)\n         {\n            console.warn(`[SvelteApp.state.set] warning: application is not rendered and 'animateTo' is true.`);\n            return;\n         }\n\n         // Provide special handling to potentially change transform origin as this parameter is not animated.\n         if (data.position.transformOrigin !== application.position.transformOrigin)\n         {\n            application.position.transformOrigin = data.position.transformOrigin;\n         }\n\n         if (isObject(data?.ui))\n         {\n            const minimized = typeof data.ui?.minimized === 'boolean' ? data.ui.minimized : false;\n\n            if (application?.reactive?.minimized && !minimized)\n            {\n               application.maximize({ animate: false, duration: 0 });\n            }\n         }\n\n         const promise = application.position.animate.to(data.position, {\n            duration,\n            ease,\n            strategy: 'cancelAll'\n         }).finished.then(({ cancelled }) =>\n         {\n            if (cancelled) { return; }\n\n            // Merge in saved options to application.\n            if (isObject(data?.options))\n            {\n               application?.reactive.mergeOptions(data.options);\n            }\n\n            if (isObject(data?.ui))\n            {\n               const minimized = typeof data.ui?.minimized === 'boolean' ? data.ui.minimized : false;\n\n               // Application is currently minimized and stored state is not, so reset minimized state without\n               // animation.\n               if (!application?.reactive?.minimized && minimized)\n               {\n                  application.minimize({ animate: false, duration: 0 });\n               }\n            }\n\n            if (isObject(data?.beforeMinimized))\n            {\n               application.position.state.set({ name: '#beforeMinimized', ...data.beforeMinimized });\n            }\n         });\n\n         // Return a Promise with the application that resolves after animation ends.\n         if (async) { return promise; }\n      }\n      else\n      {\n         if (rendered)\n         {\n            // Merge in saved options to application.\n            if (isObject(data?.options))\n            {\n               application?.reactive.mergeOptions(data.options);\n            }\n\n            if (isObject(data?.ui))\n            {\n               const minimized = typeof data.ui?.minimized === 'boolean' ? data.ui.minimized : false;\n\n               // Application is currently minimized and stored state is not, so reset minimized state without\n               // animation.\n               if (application?.reactive?.minimized && !minimized)\n               {\n                  application.maximize({ animate: false, duration: 0 });\n               }\n               else if (!application?.reactive?.minimized && minimized)\n               {\n                  application.minimize({ animate: false, duration });\n               }\n            }\n\n            if (isObject(data?.beforeMinimized))\n            {\n               application.position.state.set({ name: '#beforeMinimized', ...data.beforeMinimized });\n            }\n\n            // Default options is to set data for an immediate update.\n            application.position.set(data.position);\n         }\n         else\n         {\n            // When not rendered set position to the 'beforeMinimized' data if it exists otherwise set w/ 'position'.\n            // Currently, w/ Foundry core Application API it is impossible to initially render an app in the minimized\n            // state.\n\n            let positionData = data.position;\n\n            if (isObject(data.beforeMinimized))\n            {\n               // Take before minimized data.\n               positionData = data.beforeMinimized;\n\n               // Apply position left / top to before minimized data. This covers the case when an app is minimized,\n               // but then moved. This allows restoration of the before minimized parameters w/ the last position\n               // location.\n               positionData.left = data.position.left;\n               positionData.top = data.position.top;\n            }\n\n            application.position.set(positionData);\n         }\n      }\n   }\n}\n\n/**\n * Provides a mechanism to retrieve and query all mounted Svelte components including the main application shell.\n *\n * @implements {import('../../types').SvelteApp.API.Svelte}\n */\nclass GetSvelteData\n{\n   /** @type {import('svelte').SvelteComponent[] | null[]} */\n   #applicationShellHolder;\n\n   /** @type {import('./types').SvelteData[]} */\n   #svelteData;\n\n   /**\n    * Keep a direct reference to the SvelteData array in an associated {@link SvelteApp}.\n    *\n    * @param {import('svelte').SvelteComponent[] | null[]}  applicationShellHolder - A reference to the mounted app shell.\n    *\n    * @param {import('./types').SvelteData[]}  svelteData - A reference to the SvelteData array of mounted components.\n    */\n   constructor(applicationShellHolder, svelteData)\n   {\n      this.#applicationShellHolder = applicationShellHolder;\n      this.#svelteData = svelteData;\n   }\n\n   /**\n    * Returns any mounted application shell.\n    *\n    * @returns {import('svelte').SvelteComponent} Any mounted application shell.\n    */\n   get appShell() { return this.#applicationShellHolder[0]; }\n\n   /**\n    * Returns any mounted application shell.\n    *\n    * @deprecated Use {@link GetSvelteData.appShell}; since `0.2.0` removal in `0.5.0`.\n    *\n    * @returns {import('svelte').SvelteComponent} Any mounted application shell.\n    */\n   get applicationShell() { return this.#applicationShellHolder[0]; }\n\n   /**\n    * Returns mounted application shell data / config.\n    *\n    * @internal\n    *\n    * @returns {import('./types').SvelteData} Any mounted application shell data.\n    */\n   get appShellData() { return this.#svelteData[0]; }\n}\n\n/**\n * API docs and description in {@link SvelteApp.API.Reactive}.\n */\nclass SvelteReactive\n{\n   /**\n    * @type {import('../SvelteApp').SvelteApp}\n    */\n   #application;\n\n   /**\n    * @type {boolean}\n    */\n   #initialized = false;\n\n   /** @type {import('@typhonjs-fvtt/runtime/svelte/store/web-storage').WebStorage} */\n   #sessionStorage;\n\n   /**\n    * The Application option store which is injected into mounted Svelte component context under the `external` key.\n    *\n    * @type {import('./types').StoreAppOptions}\n    */\n   #storeAppOptions;\n\n   /**\n    * Stores the update function for `#storeAppOptions`.\n    *\n    * @type {(this: void, updater: import('svelte/store').Updater<object>) => void}\n    */\n   #storeAppOptionsUpdate;\n\n   /**\n    * Stores the UI state data to make it accessible via getters.\n    *\n    * @type {object}\n    */\n   #dataUIState;\n\n   /**\n    * The UI option store which is injected into mounted Svelte component context under the `external` key.\n    *\n    * @type {import('./types').StoreUIOptions}\n    */\n   #storeUIState;\n\n   /**\n    * Stores the update function for `#storeUIState`.\n    *\n    * @type {(this: void, updater: import('svelte/store').Updater<object>) => void}\n    */\n   #storeUIStateUpdate;\n\n   /**\n    * Stores the unsubscribe functions from local store subscriptions.\n    *\n    * @type {import('svelte/store').Unsubscriber[]}\n    */\n   #storeUnsubscribe = [];\n\n   /**\n    * @param {import('../SvelteApp').SvelteApp} application - The host Foundry application.\n    */\n   constructor(application)\n   {\n      this.#application = application;\n      const optionsSessionStorage = application?.options?.sessionStorage;\n\n      if (optionsSessionStorage !== void 0 && !(optionsSessionStorage instanceof TJSWebStorage))\n      {\n         throw new TypeError(`'options.sessionStorage' is not an instance of TJSWebStorage.`);\n      }\n\n      // If no external web storage API instance is available then create a TJSSessionStorage instance.\n      this.#sessionStorage = optionsSessionStorage !== void 0 ? optionsSessionStorage : new TJSSessionStorage();\n   }\n\n   /**\n    * Initializes reactive support. Package private for internal use.\n    *\n    * @returns {import('./types-local').SvelteReactiveStores | undefined} Internal methods to interact with Svelte\n    * stores.\n    *\n    * @package\n    * @internal\n    */\n   initialize()\n   {\n      if (this.#initialized) { return; }\n\n      this.#initialized = true;\n\n      this.#storesInitialize();\n\n      return {\n         appOptionsUpdate: this.#storeAppOptionsUpdate,\n         uiStateUpdate: this.#storeUIStateUpdate,\n         subscribe: this.#storesSubscribe.bind(this),\n         unsubscribe: this.#storesUnsubscribe.bind(this)\n      };\n   }\n\n// Store getters -----------------------------------------------------------------------------------------------------\n\n   /**\n    * @returns {import('@typhonjs-fvtt/runtime/svelte/store/web-storage').WebStorage} Returns WebStorage (session) instance.\n    */\n   get sessionStorage()\n   {\n      return this.#sessionStorage;\n   }\n\n   /**\n    * Returns the store for app options.\n    *\n    * @returns {import('../../types').SvelteApp.API.Reactive.AppOptions} App options store.\n    */\n   get storeAppOptions() { return this.#storeAppOptions; }\n\n   /**\n    * Returns the store for UI options.\n    *\n    * @returns {import('../../types').SvelteApp.API.Reactive.UIState} UI options store.\n    */\n   get storeUIState() { return this.#storeUIState; }\n\n// Only reactive getters ---------------------------------------------------------------------------------------------\n\n   /**\n    * Returns the current active Window / WindowProxy UI state.\n    *\n    * @returns {Window} Active window UI state.\n    */\n   get activeWindow() { return this.#dataUIState.activeWindow ?? globalThis; }\n\n   /**\n    * Returns the current dragging UI state.\n    *\n    * @returns {boolean} Dragging UI state.\n    */\n   get dragging() { return this.#dataUIState.dragging; }\n\n   /**\n    * Returns the current minimized UI state.\n    *\n    * @returns {boolean} Minimized UI state.\n    */\n   get minimized() { return this.#dataUIState.minimized; }\n\n   /**\n    * Returns the current resizing UI state.\n    *\n    * @returns {boolean} Resizing UI state.\n    */\n   get resizing() { return this.#dataUIState.resizing; }\n\n   /**\n    * Sets the current active Window / WindowProxy UI state.\n    *\n    * Note: This is protected usage and used internally.\n    *\n    * @param {Window} activeWindow - Active Window / WindowProxy UI state.\n    *\n    * @hidden\n    */\n   set activeWindow(activeWindow)\n   {\n      // Note: when setting activeWindow to undefined `globalThis` is set. There isn't a great test for Window /\n      // WindowProxy, so check `toString`.\n      if (activeWindow === void 0 || activeWindow === null ||\n       (Object.prototype.toString.call(activeWindow) === '[object Window]'))\n      {\n         this.#storeUIStateUpdate((options) => deepMerge(options, { activeWindow: activeWindow ?? globalThis }));\n      }\n   }\n\n// Reactive getter / setters -----------------------------------------------------------------------------------------\n\n   /**\n    * Returns the draggable app option.\n    *\n    * @returns {boolean} Draggable app option.\n    */\n   get draggable() { return this.#application?.options?.draggable; }\n\n   /**\n    * Returns the focusAuto app option.\n    *\n    * @returns {boolean} When true auto-management of app focus is enabled.\n    */\n   get focusAuto() { return this.#application?.options?.focusAuto; }\n\n   /**\n    * Returns the focusKeep app option.\n    *\n    * @returns {boolean} When `focusAuto` and `focusKeep` is true; keeps internal focus.\n    */\n   get focusKeep() { return this.#application?.options?.focusKeep; }\n\n   /**\n    * Returns the focusTrap app option.\n    *\n    * @returns {boolean} When true focus trapping / wrapping is enabled keeping focus inside app.\n    */\n   get focusTrap() { return this.#application?.options?.focusTrap; }\n\n   /**\n    * Returns the headerButtonNoClose app option.\n    *\n    * @returns {boolean} Remove the close the button in header app option.\n    */\n   get headerButtonNoClose() { return this.#application?.options?.headerButtonNoClose; }\n\n   /**\n    * Returns the headerButtonNoLabel app option.\n    *\n    * @returns {boolean} Remove the labels from buttons in header app option.\n    */\n   get headerButtonNoLabel() { return this.#application?.options?.headerButtonNoLabel; }\n\n   /**\n    * Returns the headerIcon app option.\n    *\n    * @returns {string|void} URL for header app icon.\n    */\n   get headerIcon() { return this.#application?.options?.headerIcon; }\n\n   /**\n    * Returns the headerNoTitleMinimized app option.\n    *\n    * @returns {boolean} When true removes the header title when minimized.\n    */\n   get headerNoTitleMinimized() { return this.#application?.options?.headerNoTitleMinimized; }\n\n   /**\n    * Returns the minimizable app option.\n    *\n    * @returns {boolean} Minimizable app option.\n    */\n   get minimizable() { return this.#application?.options?.minimizable; }\n\n   /**\n    * Returns the Foundry popOut state; {@link Application.popOut}\n    *\n    * @returns {boolean} Positionable app option.\n    */\n   get popOut() { return this.#application.popOut; }\n\n   /**\n    * Returns the positionable app option; {@link SvelteApp.Options.positionable}\n    *\n    * @returns {boolean} Positionable app option.\n    */\n   get positionable() { return this.#application?.options?.positionable; }\n\n   /**\n    * Returns the resizable option.\n    *\n    * @returns {boolean} Resizable app option.\n    */\n   get resizable() { return this.#application?.options?.resizable; }\n\n   /**\n    * Returns the title accessor from the parent Application class; {@link Application.title}\n    *\n    * @privateRemarks\n    * TODO: Application v2; note that super.title localizes `this.options.title`; IMHO it shouldn't.    *\n    *\n    * @returns {string} Title.\n    */\n   get title() { return this.#application.title; }\n\n   /**\n    * Sets `this.options.draggable` which is reactive for application shells.\n    *\n    * @param {boolean}  draggable - Sets the draggable option.\n    */\n   set draggable(draggable)\n   {\n      if (typeof draggable === 'boolean') { this.setOptions('draggable', draggable); }\n   }\n\n   /**\n    * Sets `this.options.focusAuto` which is reactive for application shells.\n    *\n    * @param {boolean}  focusAuto - Sets the focusAuto option.\n    */\n   set focusAuto(focusAuto)\n   {\n      if (typeof focusAuto === 'boolean') { this.setOptions('focusAuto', focusAuto); }\n   }\n\n   /**\n    * Sets `this.options.focusKeep` which is reactive for application shells.\n    *\n    * @param {boolean}  focusKeep - Sets the focusKeep option.\n    */\n   set focusKeep(focusKeep)\n   {\n      if (typeof focusKeep === 'boolean') { this.setOptions('focusKeep', focusKeep); }\n   }\n\n   /**\n    * Sets `this.options.focusTrap` which is reactive for application shells.\n    *\n    * @param {boolean}  focusTrap - Sets the focusTrap option.\n    */\n   set focusTrap(focusTrap)\n   {\n      if (typeof focusTrap === 'boolean') { this.setOptions('focusTrap', focusTrap); }\n   }\n\n   /**\n    * Sets `this.options.headerButtonNoClose` which is reactive for application shells.\n    *\n    * @param {boolean}  headerButtonNoClose - Sets the headerButtonNoClose option.\n    */\n   set headerButtonNoClose(headerButtonNoClose)\n   {\n      if (typeof headerButtonNoClose === 'boolean') { this.setOptions('headerButtonNoClose', headerButtonNoClose); }\n   }\n\n   /**\n    * Sets `this.options.headerButtonNoLabel` which is reactive for application shells.\n    *\n    * @param {boolean}  headerButtonNoLabel - Sets the headerButtonNoLabel option.\n    */\n   set headerButtonNoLabel(headerButtonNoLabel)\n   {\n      if (typeof headerButtonNoLabel === 'boolean') { this.setOptions('headerButtonNoLabel', headerButtonNoLabel); }\n   }\n\n   /**\n    * Sets `this.options.headerIcon` which is reactive for application shells.\n    *\n    * @param {string | undefined}  headerIcon - Sets the headerButtonNoLabel option.\n    */\n   set headerIcon(headerIcon)\n   {\n      if (headerIcon === void 0 || typeof headerIcon === 'string') { this.setOptions('headerIcon', headerIcon); }\n   }\n\n   /**\n    * Sets `this.options.headerNoTitleMinimized` which is reactive for application shells.\n    *\n    * @param {boolean}  headerNoTitleMinimized - Sets the headerNoTitleMinimized option.\n    */\n   set headerNoTitleMinimized(headerNoTitleMinimized)\n   {\n      if (typeof headerNoTitleMinimized === 'boolean')\n      {\n         this.setOptions('headerNoTitleMinimized', headerNoTitleMinimized);\n      }\n   }\n\n   /**\n    * Sets `this.options.minimizable` which is reactive for application shells that are also pop out.\n    *\n    * @param {boolean}  minimizable - Sets the minimizable option.\n    */\n   set minimizable(minimizable)\n   {\n      if (typeof minimizable === 'boolean') { this.setOptions('minimizable', minimizable); }\n   }\n\n   /**\n    * Sets `this.options.popOut` which is reactive for application shells. This will add / remove this application\n    * from `ui.windows`.\n    *\n    * @param {boolean}  popOut - Sets the popOut option.\n    */\n   set popOut(popOut)\n   {\n      if (typeof popOut === 'boolean') { this.setOptions('popOut', popOut); }\n   }\n\n   /**\n    * Sets `this.options.positionable` enabling / disabling {@link SvelteApp.position}.\n    *\n    * @param {boolean}  positionable - Sets the positionable option.\n    */\n   set positionable(positionable)\n   {\n      if (typeof positionable === 'boolean') { this.setOptions('positionable', positionable); }\n   }\n\n   /**\n    * Sets `this.options.resizable` which is reactive for application shells.\n    *\n    * @param {boolean}  resizable - Sets the resizable option.\n    */\n   set resizable(resizable)\n   {\n      if (typeof resizable === 'boolean') { this.setOptions('resizable', resizable); }\n   }\n\n   /**\n    * Sets `this.options.title` which is reactive for application shells.\n    *\n    * Note: Will set empty string if title is undefined or null.\n    *\n    * @param {string | undefined | null}   title - Application title; will be localized, so a translation key is fine.\n    */\n   set title(title)\n   {\n      if (typeof title === 'string')\n      {\n         this.setOptions('title', title);\n      }\n      else if (title === void 0 || title === null)\n      {\n         this.setOptions('title', '');\n      }\n   }\n\n   // Reactive Options API -------------------------------------------------------------------------------------------\n\n   /**\n    * Provides a way to safely get this applications options given an accessor string which describes the\n    * entries to walk. To access deeper entries into the object format the accessor string with `.` between entries\n    * to walk.\n    *\n    * // TODO DOCUMENT the accessor in more detail.\n    *\n    * @param {string}   accessor - The path / key to set. You can set multiple levels.\n    *\n    * @param {*}        [defaultValue] - A default value returned if the accessor is not found.\n    *\n    * @returns {*} Value at the accessor.\n    */\n   getOptions(accessor, defaultValue)\n   {\n      return safeAccess(this.#application.options, accessor, defaultValue);\n   }\n\n   /**\n    * Provides a way to merge `options` into this applications options and update the appOptions store.\n    *\n    * @param {object}   options - The options object to merge with `this.options`.\n    */\n   mergeOptions(options)\n   {\n      this.#storeAppOptionsUpdate((instanceOptions) => deepMerge(instanceOptions, options));\n   }\n\n   /**\n    * Provides a way to safely set this applications options given an accessor string which describes the\n    * entries to walk. To access deeper entries into the object format the accessor string with `.` between entries\n    * to walk.\n    *\n    * Additionally, if an application shell Svelte component is mounted and exports the `appOptions` property then\n    * the application options is set to `appOptions` potentially updating the application shell / Svelte component.\n    *\n    * @param {string}   accessor - The path / key to set. You can set multiple levels.\n    *\n    * @param {any}      value - Value to set.\n    */\n   setOptions(accessor, value)\n   {\n      const success = safeSet(this.#application.options, accessor, value, { createMissing: true });\n\n      // If `this.options` modified then update the app options store.\n      if (success)\n      {\n         this.#storeAppOptionsUpdate(() => this.#application.options);\n      }\n   }\n\n   /**\n    * Serializes the main {@link SvelteApp.Options} for common application state.\n    *\n    * @returns {import('../../types').SvelteApp.API.Reactive.Data} Common application state.\n    */\n   toJSON()\n   {\n      return {\n         draggable: this.#application?.options?.draggable ?? true,\n         focusAuto: this.#application?.options?.focusAuto ?? true,\n         focusKeep: this.#application?.options?.focusKeep ?? false,\n         focusTrap: this.#application?.options?.focusTrap ?? true,\n         headerButtonNoClose: this.#application?.options?.headerButtonNoClose ?? false,\n         headerButtonNoLabel: this.#application?.options?.headerButtonNoLabel ?? false,\n         headerNoTitleMinimized: this.#application?.options?.headerNoTitleMinimized ?? false,\n         minimizable: this.#application?.options?.minimizable ?? true,\n         positionable: this.#application?.options?.positionable ?? true,\n         resizable: this.#application?.options?.resizable ?? true\n      };\n   }\n\n   /**\n    * Updates the UI Options store with the current header buttons. You may dynamically add / remove header buttons\n    * if using an application shell Svelte component. In either overriding `_getHeaderButtons` or responding to the\n    * Hooks fired return a new button array and the uiOptions store is updated and the application shell will render\n    * the new buttons.\n    *\n    * Optionally you can set in the SvelteApp app options {@link SvelteApp.Options.headerButtonNoClose}\n    * to remove the close button and {@link SvelteApp.Options.headerButtonNoLabel} to true and labels will be\n    * removed from the header buttons.\n    *\n    * @param {object} [opts] - Optional parameters (for internal use)\n    *\n    * @param {boolean} [opts.headerButtonNoClose] - The value for `headerButtonNoClose`.\n    *\n    * @param {boolean} [opts.headerButtonNoLabel] - The value for `headerButtonNoLabel`.\n    */\n   updateHeaderButtons({ headerButtonNoClose = this.#application.options.headerButtonNoClose,\n    headerButtonNoLabel = this.#application.options.headerButtonNoLabel } = {})\n   {\n      let buttons = this.#application._getHeaderButtons();\n\n      // Remove close button if this.options.headerButtonNoClose is true;\n      if (typeof headerButtonNoClose === 'boolean' && headerButtonNoClose)\n      {\n         buttons = buttons.filter((button) => button.class !== 'close');\n      }\n\n      // Remove labels if this.options.headerButtonNoLabel is true;\n      if (typeof headerButtonNoLabel === 'boolean' && headerButtonNoLabel)\n      {\n         for (const button of buttons) { button.label = void 0; }\n      }\n\n      this.#storeUIStateUpdate((options) =>\n      {\n         options.headerButtons = buttons;\n         return options;\n      });\n   }\n\n   // Internal implementation ----------------------------------------------------------------------------------------\n\n   /**\n    * Initializes the Svelte stores and derived stores for the application options and UI state.\n    *\n    * While writable stores are created the update method is stored in private variables locally and derived Readable\n    * stores are provided for essential options which are commonly used.\n    *\n    * These stores are injected into all Svelte components mounted under the `external` context: `storeAppOptions` and\n    * `storeUIState`.\n    */\n   #storesInitialize()\n   {\n      const writableAppOptions = writable(this.#application.options);\n\n      // Keep the update function locally, but make the store essentially readable.\n      this.#storeAppOptionsUpdate = writableAppOptions.update;\n\n      /**\n       * Create custom store. The main subscribe method for all app options changes is provided along with derived\n       * writable stores for all reactive options.\n       *\n       * @type {import('./types').StoreAppOptions}\n       */\n      const storeAppOptions = {\n         subscribe: writableAppOptions.subscribe,\n\n         draggable: propertyStore(writableAppOptions, 'draggable'),\n         focusAuto: propertyStore(writableAppOptions, 'focusAuto'),\n         focusKeep: propertyStore(writableAppOptions, 'focusKeep'),\n         focusTrap: propertyStore(writableAppOptions, 'focusTrap'),\n         headerButtonNoClose: propertyStore(writableAppOptions, 'headerButtonNoClose'),\n         headerButtonNoLabel: propertyStore(writableAppOptions, 'headerButtonNoLabel'),\n         headerIcon: propertyStore(writableAppOptions, 'headerIcon'),\n         headerNoTitleMinimized: propertyStore(writableAppOptions, 'headerNoTitleMinimized'),\n         minimizable: propertyStore(writableAppOptions, 'minimizable'),\n         popOut: propertyStore(writableAppOptions, 'popOut'),\n         positionable: propertyStore(writableAppOptions, 'positionable'),\n         resizable: propertyStore(writableAppOptions, 'resizable'),\n         title: propertyStore(writableAppOptions, 'title')\n      };\n\n      Object.freeze(storeAppOptions);\n\n      this.#storeAppOptions = storeAppOptions;\n\n      this.#dataUIState = {\n         activeWindow: globalThis,\n         dragging: false,\n         headerButtons: [],\n         minimized: this.#application._minimized,\n         resizing: false\n      };\n\n      // Create a store for UI state data.\n      const writableUIOptions = writable(this.#dataUIState);\n\n      // Keep the update function locally, but make the store essentially readable.\n      this.#storeUIStateUpdate = writableUIOptions.update;\n\n      /**\n       * @type {import('./types').StoreUIOptions}\n       */\n      const storeUIState = {\n         subscribe: writableUIOptions.subscribe,\n\n         // activeWindow: propertyStore(writableUIOptions, 'activeWindow'),\n         activeWindow: derived(writableUIOptions, ($options, set) => set($options.activeWindow)),\n         dragging: propertyStore(writableUIOptions, 'dragging'),\n         headerButtons: derived(writableUIOptions, ($options, set) => set($options.headerButtons)),\n         minimized: derived(writableUIOptions, ($options, set) => set($options.minimized)),\n         resizing: propertyStore(writableUIOptions, 'resizing')\n      };\n\n      Object.freeze(storeUIState);\n\n      // Initialize the store with options set in the Application constructor.\n      this.#storeUIState = storeUIState;\n   }\n\n   /**\n    * Registers local store subscriptions for app options. `popOut` controls registering this app with `ui.windows`.\n    *\n    * @see SvelteApp._injectHTML\n    */\n   #storesSubscribe()\n   {\n      // Register local subscriptions.\n\n      // Handles updating header buttons to add / remove the close button.\n      this.#storeUnsubscribe.push(subscribeIgnoreFirst(this.#storeAppOptions.headerButtonNoClose, (value) =>\n      {\n         this.updateHeaderButtons({ headerButtonNoClose: value });\n      }));\n\n      // Handles updating header buttons to add / remove button labels.\n      this.#storeUnsubscribe.push(subscribeIgnoreFirst(this.#storeAppOptions.headerButtonNoLabel, (value) =>\n      {\n         this.updateHeaderButtons({ headerButtonNoLabel: value });\n      }));\n\n      // Handles adding / removing this application from `ui.windows` when popOut changes.\n      this.#storeUnsubscribe.push(subscribeIgnoreFirst(this.#storeAppOptions.popOut, (value) =>\n      {\n         if (value && this.#application.rendered)\n         {\n            globalThis.ui.windows[this.#application.appId] = this.#application;\n         }\n         else\n         {\n            delete globalThis.ui.windows[this.#application.appId];\n         }\n      }));\n   }\n\n   /**\n    * Unsubscribes from any locally monitored stores.\n    *\n    * @see SvelteApp.close\n    */\n   #storesUnsubscribe()\n   {\n      this.#storeUnsubscribe.forEach((unsubscribe) => unsubscribe());\n      this.#storeUnsubscribe = [];\n   }\n}\n\n/**\n * Defines the application shell contract. If Svelte components export getter / setters for the following properties\n * then that component is considered an application shell.\n *\n * @type {string[]}\n */\nconst applicationShellContract = ['elementRoot'];\n\nObject.freeze(applicationShellContract);\n\n/**\n * Provides a method to determine if the passed in object / Svelte component follows the application shell contract.\n * This involves ensuring that the accessors defined in `applicationShellContract`.\n *\n * Note: A caveat is that when using Vite in a developer build components are wrapped in a proxy / ProxyComponent that\n * defines instance accessors versus on the prototype, so the check below ensures that all accessors in the contract are\n * either available on the prototype or directly on the instance.\n *\n * @param {*}  component - Object / component to test.\n *\n * @returns {boolean} Whether the component is a ApplicationShell or TJSApplicationShell.\n */\nfunction isApplicationShell(component)\n{\n   if (component === null || component === void 0) { return false; }\n\n   let compHasContract = true;\n   let protoHasContract = true;\n\n   // Check for accessors on the instance.\n   for (const accessor of applicationShellContract)\n   {\n      const descriptor = Object.getOwnPropertyDescriptor(component, accessor);\n      if (descriptor === void 0 || descriptor.get === void 0 || descriptor.set === void 0) { compHasContract = false; }\n   }\n\n   // Get the prototype which is the parent SvelteComponent that has any getter / setters.\n   const prototype = Object.getPrototypeOf(component);\n\n   // Verify the application shell contract. If the accessors (getters / setters) are defined for\n   // `applicationShellContract`.\n   for (const accessor of applicationShellContract)\n   {\n      const descriptor = Object.getOwnPropertyDescriptor(prototype, accessor);\n      if (descriptor === void 0 || descriptor.get === void 0 || descriptor.set === void 0) { protoHasContract = false; }\n   }\n\n   return compHasContract || protoHasContract;\n}\n\n/**\n * Instantiates and attaches a Svelte component to the main inserted HTML.\n *\n * @param {object}            [opts] - Optional parameters.\n *\n * @param {object}            [opts.app] - The target application\n *\n * @param {import('@typhonjs-fvtt/runtime/svelte/util').TJSSvelte.Config.Dynamic}  [opts.config] - Svelte component options\n *\n * @param {Function}          [opts.elementRootUpdate] - A callback to assign to the external context.\n *\n * @returns {import('@typhonjs-fvtt/runtime/svelte/application').SvelteData} The config + instantiated Svelte component.\n */\nfunction loadSvelteConfig({ app, config, elementRootUpdate } = {})\n{\n   let target;\n\n   // A specific HTMLElement to append Svelte component.\n   if (CrossWindow.isHTMLElement(config.target))\n   {\n      target = config.target;\n   }\n   else if (typeof config.target === 'string')\n   {\n      // Attempt to find target from query selector string.\n      const activeWindow = app?.reactive?.activeWindow;\n      target = activeWindow?.document?.querySelector(config.target);\n   }\n\n   if (!CrossWindow.isHTMLElement(target))\n   {\n      console.log(\n       `%c[TRL] loadSvelteConfig error - Could not find target, '${config.target}', for config:\\n`,\n        'background: rgb(57,34,34)', config);\n\n      throw new Error();\n   }\n\n   const NewSvelteComponent = config.class;\n\n   const svelteConfig = TJSSvelte.config.parseConfig({ ...config, target }, { contextExternal: true, thisArg: app });\n\n   const externalContext = svelteConfig.context.get('#external');\n\n   // Inject the Foundry application instance and `elementRootUpdate` to the external context.\n   externalContext.application = app;\n   externalContext.elementRootUpdate = elementRootUpdate;\n   externalContext.sessionStorage = app.reactive.sessionStorage;\n\n   let eventbus;\n\n   // Potentially inject any TyphonJS eventbus and track the proxy in the SvelteData instance.\n   if (isObject(app._eventbus) && typeof app._eventbus.createProxy === 'function')\n   {\n      eventbus = app._eventbus.createProxy();\n      externalContext.eventbus = eventbus;\n   }\n\n   // Seal external context so that it can't be extended.\n   Object.seal(externalContext);\n\n   // Create the Svelte component.\n   /**\n    * @type {import('svelte').SvelteComponent}\n    */\n   const component = new NewSvelteComponent(svelteConfig);\n\n   // Set any eventbus to the config.\n   svelteConfig.eventbus = eventbus;\n\n   /**\n    * @type {HTMLElement}\n    */\n   let element;\n\n   // We can directly get the root element from components which follow the application store contract.\n   if (isApplicationShell(component))\n   {\n      element = component.elementRoot;\n   }\n\n   if (!CrossWindow.isHTMLElement(element))\n   {\n      console.log(\n       `%c[TRL] loadSvelteConfig error - No application shell contract found. Did you bind and export a HTMLElement ` +\n        `as 'elementRoot' and include '<svelte:options accessors={true}/>'?\\n` +\n         `\\nOffending config:\\n`, 'background: rgb(57,34,34)', config);\n\n      throw new Error();\n   }\n\n   return { config: svelteConfig, component, element };\n}\n\n/**\n * Provides an index of all visible rendered {@link SvelteApp} instances in a given Svelte runtime. This allows\n * bulk operations to be performed across all apps.\n */\nclass TJSAppIndex\n{\n   /**\n    * Stores all visible / rendered apps.\n    *\n    * @type {Map<string, import('@typhonjs-fvtt/runtime/svelte/application').SvelteApp>}\n    */\n   static #visibleApps = new Map();\n\n   /**\n    * Adds a SvelteApp to all visible apps tracked.\n    *\n    * @param {import('@typhonjs-fvtt/runtime/svelte/application').SvelteApp} app - A SvelteApp\n    *\n    * @package\n    */\n   static add(app)\n   {\n      this.#visibleApps.set(app.id, app);\n   }\n\n   /**\n    * Removes a SvelteApp from all visible apps tracked.\n    *\n    * @param {import('@typhonjs-fvtt/runtime/svelte/application').SvelteApp} app - A SvelteApp\n    *\n    * @package\n    */\n   static delete(app)\n   {\n      this.#visibleApps.delete(app.id);\n   }\n\n   /**\n    * Gets a particular app by ID.\n    *\n    * @param {string}   key - App ID.\n    *\n    * @returns {import('@typhonjs-fvtt/runtime/svelte/application').SvelteApp} Associated app.\n    */\n   static get(key)\n   {\n      return this.#visibleApps.get(key);\n   }\n\n   /**\n    * Returns whether an associated app by ID is being tracked.\n    *\n    * @param {string}   key - App ID.\n    *\n    * @returns {boolean} The given App ID is visible.\n    */\n   static has(key)\n   {\n      return this.#visibleApps.has(key);\n   }\n\n   /**\n    * @returns {IterableIterator<string>} All visible app IDs.\n    */\n   static keys()\n   {\n      return this.#visibleApps.keys();\n   }\n\n   /**\n    * @returns {IterableIterator<import('@typhonjs-fvtt/runtime/svelte/application').SvelteApp>} All visible apps.\n    */\n   static values()\n   {\n      return this.#visibleApps.values();\n   }\n}\n\nclass FoundryHMRSupport\n{\n   static initialize()\n   {\n      if (import.meta.hot)\n      {\n         Hooks.on('hotReload', (data) =>\n         {\n            // Only handle JSON hot reload presumably specified in package manifest for language translation files.\n            if (data?.extension === 'json')\n            {\n               // Postpone until next macrotask to allow Foundry to update localization first.\n               setTimeout(() =>\n               {\n                  for (const app of TJSAppIndex.values())\n                  {\n                     const appShell = app.svelte.appShell;\n\n                     // Retrieve the original `svelte-hmr` instrumented HMR component / not the proxy.\n                     const hmrComponent = appShell?.$$?.hmr_cmp;\n\n                     if (appShell && typeof hmrComponent?.$replace === 'function')\n                     {\n                        const svelteData = app.svelte.appShellData;\n                        if (svelteData)\n                        {\n                           try\n                           {\n                              // Replace with self; this will invoke `on_hmr` callback in associated SvelteApp.\n                              hmrComponent.$replace(hmrComponent.constructor, {\n                                 target: svelteData.config.target,\n                                 anchor: svelteData.config.anchor,\n                                 preserveLocalState: true,\n                                 conservative: true\n                              });\n                           }\n                           catch (error)\n                           {\n                              const name = hmrComponent?.constructor?.name ?? 'Unknown';\n                              console.error(`TyphonJS Runtime Library error; Could not hot reload component: '${name}'`);\n                              console.error(error);\n                           }\n                        }\n                     }\n                  }\n               }, 0);\n            }\n\n            return true;\n         });\n      }\n   }\n}\n\n/**\n * Provides a Svelte aware extension to the Foundry {@link Application} class to manage the app lifecycle\n * appropriately. You can declaratively load one or more components from `defaultOptions` using a\n * {@link #runtime/svelte/util!TJSSvelte.Config.Dynamic} object in the {@link SvelteApp.Options.svelte} property.\n *\n * @implements {TJSPosition.Positionable}\n */\nclass SvelteApp extends Application\n{\n   /**\n    * Stores the first mounted component which follows the application shell contract.\n    *\n    * @type {import('svelte').SvelteComponent[] | null[]} Application shell.\n    */\n   #applicationShellHolder = [null];\n\n   /**\n    * Stores and manages application state for saving / restoring / serializing.\n    *\n    * @type {import('./types').SvelteApp.API.State}\n    */\n   #applicationState;\n\n   /**\n    * Stores the target element which may not necessarily be the main element.\n    *\n    * @type {HTMLElement}\n    */\n   #elementTarget = null;\n\n   /**\n    * Stores the content element which is set for application shells.\n    *\n    * @type {HTMLElement}\n    */\n   #elementContent = null;\n\n   /**\n    * On initial render gating of `setPosition` invoked by `Application._render` occurs, so that percentage values\n    * can correctly be positioned with initial helper constraints (centered).\n    *\n    * @type {boolean}\n    */\n   #gateSetPosition = false;\n\n   /**\n    * Stores initial z-index from `_renderOuter` to set to target element / Svelte component.\n    *\n    * @type {number}\n    */\n   #initialZIndex = 95;\n\n   /**\n    * Stores on mount state which is checked in _render to trigger onSvelteMount callback.\n    *\n    * @type {boolean}\n    */\n   #onMount = false;\n\n   /**\n    * The position store.\n    *\n    * @type {TJSPosition}\n    */\n   #position;\n\n   /**\n    * Contains the Svelte stores and reactive accessors.\n    *\n    * @type {SvelteReactive}\n    */\n   #reactive;\n\n   /**\n    * Stores SvelteData entries with instantiated Svelte components.\n    *\n    * @type {import('./internal/state-svelte/types').SvelteData[] | null[]}\n    */\n   #svelteData = [null];\n\n   /**\n    * Provides a helper class that combines multiple methods for interacting with the mounted components tracked in\n    * #svelteData.\n    *\n    * @type {import('./types').SvelteApp.API.Svelte<Options>}\n    */\n   #getSvelteData = new GetSvelteData(this.#applicationShellHolder, this.#svelteData);\n\n   /**\n    * Contains methods to interact with the Svelte stores.\n    *\n    * @type {import('./internal/state-reactive/types-local').SvelteReactiveStores}\n    */\n   #stores;\n\n   /**\n    * @param {Partial<import('./types').SvelteApp.Options>} [options] - The options for the application.\n    */\n   constructor(options = {})\n   {\n      super(options);\n\n      if (!isObject(this.options.svelte))\n      {\n         throw new Error(`SvelteApp - constructor - No Svelte configuration object found in 'options'.`);\n      }\n\n      this.#applicationState = new ApplicationState(this);\n\n      // Initialize TJSPosition with the position object set by Application.\n      this.#position = new TJSPosition(this, {\n         ...this.position,\n         ...this.options,\n         initial: this.options.positionInitial,\n         ortho: this.options.positionOrtho,\n         validator: this.options.positionValidator\n      });\n\n      // Remove old position field.\n      delete this.position;\n\n      /**\n       * Define accessors to retrieve TJSPosition by `this.position`.\n       *\n       * @member {TJSPosition} position - Adds accessors to SvelteApp to get / set the position data.\n       *\n       * @memberof SvelteApp#\n       */\n      Object.defineProperty(this, 'position', {\n         get: () => this.#position,\n         set: (position) => { if (isObject(position)) { this.#position.set(position); } }\n      });\n\n      this.#reactive = new SvelteReactive(this);\n\n      this.#stores = this.#reactive.initialize();\n   }\n\n   /**\n    * Specifies the default options that SvelteApp supports.\n    *\n    * @returns {import('./types').SvelteApp.Options} options - Application options.\n    * @see https://foundryvtt.com/api/interfaces/client.ApplicationOptions.html\n    */\n   static get defaultOptions()\n   {\n      return /** @type {import('./types').SvelteApp.Options} */ deepMerge(super.defaultOptions, {\n         defaultCloseAnimation: true,     // If false the default slide close animation is not run.\n         draggable: true,                 // If true then application shells are draggable.\n         focusAuto: true,                 // When true auto-management of app focus is enabled.\n         focusKeep: false,                // When `focusAuto` and `focusKeep` is true; keeps internal focus.\n         focusSource: void 0,             // Stores any A11yFocusSource data that is applied when app is closed.\n         focusTrap: true,                 // When true focus trapping / wrapping is enabled keeping focus inside app.\n         headerButtonNoClose: false,      // If true then the close header button is removed.\n         headerButtonNoLabel: false,      // If true then header button labels are removed for application shells.\n         headerIcon: void 0,              // Sets a header icon given an image URL.\n         headerNoTitleMinimized: false,   // If true then header title is hidden when application is minimized.\n         minHeight: MIN_WINDOW_HEIGHT,    // Assigned to position. Number specifying minimum window height.\n         minWidth: MIN_WINDOW_WIDTH,      // Assigned to position. Number specifying minimum window width.\n         positionable: true,              // If false then `position.set` does not take effect.\n         positionInitial: TJSPosition.Initial.browserCentered,      // A helper for initial position placement.\n         positionOrtho: true,             // When true TJSPosition is optimized for orthographic use.\n         positionValidator: TJSPosition.Validators.transformWindow, // A function providing the default validator.\n         sessionStorage: void 0,          // An instance of WebStorage (session) to share across SvelteApps.\n         svelte: void 0,                  // A Svelte configuration object.\n         transformOrigin: 'top left'      // By default, 'top / left' respects rotation when minimizing.\n      });\n   }\n\n   /**\n    * Returns the content element if an application shell is mounted.\n    *\n    * @returns {HTMLElement} Content element.\n    */\n   get elementContent() { return this.#elementContent; }\n\n   /**\n    * Returns the target element or main element if no target defined.\n    *\n    * @returns {HTMLElement} Target element.\n    */\n   get elementTarget() { return this.#elementTarget; }\n\n   /**\n    * Returns the reactive accessors & Svelte stores for SvelteApp.\n    *\n    * @returns {import('./types').SvelteApp.API.Reactive} The reactive accessors & Svelte stores.\n    */\n   get reactive() { return this.#reactive; }\n\n   /**\n    * Returns the application state manager.\n    *\n    * @returns {import('./types').SvelteApp.API.State} The application state manager.\n    */\n   get state() { return this.#applicationState; }\n\n   /**\n    * Returns the `Svelte` helper class w/ various methods to access the mounted application shell component.\n    *\n    * @returns {import('./types').SvelteApp.API.Svelte<Options>} `Svelte` / mounted application shell API.\n    */\n   get svelte() { return this.#getSvelteData; }\n\n   /**\n    * In this case of when a template is defined in app options `html` references the inner HTML / template. However,\n    * to activate classic v1 tabs for a Svelte component the element target is passed as an array simulating JQuery as\n    * the element is retrieved immediately and the core listeners use standard DOM queries.\n    *\n    * @protected\n    * @ignore\n    * @internal\n    */\n   _activateCoreListeners(html)\n   {\n      super._activateCoreListeners(typeof this.options.template === 'string' ? html :\n       [this.popOut ? this.#elementTarget?.firstChild : this.#elementTarget]);\n   }\n\n   /**\n    * Provide an override to set this application as the active window regardless of z-index. Changes behaviour from\n    * Foundry core.\n    *\n    * @param {object} [opts] - Optional parameters.\n    *\n    * @param {boolean} [opts.focus=true] - When true and the active element is not contained in the app `elementTarget`\n    *        is focused..\n    *\n    * @param {boolean} [opts.force=false] - Force bring to top; will increment z-index by popOut order.\n    *\n    * @ignore\n    * @internal\n    */\n   bringToTop({ focus = true, force = false } = {})\n   {\n      // Only perform bring to top when the active window is the main Foundry window instance.\n      if (this.reactive.activeWindow !== globalThis) { return; }\n\n      if (force || this.popOut) { super.bringToTop(); }\n\n      const elementTarget = this.elementTarget;\n      const activeElement = document.activeElement;\n\n      // If the activeElement is not contained in this app via elementTarget then blur the current active element\n      // and make elementTarget focused.\n      if (focus && elementTarget && activeElement !== elementTarget && !elementTarget?.contains(activeElement))\n      {\n         // Blur current active element.\n         if (A11yHelper.isFocusTarget(activeElement))\n         {\n            activeElement.blur();\n         }\n\n         elementTarget?.focus();\n      }\n\n      globalThis.ui.activeWindow = this;\n   }\n\n   /**\n    * Note: This method is fully overridden and duplicated as Svelte components need to be destroyed manually and the\n    * best visual result is to destroy them after the default slide up animation occurs, but before the element\n    * is removed from the DOM.\n    *\n    * If you destroy the Svelte components before the slide up animation the Svelte elements are removed immediately\n    * from the DOM. The purpose of overriding ensures the slide up animation is always completed before\n    * the Svelte components are destroyed and then the element is removed from the DOM.\n    *\n    * Close the application and unregisters references to it within UI mappings.\n    * This function returns a Promise which resolves once the window closing animation concludes.\n    *\n    * @param {object}   [options] - Optional parameters.\n    *\n    * @param {boolean}  [options.force] - Force close regardless of render state.\n    *\n    * @returns {Promise<void>}    A Promise which resolves once the application is closed.\n    *\n    * @ignore\n    * @internal\n    */\n   async close(options = {})\n   {\n      const states = Application.RENDER_STATES;\n\n      if (!options.force && ![states.RENDERED, states.ERROR].includes(this._state)) { return; }\n\n      /**\n       * Get the element.\n       *\n       * @type {HTMLElement}\n       */\n      const el = this.#elementTarget;\n      if (!el)\n      {\n         /**\n          * @ignore\n          * @internal\n          */\n         this._state = states.CLOSED;\n\n         return;\n      }\n\n      // Support for PopOut! module; `close` is double invoked; once before the element is rejoined to the main window.\n      // Reject close invocations when the element window is not the main originating window / globalThis.\n      if (CrossWindow.getWindow(el, { throws: false }) !== globalThis) { return; }\n\n      /**\n       * @ignore\n       * @internal\n       */\n      this._state = states.CLOSING;\n\n      // Unsubscribe from any local stores.\n      this.#stores.unsubscribe();\n\n      // Make any window content overflow hidden to avoid any scrollbars appearing in default or Svelte outro\n      // transitions.\n      const content = el.querySelector('.window-content');\n      if (content)\n      {\n         content.style.overflow = 'hidden';\n\n         // Set all children of content to overflow hidden as if there is going to be additional scrolling elements\n         // they are likely one level deep.\n         for (let cntr = content.children.length; --cntr >= 0;)\n         {\n            content.children[cntr].style.overflow = 'hidden';\n         }\n      }\n\n      // Dispatch Hooks for closing the base and subclass applications\n      for (const cls of this.constructor._getInheritanceChain())\n      {\n         /**\n          * A hook event that fires whenever this Application is closed.\n          *\n          * Note: JQuery wrapping as Foundry event arguments uses JQuery.\n          */\n         Hooks.call(`close${cls.name}`, this, $(el));\n      }\n\n      // If options `defaultCloseAnimation` is false then do not execute the standard slide up animation.\n      // This allows Svelte components to provide any out transition. Application shells will automatically set\n      // `defaultCloseAnimation` based on any out transition set or unset.\n      const animate = typeof this.options.defaultCloseAnimation === 'boolean' ? this.options.defaultCloseAnimation :\n       true;\n\n      if (animate)\n      {\n         // Set min height for full slide.\n         el.style.minHeight = '0';\n\n         const { paddingBottom, paddingTop } = globalThis.getComputedStyle(el);\n\n         // Slide-up application.\n         await el.animate([\n            { maxHeight: `${el.clientHeight}px`, paddingTop, paddingBottom },\n            { maxHeight: 0, paddingTop: 0, paddingBottom: 0 }\n         ], { duration: 250, easing: 'ease-in', fill: 'forwards' }).finished;\n      }\n\n      // Stores the Promises returned from running outro transitions and destroying each Svelte component.\n      const svelteDestroyPromises = [];\n\n      // Manually invoke the destroy callbacks for all Svelte components.\n      for (const entry of this.#svelteData)\n      {\n         if (!isObject(entry)) { continue; }\n\n         // Use `outroAndDestroy` to run outro transitions before destroying.\n         svelteDestroyPromises.push(TJSSvelte.util.outroAndDestroy(entry.component));\n\n         // If any proxy eventbus has been added then remove all event registrations from the component.\n         const eventbus = entry.config.eventbus;\n         if (isObject(eventbus) && typeof eventbus.off === 'function')\n         {\n            eventbus.off();\n            entry.config.eventbus = void 0;\n         }\n      }\n\n      // Await all Svelte components to destroy.\n      await Promise.allSettled(svelteDestroyPromises);\n\n      // Remove from all visible apps tracked.\n      TJSAppIndex.delete(this);\n\n      // Reset SvelteData like this to maintain reference to GetSvelteData / `this.svelte`.\n      this.#svelteData[0] = null;\n\n      // Remove element from the DOM. Most SvelteComponents have already removed it.\n      el.remove();\n\n      // Silently restore any width / height state before minimized as applicable.\n      this.position.state.restore({\n         name: '#beforeMinimized',\n         properties: ['width', 'height'],\n         silent: true,\n         remove: true\n      });\n\n      // Clean up data\n      this.#applicationShellHolder[0] = null;\n\n      /**\n       * @ignore\n       * @internal\n       */\n      this._element = null;\n      this.#elementContent = null;\n      this.#elementTarget = null;\n\n      delete globalThis.ui.windows[this.appId];\n\n      /**\n       * @ignore\n       * @internal\n       */\n      this._minimized = false;\n\n      /**\n       * @ignore\n       * @internal\n       */\n      this._scrollPositions = null;\n\n      /**\n       * @ignore\n       * @internal\n       */\n      this._state = states.CLOSED;\n\n      this.#onMount = false;\n\n      // Update the minimized UI store state.\n      this.#stores.uiStateUpdate((storeOptions) => deepMerge(storeOptions, { minimized: this._minimized }));\n\n      // Apply any stored focus options and then remove them from options.\n      A11yHelper.applyFocusSource(this.options.focusSource);\n\n      delete this.options.focusSource;\n   }\n\n   /**\n    * Specify the set of config buttons which should appear in the SvelteApp header. Buttons should be returned as\n    * an Array of objects. The header buttons which are added to the application can be modified by the\n    * `getApplicationHeaderButtons` hook.\n    *\n    * SvelteApp extends the button functionality with full reactivity for state changes during callbacks. Callbacks\n    * receive the button data and can modify it to update the button state.\n    *\n    * @privateRemarks Provide a basic override implementation to extend types with additional SvelteApp functionality.\n    *\n    * @returns {import('./types').SvelteApp.HeaderButton[]} All header buttons.\n    * @protected\n    */\n   _getHeaderButtons()\n   {\n      return super._getHeaderButtons();\n   }\n\n   /**\n    * Inject the Svelte components defined in `this.options.svelte`. The Svelte component can attach to the existing\n    * pop-out of Application or provide no template and render into a document fragment which is then attached to the\n    * DOM.\n    *\n    * @protected\n    * @ignore\n    * @internal\n    */\n   _injectHTML()\n   {\n      // Make sure the store is updated with the latest header buttons. Also allows filtering buttons before display.\n      this.reactive.updateHeaderButtons();\n\n      // Create a function to generate a callback for Svelte components to invoke to update the tracked elements for\n      // application shells in the rare cases that the main element root changes. The update is only triggered on\n      // successive changes of `elementRoot`. Returns a boolean to indicate the element roots are updated.\n      const elementRootUpdate = () =>\n      {\n         let cntr = 0;\n\n         return (elementRoot) =>\n         {\n            if (elementRoot !== null && elementRoot !== void 0 && cntr++ > 0)\n            {\n               this.#updateApplicationShell();\n               return true;\n            }\n\n            return false;\n         };\n      };\n\n      // A sanity check; absence should be detected in constructor.\n      if (!isObject(this.options.svelte))\n      {\n         throw new Error(`SvelteApp - _injectHTML - No Svelte configuration object found in 'options'.`);\n      }\n\n      const svelteData = loadSvelteConfig({\n         app: this,\n         config: this.options.svelte,\n         elementRootUpdate\n      });\n\n      // A sanity check as shouldn't hit this case as only one component is being mounted.\n      if (this.svelte.appShell !== null)\n      {\n         throw new Error(\n          `SvelteApp - _injectHTML - An application shell is already mounted; offending config:\\n` +\n           `${JSON.stringify(this.options.svelte)}`);\n      }\n\n      this.#applicationShellHolder[0] = svelteData.component;\n\n      // If Vite / HMR / svelte_hmr is enabled then add a hook to receive callbacks when the ProxyComponent\n      // refreshes. Update the element root accordingly and force an update to TJSPosition.\n      // See this issue for info about `on_hmr`:\n      // https://github.com/sveltejs/svelte-hmr/issues/57\n      if (TJSSvelte.util.isHMRProxy(svelteData.component) && Array.isArray(svelteData.component?.$$?.on_hmr))\n      {\n         svelteData.component.$$.on_hmr.push(() => () => this.#updateApplicationShell());\n      }\n\n      this.#svelteData[0] = svelteData;\n\n      // Wrap `elementRoot` as a JQuery object and set to AppV1 / Application element.\n      this._element = $(this.svelte.appShell.elementRoot);\n\n      // Detect if the application shell exports an `elementContent` accessor.\n      this.#elementContent = hasGetter(this.svelte.appShell, 'elementContent') ?\n       this.svelte.appShell.elementContent : null;\n\n      // Detect if the application shell exports an `elementTarget` accessor if not set `elementTarget` to\n      // `elementRoot`.\n      this.#elementTarget = hasGetter(this.svelte.appShell, 'elementTarget') ? this.svelte.appShell.elementTarget :\n       this.svelte.appShell.elementRoot;\n\n      // The initial zIndex may be set in application options or for popOut applications is stored by `_renderOuter`\n      // in `this.#initialZIndex`.\n      if (typeof this.options.positionable === 'boolean' && this.options.positionable)\n      {\n         this.#elementTarget.style.zIndex = typeof this.options.zIndex === 'number' ? this.options.zIndex :\n          this.#initialZIndex ?? 95;\n      }\n\n      // Subscribe to local store handling.\n      this.#stores.subscribe();\n   }\n\n   /**\n    * Provides a mechanism to update the UI options store for maximized.\n    *\n    * Note: the sanity check is duplicated from {@link Application.maximize} the store is updated _before_\n    * performing the rest of animations. This allows application shells to remove / show any resize handlers\n    * correctly. Extra constraint data is stored in a saved position state in {@link SvelteApp.minimize}\n    * to animate the content area.\n    *\n    * @param {object}   [opts] - Optional parameters.\n    *\n    * @param {boolean}  [opts.animate=true] - When true perform default maximizing animation.\n    *\n    * @param {number}   [opts.duration=0.1] - Controls content area animation duration in seconds.\n    */\n   async maximize({ animate = true, duration = 0.1 } = {})\n   {\n      if (!this.popOut || [false, null].includes(this._minimized)) { return; }\n\n      this._minimized = null;\n\n      const durationMS = duration * 1000; // For WAAPI.\n\n      // Get content\n      const element = this.elementTarget;\n      const header = element.querySelector('.window-header');\n      const content = element.querySelector('.window-content');\n\n      // Get the complete position before minimized. Used to reset min width & height to initial values later.\n      const positionBefore = this.position.state.get({ name: '#beforeMinimized' });\n\n      // First animate / restore width / async.\n      if (animate)\n      {\n         await this.position.state.restore({\n            name: '#beforeMinimized',\n            async: true,\n            animateTo: true,\n            properties: ['width'],\n            duration: 0.1\n         });\n      }\n\n      element.classList.remove('minimized');\n\n      // Reset display none on all children of header.\n      for (let cntr = header.children.length; --cntr >= 0;) { header.children[cntr].style.display = null; }\n\n      content.style.display = null;\n\n      let constraints;\n\n      if (animate)\n      {\n         // Next animate / restore height synchronously and remove key. Retrieve constraints data for slide up animation\n         // below.\n         ({ constraints } = this.position.state.restore({\n            name: '#beforeMinimized',\n            animateTo: true,\n            properties: ['height'],\n            remove: true,\n            duration\n         }));\n      }\n      else\n      {\n         ({ constraints } = this.position.state.remove({ name: '#beforeMinimized' }));\n      }\n\n      // Slide down content with stored constraints.\n      await content.animate([\n         { maxHeight: 0, paddingTop: 0, paddingBottom: 0, offset: 0 },\n         { ...constraints, offset: 1 },\n         { maxHeight: '100%', offset: 1 },\n      ], { duration: durationMS, fill: 'forwards' }).finished; // WAAPI in ms.\n\n      // Restore previous min width & height from saved data, app options, or default Foundry values.\n      this.position.set({\n         minHeight: positionBefore.minHeight ?? this.options?.minHeight ?? MIN_WINDOW_HEIGHT,\n         minWidth: positionBefore.minWidth ?? this.options?.minWidth ?? MIN_WINDOW_WIDTH,\n      });\n\n      // Remove inline styles that override any styles assigned to the app.\n      element.style.minWidth = null;\n      element.style.minHeight = null;\n\n      this._minimized = false;\n\n      // Using a 50ms timeout prevents any instantaneous display of scrollbars with the above maximize animation.\n      setTimeout(() =>\n      {\n         content.style.overflow = null;\n\n         // Reset all children of content removing overflow hidden.\n         for (let cntr = content.children.length; --cntr >= 0;)\n         {\n            content.children[cntr].style.overflow = null;\n         }\n      }, 50);\n\n      this.#stores.uiStateUpdate((options) => deepMerge(options, { minimized: false }));\n   }\n\n   /**\n    * Provides a mechanism to update the UI options store for minimized.\n    *\n    * Note: the sanity check is duplicated from {@link Application.minimize} the store is updated _before_\n    * performing the rest of animations. This allows application shells to remove / show any resize handlers\n    * correctly. Extra constraint data is stored in a saved position state in {@link SvelteApp.minimize}\n    * to animate the content area.\n    *\n    * @param {object}   [opts] - Optional parameters.\n    *\n    * @param {boolean}  [opts.animate=true] - When true perform default minimizing animation.\n    *\n    * @param {number}   [opts.duration=0.1] - Controls content area animation duration in seconds.\n    */\n   async minimize({ animate = true, duration = 0.1 } = {})\n   {\n      if (!this.rendered || !this.popOut || [true, null].includes(this._minimized)) { return; }\n\n      this.#stores.uiStateUpdate((options) => deepMerge(options, { minimized: true }));\n\n      this._minimized = null;\n\n      const durationMS = duration * 1000; // For WAAPI.\n\n      const element = this.elementTarget;\n\n      // Get content\n      const header = element.querySelector('.window-header');\n      const content = element.querySelector('.window-content');\n\n      // Save current max / min height & width.\n      const beforeMinWidth = this.position.minWidth;\n      const beforeMinHeight = this.position.minHeight;\n\n      // Set minimized min width & height for header bar.\n      this.position.set({ minWidth: 100, minHeight: 30 });\n\n      // Also set inline styles to override any styles scoped to the app.\n      element.style.minWidth = '100px';\n      element.style.minHeight = '30px';\n\n      if (content)\n      {\n         content.style.overflow = 'hidden';\n\n         // Set all children of content to overflow hidden as if there is going to be additional scrolling elements\n         // they are likely one level deep.\n         for (let cntr = content.children.length; --cntr >= 0;)\n         {\n            content.children[cntr].style.overflow = 'hidden';\n         }\n      }\n\n      const { paddingBottom, paddingTop } = globalThis.getComputedStyle(content);\n\n      // Extra data that is saved with the current position. Used during `maximize`.\n      const constraints = {\n         maxHeight: `${content.clientHeight}px`,\n         paddingTop,\n         paddingBottom\n      };\n\n      // Slide-up content\n      if (animate)\n      {\n         const animation = content.animate([\n            constraints,\n            { maxHeight: 0, paddingTop: 0, paddingBottom: 0 }\n         ], { duration: durationMS, fill: 'forwards' }); // WAAPI in ms.\n\n         // Set display style to none when animation finishes.\n         animation.finished.then(() => content.style.display = 'none');\n      }\n      else\n      {\n         setTimeout(() => content.style.display = 'none', durationMS);\n      }\n\n      // Save current position state and add the constraint data to use in `maximize`.\n      const saved = this.position.state.save({ name: '#beforeMinimized', constraints });\n\n      // Set the initial before min width & height.\n      saved.minWidth = beforeMinWidth;\n      saved.minHeight = beforeMinHeight;\n\n      const headerOffsetHeight = header.offsetHeight;\n\n      // minHeight needs to be adjusted to header height.\n      this.position.minHeight = headerOffsetHeight;\n\n      if (animate)\n      {\n         // First await animation of height upward.\n         await this.position.animate.to({ height: headerOffsetHeight }, { duration }).finished;\n      }\n\n      // Set all header buttons besides close and the window title to display none.\n      for (let cntr = header.children.length; --cntr >= 0;)\n      {\n         const className = header.children[cntr].className;\n\n         if (className.includes('window-title') || className.includes('close')) { continue; }\n\n         // v10+ of Foundry core styles automatically hides anything besides the window title and close button, so\n         // explicitly set display to block.\n         if (className.includes('keep-minimized'))\n         {\n            header.children[cntr].style.display = 'block';\n            continue;\n         }\n\n         header.children[cntr].style.display = 'none';\n      }\n\n      if (animate)\n      {\n         // Await animation of width to the left / minimum width.\n         await this.position.animate.to({ width: MIN_WINDOW_WIDTH }, { duration: 0.1 }).finished;\n      }\n\n      element.classList.add('minimized');\n\n      this._minimized = true;\n   }\n\n   /**\n    * Provides a callback after all Svelte components are initialized.\n    */\n   onSvelteMount() {} // eslint-disable-line no-unused-vars\n\n   /**\n    * Provides a callback after the main application shell is remounted. This may occur during HMR / hot module\n    * replacement or directly invoked from the `elementRootUpdate` callback passed to the application shell component\n    * context.\n    */\n   onSvelteRemount() {} // eslint-disable-line no-unused-vars\n\n   /**\n    * Override replacing HTML as Svelte components control the rendering process. Only potentially change the outer\n    * application frame / title for pop-out applications.\n    *\n    * @protected\n    * @ignore\n    * @internal\n    */\n   _replaceHTML(element, html)  // eslint-disable-line no-unused-vars\n   {\n      if (!element.length) { return; }\n\n      this.reactive.updateHeaderButtons();\n   }\n\n   /**\n    * Provides an override verifying that a new Application being rendered for the first time doesn't have a\n    * corresponding DOM element already loaded. This is a check that only occurs when `this._state` is\n    * `Application.RENDER_STATES.NONE`. It is useful in particular when SvelteApp has a static ID\n    * explicitly set in `this.options.id` and long intro / outro transitions are assigned. If a new application\n    * sharing this static ID attempts to open / render for the first time while an existing DOM element sharing\n    * this static ID exists then the initial render is cancelled below rather than crashing later in the render\n    * cycle {@link TJSPosition.set}.\n    *\n    * @protected\n    * @ignore\n    * @internal\n    */\n   async _render(force = false, options = {})\n   {\n      // Store any focusSource instance.\n      if (isObject(options?.focusSource)) { this.options.focusSource = options.focusSource; }\n\n      const activeWindow = this.reactive.activeWindow;\n\n      try\n      {\n         if (this._state === Application.RENDER_STATES.NONE &&\n          A11yHelper.isFocusTarget(activeWindow.document.querySelector(`#${this.id}`)))\n         {\n            console.warn(`SvelteApp - _render: A DOM element already exists for CSS ID '${this.id\n             }'. Cancelling initial render for new application with appId '${this.appId}'.`);\n\n            return;\n         }\n      }\n      catch (err)\n      {\n         console.warn(`SvelteApp - _render: Potentially malformed application ID '${this.id\n          }'. Cancelling initial render for new application with appId '${this.appId}'.`);\n\n         return;\n      }\n\n      // On initial render gating of `setPosition` invoked by `Application._render` occurs, so that percentage values\n      // can correctly be positioned with initial helper constraints (centered).\n      this.#gateSetPosition = true;\n\n      await super._render(force, options);\n\n      this.#gateSetPosition = false;\n\n      // Handle the same render exclusion tests that reject a render in Application.\n\n      // Do not render under certain conditions.\n      if ([Application.RENDER_STATES.CLOSING, Application.RENDER_STATES.RENDERING].includes(this._state)) { return; }\n\n      // Applications which are not currently rendered must be forced.\n      if (!force && (this._state <= Application.RENDER_STATES.NONE)) { return; }\n\n      // It is necessary to directly invoke `position.set` as TJSPosition uses accessors and is not a bare object, so\n      // the merging that occurs in `Application._render` does not take effect. Additionally, any of the main\n      // positional properties that are defined as strings such as percentage values need to be set after the element\n      // is mounted.\n      if (!this._minimized)\n      {\n         this.#position.set({\n            left: typeof this.options?.left === 'string' ? this.options.left : void 0,\n            height: typeof this.options?.height === 'string' ? this.options.height : void 0,\n            maxHeight: typeof this.options?.maxHeight === 'string' ? this.options.maxHeight : void 0,\n            maxWidth: typeof this.options?.maxWidth === 'string' ? this.options.maxWidth : void 0,\n            minHeight: typeof this.options?.minHeight === 'string' ? this.options.minHeight : void 0,\n            minWidth: typeof this.options?.minWidth === 'string' ? this.options.minWidth : void 0,\n            rotateX: typeof this.options?.rotateX === 'string' ? this.options.rotateX : void 0,\n            rotateY: typeof this.options?.rotateY === 'string' ? this.options.rotateY : void 0,\n            rotateZ: typeof this.options?.rotateZ === 'string' ? this.options.rotateZ : void 0,\n            rotation: typeof this.options?.rotation === 'string' ? this.options.rotation : void 0,\n            top: typeof this.options?.top === 'string' ? this.options.top : void 0,\n            width: typeof this.options?.width === 'string' ? this.options.width : void 0,\n\n            ...options\n         });\n      }\n\n      if (!this.#onMount)\n      {\n         // Add to visible apps tracked.\n         TJSAppIndex.add(this);\n\n         this.onSvelteMount();\n\n         this.#onMount = true;\n      }\n   }\n\n   /**\n    * Render the inner application content. Provide an empty JQuery element per the core Foundry API.\n    *\n    * @protected\n    * @ignore\n    * @internal\n    */\n   async _renderInner()\n   {\n      const activeWindow = this.reactive.activeWindow;\n\n      const html = activeWindow.document.createDocumentFragment();\n\n      return $(html);\n   }\n\n   /**\n    * Stores the initial z-index set in `_renderOuter` which is used in `_injectHTML` to set the target element\n    * z-index after the Svelte component is mounted.\n    *\n    * @protected\n    * @ignore\n    * @internal\n    */\n   async _renderOuter()\n   {\n      const html = await super._renderOuter();\n      this.#initialZIndex = html[0].style.zIndex;\n      return html;\n   }\n\n   /**\n    * All calculation and updates of position are implemented in {@link TJSPosition.set}.\n    * This allows position to be fully reactive and in control of updating inline styles for the application.\n    *\n    * This method remains for backward compatibility with Foundry. If you have a custom override quite likely you need\n    * to update to using the {@link TJSPosition.validators} / ValidatorAPI functionality.\n    *\n    * @param {TJSPosition.API.Data.TJSPositionDataRelative}   [position] - TJSPosition data.\n    *\n    * @returns {TJSPosition} The updated position object for the application containing the new values.\n    * @ignore\n    */\n   setPosition(position)\n   {\n      return !this.#gateSetPosition ? this.position.set(position) : this.position;\n   }\n\n   /**\n    * This method is invoked by the `elementRootUpdate` callback that is added to the external context passed to\n    * Svelte components. When invoked it updates the local element roots tracked by SvelteApp.\n    *\n    * This method may also be invoked by HMR / hot module replacement via `svelte-hmr`.\n    */\n   #updateApplicationShell()\n   {\n      const applicationShell = this.svelte.appShell;\n\n      if (applicationShell !== null)\n      {\n         this._element = $(applicationShell.elementRoot);\n\n         // Detect if the application shell exports an `elementContent` accessor.\n         this.#elementContent = hasGetter(applicationShell, 'elementContent') ?\n          applicationShell.elementContent : null;\n\n         // Detect if the application shell exports an `elementTarget` accessor.\n         this.#elementTarget = hasGetter(applicationShell, 'elementTarget') ?\n          applicationShell.elementTarget : null;\n\n         if (this.#elementTarget === null)\n         {\n            this.#elementTarget = typeof this.options.selectorTarget === 'string' ?\n             this._element[0].querySelector(this.options.selectorTarget) : this._element[0];\n         }\n\n         // The initial zIndex may be set in application options or for popOut applications is stored by `_renderOuter`\n         // in `this.#initialZIndex`.\n         if (typeof this.options.positionable === 'boolean' && this.options.positionable)\n         {\n            this.#elementTarget.style.zIndex = typeof this.options.zIndex === 'number' ? this.options.zIndex :\n             this.#initialZIndex ?? 95;\n\n            super.bringToTop();\n\n            // Ensure that new root element has inline position styles set.\n            this.position.set(this.position.get());\n         }\n\n         super._activateCoreListeners([this.popOut ? this.#elementTarget?.firstChild : this.#elementTarget]);\n\n         this.onSvelteRemount();\n      }\n   }\n}\n\n/**\n * Handle `PopOut!` module hooks to allow applications to popout to their own browser window.\n */\nclass PopoutSupport\n{\n   static initialize()\n   {\n      Hooks.on('PopOut:loading', (app, popout) =>\n      {\n         if (app instanceof SvelteApp)\n         {\n            // Disable app position system.\n            app.position.enabled = false;\n\n            // Save current `headerButtonNoClose` state.\n            app.state.save({\n               name: '#beforePopout',\n               headerButtonNoClose: app.reactive.headerButtonNoClose\n            });\n\n            // Set the apps active window to the popout browser window.\n            app.reactive.activeWindow = popout;\n\n            // Disable the close button.\n            app.reactive.headerButtonNoClose = true;\n         }\n      });\n\n      Hooks.on('PopOut:popin', (app) => this.#handleRejoin(app));\n      Hooks.on('PopOut:close', (app) => this.#handleRejoin(app));\n   }\n\n   /**\n    * Handles rejoining the app to main browser window.\n    *\n    * @param {Application} app - The target app.\n    */\n   static #handleRejoin(app)\n   {\n      if (app instanceof SvelteApp)\n      {\n         // Enable the app position system.\n         app.position.enabled = true;\n\n         // Restore the initial header button no close state.\n         const beforeData = app.state.remove({ name: '#beforePopout' });\n         if (beforeData) { app.reactive.headerButtonNoClose = beforeData?.headerButtonNoClose ?? false; }\n\n         // Reset the apps active window to the main `globalThis` reference.\n         app.reactive.activeWindow = void 0;\n      }\n   }\n}\n\n/**\n * Provides storage for all dialog options through individual accessors and `get`, `merge`, `replace` and `set` methods\n * that safely access and update data changed to the mounted DialogShell component reactively.\n */\nclass TJSDialogData\n{\n   /**\n    * @type {import('../../index.js').SvelteApp}\n    */\n   #application;\n\n   /**\n    * Stores the dialog options data.\n    *\n    * @type {import('./types').TJSDialog.OptionsData}\n    */\n   #internal = {};\n\n   /**\n    * @param {import('../../index.js').SvelteApp} application - The host Foundry application.\n    */\n   constructor(application)\n   {\n      this.#application = application;\n\n      Object.seal(this);\n   }\n\n   /**\n    * @returns {{ [key: string]: import('./types').TJSDialogButtonData }} The dialog button configuration.\n    */\n   get buttons()\n   {\n      return this.#internal.buttons;\n   }\n\n   /**\n    * Set the dialog button configuration.\n    *\n    * @param {string} buttons - New dialog button configuration.\n    */\n   set buttons(buttons)\n   {\n      this.#internal.buttons = buttons;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {import('@typhonjs-fvtt/runtime/svelte/util').TJSSvelte.Config.Minimal | string} The Svelte configuration object or HTML string\n    *          content.\n    */\n   get content()\n   {\n      return this.#internal.content;\n   }\n\n   /**\n    * Set the Svelte configuration object or HTML string content.\n    *\n    * @param {import('@typhonjs-fvtt/runtime/svelte/util').TJSSvelte.Config.Minimal | string} content - New Svelte configuration object or\n    *        HTML string content.\n    */\n   set content(content)\n   {\n      this.#internal.content = content;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {string} The default button ID to focus initially.\n    */\n   get default()\n   {\n      return this.#internal.default;\n   }\n\n   /**\n    * Set the default button ID to focus initially.\n    *\n    * @param {string} newDefault - New default button ID to focus initially.\n    */\n   set default(newDefault)\n   {\n      this.#internal.default = newDefault;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} The dialog draggable state; draggable when true.\n    */\n   get draggable()\n   {\n      return this.#internal.draggable;\n   }\n\n   /**\n    * Set the dialog state; draggable when true.\n    *\n    * @param {boolean} draggable - New dialog draggable state; draggable when true.\n    */\n   set draggable(draggable)\n   {\n      this.#internal.draggable = draggable;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} When true auto-management of app focus is enabled.\n    */\n   get focusAuto()\n   {\n      return this.#internal.focusAuto;\n   }\n\n   /**\n    * Set the dialog auto-management of app focus.\n    *\n    * @param {boolean} focusAuto - New dialog auto-management of app focus.\n    */\n   set focusAuto(focusAuto)\n   {\n      this.#internal.focusAuto = focusAuto;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} When true the first focusable element that isn't a button is focused.\n    */\n   get focusFirst()\n   {\n      return this.#internal.focusFirst;\n   }\n\n   /**\n    * Set the dialog first focusable element state.\n    *\n    * @param {boolean} focusFirst - New dialog first focusable element state.\n    */\n   set focusFirst(focusFirst)\n   {\n      this.#internal.focusFirst = focusFirst;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} When `focusAuto` and `focusKeep` is true; keeps internal focus.\n    */\n   get focusKeep()\n   {\n      return this.#internal.focusKeep;\n   }\n\n   /**\n    * Set the dialog `focusKeep` state. When `focusAuto` and `focusKeep` is true; keeps internal focus.\n    *\n    * @param {boolean} focusKeep - New dialog `focusKeep` state.\n    */\n   set focusKeep(focusKeep)\n   {\n      this.#internal.focusKeep = focusKeep;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} When true the dialog is minimizable.\n    */\n   get minimizable()\n   {\n      return this.#internal.minimizable;\n   }\n\n   /**\n    * Set the dialog `minimizable` state. When true the dialog is minimizable.\n    *\n    * @param {boolean} minimizable - New dialog `minimizable` state.\n    */\n   set minimizable(minimizable)\n   {\n      this.#internal.minimizable = minimizable;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} When true a modal dialog is displayed.\n    */\n   get modal()\n   {\n      return this.#internal.modal;\n   }\n\n   /**\n    * Set the dialog `modal` state. When true a modal dialog is displayed.\n    *\n    * @param {boolean} modal - New dialog `modal` state.\n    */\n   set modal(modal)\n   {\n      this.#internal.modal = modal;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {import('./types').TJSDialog.OptionsModal} Additional options for modal dialog display.\n    */\n   get modalOptions()\n   {\n      return this.#internal.modalOptions;\n   }\n\n   /**\n    * Set additional options for modal dialog display.\n    *\n    * @param {import('./types').TJSDialog.OptionsModal} modalOptions - New additional options for modal dialog display.\n    */\n   set modalOptions(modalOptions)\n   {\n      this.#internal.modalOptions = modalOptions;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} When true and an error is raised in dialog callback functions post a UI error notification.\n    */\n   get notifyError()\n   {\n      return this.#internal.notifyError;\n   }\n\n   /**\n    * Set the dialog `notifyError` state. When true and an error is raised in dialog callback functions post a UI error\n    * notification.\n    *\n    * @param {boolean} notifyError - New dialog `notifyError` state.\n    */\n   set notifyError(notifyError)\n   {\n      this.#internal.notifyError = notifyError;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {string | ((data?: { application?: import('../../index.js').TJSDialog }) => any)} Callback invoked when\n    *          dialog is closed; no button option selected. When defined as a string any matching function by name\n    *          exported from content Svelte component is invoked.\n    */\n   get onClose()\n   {\n      return this.#internal.onClose;\n   }\n\n   /**\n    * Set callback invoked when dialog is closed; no button option selected. When defined as a string any matching\n    * function by name exported from content Svelte component is invoked..\n    *\n    * @param {string | ((data?: { application?: import('../../index.js').TJSDialog }) => any)} onClose - New dialog\n    *        `onClose` state.\n    */\n   set onClose(onClose)\n   {\n      this.#internal.onClose = onClose;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} Dialog `rejectClose` state. When true and a Promise has been created by {@link TJSDialog.wait}\n    *          and the Promise is not in the process of being resolved or rejected on close of the dialog any `onClose`\n    *          function is invoked and any result that is undefined will cause the Promise to then be rejected..\n    */\n   get rejectClose()\n   {\n      return this.#internal.rejectClose;\n   }\n\n   /**\n    * Set the dialog `rejectClose` state.\n    *\n    * @param {boolean} rejectClose - New dialog `rejectClose` state.\n    */\n   set rejectClose(rejectClose)\n   {\n      this.#internal.rejectClose = rejectClose;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} When true the dialog is resizable.\n    */\n   get resizable()\n   {\n      return this.#internal.resizable;\n   }\n\n   /**\n    * Set the dialog `resizable` state. When true the dialog is resizable.\n    *\n    * @param {boolean} resizable - New dialog `resizable` state.\n    */\n   set resizable(resizable)\n   {\n      this.#internal.resizable = resizable;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {boolean} When true and resolving any Promises and there are undefined results from any button callbacks\n    *          the button ID is resolved.\n    */\n   get resolveId()\n   {\n      return this.#internal.resolveId;\n   }\n\n   /**\n    * Set the dialog `resolveId` state. When true and resolving any Promises and there are undefined results from any\n    * button callbacks the button ID is resolved.\n    *\n    * @param {boolean} resolveId - New dialog `resolveId` state.\n    */\n   set resolveId(resolveId)\n   {\n      this.#internal.resolveId = resolveId;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {string} The dialog window title.\n    */\n   get title()\n   {\n      return this.#internal.title;\n   }\n\n   /**\n    * Set the dialog window title.\n    *\n    * @param {string} title - New dialog window title.\n    */\n   set title(title)\n   {\n      this.#internal.title = title;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {import('./types').TJSDialog.OptionsTransition} Transition options for the dialog.\n    */\n   get transition()\n   {\n      return this.#internal.transition;\n   }\n\n   /**\n    * Set transition options for the dialog.\n    *\n    * @param {import('./types').TJSDialog.OptionsTransition} transition - New transition options for the dialog.\n    */\n   set transition(transition)\n   {\n      this.#internal.transition = transition;\n      this.#updateComponent();\n   }\n\n   /**\n    * @returns {number | null} A specific z-index for the dialog. Pass null for the dialog to act like other\n    *          applications in regard bringing to top when activated.\n    */\n   get zIndex()\n   {\n      return this.#internal.zIndex;\n   }\n\n   /**\n    * Set specific z-index for the dialog.\n    *\n    * @param {number | null} zIndex - New z-index for the dialog.\n    */\n   set zIndex(zIndex)\n   {\n      this.#internal.zIndex = zIndex;\n      this.#updateComponent();\n   }\n\n   /**\n    * Provides a cloned copy of the dialog data.\n    * Note: The content attribute is not cloned as complex / props may be present.\n    *\n    * @returns {import('./types').TJSDialog.OptionsData} A clone of the dialog data.\n    */\n   clone()\n   {\n      // Make a shallow copy of internally stored data.\n      const shallowCopy = { ...this.#internal };\n\n      // Remove the content parameter as it may contain complex props sent to the hosted dialog component.\n      delete shallowCopy.content;\n\n      // Clone the internal data and then set the content directly.\n      const cData = klona(shallowCopy);\n      cData.content = this.#internal.content;\n\n      return cData;\n   }\n\n   /**\n    * Provides a way to safely get this dialogs data given an accessor string which describes the\n    * entries to walk. To access deeper entries into the object format the accessor string with `.` between entries\n    * to walk.\n    *\n    * @param {string}   accessor - The path / key to set. You can set multiple levels.\n    *\n    * @param {any}      [defaultValue] - A default value returned if the accessor is not found.\n    *\n    * @returns {any} Value at the accessor.\n    */\n   get(accessor, defaultValue)\n   {\n      return safeAccess(this.#internal, accessor, defaultValue);\n   }\n\n   /**\n    * @param {import('./types').TJSDialog.OptionsData} data - Merge provided data object into Dialog data.\n    */\n   merge(data)\n   {\n      deepMerge(this.#internal, data);\n      this.#updateComponent();\n   }\n\n   /**\n    * Sets the dialog data; this is reactive.\n    *\n    * @param {import('./types').TJSDialog.OptionsData}   data - Dialog data.\n    */\n   replace(data)\n   {\n      if (!isObject(data)) { throw new TypeError(`TJSDialogData replace error: 'data' is not an object'.`); }\n\n      this.#internal = {};\n\n      // Merge new data and perform a reactive update.\n      this.merge(data);\n   }\n\n   /**\n    * Provides a way to safely set this dialogs data given an accessor string which describes the\n    * entries to walk. To access deeper entries into the object format the accessor string with `.` between entries\n    * to walk.\n    *\n    * Automatically the dialog data will be updated in the associated DialogShell Svelte component.\n    *\n    * @param {string}   accessor - The path / key to set. You can set multiple levels.\n    *\n    * @param {any}      value - Value to set.\n    *\n    * @returns {boolean} True if successful.\n    */\n   set(accessor, value)\n   {\n      const success = safeSet(this.#internal, accessor, value, { createMissing: true });\n\n      // If `this.#internal` modified then update the app options store.\n      if (success) { this.#updateComponent(); }\n\n      return success;\n   }\n\n   /**\n    * Updates the data in the Svelte dialog component.\n    */\n   #updateComponent()\n   {\n      const component = this.#application.svelte.appShell;\n      if (component?.data) { component.data = this.clone(); }\n   }\n}\n\n/**\n * Provides a reactive dialog implementation configured from a unique dialog options object. The dialog features a\n * bottom button bar for user selection.\n *\n * A glasspane / modal option with various styling and transition capabilities is available when setting `modal: true`.\n *\n * Most importantly the `content` attribute of dialog data can be a Svelte component configuration object to render\n * your custom component as the dialog content. When using a Svelte component as the content you can assign a string\n * to the various `on<XXX>` dialog callbacks and an exported function from your component will be invoked to handle the\n * button callback. All dialog button callbacks and `onClose` callback receive a single argument which is the dialog /\n * application instance.\n *\n * When making a form with form validation or other dialog that you don't want to close immediately on button press you\n * can set `autoClose: false`, however you are 100% in control of resolving any Promise callbacks from button presses\n * and also closing the application. Each button can also be configured with `autoClose: false` in the button data.\n *\n * There is a handy Promise management capability to track a single Promise for the lifetime of a dialog available\n * at {@link TJSDialog.managedPromise}. By default when the user closes the dialog / application any managed Promise is\n * resolved with `null`. The managed Promise is available in any Svelte content component by using\n * `const managedPromise = getContext('#managedPromise')`. When handling any custom resolution particularly when\n * setting `autoClose: false` for a given button you are 100% in control of resolving or rejecting asynchronous data to\n * return from the dialog.\n *\n * To create and wait upon a managed promise for asynchronous return results use the static or member variation of\n * {@link TJSDialog.wait}.\n *\n * Please refer to {@link TJSDialog.OptionsData} for the various options used to construct the dialog.\n *\n * There are a couple of static helper methods to quickly create standard dialogs such as a 'yes' / 'no' confirmation\n * dialog with {@link TJSDialog.confirm} and an 'ok' single button dialog with {@link TJSDialog.prompt}.\n */\nclass TJSDialog extends SvelteApp\n{\n   /** @type {TJSDialogData} */\n   #data;\n\n   /** @type {ManagedPromise} */\n   #managedPromise;\n\n   /**\n    * @param {import('./internal/state-dialog/types').TJSDialog.OptionsData} data - Dialog options.\n    *\n    * @param {import('./types').SvelteApp.OptionsCore}   [options] - SvelteApp options.\n    */\n   constructor(data, options = {})\n   {\n      // Note: explicit setting of `popOutModuleDisable` to prevent the PopOut! module from acting on modal dialogs.\n      // @ts-expect-error\n      super({ popOutModuleDisable: typeof data?.modal === 'boolean' ? data.modal : false, ...options });\n\n      this.#managedPromise = new ManagedPromise();\n\n      this.#data = new TJSDialogData(this);\n      this.#data.replace(data);\n   }\n\n   /**\n    * Default options for TJSDialog. Provides a default width and setting `height` to `auto` to always display dialog\n    * content even if it changes. The default `DialogShell` / `svelte` options should not be changed and instead mount\n    * the dialog content component by supplying a Svelte configuration object to dialog data `content` field.\n    *\n    * @returns {import('./types').SvelteApp.Options} Default options\n    */\n   static get defaultOptions()\n   {\n      return /** @type {import('./types').SvelteApp.Options} */ deepMerge(super.defaultOptions, {\n         classes: ['dialog', 'tjs-dialog'],\n         width: 400,\n         height: 'auto',\n         svelte: {\n            class: DialogShell,\n            intro: true,\n            target: document.body,\n            /**\n             * `this` is the TJSDialog instance when invoked.\n             *\n             * @this {TJSDialog}\n             *\n             * @returns {{data: import('./types').TJSDialog.OptionsData, managedPromise: ManagedPromise}} Props\n             */\n            props: function()\n            {\n               return {\n                  data: this.#data.clone(),\n                  managedPromise: this.#managedPromise\n               };\n            }\n         }\n      });\n   }\n\n   /**\n    * Returns the dialog data.\n    *\n    * @returns {import('./internal/state-dialog/types').TJSDialog.Data} Dialog data.\n    */\n   get data() { return this.#data; }\n\n   /**\n    * @returns {import('@typhonjs-fvtt/runtime/util/async').ManagedPromise} Returns the managed promise.\n    */\n   get managedPromise() { return this.#managedPromise; }\n\n   /**\n    * Close the dialog and un-register references to it within UI mappings.\n    * This function returns a Promise which resolves once the window closing animation concludes.\n    *\n    * @param {object}   [options] - Optional parameters.\n    *\n    * @param {boolean}  [options.force] - Force close regardless of render state.\n    *\n    * @returns {Promise<void>} A Promise which resolves once the application is closed with the callback value or\n    *                          `true`.\n    */\n   async close(options)\n   {\n      try\n      {\n         // Note: When handling a managed promise if a button selection has already been made the managed promise is\n         // already processing and the resolution below is skipped.\n         if (this.#managedPromise.isActive && !this.#managedPromise.isProcessing)\n         {\n            const result = TJSDialog.#invokeFn(this.#data.onClose, this, null);\n            const rejectClose = typeof this.#data.rejectClose === 'boolean' ? this.#data.rejectClose : false;\n\n            if (rejectClose && result === null)\n            {\n               this.#managedPromise.reject(new Error('TJSDialog was closed without a choice being made.'));\n            }\n            else\n            {\n               this.#managedPromise.resolve(result);\n            }\n         }\n      }\n      catch (err)\n      {\n         const notifyError = typeof this.#data.notifyError === 'boolean' ? this.#data.notifyError : true;\n         if (notifyError)\n         {\n            // TODO: When app eventbus is available send event for UI notification instead of Foundry API usage.\n            globalThis.ui.notifications.error(err, { console: false });\n         }\n\n         // If there is a managed Promise reject it or re-throw error.\n         if (!this.#managedPromise.reject(err)) { throw err; }\n      }\n      finally\n      {\n         await super.close(options);\n      }\n   }\n\n   /**\n    * Brings to top or renders this dialog returning a Promise that is resolved any button pressed or when the dialog\n    * is closed.\n    *\n    * Creates an anonymous data defined TJSDialog returning a Promise that can be awaited upon for the user to make a\n    * choice.\n    *\n    * Note: `null` is returned if the dialog is closed without a user making a choice.\n    *\n    * @template T\n    *\n    * @param {object}   [options] - Options.\n    *\n    * @param {boolean}  [options.reuse=false] - When true if there is an existing managed Promise this allows multiple\n    *        sources to await on the same result.\n    *\n    * @returns {Promise<T>} A promise for dialog resolution.\n    */\n   async wait(options)\n   {\n      // TODO: Direct usage of Foundry core Application API.\n      if (this.rendered)\n      {\n         this.bringToTop();\n      }\n      else\n      {\n         this.render(true, { focus: true });\n      }\n\n      // Return a managed Promise which is automatically resolved on button press via `DialogContent` component or when\n      // the dialog is closed.\n      return this.#managedPromise.create(options);\n   }\n\n   // ---------------------------------------------------------------------------------------------------------------\n\n   /**\n    * A helper factory method to create simple confirmation dialog windows which consist of simple yes / no prompts.\n    * If you require more flexibility, a custom TJSDialog instance is preferred. The default focused button is 'yes'.\n    * You can change the default focused button by setting `default` to `yes` or `no`.\n    *\n    * @template T\n    *\n    * @param {import('./internal/state-dialog/types').TJSDialog.OptionsData & {\n    *    onYes?: string | ((data?: { application?: TJSDialog }) => any),\n    *    onNo?: string | ((data?: { application?: TJSDialog }) => any)\n    * }} [data] - Confirm dialog options.\n    *\n    * @param {string|((data?: { application?: TJSDialog }) => any)} [data.onYes] - Callback function upon `yes`; may be\n    *        an async function. When defined as a string any matching function by name exported from content Svelte\n    *        component is invoked.\n    *\n    * @param {string|((data?: { application?: TJSDialog }) => any)} [data.onNo] - Callback function upon `no`; may be an\n    *        async function. When defined as a string any matching function by name exported from content Svelte\n    *        component is invoked.\n    *\n    * @param {import('./types').SvelteApp.OptionsCore}  [options]  SvelteApp options passed to the\n    *        TJSDialog constructor.\n    *\n    * @returns {Promise<T>} A promise which resolves with result of yes / no callbacks or true / false.\n    *\n    * @example\n    * const result = await TJSDialog.confirm({\n    *  title: 'A Yes or No Question',\n    *  content: '<p>Choose wisely.</p>',\n    *  onYes: () => 'YES Result',\n    *  onNo: () => 'NO Result'\n    * });\n    *\n    * // Logs 'YES result', 'NO Result', or null if the user closed the dialog without making a selection.\n    * console.log(result);\n    */\n   static async confirm({ onYes, onNo, ...data } = {}, options = {})\n   {\n      // Allow overwriting of default icon and labels.\n      const mergedButtons = deepMerge({\n         yes: {\n            icon: 'fas fa-check',\n            label: 'Yes'\n         },\n         no: {\n            icon: 'fas fa-times',\n            label: 'No',\n         }\n      }, data.buttons ?? {});\n\n      return this.wait({\n         ...data,\n         buttons: deepMerge(mergedButtons, {\n            yes: {\n               onPress: ({ application }) => this.#invokeFn(onYes, application, true)\n            },\n            no: {\n               onPress: ({ application }) => this.#invokeFn(onNo, application, false)\n            }\n         }),\n         default: data.default ?? 'yes'\n      }, options);\n   }\n\n   /**\n    * A helper method to invoke a callback function directly or lookup an exported function with the same name from any\n    * content Svelte component to invoke. This is used internally to apply default values for `confirm` and `prompt`.\n    *\n    * @param {string|((data?: { application?: TJSDialog }) => any)} callback - Callback function to invoke; may be an\n    *        async function. When defined as a string any matching function by name exported from content Svelte\n    *        component is invoked.\n    *\n    * @param {TJSDialog} application - TJSDialog instance passed to callback.\n    *\n    * @param {*} [defaultResult] - An optional default result to return; undefined if not specified.\n    *\n    * @returns {*} Result.\n    *\n    * @internal\n    */\n   static #invokeFn(callback, application, defaultResult = void 0)\n   {\n      let result = defaultResult;\n\n      switch (typeof callback)\n      {\n         case 'function':\n            // Pass the dialog instance to the callback.\n            result = callback({ application });\n            break;\n\n         case 'string':\n         {\n            const dialogComponent = application?.svelte?.appShell?.dialogComponent;\n\n            // Attempt lookup by function name in dialog instance component.\n            if (dialogComponent !== void 0 && typeof dialogComponent?.[callback] === 'function')\n            {\n               result = dialogComponent?.[callback]({ application });\n            }\n            else\n            {\n               if (dialogComponent === void 0)\n               {\n                  console.warn(`[TRL] TJSDialog warning: 'onPress' defined as a string with no ` +\n                   `associated content Svelte component.`);\n               }\n               else if (typeof dialogComponent?.[callback] !== 'function')\n               {\n                  console.warn(`[TRL] TJSDialog warning: The content Svelte component does not contain ` +\n                   `an associated function '${callback}'. Did you remember to add ` +\n                   `'<svelte:options accessors={true} />' and export the function?`);\n               }\n            }\n            break;\n         }\n      }\n\n      return result;\n   }\n\n   /**\n    * A helper factory method to display a basic \"prompt\" style TJSDialog with a single button.\n    *\n    * @template T\n    *\n    * @param {import('./internal/state-dialog/types').TJSDialog.OptionsData & {\n    *    onOk?: string | ((data?: { application?: TJSDialog }) => any),\n    *    label?: string,\n    *    icon?: string\n    * }} [data] - Prompt dialog options that includes any TJSDialog options along with the following optional fields:\n    *\n    * @param {string|((data?: { application?: TJSDialog }) => any)} [data.onOk] - Callback function upon `ok`; may be\n    *        an async function. When defined as a string any matching function by name exported from content Svelte\n    *        component is invoked.\n    *\n    * @param {string}   [data.label] - The OK prompt button text.\n    *\n    * @param {string}   [data.icon=\"fas fa-check\"] - Set another icon besides `fas fa-check` for button.\n    *\n    * @param {import('./types').SvelteApp.OptionsCore}  [options]  SvelteApp options passed to the\n    *        TJSDialog constructor.\n    *\n    * @returns {Promise<T>} The returned value from the provided callback function or `true` if the button\n    *          is pressed.\n    *\n    * @example\n    * const result = await TJSDialog.prompt({\n    *  title: 'Are you OK?',\n    *  content: '<p>Are you OK?.</p>',\n    *  label: 'Feeling Fine!',\n    *  onOk: () => 'OK'\n    * });\n    *\n    * // Logs 'OK' or null if the user closed the dialog without making a selection.\n    * console.log(result);\n    */\n   static async prompt({ onOk, label, icon = 'fas fa-check', ...data } = {}, options = {})\n   {\n      return this.wait({\n         ...data,\n         buttons: {\n            ok: {\n               icon,\n               label,\n               onPress: ({ application }) => this.#invokeFn(onOk, application, true)\n            }\n         },\n         default: 'ok'\n      }, options);\n   }\n\n   /**\n    * Creates an anonymous data defined TJSDialog returning a Promise that can be awaited upon for the user to make a\n    * choice.\n    *\n    * Note: By default `null` is returned if the dialog is closed without a user making a choice.\n    *\n    * @template T\n    *\n    * @param {import('./internal/state-dialog/types').TJSDialog.OptionsData}  data - Dialog data passed to the\n    *        TJSDialog constructor.\n    *\n    * @param {import('./types').SvelteApp.OptionsCore}  [options]  SvelteApp options passed to the\n    *        TJSDialog constructor.\n    *\n    * @returns {Promise<T>} A Promise that resolves to the chosen result.\n    */\n   static async wait(data, options = {})\n   {\n      if (!isObject(data)) { throw new TypeError(`TJSDialog.wait error: 'data' is not an object'.`); }\n\n      // Instantiate and render the dialog.\n      return new this({ ...data }, options).wait();\n   }\n}\n\n// Handle `hotReload` Foundry hook when running the Vite dev server.\nif (import.meta.hot) { FoundryHMRSupport.initialize(); }\n\n// Handle `PopOut!` module hooks to allow applications to popout to their own browser window.\nPopoutSupport.initialize();\n\nexport { SvelteApp, SvelteApp as SvelteApplication, TJSDialog };\n//# sourceMappingURL=index.js.map\n","import { debug } from \"../lib/lib.js\";\n\nclass loading_bar {\n  constructor() {\n    this.total = 0;\n    this.current = 0;\n    this.lastPct = 0;\n  }\n\n  init(context, total) {\n    this.context = context;\n    this.total = total;\n    this.current = 0;\n    this.lastPct = 0;\n    SceneNavigation.displayProgressBar({ label: this.context, pct: 1 });\n  }\n\n  incrementProgress() {\n    this.current += 1;\n    const pct = Math.round((this.current / this.total) * 100);\n    if (pct !== this.lastPct) {\n      debug(`${pct}% loaded...`);\n      SceneNavigation.displayProgressBar({ label: this.context, pct: pct });\n    }\n    this.lastPct = pct;\n  }\n}\n\nconst LoadingBar = new loading_bar();\n\nexport default LoadingBar;\n","export default {\r\n\tPlaceableObject: foundry?.canvas?.placeables?.PlaceableObject ?? PlaceableObject,\r\n\tToken: foundry?.canvas?.placeables?.Token ?? Token,\r\n\tMeasuredTemplate: foundry?.canvas?.placeables?.MeasuredTemplate ?? MeasuredTemplate,\r\n\tDrawing: foundry?.canvas?.placeables?.Drawing ?? Drawing,\r\n\tTile: foundry?.canvas?.placeables?.Tile ?? Tile,\r\n\tSpriteMesh: foundry?.canvas?.containers?.SpriteMesh ?? SpriteMesh,\r\n\tInteractionLayer: foundry?.canvas?.layers?.InteractionLayer ?? InteractionLayer,\r\n\tsrcExists: foundry?.canvas?.srcExists ?? srcExists,\r\n\tloadTexture: foundry?.canvas?.loadTexture ?? loadTexture,\r\n\tBatchShaderGenerator: foundry?.canvas?.rendering?.batching?.BatchShaderGenerator ?? BatchShaderGenerator,\r\n\tBaseSamplerShader: foundry?.canvas?.rendering?.shaders?.BaseSamplerShader ?? BaseSamplerShader,\r\n\tAbstractBaseFilter: foundry?.canvas?.rendering?.filters?.AbstractBaseFilter ?? AbstractBaseFilter,\r\n\tCanvasAnimation: foundry?.canvas?.animation?.CanvasAnimation ?? CanvasAnimation,\r\n\tCanvas: foundry?.canvas?.Canvas ?? Canvas,\r\n}","import CONSTANTS from \"../constants.js\"\nimport { debug } from \"../lib/lib.js\"\nimport FoundryShim from \"../utils/foundry-shim.js\";\n\nconst SequencerFileCache = {\n  _videos: {},\n  _preloadedFiles: new Set(),\n  _totalCacheSize: 0,\n  _validTypes: [\"video/webm\", \"video/x-webm\", \"application/octet-stream\", \"binary/octet-stream\"],\n  /** @type {Map<string, PIXI.Spritesheet>} */\n  _spritesheets: new Map(),\n  /** @type {Map<string, Promise<{spritesheet: PIXI.Spritesheet, scale: number}> | null>} */\n  _generateSpritesheetJobs: new Map(),\n\n  /** @type {Promise<import(\"../lib/spritesheets/SpritesheetGenerator.js\").SpritesheetGenerator> | null} */\n  _spritesheetGenerator: null,\n\n  /**\n   *\n   * @param {string} inSrc\n   * @returns {Promise<Blob>} the video blob\n   */\n  async loadVideo(inSrc) {\n    if (!this._videos[inSrc]) {\n      const blob = await fetch(inSrc, {\n        mode: \"cors\",\n        credentials: \"same-origin\",\n      })\n        .then((r) => r.blob())\n        .catch((err) => {\n          console.error(err)\n        })\n\n      if (this._validTypes.indexOf(blob?.type) === -1) return false\n\n      while (this._totalCacheSize + blob.size > 524288000) {\n        const entries = Object.entries(this._videos)\n\n        entries.sort((a, b) => {\n          return b[1].lastUsed - a[1].lastUsed\n        })\n\n        const [oldSrc] = entries[0]\n\n        this._preloadedFiles.delete(oldSrc)\n        this._totalCacheSize -= this._videos[oldSrc].blob.size\n        delete this._videos[oldSrc]\n      }\n\n      this._totalCacheSize += blob.size\n      this._preloadedFiles.add(inSrc)\n      this._videos[inSrc] = {\n        blob,\n        lastUsed: +new Date(),\n      }\n    }\n\n    this._videos[inSrc].lastUsed = +new Date()\n    return this._videos[inSrc].blob\n  },\n\n  srcExists(inSrc) {\n    if (this._preloadedFiles.has(inSrc)) {\n      return true\n    }\n    return FoundryShim.srcExists(inSrc)\n  },\n\n  async loadFile(inSrc, preload = false) {\n    if (inSrc.toLowerCase().endsWith(\".webm\")) {\n      let blob = await this.loadVideo(inSrc)\n      if (!blob) return false\n      this._preloadedFiles.add(inSrc)\n      if (preload) return true\n      return get_video_texture(blob)\n    } else if (foundry.audio.AudioHelper.hasAudioExtension(inSrc)) {\n      try {\n        const audio = await foundry.audio.AudioHelper.preloadSound(inSrc)\n        if (audio) {\n          this._preloadedFiles.add(inSrc)\n        }\n        return audio\n      } catch (err) {\n        console.error(`Failed to load audio: ${inSrc}`)\n        return false\n      }\n    }\n\n    const texture = await FoundryShim.loadTexture(inSrc)\n    if (texture) {\n      this._preloadedFiles.add(inSrc)\n    }\n    return texture\n  },\n\n  /**\n   * @param {string} inSrc\n   * @param {Object} options\n   * @param {number} options.minimumScale\n   * @return {Promise<PIXI.Spritesheet | undefined>} the compiled spritesheet or\n   * undefined if it cannot be generated\n   */\n  async requestCompiledSpritesheet(inSrc, { minimumScale }) {\n    if (!inSrc.toLowerCase().endsWith(\".webm\")) {\n      return\n    }\n    if (this._spritesheetGenerator == null) {\n      this._spritesheetGenerator = import(\n        \"../lib/spritesheets/SpritesheetGenerator.js\"\n      ).then((m) => m.SpritesheetGenerator.create())\n    }\n    const generator = await this._spritesheetGenerator\n    if (!generator) {\n      return\n    }\n    let job = this._generateSpritesheetJobs.get(inSrc)\n    if (!job) {\n      job = new Promise(async (resolve) => {\n        const timeStart = Date.now()\n\n        debug(\n          `Spritesheets | generating ${inSrc}. Required scale ${minimumScale}`,\n        )\n        const blob = await this.loadVideo(inSrc)\n        const buffer = await blob.arrayBuffer()\n        /** @type {PIXI.Spritesheet | null} */\n        let spritesheet = null\n        let scale = 1\n        try {\n          const result = await generator.spritesheetFromBuffer({\n            buffer,\n            id: inSrc,\n            minimumScale,\n          })\n          spritesheet = result.spritesheet\n          scale = result.scale\n        } catch (error) {\n          console.warn(error)\n          resolve(null)\n          return\n        }\n        const w = spritesheet.baseTexture.width\n        const h = spritesheet.baseTexture.height\n        const megaBytes =\n          Math.round(\n            spritesheet.baseTexture.resource._levelBuffers.reduce(\n              (acc, cur) => acc + cur.levelBuffer.byteLength,\n              0,\n            ) / 100_000,\n          ) / 10\n        const time = Math.round((Date.now() - timeStart) / 100) / 10\n        debug(\n          `Spritesheets | ${inSrc} generated in ${time}s. ${w}x${h} ${megaBytes}mb`,\n        )\n        resolve({ spritesheet, scale })\n      })\n      this._generateSpritesheetJobs.set(inSrc, job)\n    }\n\n    const result = await job\n    if (result && result.scale < minimumScale) {\n      debug(\n        `Spritesheets | ${inSrc} minimum scale of ${minimumScale} requested but only scale ${result.scale} is available`,\n      )\n      return undefined\n    }\n    return result?.spritesheet\n  },\n\n  registerSpritesheet(inSrc, inSpriteSheet) {\n    const existingSheetRef = this._spritesheets.get(inSrc)\n    if (existingSheetRef) {\n      existingSheetRef[1] += 1\n    } else {\n      this._spritesheets.set(inSrc, [inSpriteSheet, 1])\n    }\n  },\n\n  /**\n   *\n   * @param {string} inSrc\n   * @returns {void}\n   */\n  async unloadSpritesheet(inSrc) {\n    const existingSheetRef = this._spritesheets.get(inSrc)\n    if (!existingSheetRef) {\n      console.error(\"trying to unlaod spritesheet that was not loaded:\", inSrc)\n      return\n    }\n    existingSheetRef[1] -= 1\n    if (existingSheetRef[1] > 0) {\n      return\n    }\n    this._generateSpritesheetJobs.delete(inSrc)\n    this._spritesheets.delete(inSrc)\n    /** @type {PIXI.Spritesheet} */\n    const sheet = existingSheetRef[0]\n    const relatedPacks = sheet.data?.meta?.related_multi_packs ?? []\n    const relatedSheets = sheet.linkedSheets\n    // const packsSize = Math.max(relatedPacks.length, relatedSheets.length)\n    // clean up related sheets starting with the last (leaf)\n\n    const cacheKeys = [\n      get_sheet_image_url(inSrc, sheet),\n      foundry.utils.getRoute(inSrc),\n    ]\n    await PIXI.Assets.unload(cacheKeys.filter((src) => !!src))\n\t\tif (sheet.textures) {\n\t\t\tObject.values(sheet.textures).forEach((t) => t.destroy())\n\t\t}\n    sheet.baseTexture?.destroy()\n  },\n}\n\n/**\n * @param {PIXI.Spritesheet} sheet\n */\nfunction get_sheet_image_url(inSrc, sheet) {\n  const imageName = sheet?.data?.meta?.image\n  if (!imageName) {\n    return\n  }\n  const srcPrefix = inSrc.split(\"/\").slice(0, -1).join(\"/\")\n  const sheetSrc = `${srcPrefix}/${imageName}`\n  return foundry.utils.getRoute(sheetSrc)\n}\nfunction get_sheet_source_url(inSrc, sheetFilename) {\n  const srcPrefix = inSrc.split(\"/\").slice(0, -1).join(\"/\")\n  const sheetSrc = `${srcPrefix}/${sheetFilename}`\n  return foundry.utils.getRoute(sheetSrc)\n}\n\n// TODO: video base textures need to be cleaned up...\n// We should introduce manual reference counting like with spritesheet textures.\nasync function get_video_texture(inBlob) {\n  return new Promise(async (resolve, reject) => {\n    const video = document.createElement(\"video\")\n    video.preload = \"auto\"\n    video.crossOrigin = \"anonymous\"\n    video.controls = true\n    video.autoplay = false\n    video.autoload = true\n    video.muted = true\n    video.src = URL.createObjectURL(inBlob)\n\n    let canplay = true\n    video.oncanplay = async () => {\n      if (!canplay) return\n      canplay = false\n\n      video.height = video.videoHeight\n      video.width = video.videoWidth\n\n      const baseTexture = PIXI.BaseTexture.from(video, {\n        resourceOptions: { autoPlay: false },\n      })\n\n      if (game.settings.get(CONSTANTS.MODULE_NAME, \"enable-fix-pixi\")) {\n        baseTexture.alphaMode = PIXI.ALPHA_MODES.PREMULTIPLIED_ALPHA\n      }\n\n      const texture = new PIXI.Texture(baseTexture)\n\n      resolve(texture)\n      video.oncanplay = null\n    }\n\n    video.onerror = () => {\n      URL.revokeObjectURL(video.src)\n      reject()\n    }\n  })\n}\n\nexport default SequencerFileCache\n","import * as lib from \"../lib/lib.js\";\nimport SequencerFileCache from \"./sequencer-file-cache.js\";\n\nexport class SequencerFileBase {\n  static make(inData, inDBPath, inMetadata) {\n    if (typeof inData === 'string' && !inDBPath && !inMetadata) {\n      return new SequencerFilePlain(inData)\n    }\n    const originalFile = inData?.file ?? inData;\n    const file = foundry.utils.duplicate(originalFile);\n    const isRangeFind =\n      typeof file !== \"string\" && !Array.isArray(originalFile)\n        ? Object.keys(originalFile).filter((key) => key.endsWith(\"ft\")).length >\n          0\n        : false;\n\n    return isRangeFind\n      ? new SequencerFileRangeFind(inData, inDBPath, inMetadata)\n      : new SequencerFile(inData, inDBPath, inMetadata);\n  }\n}\n\nexport class SequencerFilePlain extends SequencerFileBase {\n  #file\n  rangeFind = false;\n\n  constructor(inData) {\n    super();\n    this.#file = inData\n  }\n\n  getFileForDistance() {\n    return this.getFile()\n  }\n\n  getFile() {\n    return this.#file\n  }\n  getAllFiles() {\n    return [this.#file]\n  }\n  async validate() {\n    return Promise.resolve(!!this.#file)\n  }\n\n  clone() {\n    return new SequencerFilePlain(this.#file)\n  }\n\n  getTimestamps() {\n    return undefined\n  }\n}\n\n\nexport class SequencerFile extends SequencerFileBase {\n  rangeFind = false;\n\n  get isFlipbook() {\n    return this.originalMetadata?.flipbook\n  }\n\n  constructor(inData, inDBPath, inMetadata) {\n    super();\n    inData = foundry.utils.duplicate(inData);\n    inMetadata = foundry.utils.duplicate(inMetadata);\n    this.originalData = inData;\n    this.originalMetadata = inMetadata;\n    for (let [key, value] of Object.entries(inMetadata)) {\n      this[key] = value;\n    }\n    this.dbPath = inDBPath;\n    this.moduleName = inDBPath.split(\".\")[0];\n    this.originalFile = inData?.file ?? inData;\n    this.file = foundry.utils.duplicate(this.originalFile);\n    this.fileIndex = null;\n    this.twister = false;\n  }\n\n  clone() {\n    return SequencerFile.make(\n      this.originalData,\n      this.dbPath,\n      this.originalMetadata\n    );\n  }\n\n  async validate() {\n    let isValid = true;\n    const directories = {};\n    const allFiles = this.getAllFiles();\n    for (const file of allFiles) {\n      let directory = file.split(\"/\");\n      directory.pop();\n      directory = directory.join(\"/\");\n      if (directories[directory] === undefined) {\n        directories[directory] = await lib.getFiles(directory);\n      }\n    }\n    for (const file of allFiles) {\n      let directory = file.split(\"/\");\n      directory.pop();\n      directory = directory.join(\"/\");\n\n      if (directories[directory].indexOf(file) === -1) {\n        console.warn(\n          `\"${this.dbPath}\" has an incorrect file path, could not find file. Points to:\\n${file}`\n        );\n        isValid = false;\n      }\n    }\n    return isValid;\n  }\n\n  getAllFiles() {\n    return [this.file].deepFlatten();\n  }\n\n  getFile() {\n    if (Array.isArray(this.file)) {\n      this.fileIndex = lib.is_real_number(this.fileIndex)\n        ? this.fileIndex\n        : lib.random_array_element(this.file, {\n            twister: this.twister,\n            index: true,\n          });\n      return this.file[this.fileIndex];\n    }\n    return this.file;\n  }\n\n  getTimestamps() {\n    if (Array.isArray(this.originalMetadata?.timestamps)) {\n      return (\n        this.originalMetadata?.timestamps?.[this.fileIndex] ??\n        this.originalMetadata?.timestamps[0]\n      );\n    }\n    return this.originalMetadata?.timestamps;\n  }\n\n  getPreviewFile(entry) {\n    let parts = entry.split(\".\");\n    let files = this.getAllFiles();\n    if (Array.isArray(files)) {\n      if (lib.is_real_number(parts[parts.length - 1])) {\n        files = files[parts[parts.length - 1]];\n      } else {\n        const index = Math.floor(lib.interpolate(0, files.length - 1, 0.5));\n        files = files?.[index - 1] ?? files[index];\n      }\n    }\n    return files;\n  }\n\n  getFileForDistance() {\n    return this.getFile()\n  }\n}\n\nexport class SequencerFileRangeFind extends SequencerFile {\n  rangeFind = true;\n\n  constructor(...args) {\n    super(...args);\n    this._fileDistanceMap = false;\n  }\n\n  static get ftToDistanceMap() {\n    return {\n      \"90ft\": canvas.grid.size * 15,\n      \"60ft\": canvas.grid.size * 9,\n      \"30ft\": canvas.grid.size * 5,\n      \"15ft\": canvas.grid.size * 2,\n      \"05ft\": 0,\n    };\n  }\n\n  get _gridSizeDiff() {\n    return canvas.grid.size / this.template[0];\n  }\n\n  getAllFiles() {\n    return Object.values(this.file).deepFlatten();\n  }\n\n  getFile(inFt = '15ft') {\n    if (inFt && this.file[inFt]) {\n      if (Array.isArray(this.file[inFt])) {\n        const fileIndex = lib.is_real_number(this.fileIndex)\n          ? Math.min(this.file[inFt].length - 1, this.fileIndex)\n          : lib.random_array_element(this.file[inFt], {\n              twister: this.twister,\n              index: true,\n            });\n        return this.file[inFt][fileIndex];\n      }\n      return this.file[inFt];\n    }\n\n    return this.file;\n  }\n\n  getPreviewFile(entry) {\n    let parts = entry.split(\".\");\n    const ft = parts.find(\n      (part) =>\n        Object.keys(SequencerFileRangeFind.ftToDistanceMap).indexOf(part) > -1\n    );\n    if (!ft) {\n      return super.getPreviewFile(entry);\n    }\n    const fileIndex = parts.slice(parts.indexOf(ft) + 1)?.[0];\n    if (lib.is_real_number(Number(fileIndex))) {\n      this.fileIndex = Number(fileIndex);\n    }\n    return this.getFile(ft);\n  }\n\n  _getMatchingDistance(inEntry) {\n    return SequencerFileRangeFind.ftToDistanceMap[inEntry] / this._gridSizeDiff;\n  }\n\n  getFileForDistance(inDistance) {\n    if (!this._fileDistanceMap) {\n      let distances = Object.keys(this.file)\n        .filter(\n          (entry) =>\n            Object.keys(SequencerFileRangeFind.ftToDistanceMap).indexOf(entry) >\n            -1\n        )\n        .map((ft) => {\n          return {\n            file: this.getFile(ft),\n            minDistance: this._getMatchingDistance(ft),\n          };\n        });\n\n      let uniqueDistances = [\n        ...new Set(distances.map((item) => item.minDistance)),\n      ];\n      uniqueDistances.sort((a, b) => a - b);\n\n      let max = Math.max(...uniqueDistances);\n      let min = Math.min(...uniqueDistances);\n\n      this._fileDistanceMap = distances.map((entry) => {\n        entry.distances = {\n          min: entry.minDistance === min ? 0 : entry.minDistance,\n          max:\n            entry.minDistance === max\n              ? Infinity\n              : uniqueDistances[uniqueDistances.indexOf(entry.minDistance) + 1],\n        };\n        return entry;\n      });\n    }\n\n    const possibleFiles = this._fileDistanceMap\n      .filter((entry) => {\n        const relativeDistance = inDistance / this._gridSizeDiff;\n        return (\n          relativeDistance >= entry.distances.min &&\n          relativeDistance < entry.distances.max\n        );\n      })\n      .map((entry) => entry.file)\n      .flat();\n\n    return possibleFiles.length > 1\n      ? lib.random_array_element(possibleFiles, { twister: this.twister })\n      : possibleFiles[0];\n  }\n}\n","import * as lib from \"../lib/lib.js\";\nimport LoadingBar from \"../utils/loadingBar.js\";\nimport { SequencerFile, SequencerFileBase } from \"./sequencer-file.js\";\nimport { writable, get } from \"svelte/store\";\nimport CONSTANTS from \"../constants.js\";\n\nclass Database {\n  #entriesStore = writable({});\n\n  privateModules = [];\n  flattenedEntries = [];\n  flattenedEntriesAdvanced = [];\n  inverseFlattenedEntries = new Map();\n\n  get entries() {\n    return get(this.#entriesStore);\n  }\n  set entries(entries) {\n    this.#entriesStore.set(entries);\n  }\n  get entriesStore() {\n    return this.#entriesStore;\n  }\n\n  get publicModules() {\n    return Object.keys(this.entries).filter(\n      (module) => !this.privateModules.includes(module)\n    );\n  }\n\n  get publicFlattenedEntries() {\n    return this.flattenedEntries.filter((entry) => {\n      return this.privateModules.indexOf(entry.split(\".\")[0]) === -1;\n    });\n  }\n\n  get publicFlattenedSimpleEntries() {\n    return lib.make_array_unique(\n      this.publicFlattenedEntries.map((entry) => {\n        return entry.split(CONSTANTS.FEET_REGEX)[0];\n      })\n    );\n  }\n\n  get publicFlattenedEntriesAdvanced() {\n    return this.flattenedEntriesAdvanced.filter((entry) => {\n      return this.privateModules.indexOf(entry.path.split(\".\")[0]) === -1;\n    });\n  }\n\n\n  /**\n   *  Retrieves an object of every public entry\n   *\n   * @return {object}\n   */\n  get filePathDatabasePaths() {\n    const fileDatabaseObject = {};\n    Object.entries(this.entries)\n      .map((entry) => entry[1])\n      .deepFlatten()\n      .forEach((sequencerFile) => {\n        if (sequencerFile?.rangeFind) {\n          Object.entries(sequencerFile.file).forEach((entry) => {\n            fileDatabaseObject[entry[1]] =\n              sequencerFile.dbPath + \".\" + entry[0];\n          });\n        } else {\n          fileDatabaseObject[sequencerFile.file] = sequencerFile.dbPath;\n        }\n      });\n    return fileDatabaseObject;\n  }\n\n  /**\n   *  Registers a set of entries to the database on the given module name\n   *\n   * @param  {string}      inModuleName  The namespace to assign to the inserted entries\n   * @param  {object}      inEntries     The entries to merge into the database\n   * @param  {boolean}     isPrivate     Whether to mark these entries as private and not show in Effect Player or Database Viewer\n   * @param  {boolean}     override      Whether to ignore existing entries and completely override the module's previous entries\n   * @return {boolean}\n   */\n  registerEntries(inModuleName, inEntries, isPrivate = false, override = false) {\n    if (inModuleName.includes(\".\"))\n      return this._throwError(\n        \"registerEntries\",\n        \"module name must not contain periods\"\n      );\n    if (this.entries[inModuleName] && !override)\n      lib.custom_warning(\n        \"Sequencer\",\n        `registerEntries | module \"${inModuleName}\" has already been registered to the database! Do you have two similar modules active?`,\n        true\n      );\n    this._flatten(inEntries, inModuleName);\n    const processedEntries = this._processEntries(inModuleName, inEntries);\n    if (override) {\n      if (isPrivate) { \n        this.privateModules.push(inModuleName); \n      } else {\n        this.privateModules = this.privateModules.filter(mod => module !== inModuleName);\n      }\n      this.entries[inModuleName] = processedEntries;\n    } else {\n      if (isPrivate) this.privateModules.push(inModuleName);\n      this.entries = foundry.utils.mergeObject(this.entries, {\n        [inModuleName]: processedEntries,\n      });\n    }\n    lib.debug(\n      `Sequencer | Database | Entries for \"${inModuleName}\" registered`\n    );\n    Hooks.callAll(\"registerSequencerDatabaseEntries\", inModuleName);\n    return true;\n  }\n\n  /**\n   *  Validates the entries under a certain module name, checking whether paths to assets are correct or not\n   *\n   * @param  {string}     inModuleName    The namespace to assign to the inserted entries\n   * @return {boolean}\n   */\n  async validateEntries(inModuleName) {\n    let entries = this.getEntry(inModuleName);\n    if (!Array.isArray(entries)) {\n      entries = [entries];\n    }\n    ui.notifications.info(\n      `Validating paths registered to \"${inModuleName}\"...`\n    );\n    let isValid = true;\n    LoadingBar.init(\n      `Validating paths registered to \"${inModuleName}\"...`,\n      entries.length\n    );\n    for (let entry of entries) {\n      const result = await entry.validate();\n      LoadingBar.incrementProgress();\n      isValid = !(!result || !isValid);\n    }\n    if (!isValid) {\n      ui.notifications.error(\n        `Validation of paths registered to \"${inModuleName}\" failed! Errors logged in console.`\n      );\n    } else {\n      ui.notifications.info(\n        `Validation of paths registered to \"${inModuleName}\" complete! No errors found!`\n      );\n    }\n  }\n\n  /**\n   *  Quickly checks if the entry exists in the database\n   *\n   * @param  {string}      inString    The entry to find in the database\n   * @return {boolean}                 If the entry exists in the database\n   */\n  entryExists(inString) {\n    if (typeof inString !== \"string\")\n      return this._throwError(\"entryExists\", \"inString must be of type string\");\n    inString = inString.trim();\n    if (inString === \"\")\n      return this._throwError(\"entryExists\", \"inString cannot be empty\");\n    inString = inString.replace(/\\[[0-9]+]$/, \"\");\n    return this.flattenedEntries.find((entry) => entry.startsWith(inString));\n  }\n\n  /**\n   *  Gets the entry in the database by a dot-notated string\n   *\n   * @param  {string}                     inString        The entry to find in the database\n   * @param  {boolean}                    softFail        Whether it should soft fail (no error) when no entry was found\n   * @return {array|SequencerFile|boolean}                The found entry in the database, or false if not found (with warning)\n   */\n  getEntry(inString, { softFail = false } = {}) {\n    if (typeof inString !== \"string\") {\n      if (softFail) return false;\n      return this._throwError(\"getEntry\", \"inString must be of type string\");\n    }\n    inString = inString.trim();\n    if (inString === \"\") {\n      if (softFail) return false;\n      return this._throwError(\"getEntry\", \"inString cannot be empty\");\n    }\n    inString = inString.replace(/\\[[0-9]+]$/, \"\");\n    if (!this.entryExists(inString)) {\n      if (softFail) return false;\n      return this._throwError(\n        \"getEntry\",\n        `Could not find ${inString} in database`\n      );\n    }\n\n    let ft = false;\n    let index = false;\n    if (CONSTANTS.FEET_REGEX.test(inString)) {\n      ft = inString.match(CONSTANTS.FEET_REGEX)[0];\n      const split = inString.split(ft).filter((str) => str !== \"\");\n      if (split.length > 1) {\n        index = split[1].split(\".\")[0];\n      }\n      inString = split[0];\n    }\n\n    const module = inString.split(\".\")[0];\n    const exactEntries = this.entries[module].filter((entry) => {\n      return entry.dbPath === inString;\n    });\n\n    let filteredEntries = (\n      exactEntries.length\n        ? exactEntries\n        : this.entries[module].filter((entry) => {\n          return entry.dbPath.startsWith(inString);\n        })\n    ).map((entry) => {\n      let foundFile = entry;\n      if (ft) foundFile = entry.file?.[ft] ?? foundFile;\n      if (index) foundFile = foundFile?.[index] ?? foundFile;\n      return foundFile;\n    });\n\n    if (!filteredEntries.length)\n      return this._throwError(\n        \"getEntry\",\n        `Could not find ${inString} in database`\n      );\n\n    const foundEntry =\n      filteredEntries.length === 1 ? filteredEntries[0] : filteredEntries;\n\n    if (index && filteredEntries.length === 1) {\n      foundEntry.fileIndex = Number(index);\n    }\n\n    return foundEntry;\n  }\n\n  /**\n   *  Gets all files under a database path\n   *\n   * @param  {string}         inDBPath    The module to get all files from\n   * @return {array|boolean}                  The found entries in the database under the module's name, or false if not found (with warning)\n   */\n  getAllFileEntries(inDBPath) {\n    if (typeof inDBPath !== \"string\")\n      return this._throwError(\n        \"getAllFileEntries\",\n        \"inDBPath must be of type string\"\n      );\n    inDBPath = inDBPath.trim();\n    if (inDBPath === \"\")\n      return this._throwError(\"getAllFileEntries\", \"inDBPath cannot be empty\");\n    if (!this.entryExists(inDBPath))\n      return this._throwError(\n        \"getAllFileEntries\",\n        `Could not find ${inDBPath} in database`\n      );\n    const entries = this._recurseGetFilePaths(inDBPath);\n    return lib.make_array_unique(entries.flat());\n  }\n\n  /**\n   *  Get all valid entries under a certain path\n   *\n   * @param  {string}             inPath      The database path to get entries under\n   * @return {array|boolean}                  An array containing the next layer of valid paths\n   */\n  getPathsUnder(\n    inPath,\n    {\n      ranges = false,\n      arrays = false,\n      match = false,\n      fullyQualified = false,\n    } = {}\n  ) {\n    if (typeof inPath !== \"string\")\n      return this._throwError(\"getPathsUnder\", \"inPath must be of type string\");\n    inPath = inPath.trim();\n    if (inPath === \"\")\n      return this._throwError(\"getPathsUnder\", \"inPath cannot be empty\");\n    inPath = inPath.replace(/\\[[0-9]+]$/, \"\");\n    if (!this.entryExists(inPath))\n      return this._throwError(\n        \"getPathsUnder\",\n        `Could not find ${inPath} in database`\n      );\n    const entries = this.flattenedEntries.filter((e) => {\n      return (\n        (e.startsWith(inPath + \".\") || e === inPath) &&\n        (!match || (match && e.match(match)))\n      );\n    });\n    if (entries.length === 0) return [];\n    return lib.make_array_unique(\n      entries\n        .map((e) => (!arrays ? e.split(CONSTANTS.ARRAY_REGEX)[0] : e))\n        .map((e) => (!ranges ? e.split(CONSTANTS.FEET_REGEX)[0] : e))\n        .map((e) => (!fullyQualified ? e.split(inPath)[1] : e))\n        .map((e) => (!fullyQualified ? (e ? e.split(\".\")[1] : \"\") : e))\n        .filter(Boolean)\n    );\n  }\n\n  /**\n   *  Get all valid entries under a certain path\n   *\n   * @param  {string}             inPath          The database path to search for\n   * @param  {boolean}            publicOnly      Whether to only search for public modules\n   * @return {array|boolean}                      An array containing potential database paths\n   */\n  searchFor(inPath, publicOnly = true) {\n    const modules = publicOnly ? this.publicModules : Object.keys(this.entries);\n    const originalEntries = publicOnly\n      ? this.publicFlattenedEntries\n      : this.flattenedEntries;\n\n    if ((!inPath || inPath === \"\") && !modules.includes(inPath)) return modules;\n\n    if (typeof inPath !== \"string\") {\n      return this._throwError(\"searchFor\", \"inString must be of type string\");\n    }\n\n    inPath = inPath.trim();\n\n    if (inPath === \"\")\n      return this._throwError(\"searchFor\", \"inString cannot be empty\");\n\n    inPath = inPath.replace(/\\[[0-9]+]$/, \"\");\n    inPath = inPath.trim();\n\n    let entries = originalEntries.filter(\n      (e) => e.startsWith(inPath) && e !== inPath\n    );\n\n    if (inPath.endsWith(\".\")) inPath = inPath.substring(0, inPath.length - 1);\n    let length = inPath.split(\".\").length + 1;\n    let foundEntries = entries.map((e) => {\n      let path = e.split(CONSTANTS.FEET_REGEX)[0];\n      return path.split(\".\").slice(0, length).join(\".\");\n    });\n\n    if (foundEntries.length === 0) {\n      const regexString = lib\n        .str_to_search_regex_str(inPath)\n        .replace(/\\s+/g, \"|\");\n      const searchParts = regexString.split(\"|\").length;\n      const regexSearch = new RegExp(regexString, \"gu\");\n      foundEntries = originalEntries\n        .filter((e) => {\n          return e.match(regexSearch)?.length >= searchParts;\n        })\n        .map((e) => {\n          return e.split(CONSTANTS.FEET_REGEX)[0];\n        });\n    }\n\n    return lib.make_array_unique(foundEntries);\n  }\n\n  /**\n   * Throws an error without THROWING one. Duh.\n   *\n   * @param inFunctionName\n   * @param inError\n   * @returns {boolean}\n   * @private\n   */\n  _throwError(inFunctionName, inError) {\n    let error = `Sequencer | Database | ${inFunctionName} - ${inError}`;\n    ui.notifications.error(error);\n    return false;\n  }\n\n  /**\n   * Gets all file paths from the entirety of\n   *\n   * @param inDBPath\n   * @returns {Array}\n   * @private\n   */\n  _recurseGetFilePaths(inDBPath) {\n    const module = inDBPath.split(\".\")[0];\n    return this.entries[module]\n      .filter((entry) => entry.dbPath.startsWith(inDBPath))\n      .map((entry) => {\n        return entry.getAllFiles();\n      })\n      .flat();\n  }\n\n  /**\n   * Flattens a given object to just their db path and file path\n   *\n   * @param entries\n   * @param inModule\n   * @private\n   */\n  _flatten(entries, inModule) {\n    let flattened = lib.flatten_object(\n      foundry.utils.duplicate({ [inModule]: entries })\n    );\n    this.flattenedEntries = lib.make_array_unique(\n      this.flattenedEntries.concat(\n        Object.keys(flattened).map((file) => file.split(\".file\")[0])\n      )\n    );\n    this.flattenedEntriesAdvanced = lib.make_array_unique(\n      this.flattenedEntriesAdvanced.concat(\n        Object.entries(flattened).map(([path, file]) => ({\n          path: path.split(\".file\")[0],\n          file,\n          isAudio: file.endsWith(\"ogg\")\n            || file.endsWith(\"mp3\")\n            || file.endsWith(\"wav\")\n        }))\n      )\n    );\n    this.inverseFlattenedEntries = Object.keys(flattened).reduce(\n      (acc, entry) => {\n        return acc.set(flattened[entry], entry.split(\".file\")[0]);\n      },\n      this.inverseFlattenedEntries\n    );\n  }\n\n  /**\n   * Processes and recurse into a large object containing file paths at any given depth\n   *\n   * @param moduleName\n   * @param entries\n   * @returns {object}\n   * @private\n   */\n  _processEntries(moduleName, entries) {\n    const allPaths = new Set(\n      this.flattenedEntries\n        .filter((e) => e.split(\".\")[0] === moduleName)\n        .map((e) => e.split(CONSTANTS.FEET_REGEX)[0])\n    );\n\n    const allTemplates = foundry.utils.mergeObject(entries?._templates ?? {}, {\n      default: [100, 0, 0],\n    });\n\n    if (entries?._templates) {\n      delete entries?._templates;\n    }\n\n    const moduleEntries = [];\n\n    const mediaFileExtensions = Object.keys(CONST.FILE_CATEGORIES.IMAGE)\n      .concat(Object.keys(CONST.FILE_CATEGORIES.VIDEO))\n      .concat(Object.keys(CONST.FILE_CATEGORIES.AUDIO))\n      .concat(['json']);\n\n    for (let wholeDBPath of allPaths) {\n      let metadata = this._getCleanData(entries);\n      let dbPath = wholeDBPath.split(\".\");\n      dbPath.shift();\n      let combinedPath = \"\";\n      for (let part of dbPath) {\n        combinedPath = combinedPath ? combinedPath + \".\" + part : part;\n        const entry = foundry.utils.getProperty(entries, combinedPath);\n        if (Array.isArray(entry) || typeof entry === \"string\" || entry?.file) {\n          metadata = this._getCleanData(entry, { existingData: metadata });\n          break;\n        }\n        metadata = this._getCleanData(entry, { existingData: metadata });\n      }\n\n      if (!metadata.template) metadata.template = \"default\";\n      if (typeof metadata.template === \"string\") {\n        metadata.template =\n          allTemplates?.[metadata.template] ?? allTemplates?.[\"default\"];\n      }\n\n      let data = foundry.utils.getProperty(entries, dbPath.join(\".\"));\n      if (!Array.isArray(data) && !(typeof data === \"string\")) {\n        data = this._getCleanData(data, { metadata: false });\n      }\n\n      if (typeof data === \"string\") {\n        const existingEntry = this.entryExists(data);\n        const extension = data\n          .split(\".\")\n        [data.split(\".\").length - 1].toLowerCase();\n\n        if (\n          !existingEntry &&\n          extension &&\n          !mediaFileExtensions.includes(extension)\n        ) {\n          console.warn(\n            `Sequencer | Database | registerEntries - failed to register ${wholeDBPath} to ${data}!`\n          );\n          this.flattenedEntries.splice(\n            this.flattenedEntries.indexOf(wholeDBPath),\n            1\n          );\n          continue;\n        } else if (existingEntry) {\n          const sequencerFile = this.getEntry(data);\n          const clone = sequencerFile.clone();\n          clone.dbPath = wholeDBPath;\n          clone.metadata = foundry.utils.mergeObject(\n            clone.metadata ?? {},\n            metadata ?? {}\n          );\n          moduleEntries.push(clone);\n          continue;\n        }\n      }\n\n      moduleEntries.push(SequencerFileBase.make(data, wholeDBPath, metadata));\n    }\n\n    return moduleEntries;\n  }\n\n  _getCleanData(data, { existingData = {}, metadata = true } = {}) {\n    data = Object.entries(data).filter((entry) => {\n      return metadata === entry[0].startsWith(\"_\");\n    });\n    if (metadata) {\n      data = data.map((entry) => [entry[0].slice(1), entry[1]]);\n    }\n    return foundry.utils.mergeObject(existingData, Object.fromEntries(data));\n  }\n}\n\nconst SequencerDatabase = new Database();\n\nexport default SequencerDatabase;\n","<script>\r\n\r\n  import { databaseStore } from \"./DatabaseStore.js\";\r\n  import { localize } from '#runtime/util/i18n';\r\n\r\n  export let data;\r\n\r\n  const searchRegex = databaseStore.searchRegex;\r\n\r\n  let flashFilePath = false;\r\n  let flashDBPath = false;\r\n\r\n  $: highlight = data.path.replace(\r\n    $searchRegex,\r\n    \"<mark>$&</mark>\"\r\n  );\r\n\r\n</script>\r\n\r\n<div class=\"database-entry\" style=\"margin-left:{data.depth * 15}px;\">\r\n\t<div class=\"database-entry-text-container\">\r\n\t\t{#if data.hasChildren}\r\n\t\t\t<a on:click={(e) => {\r\n\t\t\t\tdatabaseStore.openTreePath(data.fullPath, !data.open, e.ctrlKey);\r\n\t\t\t}}>\r\n\t\t\t\t<i class=\"fas\" class:fa-angle-down={data.open} class:fa-angle-right={!data.open}></i>\r\n\t\t\t</a>\r\n\t\t{/if}\r\n\t\t{#if data.fullPath.includes(\".\")}\r\n\t\t\t{#if !data.hasChildren}\r\n\t\t\t\t<a class=\"database-entry-button\" title=\"{localize('SEQUENCER.Database.CopyFilePath')}\" on:click={(e) => {\r\n\t\t\t\t\tdatabaseStore.copyPath(data.fullPath, true, e.ctrlKey)\r\n\t\t\t\t\tflashFilePath = true;\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\tflashFilePath = false\r\n\t\t\t\t\t}, 400);\r\n\t\t\t\t}}>\r\n\t\t\t\t\t<i class=\"fas fa-file\" class:flash-it={flashFilePath}></i>\r\n\t\t\t\t</a>\r\n\t\t\t{/if}\r\n\t\t\t<a class=\"database-entry-button\" title=\"{localize('SEQUENCER.Database.CopyDatabasePath')}\" on:click={(e) => {\r\n\t\t\t\tdatabaseStore.copyPath(data.fullPath, false, e.ctrlKey)\r\n\t\t\t\tflashDBPath = true;\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tflashDBPath = false\r\n\t\t\t\t}, 400);\r\n\t\t\t}}>\r\n\t\t\t\t<i class=\"fas fa-database\" class:flash-it={flashDBPath}></i>\r\n\t\t\t</a>\r\n\t\t\t<a class=\"database-entry-button\" title=\"{localize('SEQUENCER.Database.PlayPreview')}\" on:click={() => {\r\n\t\t\t\tdatabaseStore.playFile(data.fullPath)\r\n\t\t\t}}>\r\n\t\t\t\t<i class=\"fas fa-play\"></i>\r\n\t\t\t</a>\r\n\t\t{/if}\r\n\t\t<div class=\"database-entry-text\" title=\"{data.path}\">\r\n\t\t\t<div class=\"database-entry-text-highlight\">{@html highlight}</div>\r\n\t\t\t{data.path}\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n\r\n<style lang=\"scss\">\r\n\r\n  .database-entry {\r\n    flex: 1 0 auto;\r\n\r\n    .database-entry-text-container {\r\n      flex: 1;\r\n      display: flex;\r\n      align-items: center;\r\n\r\n      .database-entry-button {\r\n        padding: 0 0 0 3px;\r\n        font-size: 0.7rem;\r\n        line-height: normal;\r\n        cursor: pointer;\r\n      }\r\n\r\n      a {\r\n        display: flex;\r\n        align-items: center;\r\n        justify-content: center;\r\n        max-width: 15px;\r\n      }\r\n\r\n      a > i {\r\n        flex: 0 0 15px;\r\n        min-width: 15px;\r\n      }\r\n    }\r\n  }\r\n\r\n  .database-entry > button > i {\r\n    font-size: 0.7rem;\r\n  }\r\n\r\n  .sub-leaves {\r\n    padding-left: 1rem;\r\n    padding-bottom: 0.25rem;\r\n    display: flex;\r\n    flex-direction: column;\r\n  }\r\n\r\n  .database-entry-text {\r\n    position: relative;\r\n    margin-left: 5px;\r\n  }\r\n\r\n  .database-entry-text-highlight {\r\n    pointer-events: none;\r\n    color: transparent;\r\n    position: absolute;\r\n    top: 0;\r\n    left: 0;\r\n    width: 100%;\r\n    height: 100%;\r\n    overflow: hidden;\r\n  }\r\n\r\n  .flash-it {\r\n    -webkit-animation: flash linear 400ms forwards;\r\n    animation: flash linear 400ms forwards;\r\n  }\r\n\r\n  @keyframes flash {\r\n    0% {\r\n      opacity: 1;\r\n    }\r\n    25% {\r\n      opacity: .1;\r\n    }\r\n    50% {\r\n      opacity: 1;\r\n    }\r\n    75% {\r\n      opacity: .1;\r\n    }\r\n    100% {\r\n      opacity: 1;\r\n    }\r\n  }\r\n</style>\r\n","<script>\r\n\texport let data;\r\n</script>\r\n\r\n<div style=\"margin-bottom: 0.3rem;\"></div>\r\n","import SequencerFileCache from \"../../modules/sequencer-file-cache\";\n\nconst viewSize = 320;\nlet animatedSprite;\nlet offscreenApp;\nlet canvas;\nlet offscreenCanvas;\nlet oldImageSrcs = new Map();\n\nfunction initOffscreenApp(databaseStore) {\n\tif (offscreenApp) {\n\t\treturn;\n\t}\n\tcanvas = document.createElement(\"canvas\");\n\tcanvas.style.display = \"none\";\n\toffscreenCanvas = canvas.transferControlToOffscreen();\n\tconst backgroundColor = \n\toffscreenApp = new PIXI.Application({ autoStart: false, view: offscreenCanvas, backgroundColor: 0x999999, sharedTicker: false });\n\toffscreenApp.ticker.stop();\n\t// worker thread would be nice, but then we would need the webworker version of pixi.js too...\n\tdocument.body.appendChild(canvas);\n\t// workaround to fix errors when destroying the offscreen app\n\toffscreenCanvas.style = {}\n\toffscreenCanvas.width = viewSize;\n\toffscreenCanvas.height = viewSize;\n}\n\nexport async function playSpritesheet(file, databaseStore) {\n\tinitOffscreenApp(databaseStore);\n\tconst sheet = await SequencerFileCache.loadFile(file);\n\tif (!sheet) {\n\t\treturn;\n\t}\n\tSequencerFileCache.registerSpritesheet(file, sheet);\n\tconst frames = Object.values(sheet.animations)?.[0];\n\tif (!frames) {\n\t\treturn;\n\t}\n\tconst framerate = sheet.data?.meta?.framerate ?? 30;\n\tconst frametime = (1 / framerate) * 1000;\n\tdatabaseStore.metadata.set({\n\t\ttype: \"Spritesheet\",\n\t\tduration: Math.round(frametime * frames.length) + \"ms\",\n\t});\n\tif (!animatedSprite) {\n\t\tanimatedSprite = new PIXI.AnimatedSprite(frames, true);\n\t\tanimatedSprite.anchor.set(0.5);\n\t\tanimatedSprite.x = viewSize / 2;\n\t\tanimatedSprite.y = viewSize / 2;\n\t\toffscreenApp.stage.addChild(animatedSprite);\n\t}\n\tlet queuedFrame;\n\tlet renderedFrame;\n\tanimatedSprite.onFrameChange = async (frame) => {\n\t\t// rendering operation is async. If we're currently still rendering\n\t\t// the previous frame, don't even try to render the current one\n\t\tif (queuedFrame !== renderedFrame) {\n\t\t\treturn;\n\t\t}\n\t\tlet curerntImageSrc = oldImageSrcs.get(frame);\n\t\tif (!curerntImageSrc) {\n\t\t\tqueuedFrame = frame;\n\t\t\toffscreenApp.render()\n\t\t\tconst imageBlob = await offscreenCanvas.convertToBlob();\n\t\t\tcurerntImageSrc = URL.createObjectURL(imageBlob);\n\t\t\toldImageSrcs.set(frame, curerntImageSrc);\n\t\t\trenderedFrame = frame;\n\t\t}\n\t\tdatabaseStore.elements.image.src = curerntImageSrc;\n\t};\n\tanimatedSprite.textures = frames;\n\tanimatedSprite.scale.set(viewSize / Math.max(frames[0].width, frames[0].height));\n\tanimatedSprite.file = file;\n\tanimatedSprite.play();\n}\n\nexport async function cleanupSpritesheet(destroy = false) {\n\tif (!animatedSprite) {\n\t\treturn;\n\t}\n\tanimatedSprite.stop();\n\tanimatedSprite.onFrameChange = null;\n\tif (animatedSprite.file) {\n\t\tawait SequencerFileCache.unloadSpritesheet(animatedSprite.file);\n\t\tanimatedSprite.file = null;\n\t}\n\n\toldImageSrcs.values().forEach((objectUrl) => {\n\t\tURL.revokeObjectURL(objectUrl);\n\t});\n\toldImageSrcs.clear();\n\tif (destroy) {\n\t\tanimatedSprite.destroy();\n\t\tanimatedSprite = null;\n\t\toffscreenApp.destroy();\n\t\tcanvas.remove()\n\t\toffscreenCanvas = null;\n\t\toffscreenApp = undefined;\n\t}\n}\n","import { get, writable } from \"svelte/store\";\nimport CONSTANTS from \"../../constants.js\";\nimport * as lib from \"../../lib/lib.js\";\nimport SequencerDatabase from \"../../modules/sequencer-database.js\";\nimport { SequencerFileBase } from \"../../modules/sequencer-file.js\";\nimport TreeViewEntry from \"./TreeViewEntry.svelte\";\nimport TreeViewSeparator from \"./TreeViewSeparator.svelte\";\nimport { cleanupSpritesheet, playSpritesheet } from \"./renderSpritesheet.js\";\n\nlet lastFile = false;\n\nfunction getFileData(entryText) {\n  let entry = SequencerDatabase.getEntry(entryText);\n\n  if (Array.isArray(entry)) {\n    if (entry.includes(lastFile) && entry.length > 1) {\n      entry.splice(entry.indexOf(lastFile), 1);\n    }\n    entry = lib.random_array_element(entry);\n    lastFile = entry;\n  }\n\n  let previewFile = entry?.file ?? entry;\n  if (entry instanceof SequencerFileBase) {\n    previewFile = entry.clone().getPreviewFile(entryText);\n  }\n\n  let lowerCaseEntry = previewFile ? previewFile.toLowerCase() : \"unknown.jpg\";\n\n  const isAudio =\n    lowerCaseEntry.endsWith(\"ogg\") ||\n    lowerCaseEntry.endsWith(\"mp3\") ||\n    lowerCaseEntry.endsWith(\"wav\");\n  const isSpritesheet = lowerCaseEntry.endsWith(\"json\");\n  const isImage = !lowerCaseEntry.endsWith(\"webm\") && !isAudio && !isSpritesheet;\n  const isVideo = !isAudio && !isImage && !isSpritesheet;\n  const icon = previewFile\n    ? isVideo || isSpritesheet\n      ? \"fa-film\"\n      : isAudio\n        ? \"fa-volume-high\"\n        : \"fa-image\"\n    : \"fa-question-mark\";\n  const title = previewFile\n    ? isVideo\n      ? \"Animated WebM\"\n      : isSpritesheet\n        ? \"Spritesheet\"\n        : isAudio\n          ? \"Audio\"\n          : \"Image\"\n    : \"Unknown\";\n\n  return {\n    file: previewFile ?? \"unknown.jpg\",\n    dbEntry: entry,\n    icon,\n    title,\n    isAudio,\n    isImage,\n    isSpritesheet,\n    isVideo,\n  };\n}\n\nfunction copyPath(dbPath, getFilepath, quotes = false) {\n  const tempInput = document.createElement(\"input\");\n  tempInput.value = `${dbPath}`;\n\n  let entry;\n  if (getFilepath) {\n    entry = Sequencer.Database.getEntry(dbPath);\n    if (Array.isArray(entry)) {\n      entry = lib.random_array_element(entry);\n    }\n    if (entry instanceof SequencerFileBase) {\n      const specificFt = dbPath.match(CONSTANTS.FEET_REGEX);\n      if (specificFt) {\n        const ft = specificFt[0].replaceAll(\".\", \"\");\n        entry = entry.getFile(ft);\n      } else {\n        const files = entry.getAllFiles();\n        if (Array.isArray(files)) {\n          const index = Math.floor(lib.interpolate(0, files.length - 1, 0.5));\n          entry = files[index];\n        }\n      }\n    }\n\n    tempInput.value = `${entry?.file ?? entry}`;\n  }\n\n  if (quotes) {\n    tempInput.value = `\"${tempInput.value}\"`;\n  }\n\n  document.body.appendChild(tempInput);\n  tempInput.select();\n  document.execCommand(\"copy\");\n  document.body.removeChild(tempInput);\n  document.execCommand(\"copy\");\n}\n\nasync function playFile(entry) {\n  await cleanupSpritesheet()\n  const { file, isAudio, isImage, isVideo, isSpritesheet } = getFileData(entry);\n  databaseStore.elements.audio.classList.toggle(\"hidden\", !isAudio);\n  databaseStore.elements.image.classList.toggle(\"hidden\", !isImage && !isSpritesheet);\n  databaseStore.elements.player.classList.toggle(\"hidden\", !isVideo);\n\n  if (isImage) {\n    databaseStore.elements.image.src = file;\n    databaseStore.metadata.set({\n      type: \"Image\",\n      duration: \"n/a\",\n    });\n    return;\n  }\n\n  if (isSpritesheet) {\n    playSpritesheet(file, databaseStore);\n    return;\n  }\n\n  const element = isAudio\n    ? databaseStore.elements.audio\n    : databaseStore.elements.player;\n\n  element.onerror = () => {\n    const error = `Sequencer Database Viewer | Could not play file: ${file}`;\n    ui.notifications.error(error);\n    console.error(error);\n  };\n\n  element.oncanplay = () => {\n    element.play();\n  };\n\n  element.onloadedmetadata = () => {\n    databaseStore.metadata.set({\n      type: isVideo ? \"Video\" : isAudio ? \"Audio\" : \"Image\",\n      duration: isImage ? \"n/a\" : element.duration * 1000 + \"ms\",\n    });\n  };\n\n  element.src = file;\n}\n\n\nconst treeStore = writable({});\nconst visibleTreeStore = writable([]);\nlet flattenedEntries = [];\nconst entriesStore = SequencerDatabase.entriesStore;\nconst packStore = writable(SequencerDatabase.publicModules);\nconst selectedPackStore = writable(\"all\");\nconst searchStore = writable(\"\");\nconst cleanSearchStore = writable(\"\");\nconst searchRegexStore = writable(new RegExp(\"\", \"gu\"));\n\nSequencerDatabase.entriesStore.subscribe(() => {\n  packStore.set(SequencerDatabase.publicModules);\n});\n\nconst databaseStore = {\n  metadata: writable(false),\n  allRanges: writable(false),\n  fileTypes: writable(\"all\"),\n  subLists: writable(false),\n  listView: writable(false),\n  packStore: packStore,\n  selectedPackStore: selectedPackStore,\n  visibleTreeStore: visibleTreeStore,\n  search: searchStore,\n  cleanSearchStore: cleanSearchStore,\n  searchRegex: searchRegexStore,\n  elements: {},\n  cleanupSpritesheet() { cleanupSpritesheet(true) },\n  copyPath,\n  playFile,\n  openTreePath,\n};\n\nentriesStore.subscribe(() => {\n  filterFlattenedEntries();\n});\n\ndatabaseStore.allRanges.subscribe(() => {\n  filterFlattenedEntries();\n});\n\ndatabaseStore.subLists.subscribe(() => {\n  filterFlattenedEntries();\n});\n\ndatabaseStore.selectedPackStore.subscribe(() => {\n  filterFlattenedEntries();\n});\n\nsearchStore.subscribe((val) => {\n  const cleanSearch = lib.str_to_search_regex_str(val).replace(/\\s+/g, \"|\");\n  cleanSearchStore.set(cleanSearch);\n  searchRegexStore.set(new RegExp(cleanSearch, \"gu\"));\n  updateVisualTree();\n});\n\nfunction filterFlattenedEntries() {\n  const selectedPack = get(selectedPackStore);\n  const search = get(searchStore);\n  const searchRegex = get(searchRegexStore);\n  const subLists = get(databaseStore.subLists);\n  const allRanges = get(databaseStore.allRanges);\n  flattenedEntries = lib.make_array_unique(\n    SequencerDatabase.publicFlattenedEntries\n      .filter((e) => {\n        return (\n          (selectedPack === \"all\" || e.startsWith(selectedPack + \".\")) &&\n          (!search || e.match(searchRegex))\n        );\n      })\n      .map((e) => (!subLists ? e.split(CONSTANTS.ARRAY_REGEX)[0] : e))\n      .map((e) => (!allRanges ? e.split(CONSTANTS.FEET_REGEX)[0] : e))\n  );\n  treeStore.set(\n    flattenedEntries.reduce((acc, entry) => {\n      let path = \"\";\n      for (const part of entry.split(\".\")) {\n        const fullPath = path ? path + \".\" + part : part;\n        path = path ? path + \".children.\" + part : part;\n        if (!foundry.utils.getProperty(acc, path)) {\n          foundry.utils.setProperty(\n            acc,\n            path,\n            foundry.utils.mergeObject(\n              {\n                path: part,\n                fullPath,\n                open: false,\n                children: {},\n              },\n              foundry.utils.getProperty(acc, path)\n            )\n          );\n        }\n      }\n      return acc;\n    }, {})\n  );\n}\n\nfunction openTreePath(fullPath, open, openAll = false) {\n  treeStore.update((tree) => {\n    const fullTreePath = fullPath.split(\".\").join(\".children.\");\n    const node = foundry.utils.getProperty(tree, fullTreePath);\n    foundry.utils.setProperty(tree, fullTreePath + \".open\", open);\n    if ((!open || openAll) && !foundry.utils.isEmpty(node.children)) {\n      recurseOpenTree(node.children, open);\n    }\n    return tree;\n  });\n}\n\nfunction recurseOpenTree(children, open) {\n  for (const node of Object.values(children)) {\n    node.open = open;\n    if (!foundry.utils.isEmpty(node.children)) {\n      recurseOpenTree(node.children, open);\n    }\n  }\n}\n\ntreeStore.subscribe(() => {\n  updateVisualTree();\n});\n\nfunction updateVisualTree() {\n  const tree = get(treeStore);\n  const visibleTree = recurseTree(tree)\n    .deepFlatten()\n    .filter((e) => e.visible);\n  visibleTreeStore.set(visibleTree);\n}\n\nfunction recurseTree(tree, path = \"\", depth = 0) {\n  const search = get(searchStore);\n  const searchRegex = get(searchRegexStore);\n  const searchParts = get(cleanSearchStore).split(\"|\");\n  return Object.entries(tree).map(([key, data]) => {\n    const fullPath = path ? path + \".\" + key : key;\n\n    const children = recurseTree(\n      data.children,\n      fullPath,\n      depth + 1\n    ).deepFlatten();\n\n    const matchParts = lib.make_array_unique(fullPath.match(searchRegex) || []);\n    const open =\n      data.open ||\n      (search &&\n        (matchParts.length >= searchParts.length ||\n          children.filter((e) => e.visible).length));\n    let visible = !search || matchParts.length >= searchParts.length;\n\n    if (visible) {\n      children.forEach((e) => (e.visible = true));\n    } else {\n      visible = children.filter((e) => e.visible).length;\n    }\n\n    const entry = {\n      class: TreeViewEntry,\n      path: key,\n      fullPath: fullPath,\n      open,\n      visible,\n      hasChildren: !foundry.utils.isEmpty(data.children),\n      depth,\n    };\n\n    const leaf = [entry];\n    if ((data.open || entry.open) && entry.hasChildren) {\n      leaf.push(...children, {\n        fullPath: foundry.utils.randomID(),\n        class: TreeViewSeparator,\n      });\n    }\n    return leaf;\n  });\n}\n\nexport { databaseStore };\n","<script>\r\n\r\n\r\n  import { createEventDispatcher } from \"svelte\";\r\n  import { databaseStore } from \"./DatabaseStore.js\";\r\n  import { localize } from '#runtime/util/i18n';\r\n\r\n  const dispatch = createEventDispatcher();\r\n\r\n\texport let entry;\r\n\r\n  const searchRegex = databaseStore.searchRegex;\r\n\r\n  let flashFilePath = false;\r\n  let flashDBPath = false;\r\n\r\n  $: highlight = entry.replace(\r\n    $searchRegex,\r\n\t\t\"<mark>$&</mark>\"\r\n\t);\r\n\r\n</script>\r\n\r\n<div\r\n\tclass=\"database-entry\"\r\n\tdata-id=\"{entry}\"\r\n>\r\n\t<button type=\"button\" class=\"btn_play\" title=\"{localize('SEQUENCER.Database.PlayPreview')}\" on:click={() => {\r\n    databaseStore.playFile(entry)\r\n  }}>\r\n\t\t<i class=\"fas fa-play\"></i>\r\n\t</button>\r\n\t<button type=\"button\" class=\"btn_copy_filepath\" title=\"{localize('SEQUENCER.Database.CopyFilePath')}\" on:click={(e) => {\r\n    databaseStore.copyPath(entry, true, e.ctrlKey)\r\n    flashFilePath = true;\r\n    setTimeout(() => {\r\n      flashFilePath = false\r\n    }, 400);\r\n    }}>\r\n\t\t<i class:flash-it={flashFilePath} class=\"fas fa-file\"></i>\r\n\t</button>\r\n\t<button type=\"button\" class=\"btn_copy_databasepath\" title=\"{localize('SEQUENCER.Database.CopyDatabasePath')}\" on:click={(e) => {\r\n    databaseStore.copyPath(entry, false, e.ctrlKey)\r\n    flashDBPath = true;\r\n    setTimeout(() => {\r\n      flashDBPath = false\r\n    }, 400);\r\n  }}>\r\n\t\t<i class:flash-it={flashDBPath} class=\"fas fa-database\"></i>\r\n\t</button>\r\n\r\n\t<div class=\"database-entry-text\" title=\"{entry}\">\r\n\t\t<div class=\"database-entry-text-highlight\">{@html highlight}</div>\r\n\t\t{entry}\r\n\t</div>\r\n</div>\r\n\r\n<style lang=\"scss\">\r\n\r\n  .database-entry{\r\n    display:flex;\r\n    flex: 1 0 auto;\r\n  }\r\n\r\n  select, input {\r\n    color: black !important;\r\n    background: rgba(255, 255, 255, 0.5) !important;\r\n    margin-right: 0.25rem;\r\n  }\r\n\r\n  .database-entry > button{\r\n    flex: 0;\r\n\t\tpadding: 0 0 0 3px;\r\n    font-size: 0.7rem !important;\r\n    min-height: 20px;\r\n    max-height: 20px;\r\n    min-width: 20px;\r\n    max-width: 20px;\r\n    line-height: normal;\r\n    margin-right: 2px !important;\r\n  }\r\n\r\n  .database-entry > button > i {\r\n    font-size: 0.7rem;\r\n  }\r\n\r\n  .btn_play * {\r\n    pointer-events: none;\r\n  }\r\n\r\n  .btn_copy_filepath, .btn_copy_databasepath{\r\n    min-width: 1.5rem;\r\n    padding: 0;\r\n  }\r\n\r\n  .database-entry > div{\r\n    flex: 1;\r\n    line-height:1.25rem;\r\n  }\r\n\r\n  .database-entry-text {\r\n    position: relative;\r\n\t\tmargin-left: 5px;\r\n  }\r\n\r\n  .database-entry-text-highlight {\r\n    pointer-events: none;\r\n    color: transparent;\r\n    position: absolute;\r\n    top: 0;\r\n    left: 0;\r\n    width: 100%;\r\n    height: 100%;\r\n    overflow: hidden;\r\n  }\r\n\r\n  .flash-it {\r\n    -webkit-animation: flash linear 400ms forwards;\r\n    animation: flash linear 400ms forwards;\r\n  }\r\n\r\n  @keyframes flash {\r\n    0% {\r\n      opacity: 1;\r\n    }\r\n    25% {\r\n      opacity: .1;\r\n    }\r\n    50% {\r\n      opacity: 1;\r\n    }\r\n    75% {\r\n      opacity: .1;\r\n    }\r\n    100% {\r\n      opacity: 1;\r\n    }\r\n  }\r\n\r\n</style>\r\n","/**\n * virtual list core calculating center\n */\n\nconst DIRECTION_TYPE = {\n    FRONT: \"FRONT\", // scroll up or left\n    BEHIND: \"BEHIND\", // scroll down or right\n}\nconst CALC_TYPE = {\n    INIT: \"INIT\",\n    FIXED: \"FIXED\",\n    DYNAMIC: \"DYNAMIC\",\n}\nconst LEADING_BUFFER = 2\n\nexport default class {\n    param\n    callUpdate\n    firstRangeTotalSize = 0\n    firstRangeAverageSize = 0\n    lastCalcIndex = 0\n    fixedSizeValue = 0\n    calcType = CALC_TYPE.INIT\n    offset = 0\n    direction = \"\"\n    range\n\n    constructor(param, callUpdate) {\n        this.init(param, callUpdate)\n    }\n\n    init(param, callUpdate) {\n        // param data\n        this.param = param\n        this.callUpdate = callUpdate\n\n        // size data\n        this.sizes = new Map()\n        this.firstRangeTotalSize = 0\n        this.firstRangeAverageSize = 0\n        this.fixedSizeValue = 0\n        this.calcType = CALC_TYPE.INIT\n\n        // scroll data\n        this.offset = 0\n        this.direction = \"\"\n\n        // range data\n        this.range = Object.create(null)\n        if (param) {\n            this.checkRange(0, param.keeps - 1)\n        }\n\n        // benchmark example data\n        // this.__bsearchCalls = 0\n        // this.__getIndexOffsetCalls = 0\n    }\n\n    destroy() {\n        this.init(null, null)\n    }\n\n    // return current render range\n    getRange() {\n        const range = Object.create(null)\n        range.start = this.range.start\n        range.end = this.range.end\n        range.padFront = this.range.padFront\n        range.padBehind = this.range.padBehind\n        return range\n    }\n\n    isBehind() {\n        return this.direction === DIRECTION_TYPE.BEHIND\n    }\n\n    isFront() {\n        return this.direction === DIRECTION_TYPE.FRONT\n    }\n\n    // return start index offset\n    getOffset(start) {\n        return (start < 1 ? 0 : this.getIndexOffset(start)) + this.param.slotHeaderSize\n    }\n\n    updateParam(key, value) {\n        if (this.param && (key in this.param)) {\n            // if uniqueIds change, find out deleted id and remove from size map\n            if (key === \"uniqueIds\") {\n                this.sizes.forEach((v, key) => {\n                    if (!value.includes(key)) {\n                        this.sizes.delete(key)\n                    }\n                })\n            }\n            this.param[key] = value\n        }\n    }\n\n    // save each size map by id\n    saveSize(id, size) {\n        this.sizes.set(id, size)\n\n        // we assume size type is fixed at the beginning and remember first size value\n        // if there is no size value different from this at next coming saving\n        // we think it's a fixed size list, otherwise is dynamic size list\n        if (this.calcType === CALC_TYPE.INIT) {\n            this.fixedSizeValue = size\n            this.calcType = CALC_TYPE.FIXED\n        } else if (this.calcType === CALC_TYPE.FIXED && this.fixedSizeValue !== size) {\n            this.calcType = CALC_TYPE.DYNAMIC\n            // it's no use at all\n            delete this.fixedSizeValue\n        }\n\n        // calculate the average size only in the first range\n        if (this.calcType !== CALC_TYPE.FIXED && typeof this.firstRangeTotalSize !== \"undefined\") {\n            if (this.sizes.size < Math.min(this.param.keeps, this.param.uniqueIds.length)) {\n                this.firstRangeTotalSize = [...this.sizes.values()].reduce((acc, val) => acc + val, 0)\n                this.firstRangeAverageSize = Math.round(this.firstRangeTotalSize / this.sizes.size)\n            } else {\n                // it's done using\n                delete this.firstRangeTotalSize\n            }\n        }\n    }\n\n    // in some special situation (e.g. length change) we need to update in a row\n    // try going to render next range by a leading buffer according to current direction\n    handleDataSourcesChange() {\n        let start = this.range.start\n\n        if (this.isFront()) {\n            start = start - LEADING_BUFFER\n        } else if (this.isBehind()) {\n            start = start + LEADING_BUFFER\n        }\n\n        start = Math.max(start, 0)\n\n        this.updateRange(this.range.start, this.getEndByStart(start))\n    }\n\n    // when slot size change, we also need force update\n    handleSlotSizeChange() {\n        this.handleDataSourcesChange()\n    }\n\n    // calculating range on scroll\n    handleScroll(offset) {\n        this.direction = offset < this.offset ? DIRECTION_TYPE.FRONT : DIRECTION_TYPE.BEHIND\n        this.offset = offset\n\n        if (!this.param) {\n            return\n        }\n\n        if (this.direction === DIRECTION_TYPE.FRONT) {\n            this.handleFront()\n        } else if (this.direction === DIRECTION_TYPE.BEHIND) {\n            this.handleBehind()\n        }\n    }\n\n    // ----------- public method end -----------\n\n    handleFront() {\n        const overs = this.getScrollOvers()\n        // should not change range if start doesn't exceed overs\n        if (overs > this.range.start) {\n            return\n        }\n\n        // move up start by a buffer length, and make sure its safety\n        const start = Math.max(overs - this.param.buffer, 0)\n        this.checkRange(start, this.getEndByStart(start))\n    }\n\n    handleBehind() {\n        const overs = this.getScrollOvers()\n        // range should not change if scroll overs within buffer\n        if (overs < this.range.start + this.param.buffer) {\n            return\n        }\n\n        this.checkRange(overs, this.getEndByStart(overs))\n    }\n\n    // return the pass overs according to current scroll offset\n    getScrollOvers() {\n        // if slot header exist, we need subtract its size\n        const offset = this.offset - this.param.slotHeaderSize\n        if (offset <= 0) {\n            return 0\n        }\n\n        // if is fixed type, that can be easily\n        if (this.isFixedType()) {\n            return Math.floor(offset / this.fixedSizeValue)\n        }\n\n        let low = 0\n        let middle = 0\n        let middleOffset = 0\n        let high = this.param.uniqueIds.length\n\n        while (low <= high) {\n            // this.__bsearchCalls++\n            middle = low + Math.floor((high - low) / 2)\n            middleOffset = this.getIndexOffset(middle)\n\n            if (middleOffset === offset) {\n                return middle\n            } else if (middleOffset < offset) {\n                low = middle + 1\n            } else if (middleOffset > offset) {\n                high = middle - 1\n            }\n        }\n\n        return low > 0 ? --low : 0\n    }\n\n    // return a scroll offset from given index, can efficiency be improved more here?\n    // although the call frequency is very high, its only a superposition of numbers\n    getIndexOffset(givenIndex) {\n        if (!givenIndex) {\n            return 0\n        }\n\n        let offset = 0\n        let indexSize = 0\n        for (let index = 0; index < givenIndex; index++) {\n            // this.__getIndexOffsetCalls++\n            indexSize = this.sizes.get(this.param.uniqueIds[index])\n            offset = offset + (typeof indexSize === \"number\" ? indexSize : this.getEstimateSize())\n        }\n\n        // remember last calculate index\n        this.lastCalcIndex = Math.max(this.lastCalcIndex, givenIndex - 1)\n        this.lastCalcIndex = Math.min(this.lastCalcIndex, this.getLastIndex())\n\n        return offset\n    }\n\n    // is fixed size type\n    isFixedType() {\n        return this.calcType === CALC_TYPE.FIXED\n    }\n\n    // return the real last index\n    getLastIndex() {\n        return this.param.uniqueIds.length - 1\n    }\n\n    // in some conditions range is broke, we need correct it\n    // and then decide whether need update to next range\n    checkRange(start, end) {\n        const keeps = this.param.keeps\n        const total = this.param.uniqueIds.length\n\n        // data less than keeps, render all\n        if (total <= keeps) {\n            start = 0\n            end = this.getLastIndex()\n        } else if (end - start < keeps - 1) {\n            // if range length is less than keeps, correct it base on end\n            start = end - keeps + 1\n        }\n\n        if (this.range.start !== start) {\n            this.updateRange(start, end)\n        }\n    }\n\n    // setting to a new range and rerender\n    updateRange(start, end) {\n        this.range.start = start\n        this.range.end = end\n        this.range.padFront = this.getPadFront()\n        this.range.padBehind = this.getPadBehind()\n        this.callUpdate(this.getRange())\n    }\n\n    // return end base on start\n    getEndByStart(start) {\n        const theoryEnd = start + this.param.keeps - 1\n        const truelyEnd = Math.min(theoryEnd, this.getLastIndex())\n        return truelyEnd\n    }\n\n    // return total front offset\n    getPadFront() {\n        if (this.isFixedType()) {\n            return this.fixedSizeValue * this.range.start\n        } else {\n            return this.getIndexOffset(this.range.start)\n        }\n    }\n\n    // return total behind offset\n    getPadBehind() {\n        const end = this.range.end\n        const lastIndex = this.getLastIndex()\n\n        if (this.isFixedType()) {\n            return (lastIndex - end) * this.fixedSizeValue\n        }\n\n        // if it's all calculated, return the exactly offset\n        if (this.lastCalcIndex === lastIndex) {\n            return this.getIndexOffset(lastIndex) - this.getIndexOffset(end)\n        } else {\n            // if not, use a estimated value\n            return (lastIndex - end) * this.getEstimateSize()\n        }\n    }\n\n    // get the item estimate size\n    getEstimateSize() {\n        return this.isFixedType() ? this.fixedSizeValue : (this.firstRangeAverageSize || this.param.estimateSize)\n    }\n}\n\nexport function isBrowser() {\n    return typeof document !== \"undefined\"\n}","<script>\n    import {afterUpdate, createEventDispatcher, onDestroy, onMount} from \"svelte\"\n\n    export let horizontal = false\n    export let uniqueKey\n    export let type = \"item\"\n\n    let resizeObserver\n    let itemDiv\n    let previousSize\n\n    const dispatch = createEventDispatcher()\n    const shapeKey = horizontal ? \"offsetWidth\" : \"offsetHeight\"\n\n    onMount(() => {\n        if (typeof ResizeObserver !== \"undefined\") {\n            resizeObserver = new ResizeObserver(dispatchSizeChange)\n            resizeObserver.observe(itemDiv)\n        }\n    })\n    afterUpdate(dispatchSizeChange)\n    onDestroy(() => {\n        if (resizeObserver) {\n            resizeObserver.disconnect()\n            resizeObserver = null\n        }\n    })\n\n    function dispatchSizeChange() {\n        const size = itemDiv ? itemDiv[shapeKey] : 0\n        if (size === previousSize) return\n        previousSize = size\n        dispatch(\"resize\", {id: uniqueKey, size, type})\n    }\n</script>\n\n<div bind:this={itemDiv} class=\"virtual-scroll-item\">\n    <slot/>\n</div>\n","<script>\n    import Virtual, {isBrowser} from \"./virtual\"\n    import Item from \"./Item.svelte\"\n    import {createEventDispatcher, onDestroy, onMount} from \"svelte\"\n\n    /**\n     * Unique key for getting data from `data`\n     * @type {string}\n     */\n    export let key = \"id\"\n    /**\n     * Source for list\n     * @type {Array<any>}\n     */\n    export let data\n    /**\n     * Count of rendered items\n     * @type {number}\n     */\n    export let keeps = 30\n    /**\n     * Estimate size of each item, needs for smooth scrollbar\n     * @type {number}\n     */\n    export let estimateSize = 50\n    /**\n     * Scroll direction\n     * @type {boolean}\n     */\n    export let isHorizontal = false\n    /**\n     * scroll position start index\n     */\n    export let start = 0\n    /**\n     * scroll position offset\n     */\n    export let offset = 0\n    /**\n     * Let virtual list using global document to scroll through the list\n     * @type {boolean}\n     */\n    export let pageMode = false\n    /**\n     * The threshold to emit `top` event, attention to multiple calls.\n     * @type {number}\n     */\n    export let topThreshold = 0\n    /**\n     * The threshold to emit `bottom` event, attention to multiple calls.\n     * @type {number}\n     */\n    export let bottomThreshold = 0\n\n    let displayItems = []\n    let paddingStyle\n    let directionKey = isHorizontal ? \"scrollLeft\" : \"scrollTop\"\n    let range = null\n    let virtual = new Virtual({\n        slotHeaderSize: 0,\n        slotFooterSize: 0,\n        keeps: keeps,\n        estimateSize: estimateSize,\n        buffer: Math.round(keeps / 3), // recommend for a third of keeps\n        uniqueIds: getUniqueIdFromDataSources(),\n    }, onRangeChanged)\n    let root\n    let shepherd\n    const dispatch = createEventDispatcher()\n\n    /**\n     * @type {(id: number) => number}\n     */\n    export function getSize(id) {\n        return virtual.sizes.get(id)\n    }\n\n    /**\n     * Count of items\n     * @type {() => number}\n     */\n    export function getSizes() {\n        return virtual.sizes.size\n    }\n\n    /**\n     * @type {() => number}\n     */\n    export function getOffset() {\n        if (pageMode && isBrowser()) {\n            return document.documentElement[directionKey] || document.body[directionKey]\n        } else {\n            return root ? Math.ceil(root[directionKey]) : 0\n        }\n    }\n\n    /**\n     * @type {() => number}\n     */\n    export function getClientSize() {\n        const key = isHorizontal ? \"clientWidth\" : \"clientHeight\"\n        if (pageMode && isBrowser()) {\n            return document.documentElement[key] || document.body[key]\n        } else {\n            return root ? Math.ceil(root[key]) : 0\n        }\n    }\n\n    /**\n     * @type {() => number}\n     */\n    export function getScrollSize() {\n        const key = isHorizontal ? \"scrollWidth\" : \"scrollHeight\"\n        if (pageMode && isBrowser()) {\n            return document.documentElement[key] || document.body[key]\n        } else {\n            return root ? Math.ceil(root[key]) : 0\n        }\n    }\n\n    /**\n     * @type {() => void}\n     */\n    export function updatePageModeFront() {\n        if (root && isBrowser()) {\n            const rect = root.getBoundingClientRect()\n            const {defaultView} = root.ownerDocument\n            const offsetFront = isHorizontal ? (rect.left + defaultView.pageXOffset) : (rect.top + defaultView.pageYOffset)\n            virtual.updateParam(\"slotHeaderSize\", offsetFront)\n        }\n    }\n\n    /**\n     * @type {(offset: number) => void}\n     */\n    export function scrollToOffset(offset) {\n        if (!isBrowser()) return\n        if (pageMode) {\n            document.body[directionKey] = offset\n            document.documentElement[directionKey] = offset\n        } else if (root) {\n            root[directionKey] = offset\n        }\n    }\n\n    /**\n     * @type {(index: number) => void}\n     */\n    export function scrollToIndex(index) {\n        if (index >= data.length - 1) {\n            scrollToBottom()\n        } else {\n            const offset = virtual.getOffset(index)\n            scrollToOffset(offset)\n        }\n    }\n\n    /**\n     * @type {() => void}\n     */\n    export function scrollToBottom() {\n        if (shepherd) {\n            const offset = shepherd[isHorizontal ? \"offsetLeft\" : \"offsetTop\"]\n            scrollToOffset(offset)\n\n            // check if it's really scrolled to the bottom\n            // maybe list doesn't render and calculate to last range,\n            // so we need retry in next event loop until it really at bottom\n            setTimeout(() => {\n                if (getOffset() + getClientSize() + 1 < getScrollSize()) {\n                    scrollToBottom()\n                }\n            }, 3)\n        }\n    }\n\n    onMount(() => {\n        if (start) {\n            scrollToIndex(start)\n        } else if (offset) {\n            scrollToOffset(offset)\n        }\n\n        if (pageMode) {\n            updatePageModeFront()\n\n            document.addEventListener(\"scroll\", onScroll, {\n                passive: false,\n            })\n        }\n    })\n\n    onDestroy(() => {\n        virtual.destroy()\n        if (pageMode && isBrowser()) {\n            document.removeEventListener(\"scroll\", onScroll)\n        }\n    })\n\n    function getUniqueIdFromDataSources() {\n        return data.map((dataSource) => dataSource[key])\n    }\n\n    function onItemResized(event) {\n        const {id, size, type} = event.detail\n        if (type === \"item\")\n            virtual.saveSize(id, size)\n        else if (type === \"slot\") {\n            if (id === \"header\")\n                virtual.updateParam(\"slotHeaderSize\", size)\n            else if (id === \"footer\")\n                virtual.updateParam(\"slotFooterSize\", size)\n\n            // virtual.handleSlotSizeChange()\n        }\n    }\n\n    function onRangeChanged(range_) {\n        range = range_\n        paddingStyle = paddingStyle = isHorizontal ? `0px ${range.padBehind}px 0px ${range.padFront}px` : `${range.padFront}px 0px ${range.padBehind}px`\n        displayItems = data.slice(range.start, range.end + 1)\n    }\n\n    function onScroll(event) {\n        const offset = getOffset()\n        const clientSize = getClientSize()\n        const scrollSize = getScrollSize()\n\n        // \biOS scroll-spring-back behavior will make direction mistake\n        if (offset < 0 || (offset + clientSize > scrollSize) || !scrollSize) {\n            return\n        }\n\n        virtual.handleScroll(offset)\n        emitEvent(offset, clientSize, scrollSize, event)\n    }\n\n    function emitEvent(offset, clientSize, scrollSize, event) {\n        dispatch(\"scroll\", {event, range: virtual.getRange()})\n\n        if (virtual.isFront() && !!data.length && (offset - topThreshold <= 0)) {\n            dispatch(\"top\")\n        } else if (virtual.isBehind() && (offset + clientSize + bottomThreshold >= scrollSize)) {\n            dispatch(\"bottom\")\n        }\n    }\n\n    $: scrollToOffset(offset)\n    $: scrollToIndex(start)\n    $: handleKeepsChange(keeps)\n\n    function handleKeepsChange(keeps) {\n        virtual.updateParam(\"keeps\", keeps)\n        virtual.handleSlotSizeChange()\n    }\n\n    $: handleDataSourcesChange(data)\n\n    async function handleDataSourcesChange(data) {\n        virtual.updateParam(\"uniqueIds\", getUniqueIdFromDataSources())\n        virtual.handleDataSourcesChange()\n    }\n</script>\n\n<div bind:this={root} on:scroll={onScroll} style=\"overflow-y: auto; height: inherit\" class=\"virtual-scroll-root\">\n    {#if $$slots.header}\n        <Item on:resize={onItemResized} type=\"slot\" uniqueKey=\"header\">\n            <slot name=\"header\"/>\n        </Item>\n    {/if}\n    <div style=\"padding: {paddingStyle}\" class=\"virtual-scroll-wrapper\">\n        {#each displayItems as dataItem, dataIndex (dataItem[key])}\n            <Item\n                    on:resize={onItemResized}\n                    uniqueKey={dataItem[key]}\n                    horizontal={isHorizontal}\n                    type=\"item\">\n                <slot data={dataItem} index={dataIndex} />\n            </Item>\n        {/each}\n    </div>\n    {#if $$slots.footer}\n        <Item on:resize={onItemResized} type=\"slot\" uniqueKey=\"footer\">\n            <slot name=\"footer\"/>\n        </Item>\n    {/if}\n    <div bind:this={shepherd} class=\"shepherd\"\n         style=\"width: {isHorizontal ? '0px' : '100%'};height: {isHorizontal ? '100%' : '0px'}\"></div>\n</div>\n","<script>\r\n\r\n\timport { ApplicationShell } from \"#runtime/svelte/component/application\";\r\n  import { localize } from '#runtime/util/i18n';\r\n  import { getContext, onDestroy } from \"svelte\";\r\n\r\n  import DatabaseEntry from \"./DatabaseEntry.svelte\";\r\n  import VirtualScroll from \"svelte-virtual-scroll-list\"\r\n\r\n  import SequencerDatabase from \"../../modules/sequencer-database.js\";\r\n  import { databaseStore } from \"./DatabaseStore.js\";\r\n  import * as lib from \"../../lib/lib.js\";\r\n  import CONSTANTS from \"../../constants.js\";\r\n\r\n  const { application } = getContext(\"#external\");\r\n\r\n  export let elementRoot;\r\n\r\n  let entries = [];\r\n\r\n  let filteredEntries = [];\r\n\r\n  const selectedPackStore = databaseStore.selectedPackStore;\r\n  const packStore = databaseStore.packStore;\r\n  const fileTypes = databaseStore.fileTypes;\r\n  const metadata = databaseStore.metadata;\r\n  const allRanges = databaseStore.allRanges;\r\n  const subLists = databaseStore.subLists;\r\n  const listView = databaseStore.listView;\r\n  const visibleTreeStore = databaseStore.visibleTreeStore;\r\n  const search = databaseStore.search;\r\n  const cleanSearchStore = databaseStore.cleanSearchStore;\r\n  const searchRegex = databaseStore.searchRegex;\r\n  const entriesStore = SequencerDatabase.entriesStore;\r\n\r\n  listView.set(game.settings.get(CONSTANTS.MODULE_NAME, \"db-list-view\"));\r\n\r\n  $: game.settings.set(CONSTANTS.MODULE_NAME, \"db-list-view\", $listView);\r\n\r\n  $: {\r\n    $entriesStore;\r\n    const specificRanges = $allRanges\r\n    ? Sequencer.Database.publicFlattenedEntriesAdvanced\r\n    : Sequencer.Database.publicFlattenedSimpleEntries;\r\n    entries = specificRanges.map(\r\n      (entry) => {\r\n        if (typeof entry === \"string\"){\r\n        return {\r\n          pack: entry.split(\".\")[0],\r\n          entry: entry,\r\n        };\r\n      } else {\r\n        return {\r\n          pack: entry.path.split(\".\")[0],\r\n          entry: entry.path,\r\n          isAudio: entry.isAudio,\r\n        };\r\n        }\r\n      }\r\n    );\r\n  }\r\n\r\n  $: {\r\n    if (!$allRanges) $fileTypes = \"all\"\r\n  }\r\n\r\n  $: {\r\n    const searchParts = $cleanSearchStore.split('|');\r\n    filteredEntries = entries.filter((part) => {\r\n      const matchParts = lib.make_array_unique(part.entry.match($searchRegex) || []);\r\n      return (\r\n        ($selectedPackStore === \"all\" || $selectedPackStore === part.pack) &&\r\n        ($search === \"\" || matchParts.length >= searchParts.length) &&\r\n        (\r\n          $fileTypes === \"all\"\r\n          || ($fileTypes === \"video\" && !part.isAudio)\r\n          || ($fileTypes === \"sound\" && part.isAudio)\r\n        )\r\n      );\r\n    });\r\n  }\r\n\r\n  onDestroy(() => databaseStore.cleanupSpritesheet());\r\n</script>\r\n\r\n<svelte:options accessors={true}/>\r\n\r\n<ApplicationShell bind:elementRoot>\r\n\r\n\t<div class=\"sequencer-database-content\">\r\n\r\n\t\t<div class=\"sequencer-database-header\">\r\n\t\t\t<select bind:value={$selectedPackStore} name=\"pack-select\">\r\n\t\t\t\t<option value=\"all\">{localize(\"SEQUENCER.Database.AllPacks\")}</option>\r\n\t\t\t\t{#each $packStore as pack, index}\r\n\t\t\t\t\t<option>{ pack }</option>\r\n\t\t\t\t{/each}\r\n\t\t\t</select>\r\n      <select name=\"file-select\" disabled={!$allRanges} title={$allRanges ? \"\" : localize(\"SEQUENCER.Database.FileTypePredicate\")} bind:value={$fileTypes}>\r\n\t\t\t\t<option value=\"all\">{localize(\"SEQUENCER.Database.All\")}</option>\r\n\t\t\t\t<option value=\"video\">{localize(\"SEQUENCER.Database.Video\")}</option>\r\n\t\t\t\t<option value=\"sound\">{localize(\"SEQUENCER.Database.Sound\")}</option>\r\n\t\t\t</select>\r\n\t\t\t<input bind:value={$search} class=\"ml-2\" placeholder='{localize(\"SEQUENCER.Database.Search\")}' type=\"text\">\r\n\t\t\t<input bind:checked={$allRanges} class=\"ml-2\" id=\"database-all-ranges\" type=\"checkbox\">\r\n\t\t\t<label class=\"all-ranges-label\" for=\"database-all-ranges\">{localize(\"SEQUENCER.Database.ShowAllRanges\")}</label>\r\n\t\t\t<input bind:checked={$subLists} class=\"ml-2\" id=\"include-sub-lists\" type=\"checkbox\">\r\n\t\t\t<label class=\"all-ranges-label\" for=\"include-sub-lists\">{localize(\"SEQUENCER.Database.ShowSubLists\")}</label>\r\n\t\t\t<input bind:checked={$listView} class=\"ml-2\" id=\"treeview\" type=\"checkbox\">\r\n\t\t\t<label class=\"all-ranges-label\" for=\"treeview\">{localize(\"SEQUENCER.Database.ListView\")}</label>\r\n\t\t</div>\r\n\r\n\t\t<div class=\"sequencer-database-entries-container\">\r\n\r\n\t\t\t{#if $listView}\r\n        <div class=\"sequencer-database-entries\">\r\n          <VirtualScroll\r\n            data={filteredEntries}\r\n            key=\"entry\"\r\n            let:data\r\n          >\r\n            <DatabaseEntry entry={data.entry}/>\r\n          </VirtualScroll>\r\n        </div>\r\n\t\t\t{:else}\r\n        <div class=\"sequencer-database-entries-tree\">\r\n          <VirtualScroll\r\n            data={$visibleTreeStore}\r\n            key=\"fullPath\"\r\n            let:data\r\n          >\r\n            <svelte:component this={data.class} {data}/>\r\n          </VirtualScroll>\r\n        </div>\r\n\t\t\t{/if}\r\n\r\n\t\t\t<div class=\"sequencer-database-player-container\">\r\n        <div class=\"sequencer-database-player-content\">\r\n\t\t\t\t<video autoplay bind:this={databaseStore.elements.player} class=\"database-player\" height=\"335\" loop\r\n\t\t\t\t\t\t\t on:mouseenter={() => { databaseStore.elements.player.controls = true; }}\r\n\t\t\t\t\t\t\t on:mouseleave={() => { databaseStore.elements.player.controls = false; }}\r\n\t\t\t\t\t\t\t preload\r\n\t\t\t\t\t\t\t width=\"335\"\r\n\t\t\t\t>\r\n\t\t\t\t</video>\r\n\t\t\t\t<img bind:this={databaseStore.elements.image} class=\"database-image hidden\">\r\n\t\t\t\t<audio controls autoplay bind:this={databaseStore.elements.audio} class=\"database-audio hidden\">\r\n\t\t\t\t\t<source type=\"audio\">\r\n\t\t\t\t</audio>\r\n      </div>\r\n\t\t\t\t<div class=\"sequencer-database-metadata-footer\">\r\n\t\t\t\t\t{#if $metadata}\r\n\t\t\t\t\t\tType: {$metadata.type} | Duration: {$metadata.duration}\r\n\t\t\t\t\t{:else}\r\n\t\t\t\t\t\tNo file loaded...\r\n\t\t\t\t\t{/if}\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\r\n\t\t</div>\r\n\r\n\t</div>\r\n\r\n</ApplicationShell>\r\n\r\n<style lang=\"scss\">\r\n\r\n  .sequencer-database {\r\n    &-content {\r\n      display: flex;\r\n      flex-direction: column;\r\n    }\r\n\r\n    &-header {\r\n      display: flex;\r\n      align-items: center;\r\n      flex-direction: row;\r\n\r\n      > select {\r\n\t\t\t\tflex: 0 1 auto;\r\n        border-radius: 5px 0 0 5px;\r\n        border-right: 0;\r\n        height: 28px;\r\n\r\n        & + select {\r\n          border-radius: 0 0 0 0;\r\n        }\r\n      }\r\n\r\n      > input[type=\"text\"] {\r\n        border-radius: 0 5px 5px 0;\r\n        padding-left: 0.5rem;\r\n        height: 28px;\r\n      }\r\n\r\n\t\t\t> label {\r\n\t\t\t\tflex: 1 0 auto;\r\n        padding-right: 0.25rem;\r\n\t\t\t}\r\n    }\r\n\r\n    &-entries-container {\r\n      padding-top: 0.5rem;\r\n      max-height: calc(420px - 5rem);\r\n      display: flex;\r\n    }\r\n\r\n    &-entries {\r\n      height: 339px;\r\n      flex: 1;\r\n      margin-right: 0.5rem;\r\n\r\n\t\t\t& :global(.virtual-scroll-item) {\r\n        padding: 2px;\r\n        margin-right: 5px;\r\n        border-radius: 4px;\r\n      }\r\n\r\n      & :global(.virtual-scroll-item):nth-child(odd) {\r\n        background-color: rgba(0, 0, 0, 0.1);\r\n      }\r\n    }\r\n\r\n    &-entries-tree {\r\n      height: 339px;\r\n      flex: 1;\r\n      margin-right: 0.5rem;\r\n\r\n      & :global(.virtual-scroll-item) {\r\n        padding: 2px;\r\n        margin-right: 5px;\r\n        border-radius: 4px;\r\n        min-height: 0px;\r\n        max-height: 17px;\r\n        height: auto;\r\n      }\r\n    }\r\n\r\n    &-player-container {\r\n      display: flex;\r\n      flex-direction: column;\r\n      align-items: center;\r\n      width: 335px;\r\n      height: 335px;\r\n    }\r\n\r\n    &-player-content {\r\n      display: flex;\r\n      flex: 1;\r\n      height: 100%;\r\n      vertical-align: middle;\r\n\r\n      width: 320px;\r\n      height: 320px;\r\n      max-width: 320px;\r\n      max-height: 320px;\r\n      border-radius: 5px;\r\n    }\r\n\r\n    &-metadata-footer {\r\n      text-align: center;\r\n      margin-top: 5px;\r\n      flex: 0;\r\n    }\r\n  }\r\n\r\n  .hidden {\r\n    display: none;\r\n  }\r\n\r\n  .database-player-container {\r\n    padding: 5px;\r\n    width: 355px;\r\n    height: 355px;\r\n  }\r\n\r\n  .database-player {\r\n    background-color: #999999;\r\n    padding: 10px;\r\n    max-width: 320px;\r\n    height: 320px;\r\n    max-height: 320px;\r\n\t\tmin-height: 320px;\r\n  }\r\n\r\n  .database-image {\r\n    max-width: 320px;\r\n    height: 320px;\r\n    max-height: 320px;\r\n    min-height: 320px;\r\n  }\r\n\r\n  .database-audio {\r\n    margin: auto;\r\n  }\r\n\r\n</style>\r\n","import { SvelteApplication } from \"#runtime/svelte/application\";\nimport DatabaseShell from \"./database-shell.svelte\";\n\nexport class DatabaseViewerApp extends SvelteApplication {\n  static get defaultOptions() {\n    return foundry.utils.mergeObject(super.defaultOptions, {\n      title: game.i18n.localize(\"SEQUENCER.Database.Title\"),\n      classes: [\"dialog\"],\n      width: 900,\n      height: 425,\n      svelte: {\n        class: DatabaseShell,\n        target: document.body,\n      },\n    });\n  }\n\n  static getActiveApp() {\n    return Object.values(ui.windows).find((app) => {\n      return (\n        app instanceof this && app._state > Application.RENDER_STATES.CLOSED\n      );\n    });\n  }\n\n  static async show(options = {}) {\n    const existingApp = this.getActiveApp();\n    if (existingApp) return existingApp.render(false, { focus: true });\n    return new Promise((resolve) => {\n      options.resolve = resolve;\n      new this(options).render(true, { focus: true });\n    });\n  }\n}\n","<script>\r\n  import { localize } from '#runtime/util/i18n';\r\n  import * as lib from \"/lib/lib.js\"\r\n\r\n  async function openSettings(){\r\n\r\n    const settings = new SettingsConfig();\r\n\r\n    await settings.render(true)\r\n\r\n    await lib.wait(75);\r\n\r\n    const focusElement = settings.element.find('select[name=\"sequencer.permissions-effect-create\"]');\r\n\r\n    settings.element.find(\"div.scrollable\").scrollTop(focusElement.offset().top)\r\n\r\n    await lib.wait(250);\r\n\r\n    focusElement.css(\"box-shadow\", \"rgba(200, 64, 67, 0.75) inset 0 0 10px\");\r\n\r\n    await lib.wait(5000);\r\n\r\n    focusElement.css(\"box-shadow\", \"none\");\r\n\r\n  }\r\n\r\n</script>\r\n\r\n<div class=\"howto-container\">\r\n\t<p>{@html localize(\"SEQUENCER.HowTo.Welcome\")}</p>\r\n\t<p>{@html localize(\"SEQUENCER.HowTo.Explanation\")}</p>\r\n\t{#if game.user.isGM}\r\n\t\t<p>{@html localize(\"SEQUENCER.HowTo.PermissionsExplanation\")}</p>\r\n\t\t<button type=\"button\" class=\"w-100 open-module-settings\" on:click={openSettings}>\r\n\t\t\t<i class=\"fas fa-plug\"></i> {@html localize(\"SEQUENCER.HowTo.OpenModuleSettings\")}\r\n\t\t</button>\r\n\t{/if}\r\n\t<p>{@html localize(\"SEQUENCER.HowTo.PlayerExplanation\")}</p>\r\n\t<p>{@html localize(\"SEQUENCER.HowTo.LayerExplanation\")}</p>\r\n\t<ol>\r\n\t\t<li>\r\n\t\t\t<strong>{@html localize(\"SEQUENCER.HowTo.Click\")}</strong><br>\r\n\t\t\t{@html localize(\"SEQUENCER.HowTo.ClickLabel\")}\r\n\t\t</li>\r\n\t\t<li>\r\n\t\t\t<strong>{@html localize(\"SEQUENCER.HowTo.ClickDrag\")}</strong><br>\r\n\t\t\t{@html localize(\"SEQUENCER.HowTo.ClickDragLabel\")}\r\n\t\t</li>\r\n\t\t<li>\r\n\t\t\t<strong>{@html localize(\"SEQUENCER.HowTo.Shift\")}</strong><br>\r\n\t\t\t{@html localize(\"SEQUENCER.HowTo.ShiftLabel\")}\r\n\t\t</li>\r\n\t\t<li>\r\n\t\t\t<strong>{@html localize(\"SEQUENCER.HowTo.ShiftControl\")}</strong><br>\r\n\t\t\t{@html localize(\"SEQUENCER.HowTo.ShiftControlLabel\")}\r\n\t\t</li>\r\n\t\t<li>\r\n\t\t\t<strong>{@html localize(\"SEQUENCER.HowTo.MoreToCome\")}</strong>\r\n\t\t</li>\r\n\t</ol>\r\n</div>\r\n\r\n<style lang=\"scss\">\r\n\r\n  .howto-container{\r\n    min-width: 320px;\r\n    max-width: 320px;\r\n    min-height: 563px;\r\n\r\n    li{\r\n      list-style: none;\r\n      margin-bottom: 0.5rem;\r\n    }\r\n  }\r\n\r\n</style>\r\n","<script>\r\n  import { localize } from '#runtime/util/i18n';\r\n\r\n  export let activeTab;\r\n  export let tabs;\r\n  export let underscore = false;\r\n  export let separateElements = false;\r\n\r\n</script>\r\n\r\n<nav class=\"tabs\" data-group=\"primary\" style={$$props.style}>\r\n\t{#each tabs.filter(tab => !tab.hidden) as tab, index (tab.value)}\r\n\t\t{#if separateElements && index > 0}\r\n\t\t\t<div style=\"border-right: 1px solid rgba(0,0,0,0.5); margin: 0 10px;\"></div>\r\n\t\t{/if}\r\n\t\t<div on:click={() => { activeTab = tab.value}}\r\n\t\t\t\t class=\"item item-piles-flexrow item-piles-clickable-link\"\r\n\t\t\t\t class:underscore={underscore}\r\n\t\t\t\t class:active={activeTab === tab.value}\r\n\t\t\t\t data-tab=\"rest\">\r\n\t\t\t{#if tab.icon} <i class=\"icon {tab.icon}\"></i> {/if}\r\n\t\t\t{localize(tab.label)}\r\n\t\t</div>\r\n\t{/each}\r\n</nav>\r\n\r\n\r\n<style lang=\"scss\">\r\n\r\n  .tabs {\r\n\t\tflex: 0;\r\n    border-bottom: 1px solid rgba(0, 0, 0, 0.25);\r\n    margin-bottom: 0.5rem;\r\n    padding-bottom: 0.5rem;\r\n  }\r\n\r\n  .item {\r\n    display: flex;\r\n    flex-direction: row;\r\n    align-items: center;\r\n    border-bottom: 2px solid transparent;\r\n\r\n    &.active {\r\n      text-shadow: 0 0 10px rgba(255,0,0,1);\r\n\r\n      &.underscore {\r\n        text-shadow: none;\r\n        border-bottom: 2px solid rgba(125, 0, 0, 0.5);\r\n      }\r\n    }\r\n  }\r\n\r\n  .icon {\r\n    margin-right: 0.25rem;\r\n  }\r\n\r\n</style>\r\n","import { get, writable } from \"svelte/store\";\nimport CONSTANTS from \"../constants.js\";\n\nconst SequenceManager = {\n  VisibleEffects: writable({}),\n  RunningSounds: writable({}),\n  RunningSequences: writable({}),\n};\n\n/* ------------------ Effects ------------------ */\nSequenceManager.VisibleEffects.get = (id) => {\n  return get(SequenceManager.VisibleEffects)[id];\n};\n\nSequenceManager.VisibleEffects.add = (id, data) => {\n  SequenceManager.VisibleEffects.update((effects) => {\n    effects[id] = data;\n    return effects;\n  });\n};\n\nSequenceManager.VisibleEffects.delete = (id) => {\n  SequenceManager.VisibleEffects.update((effects) => {\n    delete effects[id];\n    return effects;\n  });\n};\n\nSequenceManager.VisibleEffects.values = () => {\n  return Object.values(get(SequenceManager.VisibleEffects));\n};\n\n/* ------------------ Sounds ------------------ */\nSequenceManager.RunningSounds.get = (id) => {\n  return get(SequenceManager.RunningSounds)[id];\n};\n\nSequenceManager.RunningSounds.add = (id, data) => {\n  SequenceManager.RunningSounds.update((sounds) => {\n    sounds[id] = data;\n    return sounds;\n  });\n};\n\nSequenceManager.RunningSounds.delete = (id) => {\n  SequenceManager.RunningSounds.update((sounds) => {\n    delete sounds[id];\n    return sounds;\n  });\n};\n\nSequenceManager.RunningSounds.values = () => {\n  return Object.values(get(SequenceManager.RunningSounds));\n};\n\nSequenceManager.RunningSounds.keys = () => {\n  return Object.keys(get(SequenceManager.RunningSounds));\n};\n\n/* ----------------- Sequences ------------------ */\nSequenceManager.RunningSequences.get = (id) => {\n  return get(SequenceManager.RunningSequences)[id];\n};\n\nSequenceManager.RunningSequences.add = (id, sequence) => {\n  SequenceManager.RunningSequences.update((sequences) => {\n    sequences[id] = sequence;\n    return sequences;\n  });\n};\n\nSequenceManager.RunningSequences.delete = (id) => {\n  SequenceManager.RunningSequences.update((sequences) => {\n    delete sequences[id];\n    return sequences;\n  });\n};\n\nSequenceManager.RunningSequences.clearFinishedSequences = () => {\n  SequenceManager.RunningSequences.update((sequences) => {\n    for (const sequence of Object.values(sequences)) {\n      if (\n        sequence.status === CONSTANTS.STATUS.COMPLETE ||\n        sequence.status === CONSTANTS.STATUS.ABORTED\n      ) {\n        delete sequences[sequence.id];\n      }\n    }\n    return sequences;\n  });\n};\n\nSequenceManager.RunningSequences.stopAll = () => {\n  SequenceManager.RunningSequences.update((sequences) => {\n    for (const sequence of Object.values(sequences)) {\n      sequence._abort();\n    }\n    return sequences;\n  });\n};\n\nSequenceManager.RunningSequences.values = () => {\n  return Object.values(get(SequenceManager.RunningSequences));\n};\n\nexport default SequenceManager;\n","export default class ColorMatrixFilter extends globalThis.PIXI.ColorMatrixFilter {\n  /**\n   * Properties & default values:\n   *     - hue [false]\n   *     - brightness [1]\n   *     - contrast [1]\n   *     - saturate [1]\n   */\n  constructor(inData) {\n    super();\n    this.isValid = true;\n    this.values = new Map();\n    for (let [key, value] of Object.entries(inData)) {\n      this.setValue(key, value);\n      if (!this.isValid) break;\n    }\n  }\n\n  setValue(key, value) {\n    try {\n      this.values[key] = value;\n      super[key](value, true);\n    } catch (err) {\n      ui.notifications.warn(\n        `Sequencer | ${this.constructor.name} | Could not set property ${key}`\n      );\n    }\n  }\n\n  get hue() {\n    return this.values?.hue ?? 0\n  }\n  set hue(value) {\n    this.values.hue = value\n    super.hue(value)\n    this.setOthers('hue')\n  }\n\n\n  get contrast() {\n    return this.values?.contrast ?? 0\n  }\n  set contrast(value) {\n    this.values.contrast = value\n    super.contrast(value)\n  }\n\n\n  get brightness() {\n    return this.values?.brightness ?? 0\n  }\n  set brightness(value) {\n    this.values.brightness = value\n    super.brightness(value)\n  }\n\n  get saturate() {\n    return this.values?.saturate ?? 0\n  }\n  set saturate(value) {\n    this.values.saturate = value\n    super.saturate(value)\n  }\n\n  setOthers(ignoreKey) {\n    for (let [key, value] of this.values.entries) {\n      if (key === ignoreKey) continue\n      this.setValue(key, value)\n    }\n  }\n}\n","export default class BlurFilter extends globalThis.PIXI.BlurFilter {\n  /**\n   * Properties & default values:\n   *     - strength [8]\n   *     - blur [2]\n   *     - blurX [2]\n   *     - blurY [2]\n   *     - quality [4]\n   *     - resolution [PIXI.settings.FILTER_RESOLUTION]\n   *     - kernelSize [5]\n   */\n  constructor(inData = {}) {\n    inData = foundry.utils.mergeObject(\n      {\n        strength: 1,\n        quality: 4,\n        resolution: PIXI.settings.FILTER_RESOLUTION,\n        kernelSize: 5,\n      },\n      inData\n    );\n\n    super(...Object.values(inData));\n\n    this.isValid = true;\n    for (let [key, value] of Object.entries(inData)) {\n      try {\n        this[key] = value;\n      } catch (err) {\n        ui.notifications.warn(\n          `Sequencer | ${this.constructor.name} | Could not set property ${key}`\n        );\n        this.isValid = false;\n      }\n    }\n  }\n}\n","export default class NoiseFilter extends globalThis.PIXI.NoiseFilter {\n  /**\n   * Properties & default values:\n   *     - noise [0.5]\n   *     - seed [Math.random()]\n   */\n  constructor(inData = {}) {\n    super();\n\n    inData = foundry.utils.mergeObject(\n      {\n        noise: 0.5,\n        seed: Math.random(),\n      },\n      inData\n    );\n\n    this.isValid = true;\n    for (let [key, value] of Object.entries(inData)) {\n      try {\n        this[key] = value;\n      } catch (err) {\n        ui.notifications.warn(\n          `Sequencer | ${this.constructor.name} | Could not set property ${key}`\n        );\n        this.isValid = false;\n      }\n    }\n  }\n}\n","export default class GlowFilter extends globalThis.PIXI.Filter {\n\n\tstatic defaults = {\n\t\tdistance: 10,\n\t\touterStrength: 4,\n\t\tinnerStrength: 0,\n\t\tcolor: 0xffffff,\n\t\tquality: 0.1,\n\t\tknockout: false,\n\t\talpha: 1,\n\t}\n\n\n\tconstructor(options) {\n\n\t\tconst opts = Object.assign({}, GlowFilter.defaults, options);\n\t\tconst {\n\t\t\touterStrength,\n\t\t\tinnerStrength,\n\t\t\tcolor,\n\t\t\tknockout,\n\t\t\tquality,\n\t\t\talpha\n\t\t} = opts;\n\n\t\tconst distance = Math.round(opts.distance);\n\n\t\tsuper(vertex, frag\n\t\t\t.replace(/__ANGLE_STEP_SIZE__/gi, `${(1 / quality / distance).toFixed(7)}`)\n\t\t\t.replace(/__DIST__/gi, `${distance.toFixed(0)}.0`));\n\n\t\tthis.uniforms.glowColor = new Float32Array([0, 0, 0, 1]);\n\t\tthis.uniforms.alpha = 1;\n\n\t\tObject.assign(this, {\n\t\t\tcolor,\n\t\t\touterStrength,\n\t\t\tinnerStrength,\n\t\t\tpadding: distance,\n\t\t\tknockout,\n\t\t\talpha,\n\t\t});\n\n\t\tthis.isValid = true;\n\t}\n\n\t/**\n\t * The color of the glow.\n\t * @default 0xFFFFFF\n\t */\n\tget color()\n\t{\n\t\treturn PIXI.utils.rgb2hex(this.uniforms.glowColor);\n\t}\n\tset color(value)\n\t{\n\t\tPIXI.utils.hex2rgb(value, this.uniforms.glowColor);\n\t}\n\n\t/**\n\t * The strength of the glow outward from the edge of the sprite.\n\t * @default 4\n\t */\n\tget outerStrength()\n\t{\n\t\treturn this.uniforms.outerStrength;\n\t}\n\tset outerStrength(value)\n\t{\n\t\tthis.uniforms.outerStrength = value;\n\t}\n\n\t/**\n\t * The strength of the glow inward from the edge of the sprite.\n\t * @default 0\n\t */\n\tget innerStrength()\n\t{\n\t\treturn this.uniforms.innerStrength;\n\t}\n\tset innerStrength(value)\n\t{\n\t\tthis.uniforms.innerStrength = value;\n\t}\n\n\t/**\n\t * Only draw the glow, not the texture itself\n\t * @default false\n\t */\n\tget knockout()\n\t{\n\t\treturn this.uniforms.knockout;\n\t}\n\tset knockout(value)\n\t{\n\t\tthis.uniforms.knockout = value;\n\t}\n\n\t/**\n\t * The alpha value of the glow\n\t * @default 1\n\t */\n\tget alpha()\n\t{\n\t\treturn this.uniforms.alpha;\n\t}\n\tset alpha(value)\n\t{\n\t\tthis.uniforms.alpha = value;\n\t}\n}\n\nconst frag = `varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nuniform float outerStrength;\nuniform float innerStrength;\n\nuniform vec4 glowColor;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform bool knockout;\nuniform float alpha;\n\nconst float PI = 3.14159265358979323846264;\n\nconst float DIST = __DIST__;\nconst float ANGLE_STEP_SIZE = min(__ANGLE_STEP_SIZE__, PI * 2.0);\nconst float ANGLE_STEP_NUM = ceil(PI * 2.0 / ANGLE_STEP_SIZE);\n\nconst float MAX_TOTAL_ALPHA = ANGLE_STEP_NUM * DIST * (DIST + 1.0) / 2.0;\n\nvoid main(void) {\n    vec2 px = vec2(1.0 / filterArea.x, 1.0 / filterArea.y);\n\n    float totalAlpha = 0.0;\n\n    vec2 direction;\n    vec2 displaced;\n    vec4 curColor;\n\n    for (float angle = 0.0; angle < PI * 2.0; angle += ANGLE_STEP_SIZE) {\n       direction = vec2(cos(angle), sin(angle)) * px;\n\n       for (float curDistance = 0.0; curDistance < DIST; curDistance++) {\n           displaced = clamp(vTextureCoord + direction * \n                   (curDistance + 1.0), filterClamp.xy, filterClamp.zw);\n\n           curColor = texture2D(uSampler, displaced);\n\n           totalAlpha += (DIST - curDistance) * curColor.a;\n       }\n    }\n    \n    curColor = texture2D(uSampler, vTextureCoord);\n\n    float alphaRatio = (totalAlpha / MAX_TOTAL_ALPHA);\n\n    float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * curColor.a;\n    float innerGlowStrength = min(1.0, innerGlowAlpha);\n    \n    vec4 innerColor = mix(curColor, glowColor, innerGlowStrength);\n\n    float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a);\n    float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);\n\n    if (knockout) {\n      float resultAlpha = (outerGlowAlpha + innerGlowAlpha) * alpha;\n      gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);\n    }\n    else {\n      vec4 outerGlowColor = outerGlowStrength * glowColor.rgba * alpha;\n      gl_FragColor = innerColor + outerGlowColor;\n    }\n}`;\n\nconst vertex = `attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}`;\n","let shader = `\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\nfloat alpha;\n\nvoid main() {\n    vec4 pixel = texture2D(uSampler, vTextureCoord);\n    alpha = smoothstep(0.6,1.0,pixel.a);\n    gl_FragColor = vec4(alpha, alpha, alpha, pixel.a);\n}\n`;\n\nexport default class ClipFilter extends PIXI.Filter {\n  constructor() {\n    super(null, shader);\n  }\n}\n","import ColorMatrixFilter from \"./filters/color-matrix-filter.js\";\nimport BlurFilter from \"./filters/blur-filter.js\";\nimport NoiseFilter from \"./filters/noise-filter.js\";\nimport GlowFilter from \"./filters/glow-filter.js\";\nimport ClipFilter from \"./filters/clip-filter.js\";\n\nconst filters = {\n  ColorMatrix: ColorMatrixFilter,\n  Blur: BlurFilter,\n  Noise: NoiseFilter,\n  Glow: GlowFilter,\n  Clip: ClipFilter,\n};\n\nexport default filters;\n","import FoundryShim from \"../../utils/foundry-shim.js\";\n\nexport default class MaskFilter extends FoundryShim.AbstractBaseFilter {\n  /** @override */\n  static fragmentShader = `\\\n        varying vec2 vTextureCoord;\n\n        uniform sampler2D uSampler;\n        uniform sampler2D uMaskSampler;\n\n        void main(void) {\n            gl_FragColor = texture2D(uSampler, vTextureCoord)\n                * texture2D(uMaskSampler, vTextureCoord).a;\n        }`;\n\n  /** @override */\n  static defaultUniforms = { uMaskSampler: null };\n\n  /** @type {DisplayObject[]|null} */\n  masks = [];\n\n  /** @override */\n  apply(filterManager, input, output, clearMode, currentState) {\n    const maskFilterTexture = filterManager.getFilterTexture();\n    const originalFilterTexture = this.#push(\n      filterManager,\n      currentState,\n      maskFilterTexture\n    );\n    const renderer = filterManager.renderer;\n\n    for (const mask of this.masks) {\n      if (mask?.obj?.destroyed) continue;\n      const renderable = mask.renderable;\n      mask.renderable = true;\n      mask.render(renderer);\n      mask.renderable = renderable;\n    }\n\n    renderer.batch.flush();\n\n    this.#pop(filterManager, currentState, originalFilterTexture);\n    this.uniforms.uMaskSampler = maskFilterTexture;\n    filterManager.applyFilter(this, input, output, clearMode);\n    filterManager.returnFilterTexture(maskFilterTexture);\n  }\n\n  #push(filterManager, currentState, maskFilterTexture) {\n    const originalFilterTexture = currentState.renderTexture;\n\n    currentState.renderTexture = maskFilterTexture;\n    filterManager.defaultFilterStack.push(currentState);\n    filterManager.bindAndClear(maskFilterTexture);\n\n    return originalFilterTexture;\n  }\n\n  #pop(filterManager, currentState, originalFilterTexture) {\n    currentState.renderTexture = originalFilterTexture;\n    filterManager.defaultFilterStack.pop();\n\n    if (filterManager.activeState === currentState) {\n      return;\n    }\n\n    filterManager.activeState = currentState;\n\n    const globalUniforms = filterManager.globalUniforms.uniforms;\n\n    globalUniforms.outputFrame = currentState.sourceFrame;\n    globalUniforms.resolution = currentState.resolution;\n\n    const inputSize = globalUniforms.inputSize;\n    const inputPixel = globalUniforms.inputPixel;\n    const inputClamp = globalUniforms.inputClamp;\n\n    inputSize[0] = currentState.destinationFrame.width;\n    inputSize[1] = currentState.destinationFrame.height;\n    inputSize[2] = 1.0 / inputSize[0];\n    inputSize[3] = 1.0 / inputSize[1];\n\n    inputPixel[0] = Math.round(inputSize[0] * currentState.resolution);\n    inputPixel[1] = Math.round(inputSize[1] * currentState.resolution);\n    inputPixel[2] = 1.0 / inputPixel[0];\n    inputPixel[3] = 1.0 / inputPixel[1];\n\n    inputClamp[0] = 0.5 * inputPixel[2];\n    inputClamp[1] = 0.5 * inputPixel[3];\n    inputClamp[2] =\n      currentState.sourceFrame.width * inputSize[2] - 0.5 * inputPixel[2];\n    inputClamp[3] =\n      currentState.sourceFrame.height * inputSize[3] - 0.5 * inputPixel[3];\n\n    if (currentState.legacy) {\n      const filterArea = globalUniforms.filterArea;\n\n      filterArea[0] = currentState.destinationFrame.width;\n      filterArea[1] = currentState.destinationFrame.height;\n      filterArea[2] = currentState.sourceFrame.x;\n      filterArea[3] = currentState.sourceFrame.y;\n\n      globalUniforms.filterClamp = globalUniforms.inputClamp;\n    }\n\n    filterManager.globalUniforms.update();\n  }\n}\n","import * as lib from \"../lib/lib.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\n\nconst SequencerAnimationEngine = {\n\t_animations: [],\n\t_debug: undefined,\n\t_deltas: [],\n\n\tticker: false,\n\tdt: 0,\n\n\tisRunning: false,\n\n\taddAnimation(origin, attributes = [], timeDifference = 0) {\n\t\tif (!Array.isArray(attributes)) attributes = [attributes];\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis._animations.push({\n\t\t\t\torigin,\n\t\t\t\tattributes: attributes.map((attribute) => {\n\t\t\t\t\tattribute.targetId = lib.get_object_identifier(attribute.target) + \"-\" + attribute.propertyName;\n\t\t\t\t\tattribute.id = foundry.utils.randomID();\n\t\t\t\t\tattribute.started = false;\n\t\t\t\t\tattribute.initialized = false;\n\t\t\t\t\tattribute.finishing = false;\n\t\t\t\t\tattribute.complete = false;\n\t\t\t\t\tattribute.previousValue = null;\n\t\t\t\t\tattribute.progress = 0;\n\t\t\t\t\tattribute.value = 0;\n\t\t\t\t\tattribute.coreValue = 0;\n\t\t\t\t\tattribute.isFunkyProperty = attribute.propertyName.startsWith(\"scale.\");\n\n\t\t\t\t\tattribute.duration = attribute.duration ?? 0;\n\t\t\t\t\tattribute.durationDone = timeDifference ?? 0;\n\n\t\t\t\t\tif (attribute?.looping) {\n\t\t\t\t\t\tattribute.loopDuration = attribute.loopDuration ?? attribute.duration ?? 0;\n\t\t\t\t\t\tattribute.loopDurationDone = timeDifference % attribute.loopDuration ?? 0;\n\t\t\t\t\t\tattribute.loops = attribute.loops ?? 0;\n\t\t\t\t\t\tattribute.loopsDone = Math.floor(\n\t\t\t\t\t\t\tattribute.durationDone / attribute.duration\n\t\t\t\t\t\t);\n\t\t\t\t\t\tattribute.index = attribute.loopsDone % attribute.values.length;\n\t\t\t\t\t\tattribute.nextIndex =\n\t\t\t\t\t\t\t(attribute.loopsDone + 1) % attribute.values.length;\n\t\t\t\t\t\tif (!attribute.pingPong && attribute.nextIndex === 0) {\n\t\t\t\t\t\t\tattribute.index = 0;\n\t\t\t\t\t\t\tattribute.nextIndex = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn attribute;\n\t\t\t\t}),\n\t\t\t\tcomplete: false,\n\t\t\t\ttotalDt: timeDifference,\n\t\t\t\tresolve: resolve,\n\t\t\t});\n\n\t\t\tthis._animations.sort((a, b) => {\n\t\t\t\tconst aNumAbsolute = a.attributes.filter(attr => !attr.complete && attr.absolute).length;\n\t\t\t\tconst bNumAbsolute = b.attributes.filter(attr => !attr.complete && attr.absolute).length;\n\t\t\t\treturn bNumAbsolute - aNumAbsolute;\n\t\t\t});\n\n\t\t\tif (!this.ticker) {\n\t\t\t\tthis.start();\n\t\t\t}\n\n\t\t\tlib.debug(`Added animations to Animation Engine`);\n\t\t});\n\t},\n\n\tendAnimations(target) {\n\t\tthis._animations = this._animations.filter(\n\t\t\t(animation) => animation.origin !== target\n\t\t);\n\t},\n\n\tupdateStartValues(target, propertyName) {\n\t\tconst targetId = lib.get_object_identifier(target) + \"-\" + propertyName;\n\t\tif (targetId in this._coreValues) {\n\t\t\tthis._coreValues[targetId].value = lib.deep_get(target, propertyName);\n\t\t}\n\t},\n\n\tstart() {\n\t\tif (!this.ticker) {\n\t\t\tlib.debug(`Animation Engine Started`);\n\t\t\tthis.ticker = FoundryShim.CanvasAnimation.ticker;\n\t\t\tthis.ticker.add(this.nextFrame.bind(this));\n\t\t}\n\t},\n\n\tnextFrame() {\n\t\tif (this._animations.length === 0) {\n\t\t\tthis._coreValues = {};\n\t\t\treturn;\n\t\t}\n\n\t\tthis._storedValues = {};\n\n\t\tthis._animations.forEach((animation) => this._animate(animation));\n\n\t\tfor (let delta of Object.values(this._storedValues)) {\n\t\t\ttry {\n\t\t\t\tlib.deep_set(delta.target, delta.propertyName, delta.value);\n\t\t\t} catch (err) {\n\t\t\t}\n\t\t}\n\n\t\tthis._animations = this._animations.filter((animation) => !animation.complete);\n\n\t},\n\n\t_coreValues: {},\n\t_storedValues: {},\n\n\t_animate(animation) {\n\t\tanimation.totalDt += this.ticker.elapsedMS;\n\n\t\tanimation.attributes.filter((attribute) => {\n\t\t\treturn !attribute.complete && animation.totalDt >= attribute.delay;\n\t\t}).forEach((attr) => {\n\t\t\tthis._animateAttribute(attr);\n\t\t\tif(attr.finishing){\n\t\t\t\tattr.complete = true;\n\t\t\t\tif (this._coreValues[attr.targetId]) {\n\t\t\t\t\tdelete this._coreValues[attr.targetId];\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tanimation.complete = animation.attributes.filter((attribute) => !attribute.complete).length === 0;\n\n\t\tif (animation.complete) {\n\t\t\tanimation.resolve();\n\t\t}\n\t},\n\n\t_animateAttribute(attribute) {\n\n\t\tif (this._coreValues[attribute.targetId] === undefined) {\n\t\t\tthis._coreValues[attribute.targetId] = {\n\t\t\t\tid: attribute.id,\n\t\t\t\tvalue: lib.deep_get(attribute.target, attribute.propertyName)\n\t\t\t};\n\t\t}\n\n\t\tif (this._storedValues[attribute.targetId] === undefined) {\n\t\t\tthis._storedValues[attribute.targetId] = {\n\t\t\t\tvalue: this._coreValues[attribute.targetId].value,\n\t\t\t\ttarget: attribute.target,\n\t\t\t\tpropertyName: attribute.propertyName,\n\t\t\t\ttargetId: attribute.targetId\n\t\t\t};\n\t\t}\n\n\t\tif (attribute?.looping && attribute?.indefinite) {\n\t\t\tthis._handleIndefiniteLoop(attribute);\n\t\t} else if (attribute?.looping) {\n\t\t\tthis._handleLoops(attribute);\n\t\t} else {\n\t\t\tthis._handleDefault(attribute);\n\t\t}\n\n\t\t// This is absolutely horrendous, but 50% of the time, it works 90% of the time.\n\t\tif (attribute.absolute) {\n\t\t\tthis._coreValues[attribute.targetId].value = attribute.value;\n\t\t\tconst delta = this._coreValues[attribute.targetId].value - this._storedValues[attribute.targetId].value;\n\t\t\tthis._storedValues[attribute.targetId].value += delta;\n\t\t} else {\n\t\t\tif (attribute.isFunkyProperty) {\n\t\t\t\tconst coreValue = this._coreValues[attribute.targetId].value;\n\t\t\t\tattribute.delta = (coreValue * attribute.value) - coreValue;\n\t\t\t\tthis._storedValues[attribute.targetId].value += attribute.delta;\n\t\t\t} else {\n\t\t\t\tthis._storedValues[attribute.targetId].value += attribute.value;\n\t\t\t}\n\t\t}\n\n\t},\n\n\t_handleBaseLoop(attribute) {\n\t\tif (!attribute.initialized) {\n\t\t\tif (attribute.values.length === 1) {\n\t\t\t\tattribute.values.unshift(this._coreValues[attribute.targetId].value);\n\t\t\t}\n\t\t\tattribute.initialized = true;\n\t\t}\n\n\t\tattribute.loopDurationDone += this.ticker.deltaMS;\n\t\tattribute.progress = attribute.loopDurationDone / attribute.loopDuration;\n\n\t\tattribute.value = lib.interpolate(\n\t\t\tattribute.values[attribute.index],\n\t\t\tattribute.values[attribute.nextIndex],\n\t\t\tattribute.progress,\n\t\t\tattribute.ease\n\t\t);\n\n\t\tif (attribute.progress >= 1.0) {\n\t\t\tattribute.loopDurationDone -= attribute.loopDuration;\n\n\t\t\tattribute.index = (attribute.index + 1) % attribute.values.length;\n\t\t\tattribute.nextIndex = (attribute.nextIndex + 1) % attribute.values.length;\n\n\t\t\tif (!attribute.pingPong && attribute.nextIndex === 0) {\n\t\t\t\tattribute.index = 0;\n\t\t\t\tattribute.nextIndex = 1;\n\t\t\t}\n\n\t\t\tattribute.loopsDone++;\n\n\t\t\tattribute.value = lib.interpolate(\n\t\t\t\tattribute.values[attribute.index],\n\t\t\t\tattribute.values[attribute.nextIndex],\n\t\t\t\tattribute.progress % 1.0,\n\t\t\t\tattribute.ease\n\t\t\t);\n\t\t}\n\t},\n\n\t_handleIndefiniteLoop(attribute) {\n\t\treturn this._handleBaseLoop(attribute);\n\t},\n\n\t_handleLoops(attribute) {\n\t\tthis._handleBaseLoop(attribute);\n\n\t\tattribute.durationDone += this.ticker.deltaMS;\n\t\tattribute.overallProgress = attribute.durationDone / attribute.duration;\n\n\t\tif (\n\t\t\tattribute.progress >= 1.0 &&\n\t\t\tattribute.loopsDone === attribute.loops * 2\n\t\t) {\n\t\t\tattribute.finishing = true;\n\t\t\tattribute.value = attribute.values[attribute.index];\n\t\t}\n\n\t\tif (attribute.overallProgress >= 1.0) {\n\t\t\tattribute.finishing = true;\n\t\t}\n\t},\n\n\t_handleDefault(attribute) {\n\t\tif (!attribute.initialized) {\n\t\t\tif (attribute.from === undefined) {\n\t\t\t\tattribute.from = this._coreValues[attribute.targetId].value;\n\t\t\t}\n\t\t\tattribute.initialized = true;\n\t\t}\n\n\t\tattribute.durationDone += this.ticker.deltaMS;\n\t\tattribute.progress = attribute.durationDone / attribute.duration;\n\n\t\tattribute.value = lib.interpolate(\n\t\t\tattribute.from,\n\t\t\tattribute.to,\n\t\t\tlib.clamp(attribute.progress, 0.0, 1.0),\n\t\t\tattribute.ease\n\t\t);\n\n\t\tif (attribute.progress >= 1.0) {\n\t\t\tattribute.value = attribute.to;\n\t\t\tattribute.finishing = true;\n\t\t}\n\t},\n};\n\nexport default SequencerAnimationEngine;\n","import * as lib from \"../lib/lib.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport { sequencerSocket, SOCKET_HANDLERS } from \"../sockets.js\";\nimport CONSTANTS from \"../constants.js\";\n\nconst flagManager = {\n\tflagEffectAddBuffer: new Map(),\n\tflagEffectRemoveBuffer: new Map(),\n\tflagSoundAddBuffer: new Map(),\n\tflagSoundRemoveBuffer: new Map(),\n\t_latestFlagVersion: false,\n\n\tget latestFlagVersion() {\n\t\tif (!this._latestFlagVersion) {\n\t\t\tconst versions = Object.keys(this.effectMigrations);\n\t\t\tversions.sort((a, b) => {\n\t\t\t\treturn foundry.utils.isNewerVersion(a, b) ? -1 : 1;\n\t\t\t});\n\t\t\tthis._latestFlagVersion = versions[0];\n\t\t}\n\t\treturn this._latestFlagVersion;\n\t},\n\n\t/**\n\t * Sanitizes the effect data, accounting for changes to the structure in previous versions\n\t *\n\t * @param inDocument\n\t * @returns {array}\n\t */\n\tgetEffectFlags(inDocument) {\n\t\tlet effects = foundry.utils.getProperty(inDocument, CONSTANTS.EFFECTS_FLAG);\n\n\t\tif (!effects?.length) return [];\n\n\t\teffects = foundry.utils.deepClone(effects);\n\n\t\tconst changes = [];\n\t\tfor (let [effectId, effectData] of effects) {\n\t\t\tlet effectVersion = effectData?.flagVersion ?? \"1.0.0\";\n\n\t\t\tlet changesAdded = false;\n\n\t\t\tif (effectData._id !== effectId) {\n\t\t\t\tchangesAdded = true;\n\t\t\t\teffectData._id = effectId;\n\t\t\t\tchanges.push(effectData);\n\n\t\t\t\tlib.debug(\n\t\t\t\t\t`Fixed effect with broken ID ${effectId}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (effectData.flagVersion === this.latestFlagVersion) continue;\n\n\t\t\tfor (let [version, migration] of Object.entries(this.effectMigrations)) {\n\t\t\t\tif (!foundry.utils.isNewerVersion(version, effectVersion)) continue;\n\n\t\t\t\teffectData = migration(inDocument, effectData);\n\t\t\t}\n\n\t\t\tlib.debug(\n\t\t\t\t`Migrated effect with ID ${effectId} from version ${effectVersion} to version ${this.latestFlagVersion}`,\n\t\t\t);\n\n\t\t\teffectData.flagVersion = this.latestFlagVersion;\n\n\t\t\tif (!changesAdded) changes.push(effectData);\n\t\t}\n\n\t\tif (changes.length) {\n\t\t\tflagManager.addEffectFlags(inDocument.uuid, changes);\n\t\t}\n\n\t\treturn effects;\n\t},\n\n\teffectMigrations: {\n\t\t\"2.0.0\": (inDocument, effectData) => {\n\t\t\teffectData._id = effectData.id;\n\t\t\teffectData.creationTimestamp = effectData.timestamp;\n\n\t\t\tif (effectData.template) {\n\t\t\t\teffectData.template = {\n\t\t\t\t\tgridSize: effectData.template[0],\n\t\t\t\t\tstartPoint: effectData.template[1],\n\t\t\t\t\tendPoint: effectData.template[2],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (effectData.attachTo) {\n\t\t\t\teffectData.attachTo = {\n\t\t\t\t\tactive: true,\n\t\t\t\t\talign: \"center\",\n\t\t\t\t\trotation: true,\n\t\t\t\t\tbindVisibility: true,\n\t\t\t\t\tbindAlpha: true,\n\t\t\t\t};\n\t\t\t\teffectData.source = inDocument.uuid;\n\t\t\t\tconst objectSize = canvaslib.get_object_dimensions(inDocument, true);\n\t\t\t\teffectData.offset = {\n\t\t\t\t\tx: effectData.position.x - objectSize.width,\n\t\t\t\t\ty: effectData.position.y - objectSize.height,\n\t\t\t\t};\n\t\t\t} else if (effectData.position) {\n\t\t\t\teffectData.source = effectData.position;\n\t\t\t}\n\n\t\t\tif (effectData.reachTowards) {\n\t\t\t\teffectData.stretchTo = {\n\t\t\t\t\tattachTo: false,\n\t\t\t\t\tonlyX: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (effectData.filters) {\n\t\t\t\teffectData.filters = Object.entries(effectData.filters).map((entry) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tclassName: entry[0],\n\t\t\t\t\t\t...entry[1],\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}\n\n\t\t\teffectData.moveSpeed = effectData.speed;\n\n\t\t\teffectData.target = null;\n\t\t\teffectData.forcedIndex = null;\n\t\t\teffectData.flipX = false;\n\t\t\teffectData.flipY = false;\n\t\t\teffectData.nameOffsetMap = {};\n\t\t\teffectData.sequenceId = 0;\n\n\t\t\tdelete effectData.id;\n\t\t\tdelete effectData.timestamp;\n\t\t\tdelete effectData.position;\n\t\t\tdelete effectData.reachTowards;\n\t\t\tdelete effectData.speed;\n\t\t\tdelete effectData.audioVolume;\n\t\t\tdelete effectData.gridSizeDifference;\n\t\t\tdelete effectData.template;\n\n\t\t\tif (effectData.animatedProperties) {\n\t\t\t\tdelete effectData.animatedProperties.fadeInAudio;\n\t\t\t\tdelete effectData.animatedProperties.fadeOutAudio;\n\t\t\t}\n\n\t\t\teffectData = foundry.utils.mergeObject(\n\t\t\t\teffectData,\n\t\t\t\teffectData.animatedProperties,\n\t\t\t);\n\n\t\t\tdelete effectData.animatedProperties;\n\n\t\t\treturn effectData;\n\t\t},\n\n\t\t\"2.0.6\": (inDocument, effectData) => {\n\t\t\teffectData.private = null;\n\n\t\t\treturn effectData;\n\t\t},\n\n\t\t\"2.0.8\": (inDocument, effectData) => {\n\t\t\tif (effectData.stretchTo) {\n\t\t\t\teffectData.stretchTo.tiling = false;\n\t\t\t}\n\n\t\t\treturn effectData;\n\t\t},\n\n\t\t\"2.0.9\": (inDocument, effectData) => {\n\t\t\teffectData.tilingTexture = false;\n\n\t\t\tif (effectData.stretchTo?.tiling !== undefined) {\n\t\t\t\tif (effectData.stretchTo.tiling) {\n\t\t\t\t\teffectData.tilingTexture = {\n\t\t\t\t\t\tscale: { x: 1, y: 1 },\n\t\t\t\t\t\tposition: { x: 0, y: 0 },\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdelete effectData.stretchTo.tiling;\n\t\t\t}\n\n\t\t\treturn effectData;\n\t\t},\n\n\t\t\"2.1.0\": (inDocument, effectData) => {\n\t\t\tif (effectData.randomOffset) {\n\t\t\t\teffectData.randomOffset = {\n\t\t\t\t\tsource: !effectData.target ? effectData.randomOffset : false,\n\t\t\t\t\ttarget: !!effectData.target ? effectData.randomOffset : false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (effectData.nameOffsetMap) {\n\t\t\t\tObject.values(effectData.nameOffsetMap).forEach((offsetMap) => {\n\t\t\t\t\tif (offsetMap.randomOffset) {\n\t\t\t\t\t\toffsetMap.randomOffset = {\n\t\t\t\t\t\t\tsource: !offsetMap.target ? offsetMap.randomOffset : false,\n\t\t\t\t\t\t\ttarget: !!offsetMap.target ? offsetMap.randomOffset : false,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn effectData;\n\t\t},\n\n\t\t\"3.2.0\": (inDocument, effectData) => {\n\t\t\tif (effectData.attachTo?.followRotation !== undefined) {\n\t\t\t\teffectData.attachTo.bindRotation = effectData.attachTo.followRotation;\n\t\t\t\tdelete effectData.attachTo.followRotation;\n\t\t\t}\n\t\t\tif (effectData.scaleToObject) {\n\t\t\t\tif (effectData.attachTo?.active) {\n\t\t\t\t\teffectData.attachTo.bindScale = true;\n\t\t\t\t} else if (!effectData.attachTo?.active && !effectData.attachTo?.bindScale) {\n\t\t\t\t\teffectData.scaleToObject = false;\n\t\t\t\t\teffectData.size = canvaslib.get_object_dimensions(inDocument);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn effectData;\n\t\t},\n\n\t\t\"3.2.1\": (inDocument, effectData) => {\n\t\t\tif (effectData.noLoop !== undefined) {\n\t\t\t\teffectData.loopOptions = {\n\t\t\t\t\tloops: 1,\n\t\t\t\t\tloopDelay: 0,\n\t\t\t\t\tendOnLastLoop: false\n\t\t\t\t}\n\t\t\t\tdelete effectData.noLoop;\n\t\t\t}\n\t\t\treturn effectData;\n\t\t}\n\t},\n\n\t/**\n\t * Adds effects to a given document\n\t *\n\t * @param inObjectUUID\n\t * @param inEffects\n\t */\n\taddEffectFlags: (inObjectUUID, inEffects) => {\n\t\tif (!Array.isArray(inEffects)) inEffects = [inEffects];\n\t\tsequencerSocket.executeAsGM(\n\t\t\tSOCKET_HANDLERS.ADD_EFFECT_FLAGS,\n\t\t\tinObjectUUID,\n\t\t\tinEffects,\n\t\t);\n\t},\n\n\t/**\n\t * Removes effects from a given document\n\t *\n\t * @param inObjectUUID\n\t * @param inEffects\n\t * @param removeAll\n\t */\n\tremoveEffectFlags: (inObjectUUID, inEffects, removeAll = false) => {\n\t\tsequencerSocket.executeAsGM(\n\t\t\tSOCKET_HANDLERS.REMOVE_EFFECT_FLAGS,\n\t\t\tinObjectUUID,\n\t\t\tinEffects,\n\t\t\tremoveAll,\n\t\t);\n\t},\n\n\t_addEffectFlags: (inObjectUUID, inEffects) => {\n\t\tif (!Array.isArray(inEffects)) inEffects = [inEffects];\n\n\t\tlet flagsToSet = flagManager.flagEffectAddBuffer.get(inObjectUUID) ?? {\n\t\t\teffects: [],\n\t\t};\n\n\t\tflagsToSet.effects.push(...inEffects);\n\n\t\tflagManager.flagEffectAddBuffer.set(inObjectUUID, flagsToSet);\n\n\t\tflagManager.updateEffectFlags();\n\t},\n\n\t_removeEffectFlags: (inObjectUUID, inEffects, removeAll = false) => {\n\t\tif (inEffects && !Array.isArray(inEffects)) inEffects = [inEffects];\n\n\t\tlet flagsToSet = flagManager.flagEffectRemoveBuffer.get(inObjectUUID) ?? {\n\t\t\teffects: [],\n\t\t\tremoveAll: removeAll,\n\t\t};\n\n\t\tif (inEffects) flagsToSet.effects.push(...inEffects);\n\n\t\tflagManager.flagEffectRemoveBuffer.set(inObjectUUID, flagsToSet);\n\n\t\tflagManager.updateEffectFlags();\n\t},\n\n\tupdateEffectFlags: foundry.utils.debounce(async () => {\n\t\tlet flagsToAdd = Array.from(flagManager.flagEffectAddBuffer);\n\t\tlet flagsToRemove = Array.from(flagManager.flagEffectRemoveBuffer);\n\n\t\tflagManager.flagEffectAddBuffer.clear();\n\t\tflagManager.flagEffectRemoveBuffer.clear();\n\n\t\tflagsToAdd.forEach((entry) => (entry[1].original = true));\n\t\tflagsToRemove.forEach((entry) => (entry[1].original = true));\n\n\t\tconst objects = new Set([\n\t\t\t...flagsToAdd.map((effect) => effect[0]).filter(Boolean),\n\t\t\t...flagsToRemove.map((effect) => effect[0]).filter(Boolean),\n\t\t]);\n\n\t\tflagsToAdd = new Map(flagsToAdd);\n\t\tflagsToRemove = new Map(flagsToRemove);\n\n\t\tconst actorUpdates = {};\n\t\tconst sceneObjectsToUpdate = {};\n\n\t\tfor (let objectUUID of objects) {\n\t\t\tlet object = fromUuidSync(objectUUID);\n\n\t\t\tif (!object) {\n\t\t\t\tlib.debug(\n\t\t\t\t\t`Failed to set flags on non-existent object with UUID: ${objectUUID}`,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst isLinkedToken = object instanceof TokenDocument && object.actorLink;\n\t\t\tconst isLinkedActor = object instanceof Actor && object.prototypeToken.actorLink;\n\n\t\t\tlet toAdd = flagsToAdd.get(objectUUID) ?? { effects: [] };\n\t\t\tlet toRemove = flagsToRemove.get(objectUUID) ?? {\n\t\t\t\teffects: [],\n\t\t\t\tremoveAll: false,\n\t\t\t};\n\n\t\t\tlet origExistingFlags = foundry.utils.getProperty(object, CONSTANTS.EFFECTS_FLAG) ?? [];\n\t\t\tif (isLinkedToken) {\n\t\t\t\torigExistingFlags = origExistingFlags.concat(foundry.utils.getProperty(object.actor, CONSTANTS.EFFECTS_FLAG) ?? []);\n\t\t\t}\n\t\t\tconst existingFlags = new Map(origExistingFlags);\n\n\t\t\tif (toRemove?.removeAll) {\n\t\t\t\ttoRemove.effects = Array.from(existingFlags).map((entry) => entry[0]);\n\t\t\t}\n\n\t\t\tfor (let effect of toAdd.effects) {\n\t\t\t\tif (typeof effect === \"string\") {\n\t\t\t\t\teffect = existingFlags.get(effect);\n\t\t\t\t\tif (!effect) continue;\n\t\t\t\t}\n\t\t\t\texistingFlags.set(effect._id, effect);\n\t\t\t}\n\n\t\t\tfor (let effect of toRemove.effects) {\n\t\t\t\tif (typeof effect === \"string\") {\n\t\t\t\t\teffect = existingFlags.get(effect);\n\t\t\t\t\tif (!effect) continue;\n\t\t\t\t}\n\t\t\t\texistingFlags.delete(effect._id);\n\t\t\t}\n\n\t\t\tlet flagsToSet = Array.from(existingFlags);\n\t\t\tconst options = {};\n\n\t\t\tif (\n\t\t\t\t(isLinkedToken || isLinkedActor) &&\n\t\t\t\t(toAdd.original || toRemove.original)\n\t\t\t) {\n\t\t\t\tconst actor = object?.actor ?? object;\n\t\t\t\tactorUpdates[actor.id] = flagsToSet.filter(\n\t\t\t\t\t(effect) => lib.is_UUID(effect[1]?.source) && effect[1]?.attachTo?.active && effect[1]?.persistOptions?.persistTokenPrototype,\n\t\t\t\t);\n\t\t\t\tflagsToSet = flagsToSet.filter(\n\t\t\t\t\t(effect) => !effect[1]?.persistOptions?.persistTokenPrototype || !lib.is_UUID(effect[1]?.source) || !effect[1]?.attachTo?.active,\n\t\t\t\t);\n\t\t\t\tif (\n\t\t\t\t\tisLinkedToken &&\n\t\t\t\t\tgame.modules.get(\"multilevel-tokens\")?.active &&\n\t\t\t\t\tfoundry.utils.getProperty(object, \"flags.multilevel-tokens.stoken\")\n\t\t\t\t) {\n\t\t\t\t\toptions[\"mlt_bypass\"] = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (object?.documentName === \"Scene\") {\n\t\t\t\tconst sceneId = object.id;\n\t\t\t\tsceneObjectsToUpdate[sceneId] = sceneObjectsToUpdate[sceneId] ?? {\n\t\t\t\t\tupdates: {},\n\t\t\t\t\tdocuments: {},\n\t\t\t\t};\n\t\t\t\tsceneObjectsToUpdate[sceneId].updates[CONSTANTS.EFFECTS_FLAG] = flagsToSet;\n\t\t\t} else if (!(object instanceof Actor) && origExistingFlags.length !== flagsToSet.length) {\n\t\t\t\tconst sceneId = object.parent.id;\n\t\t\t\tconst docName = object.documentName;\n\t\t\t\tsceneObjectsToUpdate[sceneId] = sceneObjectsToUpdate[sceneId] ?? {\n\t\t\t\t\tupdates: {},\n\t\t\t\t\tdocuments: {},\n\t\t\t\t};\n\t\t\t\tsceneObjectsToUpdate[sceneId].documents[docName] = sceneObjectsToUpdate[\n\t\t\t\t\tsceneId\n\t\t\t\t\t].documents[docName] ?? {\n\t\t\t\t\toptions: {},\n\t\t\t\t\tupdates: [],\n\t\t\t\t};\n\t\t\t\tsceneObjectsToUpdate[sceneId].documents[docName].options = options;\n\t\t\t\tsceneObjectsToUpdate[sceneId].documents[docName].updates.push({\n\t\t\t\t\t_id: object.id,\n\t\t\t\t\t[CONSTANTS.EFFECTS_FLAG]: flagsToSet,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tfor (const [sceneId, sceneData] of Object.entries(sceneObjectsToUpdate)) {\n\t\t\tconst scene = game.scenes.get(sceneId);\n\t\t\tif (!foundry.utils.isEmpty(sceneData.updates)) {\n\t\t\t\tawait scene.update(sceneData.updates);\n\t\t\t}\n\t\t\tfor (const [documentType, documentData] of Object.entries(\n\t\t\t\tsceneData.documents,\n\t\t\t)) {\n\t\t\t\tawait scene.updateEmbeddedDocuments(\n\t\t\t\t\tdocumentType,\n\t\t\t\t\tdocumentData.updates,\n\t\t\t\t\tdocumentData.options,\n\t\t\t\t);\n\t\t\t\tlib.debug(\n\t\t\t\t\t`Flags set for documents of type \"${documentType}\" in scene with ID \"${sceneId}\"`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tawait Actor.updateDocuments(\n\t\t\tObject.entries(actorUpdates).map(([actorId, effects]) => ({\n\t\t\t\t_id: actorId,\n\t\t\t\t[CONSTANTS.EFFECTS_FLAG]: effects,\n\t\t\t})),\n\t\t);\n\t}, 250),\n\n\t/**\n\t * Sanitizes the effect data, accounting for changes to the structure in previous versions\n\t *\n\t * @param inDocument\n\t * @returns {array}\n\t */\n\tgetSoundFlags(inDocument) {\n\t\tlet sounds = foundry.utils.getProperty(inDocument, CONSTANTS.SOUNDS_FLAG);\n\n\t\tif (!sounds?.length) return [];\n\n\t\tsounds = foundry.utils.deepClone(sounds);\n\n\t\tconst changes = [];\n\t\tfor (let [soundId, soundData] of sounds) {\n\t\t\tlet soundVersion = soundData?.flagVersion ?? \"1.0.0\";\n\n\t\t\tif (soundData.flagVersion === this.latestFlagVersion) continue;\n\n\t\t\tfor (let [version, migration] of Object.entries(this.soundMigrations)) {\n\t\t\t\tif (!foundry.utils.isNewerVersion(version, soundVersion)) continue;\n\n\t\t\t\tsoundData = migration(inDocument, soundData);\n\t\t\t}\n\n\t\t\tlib.debug(\n\t\t\t\t`Migrated sound with ID ${soundId} from version ${soundVersion} to version ${this.latestFlagVersion}`,\n\t\t\t);\n\n\t\t\tsoundData.flagVersion = this.latestFlagVersion;\n\n\t\t\tchanges.push(soundData);\n\t\t}\n\n\t\tif (changes.length) {\n\t\t\tflagManager.addSoundFlags(inDocument.uuid, changes);\n\t\t}\n\n\t\treturn sounds;\n\t},\n\n\tsoundMigrations: {},\n\n\t/**\n\t * Adds sounds to a given document\n\t *\n\t * @param inObjectUUID\n\t * @param inSounds\n\t */\n\taddSoundFlags: (inObjectUUID, inSounds) => {\n\t\tif (!Array.isArray(inSounds)) inSounds = [inSounds];\n\t\tsequencerSocket.executeAsGM(\n\t\t\tSOCKET_HANDLERS.ADD_EFFECT_FLAGS,\n\t\t\tinObjectUUID,\n\t\t\tinSounds,\n\t\t);\n\t},\n\n\t/**\n\t * Removes sounds from a given document\n\t *\n\t * @param inObjectUUID\n\t * @param inSounds\n\t * @param removeAll\n\t */\n\tremoveSoundFlags: (inObjectUUID, inSounds, removeAll = false) => {\n\t\tsequencerSocket.executeAsGM(\n\t\t\tSOCKET_HANDLERS.REMOVE_EFFECT_FLAGS,\n\t\t\tinObjectUUID,\n\t\t\tinSounds,\n\t\t\tremoveAll,\n\t\t);\n\t},\n\n\t_addSoundFlags: (sceneID, inSounds) => {\n\t\tif (!Array.isArray(inSounds)) inSounds = [inSounds];\n\n\t\tlet flagsToSet = flagManager.flagAddBuffer.get(sceneID) ?? {\n\t\t\teffects: [],\n\t\t};\n\n\t\tflagsToSet.effects.push(...inSounds);\n\n\t\tflagManager.flagSoundAddBuffer.set(sceneID, flagsToSet);\n\n\t\tflagManager.updateSoundFlags();\n\t},\n\n\t_removeSoundFlags: (sceneID, inSounds, removeAll = false) => {\n\t\tif (inSounds && !Array.isArray(inSounds)) inSounds = [inSounds];\n\n\t\tlet flagsToSet = flagManager.flagRemoveBuffer.get(sceneID) ?? {\n\t\t\teffects: [],\n\t\t\tremoveAll: removeAll,\n\t\t};\n\n\t\tif (inSounds) flagsToSet.effects.push(...inSounds);\n\n\t\tflagManager.flagSoundRemoveBuffer.set(sceneID, flagsToSet);\n\n\t\tflagManager.updateSoundFlags();\n\t},\n\n\tupdateFlags: foundry.utils.debounce(async () => {\n\n\t\tlet soundFlagsToAdd = Array.from(flagManager.flagSoundAddBuffer);\n\t\tlet soundFlagsToRemove = Array.from(flagManager.flagSoundRemoveBuffer);\n\n\t\tflagManager.flagSoundAddBuffer.clear();\n\t\tflagManager.flagSoundRemoveBuffer.clear();\n\n\t\tsoundFlagsToAdd.forEach((entry) => (entry[1].original = true));\n\t\tsoundFlagsToRemove.forEach((entry) => (entry[1].original = true));\n\n\t\tconst scenes = new Set([\n\t\t\t...soundFlagsToAdd.map((sound) => sound[0]).filter(Boolean),\n\t\t\t...soundFlagsToRemove.map((sound) => sound[0]).filter(Boolean),\n\t\t]);\n\n\t\tsoundFlagsToAdd = new Map(soundFlagsToAdd);\n\t\tsoundFlagsToRemove = new Map(soundFlagsToRemove);\n\n\t\tconst scenesToUpdate = {};\n\n\t\tfor (let sceneId of scenes) {\n\t\t\tlet scene = game.scenes.get(sceneId);\n\n\t\t\tif (!scene) {\n\t\t\t\tlib.debug(\n\t\t\t\t\t`Failed to set flags on non-existent scene with ID: ${sceneId}`,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet soundsToAdd = soundFlagsToAdd.get(sceneId) ?? { sounds: [] };\n\t\t\tlet soundsToRemove = soundFlagsToRemove.get(sceneId) ?? {\n\t\t\t\tsounds: [],\n\t\t\t\tremoveAll: false,\n\t\t\t};\n\n\t\t\tconst existingFlags = new Map(\n\t\t\t\tfoundry.utils.getProperty(scene, CONSTANTS.SOUNDS_FLAG) ?? [],\n\t\t\t);\n\n\t\t\tif (soundsToRemove?.removeAll) {\n\t\t\t\tsoundsToRemove.sounds = Array.from(existingFlags).map((entry) => entry[0]);\n\t\t\t}\n\n\t\t\tfor (let sound of soundsToAdd.sounds) {\n\t\t\t\tif (typeof sound === \"string\") {\n\t\t\t\t\tsound = existingFlags.get(sound);\n\t\t\t\t\tif (!sound) continue;\n\t\t\t\t}\n\t\t\t\texistingFlags.set(sound.sound_id, sound);\n\t\t\t}\n\n\t\t\tfor (let sound of soundsToRemove.sounds) {\n\t\t\t\tif (typeof sound === \"string\") {\n\t\t\t\t\tsound = existingFlags.get(sound);\n\t\t\t\t\tif (!sound) continue;\n\t\t\t\t}\n\t\t\t\texistingFlags.delete(sound.sound_id);\n\t\t\t}\n\n\t\t\tlet flagsToSet = Array.from(existingFlags);\n\n\t\t\tscenesToUpdate[sceneId] = scenesToUpdate[sceneId] ?? {\n\t\t\t\tupdates: {},\n\t\t\t\tdocuments: {},\n\t\t\t};\n\n\t\t\tscenesToUpdate[sceneId].updates[CONSTANTS.EFFECTS_FLAG] = flagsToSet;\n\n\t\t}\n\n\t\tfor (const [sceneId, sceneData] of Object.entries(scenesToUpdate)) {\n\t\t\tconst scene = game.scenes.get(sceneId);\n\t\t\tawait scene.update(sceneData.updates);\n\t\t}\n\n\t}, 250),\n\n};\n\nexport default flagManager;\n","import { sequencerSocket, SOCKET_HANDLERS } from \"../sockets.js\";\nimport SequencerAnimationEngine from \"./sequencer-animation-engine.js\";\nimport * as lib from \"../lib/lib.js\";\nimport SequenceManager from \"./sequence-manager.js\";\nimport { EffectsUIApp } from \"../formapplications/effects-ui/effects-ui-app.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport CONSTANTS from \"../constants.js\";\nimport { getPositionFromData } from \"../lib/canvas-lib.js\";\n\n\nexport default class SequencerSoundManager {\n\n\t/**\n\t * Returns all the currently running sounds\n\t *\n\t * @returns {Array}\n\t */\n\tstatic get sounds() {\n\t\treturn Array.from(SequenceManager.RunningSounds.values());\n\t}\n\n\t/**\n\t * Opens the Sequencer Manager with the sounds tab open\n\t */\n\tstatic show() {\n\t\treturn EffectsUIApp.show({ tab: \"manager\" });\n\t}\n\n\t/**\n\t * Play an audio file.\n\t *\n\t * @param {Object} data The data that describes the audio to play.\n\t * @param {boolean} [push=false] A flag indicating whether to make other clients play the audio, too.\n\t * @returns {Number} A promise that resolves when the audio file has finished playing.\n\t */\n\tstatic async play(data, push = true) {\n\t\tif (push)\n\t\t\tsequencerSocket.executeForOthers(SOCKET_HANDLERS.PLAY_SOUND, data);\n\t\treturn this._play(data);\n\t}\n\n\t/**\n\t * @param {Object} data\n\t * @returns {Number}\n\t * @private\n\t */\n\tstatic async _play(data) {\n\n\t\tif (data.delete) return false;\n\n\t\tHooks.callAll(\"createSequencerSound\", data);\n\n\t\tlib.debug(`Playing sound:`, data);\n\n\t\tconst playSound = game.settings.get(\"sequencer\", \"soundsEnabled\") &&\n\t\t\tgame.user.viewedScene === data.sceneId &&\n\t\t\t(!data?.users?.length || data?.users?.includes(game.userId));\n\n\t\tdata.volume = playSound ? (data.volume ?? 0.8) : 0.0;\n\n\t\tlet sound;\n\n\t\tif (data.source) {\n\t\t\tlet location = canvaslib.getPositionFromData(data);\n\t\t\tif (data.offset) {\n\t\t\t\tlocation.x += (data.offset.source.x || 0) * (data.offset.gridUnits ? canvas.grid.size : 1);\n\t\t\t\tlocation.y += (data.offset.source.y || 0) * (data.offset.gridUnits ? canvas.grid.size : 1);\n\t\t\t}\n\t\t\tif (data.randomOffset?.source) {\n\t\t\t\tconst twister = lib.createMersenneTwister(data.seed);\n\t\t\t\tlocation = canvaslib.get_random_offset(location, data.randomOffset.source, twister);\n\t\t\t}\n\t\t\tsound = await canvas.sounds.playAtPosition(data.src, location, data.locationOptions?.radius || 5, {\n\t\t\t\tgmAlways: false,\n\t\t\t\twalls: false,\n\t\t\t\teasing: true,\n\t\t\t\tmuffledEffect: { type: \"lowpass\" },\n\t\t\t\t...data.locationOptions,\n\t\t\t\tvolume: data.volume,\n\t\t\t\tchannel: data.channel || \"interface\"\n\t\t\t});\n\t\t} else {\n\t\t\tsound = await game.audio.play(data.src, {\n\t\t\t\t...data.locationOptions,\n\t\t\t\tvolume: data.fadeIn ? 0 : data.volume,\n\t\t\t\tloop: data.loop,\n\t\t\t\toffset: data.startTime,\n\t\t\t\tcontext: game.audio[data.channel || \"interface\"]\n\t\t\t});\n\t\t}\n\n\t\tif (!sound) return false;\n\n\t\tsound.sequencer_data = data;\n\t\tsound.sound_id = data.id;\n\t\tsound.sound_playing = playSound || game.user.isGM;\n\n\t\tSequenceManager.RunningSounds.add(data.id, sound);\n\n\t\tif (data.fadeIn && playSound) {\n\t\t\tSequencerAnimationEngine.addAnimation(data.id, {\n\t\t\t\ttarget: sound,\n\t\t\t\tpropertyName: \"volume\",\n\t\t\t\tfrom: 0.0,\n\t\t\t\tto: data.volume,\n\t\t\t\tduration: Math.min(data.fadeIn.duration, data.duration),\n\t\t\t\tease: data.fadeIn.ease,\n\t\t\t\tdelay: Math.min(data.fadeIn.delay, data.duration),\n\t\t\t\tabsolute: true\n\t\t\t});\n\t\t}\n\n\t\tif (data.fadeOut && playSound) {\n\t\t\tSequencerAnimationEngine.addAnimation(data.id, {\n\t\t\t\ttarget: sound,\n\t\t\t\tpropertyName: \"volume\",\n\t\t\t\tfrom: data.volume,\n\t\t\t\tto: 0.0,\n\t\t\t\tduration: Math.min(data.fadeOut.duration, data.duration),\n\t\t\t\tease: data.fadeOut.ease,\n\t\t\t\tdelay: Math.max(\n\t\t\t\t\tdata.duration - data.fadeOut.duration + data.fadeOut.delay,\n\t\t\t\t\t0,\n\t\t\t\t),\n\t\t\t\tabsolute: true\n\t\t\t});\n\t\t}\n\n\t\tif (data.duration) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tsound.stop();\n\t\t\t}, data.duration);\n\t\t}\n\n\t\tnew Promise((resolve) => {\n\t\t\tsound.addEventListener(\"stop\", resolve);\n\t\t\tsound.addEventListener(\"end\", resolve);\n\t\t}).then(() => {\n\t\t\tSequenceManager.RunningSounds.delete(data.id);\n\t\t\tHooks.callAll(\"endedSequencerSound\", data);\n\t\t});\n\n\t\treturn data.duration;\n\t}\n\n\tstatic _validateFilters(inFilter) {\n\n\t\tif (inFilter?.sounds) {\n\t\t\tif (!Array.isArray(inFilter.sounds)) {\n\t\t\t\tinFilter.sounds = [inFilter.sounds];\n\t\t\t}\n\t\t\tinFilter.sounds = inFilter.sounds.map((sound) => {\n\t\t\t\tif (!(typeof sound === \"string\" || sound instanceof foundry?.audio?.Sound))\n\t\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\t\t\"Sequencer\",\n\t\t\t\t\t\t\"SoundManager | collections in inFilter.sounds must be of type string or Sound\",\n\t\t\t\t\t);\n\t\t\t\tif (sound instanceof foundry?.audio?.Sound) return sound.sequencer_data.id;\n\t\t\t\treturn sound;\n\t\t\t});\n\t\t}\n\n\t\tif (inFilter?.name && typeof inFilter?.name !== \"string\")\n\t\t\tthrow lib.custom_error(\n\t\t\t\t\"Sequencer\",\n\t\t\t\t\"SoundManager | inFilter.name must be of type string\",\n\t\t\t);\n\n\t\tif (inFilter?.sceneId) {\n\t\t\tif (typeof inFilter.sceneId !== \"string\")\n\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\t\"Sequencer\",\n\t\t\t\t\t\"SoundManager | inFilter.sceneId must be of type string\",\n\t\t\t\t);\n\t\t\tif (!game.scenes.get(inFilter.sceneId))\n\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\t\"Sequencer\",\n\t\t\t\t\t\"SoundManager | inFilter.sceneId must be a valid scene id (could not find scene)\",\n\t\t\t\t);\n\t\t} else {\n\t\t\tinFilter.sceneId = game.user.viewedScene;\n\t\t}\n\n\t\tif (inFilter?.origin && typeof inFilter?.origin !== \"string\")\n\t\t\tthrow lib.custom_error(\n\t\t\t\t\"Sequencer\",\n\t\t\t\t\"SoundManager | inFilter.origin must be of type string\",\n\t\t\t);\n\n\t\tif (\n\t\t\t!inFilter.sounds &&\n\t\t\t!inFilter.name &&\n\t\t\t!inFilter.sceneId &&\n\t\t\t!inFilter.origin\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tsounds: null,\n\t\t\t\tname: null,\n\t\t\t\tsceneId: null,\n\t\t\t\torigin: null,\n\t\t\t},\n\t\t\tinFilter,\n\t\t);\n\t}\n\n\tstatic _filterSounds(inFilter) {\n\t\tif (inFilter.name) {\n\t\t\tinFilter.name = new RegExp(\n\t\t\t\t\"^\" + lib.str_to_search_regex_str(lib.safe_str(inFilter.name)) + \"$\",\n\t\t\t\t\"gu\",\n\t\t\t);\n\t\t}\n\t\treturn this.sounds.filter((sound) => {\n\t\t\treturn (\n\t\t\t\t(inFilter.sounds === null || inFilter.sounds.includes(sound.sequencer_data.id)) &&\n\t\t\t\t(inFilter.name === null || (sound.sequencer_data.name && inFilter.name && sound.sequencer_data.name.match(inFilter.name)?.length)) &&\n\t\t\t\t(inFilter.sceneId === null || (sound.sequencer_data.sceneId === inFilter.sceneId)) &&\n\t\t\t\t(inFilter.origin === null || inFilter.origin === sound.sequencer_data.origin)\n\t\t\t)\n\t\t});\n\t}\n\n\tstatic getSounds(inFilter = {}) {\n\t\tconst filters = this._validateFilters(inFilter);\n\t\tif (!inFilter)\n\t\t\tthrow lib.custom_error(\n\t\t\t\t\"Sequencer\",\n\t\t\t\t\"SoundManager | getSounds | Incorrect or incomplete parameters provided\",\n\t\t\t);\n\t\treturn this._filterSounds(filters);\n\t}\n\n\tstatic stop(ids) {\n\t\tlib.custom_warning(\n\t\t\t\"Sequencer\",\n\t\t\t\"SoundManager | stop | This method is becoming deprecated, please use Sequencer.SoundManager.endSounds instead\",\n\t\t\tfalse,\n\t\t);\n\t\treturn this.endSounds({ sounds: ids });\n\t}\n\n\tstatic endSounds(inFilter, push = true) {\n\t\tconst filters = this._validateFilters(inFilter);\n\t\tconst sounds = this._filterSounds(filters);\n\t\tif (!sounds?.length) return;\n\t\tconst ids = sounds.map(sound => sound.sequencer_data.id);\n\t\tif (push && game.user.isGM) {\n\t\t\tsequencerSocket.executeForOthers(SOCKET_HANDLERS.END_SOUNDS, ids);\n\t\t}\n\t\treturn this._endSounds(ids);\n\t}\n\n\t/**\n\t * @param ids\n\t * @private\n\t */\n\tstatic _endSounds(ids) {\n\t\tfor (const id of ids) {\n\t\t\tconst sound = SequenceManager.RunningSounds.get(id);\n\t\t\tif (sound) {\n\t\t\t\tsound.stop();\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic endAllSounds(push = true) {\n\t\tconst ids = SequenceManager.RunningSounds.keys();\n\t\tif (push && game.user.isGM) {\n\t\t\tsequencerSocket.executeForOthers(SOCKET_HANDLERS.END_SOUNDS, ids);\n\t\t}\n\t\treturn this._endSounds(ids);\n\t}\n}\n","import * as lib from \"../lib/lib.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport { sequencerSocket, SOCKET_HANDLERS } from \"../sockets.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\n\nlet lockedView = false;\n\nexport default class SequencerFoundryReplicator {\n  static registerHooks() {\n    Hooks.on(\"canvasPan\", () => {\n      if (!lockedView) return;\n      canvas.stage.pivot.set(lockedView.x, lockedView.y);\n      canvas.stage.scale.set(lockedView.scale, lockedView.scale);\n      canvas.updateBlur(lockedView.scale);\n      canvas.controls._onCanvasPan();\n      canvas.hud.align();\n    });\n  }\n\n  static playScrollingText(data, push = true) {\n    if (push) {\n      sequencerSocket.executeForOthers(\n        SOCKET_HANDLERS.CREATE_SCROLLING_TEXT,\n        data\n      );\n    }\n    return this._playScrollingText(data);\n  }\n\n  static _playScrollingText(data) {\n    if (game.user.viewedScene !== data.sceneId) return;\n    if (data.users.length && !data.users.includes(game.userId)) return;\n\n    canvas.interface.createScrollingText(\n      canvaslib.getPositionFromData(data),\n      data.content,\n      data.options\n    );\n\n    return data.options?.duration ?? 2000;\n  }\n\n  static panCanvas(data, push = true) {\n    if (push) {\n      sequencerSocket.executeForOthers(SOCKET_HANDLERS.PAN_CANVAS, data);\n    }\n\n    return this._panCanvas(data);\n  }\n\n  static _panCanvas(data) {\n    if (game.user.viewedScene !== data.sceneId) return;\n    if (data.users.length && !data.users.includes(game.userId)) return;\n\n    if (data.source) {\n      const position = canvaslib.getPositionFromData(data);\n\n      canvas.animatePan({\n        x: position.x,\n        y: position.y,\n        scale: data.scale,\n        duration: data.duration,\n        speed: data.speed,\n      });\n\n      if (data.speed) {\n        let ray = new Ray(canvas.stage.pivot, {\n          x: position.x,\n          y: position.y,\n        });\n        data.duration = Math.round((ray.distance * 1000) / data.speed);\n      }\n\n      if (data.lockView > 0) {\n        setTimeout(() => {\n          lockedView = {\n            x: position.x,\n            y: position.y,\n            scale: data.scale,\n          };\n        }, data.duration);\n        setTimeout(() => {\n          lockedView = false;\n        }, data.lockView + data.duration);\n      }\n    } else {\n      data.duration = 0;\n    }\n\n    if (data.shake) {\n      setTimeout(() => {\n        this._shake(data.shake);\n      }, data.duration);\n    }\n\n    return (\n      data.duration + Math.max(data.lockView ?? 0, data.shake?.duration ?? 0)\n    );\n  }\n\n  static _shake(shakeData) {\n\n\t  if(!shakeData.duration || !shakeData.frequency) return;\n\n    let x = lib.random_float_between(-1, 1);\n    let y = lib.random_float_between(-1, 1);\n    let rot = shakeData.rotation ? lib.random_float_between(-1, 1) : 0;\n    let positions = [{ x, y, rot }];\n\n\t\tfor (\n\t\t\tlet index = 0;\n\t\t\tindex < Math.floor(shakeData.duration / shakeData.frequency);\n\t\t\tindex++\n\t\t) {\n\t\t\tx = lib.flip_negate(x, Math.random());\n\t\t\ty = lib.flip_negate(y, Math.random());\n\t\t\trot = shakeData.rotation ? lib.flip_negate(rot, Math.random()) : 0;\n\t\t\tpositions.push({ x, y, rot });\n\t\t}\n\n    let currentDuration = 0;\n    positions = positions.map((pos) => {\n      let fadeStrength = 1;\n      if (\n        shakeData.fadeInDuration &&\n        currentDuration <= shakeData.fadeInDuration\n      ) {\n        fadeStrength = Math.max(\n          0,\n          Math.min(1, currentDuration / shakeData.fadeInDuration)\n        );\n      }\n      if (\n        shakeData.fadeOutDuration &&\n        currentDuration >= shakeData.duration - shakeData.fadeOutDuration\n      ) {\n        fadeStrength = Math.max(\n          0,\n          Math.min(\n            1,\n            (shakeData.duration - currentDuration) / shakeData.fadeOutDuration\n          )\n        );\n      }\n      pos.x *= shakeData.strength * fadeStrength;\n      pos.y *= shakeData.strength * fadeStrength;\n      if (shakeData.rotation) {\n        pos.rot *= (shakeData.strength / 7.5) * fadeStrength;\n      } else {\n        pos.rot = 0;\n      }\n      currentDuration += shakeData.frequency;\n      return {\n        transform: `translate(${pos.x}px, ${pos.y}px) rotate(${pos.rot}deg)`,\n      };\n    });\n\n    document.getElementById(\"board\").animate(positions, {\n      duration: shakeData.duration,\n    });\n  }\n}\n","import { sequencerSocket, SOCKET_HANDLERS } from \"../sockets.js\";\nimport SequencerFileCache from \"./sequencer-file-cache.js\";\nimport LoadingBar from \"../utils/loadingBar.js\";\nimport * as lib from \"../lib/lib.js\";\n\nconst SequencerPreloader = {\n  _usersToRespond: new Set(),\n  _clientsDone: [],\n  _resolve: () => {},\n\n  /**\n   *  Caches provided file(s) locally, vastly improving loading speed of those files.\n   *\n   * @param {Array|String}        inSrcs\n   * @param {Boolean}             showProgressBar\n   * @returns {Promise<void>}\n   */\n  preload(inSrcs, showProgressBar = false) {\n    if (Array.isArray(inSrcs)) {\n      inSrcs.forEach((str) => {\n        if (typeof str !== \"string\") {\n          throw lib.custom_error(\n            \"Sequencer\",\n            \"preload | each entry in inSrcs must be of type string\"\n          );\n        }\n      });\n    } else if (typeof inSrcs !== \"string\") {\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"preload | inSrcs must be of type string or array of strings\"\n      );\n    }\n\n    if (typeof showProgressBar !== \"boolean\") {\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"preload | showProgressBar must be of type of boolean\"\n      );\n    }\n\n    const srcs = this._cleanSrcs(inSrcs);\n\n    if (srcs.length === 0) return;\n\n    return this._preloadLocal(srcs, showProgressBar);\n  },\n\n  /**\n   *  Causes each connected client (including the caller) to fetch and cache the provided file(s) locally, vastly\n   *  improving loading speed of those files.\n   *\n   * @param {Array|String}        inSrcs\n   * @param {Boolean}             showProgressBar\n   * @returns {Promise<void>}\n   */\n  preloadForClients(inSrcs, showProgressBar = false) {\n    if (Array.isArray(inSrcs)) {\n      inSrcs.forEach((str) => {\n        if (typeof str !== \"string\") {\n          throw lib.custom_error(\n            \"Sequencer\",\n            \"preloadForClients | each entry in inSrcs must be of type string\"\n          );\n        }\n      });\n    } else if (typeof inSrcs !== \"string\") {\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"preloadForClients | inSrcs must be of type string or array of strings\"\n      );\n    }\n\n    if (typeof showProgressBar !== \"boolean\") {\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"preloadForClients | showProgressBar must be of type of boolean\"\n      );\n    }\n\n    const srcs = this._cleanSrcs(inSrcs);\n\n    if (srcs.length === 0) return;\n\n    if (!lib.user_can_do(\"permissions-preload\")) {\n      lib.custom_warning(\n        \"Sequencer\",\n        \"preloadForClients - You do not have permission to force other clients to preload. Preloading locally instead.\"\n      );\n      return this._preloadLocal(srcs, showProgressBar);\n    }\n\n    const promise = new Promise((resolve) => {\n      this._resolve = resolve;\n    });\n\n    this._usersToRespond = new Set(\n      game.users.filter((user) => user.active).map((user) => user.id)\n    );\n\n    sequencerSocket.executeForEveryone(\n      SOCKET_HANDLERS.PRELOAD,\n      game.user.id,\n      srcs,\n      showProgressBar\n    );\n\n    return promise;\n  },\n\n  async respond(inSenderId, inSrcs, showProgressBar) {\n    const numFilesFailedToLoad = await this._preloadLocal(\n      inSrcs,\n      showProgressBar\n    );\n    return sequencerSocket.executeAsUser(\n      SOCKET_HANDLERS.PRELOAD_RESPONSE,\n      inSenderId,\n      game.user.id,\n      numFilesFailedToLoad\n    );\n  },\n\n  handleResponse(inUserId, numFilesFailedToLoad) {\n    this._usersToRespond.delete(inUserId);\n    this._clientsDone.push({\n      userId: inUserId,\n      numFilesFailedToLoad: numFilesFailedToLoad,\n    });\n    if (this._usersToRespond.size > 0) return;\n\n    this._clientsDone.forEach((user) => {\n      if (user.numFilesFailedToLoad > 0) {\n        lib.debug(\n          `${\n            game.users.get(user.userId).name\n          } preloaded files, failed to preload ${\n            user.numFilesFailedToLoad\n          } files`\n        );\n      } else {\n        lib.debug(\n          `${game.users.get(user.userId).name} preloaded files successfully`\n        );\n      }\n    });\n    lib.debug(`All clients responded to file preloads`);\n\n    this._resolve();\n\n    this._usersToRespond = new Set();\n    this._clientsDone = [];\n    this._resolve = () => {};\n  },\n\n  /**\n   * Filters and cleans up file paths given to the preload methods\n   *\n   * @private\n   */\n  _cleanSrcs(inSrcs) {\n    if (!Array.isArray(inSrcs)) {\n      inSrcs = [inSrcs];\n    }\n\n    if (inSrcs.length === 0) {\n      lib.custom_warning(\"Sequencer\", \"You need to provide files to preload\");\n      return [];\n    }\n\n    inSrcs = lib\n      .make_array_unique(\n        inSrcs.filter(Boolean).map((src) => {\n          if (Sequencer.Database.entryExists(src)) {\n            return Sequencer.Database.getAllFileEntries(src);\n          }\n          return src;\n        })\n        .deepFlatten()\n      );\n\n    if (inSrcs.length >= 750) {\n      lib.custom_warning(\n        \"Sequencer\",\n        \"You are preloading over 750 files, you are most likely preloading more files than the system can cache.\",\n        true\n      );\n    }\n\n    return inSrcs;\n  },\n\n  /**\n   * The method that actually preloads files locally, with an optional progress bar\n   *\n   * @private\n   */\n  _preloadLocal(inSrcs, showProgressBar) {\n    let startTime = performance.now();\n    let numFilesToLoad = inSrcs.length;\n\n    lib.debug(`Preloading ${numFilesToLoad} files...`);\n    if (showProgressBar)\n      LoadingBar.init(\n        `Sequencer - Preloading ${numFilesToLoad} files`,\n        numFilesToLoad\n      );\n\n    return new Promise(async (resolve) => {\n      let numFilesFailedToLoad = 0;\n      const loadingPromises = inSrcs.map(async (src) => {\n        const blob = await SequencerFileCache.loadFile(src, true);\n        if (showProgressBar) LoadingBar.incrementProgress();\n        if (!blob) {\n          numFilesFailedToLoad++;\n        }\n      })\n      await Promise.allSettled(loadingPromises)\n      const timeTaken = (performance.now() - startTime) / 1000;\n      let failedToLoad = ` (${numFilesFailedToLoad} failed to load)`;\n      lib.debug(\n        `Preloading ${numFilesToLoad} files took ${timeTaken}s` + failedToLoad\n      );\n      resolve(numFilesFailedToLoad);\n    });\n  },\n};\n\nexport default SequencerPreloader;\n","import CONSTANTS from \"./constants.js\";\nimport * as lib from \"./lib/lib.js\";\nimport FlagManager from \"./utils/flag-manager.js\";\nimport SequencerSoundManager from \"./modules/sequencer-sound-manager.js\";\nimport SequencerEffectManager from \"./modules/sequencer-effect-manager.js\";\nimport SequencerFoundryReplicator from \"./modules/sequencer-foundry-replicator.js\";\nimport SequencerPreloader from './modules/sequencer-preloader.js'\n\nexport const SOCKET_HANDLERS = {\n  PLAY_EFFECT: \"playEffect\",\n  END_EFFECTS: \"endEffects\",\n  UPDATE_EFFECT: \"updateEffects\",\n  ADD_EFFECT_ANIMATIONS: \"addEffectAnimations\",\n  PLAY_SOUND: \"playSound\",\n  END_SOUNDS: \"endSounds\",\n  PRELOAD: \"preload\",\n  PRELOAD_RESPONSE: \"preloadResponse\",\n  PRELOAD_DONE: \"preloadDone\",\n  UPDATE_DOCUMENT: \"updateDocument\",\n  ADD_EFFECT_FLAGS: \"addEffectFlags\",\n  REMOVE_EFFECT_FLAGS: \"removeEffectFlags\",\n  UPDATE_EFFECT_POSITION: \"updateEffectPosition\",\n  ADD_SOUND_FLAGS: \"addSoundFlags\",\n  REMOVE_SOUND_FLAGS: \"removeSoundFlags\",\n  UPDATE_SOUND_POSITION: \"updateSoundPosition\",\n  CREATE_SCROLLING_TEXT: \"createScrollingText\",\n  CREATE_LIGHT_SOURCE: \"createLightSource\",\n  PAN_CANVAS: \"panCanvas\",\n  RUN_SEQUENCE_LOCALLY: \"runSequenceLocally\",\n};\n\nexport let sequencerSocket = false;\n\nexport function registerSocket() {\n  if (sequencerSocket) return;\n\tif (!socketlib?.registerModule) return;\n  sequencerSocket = socketlib.registerModule(CONSTANTS.MODULE_NAME);\n  sequencerSocket.register(SOCKET_HANDLERS.PLAY_EFFECT, (...args) =>\n    SequencerEffectManager._playEffect(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.END_EFFECTS, (...args) =>\n    SequencerEffectManager._endManyEffects(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.UPDATE_EFFECT, (...args) =>\n    SequencerEffectManager._updateEffect(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.ADD_EFFECT_ANIMATIONS, (...args) =>\n    SequencerEffectManager._addEffectAnimations(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.PLAY_SOUND, (...args) =>\n    SequencerSoundManager._play(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.END_SOUNDS, (...args) =>\n    SequencerSoundManager._endSounds(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.PRELOAD, (...args) =>\n    SequencerPreloader.respond(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.PRELOAD_RESPONSE, (...args) =>\n    SequencerPreloader.handleResponse(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.UPDATE_DOCUMENT, (...args) =>\n    updateDocument(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.ADD_EFFECT_FLAGS, (...args) =>\n    FlagManager._addEffectFlags(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.REMOVE_EFFECT_FLAGS, (...args) =>\n    FlagManager._removeEffectFlags(...args)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.UPDATE_EFFECT_POSITION, (...args) =>\n    SequencerEffectManager._updatePosition(...args)\n  );\n\tsequencerSocket.register(SOCKET_HANDLERS.ADD_SOUND_FLAGS, (...args) =>\n\t\tFlagManager._addSoundFlags(...args)\n\t);\n\tsequencerSocket.register(SOCKET_HANDLERS.REMOVE_SOUND_FLAGS, (...args) =>\n\t\tFlagManager._removeSoundFlags(...args)\n\t);\n  sequencerSocket.register(SOCKET_HANDLERS.CREATE_SCROLLING_TEXT, (data) =>\n    SequencerFoundryReplicator._playScrollingText(data)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.PAN_CANVAS, (data) =>\n    SequencerFoundryReplicator._panCanvas(data)\n  );\n  sequencerSocket.register(SOCKET_HANDLERS.RUN_SEQUENCE_LOCALLY, (data) => {\n    lib.debug(\"Playing remote Sequence\");\n    new Sequence().fromJSON(data).play();\n  });\n}\n\nasync function updateDocument(documentUuid, updates, animate) {\n  const document = await fromUuid(documentUuid);\n  return document.update(updates, animate);\n}\n","import CanvasEffect from \"../canvas-effects/canvas-effect.js\";\nimport { sequencerSocket, SOCKET_HANDLERS } from \"../sockets.js\";\nimport * as lib from \"../lib/lib.js\";\nimport flagManager from \"../utils/flag-manager.js\";\nimport CONSTANTS from \"../constants.js\";\nimport SequenceManager from \"./sequence-manager.js\";\nimport { EffectsUIApp } from \"../formapplications/effects-ui/effects-ui-app.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\n\nconst PositionContainer = new Map();\nconst TemporaryPositionsContainer = new Map();\n\nexport default class SequencerEffectManager {\n  /**\n   * Returns all the currently running effects on the canvas\n   *\n   * @returns {Array}\n   */\n  static get effects() {\n    return Array.from(SequenceManager.VisibleEffects.values());\n  }\n\n  static _updatePosition(uuid, position) {\n    TemporaryPositionsContainer.set(uuid, position);\n  }\n\n  static getPositionForUUID(uuid) {\n    return TemporaryPositionsContainer.get(uuid);\n  }\n\n  /**\n   * Opens the Sequencer Manager UI with the effects tab open\n   */\n  static show() {\n    return EffectsUIApp.show({ tab: \"manager\" });\n  }\n\n  /**\n   * Play an effect on the canvas.\n   *\n   * @param {object} data The data that describes the audio to play\n   * @param {boolean} [push=true] A flag indicating whether or not to make other clients play the effect\n   * @returns {CanvasEffect} A CanvasEffect object\n   */\n  static async play(data, push = true) {\n    if (!lib.user_can_do(\"permissions-effect-create\")) {\n      lib.custom_warning(\n        \"Sequencer\",\n        \"EffectManager | play | Players do not have permissions to play effects. This can be configured in Sequencer's module settings.\"\n      );\n      return;\n    }\n    if (push) sequencerSocket.executeForOthers(SOCKET_HANDLERS.PLAY_EFFECT, data);\n    return this._playEffect(data);\n  }\n\n  /**\n   * Get effects that are playing on the canvas based on a set of filters\n   *\n   * @param {object} inFilter An object containing filters that determine which effects to return\n   *                             - object: An ID or a PlaceableObject\n   *                             - name: The name of the effect\n   *                             - sceneId: the ID of the scene to search within\n   * @returns {Array} An array containing effects that match the given filter\n   */\n  static getEffects(inFilter = {}) {\n    const filters = this._validateFilters(inFilter);\n    if (!inFilter)\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"EffectManager | getEffects | Incorrect or incomplete parameters provided\"\n      );\n    return this._filterEffects(filters);\n  }\n\n  /**\n   * Updates effects based on a set of filters\n   *\n   * @param {object} inFilter An object containing filters that determine which effects to return\n   *                             - object: An ID or a PlaceableObject\n   *                             - name: The name of the effect\n   *                             - sceneId: the ID of the scene to search within\n   *                             - effects: a single CanvasEffect or its ID, or an array of such\n   * @param {object} inUpdates\n   * @returns {promise}\n   */\n  static updateEffects(inFilter, inUpdates) {\n    inFilter = this._validateFilters(inFilter);\n    if (!inFilter)\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"EffectManager | updateEffects | Incorrect or incomplete parameters provided\"\n      );\n\n    CanvasEffect.validateUpdate(inUpdates);\n\n    const effectsToUpdate = this._filterEffects(inFilter).filter(\n      (effect) => effect.userCanUpdate\n    );\n\n    return Promise.allSettled(\n      effectsToUpdate.map((effect) => effect.update(inUpdates))\n    );\n  }\n\n  /**\n   * End effects that are playing on the canvas based on a set of filters\n   *\n   * @param {object} inFilter An object containing filters that determine which effects to end\n   *                             - object: An ID or a PlaceableObject\n   *                             - name: The name of the effect\n   *                             - sceneId: the ID of the scene to search within\n   *                             - effects: a single CanvasEffect or its ID, or an array of such\n   * @param {boolean} [push=true] A flag indicating whether or not to make other clients end the effects\n   * @returns {promise} A promise that resolves when the effects have ended\n   */\n  static async endEffects(inFilter = {}, push = true) {\n    inFilter = this._validateFilters(inFilter);\n    if (!inFilter)\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"EffectManager | endEffects | Incorrect or incomplete parameters provided\"\n      );\n    const effectsToEnd = this._getEffectsByFilter(inFilter);\n    if (!effectsToEnd.length) return;\n    if (push)\n      sequencerSocket.executeForOthers(\n        SOCKET_HANDLERS.END_EFFECTS,\n        effectsToEnd\n      );\n    return this._endManyEffects(effectsToEnd);\n  }\n\n  /**\n   * End all effects that are playing on the canvas\n   *\n   * @param {string} [inSceneId] A parameter which determines which scene to end all effects on, defaults to current viewed scene\n   * @param {boolean} [push=true] A flag indicating whether or not to make other clients end all effects\n   * @returns {promise} A promise that resolves when all of the effects have _ended\n   */\n  static async endAllEffects(inSceneId = game.user.viewedScene, push = true) {\n    const inFilter = this._validateFilters({ sceneId: inSceneId });\n    if (!inFilter)\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"EffectManager | endAllEffects | Incorrect or incomplete parameters provided\"\n      );\n    const effectsToEnd = this._getEffectsByFilter(inFilter);\n    if (!effectsToEnd.length) return;\n    if (push)\n      sequencerSocket.executeForOthers(\n        SOCKET_HANDLERS.END_EFFECTS,\n        effectsToEnd\n      );\n    return this._endManyEffects(effectsToEnd);\n  }\n\n  static _getEffectsByFilter(inFilter) {\n    return lib.make_array_unique(\n      this._filterEffects(inFilter)\n        .filter((effect) => effect.userCanDelete)\n        .map((effect) => {\n          return effect.data?.persistOptions?.persistTokenPrototype && lib.is_UUID(effect?.data.source) && effect.data?.attachTo?.active\n            ? effect.data?.persistOptions?.id ?? effect.id\n            : effect.id;\n        })\n    );\n  }\n\n  /**\n   * If an effect has been named its position will be cached, which can be retrieved with this method\n   *\n   * @param {string} inName\n   * @returns {object|boolean}\n   * @private\n   */\n  static getEffectPositionByName(inName) {\n    if (!(typeof inName === \"string\"))\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"EffectManager | getEffectPositionByName | inName must be of type string\"\n      );\n    return PositionContainer.get(inName) ?? false;\n  }\n\n  /**\n   * Filters the existing effects based on the given filter\n   *\n   * @param inFilter\n   * @returns {array}\n   * @private\n   */\n  static _filterEffects(inFilter) {\n    if (inFilter.name) {\n      inFilter.name = new RegExp(\n        \"^\" + lib.str_to_search_regex_str(lib.safe_str(inFilter.name)) + \"$\",\n        \"gu\"\n      );\n    }\n    let effects = this.effects;\n    if (inFilter.sceneId && inFilter.sceneId !== canvas.scene.id) {\n      effects = lib\n        .get_all_documents_from_scene(inFilter.sceneId)\n        .map((doc) => {\n          return foundry.utils.getProperty(doc, CONSTANTS.EFFECTS_FLAG);\n        })\n        .filter((flags) => !!flags)\n        .map((flags) => {\n          return flags.map((flag) => CanvasEffect.make(flag[1]));\n        })\n        .deepFlatten();\n    }\n    return effects.filter((effect) => {\n      return (\n        (!inFilter.effects || inFilter.effects.includes(effect.id)) &&\n        (!inFilter.name ||\n          (effect.data.name &&\n            effect.data.name.match(inFilter.name)?.length)) &&\n        (!inFilter.source || inFilter.source === effect.data.source) &&\n        (!inFilter.target || inFilter.target === effect.data.target) &&\n        (!inFilter.origin || inFilter.origin === effect.data.origin)\n      );\n    });\n  }\n\n  /**\n   * Validates an object actually exists, and gets its UUID\n   *\n   * @param object\n   * @param sceneId\n   * @returns {string}\n   * @private\n   */\n  static _validateObject(object, sceneId) {\n    if (\n      !(\n        object instanceof foundry.abstract.Document ||\n        object instanceof FoundryShim.PlaceableObject ||\n        typeof object === \"string\"\n      )\n    ) {\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"EffectManager | object must be instance of PlaceableObject or of type string\"\n      );\n    } else if (\n      object instanceof FoundryShim.PlaceableObject ||\n      object instanceof foundry.abstract.Document\n    ) {\n      object = lib.get_object_identifier(object?.document ?? object);\n    } else if (typeof object === \"string\") {\n      const actualObject = lib.get_object_from_scene(object, sceneId);\n      if (!actualObject) {\n        throw lib.custom_error(\n          \"Sequencer\",\n          `EffectManager | could not find object with ID: ${object}`\n        );\n      }\n      const uuid = lib.get_object_identifier(actualObject);\n      if (!uuid) {\n        throw lib.custom_error(\n          \"Sequencer\",\n          `EffectManager | could could not establish identifier of object with ID: ${object}`\n        );\n      }\n      object = uuid;\n    }\n\n    return object;\n  }\n\n  /**\n   * Validates the filter given to any of the above public methods\n   *\n   * @param inFilter\n   * @returns {boolean}\n   * @private\n   */\n  static _validateFilters(inFilter) {\n    if (inFilter?.sceneId) {\n      if (typeof inFilter.sceneId !== \"string\")\n        throw lib.custom_error(\n          \"Sequencer\",\n          \"EffectManager | inFilter.sceneId must be of type string\"\n        );\n      if (!game.scenes.get(inFilter.sceneId))\n        throw lib.custom_error(\n          \"Sequencer\",\n          \"EffectManager | inFilter.sceneId must be a valid scene id (could not find scene)\"\n        );\n    } else {\n      inFilter.sceneId = game.user.viewedScene;\n    }\n\n    if (inFilter?.object) {\n      inFilter.source = this._validateObject(inFilter.object, inFilter.sceneId);\n      delete inFilter.object;\n    }\n\n    if (inFilter?.source) {\n      inFilter.source = this._validateObject(inFilter.source, inFilter.sceneId);\n    }\n\n    if (inFilter?.target) {\n      inFilter.target = this._validateObject(inFilter.target, inFilter.sceneId);\n    }\n\n    if (inFilter?.name && typeof inFilter?.name !== \"string\")\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"EffectManager | inFilter.name must be of type string\"\n      );\n    if (inFilter?.origin && typeof inFilter?.origin !== \"string\")\n      throw lib.custom_error(\n        \"Sequencer\",\n        \"EffectManager | inFilter.origin must be of type string\"\n      );\n\n    if (inFilter?.effects) {\n      if (!Array.isArray(inFilter.effects))\n        inFilter.effects = [inFilter.effects];\n      inFilter.effects = inFilter.effects.map((effect) => {\n        if (!(typeof effect === \"string\" || effect instanceof CanvasEffect))\n          throw lib.custom_error(\n            \"Sequencer\",\n            \"EffectManager | collections in inFilter.effects must be of type string or CanvasEffect\"\n          );\n        if (effect instanceof CanvasEffect) return effect.id;\n        return effect;\n      });\n    }\n\n    if (\n      !inFilter.name &&\n      !inFilter.origin &&\n      !inFilter.target &&\n      !inFilter.sceneId &&\n      !inFilter.effects &&\n      !inFilter.origin\n    )\n      return false;\n\n    return foundry.utils.mergeObject(\n      {\n        effects: false,\n        name: false,\n        source: false,\n        target: false,\n        sceneId: false,\n        origin: false,\n      },\n      inFilter\n    );\n  }\n\n  /**\n   * Actually plays the effect on the canvas\n   *\n   * @param data\n   * @param setFlags\n   * @returns {Promise<{duration: Promise<number>, promise: Promise<void>}>}\n   * @private\n   */\n  static async _playEffect(data, setFlags = true) {\n\n    const effect = CanvasEffect.make(data);\n\n    if (\n      data.persist &&\n      setFlags &&\n      effect.context &&\n      effect.owner &&\n\t    !effect.isSourceTemporary &&\n      !data.temporary &&\n      !data.remote\n    ) {\n      flagManager.addEffectFlags(effect.context.uuid, effect.data);\n    }\n\n    if (!effect.shouldPlay) return;\n\n    const playData = effect.play();\n\n    SequenceManager.VisibleEffects.add(effect.id, effect);\n    if (effect.data.name) {\n      effect._ticker.add(() => {\n        if (effect.isDestroyed) return;\n        PositionContainer.set(effect.data.name, {\n          start: effect.sourcePosition,\n          end: effect.targetPosition,\n        });\n      });\n    }\n\n    if (data.temporary && effect.owner) {\n      let lastSourcePosition = {};\n      let lastTargetPosition = {};\n      effect._addToTicker(() => {\n        if (effect.source && !effect.isSourceDestroyed) {\n          const sourceData = effect.getSourceData();\n          if (JSON.stringify(sourceData) !== lastSourcePosition) {\n            sequencerSocket.executeForOthers(\n              SOCKET_HANDLERS.UPDATE_EFFECT_POSITION,\n              data.source,\n              sourceData\n            );\n            lastSourcePosition = JSON.stringify(sourceData);\n          }\n        }\n        if (effect.target && !effect.isTargetDestroyed) {\n          const targetData = effect.getTargetData();\n          if (JSON.stringify(targetData) !== lastTargetPosition) {\n            sequencerSocket.executeForOthers(\n              SOCKET_HANDLERS.UPDATE_EFFECT_POSITION,\n              data.target,\n              targetData\n            );\n            lastTargetPosition = JSON.stringify(targetData);\n          }\n        }\n      });\n    }\n\n    if (!data.persist) {\n      playData.promise.then(() => this._removeEffect(effect));\n    }\n\n    return playData;\n  }\n\n  /**\n   * Updates a single effect with the given data\n   *\n   * @param inEffectId\n   * @param inUpdates\n   * @returns {promise|boolean}\n   * @private\n   */\n  static _updateEffect(inEffectId, inUpdates) {\n    const effect = SequenceManager.VisibleEffects.get(inEffectId);\n    if (!effect) return false;\n    return effect._update(inUpdates);\n  }\n\n  /**\n   * Updates a single effect with new animations\n   *\n   * @param inEffectId\n   * @param inAnimations\n   * @param inLoopingAnimations\n   * @returns {promise|boolean}\n   * @private\n   */\n  static _addEffectAnimations(inEffectId, inAnimations, inLoopingAnimations) {\n    const effect = SequenceManager.VisibleEffects.get(inEffectId);\n    if (!effect) return false;\n    return effect._addAnimations(inAnimations, inLoopingAnimations);\n  }\n\n  /**\n   * Sets up persisting effects when the scene is first loaded\n   *\n   * @returns {promise}\n   */\n  static async initializePersistentEffects() {\n    await this.tearDownPersists();\n    const allObjects = lib.get_all_documents_from_scene();\n    allObjects.push(canvas.scene);\n    const docEffectsMap = allObjects.reduce((acc, doc) => {\n      let effects = flagManager.getEffectFlags(doc);\n      effects.forEach((e) => {\n        if (lib.is_UUID(e[1].source) && e[1].source !== doc.uuid) {\n          e[1].delete = true;\n        }\n      });\n      if (doc instanceof TokenDocument && doc?.actorLink) {\n        const actorEffects = flagManager.getEffectFlags(doc?.actor);\n        actorEffects.forEach((e) => {\n          e[1]._id = foundry.utils.randomID();\n          e[1].source = doc.uuid;\n          e[1].sceneId = doc.parent.id;\n        });\n        effects = effects.concat(actorEffects);\n      }\n      if (effects.length) {\n        acc[doc.uuid] = effects;\n      }\n      return acc;\n    }, {});\n    const promises = Object.entries(docEffectsMap)\n      .map(([uuid, effects]) => {\n        return this._playEffectMap(effects, fromUuidSync(uuid));\n      })\n      .flat();\n    return Promise.all(promises).then(() => {\n      Hooks.callAll(\"sequencerEffectManagerReady\");\n    });\n  }\n\n  /**\n   * Tears down persisting effects when the scene is unloaded\n   */\n  static tearDownPersists() {\n    return Promise.allSettled(\n      this.effects.map((effect) => {\n        SequenceManager.VisibleEffects.delete(effect.id);\n        return effect.destroy();\n      })\n    );\n  }\n\n  static setup() {\n    Hooks.on(\"preCreateToken\", this._patchCreationData.bind(this));\n    Hooks.on(\"preCreateDrawing\", this._patchCreationData.bind(this));\n    Hooks.on(\"preCreateTile\", this._patchCreationData.bind(this));\n    Hooks.on(\"preCreateMeasuredTemplate\", this._patchCreationData.bind(this));\n    Hooks.on(\"createToken\", this._documentCreated.bind(this));\n    Hooks.on(\"createDrawing\", this._documentCreated.bind(this));\n    Hooks.on(\"createTile\", this._documentCreated.bind(this));\n    Hooks.on(\"createMeasuredTemplate\", this._documentCreated.bind(this));\n  }\n\n  /**\n   * Patches an object's creation data before it's created so that the effect plays on it correctly\n   *\n   * @param inDocument\n   * @param data\n   * @param options\n   * @returns {*}\n   */\n  static async _patchCreationData(inDocument, data, options) {\n    const effects = flagManager.getEffectFlags(inDocument);\n\n    if (!effects?.length) return;\n\n    const updates = {};\n\n    let documentUuid;\n    if (!inDocument._id) {\n      const documentId = foundry.utils.randomID();\n      documentUuid = inDocument.uuid + documentId;\n      updates[\"_id\"] = documentId;\n      options.keepId = true;\n    } else {\n      documentUuid = inDocument.uuid;\n    }\n\n    updates[CONSTANTS.EFFECTS_FLAG] = this._patchEffectDataForDocument(\n      documentUuid,\n      effects\n    );\n\n    return inDocument.updateSource(updates);\n  }\n\n  static _patchEffectDataForDocument(inDocumentUuid, effects) {\n    return effects.map((effect) => {\n      effect[0] = foundry.utils.randomID();\n      const effectData = effect[1];\n      effectData._id = effect[0];\n      if (lib.is_UUID(effectData.source)) {\n        if (effectData.masks.includes(effectData.source)) {\n          const index = effectData.masks.indexOf(effectData.source);\n          effectData.masks[index] = inDocumentUuid;\n        }\n        effectData.source = inDocumentUuid;\n      }\n      effectData.sceneId = inDocumentUuid.split(\".\")[1];\n      return effect;\n    });\n  }\n\n  /**\n   * Plays the effects of a given document on creation\n   *\n   * @param inDocument\n   * @returns {*}\n   */\n  static async _documentCreated(inDocument) {\n    let effects = flagManager.getEffectFlags(inDocument);\n    if (inDocument instanceof TokenDocument && inDocument?.actorLink) {\n      let actorEffects = flagManager.getEffectFlags(inDocument?.actor);\n      if (actorEffects.length) {\n        actorEffects = this._patchEffectDataForDocument(\n          inDocument.uuid,\n          actorEffects\n        );\n      }\n      effects = effects.concat(actorEffects);\n    }\n    if (!effects?.length) return;\n    return this._playEffectMap(effects, inDocument);\n  }\n\n  /**\n   * Plays multiple effects at the same time\n   *\n   * @param inEffects\n   * @param inDocument\n   * @returns {Promise<{duration: Promise<number>, promise: Promise<void>}[]>}\n   * @private\n   */\n  static _playEffectMap(inEffects, inDocument) {\n    if (inEffects instanceof Map) inEffects = Array.from(inEffects);\n    return Promise.all(\n      inEffects.map((effect) => {\n        if (!CanvasEffect.checkValid(effect[1])) {\n          if (!game.user.isGM) return;\n          lib.custom_warning(\n            `Sequencer`,\n            `Removed effect from ${inDocument.uuid} as it no longer had a valid source or target`\n          );\n          return flagManager.removeEffectFlags(inDocument.uuid, effect);\n        }\n        return this._playEffect(effect[1], false)\n          .then((result) => {\n            if (!result) {\n              lib.debug(\"Error playing effect\");\n            }\n          })\n          .catch((err) => {\n            lib.debug(\"Error playing effect:\", err);\n          });\n      })\n    );\n  }\n\n  /**\n   * Ends one or many effects at the same time, returning a promise that resolves once every effect has fully ended\n   *\n   * @param inEffectIds\n   * @returns {Promise}\n   * @private\n   */\n  static async _endManyEffects(inEffectIds = false) {\n    const actorEffectsToEnd = this.effects.filter((effect) => {\n      return (\n        effect.context?.actorLink &&\n        inEffectIds.includes(effect.data?.persistOptions?.id)\n      );\n    });\n    const effectsByActorUuid = Object.values(\n      lib.group_by(actorEffectsToEnd, \"context.actor.uuid\")\n    );\n\n    const regularEffectsToEnd = this.effects.filter((effect) => {\n      return (\n        inEffectIds.includes(effect.id) ||\n        (!effect.context?.actorLink &&\n          inEffectIds.includes(effect.data?.persistOptions?.id))\n      );\n    });\n    const effectsByContextUuid = Object.values(\n      lib.group_by(regularEffectsToEnd, \"context.uuid\")\n    );\n\n    effectsByContextUuid.forEach((effects) => {\n      effects = effects.filter(\n        (effect) => effect.data.persist && !effect.data.temporary\n      );\n      if (!effects.length) return;\n      const effectData = effects.map((effect) => effect.data);\n      flagManager.removeEffectFlags(\n        effects[0].context.uuid,\n        effectData,\n        !inEffectIds\n      );\n    });\n\n    effectsByActorUuid.forEach((effects) => {\n      effects = effects.filter(\n        (effect) => effect.data.persist && !effect.data.temporary\n      );\n      if (!effects.length) return;\n\n      const effectContext = effects[0].context;\n      const effectData = effects.map((effect) => effect.data);\n\n      if (\n        !(\n          effectContext instanceof TokenDocument &&\n          effectContext.actorLink &&\n          effectContext.actor.prototypeToken.actorLink\n        )\n      ) {\n        return;\n      }\n\n      const persistentEffectData = effectData.filter(\n        (data) => lib.is_UUID(data?.source) && data?.persistOptions?.persistTokenPrototype\n      );\n      if (!persistentEffectData.length) return;\n\n      const actorEffects = flagManager.getEffectFlags(effectContext.actor);\n      const applicableActorEffects = actorEffects\n        .filter((effect) => {\n          return (\n\t          lib.is_UUID(effect[1]?.source) &&\n\t          effect[1]?.persistOptions?.persistTokenPrototype &&\n            persistentEffectData.some(\n              (persistentEffect) =>\n                persistentEffect.persistOptions.id ===\n                effect[1]?.persistOptions?.id\n            )\n          );\n        })\n        .map((e) => e[0]);\n\n      flagManager.removeEffectFlags(\n        effectContext.actor.uuid,\n        applicableActorEffects,\n        !inEffectIds\n      );\n    });\n\n    const effectsToEnd = effectsByContextUuid\n      .concat(effectsByActorUuid)\n      .deepFlatten();\n\n    return Promise.allSettled(\n      effectsToEnd.map((effect) => this._removeEffect(effect))\n    );\n  }\n\n  static _effectContextFilter(inUUID, effectData) {\n    return (\n      effectData?.source === inUUID ||\n      effectData?.target === inUUID ||\n      (effectData?.tiedDocuments ?? []).indexOf(inUUID) > -1\n    );\n  }\n\n  /**\n   * Handles the deletion of objects that effects are attached to\n   *\n   * @param inUUID\n   * @returns {Promise}\n   */\n  static objectDeleted(inUUID) {\n    const documentsToCheck = game.scenes\n      .filter((scene) => scene.id !== game.user.viewedScene)\n      .map((scene) => [scene, ...lib.get_all_documents_from_scene(scene.id)])\n      .deepFlatten();\n\n    const documentEffectsToEnd = documentsToCheck\n      .map((obj) => {\n        const objEffects = flagManager.getEffectFlags(obj);\n        const effectsToEnd = objEffects.filter(([effectId, effectData]) =>\n          this._effectContextFilter(inUUID, effectData)\n        );\n        return {\n          document: obj,\n          effects: effectsToEnd.map((effect) => effect[0]),\n        };\n      })\n      .filter((obj) => obj.effects.length);\n\n    const visibleEffectsToEnd = this.effects\n      .filter((effect) => this._effectContextFilter(inUUID, effect.data))\n      .map((e) => e.id);\n\n    return Promise.allSettled([\n      this._endManyEffects(visibleEffectsToEnd),\n      ...documentEffectsToEnd.map((obj) => {\n        return flagManager.removeEffectFlags(obj.document.uuid, obj.effects);\n      }),\n    ]);\n  }\n\n  /**\n   * Removes the effect from the manager and ends it, returning a promise that resolves once the effect has fully _ended\n   *\n   * @param effect\n   * @returns {Promise}\n   * @private\n   */\n  static _removeEffect(effect) {\n    SequenceManager.VisibleEffects.delete(effect.id);\n    TemporaryPositionsContainer.delete(effect.data.source);\n    TemporaryPositionsContainer.delete(effect.data.target);\n    return effect.endEffect();\n  }\n}\n","import {\n  EffectPlayer,\n  InteractionManager,\n  SelectionManager,\n} from \"../modules/sequencer-interaction-manager.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport CONSTANTS from \"../constants.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\n\nexport class BaseEffectsLayer extends FoundryShim.InteractionLayer {\n  static get layerOptions() {\n    return foundry.utils.mergeObject(super.layerOptions, {\n      elevation: 100000000,\n      name: CONSTANTS.EFFECTS_LAYER,\n    });\n  }\n}\n\nexport class SequencerInterfaceLayer extends FoundryShim.InteractionLayer {\n  constructor(...args) {\n    super(...args);\n  }\n\n\tisActive = false;\n\n  static get layerOptions() {\n    return foundry.utils.mergeObject(super.layerOptions, {\n      elevation: 100000000,\n      name: CONSTANTS.INTERFACE_LAYER,\n    });\n  }\n\n\tactivate(...args){\n\t\tconst result = super.activate(...args);\n\t\tthis.isActive = true;\n\t\treturn result;\n\t}\n\n  deactivate() {\n    super.deactivate();\n    if (!this.isActive) return;\n    this._clearChildren();\n    this.isActive = false;\n    InteractionManager.tearDown();\n  }\n\n  _setup() {\n    if (!this.UIContainer || this.UIContainer._destroyed) {\n      this.UIContainer = new PIXI.Container();\n      this.UIContainer.sortableChildren = true;\n      this.UIContainer.parentName = \"sequencerUIContainer\";\n      this.UIContainer.zIndex = 10000000000000;\n      this.addChild(this.UIContainer);\n\n      this.linePoint = this.UIContainer.addChild(new PIXI.Graphics());\n      this.line = this.UIContainer.addChild(new PIXI.Graphics());\n      this.lineHead = this.UIContainer.addChild(new PIXI.Graphics());\n      this.suggestionPoint = this.UIContainer.addChild(new PIXI.Graphics());\n      this.effectHoverBoxes = this.UIContainer.addChild(new PIXI.Graphics());\n      this.effectSelectionBorder = this.UIContainer.addChild(\n        new PIXI.Graphics()\n      );\n      this.effectSourcePosition = this.UIContainer.addChild(\n        new PIXI.Graphics()\n      );\n      this.effectTargetPosition = this.UIContainer.addChild(\n        new PIXI.Graphics()\n      );\n\n      this.suggestionPoint.filters = [new PIXI.AlphaFilter(0.75)];\n      this.effectSourcePosition.filters = [new PIXI.AlphaFilter(0.75)];\n      this.effectTargetPosition.filters = [new PIXI.AlphaFilter(0.75)];\n\n      this.effectSelectionBorder.zIndex = 1;\n\n      this.effectSourcePosition.interactive = true;\n      this.effectSourcePosition.on(\"mousedown\", () => {\n        SelectionManager.sourcePointSelected();\n      });\n\n      this.effectTargetPosition.interactive = true;\n      this.effectTargetPosition.on(\"mousedown\", () => {\n        SelectionManager.targetPointSelected();\n      });\n    }\n  }\n\n  async _draw(...args) {}\n\n  render(...args) {\n    super.render(...args);\n    this._setup();\n    this._clearChildren();\n    this._drawHoveredEffectElements();\n    if (!this.isActive) return;\n    this._drawLine();\n    this._drawPoints();\n    this._drawSelectedEffectElements();\n    this._drawSuggestionPoint();\n  }\n\n  _clearChildren() {\n    if (!this.UIContainer) return;\n    this.UIContainer.children.forEach((child) => {\n      child.clear();\n    });\n  }\n\n  _drawLine() {\n    if (\n      !EffectPlayer.startPos ||\n      !EffectPlayer.endPos ||\n      game?.activeTool !== CONSTANTS.TOOLS.PLAY\n    )\n      return;\n\n    this.line.lineStyle(3, CONSTANTS.COLOR.PRIMARY, 1);\n    // If line already present then set its position only\n    this.line.moveTo(EffectPlayer.startPos.x, EffectPlayer.startPos.y);\n    this.line.lineTo(EffectPlayer.endPos.x, EffectPlayer.endPos.y);\n  }\n\n  _drawPoints() {\n    if (game?.activeTool !== CONSTANTS.TOOLS.PLAY) return;\n\n    const startPos = EffectPlayer.startPos || EffectPlayer.cursorPos;\n\n    this.linePoint.beginFill(CONSTANTS.COLOR.PRIMARY);\n    this.linePoint.drawCircle(startPos.x, startPos.y, 5);\n\n    if (EffectPlayer.sourceAttachFound) {\n      this._drawCrossAtLocation(this.linePoint, startPos);\n    }\n\n    if (!EffectPlayer.endPos) return;\n\n    const angle = new Ray(startPos, EffectPlayer.endPos).angle;\n\n    this.lineHead.beginFill(CONSTANTS.COLOR.PRIMARY);\n    this.lineHead.moveTo(0, -5);\n    this.lineHead.lineTo(-15, 30);\n    this.lineHead.lineTo(15, 30);\n    this.lineHead.endFill();\n    this.lineHead.rotation = angle + Math.PI / 2;\n    this.lineHead.position.set(EffectPlayer.endPos.x, EffectPlayer.endPos.y);\n\n    if (EffectPlayer.targetAttachFound) {\n      this.linePoint.beginFill(CONSTANTS.COLOR.SECONDARY);\n      this._drawCrossAtLocation(this.linePoint, EffectPlayer.endPos);\n    }\n  }\n\n  _drawHoveredEffectElements() {\n    const effects = new Set(SelectionManager.hoveredEffects);\n    if (SelectionManager.hoveredEffectUI)\n      effects.add(SelectionManager.hoveredEffectUI);\n    for (const effect of effects) {\n      if (\n        !effect ||\n        effect === SelectionManager.selectedEffect ||\n        effect.data.screenSpace ||\n        effect._isEnding\n      )\n        continue;\n      this._drawBoxAroundEffect(this.effectHoverBoxes, effect);\n    }\n  }\n\n  _drawSelectedEffectElements() {\n    if (!SelectionManager.selectedEffect) return;\n    this._drawBoxAroundEffect(\n      this.effectSelectionBorder,\n      SelectionManager.selectedEffect,\n      true\n    );\n    this._drawEffectStartEndPoints(SelectionManager.selectedEffect);\n  }\n\n  _drawBoxAroundEffect(graphic, effect, selected = false) {\n    if (\n      !effect ||\n      effect._destroyed ||\n      !effect.spriteContainer ||\n      !effect.ready\n    )\n      return;\n\n    graphic.lineStyle(3, selected ? CONSTANTS.COLOR.PRIMARY : 0xffffff, 0.9);\n\n    let boundingBox = effect.sprite.getLocalBounds();\n    let dimensions = {\n      x: effect.position.x + boundingBox.x * effect.sprite.scale.x,\n      y: effect.position.y + boundingBox.y * effect.sprite.scale.y,\n      width: boundingBox.width * effect.sprite.scale.x,\n      height: boundingBox.height * effect.sprite.scale.y,\n    };\n\n    if (effect.data.shapes.length) {\n      for (const shape of Object.values(effect.shapes)) {\n        boundingBox = shape.getLocalBounds();\n        dimensions = {\n          x: Math.min(\n            dimensions.x,\n            effect.position.x + boundingBox.x * shape.scale.x\n          ),\n          y: Math.min(\n            dimensions.y,\n            effect.position.y + boundingBox.y * shape.scale.y\n          ),\n          width: Math.max(dimensions.width, boundingBox.width * shape.scale.x),\n          height: Math.max(\n            dimensions.height,\n            boundingBox.height * shape.scale.y\n          ),\n        };\n      }\n    }\n\n    const rotation = Math.normalizeRadians(\n      effect.rotationContainer.rotation +\n        effect.spriteContainer.rotation +\n        effect.sprite.rotation\n    );\n\n    this._drawRectangle(graphic, effect.position, rotation, dimensions);\n  }\n\n  _drawRectangle(graphic, position, rotation, dimensions) {\n    graphic.moveTo(\n      ...canvaslib.rotate_coordinate(\n        position,\n        {\n          x: dimensions.x,\n          y: dimensions.y,\n        },\n        -rotation\n      )\n    );\n\n    graphic.lineTo(\n      ...canvaslib.rotate_coordinate(\n        position,\n        {\n          x: dimensions.x + dimensions.width,\n          y: dimensions.y,\n        },\n        -rotation\n      )\n    );\n\n    graphic.lineTo(\n      ...canvaslib.rotate_coordinate(\n        position,\n        {\n          x: dimensions.x + dimensions.width,\n          y: dimensions.y + dimensions.height,\n        },\n        -rotation\n      )\n    );\n\n    graphic.lineTo(\n      ...canvaslib.rotate_coordinate(\n        position,\n        {\n          x: dimensions.x,\n          y: dimensions.y + dimensions.height,\n        },\n        -rotation\n      )\n    );\n\n    graphic.lineTo(\n      ...canvaslib.rotate_coordinate(\n        position,\n        {\n          x: dimensions.x,\n          y: dimensions.y,\n        },\n        -rotation\n      )\n    );\n\n    graphic.lineTo(\n      ...canvaslib.rotate_coordinate(\n        position,\n        {\n          x: dimensions.x + dimensions.width,\n          y: dimensions.y,\n        },\n        -rotation\n      )\n    );\n  }\n\n  /**\n   * Draws the start/end point circles\n   * @private\n   */\n  _drawEffectStartEndPoints(effect) {\n    if (!effect || effect._destroyed || !effect.spriteContainer) return;\n\n    if (\n      !effect.data.stretchTo ||\n      !effect.sourcePosition ||\n      !effect.targetPosition\n    )\n      return;\n\n    this.effectSourcePosition.beginFill(CONSTANTS.COLOR.PRIMARY);\n    this.effectSourcePosition.drawCircle(\n      effect.sourcePosition.x,\n      effect.sourcePosition.y,\n      canvas.grid.size * 0.25\n    );\n\n    if (typeof effect.data.source === \"string\") {\n      this._drawCrossAtLocation(\n        this.effectSourcePosition,\n        effect.sourcePosition\n      );\n    }\n\n    this.effectTargetPosition.beginFill(CONSTANTS.COLOR.SECONDARY);\n    this.effectTargetPosition.drawCircle(\n      effect.targetPosition.x,\n      effect.targetPosition.y,\n      canvas.grid.size * 0.25\n    );\n    this.effectTargetPosition.alpha = 0.75;\n\n    if (typeof effect.data.target === \"string\") {\n      this._drawCrossAtLocation(\n        this.effectTargetPosition,\n        effect.targetPosition\n      );\n    }\n  }\n\n  _drawSuggestionPoint() {\n    if (\n      !SelectionManager.suggestedProperties ||\n      !SelectionManager.selectedEffect\n    )\n      return;\n\n    const effect = SelectionManager.selectedEffect;\n    const suggestion = SelectionManager.suggestedProperties;\n\n    this.suggestionPoint.position.set(0, 0);\n    this.suggestionPoint.rotation = 0;\n\n    if (effect.data.stretchTo) {\n      this.suggestionPoint.beginFill(suggestion.color);\n      this.suggestionPoint.drawCircle(\n        suggestion.position.x,\n        suggestion.position.y,\n        canvas.grid.size * 0.25\n      );\n      if (suggestion.showCursor) {\n        this._drawCrossAtLocation(this.suggestionPoint, suggestion.position);\n      }\n      return;\n    }\n\n    const boundingBox = effect.spriteContainer.getLocalBounds();\n\n    const dimensions = {\n      x: boundingBox.x * effect.scale.x,\n      y: boundingBox.y * effect.scale.y,\n      width: boundingBox.width * effect.scale.x,\n      height: boundingBox.height * effect.scale.y,\n    };\n\n    this.suggestionPoint.lineStyle(3, CONSTANTS.COLOR.PRIMARY, 0.9);\n    this.suggestionPoint.position.set(\n      suggestion.position.x,\n      suggestion.position.y\n    );\n    this._drawRectangle(\n      this.suggestionPoint,\n      suggestion.position,\n      effect.rotation,\n      dimensions,\n      true\n    );\n\n    if (suggestion.showCursor) {\n      this.suggestionPoint.beginFill(CONSTANTS.COLOR.SECONDARY);\n      this._drawCrossAtLocation(this.suggestionPoint);\n    }\n\n    if (suggestion.showPoint) {\n      this.suggestionPoint.drawCircle(0, 0, canvas.grid.size * 0.2);\n    }\n  }\n\n  _drawCrossAtLocation(inElement, inPosition = { x: 0, y: 0 }) {\n    inElement.drawRect(\n      inPosition.x + canvas.grid.size * -0.05,\n      inPosition.y + canvas.grid.size * -0.5,\n      canvas.grid.size * 0.1,\n      canvas.grid.size\n    );\n    inElement.drawRect(\n      inPosition.x + canvas.grid.size * -0.5,\n      inPosition.y + canvas.grid.size * -0.05,\n      canvas.grid.size,\n      canvas.grid.size * 0.1\n    );\n  }\n}\n\nexport class UIEffectsLayer extends FoundryShim.InteractionLayer {\n  static get layerOptions() {\n    return foundry.utils.mergeObject(super.layerOptions, {\n      zIndex: 999999999999999,\n      name: \"sequencerEffectsAboveEverything\",\n    });\n  }\n\n  updateTransform() {\n    if (this.sortableChildren && this.sortDirty) {\n      this.sortChildren();\n    }\n\n    this._boundsID++;\n\n    this.transform.updateTransform(PIXI.Transform.IDENTITY);\n    this.worldAlpha = this.alpha;\n\n    for (let child of this.children) {\n      if (child.visible) {\n        child.updateTransform();\n      }\n    }\n  }\n}\n\nlet layer = false;\n\nexport class SequencerAboveUILayer {\n  constructor(name, zIndex = 0.1) {\n    this.canvas = document.createElement(\"canvas\");\n    this.canvas.id = name;\n\n    this.canvas.style.cssText = `\n            position:absolute;\n            touch-action: none;\n            pointer-events: none;\n            width:100%;\n            height:100%;\n            z-index:${zIndex};\n            padding: 0;\n            margin: 0;\n        `;\n\n    document.body.appendChild(this.canvas);\n\n    this.app = new PIXI.Application({\n      width: window.innerWidth,\n      height: window.innerHeight,\n      view: this.canvas,\n      antialias: true,\n      backgroundAlpha: 0.0,\n      sharedTicker: true,\n    });\n\n    this.app.resizeTo = window;\n    this.app.stage.renderable = false;\n  }\n\n  static setup() {\n    if (!game.settings.get(\"sequencer\", \"enable-above-ui-screenspace\")) return;\n    layer = new this(\"sequencerUILayerAbove\", 10000);\n  }\n\n  static getLayer() {\n    return layer ? layer.app.stage : canvas.sequencerEffectsUILayer;\n  }\n\n  static addChild(...args) {\n\t\tconst layer = this.getLayer();\n    const result = layer.addChild(...args);\n\t\tlayer.renderable = layer.children.length > 0;\n    return result;\n  }\n\n  static sortChildren() {\n    return this.getLayer().sortChildren();\n  }\n\n  static removeContainerByEffect(inEffect) {\n\t\tconst layer = this.getLayer();\n\t\tif (!(layer instanceof SequencerAboveUILayer)) return;\n\n    const child = layer.children.find((child) => child === inEffect);\n    if (!child) return;\n    layer.removeChild(child);\n\n    layer.renderable = layer.children.length > 0;\n  }\n\n  updateTransform() {\n    if (this.app.stage.sortableChildren && this.app.stage.sortDirty) {\n      this.app.stage.sortChildren();\n    }\n\n    this.app.stage._boundsID++;\n\n    this.app.stage.transform.updateTransform(PIXI.Transform.IDENTITY);\n    this.app.stage.worldAlpha = this.app.stage.alpha;\n\n    for (let child of this.app.stage.children) {\n      if (child.visible) {\n        child.updateTransform();\n      }\n    }\n  }\n}\n","import FoundryShim from \"../../utils/foundry-shim.js\";\n\nconst tempMat = new PIXI.Matrix();\nconst uvPoint = new PIXI.Point();\n\nclass VisionSamplerShaderGenerator extends FoundryShim.BatchShaderGenerator {\n\tgenerateSampleSrc(maxTextures) {\n\t\tlet src = \"\\n\\n\";\n\t\tfor (let i = 0; i < maxTextures; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsrc += \"\\nelse \";\n\t\t\t}\n\t\t\tif (i < maxTextures - 1) {\n\t\t\t\tsrc += `if(vTextureId < ${i}.5)`;\n\t\t\t}\n\n\t\t\tsrc += \"\\n{\";\n\t\t\tsrc += `\\n\\tcolor = texture(uSamplers[${i}], coord, unclamped == coord ? 0.0f : -32.0f);`;\n\t\t\tsrc += \"\\n}\";\n\t\t}\n\n\t\tsrc += \"\\n\";\n\t\tsrc += \"\\n\";\n\n\t\treturn src;\n\t}\n}\n\nconst emptyColorMatrix = new Uint8Array(20);\n\nexport default class VisionSamplerShader extends FoundryShim.BaseSamplerShader {\n\tstatic classPluginName = \"sequencerVisionBatch\";\n\tstatic batchShaderGeneratorClass = VisionSamplerShaderGenerator;\n\n\tstatic batchGeometry = [\n\t\t{ id: \"aVertexPosition\", size: 2, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aTextureCoord\", size: 2, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aClampOffset\", size: 2, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aClampFrame\", size: 4, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aMapCoord1\", size: 3, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aMapCoord2\", size: 3, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aMapCoord3\", size: 3, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aColor\", size: 4, normalized: true, type: PIXI.TYPES.UNSIGNED_BYTE },\n\t\t{ id: \"aColorMatrixR\", size: 4, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aColorMatrixG\", size: 4, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aColorMatrixB\", size: 4, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aColorMatrixA\", size: 4, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aColorMatrixOffset\", size: 4, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aColorMatrixAlpha\", size: 1, normalized: false, type: PIXI.TYPES.FLOAT },\n\t\t{ id: \"aShaderFlags\", size: 1, normalized: false, type: PIXI.TYPES.UNSIGNED_SHORT },\n\t\t{ id: \"aTextureId\", size: 1, normalized: false, type: PIXI.TYPES.UNSIGNED_SHORT },\n\t];\n\n\tstatic #SHADER_FLAGS = foundry.utils.BitMask.generateShaderBitMaskConstants([\n\t\t\"IS_TILING\",\n\t\t\"IS_VISION_MASKING_ENABLED\",\n\t\t\"IS_COLOR_MATRIX_ENABLED\",\n\t]);\n\n\t/** @override */\n\tstatic batchVertexSize = 42;\n\n\t/** @override */\n\tstatic reservedTextureUnits = 1; // We need a texture unit for the occlusion texture\n\n\t/**\n\t * The batch vertex shader source.\n\t * @type {string}\n\t */\n\tstatic batchVertexShader = /* glsl */ `#version 300 es\n\tprecision highp float;\n\t\n\tuniform vec2 screenDimensions;\n\tuniform mat3 projectionMatrix;\n\tuniform mat3 translationMatrix;\n\tuniform vec4 tint;\n\t\n\tin vec2 aVertexPosition;\n\tin vec2 aTextureCoord;\n\tin vec2 aClampOffset;\n\tin vec4 aClampFrame;\n\tin vec3 aMapCoord1;\n\tin vec3 aMapCoord2;\n\tin vec3 aMapCoord3;\n\tin vec4 aColor;\n\tin vec4 aColorMatrixR;\n\tin vec4 aColorMatrixG;\n\tin vec4 aColorMatrixB;\n\tin vec4 aColorMatrixA;\n\tin vec4 aColorMatrixOffset;\n\tin float aColorMatrixAlpha;\n\tin float aShaderFlags;\n\tin float aTextureId;\n\t\n\tout vec2 vTextureCoord;\n\tout vec2 vVisionCoord;\n\tflat out vec2 vClampOffset;\n\tflat out vec4 vClampFrame;\n\tflat out mat3 vMapCoord;\n\tflat out vec4 vColor;\n\tflat out mat4 vColorMatrix;\n\tflat out vec4 vColorMatrixOffset;\n\tflat out float vColorMatrixAlpha;\n\tflat out uint vShaderFlags;\n\tflat out float vTextureId;\n\t\n\tvoid main(void) {\n\t\tgl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0f)).xy, 0.0f, 1.0f);\n\t\tvTextureCoord = aTextureCoord;\n\t\tvVisionCoord = aVertexPosition / screenDimensions;\n\t\tvColor = aColor * tint;\n\t\tvClampOffset = aClampOffset;\n\t\tvClampFrame = aClampFrame;\n\t\tvMapCoord = mat3(aMapCoord1, aMapCoord2, aMapCoord3);\n\t\tvColorMatrix = mat4(aColorMatrixR, aColorMatrixG, aColorMatrixB, aColorMatrixA);\n\t\tvColorMatrixOffset = aColorMatrixOffset;\n\t\tvColorMatrixAlpha = aColorMatrixAlpha;\n\t\tvShaderFlags = uint(aShaderFlags);\n\t\tvTextureId = aTextureId;\n\t}\n\t`;\n\n\t/**\n\t * The batch fragment shader source.\n\t * @type {string}\n\t */\n\tstatic batchFragmentShader = /* glsl */ `#version 300 es\n\tprecision mediump float;\n\n\tin vec2 vTextureCoord;\n\tin vec2 vVisionCoord;\n\tflat in float vTextureId;\n\tflat in vec4 vColor;\n\tflat in mat3 vMapCoord;\n\tflat in uint vShaderFlags;\n\tflat in vec2 vClampOffset;\n\tflat in vec4 vClampFrame;\n\tflat in mat4 vColorMatrix;\n\tflat in vec4 vColorMatrixOffset;\n\tflat in float vColorMatrixAlpha;\n\n\tuniform bool enableVisionMasking;\n\tuniform sampler2D visionMaskTexture;\n\tuniform sampler2D uSamplers[%count%];\n\tout vec4 fragColor;\n\n\t${VisionSamplerShader.#SHADER_FLAGS}\n\n\tvoid main(void){\n\t\tbool isTilingEnabled = ((vShaderFlags & IS_TILING) == IS_TILING);\n\t\tbool isVisionMaskingEnabled = ((vShaderFlags & IS_VISION_MASKING_ENABLED) == IS_VISION_MASKING_ENABLED);\n\t\tbool isColorMatrixEnabled = ((vShaderFlags & IS_COLOR_MATRIX_ENABLED) == IS_COLOR_MATRIX_ENABLED);\n\n\t\tvec2 coord = vTextureCoord;\n\t\tvec2 unclamped;\n\t\tif (isTilingEnabled) {\n\t\t\tcoord = coord + ceil(vClampOffset - coord);\n\t\t\tcoord = (vMapCoord * vec3(coord, 1.0)).xy;\n\t\t\tunclamped = coord;\n\t\t\tcoord = clamp(coord, vClampFrame.xy, vClampFrame.zw);\n\t\t} else {\n\t\t\tunclamped = coord;\n\t  }\n\t  float mask = isVisionMaskingEnabled && enableVisionMasking ? texture(visionMaskTexture, vVisionCoord).r : 1.0;\n\n\t  vec4 color;\n\t  %forloop%\n\n\t\tif (isColorMatrixEnabled && vColorMatrixAlpha > 0.0) {\n\t\t\tif (color.a > 0.0) {\n\t      color.rgb /= color.a;\n\t    }\n\t\t\tvec4 result = color * vColorMatrix + vColorMatrixOffset;\n\n\t\t\tvec3 rgb = mix(color.rgb, result.rgb, vColorMatrixAlpha);\n\t\t\trgb *= result.a;\n\t\t\tcolor = vec4(rgb, result.a);\n\t  }\n\t  fragColor = color * mask * vColor;\n\t}\t\n\t`;\n\n\t/** @override */\n\tstatic batchDefaultUniforms(maxTex) {\n\t\treturn {\n\t\t\tscreenDimensions: [1, 1],\n\t\t\tvisionMaskTexture: maxTex,\n\t\t};\n\t}\n\n\t/** @override */\n\tstatic _preRenderBatch(batchRenderer) {\n\t\tconst uniforms = batchRenderer._shader.uniforms;\n\t\tuniforms.screenDimensions = canvas.screenDimensions;\n\t\tuniforms.enableVisionMasking = canvas?.visibility?.visible ?? canvas?.effects?.visibility?.visible ?? true;\n\t\tbatchRenderer.renderer.texture.bind(canvas.masks.vision.renderTexture, uniforms.visionMaskTexture);\n\t}\n\n\t/** @override */\n\tstatic _packInterleavedGeometry(element, attributeBuffer, indexBuffer, aIndex, iIndex) {\n\t\tconst { float32View, uint32View, uint16View } = attributeBuffer;\n\n\t\t/** @type {import(\"../meshes/TilingSpriteMesh\").default} */\n\t\tconst mesh = element.object;\n\t\t// Write indices into buffer\n\t\tconst packedVertices = aIndex / this.vertexSize;\n\t\tconst indices = element.indices;\n\t\tfor (let i = 0; i < indices.length; i++) {\n\t\t\tindexBuffer[iIndex++] = packedVertices + indices[i];\n\t\t}\n\n\t\t// Prepare attributes\n\t\tconst vertexData = element.vertexData;\n\t\tlet uvs = element.uvs;\n\t\tconst alpha = Math.min(element.worldAlpha, 1.0);\n\t\tconst baseTexture = element._texture.baseTexture;\n\t\tconst argb = PIXI.Color.shared.setValue(element._tintRGB).toPremultiplied(alpha, baseTexture.alphaMode > 0);\n\t\tconst textureId = element._texture.baseTexture._batchLocation;\n\t\tconst mapCoord = mesh.uvMatrix.mapCoord.toArray(true);\n\t\tlet clampFrame = mesh.uvMatrix.uClampFrame;\n\t\tlet clampOffset = mesh.uvMatrix.uClampOffset;\n\t\tif (mesh.tiling) {\n\t\t\tconst tex = element._texture;\n\t\t\tconst w = tex.width;\n\t\t\tconst h = tex.height;\n\t\t\tconst W = mesh.width;\n\t\t\tconst H = mesh.height;\n\t\t\tconst lt = mesh.tileTransform.localTransform;\n\t\t\ttempMat.set((lt.a * w) / W, (lt.b * w) / H, (lt.c * h) / W, (lt.d * h) / H, lt.tx / W, lt.ty / H);\n\n\t\t\tconst anchorX = mesh.uvRespectAnchor ? mesh.anchor.x : 0;\n\t\t\tconst anchorY = mesh.uvRespectAnchor ? mesh.anchor.y : 0;\n\n\t\t\tuvs[0] = uvs[6] = -anchorX;\n\t\t\tuvs[1] = uvs[3] = -anchorY;\n\t\t\tuvs[2] = uvs[4] = 1.0 - anchorX;\n\t\t\tuvs[5] = uvs[7] = 1.0 - anchorY;\n\t\t}\n\n\t\t// Write attributes into buffer\n\t\tconst vertexSize = this.vertexSize;\n\t\tconst colorMatrixArray = mesh.colorMatrixFilter?.matrix ?? emptyColorMatrix;\n\t\tconst colorMatrixAlpha = mesh.colorMatrixFilter?.alpha ?? 1;\n\t\tfor (let i = 0, j = 0; i < vertexData.length; i += 2, j += vertexSize) {\n\t\t\tuvPoint.set(uvs[i], uvs[i + 1]);\n\t\t\tif (mesh.tiling) {\n\t\t\t\ttempMat.applyInverse(uvPoint, uvPoint);\n\t\t\t}\n\t\t\tlet k = aIndex + j;\n\t\t\tfloat32View[k++] = vertexData[i];\n\t\t\tfloat32View[k++] = vertexData[i + 1];\n\t\t\tfloat32View[k++] = uvPoint.x;\n\t\t\tfloat32View[k++] = uvPoint.y;\n\t\t\tfloat32View[k++] = clampOffset[0];\n\t\t\tfloat32View[k++] = clampOffset[1];\n\t\t\tfloat32View[k++] = clampFrame[0];\n\t\t\tfloat32View[k++] = clampFrame[1];\n\t\t\tfloat32View[k++] = clampFrame[2];\n\t\t\tfloat32View[k++] = clampFrame[3];\n\t\t\tfloat32View[k++] = mapCoord[0];\n\t\t\tfloat32View[k++] = mapCoord[1];\n\t\t\tfloat32View[k++] = mapCoord[2];\n\t\t\tfloat32View[k++] = mapCoord[3];\n\t\t\tfloat32View[k++] = mapCoord[4];\n\t\t\tfloat32View[k++] = mapCoord[5];\n\t\t\tfloat32View[k++] = mapCoord[6];\n\t\t\tfloat32View[k++] = mapCoord[7];\n\t\t\tfloat32View[k++] = mapCoord[8];\n\t\t\tuint32View[k++] = argb;\n\n\t\t\tfloat32View[k++] = colorMatrixArray[0];\n\t\t\tfloat32View[k++] = colorMatrixArray[1];\n\t\t\tfloat32View[k++] = colorMatrixArray[2];\n\t\t\tfloat32View[k++] = colorMatrixArray[3];\n\n\t\t\tfloat32View[k++] = colorMatrixArray[5];\n\t\t\tfloat32View[k++] = colorMatrixArray[6];\n\t\t\tfloat32View[k++] = colorMatrixArray[7];\n\t\t\tfloat32View[k++] = colorMatrixArray[8];\n\n\t\t\tfloat32View[k++] = colorMatrixArray[10];\n\t\t\tfloat32View[k++] = colorMatrixArray[11];\n\t\t\tfloat32View[k++] = colorMatrixArray[12];\n\t\t\tfloat32View[k++] = colorMatrixArray[13];\n\n\t\t\tfloat32View[k++] = colorMatrixArray[15];\n\t\t\tfloat32View[k++] = colorMatrixArray[16];\n\t\t\tfloat32View[k++] = colorMatrixArray[17];\n\t\t\tfloat32View[k++] = colorMatrixArray[18];\n\n\t\t\tfloat32View[k++] = colorMatrixArray[4];\n\t\t\tfloat32View[k++] = colorMatrixArray[9];\n\t\t\tfloat32View[k++] = colorMatrixArray[14];\n\t\t\tfloat32View[k++] = colorMatrixArray[19];\n\n\t\t\tfloat32View[k++] = colorMatrixAlpha;\n\n\t\t\tk <<= 1;\n\t\t\tuint16View[k++] = mesh.shaderFlags.valueOf();\n\t\t\tuint16View[k++] = textureId;\n\t\t}\n\t}\n\n\t// need to override createPlugin as canvas.performance is not defined in foundry when\n\t// we need it to be\n\tstatic createPlugin() {\n    const shaderClass = this;\n    const geometryClass = Array.isArray(shaderClass.batchGeometry)\n      ? class BatchGeometry extends PIXI.Geometry {\n        constructor(_static=false) {\n          super();\n          this._buffer = new PIXI.Buffer(null, _static, false);\n          this._indexBuffer = new PIXI.Buffer(null, _static, true);\n          for ( const {id, size, normalized, type} of shaderClass.batchGeometry ) {\n            this.addAttribute(id, this._buffer, size, normalized, type);\n          }\n          this.addIndex(this._indexBuffer);\n        }\n      } : shaderClass.batchGeometry;\n    return class BatchPlugin extends shaderClass.batchRendererClass {\n\n      /** @override */\n      static get shaderGeneratorClass() {\n        return shaderClass.batchShaderGeneratorClass;\n      }\n\n      /* ---------------------------------------- */\n\n      /** @override */\n      static get defaultVertexSrc() {\n        return shaderClass.batchVertexShader;\n      }\n\n      /* ---------------------------------------- */\n\n      /** @override */\n      static get defaultFragmentTemplate() {\n        return shaderClass.batchFragmentShader;\n      }\n\n      /* ---------------------------------------- */\n\n      /** @override */\n      static get defaultUniforms() {\n        return shaderClass.batchDefaultUniforms;\n      }\n\n      /* ---------------------------------------- */\n\n      /**\n       * The batch plugin constructor.\n       * @param {PIXI.Renderer} renderer    The renderer\n       */\n      constructor(renderer) {\n        super(renderer);\n        this.geometryClass = geometryClass;\n        this.vertexSize = shaderClass.batchVertexSize;\n        this.reservedTextureUnits = shaderClass.reservedTextureUnits;\n        this._packInterleavedGeometry = shaderClass._packInterleavedGeometry;\n        this._preRenderBatch = shaderClass._preRenderBatch;\n      }\n\n      /* ---------------------------------------- */\n\n      /** @inheritdoc */\n      setShaderGenerator(options) {\n        // if ( !canvas.performance ) return;\n        super.setShaderGenerator(options);\n      }\n\n      /* ---------------------------------------- */\n\n      /** @inheritdoc */\n      contextChange() {\n        this.shaderGenerator = null;\n        super.contextChange();\n      }\n    };\n  }\n}\n","import VisionSamplerShader from \"../filters/vision-sampler-shader.js\";\nimport FoundryShim from \"../../utils/foundry-shim.js\";\n\n/**\n * Extends SpriteMesh to allow for tiling of sprites\n */\nexport default class TilingSpriteMesh extends FoundryShim.SpriteMesh {\n\t/** @type {PIXI.Transform} */\n\ttileTransform;\n\n\t/** @type {PIXI.TextureMatrix} */\n\tuvMatrix;\n\n\t/** @type {PIXI.ColorMatrixFilter} */\n\t#colorMatrixFilter;\n\n\tshaderFlags = new foundry.utils.BitMask({\n\t\tisTiling: false,\n\t\tisVisionMaskingEnabled: true,\n\t\tisColorMatrixEnabled: false,\n\t});\n\n\t/**\n\t * @param {PIXI.Texture} texture - The {@link PIXI.Texture} bound to this mesh\n\t * @param {object} [options = {}]\n\t * @property {typeof BaseSamplerShader} options.shaderClassader Shader class used by this sprite mesh.\n\t * @property {boolean} options.tiling Shader class used by this sprite mesh.\n\t * @property {boolean} options.isVisionMaskingEnabled Shader class used by this sprite mesh.\n\t */\n\tconstructor(texture, { shaderClass = VisionSamplerShader, tiling = false, isVisionMaskingEnabled = true } = {}) {\n\t\tsuper(texture, shaderClass);\n\t\tthis.tileTransform = new PIXI.Transform();\n\t\tthis.tiling = tiling;\n\t\tthis.isVisionMaskingEnabled = isVisionMaskingEnabled;\n\t\tthis.uvMatrix = this.texture.uvMatrix || new PIXI.TextureMatrix(texture);\n\t}\n\n\tget tiling() {\n\t\treturn this.shaderFlags.hasState('isTiling')\n\t}\n\t/**\n\t * @param {boolean} value\n\t */\n\tset tiling(value) {\n\t\tthis.shaderFlags.toggleState('isTiling', value)\n\t}\n\n\t\n\tget isVisionMaskingEnabled() {\n\t\treturn this.shaderFlags.hasState('isVisionMaskingEnabled')\n\t}\n\t/**\n\t * @param {boolean} value\n\t */\n\tset isVisionMaskingEnabled(value) {\n\t\tthis.shaderFlags.toggleState('isVisionMaskingEnabled', value)\n\t}\n\n\t/**\n\t * @param {PIXI.ColorMatrixFilter | null} value\n\t */\n\tset colorMatrixFilter(value) {\n\t\tthis.shaderFlags.toggleState('isColorMatrixEnabled', value != null)\n\t\tthis.#colorMatrixFilter = value;\n\t}\n\tget colorMatrixFilter() {\n\t\treturn this.#colorMatrixFilter;\n\t}\n\n\t/** The scaling of the image that is being tiled. */\n\tget tileScale() {\n\t\treturn this.tileTransform.scale;\n\t}\n\n\tset tileScale(value) {\n\t\tthis.tileTransform.scale.copyFrom(value);\n\t}\n\n\t/** The offset of the image that is being tiled. */\n\tget tilePosition() {\n\t\treturn this.tileTransform.position;\n\t}\n\n\tset tilePosition(value) {\n\t\tthis.tileTransform.position.copyFrom(value);\n\t}\n\n\t_onTextureUpdate() {\n\t\tsuper._onTextureUpdate();\n\t\tif (this.uvMatrix) {\n\t\t\tthis.uvMatrix.texture = this._texture;\n\t\t}\n\t}\n\n\t/**\n\t * Renders the object using the WebGL renderer\n\t * @param renderer - The renderer\n\t */\n\t_render(renderer) {\n\t\tthis.uvMatrix.update();\n\t\tthis.tileTransform.updateLocalTransform();\n\t\tsuper._render(renderer);\n\t}\n\n\tdestroy() {\n\t\tsuper.destroy();\n\t\tthis.tileTransform = null;\n\t\tthis.uvMatrix = null;\n\t}\n}\n","import VisionSamplerShader from \"../filters/vision-sampler-shader.js\";\nimport TilingSpriteMesh from \"./TilingSpriteMesh.js\";\n\n/**\n * This is a 1:1 copy of the animated sprite code but set atop the TilingSpriteMesh\n */\nexport default class AnimatedSpriteMesh extends TilingSpriteMesh {\n\t/**\n\t * @param textures - An array of {@link PIXI.Texture} or frame\n\t *  objects that make up the animation.\n\t * @param {object} [options = {}]\n\t * @property {typeof BaseSamplerShader} options.shaderClassader Shader class used by this sprite mesh.\n\t * @property {boolean} options.tiling Shader class used by this sprite mesh.\n\t * @property {boolean} options.isVisionMaskingEnabled Shader class used by this sprite mesh.\n\t */\n\tconstructor(\n\t\ttextures,\n\t\t{ autoUpdate = true, shaderClass = VisionSamplerShader, isVisionMaskingEnabled = true, tiling } = {}\n\t) {\n\t\tconst texture = textures[0] instanceof PIXI.Texture ? textures[0] : textures[0].texture;\n\t\tsuper(texture, { shaderClass, tiling, isVisionMaskingEnabled });\n\t\tthis._textures = [];\n\t\tthis._durations = null;\n\t\tthis._autoUpdate = autoUpdate;\n\t\tthis._isConnectedToTicker = false;\n\t\tthis.animationSpeed = 1;\n\t\tthis.loop = true;\n\t\tthis.updateAnchor = false;\n\t\tthis.onComplete = null;\n\t\tthis.onFrameChange = null;\n\t\tthis.onLoop = null;\n\t\tthis._currentTime = 0;\n\t\tthis._playing = false;\n\t\tthis._previousFrame = null;\n\t\tthis.textures = textures;\n\t}\n\t/** Stops the AnimatedSprite. */\n\tstop() {\n\t\tif (!this._playing) {\n\t\t\treturn;\n\t\t}\n\t\tthis._playing = false;\n\t\tif (this._autoUpdate && this._isConnectedToTicker) {\n\t\t\tPIXI.Ticker.shared.remove(this.update, this);\n\t\t\tthis._isConnectedToTicker = false;\n\t\t}\n\t}\n\t/** Plays the AnimatedSprite. */\n\tplay() {\n\t\tif (this._playing) {\n\t\t\treturn;\n\t\t}\n\t\tthis._playing = true;\n\t\tif (this._autoUpdate && !this._isConnectedToTicker) {\n\t\t\tPIXI.Ticker.shared.add(this.update, this, PIXI.UPDATE_PRIORITY.HIGH);\n\t\t\tthis._isConnectedToTicker = true;\n\t\t}\n\t}\n\t/**\n\t * Stops the AnimatedSprite and goes to a specific frame.\n\t * @param frameNumber - Frame index to stop at.\n\t */\n\tgotoAndStop(frameNumber) {\n\t\tthis.stop();\n\t\tthis.currentFrame = frameNumber;\n\t}\n\t/**\n\t * Goes to a specific frame and begins playing the AnimatedSprite.\n\t * @param frameNumber - Frame index to start at.\n\t */\n\tgotoAndPlay(frameNumber) {\n\t\tthis.currentFrame = frameNumber;\n\t\tthis.play();\n\t}\n\t/**\n\t * Updates the object transform for rendering.\n\t * @param deltaTime - Time since last tick.\n\t */\n\tupdate(deltaTime) {\n\t\tif (!this._playing) {\n\t\t\treturn;\n\t\t}\n\t\tconst elapsed = this.animationSpeed * deltaTime;\n\t\tconst previousFrame = this.currentFrame;\n\t\tif (this._durations !== null) {\n\t\t\tlet lag = (this._currentTime % 1) * this._durations[this.currentFrame];\n\t\t\tlag += (elapsed / 60) * 1000;\n\t\t\twhile (lag < 0) {\n\t\t\t\tthis._currentTime--;\n\t\t\t\tlag += this._durations[this.currentFrame];\n\t\t\t}\n\t\t\tconst sign = Math.sign(this.animationSpeed * deltaTime);\n\t\t\tthis._currentTime = Math.floor(this._currentTime);\n\t\t\twhile (lag >= this._durations[this.currentFrame]) {\n\t\t\t\tlag -= this._durations[this.currentFrame] * sign;\n\t\t\t\tthis._currentTime += sign;\n\t\t\t}\n\t\t\tthis._currentTime += lag / this._durations[this.currentFrame];\n\t\t} else {\n\t\t\tthis._currentTime += elapsed;\n\t\t}\n\t\tif (this._currentTime < 0 && !this.loop) {\n\t\t\tthis.gotoAndStop(0);\n\t\t\tif (this.onComplete) {\n\t\t\t\tthis.onComplete();\n\t\t\t}\n\t\t} else if (this._currentTime >= this._textures.length && !this.loop) {\n\t\t\tthis.gotoAndStop(this._textures.length - 1);\n\t\t\tif (this.onComplete) {\n\t\t\t\tthis.onComplete();\n\t\t\t}\n\t\t} else if (previousFrame !== this.currentFrame) {\n\t\t\tif (this.loop && this.onLoop) {\n\t\t\t\tif (\n\t\t\t\t\t(this.animationSpeed > 0 && this.currentFrame < previousFrame) ||\n\t\t\t\t\t(this.animationSpeed < 0 && this.currentFrame > previousFrame)\n\t\t\t\t) {\n\t\t\t\t\tthis.onLoop();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.updateTexture();\n\t\t}\n\t}\n\t/** Updates the displayed texture to match the current frame index. */\n\tupdateTexture() {\n\t\tconst currentFrame = this.currentFrame;\n\t\tif (this._previousFrame === currentFrame) {\n\t\t\treturn;\n\t\t}\n\t\tthis._previousFrame = currentFrame;\n\t\tthis._texture = this._textures[currentFrame];\n\t\tthis._textureID = -1;\n\t\tthis._textureTrimmedID = -1;\n\t\tthis._cachedTint = [1, 1, 1, 1];\n\t\tthis.uvs.set(this._texture._uvs.uvsFloat32);\n\t\t\n\t\tif (this.updateAnchor) {\n\t\t\tthis._anchor.copyFrom(this._texture.defaultAnchor);\n\t\t}\n\t\tif (this.onFrameChange) {\n\t\t\tthis.onFrameChange(this.currentFrame);\n\t\t}\n\t\tif (this.uvMatrix) {\n\t\t\tthis.uvMatrix.texture = this._texture;\n\t\t}\n\t}\n\tdestroy(options) {\n\t\tthis.stop();\n\t\tsuper.destroy(options);\n\t\tthis.onComplete = null;\n\t\tthis.onFrameChange = null;\n\t\tthis.onLoop = null;\n\t}\n\t/**\n\t * A short hand way of creating an AnimatedSprite from an array of frame ids.\n\t * @param frames - The array of frames ids the AnimatedSprite will use as its texture frames.\n\t * @returns - The new animated sprite with the specified frames.\n\t */\n\tstatic fromFrames(frames) {\n\t\tconst textures = [];\n\t\tfor (let i = 0; i < frames.length; ++i) {\n\t\t\ttextures.push(PIXI.Texture.from(frames[i]));\n\t\t}\n\t\treturn new AnimatedSprite(textures);\n\t}\n\t/**\n\t * A short hand way of creating an AnimatedSprite from an array of image ids.\n\t * @param images - The array of image urls the AnimatedSprite will use as its texture frames.\n\t * @returns The new animate sprite with the specified images as frames.\n\t */\n\tstatic fromImages(images) {\n\t\tconst textures = [];\n\t\tfor (let i = 0; i < images.length; ++i) {\n\t\t\ttextures.push(PIXI.Texture.from(images[i]));\n\t\t}\n\t\treturn new AnimatedSprite(textures);\n\t}\n\t/**\n\t * The total number of frames in the AnimatedSprite. This is the same as number of textures\n\t * assigned to the AnimatedSprite.\n\t * @readonly\n\t * @default\n\t */\n\tget totalFrames() {\n\t\treturn this._textures.length;\n\t}\n\t/** The array of textures used for this AnimatedSprite. */\n\tget textures() {\n\t\treturn this._textures;\n\t}\n\tset textures(value) {\n\t\tif (value[0] instanceof PIXI.Texture) {\n\t\t\tthis._textures = value;\n\t\t\tthis._durations = null;\n\t\t} else {\n\t\t\tthis._textures = [];\n\t\t\tthis._durations = [];\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tthis._textures.push(value[i].texture);\n\t\t\t\tthis._durations.push(value[i].time);\n\t\t\t}\n\t\t}\n\t\tthis._previousFrame = null;\n\t\tthis.gotoAndStop(0);\n\t\tthis.updateTexture();\n\t}\n\t/** The AnimatedSprite's current frame index. */\n\tget currentFrame() {\n\t\tlet currentFrame = Math.floor(this._currentTime) % this._textures.length;\n\t\tif (currentFrame < 0) {\n\t\t\tcurrentFrame += this._textures.length;\n\t\t}\n\t\treturn currentFrame;\n\t}\n\tset currentFrame(value) {\n\t\tif (value < 0 || value > this.totalFrames - 1) {\n\t\t\tthrow new Error(\n\t\t\t\t`[AnimatedSprite]: Invalid frame index value ${value}, ` +\n\t\t\t\t\t`expected to be between 0 and totalFrames ${this.totalFrames}.`\n\t\t\t);\n\t\t}\n\t\tconst previousFrame = this.currentFrame;\n\t\tthis._currentTime = value;\n\t\tif (previousFrame !== this.currentFrame) {\n\t\t\tthis.updateTexture();\n\t\t}\n\t}\n\t/**\n\t * Indicates if the AnimatedSprite is currently playing.\n\t * @readonly\n\t */\n\tget playing() {\n\t\treturn this._playing;\n\t}\n\t/** Whether to use Ticker.shared to auto update animation time. */\n\tget autoUpdate() {\n\t\treturn this._autoUpdate;\n\t}\n\tset autoUpdate(value) {\n\t\tif (value !== this._autoUpdate) {\n\t\t\tthis._autoUpdate = value;\n\t\t\tif (!this._autoUpdate && this._isConnectedToTicker) {\n\t\t\t\tPIXI.Ticker.shared.remove(this.update, this);\n\t\t\t\tthis._isConnectedToTicker = false;\n\t\t\t} else if (this._autoUpdate && !this._isConnectedToTicker && this._playing) {\n\t\t\t\tPIXI.Ticker.shared.add(this.update, this);\n\t\t\t\tthis._isConnectedToTicker = true;\n\t\t\t}\n\t\t}\n\t}\n}\n","// @ts-check\nimport AnimatedSpriteMesh from \"../lib/meshes/AnimatedSpriteMesh.js\";\nimport TilingSpriteMesh from \"../lib/meshes/TilingSpriteMesh.js\";\nimport SequencerFileCache from \"../modules/sequencer-file-cache.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\nclass Asset {\n\tdestroy() {\n\t\t// nothing to do in the general case\n\t}\n}\nclass TextureAsset extends Asset {\n\tfilepath;\n\ttexture;\n\tconstructor({ filepath, texture }) {\n\t\tsuper();\n\t\tthis.filepath = filepath;\n\t\tthis.texture = texture;\n\t}\n}\nclass VideoAsset extends Asset {\n\t/** @type {string} */\n\tfilepath;\n\n\t/** @type {PIXI.Texture} */\n\ttexture;\n\n\t/** @type {HTMLVideoElement  } */\n\tvideo;\n\n\t/**\n\t *\n\t * @param {object} params\n\t * @param {string} params.filepath\n\t * @param {PIXI.Texture} params.texture\n\t * @param {HTMLVideoElement} params.video\n\t */\n\tconstructor({ filepath, texture, video }) {\n\t\tsuper();\n\t\tthis.filepath = filepath;\n\t\tthis.texture = texture;\n\t\tthis.video = video;\n\t}\n\tdestroy() {\n\t\ttry {\n\t\t\tthis.video.pause();\n\t\t\tURL.revokeObjectURL(this.video.src);\n\t\t\tthis.video.removeAttribute(\"src\");\n\t\t\tthis.video.onerror = null;\n\t\t\tthis.video.oncanplay = null;\n\t\t\tthis.video.load();\n\t\t\t// @ts-expect-error can only be null after destroy\n\t\t\tthis.video = null;\n\t\t} catch (err) {}\n\t\tthis.texture.destroy(true);\n\t}\n}\nclass VideoSpritesheetAsset extends Asset {\n\t/** @type {string} */\n\tfilepath;\n\n\t/** @type {PIXI.Spritesheet} */\n\tspritesheet;\n\n\t/** @type {PIXI.FrameObject[]} */\n\tframeObjects;\n\n\t/** @type {number} */\n\tframerate;\n\n\t/**\n\t * @param {object} params\n\t * @param {string} params.filepath\n\t * @param {PIXI.Spritesheet} params.spritesheet\n\t */\n\tconstructor({ filepath, spritesheet }) {\n\t\tsuper();\n\t\tthis.filepath = filepath;\n\t\tthis.spritesheet = spritesheet;\n\t\t// @ts-expect-error framerate is either there or undefined, stop complaining typescript...\n\t\tthis.framerate = this.spritesheet.data?.meta?.frameRate ?? 30;\n\t\tconst frametime = (1 / this.framerate) * 1000;\n\t\tthis.frameObjects = (Object.values(spritesheet.animations)[0] ?? []).map((texture) => ({\n\t\t\ttexture,\n\t\t\ttime: frametime,\n\t\t}));\n\t\tthis.#register();\n\t}\n\tdestroy() {\n\t\treturn SequencerFileCache.unloadSpritesheet(this.filepath);\n\t}\n\t#register() {\n\t\tSequencerFileCache.registerSpritesheet(this.filepath, this.spritesheet);\n\t}\n}\nclass FlipbookAsset extends Asset {\n\t/** @type {string[]} */\n\tfilepaths;\n\n\t/** @type {PIXI.FrameObject[]} */\n\tframeObjects;\n\n\t/** @type {number} */\n\tframerate;\n\n\t/**\n\t * @param {object} params\n\t * @param {string[]} params.filepaths\n\t * @param {PIXI.Texture[]} params.textures\n\t * @param {number} params.framerate\n\t */\n\tconstructor({ filepaths, textures, framerate = 24 }) {\n\t\tsuper();\n\t\tthis.filepaths = filepaths;\n\t\tthis.framerate = framerate;\n\t\tconst frametime = (1 / framerate) * 1000;\n\t\tthis.frameObjects = textures.map((texture) => ({ texture, time: frametime }));\n\t}\n\tdestroy() {\n\t\t// TODO maybe add spritesheet-like ref counting for flipbooks too?\n\t}\n}\n//#endregion\n//#region Playback controls\nclass PlaybackControls {\n\tdestroy() {}\n}\nclass VideoPlaybackControls extends PlaybackControls {\n\t/** @type {HTMLVideoElement} */\n\t#video;\n\n\t/** @type {PIXI.Texture} */\n\t#texture;\n\n\t/**\n\t * @param {HTMLVideoElement} video\n\t * @param {PIXI.Texture} texture\n\t */\n\tconstructor(video, texture) {\n\t\tsuper();\n\t\tthis.#video = video;\n\t\tthis.#texture = texture;\n\t}\n\tasync play() {\n\t\ttry {\n\t\t\tawait this.#video.play();\n\t\t\tthis.#texture.update();\n\t\t} catch (error) {}\n\t}\n\tstop() {\n\t\tthis.#video.pause();\n\t}\n\tget duration() {\n\t\treturn this.#video.duration;\n\t}\n\tget isPlaying() {\n\t\treturn !this.#video.paused;\n\t}\n\tget loop() {\n\t\treturn this.#video.loop;\n\t}\n\tset loop(value) {\n\t\tthis.#video.loop = value;\n\t}\n\tget volume() {\n\t\treturn this.#video.volume;\n\t}\n\tset volume(value) {\n\t\tthis.#video.muted = !value;\n\t\tthis.#video.volume = value;\n\t}\n\tget currentTime() {\n\t\treturn this.#video.currentTime;\n\t}\n\tset currentTime(value) {\n\t\tthis.#video.currentTime = value;\n\t}\n\tget playbackRate() {\n\t\treturn this.#video.playbackRate;\n\t}\n\tset playbackRate(value) {\n\t\tthis.#video.playbackRate = value;\n\t}\n\tdestroy() {\n\t\tthis.stop();\n\t\t// @ts-expect-error should be null only when destroyed\n\t\tthis.#video = null;\n\t\t// @ts-expect-error should be null only when destroyed\n\t\tthis.#texture = null;\n\t}\n}\n\nclass SpritePlaybackControls extends PlaybackControls {\n\t/** @type {AnimatedSpriteMesh} */\n\t#sprite;\n\n\t/** @type {number} */\n\t#framerate;\n\n\t/** @type {number} */\n\t#framecount;\n\n\t/**\n\t * @param {AnimatedSpriteMesh} sprite\n\t * @param {number} framerate\n\t * @param {number} framecount\n\t */\n\tconstructor(sprite, framerate, framecount) {\n\t\tsuper();\n\t\tthis.#sprite = sprite;\n\t\tthis.#framerate = framerate;\n\t\tthis.#framecount = framecount;\n\t}\n\tasync play() {\n\t\tthis.#sprite.play();\n\t}\n\tstop() {\n\t\tthis.#sprite.stop();\n\t}\n\tget duration() {\n\t\treturn this.#framecount / this.#framerate;\n\t}\n\tget isPlaying() {\n\t\treturn this.#sprite.playing;\n\t}\n\tget loop() {\n\t\treturn this.#sprite.loop;\n\t}\n\tset loop(value) {\n\t\tthis.#sprite.loop = value;\n\t}\n\tget volume() {\n\t\treturn 0;\n\t}\n\tset volume(_value) {}\n\n\tget currentTime() {\n\t\t// return currentTime rounded with ms accuracy.\n\t\t// This solves issues with videos vor example having 265 frames, 24 fps.\n\t\t// This resolves to an accurate total time of 11.04166.. s, whereas\n\t\t// the reported time from the video file would be 11.042s.\n\t\tconst accurateTime = (this.#sprite.currentFrame + 1) / this.#framerate;\n\t\treturn Math.round(accurateTime * 1000) / 1000;\n\t}\n\tset currentTime(value) {\n\t\tconst newFrame = Math.floor(value * this.#framerate);\n\t\tconst newFrameIndex = Math.clamp(newFrame, 0, this.#framecount - 1);\n\t\tif (this.#sprite.playing) {\n\t\t\tthis.#sprite.gotoAndPlay(newFrameIndex);\n\t\t} else {\n\t\t\tthis.#sprite.gotoAndStop(newFrameIndex);\n\t\t}\n\t}\n\tget playbackRate() {\n\t\treturn this.#sprite.animationSpeed;\n\t}\n\tset playbackRate(value) {\n\t\tthis.#sprite.animationSpeed = value;\n\t}\n\n\tdestroy() {\n\t\tthis.stop();\n\t\t// @ts-expect-error should be null only when destroyed\n\t\tthis.#sprite = null;\n\t}\n}\n\nexport class SequencerSpriteManager extends PIXI.Container {\n\t// @ts-ignore\n\t#id = foundry.utils.randomID();\n\n\t/** @type {import(\"../modules/sequencer-file.js\").SequencerFile} */\n\t#file;\n\n\t/** @type {{ antialiasing: PIXI.SCALE_MODES; tiling?: boolean; xray?: boolean; isPersisted: boolean }} */\n\t#sharedSpriteConfig;\n\n\t/** @type {string | undefined} */\n\t#activeAssetPath;\n\n\t/** @type {Map<string | undefined, VideoAsset | VideoSpritesheetAsset | TextureAsset | FlipbookAsset>} */\n\t#relatedAssets = new Map();\n\n\t/** @type {VideoPlaybackControls | SpritePlaybackControls | null} */\n\t#playbackControls;\n\n\t/** @type {Promise<void> | undefined} */\n\t#preloadingPromise;\n\n\t/** @type {TilingSpriteMesh | null} */\n\t#managedSprite;\n\n\t/** @type {PIXI.Text | null} */\n\t#textSprite;\n\n\t/** @type {{width: number, height: number, scaleX: number, scaleY: number}} */\n\t#defaultScaling = {\n\t\twidth: 0,\n\t\theight: 0,\n\t\tscaleX: 1,\n\t\tscaleY: 1,\n\t};\n\n\tget preloadingPromise() {\n\t\tif (this.#preloadingPromise) {\n\t\t\treturn this.#preloadingPromise;\n\t\t}\n\t\treturn Promise.resolve();\n\t}\n\n\t/**\n\t * @param {import(\"../modules/sequencer-file.js\").SequencerFile} file\n\t * @param {{ antialiasing: PIXI.SCALE_MODES; tiling?: boolean; xray?: boolean; isPersisted: boolean }} options\n\t */\n\tconstructor(file, options) {\n\t\tsuper();\n\t\tthis.#sharedSpriteConfig = options ?? {\n\t\t\tantialiasing: PIXI.SCALE_MODES.LINEAR,\n\t\t\ttiling: false,\n\t\t\txray: false,\n\t\t\tisPersisted: false,\n\t\t};\n\t\tthis.#file = file;\n\t}\n\t//#region public api\n\tget activePath() {\n\t\treturn this.#activeAssetPath;\n\t}\n\n\tget activeAsset() {\n\t\treturn this.#relatedAssets.get(this.activePath);\n\t}\n\n\tget texture() {\n\t\treturn this.managedSprite?.texture;\n\t}\n\n\tget managedSprite() {\n\t\treturn this.#managedSprite;\n\t}\n\n\t/** @return {PreciseText | null} */\n\tget textSprite() {\n\t\treturn this.#textSprite\n\t}\n\n\t/**\n\t * caches current scaling values to be used for spritesheet scaling if needed\n\t */\n\tupdateDefaultScaling() {\n\t\tthis.#defaultScaling = {\n\t\t\tscaleX: this.scale.x,\n\t\t\tscaleY: this.scale.y,\n\t\t\twidth: this.width,\n\t\t\theight: this.height,\n\t\t};\n\t}\n\n\tupdateVideoTextures() {\n\t\t// CHECKME lets see if this works without update texture.\n\t\tthis.#managedSprite?.texture?.update();\n\t}\n\t/**\n\t * @param {string | undefined} filePath\n\t */\n\tasync activate(filePath) {\n\t\tif (!filePath || this.#activeAssetPath === filePath) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet nextAsset = this.#relatedAssets.get(filePath);\n\t\t// new file is already being loaded, nothing more to do\n\t\tif (this.#relatedAssets.has(filePath) && nextAsset == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!nextAsset) {\n\t\t\tthis.#relatedAssets[filePath] = undefined;\n\t\t\tnextAsset = await this.#loadAsset(filePath);\n\t\t\tif (this.destroyed) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#relatedAssets.set(filePath, nextAsset);\n\t\t}\n\n\t\tif (this.#activateAsset(nextAsset)) {\n\t\t\tthis.#activeAssetPath = filePath;\n\t\t}\n\t\tif (this.#sharedSpriteConfig.isPersisted && !this.#sharedSpriteConfig.tiling) {\n\t\t\trequestAnimationFrame(async () => {\n\t\t\t\tconst minimumScale = this.#calculateMinimumSpritesheetScale();\n\t\t\t\tconst spritesheet = await SequencerFileCache.requestCompiledSpritesheet(filePath, {\n\t\t\t\t\tminimumScale: minimumScale,\n\t\t\t\t});\n\t\t\t\tif (!spritesheet) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst previousAsset = this.activeAsset;\n\t\t\t\tconst asset = new VideoSpritesheetAsset({ filepath: filePath, spritesheet });\n\t\t\t\tthis.#relatedAssets.set(filePath, asset);\n\t\t\t\tif (this.destroyed || this.#activeAssetPath !== filePath) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.#activateAsset(asset);\n\t\t\t\tpreviousAsset?.destroy();\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t * @param {{ text: string | null; textStyle: Partial<PIXI.ITextStyle> | PIXI.TextStyle }} textData\n\t */\n\taddText(textData) {\n\t\tif (this.#textSprite) {\n\t\t\tthis.#textSprite.text = textData.text ?? \"\";\n\t\t\treturn this.#textSprite;\n\t\t}\n\t\tconst textSprite = new PreciseText(textData.text ?? \"\", textData.textStyle);\n\t\ttextSprite.resolution = 5;\n\t\ttextSprite.zIndex = 1;\n\t\ttextSprite.anchor.set(0.5, 0.5);\n\t\tthis.#textSprite = textSprite;\n\t\treturn this.addChild(textSprite);\n\t}\n\tremoveText() {\n\t\tthis.#textSprite?.destroy();\n\t\tthis.#textSprite = null;\n\t}\n\n\t/**\n\t * @param {string | number} filepath\n\t */\n\tremoveSprite(filepath) {\n\t\tthis.#relatedAssets[filepath]?.destroy();\n\t\tdelete this.#relatedAssets[filepath];\n\t}\n\tasync preloadVariants() {\n\t\tif (!this.#preloadingPromise) {\n\t\t\treturn (this.#preloadingPromise = this.#preloadVariants());\n\t\t}\n\t\treturn this.#preloadingPromise;\n\t}\n\tdestroy() {\n\t\tthis.#playbackControls?.destroy();\n\t\tfor (const asset of this.#relatedAssets.values()) {\n\t\t\tasset?.destroy();\n\t\t}\n\t\tthis.#relatedAssets.clear();\n\t\tthis.managedSprite?.removeFromParent();\n\t\tthis.managedSprite?.destroy();\n\t\tsuper.destroy({ children: true });\n\t}\n\t//#endregion\n\t//#region Managed Sprite proxies\n\tasync play() {\n\t\tthis.#playbackControls?.play();\n\t}\n\tstop() {\n\t\tthis.#playbackControls?.stop();\n\t}\n\tget tileScale() {\n\t\treturn this.managedSprite?.tileScale;\n\t}\n\tset tileScale(point) {\n\t\tif (point) {\n\t\t\tthis.managedSprite?.tileScale.copyFrom(point);\n\t\t}\n\t}\n\tget tilePosition() {\n\t\treturn this.managedSprite?.tilePosition;\n\t}\n\tset tilePosition(point) {\n\t\tif (point) {\n\t\t\tthis.managedSprite?.tilePosition.copyFrom(point);\n\t\t}\n\t}\n\tget anchor() {\n\t\treturn this.managedSprite?.anchor;\n\t}\n\tset anchor(point) {\n\t\tif (point) {\n\t\t\tthis.managedSprite?.anchor.copyFrom(point);\n\t\t}\n\t}\n\tget tint() {\n\t\treturn this.managedSprite?.tint ?? 0xffffff;\n\t}\n\tset tint(value) {\n\t\tif (this.managedSprite) {\n\t\t\tthis.managedSprite.tint = typeof value === \"number\" ? Math.floor(value) : value;\n\t\t}\n\t}\n\tget scale() {\n\t\treturn this.managedSprite?.scale || super.scale;\n\t}\n\tset scale(point) {\n\t\tthis.managedSprite?.scale.copyFrom(point);\n\t}\n\tget width() {\n\t\treturn this.managedSprite?.width ?? 0;\n\t}\n\tset width(value) {\n\t\tif (!this.managedSprite) {\n\t\t\treturn;\n\t\t}\n\t\tthis.managedSprite.width = value;\n\t}\n\tget height() {\n\t\treturn this.managedSprite?.height ?? 0;\n\t}\n\tset height(value) {\n\t\tif (!this.managedSprite) {\n\t\t\treturn;\n\t\t}\n\t\tthis.managedSprite.height = value;\n\t}\n\tget resolution() {\n\t\treturn this.#textSprite?.resolution;\n\t}\n\tset resolution(value) {\n\t\tif (!this.#textSprite) return;\n\t\tthis.#textSprite.resolution = value ?? 5;\n\t}\n\n\t/** @type {} */\n\tget hasAnimatedMedia() {\n\t\treturn (\n\t\t\tthis.activeAsset instanceof VideoAsset ||\n\t\t\tthis.activeAsset instanceof VideoSpritesheetAsset ||\n\t\t\tthis.activeAsset instanceof FlipbookAsset\n\t\t);\n\t}\n\tget playing() {\n\t\treturn this.#playbackControls?.isPlaying ?? false;\n\t}\n\tget duration() {\n\t\treturn this.#playbackControls?.duration ?? 0;\n\t}\n\tget volume() {\n\t\treturn this.#playbackControls?.volume ?? 0;\n\t}\n\tset volume(value) {\n\t\tif (!this.#playbackControls) return;\n\t\tthis.#playbackControls.volume = value;\n\t}\n\tget loop() {\n\t\treturn this.#playbackControls?.loop ?? false;\n\t}\n\tset loop(value) {\n\t\tif (!this.#playbackControls) return;\n\t\tthis.#playbackControls.loop = value;\n\t}\n\tget currentTime() {\n\t\treturn this.#playbackControls?.currentTime ?? 0;\n\t}\n\tset currentTime(value) {\n\t\tif (!this.#playbackControls) return;\n\t\tthis.#playbackControls.currentTime = value;\n\t}\n\tget playbackRate() {\n\t\treturn this.#playbackControls?.playbackRate ?? 1;\n\t}\n\tset playbackRate(value) {\n\t\tif (!this.#playbackControls) return;\n\t\tthis.#playbackControls.playbackRate = value;\n\t}\n\t/** @return {PIXI.ColorMatrixFilter | null} */\n\tget colorMatrixFilter() {\n\t\treturn this.managedSprite?.colorMatrixFilter ?? null;\n\t}\n\tset colorMatrixFilter(value) {\n\t\tif (!this.managedSprite) return;\n\t\tthis.managedSprite.colorMatrixFilter = value;\n\t\tif (this.#textSprite) {\n\t\t\tif (value) {\n\t\t\t\tthis.#textSprite.filters?.push(value);\n\t\t\t} else if (this.#textSprite.filters) {\n\t\t\t\tthis.#textSprite.filters = this.#textSprite.filters.filter(\n\t\t\t\t\t(filter) => !(filter instanceof PIXI.ColorMatrixFilter)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync #preloadVariants() {\n\t\tif (this.#activeAssetPath === \"TEXT\") {\n\t\t\treturn;\n\t\t}\n\t\tif (!this.#file || this.#file.isFlipbook) {\n\t\t\treturn;\n\t\t}\n\t\t/** @type {string[]} */\n\t\tconst allFiles = this.#file.getAllFiles();\n\n\t\tfor (const filePath of allFiles) {\n\t\t\tif (this.#relatedAssets[filePath]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst asset = await this.#loadAsset(filePath);\n\t\t\tthis.#relatedAssets.set(filePath, asset);\n\t\t}\n\t}\n\n\t/**\n\t * @param {string} filepath\n\t */\n\tasync #loadAsset(filepath) {\n\t\tif (this.#file && this.#file.isFlipbook) {\n\t\t\treturn this.#loadFlipbook(this.#file.getAllFiles(), this.#file.originalMetadata);\n\t\t}\n\t\tconst texture = await SequencerFileCache.loadFile(filepath);\n\t\t// disable mipmaps if using compressed textures and no level information is given.\n\t\t// for some reason, the integrated basis_universal transcoder does not set this\n\t\t// correctly.\n\t\tif (\n\t\t\ttexture?.baseTexture?.resource instanceof PIXI.CompressedTextureResource &&\n\t\t\ttexture?.baseTexture?.resource.levels === 1\n\t\t) {\n\t\t\ttexture?.baseTexture?.setStyle(0, 0);\n\t\t} else if (\n\t\t\tthis.#sharedSpriteConfig.antialiasing &&\n\t\t\tthis.#sharedSpriteConfig.antialiasing !== PIXI.SCALE_MODES.LINEAR\n\t\t) {\n\t\t\ttexture?.baseTexture.setStyle(0, this.#sharedSpriteConfig.antialiasing);\n\t\t}\n\t\tif (texture instanceof PIXI.Spritesheet) {\n\t\t\treturn new VideoSpritesheetAsset({ filepath, spritesheet: texture });\n\t\t}\n\t\tif (texture.baseTexture?.resource?.source instanceof HTMLVideoElement) {\n\t\t\treturn new VideoAsset({ filepath, texture, video: texture.baseTexture.resource.source });\n\t\t}\n\t\treturn new TextureAsset({ filepath, texture });\n\t}\n\n\t/**\n\t * @param {string[]} filepaths\n\t * @param {{ fps: number; }} metadata\n\t */\n\tasync #loadFlipbook(filepaths, metadata) {\n\t\tconst textures = (await Promise.all(filepaths.map(async (filepath) => FoundryShim.loadTexture(filepath)))).filter(\n\t\t\t(t) => t instanceof PIXI.Texture\n\t\t);\n\t\treturn new FlipbookAsset({ filepaths, textures, framerate: metadata?.fps ?? 24 });\n\t}\n\n\t/**\n\t * @param {VideoAsset | VideoSpritesheetAsset | TextureAsset | FlipbookAsset} nextAsset\n\t * @returns\n\t */\n\t#activateAsset(nextAsset) {\n\t\tlet view;\n\t\tlet controls;\n\t\tconst tiling = this.#sharedSpriteConfig.tiling;\n\t\tconst isVisionMaskingEnabled = !this.#sharedSpriteConfig.xray;\n\t\tif (nextAsset instanceof VideoAsset) {\n\t\t\tview = new TilingSpriteMesh(nextAsset.texture, { isVisionMaskingEnabled, tiling });\n\t\t\tcontrols = new VideoPlaybackControls(nextAsset.video, nextAsset.texture);\n\t\t} else if (nextAsset instanceof VideoSpritesheetAsset || nextAsset instanceof FlipbookAsset) {\n\t\t\tview = new AnimatedSpriteMesh(nextAsset.frameObjects, {\n\t\t\t\tautoUpdate: true,\n\t\t\t\tisVisionMaskingEnabled,\n\t\t\t\ttiling: !!tiling,\n\t\t\t});\n\t\t\tcontrols = new SpritePlaybackControls(view, nextAsset.framerate, nextAsset.frameObjects.length);\n\t\t} else if (nextAsset instanceof TextureAsset) {\n\t\t\tview = new TilingSpriteMesh(nextAsset.texture, { isVisionMaskingEnabled, tiling });\n\t\t\tcontrols = null;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t\t// apply current values\n\t\tthis.#applyPreviousValues(view, controls);\n\n\t\tif (this.#playbackControls) {\n\t\t\tthis.#playbackControls.destroy();\n\t\t} else {\n\t\t\tcontrols?.play();\n\t\t}\n\t\tthis.#playbackControls = controls;\n\n\t\tif (this.managedSprite) {\n\t\t\tthis.managedSprite.removeFromParent();\n\t\t\tthis.managedSprite.destroy();\n\t\t}\n\t\tthis.#managedSprite = view;\n\t\tthis.addChildAt(view, 0);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t *\n\t * @param {TilingSpriteMesh} view\n\t * @param {VideoPlaybackControls | SpritePlaybackControls | null} controls\n\t */\n\t#applyPreviousValues(view, controls) {\n\t\tif (this.managedSprite) {\n\t\t\tconst prev = this.managedSprite;\n\t\t\tview.tint = prev.tint;\n\t\t\tview.anchor.copyFrom(prev.anchor);\n\t\t\tview.scale.copyFrom(prev.scale);\n\t\t\tview.width = prev.width;\n\t\t\tview.height = prev.height;\n\t\t\tview.tileScale.copyFrom(prev.tileScale);\n\t\t\tview.tilePosition.copyFrom(prev.tilePosition);\n\t\t\tview.pivot.copyFrom(prev.pivot);\n\t\t\tview.skew.copyFrom(prev.skew);\n\t\t\tview.alpha = prev.alpha;\n\t\t\tview.colorMatrixFilter = prev.colorMatrixFilter;\n\t\t\tview.position.copyFrom(prev.position);\n\t\t\tview.alphaMode = prev.alphaMode;\n\t\t\tview.blendMode = prev.blendMode;\n\t\t\tview.cullable = prev.cullable;\n\t\t\tview.renderable = prev.renderable;\n\t\t\tview.visible = prev.visible;\n\t\t\tview.tiling = prev.tiling;\n\t\t}\n\n\t\tif (controls && this.#playbackControls) {\n\t\t\tconst prev = this.#playbackControls;\n\t\t\tcontrols.volume = prev.volume;\n\t\t\tcontrols.loop = prev.loop;\n\t\t\tcontrols.playbackRate = prev.playbackRate;\n\t\t\tcontrols.currentTime = prev.currentTime;\n\t\t\tif (prev.isPlaying) {\n\t\t\t\tcontrols.play();\n\t\t\t} else {\n\t\t\t\tcontrols.stop();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * calculates the minimum scale required for generated spritesheets\n\t * @returns {number}\n\t */\n\t#calculateMinimumSpritesheetScale() {\n\t\tconst defaultScale = this.#defaultScaling;\n\t\t// Return the largest of the x, y scaling factors.\n\t\t// if any of those is 0, fall back to the default 1x scaling.\n\t\tconst maxScale = Math.max(defaultScale.scaleX || 1, defaultScale.scaleY || 1);\n\n\t\t// Never return a value larger than 1 as it makes no sense to upscale the video\n\t\t// textures for spritesheets\n\t\treturn Math.min(maxScale, 1);\n\t}\n}\n//#endregion\n","import { get_mouse_position, } from \"../../lib/canvas-lib.js\";\r\nimport { is_real_number } from \"../../lib/lib.js\";\r\nimport CONSTANTS from \"../../constants.js\";\r\nimport * as lib from \"../../lib/lib.js\"\r\nimport FoundryShim from \"../../utils/foundry-shim.js\";\r\n\r\nexport default class CrosshairsPlaceable extends FoundryShim.MeasuredTemplate {\r\n\r\n\tconstructor(...args) {\r\n\t\tsuper(...args);\r\n\t\tthis.tag = \"sequencer-crosshair-\" + foundry.utils.randomID();\r\n\t\tthis.cachedLocation = false;\r\n\t}\r\n\r\n\t#handlers = {\r\n\t\tmouseup: null, move: null, wheel: null\r\n\t};\r\n\r\n\t#promise = {\r\n\t\tresolve: null,\r\n\t};\r\n\r\n\t#isDrag = false;\r\n\t#isPanning = false;\r\n\t#customText = false;\r\n\t#distanceText = false;\r\n\t#rangeHighlight = false;\r\n\tisValid = true;\r\n\r\n\t#lastPositions = false;\r\n\r\n\tget crosshair() {\r\n\t\treturn this.document.crosshair;\r\n\t}\r\n\r\n\tget callbacks() {\r\n\t\treturn this.document.callbacks;\r\n\t}\r\n\r\n\tget range() {\r\n\t\tconst objLocation = this.crosshair.location.obj?.center ?? this.crosshair.location.obj;\r\n\t\treturn canvas.grid.measurePath([objLocation, this.position]).distance;\r\n\t}\r\n\r\n\tupdateCrosshair(data) {\r\n\t\tthis.document.crosshair = foundry.utils.mergeObject(this.document.crosshair, data);\r\n\t\tif(this.#customText){\r\n\t\t\tthis.#customText.destroy();\r\n\t\t\tthis.#customText = null;\r\n\t\t}\r\n\t\tif(this.#distanceText){\r\n\t\t\tthis.#distanceText.destroy();\r\n\t\t\tthis.#distanceText = null;\r\n\t\t}\r\n\t\tif(this.#rangeHighlight){\r\n\t\t\tthis.#rangeHighlight.destroy();\r\n\t\t\tthis.#rangeHighlight = null;\r\n\t\t}\r\n\t\treturn this.draw();\r\n\t}\r\n\r\n\tasync #refreshIcon() {\r\n\t\tthis.controlIcon.renderable = !!this.crosshair.icon.texture;\r\n\t\tif (this.crosshair.icon.texture) {\r\n\t\t\tthis.controlIcon.iconSrc = this.crosshair.icon.texture;\r\n\t\t\tthis.controlIcon.texture = await FoundryShim.loadTexture(this.controlIcon.iconSrc);\r\n\t\t\tthis.controlIcon.icon.texture = this.controlIcon.texture;\r\n\t\t}\r\n\t\tif (!this.crosshair.icon.borderVisible) {\r\n\t\t\tthis.controlIcon.bg.clear();\r\n\t\t}\r\n\t}\r\n\r\n\t_refreshRulerText() {\r\n\t\tconst shapeWidth = this.shape.width ?? 0;\r\n\t\tconst shapeHeight = this.shape.height ?? 0;\r\n\t\tif (this.crosshair.location.showRange && this.crosshair.location.obj) {\r\n\t\t\tif (!this.#distanceText && this.crosshair.location.obj) {\r\n\t\t\t\tconst style = CONFIG.canvasTextStyle.clone();\r\n\t\t\t\tstyle.align = \"center\";\r\n\t\t\t\tthis.#distanceText = this.template.addChild(new PreciseText(\"\", style));\r\n\t\t\t}\r\n\t\t\tconst actualHeight = (this.shapeHeight || this.shape.radius) + (canvas.grid.size / 2);\r\n\t\t\tthis.#distanceText.anchor.set(0.5, 0.5);\r\n\t\t\tthis.#distanceText.position.set((shapeWidth / 2), actualHeight);\r\n\t\t\tconst { units } = this.document.parent.grid;\r\n\t\t\tthis.#distanceText.text = this.range.toString() + \" \" + units;\r\n\t\t}\r\n\t\tthis.ruler.renderable = !!this.crosshair.label?.text;\r\n\t\tif (!this.ruler.renderable) return;\r\n\t\tif (this.crosshair.label?.text) {\r\n\t\t\tif (!this.#customText) {\r\n\t\t\t\tconst style = CONFIG.canvasTextStyle.clone();\r\n\t\t\t\tstyle.align = \"center\";\r\n\t\t\t\tthis.#customText = this.template.addChild(new PreciseText(\"\", style));\r\n\t\t\t}\r\n\t\t\tif (this.#customText.text !== this.crosshair.label.text) this.#customText.text = this.crosshair.label.text;\r\n\t\t\tthis.#customText.anchor.set(0.5);\r\n\t\t\tthis.#customText.position.set(\r\n\t\t\t\t(shapeWidth / 2) + this.crosshair.label.dx ?? 0,\r\n\t\t\t\t(shapeHeight / 2) + this.crosshair.label.dy ?? 0\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tif (this.#customText) {\r\n\t\t\t\tthis.#customText.text = \"\";\r\n\t\t\t\tthis.#customText.destroy();\r\n\t\t\t\tthis.#customText = null;\r\n\t\t\t}\r\n\t\t\treturn super._refreshRulerText();\r\n\t\t}\r\n\t}\r\n\r\n\t_refreshTemplate() {\r\n\t\tconst t = this.template.clear();\r\n\r\n\t\t// Draw the Template outline\r\n\t\tt.lineStyle(this._borderThickness, this.document.borderColor, this.crosshair.borderAlpha).beginFill(0x000000, 0.0);\r\n\r\n\t\t// Fill Color or Texture\r\n\t\tif (this.texture) {\r\n\t\t\tconst d = canvas.dimensions;\r\n\t\t\tlet { direction, distance } = this.document;\r\n\t\t\tdistance *= (d.size / d.distance);\r\n\r\n\t\t\tconst textureAlpha = this.crosshair.textureAlpha || 0.5;\r\n\t\t\tlet textureScale = this.crosshair.textureScale || 1;\r\n\t\t\tlet textureSize = distance * textureScale;\r\n\r\n\t\t\tlet xScale = 1;\r\n\t\t\tlet yScale = 1;\r\n\t\t\tlet xOffset = 0;\r\n\t\t\tlet yOffset = 0;\r\n\r\n\t\t\tswitch (this.document.t) {\r\n\t\t\t\tcase 'circle':\r\n          xOffset = yOffset = textureSize;\r\n          xScale = yScale = textureSize * 2 / this.texture.width;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'cone':\r\n          textureSize /= 2;\r\n          yOffset = -textureSize;\r\n          xScale = yScale = textureSize * 2 / this.texture.width;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'rect':\r\n          // textureSize is basically the hypotenuse, multiple by cos/sin to get the width/height of the rect\r\n          xScale = textureSize * Math.cos(Math.toRadians(direction)) / this.texture.width;\r\n          yScale = textureSize * Math.sin(Math.toRadians(direction)) / this.texture.height;\r\n          textureSize /= 2;\r\n          // don't change angle of texture as the shape of the rect changes width/height\r\n          direction = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'ray':\r\n          yOffset = this.document.width / d.distance * d.size / 2;\r\n          xScale = textureSize / this.texture.width;\r\n          yScale = textureSize / this.texture.height;\r\n          yScale *= this.document.width / this.document.distance;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tt.beginTextureFill({\r\n\t\t\t\ttexture: this.texture,\r\n\t\t\t\tmatrix: new PIXI.Matrix()\r\n\t\t\t\t\t.scale(xScale, yScale)\r\n\t\t\t\t\t.translate(xOffset, yOffset)\r\n\t\t\t\t\t.rotate(Math.toRadians(direction)),\r\n\t\t\t\talpha: textureAlpha,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tt.beginFill(0x000000, 0.0);\r\n\t\t}\r\n\r\n\t\t// Draw the shape\r\n\t\tt.drawShape(this.shape);\r\n\r\n\t\tif (!this.crosshair.lockDrag) {\r\n\t\t\t// Draw origin and destination points\r\n\t\t\tt.lineStyle(this._borderThickness, 0x000000)\r\n\t\t\t\t.beginFill(0x000000, 0.5)\r\n\t\t\t\t.drawCircle(0, 0, 6)\r\n\t\t\t\t.drawCircle(this.ray.dx, this.ray.dy, 6)\r\n\t\t\t\t.endFill();\r\n\t\t}\r\n\t}\r\n\r\n\t#refreshRangeHighlight() {\r\n\r\n\t\tconst loc = this.crosshair.location;\r\n\r\n\t\tif(!loc.displayRangePoly || !loc.obj || loc.limitMaxRange === null) return;\r\n\r\n\t\tif(this.#rangeHighlight){\r\n\t\t\tthis.#rangeHighlight.clear();\r\n\t\t}else{\r\n\t\t\tthis.#rangeHighlight = new PIXI.Graphics();\r\n\t\t\tcanvas.tokens.addChild(this.#rangeHighlight);\r\n\t\t\tthis.#rangeHighlight.zIndex = -1;\r\n\t\t\tthis.#rangeHighlight.interactive = false;\r\n\t\t\tcanvas.tokens.sortChildren();\r\n\t\t}\r\n\r\n\t\tconst object = loc.obj;\r\n\r\n\t\tconst position = {\r\n\t\t\tx: object?.center?.x ?? object?.position?.x ?? object?.x,\r\n\t\t\ty: object?.center?.y ?? object?.position?.y ?? object?.y\r\n\t\t};\r\n\r\n    const defaultSize = canvas.dimensions.distancePixels;\r\n\t\tconst { w, h } = object;\r\n\t\tconst distance = loc.limitMaxRange + ((Math.max(w ?? defaultSize, h ?? defaultSize) / 2) / canvas.dimensions.distancePixels);\r\n\r\n\t\tthis.#rangeHighlight\r\n\t\t\t.beginFill(loc.rangePolyFillColor ?? 0xFFFFFF, lib.clamp(loc.rangePolyFillAlpha ?? 0.25, 0.0, 1.0))\r\n\t\t\t.lineStyle(2, loc.rangePolyLineColor ?? 0xFF0000, lib.clamp(loc.rangePolyLineAlpha ?? 0.5, 0.0, 1.0))\r\n\t\t\t.drawPolygon(canvas.grid.getCircle(position, distance));\r\n\r\n\t}\r\n\r\n\tasync show() {\r\n\t\tawait this.draw();\r\n\t\tthis.layer.addChild(this);\r\n\t\tthis.oldInteractiveChildren = this.layer.interactiveChildren;\r\n\t\tthis.layer.interactiveChildren = false;\r\n\t\tthis.#updateLocation();\r\n\t\tthis.#refreshRangeHighlight();\r\n\t\tthis.#runCallback(CONSTANTS.CALLBACKS.SHOW, this);\r\n\t\treturn this.#activateShowListeners();\r\n\t}\r\n\r\n\tasync #activateShowListeners() {\r\n\t\treturn new Promise((resolve) => {\r\n\t\t\tthis.#promise.resolve = resolve;\r\n\t\t\tthis.#handlers.move = this.#onMove.bind(this);\r\n\t\t\tthis.#handlers.mouseup = this.#onMouseUp.bind(this);\r\n\t\t\tthis.#handlers.wheel = this.#onWheel.bind(this);\r\n\t\t\t// Canvas.stage.removeAllListeners();\r\n\t\t\tcanvas.stage.on(\"mousemove\", this.#handlers.move);\r\n\t\t\tcanvas.stage.on(\"pointerup\", this.#handlers.mouseup);\r\n\t\t\tcanvas.app.view.onwheel = this.#handlers.wheel;\r\n\t\t});\r\n\t}\r\n\r\n\t#getSnappedPoint(point, mode = this.crosshair.snap.position, resolution = this.crosshair.snap.resolution) {\r\n\t\tresolution = !resolution || resolution <= 0 ? canvas.grid.size : resolution;\r\n\t\treturn canvas.grid.getSnappedPoint(point, { mode, resolution: resolution });\r\n\t}\r\n\r\n\t#onMove(evt) {\r\n\r\n\t\tconst now = Date.now();\r\n\t\tconst leftDown = (evt.buttons & 1) > 0;\r\n\t\tconst rightDown = (evt.buttons & 2) > 0;\r\n\t\tthis.#isDrag = !!(leftDown && canvas.mouseInteractionManager.isDragging);\r\n\t\tthis.#isPanning = this.#isPanning || !!(rightDown && canvas.mouseInteractionManager.isDragging);\r\n\r\n\t\tif (this.#isPanning) return;\r\n\r\n\t\tif (this.#isDrag) {\r\n\t\t\tcanvas.mouseInteractionManager.cancel(evt);\r\n\t\t}\r\n\r\n\t\tevt.preventDefault();\r\n\r\n\t\t// Apply a 20ms throttle\r\n\t\tif (now - this.moveTime <= 20) return;\r\n\r\n\t\tconst moved = this.#updateLocation();\r\n\r\n\t\tthis.#runCallback(CONSTANTS.CALLBACKS.MOUSE_MOVE, this);\r\n\t\tif (moved) this.#runCallback(CONSTANTS.CALLBACKS.MOVE, this);\r\n\r\n\t\tthis.#updateLineOfSight();\r\n\r\n\t\tthis.refresh();\r\n\t\tthis.moveTime = now;\r\n\t}\r\n\r\n\t#updateLineOfSight() {\r\n\r\n\t\tif (!this.crosshair.location?.obj || this.crosshair.location?.wallBehavior === CONSTANTS.PLACEMENT_RESTRICTIONS.ANYWHERE) return;\r\n\r\n\t\tconst object = this.crosshair.location.obj;\r\n\t\tconst objLocation = {\r\n\t\t\tx: object?.center?.x ?? object?.position?.x ?? object?.x,\r\n\t\t\ty: object?.center?.y ?? object?.position?.y ?? object?.y\r\n\t\t};\r\n\t\tconst location = { x: this.document.x, y: this.document.y };\r\n\r\n\t\tconst exitEarly = this.#lastPositions && (this.#lastPositions.obj.x === objLocation.x\r\n\t\t\t&& this.#lastPositions.obj.y === objLocation.y\r\n\t\t\t&& this.#lastPositions.tgt.x === location.x\r\n\t\t\t&& this.#lastPositions.tgt.y === location.y);\r\n\r\n\t\tthis.#lastPositions = {\r\n\t\t\tobj: objLocation,\r\n\t\t\ttgt: location\r\n\t\t}\r\n\r\n\t\tif (exitEarly) return;\r\n\r\n\t\tconst type = this.crosshair.location?.wallBehavior === CONSTANTS.PLACEMENT_RESTRICTIONS.LINE_OF_SIGHT\r\n\t\t\t? \"sight\"\r\n\t\t\t: \"move\";\r\n\r\n\t\tconst collisions = CONFIG.Canvas.polygonBackends.sight.testCollision(objLocation, location, {\r\n\t\t\ttype,\r\n\t\t\tuseThreshold: true\r\n\t\t});\r\n\r\n\t\tconst wasValid = this.isValid;\r\n\t\tthis.isValid = !collisions.length;\r\n\r\n\t\tif(!this.isValid && wasValid){\r\n\t\t\tthis.#runCallback(CONSTANTS.CALLBACKS.COLLIDE, this, collisions);\r\n\t\t}else if(this.isValid && !wasValid){\r\n\t\t\tthis.#runCallback(CONSTANTS.CALLBACKS.STOP_COLLIDING, this);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t#handleLockedEdge(mouseLocation) {\r\n\r\n\t\tlet snappedMouseLocation = this.#getSnappedPoint(mouseLocation, CONST.GRID_SNAPPING_MODES.CENTER);\r\n\t\tconst { lockToEdgeDirection } = this.crosshair.location;\r\n\r\n\t\tconst placeable = this.crosshair.location.obj;\r\n\t\tconst shape = placeable.getShape();\r\n\t\tconst { w, h } = this.crosshair.location.obj;\r\n\r\n\t\tconst shapePoints = shape?.points ?? [0, 0, w, 0, w, h, 0, h];\r\n\t\tconst points = shapePoints.map((point, i) => {\r\n\t\t\tconst worldCoord = i % 2 === 0 ? (placeable.document.x) : (placeable.document.y)\r\n\t\t\treturn point + worldCoord;\r\n\t\t});\r\n\r\n\t\tconst centerPoint = placeable.getCenterPoint();\r\n\t\tconst ray = new Ray(centerPoint, mouseLocation);\r\n\r\n\t\tlet intersection;\r\n\t\tfor (let i = 0; i < points.length; i += 2) {\r\n\t\t\tintersection = ray.intersectSegment([points[i], points[i + 1], points[i + 2 >= points.length ? 0 : i + 2], points[i + 3 >= points.length ? 1 : i + 3]]);\r\n\t\t\tif (intersection) break;\r\n\t\t}\r\n\r\n\t\tif (!intersection) return {};\r\n\r\n\t\tlet snappedIntersection = this.#getSnappedPoint(intersection, CONST.GRID_SNAPPING_MODES.EDGE_MIDPOINT);\r\n\r\n\t\tif (canvas.scene.grid.type === CONST.GRID_TYPES.SQUARE) {\r\n\t\t\tconst size = this.document.parent.grid.size;\r\n\t\t\tconst left = snappedMouseLocation.x < points[0]\r\n\t\t\tconst above = snappedMouseLocation.y < points[1];\r\n\t\t\tconst right = snappedMouseLocation.x > points[2];\r\n\t\t\tconst below = snappedMouseLocation.y > points[5];\r\n\t\t\tif ((left || right) && (below || above)) {\r\n\t\t\t\tsnappedIntersection.x = left ? points[0] - size : (right ? points[2] + size : snappedIntersection.x);\r\n\t\t\t\tsnappedIntersection.y = above ? points[1] - size : (right ? points[5] + size : snappedIntersection.y);\r\n\t\t\t\tif (above && left) {\r\n\t\t\t\t\tsnappedIntersection.x = points[0];\r\n\t\t\t\t\tsnappedIntersection.y = points[1];\r\n\t\t\t\t} else if (above && right) {\r\n\t\t\t\t\tsnappedIntersection.x = points[2];\r\n\t\t\t\t\tsnappedIntersection.y = points[3];\r\n\t\t\t\t} else if (below && right) {\r\n\t\t\t\t\tsnappedIntersection.x = points[4];\r\n\t\t\t\t\tsnappedIntersection.y = points[5];\r\n\t\t\t\t} else if (below && left) {\r\n\t\t\t\t\tsnappedIntersection.x = points[6];\r\n\t\t\t\t\tsnappedIntersection.y = points[7];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (lockToEdgeDirection) {\r\n\t\t\tconst lockedRay = Ray.towardsPoint(snappedIntersection, snappedMouseLocation, 2)\r\n\t\t\tconst snappedDirection = this.#getSnappedPoint(lockedRay.B, CONST.GRID_SNAPPING_MODES.CENTER)\r\n\t\t\tsnappedMouseLocation.x = snappedDirection.x;\r\n\t\t\tsnappedMouseLocation.y = snappedDirection.y;\r\n\t\t}\r\n\r\n\t\tconst { direction, distance } = this.#getDraggedMatrix(snappedIntersection, snappedMouseLocation);\r\n\r\n\t\treturn {\r\n\t\t\t...snappedIntersection, direction, distance\r\n\t\t};\r\n\r\n\t}\r\n\r\n\t#handleLimit(mouseLocation, targetLocation) {\r\n\r\n\t\tconst ray = new Ray(targetLocation, mouseLocation);\r\n\t\tconst gridPath = canvas.grid.measurePath([targetLocation, mouseLocation]);\r\n\r\n\t\tconst limitMinRange = is_real_number(this.crosshair.location.limitMinRange) ? this.crosshair.location.limitMinRange : 0;\r\n\t\tconst limitMaxRange = is_real_number(this.crosshair.location.limitMaxRange) ? this.crosshair.location.limitMaxRange : Infinity;\r\n\r\n\t\tlet finalLocation = mouseLocation;\r\n\t\tif (gridPath.cost < limitMinRange) {\r\n\t\t\tfinalLocation = canvas.grid.getTranslatedPoint(targetLocation, Math.toDegrees(ray.angle), limitMinRange);\r\n\t\t} else if (gridPath.cost > limitMaxRange) {\r\n\t\t\tfinalLocation = canvas.grid.getTranslatedPoint(targetLocation, Math.toDegrees(ray.angle), limitMaxRange);\r\n\t\t}\r\n\r\n\t\tconst snappedPosition = this.#getSnappedPoint(finalLocation);\r\n\t\tconst { direction, distance } = this.#getDraggedMatrix(targetLocation, snappedPosition);\r\n\r\n\t\treturn {\r\n\t\t\t...snappedPosition, direction, distance\r\n\t\t};\r\n\r\n\t}\r\n\r\n\t#updateLocation() {\r\n\r\n\t\tlet mouseLocation = get_mouse_position();\r\n\r\n\t\tmouseLocation.x += this.crosshair.location.offset.x ?? 0;\r\n\t\tmouseLocation.y += this.crosshair.location.offset.y ?? 0;\r\n\r\n\t\tlet update;\r\n\r\n\t\tif (this.crosshair.location.obj && (this.crosshair.location.lockToEdge || this.crosshair.location.limitMinRange || this.crosshair.location.limitMaxRange)) {\r\n\r\n\t\t\tconst location = this.crosshair.location.obj;\r\n\t\t\tconst targetLocation = {\r\n\t\t\t\tx: location?.center?.x ?? location?.position?.x ?? location?.x,\r\n\t\t\t\ty: location?.center?.y ?? location?.position?.y ?? location?.y\r\n\t\t\t};\r\n\r\n\t\t\tif (this.crosshair.location.lockToEdge) {\r\n\t\t\t\tupdate = this.#handleLockedEdge(mouseLocation);\r\n\t\t\t} else if (this.crosshair.location.limitMinRange || this.crosshair.location.limitMaxRange) {\r\n\t\t\t\tupdate = this.#handleLimit(mouseLocation, targetLocation);\r\n\t\t\t}\r\n\r\n\t\t} else if (this.#isDrag) {\r\n\t\t\tconst { direction, distance } = this.#getDraggedMatrix(this.document, mouseLocation);\r\n\t\t\tupdate = { distance, direction };\r\n\t\t} else {\r\n\t\t\tconst snappedPosition = this.#getSnappedPoint(mouseLocation);\r\n\t\t\tupdate = {\r\n\t\t\t\tx: snappedPosition.x, y: snappedPosition.y\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tconst isChanged = update?.x !== undefined && this.document.x !== update.x || update?.y !== undefined && this.document.y !== update.y || update?.direction !== undefined && this.document.direction !== update.direction || update?.distance !== undefined && this.document.distance !== update.distance;\r\n\r\n\t\tthis.document.updateSource(update);\r\n\r\n\t\treturn isChanged;\r\n\t}\r\n\r\n\t#getDistance(dragDistance) {\r\n\t\tif (this.crosshair.distanceMin === null && this.crosshair.distanceMax === null) {\r\n\t\t\treturn this.document.distance;\r\n\t\t}\r\n\t\tconst min = this.crosshair.distanceMin ?? this.document.originalConfig.distance;\r\n\t\tconst max = this.crosshair.distanceMax ?? this.document.originalConfig.distance;\r\n\t\treturn Math.min(Math.max(0.5, dragDistance, min), max);\r\n\t}\r\n\r\n\t#getDraggedMatrix(source, target) {\r\n\r\n\t\tconst dragAngle = (new Ray(source, target)).angle;\r\n\t\tconst dragDistance = canvas.grid.measurePath([source, target]);\r\n\r\n\t\tconst direction = this.crosshair.snap.direction\r\n\t\t\t? Math.round(Math.toDegrees(dragAngle) / this.crosshair.snap.direction) * this.crosshair.snap.direction\r\n\t\t\t: Math.toDegrees(dragAngle);\r\n\r\n\t\treturn {\r\n\t\t\tdirection: direction || 0,\r\n\t\t\tdistance: this.#getDistance(dragDistance.distance)\r\n\t\t};\r\n\r\n\t}\r\n\r\n\t#onMouseUp(evt) {\r\n\t\tconst event = evt?.nativeEvent ?? evt;\r\n\t\tif (!(event.which === 1 || event.which === 3)) return;\r\n\t\tif (this.#isDrag) {\r\n\t\t\tthis.#isDrag = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (this.#isPanning) {\r\n\t\t\tthis.#isPanning = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\treturn event.which === 1 ? this.#onConfirm() : this.#onCancel();\r\n\t}\r\n\r\n\t#onConfirm() {\r\n\t\tconst position = this.document.getOrientation();\r\n\t\tif (!this.isValid) {\r\n\t\t\tthis.#runCallback(CONSTANTS.CALLBACKS.INVALID_PLACEMENT, position);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst placedCallback = this.#runCallback(CONSTANTS.CALLBACKS.PLACED, position);\r\n\t\tif (placedCallback === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.cachedLocation = position;\r\n\t\tthis.#promise.resolve(this.document);\r\n\t\tthis.destroy();\r\n\t}\r\n\r\n\t#onCancel() {\r\n\t\tthis.#runCallback(CONSTANTS.CALLBACKS.CANCEL);\r\n\t\tthis.#promise.resolve(false);\r\n\t\tthis.destroy();\r\n\t}\r\n\r\n\t#runCallback(name, ...params) {\r\n\t\tif (!this.callbacks[name]) return;\r\n\t\treturn this.callbacks[name](...params);\r\n\t}\r\n\r\n\t#clearHandlers() {\r\n\t\tthis.layer.interactiveChildren = this.oldInteractiveChildren;\r\n\t\tcanvas.stage.off(\"mousemove\", this.#handlers.move);\r\n\t\tcanvas.stage.off(\"pointerup\", this.#handlers.mouseup);\r\n\t\tcanvas.app.view.onwheel = null;\r\n\t}\r\n\r\n\t#onWheel(evt) {\r\n\r\n\t\tif (!evt.altKey && !evt.ctrlKey && !evt.shiftKey) return;\r\n\r\n\t\tevt.stopPropagation();\r\n\r\n\t\tif (evt.shiftKey) this.#updateDirection(evt)\r\n\r\n\t\tif (evt.altKey) this.#updateDistance(evt);\r\n\r\n\t\tif (evt.ctrlKey) {\r\n\t\t\t// TODO widen\r\n\t\t}\r\n\r\n\t\tthis.refresh();\r\n\t}\r\n\r\n\t#updateDistance(evt) {\r\n\t\tconst step = (this.document.parent.grid.distance / 2);\r\n\t\tconst delta = step * Math.sign(-evt.deltaY);\r\n\t\tlet distance = this.document.distance + delta;\r\n\t\tdistance = Math.max(0.5, distance.toNearest(step));\r\n\t\tdistance = this.#getDistance(distance)\r\n\t\tthis.document.updateSource({ distance });\r\n\t}\r\n\r\n\t#updateDirection(evt) {\r\n\t\tif (this.crosshair.lockManualRotation) return;\r\n\t\tconst scrollDelta = Math.sign(evt.deltaY);\r\n\t\tlet delta = this.crosshair.snap.direction ? this.crosshair.snap.direction * scrollDelta : scrollDelta * 5;\r\n\t\tif (delta < 0) delta += 360;\r\n\t\tif (delta > 360) delta -= 360;\r\n\t\tconst direction = Math.max(1, this.document.direction + delta);\r\n\t\tthis.document.updateSource({ direction });\r\n\t}\r\n\r\n\t/** @override */\r\n\t_getGridHighlightPositions() {\r\n\t\tif (!this.crosshair.gridHighlight) return [];\r\n\t\treturn super._getGridHighlightPositions();\r\n\t}\r\n\r\n\t/** @override */\r\n\t_destroy(options = {}) {\r\n\t\tsuper._destroy(options);\r\n\t\tif(this.#rangeHighlight) this.#rangeHighlight.destroy();\r\n\t\tthis.#clearHandlers();\r\n\t}\r\n\r\n\t/** @override */\r\n\tasync draw() {\r\n\t\tawait super.draw();\r\n\t\tthis.#refreshIcon();\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * The only difference between here and `super` is that this passes along an alpha\r\n\t * @override\r\n\t */\r\n\thighlightGrid() {\r\n\t\t// Clear the existing highlight layer\r\n\t\tcanvas.interface.grid.clearHighlightLayer(this.highlightId);\r\n  \r\n\t\t// Highlight colors\r\n\t\tconst border = this.document.borderColor;\r\n\t\tconst color = this.document.fillColor;\r\n\t\tconst alpha = this.crosshair.fillAlpha;\r\n  \r\n\t\t// If we are in grid-less mode, highlight the shape directly\r\n\t\tif ( canvas.grid.type === CONST.GRID_TYPES.GRIDLESS ) {\r\n\t\t\tconst shape = this._getGridHighlightShape();\r\n\t\t\tcanvas.interface.grid.highlightPosition(this.highlightId, {border, color, alpha, shape});\r\n\t\t}\r\n\r\n\t\t// Otherwise, highlight specific grid positions\r\n\t\telse {\r\n\t\t\tconst positions = this._getGridHighlightPositions();\r\n\t\t\tfor ( const {x, y} of positions ) {\r\n\t\t\t\tcanvas.interface.grid.highlightPosition(this.highlightId, {x, y, border, color, alpha});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","class Plugin {\r\n\r\n\tconstructor(name) {\r\n\t\tthis.name = name;\r\n\t}\r\n\r\n\t/**\r\n\t * The effect's source location, eg the target of `.atLocation()` or `.attachTo()`\r\n\t *\r\n\t * @param effect\r\n\t * @param position\r\n\t * @returns {*}\r\n\t */\r\n\tsourcePosition({ effect, position }={}) {\r\n\t\treturn position;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * The effect's source location, eg the target of `.stretchTo()` or `.rotateTowards()`\r\n\t *\r\n\t * @param effect\r\n\t * @param position\r\n\t * @returns {*}\r\n\t */\r\n\ttargetPosition({ effect, position }={}) {\r\n\t\treturn position;\r\n\t}\r\n\r\n\t/**\r\n\t * The effect's rotation calculation\r\n\t *\r\n\t * @param effect\r\n\t */\r\n\trotation({ effect }={}) { }\r\n\r\n\t/**\r\n\t * The effect's elevation calculation\r\n\t *\r\n\t * @param effect\r\n\t * @param sort\r\n\t * @returns Number\r\n\t */\r\n\televation({ effect, sort }={}) {\r\n\t\treturn sort;\r\n\t}\r\n\r\n\tcreateSpriteContainers({ effect, container }={}) {\r\n\t\treturn container;\r\n\t}\r\n\r\n\t/**\r\n\t * makes changes to the effect upon creation\r\n\t *\r\n\t * @param effect\r\n\t */\r\n\tcreateSprite({ effect }={}) { }\r\n\r\n\t/**\r\n\t * Allows you to make changes to the effect's mask, if used\r\n\t *\r\n\t * @param effect\r\n\t * @param doc\r\n\t * @param obj\r\n\t * @param shape\r\n\t * @returns {*}\r\n\t */\r\n\tmasking({ effect, doc, obj, shape }={}) {\r\n\t\treturn shape\r\n\t}\r\n\r\n\t/**\r\n\t * Which hooks should refresh the masking of the effect\r\n\t *\r\n\t * @returns {*[]}\r\n\t */\r\n\tget maskingHooks() {\r\n\t\treturn [];\r\n\t}\r\n}\r\n\r\nclass GrapeJuiceIsometrics extends Plugin {\r\n\r\n\tisIsometricActive(effect) {\r\n\t\treturn !(effect.data.screenSpace || effect.data.screenSpaceAboveUI) && foundry.utils.getProperty(\r\n\t\t\tgame.scenes.get(effect.data.sceneId),\r\n\t\t\t`flags.${this.name}.is_isometric`\r\n\t\t)\r\n\t}\r\n\r\n\tsourcePosition({ effect, position, height }={}) {\r\n\r\n\t\tif (this.isIsometricActive(effect) && effect.source instanceof PlaceableObject) {\r\n\t\t\tconst elevation = ((effect.sourceDocument.elevation ?? 0) / canvas.scene.grid.distance) * canvas.grid.size;\r\n\t\t\tposition.x += elevation;\r\n\t\t\tposition.y -= elevation;\r\n\t\t\tif (\r\n\t\t\t\teffect.data.isometric?.overlay ||\r\n\t\t\t\teffect.target instanceof PlaceableObject\r\n\t\t\t) {\r\n\t\t\t\tposition.x += height / 2;\r\n\t\t\t\tposition.y -= height / 2;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn position;\r\n\r\n\t}\r\n\r\n\ttargetPosition({ effect, position, height }={}) {\r\n\r\n\t\tif (this.isIsometricActive(effect) && effect.target instanceof PlaceableObject) {\r\n\t\t\tconst targetHeight = height / 2;\r\n\t\t\tconst elevation = ((effect.targetDocument.elevation ?? 0) / canvas.scene.grid.distance) * canvas.grid.size;\r\n\t\t\tposition.x += elevation + targetHeight;\r\n\t\t\tposition.y -= elevation + targetHeight;\r\n\t\t}\r\n\r\n\t\treturn position;\r\n\r\n\t}\r\n\r\n\trotation({ effect }={}) {\r\n\r\n\t\tif (effect.data.stretchTo) {\r\n\t\t\tlet skew = Math.normalizeRadians(\r\n\t\t\t\teffect.rotationContainer.rotation - Math.PI / 4\r\n\t\t\t);\r\n\r\n\t\t\tif (\r\n\t\t\t\tMath.abs(skew) >= Math.PI / 2 - 0.5 &&\r\n\t\t\t\tMath.abs(skew) <= Math.PI / 2 + 0.5\r\n\t\t\t) {\r\n\t\t\t\tskew -= Math.PI / 2;\r\n\t\t\t}\r\n\r\n\t\t\teffect.isometricContainer.skew.set(Math.normalizeRadians(skew), 0);\r\n\t\t\teffect.isometricContainer.rotation = 0;\r\n\t\t} else if (effect.data?.isometric?.overlay) {\r\n\t\t\teffect.rotationContainer.rotation = 0;\r\n\t\t\tlet skew = Math.PI / 4 + effect.rotationContainer.rotation;\r\n\t\t\teffect.isometricContainer.skew.set(\r\n\t\t\t\tMath.normalizeRadians(skew - Math.PI / 4),\r\n\t\t\t\t0\r\n\t\t\t);\r\n\t\t\teffect.isometricContainer.scale.set(\r\n\t\t\t\t1.0,\r\n\t\t\t\twindow.scale ?? Math.sqrt(3)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\televation({ effect, sort }={}) {\r\n\r\n\t\tif (this.isIsometricActive(effect)) {\r\n\t\t\tconst sourceSort = effect.source\r\n\t\t\t\t? (effect.sourceMesh?.sort ?? 0) + (effect.data.isometric?.overlay ? 1 : -1)\r\n\t\t\t\t: 0;\r\n\t\t\tconst targetSort = effect.target\r\n\t\t\t\t? (effect.targetMesh?.sort ?? 0) + (effect.data.isometric?.overlay ? 1 : -1)\r\n\t\t\t\t: 0;\r\n\t\t\tsort = Math.max(sourceSort, targetSort);\r\n\t\t}\r\n\r\n\t\treturn sort;\r\n\t}\r\n\r\n\tcreateSpriteContainers({ effect, container }={}) {\r\n\t\teffect.isometricContainer = container.addChild(\r\n\t\t\tnew PIXI.Container()\r\n\t\t);\r\n\t\teffect.isometricContainer.id = effect.id + \"-isometricContainer\";\r\n\t\treturn effect.isometricContainer;\r\n\t}\r\n\r\n\tcreateSprite({ effect }={}) {\r\n\t\tif (this.isIsometricActive(effect)) {\r\n\t\t\teffect.isometricContainer.rotation = Math.PI / 4;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nclass IsometricPerspective extends GrapeJuiceIsometrics {\r\n\tisIsometricActive(effect) {\r\n\t\treturn !(effect.data.screenSpace || effect.data.screenSpaceAboveUI) && foundry.utils.getProperty(\r\n\t\t\tgame.scenes.get(effect.data.sceneId),\r\n\t\t\t`flags.${this.name}.isometricEnabled`\r\n\t\t)\r\n\t}\r\n}\r\n\r\nclass WalledTemplates extends Plugin {\r\n\tmasking({ effect, doc, obj, shape }={}) {\r\n\t\tif (\r\n\t\t\tobj.walledtemplates?.walledTemplate\r\n\t\t) {\r\n\t\t\tlet wt = obj.walledtemplates.walledTemplate;\r\n\t\t\twt.options.padding = 3 * canvas.dimensions.distancePixels;\r\n\t\t\tshape = wt.computeShape();\r\n\t\t\twt.options.padding = 0;\r\n\t\t}\r\n\t\treturn shape\r\n\t}\r\n\r\n\tget maskingHooks() {\r\n\t\treturn [\"createWall\", \"updateWall\", \"deleteWall\"];\r\n\t}\r\n}\r\n\r\nclass PluginsManager {\r\n\tstatic modules = {\r\n\t\t\"grape_juice-isometrics\": GrapeJuiceIsometrics,\r\n\t\t\"isometric-perspective\": IsometricPerspective,\r\n\t\t\"walledtemplates\": WalledTemplates,\r\n\t}\r\n\tstatic plugins = [];\r\n\r\n\tstatic initialize() {\r\n\t\tfor(const [module, pluginClass] of Object.entries(this.modules)){\r\n\t\t\tif(!game.modules.get(module)?.active) continue;\r\n\t\t\tthis.plugins.push(new pluginClass(module));\r\n\t\t}\r\n\t}\r\n\r\n\tstatic sourcePosition({ effect, position, height }={}) {\r\n\t\tfor(const plugin of this.plugins){\r\n\t\t\tposition = plugin.sourcePosition({ effect, position, height })\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n\r\n\tstatic targetPosition({ effect, position, height }={}) {\r\n\t\tfor(const plugin of this.plugins){\r\n\t\t\tposition = plugin.targetPosition({ effect, position, height })\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n\r\n\tstatic rotation({ effect }={}) {\r\n\t\tfor(const plugin of this.plugins){\r\n\t\t\tplugin.rotation({ effect })\r\n\t\t}\r\n\t}\r\n\r\n\tstatic elevation({ effect, sort }={}) {\r\n\t\tfor(const plugin of this.plugins){\r\n\t\t\tsort = plugin.elevation({ effect, sort })\r\n\t\t}\r\n\t\treturn sort;\r\n\t}\r\n\r\n\tstatic createSpriteContainers({ effect, container }={}){\r\n\t\tfor(const plugin of this.plugins){\r\n\t\t\tcontainer = plugin.createSpriteContainers({ effect, container });\r\n\t\t}\r\n\t\treturn container\r\n\t}\r\n\r\n\tstatic createSprite({ effect }={}) {\r\n\t\tfor(const plugin of this.plugins){\r\n\t\t\tplugin.createSprite({ effect })\r\n\t\t}\r\n\t}\r\n\r\n\tstatic masking({ effect, doc, obj, shape }={}) {\r\n\t\tfor(const plugin of this.plugins){\r\n\t\t\tshape = plugin.masking({ effect, doc, obj, shape })\r\n\t\t}\r\n\t\treturn shape;\r\n\t}\r\n\r\n\tstatic get maskingHooks() {\r\n\t\tlet hooks = [];\r\n\t\tfor(const plugin of this.plugins){\r\n\t\t\thooks = hooks.concat(plugin.maskingHooks)\r\n\t\t}\r\n\t\treturn hooks;\r\n\t}\r\n}\r\n\r\n\r\nexport default PluginsManager;","import CONSTANTS from \"../constants.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport filters from \"../lib/filters.js\";\nimport MaskFilter from \"../lib/filters/mask-filter.js\";\nimport * as lib from \"../lib/lib.js\";\nimport SequencerAnimationEngine from \"../modules/sequencer-animation-engine.js\";\nimport SequencerEffectManager from \"../modules/sequencer-effect-manager.js\";\nimport { SequencerFileBase } from \"../modules/sequencer-file.js\";\nimport { sequencerSocket, SOCKET_HANDLERS } from \"../sockets.js\";\nimport flagManager from \"../utils/flag-manager.js\";\nimport { SequencerAboveUILayer } from \"./effects-layer.js\";\nimport { SequencerSpriteManager } from \"./sequencer-sprite-manager.js\";\nimport CrosshairsPlaceable from \"../modules/sequencer-crosshair/CrosshairsPlaceable.js\";\nimport PluginsManager from \"../utils/plugins-manager.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\n\nconst hooksManager = {\n\t_hooks: new Map(),\n\t_hooksRegistered: new Set(),\n\n\taddHook(effectUuid, hookName, callable, callNow = false) {\n\t\tif (!this._hooksRegistered.has(hookName)) {\n\t\t\tlib.debug(\"registering hook for: \" + hookName);\n\t\t\tthis._hooksRegistered.add(hookName);\n\t\t\tHooks.on(hookName, (...args) => {\n\t\t\t\tthis._hookCalled(hookName, ...args);\n\t\t\t});\n\t\t}\n\n\t\tconst key = hookName + \"-\" + effectUuid;\n\n\t\tif (!this._hooks.has(key)) {\n\t\t\tthis._hooks.set(key, []);\n\t\t}\n\n\t\tthis._hooks.get(key).push(callable);\n\n\t\tif (callNow) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tcallable();\n\t\t\t}, 20);\n\t\t}\n\t},\n\n\t_hookCalled(hookName, ...args) {\n\t\tArray.from(this._hooks)\n\t\t\t.filter((entry) => entry[0].startsWith(hookName + \"-\"))\n\t\t\t.map((hooks) => hooks[1])\n\t\t\t.deepFlatten()\n\t\t\t.forEach((callback) => callback(...args));\n\t},\n\n\tremoveHooks(effectUuid) {\n\t\tArray.from(this._hooks)\n\t\t\t.filter((entry) => entry[0].endsWith(\"-\" + effectUuid))\n\t\t\t.forEach((entry) => this._hooks.delete(entry[0]));\n\t},\n};\n\nconst SyncGroups = {\n\ttimes: new Map(),\n\teffectIds: new Map(),\n\n\tget(effect) {\n\t\tconst fullName = effect.data.sceneId + \"-\" + effect.data.syncGroup;\n\t\tconst effectIds = new Set(this.effectIds.get(fullName));\n\t\tif (effectIds && !effectIds.has(effect.id)) {\n\t\t\teffectIds.add(effect.id);\n\t\t\tthis.effectIds.set(fullName, Array.from(effectIds));\n\t\t}\n\t\treturn this.times.get(fullName);\n\t},\n\n\tset(effect) {\n\t\tconst fullName = effect.data.sceneId + \"-\" + effect.data.syncGroup;\n\t\tthis.times.set(fullName, effect.data.creationTimestamp);\n\t\tthis.effectIds.set(fullName, [effect.id]);\n\t},\n\n\tremove(effect) {\n\t\tconst fullName = effect.data.sceneId + \"-\" + effect.data.syncGroup;\n\t\tconst effectIds = new Set(this.effectIds.get(fullName));\n\t\teffectIds.delete(effect.id);\n\t\tif (effectIds.size) {\n\t\t\tthis.effectIds.set(fullName, Array.from(effectIds));\n\t\t} else {\n\t\t\tthis.effectIds.delete(fullName);\n\t\t\tthis.times.delete(fullName);\n\t\t}\n\t}\n};\n\nexport default class CanvasEffect extends PIXI.Container {\n\t#elevation = 0;\n\t#sort = 0;\n\t#sortLayer = 800\n\n\tconstructor(inData) {\n\t\tsuper();\n\n\t\tthis.sortableChildren = true;\n\t\tthis.interactiveChildren = false;\n\n\t\t// Set default values\n\t\tthis.actualCreationTime = +new Date();\n\t\tthis.data = inData;\n\n\t\tthis._resolve = null;\n\t\tthis._durationResolve = null;\n\n\t\tthis.ready = false;\n\t\tthis._ended = false;\n\t\tthis._isEnding = false;\n\n\t\tthis._cachedSourceData = {};\n\t\tthis._cachedTargetData = {};\n\t\tthis.sourceOffset = { x: 0, y: 0 };\n\t\tthis.targetOffset = { x: 0, y: 0 };\n\n\t\tthis.uuid = false;\n\n\t}\n\n\tstatic get protectedValues() {\n\t\treturn [\n\t\t\t\"_id\",\n\t\t\t\"sequenceId\",\n\t\t\t\"creationTimestamp\",\n\t\t\t\"creatorUserId\",\n\t\t\t\"moduleName\",\n\t\t\t\"index\",\n\t\t\t\"repetition\",\n\t\t\t\"moves\",\n\t\t\t\"fadeIn\",\n\t\t\t\"fadeOut\",\n\t\t\t\"scaleIn\",\n\t\t\t\"scaleOut\",\n\t\t\t\"rotateIn\",\n\t\t\t\"rotateOut\",\n\t\t\t\"fadeInAudio\",\n\t\t\t\"fadeOutAudio\",\n\t\t\t\"animations\",\n\t\t\t\"nameOffsetMap\",\n\t\t\t\"persist\",\n\t\t];\n\t}\n\n\t/** @type {number} */\n\tget elevation() {\n\t\treturn this.#elevation;\n\t}\n\n\tset elevation(value) {\n\t\tthis.#elevation = value;\n\t}\n\n\t/** @type {number} */\n\tget sort() {\n\t\treturn this.#sort;\n\t}\n\n\tset sort(value) {\n\t\tthis.#sort = value;\n\t}\n\n\t/** @type {number} */\n\tget sortLayer() {\n\t\treturn this.#sortLayer;\n\t}\n\n\tset sortLayer(value) {\n\t\tthis.#sortLayer = value;\n\t}\n\n\tget context() {\n\t\treturn this.data.attachTo?.active && this.sourceDocument\n\t\t\t? this.sourceDocument\n\t\t\t: game.scenes.get(this.data.sceneId);\n\t}\n\n\tget creationTimestamp() {\n\t\tif (this.data.syncGroup) {\n\t\t\tconst time = SyncGroups.get(this);\n\t\t\tif (time) return time;\n\t\t\tSyncGroups.set(this)\n\t\t}\n\t\treturn this.data.creationTimestamp;\n\t}\n\n\t/**\n\t * The ID of the effect\n\t *\n\t * @returns {string}\n\t */\n\tget id() {\n\t\treturn this.data._id;\n\t}\n\n\t/**\n\t * Whether this effect is destroyed or is in the process of being destroyed\n\t */\n\tget isDestroyed() {\n\t\treturn (\n\t\t\tthis.destroyed ||\n\t\t\t(this.source && this.isSourceDestroyed) ||\n\t\t\t(this.target && this.isTargetDestroyed)\n\t\t);\n\t}\n\n\t/**\n\t * Whether the source of this effect is temporary\n\t *\n\t * @returns {boolean}\n\t */\n\tget isSourceTemporary() {\n\t\treturn (\n\t\t\tthis.data.attachTo?.active &&\n\t\t\tthis.sourceDocument &&\n\t\t\t!lib.is_UUID(this.sourceDocument?.uuid)\n\t\t);\n\t}\n\n\t/**\n\t * Whether the source of this effect has been destroyed\n\t *\n\t * @returns {boolean}\n\t */\n\tget isSourceDestroyed() {\n\t\treturn (\n\t\t\tthis.source && this.source?.destroyed && (!this.sourceDocument?.object || this.sourceDocument?.object?.destroyed || this.source.constructor.name === \"Crosshairs\")\n\t\t);\n\t}\n\n\t/**\n\t * Whether the target of this effect is temporary\n\t *\n\t * @returns {boolean}\n\t */\n\tget isTargetTemporary() {\n\t\treturn (\n\t\t\t(this.data.stretchTo?.attachTo || this.data.rotateTowards?.attachTo) &&\n\t\t\tthis.targetDocument &&\n\t\t\t!lib.is_UUID(this.targetDocument.uuid)\n\t\t);\n\t}\n\n\t/**\n\t * Whether the target of this effect has been destroyed\n\t *\n\t * @returns {boolean}\n\t */\n\tget isTargetDestroyed() {\n\t\treturn (\n\t\t\tthis.target && this.target?.destroyed && (!this.targetDocument?.object || this.targetDocument?.object?.destroyed || this.target.constructor.name === \"Crosshairs\")\n\t\t);\n\t}\n\n\t/**\n\t * The source object (or source location) of the effect\n\t *\n\t * @returns {boolean|object}\n\t */\n\tget source() {\n\t\tif (!this._source && this.data.source) {\n\t\t\tconst getDifferentTarget = this.data.source === this.data.target;\n\t\t\tthis._source = this._getObjectByID(this.data.source?.uuid ?? this.data.source, getDifferentTarget, true) ?? this.data.source;\n\t\t\tthis._source = this._source?._object ?? this._source;\n\t\t}\n\t\treturn this._source;\n\t}\n\n\t/**\n\t * Retrieves the source document\n\t *\n\t * @returns {Document|foundry.canvas.placeables.PlaceableObject}\n\t */\n\tget sourceDocument() {\n\t\treturn this.source?.document ?? this.source;\n\t}\n\n\t/**\n\t * Retrieves the PIXI object for the source object\n\t *\n\t * @returns {*|PIXI.Sprite|TileHUD<Application.Options>}\n\t */\n\tget sourceMesh() {\n\t\treturn this.source?.mesh ?? this.source?.template;\n\t}\n\n\t/**\n\t * The source position with the relevant offsets calculated\n\t *\n\t * @returns {{x: number, y: number}}\n\t */\n\tget sourcePosition() {\n\t\tlet position = this.getSourceData().position;\n\t\tlet offset = this._getOffset(this.data.source, true);\n\n\t\tif (this.data.attachTo?.active && this.data.attachTo?.align && this.data.attachTo?.align !== \"center\") {\n\t\t\tconst additionalOffset = canvaslib.align({\n\t\t\t\tcontext: this.source,\n\t\t\t\tspriteWidth: this.sprite.width,\n\t\t\t\tspriteHeight: this.sprite.height,\n\t\t\t\talign: this.data.attachTo?.align,\n\t\t\t\tedge: this.data.attachTo?.edge,\n\t\t\t});\n\n\t\t\toffset.x += additionalOffset.x;\n\t\t\toffset.y += additionalOffset.y;\n\t\t}\n\n\t\treturn {\n\t\t\tx: (position.x - offset.x) + this.sourceOffset.x,\n\t\t\ty: (position.y - offset.y) + this.sourceOffset.y,\n\t\t};\n\t}\n\n\t/**\n\t * The target object (or target location) of the effect\n\t *\n\t * @returns {boolean|object}\n\t */\n\tget target() {\n\t\tif (!this._target && this.data.target) {\n\t\t\tconst getDifferentTarget = this.data.source === this.data.target;\n\t\t\tthis._target = this._getObjectByID(this.data.target?.uuid ?? this.data.target, getDifferentTarget, false) ?? this.data.target;\n\t\t\tthis._target = this._target?._object ?? this._target;\n\t\t}\n\t\treturn this._target;\n\t}\n\n\t/**\n\t * Retrieves the document of the target\n\t *\n\t * @returns {Document|foundry.canvas.placeables.PlaceableObject}\n\t */\n\tget targetDocument() {\n\t\treturn this.target?.document ?? this.target;\n\t}\n\n\t/**\n\t * Retrieves the PIXI object for the target object\n\t *\n\t * @returns {*|PIXI.Sprite|TileHUD<Application.Options>}\n\t */\n\tget targetMesh() {\n\t\treturn this.target?.mesh ?? this.target?.template;\n\t}\n\n\t/**\n\t * The target position with the relevant offsets calculated\n\t *\n\t * @returns {{x: number, y: number}}\n\t */\n\tget targetPosition() {\n\t\tconst position = this.getTargetData().position;\n\t\tconst offset = this._getOffset(this.data.target);\n\n\t\treturn {\n\t\t\tx: (position.x - offset.x) + this.targetOffset.x,\n\t\t\ty: (position.y - offset.y) + this.targetOffset.y,\n\t\t};\n\t}\n\n\t/**\n\t * Returns this effect's world position\n\t *\n\t * @returns {{x: number, y: number}}\n\t */\n\tget worldPosition() {\n\t\tconst t = canvas.stage.worldTransform;\n\t\treturn {\n\t\t\tx: (this.sprite.worldTransform.tx - t.tx) / canvas.stage.scale.x,\n\t\t\ty: (this.sprite.worldTransform.ty - t.ty) / canvas.stage.scale.y,\n\t\t};\n\t}\n\n\t/**\n\t * Whether the current user is the owner of this effect\n\t *\n\t * @returns {boolean}\n\t */\n\tget owner() {\n\t\treturn this.data.creatorUserId === game.user.id;\n\t}\n\n\tget loopDelay() {\n\t\treturn (this.data.loopOptions?.loopDelay ?? 0);\n\t}\n\n\tget loops() {\n\t\treturn (this.data.loopOptions?.loops ?? 0);\n\t}\n\n\t/**\n\t * Whether the current user can update this effect\n\t *\n\t * @returns {boolean}\n\t */\n\tget userCanUpdate() {\n\t\treturn (\n\t\t\tgame.user.isGM ||\n\t\t\tthis.owner ||\n\t\t\t(this.data.attachTo?.active &&\n\t\t\t\tthis.sourceDocument.canUserModify(game.user, \"update\"))\n\t\t);\n\t}\n\n\t/**\n\t * Whether the current user can delete this effect\n\t *\n\t * @returns {boolean}\n\t */\n\tget userCanDelete() {\n\t\treturn this.userCanUpdate || lib.user_can_do(\"permissions-effect-delete\");\n\t}\n\n\t/**\n\t * Whether this effect is on the current scene\n\t *\n\t * @returns {boolean}\n\t */\n\tget onCurrentScene() {\n\t\treturn this.data.sceneId === game.user.viewedScene;\n\t}\n\n\t/**\n\t * Whether this effect should be shown as faded or not - effects created by users for other users should be shown\n\t * for all\n\t *\n\t * @returns {boolean}\n\t */\n\tget shouldShowFadedVersion() {\n\t\t// If the user has not set the opacity user-specific effects to 0\n\t\t// And it is not an effect that is only played for the user who created the effect\n\t\t// And if the effect is going to be played for a subset of users\n\t\t// And the users does not contain this user\n\t\treturn (\n\t\t\tthis.data.users &&\n\t\t\tthis.data.users.length &&\n\t\t\t!(\n\t\t\t\tthis.data.users.length === 1 &&\n\t\t\t\tthis.data.users.includes(this.data.creatorUserId)\n\t\t\t) &&\n\t\t\t!this.data.users.includes(game.userId)\n\t\t);\n\t}\n\n\tset effectAlpha(value) {\n\t\tif (this.sprite) {\n\t\t\tthis.sprite.alpha = value\n\t\t}\n\t\tif (this.shapes) {\n\t\t\tObject.values(this.shapes).forEach(shape => {\n\t\t\t\tshape.alpha = value\n\t\t\t})\n\t\t}\n\t}\n\n\tget effectAlpha() {\n\t\treturn this.sprite?.alpha\n\t}\n\n\tasync playMedia() {\n\t\tif (this.destroyed || this._ended || this._isEnding) {\n\t\t\treturn\n\t\t}\n\t\tawait this.sprite.play()\n\t\tthis._setupTimestampHook(this.mediaCurrentTime * 1000);\n\t}\n\n\tupdateTexture() {\n\t\tthis.sprite.updateVideoTextures()\n\t}\n\n\tasync pauseMedia() {\n\t\tthis.sprite.stop()\n\t}\n\n\tget mediaLooping() {\n\t\treturn this.sprite.loop\n\t}\n\n\tset mediaLooping(looping) {\n\t\treturn this.sprite.loop = looping\n\t}\n\n\tget mediaIsPlaying() {\n\t\treturn this.sprite.playing\n\t}\n\n\tget mediaCurrentTime() {\n\t\treturn this.sprite.currentTime\n\t}\n\n\tget mediaPlaybackRate() {\n\t\treturn this.sprite.playbackRate\n\t}\n\n\tset mediaPlaybackRate(inPlaybackRate) {\n\t\t// Playbackrate for spritesheets is now handled by timing info in the animation sequence\n\t\tthis.sprite.playbackRate = inPlaybackRate;\n\t}\n\n\tset mediaCurrentTime(newTime) {\n\t\tthis.sprite.currentTime = newTime\n\t}\n\n\tget mediaDuration() {\n\t\treturn this.sprite.duration\n\t}\n\n\tget mediaDurationMs(){\n\t\treturn this.mediaDuration * 1000\n\t}\n\n\tget hasAnimatedMedia() {\n\t\treturn this.sprite.hasAnimatedMedia\n\t}\n\n\t/**\n\t * The template of the effect, determining the effect's internal grid size, and start/end padding\n\t *\n\t * @returns {object}\n\t */\n\tget template() {\n\t\treturn this._template\n\t}\n\n\t/**\n\t * The grid size difference between the internal effect's grid vs the grid on the canvas. If the effect is in screen space, we ignore this.\n\t *\n\t * @returns {number}\n\t */\n\tget gridSizeDifference() {\n\t\treturn canvas.grid.size / (this.template?.gridSize ?? this.defaultGridSize);\n\t}\n\n\tget defaultGridSize() {\n\t\treturn 100\n\t}\n\n\t/**\n\t * Whether the effect should be flipped on any given axis\n\t *\n\t * @returns {number}\n\t */\n\tget flipX() {\n\t\tconst offsetMap = this._nameOffsetMap?.[this.data.source];\n\t\tlet flip = this.data.flipX ? -1 : 1\n\t\tif(offsetMap && offsetMap.mirrorX !== undefined) {\n\t\t\tflip *= offsetMap.mirrorX ? -1 : 1;\n\t\t}\n\t\treturn flip;\n\t}\n\n\tget flipY() {\n\t\tconst offsetMap = this._nameOffsetMap?.[this.data.source];\n\t\tlet flip = this.data.flipY ? -1 : 1\n\t\tif(offsetMap && offsetMap.mirrorY !== undefined) {\n\t\t\tflip *= offsetMap.mirrorY ? -1 : 1;\n\t\t}\n\t\treturn flip;\n\t}\n\n\t/**\n\t * Whether this effect should play at all, depending on a multitude of factors\n\t *\n\t * @returns {boolean}\n\t */\n\tget shouldPlay() {\n\t\treturn (\n\t\t\t(game.user.viewedScene === this.data.sceneId ||\n\t\t\t\tthis.data.creatorUserId === game.userId) &&\n\t\t\t(game.user.isGM ||\n\t\t\t\t!this.data.users ||\n\t\t\t\tthis.data.users.length === 0 ||\n\t\t\t\tthis.data.users.includes(game.userId))\n\t\t);\n\t}\n\n\tget shouldPlayVisible() {\n\t\tlet playVisible =\n\t\t\tthis.shouldPlay &&\n\t\t\tgame.settings.get(\"sequencer\", \"effectsEnabled\") &&\n\t\t\tgame.user.viewedScene === this.data.sceneId;\n\n\t\tif (game.settings.get(\"core\", \"photosensitiveMode\")) {\n\t\t\tplayVisible = false;\n\t\t\tlib.throttled_custom_warning(\n\t\t\t\tthis.data.moduleName,\n\t\t\t\t\"Photosensitive Mode is turned on, so Sequencer's visual effects aren't being rendered\"\n\t\t\t);\n\t\t}\n\n\t\treturn playVisible;\n\t}\n\n\tstatic make(inData) {\n\t\treturn !inData.persist\n\t\t\t? new CanvasEffect(inData)\n\t\t\t: new PersistentCanvasEffect(inData);\n\t}\n\n\tstatic checkValid(effectData) {\n\t\tif (effectData.delete) {\n\t\t\treturn false;\n\t\t}\n\t\tlet sourceExists = true;\n\t\tlet targetExists = true;\n\t\tif (effectData.source && lib.is_UUID(effectData.source)) {\n\t\t\tsourceExists = fromUuidSync(effectData.source);\n\t\t}\n\t\tif (effectData.target && lib.is_UUID(effectData.target)) {\n\t\t\ttargetExists = fromUuidSync(effectData.target);\n\t\t}\n\t\tfor (let tiedDocumentUuid of effectData?.tiedDocuments ?? []) {\n\t\t\tif (tiedDocumentUuid && lib.is_UUID(tiedDocumentUuid)) {\n\t\t\t\tlet tiedDocumentExists = fromUuidSync(tiedDocumentUuid);\n\t\t\t\tif (!tiedDocumentExists) return false;\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\teffectData.source &&\n\t\t\tlib.is_UUID(effectData.source) &&\n\t\t\teffectData.target &&\n\t\t\tlib.is_UUID(effectData.target)\n\t\t) {\n\t\t\tconst sourceScene = effectData.source.split(\".\")[1];\n\t\t\tconst targetScene = effectData.target.split(\".\")[1];\n\t\t\tif (sourceScene !== targetScene || sourceScene !== effectData.sceneId)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn sourceExists && targetExists;\n\t}\n\n\t/**\n\t * Validates that the update contains the appropriate data\n\t *\n\t * @param inUpdates\n\t */\n\tstatic validateUpdate(inUpdates) {\n\t\tconst updateKeys = Object.keys(inUpdates);\n\t\tconst protectedValues = updateKeys.filter((key) =>\n\t\t\tCanvasEffect.protectedValues.includes(key)\n\t\t);\n\t\tif (protectedValues.length) {\n\t\t\tthrow lib.custom_error(\n\t\t\t\t\"Sequencer\",\n\t\t\t\t`CanvasEffect | update | You cannot update the following keys of an effect's data: ${protectedValues.join(\n\t\t\t\t\t\"\\n - \"\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\t\tif (updateKeys.includes(\"source\")) {\n\t\t\tif (\n\t\t\t\t!(\n\t\t\t\t\tlib.is_UUID(inUpdates.source) ||\n\t\t\t\t\tcanvaslib.is_object_canvas_data(inUpdates.source)\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\t\"Sequencer\",\n\t\t\t\t\t`CanvasEffect | update | source must be of type document UUID or object with X and Y coordinates`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (updateKeys.includes(\"target\")) {\n\t\t\tif (\n\t\t\t\t!(\n\t\t\t\t\tlib.is_UUID(inUpdates.target) ||\n\t\t\t\t\tcanvaslib.is_object_canvas_data(inUpdates.target)\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\t\"Sequencer\",\n\t\t\t\t\t`CanvasEffect | update | target must be of type document UUID or object with X and Y coordinates`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetHook(type, uuid) {\n\t\tif (!lib.is_UUID(uuid)) return false;\n\t\tconst parts = uuid.split(\".\");\n\t\treturn type + parts[parts.length - 2];\n\t}\n\n\t/**\n\t * Gets the source hook name\n\t *\n\t * @param {string} type\n\t * @returns {string|boolean}\n\t */\n\tgetSourceHook(type = \"\") {\n\t\treturn this.getHook(type, this.data.source);\n\t}\n\n\t/**\n\t * The source object's current position, or its current position\n\t *\n\t * @returns {boolean|object}\n\t */\n\tgetSourceData() {\n\n\t\tif (this.data.temporary && !this.owner) {\n\t\t\treturn SequencerEffectManager.getPositionForUUID(this.data.source);\n\t\t}\n\n\t\tif (this.source instanceof FoundryShim.PlaceableObject && this.isSourceDestroyed){\n\t\t\treturn {\n\t\t\t\t...this._cachedSourceData,\n\t\t\t};\n\t\t}\n\n\t\tlet crosshairPos = this.source instanceof CrosshairsPlaceable ? this.sourceDocument.getOrientation() : false;\n\t\tcrosshairPos = crosshairPos?.source;\n\n\t\tlet position =\n\t\t\tthis.source instanceof FoundryShim.PlaceableObject && !this.isSourceTemporary\n\t\t\t\t? canvaslib.get_object_position(this.source)\n\t\t\t\t: crosshairPos || this.source?.worldPosition || this.source?.center || this.source;\n\n\t\tconst { width, height } = crosshairPos || canvaslib.get_object_dimensions(this.source);\n\n\t\tposition = PluginsManager.sourcePosition({ effect: this, position, height });\n\n\t\tif (position !== undefined) {\n\t\t\tthis._cachedSourceData.position = position;\n\t\t}\n\n\t\tif (width !== undefined && height !== undefined) {\n\t\t\tthis._cachedSourceData.width = width;\n\t\t\tthis._cachedSourceData.height = height;\n\t\t}\n\n\t\tlet rotation = 0;\n\t\tif (this.source instanceof FoundryShim.MeasuredTemplate && this.sourceDocument?.t !== \"rect\") {\n\t\t\trotation = Math.normalizeRadians(\n\t\t\t\tMath.toRadians(this.sourceDocument?.direction)\n\t\t\t);\n\t\t} else if (!(this.source instanceof FoundryShim.MeasuredTemplate)) {\n\t\t\trotation = this.sourceDocument?.rotation\n\t\t\t\t? Math.normalizeRadians(Math.toRadians(this.sourceDocument?.rotation))\n\t\t\t\t: 0;\n\t\t}\n\n\t\tif (rotation !== undefined) {\n\t\t\tthis._cachedSourceData.rotation = rotation;\n\t\t}\n\n\t\tconst alpha =\n\t\t\tthis.sourceDocument instanceof TokenDocument || this.sourceDocument instanceof TileDocument\n\t\t\t\t? this.sourceDocument?._source?.alpha ?? 1.0\n\t\t\t\t: 1.0;\n\n\t\tif (alpha !== undefined) {\n\t\t\tthis._cachedSourceData.alpha = alpha;\n\t\t}\n\n\t\treturn {\n\t\t\t...this._cachedSourceData,\n\t\t};\n\t}\n\n\t/**\n\t * Gets the target hook name\n\t *\n\t * @param {string} type\n\t * @returns {string|boolean}\n\t */\n\tgetTargetHook(type = \"\") {\n\t\treturn this.getHook(type, this.data.target);\n\t}\n\n\t/**\n\t * The target object's current position, or its current position\n\t *\n\t * @returns {boolean|object}\n\t */\n\tgetTargetData() {\n\n\t\tif (this.data.temporary && !this.owner) {\n\t\t\treturn (\n\t\t\t\tSequencerEffectManager.getPositionForUUID(this.data.target) ??\n\t\t\t\tthis.getSourceData()\n\t\t\t);\n\t\t}\n\n\t\tif (this.target instanceof FoundryShim.PlaceableObject && this.isTargetDestroyed){\n\t\t\treturn {\n\t\t\t\t...this._cachedTargetData,\n\t\t\t};\n\t\t}\n\n\t\tlet crosshairPos = this.target instanceof CrosshairsPlaceable ? this.targetDocument.getOrientation() : false;\n\t\tcrosshairPos = crosshairPos?.target ?? crosshairPos?.source;\n\n\t\tlet position =\n\t\t\tthis.target instanceof FoundryShim.PlaceableObject && !this.isTargetTemporary && !this.isTargetDestroyed\n\t\t\t\t? canvaslib.get_object_position(this.target, { measure: true })\n\t\t\t\t: crosshairPos || this.target?.worldPosition || this.target?.center || this.target;\n\n\t\tconst { width, height } = crosshairPos || canvaslib.get_object_dimensions(this.target);\n\n\t\tposition = PluginsManager.targetPosition({ effect: this, position, height });\n\n\t\tif (width !== undefined && height !== undefined) {\n\t\t\tthis._cachedTargetData.width = width;\n\t\t\tthis._cachedTargetData.height = height;\n\t\t}\n\n\t\tif (position !== undefined) {\n\t\t\tthis._cachedTargetData.position = position;\n\t\t}\n\n\t\tlet rotation = 0;\n\t\tif (\n\t\t\tthis.target instanceof FoundryShim.MeasuredTemplate &&\n\t\t\tthis.targetDocument?.t !== \"rect\"\n\t\t) {\n\t\t\trotation = Math.normalizeRadians(\n\t\t\t\tMath.toRadians(this.targetDocument?.direction)\n\t\t\t);\n\t\t} else if (!(this.target instanceof FoundryShim.MeasuredTemplate)) {\n\t\t\trotation = this.targetDocument?.rotation\n\t\t\t\t? Math.normalizeRadians(Math.toRadians(this.targetDocument?.rotation))\n\t\t\t\t: 0;\n\t\t}\n\n\t\tif (rotation !== undefined) {\n\t\t\tthis._cachedTargetData.rotation = rotation;\n\t\t}\n\n\t\tconst alpha =\n\t\t\tthis.targetDocument instanceof TokenDocument ||\n\t\t\tthis.targetDocument instanceof TileDocument\n\t\t\t\t? this.targetDocument?.alpha ?? 1.0\n\t\t\t\t: 1.0;\n\n\t\tif (alpha !== undefined) {\n\t\t\tthis._cachedTargetData.alpha = alpha;\n\t\t}\n\n\t\treturn {\n\t\t\t...this._cachedTargetData,\n\t\t};\n\t}\n\n\t/**\n\t * Calculates the offset for a given offset property and name mapping\n\t *\n\t * @param {string} offsetMapName\n\t * @param {boolean} source\n\t * @returns {{x: number, y: number}|*}\n\t * @private\n\t */\n\t_getOffset(offsetMapName, source = false) {\n\t\tconst key = source ? \"source\" : \"target\";\n\n\t\tconst offset = {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t};\n\n\t\tlet twister = this._twister;\n\n\t\tlet nameOffsetMap = this._nameOffsetMap?.[this.data.name];\n\n\t\tif (nameOffsetMap) {\n\t\t\ttwister = nameOffsetMap.twister;\n\t\t}\n\n\t\t// If the effect is missing, and it's not the source we're offsetting OR it is the source, but we don't have a target (it's playing on the spot)\n\t\tif (this.data.missed && (!source || !this.data.target)) {\n\t\t\tlet missedOffset =\n\t\t\t\tthis._offsetCache[key]?.missedOffset ||\n\t\t\t\tcanvaslib.calculate_missed_position(this.source, this.target, twister);\n\t\t\tthis._offsetCache[key].missedOffset = missedOffset;\n\t\t\toffset.x -= missedOffset.x;\n\t\t\toffset.y -= missedOffset.y;\n\t\t}\n\n\t\tconst obj = source ? this.source : this.target;\n\t\tconst multiplier = source\n\t\t\t? this.data.randomOffset?.source\n\t\t\t: this.data.randomOffset?.target;\n\n\t\tif (obj && multiplier) {\n\t\t\tlet randomOffset =\n\t\t\t\tthis._offsetCache[key]?.randomOffset ||\n\t\t\t\tcanvaslib.get_random_offset(obj, multiplier, twister);\n\t\t\tthis._offsetCache[key].randomOffset = randomOffset;\n\t\t\toffset.x -= randomOffset.x;\n\t\t\toffset.y -= randomOffset.y;\n\t\t}\n\n\t\tlet extraOffset = this.data?.offset?.[key];\n\t\tif (extraOffset) {\n\t\t\tlet newOffset = {\n\t\t\t\tx: extraOffset.x,\n\t\t\t\ty: extraOffset.y,\n\t\t\t};\n\t\t\tif (extraOffset.gridUnits) {\n\t\t\t\tnewOffset.x *= canvas.grid.size;\n\t\t\t\tnewOffset.y *= canvas.grid.size;\n\t\t\t}\n\t\t\tif (extraOffset.local) {\n\t\t\t\tif (\n\t\t\t\t\t!this._cachedSourceData?.position ||\n\t\t\t\t\t!this._cachedTargetData?.position\n\t\t\t\t) {\n\t\t\t\t\tthis.getSourceData();\n\t\t\t\t\tthis.getTargetData();\n\t\t\t\t}\n\n\t\t\t\tconst startPos = this._cachedSourceData.position;\n\t\t\t\tconst endPos = this._cachedTargetData.position;\n\n\t\t\t\tconst angle = this.target\n\t\t\t\t\t? new Ray(startPos, endPos).angle\n\t\t\t\t\t: Ray.fromAngle(\n\t\t\t\t\t\tstartPos.x,\n\t\t\t\t\t\tstartPos.y,\n\t\t\t\t\t\tthis._cachedSourceData.rotation,\n\t\t\t\t\t\t1\n\t\t\t\t\t).angle;\n\n\t\t\t\tnewOffset = canvaslib.rotateAroundPoint(\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\tnewOffset.x,\n\t\t\t\t\tnewOffset.y,\n\t\t\t\t\t-angle\n\t\t\t\t);\n\t\t\t}\n\t\t\toffset.x -= newOffset.x;\n\t\t\toffset.y -= newOffset.y;\n\t\t}\n\n\t\tlet offsetMap = this._nameOffsetMap?.[offsetMapName];\n\n\t\tif (!this._offsetCache[key][\"nameCache\"][offsetMapName]) {\n\t\t\tthis._offsetCache[key][\"nameCache\"][offsetMapName] = {};\n\t\t}\n\n\t\tif (offsetMap) {\n\t\t\tif (offsetMap.missed) {\n\t\t\t\tconst missedOffset =\n\t\t\t\t\tthis._offsetCache[key][\"nameCache\"][offsetMapName]?.missedOffset ||\n\t\t\t\t\tcanvaslib.calculate_missed_position(\n\t\t\t\t\t\toffsetMap.sourceObj,\n\t\t\t\t\t\toffsetMap.targetObj,\n\t\t\t\t\t\toffsetMap.twister\n\t\t\t\t\t);\n\t\t\t\tthis._offsetCache[key][\"nameCache\"][offsetMapName].missedOffset =\n\t\t\t\t\tmissedOffset;\n\t\t\t\toffset.x -= missedOffset.x;\n\t\t\t\toffset.y -= missedOffset.y;\n\t\t\t}\n\n\t\t\tconst obj = offsetMap.targetObj || offsetMap.sourceObj;\n\t\t\tconst multiplier =\n\t\t\t\toffsetMap.randomOffset?.source || offsetMap.randomOffset?.target;\n\n\t\t\tif (obj && multiplier) {\n\t\t\t\tlet randomOffset =\n\t\t\t\t\tthis._offsetCache[key][\"nameCache\"][offsetMapName]?.randomOffset ||\n\t\t\t\t\tcanvaslib.get_random_offset(obj, multiplier, offsetMap.twister);\n\t\t\t\tthis._offsetCache[key][\"nameCache\"][offsetMapName].randomOffset =\n\t\t\t\t\trandomOffset;\n\t\t\t\toffset.x -= randomOffset.x;\n\t\t\t\toffset.y -= randomOffset.y;\n\t\t\t}\n\n\t\t\tif (offsetMap.offset) {\n\t\t\t\toffset.x += offsetMap.offset.x;\n\t\t\t\toffset.y += offsetMap.offset.y;\n\t\t\t}\n\t\t}\n\n\t\treturn offset;\n\t}\n\n\t/**\n\t * Initializes the name offset map by establishing targets\n\t *\n\t * @param inOffsetMap\n\t * @returns {{setup}|*}\n\t * @private\n\t */\n\t_setupOffsetMap(inOffsetMap) {\n\t\tif (!inOffsetMap.setup) {\n\t\t\tinOffsetMap.setup = true;\n\t\t\tinOffsetMap.sourceObj = inOffsetMap.source\n\t\t\t\t? this._validateObject(inOffsetMap.source)\n\t\t\t\t: false;\n\t\t\tinOffsetMap.targetObj = inOffsetMap.target\n\t\t\t\t? this._validateObject(inOffsetMap.target)\n\t\t\t\t: false;\n\t\t\tconst repetition = this.data.repetition % inOffsetMap.repetitions;\n\t\t\tconst seed = lib.get_hash(`${inOffsetMap.seed}-${repetition}`);\n\t\t\tinOffsetMap.twister = lib.createMersenneTwister(seed);\n\t\t}\n\n\t\treturn inOffsetMap;\n\t}\n\n\t/**\n\t * Plays the effect, returning two promises; one that resolves once the duration has been established, and another\n\t * when the effect has finished playing\n\t *\n\t * @returns {Object}\n\t */\n\tplay() {\n\t\tconst durationPromise = new Promise((resolve, reject) => {\n\t\t\tthis._durationResolve = resolve;\n\t\t});\n\n\t\tconst finishPromise = new Promise(async (resolve, reject) => {\n\t\t\tthis._resolve = resolve;\n\t\t\tHooks.callAll(\"createSequencerEffect\", this);\n\t\t\tlib.debug(`Playing effect:`, this.data);\n\t\t\tthis._initialize();\n\t\t});\n\n\t\treturn {\n\t\t\tduration: durationPromise,\n\t\t\tpromise: finishPromise,\n\t\t};\n\t}\n\n\t/**\n\t *  Ends the effect\n\t */\n\tendEffect() {\n\t\tif (this._ended) return;\n\t\tHooks.callAll(\"endedSequencerEffect\", this);\n\t\tthis.destroy();\n\t}\n\n\tdestroy(...args) {\n\t\tthis._destroyDependencies();\n\t\treturn super.destroy(...args);\n\t}\n\n\t/**\n\t * Updates this effect with the given parameters\n\t * @param inUpdates\n\t * @returns {Promise}\n\t */\n\tasync update(inUpdates) {\n\t\tif (!this.userCanUpdate)\n\t\t\tthrow lib.custom_error(\n\t\t\t\t\"Sequencer\",\n\t\t\t\t\"CanvasEffect | Update | You do not have permission to update this effect\"\n\t\t\t);\n\t\tCanvasEffect.validateUpdate(inUpdates);\n\n\t\tconst newData = foundry.utils.deepClone(this.data);\n\t\tconst updateKeys = Object.keys(inUpdates);\n\n\t\tupdateKeys.forEach((key) => {\n\t\t\tfoundry.utils.setProperty(newData, key, inUpdates[key]);\n\t\t});\n\n\t\tif (\n\t\t\tObject.keys(foundry.utils.diffObject(newData, this.data)).length === 0\n\t\t) {\n\t\t\tlib.debug(\n\t\t\t\t`Skipped updating effect with ID ${this.id} - no changes needed`\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.data.persist) {\n\t\t\tconst originalSourceUUID =\n\t\t\t\tlib.is_UUID(this.data.source) && this.data.attachTo\n\t\t\t\t\t? this.data.source\n\t\t\t\t\t: \"Scene.\" + this.data.sceneId;\n\n\t\t\tconst newSourceUUID =\n\t\t\t\tlib.is_UUID(newData.source) && newData.attachTo\n\t\t\t\t\t? newData.source\n\t\t\t\t\t: \"Scene.\" + newData.sceneId;\n\n\t\t\tif (originalSourceUUID !== newSourceUUID) {\n\t\t\t\tflagManager.removeEffectFlags(originalSourceUUID, newData);\n\t\t\t}\n\n\t\t\tflagManager.addEffectFlags(newSourceUUID, newData);\n\t\t}\n\n\t\tlib.debug(`Updated effect with ID ${this.id}`);\n\n\t\treturn sequencerSocket.executeForEveryone(\n\t\t\tSOCKET_HANDLERS.UPDATE_EFFECT,\n\t\t\tthis.id,\n\t\t\tnewData\n\t\t);\n\t}\n\n\tasync addAnimatedProperties({ animations = [], loopingAnimation = [] } = {}) {\n\t\tconst animationsToAdd = [];\n\t\tif (!Array.isArray(animations)) {\n\t\t\tthrow lib.custom_error(\n\t\t\t\tthis.data.moduleName,\n\t\t\t\t`animations must be an array of arrays`\n\t\t\t);\n\t\t}\n\t\tfor (const animationData of animations) {\n\t\t\tif (!Array.isArray(animationData)) {\n\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\tthis.data.moduleName,\n\t\t\t\t\t`each entry in animations must be an array, each with target, property name, and animation options`\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst result = canvaslib.validateAnimation(...animationData);\n\t\t\tif (typeof result === \"string\") {\n\t\t\t\tthrow lib.custom_error(this.data.moduleName, result);\n\t\t\t}\n\t\t\tresult.creationTimestamp = +new Date();\n\t\t\tanimationsToAdd.push(result);\n\t\t}\n\t\tif (!Array.isArray(loopingAnimation)) {\n\t\t\tthrow lib.custom_error(\n\t\t\t\tthis.data.moduleName,\n\t\t\t\t`loopingAnimation must be an array of arrays`\n\t\t\t);\n\t\t}\n\t\tfor (const animationData of loopingAnimation) {\n\t\t\tif (!Array.isArray(animationData)) {\n\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\tthis.data.moduleName,\n\t\t\t\t\t`each entry in loopingAnimation must be an array, each with target, property name, and animation options`\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst result = canvaslib.validateLoopingAnimation(...animationData);\n\t\t\tif (typeof result === \"string\") {\n\t\t\t\tthrow lib.custom_error(this.data.moduleName, result);\n\t\t\t}\n\t\t\tresult.creationTimestamp = +new Date();\n\t\t\tanimationsToAdd.push(result);\n\t\t}\n\n\t\tif (this.data.persist) {\n\t\t\tconst originalSourceUUID =\n\t\t\t\tlib.is_UUID(this.data.source) && this.data.attachTo\n\t\t\t\t\t? this.data.source\n\t\t\t\t\t: \"Scene.\" + this.data.sceneId;\n\t\t\tconst newData = foundry.utils.deepClone(this.data);\n\t\t\tnewData.animations = (newData.animations ?? []).concat(\n\t\t\t\tfoundry.utils.deepClone(animationsToAdd)\n\t\t\t);\n\t\t\tflagManager.addEffectFlags(originalSourceUUID, newData);\n\t\t}\n\n\t\treturn sequencerSocket.executeForEveryone(\n\t\t\tSOCKET_HANDLERS.ADD_EFFECT_ANIMATIONS,\n\t\t\tthis.id,\n\t\t\tanimationsToAdd\n\t\t);\n\t}\n\n\tasync _addAnimations(inAnimations) {\n\t\tthis._playAnimations(foundry.utils.deepClone(inAnimations));\n\t\tthis.data.animations = (this.data.animations ?? []).concat(inAnimations);\n\t}\n\n\t/**\n\t * Updates the effect\n\t *\n\t * @param inUpdates\n\t * @returns {Promise}\n\t * @private\n\t */\n\t_update(inUpdates) {\n\t\tthis.data = inUpdates;\n\t\tHooks.callAll(\"updateSequencerEffect\", this);\n\t\tthis._destroyDependencies();\n\t\treturn this._reinitialize();\n\t}\n\n\t/**\n\t * Determines whether a position is within the bounds of this effect\n\t *\n\t * @param inPosition\n\t * @returns {boolean}\n\t */\n\tisPositionWithinBounds(inPosition) {\n\t\tif (!this.spriteContainer) return false;\n\t\treturn canvaslib.is_position_within_bounds(\n\t\t\tinPosition,\n\t\t\tthis.spriteContainer,\n\t\t\tthis.parent\n\t\t);\n\t}\n\n\t/**\n\t * Initializes the effect and places it on the canvas\n\t *\n\t * @returns {Promise}\n\t * @private\n\t */\n\tasync _initialize() {\n\t\tthis.ready = false;\n\t\tthis._initializeVariables();\n\t\tthis._addToContainer();\n\t\tthis._createFile()\n\t\tthis._updateCurrentFilePath(false, true)\n\t\tawait this._createSprite();\n\t\tthis._calculateDuration();\n\t\tthis._createShapes();\n\t\tawait this._setupMasks();\n\t\tawait this._transformSprite();\n\t\tthis._playPresetAnimations();\n\t\tthis._playCustomAnimations();\n\t\tthis._setEndTimeout();\n\t\tthis._registerTickers()\n\t\tthis._timeoutVisibility();\n\t\tawait this._startEffect();\n\t\tthis.ready = true;\n\t}\n\n\t/**\n\t * Reinitializes the effect after it has been updated\n\t *\n\t * @param play\n\t * @returns {Promise}\n\t * @private\n\t */\n\tasync _reinitialize() {\n\t\tthis.renderable = false;\n\t\tif (!this.shouldPlay) {\n\t\t\treturn Sequencer.EffectManager._removeEffect(this);\n\t\t}\n\t\tthis.actualCreationTime = +new Date();\n\t\treturn this._initialize();\n\t}\n\n\t/**\n\t * Initializes variables core to the function of the effect\n\t * This is run as a part of the construction of the effect\n\t *\n\t * @private\n\t */\n\t_initializeVariables() {\n\t\t// Responsible for rotating the sprite\n\t\tthis.rotationContainer = this.addChild(new PIXI.Container());\n\t\tthis.rotationContainer.id = this.id + \"-rotationContainer\";\n\n\t\tthis.pluginContainer = PluginsManager.createSpriteContainers({ effect: this, container: this.rotationContainer });\n\n\t\t// An offset container for the sprite\n\t\tthis.spriteContainer = this.pluginContainer.addChild(\n\t\t\tnew PIXI.Container()\n\t\t);\n\t\tthis.spriteContainer.id = this.id + \"-spriteContainer\";\n\n\t\tthis._template = this.data.template;\n\t\tthis._ended = null;\n\t\tthis._maskContainer = null;\n\t\tthis._maskSprite = null;\n\t\tthis._file = null;\n\t\tthis._loopOffset = 0;\n\t\tthis.effectFilters = {};\n\t\tthis._animationDuration = 0;\n\t\tthis._animationTimes = {};\n\t\tthis._twister = lib.createMersenneTwister(this.creationTimestamp);\n\t\tthis._distanceCache = null;\n\t\tthis._isRangeFind = false;\n\t\tthis._customAngle = 0;\n\t\tthis._currentFilePath = this.data.file;\n\t\tthis._hooks = [];\n\t\tthis._lastDimensions = {};\n\t\tthis._lastScreenDimensions = {};\n\n\t\tif (this._resetTimeout) {\n\t\t\tclearTimeout(this._resetTimeout);\n\t\t}\n\t\tthis._resetTimeout = null;\n\n\t\tthis._source = false;\n\t\tthis._target = false;\n\t\tthis._offsetCache = {\n\t\t\tsource: { nameCache: {} },\n\t\t\ttarget: { nameCache: {} },\n\t\t};\n\n\t\tthis._nameOffsetMap = Object.fromEntries(\n\t\t\tObject.entries(\n\t\t\t\tfoundry.utils.deepClone(this.data.nameOffsetMap ?? {})\n\t\t\t).map((entry) => {\n\t\t\t\treturn [entry[0], this._setupOffsetMap(entry[1])];\n\t\t\t})\n\t\t);\n\n\t\tthis.uuid = !lib.is_UUID(this.context.uuid)\n\t\t\t? this.id\n\t\t\t: this.context.uuid + \".data.flags.sequencer.effects.\" + this.id;\n\n\t\tthis._ticker = FoundryShim.CanvasAnimation.ticker;\n\t\tthis._tickerMethods = [];\n\t}\n\n\t_addToTicker(func) {\n\t\tthis._tickerMethods.push(func);\n\t\tthis._ticker.add(func, this);\n\t}\n\n\t/**\n\t * Destroys all dependencies to this element, such as tickers, animations, textures, and child elements\n\t *\n\t * @private\n\t */\n\t_destroyDependencies() {\n\t\tif (this._ended) return;\n\t\tthis._ended = true;\n\n\t\tthis.mask = null;\n\n\t\thooksManager.removeHooks(this.uuid);\n\n\t\tthis._tickerMethods.forEach(func => this._ticker.remove(func, this));\n\t\tthis._ticker = null;\n\n\t\tSequencerAnimationEngine.endAnimations(this.id);\n\n\t\tif (this._maskContainer) this._maskContainer.destroy({ children: true });\n\t\tif (this._maskSprite) {\n\t\t\ttry {\n\t\t\t\tthis._maskSprite.texture.destroy(true);\n\t\t\t\tthis._maskSprite.destroy();\n\t\t\t} catch (err) {\n\t\t\t}\n\t\t}\n\n\t\tthis.sprite.destroy();\n\t\tthis.sprite = null;\n\n\t\ttry {\n\t\t\tif (this.data.screenSpace) {\n\t\t\t\tSequencerAboveUILayer.removeContainerByEffect(this);\n\t\t\t}\n\t\t} catch (err) {\n\t\t}\n\n\t\tif (this.data.syncGroup) {\n\t\t\tSyncGroups.remove(this);\n\t\t}\n\t\tthis.removeChildren().forEach((child) => child.destroy({ children: true }));\n\t}\n\n\t/**\n\t * Plays preset animations\n\t *\n\t * @private\n\t */\n\t_playPresetAnimations() {\n\t\tthis._moveTowards();\n\n\t\tthis._fadeOut();\n\t\tthis._fadeIn();\n\n\t\tthis._rotateOut();\n\t\tthis._rotateIn();\n\n\t\tthis._scaleOut();\n\t\tthis._scaleIn();\n\n\t\tthis._fadeOutAudio();\n\t\tthis._fadeInAudio();\n\t}\n\n\t/**\n\t * Gets an object based on an identifier, checking if it exists within the named offset map, whether it's a\n\t * coordinate object, or if it's an UUID that needs to be fetched from the scene\n\t *\n\t * @param inIdentifier\n\t * @param specific\n\t * @param returnSource\n\t * @returns {*}\n\t * @private\n\t */\n\t_getObjectByID(inIdentifier, specific = false, returnSource = false) {\n\t\tlet source = inIdentifier;\n\t\tlet offsetMap = this._nameOffsetMap?.[inIdentifier];\n\t\tif (offsetMap) {\n\t\t\tif(specific){\n\t\t\t\tsource = (returnSource\n\t\t\t\t\t? offsetMap?.sourceObj || offsetMap?.targetObj\n\t\t\t\t\t: offsetMap?.targetObj || offsetMap?.sourceObj\n\t\t\t\t) || source;\n\t\t\t}else {\n\t\t\t\tsource = offsetMap?.targetObj || offsetMap?.sourceObj || source;\n\t\t\t}\n\t\t} else {\n\t\t\tsource = this._validateObject(source);\n\t\t}\n\t\treturn source;\n\t}\n\n\t/**\n\t * Validates the given parameter, whether it's a UUID or a coordinate object, and returns the proper one\n\t *\n\t * @param inObject\n\t * @returns {*}\n\t * @private\n\t */\n\t_validateObject(inObject) {\n\t\tif (lib.is_UUID(inObject) || !canvaslib.is_object_canvas_data(inObject)) {\n\t\t\tinObject = lib.get_object_from_scene(inObject, this.data.sceneId);\n\t\t\tinObject = inObject?._object ?? inObject;\n\t\t}\n\t\treturn inObject;\n\t}\n\n\t/**\n\t * Adds this effect to the appropriate container on the right layer\n\t *\n\t * @private\n\t */\n\t_addToContainer() {\n\t\tlet layer;\n\t\tif (this.data.screenSpaceAboveUI) {\n\t\t\tlayer = SequencerAboveUILayer;\n\t\t} else if (this.data.screenSpace) {\n\t\t\tlayer = canvas.sequencerEffectsUILayer;\n\t\t} else if (this.data.aboveInterface) {\n\t\t\tlayer = canvas.controls;\n\t\t} else if (this.data.aboveLighting) {\n\t\t\tlayer = canvas.interface;\n\t\t} else {\n\t\t\tlayer = canvas.primary;\n\t\t}\n\n\t\tlayer.addChild(this);\n\t\tlayer.sortChildren();\n\t}\n\n\tget startTimeMs() {\n\t\treturn this._startTime * 1000;\n\t}\n\n\tget endTimeMs() {\n\t\treturn this._endTime * 1000;\n\t}\n\n\t/**\n\t * Calculates the duration of this effect, based on animation durations, the video source duration, end/start times, etc\n\t *\n\t * @private\n\t */\n\t_calculateDuration() {\n\t\tlet playbackRate = this.data.playbackRate || 1.0;\n\n\t\tthis.mediaPlaybackRate = playbackRate;\n\n\t\tthis._animationDuration = this.data.duration || this.mediaDurationMs;\n\n\t\t// If the effect moves, then infer the duration from the distance divided by the speed\n\t\tif (this.data.moveSpeed && this.data.moves) {\n\t\t\tlet distance = canvaslib.distance_between(\n\t\t\t\tthis.sourcePosition,\n\t\t\t\tthis.targetPosition\n\t\t\t);\n\t\t\tlet durationFromSpeed = (distance / this.data.moveSpeed) * 1000;\n\t\t\tthis._animationDuration = Math.max(durationFromSpeed, this.data.duration);\n\t\t} else if (!this.data.duration && !this.hasAnimatedMedia) {\n\t\t\t// Determine static image duration\n\t\t\tlet fadeDuration =\n\t\t\t\t(this.data.fadeIn?.duration ?? 0) + (this.data.fadeOut?.duration ?? 0);\n\t\t\tlet scaleDuration =\n\t\t\t\t(this.data.scaleIn?.duration ?? 0) +\n\t\t\t\t(this.data.scaleOut?.duration ?? 0);\n\t\t\tlet rotateDuration =\n\t\t\t\t(this.data.rotateIn?.duration ?? 0) +\n\t\t\t\t(this.data.rotateOut?.duration ?? 0);\n\t\t\tlet moveDuration = 0;\n\t\t\tif (this.data.moves) {\n\t\t\t\tlet distance = canvaslib.distance_between(\n\t\t\t\t\tthis.sourcePosition,\n\t\t\t\t\tthis.targetPosition\n\t\t\t\t);\n\t\t\t\tmoveDuration =\n\t\t\t\t\t(this.data.moveSpeed\n\t\t\t\t\t\t? (distance / this.data.moveSpeed) * 1000\n\t\t\t\t\t\t: 1000) + this.data.moves.delay;\n\t\t\t}\n\n\t\t\tlet animationDurations = this.data.animations?.length\n\t\t\t\t? Math.max(\n\t\t\t\t\t...this.data.animations.map((animation) => {\n\t\t\t\t\t\tif (animation.looping) {\n\t\t\t\t\t\t\tif (animation.loops === 0) return 0;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t(animation?.duration ?? 0) * (animation?.loops ?? 0) +\n\t\t\t\t\t\t\t\t(animation?.delay ?? 0)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn (animation?.duration ?? 0) + (animation?.delay ?? 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t: 0;\n\n\t\t\tthis._animationDuration = Math.max(\n\t\t\t\tfadeDuration,\n\t\t\t\tscaleDuration,\n\t\t\t\trotateDuration,\n\t\t\t\tmoveDuration,\n\t\t\t\tanimationDurations\n\t\t\t);\n\n\t\t\tthis._animationDuration = this._animationDuration || 1000;\n\t\t}\n\n\t\t// Clamp effect duration to start time and end time\n\t\tthis._startTime = 0;\n\t\tif (this.data.time?.start && this.mediaCurrentTime !== null) {\n\t\t\tlet currentTime = !this.data.time.start.isPerc\n\t\t\t\t? this.data.time.start.value ?? 0\n\t\t\t\t: this._animationDuration * this.data.time.start.value;\n\t\t\tthis.mediaCurrentTime = currentTime / 1000;\n\t\t\tthis._startTime = currentTime / 1000;\n\t\t}\n\n\t\tthis._endTime = this._animationDuration;\n\t\tif (this.data.time?.end) {\n\t\t\tif (this.data.time.end.isPerc) {\n\t\t\t\tthis._endTime = this._animationDuration - (this._animationDuration * this.data.time.end.value);\n\t\t\t} else {\n\t\t\t\tthis._endTime = this.data.time.isRange\n\t\t\t\t\t? this.data.time.end.value\n\t\t\t\t\t: this._animationDuration - this.data.time.end.value;\n\t\t\t}\n\t\t}\n\t\tthis._endTime /= 1000;\n\n\t\tthis._animationDuration = lib.clamp(this.endTimeMs - this.startTimeMs, 0, this._animationDuration);\n\n\t\tif (\n\t\t\tthis._file?.markers &&\n\t\t\tthis._startTime === 0 &&\n\t\t\tthis._endTime === this.mediaDuration\n\t\t) {\n\t\t\tthis._animationTimes.loopStart = this._file.markers.loop.start / playbackRate / 1000;\n\t\t\tthis._animationTimes.loopEnd = this._file.markers.loop.end / playbackRate / 1000;\n\t\t\tthis._animationTimes.forcedEnd = this._file.markers.forcedEnd / playbackRate / 1000;\n\t\t}\n\n\t\tthis._totalDuration = this.loops\n\t\t\t? (this._animationDuration * this.loops) + (this.loopDelay * (this.loops - 1))\n\t\t\t: this._animationDuration;\n\n\t\tthis._totalDuration /= playbackRate;\n\n\t\tif(this.data.persist){\n\t\t\tthis.mediaLooping = (\n\t\t\t\t(!this.data.time || (this._startTime === 0 && this._endTime === this.mediaDuration)) &&\n\t\t\t\tthis._animationTimes.loopStart === undefined &&\n\t\t\t\tthis._animationTimes.loopEnd === undefined &&\n\t\t\t\t!this.loops &&\n\t\t\t\t!this.loopDelay\n\t\t\t);\n\t\t}else{\n\t\t\tthis.mediaLooping = this._startTime === 0 && this._endTime > this.mediaDuration && !(this.loops && this.loopDelay);\n\t\t}\n\n\t\t// Resolve duration promise so that owner of effect may know when it is finished\n\t\tthis._durationResolve(this._totalDuration);\n\t}\n\n\t/**\n\t * If this effect is animatable, hold off on rendering it for a bit so that the animations have time to initialize to\n\t * prevent it from spawning and then jumping to the right place\n\t *\n\t * @private\n\t */\n\t_timeoutVisibility() {\n\t\tif(!this.data.animations){\n\t\t\treturn this._setupHooks();\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tthis._setupHooks();\n\t\t},50);\n\t}\n\n\t/**\n\t * Add Ticker handler to check for updates to attached objects\n\t *\n\t * @private\n\t */\n\t_registerTickers() {\n\t\t//stretchTo && attached to stretchTo\n\t\tif (this.data.stretchTo && this.data.stretchTo?.attachTo) {\n\t\t\tthis._addToTicker(this._transformStretchToAttachedSprite);\n\t\t}\n\t\t// attachTo, not attached to stretchTo\n\t\tif (this.data.attachTo?.active && !this.data.stretchTo?.attachTo) {\n\t\t\tthis._addToTicker(this._transformAttachedNoStretchSprite);\n\t\t}\n\n\t\t// rotateTowards\n\t\tif (this.data.rotateTowards && this.data.rotateTowards?.attachTo) {\n\t\t\tthis._addToTicker(this._transformRotateTowardsAttachedSprite);\n\t\t}\n\n\t\t// scaleTo\n\t\tif (this.data.scaleToObject && this.data?.attachTo?.active && this.data?.attachTo?.bindScale) {\n\t\t\tconst { heightWidthRatio, widthHeightRatio, baseScaleX, baseScaleY } = this._getBaseScale()\n\t\t\tthis._addToTicker(() => {\n\t\t\t\tthis._applyScaleToObject(heightWidthRatio, widthHeightRatio, baseScaleX, baseScaleY);\n\t\t\t\tthis._setAnchors()\n\t\t\t});\n\t\t}\n\n\t\t// source or target destroy safeguards\n\t\tif (this.isSourceTemporary) {\n\t\t\tthis._addToTicker(this._checkSourceDestroyed);\n\t\t}\n\t\tif (this.isTargetTemporary) {\n\t\t\tthis._addToTicker(this._checkTargetDestroyed);\n\t\t}\n\t}\n\n\t_checkSourceDestroyed() {\n\t\tif (this.isSourceDestroyed) {\n\t\t\tthis._source = this.sourcePosition;\n\t\t\tSequencerEffectManager.endEffects({ effects: this });\n\t\t}\n\t}\n\n\t_checkTargetDestroyed() {\n\t\tif (this.isTargetDestroyed) {\n\t\t\tthis._source = this.targetPosition;\n\t\t\tSequencerEffectManager.endEffects({ effects: this });\n\t\t}\n\t}\n\n\t_createFile() {\n\t\tif (this.data.file === \"\") {\n\t\t\treturn;\n\t\t}\n\n\t\tlet file\n\t\tif (this.data.customRange) {\n\t\t\tconst template = this.template ? [this.template.gridSize, this.template.startPoint, this.template.endPoint] : [100, 0, 0]\n\t\t\tfile = SequencerFileBase.make(\n\t\t\t\tthis.data.file,\n\t\t\t\t\"temporary.range.file\",\n\t\t\t\t{template},\n\t\t\t);\n\t\t} else if (Sequencer.Database.entryExists(this.data.file)) {\n\t\t\tfile = Sequencer.Database.getEntry(this.data.file).clone();\n\t\t} else {\n\t\t\tfile = SequencerFileBase.make(this.data.file)\n\t\t\tthis._currentFilePath = this.data.file;\n\t\t}\n\n\t\tif (file.template) {\n\t\t\tthis._template =\n\t\t\t\tfoundry.utils.mergeObject(\n\t\t\t\t\t{ gridSize: file.template[0], startPoint: file.template[1], endPoint: file.template[2] },\n\t\t\t\t\tthis.data.template\n\t\t\t\t)\n\n\t\t}\n\t\tfile.fileIndex = this.data.forcedIndex;\n\t\tfile.twister = this._twister;\n\t\tthis._file = file\n\t\tthis._isRangeFind = file?.rangeFind;\n\t}\n\n\t_updateCurrentFilePath(distance, showDistanceWarning = false) {\n\t\tif (!this._file) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this.data.stretchTo) {\n\t\t\tthis._currentFilePath = this._file.getFile();\n\t\t\treturn;\n\t\t}\n\t\tdistance = distance || (new Ray(this.sourcePosition, this.targetPosition)).distance;\n\t\tif (distance === 0 && showDistanceWarning) {\n\t\t\tlib.custom_error(\n\t\t\t      \"effect\",\n\t\t\t      `stretchTo - You are stretching over a distance of \"0\", you may be attempting to stretch between two of the same coordinates!`\n\t\t\t);\n\t\t}\n\t\tthis._currentFilePath = this._file.getFileForDistance(distance);\n\t}\n\n\t/**\n\t * Creates the sprite, and the relevant containers that manage the position and offsets of the overall visual look of the sprite\n\t *\n\t * @private\n\t */\n\tasync _createSprite() {\n\t\tthis.renderable = false;\n\t\tconst spriteData = {\n\t\t\tantialiasing: this.data?.fileOptions?.antialiasing,\n\t\t\ttiling: this.data.tilingTexture,\n\t\t\txray: this.data.xray || this.data.screenSpace || this.data.screenSpaceAboveUI,\n\t\t\tisPersisted: this.data.persist && !this.data.loopOptions?.endOnLastLoop\n\t\t}\n\t\t/** @type {SequencerSpriteManager} */\n\t\tthis.sprite = new SequencerSpriteManager(this._file, spriteData)\n\t\tthis.spriteContainer.addChild(this.sprite)\n\t\tthis.sprite.id = this.id + \"-sprite\";\n\t\tthis.sprite.loopDelay = this.loopDelay\n\t\tthis.sprite.currentTime = this._startTime\n\t\tthis.sprite.loop = this.loops\n\n\t\tawait this.sprite.activate(this._currentFilePath)\n\n\t\tthis.sprite.volume = (this.data.volume ?? 0) * game.settings.get(\"core\", \"globalInterfaceVolume\");\n\n\t\tif (this._isRangeFind && this.data.stretchTo && (this.data.attachTo?.active || this.data.stretchTo?.attachTo?.active)) {\n\t\t\tthis.sprite.preloadVariants()\n\t\t}\n\n\t\tif (this.data.text) {\n\t\t\tconst text = this.data.text.text;\n\t\t\tconst fontSettings = foundry.utils.deepClone(this.data.text);\n\t\t\tfontSettings.fontSize = (fontSettings?.fontSize ?? 26) * (150 / canvas.grid.size);\n\t\t\tconst textSprite = this.sprite.addText({text, textStyle: fontSettings})\n\t\t\ttextSprite.zIndex = 1;\n\t\t\tconst textAnchor = this.data.text.anchor\n\t\t\ttextSprite.anchor.set(textAnchor?.x ?? 0.5, textAnchor?.y ?? 0.5);\n\t\t}\n\n\t\tthis.sprite.filters = [];\n\n\t\tif (this.data.filters) {\n\t\t\tfor (let index = 0; index < this.data.filters.length; index++) {\n\t\t\t\tconst filterData = this.data.filters[index];\n\t\t\t\tconst filter = new filters[filterData.className](filterData.data);\n\t\t\t\tfilter.id = this.id + \"-\" + filterData.className + \"-\" + index.toString();\n\t\t\t\tif (filter instanceof PIXI.ColorMatrixFilter) {\n\t\t\t\t\tthis.sprite.colorMatrixFilter = filter;\n\t\t\t\t} else {\n\t\t\t\t\tthis.sprite.filters.push(filter);\n\t\t\t\t}\n\t\t\t\tconst filterKeyName = filterData.name || filterData.className;\n\t\t\t\tthis.effectFilters[filterKeyName] = filter;\n\t\t\t}\n\t\t}\n\n\t\tthis.effectAlpha = this.data.opacity\n\n\t\tlet spriteOffsetX = this.data.spriteOffset?.x ?? 0;\n\t\tlet spriteOffsetY = this.data.spriteOffset?.y ?? 0;\n\t\tif (this.data.spriteOffset?.gridUnits) {\n\t\t\tspriteOffsetX *= canvas.grid.size;\n\t\t\tspriteOffsetY *= canvas.grid.size;\n\t\t}\n\n\t\tthis.sprite.position.set(spriteOffsetX, spriteOffsetY);\n\n\t\tthis.sprite.anchor?.set(\n\t\t\tthis.data.spriteAnchor?.x ?? 0.5,\n\t\t\tthis.data.spriteAnchor?.y ?? 0.5\n\t\t);\n\n\t\tlet spriteRotation = this.data.spriteRotation ?? 0;\n\t\tif (this.data.randomSpriteRotation) {\n\t\t\tspriteRotation += lib.random_float_between(-360, 360, this._twister);\n\t\t}\n\n\t\tthis.sprite.rotation = Math.normalizeRadians(\n\t\t\tMath.toRadians(spriteRotation)\n\t\t);\n\n\t\tthis._customAngle = this.data.angle ?? 0;\n\t\tif (this.data.randomRotation) {\n\t\t\tthis._customAngle += lib.random_float_between(-360, 360, this._twister);\n\t\t}\n\n\t\tconst offsetMap = this._nameOffsetMap?.[this.data.source];\n\t\tif(offsetMap?.angle !== undefined) {\n\t\t\tthis._customAngle += offsetMap?.angle;\n\t\t}\n\t\tif(offsetMap?.randomRotation) {\n\t\t\tthis._customAngle += lib.random_float_between(-360, 360, offsetMap.twister);\n\t\t}\n\n\t\tthis.spriteContainer.rotation = -Math.normalizeRadians(\n\t\t\tMath.toRadians(this._customAngle)\n\t\t);\n\n\t\tPluginsManager.createSprite({ effect: this });\n\n\t\tif (this.data.tint) {\n\t\t\tthis.sprite.tint = this.data.tint;\n\t\t}\n\n\t\t// only set filter and fade effects when a faded version should actually be shown\n\t\tif (this.shouldShowFadedVersion) {\n\t\t\tthis.alpha = game.settings.get(CONSTANTS.MODULE_NAME,\"user-effect-opacity\") / 100;\n\t\t\tthis.filters = [\n\t\t\t\tnew PIXI.ColorMatrixFilter({\n\t\t\t\t\tsaturation: -1,\n\t\t\t\t}),\n\t\t\t];\n\t\t}\n\n\t\tthis.updateElevation();\n\t}\n\n\t_createShapes() {\n\t\tconst nonMaskShapes = (this.data?.shapes ?? []).filter(\n\t\t\t(shape) => !shape.isMask\n\t\t);\n\t\tthis.shapes = {};\n\t\tfor (const shape of nonMaskShapes) {\n\t\t\tconst graphic = canvaslib.createShape(shape);\n\t\t\tgraphic.filters = this.sprite.filters;\n\t\t\tthis.spriteContainer.addChild(graphic);\n\t\t\tthis.shapes[shape?.name ?? \"shape-\" + foundry.utils.randomID()] = graphic;\n\t\t}\n\t}\n\n\tupdateElevation() {\n\t\tlet targetElevation = Math.max(\n\t\t\t\tcanvaslib.get_object_elevation(this.source ?? {}),\n\t\t\t\tcanvaslib.get_object_elevation(this.target ?? {})\n\t\t\t);\n\n\t\tlet effectElevation = this.data.elevation?.elevation ?? 0;\n\t\tif (!this.data.elevation?.absolute) {\n\t\t\teffectElevation += targetElevation;\n\t\t}\n\t\tthis.elevation = effectElevation;\n\t\tlet sort = !lib.is_real_number(this.data.zIndex)\n\t\t\t? (this?.parent?.children?.length ?? 0)\n\t\t\t: 100000;\n\t\tsort = PluginsManager.elevation({ effect: this, sort })\n\t\tsort += 100 + (this.data.aboveLighting ? 300 : 0);\n\t\tthis.zIndex = sort + (lib.is_real_number(this.data.zIndex) ? this.data.zIndex : 0);\n\t\tthis.sort = sort;\n\t\tthis.sortLayer = this.data.sortLayer\n\t\tif (this.parent) {\n\t\t\tthis.parent.sortChildren();\n\t\t}\n\t}\n\n\tupdateTransform() {\n\t\tsuper.updateTransform();\n\t\tif (this.data.screenSpace || this.data.screenSpaceAboveUI) {\n\t\t\tconst [screenWidth, screenHeight] = canvas.screenDimensions;\n\n\t\t\tif(this._lastScreenDimensions?.screenWidth !== screenWidth && this._lastScreenDimensions?.screenHeight !== screenHeight){\n\t\t\t\tthis._lastScreenDimensions.screenWidth = screenWidth;\n\t\t\t\tthis._lastScreenDimensions.screenHeight = screenHeight;\n\t\t\t}\n\n\t\t\tthis.position.set(\n\t\t\t\t(this.data.screenSpacePosition?.x ?? 0) +\n\t\t\t\tscreenWidth *\n\t\t\t\t(this.data.screenSpaceAnchor?.x ?? this.data.anchor?.x ?? 0.5),\n\t\t\t\t(this.data.screenSpacePosition?.y ?? 0) +\n\t\t\t\tscreenHeight *\n\t\t\t\t(this.data.screenSpaceAnchor?.y ?? this.data.anchor?.y ?? 0.5)\n\t\t\t);\n\n\t\t\tif (this.data.screenSpaceScale) {\n\t\t\t\tconst scaleData = this.data.screenSpaceScale ?? { x: 1, y: 1 };\n\n\t\t\t\tlet scaleX = scaleData.x;\n\t\t\t\tlet scaleY = scaleData.y;\n\n\t\t\t\tthis._lastScreenDimensions.width = this.sprite.texture?.width || this._lastScreenDimensions.width || this.sprite.width || this.spriteContainer.children[this.spriteContainer.children.length-1].width;\n\t\t\t\tthis._lastScreenDimensions.height = this.sprite.texture?.height || this._lastScreenDimensions.height || this.sprite.height || this.spriteContainer.children[this.spriteContainer.children.length-1].height;\n\n\t\t\t\tif (scaleData.fitX) {\n\t\t\t\t\tscaleX = scaleX * (screenWidth / this._lastScreenDimensions.width);\n\t\t\t\t}\n\n\t\t\t\tif (scaleData.fitY) {\n\t\t\t\t\tscaleY = scaleY * (screenHeight / this._lastScreenDimensions.height);\n\t\t\t\t}\n\n\t\t\t\tscaleX = scaleData.ratioX ? scaleY : scaleX;\n\t\t\t\tscaleY = scaleData.ratioY ? scaleX : scaleY;\n\n\t\t\t\tthis.scale.set(scaleX, scaleY);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync _setupMasks() {\n\t\tconst maskShapes = this.data.shapes.filter((shape) => shape.isMask);\n\n\t\tif (!this.data?.masks?.length && !maskShapes.length) return;\n\n\t\tconst maskFilter = MaskFilter.create();\n\n\t\tfor (const uuid of this.data.masks) {\n\t\t\tconst documentObj = fromUuidSync(uuid);\n\n\t\t\tif (!documentObj || documentObj.parent.id !== this.data.sceneId) continue;\n\n\t\t\tconst obj = documentObj.object;\n\n\t\t\tlet shape = obj?.mesh;\n\t\t\tlet shapeToAdd = shape;\n\n\t\t\tif (obj instanceof FoundryShim.MeasuredTemplate || obj instanceof FoundryShim.Drawing) {\n\t\t\t\tshape = obj?.shape?.geometry?.graphicsData?.[0]?.shape ?? obj?.shape;\n\n\t\t\t\tshape = PluginsManager.masking({\n\t\t\t\t\teffect: this,\n\t\t\t\t\tdoc: documentObj,\n\t\t\t\t\tobj,\n\t\t\t\t\tshape\n\t\t\t\t});\n\n\t\t\t\tshapeToAdd = new PIXI.LegacyGraphics()\n\t\t\t\t\t.beginFill()\n\t\t\t\t\t.drawShape(shape)\n\t\t\t\t\t.endFill();\n\n\t\t\t\tif (obj instanceof FoundryShim.MeasuredTemplate) {\n\t\t\t\t\tshapeToAdd.position.set(documentObj.x, documentObj.y);\n\t\t\t\t} else {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tx,\n\t\t\t\t\t\ty,\n\t\t\t\t\t\tshape: { width, height },\n\t\t\t\t\t\trotation,\n\t\t\t\t\t} = documentObj;\n\t\t\t\t\tshapeToAdd.pivot.set(width / 2, height / 2);\n\t\t\t\t\tshapeToAdd.position.set(x + width / 2, y + height / 2);\n\t\t\t\t\tshapeToAdd.angle = rotation;\n\t\t\t\t}\n\t\t\t\tshapeToAdd.cullable = true;\n\t\t\t\tshapeToAdd.custom = true;\n\t\t\t\tshapeToAdd.renderable = false;\n\t\t\t\tshapeToAdd.uuid = uuid;\n\t\t\t\tcanvas.stage.addChild(shapeToAdd);\n\t\t\t}\n\t\t\tshapeToAdd.obj = obj;\n\n\t\t\tconst updateMethod = (doc) => {\n\t\t\t\tif (doc !== documentObj) return;\n\t\t\t\tconst mask = maskFilter.masks.find((shape) => shape.uuid === uuid);\n\t\t\t\tif (!mask) return;\n\t\t\t\tif (!mask.custom) return;\n\t\t\t\tmask.clear();\n\t\t\t\tif (obj instanceof FoundryShim.MeasuredTemplate) {\n\t\t\t\t\tmask.position.set(documentObj.x, documentObj.y);\n\t\t\t\t\tlet maskObj = documentObj.object;\n\t\t\t\t\tshape = obj?.shape?.geometry?.graphicsData?.[0]?.shape ?? obj?.shape;\n\t\t\t\t\tshape = PluginsManager.masking({\n\t\t\t\t\t\teffect: this,\n\t\t\t\t\t\tdoc: documentObj,\n\t\t\t\t\t\tobj: maskObj,\n\t\t\t\t\t\tshape\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tx,\n\t\t\t\t\t\ty,\n\t\t\t\t\t\tshape: { width, height },\n\t\t\t\t\t\trotation,\n\t\t\t\t\t} = documentObj;\n\t\t\t\t\tmask.pivot.set(width / 2, height / 2);\n\t\t\t\t\tmask.position.set(x + width / 2, y + height / 2);\n\t\t\t\t\tmask.angle = rotation;\n\t\t\t\t}\n\t\t\t\tmask.beginFill().drawShape(shape).endFill();\n\t\t\t};\n\n\t\t\tPluginsManager.maskingHooks.forEach(hook => {\n\t\t\t\thooksManager.addHook(this.uuid, hook, (doc) => {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tupdateMethod(doc);\n\t\t\t\t\t}, 100);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\thooksManager.addHook(this.uuid, this.getHook(\"update\", uuid), (doc) => {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tupdateMethod(doc);\n\t\t\t\t}, 100);\n\t\t\t});\n\n\t\t\tmaskFilter.masks.push(shapeToAdd);\n\t\t}\n\n\t\tfor (const shapeData of maskShapes) {\n\t\t\tconst shape = canvaslib.createShape(shapeData);\n\t\t\tshape.cullable = true;\n\t\t\tshape.custom = true;\n\t\t\tshape.renderable = false;\n\t\t\tthis.spriteContainer.addChild(shape);\n\t\t\tthis.shapes[shapeData?.name ?? \"shape-\" + foundry.utils.randomID()] = shape;\n\t\t\tmaskFilter.masks.push(shape);\n\t\t}\n\n\t\tthis.sprite.filters.push(maskFilter);\n\t}\n\n\t/**\n\t * Sets up the hooks relating to this effect's source and target\n\t *\n\t * @private\n\t */\n\t_setupHooks() {\n\n\t\tconst attachedToSource =\n\t\t\tthis.data.attachTo?.active && lib.is_UUID(this.data.source);\n\t\tconst attachedToTarget =\n\t\t\t(this.data.stretchTo?.attachTo || this.data.rotateTowards?.attachTo) &&\n\t\t\tlib.is_UUID(this.data.target);\n\n\t\tconst baseRenderable = this.shouldPlayVisible;\n\t\tlet renderable = baseRenderable;\n\t\tlet alpha = null;\n\n\t\tif (attachedToSource) {\n\t\t\thooksManager.addHook(this.uuid, this.getSourceHook(\"delete\"), (doc) => {\n\t\t\t\tconst uuid = doc.uuid;\n\t\t\t\tif (doc !== this.sourceDocument) return;\n\t\t\t\tthis._source = this._cachedSourceData.position;\n\t\t\t\tSequencerEffectManager.objectDeleted(uuid);\n\t\t\t});\n\n\t\t\tif(this.isSourceDestroyed){\n\t\t\t\tSequencerEffectManager.objectDeleted(this.sourceDocument.uuid);\n\t\t\t}\n\n\t\t\tif (this.data.attachTo?.bindVisibility) {\n\t\t\t\thooksManager.addHook(\n\t\t\t\t\tthis.uuid,\n\t\t\t\t\t\"sightRefresh\",\n\t\t\t\t\t() => {\n\t\t\t\t\t\tconst sourceVisible =\n\t\t\t\t\t\t\tthis.source && (!this.sourceMesh?.occluded);\n\t\t\t\t\t\tconst sourceHidden =\n\t\t\t\t\t\t\tthis.sourceDocument && (this.sourceDocument?.hidden ?? false);\n\t\t\t\t\t\tconst targetVisible =\n\t\t\t\t\t\t\tthis.target &&\n\t\t\t\t\t\t\t(!attachedToTarget || (this.targetMesh?.occluded ?? true));\n\t\t\t\t\t\tthis.renderable =\n\t\t\t\t\t\t\tbaseRenderable &&\n\t\t\t\t\t\t\t(!sourceHidden || game.user.isGM) &&\n\t\t\t\t\t\t\t(sourceVisible || targetVisible) &&\n\t\t\t\t\t\t\tthis._checkWallCollisions();\n\t\t\t\t\t\tthis.alpha = sourceVisible && sourceHidden ? 0.5 : 1.0;\n\t\t\t\t\t\trenderable = baseRenderable && this.renderable;\n\t\t\t\t\t},\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (this.data.attachTo?.bindAlpha || this.data.attachTo?.bindElevation) {\n\t\t\t\thooksManager.addHook(this.uuid, this.getSourceHook(\"update\"), (doc) => {\n\t\t\t\t\tif (doc !== this.sourceDocument) return;\n\t\t\t\t\tif (this.data.attachTo?.bindAlpha) {\n\t\t\t\t\t\tthis.spriteContainer.alpha = this.getSourceData().alpha;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.data.attachTo?.bindElevation) {\n\t\t\t\t\t\tthis.updateElevation();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (this.data.attachTo?.bindAlpha) {\n\t\t\t\talpha = this.getSourceData().alpha;\n\t\t\t}\n\t\t}\n\n\t\tif (attachedToTarget) {\n\t\t\thooksManager.addHook(this.uuid, this.getTargetHook(\"delete\"), (doc) => {\n\t\t\t\tif (doc !== this.target) return;\n\t\t\t\tthis._target = this._cachedTargetData.position;\n\t\t\t\tconst uuid = doc.uuid;\n\t\t\t\tSequencerEffectManager.objectDeleted(uuid);\n\t\t\t});\n\t\t\tif(this.isTargetDestroyed){\n\t\t\t\tSequencerEffectManager.objectDeleted(this.targetDocument.uuid);\n\t\t\t}\n\t\t\thooksManager.addHook(this.uuid, this.getTargetHook(\"update\"), (doc) => {\n\t\t\t\tif (doc !== this.target) return;\n\t\t\t\tthis.updateElevation();\n\t\t\t});\n\t\t}\n\n\t\tfor (let uuid of this.data?.tiedDocuments ?? []) {\n\t\t\tconst tiedDocument = fromUuidSync(uuid);\n\t\t\tif (tiedDocument) {\n\t\t\t\thooksManager.addHook(\n\t\t\t\t\tthis.uuid,\n\t\t\t\t\tthis.getHook(\"delete\", tiedDocument.uuid),\n\t\t\t\t\t(doc) => {\n\t\t\t\t\t\tif (tiedDocument !== doc) return;\n\t\t\t\t\t\tSequencerEffectManager.objectDeleted(doc.uuid);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tthis.renderable = renderable;\n\t\t\tthis.spriteContainer.alpha = alpha ?? 1.0;\n\t\t}, 25);\n\t}\n\n\t/**\n\t * Calculates the padding and scale to stretch an effect across the given distance\n\t *\n\t * If the file is a SequencerFileBase instance, it will also pick the appropriate file for the right distance\n\t *\n\t * @param {number} distance\n\t * @param {number} textureWidth\n\t * @returns {Object}\n\t * @private\n\t */\n\tasync _getDistanceScaling(distance, textureWidth) {\n\t\tif (!this._distanceCache || this._distanceCache?.distance !== distance) {\n\t\t\tlet scaleX = 1.0;\n\t\t\tlet scaleY = 1.0;\n\n\t\t\tif (this._file instanceof SequencerFileBase) {\n\n\t\t\t\tconst startPoint = this.template?.startPoint ?? 0\n\t\t\t\tconst endPoint = this.template?.endPoint ?? 0\n\t\t\t\tconst widthWithPadding = textureWidth - (startPoint + endPoint);\n\n\t\t\t\tconst spriteScale = distance / widthWithPadding\n\n\t\t\t\tscaleX = spriteScale;\n\t\t\t\tscaleY = this.data.stretchTo?.onlyX ? widthWithPadding / textureWidth : spriteScale;\n\t\t\t}\n\n\t\t\tthis._distanceCache = {\n\t\t\t\tscaleX,\n\t\t\t\tscaleY,\n\t\t\t\tdistance,\n\t\t\t};\n\t\t}\n\n\t\treturn this._distanceCache;\n\t}\n\n\t/**\n\t * Applies the distance scaling to the sprite based on the previous method\n\t *\n\t * @returns {Promise<void>}\n\t * @private\n\t */\n\tasync _applyDistanceScaling() {\n\t\tconst ray = new Ray(this.sourcePosition, this.targetPosition);\n\n\t\tthis._rotateTowards(ray);\n\n\t\tconst distance = ray.distance / (this.data.scale.x ?? 1.0);\n\n\t\tthis._updateCurrentFilePath(distance)\n\t\tawait this.sprite.activate(this._currentFilePath)\n\t\tconst texture = this.sprite.texture\n\n\t\tlet {  scaleX, scaleY } = await this._getDistanceScaling(distance, texture.width);\n\n\t\tif (this.data.attachTo?.active) {\n\t\t\tthis.position.set(\n\t\t\t\tthis.sourcePosition.x,\n\t\t\t\tthis.sourcePosition.y\n\t\t\t);\n\t\t}\n\n\t\tif (this.data.tilingTexture) {\n\t\t\tconst scaleX = (this.data.scale.x ?? 1.0);\n\t\t\tconst scaleY = (this.data.scale.y ?? 1.0);\n\t\t\tthis.sprite.scale.set(scaleX * this.flipX, scaleY * this.flipY);\n\t\t\tthis.sprite.width = distance * scaleX;\n\t\t\tthis.sprite.height = texture.height * scaleY;\n\n\t\t\tthis.sprite.tileScale.x = this.data.tilingTexture.scale.x * scaleX;\n\t\t\tthis.sprite.tileScale.y = this.data.tilingTexture.scale.y * scaleY;\n\t\t\tthis.sprite.tilePosition = this.data.tilingTexture.position;\n\t\t} else {\n\t\t\tthis.sprite.scale.set(\n\t\t\t\tscaleX * (this.data.scale.x ?? 1.0) * this.flipX,\n\t\t\t\tscaleY * (this.data.scale.y ?? 1.0) * this.flipY\n\t\t\t);\n\t\t}\n\n\t}\n\n\t_setAnchors() {\n\t\tlet anchor = {x: 0.5, y: 0.5, ...(this.data.spriteAnchor ?? null)}\n\n\t\tif (\n\t\t\t(this.data.rotateTowards && this.data.rotateTowards.template) ||\n\t\t\tthis.data.stretchTo\n\t\t) {\n\t\t\tconst textureWidth = this.sprite.texture?.width ?? this.sprite.width;\n\t\t\tconst templateAnchorX = this.template ? this.template.startPoint / textureWidth : undefined;\n\t\t\tanchor = { x: templateAnchorX, y: 0.5 }\n\t\t}\n\t\tif (this.data.rotateTowards && !this.data.rotateTowards.template && !this.data.anchor) {\n\t\t\tthis.spriteContainer.pivot.set(this.sprite.width * -0.5,0);\n\t\t} else {\n\t\t\tthis.spriteContainer.pivot.set(\n\t\t\t\tlib.interpolate(\n\t\t\t\t\tthis.sprite.width * -0.5,\n\t\t\t\t\tthis.sprite.width * 0.5,\n\t\t\t\t\tthis.data.anchor?.x ?? 0.5\n\t\t\t\t),\n\t\t\t\tlib.interpolate(\n\t\t\t\t\tthis.sprite.height * -0.5,\n\t\t\t\t\tthis.sprite.height * 0.5,\n\t\t\t\t\tthis.data.anchor?.y ?? 0.5\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tthis.sprite.anchor?.set(\n\t\t\tthis.flipX === 1 ? anchor.x : 1 - anchor.x,\n\t\t\tanchor.y\n\t\t);\n\t}\n\n\t_checkWallCollisions() {\n\t\tif (\n\t\t\t!this.data.stretchTo?.attachTo ||\n\t\t\t!this.data.stretchTo?.requiresLineOfSight\n\t\t)\n\t\t\treturn true;\n\n\t\tconst ray = new Ray(this.sourcePosition, this.targetPosition);\n\n\t\tconst blockingObjects = canvas.walls.checkCollision(ray, { type: \"sight\" });\n\n\t\tif (!blockingObjects.length && !this.data.stretchTo?.hideLineOfSight) {\n\t\t\tSequencerEffectManager.endEffects({ effects: this });\n\t\t}\n\n\t\treturn !blockingObjects.length;\n\t}\n\n\t/**\n\t * Rotates the effect towards the target\n\t *\n\t * @param ray\n\t * @private\n\t */\n\t_rotateTowards(ray) {\n\t\tif (!ray) {\n\t\t\tconst sourcePosition =\n\t\t\t\tthis.flipX === 1 ? this.sourcePosition : this.targetPosition;\n\t\t\tconst targetPosition =\n\t\t\t\tthis.flipX === 1 ? this.targetPosition : this.sourcePosition;\n\t\t\tray = new Ray(sourcePosition, targetPosition);\n\t\t}\n\n\t\tthis.rotationContainer.rotation = Math.normalizeRadians(\n\t\t\tray.angle + Math.toRadians(this.data.rotateTowards?.rotationOffset ?? 0)\n\t\t);\n\n\t\tPluginsManager.rotation({ effect: this });\n\t}\n\n\t/**\n\t * Transforms the sprite, rotating it, stretching it, scaling it, sizing it according its data\n\t *\n\t * @private\n\t */\n\tasync _transformSprite() {\n\t\tif (this.data.stretchTo) {\n\t\t\tawait this._applyDistanceScaling();\n\t\t}\n\n\t\tif (!this.data.stretchTo) {\n\t\t\tthis._transformNoStretchSprite();\n\t\t}\n\n\t\tif (!this.data.screenSpace && (!this.data.attachTo?.active || this.data.stretchTo?.attachTo)) {\n\t\t\tthis.position.set(this.sourcePosition.x, this.sourcePosition.y);\n\t\t}\n\n\t\tif (this.data.rotateTowards) {\n\t\t\tthis._rotateTowards();\n\t\t}\n\n\t\tthis._setAnchors()\n\t\tPluginsManager.rotation({ effect: this });\n\t\tthis.sprite.updateDefaultScaling()\n\t}\n\n\tasync _transformStretchToAttachedSprite() {\n\t\ttry {\n\t\t\tawait this._applyDistanceScaling();\n\t\t\tthis._setAnchors()\n\t\t} catch (err) {\n\t\t\t//lib.debug_error(err);\n\t\t}\n\t}\n\n\t_transformNoStretchSprite() {\n\t\tif (this.data.tilingTexture) {\n\t\t\tthis.sprite.tileScale = {\n\t\t\t\tx: this.data.tilingTexture.scale.x * this.gridSizeDifference,\n\t\t\t\ty: this.data.tilingTexture.scale.y * this.gridSizeDifference,\n\t\t\t};\n\n\t\t\tthis.sprite.tilePosition = this.data.tilingTexture.position;\n\t\t}\n\n\t\tconst { heightWidthRatio, widthHeightRatio, baseScaleX, baseScaleY } = this._getBaseScale()\n\n\t\tif (this.data.scaleToObject) {\n\t\t\tthis._applyScaleToObject(heightWidthRatio, widthHeightRatio, baseScaleX, baseScaleY);\n\n\t\t} else if (this.data.size) {\n\n\t\t\tlet { height, width } = this.data.size;\n\n\t\t\tif (this.data.size.width === \"auto\" || this.data.size.height === \"auto\") {\n\t\t\t\theight = this.sprite.height;\n\t\t\t\twidth = this.sprite.width;\n\n\t\t\t\tif (this.data.size.width === \"auto\") {\n\t\t\t\t\theight = this.data.size.height;\n\t\t\t\t\tif (this.data.size.gridUnits) {\n\t\t\t\t\t\theight *= canvas.grid.size;\n\t\t\t\t\t}\n\t\t\t\t\twidth = height * widthHeightRatio;\n\t\t\t\t} else if (this.data.size.height === \"auto\") {\n\t\t\t\t\twidth = this.data.size.width;\n\t\t\t\t\tif (this.data.size.gridUnits) {\n\t\t\t\t\t\twidth *= canvas.grid.size;\n\t\t\t\t\t}\n\t\t\t\t\theight = width * heightWidthRatio;\n\t\t\t\t}\n\t\t\t} else if (this.data.size.gridUnits) {\n\t\t\t\theight *= canvas.grid.size;\n\t\t\t\twidth *= canvas.grid.size;\n\t\t\t}\n\n\t\t\tthis.sprite.width = width * baseScaleX;\n\t\t\tthis.sprite.height = height * baseScaleY;\n\t\t} else if (this.data.screenSpace) {\n\t\t\tthis.sprite.scale.set(\n\t\t\t\tbaseScaleX,\n\t\t\t\tbaseScaleY\n\t\t\t);\n\t\t} else {\n\t\t\tthis.sprite.scale.set(\n\t\t\t\tbaseScaleX * this.gridSizeDifference,\n\t\t\t\tbaseScaleY * this.gridSizeDifference\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Calculate the base scale and aspect ratios of the sprite\n\t *\n\t * @returns {{heightWidthRatio: number, widthHeightRatio: number, baseScaleX: number, baseScaleY: number}}\n\t *\n\t * @private\n\t */\n\t_getBaseScale() {\n\t\tconst heightWidthRatio = this.sprite.height / this.sprite.width;\n\t\tconst widthHeightRatio = this.sprite.width / this.sprite.height;\n\n\t\tconst baseScaleX =\n\t\t\t(this.data.scale?.x ?? 1.0) *\n\t\t\t(this.data.spriteScale?.x ?? 1.0) *\n\t\t\tthis.flipX;\n\t\tconst baseScaleY =\n\t\t\t(this.data.scale?.y ?? 1.0) *\n\t\t\t(this.data.spriteScale?.y ?? 1.0) *\n\t\t\tthis.flipY;\n\n\t\treturn {\n\t\t\theightWidthRatio,\n\t\t\twidthHeightRatio,\n\t\t\tbaseScaleX,\n\t\t\tbaseScaleY,\n\t\t}\n\t}\n\n\t_applyScaleToObject(heightWidthRatio, widthHeightRatio, baseScaleX, baseScaleY) {\n\t\ttry {\n\t\t\tlet { width, height } = this.getSourceData();\n\n\t\t\tif (this.sourceDocument instanceof TokenDocument) {\n\t\t\t\twidth *= this.data.scaleToObject?.considerTokenScale\n\t\t\t\t\t? this.sourceDocument.texture.scaleX\n\t\t\t\t\t: 1.0;\n\t\t\t\theight *= this.data.scaleToObject?.considerTokenScale\n\t\t\t\t\t? this.sourceDocument.texture.scaleY\n\t\t\t\t\t: 1.0;\n\t\t\t}\n\n\t\t\tif (width === this._lastDimensions.width && height === this._lastDimensions.height) return;\n\n\t\t\tthis._lastDimensions = { width, height };\n\n\t\t\tconst ratioToUse = heightWidthRatio > widthHeightRatio;\n\n\t\t\tif (this.data.scaleToObject?.uniform) {\n\t\t\t\tlet newWidth = Math.max(width, height);\n\t\t\t\theight = Math.max(width, height);\n\t\t\t\twidth = newWidth;\n\t\t\t} else {\n\t\t\t\twidth = width * (ratioToUse ? widthHeightRatio : 1.0);\n\t\t\t\theight = height * (!ratioToUse ? heightWidthRatio : 1.0);\n\t\t\t}\n\n\t\t\tthis.sprite.width = width * (this.data.scaleToObject?.scale ?? 1.0) * baseScaleX;\n\t\t\tthis.sprite.height = height * (this.data.scaleToObject?.scale ?? 1.0) * baseScaleY;\n\n\t\t\tSequencerAnimationEngine.updateStartValues(this.sprite, \"width\");\n\t\t\tSequencerAnimationEngine.updateStartValues(this.sprite, \"height\");\n\t\t\tSequencerAnimationEngine.updateStartValues(this.sprite, \"scale.x\");\n\t\t\tSequencerAnimationEngine.updateStartValues(this.sprite, \"scale.y\");\n\n\t\t} catch (err) {\n\n\t\t}\n\n\t}\n\n\tasync _transformAttachedNoStretchSprite() {\n\n\t\tif (this.isDestroyed) return;\n\n\t\tconst applyRotation =\n\t\t\tthis.data.attachTo?.bindRotation &&\n\t\t\t!(\n\t\t\t\tthis.sourceDocument instanceof TokenDocument &&\n\t\t\t\tthis.sourceDocument.lockRotation\n\t\t\t) &&\n\t\t\t(this.sourceDocument?.rotation !== undefined ||\n\t\t\t\tthis.sourceDocument?.direction !== undefined) &&\n\t\t\t!this.data.rotateTowards &&\n\t\t\t!this.data.stretchTo;\n\n\t\tif (applyRotation) {\n\t\t\tthis.rotationContainer.rotation = this.getSourceData().rotation;\n\t\t}\n\n\t\tPluginsManager.rotation({ effect: this });\n\n\t\tthis.position.set(\n\t\t\tthis.sourcePosition.x,\n\t\t\tthis.sourcePosition.y\n\t\t);\n\t}\n\n\tasync _transformRotateTowardsAttachedSprite() {\n\t\tif (this.isDestroyed) return;\n\t\ttry {\n\t\t\tthis._rotateTowards();\n\t\t\tthis._setAnchors()\n\t\t} catch (err) {\n\t\t\tlib.debug_error(err);\n\t\t}\n\t}\n\n\t/**\n\t * Provided an animation targeting the rotation of the sprite's primary container, this method will counter-rotate\n\t * the sprite in an equal fashion so that the sprite's rotation remains static relative to this animation\n\t *\n\t * @param animation\n\t * @returns {*[]}\n\t * @private\n\t */\n\t_counterAnimateRotation(animation) {\n\t\tif (\n\t\t\tanimation.target === this.spriteContainer &&\n\t\t\tthis.data.zeroSpriteRotation\n\t\t) {\n\t\t\tdelete animation.target;\n\t\t\tlet counterAnimation = foundry.utils.deepClone(animation);\n\t\t\tanimation.target = this.spriteContainer;\n\t\t\tcounterAnimation.target = this.sprite;\n\t\t\tif (counterAnimation.values) {\n\t\t\t\tcounterAnimation.values = counterAnimation.values.map(\n\t\t\t\t\t(value) => value * -1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcounterAnimation.from *= -1;\n\t\t\t\tcounterAnimation.to *= -1;\n\t\t\t}\n\t\t\tif (!Array.isArray(animation)) {\n\t\t\t\tanimation = [animation, counterAnimation];\n\t\t\t} else {\n\t\t\t\tanimation.push(counterAnimation);\n\t\t\t}\n\t\t}\n\n\t\treturn animation;\n\t}\n\n\t/**\n\t * Plays the custom animations of this effect\n\t *\n\t * @returns {number}\n\t * @private\n\t */\n\t_playCustomAnimations() {\n\t\tif (!this.data.animations) return 0;\n\n\t\tthis._playAnimations(\n\t\t\tfoundry.utils.deepClone(this.data.animations) ?? [],\n\t\t\tthis.actualCreationTime - this.creationTimestamp\n\t\t);\n\t}\n\n\t_playAnimations(animations, timeDifference = 0) {\n\t\tlet animationsToSend = [];\n\n\t\tconst oneShotAnimations = animations.filter(\n\t\t\t(animation) => !animation.looping && !animation.fromEnd\n\t\t);\n\n\t\tfor (let animation of oneShotAnimations) {\n\t\t\tif (animation.target === 'alphaFilter') {\n\t\t\t\tanimation.target = this\n\t\t\t\tanimation.propertyName = 'effectAlpha'\n\t\t\t} else if (animation.target === \"effect\") {\n\t\t\t\tanimation.target = this;\n\t\t\t} else {\n\t\t\t\tanimation.target = foundry.utils.getProperty(this, animation.target);\n\t\t\t}\n\n\t\t\tif (!animation.target) continue;\n\n\t\t\tif (animation.propertyName.indexOf(\"rotation\") > -1) {\n\t\t\t\tanimation.from = animation.from * (Math.PI / 180);\n\t\t\t\tanimation.to = animation.to * (Math.PI / 180);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t[\"position.x\", \"position.y\", \"height\", \"width\"].includes(\n\t\t\t\t\tanimation.propertyName\n\t\t\t\t) &&\n\t\t\t\tanimation.gridUnits\n\t\t\t) {\n\t\t\t\tanimation.from *= canvas.grid.size;\n\t\t\t\tanimation.to *= canvas.grid.size;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t[\"position.x\", \"position.y\", \"height\", \"width\"].includes(\n\t\t\t\t\tanimation.propertyName\n\t\t\t\t) &&\n\t\t\t\tanimation.screenSpace\n\t\t\t) {\n\t\t\t\tconst [screenWidth, screenHeight] = canvas.screenDimensions;\n\t\t\t\tconst dimension = animation.propertyName === \"position.x\" || animation.propertyName === \"width\"\n\t\t\t\t\t? screenWidth\n\t\t\t\t\t: screenHeight;\n\t\t\t\tanimation.from *= dimension;\n\t\t\t\tanimation.to *= dimension;\n\t\t\t}\n\n\t\t\tif ([\"hue\"].includes(animation.propertyName)) {\n\t\t\t\tanimation.getPropertyName = \"values.\" + animation.propertyName;\n\t\t\t}\n\n\t\t\tanimationsToSend = animationsToSend.concat(\n\t\t\t\tthis._counterAnimateRotation(animation)\n\t\t\t);\n\t\t}\n\n\t\tconst loopingAnimations = animations.filter(\n\t\t\t(animation) => animation.looping\n\t\t);\n\n\t\tfor (let animation of loopingAnimations) {\n\t\t\tif (animation.target === 'alphaFilter') {\n\t\t\t\tanimation.target = this\n\t\t\t\tanimation.propertyName = 'effectAlpha'\n\t\t\t} else if (animation.target === \"effect\") {\n\t\t\t\tanimation.target = this;\n\t\t\t} else {\n\t\t\t\tanimation.target = foundry.utils.getProperty(this, animation.target);\n\t\t\t}\n\n\t\t\tif (!animation.target) continue;\n\n\t\t\tif (animation.propertyName.indexOf(\"rotation\") > -1) {\n\t\t\t\tanimation.values = animation.values.map((angle) => {\n\t\t\t\t\treturn angle * (Math.PI / 180);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t[\"position.x\", \"position.y\", \"height\", \"width\"].includes(\n\t\t\t\t\tanimation.propertyName\n\t\t\t\t) &&\n\t\t\t\tanimation.gridUnits\n\t\t\t) {\n\t\t\t\tanimation.values = animation.values.map((value) => {\n\t\t\t\t\treturn value * canvas.grid.size;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif ([\"hue\"].includes(animation.propertyName)) {\n\t\t\t\tanimation.getPropertyName = \"values.\" + animation.propertyName;\n\t\t\t}\n\n\t\t\tanimationsToSend = animationsToSend.concat(\n\t\t\t\tthis._counterAnimateRotation(animation)\n\t\t\t);\n\t\t}\n\n\t\tif (!(this instanceof PersistentCanvasEffect)) {\n\t\t\tanimationsToSend = animationsToSend.concat(\n\t\t\t\tthis._getFromEndCustomAnimations()\n\t\t\t);\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tSequencerAnimationEngine.addAnimation(\n\t\t\t\tthis.id,\n\t\t\t\tanimationsToSend,\n\t\t\t\ttimeDifference\n\t\t\t);\n\t\t}, 20);\n\t}\n\n\t_getFromEndCustomAnimations(immediate = false) {\n\t\tlet fromEndAnimations = [];\n\n\t\tconst animations = foundry.utils.deepClone(this.data.animations) ?? [];\n\n\t\tconst oneShotEndingAnimations = animations.filter(\n\t\t\t(animation) => !animation.looping && animation.fromEnd\n\t\t);\n\n\t\tfor (let animation of oneShotEndingAnimations) {\n\t\t\tanimation.target = foundry.utils.getProperty(this, animation.target);\n\n\t\t\tif (!animation.target) continue;\n\n\t\t\tanimation.delay = lib.is_real_number(immediate)\n\t\t\t\t? Math.max(immediate - animation.duration + animation.delay, 0)\n\t\t\t\t: Math.max(\n\t\t\t\t\tthis._totalDuration - animation.duration + animation.delay,\n\t\t\t\t\t0\n\t\t\t\t);\n\n\t\t\tif (animation.propertyName.indexOf(\"rotation\") > -1) {\n\t\t\t\tanimation.from = animation.from * (Math.PI / 180);\n\t\t\t\tanimation.to = animation.to * (Math.PI / 180);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t[\"position.x\", \"position.y\", \"height\", \"width\"].includes(\n\t\t\t\t\tanimation.propertyName\n\t\t\t\t) &&\n\t\t\t\tanimation.gridUnits\n\t\t\t) {\n\t\t\t\tanimation.from *= canvas.grid.size;\n\t\t\t\tanimation.to *= canvas.grid.size;\n\t\t\t}\n\n\t\t\tfromEndAnimations = fromEndAnimations.concat(\n\t\t\t\tthis._counterAnimateRotation(animation)\n\t\t\t);\n\t\t}\n\n\t\treturn fromEndAnimations;\n\t}\n\n\t/**\n\t * Fades in the effect at the start of the effect\n\t *\n\t * @returns {number|*}\n\t * @private\n\t */\n\t_fadeIn() {\n\t\tif (!this.data.fadeIn || !this.sprite) return 0;\n\n\t\tlet fadeIn = this.data.fadeIn;\n\n\t\tif (\n\t\t\tthis.actualCreationTime -\n\t\t\t(this.creationTimestamp + fadeIn.duration + fadeIn.delay) >\n\t\t\t0\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.effectAlpha = 0.0;\n\n\t\tSequencerAnimationEngine.addAnimation(this.id, {\n\t\t\ttarget: this,\n\t\t\tpropertyName: \"effectAlpha\",\n\t\t\tto: this.data.opacity,\n\t\t\tduration: fadeIn.duration,\n\t\t\tease: fadeIn.ease,\n\t\t\tdelay: fadeIn.delay,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\treturn fadeIn.duration + fadeIn.delay;\n\t}\n\n\t/**\n\t * Fades in the effect's audio at the start of the effect\n\t *\n\t * @returns {number|*}\n\t * @private\n\t */\n\t_fadeInAudio() {\n\t\tif (!this.data.fadeInAudio || !this.sprite || !this.sprite.hasAnimatedMedia) return 0;\n\n\t\tlet fadeInAudio = this.data.fadeInAudio;\n\n\t\tif (\n\t\t\tthis.actualCreationTime -\n\t\t\t(this.creationTimestamp +\n\t\t\t\tfadeInAudio.duration +\n\t\t\t\tfadeInAudio.delay) >\n\t\t\t0\n\t\t)\n\t\t\treturn;\n\n\t\tthis.sprite.volume = 0.0;\n\n\t\tSequencerAnimationEngine.addAnimation(this.id, {\n\t\t\ttarget: this.sprite,\n\t\t\tpropertyName: \"volume\",\n\t\t\tto:\n\t\t\t\t(this.data.volume ?? 0) *\n\t\t\t\tgame.settings.get(\"core\", \"globalInterfaceVolume\"),\n\t\t\tduration: fadeInAudio.duration,\n\t\t\tease: fadeInAudio.ease,\n\t\t\tdelay: fadeInAudio.delay,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\treturn fadeInAudio.duration + fadeInAudio.delay;\n\t}\n\n\t/**\n\t * Fades out the effect at the end of the effect's duration\n\t *\n\t * @returns {number|*}\n\t * @private\n\t */\n\t_fadeOut(immediate = false) {\n\t\tif (!this.data.fadeOut || !this.sprite) return 0;\n\n\t\tlet fadeOut = this.data.fadeOut;\n\n\t\tfadeOut.delay = lib.is_real_number(immediate)\n\t\t\t? Math.max(immediate - fadeOut.duration + fadeOut.delay, 0)\n\t\t\t: Math.max(this._totalDuration - fadeOut.duration + fadeOut.delay, 0);\n\n\t\tSequencerAnimationEngine.addAnimation(this.id, {\n\t\t\ttarget: this,\n\t\t\tpropertyName: \"effectAlpha\",\n\t\t\tto: 0.0,\n\t\t\tduration: fadeOut.duration,\n\t\t\tease: fadeOut.ease,\n\t\t\tdelay: fadeOut.delay,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\treturn fadeOut.duration + fadeOut.delay;\n\t}\n\n\t/**\n\t * Fades out the effect at the end of the effect's duration\n\t *\n\t * @returns {number|*}\n\t * @private\n\t */\n\t_fadeOutAudio(immediate = false) {\n\t\tif (!this.data.fadeOutAudio || !this.sprite || !this.sprite.hasAnimatedMedia) return 0;\n\n\t\tlet fadeOutAudio = this.data.fadeOutAudio;\n\n\t\tfadeOutAudio.delay = lib.is_real_number(immediate)\n\t\t\t? Math.max(immediate - fadeOutAudio.duration + fadeOutAudio.delay, 0)\n\t\t\t: Math.max(\n\t\t\t\tthis._totalDuration - fadeOutAudio.duration + fadeOutAudio.delay,\n\t\t\t\t0\n\t\t\t);\n\n\t\tsetTimeout(() => {\n\t\t\tSequencerAnimationEngine.addAnimation(this.id, {\n\t\t\t\ttarget: this.sprite,\n\t\t\t\tpropertyName: \"volume\",\n\t\t\t\tto: 0.0,\n\t\t\t\tduration: fadeOutAudio.duration,\n\t\t\t\tease: fadeOutAudio.ease,\n\t\t\t\tdelay: fadeOutAudio.delay,\n\t\t\t\tabsolute: true,\n\t\t\t});\n\t\t});\n\n\t\treturn fadeOutAudio.duration + fadeOutAudio.delay;\n\t}\n\n\t/**\n\t * Determines the scale to animate from or to\n\t * @param property\n\t * @returns {{x: number, y: number}}\n\t * @private\n\t */\n\t_determineScale(property) {\n\t\tlet scale = {\n\t\t\tx: this.sprite.scale.x,\n\t\t\ty: this.sprite.scale.y,\n\t\t};\n\n\t\tif (lib.is_real_number(property.value)) {\n\t\t\tscale.x *= property.value * this.gridSizeDifference * this.flipX;\n\t\t\tscale.y *= property.value * this.gridSizeDifference * this.flipY;\n\t\t} else {\n\t\t\tscale.x *= property.value.x * this.gridSizeDifference * this.flipX;\n\t\t\tscale.y *= property.value.y * this.gridSizeDifference * this.flipY;\n\t\t}\n\n\t\treturn scale;\n\t}\n\n\t/**\n\t * Scales the effect in at the start of the effect\n\t *\n\t * @returns {number|*}\n\t * @private\n\t */\n\t_scaleIn() {\n\t\tif (!this.data.scaleIn || !this.sprite) return 0;\n\n\t\tlet scaleIn = this.data.scaleIn;\n\t\tlet fromScale = this._determineScale(scaleIn);\n\n\t\tif (\n\t\t\tthis.actualCreationTime -\n\t\t\t(this.creationTimestamp + scaleIn.duration + scaleIn.delay) >\n\t\t\t0\n\t\t)\n\t\t\treturn;\n\n\t\tlet toScale = {\n\t\t\tx: this.sprite.scale.x,\n\t\t\ty: this.sprite.scale.y,\n\t\t};\n\n\t\tthis.sprite.scale.set(fromScale.x, fromScale.y);\n\n\t\tSequencerAnimationEngine.addAnimation(this.id, [\n\t\t\t{\n\t\t\t\ttarget: this.sprite,\n\t\t\t\tpropertyName: \"scale.x\",\n\t\t\t\tfrom: fromScale.x,\n\t\t\t\tto: toScale.x,\n\t\t\t\tduration: scaleIn.duration,\n\t\t\t\tease: scaleIn.ease,\n\t\t\t\tdelay: scaleIn.delay,\n\t\t\t\tabsolute: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttarget: this.sprite,\n\t\t\t\tpropertyName: \"scale.y\",\n\t\t\t\tfrom: fromScale.y,\n\t\t\t\tto: toScale.y,\n\t\t\t\tduration: scaleIn.duration,\n\t\t\t\tease: scaleIn.ease,\n\t\t\t\tdelay: scaleIn.delay,\n\t\t\t\tabsolute: true,\n\t\t\t},\n\t\t]);\n\n\t\treturn scaleIn.duration + scaleIn.delay;\n\t}\n\n\t/**\n\t * Scales the effect out at the end of the effect's duration\n\t *\n\t * @returns {number|*}\n\t * @private\n\t */\n\t_scaleOut(immediate = false) {\n\t\tif (!this.data.scaleOut || !this.sprite) return 0;\n\n\t\tlet scaleOut = this.data.scaleOut;\n\t\tlet scale = this._determineScale(scaleOut);\n\n\t\tscaleOut.delay = lib.is_real_number(immediate)\n\t\t\t? Math.max(immediate - scaleOut.duration + scaleOut.delay, 0)\n\t\t\t: Math.max(\n\t\t\t\tthis._totalDuration - scaleOut.duration + scaleOut.delay,\n\t\t\t\t0\n\t\t\t);\n\n\t\tSequencerAnimationEngine.addAnimation(this.id, [\n\t\t\t{\n\t\t\t\ttarget: this.sprite,\n\t\t\t\tpropertyName: \"scale.x\",\n\t\t\t\tto: scale.x,\n\t\t\t\tduration: scaleOut.duration,\n\t\t\t\tease: scaleOut.ease,\n\t\t\t\tdelay: scaleOut.delay,\n\t\t\t\tabsolute: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttarget: this.sprite,\n\t\t\t\tpropertyName: \"scale.y\",\n\t\t\t\tto: scale.y,\n\t\t\t\tduration: scaleOut.duration,\n\t\t\t\tease: scaleOut.ease,\n\t\t\t\tdelay: scaleOut.delay,\n\t\t\t\tabsolute: true,\n\t\t\t},\n\t\t]);\n\n\t\treturn scaleOut.duration + scaleOut.delay;\n\t}\n\n\t/**\n\t * Rotates the effect in at the start of the effect\n\t *\n\t * @returns {number|*}\n\t * @private\n\t */\n\t_rotateIn() {\n\t\tif (!this.data.rotateIn || !this.sprite) return 0;\n\n\t\tlet rotateIn = this.data.rotateIn;\n\n\t\tif (\n\t\t\tthis.actualCreationTime -\n\t\t\t(this.creationTimestamp + rotateIn.duration + rotateIn.delay) >\n\t\t\t0\n\t\t)\n\t\t\treturn;\n\n\t\tlet original_radians = this.spriteContainer.rotation;\n\t\tthis.spriteContainer.rotation = rotateIn.value * (Math.PI / 180);\n\n\t\tSequencerAnimationEngine.addAnimation(\n\t\t\tthis.id,\n\t\t\tthis._counterAnimateRotation({\n\t\t\t\ttarget: this.spriteContainer,\n\t\t\t\tpropertyName: \"rotation\",\n\t\t\t\tto: original_radians,\n\t\t\t\tduration: rotateIn.duration,\n\t\t\t\tease: rotateIn.ease,\n\t\t\t\tdelay: rotateIn.delay,\n\t\t\t\tabsolute: true,\n\t\t\t})\n\t\t);\n\n\t\treturn rotateIn.duration + rotateIn.delay;\n\t}\n\n\t/**\n\t * Rotates the effect out at the end of the effect's duration\n\t *\n\t * @returns {number|*}\n\t * @private\n\t */\n\t_rotateOut(immediate = false) {\n\t\tif (!this.data.rotateOut || !this.sprite) return 0;\n\n\t\tlet rotateOut = this.data.rotateOut;\n\n\t\trotateOut.delay = lib.is_real_number(immediate)\n\t\t\t? Math.max(immediate - rotateOut.duration + rotateOut.delay, 0)\n\t\t\t: Math.max(\n\t\t\t\tthis._totalDuration - rotateOut.duration + rotateOut.delay,\n\t\t\t\t0\n\t\t\t);\n\n\t\tSequencerAnimationEngine.addAnimation(\n\t\t\tthis.id,\n\t\t\tthis._counterAnimateRotation({\n\t\t\t\ttarget: this.spriteContainer,\n\t\t\t\tpropertyName: \"rotation\",\n\t\t\t\tto: rotateOut.value * (Math.PI / 180),\n\t\t\t\tduration: rotateOut.duration,\n\t\t\t\tease: rotateOut.ease,\n\t\t\t\tdelay: rotateOut.delay,\n\t\t\t\tabsolute: true,\n\t\t\t})\n\t\t);\n\n\t\treturn rotateOut.duration + rotateOut.delay;\n\t}\n\n\t/**\n\t * Causes the effect to move towards the given location\n\t *\n\t * @returns {number|*}\n\t * @private\n\t */\n\t_moveTowards() {\n\t\tif (!this.data.moves || !this.sprite) return 0;\n\n\t\tlet moves = this.data.moves;\n\n\t\tlet movementDuration = this._totalDuration;\n\t\tif (this.data.moveSpeed) {\n\t\t\tconst distance = canvaslib.distance_between(\n\t\t\t\tthis.sourcePosition,\n\t\t\t\tthis.targetPosition\n\t\t\t);\n\t\t\tmovementDuration = (distance / this.data.moveSpeed) * 1000;\n\t\t}\n\n\t\tif (this.data.moves.rotate) this._rotateTowards();\n\n\t\tconst duration = movementDuration - moves.delay;\n\n\t\tif (\n\t\t\tthis.actualCreationTime -\n\t\t\t(this.creationTimestamp + duration + moves.delay) >\n\t\t\t0\n\t\t)\n\t\t\treturn;\n\n\t\tSequencerAnimationEngine.addAnimation(this.id, [\n\t\t\t{\n\t\t\t\ttarget: this,\n\t\t\t\tpropertyName: \"position.x\",\n\t\t\t\tto: this.targetPosition.x,\n\t\t\t\tduration: duration,\n\t\t\t\tease: moves.ease,\n\t\t\t\tdelay: moves.delay,\n\t\t\t\tabsolute: true\n\t\t\t},\n\t\t\t{\n\t\t\t\ttarget: this,\n\t\t\t\tpropertyName: \"position.y\",\n\t\t\t\tto: this.targetPosition.y,\n\t\t\t\tduration: duration,\n\t\t\t\tease: moves.ease,\n\t\t\t\tdelay: moves.delay,\n\t\t\t\tabsolute: true\n\t\t\t},\n\t\t]);\n\n\t\treturn duration + moves.delay;\n\t}\n\n\t/**\n\t * If this effect is temporary, this sets the timeout for when the effect should resolve and get removed;\n\t *\n\t * @private\n\t */\n\t_setEndTimeout() {\n\t\tsetTimeout(() => {\n\t\t\tthis._resolve(this.data);\n\t\t\tthis.endEffect();\n\t\t}, this._totalDuration);\n\t}\n\n\t_setupTimestampHook(offset) {\n\t\tif (!this._file?.originalMetadata?.timestamps || this._ended) return;\n\t\tconst timestamps = this._file.getTimestamps();\n\t\tconst timestampArray = Array.isArray(timestamps)\n\t\t\t? timestamps\n\t\t\t: [timestamps];\n\t\tfor (const timestamp of timestampArray) {\n\t\t\tif (!lib.is_real_number(timestamp)) continue;\n\t\t\tlet realTimestamp = timestamp - offset / this.mediaPlaybackRate;\n\t\t\tif (realTimestamp < 0) {\n\t\t\t\trealTimestamp += this._endTime;\n\t\t\t}\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (this._ended) return;\n\t\t\t\tHooks.callAll(\"sequencerEffectTimestamp\", this, this._file);\n\t\t\t\tif (this.mediaLooping) {\n\t\t\t\t\tconst offsets = (this._endTime - this.mediaCurrentTime) * -1000;\n\t\t\t\t\tthis._setupTimestampHook(offsets);\n\t\t\t\t}\n\t\t\t}, realTimestamp);\n\t\t}\n\t}\n\n\t/**\n\t * Starts the loop of this effect, calculating the difference between the effect's creation time, and the actual\n\t * creation time on the client\n\t *\n\t * @returns {Promise<void>}\n\t * @private\n\t */\n\tasync _startEffect() {\n\n\t\tif (!this.hasAnimatedMedia) return;\n\n\t\tlet creationTimeDifference = this.data.persist ? this.actualCreationTime - this.creationTimestamp : 0;\n\t\tcreationTimeDifference *= this.mediaPlaybackRate\n\n\t\t// +1 because \"loops: 1\" means we run the animation one time, not that it restarts once\n\t\t// whereas 0 means endless looping.\n\t\tthis._currentLoops = Math.floor(creationTimeDifference / this._totalDuration) + 1;\n\n\t\tif (this.loops && this._currentLoops > this.loops) {\n\t\t\tif(this.data.loopOptions?.endOnLastLoop || !this.data.persist) {\n\t\t\t\treturn this.endEffect();\n\t\t\t}\n\t\t\tawait this.pauseMedia();\n\t\t\tthis.mediaCurrentTime = this._endTime;\n\t\t\tif (this.sprite.texture) {\n\t\t\t\tconst oldRenderable = this.renderable;\n\t\t\t\tthis.renderable = false;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.updateTexture();\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.renderable ||= oldRenderable;\n\t\t\t\t\t}, 150)\n\t\t\t\t}, 150);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._startLoop(creationTimeDifference);\n\t}\n\n\t/**\n\t * Kicks off the loop, or just sets the video to loop\n\t *\n\t * @param creationTimeDifference\n\t * @returns {Promise<void>}\n\t * @private\n\t */\n\tasync _startLoop(creationTimeDifference) {\n\t\tif (!this._animationTimes.loopStart) {\n\t\t\tthis._loopOffset =\n\t\t\t\t(creationTimeDifference % this._animationDuration) / 1000;\n\t\t} else if ((creationTimeDifference / 1000) > this._animationTimes.loopStart) {\n\t\t\tconst loopDuration =\n\t\t\t\tthis._animationTimes.loopEnd - this._animationTimes.loopStart;\n\t\t\tthis._loopOffset =\n\t\t\t\t(creationTimeDifference % (loopDuration * 1000)) / 1000;\n\t\t}\n\n\t\tif (this._loopOffset) {\n\t\t\tthis.mediaCurrentTime = this._loopOffset\n\t\t}\n\t\tawait this.playMedia();\n\t\tthis._addToTicker(this.loopHandler);\n\t}\n\n\tasync loopHandler() {\n\t\tif (this._ended || this._isEnding) {\n\t\t\treturn;\n\t\t}\n\t\tconst endTime = this.data.persist ? (this._animationTimes.loopEnd ?? this._endTime) : this._endTime;\n\t\tif (this.mediaCurrentTime < endTime) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.restartLoopHandler != null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// if we're above end time, we can safely just pause for now\n\t\tthis.pauseMedia();\n\n\t\t// default media current time to exactly end time so we don't\n\t\t// continue to trigger certain parts of the following code\n\t\t// unnecessarily\n\t\tthis.mediaCurrentTime = this._endTime;\n\n\t\t// if we reached maximum loops, stay paused or even end the effect\n\t\tif ((this.loops || !this.data.persist) && this._currentLoops >= this.loops) {\n\t\t\tif (!this.data.persist || (this.data.persist && this.data.loopOptions?.endOnLastLoop)) {\n\t\t\t\tthis.endEffect();\n\t\t\t}\n\t\t\tthis._ticker?.remove(this.loopHandler, this);\n\t\t\treturn;\n\t\t}\n\n\t\tconst restartTime = this._startTime === 0 && this._animationTimes.loopStart \n\t\t  ? this._animationTimes.loopStart \n\t\t\t: this._startTime;\n\t\t// no loop delay means just start again at the beginning!\n\t\tif (!this.loopDelay) {\n\t\t\tthis._currentLoops++;\n\t\t\tthis.mediaCurrentTime = restartTime;\n\t\t\tthis.playMedia();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._currentLoops++;\n\t\t// register restart handler to trigger after loop delay\n\t\tthis.restartLoopHandler = setTimeout(() => {\n\t\t\tthis.restartLoopHandler = null;\n\t\t\tthis.mediaCurrentTime = restartTime;\n\t\t\tthis.playMedia();\n\t\t}, this.loopDelay)\n\t}\n}\n\nclass PersistentCanvasEffect extends CanvasEffect {\n\n\t/** @OVERRIDE */\n\t_playPresetAnimations() {\n\t\tthis._moveTowards();\n\t\tthis._fadeIn();\n\t\tthis._scaleIn();\n\t\tthis._rotateIn();\n\t}\n\n\t/** @OVERRIDE */\n\t_timeoutVisibility() {\n\t\tlet creationTimeDifference = this.actualCreationTime - this.creationTimestamp;\n\t\tlet timeout =\n\t\t\tcreationTimeDifference === 0 && !this.data.animations ? 0 : 50;\n\t\tsetTimeout(() => {\n\t\t\tthis._setupHooks();\n\t\t}, timeout);\n\t}\n\n\t/** @OVERRIDE */\n\t_setEndTimeout() {\n\t\tlet creationTimeDifference = this.actualCreationTime - this.creationTimestamp;\n\t\tif(this.loops && creationTimeDifference >= this._totalDuration && this.hasAnimatedMedia){\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.pauseMedia();\n\t\t\t}, this._totalDuration);\n\t\t}\n\t}\n\n\t/** @OVERRIDE */\n\tasync endEffect() {\n\t\tif (this._isEnding) return;\n\t\tthis._isEnding = true;\n\t\tlet extraEndDuration = this.data.extraEndDuration ?? 0;\n\t\tthis.mediaLooping = false;\n\t\tif (this._animationTimes?.forcedEnd) {\n\t\t\tthis.mediaCurrentTime = this._animationTimes.forcedEnd;\n\t\t\textraEndDuration += (this.mediaDuration - (this._animationTimes?.forcedEnd ?? 0)) * 1000;\n\t\t} else if (this._animationTimes?.loopEnd) {\n\t\t\textraEndDuration += (this.mediaDuration - this.mediaCurrentTime) * 1000;\n\t\t}\n\t\tconst fromEndCustomAnimations = this._getFromEndCustomAnimations(extraEndDuration);\n\t\tconst durations = [\n\t\t\tthis._fadeOut(extraEndDuration),\n\t\t\tthis._fadeOutAudio(extraEndDuration),\n\t\t\tthis._scaleOut(extraEndDuration),\n\t\t\tthis._rotateOut(extraEndDuration),\n\t\t\textraEndDuration,\n\t\t\t...fromEndCustomAnimations.map(\n\t\t\t\t(animation) => animation.duration + animation.delay\n\t\t\t),\n\t\t].filter(Boolean);\n\t\tSequencerAnimationEngine.addAnimation(this.id, fromEndCustomAnimations);\n\t\tconst waitDuration = Math.max(...durations, 0);\n\t\tthis._resolve(waitDuration);\n\t\treturn new Promise((resolve) =>\n\t\t\tsetTimeout(() => {\n\t\t\t\tsuper.endEffect();\n\t\t\t\tresolve(this.data);\n\t\t\t}, waitDuration)\n\t\t);\n\t}\n}\n","import * as lib from \"./lib.js\";\nimport CanvasEffect from \"../canvas-effects/canvas-effect.js\";\nimport CONSTANTS from \"../constants.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\nimport { sequencerSocket, SOCKET_HANDLERS } from \"../sockets.js\";\n\nexport function createShape(shape) {\n  const graphic = new PIXI.LegacyGraphics();\n\n\tgraphic.id = \"sequencer-graphics-\" + foundry.utils.randomID();\n\n\tgraphic.beginFill(\n\t\tshape?.isMask || !lib.is_real_number(shape?.fillColor) ? 0xffffff : shape?.fillColor,\n\t\tshape?.isMask ? 1 : (shape?.fillAlpha ?? 0)\n\t);\n\n  graphic.lineStyle(\n    shape.lineSize ?? (shape?.isMask ? 1 : 0),\n    shape?.lineColor ?? 0xffffff\n  );\n\n  const offsetX =\n    (shape.offset?.x ?? 0) * (shape.offset?.gridUnits ? canvas.grid.size : 1);\n  const offsetY =\n    (shape.offset?.y ?? 0) * (shape.offset?.gridUnits ? canvas.grid.size : 1);\n  const sizeMultiplier = shape.gridUnits ? canvas.grid.size : 1;\n\n  graphic.offset = {\n    x: offsetX,\n    y: offsetY,\n  };\n\n  switch (shape.type) {\n    case CONSTANTS.SHAPES.CIRC:\n      graphic.drawCircle(\n        graphic.offset.x,\n        graphic.offset.y,\n        shape.radius * sizeMultiplier\n      );\n      break;\n    case CONSTANTS.SHAPES.RECT:\n      graphic.drawRect(\n        graphic.offset.x,\n        graphic.offset.y,\n        shape.width * sizeMultiplier,\n        shape.height * sizeMultiplier\n      );\n      break;\n    case CONSTANTS.SHAPES.ELIP:\n      graphic.drawEllipse(\n        graphic.offset.x,\n        graphic.offset.y,\n        shape.width * sizeMultiplier,\n        shape.height * sizeMultiplier\n      );\n      break;\n    case CONSTANTS.SHAPES.RREC:\n      graphic.drawRoundedRect(\n        graphic.offset.x,\n        graphic.offset.y,\n        shape.width * sizeMultiplier,\n        shape.height * sizeMultiplier,\n        shape.radius * sizeMultiplier\n      );\n      break;\n    case CONSTANTS.SHAPES.POLY:\n      graphic.drawPolygon(\n        shape.points.map((point) => {\n          return new PIXI.Point(\n            point[0] * sizeMultiplier,\n            point[1] * sizeMultiplier\n          );\n        })\n      );\n      break;\n  }\n\n  graphic.alpha = shape.alpha ?? 1.0;\n\n  graphic.endFill();\n\n\tif (shape.anchor) {\n\t\tgraphic.pivot.set(\n\t\t\tshape.width * (shape.anchor.x ?? 0.0),\n\t\t\tshape.height * (shape.anchor.y ?? 0.0)\n\t\t)\n\t}\n\n  return graphic;\n}\n\nexport function calculate_missed_position(source, target, twister) {\n  const sourcePosition = get_object_position(source);\n  const sourceDimensions = get_object_dimensions(source, true);\n\n  if (!target) {\n    const angle = twister.random() * Math.PI * 2;\n    let x = Math.cos(angle) * sourceDimensions.width;\n    let y = Math.sin(angle) * sourceDimensions.height;\n\n    return {\n      x: lib.random_float_between(x * 1.5, x * 2.5, twister),\n      y: lib.random_float_between(y * 1.5, y * 2.5, twister),\n    };\n  }\n\n  const targetDimensions = get_object_dimensions(target, true);\n  const targetPosition = get_object_position(target);\n\n  const ray = new Ray(targetPosition, sourcePosition);\n\n  let startRadians = ray.angle + Math.PI / 2;\n  let endRadians = ray.angle - Math.PI / 2;\n\n  const sizeCompensation = Math.max(\n    1,\n    Math.abs(sourceDimensions.width - targetDimensions.height)\n  );\n  let distance = ray.distance / canvas.grid.size - sizeCompensation;\n\n  if (distance <= 1) {\n    const angle =\n      twister.random() > 0.5\n        ? ray.angle + Math.PI / 4\n        : ray.angle - Math.PI / 4;\n    const x = Math.cos(angle) * targetDimensions.width;\n    const y = Math.sin(angle) * targetDimensions.height;\n    return { x, y };\n  }\n\n  distance = Math.max(Math.abs(distance - 15), 6);\n\n  endRadians -= Math.PI / distance;\n  startRadians += Math.PI / distance;\n\n  const angle = lib.interpolate(startRadians, endRadians, twister.random());\n  const x = Math.cos(angle) * targetDimensions.width;\n  const y = Math.sin(angle) * targetDimensions.height;\n\n  return {\n    x: lib.random_float_between(x * 1.5, x * 2.5, twister),\n    y: lib.random_float_between(y * 1.5, y * 2.5, twister),\n  };\n}\n\nexport function get_object_position(\n  obj,\n  { measure = false, exact = false } = {}\n) {\n  if (obj instanceof CanvasEffect) {\n    return obj.worldPosition;\n  }\n\n  obj = obj?._object ?? obj.object ?? obj;\n\n  let pos = {};\n  if (obj instanceof FoundryShim.MeasuredTemplate) {\n    if (measure) {\n      if (obj.document.t === \"cone\" || obj.document.t === \"ray\") {\n        pos.x = obj.ray.B.x;\n        pos.y = obj.ray.B.y;\n      }\n    }\n    if (obj.document.t === \"rect\") {\n      pos.x = obj.x;\n      pos.y = obj.y;\n\n      if (!exact) {\n        pos.x += Math.abs(obj.shape.width / 2) + obj.shape.x;\n        pos.y += Math.abs(obj.shape.height / 2) + obj.shape.y;\n      }\n    }\n  } else if (obj instanceof FoundryShim.Tile) {\n    pos = {\n      x: obj.document.x,\n      y: obj.document.y,\n    };\n\n    if (!exact) {\n      pos.x += Math.abs(obj.document.width / 2);\n      pos.y += Math.abs(obj.document.height / 2);\n    }\n  } else if (obj instanceof FoundryShim.Token) {\n    const halfSize = get_object_dimensions(obj, true);\n    pos = {\n      x: obj.x + halfSize.width,\n      y: obj.y + halfSize.height,\n    };\n\n    if (exact) {\n      pos.x -= halfSize.width;\n      pos.y -= halfSize.height;\n    }\n  } else if (obj instanceof FoundryShim.Drawing) {\n    pos = {\n      x: obj.document.x,\n      y: obj.document.y,\n    };\n\n    if (!exact) {\n      const halfSize = get_object_dimensions(obj, true);\n      pos.x += halfSize.width;\n      pos.y += halfSize.height;\n    }\n  }\n\n  pos = {\n    x:\n      pos.x ??\n      obj?.x ??\n      obj?.position?.x ??\n      obj?.position?._x ??\n      obj?.document?.x ??\n      obj?.document?.position?.x ??\n      null,\n    y:\n      pos.y ??\n      obj?.y ??\n      obj?.position?.y ??\n      obj?.position?._y ??\n      obj?.document?.y ??\n      obj?.document?.position?.y ??\n      null,\n    elevation: obj?.elevation ?? obj?.document?.elevation ?? null,\n  };\n\n  if (pos.x === null) delete pos[\"x\"];\n  if (pos.y === null) delete pos[\"y\"];\n  if (pos.elevation === null) delete pos[\"elevation\"];\n\n  return pos;\n}\n\nexport function get_random_offset(target, randomOffset, twister = false) {\n  let { width, height } = get_object_dimensions(target, true);\n\n  width *= randomOffset;\n  height *= randomOffset;\n\n  return {\n    x: lib.random_float_between(width * -1, width, twister),\n    y: lib.random_float_between(height * -1, height, twister),\n  };\n}\n\nexport function get_object_dimensions(inObj, half = false) {\n  inObj = inObj?.object ?? inObj?._object ?? inObj;\n\n  let width =\n    inObj?.hitArea?.width ??\n    inObj?.w ??\n    inObj?.shape?.width ??\n    (inObj?.shape?.radius ? inObj?.shape?.radius * 2 : undefined) ??\n    inObj?.bounds?.width ??\n    inObj?.width ??\n    canvas.grid.size;\n\n  let height =\n    inObj?.hitArea?.height ??\n    inObj?.h ??\n    inObj?.shape?.height ??\n    (inObj?.shape?.radius ? inObj?.shape?.radius * 2 : undefined) ??\n    inObj?.bounds?.height ??\n    inObj?.height ??\n    canvas.grid.size;\n\n  return {\n    width: width / (half ? 2 : 1),\n    height: height / (half ? 2 : 1),\n  };\n}\n\nexport const alignments = {\n  \"top-left\": { x: 0.5, y: 0.5 },\n  top: { x: 0, y: 0.5 },\n  \"top-right\": { x: -0.5, y: 0.5 },\n  left: { x: 0.5, y: 0 },\n  center: { x: 0, y: 0 },\n  right: { x: -0.5, y: 0 },\n  \"bottom-left\": { x: 0.5, y: -0.5 },\n  bottom: { x: 0, y: -0.5 },\n  \"bottom-right\": { x: -0.5, y: -0.5 },\n};\n\nexport function align({\n  context,\n  spriteWidth,\n  spriteHeight,\n  align,\n  edge,\n} = {}) {\n  let { width, height } = get_object_dimensions(context);\n\n  const alignRatio = alignments[align];\n  const offset = {\n    x: lib.interpolate(width * -0.5, width * 0.5, alignRatio.x + 0.5),\n    y: lib.interpolate(height * -0.5, height * 0.5, alignRatio.y + 0.5),\n  };\n\n  return {\n    x:\n      offset.x +\n      (edge && edge !== \"on\"\n        ? spriteWidth * alignRatio.x * (edge === \"outer\" ? 1 : -1)\n        : 0),\n    y:\n      offset.y +\n      (edge && edge !== \"on\"\n        ? spriteHeight * alignRatio.y * (edge === \"outer\" ? 1 : -1)\n        : 0),\n  };\n}\n\nexport function is_object_canvas_data(inObj) {\n  if (typeof inObj !== \"object\") return false;\n  const keys = Object.keys(inObj);\n  keys.sort();\n  return (\n    (keys.includes(\"x\") && keys.includes(\"y\")) ||\n    (keys.includes(\"height\") &&\n      keys.includes(\"width\") &&\n      keys.includes(\"x\") &&\n      keys.includes(\"y\"))\n  );\n}\n\nexport function get_object_canvas_data(inObject, { measure = false, uuid = true }={}) {\n  inObject = inObject?.object ?? inObject;\n  const data = {\n    ...get_object_position(inObject, { measure }),\n    ...get_object_dimensions(inObject?.mesh ?? inObject?.tile ?? inObject),\n    elevation: get_object_elevation(inObject),\n    cachedLocation: true,\n  };\n\tif(uuid) {\n\t\tdata[\"uuid\"] = inObject?.document?.uuid ?? inObject?.uuid;\n\t}\n\treturn data;\n}\n\nexport function get_object_elevation(inObject) {\n  return inObject?.document?.elevation ?? inObject?.elevation ?? 0;\n}\n\nexport function get_mouse_position(snapToGrid = false) {\n  const pos = lib.getCanvasMouse().getLocalPosition(canvas.app.stage);\n\n\tconst snappingOptions = {\n\t\tmode: CONST.GRID_SNAPPING_MODES.CENTER | CONST.GRID_SNAPPING_MODES.VERTEX | CONST.GRID_SNAPPING_MODES.EDGE_MIDPOINT\n\t};\n\n\treturn !snapToGrid\n\t\t? new PIXI.Point(pos.x, pos.y)\n\t\t: canvas.grid.getSnappedPoint({ x: pos.x, y: pos.y }, snappingOptions)\n}\n\nexport function distance_between(p1, p2) {\n  return new Ray(p1, p2).distance;\n}\n\n\nexport function validateObject(inObject, sceneId) {\n  if (lib.is_UUID(inObject) || !is_object_canvas_data(inObject)) {\n    inObject = lib.get_object_from_scene(inObject, sceneId);\n  }\n  return inObject?._object ?? inObject;\n}\n\nexport function getPositionFromData(data, type=\"source\") {\n\n  const source = data.nameOffsetMap[data[type]]\n    ? data.nameOffsetMap[data[type]][type]\n    : validateObject(data[type], data.sceneId);\n\n  const position =\n    source instanceof FoundryShim.PlaceableObject\n      ? get_object_position(source)\n      : source?.worldPosition || source?.center || source;\n\n  const multiplier = data.randomOffset?.[type] ?? data.randomOffset;\n  const twister = lib.createMersenneTwister(data.seed);\n\n  if (source && multiplier) {\n    let randomOffset = get_random_offset(\n      source,\n      multiplier,\n      twister\n    );\n    position.x -= randomOffset.x;\n    position.y -= randomOffset.y;\n  }\n\n  let extraOffset = data.offset;\n  if (extraOffset) {\n    let newOffset = {\n      x: extraOffset.x,\n      y: extraOffset.y,\n    };\n    if (extraOffset.gridUnits) {\n      newOffset.x *= canvas.grid.size;\n      newOffset.y *= canvas.grid.size;\n    }\n    if (extraOffset.local) {\n      newOffset = rotateAroundPoint(\n        0,\n        0,\n        newOffset.x,\n        newOffset.y,\n        source?.rotation ?? 0\n      );\n    }\n    position.x -= newOffset.x;\n    position.y -= newOffset.y;\n  }\n\n  return position;\n}\n\n/**\n * Determines whether a position is within the bounds of this effect\n *\n * @param inPosition\n * @param inElement\n * @param relativeTo\n * @returns {boolean}\n */\nexport function is_position_within_bounds(inPosition, inElement, relativeTo) {\n  const localPosition = inElement.toLocal(inPosition, relativeTo);\n  return inElement.getLocalBounds().contains(localPosition.x, localPosition.y);\n}\n\nexport function rotate_coordinate(p1, p2, radians) {\n  let cos = Math.cos(radians);\n  let sin = Math.sin(radians);\n  let nx = cos * (p2.x - p1.x) + sin * (p2.y - p1.y) + p1.x;\n  let ny = cos * (p2.y - p1.y) - sin * (p2.x - p1.x) + p1.y;\n  return [nx, ny];\n}\n\n/**\n * Gets the closest token to a certain position\n *\n * @param inPosition\n * @param minimumDistance\n * @returns {*|boolean}\n */\nexport function get_closest_token(\n  inPosition,\n  { minimumDistance = false } = {}\n) {\n  let tokens = Array.from(canvas.scene.tokens);\n  if (minimumDistance) {\n    tokens = tokens.filter(\n      (token) =>\n        distance_between(get_object_position(token), inPosition) <=\n        minimumDistance\n    );\n  }\n  tokens.sort((a, b) => {\n    return (\n      distance_between(get_object_position(a), inPosition) -\n      distance_between(get_object_position(b), inPosition)\n    );\n  });\n  return tokens?.[0] ?? false;\n}\n\nexport function rotateAroundPoint(cx, cy, x, y, radians) {\n  const cos = Math.cos(radians);\n  const sin = Math.sin(radians);\n  const nx = cos * (x - cx) + sin * (y - cy) + cx;\n  const ny = cos * (y - cy) - sin * (x - cx) + cy;\n  return { x: nx, y: ny };\n}\n\nexport function validateAnimation(inTarget, inPropertyName, inOptions) {\n  if (typeof inPropertyName !== \"string\") {\n    return `inPropertyName must be of type string`;\n  }\n  if (typeof inTarget !== \"string\") {\n    return `inTarget must be of type string`;\n  }\n  if (!lib.is_real_number(inOptions.from)) {\n    return `inOptions.from must be of type number`;\n  }\n  if (!lib.is_real_number(inOptions.to)) {\n    return `inOptions.to must be of type number`;\n  }\n  if (!lib.is_real_number(inOptions.duration)) {\n    return `inOptions.duration must be of type number`;\n  }\n  if (inOptions?.delay !== undefined && !lib.is_real_number(inOptions.delay)) {\n    return `inOptions.delay must be of type number`;\n  }\n  if (inOptions?.ease !== undefined && typeof inOptions.ease !== \"string\") {\n    return `inOptions.ease must be of type string`;\n  }\n  if (\n    inOptions?.fromEnd !== undefined &&\n    typeof inOptions.fromEnd !== \"boolean\"\n  ) {\n    return `inOptions.fromEnd must be of type boolean`;\n  }\n\tif (inOptions?.screenSpace !== undefined && typeof inOptions.screenSpace !== \"boolean\") {\n\t\treturn `inOptions.screenSpace must be of type boolean`;\n\t}\n\tif (inOptions?.gridUnits !== undefined) {\n\t  if (typeof inOptions.gridUnits !== \"boolean\") {\n\t    return `inOptions.gridUnits must be of type boolean`;\n    }\n    if (\n      inOptions.gridUnits &&\n      ![\n        \"position.x\",\n        \"position.y\",\n        \"scale.x\",\n        \"scale.y\",\n        \"height\",\n        \"width\",\n      ].includes(inPropertyName)\n    ) {\n      return `if inOptions.gridUnits is true, inPropertyName must be position.x, position.y, scale.x, scale.y, width, or height`;\n    }\n  }\n\tif (\n\t\tinOptions?.absolute !== undefined &&\n\t\ttypeof inOptions.absolute !== \"boolean\"\n\t) {\n\t\treturn `inOptions.absolute must be of type boolean`;\n\t}\n\n  return {\n    target: inTarget,\n    propertyName: inPropertyName,\n    from: inOptions?.from,\n    to: inOptions?.to,\n    duration: inOptions?.duration ?? 0,\n    delay: inOptions?.delay ?? 0,\n    ease: inOptions?.ease ?? \"linear\",\n    looping: false,\n    fromEnd: inOptions?.fromEnd ?? false,\n    gridUnits: inOptions?.gridUnits ?? false,\n    absolute: inOptions?.absolute ?? false,\n\t  screenSpace: inOptions?.screenSpace ?? false,\n  };\n}\n\nexport function validateLoopingAnimation(inTarget, inPropertyName, inOptions) {\n  if (typeof inPropertyName !== \"string\") {\n    return `inPropertyName must be of type string`;\n  }\n  if (typeof inTarget !== \"string\") {\n    return `inTarget must be of type string`;\n  }\n\n  if (!inOptions?.values) {\n    if (!inOptions?.from === undefined || !inOptions?.to === undefined) {\n      return `if inOptions.values is not set, you must provide inOptions.from and inOptions.to`;\n    }\n    if (!lib.is_real_number(inOptions.from)) {\n      return `inOptions.from must be of type number`;\n    }\n    if (!lib.is_real_number(inOptions.to)) {\n      return `inOptions.to must be of type number`;\n    }\n    inOptions.values = [inOptions?.from, inOptions?.to];\n    delete inOptions.from;\n    delete inOptions.to;\n  } else {\n    if (!Array.isArray(inOptions.values)) {\n      return `inOptions.values must be of type array`;\n    }\n    inOptions.values.forEach((value) => {\n      if (!lib.is_real_number(value)) {\n        return `values in inOptions.keys must be of type number`;\n      }\n    });\n  }\n\n  if (!lib.is_real_number(inOptions.duration)) {\n    return `inOptions.duration must be of type number`;\n  }\n\n  if (inOptions?.delay !== undefined && !lib.is_real_number(inOptions.delay)) {\n    return `inOptions.delay must be of type number`;\n  }\n  if (inOptions?.ease !== undefined && typeof inOptions.ease !== \"string\") {\n    return `inOptions.ease must be of type string`;\n  }\n  if (inOptions?.loops !== undefined && !lib.is_real_number(inOptions.loops)) {\n    return `inOptions.loops must be of type number`;\n  }\n  if (\n    inOptions?.pingPong !== undefined &&\n    typeof inOptions.pingPong !== \"boolean\"\n  ) {\n    return `inOptions.pingPong must be of type boolean`;\n  }\n\tif (inOptions?.screenSpace !== undefined && typeof inOptions.screenSpace !== \"boolean\") {\n\t\treturn `inOptions.screenSpace must be of type boolean`;\n\t}\n\tif (inOptions?.gridUnits !== undefined) {\n    if (typeof inOptions.gridUnits !== \"boolean\") {\n      return `inOptions.gridUnits must be of type boolean`;\n    }\n    if (\n      inOptions.gridUnits &&\n      ![\n        \"position.x\",\n        \"position.y\",\n        \"scale.x\",\n        \"scale.y\",\n        \"height\",\n        \"width\",\n      ].includes(inPropertyName)\n    ) {\n      return `if inOptions.gridUnits is true, inPropertyName must be position.x, position.y, scale.x, scale.y, width, or height`;\n    }\n  }\n\n  return {\n    target: inTarget,\n    propertyName: inPropertyName,\n    values: inOptions?.values,\n    duration: inOptions?.duration ?? 0,\n    delay: inOptions?.delay ?? 0,\n    ease: inOptions?.ease ?? \"linear\",\n    looping: true,\n    loops: inOptions?.loops,\n    indefinite:\n      inOptions?.loops === undefined || !lib.is_real_number(inOptions?.loops),\n    pingPong: inOptions?.pingPong ?? false,\n    gridUnits: inOptions?.gridUnits ?? false,\n\t  screenSpace: inOptions?.screenSpace ?? false,\n  };\n}\n","import { writable, get } from \"svelte/store\";\nimport { EffectPlayer } from \"../../modules/sequencer-interaction-manager.js\";\nimport CONSTANTS from \"../../constants.js\";\n\nconst PlayerSettings = {\n  file: {\n    label: \"SEQUENCER.Player.Option.File\",\n    store: writable(\"\"),\n    default: \"\",\n  },\n  scale: {\n    label: \"SEQUENCER.Player.Option.Scale\",\n    store: writable(1.0),\n    default: 1.0,\n  },\n  users: {\n    label: \"SEQUENCER.Player.Option.ForUsers\",\n    store: writable([]),\n    default: [],\n  },\n  belowTokens: {\n    label: \"SEQUENCER.Player.Option.BelowTokens\",\n    store: writable(false),\n    default: false,\n  },\n  snapToGrid: {\n    label: \"SEQUENCER.Player.Option.SnapToGrid\",\n    store: writable(false),\n    default: false,\n  },\n  rotation: {\n    label: \"SEQUENCER.Player.Option.Rotation\",\n    store: writable(0),\n    default: 0,\n  },\n  randomRotation: {\n    label: \"SEQUENCER.Player.Option.Randomize\",\n    store: writable(false),\n    default: false,\n  },\n  fadeIn: {\n    label: \"SEQUENCER.Player.Option.FadeIn\",\n    store: writable(0),\n    default: 0,\n  },\n  fadeOut: {\n    label: \"SEQUENCER.Player.Option.FadeOut\",\n    store: writable(0),\n    default: 0,\n  },\n  scaleIn: {\n    label: \"SEQUENCER.Player.Option.ScaleIn\",\n    store: writable(0),\n    default: 0,\n  },\n  scaleOut: {\n    label: \"SEQUENCER.Player.Option.ScaleOut\",\n    store: writable(0),\n    default: 0,\n  },\n\n  mirrorX: {\n    label: \"SEQUENCER.Player.Option.MirrorX\",\n    store: writable(false),\n    default: false,\n  },\n  mirrorY: {\n    label: \"SEQUENCER.Player.Option.MirrorY\",\n    store: writable(false),\n    default: false,\n  },\n  randomMirrorX: {\n    label: \"SEQUENCER.Player.Option.Randomize\",\n    store: writable(false),\n    default: false,\n  },\n  randomMirrorY: {\n    label: \"SEQUENCER.Player.Option.Randomize\",\n    store: writable(false),\n    default: false,\n  },\n\n  offsetX: {\n    label: \"SEQUENCER.Player.Option.OffsetX\",\n    store: writable(0),\n    default: 0,\n  },\n  offsetY: {\n    label: \"SEQUENCER.Player.Option.OffsetY\",\n    store: writable(0),\n    default: 0,\n  },\n\n  offsetGridUnits: {\n    label: \"SEQUENCER.Player.Option.GridUnits\",\n    store: writable(false),\n    default: false,\n  },\n\n  randomOffsetAmount: {\n    label: \"SEQUENCER.Player.Option.RandomOffset\",\n    store: writable(0),\n    default: 0,\n  },\n\n  randomOffset: {\n    label: \"SEQUENCER.Player.Option.Randomize\",\n    store: writable(false),\n    default: false,\n  },\n\n  preload: {\n    label: \"SEQUENCER.Player.Option.Preload\",\n    store: writable(false),\n    default: false,\n  },\n  moveTowards: {\n    label: \"SEQUENCER.Player.Option.DragBehavior\",\n    label_off: \"SEQUENCER.Player.Option.DragStretch\",\n    label_on: \"SEQUENCER.Player.Option.DragMove\",\n    store: writable(false),\n    default: false,\n  },\n  moveSpeed: {\n    label: \"SEQUENCER.Player.Option.MoveSpeed\",\n    store: writable(0),\n    default: 0,\n  },\n  attachTo: {\n    label: \"SEQUENCER.Player.Option.AttachTo\",\n    store: writable(false),\n    default: false,\n    callback: (e) => {\n      EffectPlayer.sourceAttach = e.target.checked;\n    },\n  },\n  stretchToAttach: {\n    label: \"SEQUENCER.Player.Option.StretchToAttach\",\n    store: writable(false),\n    default: false,\n    callback: (e) => {\n      EffectPlayer.targetAttach = e.target.checked;\n    },\n  },\n  persist: {\n    label: \"SEQUENCER.Player.Option.Persist\",\n    store: writable(false),\n    default: false,\n  },\n  repeat: {\n    label: \"SEQUENCER.Player.Option.Repeat\",\n    store: writable(false),\n    default: false,\n  },\n  repetitions: {\n    label: \"SEQUENCER.Player.Option.Repetitions\",\n    store: writable(1.0),\n    default: 1.0,\n  },\n  repeatDelayMin: {\n    label: \"SEQUENCER.Player.Option.DelayMin\",\n    store: writable(200),\n    default: 200,\n  },\n  repeatDelayMax: {\n    label: \"SEQUENCER.Player.Option.DelayMax\",\n    store: writable(400),\n    default: 400,\n  },\n};\n\nPlayerSettings.export = () => {\n  return Object.fromEntries(\n    Object.entries(PlayerSettings).map((entry) => {\n      return [entry[0], get(entry[1].store)];\n    })\n  );\n};\n\nPlayerSettings.import = (settings) => {\n  Object.entries(PlayerSettings).forEach((entry) => {\n    if (settings?.[entry[0]] !== undefined) {\n      entry[1].store.set(settings?.[entry[0]]);\n    } else if (entry[1]?.default !== undefined) {\n      entry[1].store.set(entry[1].default);\n    }\n  });\n};\n\nPlayerSettings.getPresets = () => {\n  return Object.keys(game.settings.get(CONSTANTS.MODULE_NAME, \"effectPresets\"));\n};\n\nPlayerSettings.loadPreset = (name) => {\n  const effectPresets = game.settings.get(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\"\n  );\n  return PlayerSettings.import(effectPresets[name]);\n};\n\nPlayerSettings.savePreset = async (name) => {\n  const newName = await promptNewPresetName(name);\n  if (!newName) return;\n  const effectPresets = game.settings.get(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\"\n  );\n  effectPresets[newName] = PlayerSettings.export();\n  return game.settings.set(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\",\n    effectPresets\n  );\n};\n\nPlayerSettings.copyPreset = async (name) => {\n  const newName = await promptNewPresetName(name, true);\n  if (!newName) return;\n  const effectPresets = game.settings.get(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\"\n  );\n  effectPresets[newName] = PlayerSettings.export();\n  return game.settings.set(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\",\n    effectPresets\n  );\n};\n\nPlayerSettings.deletePreset = (name) => {\n  const effectPresets = game.settings.get(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\"\n  );\n  delete effectPresets[name];\n  return game.settings.set(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\",\n    effectPresets\n  );\n};\n\nasync function promptNewPresetName(inName, copy = false) {\n  const effectPresets = game.settings.get(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\"\n  );\n\n  let title = copy\n    ? game.i18n.localize(\"SEQUENCER.Player.CopyPresetTitle\")\n    : game.i18n.localize(\"SEQUENCER.Player.CreateNewPresetTitle\");\n\n  let presetName = await new Promise((resolve) => {\n    let rejected = false;\n    new Dialog({\n      title: title,\n      content: `<p><input type=\"text\" placeholder=\"${game.i18n.localize(\n        \"SEQUENCER.Player.CreateNewPresetInputLabel\"\n      )}\" id=\"newPresetName\" style=\"width:100%;\"></p>`,\n      buttons: {\n        okay: {\n          icon: '<i class=\"fas fa-check\"></i>',\n          label: game.i18n.localize(\"SEQUENCER.OK\"),\n          callback: async (html) => {\n            let name = html.find(\"#newPresetName\").val();\n\n            if (name === \"\" || !name) {\n              name = false;\n              rejected = true;\n            }\n\n            resolve(name);\n          },\n        },\n        cancel: {\n          icon: '<i class=\"fas fa-times\"></i>',\n          label: game.i18n.localize(\"SEQUENCER.Cancel\"),\n          callback: () => {\n            rejected = true;\n            resolve(false);\n          },\n        },\n      },\n      close: () => {},\n      render: (html) => {\n        html.find(\"#newPresetName\").val(inName).focus();\n      },\n    }).render(true);\n  });\n\n  if (presetName) {\n    if (presetName.toLowerCase() === \"default\") {\n      Dialog.prompt({\n        title: game.i18n.localize(\"SEQUENCER.Player.DefaultErrorTitle\"),\n        content: `<p>${game.i18n.localize(\n          \"SEQUENCER.Player.DefaultErrorContent\"\n        )}</p>`,\n        label: game.i18n.localize(\"SEQUENCER.OK\"),\n        callback: () => {},\n      });\n      return false;\n    }\n\n    if (effectPresets[presetName]) {\n      const overwrite = await Dialog.confirm({\n        title: game.i18n.localize(\"SEQUENCER.Player.OverwritePresetTitle\"),\n        content: `<p>${game.i18n.format(\n          \"SEQUENCER.Player.OverwritePresetContent\",\n          { preset_name: presetName }\n        )}</p>`,\n      });\n\n      if (!overwrite) {\n        presetName = await promptPresetName(presetName);\n      }\n    }\n  }\n\n  return presetName;\n}\n\nPlayerSettings.migrateOldPresets = () => {\n  if (!game.user.isGM) return;\n\n  const effectPresets = game.settings.get(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\"\n  );\n\n  const presetsToUpdate = Object.values(effectPresets).filter((preset) => {\n    return !preset?.version;\n  });\n\n  if (!presetsToUpdate.length) return;\n\n  const newEffectPresets = Object.fromEntries(\n    Object.entries(effectPresets).map(([name, preset]) => {\n      if (preset?.version) return [name, preset];\n      preset.version = game.modules.get(CONSTANTS.MODULE_NAME).version;\n      if (preset.repetitions > 1) {\n        preset.repeat = true;\n      }\n      if (preset.randomMirrorY) {\n        preset.mirrorY = true;\n      }\n      if (preset.randomOffset) {\n        preset.randomOffsetAmount = 1;\n        preset.offsetGridUnits = true;\n      }\n      return [name, preset];\n    })\n  );\n\n  return game.settings.set(\n    CONSTANTS.MODULE_NAME,\n    \"effectPresets\",\n    newEffectPresets\n  );\n};\n\nexport { PlayerSettings };\n","import * as lib from \"../lib/lib.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport SequencerEffectManager from \"./sequencer-effect-manager.js\";\nimport CONSTANTS from \"../constants.js\";\nimport SequencerFileCache from \"./sequencer-file-cache.js\";\nimport { EffectsUIApp } from \"../formapplications/effects-ui/effects-ui-app.js\";\nimport { get } from \"svelte/store\";\nimport { PlayerSettings } from \"../formapplications/effects-ui/effect-player-store.js\";\n\n/**\n * -------------------------------------------------------------\n * |         THIS IS A MESS, YOU HAVE BEEN WARNED              |\n * -------------------------------------------------------------\n */\n\nexport const InteractionManager = {\n  startDragPosition: false,\n\n  state: {\n    LeftMouseDown: false,\n    RightMouseDown: false,\n    Dragging: false,\n  },\n\n  get isLayerActive() {\n    return canvas.sequencerInterfaceLayer.active;\n  },\n\n  initialize() {\n    window.addEventListener(\"mousedown\", (event) => {\n      if (!canvas.ready) return;\n      if (!this.isLayerActive) return;\n      const hover = document.elementFromPoint(event.clientX, event.clientY);\n      if (!hover || hover.id !== \"board\") return;\n\n      const button = event.button;\n      if (!(button === 0 || button === 2)) return;\n      if (button === 0) {\n        this.state.LeftMouseDown = true;\n        this._propagateEvent(\"mouseLeftDown\");\n      }\n      if (button === 2) {\n        this.state.RightMouseDown = true;\n        this._propagateEvent(\"mouseRightDown\");\n      }\n    });\n\n    window.addEventListener(\"mouseup\", (event) => {\n      if (!canvas.ready) return;\n      if (!this.isLayerActive) return;\n      const hover = document.elementFromPoint(event.clientX, event.clientY);\n      if (!hover || hover.id !== \"board\") return;\n      if (document.activeElement.tagName !== \"BODY\") return;\n\n      const button = event.button;\n      if (!(button === 0 || button === 2)) return;\n      if (button === 0) {\n        this.state.LeftMouseDown = false;\n        this._propagateEvent(\"mouseLeftUp\");\n        this.state.Dragging = false;\n        this.startDragPosition = false;\n      }\n      if (button === 2) {\n        this.state.RightMouseDown = false;\n        this._propagateEvent(\"mouseRightUp\");\n        this.state.Dragging = false;\n        this.startDragPosition = false;\n      }\n    });\n\n    window.addEventListener(\"mousemove\", (event) => {\n      if (!canvas.ready) return;\n      if (!this.isLayerActive) return;\n      const hover = document.elementFromPoint(event.clientX, event.clientY);\n      if (!hover || hover.id !== \"board\") return;\n      this._propagateEvent(\"mouseMove\");\n      if (this.state.LeftMouseDown && !this.startDragPosition) {\n        this.startDragPosition = canvaslib.get_mouse_position();\n      }\n      if (this.state.LeftMouseDown && !this.state.Dragging) {\n        const distance = canvaslib.distance_between(\n          this.startDragPosition,\n          canvaslib.get_mouse_position()\n        );\n        this.state.Dragging = distance > 20;\n      }\n    });\n\n    EffectPlayer.initialize();\n    SelectionManager.initialize();\n  },\n\n  tearDown() {\n    EffectPlayer.tearDown();\n    SelectionManager.tearDown();\n  },\n\n  _propagateEvent(eventName) {\n    if (EffectPlayer.isActive && EffectPlayer[eventName]) {\n      EffectPlayer[eventName]();\n    }\n    if (SelectionManager.isActive && SelectionManager[eventName]) {\n      SelectionManager[eventName]();\n    }\n  },\n};\n\nexport const EffectPlayer = {\n  sequenceBuffer: [],\n\n  playMany: false,\n  playManySequenced: false,\n\n  cursorPos: false,\n  startPos: false,\n  endPos: false,\n\n  get snapLocationToGrid() {\n    return get(PlayerSettings.snapToGrid.store);\n  },\n\n  get sourceAttach() {\n    return get(PlayerSettings.attachTo.store);\n  },\n\n  get targetAttach() {\n    return get(PlayerSettings.stretchToAttach.store);\n  },\n\n  sourceAttachFound: false,\n  targetAttachFound: false,\n\n  get isActive() {\n    return (\n      InteractionManager.isLayerActive && game?.activeTool === CONSTANTS.TOOLS.PLAY\n    );\n  },\n\n  /**\n   * Opens the Sequencer Effects UI with the player tab open\n   */\n  show() {\n    return EffectsUIApp.show({ tab: \"player\" });\n  },\n\n  initialize() {\n    this.layer = canvas.sequencerInterfaceLayer;\n  },\n\n  tearDown() {\n    this._reset();\n  },\n\n  /**\n   * Mouse events\n   */\n  mouseLeftDown() {\n    this._evaluateStartPosition();\n  },\n\n  mouseLeftUp() {\n    if (!this.startPos) return;\n    this._playEffect();\n    this.startPos = false;\n    this.endPos = false;\n    this.sourceAttachFound = false;\n    this.targetAttachFound = false;\n  },\n\n  mouseRightUp() {\n    this._reset();\n  },\n\n  mouseMove() {\n    this._evaluateCursorPosition();\n\n    if (InteractionManager.state.Dragging) {\n      this._evaluateEndPosition();\n    }\n  },\n\n  /**\n   * Hotkeys\n   */\n  playManyUp() {\n    this._playEffects();\n    this._reset();\n  },\n\n  /**\n   * Private methods\n   */\n  _evaluatePosition(attach = false) {\n    let position = canvaslib.get_mouse_position(this.snapLocationToGrid);\n\n    const attachToObject = attach\n      ? canvaslib.get_closest_token(position, {\n          minimumDistance: canvas.grid.size,\n        })\n      : false;\n\n    let attachFound = false;\n    if (attachToObject) {\n      attachFound = true;\n      position = canvaslib.get_object_position(attachToObject);\n    }\n\n    return [position, attachFound];\n  },\n\n  _evaluateCursorPosition() {\n    const attach = InteractionManager.state.Dragging\n      ? this.targetAttach\n      : this.sourceAttach;\n\n    [this.cursorPos] = this._evaluatePosition(attach);\n  },\n\n  _evaluateStartPosition() {\n    if (this.startPos) return;\n\n    [this.startPos, this.sourceAttachFound] = this._evaluatePosition(\n      this.sourceAttach\n    );\n  },\n\n  _evaluateEndPosition() {\n    [this.endPos, this.targetAttachFound] = this._evaluatePosition(\n      this.targetAttach\n    );\n  },\n\n  _reset() {\n    if (!this.layer) return;\n    this.startPos = false;\n    this.endPos = false;\n    this.sourceAttachFound = false;\n    this.targetAttachFound = false;\n    this.sequenceBuffer = [];\n    this._evaluateCursorPosition();\n  },\n\n  async _playEffect() {\n    const settings = foundry.utils.mergeObject(PlayerSettings.export(), {\n      ...InteractionManager.state,\n      startPos: this.startPos,\n      endPos: this.endPos,\n    });\n\n    if (!settings.users.length || settings.users?.[0] === \"all\")\n      settings.users = [];\n\n    if (settings.file === \"\") return;\n\n    if (\n      !(\n        Sequencer.Database.entryExists(settings.file) ||\n        (await SequencerFileCache.srcExists(settings.file))\n      )\n    ) {\n      throw lib.custom_error(\n        \"Sequencer\",\n        `Sequencer Player | Could not find file or database entry: ${settings.file}`\n      );\n    }\n\n    if (settings.preload) {\n      await Sequencer.Preloader.preloadForClients(settings.file);\n    }\n\n    const sequence =\n      this.sequenceBuffer.length > 0 && this.playManySequenced\n        ? this.sequenceBuffer[this.sequenceBuffer.length - 1]\n        : new Sequence();\n\n    const effect = sequence\n      .effect()\n      .file(settings.file)\n      .forUsers(settings.users)\n      .mirrorX(settings.mirrorX && !settings.randomMirrorX)\n      .mirrorY(settings.mirrorY && !settings.randomMirrorY)\n      .randomizeMirrorX(settings.randomMirrorX)\n      .randomizeMirrorY(settings.randomMirrorY)\n      .persist(settings.persist)\n      .belowTokens(settings.belowTokens);\n\n    if (settings.repeat) {\n      effect.repeats(\n        settings.repetitions,\n        settings.repeatDelayMin,\n        settings.repeatDelayMax\n      );\n    }\n\n    if (settings.fadeIn > 0) effect.fadeIn(settings.fadeIn);\n    if (settings.fadeOut > 0) effect.fadeOut(settings.fadeOut);\n\n    const offsetData = settings.randomOffset\n      ? {\n          offset: { x: settings.offsetX, y: settings.offsetY },\n          gridUnits: settings.offsetGridUnits,\n        }\n      : {};\n    const offsetSource = !settings.Dragging ? offsetData : {};\n    const attachToObject = settings.attachTo\n      ? canvaslib.get_closest_token(settings.startPos, {\n          minimumDistance: canvas.grid.size,\n        })\n      : false;\n    if (attachToObject) {\n      effect.attachTo(attachToObject, {\n        randomOffset:\n          settings.randomOffset && !settings.Dragging\n            ? settings.randomOffsetAmount\n            : false,\n        ...offsetSource,\n      });\n    } else {\n      effect.atLocation(settings.startPos, {\n        randomOffset:\n          settings.randomOffset && !settings.Dragging\n            ? settings.randomOffsetAmount\n            : false,\n        ...offsetSource,\n      });\n    }\n\n    if (\n      settings.persist &&\n      settings.name &&\n      settings.name !== \"\" &&\n      settings.name !== \"default\" &&\n      settings.name !== \"new\"\n    ) {\n      effect.name(\"Preset: \" + settings.name);\n    }\n\n    if (settings.Dragging) {\n      if (settings.moveTowards) {\n        effect.moveTowards(settings.endPos, {\n          randomOffset: settings.randomOffset\n            ? settings.randomOffsetAmount\n            : false,\n          ...offsetData,\n        });\n        if (settings.moveSpeed) {\n          effect.moveSpeed(settings.moveSpeed);\n        }\n      } else {\n        let target = settings.stretchToAttach\n          ? canvaslib.get_closest_token(settings.endPos, {\n              minimumDistance: canvas.grid.size,\n            })\n          : settings.endPos;\n        effect.stretchTo(target, {\n          attachTo: settings.stretchToAttach,\n          randomOffset: settings.randomOffset\n            ? settings.randomOffsetAmount\n            : false,\n          ...offsetData,\n        });\n      }\n    }\n\n    if (!settings.Dragging || (settings.Dragging && settings.moveTowards)) {\n      effect.scale(settings.scale);\n      if (settings.scaleIn > 0)\n        effect.scaleIn(0, settings.scaleIn, { ease: \"easeInOutSine\" });\n      if (settings.scaleOut > 0)\n        effect.scaleOut(0, settings.scaleOut, { ease: \"easeInOutSine\" });\n      effect.randomRotation(settings.randomRotation);\n    }\n\n    if (this.playManySequenced) {\n      effect.waitUntilFinished();\n    }\n\n    if (!this.playManySequenced || this.sequenceBuffer.length === 0) {\n      this.sequenceBuffer.push(sequence);\n    }\n\n    if (!this.playMany && !this.playManySequenced) this._playEffects();\n  },\n\n  _playEffects() {\n    this.sequenceBuffer.forEach((sequence) => sequence.play());\n    this.sequenceBuffer = [];\n  },\n};\n\nexport const SelectionManager = {\n  selectedEffect: false,\n  hoveredEffects: new Set(),\n  suggestedProperties: false,\n  sourceOrTarget: false,\n  dragOffset: false,\n  hoveredEffectUI: false,\n\n  get snapToGrid() {\n    return get(PlayerSettings.snapToGrid.store);\n  },\n\n  set snapToGrid(bool) {\n    PlayerSettings.snapToGrid.store.set(bool);\n  },\n\n  set attachToTarget(bool) {\n    PlayerSettings.stretchToAttach.store.set(bool);\n  },\n\n  get attachToTarget() {\n    return get(PlayerSettings.stretchToAttach.store);\n  },\n\n  get isActive() {\n    return (\n      InteractionManager.isLayerActive && game?.activeTool === CONSTANTS.TOOLS.SELECT\n    );\n  },\n\n  get effects() {\n    return SequencerEffectManager.effects.filter(\n      (effect) => effect.userCanDelete\n    );\n  },\n\n  initialize() {\n    this.layer = canvas.sequencerInterfaceLayer;\n  },\n\n  tearDown() {\n    this._reset();\n    this.hoveredEffects = new Set();\n  },\n\n  sourcePointSelected() {\n    this.sourceOrTarget = \"source\";\n  },\n\n  targetPointSelected() {\n    this.sourceOrTarget = \"target\";\n  },\n\n  /**\n   * Mouse Events\n   */\n  mouseLeftDown() {\n    if (!this.selectedEffect) {\n      return this._selectEffects();\n    }\n    if (!this.hoveredEffects.size) {\n      this._reset();\n    }\n  },\n\n  mouseRightDown() {},\n\n  mouseLeftUp() {\n    if (!InteractionManager.state.Dragging) {\n      return this._selectEffects();\n    }\n    if (\n      !InteractionManager.state.Dragging ||\n      !this.selectedEffect ||\n      !this.suggestedProperties\n    )\n      return;\n    this._updateEffect();\n  },\n\n  mouseRightUp() {\n    InteractionManager.state.LeftMouseDown = false;\n    this.suggestedProperties = false;\n    this.sourceOrTarget = false;\n    this.dragOffset = false;\n  },\n\n  mouseMove() {\n    this._evaluateHoveredEffects();\n    if (\n      InteractionManager.state.LeftMouseDown &&\n      !InteractionManager.state.RightMouseDown\n    ) {\n      this._evaluateEffectPositionUpdate();\n    }\n  },\n\n  /**\n   * Hotkeys\n   */\n  async delete() {\n    if (!this.selectedEffect) return;\n    await SequencerEffectManager.endEffects({ effects: this.selectedEffect });\n    this.selectedEffect = false;\n  },\n\n  attachToTargetDown() {\n    if (\n      InteractionManager.state.LeftMouseDown &&\n      !InteractionManager.state.RightMouseDown\n    ) {\n      this._evaluateEffectPositionUpdate();\n    }\n  },\n\n  /**\n   * Private methods\n   */\n  _selectEffects() {\n    this._reset();\n    if (!this.hoveredEffects.size) return;\n    const firstElement = Array.from(this.hoveredEffects)[0];\n    this.selectedEffect = !firstElement.selected ? firstElement : false;\n  },\n\n  _evaluateHoveredEffects() {\n    const position = canvaslib.get_mouse_position();\n    this.hoveredEffects = this.effects.filter((effect) =>\n      effect.isPositionWithinBounds(position)\n    );\n    this.hoveredEffects.sort((a, b) => {\n      return a.data.layer !== b.data.zIndex\n        ? a.data.zIndex - b.data.zIndex\n        : a.data.layer - b.data.zIndex;\n    });\n    this.hoveredEffects = new Set(this.hoveredEffects);\n  },\n\n  _evaluateEffectPositionUpdate() {\n    if (!this.selectedEffect) return;\n\n    if (this.selectedEffect.data.stretchTo && !this.sourceOrTarget) {\n      return;\n    }\n\n    let showCursor = false;\n    let showPoint = this.snapToGrid;\n\n    let position = canvaslib.get_mouse_position(this.snapToGrid);\n\n    if (!this.selectedEffect.data.stretchTo && !this.dragOffset) {\n      this.dragOffset = {\n        x: position.x - this.selectedEffect.position.x,\n        y: position.y - this.selectedEffect.position.y,\n      };\n    }\n\n    if (this.attachToTarget) {\n      const obj = canvaslib.get_closest_token(position, {\n        minimumDistance: canvas.grid.size,\n      });\n      if (obj) {\n        position = canvaslib.get_object_position(obj);\n        showCursor = true;\n        showPoint = false;\n      }\n    }\n\n    if (this.dragOffset && !showCursor && !this.snapToGrid) {\n      position.x -= this.dragOffset.x;\n      position.y -= this.dragOffset.y;\n    }\n\n    const color =\n      (this.sourceOrTarget || \"source\") === \"source\"\n        ? CONSTANTS.COLOR.PRIMARY\n        : CONSTANTS.COLOR.SECONDARY;\n\n    this.suggestedProperties = {\n      position,\n      showCursor,\n      showPoint,\n      color,\n    };\n  },\n\n  _updateEffect() {\n    if (!this.selectedEffect) return;\n\n    const updates = {\n      attachTo: this.selectedEffect.data.attachTo,\n      stretchTo: this.selectedEffect.data.stretchTo,\n    };\n\n    const obj = this.attachToTarget\n      ? canvaslib.get_closest_token(this.suggestedProperties.position, {\n          minimumDistance: canvas.grid.size,\n          type: TokenDocument,\n        })\n      : false;\n    let objUuid = obj ? lib.get_object_identifier(obj) : false;\n\n    if (this.sourceOrTarget === \"source\") {\n      if (!updates.attachTo) {\n        updates.attachTo = {\n          active: false,\n          align: \"center\",\n          rotation: true,\n          bindVisibility: true,\n          bindAlpha: true,\n        };\n      }\n      updates.attachTo = foundry.utils.mergeObject(updates.attachTo || {}, {\n        active: this.attachToTarget && !!objUuid,\n      });\n      if (this.attachToTarget && objUuid) {\n        updates.source = objUuid;\n      } else {\n        updates[\"source\"] = this.suggestedProperties.position;\n      }\n    } else if (this.sourceOrTarget === \"target\") {\n      updates.stretchTo.attachTo = this.attachToTarget && !!objUuid;\n      if (this.attachToTarget && objUuid) {\n        updates.target = objUuid;\n      } else {\n        updates[\"target\"] = this.suggestedProperties.position;\n      }\n    } else {\n      updates[\"source\"] = this.suggestedProperties.position;\n    }\n\n    this.selectedEffect.update(updates);\n\n    this.suggestedProperties = false;\n    this.sourceOrTarget = false;\n    this.dragOffset = false;\n  },\n\n  _reset() {\n    this.selectedEffect = false;\n    this.suggestedProperties = false;\n    this.sourceOrTarget = false;\n    this.dragOffset = false;\n  },\n};\n","<script>\r\n\r\n  import { localize } from '#runtime/util/i18n';\r\n  import { SelectionManager } from \"../../../modules/sequencer-interaction-manager.js\";\r\n  import SequencerEffectManager from \"../../../modules/sequencer-effect-manager.js\";\r\n\r\n  export let effect;\r\n\r\n  function getEffectName(effect) {\r\n\r\n    let effectName = \"\";\r\n    if (effect.data.file && typeof effect.data.file === \"string\") {\r\n\t    effectName = effect.data.file.split('\\\\').pop().split('/').pop();\r\n    } else if (effect.data.file && typeof effect.data.file === \"object\") {\r\n      effectName = Object.values(effect.data.file)[0].split('\\\\').pop().split('/').pop();\r\n    } else if (effect.data.text) {\r\n      effectName = \"Text: \" + effect.data.text.text;\r\n    } else {\r\n      effectName =  effect.data?.shapes?.[0]?.type ? \"Shape: \" + effect.data.shapes[0]?.type : \"Unknown effect\"\r\n    }\r\n\r\n    effectName = effect.data.name ? `${effect.data.name} (${effectName})` : effectName;\r\n\r\n    if (effect.data.creatorUserId !== game.userId) {\r\n      let user_name = game.users.get(effect.data.creatorUserId)?.name;\r\n      let formattedUsername = (user_name\r\n        ? localize(\"SEQUENCER.ManagerPlayersEffect\", { user_name })\r\n        : localize(\"SEQUENCER.ManagerUnknownEffect\"));\r\n      effectName += ` (${formattedUsername})`;\r\n    }\r\n\r\n    return effectName;\r\n\r\n  }\r\n\r\n  function mouseOver() {\r\n    SelectionManager.hoveredEffectUI = effect;\r\n  }\r\n\r\n  function mouseLeave() {\r\n    SelectionManager.hoveredEffectUI = false;\r\n  }\r\n\r\n  function endEffect(){\r\n    SequencerEffectManager.endEffects({ effects: [effect] });\r\n\t}\r\n\r\n</script>\r\n\r\n\r\n<div class=\"effect hover-highlight\" on:mouseleave={mouseLeave} on:mouseover={mouseOver}>\r\n\t<button class=\"btn_end\" type=\"button\" on:click={endEffect}>\r\n\t\t<i class=\"fas fa-times\"></i>\r\n\t</button>\r\n\t<div class=\"effect-text hover-text\">\r\n\t\t{getEffectName(effect)}\r\n\t</div>\r\n</div>\r\n\r\n\r\n<style lang=\"scss\">\r\n\r\n  .effect {\r\n    display: flex;\r\n    flex: 1 0 auto;\r\n  }\r\n\r\n  .effect > button {\r\n    flex: 0;\r\n    font-size: 0.7rem;\r\n    height: 1.25rem;\r\n    line-height: normal;\r\n    margin-right: 5px;\r\n  }\r\n\r\n  .btn_end {\r\n    min-width: 1.5rem;\r\n  }\r\n\r\n  .effect > div {\r\n    flex: 1;\r\n    line-height: 1.25rem;\r\n  }\r\n\r\n  .hover-highlight:hover > .hover-text {\r\n    color: #000;\r\n    text-shadow: 0 0 10px red;\r\n  }\r\n\r\n</style>\r\n","<script>\r\n\r\n\timport SequencerSoundManager from \"../../../modules/sequencer-sound-manager.js\";\r\n\r\n\texport let id;\r\n\texport let sound;\r\n\r\n\tfunction endSound() {\r\n\t\tSequencerSoundManager.endSounds({ sounds: [id] }, true);\r\n\t}\r\n\r\n</script>\r\n\r\n\r\n<div class=\"effect hover-highlight\">\r\n\t<button class=\"btn_end\" on:click={endSound} type=\"button\">\r\n\t\t<i class=\"fas fa-times\"></i>\r\n\t</button>\r\n\t<div class=\"effect-text hover-text\">\r\n\t\t{sound.src.split(\"/\").slice(-1)}\r\n\t</div>\r\n</div>\r\n\r\n\r\n<style lang=\"scss\">\r\n\r\n  .effect {\r\n    display: flex;\r\n    flex: 1 0 auto;\r\n  }\r\n\r\n  .effect > button {\r\n    flex: 0;\r\n    font-size: 0.7rem;\r\n    height: 1.25rem;\r\n    line-height: normal;\r\n    margin-right: 5px;\r\n  }\r\n\r\n  .btn_end {\r\n    min-width: 1.5rem;\r\n  }\r\n\r\n  .effect > div {\r\n    flex: 1;\r\n    line-height: 1.25rem;\r\n  }\r\n\r\n  .hover-highlight:hover > .hover-text {\r\n    color: #000;\r\n    text-shadow: 0 0 10px red;\r\n  }\r\n\r\n</style>\r\n","<script>\r\n  import { localize } from '#runtime/util/i18n';\r\n  import SequenceManager from \"../../modules/sequence-manager.js\";\r\n  import EffectEntry from \"./components/EffectEntry.svelte\";\r\n  import SoundEntry from \"./components/SoundEntry.svelte\";\r\n  import SequencerSoundManager from \"../../modules/sequencer-sound-manager.js\";\r\n\r\n  const VisibleEffects = SequenceManager.VisibleEffects;\r\n  const RunningSounds = SequenceManager.RunningSounds;\r\n\r\n  $: effects = Object.values($VisibleEffects);\r\n  $: sounds = Object.entries($RunningSounds).filter(e => e[1].sound_playing);\r\n  $: persistentEffects = effects.filter(effect => effect.data.persist);\r\n  $: temporaryEffects = effects.filter(effect => !effect.data.persist);\r\n\r\n  function endAllEffects() {\r\n    Sequencer.EffectManager.endEffects({\r\n      effects: effects.filter(effect => effect.userCanDelete && !effect.data.private)\r\n\t\t});\r\n  }\r\n\r\n  function endAllSounds() {\r\n    SequencerSoundManager.endSounds({\r\n      sounds: Object.entries($RunningSounds)\r\n        .filter(e => e[1].sound_playing)\r\n        .map(e => e[0])\r\n\t\t});\r\n  }\r\n\r\n</script>\r\n\r\n<div class=\"effects-container\">\r\n\r\n  {#if !effects.length && !sounds.length}\r\n\r\n    <div class=\"no-effects\">\r\n      <h2>{localize(\"SEQUENCER.Manager.NothingPlaying\")}</h2>\r\n    </div>\r\n\r\n  {/if}\r\n\r\n  {#if effects.length}\r\n    <button class=\"w-100 end-all-effects mb-2\" on:click={endAllEffects} type=\"button\">\r\n      {localize(\"SEQUENCER.Manager.EndAllEffects\")}\r\n    </button>\r\n\r\n    <div class=\"effects\">\r\n\r\n      {#if persistentEffects.length}\r\n        <h2>{localize(\"SEQUENCER.Manager.PersistentEffects\")}</h2>\r\n        <div>\r\n          {#each persistentEffects as effect (effect.id)}\r\n            <EffectEntry {effect} />\r\n          {/each}\r\n        </div>\r\n      {/if}\r\n\r\n      {#if temporaryEffects.length && persistentEffects.length}\r\n        <hr />\r\n      {/if}\r\n\r\n      {#if temporaryEffects.length}\r\n        <h2>{localize(\"SEQUENCER.Manager.TemporaryEffects\")}</h2>\r\n        <div>\r\n          {#each temporaryEffects as effect (effect.id)}\r\n            <EffectEntry {effect} />\r\n          {/each}\r\n        </div>\r\n      {/if}\r\n\r\n    </div>\r\n\r\n  {/if}\r\n\r\n  {#if sounds.length}\r\n    <button class=\"w-100 end-all-effects mb-2\" on:click={endAllSounds} type=\"button\">\r\n      {localize(\"SEQUENCER.Manager.EndAllSounds\")}\r\n    </button>\r\n\r\n    <div>\r\n\r\n      <h2>{localize(\"SEQUENCER.Manager.Sounds\")}</h2>\r\n\r\n      <div>\r\n        {#each sounds as [id, sound] (id)}\r\n          <SoundEntry {id} {sound}/>\r\n        {/each}\r\n      </div>\r\n    </div>\r\n\r\n  {/if}\r\n\r\n</div>\r\n\r\n<style lang=\"scss\">\r\n\r\n  .end-all-effects{\r\n    margin-bottom: 0.5rem;\r\n  }\r\n\r\n  .effects-container {\r\n    min-width: 320px;\r\n    min-height: 563px;\r\n    max-width: 320px;\r\n    max-height: 563px;\r\n    display: flex;\r\n    flex-direction: column;\r\n  }\r\n\r\n  .effects {\r\n    flex: 1;\r\n    margin-top: 0.5rem;\r\n  }\r\n\r\n  .running-sequences {\r\n    flex: 1;\r\n    margin-top: 0.5rem;\r\n  }\r\n\r\n</style>\r\n","<script>\r\n\r\n  import { localize } from '#runtime/util/i18n';\r\n  import { writable } from \"svelte/store\";\r\n  import { applyStyles } from '#runtime/svelte/action/dom/style';\r\n\r\n  export let setting;\r\n  export let lock = false;\r\n  export let min = 0.1;\r\n  export let max = 2;\r\n  export let maxInput = Infinity;\r\n  export let step = 0.01;\r\n  export let styles = {};\r\n\r\n  const store = setting.store;\r\n  const isLocked = lock ? lock.store : writable(false);\r\n\r\n</script>\r\n\r\n<div style=\"display: flex; align-items: center;\" use:applyStyles={styles}>\r\n\t<label>{localize(setting.label)}</label>\r\n\t<input bind:value=\"{$store}\" disabled={$isLocked} {max} {min} {step} type=\"range\"/>\r\n\t<input bind:value=\"{$store}\" disabled={$isLocked} max={maxInput} {min} required {step} type=\"number\"/>\r\n</div>\r\n\r\n<style lang=\"scss\">\r\n\r\n\tlabel {\r\n\t\tflex: 1 0 auto;\r\n\t\tmargin-right: 0.25rem;\r\n\t}\r\n\r\n\tinput[type=\"range\"] {\r\n    flex: 1 0 50%;\r\n    margin-right: 0.25rem;\r\n\t}\r\n\r\n\tinput[type=\"number\"] {\r\n    flex: 1 0 15%;\r\n\t}\r\n\r\n</style>\r\n","<script>\r\n  import { localize } from '#runtime/util/i18n';\r\n  import { applyStyles } from '#runtime/svelte/action/dom/style';\r\n  import { writable } from \"svelte/store\";\r\n\r\n  export let setting;\r\n  export let label = false;\r\n  export let lock = false;\r\n  export let inverse = false\r\n  export let styles = {};\r\n\r\n\tconst id = \"sequencer-input-\" + foundry.utils.randomID();\r\n  const store = setting.store;\r\n  const isLocked = lock ? lock.store : writable(inverse);\r\n\r\n  $: {\r\n    if($isLocked !== inverse){\r\n      $store = false;\r\n\t\t}\r\n  }\r\n\r\n</script>\r\n\r\n<div style=\"display: flex; align-items: center;\" use:applyStyles={styles}>\r\n\t<input id={id} disabled={$isLocked !== inverse} style=\"height:15px;\" type=\"checkbox\" bind:checked={$store}/>\r\n\t<label for={id}>{localize(setting.label)}</label>\r\n</div>\r\n","<script>\r\n\timport { localize } from '#runtime/util/i18n';\r\n  import { applyStyles } from '#runtime/svelte/action/dom/style';\r\n  import { writable } from \"svelte/store\";\r\n\r\n  export let setting;\r\n  export let lock = false;\r\n  export let inverse = false;\r\n  export let styles = {};\r\n\r\n  const id = \"sequencer-input-\" + foundry.utils.randomID();\r\n  const store = setting.store;\r\n  const isLocked = lock ? lock.store : writable(inverse);\r\n</script>\r\n\r\n<div style=\"display: flex; align-items: center;\" use:applyStyles={styles}>\r\n\t{#if localize(setting.label)}\r\n\t\t<label for={id}>{localize(setting.label)}</label>\r\n\t{/if}\r\n\t<input id={id} type=\"number\" disabled={$isLocked !== inverse} bind:value={$store} on:change={() => { if($store === null) $store = 0; }}/>\r\n</div>\r\n\r\n\r\n<style lang=\"scss\">\r\n\tlabel {\r\n    text-align: right;\r\n    flex: 1 0 auto;\r\n\t\tpadding-right: 0.25rem;\r\n\t}\r\n\r\n\tinput {\r\n\t\twidth: 100%;\r\n\t\tflex: 1 0 40%;\r\n\t}\r\n</style>\r\n","<script>\r\n\r\n  import { localize } from '#runtime/util/i18n';\r\n  import { applyStyles } from '#runtime/svelte/action/dom/style';\r\n\r\n\texport let setting;\r\n  export let styles = {};\r\n\r\n  const store = setting.store;\r\n\r\n  const width = 5.75;\r\n\r\n  $: finalStyles = {\r\n    ...styles,\r\n\t\t\"--switch-width\": `${width}em`,\r\n\t\t\"--half-switch-width\": `${width-1.5}em`,\r\n\t\t\"--half-switch-width-on\": `${width-1.7}em`,\r\n\t}\r\n\r\n</script>\r\n\r\n<div style=\"display: flex; align-items: center;\" use:applyStyles={finalStyles}>\r\n\r\n\t<div class=\"first\" class:active={!$store} on:click={() => { $store = false; }}>\r\n\t\t<span>{localize(setting.label_off)}</span>\r\n\t</div>\r\n\t<div class=\"second\" class:active={$store} on:click={() => { $store = true; }}>\r\n\t\t<span>{localize(setting.label_on)}</span>\r\n\t</div>\r\n\r\n</div>\r\n\r\n\r\n<style lang=\"scss\">\r\n\r\n\tdiv > div {\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\tpadding: 2px 5px;\r\n\t\tborder: 1px solid #919191;\r\n\t\tcursor:pointer;\r\n\t}\r\n\r\n\t.first {\r\n\t\tborder-bottom-left-radius: 5px;\r\n\t\tborder-top-left-radius: 5px;\r\n\t\tbackground: #ccc;\r\n    border-right: 0;\r\n\t}\r\n\r\n\t.second {\r\n\t\tborder-bottom-right-radius: 5px;\r\n\t\tborder-top-right-radius: 5px;\r\n\t\tbackground: #ccc;\r\n\t}\r\n\r\n\t.active {\r\n    background: #eaeaea;\r\n\t}\r\n\r\n</style>\r\n","<script>\r\n  import { localize } from '#runtime/util/i18n';\r\n  import { PlayerSettings } from \"./effect-player-store.js\";\r\n  import { get } from \"svelte/store\";\r\n  import SequencerDatabase from \"../../modules/sequencer-database.js\";\r\n  import SliderInput from \"./components/SliderInput.svelte\";\r\n  import Checkbox from \"./components/Checkbox.svelte\";\r\n  import NumberInput from \"./components/NumberInput.svelte\";\r\n  import SwitchToggle from \"./components/SwitchToggle.svelte\";\r\n  import CONSTANTS from \"../../constants.js\";\r\n\r\n  const fileStore = PlayerSettings.file.store;\r\n  const users = game.users.filter(user => user.active);\r\n  const userStore = PlayerSettings.users.store;\r\n\r\n  let lastInput = \"\";\r\n  let lastResults = [];\r\n  let suggestions = [];\r\n  const searchDebounce = foundry.utils.debounce(() => {\r\n    const fileInput = get(fileStore).toLowerCase();\r\n    if(!fileInput){\r\n      suggestions = SequencerDatabase.publicModules;\r\n      return;\r\n\t\t}\r\n    if (lastInput === fileInput) return;\r\n    let results = SequencerDatabase.searchFor(fileInput);\r\n    if (lastResults.equals(results)) return;\r\n    lastResults = foundry.utils.duplicate(results);\r\n    if (results.length === 1 && results[0].startsWith(fileInput)) return;\r\n    if (results.length > 100) {\r\n      results = results.slice(0, 100);\r\n    }\r\n    suggestions = foundry.utils.duplicate(results);\r\n  }, 200);\r\n\r\n  $: searchDebounce($fileStore);\r\n\r\n  async function activateLayer(){\r\n\t\tif(CONSTANTS.IS_V13){\r\n\t\t\tui.controls.activate({ control: \"sequencer\", tool: CONSTANTS.TOOLS.PLAY });\r\n\t\t}else{\r\n\t\t\tui.controls.initialize({ layer: \"sequencer\", tool: CONSTANTS.TOOLS.PLAY });\r\n\t\t}\r\n\t  canvas.sequencerInterfaceLayer.activate({ tool: CONSTANTS.TOOLS.PLAY });\r\n  }\r\n\r\n  let filePicker = false;\r\n\r\n  function handleClick() {\r\n    if (!filePicker) {\r\n      const file = get(fileStore);\r\n      const current = SequencerDatabase.getEntry(file, { softFail: true })\r\n        ? file\r\n        : \"\";\r\n      filePicker = new FilePicker({\r\n        type: \"imageVideo\",\r\n        current,\r\n        callback: path => {\r\n          fileStore.set(path);\r\n          filePicker = false;\r\n        }\r\n      });\r\n    }\r\n    filePicker.render(true, { focus: true });\r\n  }\r\n\r\n  const presets = PlayerSettings.getPresets();\r\n  let selectedPreset = \"default\";\r\n\r\n</script>\r\n\r\n<div class=\"effect-player-container\">\r\n\r\n\t<fieldset>\r\n\r\n\t\t<legend>Effect</legend>\r\n\r\n\t\t<button class=\"activate-layer\" type=\"button\" on:click={() => activateLayer()}>{localize(\"SEQUENCER.Player.SwitchToLayer\")}</button>\r\n\r\n\t\t<div class=\"file-settings\">\r\n\t\t\t<input bind:value={$fileStore} class=\"file-input flex3\"\r\n             list=\"dblist\"\r\n\t\t\t\t\t\t placeholder='{localize(\"SEQUENCER.Player.PathInput\")}'\r\n\t\t\t\t\t\t type=\"text\"/>\r\n\t\t\t<button class=\"custom-file-picker small-button\" type=\"button\" on:click={handleClick}>\r\n        <i class=\"fas fa-file-import\"></i>\r\n      </button>\r\n\t\t\t<datalist id=\"dblist\">\r\n\t\t\t\t{#each suggestions as suggestion}\r\n\t\t\t\t\t<option>{suggestion}</option>\r\n\t\t\t\t{/each}\r\n\t\t\t</datalist>\r\n\t\t</div>\r\n\r\n\t\t<div class=\"user-settings flexcol\">\r\n\t\t\t<label for=\"user-select\">Play for users:</label>\r\n\t\t\t<select class=\"user-select\" id=\"user-select\" multiple bind:value={$userStore}>\r\n\t\t\t\t<option selected value=\"all\">{localize(\"SEQUENCER.Player.AllUsers\")}</option>\r\n\t\t\t\t{#each users as user (user.id)}\r\n\t\t\t\t\t<option value=\"{user.id}\">{user.name}</option>\r\n\t\t\t\t{/each}\r\n\t\t\t</select>\r\n\t\t</div>\r\n\r\n\t\t<div class=\"flexcol\">\r\n\r\n\t\t\t<div class=\"row w-100\">{localize(\"SEQUENCER.Player.Presets\")}</div>\r\n\r\n\t\t\t<div class=\"preset-container\">\r\n\r\n\t\t\t\t<select class=\"preset-select\" bind:value={selectedPreset} on:change={() => PlayerSettings.loadPreset(selectedPreset)}>\r\n\r\n\t\t\t\t\t<option value=\"default\">{localize(\"SEQUENCER.Player.PresetsDefault\")}</option>\r\n\t\t\t\t\t{#each presets as preset}\r\n\t\t\t\t\t\t<option>{preset}</option>\r\n\t\t\t\t\t{/each}\r\n\t\t\t\t\t<!--{{#each presets}}-->\r\n\t\t\t\t\t<!--<option>{{ @key }}</option>-->\r\n\t\t\t\t\t<!--{{/each}}-->\r\n\r\n\t\t\t\t</select>\r\n\r\n\t\t\t\t<button class=\"save-preset small-button\" data-tooltip=\"Save Preset\" type=\"button\" on:click={() => PlayerSettings.savePreset(selectedPreset)}>\r\n\t\t\t\t\t<i class=\"fas fa-download\"></i>\r\n\t\t\t\t</button>\r\n\t\t\t\t<button class=\"copy-preset small-button\" data-tooltip=\"Copy Preset\" disabled={selectedPreset === \"default\"} type=\"button\" on:click={() => PlayerSettings.copyPreset(selectedPreset)}>\r\n\t\t\t\t\t<i class=\"fas fa-copy\"></i>\r\n\t\t\t\t</button>\r\n\t\t\t\t<button class=\"delete-preset small-button\" data-tooltip=\"Delete Preset\" disabled={selectedPreset === \"default\"} type=\"button\" on:click={() => PlayerSettings.deletePreset(selectedPreset)}>\r\n\t\t\t\t\t<i class=\"fas fa-times\"></i>\r\n\t\t\t\t</button>\r\n\r\n\t\t\t</div>\r\n\r\n\t\t</div>\r\n\r\n\t</fieldset>\r\n\r\n\t<fieldset>\r\n\r\n\t\t<legend>Transform</legend>\r\n\r\n\t\t<div class=\"effect-transform-container\">\r\n\t\t\t<SliderInput setting={PlayerSettings.scale} styles={{ \"grid-column\": `1 / 5` }}/>\r\n\t\t\t<NumberInput setting={PlayerSettings.scaleIn} styles={{ \"grid-column\": `1 / 3` }}/>\r\n\t\t\t<NumberInput setting={PlayerSettings.scaleOut} styles={{ \"grid-column\": `3 / 5` }}/>\r\n\t\t\t<div class=\"divider\"></div>\r\n\t\t\t<SliderInput setting={PlayerSettings.rotation} lock={PlayerSettings.randomRotation} min=\"-180\" max=\"180\"  styles={{ \"grid-column\": `1 / 5` }}/>\r\n\t\t\t<div></div>\r\n\t\t\t<Checkbox setting={PlayerSettings.randomRotation} styles={{ \"grid-column\": `2 / 4` }}/>\r\n\t\t\t<div></div>\r\n\t\t\t<div class=\"divider\"></div>\r\n\t\t\t<Checkbox setting={PlayerSettings.mirrorX} styles={{ \"grid-column\": `1 / 3` }}/>\r\n\t\t\t<Checkbox setting={PlayerSettings.mirrorY} styles={{ \"grid-column\": `3 / 5` }}/>\r\n\t\t\t<Checkbox setting={PlayerSettings.randomMirrorX} styles={{ \"grid-column\": `1 / 3` }} lock={PlayerSettings.mirrorX} inverse/>\r\n\t\t\t<Checkbox setting={PlayerSettings.randomMirrorY} styles={{ \"grid-column\": `3 / 5` }} lock={PlayerSettings.mirrorY} inverse/>\r\n\t\t\t<div class=\"divider\"></div>\r\n\t\t\t<NumberInput setting={PlayerSettings.offsetX} lock={PlayerSettings.randomOffset} styles={{ \"grid-column\": `1 / 3` }}/>\r\n\t\t\t<NumberInput setting={PlayerSettings.offsetY} lock={PlayerSettings.randomOffset} styles={{ \"grid-column\": `3 / 5` }}/>\r\n\t\t\t<Checkbox setting={PlayerSettings.randomOffset} styles={{ \"grid-column\": `1 / 3` }}/>\r\n\t\t\t<NumberInput setting={PlayerSettings.randomOffsetAmount} lock={PlayerSettings.randomOffset} inverse styles={{ \"grid-column\": `3 / 5` }}/>\r\n\t\t\t<Checkbox setting={PlayerSettings.offsetGridUnits} styles={{ \"grid-column\": `2 / 5` }}/>\r\n\t\t\t<div></div>\r\n\t\t</div>\r\n\r\n\t</fieldset>\r\n\r\n\t<fieldset>\r\n\r\n\t\t<legend>Behavior</legend>\r\n\t\t<div class=\"effect-transform-container\">\r\n\t\t\t<NumberInput setting={PlayerSettings.fadeIn} styles={{ \"grid-column\": `1 / 3` }}/>\r\n\t\t\t<NumberInput setting={PlayerSettings.fadeOut} styles={{ \"grid-column\": `3 / 5` }}/>\r\n\t\t\t<div class=\"divider\"></div>\r\n\t\t\t<Checkbox setting={PlayerSettings.repeat} styles={{ \"grid-column\": `1 / 3` }}/>\r\n\t\t\t<NumberInput setting={PlayerSettings.repetitions} lock={PlayerSettings.repeat} inverse styles={{ \"grid-column\": `3 / 5` }}/>\r\n\t\t\t<NumberInput setting={PlayerSettings.repeatDelayMin} lock={PlayerSettings.repeat} inverse styles={{ \"grid-column\": `3 / 4` }}/>\r\n\t\t\t<NumberInput setting={PlayerSettings.repeatDelayMax} lock={PlayerSettings.repeat} inverse styles={{ \"grid-column\": `4 / 5` }}/>\r\n\t\t\t<div class=\"divider\"></div>\r\n\t\t\t<SwitchToggle setting={PlayerSettings.moveTowards} styles={{ \"grid-column\": `1 / 3` }}/>\r\n\t\t\t<NumberInput setting={PlayerSettings.moveSpeed} lock={PlayerSettings.moveTowards} inverse styles={{ \"grid-column\": `3 / 5` }}/>\r\n\t\t\t<div class=\"divider\"></div>\r\n\t\t\t<Checkbox setting={PlayerSettings.attachTo} styles={{ \"grid-column\": `1 / 5` }}/>\r\n\t\t\t<Checkbox setting={PlayerSettings.stretchToAttach} styles={{ \"grid-column\": `1 / 5` }}/>\r\n\t\t\t<Checkbox setting={PlayerSettings.snapToGrid} styles={{ \"grid-column\": `1 / 5` }}/>\r\n\t\t\t<Checkbox setting={PlayerSettings.persist} styles={{ \"grid-column\": `1 / 5` }}/>\r\n\t\t\t<Checkbox setting={PlayerSettings.belowTokens} styles={{ \"grid-column\": `1 / 5` }}/>\r\n\t\t</div>\r\n\r\n\t</fieldset>\r\n\r\n</div>\r\n\r\n<style lang=\"scss\">\r\n\r\n\t.activate-layer {\r\n\t\tmargin-bottom: 0.5rem;\r\n\t}\r\n\r\n\t.file-settings {\r\n\t\tdisplay: flex;\r\n    margin-bottom: 0.5rem;\r\n\t}\r\n\r\n\t.preset-container {\r\n\t\tdisplay: flex;\r\n    margin-bottom: 0.5rem;\r\n\r\n\t\tselect {\r\n\t\t\tflex: 1;\r\n    }\r\n\t}\r\n\r\n  .small-button {\r\n    flex: 0 0 24px;\r\n    min-width: 30px;\r\n    line-height: 24px;\r\n    margin: -1px 0 -1px 4px;\r\n    order: 99;\r\n    text-align: center;\r\n\r\n    i {\r\n      margin: 0;\r\n    }\r\n\r\n    &:disabled {\r\n      cursor: initial;\r\n      opacity: 0.5;\r\n    }\r\n\r\n  }\r\n\r\n\t.user-settings {\r\n    margin-bottom: 0.5rem;\r\n\t}\r\n\r\n  .scrolling-text {\r\n\r\n  }\r\n\r\n  /* jb2a.breath_weapons02.burst.cone.arcana */\r\n\r\n</style>\r\n","<script>\r\n\r\n  import CONSTANTS from \"../../../constants.js\";\r\n\r\n  export let status;\r\n\r\n</script>\r\n\r\n<i class=\"fa-solid background-circle\"\r\n   class:invisible={$status === CONSTANTS.STATUS.READY}\r\n   class:fa-arrow-right={$status === CONSTANTS.STATUS.RUNNING || $status === CONSTANTS.STATUS.READY}\r\n   class:fa-check={$status === CONSTANTS.STATUS.COMPLETE}\r\n   class:fa-arrow-down={$status === CONSTANTS.STATUS.SKIPPED}\r\n   class:fa-times={$status === CONSTANTS.STATUS.ABORTED}>\r\n</i>\r\n<i class=\"fa-solid \"></i>\r\n\r\n<style lang=\"scss\">\r\n\r\n  .background-circle{\r\n    position: relative;\r\n    z-index: 2;\r\n    margin-right: 0.2rem;\r\n    min-width: 1rem;\r\n    text-align: center;\r\n  }\r\n\r\n  .invisible {\r\n    opacity: 0;\r\n  }\r\n\r\n</style>\r\n","<script>\r\n\r\n  import { localize } from '#runtime/util/i18n';\r\n  import SequenceStatus from \"./SequenceStatus.svelte\";\r\n  import CONSTANTS from \"../../../constants.js\";\r\n\r\n  export let section;\r\n\r\n  const status = section.sectionStatus;\r\n  const sectionName = (section?.constructor?.niceName ? section?.constructor?.niceName : section.constructor.name) + (section?._name ? \" - \" + section._name : \"\");\r\n\r\n</script>\r\n\r\n<div>\r\n  <span>\r\n    <SequenceStatus {status}/>\r\n  </span>\r\n  <span class=\"section-name\">{sectionName}</span>\r\n  <span class=\"sequence-actions\" data-tooltip={localize(\"SEQUENCER.Sequences.AbortSection\")}>\r\n    <a class:section-done={$status > CONSTANTS.STATUS.READY} on:click={() => { section._abortSection(); }}>\r\n      <i class=\"fas fa-stop\"></i>\r\n    </a>\r\n  </span>\r\n</div>\r\n\r\n<style lang=\"scss\">\r\n  div {\r\n    display: flex;\r\n    flex-direction: row;\r\n    align-items: center;\r\n    margin-left: 0.5rem;\r\n    padding: 3px 5px;\r\n    border-radius: 3px;\r\n\r\n    .section-name {\r\n      flex: 1;\r\n    }\r\n\r\n    &:hover {\r\n      background: rgba(0, 0, 0, 0.1);\r\n    }\r\n\r\n    .sequence-actions {\r\n      opacity: 0.3;\r\n    }\r\n\r\n    &:hover .sequence-actions {\r\n      opacity: 0.8;\r\n    }\r\n\r\n    .section-done {\r\n      display: none;\r\n    }\r\n  }\r\n</style>\r\n","<script>\r\n\r\n  import { localize } from '#runtime/util/i18n';\r\n  import SequenceSection from \"./SequenceSection.svelte\";\r\n  import SequenceStatus from \"./SequenceStatus.svelte\";\r\n  import SequenceManager from \"../../../modules/sequence-manager.js\";\r\n  import CONSTANTS from \"../../../constants.js\";\r\n\r\n  export let sequence;\r\n  export let index;\r\n\r\n  const status = sequence.statusStore;\r\n\r\n</script>\r\n\r\n\r\n<div class=\"sequence-name-container\">\r\n  <span>\r\n    <SequenceStatus {status}/>\r\n  </span>\r\n  <span class=\"sequence-name\">\r\n    Sequence {index}{sequence.moduleName ? ` (${sequence.moduleName})` : \"\"}\r\n  </span>\r\n  <span class=\"sequence-actions\">\r\n    <a class=\"clear-sequence\"\r\n       class:sequence-done-show={$status > CONSTANTS.STATUS.RUNNING}\r\n       on:click={() => { SequenceManager.RunningSequences.delete(sequence.id); }}\r\n       data-tooltip={localize(\"SEQUENCER.Sequences.Clear\")}\r\n    >\r\n      <i class=\"fas fa-trash-can\"></i>\r\n    </a>\r\n    <a class:sequence-done-hide={$status > CONSTANTS.STATUS.RUNNING} on:click={() => { sequence._abort(); }} data-tooltip={localize(\"SEQUENCER.Sequences.AbortSequence\")}>\r\n      <i class=\"fas fa-stop\"></i>\r\n    </a>\r\n  </span>\r\n</div>\r\n{#each sequence.sections as section}\r\n  <SequenceSection {section} />\r\n{/each}\r\n\r\n\r\n<style lang=\"scss\">\r\n\r\n  .sequence-name-container{\r\n    display: flex;\r\n    font-weight: bold;\r\n    padding: 3px 5px;\r\n    border-radius: 3px;\r\n\r\n    .sequence-name {\r\n      flex: 1;\r\n    }\r\n\r\n    &:hover {\r\n      background: rgba(0, 0, 0, 0.1);\r\n    }\r\n\r\n    .sequence-actions {\r\n      display: flex;\r\n      max-width: 10px;\r\n      flex: 0 1 10px;\r\n      & a {\r\n        opacity: 0.35;\r\n      }\r\n    }\r\n\r\n    &:hover .sequence-actions a {\r\n      opacity: 0.7;\r\n\r\n      &:hover{\r\n        opacity: 1.0;\r\n      }\r\n    }\r\n\r\n    .clear-sequence {\r\n      margin-right: 0.5rem;\r\n      display: none;\r\n    }\r\n\r\n    .sequence-done-show {\r\n      display: block;\r\n    }\r\n\r\n    .sequence-done-hide {\r\n      display: none;\r\n    }\r\n\r\n  }\r\n\r\n</style>\r\n","<script>\r\n  import { localize } from '#runtime/util/i18n';\r\n  import { onMount, onDestroy } from \"svelte\";\r\n  import SequenceManager from \"../../modules/sequence-manager.js\";\r\n  import Sequence from \"./components/Sequence.svelte\";\r\n\r\n  const VisibleEffects = SequenceManager.VisibleEffects;\r\n  const RunningSequences = SequenceManager.RunningSequences;\r\n\r\n  $: runningSequences = Object.entries($RunningSequences);\r\n\r\n  onMount(() => {\r\n    SequenceManager.RunningSequences.clearFinishedSequences();\r\n  });\r\n\r\n  onDestroy(() => {\r\n    SequenceManager.RunningSequences.clearFinishedSequences();\r\n  });\r\n\r\n</script>\r\n\r\n<div class=\"sequence-container\">\r\n\r\n  {#if !runningSequences.length}\r\n\r\n    <div class=\"no-sequences\">\r\n      <h2>{localize(\"SEQUENCER.Sequences.NoSequences\")}</h2>\r\n    </div>\r\n\r\n  {:else}\r\n\r\n    <div class=\"sequence-button-header\">\r\n      <button type=\"button\" on:click={() => {\r\n         SequenceManager.RunningSequences.clearFinishedSequences();\r\n      }}>\r\n        {localize(\"SEQUENCER.Sequences.ClearFinished\")}\r\n      </button>\r\n      <button type=\"button\" on:click={() => {\r\n         SequenceManager.RunningSequences.stopAll();\r\n      }}>\r\n        {localize(\"SEQUENCER.Sequences.StopAll\")}\r\n      </button>\r\n    </div>\r\n\r\n    <div class=\"running-sequences\">\r\n      {#each runningSequences as [id, sequence], index (id)}\r\n        <Sequence {sequence} index={index+1}/>\r\n      {/each}\r\n    </div>\r\n\r\n  {/if}\r\n\r\n</div>\r\n\r\n<style lang=\"scss\">\r\n\r\n  .sequence-container {\r\n    min-width: 320px;\r\n    min-height: 563px;\r\n    max-width: 320px;\r\n    max-height: 563px;\r\n    display: flex;\r\n    flex-direction: column;\r\n  }\r\n\r\n  .sequence-button-header{\r\n    display: flex;\r\n    button {\r\n      font-size: 0.85rem;\r\n    }\r\n  }\r\n\r\n  .effects {\r\n    flex: 1;\r\n    margin-top: 0.5rem;\r\n  }\r\n\r\n  .running-sequences{\r\n    flex: 1;\r\n    margin-top: 0.5rem;\r\n  }\r\n\r\n</style>\r\n","<script>\r\n\r\n\timport { ApplicationShell } from \"#runtime/svelte/component/application\";\r\n  import { localize } from '#runtime/util/i18n';\r\n  import { getContext } from \"svelte\";\r\n  import HowTo from \"./HowTo.svelte\";\r\n  import Tabs from \"./Tabs.svelte\";\r\n  import Manager from \"./Manager.svelte\";\r\n  import Player from \"./Player.svelte\";\r\n  import Sequences from \"./Sequences.svelte\";\r\n\r\n  const { application } = getContext(\"#external\");\r\n\r\n  export let elementRoot;\r\n\r\n  let tabs = [\r\n    { value: \"player\", label: localize(\"SEQUENCER.Player.Title\"), icon: \"fas fa-play-circle\", component: Player },\r\n    { value: \"manager\", label: localize(\"SEQUENCER.Manager.Title\"), icon: \"fas fa-film\", component: Manager },\r\n    { value: \"sequences\", label: localize(\"SEQUENCER.Sequences.Title\"), icon: \"fas fa-play\", component: Sequences },\r\n    { value: \"howto\", label: localize(\"SEQUENCER.HowTo.Title\"), icon: \"fas fa-chalkboard-teacher\", component: HowTo },\r\n  ];\r\n\r\n  let activeTab = application.options.tab ?? \"manager\";\r\n  $: component = tabs.find(tab => tab.value === activeTab).component;\r\n\r\n</script>\r\n\r\n<svelte:options accessors={true}/>\r\n\r\n<ApplicationShell bind:elementRoot>\r\n\r\n\t<Tabs bind:activeTab {tabs}/>\r\n\r\n\t<svelte:component this={component}/>\r\n\r\n</ApplicationShell>\r\n","import { SvelteApplication } from \"#runtime/svelte/application\";\nimport EffectsUIShell from \"./effects-ui-shell.svelte\";\n\nexport class EffectsUIApp extends SvelteApplication {\n  static get defaultOptions() {\n    return foundry.utils.mergeObject(super.defaultOptions, {\n      title: game.i18n.localize(\"SEQUENCER.ManagerUI\"),\n      classes: [\"dialog\"],\n      width: \"auto\",\n      height: \"auto\",\n      top: 65,\n      left: 120,\n      resizable: false,\n      svelte: {\n        class: EffectsUIShell,\n        target: document.body,\n      },\n    });\n  }\n\n  static getActiveApp() {\n    return Object.values(ui.windows).find((app) => {\n      return (\n        app instanceof this && app._state > Application.RENDER_STATES.CLOSED\n      );\n    });\n  }\n\n  static async show(options = {}) {\n    const existingApp = this.getActiveApp();\n    if (existingApp) return existingApp.render(false, { focus: true });\n    return new Promise((resolve) => {\n      options.resolve = resolve;\n      new this(options).render(true, { focus: true });\n    });\n  }\n}\n","import CONSTANTS from \"./constants.js\";\nimport { debug, user_can_do } from \"./lib/lib.js\";\nimport { DatabaseViewerApp } from \"./formapplications/database/database-viewer-app.js\";\nimport { EffectsUIApp } from \"./formapplications/effects-ui/effects-ui-app.js\";\n\nexport function registerSettings() {\n  game.settings.register(CONSTANTS.MODULE_NAME, \"enable-fix-pixi\", {\n    name: \"SEQUENCER.Setting.EnablePixiFix.Title\",\n    hint: \"SEQUENCER.Setting.EnablePixiFix.Label\",\n    scope: \"client\",\n    config: true,\n    default: false,\n    requiresReload: true,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"enable-global-fix-pixi\", {\n    name: \"SEQUENCER.Setting.EnableGlobalPixiFix.Title\",\n    hint: \"SEQUENCER.Setting.EnableGlobalPixiFix.Label\",\n    scope: \"client\",\n    config: true,\n    default: false,\n    requiresReload: true,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"enable-above-ui-screenspace\", {\n    name: \"SEQUENCER.Setting.EnableAboveUIScreenspace.Title\",\n    hint: \"SEQUENCER.Setting.EnableAboveUIScreenspace.Label\",\n    scope: \"client\",\n    config: true,\n    default: true,\n    requiresReload: true,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"debug\", {\n    name: \"SEQUENCER.Setting.Debug.Title\",\n    hint: \"SEQUENCER.Setting.Debug.Label\",\n    scope: \"client\",\n    config: true,\n    default: false,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"showSidebarTools\", {\n    name: \"SEQUENCER.Setting.ShowTools.Title\",\n    hint: \"SEQUENCER.Setting.ShowTools.Label\",\n    scope: \"client\",\n    config: true,\n    default: true,\n    requiresReload: true,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"showTokenSidebarTools\", {\n    name: \"SEQUENCER.Setting.ShowTokenTools.Title\",\n    hint: \"SEQUENCER.Setting.ShowTokenTools.Label\",\n    scope: \"client\",\n    config: true,\n    default: true,\n    requiresReload: true,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"effectsEnabled\", {\n    name: \"SEQUENCER.Setting.EnableEffects.Title\",\n    hint: \"SEQUENCER.Setting.EnableEffects.Label\",\n    scope: \"client\",\n    config: true,\n    default: true,\n    requiresReload: true,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"soundsEnabled\", {\n    name: \"SEQUENCER.Setting.EnableSounds.Title\",\n    hint: \"SEQUENCER.Setting.EnableSounds.Label\",\n    scope: \"client\",\n    config: true,\n    default: true,\n    requiresReload: true,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"user-effect-opacity\", {\n    name: \"SEQUENCER.Setting.ExternalEffectOpacity.Title\",\n    hint: \"SEQUENCER.Setting.ExternalEffectOpacity.Label\",\n    scope: \"client\",\n    config: true,\n    default: 50,\n    type: Number,\n    range: {\n      min: 0,\n      max: 100,\n      step: 1,\n    },\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"db-list-view\", {\n    scope: \"client\",\n    config: false,\n    default: false,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"support-dialog-shown\", {\n    scope: \"world\",\n    config: false,\n    default: false,\n    type: Boolean,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"welcome-shown-version\", {\n    scope: \"world\",\n    config: false,\n    default: \"0.0.0\",\n    type: String,\n  });\n\n  const permissionLevels = [\n    game.i18n.localize(\"SEQUENCER.Permission.Player\"),\n    game.i18n.localize(\"SEQUENCER.Permission.Trusted\"),\n    game.i18n.localize(\"SEQUENCER.Permission.Assistant\"),\n    game.i18n.localize(\"SEQUENCER.Permission.GM\"),\n  ];\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"permissions-effect-create\", {\n    name: \"SEQUENCER.Setting.Permission.EffectCreate.Title\",\n    hint: \"SEQUENCER.Setting.Permission.EffectCreate.Label\",\n    scope: \"world\",\n    config: true,\n    default: 0,\n    type: Number,\n    choices: permissionLevels,\n    requiresReload: true,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"permissions-effect-delete\", {\n    name: \"SEQUENCER.Setting.Permission.EffectDelete.Title\",\n    hint: \"SEQUENCER.Setting.Permission.EffectDelete.Label\",\n    scope: \"world\",\n    config: true,\n    default: 2,\n    type: Number,\n    choices: permissionLevels,\n    requiresReload: true,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"permissions-sound-create\", {\n    name: \"SEQUENCER.Setting.Permission.SoundCreate.Title\",\n    hint: \"SEQUENCER.Setting.Permission.SoundCreate.Label\",\n    scope: \"world\",\n    config: true,\n    default: 0,\n    type: Number,\n    choices: permissionLevels,\n    requiresReload: true,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"permissions-preload\", {\n    name: \"SEQUENCER.Setting.Permission.PreloadClients.Title\",\n    hint: \"SEQUENCER.Setting.Permission.PreloadClients.Label\",\n    scope: \"world\",\n    config: true,\n    default: 1,\n    type: Number,\n    choices: permissionLevels,\n    requiresReload: true,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"permissions-sidebar-tools\", {\n    name: \"SEQUENCER.Setting.Permission.UseSidebarTools.Title\",\n    hint: \"SEQUENCER.Setting.Permission.UseSidebarTools.Label\",\n    scope: \"world\",\n    config: true,\n    default: 0,\n    type: Number,\n    choices: permissionLevels,\n    requiresReload: true,\n  });\n\n  game.settings.register(CONSTANTS.MODULE_NAME, \"effectPresets\", {\n    scope: \"client\",\n    default: {},\n    type: Object,\n  });\n\n  Hooks.on(\"getSceneControlButtons\", (controls) => {\n\n    if (!game.settings.get(CONSTANTS.MODULE_NAME, \"showSidebarTools\")) return;\n\n\t  const sidebarTools = {\n\t\t  [CONSTANTS.TOOLS.SELECT]: {\n\t\t\t  name: CONSTANTS.TOOLS.SELECT,\n\t\t\t  title: \"SEQUENCER.SidebarButtons.Select\",\n\t\t\t  icon: \"fas fa-expand\",\n\t\t\t  visible:\n\t\t\t\t  user_can_do(\"permissions-effect-create\") &&\n\t\t\t\t  user_can_do(\"permissions-sidebar-tools\"),\n\t\t\t  onChange: () => {}\n\t\t  },\n\t\t  [CONSTANTS.TOOLS.PLAY]: {\n\t\t\t  name: CONSTANTS.TOOLS.PLAY,\n\t\t\t  title: \"SEQUENCER.SidebarButtons.Play\",\n\t\t\t  icon: \"fas fa-play\",\n\t\t\t  visible:\n\t\t\t\t  user_can_do(\"permissions-effect-create\") &&\n\t\t\t\t  user_can_do(\"permissions-sidebar-tools\"),\n\t\t\t  onChange: (event, active) => {\n\t\t\t\t  if(active || !CONSTANTS.IS_V13){\n\t\t\t\t\t\tEffectsUIApp.show({ inFocus: true, tab: \"player\" });\n\t\t\t\t  }\n\t\t\t  },\n\t\t  },\n\t\t  [CONSTANTS.TOOLS.VIEWER]: {\n\t\t\t  name: CONSTANTS.TOOLS.VIEWER,\n\t\t\t  title: \"SEQUENCER.SidebarButtons.Manager\",\n\t\t\t  icon: \"fas fa-film\",\n\t\t\t  button: true,\n\t\t\t  visible:\n\t\t\t\t  user_can_do(\"permissions-effect-create\") &&\n\t\t\t\t  user_can_do(\"permissions-sidebar-tools\"),\n\t\t\t  onChange: (event, active) => {\n\t\t\t\t  if(active || !CONSTANTS.IS_V13) {\n\t\t\t\t\t  EffectsUIApp.show({ inFocus: true, tab: \"manager\" });\n\t\t\t\t  }\n\t\t\t  },\n\t\t  },\n\t\t  [CONSTANTS.TOOLS.DATABASE]: {\n\t\t\t  name: CONSTANTS.TOOLS.DATABASE,\n\t\t\t  title: \"SEQUENCER.SidebarButtons.Database\",\n\t\t\t  icon: \"fas fa-database\",\n\t\t\t  button: true,\n\t\t\t  visible: user_can_do(\"permissions-sidebar-tools\"),\n\t\t\t  onChange: (event, active) => {\n\t\t\t\t  if(active || !CONSTANTS.IS_V13) {\n\t\t\t\t\t  DatabaseViewerApp.show();\n\t\t\t\t  }\n\t\t\t  },\n\t\t  }\n\t  }\n\n\t\tif(CONSTANTS.IS_V13){\n\t\t\treturn setupSidebarToolsV13(controls, sidebarTools);\n\t\t}\n\n\t\tObject.values(sidebarTools).forEach(button => {\n\t\t\tbutton.onClick = button.onChange;\n\t\t})\n\n\t\treturn setupSidebarToolsV12(controls, sidebarTools);\n\n  });\n\n  debug(\"Sequencer | Registered settings\");\n}\n\nfunction setupSidebarToolsV13(controls, sidebarTools){\n\n\tcontrols[CONSTANTS.MODULE_NAME] = {\n\t\tname: CONSTANTS.MODULE_NAME,\n\t\ttitle: \"Sequencer Layer\",\n\t\ticon: \"fas fa-list-ol\",\n\t\tlayer: CONSTANTS.INTERFACE_LAYER,\n\t\tvisible:\n\t\t\tuser_can_do(\"permissions-effect-create\") &&\n\t\t\tuser_can_do(\"permissions-sidebar-tools\"),\n\t\tactiveTool: CONSTANTS.TOOLS.PLAY,\n\t\tonChange: (event, active) => {\n\t\t\tif ( active ) canvas.sequencerInterfaceLayer.activate({ tool: CONSTANTS.TOOLS.PLAY });\n\t\t},\n\t\ttools: sidebarTools,\n\t}\n\n\tif (!game.settings.get(CONSTANTS.MODULE_NAME, \"showTokenSidebarTools\")) {\n\t\treturn;\n\t}\n\n\tcontrols[\"tokens\"].tools[CONSTANTS.TOOLS.DATABASE] = sidebarTools[CONSTANTS.TOOLS.DATABASE];\n\tcontrols[\"tokens\"].tools[CONSTANTS.TOOLS.VIEWER] = sidebarTools[CONSTANTS.TOOLS.VIEWER];\n}\n\nfunction setupSidebarToolsV12(controls, sidebarTools){\n\n\tcontrols.push({\n\t\tname: CONSTANTS.MODULE_NAME,\n\t\ttitle: \"Sequencer Layer\",\n\t\ticon: \"fas fa-list-ol\",\n\t\tlayer: CONSTANTS.INTERFACE_LAYER,\n\t\tvisible:\n\t\t\tuser_can_do(\"permissions-effect-create\") &&\n\t\t\tuser_can_do(\"permissions-sidebar-tools\"),\n\t\tactiveTool: CONSTANTS.TOOLS.SELECT,\n\t\ttools: Object.values(sidebarTools)\n\t});\n\n\tif (!game.settings.get(CONSTANTS.MODULE_NAME, \"showTokenSidebarTools\")) {\n\t\treturn;\n\t}\n\n\tconst bar = controls.find((c) => c.name === \"token\");\n\tbar.tools.push(sidebarTools[CONSTANTS.TOOLS.DATABASE]);\n\tbar.tools.push(sidebarTools[CONSTANTS.TOOLS.VIEWER]);\n\n}\n\nexport async function migrateSettings() {\n  const oldScreenspaceSetting = game.settings.storage\n    .get(\"client\")\n    .getItem(\"sequencer.disable-above-ui-screenspace\");\n  if (oldScreenspaceSetting) {\n    const value = oldScreenspaceSetting === \"true\";\n    game.settings.storage\n      .get(\"client\")\n      .removeItem(\"sequencer.disable-above-ui-screenspace\");\n    await game.settings.set(\n      CONSTANTS.MODULE_NAME,\n      \"enable-above-ui-screenspace\",\n      !value\n    );\n  }\n}\n","import {\n  BaseEffectsLayer,\n  SequencerInterfaceLayer,\n  UIEffectsLayer,\n} from \"./canvas-effects/effects-layer.js\";\nimport { debug } from \"./lib/lib.js\";\nimport FoundryShim from \"./utils/foundry-shim.js\";\n\nexport default function registerLayers() {\n  CONFIG.Canvas.layers = foundry.utils.mergeObject(FoundryShim.Canvas.layers, {\n    sequencerEffects: {\n      layerClass: BaseEffectsLayer,\n      group: \"primary\",\n    },\n    sequencerInterfaceLayer: {\n      layerClass: SequencerInterfaceLayer,\n      group: \"interface\",\n    },\n    sequencerEffectsUILayer: {\n      layerClass: UIEffectsLayer,\n      group: \"interface\",\n    },\n  });\n\n  if (!Object.is(FoundryShim.Canvas.layers, CONFIG.Canvas.layers)) {\n    const layers = FoundryShim.Canvas.layers;\n    Object.defineProperty(FoundryShim.Canvas, \"layers\", {\n      get: function () {\n        return foundry.utils.mergeObject(layers, CONFIG.Canvas.layers);\n      },\n    });\n  }\n\n  debug(\"Registered Layers\");\n}\n","import VisionSamplerShader from \"./lib/filters/vision-sampler-shader.js\";\nimport { debug } from \"./lib/lib.js\";\n\nexport default function registerBatchShader() {\n  VisionSamplerShader.registerPlugin();\n\n  debug(\"Registered VisionBatchShader\");\n}\n","import CONSTANTS from \"./constants.js\";\nimport {\n  EffectPlayer,\n  SelectionManager,\n} from \"./modules/sequencer-interaction-manager.js\";\nimport { PlayerSettings } from \"./formapplications/effects-ui/effect-player-store.js\";\n\nconst hotkeys = {\n  get _ready() {\n    return canvas.ready && canvas.sequencerInterfaceLayer.active;\n  },\n\n  playTool: {\n    playManySequencedDown: () => {\n      if (!hotkeys._ready) return;\n      EffectPlayer.playManySequenced = true;\n    },\n    playManySequencedUp: () => {\n      if (!hotkeys._ready) return;\n      EffectPlayer.playManySequenced = false;\n      if (!EffectPlayer.isActive) return;\n      EffectPlayer.playManyUp();\n    },\n    playManyDown: () => {\n      if (!hotkeys._ready) return;\n      EffectPlayer.playMany = true;\n    },\n    playManyUp: () => {\n      if (!hotkeys._ready) return;\n      EffectPlayer.playMany = false;\n      if (!EffectPlayer.isActive) return;\n      EffectPlayer.playManyUp();\n    },\n    attachToDown: () => {\n      if (!hotkeys._ready) return;\n      PlayerSettings.attachTo.store.set(true);\n      PlayerSettings.stretchToAttach.store.set(true);\n    },\n    attachToUp: () => {\n      if (!hotkeys._ready) return;\n      PlayerSettings.attachTo.store.set(false);\n      PlayerSettings.stretchToAttach.store.set(false);\n    },\n  },\n\n  selectTool: {\n    snapToGridDown: () => {\n      if (!hotkeys._ready) return;\n      SelectionManager.snapToGrid = true;\n    },\n    snapToGridUp: () => {\n      if (!hotkeys._ready) return;\n      SelectionManager.snapToGrid = false;\n    },\n    attachToTargetDown: () => {\n      if (!hotkeys._ready) return;\n      if (!SelectionManager.isActive) return;\n      PlayerSettings.attachTo.store.set(true);\n      PlayerSettings.stretchToAttach.store.set(true);\n    },\n    attachToTargetUp: () => {\n      if (!hotkeys._ready) return;\n      PlayerSettings.attachTo.store.set(false);\n      PlayerSettings.stretchToAttach.store.set(false);\n    },\n    deleteDown: () => {\n      if (!hotkeys._ready) return;\n      SelectionManager.delete();\n    },\n  },\n};\n\nexport default function registerHotkeys() {\n  game.keybindings.register(CONSTANTS.MODULE_NAME, \"play-tool-hotkey-control\", {\n    name: \"SEQUENCER.Hotkeys.PlayTool.Control\",\n    editable: [{ key: \"ControlLeft\" }],\n    onDown: hotkeys.playTool.playManySequencedDown,\n    onUp: hotkeys.playTool.playManySequencedUp,\n  });\n\n  game.keybindings.register(CONSTANTS.MODULE_NAME, \"play-tool-hotkey-shift\", {\n    name: \"SEQUENCER.Hotkeys.PlayTool.Shift\",\n    editable: [{ key: \"ShiftLeft\" }],\n    onDown: hotkeys.playTool.playManyDown,\n    onUp: hotkeys.playTool.playManyUp,\n  });\n\n  game.keybindings.register(CONSTANTS.MODULE_NAME, \"play-tool-hotkey-alt\", {\n    name: \"SEQUENCER.Hotkeys.PlayTool.Alt\",\n    editable: [{ key: \"AltLeft\" }],\n    onDown: hotkeys.playTool.attachToDown,\n    onUp: hotkeys.playTool.attachToDown,\n  });\n\n  game.keybindings.register(\n    CONSTANTS.MODULE_NAME,\n    \"select-tool-hotkey-control\",\n    {\n      name: \"SEQUENCER.Hotkeys.SelectTool.Control\",\n      editable: [{ key: \"ControlLeft\" }],\n      onDown: hotkeys.selectTool.snapToGridDown,\n      onUp: hotkeys.selectTool.snapToGridUp,\n    }\n  );\n\n  game.keybindings.register(CONSTANTS.MODULE_NAME, \"select-tool-hotkey-alt\", {\n    name: \"SEQUENCER.Hotkeys.SelectTool.Alt\",\n    editable: [{ key: \"AltLeft\" }],\n    onDown: hotkeys.selectTool.attachToTargetDown,\n    onUp: hotkeys.selectTool.attachToTargetUp,\n  });\n\n  game.keybindings.register(\n    CONSTANTS.MODULE_NAME,\n    \"select-tool-hotkey-delete\",\n    {\n      name: \"SEQUENCER.Hotkeys.SelectTool.Delete\",\n      editable: [{ key: \"Delete\" }],\n      onDown: hotkeys.selectTool.deleteDown,\n    }\n  );\n}\n","export default async function registerTypes(register) {\n  fetch(\"modules/sequencer/typings/types.d.ts\")\n    .then((response) => response.text())\n    .then((content) => register(\"sequencer/types.d.ts\", content));\n}\n","import { custom_error, debug, is_function } from \"../lib/lib.js\";\n\nconst presetMap = new Map();\n\nexport default class SequencerPresets {\n  /**\n   * Adds a preset that can then be used in sequences\n   *\n   * @param {string} inName\n   * @param {Function} inFunction\n   * @param {boolean} [overwrite=false] overwrite\n   * @returns {Map<string, Function>}\n   */\n  static add(inName, inFunction, overwrite = false) {\n    if (typeof inName !== \"string\") {\n      throw custom_error(\n        \"Sequencer\",\n        `SequencerPresets | inName must be of type string`\n      );\n    }\n\n    if (!is_function(inFunction)) {\n      throw custom_error(\n        \"Sequencer\",\n        `SequencerPresets | inFunction must be of type function`\n      );\n    }\n\n    if (presetMap.get(inName) && !overwrite) {\n      throw custom_error(\n        \"Sequencer\",\n        `SequencerPresets | Preset \"${inName}\" already exists`\n      );\n    }\n\n    presetMap.set(inName, inFunction);\n    debug(`Sequencer | Presets | Added \"${inName}\" preset`);\n    return presetMap;\n  }\n\n  /**\n   * Retrieves all presets\n   *\n   * @returns {Map<string, Function>}\n   */\n  static getAll() {\n    return presetMap;\n  }\n\n  /**\n   * Retrieves preset based on its name\n   *\n   * @param {string} name\n   * @param {boolean} exact\n   * @returns {Function}\n   */\n  static get(name, exact = false) {\n\t  if(presetMap.has(name) || exact) {\n\t\t  return presetMap.get(name);\n\t  }\n\t  const parts = name.split(\".\");\n\t  parts.pop();\n\t  while(parts.length){\n\t\t\tconst newName = parts.join(\".\")\n\t\t  if(presetMap.has(newName)) {\n\t\t\t  return presetMap.get(newName);\n\t\t  }\n\t  }\n\t\treturn false;\n  }\n}\n","import * as lib from \"../lib/lib.js\";\nimport SequencerPresets from \"../modules/sequencer-presets.js\";\nimport CONSTANTS from \"../constants.js\";\nimport { get, writable } from \"svelte/store\";\n\nexport default class Section {\n  constructor(inSequence) {\n    this.sequence = inSequence;\n    this._applyTraits();\n    this._sectionStatus = writable(CONSTANTS.STATUS.READY);\n    this._playIf = true;\n    this._waitUntilFinished = false;\n    this._async = false;\n    this._waitUntilFinishedDelay = [0, 0];\n    this._repetitions = 1;\n    this._currentRepetition = 0;\n    this._repeatDelayMin = 0;\n    this._repeatDelayMax = 0;\n    this._repeatDelay = 0;\n    this._delayMin = 0;\n    this._delayMax = 0;\n    this._basicDelay = 0;\n    this._duration = false;\n  }\n\n  static niceName = \"Section\";\n\n  /**\n   * @protected\n   */\n  get _shouldAsync() {\n    return this._async || this._waitAnyway;\n  }\n\n  /**\n   * @protected\n   */\n  get shouldWaitUntilFinished() {\n    return this._waitUntilFinished || this._waitAnyway;\n  }\n\n  /**\n   * @protected\n   */\n  get _waitAnyway() {\n    return (\n      ((this._async || this._waitUntilFinished) && this._isLastRepetition) ||\n      (this._isLastRepetition && this._isLastSection)\n    );\n  }\n\n  /**\n   * @protected\n   */\n  get _isLastSection() {\n    return (\n      this.sequence.sections.length - 1 === this.sequence.sections.indexOf(this)\n    );\n  }\n\n  /** ------------------------------------------------------------------------------------------------------------------------------ *\n   * Methods below this point should NOT be overridden by child instances of the class, they are integral to the sequence functioning\n   * ------------------------------------------------------------------------------------------------------------------------------- */\n\n  /**\n   * @protected\n   */\n  get _isLastRepetition() {\n    return (\n      this._repetitions === 1 ||\n      this._repetitions === this._currentRepetition + 1\n    );\n  }\n\n  /**\n   * @protected\n   */\n  get _currentWaitTime() {\n    let waitUntilFinishedDelay = this._waitAnyway\n      ? lib.random_int_between(...this._waitUntilFinishedDelay)\n      : 0;\n    return waitUntilFinishedDelay + this._repeatDelay;\n  }\n\n  /**\n   * Method overwritten by inheriting classes, which is called just before the \"run\" method is called (see below)\n   *\n   * @returns {Promise<void>}\n   * @protected\n   */\n  async preRun() {}\n\n  /**\n   * Method overwritten by inheriting classes, which is called when this section is executed by the Sequence\n   *\n   * @returns {Promise<void>}\n   * @protected\n   */\n  async run() {}\n\n  /**\n   * Method overwritten by inheriting classes, which is called when this section is serialized by the Sequence\n   *\n   * @returns {object}\n   * @private\n   */\n  async _serialize() {\n    return {\n      async: this._async,\n      delay: [this._delayMin, this._delayMax],\n      waitUntilFinished: this._waitUntilFinished,\n      waitUntilFinishedDelay: this._waitUntilFinishedDelay,\n      repetitions: this._repetitions,\n      repetitionsDelay: [this._repeatDelayMin, this._repeatDelayMax],\n    };\n  }\n\n  _deserialize(data) {\n    this._async = data.async;\n    this._waitUntilFinished = data.waitUntilFinished;\n    this._waitUntilFinishedDelay = data.waitUntilFinishedDelay;\n    this._repetitions = data.repetitions;\n    this._repeatDelayMin = data.repetitionsDelay[0];\n    this._repeatDelayMax = data.repetitionsDelay[1];\n    return this;\n  }\n\n  /**\n   * Method overwritten by inheriting classes, which stores data or prepares data before the Sequence executes it (see EffectsSection)\n   *\n   * @protected\n   */\n  async _initialize() {}\n\n  /**\n   * Method overwritten by inheriting classes. Inheriting classes uses the following to apply traits to themselves:\n   * - Object.assign(this.constructor.prototype, trait)\n   *\n   * @protected\n   */\n  _applyTraits() {}\n\n  /**\n   * Causes the section to be repeated n amount of times, with an optional delay. If given inRepeatDelayMin\n   * and inRepeatDelayMax, a random repetition delay will be picked for every repetition\n   *\n   * @param {number} inRepetitions\n   * @param {number} inRepeatDelayMin\n   * @param {number} inRepeatDelayMax\n   * @returns {Section} this\n   */\n  repeats(inRepetitions, inRepeatDelayMin = 0, inRepeatDelayMax) {\n    if (!lib.is_real_number(inRepetitions))\n      throw this.sequence._customError(\n        this,\n        \"repeats\",\n        \"inRepetitions must be of type number\"\n      );\n    if (!lib.is_real_number(inRepeatDelayMin))\n      throw this.sequence._customError(\n        this,\n        \"repeats\",\n        \"repeatDelayMin must be of type number\"\n      );\n    if (inRepeatDelayMax && !lib.is_real_number(inRepeatDelayMax)) {\n      throw this.sequence._customError(\n        this,\n        \"repeats\",\n        \"repeatDelayMax must be of type number\"\n      );\n    }\n    this._repetitions = inRepetitions;\n    this._repeatDelayMin = Math.min(\n      inRepeatDelayMin,\n      inRepeatDelayMax ?? inRepeatDelayMin\n    );\n    this._repeatDelayMax = Math.max(\n      inRepeatDelayMin,\n      inRepeatDelayMax ?? inRepeatDelayMin\n    );\n    return this;\n  }\n\n  /**\n   * Causes the effect or sound to not play, and skip all delays, repetitions, waits, etc. If you pass a function,\n   * the function should return something false-y if you do not want the effect or sound to play.\n   *\n   * @param {boolean|function} inCondition\n   * @returns {Section} this\n   */\n  playIf(inCondition) {\n    this._playIf = inCondition;\n    return this;\n  }\n\n  /**\n   * Causes the section to finish running before starting the next section.\n   *\n   * @param {number|boolean} [minDelay=0] minDelay\n   * @param {number/null} [maxDelay=null] maxDelay\n   * @returns {Section} this\n   */\n  waitUntilFinished(minDelay = 0, maxDelay = null) {\n    if (minDelay === false) return this;\n    if (!lib.is_real_number(minDelay))\n      throw this.sequence._customError(\n        this,\n        \"waitUntilFinished\",\n        \"minDelay must be of type number\"\n      );\n    if (maxDelay !== null && !lib.is_real_number(maxDelay))\n      throw this.sequence._customError(\n        this,\n        \"waitUntilFinished\",\n        \"maxDelay must be of type number\"\n      );\n    this._waitUntilFinished = true;\n    this._waitUntilFinishedDelay = [\n      Math.min(minDelay, maxDelay ?? minDelay),\n      Math.max(minDelay, maxDelay ?? minDelay),\n    ];\n    return this;\n  }\n\n  /**\n   * Causes each effect or sound to finish playing before the next one starts playing. This differs from\n   * .waitUntilFinished() in the sense that this is for each repetition, whilst .waitUntilFinished() is\n   * for the entire section.\n   *\n   * @returns {Section} this\n   */\n  async() {\n    this._async = true;\n    return this;\n  }\n\n  /**\n   * Delays the effect or sound from being played for a set amount of milliseconds. If given a second number, a\n   * random delay between the two numbers will be generated.\n   *\n   * @param {number} [msMin=1] minMs\n   * @param {number} [msMax=1] maxMs\n   * @returns {Section} this\n   */\n  delay(msMin, msMax) {\n    if (!lib.is_real_number(msMin))\n      throw this.sequence._customError(\n        this,\n        \"delay\",\n        \"msMin must be of type number\"\n      );\n    if (msMax && !lib.is_real_number(msMax))\n      throw this.sequence._customError(\n        this,\n        \"delay\",\n        \"msMax must be of type number\"\n      );\n    this._delayMin = Math.min(msMin, msMax ?? msMin);\n    this._delayMax = Math.max(msMin, msMax ?? msMin);\n    return this;\n  }\n\n  /**\n   * Overrides the duration of this section\n   *\n   * @param {number} inDuration\n   * @returns {Section} this\n   */\n  duration(inDuration) {\n    if (!lib.is_real_number(inDuration))\n      throw this.sequence._customError(\n        this,\n        \"duration\",\n        \"inDuration must be of type number\"\n      );\n    this._duration = inDuration;\n    return this;\n  }\n\n  /**\n   * Applies a preset to the current section\n   *\n   * @param {string} presetName\n   * @param {*} args\n   * @returns {Section|FunctionSection|EffectSection|AnimationSection|SoundSection}\n   */\n  preset(presetName, ...args) {\n    if (typeof presetName !== \"string\") {\n      throw this.sequence._customError(\n        this,\n        \"name\",\n        `inName must be of type string`\n      );\n    }\n    const preset = SequencerPresets.get(presetName);\n    if (!preset) {\n      lib.custom_warning(\n        \"Sequencer\",\n        `preset | Could not find preset with name \"${presetName}\"`\n      );\n      return this;\n    }\n    return preset(this, ...args);\n  }\n\n  /**\n   * @protected\n   */\n  async _shouldPlay() {\n    return lib.is_function(this._playIf) ? await this._playIf() : this._playIf;\n  }\n\n  /**\n   * @protected\n   */\n  _validateLocation(inLocation) {\n    inLocation = lib.validate_document(inLocation);\n    if (typeof inLocation === \"string\") {\n      inLocation = lib.get_object_from_scene(inLocation) ?? inLocation;\n    }\n    if (typeof inLocation === \"string\") {\n      inLocation = lib.safe_str(inLocation);\n    }\n    return inLocation;\n  }\n\n  /**\n   * @protected\n   */\n  async _execute() {\n    if (!(await this._shouldPlay())) {\n      this.sectionStatus = CONSTANTS.STATUS.SKIPPED;\n      return;\n    }\n    this._basicDelay = lib.random_float_between(this._delayMin, this._delayMax);\n    return new Promise(async (resolve) => {\n      setTimeout(async () => {\n        this.sectionStatus = CONSTANTS.STATUS.RUNNING;\n        for (let i = 0; i < this._repetitions; i++) {\n          if (get(this.sectionStatus) === CONSTANTS.STATUS.ABORTED) {\n            resolve();\n            return;\n          }\n          this._currentRepetition = i;\n          this._repeatDelay =\n            i !== this._repetitions - 1\n              ? lib.random_float_between(\n                  this._repeatDelayMin,\n                  this._repeatDelayMax\n                )\n              : 0;\n          await this.preRun();\n          if (this._shouldAsync) {\n            await this.run();\n          } else {\n            this.run();\n          }\n          if (this._repetitions > 1 && i !== this._repetitions - 1) {\n            await this._delayBetweenRepetitions();\n          }\n        }\n        resolve();\n      }, this._basicDelay);\n    }).then(() => {\n      this.sectionStatus = CONSTANTS.STATUS.COMPLETE;\n    });\n  }\n\n  set sectionStatus(inStatus) {\n    this._sectionStatus.update((currentStatus) => {\n      if (\n        currentStatus === CONSTANTS.STATUS.READY ||\n        (currentStatus === CONSTANTS.STATUS.RUNNING &&\n          inStatus !== CONSTANTS.STATUS.ABORTED)\n      ) {\n        return inStatus;\n      }\n      return currentStatus;\n    });\n  }\n\n  get sectionStatus() {\n    return this._sectionStatus;\n  }\n\n  _abortSection() {\n    this.sectionStatus = CONSTANTS.STATUS.ABORTED;\n  }\n\n  /**\n   * @protected\n   */\n  async _delayBetweenRepetitions() {\n    let self = this;\n    return new Promise((resolve) => {\n      setTimeout(resolve, self._repeatDelay);\n    });\n  }\n}\n","import * as lib from \"../lib/lib.js\";\nimport Section from \"./section.js\";\n\nexport default class FunctionSection extends Section {\n  constructor(inSequence, inFunc) {\n    super(inSequence);\n    if (!lib.is_function(inFunc))\n      this._customError(\n        \"create\",\n        \"The given function needs to be an actual function\"\n      );\n    this._func = inFunc;\n    this._waitUntilFinished = inFunc.constructor.name === \"AsyncFunction\";\n  }\n\n  static niceName = \"Function\";\n\n  /**\n   * @returns {Promise<void>}\n   */\n  async run() {\n    lib.debug(\"Running function\");\n    await this._func();\n  }\n\n  /**\n   * @returns {Promise}\n   * @private\n   */\n  async _execute() {\n    await this.run();\n  }\n}\n","import { is_real_number } from \"../../lib/lib.js\";\nimport { validateAnimation } from \"../../lib/canvas-lib.js\";\nimport * as canvaslib from \"../../lib/canvas-lib.js\";\n\nexport default {\n  /**\n   * Base properties\n   */\n  _animations: null,\n\n  /**\n   * Animates a property on the target of the animation.\n   *\n   * @param {string} inTarget\n   * @param {string} inPropertyName\n   * @param {object} inOptions\n   *      @param {Number} inOptions.from       - a single number from which to animate\n   *      @param {Number} inOptions.to         - a single number to which to animate\n   *      @param {Number} inOptions.duration   - how long in ms the animation should take\n   *      @param {Number} inOptions.delay      - inserts a delay in ms before the animation starts\n   *      @param {String} inOptions.ease       - what type of easing the animation should use\n   *      @param {Boolean} inOptions.gridUnits - if animating width or height, this will set it to work in the scene's grid units\n   *      @param {Boolean} inOptions.screenSpace - if animating position, width, or height, this will set it to work in the screen's dimensions\n   *      @param {Boolean} inOptions.fromEnd   - makes this animation play from the end, like fadeOut, scaleOut, etc\n   *      @param {Boolean} inOptions.absolute  - makes this animation's values override the current value\n   *\n   * @returns this\n   */\n  animateProperty(inTarget, inPropertyName, inOptions = {}) {\n    if (!this._animations) this._animations = [];\n\n    const result = canvaslib.validateAnimation(\n      inTarget,\n      inPropertyName,\n      inOptions\n    );\n\n    if (typeof result === \"string\") {\n      throw this.sequence._customError(this, \"animateProperty\", result);\n    }\n\n    this._animations.push(result);\n\n    return this;\n  },\n\n  /**\n   * Loops a property between a set of values on the target\n   *\n   * @param {string} inTarget\n   * @param {string} inPropertyName\n   * @param {object} inOptions\n   *      @param {Number} inOptions.from         - a single number from which to loop\n   *      @param {Number} inOptions.to           - a single number to which to loop\n   *      @param {Number} inOptions.values       - an array of values to loop between\n   *      @param {Number} inOptions.duration     - how long in ms the loop should take\n   *      @param {Number} inOptions.loops        - how many loops in total this animation should go through - if none are specified, the loop is indefinite\n   *      @param {Number} inOptions.delay        - inserts a delay in ms before the animation starts\n   *      @param {String} inOptions.ease         - what type of easing the animation should use\n   *      @param {Boolean} inOptions.pingPong    - sets whether loop should interpolate to the first value after it reaches the first value, or simply set it to the first value\n   *      @param {Boolean} inOptions.gridUnits   - if animating width or height, this will set it to work in the scene's grid units\n   *      @param {Boolean} inOptions.screenSpace - if animating position, width, or height, this will set it to work in the screen's dimensions\n   *      @param {Boolean} inOptions.absolute    - makes this animation's values override the current value\n   *\n   * @returns this\n   */\n  loopProperty(inTarget, inPropertyName, inOptions = {}) {\n    if (!this._animations) this._animations = [];\n\n    const result = canvaslib.validateLoopingAnimation(\n      inTarget,\n      inPropertyName,\n      inOptions\n    );\n\n    if (typeof result === \"string\") {\n      throw this.sequence._customError(this, \"loopProperty\", result);\n    }\n\n    this._animations.push(result);\n\n    return this;\n  },\n};\n","import { is_real_number } from \"../../lib/lib.js\";\n\nexport default {\n  /**\n   * Base properties\n   */\n  _volume: null,\n  _channel: \"interface\",\n  _fadeInAudio: null,\n  _fadeOutAudio: null,\n\n  /**\n   * Sets the volume of the sound.\n   *\n   * @param {number} inVolume\n   * @returns this\n   */\n  volume(inVolume) {\n    if (!is_real_number(inVolume))\n      throw this.sequence._customError(\n        this,\n        \"volume\",\n        \"inVolume must be of type number\"\n      );\n    this._volume = Math.max(0, Math.min(1.0, inVolume));\n    return this;\n  },\n\n  /**\n   * Causes the animated section to fade in its audio (if any) when played\n   *\n   * @param {number} duration     How long the fade should be\n   * @param {object} [options]    Additional options, such as easing and delay\n   * @returns this\n   */\n  fadeInAudio(duration, options = {}) {\n    if (typeof options !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"fadeInAudio\",\n        \"options must be of type object\"\n      );\n    options = foundry.utils.mergeObject(\n      {\n        ease: \"linear\",\n        delay: 0,\n      },\n      options\n    );\n    if (!is_real_number(duration))\n      throw this.sequence._customError(\n        this,\n        \"fadeInAudio\",\n        \"duration must be of type number\"\n      );\n    if (typeof options.ease !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"fadeInAudio\",\n        \"options.ease must be of type string\"\n      );\n    if (!is_real_number(options.delay))\n      throw this.sequence._customError(\n        this,\n        \"fadeInAudio\",\n        \"options.delay must be of type number\"\n      );\n    this._fadeInAudio = {\n      duration: duration,\n      ease: options.ease,\n      delay: options.delay,\n    };\n    return this;\n  },\n\n  /**\n   * Causes the audio to fade out at the end of the animated section's duration\n   *\n   * @param {number} duration     How long the fade should be\n   * @param {object} [options]    Additional options, such as easing and delay\n   * @returns this\n   */\n  fadeOutAudio(duration, options = {}) {\n    if (typeof options !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"fadeOutAudio\",\n        \"options must be of type object\"\n      );\n    options = foundry.utils.mergeObject(\n      {\n        ease: \"linear\",\n        delay: 0,\n      },\n      options\n    );\n    if (!is_real_number(duration))\n      throw this.sequence._customError(\n        this,\n        \"fadeOutAudio\",\n        \"duration must be of type number\"\n      );\n    if (typeof options.ease !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"fadeOutAudio\",\n        \"ease must be of type string\"\n      );\n    if (!is_real_number(options.delay))\n      throw this.sequence._customError(\n        this,\n        \"fadeOutAudio\",\n        \"delay must be of type number\"\n      );\n    this._fadeOutAudio = {\n      duration: duration,\n      ease: options.ease,\n      delay: options.delay,\n    };\n    return this;\n  },\n};\n","import * as lib from \"../../lib/lib.js\";\nimport { SequencerFileRangeFind } from \"../../modules/sequencer-file.js\";\n\nexport default {\n  /**\n   * Base properties\n   */\n  _file: \"\",\n  _fileOptions: false,\n  _baseFolder: \"\",\n  _mustache: null,\n\n  /**\n   * Defines the base folder that will prepend to the file path. This is mainly just useful to make the file\n   * path easier to manage.\n   *\n   * @param {string} inBaseFolder\n   * @returns this\n   */\n  baseFolder(inBaseFolder) {\n    if (typeof inBaseFolder !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"baseFolder\",\n        \"inBaseFolder must be of type string\"\n      );\n    this._baseFolder = inBaseFolder + (inBaseFolder.endsWith(\"/\") ? \"\" : \"/\");\n    return this;\n  },\n\n  /**\n   * Sets the Mustache of the filepath. This is applied after the randomization of the filepath, if available.\n   *\n   * @param {object} inMustache\n   * @returns this\n   */\n  setMustache(inMustache) {\n    if (typeof inMustache !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"setMustache\",\n        \"inMustache must be of type object\"\n      );\n    this._mustache = inMustache;\n    return this;\n  },\n\n  async _determineFile(inFile) {\n    if (!Array.isArray(inFile) && typeof inFile === \"object\") {\n      return this._validateCustomRange(inFile);\n    }\n\n    if (Array.isArray(inFile))\n      inFile = lib.random_array_element(inFile, { recurse: true });\n\n    inFile = this._applyMustache(inFile);\n\n    if (Sequencer.Database.entryExists(inFile)) {\n      return this._determineDatabaseFile(inFile);\n    }\n\n    const determinedFile = await this._processFile(inFile);\n\n    return { file: determinedFile, forcedIndex: false, customRange: false };\n  },\n\n  async _processFile(inFile) {\n    inFile = this._applyMustache(inFile);\n    inFile = this._applyBaseFolder(inFile);\n    inFile = await this._applyWildcard(inFile);\n    if (Array.isArray(inFile))\n      inFile = lib.random_array_element(inFile, { recurse: true });\n    return inFile;\n  },\n\n  async _validateCustomRange(inFile) {\n    const finalFiles = {};\n    const validRanges = Object.keys(SequencerFileRangeFind.ftToDistanceMap);\n    for (const [range, rangeFile] of Object.entries(inFile)) {\n      if (!validRanges.includes(range)) {\n        throw this.sequence._customError(\n          this,\n          \"file\",\n          `a file-distance key map must only contain the following keys: ${validRanges.join(\n            \", \"\n          )}`\n        );\n      }\n      finalFiles[range] = await this._processFile(rangeFile);\n    }\n\n    return { file: finalFiles, forcedIndex: false, customRange: true };\n  },\n\n  _determineDatabaseFile(inFile) {\n    const entries = Sequencer.Database.getEntry(inFile);\n    const entry = Array.isArray(entries)\n      ? lib.random_array_element(entries)\n      : entries;\n    const match = inFile.match(/(\\d)+$/);\n    return {\n      file: entry,\n      forcedIndex: match ? Number(match[1]) : false,\n      customRange: false,\n    };\n  },\n\n  _applyBaseFolder(inFile) {\n    if (Array.isArray(inFile))\n      return inFile.map((file) => this._applyBaseFolder(file));\n    return inFile.startsWith(this._baseFolder)\n      ? inFile\n      : this._baseFolder + inFile;\n  },\n\n  _applyMustache(inFile) {\n    if (!this._mustache) return inFile;\n    let template = Handlebars.compile(inFile);\n    return template(this._mustache);\n  },\n\n  async _applyWildcard(inFile) {\n    if (!inFile.includes(\"*\")) return inFile;\n    if (Array.isArray(inFile))\n      return inFile.map(async (file) => await this._applyWildcard(file));\n    inFile = this._applyBaseFolder(inFile);\n    return lib.getFiles(inFile, {\n      applyWildCard: true,\n      softFail: this.sequence.softFail,\n    });\n  },\n};\n","import { is_real_number } from \"../../lib/lib.js\";\nimport * as canvaslib from \"../../lib/canvas-lib.js\";\n\nexport default {\n  /**\n   * Base properties\n   */\n  _moveTowards: null,\n  _moveSpeed: null,\n\n  /**\n   * Sets the location to move the target object to\n   *\n   * @param {object|string} inTarget\n   * @param {object} options\n   * @returns this\n   */\n  moveTowards(inTarget, options = {}) {\n    options = foundry.utils.mergeObject(\n      {\n        ease: \"linear\",\n        delay: 0,\n        rotate: true,\n        cacheLocation: false,\n      },\n      options\n    );\n    if (typeof options.ease !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"moveTowards\",\n        \"options.ease must be of type string\"\n      );\n    if (!is_real_number(options.delay))\n      throw this.sequence._customError(\n        this,\n        \"moveTowards\",\n        \"options.delay must be of type number\"\n      );\n    if (typeof options.rotate !== \"boolean\")\n      throw this.sequence._customError(\n        this,\n        \"moveTowards\",\n        \"options.rotate must be of type boolean\"\n      );\n    if (typeof options.cacheLocation !== \"boolean\")\n      throw this.sequence._customError(\n        this,\n        \"moveTowards\",\n        \"options.cacheLocation must be of type boolean\"\n      );\n    options.target = this._validateLocation(inTarget);\n    if (!options.target)\n      throw this.sequence._customError(\n        this,\n        \"moveTowards\",\n        \"could not find position of given object\"\n      );\n    options.target = options.cacheLocation\n      ? canvaslib.get_object_position(options.cacheLocation, { measure: true })\n      : options.target;\n    this._moveTowards = options;\n    return this;\n  },\n\n  /**\n   * Sets the speed (pixels per frame) to move the target object\n   *\n   * @param {number} inSpeed\n   * @returns this\n   */\n  moveSpeed(inSpeed) {\n    if (!is_real_number(inSpeed))\n      throw this.sequence._customError(\n        this,\n        \"moveSpeed\",\n        \"inSpeed must be of type number\"\n      );\n    this._moveSpeed = inSpeed;\n    return this;\n  },\n};\n","import { is_real_number } from \"../../lib/lib.js\";\n\nexport default {\n  /**\n   * Base properties\n   */\n  _opacity: null,\n  _fadeIn: null,\n  _fadeOut: null,\n\n  /**\n   * Sets the opacity of the effect. If used with ._fadeIn() and/or ._fadeOut(), this defines what the effect will fade to/from\n   *\n   * @param {number} inOpacity\n   * @returns this\n   */\n  opacity(inOpacity) {\n    if (!is_real_number(inOpacity))\n      throw this.sequence._customError(\n        this,\n        \"opacity\",\n        \"inOpacity must be of type number\"\n      );\n    this._opacity = inOpacity;\n    return this;\n  },\n\n  /**\n   * Causes the effect to fade in when played\n   *\n   * @param {number} duration     How long the fade should be\n   * @param {object} [options]    Additional options, such as easing and delay\n   * @returns this\n   */\n  fadeIn(duration, options = {}) {\n    if (typeof options !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"fadeIn\",\n        \"options must be of type object\"\n      );\n    options = foundry.utils.mergeObject(\n      {\n        ease: \"linear\",\n        delay: 0,\n      },\n      options\n    );\n    if (!is_real_number(duration))\n      throw this.sequence._customError(\n        this,\n        \"fadeIn\",\n        \"duration must be of type number\"\n      );\n    if (typeof options.ease !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"fadeIn\",\n        \"options.ease must be of type string\"\n      );\n    if (!is_real_number(options.delay))\n      throw this.sequence._customError(\n        this,\n        \"fadeIn\",\n        \"options.delay must be of type number\"\n      );\n    this._fadeIn = {\n      duration: duration,\n      ease: options.ease,\n      delay: options.delay,\n    };\n    return this;\n  },\n\n  /**\n   * Causes the effect to fade out at the end of the effect's duration\n   *\n   * @param {number} duration     How long the fade should be\n   * @param {object} [options]    Additional options, such as easing and delay\n   * @returns this\n   */\n  fadeOut(duration, options = {}) {\n    if (typeof options !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"fadeOut\",\n        \"options must be of type object\"\n      );\n    options = foundry.utils.mergeObject(\n      {\n        ease: \"linear\",\n        delay: 0,\n      },\n      options\n    );\n    if (!is_real_number(duration))\n      throw this.sequence._customError(\n        this,\n        \"fadeOut\",\n        \"duration must be of type number\"\n      );\n    if (typeof options.ease !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"fadeOut\",\n        \"ease must be of type string\"\n      );\n    if (!is_real_number(options.delay))\n      throw this.sequence._customError(\n        this,\n        \"fadeOut\",\n        \"delay must be of type number\"\n      );\n    this._fadeOut = {\n      duration: duration,\n      ease: options.ease,\n      delay: options.delay,\n    };\n    return this;\n  },\n};\n","import { is_real_number } from \"../../lib/lib.js\";\n\nexport default {\n  /**\n   * Base properties\n   */\n  _angle: null,\n  _rotateIn: null,\n  _rotateOut: null,\n  _randomRotation: null,\n  _rotateTowards: null,\n\n  /**\n   * The object gets a random rotation, which means it should not be used with .stretchTo()\n   *\n   * @param {boolean} [inBool=true] inBool\n   * @returns this\n   */\n  randomRotation(inBool = true) {\n    if (typeof inBool !== \"boolean\")\n      throw this.sequence._customError(\n        this,\n        \"randomRotation\",\n        \"inBool must be of type boolean\"\n      );\n    this._randomRotation = inBool;\n    return this;\n  },\n\n  /**\n   * Sets the rotation of the object, which is added on top of the calculated rotation after .rotateTowards() or .randomRotation()\n   *\n   * @param {number} inRotation\n   * @returns this\n   */\n  rotate(inRotation) {\n    if (!is_real_number(inRotation))\n      throw this.sequence._customError(\n        this,\n        \"opacity\",\n        \"inRotation must be of type number\"\n      );\n    this._angle = inRotation;\n    return this;\n  },\n\n  /**\n   *  Causes the object to rotate when it starts playing\n   *\n   * @param {number} degrees\n   * @param {number} duration\n   * @param {object} [options] options\n   * @returns this\n   */\n  rotateIn(degrees, duration, options = {}) {\n    if (typeof options !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"rotateIn\",\n        \"options must be of type object\"\n      );\n    options = foundry.utils.mergeObject(\n      {\n        ease: \"linear\",\n        delay: 0,\n      },\n      options\n    );\n    if (!is_real_number(degrees))\n      throw this.sequence._customError(\n        this,\n        \"rotateOut\",\n        \"degrees must be of type number\"\n      );\n    if (!is_real_number(duration))\n      throw this.sequence._customError(\n        this,\n        \"rotateOut\",\n        \"duration must be of type number\"\n      );\n    if (typeof options.ease !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"rotateIn\",\n        \"options.ease must be of type string\"\n      );\n    if (!is_real_number(options.delay))\n      throw this.sequence._customError(\n        this,\n        \"rotateIn\",\n        \"options.delay must be of type number\"\n      );\n    this._rotateIn = {\n      value: degrees,\n      duration: duration,\n      ease: options.ease,\n      delay: options.delay,\n    };\n    return this;\n  },\n\n  /**\n   *  Causes the object to rotate at the end of the effect's duration\n   *\n   * @param {number} degrees\n   * @param {number} duration\n   * @param {object} [options] options\n   * @returns this\n   */\n  rotateOut(degrees, duration, options = {}) {\n    if (typeof options !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"rotateOut\",\n        \"options must be of type object\"\n      );\n    options = foundry.utils.mergeObject(\n      {\n        ease: \"linear\",\n        delay: 0,\n      },\n      options\n    );\n    if (!is_real_number(degrees))\n      throw this.sequence._customError(\n        this,\n        \"rotateOut\",\n        \"degrees must be of type number\"\n      );\n    if (!is_real_number(duration))\n      throw this.sequence._customError(\n        this,\n        \"rotateOut\",\n        \"duration must be of type number\"\n      );\n    if (typeof options.ease !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"rotateOut\",\n        \"options.ease must be of type string\"\n      );\n    if (!is_real_number(options.delay))\n      throw this.sequence._customError(\n        this,\n        \"rotateOut\",\n        \"options.delay must be of type number\"\n      );\n    this._rotateOut = {\n      value: degrees,\n      duration: duration,\n      ease: options.ease,\n      delay: options.delay,\n    };\n    return this;\n  },\n};\n","import { is_real_number } from \"../../lib/lib.js\";\n\nexport default {\n  _scaleMin: null,\n  _scaleMax: null,\n  _scaleIn: null,\n  _scaleOut: null,\n\n  /**\n   *  A method that can take the following:\n   *  - A number to set the scale uniformly\n   *  - An object with x and y for non-uniform scaling\n   *  - Two numbers which the Sequencer will randomly pick a uniform scale between\n   *\n   * @param {number|object} inScaleMin\n   * @param {number} [inScaleMax] inScaleMax\n   * @returns this\n   */\n  scale(inScaleMin, inScaleMax) {\n    if (!is_real_number(inScaleMin) && typeof inScaleMin !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"scale\",\n        \"inScale must be of type number or object\"\n      );\n    if (is_real_number(inScaleMin)) {\n      if (inScaleMax && !is_real_number(inScaleMax)) {\n        throw this.sequence._customError(\n          this,\n          \"scale\",\n          \"if inScaleMin is a number, inScaleMax must also be of type number\"\n        );\n      }\n    }\n    this._scaleMin = inScaleMin;\n    this._scaleMax = inScaleMax ?? false;\n    return this;\n  },\n\n  /**\n   *  Causes the effect to scale when it starts playing\n   *\n   * @param {number|object} scale\n   * @param {number} duration\n   * @param {object} [options] options\n   * @returns this\n   */\n  scaleIn(scale, duration, options = {}) {\n    if (typeof options !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"scaleIn\",\n        \"options must be of type object\"\n      );\n    options = foundry.utils.mergeObject(\n      {\n        ease: \"linear\",\n        delay: 0,\n      },\n      options\n    );\n    if (!is_real_number(duration))\n      throw this.sequence._customError(\n        this,\n        \"scaleIn\",\n        \"duration must be of type number\"\n      );\n    if (!is_real_number(scale) && typeof scale !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"scaleIn\",\n        \"scale must be of type number or object\"\n      );\n    if (typeof options.ease !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"scaleIn\",\n        \"options.ease must be of type string\"\n      );\n    if (!is_real_number(options.delay))\n      throw this.sequence._customError(\n        this,\n        \"scaleIn\",\n        \"options.delay must be of type number\"\n      );\n    this._scaleIn = {\n      value: scale,\n      duration: duration,\n      ease: options.ease,\n      delay: options.delay,\n    };\n    return this;\n  },\n\n  /**\n   *  Causes the effect to scale at the end of the effect's duration\n   *\n   * @param {number|object} scale\n   * @param {number} duration\n   * @param {object} [options] options\n   * @returns this\n   */\n  scaleOut(scale, duration, options = {}) {\n    if (typeof options !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"scaleOut\",\n        \"options must be of type object\"\n      );\n    options = foundry.utils.mergeObject(\n      {\n        ease: \"linear\",\n        delay: 0,\n      },\n      options\n    );\n    if (!is_real_number(duration))\n      throw this.sequence._customError(\n        this,\n        \"scaleOut\",\n        \"duration must be of type number\"\n      );\n    if (!is_real_number(scale) && typeof scale !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"scaleOut\",\n        \"scale must be of type number or object\"\n      );\n    if (typeof options.ease !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"scaleOut\",\n        \"options.ease must be of type string\"\n      );\n    if (!is_real_number(options.delay))\n      throw this.sequence._customError(\n        this,\n        \"scaleOut\",\n        \"options.delay must be of type number\"\n      );\n    this._scaleOut = {\n      value: scale,\n      duration: duration,\n      ease: options.ease,\n      delay: options.delay,\n    };\n    return this;\n  },\n};\n","import { is_real_number } from \"../../lib/lib.js\";\n\nexport default {\n  _hasTime: true,\n  _isRange: false,\n  _startTime: null,\n  _startPerc: null,\n  _endTime: null,\n  _endPerc: null,\n\n  /**\n   * Sets the start and end time of the section, playing only that range\n   *\n   * @param {number} inMsStart\n   * @param {number} inMsEnd\n   * @returns this\n   */\n  timeRange(inMsStart, inMsEnd) {\n    if (!is_real_number(inMsStart))\n      throw this.sequence._customError(\n        this,\n        \"timeRange\",\n        \"inMsStart must be of type number\"\n      );\n    if (!is_real_number(inMsEnd))\n      throw this.sequence._customError(\n        this,\n        \"timeRange\",\n        \"inMsEnd must be of type number\"\n      );\n    this._startTime = inMsStart;\n    this._endTime = inMsEnd;\n    this._isRange = true;\n    return this;\n  },\n\n  /**\n   * Sets the start time of the section.\n   *\n   * @param {number} inMs\n   * @returns this\n   */\n  startTime(inMs) {\n    if (!is_real_number(inMs))\n      throw this.sequence._customError(\n        this,\n        \"startTime\",\n        \"inMs must be of type number\"\n      );\n    this._startTime = inMs;\n    this._startPerc = false;\n    this._isRange = false;\n    return this;\n  },\n\n  /**\n   * Sets the start time of the section based on a percentage from its total duration.\n   *\n   * @param {number} inPercentage\n   * @returns this\n   */\n  startTimePerc(inPercentage) {\n    if (!is_real_number(inPercentage))\n      throw this.sequence._customError(\n        this,\n        \"startTimePerc\",\n        \"inPercentage must be of type number\"\n      );\n    this._startTime = inPercentage;\n    this._startPerc = true;\n    this._isRange = false;\n    return this;\n  },\n\n  /**\n   * Sets the ending time of the section (from the end).\n   *\n   * @param {number} inMs\n   * @returns this\n   */\n  endTime(inMs) {\n    if (!is_real_number(inMs))\n      throw this.sequence._customError(\n        this,\n        \"endTime\",\n        \"inMs must be of type number\"\n      );\n    this._endTime = inMs;\n    this._endPerc = false;\n    this._isRange = false;\n    return this;\n  },\n\n  /**\n   * Sets the ending time of the section based on a percentage from the total duration.\n   *\n   * @param {number} inPercentage\n   * @returns this\n   */\n  endTimePerc(inPercentage) {\n    if (!is_real_number(inPercentage))\n      throw this.sequence._customError(\n        this,\n        \"endTimePerc\",\n        \"inPercentage must be of type number\"\n      );\n    this._endTime = inPercentage;\n    this._endPerc = true;\n    this._isRange = false;\n    return this;\n  },\n};\n","export default {\n  _users: null,\n\n  _addUser(inUser) {\n    if (!this._users) this._users = [];\n    if (typeof inUser !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"_addUser\",\n        \"inUser must be of type string\"\n      );\n    if (!game.users.has(inUser)) {\n      if (game.users.getName(inUser)) {\n        inUser = game.users.getName(inUser).id;\n      } else {\n        throw this.sequence._customError(\n          this,\n          \"_addUser\",\n          `user with id or name \"${inUser}\" does not exist!`\n        );\n      }\n    }\n\n    if (!this._users.includes(inUser)) this._users.push(inUser);\n  },\n\n  _deleteUser(inUser) {\n    if (!this._users) this._users = [];\n    if (this._users.includes(inUser)) {\n      let index = this._users.indexOf(inUser);\n      this._users.splice(index, 1);\n    }\n  },\n\n  /**\n   * Causes section to be executed only locally, and not push to other connected clients.\n   *\n   * @param {boolean} inLocally\n   * @returns this\n   */\n  locally(inLocally = true) {\n    if (inLocally) this._addUser(game.userId);\n    else this._deleteUser(game.userId);\n    return this;\n  },\n\n  /**\n   * Causes the section to be executed for only a set of users.\n   *\n   * @param {string|User|array<string|User>} inUsers\n   * @returns this\n   */\n  forUsers(inUsers) {\n    if (!Array.isArray(inUsers)) {\n      if (typeof inUsers !== \"string\")\n        throw this.sequence._customError(\n          this,\n          \"forUsers\",\n          \"inUser must be of type string\"\n        );\n      inUsers = [inUsers];\n    }\n    inUsers.forEach((u) => this._addUser(u));\n    return this;\n  },\n};\n","import filters from \"../../lib/filters.js\";\n\nexport default {\n  _filters: null,\n\n  _addFilter(inFilterName, inData, inName = false) {\n    if (!this._filters) this._filters = [];\n    this._filters.push({\n      className: inFilterName,\n      name: inName,\n      data: inData,\n    });\n  },\n\n  _testFilter(inFilterName, inData) {\n    let filter = new filters[inFilterName](inData);\n    if (!filter.isValid)\n      throw this.sequence._customError(\n        this,\n        \"filter\",\n        `Could not create ${inFilterName} filter - data is malformed!`\n      );\n  },\n\n  filter(inFilterName, inData = {}, inName = \"\") {\n    if (typeof inFilterName !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"filter\",\n        `inFilterName must be of type string`\n      );\n    if (!Object.keys(filters).includes(inFilterName))\n      throw this.sequence._customError(\n        this,\n        \"filter\",\n        `\"${inFilterName}\" does not exist`\n      );\n    this._testFilter(inFilterName, inData);\n    this._addFilter(inFilterName, inData, inName);\n    return this;\n  },\n};\n","import * as lib from \"../../lib/lib.js\";\nimport { is_real_number } from \"../../lib/lib.js\";\n\nexport default {\n  _tint: null,\n\n  /**\n   * Tints the target of this section by the color given to the\n   *\n   * @param {number|string} inColor\n   * @returns this\n   */\n  tint(inColor) {\n    if (!is_real_number(inColor) && typeof inColor !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"tint\",\n        `inColor must be of type string (hexadecimal) or number (decimal)!`\n      );\n    this._tint = lib.parseColor(inColor);\n    return this;\n  },\n};\n","import * as lib from \"../../lib/lib.js\";\nimport * as canvaslib from \"../../lib/canvas-lib.js\";\n\nexport default {\n  /**\n   * Base properties\n   */\n  _source: null,\n\t_offset: null,\n\t_randomOffset: null,\n\n  /**\n   *  A smart method that can take a reference to an object, or a direct on the canvas to play the effect at,\n   *  or a string reference (see .name())\n   *\n   * @param {Object|String} inLocation\n   * @param {Object} inOptions\n   * @returns {EffectSection}\n   */\n  atLocation(inLocation, inOptions = {}) {\n    if (!inLocation || !(typeof inLocation === \"object\" || typeof inLocation === \"string\")) {\n      throw this.sequence._customError(\n        this,\n        \"atLocation\",\n        `inLocation is invalid, and must be of type of object, string, placeable object, or document`\n      );\n    }\n    if (typeof inOptions !== \"object\")\n      throw this.sequence._customError(\n        this,\n        \"atLocation\",\n        `inOptions must be of type object`\n      );\n    inOptions = foundry.utils.mergeObject(\n      {\n        cacheLocation: false,\n        offset: false,\n        randomOffset: false,\n        gridUnits: false,\n        local: false,\n      },\n      inOptions\n    );\n    inLocation = this._validateLocation(inLocation);\n    if (inLocation === undefined)\n      throw this.sequence._customError(\n        this,\n        \"atLocation\",\n        \"could not find position of given object\"\n      );\n    if (typeof inOptions.cacheLocation !== \"boolean\")\n      throw this.sequence._customError(\n        this,\n        \"atLocation\",\n        \"inOptions.cacheLocation must be of type boolean\"\n      );\n    if (\n      !(\n        typeof inOptions.randomOffset === \"boolean\" ||\n        lib.is_real_number(inOptions.randomOffset)\n      )\n    )\n      throw this.sequence._customError(\n        this,\n        \"atLocation\",\n        \"inOptions.randomOffset must be of type boolean or number\"\n      );\n\n    if (inOptions.offset) {\n      const offsetData = this._validateOffset(\n        \"atLocation\",\n        inOptions.offset,\n        inOptions\n      );\n      this._offset = {\n        source: offsetData,\n        target: this._offset?.target ?? false,\n      };\n    }\n\n    this._randomOffset = {\n      source: inOptions.randomOffset,\n      target: this._randomOffset?.target ?? false,\n    };\n\n    this._source =\n      inOptions.cacheLocation && typeof inLocation !== \"string\"\n        ? canvaslib.get_object_canvas_data(inLocation, { uuid: false })\n        : inLocation;\n    return this;\n  },\n};\n","import * as lib from \"../../lib/lib.js\";\n\nexport default {\n  _offset: null,\n  _randomOffset: null,\n\n  _validateOffset(functionName, inOffset, inOptions = {}) {\n    inOffset = foundry.utils.mergeObject(\n      {\n        x: 0,\n        y: 0,\n      },\n      inOffset\n    );\n    inOptions = foundry.utils.mergeObject(\n      {\n        gridUnits: false,\n        local: false,\n      },\n      inOptions\n    );\n    if (typeof inOptions.gridUnits !== \"boolean\")\n      throw this.sequence._customError(\n        this,\n        functionName,\n        \"inOptions.gridUnits must be of type boolean\"\n      );\n    if (typeof inOptions.local !== \"boolean\")\n      throw this.sequence._customError(\n        this,\n        functionName,\n        \"inOptions.local must be of type boolean\"\n      );\n    if (!lib.is_real_number(inOffset.x))\n      throw this.sequence._customError(\n        this,\n        functionName,\n        `inOffset.x must be of type number!`\n      );\n    if (!lib.is_real_number(inOffset.y))\n      throw this.sequence._customError(\n        this,\n        functionName,\n        `inOffset.y must be of type number!`\n      );\n    return {\n      ...inOffset,\n      ...inOptions,\n    };\n  },\n};\n","export default {\n  _text: null,\n\n  /**\n   *  Creates a text element, attached to the sprite. The options for the text are available here:\n   *  https://pixijs.io/pixi-text-style/\n   *\n   * @param {String} inText\n   * @param {Object} inOptions\n   * @returns {EffectSection}\n   */\n  text(inText, inOptions = {}) {\n    if (typeof inText !== \"string\")\n      throw this.sequence._customError(\n        this,\n        \"text\",\n        \"inText must be of type string\"\n      );\n    this._text = foundry.utils.mergeObject(\n      {\n        text: inText,\n      },\n      inOptions\n    );\n    return this;\n  },\n};\n","import * as lib from \"../../lib/lib.js\";\r\n\r\nexport default {\r\n\r\n  _name: null,\r\n  _origin: null,\r\n\r\n  /**\r\n   * Causes the effect or sound to be named, which affects them differently. In the case of effects, names can be used\r\n   * in the place of \r\n   *\r\n   * @param {String} inName\r\n   * @returns {EffectSection}\r\n   */\r\n  name(inName) {\r\n    if (typeof inName !== \"string\")\r\n      throw this.sequence._customError(\r\n        this,\r\n        \"name\",\r\n        \"inName must be of type string\"\r\n      );\r\n    this._name = lib.safe_str(inName);\r\n    return this;\r\n  },\r\n\r\n  /**\r\n   *  This is for adding extra information to an sound, like the origin of the sound in the form of the item's uuid.\r\n   *  The method accepts a string or a Document that has an UUID.\r\n   *\r\n   * @param {string|document} inOrigin\r\n   * @returns {Section}\r\n   */\r\n  origin(inOrigin) {\r\n    inOrigin = lib.validate_document(inOrigin);\r\n    if (inOrigin instanceof foundry.abstract.Document) {\r\n      inOrigin = inOrigin?.uuid;\r\n      if (!inOrigin)\r\n        throw this.sequence._customError(\r\n          this,\r\n          \"origin\",\r\n          \"could not find the UUID for the given Document\"\r\n        );\r\n    }\r\n    if (typeof inOrigin !== \"string\")\r\n      throw this.sequence._customError(\r\n        this,\r\n        \"origin\",\r\n        \"inOrigin must be of type string\"\r\n      );\r\n    this._origin = inOrigin;\r\n    return this;\r\n  }\r\n\r\n}\r\n","import animation from \"./animation.js\";\nimport audio from \"./audio.js\";\nimport files from \"./files.js\";\nimport moves from \"./moves.js\";\nimport opacity from \"./opacity.js\";\nimport rotation from \"./rotation.js\";\nimport scale from \"./scale.js\";\nimport time from \"./time.js\";\nimport users from \"./users.js\";\nimport filter from \"./filter.js\";\nimport tint from \"./tint.js\";\nimport location from \"./location.js\";\nimport offset from \"./offset.js\";\nimport text from \"./text.js\";\nimport name from \"./name.js\";\n\nexport default {\n  animation,\n  audio,\n  files,\n  moves,\n  opacity,\n  rotation,\n  scale,\n  time,\n  users,\n  filter,\n  tint,\n  location,\n  offset,\n  text,\n  name\n};\n","import CrosshairsPlaceable from \"./CrosshairsPlaceable.js\";\r\nimport { get_object_canvas_data } from \"../../lib/canvas-lib.js\";\r\nimport CONSTANTS from \"../../constants.js\";\r\nimport FoundryShim from \"../../utils/foundry-shim.js\";\r\n\r\n/**\r\n *\r\n *\r\n * @class CrosshairsDocument\r\n * @mixes ClientDocumentMixin\r\n *\r\n */\r\nexport default class CrosshairsDocument extends MeasuredTemplateDocument {\r\n\r\n\tconstructor(config = {}, context = {}, crosshair = {}, callbacks = {}) {\r\n\t\t// rectangles start off as a horizontal/vertical unseen line without this initial rotation\r\n\t\tif (config.t === CONST.MEASURED_TEMPLATE_TYPES.RECTANGLE && !(config.direction % 90)) {\r\n\t\t\tconfig.direction = 45;\r\n\t\t}\r\n\t\tsuper(config, context);\r\n\t\tthis.crosshair = foundry.utils.mergeObject(CrosshairsDocument.defaultConfig, crosshair);\r\n\t\tthis.callbacks = callbacks;\r\n\t\tthis.originalConfig = foundry.utils.deepClone(config);\r\n\t}\r\n\r\n\tcrosshair = {};\r\n\t#layer = null;\r\n\tcachedPosition = null;\r\n\toriginalConfig = {};\r\n\r\n\tstatic get placeableClass() {\r\n\t\treturn CrosshairsPlaceable;\r\n\t}\r\n\r\n\tstatic get defaultConfig() {\r\n\t\treturn {\r\n\t\t\tborderAlpha: 0.75,\r\n\t\t\tfillAlpha: 0.25,\r\n\t\t\ttextureAlpha: 0.5,\r\n\t\t\ttextureScale: 1.0,\r\n\t\t\tgridHighlight: true,\r\n\t\t\ticon: {\r\n\t\t\t\ttexture: \"\",\r\n\t\t\t\tborderVisible: false\r\n\t\t\t},\r\n\t\t\tsnap: {\r\n\t\t\t\tposition: CONST.GRID_SNAPPING_MODES.CENTER,\r\n\t\t\t\tsize: CONST.GRID_SNAPPING_MODES.CENTER,\r\n\t\t\t\tresolution: 1,\r\n\t\t\t\tdirection: 0\r\n\t\t\t},\r\n\t\t\tlockDrag: true,\r\n\t\t\tdistanceMin: null,\r\n\t\t\tdistanceMax: null,\r\n\t\t\tlabel: {\r\n\t\t\t\ttext: \"\",\r\n\t\t\t\tdx: 0,\r\n\t\t\t\tdy: 0,\r\n\t\t\t},\r\n\t\t\tlocation: {\r\n\t\t\t\tobj: null,\r\n\t\t\t\tlimitMinRange: null,\r\n\t\t\t\tlimitMaxRange: null,\r\n\t\t\t\tshowRange: false,\r\n\t\t\t\tdisplayRangePoly: false,\r\n\t\t\t\trangePolyFillColor: null,\r\n\t\t\t\trangePolyLineColor: null,\r\n\t\t\t\trangePolyFillAlpha: null,\r\n\t\t\t\trangePolyLineAlpha: null,\r\n\t\t\t\tlockToEdge: false,\r\n\t\t\t\tlockToEdgeDirection: false,\r\n\t\t\t\toffset: { x: 0, y: 0 },\r\n\t\t\t\twallBehavior: CONSTANTS.PLACEMENT_RESTRICTIONS.ANYWHERE\r\n\t\t\t},\r\n\t\t\tlockManualRotation: false\r\n\t\t};\r\n\t};\r\n\r\n\tgetOrientation() {\r\n\t\tthis.cachedPosition = (!this.object || this.object?.destroyed) ? this.cachedPosition : {\r\n\t\t\tsource: get_object_canvas_data(this.object, { uuid: false }),\r\n\t\t\ttarget: this.t === CONST.MEASURED_TEMPLATE_TYPES.CONE || this.t === CONST.MEASURED_TEMPLATE_TYPES.RAY\r\n\t\t\t\t? get_object_canvas_data(this.object, { measure: true, uuid: false })\r\n\t\t\t\t: null\r\n\t\t};\r\n\t\treturn this.cachedPosition;\r\n\t}\r\n\r\n\tget documentName() {\r\n\t\treturn 'CrosshairsDocument';\r\n\t}\r\n\r\n\tget layer() {\r\n\t\tif (this.#layer) return this.#layer;\r\n\t\tconst create = (doc) => new this.constructor.placeableClass(doc);\r\n\t\tconst sink = {\r\n\t\t\tget(target, prop) {\r\n\t\t\t\tswitch (prop) {\r\n\t\t\t\t\tcase 'createObject':\r\n\t\t\t\t\t\treturn create;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treturn target[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.#layer = new Proxy(canvas.activeLayer, sink);\r\n\t\treturn this.#layer;\r\n\t}\r\n\r\n\tget isEmbedded() {\r\n\t\treturn !!this.parent;\r\n\t}\r\n\r\n\tgetCrosshairShape(){\r\n\t\tconst {t, distance, direction, angle, width} = this;\r\n\t\tswitch ( t ) {\r\n\t\t\tcase \"circle\":\r\n\t\t\t\treturn FoundryShim.MeasuredTemplate.getCircleShape(distance);\r\n\t\t\tcase \"cone\":\r\n\t\t\t\treturn FoundryShim.MeasuredTemplate.getConeShape(distance, direction, angle);\r\n\t\t\tcase \"rect\":\r\n\t\t\t\treturn FoundryShim.MeasuredTemplate.getRectShape(distance, direction);\r\n\t\t\tcase \"ray\":\r\n\t\t\t\treturn FoundryShim.MeasuredTemplate.getRayShape(distance, direction, width);\r\n\t\t}\r\n\t}\r\n\r\n\ttoken = {};\r\n\r\n\tprepareDerivedData() {\r\n\t\tsuper.prepareDerivedData();\r\n\t\tconst gridUnits = this.distance / this.parent.grid.distance;\r\n\t\tthis.radius = gridUnits * this.parent.grid.size;\r\n\t\tthis.token = {};\r\n\t\tthis.token.width = gridUnits * 2;\r\n\t\tthis.token.height = gridUnits * 2;\r\n\t\tswitch (this.t) {\r\n\t\t\tcase 'rect':\r\n\t\t\t\tthis.token.x = this.x;\r\n\t\t\t\tthis.token.y = this.y;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'circle':\r\n\t\t\tdefault:\r\n\t\t\t\tthis.token.x = this.x - this.radius;\r\n\t\t\t\tthis.token.y = this.y - this.radius;\r\n\t\t}\r\n\t}\r\n\r\n\tshow() {\r\n\t\tthis._destroyed = false;\r\n\t\tthis.#layer = null;\r\n\t\treturn this.object.show();\r\n\t}\r\n\r\n}\r\n","import * as lib from \"../lib/lib.js\";\nimport { is_real_number } from \"../lib/lib.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport Section from \"./section.js\";\nimport traits from \"./traits/_traits.js\";\nimport CanvasEffect from \"../canvas-effects/canvas-effect.js\";\nimport flagManager from \"../utils/flag-manager.js\";\nimport SequencerFileCache from \"../modules/sequencer-file-cache.js\";\nimport CONSTANTS from \"../constants.js\";\nimport CrosshairsPlaceable from \"../modules/sequencer-crosshair/CrosshairsPlaceable.js\";\nimport CrosshairsDocument from \"../modules/sequencer-crosshair/CrosshairsDocument.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\n\nexport default class EffectSection extends Section {\n\tconstructor(inSequence, inFile = \"\") {\n\t\tsuper(inSequence);\n\t\tthis._deserializedData = null;\n\t\tthis._file = inFile;\n\t\tthis._text = null;\n\t\tthis._source = null;\n\t\tthis._stretchTo = null;\n\t\tthis._attachTo = null;\n\t\tthis._copySprite = null;\n\t\tthis._anchor = null;\n\t\tthis._spriteAnchor = null;\n\t\tthis._randomOffset = null;\n\t\tthis._missed = null;\n\t\tthis._private = null;\n\t\tthis._randomMirrorX = null;\n\t\tthis._randomMirrorY = null;\n\t\tthis._mirrorX = null;\n\t\tthis._mirrorY = null;\n\t\tthis._playbackRate = null;\n\t\tthis._template = null;\n\t\tthis._overrides = [];\n\t\tthis._zIndex = null;\n\t\tthis._offset = null;\n\t\tthis._spriteOffset = null;\n\t\tthis._size = null;\n\t\tthis._syncGroup = null;\n\t\tthis._persist = null;\n\t\tthis._persistOptions = null;\n\t\tthis._zeroSpriteRotation = null;\n\t\tthis._extraEndDuration = null;\n\t\tthis._loopOptions = null;\n\t\tthis._tilingTexture = null;\n\t\tthis._snapToGrid = null;\n\t\tthis._scaleToObject = null;\n\t\tthis._screenSpace = null;\n\t\tthis._screenSpaceAboveUI = null;\n\t\tthis._screenSpaceAnchor = null;\n\t\tthis._screenSpacePosition = null;\n\t\tthis._screenSpaceScale = null;\n\t\tthis._elevation = null;\n\t\tthis._sortLayer = 800;\n\t\tthis._masks = [];\n\t\tthis._tiedDocuments = [];\n\t\tthis._selfMask = false;\n\t\tthis._temporaryEffect = false;\n\t\tthis._spriteRotation = 0;\n\t\tthis._randomSpriteRotation = false;\n\t\tthis._isRangedEffect = null;\n\t\tthis._offsetLegacy = null;\n\t\tthis._randomOffsetLegacy = null;\n\t\tthis._aboveLighting = null;\n\t\tthis._aboveInterface = null;\n\t\tthis._spriteScaleMin = 1.0;\n\t\tthis._spriteScaleMax = null;\n\t\tthis._isometric = null;\n\t\tthis._shapes = [];\n\t\tthis._xray = null;\n\t\tthis._playEffect = true;\n\t}\n\n\tstatic niceName = \"Effect\";\n\n\t/**\n\t * @private\n\t */\n\tget _target() {\n\t\treturn this._stretchTo || this._rotateTowards || this._moveTowards || false;\n\t}\n\n\tstatic debounceWarning() {\n\t\tlib.custom_warning(\n\t\t\t\"Sequencer\",\n\t\t\t\"Effect | This user does not have permissions to play effects. This can be configured in Sequencer's module settings.\"\n\t\t);\n\t}\n\n\t/**\n\t * Causes the effect to persist indefinitely on the canvas until _ended via SequencerEffectManager.endAllEffects() or\n\t * name the effect with .name() and then end it through SequencerEffectManager.endEffect()\n\t *\n\t * @param {Boolean} [inBool=true] inBool\n\t * @param {Object} [inOptions={}] inOptions\n\t * @returns {EffectSection}\n\t */\n\tpersist(inBool = true, inOptions = {}) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"persist\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"persist\",\n\t\t\t\t`inOptions must be of type object`\n\t\t\t);\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tid: foundry.utils.randomID(),\n\t\t\t\tpersistTokenPrototype: false\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\t\tif (typeof inOptions.persistTokenPrototype !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"persist\",\n\t\t\t\t\"inOptions.persistTokenPrototype must be of type boolean\"\n\t\t\t);\n\t\tthis._persist = inBool;\n\t\tthis._persistOptions = inOptions;\n\t\treturn this;\n\t}\n\n\tsyncGroup(inString) {\n\t\tif (typeof inString !== \"string\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"syncGroup\",\n\t\t\t\t\"inString must be of type string\"\n\t\t\t);\n\t\tthis._syncGroup = inString;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to become temporary, which means it will not be stored in the flags of any object,\n\t * even if it .persist() is called\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\ttemporary(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"temporary\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._temporaryEffect = inBool || this._temporaryEffect;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the effect's playback rate. A playback rate of 2.0 would make it play 2x as fast, 0.5 would make\n\t * it play half as fast.\n\t *\n\t * @param {Number} inNumber\n\t * @returns {EffectSection}\n\t */\n\tplaybackRate(inNumber = 1.0) {\n\t\tif (!lib.is_real_number(inNumber))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"playbackRate\",\n\t\t\t\t\"inNumber must be of type number\"\n\t\t\t);\n\t\tthis._playbackRate = inNumber;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to target a location close to the .stretchTowards() location, but not on it.\n\t *\n\t * @param {Boolean} [inBool=true] inBool\n\t * @returns {EffectSection}\n\t */\n\tmissed(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"missed\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._missed = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a function that will run at the end of the effect serialization step, but before it is played. Allows direct\n\t * modifications of effect's data. For example, it could be manipulated to change which file will be used based\n\t * on the distance to the target.\n\t *\n\t * @param {Function} inFunc\n\t * @returns {EffectSection}\n\t */\n\taddOverride(inFunc) {\n\t\tif (!lib.is_function(inFunc))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"addOverride\",\n\t\t\t\t\"The given function needs to be an actual function.\"\n\t\t\t);\n\t\tthis._overrides.push(inFunc);\n\t\treturn this;\n\t}\n\n\t/**\n\t *  A smart method that can take a reference to an object, or a direct on the canvas to attach an effect to,\n\t *  or a string reference (see .name())\n\t *\n\t * @param {Object|String} inObject\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\tattachTo(inObject, inOptions = {}) {\n\t\tif (!inObject || !(typeof inObject === \"object\" || typeof inObject === \"string\")) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t`inObject is invalid, and must be of type of object, string, placeable object, or document`\n\t\t\t);\n\t\t}\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t`inOptions must be of type object`\n\t\t\t);\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\talign: \"center\",\n\t\t\t\tedge: \"on\",\n\t\t\t\tbindVisibility: true,\n\t\t\t\tbindAlpha: true,\n\t\t\t\tbindElevation: true,\n\t\t\t\tbindScale: true,\n\t\t\t\tbindRotation: true,\n\t\t\t\toffset: false,\n\t\t\t\trandomOffset: false,\n\t\t\t\tgridUnits: false,\n\t\t\t\tlocal: false,\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\n\t\tconst validatedObject = this._validateLocation(inObject);\n\t\tif (validatedObject === undefined)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t\"could not find given object\"\n\t\t\t);\n\n\t\tconst aligns = Object.keys(canvaslib.alignments);\n\t\tif (\n\t\t\ttypeof inOptions.align !== \"string\" ||\n\t\t\t!aligns.includes(inOptions.align)\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t`inOptions.align must be of type string, one of: ${aligns.join(\", \")}`\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\ttypeof inOptions.edge !== \"string\" ||\n\t\t\t!(\n\t\t\t\tinOptions.edge === \"on\" ||\n\t\t\t\tinOptions.edge === \"inner\" ||\n\t\t\t\tinOptions.edge === \"outer\"\n\t\t\t)\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t`inOptions.edge must of type string with the value of either \"on\", \"inner\", or \"outer\"`\n\t\t\t);\n\t\t}\n\t\tif (typeof inOptions.bindVisibility !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t`inOptions.bindVisibility must be of type boolean`\n\t\t\t);\n\t\tif (inOptions.followRotation !== undefined) {\n\t\t\tinOptions.bindRotation = inOptions.followRotation;\n\t\t\tthis.sequence._showWarning(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t\"inOptions.followRotation is deprecated, please use inOptions.bindRotation instead\",\n        true\n\t\t\t);\n\t\t}\n\t\tif (typeof inOptions.bindRotation !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t`inOptions.bindRotation must be of type boolean`\n\t\t\t);\n\t\tif (typeof inOptions.bindAlpha !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t\"inOptions.bindAlpha must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.bindElevation !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t\"inOptions.bindElevation must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.bindScale !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t\"inOptions.bindScale must be of type boolean\"\n\t\t\t);\n\t\tif (\n\t\t\t!(\n\t\t\t\ttypeof inOptions.randomOffset === \"boolean\" ||\n\t\t\t\tlib.is_real_number(inOptions.randomOffset)\n\t\t\t)\n\t\t)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"attachTo\",\n\t\t\t\t\"inOptions.randomOffset must be of type boolean or number\"\n\t\t\t);\n\n\t\tthis._source = validatedObject;\n\n\t\tif (inOptions.offset) {\n\t\t\tconst offsetData = this._validateOffset(\n\t\t\t\t\"attachTo\",\n\t\t\t\tinOptions.offset,\n\t\t\t\tinOptions\n\t\t\t);\n\t\t\tthis._offset = {\n\t\t\t\tsource: offsetData,\n\t\t\t\ttarget: this._offset?.target ?? false,\n\t\t\t};\n\t\t}\n\n\t\tthis._randomOffset = {\n\t\t\tsource: inOptions.randomOffset,\n\t\t\ttarget: this._randomOffset?.target ?? false,\n\t\t};\n\n\t\tthis._attachTo = {\n\t\t\tactive: !!validatedObject,\n\t\t\talign: inOptions.align,\n\t\t\tedge: inOptions.edge,\n\t\t\tbindVisibility: inOptions.bindVisibility,\n\t\t\tbindAlpha: inOptions.bindAlpha,\n\t\t\tbindScale: inOptions.bindScale,\n\t\t\tbindElevation: inOptions.bindElevation,\n\t\t\tbindRotation: inOptions.bindRotation,\n\t\t};\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Causes the effect to be rotated and stretched towards an object, or a direct on the canvas to play the effect at, or a string reference (see .name())\n\t *  This effectively calculates the proper X scale for the effect to reach the target\n\t *\n\t * @param {Object|String} inLocation\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\tstretchTo(inLocation, inOptions = {}) {\n\t\tif (!inLocation || !(typeof inLocation === \"object\" || typeof inLocation === \"string\")) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t`inLocation is invalid, and must be of type of object, string, placeable object, or document`\n\t\t\t);\n\t\t}\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t`inOptions must be of type object`\n\t\t\t);\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tcacheLocation: false,\n\t\t\t\tattachTo: false,\n\t\t\t\tonlyX: false,\n\t\t\t\ttiling: false,\n\t\t\t\toffset: false,\n\t\t\t\trandomOffset: false,\n\t\t\t\tgridUnits: false,\n\t\t\t\tlocal: false,\n\t\t\t\trequiresLineOfSight: false,\n\t\t\t\thideLineOfSight: false,\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\t\tconst validatedObject = this._validateLocation(inLocation);\n\t\tif (validatedObject === undefined)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"could not find position of given object\"\n\t\t\t);\n\t\tif (typeof inOptions.cacheLocation !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"inOptions.cacheLocation must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.attachTo !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"inOptions.attachTo must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.onlyX !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"inOptions.onlyX must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.tiling !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"inOptions.tiling must be of type boolean\"\n\t\t\t);\n\t\tif (\n\t\t\t!(\n\t\t\t\ttypeof inOptions.randomOffset === \"boolean\" ||\n\t\t\t\tlib.is_real_number(inOptions.randomOffset)\n\t\t\t)\n\t\t)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"inOptions.randomOffset must be of type boolean or number\"\n\t\t\t);\n\n\t\tif (inOptions.cacheLocation && inOptions.attachTo) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"cacheLocation and attachTo cannot both be true - pick one or the other\"\n\t\t\t);\n\t\t}\n\n\t\tif (typeof inOptions.requiresLineOfSight !== \"boolean\") {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"requiresLineOfSight must be of type boolean\"\n\t\t\t);\n\t\t}\n\n\t\tif (!inOptions.attachTo && inOptions.requiresLineOfSight) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"requiresLineOfSight requires that attachTo is true\"\n\t\t\t);\n\t\t}\n\n\t\tif (typeof inOptions.hideLineOfSight !== \"boolean\") {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"hideLineOfSight must be of type boolean\"\n\t\t\t);\n\t\t}\n\n\t\tif (!inOptions.requiresLineOfSight && inOptions.hideLineOfSight) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"hideLineOfSight requires that requiresLineOfSight is true\"\n\t\t\t);\n\t\t}\n\n\t\tif (inOptions.tiling) this.tilingTexture();\n\n\t\tif (inOptions.offset) {\n\t\t\tconst offsetData = this._validateOffset(\n\t\t\t\t\"stretchTo\",\n\t\t\t\tinOptions.offset,\n\t\t\t\tinOptions\n\t\t\t);\n\t\t\tthis._offset = {\n\t\t\t\tsource: this._offset?.source ?? false,\n\t\t\t\ttarget: offsetData,\n\t\t\t};\n\t\t}\n\n\t\tthis._randomOffset = {\n\t\t\tsource: this._randomOffset?.source ?? false,\n\t\t\ttarget: inOptions.randomOffset,\n\t\t};\n\n\t\tthis._stretchTo = {\n\t\t\ttarget: inOptions.cacheLocation\n\t\t\t\t? canvaslib.get_object_canvas_data(validatedObject, { measure: true, uuid: false })\n\t\t\t\t: validatedObject,\n\t\t\tattachTo: inOptions.attachTo,\n\t\t\tonlyX: inOptions.onlyX,\n\t\t\trequiresLineOfSight: inOptions.requiresLineOfSight,\n\t\t\thideLineOfSight: inOptions.hideLineOfSight,\n\t\t};\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the location to rotate the object to\n\t *\n\t * @param {object|string} inLocation\n\t * @param {object} inOptions\n\t * @returns this\n\t */\n\trotateTowards(inLocation, inOptions = {}) {\n\t\tif (!inLocation || !(typeof inLocation === \"object\" || typeof inLocation === \"string\")) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"inLocation\",\n\t\t\t\t`inLocation is invalid, and must be of type of object, string, placeable object, or document`\n\t\t\t);\n\t\t}\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\trotationOffset: 0,\n\t\t\t\tcacheLocation: false,\n\t\t\t\tattachTo: false,\n\t\t\t\toffset: false,\n\t\t\t\trandomOffset: false,\n\t\t\t\tlocal: false,\n\t\t\t\tgridUnits: false,\n\t\t\t\ttemplate: false,\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\t\tif (!lib.is_real_number(inOptions.rotationOffset))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"inOptions.rotationOffset must be of type number\"\n\t\t\t);\n\t\tif (typeof inOptions.attachTo !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"inOptions.attachTo must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.cacheLocation !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"inOptions.cacheLocation must be of type boolean\"\n\t\t\t);\n\t\tconst validatedObject = this._validateLocation(inLocation);\n\t\tif (!validatedObject)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"could not find position of given object\"\n\t\t\t);\n\n\t\tif (inOptions.offset) {\n\t\t\tconst offsetData = this._validateOffset(\n\t\t\t\t\"attachTo\",\n\t\t\t\tinOptions.offset,\n\t\t\t\tinOptions\n\t\t\t);\n\t\t\tthis._offset = {\n\t\t\t\ttarget: offsetData ?? this._offset?.target ?? false,\n\t\t\t};\n\t\t}\n\n\t\tif (typeof inOptions.template !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"inOptions.template must be of type boolean\"\n\t\t\t);\n\n\t\tthis._randomOffset = {\n\t\t\ttarget: inOptions.randomOffset ?? this._randomOffset?.target ?? false,\n\t\t};\n\n\t\tthis._rotateTowards = {\n\t\t\ttarget: inOptions.cacheLocation\n\t\t\t\t? canvaslib.get_object_canvas_data(validatedObject, { measure: true, uuid: false })\n\t\t\t\t: validatedObject,\n\t\t\trotationOffset: inOptions.rotationOffset,\n\t\t\tcacheLocation: inOptions.cacheLocation,\n\t\t\tattachTo: inOptions.attachTo,\n\t\t\ttemplate: inOptions.template,\n\t\t};\n\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Create an effect based on the given object, effectively copying the object as an effect. Useful when you want to do some effect magic on tokens or tiles.\n\t *  @deprecated\n\t */\n\tfrom(...args) {\n\t\tthis.sequence._showWarning(\n\t\t\tthis,\n\t\t\t\"from\",\n\t\t\t\".from() is deprecated, please use .copySprite() instead\",\n      true\n\t\t);\n\t\treturn this.copySprite(...args)\n\t}\n\n\t/**\n\t *  Create an effect based on the given object, effectively copying the object as an effect. Useful when you want to do some effect magic on tokens or tiles.\n\t *\n\t * @param {Object} inObject\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\tcopySprite(inObject, inOptions = {}) {\n\t\tif (\n\t\t\t!(\n\t\t\t\tinObject instanceof FoundryShim.Token ||\n\t\t\t\tinObject instanceof FoundryShim.Tile ||\n\t\t\t\tinObject instanceof TokenDocument ||\n\t\t\t\tinObject instanceof TileDocument\n\t\t\t)\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"copySprite\",\n\t\t\t\t\"inObject must be of type Token, Tile, TokenDocument, or TileDocument\"\n\t\t\t);\n\t\t}\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"copySprite\",\n\t\t\t\t`inOptions must be of type object`\n\t\t\t);\n\t\tinObject = inObject.document ?? inObject;\n\t\tif (!inObject?.texture?.src)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"copySprite\",\n\t\t\t\t\"could not find the image for the given object\"\n\t\t\t);\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tcacheLocation: false,\n\t\t\t\toffset: false,\n\t\t\t\trandomOffset: false,\n\t\t\t\tlocal: false,\n\t\t\t\tgridUnits: false,\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\t\tif (typeof inOptions.cacheLocation !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"copySprite\",\n\t\t\t\t\"inOptions.cacheLocation must be of type boolean\"\n\t\t\t);\n\t\tif (\n\t\t\t!(\n\t\t\t\ttypeof inOptions.randomOffset === \"boolean\" ||\n\t\t\t\tlib.is_real_number(inOptions.randomOffset)\n\t\t\t)\n\t\t)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"copySprite\",\n\t\t\t\t\"inOptions.randomOffset must be of type boolean or number\"\n\t\t\t);\n\n\t\tif (inOptions.offset) {\n\t\t\tconst offsetData = this._validateOffset(\n\t\t\t\t\"attachTo\",\n\t\t\t\tinOptions.offset,\n\t\t\t\tinOptions\n\t\t\t);\n\t\t\tthis._offset = {\n\t\t\t\tsource: offsetData,\n\t\t\t\ttarget: this._offset?.target ?? false,\n\t\t\t};\n\t\t}\n\n\t\tthis._randomOffset = {\n\t\t\tsource: inOptions.randomOffset,\n\t\t\ttarget: this._randomOffset?.target ?? false,\n\t\t};\n\n\t\tthis._copySprite = {\n\t\t\tobject: inObject,\n\t\t\toptions: inOptions,\n\t\t};\n\t\treturn this;\n\t}\n\n\tshape(inType, inOptions = {}) {\n\t\tif (typeof inType !== \"string\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"type must be of type string\"\n\t\t\t);\n\n\t\tif (!Object.values(CONSTANTS.SHAPES).includes(inType)) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"type must be one of: \" + Object.values(CONSTANTS.SHAPES).join(\", \")\n\t\t\t);\n\t\t}\n\n\t\tif (inType === CONSTANTS.SHAPES.POLY) {\n\t\t\tif (!Array.isArray(inOptions.points)) {\n\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\tthis,\n\t\t\t\t\t\"shape\",\n\t\t\t\t\t\"if creating polygon, inOptions.points must be of type array\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tinOptions.points = inOptions.points.map((point) => {\n\t\t\t\tif (Array.isArray(point)) {\n\t\t\t\t\tif (!is_real_number(point[0]) || !is_real_number(point[1])) {\n\t\t\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\"shape\",\n\t\t\t\t\t\t\t\"inOptions.points must be an array, containing an array of two numbers or objects with x and y number properties\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn point;\n\t\t\t\t}\n\t\t\t\tif (typeof point === \"object\") {\n\t\t\t\t\tif (!is_real_number(point?.x) || !is_real_number(point?.y)) {\n\t\t\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\"shape\",\n\t\t\t\t\t\t\t\"inOptions.points must be an array, containing an array of two numbers or objects with x and y number properties\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn [point.x, point.y];\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (inType === CONSTANTS.SHAPES.CIRC) {\n\t\t\tif (typeof inOptions.radius !== \"number\") {\n\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\tthis,\n\t\t\t\t\t\"shape\",\n\t\t\t\t\t\"if creating circle, inOptions.radius must be of type number\"\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (\n\t\t\tinType === CONSTANTS.SHAPES.RECT ||\n\t\t\tinType === CONSTANTS.SHAPES.RREC ||\n\t\t\tinType === CONSTANTS.SHAPES.ELIP\n\t\t) {\n\t\t\tif (inOptions.width ^ inOptions.height) {\n\t\t\t\tinOptions.width = inOptions.width ?? inOptions.height;\n\t\t\t\tinOptions.height = inOptions.height ?? inOptions.width;\n\t\t\t}\n\t\t\tif (typeof inOptions.width !== \"number\") {\n\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\tthis,\n\t\t\t\t\t\"shape\",\n\t\t\t\t\t`if creating rectangle, rounded rectangle, or an ellipse, inOptions.width must be of type number`\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (typeof inOptions.height !== \"number\") {\n\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\tthis,\n\t\t\t\t\t\"shape\",\n\t\t\t\t\t\"if creating rectangle, rounded rectangle, or an ellipse, inOptions.height must be of type number\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (\n\t\t\t\tinType === CONSTANTS.SHAPES.RREC &&\n\t\t\t\ttypeof inOptions.radius !== \"number\"\n\t\t\t) {\n\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\tthis,\n\t\t\t\t\t\"shape\",\n\t\t\t\t\t\"if creating rounded border rectangle, inOptions.radius must be of type number\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tinOptions.gridUnits !== undefined &&\n\t\t\ttypeof inOptions.gridUnits !== \"boolean\"\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"inOptions.gridUnits must be of type boolean\"\n\t\t\t);\n\t\t}\n\n\t\tif (inOptions.name && typeof inOptions.name !== \"string\") {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"inOptions.name must be of type string\"\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tinOptions.fillColor &&\n\t\t\t!is_real_number(inOptions.fillColor) &&\n\t\t\ttypeof inOptions.fillColor !== \"string\"\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"inOptions.fillColor must be of type string (hexadecimal) or number (decimal)\"\n\t\t\t);\n\t\t} else {\n\t\t\tinOptions.fillColor = lib.parseColor(inOptions.fillColor).decimal;\n\t\t}\n\n\t\tif (inOptions.fillAlpha && !is_real_number(inOptions.fillAlpha)) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"inOptions.fillAlpha must be of type number\"\n\t\t\t);\n\t\t}\n\n\t\tif (inOptions.alpha && !is_real_number(inOptions.alpha)) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"inOptions.alpha must be of type number\"\n\t\t\t);\n\t\t}\n\n\t\tif (inOptions.lineSize && !is_real_number(inOptions.lineSize)) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"inOptions.lineSize must be of type number\"\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tinOptions.lineColor &&\n\t\t\t!is_real_number(inOptions.lineColor) &&\n\t\t\ttypeof inOptions.lineColor !== \"string\"\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"inOptions.lineColor must be of type string (hexadecimal) or number (decimal)\"\n\t\t\t);\n\t\t} else {\n\t\t\tinOptions.lineColor = lib.parseColor(inOptions.lineColor).decimal;\n\t\t}\n\n\t\tif (inOptions.offset) {\n\t\t\tinOptions.offset = this._validateOffset(\n\t\t\t\t\"shape\",\n\t\t\t\tinOptions.offset,\n\t\t\t\tinOptions.offset\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tinOptions.texture !== undefined &&\n\t\t\ttypeof inOptions.texture !== \"string\"\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"inOptions.texture must be of type string\"\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tinOptions.isMask !== undefined &&\n\t\t\ttypeof inOptions.isMask !== \"boolean\"\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"shape\",\n\t\t\t\t\"inOptions.isMask must be of type boolean\"\n\t\t\t);\n\t\t}\n\n\t\tthis._shapes.push({\n\t\t\t...inOptions,\n\t\t\ttype: inType,\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Causes the effect's sprite to be offset relative to its location based on a given vector\n\t *\n\t * @param {Object} inOffset\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\tspriteOffset(inOffset, inOptions = {}) {\n\t\tif (inOffset === undefined)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"spriteOffset\",\n\t\t\t\t\"inOffset must not be undefined\"\n\t\t\t);\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"spriteOffset\",\n\t\t\t\t\"options must be of type object\"\n\t\t\t);\n\t\tthis._spriteOffset = this._validateOffset(\n\t\t\t\"spriteOffset\",\n\t\t\tinOffset,\n\t\t\tinOptions\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the final effect location to be snapped to the grid\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\tsnapToGrid(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"snapToGrid\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._snapToGrid = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to be scaled to the target object's width\n\t *\n\t * @param {Number} inScale\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\tscaleToObject(inScale = 1.0, inOptions = {}) {\n\t\tif (!lib.is_real_number(inScale))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"scaleToObject\",\n\t\t\t\t`inScale must be of type number!`\n\t\t\t);\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"scaleToObject\",\n\t\t\t\t\"inOptions must be of type object\"\n\t\t\t);\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tscale: inScale,\n\t\t\t\tconsiderTokenScale: false,\n\t\t\t\tuniform: false\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\t\tif (typeof inOptions.considerTokenScale !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"scaleToObject\",\n\t\t\t\t\"inOptions.considerTokenScale must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.uniform !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"scaleToObject\",\n\t\t\t\t\"inOptions.uniform must be of type boolean\"\n\t\t\t);\n\t\tthis._scaleToObject = inOptions;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the width and the height of the effect in pixels, this size is set before any scaling\n\t *\n\t * @param {Number|Object<{width: {Number}, height: {Number}}>} inSize\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\tsize(inSize, inOptions = {}) {\n\t\tif (!lib.is_real_number(inSize) && typeof inSize !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"size\",\n\t\t\t\t\"inSize must be of type number or object\"\n\t\t\t);\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"size\",\n\t\t\t\t\"inOptions must be of type object\"\n\t\t\t);\n\t\tif (lib.is_real_number(inSize)) {\n\t\t\tinSize = {\n\t\t\t\twidth: inSize,\n\t\t\t\theight: inSize,\n\t\t\t};\n\t\t}\n\n\t\tif ((inSize.width === undefined) ^ (inSize.height === undefined)) {\n\t\t\tif (inSize.width) {\n\t\t\t\tif (!lib.is_real_number(inSize.width))\n\t\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\"size\",\n\t\t\t\t\t\t\"inSize.width must be of type number or string 'auto'\"\n\t\t\t\t\t);\n\t\t\t\tinSize[\"height\"] = \"auto\";\n\t\t\t} else {\n\t\t\t\tif (!lib.is_real_number(inSize.height))\n\t\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\"size\",\n\t\t\t\t\t\t\"inSize.height must be of type number or string 'auto'\"\n\t\t\t\t\t);\n\t\t\t\tinSize[\"width\"] = \"auto\";\n\t\t\t}\n\t\t}\n\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tgridUnits: false,\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\n\t\tif (!lib.is_real_number(inSize.width) && inSize.width !== \"auto\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"size\",\n\t\t\t\t\"inSize.width must be of type number or string 'auto'\"\n\t\t\t);\n\t\tif (!lib.is_real_number(inSize.height) && inSize.height !== \"auto\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"size\",\n\t\t\t\t\"inSize.height must be of type number or string 'auto'\"\n\t\t\t);\n\t\tif (typeof inOptions.gridUnits !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"size\",\n\t\t\t\t\"inOptions.gridUnits must be of type boolean\"\n\t\t\t);\n\n\t\tthis._size = {\n\t\t\twidth: inSize.width ?? canvas.grid.size,\n\t\t\theight: inSize.height ?? canvas.grid.size,\n\t\t\t...inOptions,\n\t\t};\n\t\treturn this;\n\t}\n\n\t/**\n\t *  This scales the sprite of the effect, and this method can take the following:\n\t *  - A number to set the scale uniformly\n\t *  - An object with x and y for non-uniform scaling\n\t *  - Two numbers which the Sequencer will randomly pick a uniform scale between\n\t *\n\t * @param {number|object} inScaleMin\n\t * @param {number} [inScaleMax] inScaleMax\n\t * @returns this\n\t */\n\tspriteScale(inScaleMin, inScaleMax) {\n\t\tif (!lib.is_real_number(inScaleMin) && typeof inScaleMin !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"spriteScale\",\n\t\t\t\t\"inScale must be of type number or object\"\n\t\t\t);\n\t\tif (lib.is_real_number(inScaleMin)) {\n\t\t\tif (inScaleMax && !lib.is_real_number(inScaleMax)) {\n\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\tthis,\n\t\t\t\t\t\"spriteScale\",\n\t\t\t\t\t\"if inScaleMin is a number, inScaleMax must also be of type number\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis._spriteScaleMin = inScaleMin;\n\t\tthis._spriteScaleMax = inScaleMax ?? false;\n\t\treturn this;\n\t}\n\n\t/**\n\t * This defines the internal padding of this effect. Gridsize determines the internal grid size of this effect which will determine how big it is on the canvas\n\t * relative to the canvas's grid size. Start and end point defines padding at the left and right of the effect\n\t *\n\t * @param {Number} gridSize\n\t * @param {Number} startPoint\n\t * @param {Number} endPoint\n\t * @returns {EffectSection}\n\t */\n\ttemplate({ gridSize, startPoint, endPoint } = {}) {\n\t\tif (gridSize && !lib.is_real_number(gridSize))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"template\",\n\t\t\t\t\"gridSize must be of type number\"\n\t\t\t);\n\t\tif (startPoint && !lib.is_real_number(startPoint))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"template\",\n\t\t\t\t\"startPoint must be of type number\"\n\t\t\t);\n\t\tif (endPoint && !lib.is_real_number(endPoint))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"template\",\n\t\t\t\t\"endPoint must be of type number\"\n\t\t\t);\n\t\tif (!gridSize && !startPoint && !endPoint)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"template\",\n\t\t\t\t\"You need to define at least one parameter!\"\n\t\t\t);\n\t\tif (!this._template) this._template = {};\n\t\tif (gridSize) this._template[\"gridSize\"] = gridSize;\n\t\tif (startPoint) this._template[\"startPoint\"] = startPoint;\n\t\tif (endPoint) this._template[\"endPoint\"] = endPoint;\n\t\treturn this;\n\t}\n\n\t/**\n\t * This makes the texture of the effect tile, effectively repeat itself within the sprite's dimensions\n\t *\n\t * @param {Object|Number} scale\n\t * @param {Object} position\n\t * @returns {EffectSection}\n\t */\n\ttilingTexture(scale = { x: 1.0, y: 1.0 }, position = { x: 0, y: 0 }) {\n\t\tif (lib.is_real_number(scale)) {\n\t\t\tscale = { x: scale, y: scale };\n\t\t}\n\n\t\tscale = { x: scale?.x ?? 1.0, y: scale?.y ?? 1.0 };\n\n\t\tif (!lib.is_real_number(scale.x))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"tilingTexture\",\n\t\t\t\t`scale.x must be of type number!`\n\t\t\t);\n\t\tif (!lib.is_real_number(scale.y))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"tilingTexture\",\n\t\t\t\t`scale.y must be of type number!`\n\t\t\t);\n\n\t\tposition = { x: position?.x ?? 0, y: position?.y ?? 0 };\n\n\t\tif (!lib.is_real_number(position.x))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"tilingTexture\",\n\t\t\t\t`position.x must be of type number!`\n\t\t\t);\n\t\tif (!lib.is_real_number(position.y))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"tilingTexture\",\n\t\t\t\t`position.y must be of type number!`\n\t\t\t);\n\n\t\tthis._tilingTexture = {\n\t\t\tscale,\n\t\t\tposition,\n\t\t};\n\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Anchors the sprite's container according to the given x and y coordinates, or uniformly based on a single number\n\t *\n\t * @param {Number|Object} inAnchor\n\t * @returns {EffectSection}\n\t */\n\tanchor(inAnchor) {\n\t\tif (lib.is_real_number(inAnchor)) {\n\t\t\tinAnchor = {\n\t\t\t\tx: inAnchor,\n\t\t\t\ty: inAnchor,\n\t\t\t};\n\t\t}\n\n\t\tinAnchor = {\n\t\t\tx: inAnchor?.x ?? 0.5,\n\t\t\ty: inAnchor?.y ?? 0.5,\n\t\t};\n\n\t\tif (!lib.is_real_number(inAnchor.x))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"anchor\",\n\t\t\t\t`inAnchor.x must be of type number!`\n\t\t\t);\n\t\tif (!lib.is_real_number(inAnchor.y))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"anchor\",\n\t\t\t\t`inAnchor.y must be of type number!`\n\t\t\t);\n\n\t\tthis._anchor = inAnchor;\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Anchors the sprite according to the given x and y coordinates, or uniformly based on a single number\n\t *\n\t * @param {Number|Object} inAnchor\n\t * @returns {EffectSection}\n\t */\n\tspriteAnchor(inAnchor) {\n\t\tif (lib.is_real_number(inAnchor)) {\n\t\t\tinAnchor = {\n\t\t\t\tx: inAnchor,\n\t\t\t\ty: inAnchor,\n\t\t\t};\n\t\t}\n\n\t\tinAnchor = {\n\t\t\tx: inAnchor?.x ?? 0.5,\n\t\t\ty: inAnchor?.y ?? 0.5,\n\t\t};\n\n\t\tif (!lib.is_real_number(inAnchor.x))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"anchor\",\n\t\t\t\t`inAnchor.x must be of type number!`\n\t\t\t);\n\t\tif (!lib.is_real_number(inAnchor.y))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"anchor\",\n\t\t\t\t`inAnchor.y must be of type number!`\n\t\t\t);\n\n\t\tthis._spriteAnchor = inAnchor;\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Centers the sprite, effectively giving it an anchor of {x: 0.5, y: 0.5}\n\t *\n\t *  Note: If this is used, it will override the anchor set by Aim Towards, which sets the sprite's anchor to the\n\t *  outermost edge of the location the sprite is played at\n\t *\n\t * @returns {EffectSection}\n\t */\n\tcenter() {\n\t\tthis.anchor(0.5);\n\t\treturn this;\n\t}\n\n\t/**\n\t * The sprite gets a randomized flipped X scale. If the scale on that axis was 1, it can\n\t * become 1 or -1, effectively mirroring the sprite on its horizontal axis\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\trandomizeMirrorX(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"randomizeMirrorX\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._randomMirrorX = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * The sprite gets a randomized flipped Y scale. If the scale on that axis was 1, it can\n\t * become 1 or -1, effectively mirroring the sprite on its vertical axis\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\trandomizeMirrorY(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"randomizeMirrorY\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._randomMirrorY = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * The sprite gets a flipped X scale. If the scale on that axis was 1, it will become 1 or -1, effectively\n\t * mirroring the sprite on its horizontal axis\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\tmirrorX(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"mirrorX\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._mirrorX = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * The sprite gets a flipped Y scale. If the scale on that axis was 1, it will become 1 or -1, effectively\n\t * mirroring the sprite on its vertical axis\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\tmirrorY(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"mirrorY\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._mirrorY = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to play beneath most tokens\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\tbelowTokens(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"belowTokens\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tif (game.release.generation >= 12) {\n\t\t\treturn this.sortLayer(inBool ? 600 : 800);\n\t\t} else {\n\t\t\tif (!inBool) return this;\n\t\t\treturn this.elevation(0, { absolute: true });\n\t\t}\n\t}\n\n\t/**\n\t * Causes the effect to play beneath most tiles\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\tbelowTiles(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"belowTokens\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tif (game.release.generation >= 12) {\n\t\t\treturn this.sortLayer(inBool ? 300 : 500);\n\t\t} else {\n\t\t\tif (!inBool) return this;\n\t\t\treturn this.elevation(-1, { absolute: true });\n\t\t}\n\t}\n\n\t/**\n\t * Causes the effect to be played on top of the vision mask\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\taboveLighting(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"aboveLighting\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._aboveLighting = inBool;\n\t\tif (game.release.generation >= 12) {\n\t\t\treturn this.sortLayer(inBool ? 1200 : 800);\n\t\t} else {\n\t\t\tif (!inBool) return this;\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to be played on top of interface\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\taboveInterface(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"aboveInterface\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._aboveInterface = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Changes the effect's elevation\n\t *\n\t * @param {Number} inElevation\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\televation(inElevation, inOptions = {}) {\n\t\tif (typeof inElevation !== \"number\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"elevation\",\n\t\t\t\t\"inElevation must be of type number\"\n\t\t\t);\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"elevation\",\n\t\t\t\t`inOptions must be of type object`\n\t\t\t);\n\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\televation: 1,\n\t\t\t\tabsolute: false,\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\n\t\tif (typeof inOptions.absolute !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"elevation\",\n\t\t\t\t\"inOptions.absolute must be of type boolean\"\n\t\t\t);\n\t\tthis._elevation = {\n\t\t\televation: inElevation,\n\t\t\tabsolute: inOptions.absolute,\n\t\t};\n\t\treturn this;\n\t}\n\n\t/**\n\t * Changes the effect's sortLayer, potentially displaying effects below tiles, above tokens or even weather effects\n\t * in case of identical elevations\n\t *\n\t * @param {Number} inSortLayer\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\tsortLayer(inSortLayer, inOptions = {}) {\n\t\tif (!lib.is_real_number(inSortLayer))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"sortLayer\",\n\t\t\t\t\"inSortLayer must be of type number\"\n\t\t\t);\n\t\tthis._sortLayer = inSortLayer;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the zIndex of the effect, potentially displaying it on top of other effects the same elevation and sort\n\t *\n\t * @param {Number} inZIndex\n\t * @returns {EffectSection}\n\t */\n\tzIndex(inZIndex) {\n\t\tif (!lib.is_real_number(inZIndex))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"zIndex\",\n\t\t\t\t\"inZIndex must be of type number\"\n\t\t\t);\n\t\tthis._zIndex = inZIndex;\n\t\treturn this;\n\t}\n\n\t/**\n\t * This method only modifies .persist()ed effects and causes them to not immediately end, but stick around for the given duration passed to this method.\n\t *\n\t * @param {Number} inExtraDuration\n\t * @returns {EffectSection}\n\t */\n\textraEndDuration(inExtraDuration) {\n\t\tif (!lib.is_real_number(inExtraDuration))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"extraEndDuration\",\n\t\t\t\t\"inExtraDuration must be of type number\"\n\t\t\t);\n\t\tthis._extraEndDuration = inExtraDuration;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Rotates the sprite\n\t *\n\t * @param {Number} inAngle\n\t * @returns {EffectSection}\n\t */\n\tspriteRotation(inAngle) {\n\t\tif (!lib.is_real_number(inAngle))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"spriteRotation\",\n\t\t\t\t\"inAngle must be of type number\"\n\t\t\t);\n\t\tthis._spriteRotation = inAngle;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Rotates the sprite\n\t *\n\t * @param {Boolean} inBool\n\t * @returns {EffectSection}\n\t */\n\trandomSpriteRotation(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"randomSpriteRotation\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._randomSpriteRotation = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to not rotate should its container rotate\n\t *\n\t * @param {Boolean} [inBool=true] inBool\n\t * @returns {EffectSection}\n\t */\n\tzeroSpriteRotation(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"zeroSpriteRotation\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._zeroSpriteRotation = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * @deprecated\n\t */\n\tnoLoop(inBool = true) {\n\t\tthis.sequence._showWarning(\n\t\t\tthis,\n\t\t\t\"noLoop\",\n\t\t\t\".noLoop() is deprecated, please use .loopOptions({ loops: 1 }) instead\",\n      true\n\t\t);\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"noLoop\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\n\t\tthis._loopOptions = foundry.utils.mergeObject(\n\t\t\tthis._loopOptions ?? {\n\t\t\t\tloopDelay: 0,\n\t\t\t\tloops: 0,\n\t\t\t},\n\t\t\t{\n\t\t\t\tloops: 1\n\t\t\t}\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Allows you to control the number of loops and the delays between each loop\n\t *\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\tloopOptions(inOptions={}){\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"loopOptions\",\n\t\t\t\t`inOptions must be of type object`\n\t\t\t);\n\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tloopDelay: 0,\n\t\t\t\tloops: 0,\n\t\t\t\tendOnLastLoop: false\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\n\t\tif (typeof inOptions.endOnLastLoop !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"loopOptions\",\n\t\t\t\t\"inOptions.endOnLastLoop must be of type boolean\"\n\t\t\t);\n\n\t\tif (typeof inOptions.loopDelay !== \"number\" || inOptions.loopDelay < 0)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"loopOptions\",\n\t\t\t\t\"inOptions.loopDelay must be of type number that is not below 0\"\n\t\t\t);\n\n\t\tif (typeof inOptions.loops !== \"number\" || inOptions.loops < 0)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"loopOptions\",\n\t\t\t\t\"inOptions.loops must be of type number that is not below 0\"\n\t\t\t);\n\n\t\tthis._loopOptions = inOptions;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to not show up in the Effect Manager UI - DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING\n\t *\n\t * @param inBool\n\t * @returns {EffectSection}\n\t */\n\tprivate(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"private\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._private = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to be played in screen space instead of world space (where tokens are)\n\t *\n\t * @param {Boolean} [inBool=true] inBool\n\t * @returns {EffectSection}\n\t */\n\tscreenSpace(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpace\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._screenSpace = inBool;\n\t\tthis._screenSpaceAnchor = this._screenSpaceAnchor ?? { x: 0.5, y: 0.5 };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to be played above all of the UI elements\n\t *\n\t * @param {Boolean} [inBool=true] inBool\n\t * @returns {EffectSection}\n\t */\n\tscreenSpaceAboveUI(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceAboveUI\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._screenSpaceAboveUI = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Positions the effect in a screen space position, offset from its .screenSpaceAnchor()\n\t *\n\t * @param {Object} inPosition\n\t * @returns {EffectSection}\n\t */\n\tscreenSpacePosition(inPosition) {\n\t\tinPosition = {\n\t\t\tx: inPosition?.x ?? 0,\n\t\t\ty: inPosition?.y ?? 0,\n\t\t};\n\t\tif (!lib.is_real_number(inPosition.x))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpacePosition\",\n\t\t\t\t`inPosition.x must be of type number!`\n\t\t\t);\n\t\tif (!lib.is_real_number(inPosition.y))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpacePosition\",\n\t\t\t\t`inPosition.y must be of type number!`\n\t\t\t);\n\t\tthis._screenSpacePosition = inPosition;\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Anchors the sprite according to the given x and y coordinates, or uniformly based on a single number in screen space\n\t *\n\t * @param {Number|Object} inAnchor\n\t * @returns {EffectSection}\n\t */\n\tscreenSpaceAnchor(inAnchor) {\n\t\tif (lib.is_real_number(inAnchor)) {\n\t\t\tinAnchor = {\n\t\t\t\tx: inAnchor,\n\t\t\t\ty: inAnchor,\n\t\t\t};\n\t\t}\n\n\t\tinAnchor = {\n\t\t\tx: inAnchor?.x ?? 0.5,\n\t\t\ty: inAnchor?.y ?? 0.5,\n\t\t};\n\n\t\tif (!lib.is_real_number(inAnchor.x))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceAnchor\",\n\t\t\t\t`inAnchor.x must be of type number!`\n\t\t\t);\n\t\tif (!lib.is_real_number(inAnchor.y))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceAnchor\",\n\t\t\t\t`inAnchor.y must be of type number!`\n\t\t\t);\n\n\t\tthis._screenSpaceAnchor = inAnchor;\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Sets up various properties relating to scale of the effect on the screen\n\t *\n\t * @param {Object} inOptions\n\t * @returns {EffectSection}\n\t */\n\tscreenSpaceScale(inOptions) {\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceScale\",\n\t\t\t\t`inOptions must be of type object`\n\t\t\t);\n\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tx: 1.0,\n\t\t\t\ty: 1.0,\n\t\t\t\tfitX: false,\n\t\t\t\tfitY: false,\n\t\t\t\tratioX: false,\n\t\t\t\tratioY: false,\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\n\t\tif (!lib.is_real_number(inOptions.x))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceScale\",\n\t\t\t\t`inOptions.x must be of type number!`\n\t\t\t);\n\t\tif (!lib.is_real_number(inOptions.y))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceScale\",\n\t\t\t\t`inOptions.y must be of type number!`\n\t\t\t);\n\t\tif (typeof inOptions.fitX !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceScale\",\n\t\t\t\t\"inOptions.fitX must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.fitY !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceScale\",\n\t\t\t\t\"inOptions.fitY must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.ratioX !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceScale\",\n\t\t\t\t\"inOptions.ratioX must be of type boolean\"\n\t\t\t);\n\t\tif (typeof inOptions.ratioY !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceScale\",\n\t\t\t\t\"inOptions.ratioY must be of type boolean\"\n\t\t\t);\n\n\t\tif (inOptions.ratioX && inOptions.ratioY)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"screenSpaceScale\",\n\t\t\t\t\"both ratioX and ratioY cannot be true, one axis must fit or be set directly\"\n\t\t\t);\n\n\t\tthis._screenSpaceScale = inOptions;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Ties the effect to any number of documents in Foundry - if those get deleted, the effect is ended.\n\t *\n\t * @param {String|PlaceableObject|foundry.abstract.Document|Array<String|PlaceableObject|foundry.abstract.Document>} inDocuments\n\t * @returns {EffectSection}\n\t */\n\ttieToDocuments(inDocuments) {\n\t\tif (!Array.isArray(inDocuments)) {\n\t\t\tinDocuments = [inDocuments];\n\t\t}\n\t\tfor (let doc of inDocuments) {\n\t\t\tif (\n\t\t\t\ttypeof doc !== \"string\" &&\n\t\t\t\t!(doc instanceof FoundryShim.PlaceableObject) &&\n\t\t\t\t!(doc instanceof foundry.abstract.Document)\n\t\t\t) {\n\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\tthis,\n\t\t\t\t\t\"tieToDocument\",\n\t\t\t\t\t\"inOrigin must be of type string, PlaceableObject, or Document, or an array thereof\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (typeof doc === \"string\") {\n\t\t\t\tconst obj = fromUuidSync(doc);\n\t\t\t\tif (!obj)\n\t\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\"tieToDocument\",\n\t\t\t\t\t\t`could not find document with UUID \"${doc}\"`\n\t\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdoc = lib.validate_document(doc);\n\t\t\t\tif (doc instanceof foundry.abstract.Document) {\n\t\t\t\t\tdoc = doc?.uuid;\n\t\t\t\t\tif (!doc)\n\t\t\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\"tieToDocument\",\n\t\t\t\t\t\t\t\"could not find the UUID for the given object\"\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._tiedDocuments.push(doc);\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t *  Masks the effect to the given object or objects. If no object is given, the effect will be masked to the source\n\t *  of the effect.\n\t *\n\t * @param {Token/TokenDocument/Tile/TileDocument/Drawing/DrawingDocument/MeasuredTemplate/MeasuredTemplateDocument/Array} inObject\n\t * @returns {Section}\n\t */\n\tmask(inObject) {\n\t\tif (!inObject) {\n\t\t\tthis._selfMask = true;\n\t\t\treturn this;\n\t\t}\n\n\t\tif (Array.isArray(inObject)) {\n\t\t\tfor (let obj of inObject) {\n\t\t\t\tthis.mask(obj);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tconst validatedObject = this._validateLocation(inObject);\n\n\t\tconst isValidObject =\n\t\t\tvalidatedObject instanceof TokenDocument ||\n\t\t\tvalidatedObject instanceof TileDocument ||\n\t\t\tvalidatedObject instanceof DrawingDocument ||\n\t\t\tvalidatedObject instanceof MeasuredTemplateDocument;\n\t\tif (!isValidObject) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"mask\",\n\t\t\t\t\"A foundry object was provided, but only Tokens, Tiles, Drawings, and MeasuredTemplates may be used to create effect masks\"\n\t\t\t);\n\t\t}\n\n\t\tthis._masks.push(lib.get_object_identifier(validatedObject));\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the effect to be visible through walls\n\t *\n\t * @param inBool\n\t * @returns {EffectSection}\n\t */\n\txray(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"xray\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._xray = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Declares which file to be played. This may also be an array of paths, which will be randomly picked from each\n\t * time the section is played.\n\t *\n\t * @param {string|array} inFile\n\t * @param {object} inOptions\n\t * @returns this\n\t */\n\tfile(inFile, inOptions = {}) {\n\t\tif(typeof inOptions === \"boolean\"){\n\t\t\tinOptions = {};\n\t\t\tthis.sequence._showWarning(\n\t\t\t\tthis,\n\t\t\t\t\"file\",\n\t\t\t\t\"passing a boolean as a second argument to .file() is deprecated, please softFail: true on the sequence itself instead\",\n        true\n\t\t\t);\n\t\t}\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"file\",\n\t\t\t\t\"inOptions must be of type object\"\n\t\t\t);\n\t\tinOptions = foundry.utils.mergeObject({\n\t\t\tantialiasing: PIXI.SCALE_MODES.LINEAR\n\t\t}, inOptions)\n\t\tif(typeof inOptions.antialiasing !== \"number\" || !(inOptions.antialiasing >= 0 && inOptions.antialiasing <= 1)){\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"file\",\n\t\t\t\t\"inOptions.antialiasing must be of type number of 0 or 1 (see PIXI.SCALE_MODES)\"\n\t\t\t);\n\t\t}\n\t\tthis._file = inFile;\n\t\tthis._fileOptions = inOptions;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Configures the isometric configuration of this effect\n\t *\n\t * @param inOptions\n\t * @returns {EffectSection}\n\t */\n\tisometric(inOptions = {}) {\n\t\tif (typeof inOptions !== \"object\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"isometric\",\n\t\t\t\t`inOptions must be of type object`\n\t\t\t);\n\t\tinOptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\toverlay: false,\n\t\t\t},\n\t\t\tinOptions\n\t\t);\n\t\tif (typeof inOptions?.overlay !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"isometric\",\n\t\t\t\t\"inOptions.overlay must be of type boolean\"\n\t\t\t);\n\t\tthis._isometric = inOptions;\n\t\treturn this;\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_expressWarnings() {\n\t\tif (this._stretchTo && this._anchor?.x) {\n\t\t\tthis.sequence._showWarning(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"you have called .stretchTo() and .anchor() - stretchTo will manually set the X axis of the anchor and may not behave like you expect.\",\n\t\t\t\ttrue\n\t\t\t);\n\t\t}\n\t\tif (this._stretchTo && this._scaleToObject) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"You're trying to stretch towards an object, while scaling to fit another??? Make up your mind!\"\n\t\t\t);\n\t\t}\n\t\tif (this._stretchTo && this._randomRotation) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"You're trying to stretch towards an object, while trying to randomly rotate the effect? What?\"\n\t\t\t);\n\t\t}\n\t\tif (this._stretchTo && this._moveTowards) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"You're trying to stretch towards an object, while moving towards it? You're insane.\"\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\tthis._attachTo &&\n\t\t\tthis._stretchTo?.attachTo &&\n\t\t\t(this._startTime || this._endTime) &&\n\t\t\tthis._isRangedEffect\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"stretchTo\",\n\t\t\t\t\"Dual-attached range-finding effects combined while using any of the time methods is stable - modern web browsers cannot handle it and it may crash them, so this feature has been disabled.\"\n\t\t\t);\n\t\t}\n\n\t\tconst source = this._getSourceObject();\n\t\tconst target = this._getTargetObject();\n\n\t\tif (\n\t\t\t!this._screenSpace &&\n\t\t\tthis._persistOptions?.persistTokenPrototype &&\n\t\t\tthis._masks.filter((uuid) => uuid !== source).length > 0\n\t\t) {\n\t\t\tthis.sequence._showWarning(\n\t\t\t\tthis,\n\t\t\t\t\"persist\",\n\t\t\t\t\"You have applied persistTokenPrototype with multiple masks from objects in the scene - these will not be persisted across scenes!\",\n\t\t\t\ttrue\n\t\t\t);\n\t\t}\n\n\t\tif (!source && !target && !this._screenSpace) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"play\",\n\t\t\t\t\"Could not determine where to play the effect!\"\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @OVERRIDE\n\t */\n\tasync preRun() {\n\n\t\tconst oldSource = this._source;\n\t\tconst crosshairSource = this.sequence?.crosshairs?.[this._source];\n\t\tif(typeof this._source === \"string\" && crosshairSource){\n\t\t\tthis._source = crosshairSource.uuid;\n\t\t}\n\t\tconst oldTarget = this._target?.target;\n\t\tconst crosshairTarget = this.sequence?.crosshairs?.[this._target?.target];\n\t\tif(typeof this._target?.target === \"string\" && crosshairTarget){\n\t\t\tthis._target.target = crosshairTarget.uuid;\n\t\t}\n\n\t\tif(this._attachTo && !this._attachTo.active && typeof this._source === \"string\" && crosshairSource){\n\t\t\tthis._attachTo.active = !!crosshairSource;\n\t\t}\n\n\t\tif (this._name && (oldSource !== this._source || oldTarget !== this._target?.target)) {\n\t\t\tthis.sequence.nameOffsetMap[this._name].source = this._getSourceObject();\n\t\t\tthis.sequence.nameOffsetMap[this._name].target = this._getTargetObject();\n\t\t}\n\n\t\tconst source = this._getSourceObject();\n\t\tif(this._persistOptions?.persistTokenPrototype && !(this._attachTo?.active || lib.is_UUID(source))){\n\t\t\tthis._persistOptions.persistTokenPrototype = false;\n\t\t}\n\t}\n\n\t/**\n\t * @OVERRIDE\n\t * @returns {Promise<void>}\n\t */\n\tasync run() {\n\t\tif (!lib.user_can_do(\"permissions-effect-create\") || !this._playEffect) {\n\t\t\tif (!lib.user_can_do(\"permissions-effect-create\")) {\n\t\t\t\tfoundry.utils.debounce(EffectSection.debounceWarning, 1000);\n\t\t\t}\n\t\t\treturn new Promise((resolve) => {\n\t\t\t\tresolve();\n\t\t\t});\n\t\t}\n\t\tif (!this._deserializedData) this._expressWarnings();\n\t\tconst data = await this._sanitizeEffectData();\n\t\tif (Hooks.call(\"preCreateSequencerEffect\", data) === false) return;\n\t\tlet push =\n\t\t\t!(data?.users?.length === 1 && data?.users?.includes(game.userId)) &&\n\t\t\t!this.sequence.localOnly;\n\t\tlet canvasEffectData = await Sequencer.EffectManager.play(data, push);\n\t\tlet totalDuration = this._currentWaitTime;\n\t\tif (this._persist) {\n\t\t\ttotalDuration += await canvasEffectData.promise;\n\t\t} else {\n\t\t\ttotalDuration += await canvasEffectData.duration;\n\t\t}\n\t\tawait new Promise((resolve) => setTimeout(resolve, totalDuration));\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_applyTraits() {\n\t\tObject.assign(this.constructor.prototype, traits.files);\n\t\tObject.assign(this.constructor.prototype, traits.audio);\n\t\tObject.assign(this.constructor.prototype, traits.moves);\n\t\tObject.assign(this.constructor.prototype, traits.opacity);\n\t\tObject.assign(this.constructor.prototype, traits.rotation);\n\t\tObject.assign(this.constructor.prototype, traits.scale);\n\t\tObject.assign(this.constructor.prototype, traits.time);\n\t\tObject.assign(this.constructor.prototype, traits.users);\n\t\tObject.assign(this.constructor.prototype, traits.animation);\n\t\tObject.assign(this.constructor.prototype, traits.filter);\n\t\tObject.assign(this.constructor.prototype, traits.tint);\n\t\tObject.assign(this.constructor.prototype, traits.location);\n\t\tObject.assign(this.constructor.prototype, traits.offset);\n\t\tObject.assign(this.constructor.prototype, traits.text);\n\t\tObject.assign(this.constructor.prototype, traits.name);\n\t}\n\n\t/**\n\t * @private\n\t */\n\tasync _initialize() {\n\n\t\tthis._mirrorX = this._mirrorX || (this._randomMirrorX && Math.random() < 0.5)\n\t\tthis._mirrorY = this._mirrorY || (this._randomMirrorY && Math.random() < 0.5)\n\n\t\tif (this._copySprite && !this._file) {\n      this._file = (\n        this._copySprite.object?.ring?.enabled\n          ? this._copySprite.object?.ring?.subject?.texture || this._copySprite.object?.texture?.src\n          : this._copySprite.object?.texture?.src\n      );\n\n\t\t\tif (this._source === null) {\n\t\t\t\tthis._source = this._validateLocation(this._copySprite.object);\n\t\t\t}\n\n\t\t\tif (this._size === null) {\n\t\t\t\tconst size = canvaslib.get_object_dimensions(this._copySprite.object);\n\t\t\t\tthis._size = {\n\t\t\t\t\twidth: size?.width ?? canvas.grid.size,\n\t\t\t\t\theight: size?.height ?? canvas.grid.size,\n\t\t\t\t\tgridUnits: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tthis._mirrorX === null &&\n\t\t\t\t(this._copySprite.object.mirrorX ||\n\t\t\t\t\t(this._copySprite.object?.tile && this._copySprite.object?.tile.scale.x < 0))\n\t\t\t) {\n\t\t\t\tthis._mirrorX = true;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tthis._mirrorY === null &&\n\t\t\t\t(this._copySprite.object.mirrorY ||\n\t\t\t\t\t(this._copySprite.object?.tile && this._copySprite.object?.tile.scale.y < 0))\n\t\t\t) {\n\t\t\t\tthis._mirrorY = true;\n\t\t\t}\n\n\t\t\tif (this._angle === null && this._copySprite.object?.rotation) {\n\t\t\t\tthis._angle = -this._copySprite.object.rotation;\n\t\t\t}\n\n\t\t\tthis._randomOffset = {\n\t\t\t\tsource: this._randomOffset?.source ?? this._copySprite.options.randomOffset,\n\t\t\t\ttarget: this._randomOffset?.target ?? false,\n\t\t\t};\n\t\t}\n\n\t\tif (this._name) {\n\n\t\t\tthis.sequence.nameOffsetMap ||= {};\n\n\t\t\tif (!this.sequence.nameOffsetMap[this._name]) {\n\t\t\t\tconst source = this._getSourceObject();\n\t\t\t\tconst target = this._getTargetObject();\n\n\t\t\t\tif (this._offsetLegacy && !this._offset) {\n\t\t\t\t\tthis._offset = {\n\t\t\t\t\t\tsource: !target ? this._offsetLegacy : false,\n\t\t\t\t\t\ttarget: !!target ? this._offsetLegacy : false,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (this._randomOffsetLegacy && !this._randomOffset) {\n\t\t\t\t\tthis._randomOffset = {\n\t\t\t\t\t\tsource: !target ? this._randomOffsetLegacy : false,\n\t\t\t\t\t\ttarget: !!target ? this._randomOffsetLegacy : false,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tthis.sequence.nameOffsetMap[this._name] = {\n\t\t\t\t\tseed: `${this._name}-${foundry.utils.randomID()}`,\n\t\t\t\t\tsource: source,\n\t\t\t\t\ttarget: target,\n\t\t\t\t\trandomOffset: this._randomOffset,\n\t\t\t\t\tangle: this._angle,\n\t\t\t\t\trandomRotation: this._randomRotation,\n\t\t\t\t\tmirrorX: this._mirrorX,\n\t\t\t\t\tmirrorY: this._mirrorY,\n\t\t\t\t\tmissed: this._missed,\n\t\t\t\t\toffset: this._offset,\n\t\t\t\t\trepetitions: this._repetitions,\n\t\t\t\t\ttwister: {},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!this._file &&\n\t\t\t!this._copySprite &&\n\t\t\t!this._text &&\n\t\t\t!this._shapes.length &&\n\t\t\tthis.sequence.softFail\n\t\t) {\n\t\t\tthis._playEffect = false;\n\t\t\treturn;\n\t\t}\n\n\t\tlet fileData = this._file\n\t\t\t? await this._determineFile(this._file)\n\t\t\t: {\n\t\t\t\tfile: this._file,\n\t\t\t\tforcedIndex: false,\n\t\t\t\tcustomRange: false,\n\t\t\t};\n\n\t\tthis._isRangedEffect = fileData?.file?.rangeFind;\n\n\t\tif (fileData.customRange || fileData.file?.dbPath) return;\n\n\t\tlet exists = false;\n\t\ttry {\n\t\t\texists = await SequencerFileCache.srcExists(fileData.file);\n\t\t} catch (err) {\n\t\t}\n\n\t\tif (!exists) {\n\t\t\tif (this.sequence.softFail) {\n\t\t\t\tthis._playEffect = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"Play\",\n\t\t\t\t`Could not find file:<br>${fileData.file}`\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_getSourceObject() {\n\t\tif (!this._source || typeof this._source !== \"object\"){\n\t\t\treturn this._source;\n\t\t}\n\t\tif(this._source instanceof CrosshairsPlaceable || this._source instanceof CrosshairsDocument){\n\t\t\tconst doc = this._source?.document ?? this._source;\n\t\t\tif(this._attachTo) {\n\t\t\t\treturn lib.get_object_identifier(doc.object);\n\t\t\t}\n\t\t\treturn doc.getOrientation().source;\n\t\t}\n\t\tif (this._source?.cachedLocation || !this._attachTo) {\n\t\t\treturn canvaslib.get_object_canvas_data(this._source, { uuid: true });\n\t\t}\n\t\treturn (\n\t\t\tlib.get_object_identifier(this._source) ??\n\t\t\tcanvaslib.get_object_canvas_data(this._source, { uuid: true })\n\t\t);\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_getTargetObject() {\n\t\tif (!this._target) return this._target;\n\t\tif (typeof this._target.target !== \"object\"){\n\t\t\treturn this._target.target;\n\t\t}\n\t\tif(this._target?.target instanceof CrosshairsPlaceable || this._target?.target instanceof CrosshairsDocument){\n\t\t\tconst doc = this._target?.target?.document ?? this._target?.target;\n\t\t\tif(this._stretchTo?.attachTo || this._rotateTowards?.attachTo){\n\t\t\t\treturn lib.get_object_identifier(doc.object);\n\t\t\t}\n\t\t\tconst orientation = doc.getOrientation();\n\t\t\treturn orientation.target ?? orientation.source;\n\t\t}\n\t\tif (\n\t\t\tthis._target?.target?.cachedLocation ||\n\t\t\t!(this._stretchTo?.attachTo || this._rotateTowards?.attachTo)\n\t\t) {\n\t\t\treturn canvaslib.get_object_canvas_data(this._target.target, { measure: true, uuid: true });\n\t\t}\n\t\treturn (\n\t\t\tlib.get_object_identifier(this._target.target) ??\n\t\t\tcanvaslib.get_object_canvas_data(this._target.target, { measure: true, uuid: true })\n\t\t);\n\t}\n\n\t/**\n\t * @private\n\t */\n\tasync _sanitizeEffectData() {\n\t\tif (this._deserializedData) {\n\t\t\tthis._deserializedData.creationTimestamp = +new Date();\n\t\t\tthis._deserializedData.remote = true;\n\t\t\treturn this._deserializedData;\n\t\t}\n\n\t\tconst { file, forcedIndex, customRange } =\n\t\t\tthis._file && this._playEffect\n\t\t\t\t? await this._determineFile(this._file)\n\t\t\t\t: {\n\t\t\t\t\tfile: this._file,\n\t\t\t\t\tforcedIndex: false,\n\t\t\t\t\tcustomRange: false,\n\t\t\t\t};\n\n\t\tlet source = this._getSourceObject();\n\t\tlet target = this._getTargetObject();\n\n\t\tthis._temporaryEffect =\n\t\t\tthis._temporaryEffect ||\n\t\t\t(source instanceof foundry.abstract.Document ||\n\t\t\tsource instanceof FoundryShim.MeasuredTemplate\n\t\t\t\t? !lib.is_UUID(source?.uuid)\n\t\t\t\t: this._temporaryEffect || false);\n\n\t\tif (this._offsetLegacy) {\n\t\t\tthis._offset = {\n\t\t\t\tsource:\n\t\t\t\t\t!target && this._offset?.source\n\t\t\t\t\t\t? this._offsetLegacy\n\t\t\t\t\t\t: this._offset?.source,\n\t\t\t\ttarget:\n\t\t\t\t\t!!target && this._offset?.target\n\t\t\t\t\t\t? this._offsetLegacy\n\t\t\t\t\t\t: this._offset?.target,\n\t\t\t};\n\t\t}\n\n\t\tif (this._randomOffsetLegacy) {\n\t\t\tthis._randomOffset = {\n\t\t\t\tsource:\n\t\t\t\t\t!target && this._randomOffset?.source\n\t\t\t\t\t\t? this._randomOffsetLegacy\n\t\t\t\t\t\t: this._randomOffset?.source,\n\t\t\t\ttarget:\n\t\t\t\t\t!!target && this._randomOffset?.target\n\t\t\t\t\t\t? this._randomOffsetLegacy\n\t\t\t\t\t\t: this._randomOffset?.target,\n\t\t\t};\n\t\t}\n\n\t\tif (this._selfMask) {\n\t\t\tthis._masks.push(\n\t\t\t\tlib.get_object_identifier(this._source) ??\n\t\t\t\tcanvaslib.get_object_canvas_data(this._source, { uuid: false })\n\t\t\t);\n\t\t}\n\n\t\tlet sceneId = game.user.viewedScene;\n\t\tif (lib.is_UUID(source)) {\n\t\t\tconst potentialSceneId = source.split(\".\")[1];\n\t\t\tif (game.scenes.get(potentialSceneId)) {\n\t\t\t\tsceneId = potentialSceneId;\n\t\t\t}\n\t\t} else if (lib.is_UUID(target)) {\n\t\t\tconst potentialSceneId = target.split(\".\")[1];\n\t\t\tif (game.scenes.get(potentialSceneId)) {\n\t\t\t\tsceneId = potentialSceneId;\n\t\t\t}\n\t\t}\n\n\t\tlet data = foundry.utils.duplicate({\n\t\t\t/**\n\t\t\t * Core properties\n\t\t\t */\n\t\t\t_id: foundry.utils.randomID(),\n\t\t\tflagVersion: flagManager.latestFlagVersion,\n\t\t\tsequenceId: this.sequence.id,\n\t\t\tcreationTimestamp: +new Date(),\n\t\t\tsceneId,\n\t\t\tcreatorUserId: game.userId,\n\t\t\tmoduleName: this.sequence.moduleName,\n\t\t\tusers: this._users ? Array.from(this._users) : false,\n\t\t\tname: this._name,\n\t\t\torigin: this._origin,\n\t\t\tindex: this.sequence.effectIndex,\n\t\t\trepetition: this._currentRepetition,\n\t\t\tprivate: this._private,\n\t\t\ttemporary: this._temporaryEffect,\n\t\t\ttiedDocuments: Array.from(new Set(this._tiedDocuments)),\n\n\t\t\t/**\n\t\t\t * Source/target properties\n\t\t\t */\n\t\t\tsource: source,\n\t\t\ttarget: target,\n\t\t\trotateTowards: this._rotateTowards,\n\t\t\tstretchTo: this._stretchTo\n\t\t\t\t? {\n\t\t\t\t\tattachTo: this._stretchTo.attachTo,\n\t\t\t\t\tonlyX: this._stretchTo.onlyX,\n\t\t\t\t\trequiresLineOfSight: this._stretchTo.requiresLineOfSight,\n\t\t\t\t\thideLineOfSight: this._stretchTo.hideLineOfSight,\n\t\t\t\t}\n\t\t\t\t: false,\n\t\t\tmoveTowards: this._moveTowards\n\t\t\t\t? {\n\t\t\t\t\tease: this._moveTowards.ease,\n\t\t\t\t\trotate: this._moveTowards.rotate,\n\t\t\t\t}\n\t\t\t\t: false,\n\n\t\t\tattachTo: this._attachTo,\n\t\t\tmissed: this._missed,\n\n\t\t\t/**\n\t\t\t * Sprite properties\n\t\t\t */\n\t\t\tfile: file?.dbPath ?? file,\n\t\t\tcustomRange,\n\t\t\tforcedIndex,\n\t\t\tfileOptions: this._fileOptions,\n\t\t\ttext: this._text,\n\t\t\ttilingTexture: this._tilingTexture,\n\t\t\tmasks: Array.from(new Set(this._masks)),\n\t\t\tshapes: this._shapes,\n\t\t\tvolume: this._volume,\n\t\t\tisometric: this._isometric,\n\t\t\tsyncGroup: this._syncGroup,\n\n\t\t\t// Transforms\n\t\t\tscale: this._getCalculatedScale(\"scale\"),\n\t\t\tspriteScale: this._getCalculatedScale(\"spriteScale\"),\n\t\t\tangle: this._angle,\n\t\t\tsize: this._size,\n\t\t\toffset: this._offset,\n\t\t\tanchor: this._anchor,\n\t\t\tspriteOffset: this._spriteOffset,\n\t\t\tspriteAnchor: this._spriteAnchor,\n\t\t\ttemplate: this._template,\n\t\t\tzeroSpriteRotation: this._zeroSpriteRotation,\n\t\t\trandomOffset: this._randomOffset,\n\t\t\trandomRotation: this._randomRotation,\n\t\t\tscaleToObject: this._scaleToObject,\n\t\t\televation: this._elevation,\n\t\t\tsortLayer: this._sortLayer,\n\t\t\taboveLighting: this._aboveLighting,\n\t\t\taboveInterface: this._aboveInterface,\n\t\t\txray: this._xray,\n\n\t\t\t// Appearance\n\t\t\tzIndex: this._zIndex,\n\t\t\topacity: lib.is_real_number(this._opacity) ? this._opacity : 1.0,\n\t\t\tfilters: this._filters,\n\t\t\tloopOptions: this._loopOptions,\n\t\t\tspriteRotation: this._spriteRotation,\n\t\t\trandomSpriteRotation: this._randomSpriteRotation,\n\t\t\ttint: this._tint?.decimal,\n\t\t\tflipX: this._mirrorX,\n\t\t\tflipY: this._mirrorY,\n\n\t\t\t/**\n\t\t\t * Time properties\n\t\t\t */\n\t\t\tduration: this._duration,\n\t\t\tpersist: this._persist,\n\t\t\tpersistOptions: this._persistOptions,\n\t\t\tplaybackRate: this._playbackRate,\n\t\t\textraEndDuration: this._extraEndDuration,\n\t\t\ttime:\n\t\t\t\tthis._startTime || this._endTime\n\t\t\t\t\t? {\n\t\t\t\t\t\tstart: lib.is_real_number(this._startTime)\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tvalue: this._startTime,\n\t\t\t\t\t\t\t\tisPerc: this._startPerc,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: false,\n\t\t\t\t\t\tend: lib.is_real_number(this._endTime)\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tvalue: this._endTime,\n\t\t\t\t\t\t\t\tisPerc: this._endPerc,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: false,\n\t\t\t\t\t\tisRange: this._isRange,\n\t\t\t\t\t}\n\t\t\t\t\t: false,\n\n\t\t\t/**\n\t\t\t * Animation properties\n\t\t\t */\n\t\t\tmoves: this._moveTowards,\n\t\t\tmoveSpeed: this._moveSpeed,\n\t\t\tfadeIn: this._fadeIn,\n\t\t\tfadeOut: this._fadeOut,\n\t\t\tscaleIn: this._scaleIn,\n\t\t\tscaleOut: this._scaleOut,\n\t\t\trotateIn: this._rotateIn,\n\t\t\trotateOut: this._rotateOut,\n\t\t\tfadeInAudio: this._fadeInAudio,\n\t\t\tfadeOutAudio: this._fadeOutAudio,\n\t\t\tanimations: this._animations,\n\n\t\t\t/**\n\t\t\t * Screenspace properties\n\t\t\t */\n\t\t\tscreenSpace: this._screenSpace,\n\t\t\tscreenSpaceAboveUI: this._screenSpaceAboveUI,\n\t\t\tscreenSpaceAnchor: this._screenSpaceAnchor,\n\t\t\tscreenSpacePosition: this._screenSpacePosition,\n\t\t\tscreenSpaceScale: this._screenSpaceScale,\n\n\t\t\tnameOffsetMap: this.sequence.nameOffsetMap,\n\t\t});\n\n\t\tfor (let override of this._overrides) {\n\t\t\tdata = await override(this, data);\n\t\t}\n\n\t\tif (\n\t\t\t(typeof data.file !== \"string\" || data.file === \"\") &&\n\t\t\t!data.text &&\n\t\t\t!data.shapes &&\n\t\t\t!data.customRange\n\t\t) {\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"file\",\n\t\t\t\t\"an effect must have a file, text, or have a shape!\"\n\t\t\t);\n\t\t}\n\n\t\t// TODO: Revisit this at some point?\n\t\t// data = Object.fromEntries(Object.entries(data).filter(entry => entry[1] !== null && entry[1] !== false));\n\n\t\treturn data;\n\t}\n\n\tasync _serialize() {\n\t\tconst data = await super._serialize();\n\t\tawait this.preRun();\n\t\tconst sectionData = await this._sanitizeEffectData();\n\t\treturn {\n\t\t\t...data,\n\t\t\ttype: \"effect\",\n\t\t\tsectionData,\n\t\t};\n\t}\n\n\tasync _deserialize(data) {\n\t\tthis._deserializedData = data.sectionData;\n\t\treturn super._deserialize(data);\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_getCalculatedScale(type) {\n\t\tconst min = this[\"_\" + type + \"Min\"];\n\t\tconst max = this[\"_\" + type + \"Max\"];\n\n\t\tlet scale = min;\n\t\tif (lib.is_real_number(min)) {\n\t\t\tif (max && lib.is_real_number(max)) {\n\t\t\t\tscale = lib.random_float_between(min, max);\n\t\t\t}\n\t\t\tscale = {\n\t\t\t\tx: scale,\n\t\t\t\ty: scale,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tx: scale?.x ?? 1.0,\n\t\t\ty: scale?.y ?? 1.0,\n\t\t};\n\t}\n}\n","import * as lib from \"../lib/lib.js\";\nimport SequencerSoundManager from \"../modules/sequencer-sound-manager.js\";\nimport Section from \"./section.js\";\nimport traits from \"./traits/_traits.js\";\nimport { SequencerFileBase } from \"../modules/sequencer-file.js\";\nimport CONSTANTS from \"../constants.js\";\nimport CrosshairsPlaceable from \"../modules/sequencer-crosshair/CrosshairsPlaceable.js\";\nimport CrosshairsDocument from \"../modules/sequencer-crosshair/CrosshairsDocument.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\n\nclass SoundSection extends Section {\n\tconstructor(inSequence, inFile = \"\") {\n\t\tsuper(inSequence);\n\t\tthis._file = inFile;\n\t\tthis._volume = 0.8;\n\t\tthis._channel = \"interface\";\n\t\tthis._overrides = [];\n\t\tthis._locationOptions = {};\n\t}\n\n\tstatic niceName = \"Sound\";\n\n\t/**\n\t * Declares which file to be played. This may also be an array of paths, which will be randomly picked from each\n\t * time the section is played.\n\t *\n\t * @param {string|array} inFile\n\t * @returns this\n\t */\n\tfile(inFile) {\n\t\tthis._file = inFile;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a function that will run at the end of the sound serialization step, but before it is played. Allows direct\n\t * modifications of sound's data.\n\t *\n\t * @param {function} inFunc\n\t * @returns {SoundSection}\n\t */\n\taddOverride(inFunc) {\n\t\tif (!lib.is_function(inFunc))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"addOverride\",\n\t\t\t\t\"The given function needs to be an actual function.\",\n\t\t\t);\n\t\tthis._overrides.push(inFunc);\n\t\treturn this;\n\t}\n\n\tradius(inNumber) {\n\t\tif (!lib.is_real_number(inNumber))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"radius\",\n\t\t\t\t\"inNumber must be of type number\"\n\t\t\t);\n\t\tthis._locationOptions['radius'] = inNumber;\n\t\treturn this;\n\t}\n\n\tconstrainedByWalls(inBool) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"constrainedByWalls\",\n\t\t\t\t`inBool must be of type boolean`\n\t\t\t);\n\t\tthis._locationOptions['walls'] = inBool;\n\t\treturn this;\n\t}\n\n\tdistanceEasing(inBool) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"distanceEasing\",\n\t\t\t\t`inBool must be of type boolean`\n\t\t\t);\n\t\tthis._locationOptions['easing'] = inBool;\n\t\treturn this;\n\t}\n\n\taudioChannel(inString) {\n\t\tif (typeof inString !== \"string\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"audioChannel\",\n\t\t\t\t`inString must be of type string`\n\t\t\t);\n\t\tif (!(game.audio?.[inString] instanceof AudioContext)) {\n\t\t\tconst validChannels = Object.entries(game.audio)\n\t\t\t\t.filter(e => e[1] instanceof AudioContext)\n\t\t\t\t.map(e => e[0]);\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"audioChannel\",\n\t\t\t\t`inString must be of type ${validChannels.slice(0, -1).join(\", \")}, or ${validChannels.slice(-1)}`\n\t\t\t);\n\t\t}\n\t\tthis._channel = inString;\n\t\treturn this;\n\t}\n\n\talwaysForGMs(inBool) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"alwaysForGMs\",\n\t\t\t\t`inBool must be of type boolean`\n\t\t\t);\n\t\tthis._locationOptions['gmAlways'] = inBool;\n\t\treturn this;\n\t}\n\n\tbaseEffect(options = {}) {\n\t\toptions = foundry.utils.mergeObject({\n\t\t\ttype: \"\",\n\t\t\tintensity: 0\n\t\t}, options);\n\t\tif (typeof options.type !== \"string\" || !CONFIG.soundEffects[options.type])\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"baseEffect\",\n\t\t\t\t`options.type must be of type string, and one of ${Object.keys(CONFIG.soundEffects).join(\", \")}`\n\t\t\t);\n\t\tif (!lib.is_real_number(options.intensity))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"baseEffect\",\n\t\t\t\t\"options.intensity must be of type number\"\n\t\t\t);\n\t\tthis._locationOptions['baseEffect'] = {\n\t\t\ttype: options.type,\n\t\t\tintensity: options.intensity\n\t\t};\n\t\treturn this;\n\t}\n\n\tmuffledEffect(options = {}) {\n\t\toptions = foundry.utils.mergeObject({\n\t\t\ttype: \"\",\n\t\t\tintensity: 0\n\t\t}, options);\n\t\tif (typeof options.type !== \"string\" || !CONFIG.soundEffects[options.type])\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"baseEffect\",\n\t\t\t\t`options.type must be of type string, and one of ${Object.keys(CONFIG.soundEffects).join(\", \")}`\n\t\t\t);\n\t\tif (!lib.is_real_number(options.intensity))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"baseEffect\",\n\t\t\t\t\"options.intensity must be of type number\"\n\t\t\t);\n\t\tthis._locationOptions['muffledEffect'] = {\n\t\t\ttype: options.type,\n\t\t\tintensity: options.intensity\n\t\t};\n\t\treturn this;\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_applyTraits() {\n\t\tObject.assign(this.constructor.prototype, traits.files);\n\t\tObject.assign(this.constructor.prototype, traits.audio);\n\t\tObject.assign(this.constructor.prototype, traits.time);\n\t\tObject.assign(this.constructor.prototype, traits.users);\n\t\tObject.assign(this.constructor.prototype, traits.name);\n\t\tObject.assign(this.constructor.prototype, traits.location);\n\t\tObject.assign(this.constructor.prototype, traits.offset);\n\t}\n\n\t/**\n\t * @OVERRIDE\n\t * @returns {Promise}\n\t */\n\tasync run() {\n\t\tconst playData = await this._sanitizeSoundData();\n\n\t\tif (typeof playData.src !== \"string\" || playData.src === \"\") {\n\t\t\tif (this.sequence.softFail) {\n\t\t\t\tplayData.play = false;\n\t\t\t} else {\n\t\t\t\tthrow this.sequence._customError(\n\t\t\t\t\tthis,\n\t\t\t\t\t\"file\",\n\t\t\t\t\t\"a sound must have a src of type string!\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!playData.play && this.sequence.softFail) {\n\t\t\treturn new Promise((reject) => {\n\t\t\t\treject();\n\t\t\t});\n\t\t}\n\n\t\tif (!playData?.play) {\n\t\t\tthis.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"Play\",\n\t\t\t\t`File not found: ${playData.src}`,\n\t\t\t);\n\t\t\treturn new Promise((reject) => reject());\n\t\t}\n\n\t\tif (Hooks.call(\"preCreateSequencerSound\", playData) === false) return;\n\n\t\tlet push =\n\t\t\t!(\n\t\t\t\tplayData?.users?.length === 1 && playData?.users?.includes(game.userId)\n\t\t\t) && !this.sequence.localOnly;\n\n\t\tSequencerSoundManager.play(playData, push);\n\n\t\tawait new Promise((resolve) =>\n\t\t\tsetTimeout(resolve, this._currentWaitTime + playData.duration),\n\t\t);\n\t}\n\n  _getSourceObject() {\n    if (!this._source || typeof this._source !== \"object\"){\n      return this._source;\n    }\n    if(this._source instanceof CrosshairsPlaceable || this._source instanceof CrosshairsDocument){\n      const doc = this._source?.document ?? this._source;\n      if(this._attachTo) {\n        return lib.get_object_identifier(doc.object);\n      }\n      return doc.getOrientation().source;\n    }\n    if (this._source?.cachedLocation || !this._attachTo) {\n      return canvaslib.get_object_canvas_data(this._source, { uuid: true });\n    }\n    return (\n      lib.get_object_identifier(this._source) ??\n      canvaslib.get_object_canvas_data(this._source, { uuid: true })\n    );\n  }\n\n\t/**\n\t * @returns {Promise}\n\t * @private\n\t */\n\tasync _sanitizeSoundData() {\n\t\tif (this._deserializedData) {\n\t\t\treturn this._deserializedData;\n\t\t}\n\n\t\tif (!this._file) {\n\t\t\treturn {\n\t\t\t\tplay: false,\n\t\t\t\tsrc: false,\n\t\t\t};\n\t\t}\n\n\t\tlet { file, forcedIndex } = await this._determineFile(this._file);\n\n\t\tif (!file) {\n\t\t\treturn {\n\t\t\t\tplay: false,\n\t\t\t\tsrc: false,\n\t\t\t};\n\t\t}\n\n\t\tif (file instanceof SequencerFileBase) {\n\t\t\tfile.forcedIndex = forcedIndex;\n\t\t\tif (file.timeRange) {\n\t\t\t\t[this._startTime, this._endTime] = file.timeRange;\n\t\t\t\tthis._isRange = true;\n\t\t\t}\n\t\t\tfile = file.getFile();\n\t\t}\n\n\t\tlet soundFile = await foundry.audio.AudioHelper.preloadSound(file);\n\t\tif (!soundFile || soundFile.failed) {\n\t\t\treturn {\n\t\t\t\tplay: false,\n\t\t\t\tsrc: this._file,\n\t\t\t};\n\t\t}\n\t\tlet duration = soundFile.duration * 1000;\n\n\t\tlet startTime =\n\t\t\t(this._startTime\n\t\t\t\t? !this._startPerc\n\t\t\t\t\t? this._startTime\n\t\t\t\t\t: this._startTime * duration\n\t\t\t\t: 0) / 1000;\n\n\t\tif (this._endTime) {\n\t\t\tduration = !this._endPerc\n\t\t\t\t? Number(\n\t\t\t\t\tthis._isRange\n\t\t\t\t\t\t? this._endTime - this._startTime\n\t\t\t\t\t\t: duration - this._endTime,\n\t\t\t\t)\n\t\t\t\t: this._endTime * duration;\n\t\t}\n\n\t\tlet data = {\n\t\t\tid: foundry.utils.randomID(),\n\t\t\tplay: true,\n\t\t\tsrc: file,\n      source: this._getSourceObject(),\n\t\t\toffset: this._offset,\n\t\t\trandomOffset: this._randomOffset,\n\t\t\tlocationOptions: this._locationOptions,\n\t\t\tloop: this._duration > duration,\n\t\t\tvolume: this._volume,\n\t\t\tchannel: this._channel,\n\t\t\tfadeIn: this._fadeInAudio,\n\t\t\tfadeOut: this._fadeOutAudio,\n\t\t\tstartTime: startTime,\n\t\t\tduration: this._duration || duration,\n\t\t\tsceneId: this._source?.parent?.id || game.user.viewedScene,\n\t\t\tusers: this._users ? Array.from(this._users) : null,\n\t\t\tname: this._name,\n\t\t\torigin: this._origin,\n\t\t\tseed: `${this._name}-${foundry.utils.randomID()}-${this._currentRepetition}`,\n      nameOffsetMap: this.sequence.nameOffsetMap,\n\t\t};\n\n\t\tfor (let override of this._overrides) {\n\t\t\tdata = await override(this, data);\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tasync _serialize() {\n\t\tconst data = await super._serialize();\n\t\tconst sectionData = await this._sanitizeSoundData();\n\t\treturn {\n\t\t\t...data,\n\t\t\ttype: \"sound\",\n\t\t\tsectionData,\n\t\t};\n\t}\n\n\tasync _deserialize(data) {\n\t\tthis._deserializedData = data.sectionData;\n\t\treturn super._deserialize(data);\n\t}\n}\n\nexport default SoundSection;\n","import * as lib from \"../lib/lib.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport Section from \"./section.js\";\nimport traits from \"./traits/_traits.js\";\nimport { sequencerSocket, SOCKET_HANDLERS } from \"../sockets.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\n\nclass AnimationSection extends Section {\n\tstatic niceName = \"Animation\";\n\n\tconstructor(inSequence, inTarget) {\n\t\tsuper(inSequence);\n\t\tthis._teleportTo = false;\n\t\tthis._originObject = false;\n\t\tthis._moveSpeed = 23;\n\t\tthis._offset = { x: 0, y: 0 };\n\t\tthis._closestSquare = false;\n\t\tthis._snapToGrid = false;\n\t\tthis._hide = undefined;\n\t\tif (inTarget) this.on(inTarget);\n\t}\n\n\t/**\n\t * Sets the target object to be animated\n\t *\n\t * @param {object|string} inTarget\n\t * @returns {AnimationSection}\n\t */\n\ton(inTarget) {\n\t\tinTarget = this._validateLocation(inTarget);\n\t\tif (!inTarget)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"on\",\n\t\t\t\t\"could not find position of given object\"\n\t\t\t);\n\t\tthis._originObject = this._validateLocation(inTarget);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the location to teleport the target object to\n\t *\n\t * @param {object|string} inTarget\n\t * @param {object} options\n\t * @returns {AnimationSection}\n\t */\n\tteleportTo(inTarget, options = {}) {\n\t\toptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tdelay: 0,\n\t\t\t\trelativeToCenter: false,\n\t\t\t},\n\t\t\toptions\n\t\t);\n\t\tif (!lib.is_real_number(options.delay))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"teleportTo\",\n\t\t\t\t\"options.delay must be of type number\"\n\t\t\t);\n\t\tinTarget = this._validateLocation(inTarget);\n\t\tif (!inTarget)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"teleportTo\",\n\t\t\t\t\"could not find position of given object\"\n\t\t\t);\n\t\toptions.target = this._validateLocation(inTarget);\n\t\tthis._teleportTo = options;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the location to rotate the object to\n\t *\n\t * @param {object|string} inLocation\n\t * @param {object} options\n\t * @returns this\n\t */\n\trotateTowards(inLocation, options = {}) {\n\t\toptions = foundry.utils.mergeObject(\n\t\t\t{\n\t\t\t\tduration: 0,\n\t\t\t\tease: \"linear\",\n\t\t\t\tdelay: 0,\n\t\t\t\trotationOffset: 0,\n\t\t\t\ttowardsCenter: true,\n\t\t\t\tcacheLocation: false,\n\t\t\t},\n\t\t\toptions\n\t\t);\n\t\tif (!lib.is_real_number(options.duration))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"options.duration must be of type number\"\n\t\t\t);\n\t\tif (typeof options.ease !== \"string\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"options.ease must be of type string\"\n\t\t\t);\n\t\tif (!lib.is_real_number(options.delay))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"options.delay must be of type number\"\n\t\t\t);\n\t\tif (!lib.is_real_number(options.rotationOffset))\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"options.rotationOffset must be of type number\"\n\t\t\t);\n\t\tif (typeof options.towardsCenter !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"options.towardsCenter must be of type boolean\"\n\t\t\t);\n\t\tif (typeof options.cacheLocation !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"options.cacheLocation must be of type boolean\"\n\t\t\t);\n\t\toptions.target = this._validateLocation(inLocation);\n\t\tif (!options.target)\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"rotateTowards\",\n\t\t\t\t\"could not find position of given object\"\n\t\t\t);\n\t\toptions.target = options.cacheLocation\n\t\t\t? canvaslib.get_object_position(options.target, { measure: true })\n\t\t\t: options.target;\n\t\tthis._rotateTowards = options;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the movement or teleportation to be offset in the X and/or Y axis\n\t *\n\t * @param {object} inOffset\n\t * @returns {AnimationSection}\n\t */\n\toffset(inOffset) {\n\t\tinOffset = foundry.utils.mergeObject({ x: 0, y: 0 }, inOffset);\n\t\tthis._offset = this._validateLocation(inOffset);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the movement or teleportation to pick the closest non-intersecting square, if the target is a token or tile\n\t *\n\t * @param {boolean} inBool\n\t * @returns {AnimationSection}\n\t */\n\tclosestSquare(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"closestSquare\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._closestSquare = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the final location to be snapped to the grid\n\t *\n\t * @param {boolean} inBool\n\t * @returns {AnimationSection}\n\t */\n\tsnapToGrid(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"snapToGrid\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._snapToGrid = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the object to become hidden\n\t *\n\t * @param {boolean} inBool\n\t * @returns {AnimationSection}\n\t */\n\thide(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"hide\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._hide = inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the object to become visible\n\t *\n\t * @param {boolean} inBool\n\t * @returns {AnimationSection}\n\t */\n\tshow(inBool = true) {\n\t\tif (typeof inBool !== \"boolean\")\n\t\t\tthrow this.sequence._customError(\n\t\t\t\tthis,\n\t\t\t\t\"show\",\n\t\t\t\t\"inBool must be of type boolean\"\n\t\t\t);\n\t\tthis._hide = !inBool;\n\t\treturn this;\n\t}\n\n\t/**\n\t * @private\n\t */\n\tasync run() {\n\t\treturn this._runAnimate();\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_applyTraits() {\n\t\tObject.assign(this.constructor.prototype, traits.moves);\n\t\tObject.assign(this.constructor.prototype, traits.opacity);\n\t\tObject.assign(this.constructor.prototype, traits.rotation);\n\t\tObject.assign(this.constructor.prototype, traits.audio);\n\t\tObject.assign(this.constructor.prototype, traits.tint);\n\t}\n\n\t/**\n\t * @private\n\t */\n\tasync _updateObject(obj, updates, animate = false, animation = {}) {\n\t\tconst uuid = obj?.uuid ?? obj?.document?.uuid;\n\t\tawait sequencerSocket.executeAsGM(\n\t\t\tSOCKET_HANDLERS.UPDATE_DOCUMENT,\n\t\t\tuuid,\n\t\t\tupdates,\n\t\t\t{ animate, animation, teleport: !!this._teleportTo }\n\t\t);\n\t}\n\n\t/**\n\t * @private\n\t */\n\tasync _waitForTokenRefresh(obj) {\n\t\tlet token;\n\n\t\tif (obj instanceof FoundryShim.Token) {\n\t\t\ttoken = obj;\n\t\t}\n\n\t\tif (obj instanceof TokenDocument) {\n\t\t\ttoken = obj.object;\n\t\t}\n\n\t\tif (token == null || token.mesh != null) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet refreshTokenID;\n\n\t\treturn await new Promise((resolve) => {\n\t\t\trefreshTokenID = Hooks.on(\"refreshToken\", async (tokenDoc) => {\n\t\t\t\tif (tokenDoc.document.actorId !== token.document.actorId || !token.mesh)\n\t\t\t\t\treturn;\n\t\t\t\tHooks.off(\"refreshToken\", refreshTokenID);\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * @private\n\t */\n\tasync _execute() {\n\t\tif (!(await this._shouldPlay())) return;\n\t\tlet self = this;\n\t\tthis._basicDelay = lib.random_float_between(this._delayMin, this._delayMax);\n\t\treturn new Promise(async (resolve) => {\n\t\t\tsetTimeout(async () => {\n\t\t\t\tawait this._waitForTokenRefresh(this._originObject);\n\t\t\t\tif (this._shouldAsync) {\n\t\t\t\t\tawait self.run();\n\t\t\t\t} else {\n\t\t\t\t\tself.run();\n\t\t\t\t}\n\t\t\t\tresolve();\n\t\t\t}, this._basicDelay);\n\t\t});\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_getClosestSquare(origin, target) {\n\t\tlet originLoc = canvaslib.get_object_position(origin, { exact: true });\n\t\tlet targetLoc = canvaslib.get_object_position(target, { exact: true });\n\n\t\tlet originDimensions = canvaslib.get_object_dimensions(origin);\n\t\tlet targetDimensions = canvaslib.get_object_dimensions(target);\n\n\t\tlet originBottom = Math.max(\n\t\t\toriginDimensions.width - canvas.grid.size,\n\t\t\tcanvas.grid.size\n\t\t);\n\t\tlet originRight = Math.max(\n\t\t\toriginDimensions.height - canvas.grid.size,\n\t\t\tcanvas.grid.size\n\t\t);\n\n\t\tlet ray = new Ray(originLoc, targetLoc);\n\n\t\tlet dx = ray.dx;\n\t\tlet dy = ray.dy;\n\n\t\tif (dx > 0 && Math.abs(dx) > originRight) {\n\t\t\tdx -= originDimensions.width;\n\t\t} else if (dx < 0 && Math.abs(dx) > targetDimensions.width) {\n\t\t\tdx += targetDimensions.height;\n\t\t} else {\n\t\t\tdx = 0;\n\t\t}\n\n\t\tif (dy > 0 && Math.abs(dy) > originBottom) {\n\t\t\tdy -= originDimensions.height;\n\t\t} else if (dy < 0 && Math.abs(dy) > targetDimensions.height) {\n\t\t\tdy += targetDimensions.height;\n\t\t} else {\n\t\t\tdy = 0;\n\t\t}\n\n\t\tconst pos = {\n\t\t\tx: originLoc.x + dx,\n\t\t\ty: originLoc.y + dy,\n\t\t\televation: targetLoc?.elevation,\n\t\t};\n\n\t\tif (!pos.elevation) {\n\t\t\tdelete pos[\"elevation\"];\n\t\t}\n\n\t\treturn pos;\n\t}\n\n\t/**\n\t * This needs a rewrite, jeesus.\n\t */\n\tasync _runAnimate() {\n\t\tlet animData = {\n\t\t\tattributes: [],\n\t\t\tmaxFPS: 1000 / game.settings.get(\"core\", \"maxFPS\"),\n\t\t\tlastTimespan: performance.now(),\n\t\t\ttotalDt: 0,\n\t\t};\n\n\t\tif (typeof this._moveTowards?.target === \"string\" && this.sequence.nameOffsetMap[this._moveTowards?.target]) {\n\t\t\tthis._moveTowards.target = this.sequence.nameOffsetMap[this._moveTowards?.target].target ?? this.sequence.nameOffsetMap[this._moveTowards?.target].source;\n\t\t}\n\n\t\tif (typeof this._teleportTo?.target === \"string\" && this.sequence.nameOffsetMap[this._teleportTo?.target]) {\n\t\t\tthis._teleportTo.target = this.sequence.nameOffsetMap[this._teleportTo?.target].target ?? this.sequence.nameOffsetMap[this._teleportTo?.target].source;\n\t\t}\n\n\t\tif (typeof this._rotateTowards?.target === \"string\" && this.sequence.nameOffsetMap[this._rotateTowards?.target]) {\n\t\t\tthis._rotateTowards.target = this.sequence.nameOffsetMap[this._rotateTowards?.target].target ?? this.sequence.nameOffsetMap[this._rotateTowards?.target].source;\n\t\t}\n\n\t\tlet overallDuration = this._duration ? this._duration : 0;\n\t\tconst originLocation = canvaslib.get_object_position(this._originObject, {\n\t\t\texact: true,\n\t\t});\n\n\t\tif (this._rotateTowards) {\n\t\t\tlet offset =\n\t\t\t\t(this._angle ? this._angle : 0) + this._rotateTowards.rotationOffset;\n\n\t\t\tlet targetLoc =\n\t\t\t\tthis._moveTowards?.target ||\n\t\t\t\tthis._teleportTo?.target ||\n\t\t\t\tthis._originObject;\n\n\t\t\ttargetLoc = this._closestSquare\n\t\t\t\t? this._getClosestSquare(this._originObject, targetLoc)\n\t\t\t\t: canvaslib.get_object_position(targetLoc, { exact: true });\n\n\t\t\ttargetLoc.x += this._offset.x;\n\t\t\ttargetLoc.y += this._offset.y;\n\n\t\t\tif (this._snapToGrid) {\n\t\t\t\ttargetLoc = canvas.grid.getSnappedPoint(targetLoc, { mode: CONST.GRID_SNAPPING_MODES.CENTER, resolution: 1 })\n\t\t\t}\n\n\t\t\tif (this._originObject instanceof TokenDocument) {\n\t\t\t\tsetTimeout(async () => {\n\t\t\t\t\tlet startLocation = this._originObject.object?.center ?? targetLoc;\n\t\t\t\t\tlet targetLocation =\n\t\t\t\t\t\tthis._rotateTowards.target?.object ?? this._rotateTowards.target;\n\t\t\t\t\tif (this._rotateTowards.towardsCenter) {\n\t\t\t\t\t\ttargetLocation = targetLocation?.center ?? targetLocation;\n\t\t\t\t\t}\n\t\t\t\t\tlet ray = new Ray(startLocation, targetLocation);\n\t\t\t\t\tlet angle = Math.normalizeDegrees((ray.angle * 180) / Math.PI - 90);\n\t\t\t\t\tangle += offset;\n\t\t\t\t\tawait this._updateObject(\n\t\t\t\t\t\tthis._originObject,\n\t\t\t\t\t\t{ rotation: angle },\n\t\t\t\t\t\tthis._rotateTowards.duration > 0,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tduration: this._rotateTowards.duration\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}, this._rotateTowards.delay ?? 0);\n\t\t\t} else {\n\t\t\t\tanimData.attributes.push({\n\t\t\t\t\tname: \"rotationTowards\",\n\t\t\t\t\toffset: offset,\n\t\t\t\t\torigin: this._originObject,\n\t\t\t\t\toriginLocation: targetLoc,\n\t\t\t\t\ttarget:\n\t\t\t\t\t\tthis._rotateTowards.target?.object ?? this._rotateTowards.target,\n\t\t\t\t\ttowardsCenter: this._rotateTowards.towardsCenter,\n\t\t\t\t\tfrom: false,\n\t\t\t\t\tto: false,\n\t\t\t\t\tprogress: 0,\n\t\t\t\t\tdone: false,\n\t\t\t\t\tduration: this._rotateTowards.duration,\n\t\t\t\t\tdurationDone: 0,\n\t\t\t\t\tdelay: this._rotateTowards.delay,\n\t\t\t\t\tease: this._rotateTowards.ease,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet rotateDuration =\n\t\t\t\tthis._rotateTowards.duration + this._rotateTowards.delay;\n\n\t\t\toverallDuration =\n\t\t\t\toverallDuration > rotateDuration ? overallDuration : rotateDuration;\n\t\t}\n\n\t\tif (this._fadeIn) {\n\t\t\tlet to = lib.is_real_number(this._opacity) ? this._opacity : 1.0;\n\n\t\t\tif (this._originObject instanceof TokenDocument) {\n\t\t\t\tsetTimeout(async () => {\n\t\t\t\t\tawait this._updateObject(this._originObject, { alpha: to }, true, {\n\t\t\t\t\t\tduration: this._fadeIn.duration,\n\t\t\t\t\t\teasing: this._fadeIn.ease,\n\t\t\t\t\t});\n\t\t\t\t}, this._fadeIn.delay ?? 0);\n\t\t\t} else {\n\t\t\t\tanimData.attributes.push({\n\t\t\t\t\tname: \"alpha\",\n\t\t\t\t\tfrom: 0.0,\n\t\t\t\t\tto: to,\n\t\t\t\t\tprogress: 0,\n\t\t\t\t\tdone: false,\n\t\t\t\t\tduration: this._fadeIn.duration,\n\t\t\t\t\tdurationDone: 0,\n\t\t\t\t\tdelay: this._fadeIn.delay,\n\t\t\t\t\tease: this._fadeIn.ease,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet fadeDuration = this._fadeIn.duration + this._fadeIn.delay;\n\n\t\t\toverallDuration =\n\t\t\t\toverallDuration > fadeDuration ? overallDuration : fadeDuration;\n\t\t}\n\n\t\tif (this._fadeInAudio && this._originObject?.video?.volume !== undefined) {\n\t\t\tlet to = lib.is_real_number(this._volume) ? this._volume : 1.0;\n\n\t\t\tanimData.attributes.push({\n\t\t\t\tname: \"video.volume\",\n\t\t\t\tfrom: 0.0,\n\t\t\t\tto: to,\n\t\t\t\tprogress: 0,\n\t\t\t\tdone: false,\n\t\t\t\tduration: this._fadeInAudio.duration,\n\t\t\t\tdurationDone: 0,\n\t\t\t\tdelay: this._fadeInAudio.delay,\n\t\t\t\tease: this._fadeInAudio.ease,\n\t\t\t});\n\n\t\t\tlet fadeDuration = this._fadeInAudio.duration + this._fadeInAudio.delay;\n\n\t\t\toverallDuration =\n\t\t\t\toverallDuration > fadeDuration ? overallDuration : fadeDuration;\n\t\t}\n\n\t\tif (this._rotateIn) {\n\t\t\tlet from = this._angle ? this._angle : this._originObject.rotation;\n\t\t\tlet to = this._rotateIn.value;\n\n\t\t\tif (Math.abs(from - to) > 180) {\n\t\t\t\tif (to < 0) {\n\t\t\t\t\tto += 360;\n\t\t\t\t} else if (from > to) {\n\t\t\t\t\tfrom -= 360;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._originObject instanceof TokenDocument) {\n\t\t\t\tsetTimeout(async () => {\n\t\t\t\t\tif (this._originObject.rotation !== from) {\n\t\t\t\t\t\tawait this._updateObject(\n\t\t\t\t\t\t\tthis._originObject,\n\t\t\t\t\t\t\t{ rotation: from },\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tawait this._updateObject(this._originObject, { rotation: to }, true, {\n\t\t\t\t\t\tduration: this._rotateIn.duration,\n\t\t\t\t\t});\n\t\t\t\t}, this._rotateIn.delay ?? 0);\n\t\t\t} else {\n\t\t\t\tanimData.attributes.push({\n\t\t\t\t\tname: \"rotation\",\n\t\t\t\t\tfrom: from,\n\t\t\t\t\tto: to,\n\t\t\t\t\tprogress: 0,\n\t\t\t\t\tdone: false,\n\t\t\t\t\tduration: this._rotateIn.duration,\n\t\t\t\t\tdurationDone: 0,\n\t\t\t\t\tdelay: this._rotateIn.delay,\n\t\t\t\t\tease: this._rotateIn.ease,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet rotateDuration = this._rotateIn.duration + this._rotateIn.delay;\n\n\t\t\toverallDuration =\n\t\t\t\toverallDuration > rotateDuration ? overallDuration : rotateDuration;\n\t\t}\n\n\t\tif (this._moveTowards) {\n\t\t\tlet originLocation = canvaslib.get_object_position(this._originObject, {\n\t\t\t\texact: true,\n\t\t\t});\n\t\t\tlet targetLocation = this._closestSquare\n\t\t\t\t? this._getClosestSquare(this._originObject, this._moveTowards.target)\n\t\t\t\t: canvaslib.get_object_position(this._moveTowards.target, {\n\t\t\t\t\texact: true,\n\t\t\t\t});\n\n\t\t\ttargetLocation.x += this._offset.x;\n\t\t\ttargetLocation.y += this._offset.y;\n\t\t\ttargetLocation.elevation =\n\t\t\t\ttargetLocation?.elevation ?? this._originObject?.elevation;\n\n\t\t\tif (this._moveTowards.relativeToCenter) {\n\t\t\t\tconst dimensions = canvaslib.get_object_dimensions(this._originObject);\n\t\t\t\ttargetLocation.x -= dimensions.width / 2;\n\t\t\t\ttargetLocation.y -= dimensions.height / 2;\n\t\t\t\tif (this._snapToGrid) {\n\t\t\t\t\ttargetLocation.x -= 0.01;\n\t\t\t\t\ttargetLocation.y -= 0.01;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._snapToGrid) {\n\t\t\t\ttargetLocation = canvas.grid.getSnappedPoint(targetLocation, {\n\t\t\t\t\tmode: CONST.GRID_SNAPPING_MODES.VERTEX,\n\t\t\t\t\tresolution: 1\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tlet originalDx = targetLocation.x - originLocation.x;\n\t\t\tlet originalDy = targetLocation.y - originLocation.y;\n\t\t\tlet originalDistance = Math.sqrt(\n\t\t\t\toriginalDx * originalDx + originalDy * originalDy\n\t\t\t);\n\n\t\t\tlet duration = this._duration\n\t\t\t\t? this._duration\n\t\t\t\t: (originalDistance / this._moveSpeed) * animData.maxFPS;\n\n\t\t\tlet moveDuration = duration + this._moveTowards.delay;\n\n\t\t\toverallDuration =\n\t\t\t\toverallDuration > moveDuration ? overallDuration : moveDuration;\n\n\t\t\tif (this._originObject instanceof TokenDocument) {\n\t\t\t\tsetTimeout(async () => {\n\t\t\t\t\tawait this._updateObject(this._originObject, targetLocation, true, {\n\t\t\t\t\t\tmovementSpeed: this._moveSpeed,\n\t\t\t\t\t\tduration\n\t\t\t\t\t});\n\t\t\t\t}, this._moveTowards.delay ?? 0);\n\t\t\t} else {\n\t\t\t\tif (!(duration === 0 || originalDistance === 0)) {\n\t\t\t\t\tanimData.attributes.push({\n\t\t\t\t\t\tname: \"position\",\n\t\t\t\t\t\torigin: originLocation,\n\t\t\t\t\t\ttarget: targetLocation,\n\t\t\t\t\t\toriginalDistance: originalDistance,\n\t\t\t\t\t\tcurrentDistance: 0,\n\t\t\t\t\t\tprogress: 0,\n\t\t\t\t\t\tspeed: 0,\n\t\t\t\t\t\tduration: duration,\n\t\t\t\t\t\tdone: false,\n\t\t\t\t\t\tease: this._moveTowards.ease,\n\t\t\t\t\t\tdelay: this._moveTowards.delay,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this._fadeOut) {\n\t\t\tlet from = lib.is_real_number(this._opacity)\n\t\t\t\t? this._opacity\n\t\t\t\t: this._originObject.alpha ?? 1.0;\n\n\t\t\tif (this._originObject instanceof TokenDocument) {\n\t\t\t\tsetTimeout(async () => {\n\t\t\t\t\tawait this._updateObject(this._originObject, { alpha: 0 }, true, {\n\t\t\t\t\t\tduration: this._fadeOut.duration\n\t\t\t\t\t});\n\t\t\t\t}, this._fadeOut.delay ?? 0);\n\t\t\t} else {\n\t\t\t\tanimData.attributes.push({\n\t\t\t\t\tname: \"alpha\",\n\t\t\t\t\tfrom: from,\n\t\t\t\t\tto: 0.0,\n\t\t\t\t\tprogress: 0,\n\t\t\t\t\tdone: false,\n\t\t\t\t\tduration: this._fadeOut.duration,\n\t\t\t\t\tdurationDone: 0,\n\t\t\t\t\tdelay: overallDuration - this._fadeOut.duration,\n\t\t\t\t\tease: this._fadeOut.ease,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet fadeOutDuration = this._fadeOut.duration + this._fadeOut.delay;\n\n\t\t\toverallDuration =\n\t\t\t\toverallDuration > fadeOutDuration ? overallDuration : fadeOutDuration;\n\t\t}\n\n\t\tif (this._fadeOutAudio && this._originObject?.video?.volume !== undefined) {\n\t\t\tlet from = lib.is_real_number(this._volume)\n\t\t\t\t? this._volume\n\t\t\t\t: this._originObject.video.volume;\n\n\t\t\tanimData.attributes.push({\n\t\t\t\tname: \"video.volume\",\n\t\t\t\tfrom: from,\n\t\t\t\tto: 0.0,\n\t\t\t\tprogress: 0,\n\t\t\t\tdone: false,\n\t\t\t\tduration: this._fadeOutAudio.duration,\n\t\t\t\tdurationDone: 0,\n\t\t\t\tdelay: overallDuration - this._fadeOutAudio.duration,\n\t\t\t\tease: this._fadeOutAudio.ease,\n\t\t\t});\n\n\t\t\tlet fadeOutAudioDuration =\n\t\t\t\tthis._fadeOutAudio.duration + this._fadeOutAudio.delay;\n\n\t\t\toverallDuration =\n\t\t\t\toverallDuration > fadeOutAudioDuration\n\t\t\t\t\t? overallDuration\n\t\t\t\t\t: fadeOutAudioDuration;\n\t\t}\n\n\t\tif (this._rotateOut) {\n\t\t\tlet from = this._rotateOut.value;\n\t\t\tlet to = this._angle ? this._angle : this._originObject.rotation;\n\n\t\t\tif (this._rotateIn) from += this._rotateIn.value;\n\n\t\t\tif (Math.abs(from - to) > 180) {\n\t\t\t\tif (to < 0) {\n\t\t\t\t\tto += 360;\n\t\t\t\t} else if (from > to) {\n\t\t\t\t\tfrom -= 360;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._originObject instanceof TokenDocument) {\n\t\t\t\tsetTimeout(async () => {\n\t\t\t\t\tif (this._originObject.rotation !== from) {\n\t\t\t\t\t\tawait this._updateObject(\n\t\t\t\t\t\t\tthis._originObject,\n\t\t\t\t\t\t\t{ rotation: from },\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tawait this._updateObject(this._originObject, { rotation: to }, true, {\n\t\t\t\t\t\tduration: this._rotateOut.duration\n\t\t\t\t\t});\n\t\t\t\t}, this._rotateOut.delay ?? 0);\n\t\t\t} else {\n\t\t\t\tanimData.attributes.push({\n\t\t\t\t\tname: \"rotation\",\n\t\t\t\t\tfrom: from,\n\t\t\t\t\tto: to,\n\t\t\t\t\tprogress: 0,\n\t\t\t\t\tdone: false,\n\t\t\t\t\tduration: this._rotateOut.duration,\n\t\t\t\t\tdurationDone: 0,\n\t\t\t\t\tdelay: overallDuration - this._rotateOut.duration,\n\t\t\t\t\tease: this._rotateOut.ease,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet rotateOutDuration = this._rotateOut.duration + this._rotateOut.delay;\n\n\t\t\toverallDuration =\n\t\t\t\toverallDuration > rotateOutDuration\n\t\t\t\t\t? overallDuration\n\t\t\t\t\t: rotateOutDuration;\n\t\t}\n\n\t\tif (this._teleportTo) {\n\t\t\tsetTimeout(async () => {\n\t\t\t\tlet targetLocation = this._closestSquare\n\t\t\t\t\t? this._getClosestSquare(this._originObject, this._teleportTo.target)\n\t\t\t\t\t: canvaslib.get_object_position(this._teleportTo.target, {\n\t\t\t\t\t\texact: true,\n\t\t\t\t\t});\n\t\t\t\tif (targetLocation.x === undefined) targetLocation.x = originLocation.x;\n\t\t\t\tif (targetLocation.y === undefined) targetLocation.y = originLocation.y;\n\t\t\t\tif (targetLocation.elevation === undefined)\n\t\t\t\t\ttargetLocation.elevation = originLocation.elevation;\n\t\t\t\ttargetLocation.x += this._offset.x;\n\t\t\t\ttargetLocation.y += this._offset.y;\n\t\t\t\ttargetLocation.elevation =\n\t\t\t\t\ttargetLocation?.elevation ?? this._originObject?.elevation;\n\t\t\t\tconst dimensions = canvaslib.get_object_dimensions(this._originObject);\n\t\t\t\tif (this._teleportTo.relativeToCenter) {\n\t\t\t\t\ttargetLocation.x -= dimensions.width / 2;\n\t\t\t\t\ttargetLocation.y -= dimensions.height / 2;\n\t\t\t\t\tif (this._snapToGrid) {\n\t\t\t\t\t\ttargetLocation.x -= 0.01;\n\t\t\t\t\t\ttargetLocation.y -= 0.01;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this._snapToGrid) {\n\t\t\t\t\ttargetLocation.x -= dimensions.width / 2;\n\t\t\t\t\ttargetLocation.y -= dimensions.height / 2;\n\t\t\t\t\ttargetLocation = canvas.grid.getSnappedPoint(targetLocation, {\n\t\t\t\t\t\tmode: CONST.GRID_SNAPPING_MODES.VERTEX,\n\t\t\t\t\t\tresolution: 1\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tawait this._updateObject(this._originObject, targetLocation, false);\n\t\t\t}, this._teleportTo.delay);\n\t\t\tif (overallDuration <= this._teleportTo.delay) {\n\t\t\t\tthis._waitUntilFinished = true;\n\t\t\t}\n\t\t\toverallDuration =\n\t\t\t\toverallDuration > this._teleportTo.delay\n\t\t\t\t\t? overallDuration\n\t\t\t\t\t: this._teleportTo.delay;\n\t\t}\n\n\t\tlet updateAttributes = {};\n\t\tif (\n\t\t\tlib.is_real_number(this._angle) &&\n\t\t\t!this._rotateIn &&\n\t\t\t!this._rotateOut\n\t\t) {\n\t\t\tupdateAttributes[\"rotation\"] = this._angle;\n\t\t}\n\n\t\tif (lib.is_real_number(this._opacity) && !this._fadeIn && !this._fadeOut) {\n\t\t\tupdateAttributes[\"alpha\"] = this._opacity;\n\t\t}\n\n\t\tif (\n\t\t\tlib.is_real_number(this._volume) &&\n\t\t\t!this._fadeInAudio &&\n\t\t\t!this._fadeOutAudio &&\n\t\t\tthis._originObject?.video?.volume !== undefined\n\t\t) {\n\t\t\tupdateAttributes[\"video.volume\"] = this._volume;\n\t\t}\n\n\t\tif (this._tint) {\n\t\t\tupdateAttributes[\"texture.tint\"] = this._tint.hexadecimal;\n\t\t}\n\n\t\tif (this._hide !== undefined) {\n\t\t\tupdateAttributes[\"hidden\"] = this._hide;\n\t\t}\n\n\t\tif (Object.keys(updateAttributes).length) {\n\t\t\tawait lib.wait(1);\n\t\t\tawait this._updateObject(this._originObject, updateAttributes);\n\t\t\tawait lib.wait(1);\n\t\t}\n\n\t\treturn new Promise(async (resolve) => {\n\t\t\tthis._animate(animData, resolve);\n\t\t\tsetTimeout(\n\t\t\t\tresolve,\n\t\t\t\tMath.max(0, overallDuration + this._currentWaitTime + animData.maxFPS)\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * @private\n\t */\n\tasync _animate(animData, resolve, timespan) {\n\t\t// If it's not the first tick\n\t\tif (timespan) {\n\t\t\tlet animatedAttributes = {};\n\n\t\t\tlet dt = timespan - animData.lastTimespan;\n\n\t\t\t// Limit to set FPS\n\t\t\tif (dt >= animData.maxFPS) {\n\t\t\t\tanimData.totalDt += dt;\n\n\t\t\t\tfor (let attribute of animData.attributes) {\n\t\t\t\t\tif (attribute.done) continue;\n\n\t\t\t\t\tif (animData.totalDt < attribute.delay) continue;\n\n\t\t\t\t\tif (attribute.name === \"position\") {\n\t\t\t\t\t\tattribute.speed =\n\t\t\t\t\t\t\tattribute.originalDistance / (attribute.duration / dt);\n\n\t\t\t\t\t\tattribute.currentDistance += attribute.speed;\n\n\t\t\t\t\t\tattribute.progress =\n\t\t\t\t\t\t\tattribute.currentDistance / attribute.originalDistance;\n\n\t\t\t\t\t\tlet x = lib.interpolate(\n\t\t\t\t\t\t\tattribute.origin.x,\n\t\t\t\t\t\t\tattribute.target.x,\n\t\t\t\t\t\t\tattribute.progress,\n\t\t\t\t\t\t\tattribute.ease\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet y = lib.interpolate(\n\t\t\t\t\t\t\tattribute.origin.y,\n\t\t\t\t\t\t\tattribute.target.y,\n\t\t\t\t\t\t\tattribute.progress,\n\t\t\t\t\t\t\tattribute.ease\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (attribute.currentDistance >= attribute.originalDistance) {\n\t\t\t\t\t\t\tx = attribute.target.x;\n\t\t\t\t\t\t\ty = attribute.target.y;\n\t\t\t\t\t\t\tattribute.done = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tanimatedAttributes[\"x\"] = x;\n\t\t\t\t\t\tanimatedAttributes[\"y\"] = y;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tattribute.name === \"rotationTowards\" &&\n\t\t\t\t\t\t\t!attribute.from &&\n\t\t\t\t\t\t\t!attribute.to\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tlet target = attribute.target;\n\t\t\t\t\t\t\tif (this._rotateTowards.towardsCenter)\n\t\t\t\t\t\t\t\ttarget = target?.center ?? target;\n\t\t\t\t\t\t\tlet ray = new Ray(attribute.originLocation, target);\n\t\t\t\t\t\t\tlet angle = (ray.angle * 180) / Math.PI - 90;\n\t\t\t\t\t\t\tangle += attribute.offset;\n\t\t\t\t\t\t\tattribute.from = attribute.origin.rotation;\n\t\t\t\t\t\t\tattribute.to = angle;\n\t\t\t\t\t\t\tif (Math.abs(attribute.from - attribute.to) > 180) {\n\t\t\t\t\t\t\t\tif (attribute.to < 0) {\n\t\t\t\t\t\t\t\t\tattribute.to += 360;\n\t\t\t\t\t\t\t\t} else if (attribute.from > attribute.to) {\n\t\t\t\t\t\t\t\t\tattribute.from -= 360;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tattribute.name = \"rotation\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tattribute.durationDone += dt;\n\n\t\t\t\t\t\tattribute.progress = attribute.durationDone / attribute.duration;\n\n\t\t\t\t\t\tlet val = lib.interpolate(\n\t\t\t\t\t\t\tattribute.from,\n\t\t\t\t\t\t\tattribute.to,\n\t\t\t\t\t\t\tattribute.progress,\n\t\t\t\t\t\t\tattribute.ease\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (attribute.progress >= 1.0) {\n\t\t\t\t\t\t\tval = attribute.to;\n\t\t\t\t\t\t\tattribute.done = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tanimatedAttributes[attribute.name] = val;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (Object.keys(animatedAttributes).length > 0) {\n\t\t\t\t\tawait this._updateObject(this._originObject, animatedAttributes);\n\t\t\t\t}\n\n\t\t\t\tanimData.attributes = animData.attributes.filter((a) => !a.done);\n\n\t\t\t\tif (animData.attributes.length === 0) return;\n\n\t\t\t\tanimData.lastTimespan = timespan;\n\t\t\t}\n\t\t}\n\n\t\tlet self = this;\n\t\trequestAnimationFrame(function (timespan) {\n\t\t\tself._animate(animData, resolve, timespan);\n\t\t});\n\t}\n}\n\nexport default AnimationSection;\n","import Section from \"./section.js\";\nimport traits from \"./traits/_traits.js\";\nimport * as lib from \"../lib/lib.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport SequencerFoundryReplicator from \"../modules/sequencer-foundry-replicator.js\";\nimport CrosshairsPlaceable from \"../modules/sequencer-crosshair/CrosshairsPlaceable.js\";\nimport CrosshairsDocument from \"../modules/sequencer-crosshair/CrosshairsDocument.js\";\n\nexport default class ScrollingTextSection extends Section {\n  constructor(inSequence, target, text, textOptions) {\n    super(inSequence);\n    this._deserializedData = null;\n    this._source = null;\n    this._text = \"\";\n    this._duration = 2000;\n    this._distance = null;\n    this._jitter = 0;\n    this._anchor = null;\n    this._direction = null;\n    this._seed = lib.get_hash(foundry.utils.randomID());\n    if (target) {\n      this.atLocation(target);\n    }\n    if (text) {\n      this.text(text, textOptions);\n    }\n  }\n\n  static niceName = \"Scrolling Text\";\n\n  /**\n   * @private\n   */\n  _applyTraits() {\n    Object.assign(this.constructor.prototype, traits.users);\n    Object.assign(this.constructor.prototype, traits.location);\n    Object.assign(this.constructor.prototype, traits.offset);\n    Object.assign(this.constructor.prototype, traits.text);\n  }\n\n  direction(inDirection) {\n    if (!(typeof inDirection === \"string\" || lib.is_real_number(inDirection))) {\n      throw this.sequence._customError(\n        this,\n        \"direction\",\n        \"inDirection must be of type string (CONST.TEXT_ANCHOR_POINTS) or number\"\n      );\n    }\n    if (\n      typeof inDirection === \"string\" &&\n      !CONST.TEXT_ANCHOR_POINTS[inDirection]\n    ) {\n      throw this.sequence._customError(\n        this,\n        \"direction\",\n        `${inDirection} does not exist in CONST.TEXT_ANCHOR_POINTS!`\n      );\n    } else if (typeof inDirection === \"string\") {\n      this._direction = CONST.TEXT_ANCHOR_POINTS[inDirection];\n    } else {\n      this._direction = inDirection;\n    }\n    return this;\n  }\n\n  anchor(inAnchor) {\n    if (!(typeof inAnchor === \"string\" || lib.is_real_number(inAnchor))) {\n      throw this.sequence._customError(\n        this,\n        \"direction\",\n        \"inAnchor must be of type string (CONST.TEXT_ANCHOR_POINTS) or number\"\n      );\n    }\n    if (\n      (typeof inAnchor === \"string\" && CONST.TEXT_ANCHOR_POINTS[inAnchor] === undefined) ||\n      (lib.is_real_number(inAnchor) &&\n        !Object.values(CONST.TEXT_ANCHOR_POINTS).includes(inAnchor))\n    ) {\n      throw this.sequence._customError(\n        this,\n        \"direction\",\n        `${inAnchor} does not exist in CONST.TEXT_ANCHOR_POINTS!`\n      );\n    } else if (typeof inAnchor === \"string\") {\n      this._anchor = CONST.TEXT_ANCHOR_POINTS[inAnchor];\n    } else {\n      this._anchor = inAnchor;\n    }\n    return this;\n  }\n\n  jitter(inJitter) {\n    if (!(lib.is_real_number(inJitter) && inJitter >= 0 && inJitter <= 1.0)) {\n      throw this.sequence._customError(\n        this,\n        \"jitter\",\n        \"inJitter must be of type number between 0 and 1\"\n      );\n    }\n    this._jitter = inJitter;\n    return this;\n  }\n\n\tasync preRun() {\n\t\tconst oldSource = this._source;\n\t\tconst crosshairSource = this.sequence?.crosshairs?.[this._source];\n\t\tif (typeof this._source === \"string\" && crosshairSource) {\n\t\t\tthis._source = crosshairSource.uuid;\n\t\t}\n\t\tif (this._name && oldSource !== this._source) {\n\t\t\tthis.sequence.nameOffsetMap[this._name].source = this._getSourceObject();\n\t\t}\n\t}\n\n  async run() {\n    const data = await this._sanitizeTextData();\n    if (Hooks.call(\"preCreateScrollingText\", data) === false) return;\n    const push =\n      !(data?.users?.length === 1 && data?.users?.includes(game.userId)) &&\n      !this.sequence.localOnly;\n    const duration = SequencerFoundryReplicator.playScrollingText(data, push);\n    await new Promise((resolve) =>\n      setTimeout(resolve, this._currentWaitTime + duration)\n    );\n  }\n\n  _getSourceObject() {\n    if (!this._source || typeof this._source !== \"object\") return this._source;\n\t  if(this._source instanceof CrosshairsPlaceable || this._source instanceof CrosshairsDocument){\n\t\t  const doc = this._source?.document ?? this._source;\n\t\t  return doc.getOrientation().source;\n\t  }\n    return (\n      lib.get_object_identifier(this._source) ??\n      canvaslib.get_object_canvas_data(this._source)\n    );\n  }\n\n  async _sanitizeTextData() {\n    if (this._deserializedData) {\n      return this._deserializedData;\n    }\n\n    return {\n      sceneId: game.user.viewedScene,\n      seed: this._seed,\n      sequenceId: this.sequence.id,\n      creatorUserId: game.userId,\n      users: this._users ? Array.from(this._users) : false,\n      moduleName: this.sequence.moduleName,\n      source: this._getSourceObject(),\n      offset: this._offset?.source ?? false,\n      randomOffset: this._randomOffset?.source ?? false,\n      content: this._text?.text ?? \"\",\n\t    nameOffsetMap: this.sequence.nameOffsetMap,\n      options: {\n        anchor: this._anchor,\n        direction: this._direction,\n        duration: this._duration,\n        distance: this._distance,\n        jitter: this._jitter,\n        ...this._text,\n      },\n    };\n  }\n\n  async _serialize() {\n    const data = await super._serialize();\n    const sectionData = await this._sanitizeTextData();\n    return {\n      ...data,\n      type: \"scrollingText\",\n      sectionData,\n    };\n  }\n\n  async _deserialize(data) {\n    this._deserializedData = data.sectionData;\n    return super._deserialize(data);\n  }\n}\n","import Section from \"./section.js\";\nimport traits from \"./traits/_traits.js\";\nimport * as lib from \"../lib/lib.js\";\nimport { is_real_number } from \"../lib/lib.js\";\nimport * as canvaslib from \"../lib/canvas-lib.js\";\nimport SequencerFoundryReplicator from \"../modules/sequencer-foundry-replicator.js\";\nimport CrosshairsPlaceable from \"../modules/sequencer-crosshair/CrosshairsPlaceable.js\";\nimport CrosshairsDocument from \"../modules/sequencer-crosshair/CrosshairsDocument.js\";\n\nexport default class CanvasPanSection extends Section {\n  constructor(inSequence, target, duration, scale) {\n    super(inSequence);\n    this._deserializedData = null;\n    this._source = null;\n    this._duration = duration ?? 250;\n    this._speed = null;\n    this._scale = scale ?? 1.0;\n    this._lockView = null;\n    this._shake = null;\n    this._seed = lib.get_hash(foundry.utils.randomID());\n    if (target) {\n      this.atLocation(target);\n    }\n  }\n\n  static niceName = \"Canvas Pan\";\n\n  /**\n   * @private\n   */\n  _applyTraits() {\n    Object.assign(this.constructor.prototype, traits.users);\n    Object.assign(this.constructor.prototype, traits.location);\n    Object.assign(this.constructor.prototype, traits.offset);\n  }\n\n  /**\n   * Sets the speed (pixels per frame) of the canvas pan\n   *\n   * @param {number} inSpeed\n   * @returns this\n   */\n  speed(inSpeed) {\n    if (!is_real_number(inSpeed))\n      throw this.sequence._customError(\n        this,\n        \"speed\",\n        \"inSpeed must be of type number\"\n      );\n    if (inSpeed < 0) {\n      throw this.sequence._customError(\n        this,\n        \"speed\",\n        \"inSpeed must be greater or equal to 0\"\n      );\n    }\n    this._speed = inSpeed;\n    return this;\n  }\n\n  /**\n   * Sets the zoom level of the canvas pan\n   *\n   * @param {number} inScale\n   * @returns this\n   */\n  scale(inScale) {\n    if (!is_real_number(inScale))\n      throw this.sequence._customError(\n        this,\n        \"scale\",\n        \"inScale must be of type number\"\n      );\n    if (inScale <= 0) {\n      throw this.sequence._customError(\n        this,\n        \"scale\",\n        \"inScale must be greater than 0\"\n      );\n    }\n    this._scale = inScale;\n    return this;\n  }\n\n  /**\n   * Locks the canvas at the given location for the given duration\n   *\n   * @param {number} inDuration\n   * @returns this\n   */\n  lockView(inDuration) {\n    if (!is_real_number(inDuration))\n      throw this.sequence._customError(\n        this,\n        \"lockView\",\n        \"inDuration must be of type number\"\n      );\n    if (inDuration < 0) {\n      throw this.sequence._customError(\n        this,\n        \"lockView\",\n        \"inDuration must be greater or equal to 0\"\n      );\n    }\n    this._lockView = inDuration;\n    return this;\n  }\n\n  /**\n   * Shakes the canvas\n   *\n   * @param {number} duration\n   * @param {number} strength\n   * @param {number} frequency\n   * @param {number} fadeInDuration\n   * @param {number} fadeOutDuration\n   * @param {boolean} rotation\n   * @returns this\n   */\n  shake({\n    duration = 250,\n    strength = 20,\n    frequency = 10,\n    fadeInDuration = 0,\n    fadeOutDuration = 200,\n    rotation = true,\n  } = {}) {\n    if (!is_real_number(duration)) {\n      throw this.sequence._customError(\n        this,\n        \"shake\",\n        \"duration must be of type number\"\n      );\n    }\n    if (!is_real_number(strength)) {\n      throw this.sequence._customError(\n        this,\n        \"shake\",\n        \"strength must be of type number\"\n      );\n    }\n    if (!is_real_number(strength)) {\n      throw this.sequence._customError(\n        this,\n        \"shake\",\n        \"frequency must be of type number\"\n      );\n    }\n    if (!is_real_number(fadeInDuration)) {\n      throw this.sequence._customError(\n        this,\n        \"shake\",\n        \"fadeInDuration must be of type number\"\n      );\n    }\n    if (!is_real_number(fadeOutDuration)) {\n      throw this.sequence._customError(\n        this,\n        \"shake\",\n        \"fadeOutDuration must be of type number\"\n      );\n    }\n    if (typeof rotation !== \"boolean\") {\n      throw this.sequence._customError(\n        this,\n        \"shake\",\n        \"rotation must be of type boolean\"\n      );\n    }\n    this._shake = {\n      duration,\n      strength,\n      frequency,\n      fadeInDuration,\n      fadeOutDuration,\n      rotation,\n    };\n    return this;\n  }\n\n\tasync preRun() {\n\t\tconst oldSource = this._source;\n\t\tconst crosshairSource = this.sequence?.crosshairs?.[this._source];\n\t\tif (typeof this._source === \"string\" && crosshairSource) {\n\t\t\tthis._source = crosshairSource.uuid;\n\t\t}\n\t\tif (this._name && oldSource !== this._source) {\n\t\t\tthis.sequence.nameOffsetMap[this._name].source = this._getSourceObject();\n\t\t}\n\t}\n\n  async run() {\n    const data = await this._sanitizeData();\n    if (Hooks.call(\"preCanvasPan\", data) === false) return;\n    const push =\n      !(data?.users?.length === 1 && data?.users?.includes(game.userId)) &&\n      !this.sequence.localOnly;\n    const duration = SequencerFoundryReplicator.panCanvas(data, push);\n    await new Promise((resolve) =>\n      setTimeout(resolve, this._currentWaitTime + duration)\n    );\n  }\n\n  _getSourceObject() {\n    if (!this._source || typeof this._source !== \"object\") return this._source;\n\t  if(this._source instanceof CrosshairsPlaceable || this._source instanceof CrosshairsDocument){\n\t\t  const doc = this._source?.document ?? this._source;\n\t\t  return doc.getOrientation().source;\n\t  }\n    return (\n      lib.get_object_identifier(this._source) ??\n      canvaslib.get_object_canvas_data(this._source, { uuid: false })\n    );\n  }\n\n  async _sanitizeData() {\n    if (this._deserializedData) {\n      return this._deserializedData;\n    }\n\n    return {\n      sceneId: game.user.viewedScene,\n      seed: this._seed,\n      sequenceId: this.sequence.id,\n      creatorUserId: game.userId,\n      users: this._users ? Array.from(this._users) : false,\n      moduleName: this.sequence.moduleName,\n      source: this._getSourceObject(),\n      offset: this._offset?.source ?? false,\n      randomOffset: this._randomOffset?.source ?? false,\n      duration: this._duration,\n      speed: this._speed,\n      scale: this._scale,\n      lockView: this._lockView,\n      shake: this._shake,\n\t    nameOffsetMap: this.sequence.nameOffsetMap,\n    };\n  }\n\n  async _serialize() {\n    const data = await super._serialize();\n    const sectionData = await this._sanitizeData();\n    return {\n      ...data,\n      type: \"canvasPan\",\n      sectionData,\n    };\n  }\n\n  async _deserialize(data) {\n    this._deserializedData = data.sectionData;\n    return super._deserialize(data);\n  }\n}\n","import * as lib from \"../lib/lib.js\";\nimport Section from \"./section.js\";\n\nexport default class WaitSection extends Section {\n  constructor(inSequence, msMin, msMax) {\n    super(inSequence);\n    this._waitUntilFinished = true;\n    this._waitDuration = lib.random_int_between(msMin, Math.max(msMin, msMax));\n  }\n\n  static niceName = \"Wait\";\n\n  /**\n   * @returns {Promise<void>}\n   */\n  async run() {\n    lib.debug(\"Running wait\");\n    await new Promise(async (resolve) => {\n      setTimeout(resolve, this._waitDuration);\n    });\n  }\n\n  /**\n   * @returns {Promise}\n   * @private\n   */\n  async _execute() {\n    await this.run();\n  }\n\n  async _serialize() {\n    const data = await super._serialize();\n    return {\n      ...data,\n      type: \"wait\",\n      sectionData: {\n        waitDuration: this._waitDuration,\n      },\n    };\n  }\n\n  async _deserialize(data) {\n    this._waitDuration = data.sectionData.waitDuration;\n    return super._deserialize(data);\n  }\n}\n","import * as lib from \"../lib/lib.js\";\r\nimport Section from \"./section.js\";\r\nimport CrosshairsDocument from \"../modules/sequencer-crosshair/CrosshairsDocument.js\";\r\nimport traits from \"./traits/_traits.js\";\r\nimport CONSTANTS from \"../constants.js\";\r\n\r\nexport default class CrosshairSection extends Section {\r\n\tconstructor(inSequence, inName = \"\") {\r\n\t\tsuper(inSequence);\r\n\t\tthis._name = inName;\r\n\t\tthis._type = CONST.MEASURED_TEMPLATE_TYPES.CIRCLE;\r\n\t\tthis._distance = canvas.grid.distance/2;\r\n\t\tthis._angle = 53.13;\r\n\t\tthis._width = canvas.grid.distance;\r\n\t\tthis._direction = 0;\r\n\t\tthis._borderColor = null;\r\n\t\tthis._fillColor = null;\r\n\t\tthis._persist = false;\r\n\t\tthis._config = CrosshairsDocument.defaultConfig;\r\n\t\tthis._waitUntilFinished = true;\r\n\t\tthis._callbacks = {};\r\n\t}\r\n\r\n\tstatic niceName = \"Crosshair\";\r\n\r\n\t/**\r\n\t * Sets the type of MeasurableTemplate to create, see CONST.MEASURED_TEMPLATE_TYPES\r\n\t */\r\n\ttype(inType = \"\") {\r\n\t\tif (typeof inType !== \"string\"){\r\n\t\t\tthrow this.sequence._customError(this, \"type\", \"inType must be of type string\");\r\n\t\t}\r\n\t\tif (!Object.values(CONST.MEASURED_TEMPLATE_TYPES).includes(inType)){\r\n\t\t\tthrow this.sequence._customError(this, \"type\", `inType must be one of valid types: ${Object.values(CONST.MEASURED_TEMPLATE_TYPES).join(\" \")} (see CONST.MEASURED_TEMPLATE_TYPES)`,);\r\n\t\t}\r\n\t\tthis._type = inType;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets a custom label to be set as a part of this crosshair\r\n\t */\r\n\tlabel(inText, inOptions = {}) {\r\n\t\tif (typeof inOptions !== \"object\"){\r\n\t\t\tthrow this.sequence._customError(this, \"label\", \"inOptions must be of type object\");\r\n\t\t}\r\n\t\tinOptions = foundry.utils.mergeObject({\r\n\t\t\tdx: CrosshairsDocument.defaultConfig.label.dx, dy: CrosshairsDocument.defaultConfig.label.dy\r\n\t\t}, inOptions,);\r\n\t\tif (typeof inText !== \"string\"){\r\n\t\t\tthrow this.sequence._customError(this, \"label\", \"inText must be of type string\");\r\n\t\t}\r\n\t\tif (!lib.is_real_number(inOptions.dx)){\r\n\t\t\tthrow this.sequence._customError(this, \"label\", \"inOptions.dx must be of type number\");\r\n\t\t}\r\n\t\tif (!lib.is_real_number(inOptions.dy)){\r\n\t\t\tthrow this.sequence._customError(this, \"label\", \"inOptions.dy must be of type number\");\r\n\t\t}\r\n\t\tthis._config[\"label\"][\"text\"] = inText;\r\n\t\tthis._config[\"label\"][\"dx\"] = inOptions.dx;\r\n\t\tthis._config[\"label\"][\"dy\"] = inOptions.dy;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets how the position of the crosshair should snap on the grid\r\n\t */\r\n\tsnapPosition(inSnap) {\r\n\t\tif (!lib.is_real_number(inSnap)){\r\n\t\t\tthrow this.sequence._customError(this, \"snapPosition\", \"inSnap must be of type number, see CONST.GRID_SNAPPING_MODES\");\r\n\t\t}\r\n\t\tthis._config[\"snap\"][\"position\"] = inSnap;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the distance for the crosshair - or radius for a circular crosshair\r\n\t */\r\n\tdistance(inDistance, inOptions = {}) {\r\n\t\tif (typeof inOptions !== \"object\"){\r\n\t\t\tthrow this.sequence._customError(this, \"distance\", \"inOptions must be of type object\");\r\n\t\t}\r\n\t\tinOptions = foundry.utils.mergeObject({\r\n\t\t\tmin: CrosshairsDocument.defaultConfig.distanceMin, max: CrosshairsDocument.defaultConfig.distanceMax\r\n\t\t}, inOptions,);\r\n\t\tif (!lib.is_real_number(inDistance)){\r\n\t\t\tthrow this.sequence._customError(this, \"distance\", \"inDistance must be of type number\");\r\n\t\t}\r\n\t\tif (inOptions.min !== null) {\r\n\t\t\tif (!lib.is_real_number(inOptions.min)){\r\n\t\t\t\tthrow this.sequence._customError(this, \"distance\", \"inOptions.min must be of type number\");\r\n\t\t\t}\r\n\t\t\tif (inOptions.min <= 0){\r\n\t\t\t\tthrow this.sequence._customError(this, \"distance\", \"inOptions.min must be a non-zero number\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tinOptions.min = inDistance;\r\n\t\t}\r\n\t\tif (inOptions.max !== null) {\r\n\t\t\tif (!lib.is_real_number(inOptions.max)){\r\n\t\t\t\tthrow this.sequence._customError(this, \"distance\", \"inOptions.max must be of type number\");\r\n\t\t\t}\r\n\t\t\tif (inOptions.max <= 0){\r\n\t\t\t\tthrow this.sequence._customError(this, \"distance\", \"inOptions.max must be a non-zero number\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tinOptions.max = inDistance;\r\n\t\t}\r\n\r\n\t\tif (inOptions.min > inOptions.max){\r\n\t\t\tthrow this.sequence._customError(this, \"distance\", \"inOptions.min cannot be larger than inOptions.max\");\r\n\t\t}\r\n\r\n\t\tthis._distance = inDistance;\r\n\t\tthis._config[\"distanceMin\"] = inOptions.min;\r\n\t\tthis._config[\"distanceMax\"] = inOptions.max;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Configures the angle of the crosshair - mostly used for the width of cone crosshairs\r\n\t */\r\n\tangle(inAngle) {\r\n\t\tif (!lib.is_real_number(inAngle)){\r\n\t\t\tthrow this.sequence._customError(this, \"angle\", \"inAngle must be of type number\");\r\n\t\t}\r\n\t\tthis._angle = inAngle;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Configures the width for the crosshair - used for ray crosshairs\r\n\t */\r\n\twidth(inWidth) {\r\n\t\tif (!lib.is_real_number(inWidth)){\r\n\t\t\tthrow this.sequence._customError(this, \"width\", \"inWidth must be of type number\");\r\n\t\t}\r\n\t\tthis._width = inWidth;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Configures the width for the crosshair - used for ray crosshairs\r\n\t */\r\n\tdirection(inDirection) {\r\n\t\tif (!lib.is_real_number(inDirection)){\r\n\t\t\tthrow this.sequence._customError(this, \"direction\", \"inDirection must be of type number\");\r\n\t\t}\r\n\t\tthis._direction = inDirection;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Configures the  increments the direction should snap along\r\n\t */\r\n\tsnapDirection(inSnapDirection) {\r\n\t\tif (!lib.is_real_number(inSnapDirection)){\r\n\t\t\tthrow this.sequence._customError(this, \"snapDirection\", \"inDirectionSnap must be of type number\");\r\n\t\t}\r\n\t\tthis._config[\"snap\"][\"direction\"] = inSnapDirection;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles whether the crosshair can be manually rotated\r\n\t */\r\n\tlockManualRotation(inBool = true) {\r\n\t\tif (typeof inBool !== \"boolean\"){\r\n\t\t\tthrow this.sequence._customError(this, \"preventUserRotation\", \"inBool must be of type number\");\r\n\t\t}\r\n\t\tthis._config[\"lockManualRotation\"] = inBool;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles whether the crosshair's end position can be dragged\r\n\t * @param inBool\r\n\t */\r\n\tlockDrag(inBool = true) {\r\n\t\tif (typeof inBool !== \"boolean\"){\r\n\t\t\tthrow this.sequence._customError(this, \"lockDrag\", \"inBool must be of type number\");\r\n\t\t}\r\n\t\tthis._config[\"lockDrag\"] = inBool;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Configures the custom icon to be used on the crosshair\r\n\t */\r\n\ticon(inTexture, inOptions = {}) {\r\n\t\tif (typeof inOptions !== \"object\"){\r\n\t\t\tthrow this.sequence._customError(this, \"icon\", \"inOptions must be of type object\");\r\n\t\t}\r\n\t\tinOptions = foundry.utils.mergeObject({ borderVisible: CrosshairsDocument.defaultConfig.icon.borderVisible }, inOptions,);\r\n\t\tif (typeof inTexture !== \"string\"){\r\n\t\t\tthrow this.sequence._customError(this, \"icon\", \"inTexture must be of type string\");\r\n\t\t}\r\n\t\tif (typeof inOptions.borderVisible !== \"boolean\"){\r\n\t\t\tthrow this.sequence._customError(this, \"icon\", \"inOptions.borderVisible must be of type boolean\");\r\n\t\t}\r\n\t\tthis._config[\"icon\"][\"texture\"] = inTexture;\r\n\t\tthis._config[\"icon\"][\"borderVisible\"] = inOptions.borderVisible;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the border color of the crosshair\r\n\t */\r\n\tborderColor(inColor, inOptions = {}) {\r\n\t\tif (typeof inOptions !== \"object\"){\r\n\t\t\tthrow this.sequence._customError(this, \"borderColor\", \"inOptions must be of type object\");\r\n\t\t}\r\n\t\tinOptions = foundry.utils.mergeObject({ borderVisible: CrosshairsDocument.defaultConfig.borderAlpha }, inOptions,);\r\n\t\tconst { alpha } = inOptions;\r\n\t\tif (!lib.is_real_number(alpha)) {\r\n\t\t\tthrow this.sequence._customError(this, \"borderAlpha\", \"inOptions.alpha must be of type number\");\r\n\t\t}\r\n\t\tthis._borderColor = lib.parseColor(inColor).hexadecimal;\r\n\t\tthis._config['borderAlpha'] = lib.normalize_alpha_number(alpha);\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the fill color of the crosshair\r\n\t */\r\n\tfillColor(inColor, inOptions = {}) {\r\n\t\tif (typeof inOptions !== \"object\"){\r\n\t\t\tthrow this.sequence._customError(this, \"fillColor\", \"inOptions must be of type object\");\r\n\t\t}\r\n\t\tinOptions = foundry.utils.mergeObject({ alpha: CrosshairsDocument.defaultConfig.fillAlpha }, inOptions,);\r\n\t\tconst { alpha } = inOptions;\r\n\t\tif (!lib.is_real_number(alpha)) {\r\n\t\t\tthrow this.sequence._customError(this, \"fillColor\", \"inOptions.alpha must be of type number\");\r\n\t\t}\r\n\t\tthis._config['fillAlpha'] = lib.normalize_alpha_number(alpha);\r\n\t\tthis._fillColor = lib.parseColor(inColor).hexadecimal;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the texture used by the crosshair\r\n\t */\r\n\ttexture(inTexture, inOptions = {}) {\r\n\t\tif (typeof inOptions !== \"object\"){\r\n\t\t\tthrow this.sequence._customError(this, \"texture\", \"inOptions must be of type object\");\r\n\t\t}\r\n\t\tinOptions = foundry.utils.mergeObject(\r\n\t\t\t{ \r\n\t\t\t\talpha: CrosshairsDocument.defaultConfig.textureAlpha,\r\n\t\t\t\tscale: CrosshairsDocument.defaultConfig.textureScale,\r\n\t\t\t}, \r\n\t\t\tinOptions,\r\n\t\t);\r\n\t\tconst { alpha, scale } = inOptions;\r\n\t\tif (!lib.is_real_number(alpha)) {\r\n\t\t\tthrow this.sequence._customError(this, \"texture\", \"inOptions.alpha must be of type number\");\r\n\t\t}\r\n\t\tif (!lib.is_real_number(scale)) {\r\n\t\t\tthrow this.sequence._customError(this, \"texture\", \"inOptions.scale must be of type number\");\r\n\t\t}\r\n\t\tif (typeof inTexture !== \"string\") {\r\n\t\t\tthrow this.sequence._customError(this, \"texture\", \"inTexture must be of type string\");\r\n\t\t}\r\n\t\tthis._texture = inTexture;\r\n\t\tthis._config['textureAlpha'] = lib.normalize_alpha_number(alpha);\r\n\t\tthis._config['textureScale'] = scale;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Configures the source location of the crosshair, usually to limit it around the target placeable object, or to\r\n\t * cause it to be limited within a certain range of the placeable object\r\n\t */\r\n\tlocation(inLocation, inOptions = {}) {\r\n\t\tif (!inLocation || typeof inLocation !== \"object\") {\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inLocation is invalid, and must be of type of placeable object, or document\");\r\n\t\t}\r\n\t\tif (typeof inOptions !== \"object\"){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions must be of type object\");\r\n\t\t}\r\n\t\tinOptions = foundry.utils.mergeObject({\r\n\t\t\tlimitMinRange: CrosshairsDocument.defaultConfig.location.limitMinRange,\r\n\t\t\tlimitMaxRange: CrosshairsDocument.defaultConfig.location.limitMaxRange,\r\n\t\t\tshowRange: CrosshairsDocument.defaultConfig.location.showRange,\r\n\t\t\tlockToEdge: CrosshairsDocument.defaultConfig.location.lockToEdge,\r\n\t\t\tlockToEdgeDirection: CrosshairsDocument.defaultConfig.location.lockToEdgeDirection,\r\n\t\t\toffset: CrosshairsDocument.defaultConfig.location.offset,\r\n\t\t\twallBehavior: CrosshairsDocument.defaultConfig.location.wallBehavior,\r\n\t\t\tdisplayRangePoly: CrosshairsDocument.defaultConfig.location.displayRangePoly,\r\n\t\t\trangePolyFillColor: CrosshairsDocument.defaultConfig.location.rangePolyFillColor,\r\n\t\t\trangePolyLineColor: CrosshairsDocument.defaultConfig.location.rangePolyLineColor,\r\n\t\t\trangePolyFillAlpha: CrosshairsDocument.defaultConfig.location.rangePolyFillAlpha,\r\n\t\t\trangePolyLineAlpha: CrosshairsDocument.defaultConfig.location.rangePolyLineAlpha,\r\n\t\t}, inOptions,);\r\n\t\tinLocation = this._validateLocation(inLocation);\r\n\t\tif (typeof inOptions.wallBehavior !== \"string\"){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.wallBehavior must be of type string\");\r\n\t\t}\r\n\t\tif (inLocation === undefined){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"could not find position of given object\");\r\n\t\t}\r\n\t\tif (inOptions.limitMinRange && !lib.is_real_number(inOptions.limitMinRange)){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.limitMinRange must be of type number\");\r\n\t\t}\r\n\t\tif (inOptions.limitMaxRange && !lib.is_real_number(inOptions.limitMaxRange)){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.limitMaxRange must be of type number\");\r\n\t\t}\r\n\t\tif (typeof inOptions.lockToEdge !== \"boolean\"){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.lockToEdge must be of type boolean\");\r\n\t\t}\r\n\t\tif (typeof inOptions.showRange !== \"boolean\"){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.showRange must be of type boolean\");\r\n\t\t}\r\n\t\tif (typeof inOptions.lockToEdgeDirection !== \"boolean\"){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.lockToEdgeDirection must be of type boolean\");\r\n\t\t}\r\n\t\tif (typeof inOptions.offset !== \"object\") {\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.offset must be of type of object\");\r\n\t\t}\r\n\t\tif (!lib.is_real_number(inOptions.offset.x)) {\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.offset.x must be of type of number\");\r\n\t\t}\r\n\t\tif (!lib.is_real_number(inOptions.offset.y)) {\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.offset.y must be of type of number\");\r\n\t\t}\r\n\t\tif (typeof inOptions.displayRangePoly !== \"boolean\"){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.displayRangePoly must be of type boolean\");\r\n\t\t}\r\n\t\tif (inOptions.rangePolyFillColor && !lib.is_real_number(inOptions.rangePolyFillColor)){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.rangePolyFillColor must be of type number (color, eg 0xFF0000)\");\r\n\t\t}\r\n\t\tif (inOptions.rangePolyLineColor && !lib.is_real_number(inOptions.rangePolyLineColor)){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.rangePolyLineColor must be of type number (color, eg 0xFF0000)\");\r\n\t\t}\r\n\t\tif (inOptions.rangePolyFillAlpha && !lib.is_real_number(inOptions.rangePolyFillAlpha)){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.rangePolyFillAlpha must be of type number\");\r\n\t\t}\r\n\t\tif (inOptions.rangePolyLineAlpha && !lib.is_real_number(inOptions.rangePolyLineAlpha)){\r\n\t\t\tthrow this.sequence._customError(this, \"location\", \"inOptions.rangePolyLineAlpha must be of type number\");\r\n\t\t}\r\n\t\tthis._config[\"location\"] = {\r\n\t\t\tobj: inLocation?.object ?? inLocation,\r\n\t\t\tlimitMinRange: inOptions.limitMinRange,\r\n\t\t\tlimitMaxRange: inOptions.limitMaxRange,\r\n\t\t\tlockToEdge: inOptions.lockToEdge,\r\n\t\t\tlockToEdgeDirection: inOptions.lockToEdgeDirection,\r\n\t\t\tshowRange: inOptions.showRange,\r\n\t\t\toffset: inOptions.offset,\r\n\t\t\twallBehavior: inOptions.wallBehavior,\r\n\t\t\tdisplayRangePoly: inOptions.displayRangePoly,\r\n\t\t\trangePolyFillColor: inOptions.rangePolyFillColor,\r\n\t\t\trangePolyLineColor: inOptions.rangePolyLineColor,\r\n\t\t\trangePolyFillAlpha: inOptions.rangePolyFillAlpha,\r\n\t\t\trangePolyLineAlpha: inOptions.rangePolyLineAlpha,\r\n\t\t};\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Causes the crosshair to spawn a measurable template identical to the crosshair\r\n\t */\r\n\tpersist(inBool = true) {\r\n\t\tif (typeof inBool !== \"boolean\"){\r\n\t\t\tthrow this.sequence._customError(this, \"persist\", \"inBool must be of type boolean\");\r\n\t\t}\r\n\t\tthis._persist = inBool;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles whether this crosshair should highlight the grid\r\n\t */\r\n\tgridHighlight(inBool = true) {\r\n\t\tif (typeof inBool !== \"boolean\"){\r\n\t\t\tthrow this.sequence._customError(this, \"gridHighlight\", \"inBool must be of type boolean\");\r\n\t\t}\r\n\t\tthis._config['gridHighlight'] = inBool;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a callback function for certain crosshair events\r\n\t */\r\n\tcallback(inString, inCallback) {\r\n\t\tif (typeof inString !== \"string\" || !Object.values(CONSTANTS.CALLBACKS).some(str => str === inString)) {\r\n\t\t\tthrow this.sequence._customError(this, \"callback\", \"inString must be of type string and one of Sequencer.Crosshair.CALLBACKS\");\r\n\t\t}\r\n\t\tif (!lib.is_function(inCallback)) {\r\n\t\t\tthrow this.sequence._customError(this, \"callback\", \"inCallback must be of type Function\");\r\n\t\t}\r\n\t\tthis._callbacks[inString] = inCallback;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tasync run() {\r\n\r\n\t\tconst reticle = new CrosshairsDocument({\r\n\t\t\tt: this._type,\r\n\t\t\tdistance: this._distance,\r\n\t\t\twidth: this._width,\r\n\t\t\tdirection: this._direction,\r\n\t\t\tangle: this._angle,\r\n\t\t\tborderColor: this._borderColor,\r\n\t\t\ttexture: this._texture,\r\n\t\t\tfillColor: this._fillColor,\r\n\t\t}, {\r\n\t\t\tparent: canvas.scene\r\n\t\t}, this._config, this._callbacks);\r\n\r\n\t\treturn reticle.show().then(async () => {\r\n\r\n\t\t\tif (this._persist) {\r\n\t\t\t\tconst [template] = await canvas.scene.createEmbeddedDocuments(\"MeasuredTemplate\", [\r\n\t\t\t\t\treticle.toObject()\r\n\t\t\t\t]);\r\n\t\t\t\tthis.sequence.crosshairs[this._name] = template;\r\n\t\t\t}\r\n\r\n\t\t\tif (this._name) {\r\n\t\t\t\tthis.sequence.nameOffsetMap ||= {};\r\n\t\t\t\tthis.sequence.nameOffsetMap[this._name] = {\r\n\t\t\t\t\tseed: `${this._name}-${foundry.utils.randomID()}`,\r\n\t\t\t\t\ttwister: {},\r\n\t\t\t\t\tsource: this.sequence.crosshairs[this._name]?.uuid ?? reticle.getOrientation().source,\r\n\t\t\t\t\ttarget: this.sequence.crosshairs[this._name]?.uuid ?? reticle.getOrientation().target\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}).catch((err) => {\r\n\t\t\tconsole.log(err)\r\n\t\t\tthis.sequence._abort();\r\n\t\t});\r\n\t}\r\n\r\n\tasync _execute() {\r\n\t\tawait this.run();\r\n\t}\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_applyTraits() {\r\n\t\tObject.assign(this.constructor.prototype, traits.name);\r\n\t}\r\n\r\n}\r\n","import * as lib from \"../lib/lib.js\";\nimport FunctionSection from \"../sections/func.js\";\nimport EffectSection from \"../sections/effect.js\";\nimport SoundSection from \"../sections/sound.js\";\nimport AnimationSection from \"../sections/animation.js\";\nimport Section from \"../sections/section.js\";\nimport SequencerPresets from \"./sequencer-presets.js\";\nimport ScrollingTextSection from \"../sections/scrollingText.js\";\nimport { sequencerSocket, SOCKET_HANDLERS } from \"../sockets.js\";\nimport CanvasPanSection from \"../sections/canvasPan.js\";\nimport SequenceManager from \"./sequence-manager.js\";\nimport { get, writable } from \"svelte/store\";\nimport CONSTANTS from \"../constants.js\";\nimport WaitSection from \"../sections/wait.js\";\nimport CrosshairSection from \"../sections/crosshair.js\";\nimport { get_object_canvas_data } from \"../lib/canvas-lib.js\";\nimport CrosshairsPlaceable from \"./sequencer-crosshair/CrosshairsPlaceable.js\";\nimport CrosshairsDocument from \"./sequencer-crosshair/CrosshairsDocument.js\";\nimport FoundryShim from \"../utils/foundry-shim.js\";\n\nexport default class Sequence {\n\tconstructor(\n\t\toptions = {\n\t\t\tmoduleName: \"Sequencer\",\n\t\t\tsoftFail: false,\n\t\t},\n\t\tsoftFail = false\n\t) {\n\t\tthis.id = foundry.utils.randomID();\n\t\tthis.moduleName =\n\t\t\ttypeof options === \"string\"\n\t\t\t\t? options\n\t\t\t\t: options?.moduleName ?? \"Sequencer\";\n\t\tthis.softFail = options?.softFail ?? softFail;\n\t\tthis.sections = [];\n\t\tthis.nameOffsetMap = false;\n\t\tthis.crosshairs = {}\n\t\tthis.effectIndex = 0;\n\t\tthis.sectionToCreate = undefined;\n\t\tthis.localOnly = false;\n\t\tthis._status = writable(CONSTANTS.STATUS.READY);\n\t\treturn lib.sequence_proxy_wrap(this);\n\t}\n\n\t/**\n\t * Plays all of this sequence's sections\n\t *\n\t * @returns {Promise}\n\t */\n\tasync play({ remote = false, preload = false, local = false } = {}) {\n\t\tthis.localOnly = local || remote;\n\t\tif (remote) {\n\t\t\tconst data = await this.toJSON();\n\t\t\tsequencerSocket.executeForOthers(\n\t\t\t\tSOCKET_HANDLERS.RUN_SEQUENCE_LOCALLY,\n\t\t\t\tdata\n\t\t\t);\n\t\t\treturn new Sequence().fromJSON(data).play({ local: true });\n\t\t}\n\t\tHooks.callAll(\"createSequencerSequence\", this);\n\t\tlib.debug(\"Initializing sections\");\n\t\tconst initializationPromises = this.sections.map((section) => section._initialize())\n\t\tawait Promise.allSettled(initializationPromises)\n\t\tif (preload) {\n\t\t\tconst preloadFiles = this.sections.filter(section => !!section._file).map(section => section._file)\n\t\t\tif(local) {\n\t\t\t\tawait Sequencer.Preloader.preload(preloadFiles)\n\t\t\t}else {\n\t\t\t\tawait Sequencer.Preloader.preloadForClients(preloadFiles)\n\t\t\t}\n\t\t}\n\t\tSequenceManager.RunningSequences.add(this.id, this);\n\t\tthis.effectIndex = 0;\n\t\tlib.debug(\"Playing sections\");\n\t\tthis.status = CONSTANTS.STATUS.RUNNING;\n\t\tconst promises = [];\n\t\tfor (let section of this.sections) {\n\t\t\tif (section instanceof EffectSection) this.effectIndex++;\n\t\t\tif (section.shouldWaitUntilFinished) {\n\t\t\t\tpromises.push(await section._execute());\n\t\t\t} else {\n\t\t\t\tpromises.push(section._execute());\n\t\t\t}\n\t\t\tif (this.status === CONSTANTS.STATUS.ABORTED) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!section._isLastSection) {\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 3));\n\t\t\t}\n\t\t}\n\n\t\treturn Promise.allSettled(promises).then(() => {\n\t\t\tHooks.callAll(\"endedSequencerSequence\");\n\t\t\tlib.debug(\"Finished playing sections\");\n\t\t\tthis.status = CONSTANTS.STATUS.COMPLETE;\n\t\t});\n\t}\n\n\t/**\n\t * Creates a section that will run a function.\n\t *\n\t * @param {function} inFunc\n\t * @returns {Sequence} this\n\t */\n\tthenDo(inFunc) {\n\t\tconst func = lib.section_proxy_wrap(new FunctionSection(this, inFunc));\n\t\tthis.sections.push(func);\n\t\treturn func;\n\t}\n\n\t/**\n\t * Creates a section that will run a macro based on a name or a direct reference to a macro.\n\t *\n\t * @param {string|Macro} inMacro\n\t * @param {object} args\n\t * @returns {Sequence} this\n\t */\n\tmacro(inMacro, ...args) {\n\t\tlet macro;\n\t\tlet compendium = false;\n\t\tif (typeof inMacro === \"string\") {\n\t\t\tif (inMacro.startsWith(\"Compendium\")) {\n\t\t\t\tlet packArray = inMacro.split(\".\");\n\t\t\t\tlet pack = game.packs.get(`${packArray[1]}.${packArray[2]}`);\n\t\t\t\t// Catch invalid compendium pack\n\t\t\t\tif (!pack) {\n\t\t\t\t\tif (this.softFail) {\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\t\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\t\tthis.moduleName,\n\t\t\t\t\t\t`macro - Compendium '${packArray[1]}.${packArray[2]}' was not found`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tmacro = packArray;\n\t\t\t\tcompendium = pack;\n\t\t\t} else {\n\t\t\t\tmacro = game.macros.getName(inMacro);\n\t\t\t\tif (!macro) {\n\t\t\t\t\tif (this.softFail) {\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\t\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\t\tthis.moduleName,\n\t\t\t\t\t\t`macro - Macro '${inMacro}' was not found`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (inMacro instanceof Macro) {\n\t\t\tmacro = inMacro;\n\t\t} else {\n\t\t\tthrow lib.custom_error(\n\t\t\t\tthis.moduleName,\n\t\t\t\t`macro - inMacro must be of instance string or Macro`\n\t\t\t);\n\t\t}\n\n\t\targs = args.length ? args?.[0] : {};\n\t\tif (typeof args !== \"object\") {\n\t\t\tthrow lib.custom_error(\n\t\t\t\tthis.moduleName,\n\t\t\t\t`macro - Secondary argument must be an object`\n\t\t\t);\n\t\t}\n\n\t\tconst func = lib.section_proxy_wrap(\n\t\t\tnew FunctionSection(\n\t\t\t\tthis,\n\t\t\t\tasync () => {\n\t\t\t\t\tif (compendium) {\n\t\t\t\t\t\tconst macroIndex = (await compendium.getIndex())\n\t\t\t\t\t\t\t.find((i) => {\n\t\t\t\t\t\t\t\tif(macro[3] === \"Macro\"){\n\t\t\t\t\t\t\t\t\treturn macro[4] === i._id;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn i.name === macro[3]\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\tconst macroData = macroIndex ? (await compendium.getDocument(macroIndex?._id)) : false;\n\t\t\t\t\t\tif (!macroData) {\n\t\t\t\t\t\t\tif (this.softFail) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthrow lib.custom_error(\n\t\t\t\t\t\t\t\tthis.moduleName,\n\t\t\t\t\t\t\t\t`macro - Macro '${macro[3]}' was not found in compendium '${macro[1]}.${macro[2]}'`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmacro = new Macro(macroData);\n\t\t\t\t\t\tmacro.ownership.default = CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER;\n\t\t\t\t\t}\n\n          await macro.execute(args);\n        },\n        true\n      )\n    );\n    this.sections.push(func);\n    return this;\n  }\n\n  /**\n   * Creates an effect section. Until you call .then(), .effect(), .sound(), or .wait(), you'll be working on the Effect section.\n   *\n   * @param {string} [inFile] inFile\n   * @returns {Section}\n   */\n  effect(inFile = \"\") {\n    const effect = lib.section_proxy_wrap(new EffectSection(this, inFile));\n    this.sections.push(effect);\n    return effect;\n  }\n\n  /**\n   * Creates a sound section. Until you call .then(), .effect(), .sound(), or .wait(), you'll be working on the Sound section.\n   *\n   * @param {string} [inFile] inFile\n   * @returns {Section}\n   */\n  sound(inFile = \"\") {\n    const sound = lib.section_proxy_wrap(new SoundSection(this, inFile));\n    this.sections.push(sound);\n    return sound;\n  }\n\n\t/**\n\t * Creates an animation. Until you call .then(), .effect(), .sound(), or .wait(), you'll be working on the Animation section.\n\t *\n\t * @param {Token|Tile} [inTarget=false] inTarget\n\t * @returns {AnimationSection}\n\t */\n\tanimation(inTarget) {\n\t\tconst animation = lib.section_proxy_wrap(\n\t\t\tnew AnimationSection(this, inTarget)\n\t\t);\n\t\tthis.sections.push(animation);\n\t\treturn animation;\n\t}\n\n\t/**\n\t * Creates a scrolling text. Until you call .then(), .effect(), .sound(), or .wait(), you'll be working on the Scrolling Text section.\n\t *\n\t * @param {Object|String|Boolean} [inTarget=false] inTarget\n\t * @param {String|Boolean} [inText=false] inText\n\t * @param {Object} [inTextOptions={}] inTextOptions\n\t * @returns {AnimationSection}\n\t */\n\tscrollingText(inTarget = false, inText = false, inTextOptions = {}) {\n\t\tconst scrolling = lib.section_proxy_wrap(\n\t\t\tnew ScrollingTextSection(this, inTarget, inText, inTextOptions)\n\t\t);\n\t\tthis.sections.push(scrolling);\n\t\treturn scrolling;\n\t}\n\n\t/**\n\t * Pans the canvas text. Until you call any other sections you'll be working on the Canvas Pan section.\n\t *\n\t * @param {Object|String|Boolean} [inTarget=false] inTarget\n\t * @param {Boolean|Number} inDuration\n\t * @param {Boolean|Number} inSpeed\n\t * @returns {AnimationSection}\n\t */\n\tcanvasPan(inTarget = false, inDuration = null, inSpeed = null) {\n\t\tconst panning = lib.section_proxy_wrap(\n\t\t\tnew CanvasPanSection(this, inTarget)\n\t\t);\n\t\tthis.sections.push(panning);\n\t\treturn panning;\n\t}\n\n\t/**\n\t * Creates a crosshair section. Until you call other Sequence methods, you will be working on the Crosshair section.\n\t *\n\t * @param {string} [inName] inName\n\t * @returns {Section}\n\t */\n\tcrosshair(inName = \"\") {\n\t\tconst crosshair = lib.section_proxy_wrap(new CrosshairSection(this, inName));\n\t\tthis.sections.push(crosshair);\n\t\treturn crosshair;\n\t}\n\n\t/**\n\t * Adds a location to the sequence and ties it to a string so that it may be used later\n\t * @param {string} inName\n\t * @param {object/PlaceableObject/Document} inLocation\n\t * @returns {Sequence} this\n\t */\n\taddNamedLocation(inName, inLocation){\n\t\tif (typeof inName !== \"string\")\n\t\t\tthrow lib.custom_error(this.moduleName, `addNamedLocation - inName must be of type string`);\n\t\tif (!(typeof inLocation === \"object\" || inLocation instanceof FoundryShim.PlaceableObject || inLocation instanceof foundry.abstract.Document))\n\t\t\tthrow lib.custom_error(this.moduleName, `addNamedLocation - inLocation must be of type object, PlaceableObject, or Document`);\n\t\tif(inLocation instanceof CrosshairsPlaceable) inLocation = inLocation.document;\n\t\tthis.nameOffsetMap ||= {};\n\n\t\tconst sourceLocation = inLocation?.source ?? inLocation?.cachedPosition?.source ?? (\n\t\t\tinLocation instanceof CrosshairsDocument\n\t\t\t\t\t? inLocation.getOrientation().source\n\t\t\t\t\t: get_object_canvas_data(inLocation, { uuid: false })\n\t\t)\n\n\t\tconst targetLocation = inLocation?.target ?? inLocation?.cachedPosition?.target ?? (\n\t\t\tinLocation instanceof CrosshairsDocument\n\t\t\t\t\t? inLocation.getOrientation().target ?? sourceLocation\n\t\t\t\t\t: get_object_canvas_data(inLocation, { measure: true, uuid: false })\n\t\t)\n\n\t\tthis.nameOffsetMap[inName] = {\n\t\t\tseed: `${inName}-${foundry.utils.randomID()}`,\n\t\t\tsource: sourceLocation,\n\t\t\ttarget: targetLocation\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Causes the sequence to wait after the last section for as many milliseconds as you pass to this method. If given\n\t * a second number, a random wait time between the two given numbers will be generated.\n\t *\n\t * @param {number} [msMin=1] minMs\n\t * @param {number} [msMax=1] maxMs\n\t * @returns {Sequence} this\n\t */\n\twait(msMin = 1, msMax = 1) {\n\t\tif (msMin < 1)\n\t\t\tthrow lib.custom_error(\n\t\t\t\tthis.moduleName,\n\t\t\t\t`wait - Wait ms cannot be less than 1`\n\t\t\t);\n\t\tif (msMax < 1)\n\t\t\tthrow lib.custom_error(\n\t\t\t\tthis.moduleName,\n\t\t\t\t`wait - Max wait ms cannot be less than 1`\n\t\t\t);\n\t\tconst section = lib.section_proxy_wrap(new WaitSection(this, msMin, msMax));\n\t\tthis.sections.push(section);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Applies a preset to the sequence\n\t *\n\t * @param {string} presetName\n\t * @param {*} args\n\t * @returns {Sequence|FunctionSection|EffectSection|AnimationSection|SoundSection}\n\t */\n\tpreset(presetName, ...args) {\n\t\tif (typeof presetName !== \"string\") {\n\t\t\tthrow this._customError(this, \"name\", `inName must be of type string`);\n\t\t}\n\t\tconst preset = SequencerPresets.get(presetName);\n\t\tif (!preset) {\n\t\t\tlib.custom_warning(\n\t\t\t\t\"Sequencer\",\n\t\t\t\t`preset | Could not find preset with name \"${presetName}\"`\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tconst lastSection = this.sections[this.sections.length - 1] || this;\n\t\treturn preset(lastSection, ...args);\n\t}\n\n\t/**\n\t * Adds the sections from a given Sequence to this Sequence\n\t *\n\t * @param {Sequence|FunctionSection|EffectSection|AnimationSection|SoundSection} inSequence\n\t * @returns {Sequence} this\n\t */\n\taddSequence(inSequence) {\n\t\tif (inSequence instanceof Section) inSequence = inSequence.sequence;\n\t\tif (!(inSequence instanceof Sequence)) {\n\t\t\tthrow lib.custom_error(\n\t\t\t\tthis.moduleName,\n\t\t\t\t`addSequence - could not find the sequence from the given parameter`\n\t\t\t);\n\t\t}\n\t\tconst newSections = inSequence.sections.map((section) => {\n\t\t\tconst newSection = Object.assign(\n\t\t\t\tObject.create(Object.getPrototypeOf(section)),\n\t\t\t\tsection\n\t\t\t);\n\t\t\tnewSection.sequence = this;\n\t\t\treturn newSection;\n\t\t});\n\t\tthis.sections = this.sections.concat(newSections);\n\t\treturn this;\n\t}\n\n\tasync toJSON() {\n\t\tconst data = {\n\t\t\toptions: { moduleName: this.moduleName, softFail: this.softFail },\n\t\t\tsections: [],\n\t\t};\n\t\tfor (const section of this.sections) {\n\t\t\tconst sectionData = await section._serialize();\n\t\t\tif (!sectionData.type) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Sequencer | toJson | ${section.constructor.name} does not support serialization!`\n\t\t\t\t);\n\t\t\t}\n\t\t\tdata.sections.push(sectionData);\n\t\t}\n\t\treturn data;\n\t}\n\n\tfromJSON(data) {\n\t\tthis.moduleName = data.options.moduleName;\n\t\tthis.softFail = data.options.softFail;\n\t\tthis.localOnly = true;\n\t\tfor (const section of data.sections) {\n\t\t\tthis[section.type]()._deserialize(section);\n\t\t}\n\t\treturn this;\n\t}\n\n\t_createCustomSection(...args) {\n\t\tconst func = lib.section_proxy_wrap(\n\t\t\tnew this.sectionToCreate(this, ...args)\n\t\t);\n\t\tthis.sectionToCreate = undefined;\n\t\tthis.sections.push(func);\n\t\treturn func;\n\t}\n\n\t_showWarning(self, func, warning, notify = false) {\n\t\tlib.custom_warning(\n\t\t\tthis.moduleName,\n\t\t\t`${self.constructor.name.replace(\"Section\", \"\")} | ${func} - ${warning}`,\n\t\t\tnotify\n\t\t);\n\t}\n\n\t_customError(self, func, error) {\n\t\treturn lib.custom_error(\n\t\t\tthis.moduleName,\n\t\t\t`${self.constructor.name.replace(\"Section\", \"\")} | ${func} - ${error}`\n\t\t);\n\t}\n\n\tset status(inStatus) {\n\t\tthis._status.update((currentStatus) => {\n\t\t\tif (\n\t\t\t\tcurrentStatus === CONSTANTS.STATUS.READY ||\n\t\t\t\tcurrentStatus === CONSTANTS.STATUS.RUNNING\n\t\t\t) {\n\t\t\t\treturn inStatus;\n\t\t\t}\n\t\t\treturn currentStatus;\n\t\t});\n\t}\n\n\tget status() {\n\t\treturn get(this._status);\n\t}\n\n\tget statusStore() {\n\t\treturn this._status;\n\t}\n\n\t_abort() {\n\t\tthis.status = CONSTANTS.STATUS.ABORTED;\n\t\tfor (const section of this.sections) {\n\t\t\tsection._abortSection();\n\t\t}\n\t}\n}\n","import Section from \"../sections/section.js\";\nimport * as lib from \"../lib/lib.js\";\n\nclass SequencerSectionManager {\n\n\t#sections = {};\n\n\tget externalSections(){\n\t\treturn this.#sections;\n\t}\n\n  /**\n   * Registers a class by a name that will then be available through the Sequencer\n   *\n   * @param {String}      inModuleName\n   * @param {String}      inMethodName\n   * @param {Class}       inClass\n   * @param {Boolean}     overwrite\n   * @returns {Boolean}               Whether the registration succeeded\n   */\n  registerSection(inModuleName, inMethodName, inClass, overwrite = false) {\n    if (!(inClass.prototype instanceof Section)) {\n      throw lib.custom_error(\n        inModuleName,\n        `inClass must be instance of Sequencer.BaseSection`\n      );\n    }\n\n    let coreMethods = Object.getOwnPropertyNames(Sequence.prototype).filter(\n      (method) => {\n        return !method.startsWith(\"_\") && method !== \"constructor\";\n      }\n    );\n\n    if (coreMethods.includes(inMethodName)) {\n      throw lib.custom_error(\n        inModuleName,\n        `${inMethodName} is an existing protected method of the Sequence class - please register with another method name!`\n      );\n    }\n\n    if (this.#sections[inMethodName] && !overwrite) {\n      throw lib.custom_error(\n        inModuleName,\n        `${inMethodName} is already a registered Section with the class ${this.#sections[inMethodName].constructor.name}`\n      );\n    }\n\n    coreMethods = coreMethods.concat(Object.keys(this.#sections));\n\n    const clashingMethods = Object.getOwnPropertyNames(\n      inClass.prototype\n    ).filter((method) => coreMethods.includes(method));\n\n    if (clashingMethods.length) {\n      let errors = clashingMethods.join(\", \");\n      throw lib.custom_error(\n        inModuleName,\n        `${inMethodName} cannot contain the following methods: ${errors}<br>These methods are existing methods on the Sequence or from already registered Sections. Please rename these methods to avoid conflicts.`\n      );\n    }\n\n    lib.debug(\n      `SectionManager | Successfully registered ${inMethodName} with Sequencer!`\n    );\n\n    this.#sections[inMethodName] = inClass;\n\n    return true;\n  }\n}\n\nconst sectionManager = new SequencerSectionManager();\n\nexport default sectionManager;\n","// SPDX-License-Identifier: MIT\n// Copyright © 2021 fvtt-lib-wrapper Rui Pinheiro\n\n\"use strict\";\n\n// A shim for the libWrapper library\nexport let libWrapper = undefined;\n\nexport const VERSIONS = [1, 12, 2];\nexport const TGT_SPLIT_RE = new RegExp(\n  \"([^.[]+|\\\\[('([^'\\\\\\\\]|\\\\\\\\.)+?'|\\\"([^\\\"\\\\\\\\]|\\\\\\\\.)+?\\\")\\\\])\",\n  \"g\"\n);\nexport const TGT_CLEANUP_RE = new RegExp(\"(^\\\\['|'\\\\]$|^\\\\[\\\"|\\\"\\\\]$)\", \"g\");\n\n// Main shim code\nHooks.once(\"init\", () => {\n  // Check if the real module is already loaded - if so, use it\n  if (globalThis.libWrapper && !(globalThis.libWrapper.is_fallback ?? true)) {\n    libWrapper = globalThis.libWrapper;\n    return;\n  }\n\n  // Fallback implementation\n  libWrapper = class {\n    static get is_fallback() {\n      return true;\n    }\n\n    static get WRAPPER() {\n      return \"WRAPPER\";\n    }\n    static get MIXED() {\n      return \"MIXED\";\n    }\n    static get OVERRIDE() {\n      return \"OVERRIDE\";\n    }\n\n    static register(\n      package_id,\n      target,\n      fn,\n      type = \"MIXED\",\n      { chain = undefined, bind = [] } = {}\n    ) {\n      const is_setter = target.endsWith(\"#set\");\n      target = !is_setter ? target : target.slice(0, -4);\n      const split = target\n        .match(TGT_SPLIT_RE)\n        .map((x) => x.replace(/\\\\(.)/g, \"$1\").replace(TGT_CLEANUP_RE, \"\"));\n      const root_nm = split.splice(0, 1)[0];\n\n      let obj, fn_name;\n      if (split.length == 0) {\n        obj = globalThis;\n        fn_name = root_nm;\n      } else {\n        const _eval = eval;\n        fn_name = split.pop();\n        obj = split.reduce(\n          (x, y) => x[y],\n          globalThis[root_nm] ?? _eval(root_nm)\n        );\n      }\n\n      let iObj = obj;\n      let descriptor = null;\n      while (iObj) {\n        descriptor = Object.getOwnPropertyDescriptor(iObj, fn_name);\n        if (descriptor) break;\n        iObj = Object.getPrototypeOf(iObj);\n      }\n      if (!descriptor || descriptor?.configurable === false)\n        throw new Error(\n          `libWrapper Shim: '${target}' does not exist, could not be found, or has a non-configurable descriptor.`\n        );\n\n      let original = null;\n      const wrapper =\n        chain ?? (type.toUpperCase?.() != \"OVERRIDE\" && type != 3)\n          ? function (...args) {\n              return fn.call(this, original.bind(this), ...bind, ...args);\n            }\n          : function (...args) {\n              return fn.call(this, ...bind, ...args);\n            };\n      if (!is_setter) {\n        if (descriptor.value) {\n          original = descriptor.value;\n          descriptor.value = wrapper;\n        } else {\n          original = descriptor.get;\n          descriptor.get = wrapper;\n        }\n      } else {\n        if (!descriptor.set)\n          throw new Error(\n            `libWrapper Shim: '${target}' does not have a setter`\n          );\n        original = descriptor.set;\n        descriptor.set = wrapper;\n      }\n\n      descriptor.configurable = true;\n      Object.defineProperty(obj, fn_name, descriptor);\n    }\n  };\n});\n","import CONSTANTS from \"./constants.js\";\nimport { libWrapper } from \"./lib/libWrapper/shim.js\";\n\nexport default function registerLibwrappers() {\n  libWrapper.register(CONSTANTS.MODULE_NAME, \"PIXI.BaseImageResource.prototype.upload\", PIXIUPLOAD);\n}\n\nfunction PIXIUPLOAD(wrapped, ...args) {\n  let baseTexture = args[1];\n\n  if (\n    baseTexture.sequencer_patched ||\n    !game.settings.get(CONSTANTS.MODULE_NAME, \"enable-global-fix-pixi\")\n  ) {\n    return wrapped(...args);\n  }\n\n  let source = args[3];\n  source = source || this.source;\n  const isVideo = !!source.videoWidth;\n  if (isVideo) {\n    baseTexture.alphaMode = PIXI.ALPHA_MODES.PREMULTIPLIED_ALPHA;\n    baseTexture.sequencer_patched = true;\n  }\n  return wrapped(...args);\n}\n","import CONSTANTS from \"./constants.js\";\nimport { custom_warning, debug } from \"./lib/lib.js\";\n\nexport default async function runMigrations() {\n  const sortedMigrations = Object.entries(migrations).sort((a, b) => {\n    return foundry.utils.isNewerVersion(b[0], a[0]) ? -1 : 1;\n  });\n\n  for (const [version, migration] of sortedMigrations) {\n    try {\n      await migration(version);\n    } catch (err) {\n      custom_warning(\n        \"Sequencer\",\n        `Something went wrong when migrating to version ${version}. Please check the console for the error!`,\n        true\n      );\n      console.error(err);\n    }\n  }\n}\n\nfunction getSequencerEffectTokens(version, tokenFilter = false) {\n  return Array.from(game.scenes)\n    .map((scene) => [\n      scene,\n      Array.from(scene.tokens)\n        .filter((token) => token.isOwner)\n        .filter((token, index) => {\n          if (tokenFilter) {\n            return tokenFilter(token, index);\n          }\n          const effects = foundry.utils.getProperty(token, CONSTANTS.EFFECTS_FLAG) ?? [];\n          const effectsOutOfDate = effects.filter((e) =>\n            foundry.utils.isNewerVersion(version, e[1].flagVersion)\n          );\n          return effectsOutOfDate.length;\n        }),\n    ])\n    .filter(([_, tokens]) => tokens.length);\n}\n\nfunction getSequencerEffectActors(version, actorFilter = false) {\n  return Array.from(game.actors)\n    .filter((actor) => actor.isOwner)\n    .filter((actor, index) => {\n      if (actorFilter) {\n        return actorFilter(actor, index);\n      }\n      const effects = foundry.utils.getProperty(actor, CONSTANTS.EFFECTS_FLAG) ?? [];\n      const effectsOutOfDate = effects.filter((e) =>\n        foundry.utils.isNewerVersion(version, e[1].flagVersion)\n      );\n      return effectsOutOfDate.length;\n    });\n}\n\nfunction getSequencerEffectActorsPrototypeToken(version, actorFilter = false) {\n  return Array.from(game.actors)\n    .filter((actor) => actor.isOwner)\n    .filter((actor, index) => {\n      if (actorFilter) {\n        return actorFilter(actor, index);\n      }\n      const effects = foundry.utils.getProperty(actor, \"prototypeToken.\" + CONSTANTS.EFFECTS_FLAG) ?? [];\n      const effectsOutOfDate = effects.filter((e) =>\n        foundry.utils.isNewerVersion(version, e[1].flagVersion)\n      );\n      return effectsOutOfDate.length;\n    });\n}\n\nconst migrations = {\n  \"3.0.0\": async (version) => {\n    const actorsToUpdate = getSequencerEffectActors(version, (actor) => {\n      const effects =\n        foundry.utils.getProperty(actor, \"prototypeToken.\" + CONSTANTS.EFFECTS_FLAG) ?? [];\n      const effectsOutOfDate = effects.filter((e) =>\n        foundry.utils.isNewerVersion(version, e[1].flagVersion)\n      );\n      return effectsOutOfDate.length;\n    });\n\n    const actorUpdateArray = actorsToUpdate.map((actor) => {\n      const effectsToMoveFromTokenPrototype = foundry.utils.getProperty(\n        actor.prototypeToken,\n        CONSTANTS.EFFECTS_FLAG\n      )\n        .filter(([_, effect]) => {\n          return effect.persistOptions?.persistTokenPrototype;\n        })\n        .map(([id, effect]) => {\n          effect.flagVersion = version;\n          return [id, effect];\n        });\n\n      const effectsToKeepOnTokenPrototype = foundry.utils.getProperty(\n        actor.prototypeToken,\n        CONSTANTS.EFFECTS_FLAG\n      )\n        .filter(([_, effect]) => {\n          return !effect.persistOptions?.persistTokenPrototype;\n        })\n        .map(([id, effect]) => {\n          effect.flagVersion = version;\n          return [id, effect];\n        });\n\n      return {\n        _id: actor.id,\n        [CONSTANTS.EFFECTS_FLAG]: effectsToMoveFromTokenPrototype,\n        [\"prototypeToken.\" + CONSTANTS.EFFECTS_FLAG]:\n          effectsToKeepOnTokenPrototype,\n      };\n    });\n\n    const tokensOnScenes = getSequencerEffectTokens(version, (t) => {\n      let actor;\n      try {\n        actor = t.actor;\n      } catch (err) {\n        return false;\n      }\n      const effects = foundry.utils.getProperty(t, CONSTANTS.EFFECTS_FLAG) ?? [];\n      const prototypeTokenEffects =\n        foundry.utils.getProperty(actor, \"prototypeToken.\" + CONSTANTS.EFFECTS_FLAG) ?? [];\n      const effectsOutOfDate = effects.filter((e) =>\n        foundry.utils.isNewerVersion(version, e[1].flagVersion)\n      );\n      const prototypeEffectsOutOfDate = prototypeTokenEffects.filter((e) =>\n        foundry.utils.isNewerVersion(version, e[1].flagVersion)\n      );\n      return (\n        t.actorLink &&\n        (effectsOutOfDate.length || prototypeEffectsOutOfDate.length)\n      );\n    });\n\n    for (const [scene, tokens] of tokensOnScenes) {\n      const updates = [];\n      for (const token of tokens) {\n        const effectsToKeepOnToken = foundry.utils.getProperty(token, CONSTANTS.EFFECTS_FLAG)\n          .filter(([_, effect]) => {\n            return !effect.persistOptions?.persistTokenPrototype;\n          })\n          .map(([id, effect]) => {\n            effect.flagVersion = version;\n            return [id, effect];\n          });\n\n        updates.push({\n          _id: token.id,\n          [CONSTANTS.EFFECTS_FLAG]: effectsToKeepOnToken,\n        });\n      }\n\n      if (updates.length) {\n        debug(\n          `Sequencer | Updated ${updates.length} tokens' effects on scene ${scene.id} to version ${version}`\n        );\n        await scene.updateEmbeddedDocuments(\"Token\", updates);\n      }\n    }\n\n    if (actorUpdateArray.length) {\n      debug(\n        `Sequencer | Updated ${actorUpdateArray.length} actors' effects to version ${version}`\n      );\n      await Actor.updateDocuments(actorUpdateArray);\n    }\n  },\n\t\"3.4.4\": async (version) => {\n\t\tconst actorsToUpdate = getSequencerEffectActors(version, (actor) => {\n\t\t\tconst effects =\n\t\t\t\tfoundry.utils.getProperty(actor, \"prototypeToken.\" + CONSTANTS.EFFECTS_FLAG) ?? [];\n\t\t\tconst effectsOutOfDate = effects.filter((e) =>\n\t\t\t\tfoundry.utils.isNewerVersion(version, e[1].flagVersion)\n\t\t\t);\n\t\t\treturn effectsOutOfDate.length;\n\t\t});\n\n\t\tconst actorUpdateArray = actorsToUpdate.map((actor) => {\n\t\t\tconst actorEffects = foundry.utils.getProperty(actor, CONSTANTS.EFFECTS_FLAG) ?? [];\n\t\t\tconst prototypeTokenEffects = foundry.utils.getProperty(actor, \"prototypeToken.\" + CONSTANTS.EFFECTS_FLAG) ?? [];\n\t\t\treturn {\n\t\t\t\t\"_id\": actor.id,\n\t\t\t\t[\"prototypeToken.\" +CONSTANTS.REMOVE_EFFECTS_FLAG]: null,\n\t\t\t\t[CONSTANTS.EFFECTS_FLAG]: actorEffects.concat(prototypeTokenEffects)\n\t\t\t}\n\t\t})\n\n\t\tif (actorUpdateArray.length) {\n\t\t\tdebug(\n\t\t\t\t`Sequencer | Updated ${actorUpdateArray.length} actors' effects to version ${version}`\n\t\t\t);\n\t\t\tawait Actor.updateDocuments(actorUpdateArray);\n\t\t}\n\t}\n};\n","import CrosshairsDocument from \"./CrosshairsDocument.js\";\r\nimport CrosshairsPlaceable from \"./CrosshairsPlaceable.js\";\r\n\r\nexport default class TokenCrosshairsDocument extends CrosshairsDocument {\r\n\t/**\r\n\t * @inheritdoc\r\n\t */\r\n\tconstructor(tokenPlaceable, context = {}, crosshair = {}, callbacks = {}) {\r\n\r\n\t\tconst tokenDoc = tokenPlaceable.document\r\n\r\n\t\tconst { distance, size } = context.parent.grid;\r\n\t\tconst rayBounds = new Ray(\r\n\t\t\t{ x: 0, y: 0 },\r\n\t\t\t{ x: tokenDoc.width * distance, y: tokenDoc.height * distance });\r\n\r\n\t\tconst initial = {\r\n\t\t\tt: 'rect',\r\n\t\t\t'icon.display': false,\r\n\t\t\tdirection: Math.toDegrees(rayBounds.angle),\r\n\t\t\tdistance: rayBounds.distance,\r\n\t\t};\r\n\r\n\t\tconst defaultCrosshair = foundry.utils.mergeObject(TokenCrosshairsDocument.defaultConfig, {\r\n\t\t\t\tdistanceMinMax: {\r\n\t\t\t\t\tmin: rayBounds.distance,\r\n\t\t\t\t\tmax: rayBounds.distance,\r\n\t\t\t\t},\r\n\t\t\t\tlocation: {\r\n\t\t\t\t\toffset: {\r\n\t\t\t\t\t\tx: (tokenDoc.width * size) / -2,\r\n\t\t\t\t\t\ty: (tokenDoc.height * size) / -2\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\ttoken: tokenPlaceable\r\n\t\t\t}\r\n\t\t)\r\n\r\n\t\tsuper(initial, context, foundry.utils.mergeObject(defaultCrosshair, crosshair), callbacks);\r\n\t}\r\n\r\n\tstatic get defaultConfig() {\r\n\t\treturn foundry.utils.mergeObject(super.defaultConfig, {\r\n\t\t\tgridHighlight: false,\r\n\t\t\tsnap: {\r\n\t\t\t\tposition: CONST.GRID_SNAPPING_MODES.VERTEX\r\n\t\t\t},\r\n\t\t\tlabel: {\r\n\t\t\t\tdisplay: false,\r\n\t\t\t},\r\n\t\t\tlockDrag: true,\r\n\t\t\talpha: 0.5\r\n\t\t});\r\n\t}\r\n\r\n\tstatic get placeableClass() {\r\n\t\treturn TokenCrosshair;\r\n\t}\r\n}\r\n\r\nclass TokenCrosshair extends CrosshairsPlaceable {\r\n\r\n\t#clonedToken = false\r\n\t#tokenRotation = 0;\r\n\r\n\t/**\r\n\t * @override\r\n\t */\r\n\t_refreshTemplate() {\r\n\t\tthis.template.clear();\r\n\t\tthis.#clonedToken.document.x = this.x;\r\n\t\tthis.#clonedToken.document.y = this.y;\r\n\t\tthis.#clonedToken.document.rotation = this.#tokenRotation;\r\n\t\tthis.#clonedToken.document.alpha = this.crosshair.alpha;\r\n\t\tthis.#clonedToken.renderFlags.set({ refreshPosition: true, refreshRotation: true, refreshMesh: true });\r\n\t\tthis.#clonedToken.initializeSources();\r\n\t}\r\n\r\n\t/**\r\n\t * @override\r\n\t */\r\n\tasync draw() {\r\n\t\tthis.#clonedToken = this.crosshair.token.clone();\r\n\t\tthis.#tokenRotation = this.#clonedToken.document.rotation;\r\n\t\tthis.#clonedToken.visible = false;\r\n\t\tthis.layer.preview.addChild(this.#clonedToken);\r\n\t\tawait this.#clonedToken.draw().then(c => c.visible = true);\r\n\t\treturn super.draw();\r\n\t}\r\n\r\n\t_destroy(options = {}) {\r\n\t\tsuper._destroy(options);\r\n\t\tthis.#clonedToken?.destroy();\r\n\t}\r\n\r\n\tupdateDirection(evt) {\r\n\t\tif (this.crosshair.lockManualRotation) return;\r\n\t\tconst scrollDelta = Math.sign(evt.deltaY);\r\n\t\tlet delta = this.crosshair.snap.direction ? this.crosshair.snap.direction * scrollDelta : scrollDelta * 10;\r\n\t\tif (delta < 0) delta += 360;\r\n\t\tif (delta > 360) delta -= 360;\r\n\t\tthis.#tokenRotation += delta;\r\n\t}\r\n\r\n\t_onConfirm(evt) {\r\n\t\tevt.preventDefault();\r\n\t\tcanvas.mouseInteractionManager.cancel(evt);\r\n\t\tif (this.isDrag) {\r\n\t\t\tthis.isDrag = false;\r\n\t\t\tcanvas.mouseInteractionManager.reset({\r\n\t\t\t\tinteractionData: true,\r\n\t\t\t\tstate: false,\r\n\t\t\t});\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.document.updateSource({\r\n\t\t\tdirection: this.#tokenRotation\r\n\t\t})\r\n\t\treturn super._onConfirm(evt);\r\n\t}\r\n}\r\n","import CrosshairsDocument from \"./CrosshairsDocument.js\";\r\nimport TokenCrosshairsDocument from \"./TokenCrosshairsDocument.js\";\r\nimport CONSTANTS from \"../../constants.js\";\r\nimport CrosshairsPlaceable from \"./CrosshairsPlaceable.js\";\r\nimport FoundryShim from \"../../utils/foundry-shim.js\";\r\n\r\nexport default class Crosshair {\r\n\r\n\tstatic PLACEMENT_RESTRICTIONS = CONSTANTS.PLACEMENT_RESTRICTIONS;\r\n\tstatic CALLBACKS = CONSTANTS.CALLBACKS;\r\n\r\n\t/**\r\n\t * Show a configurable crosshair\r\n\t *\r\n\t * @param {CrosshairData/Object} config\r\n\t * @param {CrosshairCallbackData/Object} callbacks\r\n\t * @returns {Promise}\r\n\t */\r\n\tstatic show(config = {}, callbacks = {}) {\r\n\r\n\t\tconst reticle = new CrosshairsDocument({\r\n\t\t\tt: config.t ?? CONST.MEASURED_TEMPLATE_TYPES.CIRCLE,\r\n\t\t\tdistance: config?.distance ?? canvas.grid.distance / 2,\r\n\t\t\twidth: config?.width ?? canvas.grid.distance,\r\n\t\t\tborderColor: config.borderColor ?? \"#000000\",\r\n\t\t\tfillColor: config.fillColor ?? game.user.color,\r\n\t\t\ttexture: config.texture,\r\n\t\t\tangle: config.angle ?? 53.13, // Default for Foundry, it seems?\r\n\t\t\tdirection: config.direction ?? 0\r\n\t\t}, {\r\n\t\t\tparent: canvas.scene\r\n\t\t}, foundry.utils.mergeObject(CrosshairsDocument.defaultConfig, config), callbacks);\r\n\r\n\t\treturn reticle.show();\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Show a configurable crosshair based a PlaceableObject\r\n\t *\r\n\t * @param {PlaceableObject} obj\r\n\t * @param {CrosshairData/Object} config\r\n\t * @param {CrosshairCallbackData/Object} callbacks\r\n\t * @returns {Promise}\r\n\t */\r\n\tstatic showToken(obj, config = {}, callbacks = {}) {\r\n\r\n\t\tconst placeable = obj instanceof FoundryShim.PlaceableObject ? obj : obj.object;\r\n\r\n\t\tconst controlled = placeable.controlled;\r\n\t\tplaceable.release();\r\n\r\n\t\tconst reticle = new TokenCrosshairsDocument(placeable, {\r\n\t\t\tparent: canvas.scene\r\n\t\t}, config, callbacks);\r\n\r\n\t\treturn reticle.show().finally(() => {\r\n\t\t\tif (controlled) placeable.control()\r\n\t\t});\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * @param {CrosshairsDocument} crosshair\r\n\t * @param {String/Array<string>} types\r\n\t * @param {(object: PlaceableObject, crosshair: CrosshairsDocument, shape: PIXI.Graphics) => boolean} filterMethod\r\n\t * @returns {Array<Document>/Record<String, Array<Document>>}\r\n\t */\r\n\tstatic collect(crosshair, types = \"Token\", filterMethod = this.containsCenter) {\r\n\r\n\t\tconst typesArray = Array.isArray(types) ? types : [types];\r\n\t\tconst crosshairDoc = crosshair instanceof CrosshairsPlaceable ? crosshair.document : crosshair;\r\n\t\tconst shape = crosshairDoc.getCrosshairShape();\r\n\t\tshape.x = crosshair.x;\r\n\t\tshape.y = crosshair.y;\r\n\r\n\t\tconst result = typesArray.reduce((acc, embeddedName) => {\r\n\t\t\tconst collection = crosshairDoc.parent.getEmbeddedCollection(embeddedName);\r\n\r\n\t\t\tacc[embeddedName] = collection.filter((document) => {\r\n\t\t\t\treturn filterMethod(document.object, crosshairDoc, shape);\r\n\t\t\t});\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t\t/* if we are only collecting one kind of placeable, only return one kind of placeable */\r\n\t\treturn Array.isArray(types) ? result : result[types];\r\n\r\n\t}\r\n\r\n\tstatic containsCenter(placeable, crosshair, shape) {\r\n\t\treturn shape.contains(placeable.center.x, placeable.center.y);\r\n\t}\r\n\r\n}\r\n","<script>\r\n</script>\r\n\r\n<div>\r\n\r\n\t<p class=\"header\"><strong>Sequencer is entering a new phase of development</strong></p>\r\n\r\n\t<p>Foundry VTT continues to change, and keeping Sequencer working well across new major versions takes ongoing\r\n\t\teffort. To properly support Foundry v14 and future releases, Sequencer will have to be re-written and undergo\r\n\t\ta long-overdue user interface update.</p>\r\n\r\n\t<p>Planned improvements include:</p>\r\n\r\n\t<ul>\r\n\t\t<li>Improvements to the renderer & effects</li>\r\n\t\t<li>Support for copying tokens with token rings</li>\r\n\t\t<li>Dark mode and light mode support</li>\r\n\t\t<li>Cleanup of older UI and systems for better stability</li>\r\n\t</ul>\r\n\r\n\t<p>Sequencer will remain <strong>free and fully functional</strong>. Critical fixes and Foundry compatibility updates\r\n\t\twill always be\r\n\t\tavailable to everyone.</p>\r\n\r\n\t<p>However, if Sequencer is useful to you and you would like to support this next phase of development, you can do so\r\n\t\there:</p>\r\n\r\n\t<div class=\"sequencer-support\">\r\n\t\t<span>\r\n\t\t\t<a class=\"sequencer-clickable-link\" href=\"https://www.patreon.com/cw/fantasycomputerworks\">\r\n\t\t\t\t<i class=\"fa-brands fa-patreon\"></i> <span>Support us on Patreon</span>\r\n\t\t\t</a>\r\n\t\t</span>\r\n\t</div>\r\n\r\n\t<p>Your support helps fund maintenance, UI improvements, and long-term sustainability for Sequencer and our other\r\n\t\tfree tools.</p>\r\n\r\n\t<p>Thank you for using Sequencer and for supporting the Foundry community.</p>\r\n\r\n\t<p>- Fantasy Computerworks</p>\r\n\r\n</div>\r\n\r\n<style lang=\"scss\">\r\n\r\n  div {\r\n\r\n    margin-bottom: 0.5rem;\r\n    font-size: 0.9rem;\r\n\r\n    .header-icon {\r\n      font-size: 3rem;\r\n      margin: 0;\r\n      text-align: center;\r\n    }\r\n\r\n    .header {\r\n      margin-bottom: 0.5rem;\r\n      font-size: 1.2rem;\r\n      text-align: center;\r\n    }\r\n\r\n    .sequencer-support {\r\n      display: grid;\r\n      grid-template-columns: 1fr;\r\n      text-align: center;\r\n      margin: 1.5rem 0;\r\n\r\n      a {\r\n        font-size: 1.25rem;\r\n        color: var(--color-primary);\r\n        text-decoration: none;\r\n\r\n        p {\r\n          font-size: 0.8rem;\r\n        }\r\n      }\r\n    }\r\n\r\n  }\r\n\r\n</style>\r\n","import \"./styles/module.scss\";\n\nimport { registerSettings, migrateSettings } from \"./settings.js\";\nimport registerLayers from \"./layers.js\";\nimport registerBatchShader from \"./batchShader.js\";\nimport registerHotkeys from \"./hotkeys.js\";\nimport registerTypes from \"../typings/typings.js\";\nimport { registerSocket, sequencerSocket } from \"./sockets.js\";\nimport { EASE, easeFunctions, registerEase } from \"./canvas-effects/ease.js\";\n\nimport Sequence from \"./modules/sequencer.js\";\nimport SequencerDatabase from \"./modules/sequencer-database.js\";\nimport SequencerPreloader from \"./modules/sequencer-preloader.js\";\nimport SequencerEffectManager from \"./modules/sequencer-effect-manager.js\";\nimport SequencerSectionManager from \"./modules/sequencer-section-manager.js\";\nimport {\n  EffectPlayer,\n  InteractionManager,\n} from \"./modules/sequencer-interaction-manager.js\";\nimport Section from \"./sections/section.js\";\nimport * as lib from \"./lib/lib.js\";\nimport { SequencerAboveUILayer } from \"./canvas-effects/effects-layer.js\";\nimport SequencerPresets from \"./modules/sequencer-presets.js\";\nimport registerLibwrappers from \"./libwrapper.js\";\nimport { DatabaseViewerApp } from \"./formapplications/database/database-viewer-app.js\";\nimport CONSTANTS from \"./constants.js\";\nimport { PlayerSettings } from \"./formapplications/effects-ui/effect-player-store.js\";\nimport runMigrations from \"./migrations.js\";\nimport SequencerFoundryReplicator from \"./modules/sequencer-foundry-replicator.js\";\n\nimport SequencerSoundManager from \"./modules/sequencer-sound-manager.js\";\nimport Crosshair from \"./modules/sequencer-crosshair/sequencer-crosshair.js\";\nimport { TJSPosition } from \"#runtime/svelte/store/position\";\nimport { SvelteApplication, TJSDialog } from \"#runtime/svelte/application\";\nimport PluginsManager from \"./utils/plugins-manager.js\";\nimport FoundryShim from \"./utils/foundry-shim.js\";\nimport SupportDialog from \"./formapplications/support-dialog.svelte\";\n\nlet moduleValid = false;\nlet moduleReady = false;\nlet canvasReady = false;\n\nHooks.once(\"init\", async function() {\n  // CONFIG.debug.hooks = true;\n  if (!game.modules.get(\"socketlib\")?.active) return;\n  moduleValid = true;\n\tCONSTANTS.IS_V13 = foundry.utils.isNewerVersion(game.version, \"13\");\n  // Enable basis transcoder for GPU compressible textures.\n  // Decoder is included in Foundry VTT 12 but not enabled by default\n  if (!CONSTANTS.IS_V13) {\n    CONFIG.Canvas.transcoders.basis = true\n  }\n  initializeModule();\n  registerSocket();\n\n\t// V12 -> 13 SHIM\n\tif(CONSTANTS.IS_V13) {\n\t\tObject.defineProperty(SvelteApplication, 'defaultOptions', {\n\t\t\tget: () => {\n\t\t\t\treturn foundry.utils.mergeObject(Application.defaultOptions, {\n\t\t\t\t\t// Copied directly from TRL except for minWidth and minHeight\n\t\t\t\t\tdefaultCloseAnimation: true,\n\t\t\t\t\tdraggable: true,\n\t\t\t\t\tfocusAuto: true,\n\t\t\t\t\tfocusKeep: false,\n\t\t\t\t\tfocusSource: void 0,\n\t\t\t\t\tfocusTrap: true,\n\t\t\t\t\theaderButtonNoClose: false,\n\t\t\t\t\theaderButtonNoLabel: false,\n\t\t\t\t\theaderIcon: void 0,\n\t\t\t\t\theaderNoTitleMinimized: false,\n\t\t\t\t\tminHeight: 50, // MIN_WINDOW_HEIGHT\n\t\t\t\t\tminWidth: 200, // MIN_WINDOW_WIDTH\n\t\t\t\t\tpositionable: true,\n\t\t\t\t\tpositionInitial: TJSPosition.Initial.browserCentered,\n\t\t\t\t\tpositionOrtho: true,\n\t\t\t\t\tpositionValidator: TJSPosition.Validators.transformWindow,\n\t\t\t\t\tsessionStorage: void 0,\n\t\t\t\t\tsvelte: void 0,\n\t\t\t\t\ttransformOrigin: \"top left\"\n\t\t\t\t}, { inPlace: false });\n\t\t\t}\n\t\t});\n\t}\n});\n\nHooks.once(\"socketlib.ready\", registerSocket);\n\nHooks.once(\"ready\", async function() {\n  if (!game.modules.get(\"socketlib\")?.active) {\n\t  moduleValid = false;\n    ui.notifications.error(\n      \"Sequencer - Sequencer requires the SocketLib module to be active and will not work without it!\",\n      { console: true },\n    );\n    return;\n  }\n\tif(!sequencerSocket){\n\t\tmoduleValid = false;\n\t\tui.notifications.error(\n\t\t\t\"Sequencer - Failed to set up network socket with socketlib, ensure it is installed correctly!\",\n\t\t\t{ console: true },\n\t\t);\n\t\treturn;\n\t}\n\n  for (const [name, func] of Object.entries(easeFunctions)) {\n    if (!FoundryShim.CanvasAnimation[name]) {\n      FoundryShim.CanvasAnimation[name] = func;\n    }\n  }\n\n  if (game.user.isGM) {\n    await runMigrations();\n    await migrateSettings();\n    await PlayerSettings.migrateOldPresets();\n  }\n\n  SequencerFoundryReplicator.registerHooks();\n  InteractionManager.initialize();\n});\n\nHooks.on(\"canvasTearDown\", () => {\n  canvasReady = false;\n  SequencerEffectManager.tearDownPersists();\n});\n\nconst setupModule = foundry.utils.debounce(() => {\n  if (!moduleValid) return;\n  if (!moduleReady) {\n    moduleReady = true;\n    lib.debug(\"Ready to go!\");\n    Hooks.callAll(\"sequencer.ready\");\n    Hooks.callAll(\"sequencerReady\");\n  }\n  if (!canvasReady && game.canvas?.ready) {\n    canvasReady = true;\n    SequencerEffectManager.initializePersistentEffects();\n  }\n}, 25);\n\nHooks.on(\"canvasReady\", () => {\n  setTimeout(() => {\n    setupModule();\n  }, 450);\n});\n\nHooks.on(\"refreshToken\", setupModule);\nHooks.on(\"refreshDrawing\", setupModule);\nHooks.on(\"refreshTile\", setupModule);\nHooks.on(\"refreshMeasuredTemplate\", setupModule);\n\n/**\n * Creation & delete hooks for persistent effects\n */\nfunction initializeModule() {\n  window.Sequence = Sequence;\n  window.Sequencer = {\n    Player: EffectPlayer,\n    Presets: SequencerPresets,\n    Database: SequencerDatabase,\n    DatabaseViewer: DatabaseViewerApp,\n    Preloader: SequencerPreloader,\n    EffectManager: SequencerEffectManager,\n    SoundManager: SequencerSoundManager,\n    SectionManager: SequencerSectionManager,\n    registerEase: registerEase,\n    BaseSection: Section,\n    CONSTANTS: {\n      EASE,\n    },\n    Helpers: {\n      wait: lib.wait,\n      clamp: lib.clamp,\n      interpolate: lib.interpolate,\n      random_float_between: lib.random_float_between,\n      random_int_between: lib.random_int_between,\n      shuffle_array: lib.shuffle_array,\n      random_array_element: lib.random_array_element,\n      random_object_element: lib.random_object_element,\n      make_array_unique: lib.make_array_unique,\n    },\n\t  Crosshair: Crosshair\n  };\n\n  registerSettings();\n  registerLayers();\n  registerHotkeys();\n  registerLibwrappers();\n  registerBatchShader();\n\n  SequencerEffectManager.setup();\n  SequencerAboveUILayer.setup();\n\n\tPluginsManager.initialize();\n}\n\n\nHooks.once(\"ready\", async () => {\n  displaySupportDialog();\n  displaySequencerWelcome();\n});\n\nasync function displaySupportDialog() {\n\n  const shown = game.settings.get(CONSTANTS.MODULE_NAME, \"support-dialog-shown\")\n  if (!game.user.isGM || shown) return;\n  await game.settings.set(CONSTANTS.MODULE_NAME, \"support-dialog-shown\", true);\n\n  return TJSDialog.prompt({\n    title: \"Sequencer\",\n    label: 'Okay',\n    content: {\n      class: SupportDialog,\n    }\n  }, {\n    height: \"auto\",\n    width: 500\n  });\n}\n\nasync function displaySequencerWelcome() {\n\n  const version = game.settings.get(CONSTANTS.MODULE_NAME, \"welcome-shown-version\")\n\n  if(!game.user.isGM || !foundry.utils.isNewerVersion(version, game.version)) return;\n  await game.settings.set(CONSTANTS.MODULE_NAME, \"welcome-shown-version\", game.version);\n\n  const chatMessages = game.messages.filter(message => {\n    return message.content.includes(\"sequencer-welcome\")\n  }).map(message => message.id);\n\n  if(chatMessages.length){\n    await ChatMessage.deleteDocuments(chatMessages.slice(0, -1))\n  }\n\n  await ChatMessage.create({\n    content: `\n<div class=\"sequencer-welcome\">\n<img src=\"modules/sequencer/images/sequencer.png\"/>\n<div class=\"sequencer-divider\"></div>\n<p>Sequencer can only remain open, free, and regularly updated with the support of the Foundry community.</p>\n<p>Please consider supporting us if you enjoy Foundry & visual effects!</p>\n<div class=\"sequencer-divider\"></div>\n<p><a target=\"_blank\" href=\"https://fantasycomputer.works/\">Website</a> | <a target=\"_blank\" href=\"https://fantasycomputer.works/FoundryVTT-Sequencer/#/\">Docs</a> | <a target=\"_blank\" href=\"https://discord.gg/qFHQUwBZAz\">Discord</a> | <a target=\"_blank\" href=\"https://ko-fi.com/fantasycomputerworks\">Donate</a></p>\n</div>`,\n  });\n\n}\n\n\nHooks.once(\"monaco-editor.ready\", registerTypes);\n"],"names":["lib.custom_error","lib.is_function","lib.debug","is_function","wait","clamp","layer","document","hash","target","now","name","text","element","animation","detach","linear","create_each_block","insert","update","instance","create_fragment","set","subscribe","run","get","writable","debug","result","active","scale","width","interpolate","duration","ease","options","rotation","ctx","create_if_block","s_REGEX_HTML","draggable","booleanStore","dragDefault","storeResizing","create_if_block_1","autoClose","promise","audio","time","lib.getFiles","lib.is_real_number","lib.random_array_element","files","lib.interpolate","module","lib.make_array_unique","lib.custom_warning","lib\n        .str_to_search_regex_str","lib.flatten_object","create_if_block_2","canvas","databaseStore","lib.str_to_search_regex_str","children","key","offset","resizeObserver","dispatch","keeps","data","selectedPackStore","packStore","visibleTreeStore","cleanSearchStore","entriesStore","SvelteApplication","DatabaseShell","lib.wait","lib.get_object_identifier","attr","lib.deep_get","lib.deep_set","lib.clamp","canvaslib.get_object_dimensions","lib.is_UUID","location","canvaslib.getPositionFromData","lib.createMersenneTwister","canvaslib.get_random_offset","lib.safe_str","filters","lib.random_float_between","lib.flip_negate","lib.user_can_do","lib\n      .make_array_unique","FlagManager","lib\n        .get_all_documents_from_scene","lib.get_object_from_scene","lib.get_all_documents_from_scene","lib.group_by","canvaslib.rotate_coordinate","child","filter","canvaslib.align","lib.throttled_custom_warning","canvaslib.is_object_canvas_data","canvaslib.get_object_position","canvaslib.calculate_missed_position","canvaslib.rotateAroundPoint","obj","multiplier","lib.get_hash","canvaslib.validateAnimation","canvaslib.validateLoopingAnimation","canvaslib.is_position_within_bounds","func","canvaslib.distance_between","canvaslib.createShape","canvaslib.get_object_elevation","shape","scaleX","scaleY","lib.debug_error","moves","angle","x","y","align","lib.getCanvasMouse","canvaslib.get_mouse_position","canvaslib.get_closest_token","effect","users","EffectsUIShell","lib.random_int_between","lib.validate_document","lib.parseColor","canvaslib.get_object_canvas_data","canvaslib.alignments","originLocation","timespan","lib.normalize_alpha_number","Sequence","lib.sequence_proxy_wrap","lib.section_proxy_wrap","bind","SequencerSectionManager","SupportDialog"],"mappings":";;;;AAAA;AAAA;AAAA,UAAM,YAAY;AAAA,MAChB,aAAa;AAAA,MACb,mBAAmB;AAAA,MACnB,kBAAkB;AAAA,MACnB,eAAe;AAAA,MACf,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACP,OAAO;AAAA,QACL,SAAS;AAAA,QACT,WAAW;AAAA,MAEb;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,MACP;AAAA,MACD,YAAY,IAAI,OAAO,gBAA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