{"version":3,"file":"coupdoeil.min.js","sources":["../../javascript/coupdoeil/popover/controller.js","../../javascript/coupdoeil/popover/config.js","../../javascript/coupdoeil/popover/options_parser.js","../../javascript/coupdoeil/popover/attributes.js","../../javascript/coupdoeil/popover/cache.js","../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../javascript/coupdoeil/popover/positioning.js","../../../node_modules/el-transition/index.js","../../javascript/coupdoeil/popover/current.js","../../javascript/coupdoeil/popover/closing.js","../../javascript/coupdoeil/popover/utils.js","../../javascript/coupdoeil/popover/opening.js","../../javascript/coupdoeil/popover/lazy_loading.js","../../javascript/coupdoeil/elements/coupdoeil_element.js","../../javascript/coupdoeil/events/onclick.js","../../javascript/coupdoeil/events/onmouseover.js","../../javascript/coupdoeil/events.js","../../javascript/coupdoeil/popover.js"],"sourcesContent":["export class PopoverController {\n  constructor(coupdoeilElement) {\n    this.coupdoeilElement = coupdoeilElement\n\n    this.card = null\n\n    this.children = new Set()\n    this.parent = null\n\n    this.closingRequest = null\n  }\n\n  get isOpen() {\n    return !!this.coupdoeilElement.dataset.popoverOpen\n  }\n\n  get isClosed() {\n    return !this.isOpen\n  }\n}\n","export const POPOVER_CLASS_NAME = 'coupdoeil--popover'\nexport const POPOVER_SELECTOR = `.${POPOVER_CLASS_NAME}`\nexport const POPOVER_CLOSE_BTN_SELECTOR = '[data-popover-close]'\n\n// the time (ms) to wait before closing the popover,\n// to avoid flickering if the user hovers out and in quickly,\n// or if the user moves the mouse from the target to the popover\nexport const CLOSING_DELAY_MS = 100\n\n// the time (ms) to wait before starting to fetch the content,\n// to avoid fetching too soon if the user hovers in and out the target quickly\nexport const FETCH_DELAY_MS = 100\n\n// the minimum time (ms) the user should wait before seeing the popover\nexport const OPENING_DELAY_MS = 200\n","import {getOptions} from \"./attributes\";\n\nexport const OPTIONS = {\n  animation: { getter: getAnimation },\n  cache: { getter: getCache },\n  loading: { getter: getLoading },\n  offset: { getter: getOffset },\n  openingDelay: { getter: getOpeningDelay },\n  placement: { getter: getPlacement },\n  trigger: { getter: getTrigger },\n}\n\nconst ORDERED_OPTIONS = [\n  \"trigger\",      // bit size: 1  shift: 0\n  \"loading\",      // bit size: 2  shift: 1\n  \"cache\",        // bit size: 1  shift: 3\n  \"openingDelay\", // bit size: 1  shift: 4\n  \"animation\",    // bit size: 3  shift: 5\n  \"placement\",    // bit size: 16 shift: 8\n  \"offset\"        // bit size: 20 shift: 24\n]\n\nconst TRIGGERS = [\"hover\", \"click\"]\nconst ANIMATIONS = [false, \"slide-in\", \"fade-in\", \"slide-out\", \"custom\"]\nconst PLACEMENTS = [\n  'auto',\n  'top', 'top-start', 'top-end',\n  'right', 'right-start', 'right-end',\n  'bottom', 'bottom-start', 'bottom-end',\n  'left', 'left-start', 'left-end'\n]\nconst LOADINGS = [\"async\", \"preload\", \"lazy\"]\n\nfunction parseCSSSize(value) {\n  if (typeof value === 'number') {\n    return value\n  } else if ((/^(-?\\d+\\.?\\d+)px$/).test(value)) {\n    return parseFloat(value)\n  } else if ((/^(-?\\d*\\.?\\d+)rem$/).test(value)) {\n    return parseFloat(value) * parseFloat(getComputedStyle(document.documentElement).fontSize)\n  }\n  return 0\n}\n\n// Offset option is a three part number.\n//    integer (8 bits) + decimals (10 bits) + config (2 bits)\n// config bits are for sign (positive (0) or negative (1)) and offset unit (px (0) or rem (1))\n// Examples:\n//  - \"1.25rem\" is: 00000001 . 0000011001 . 10\n//  - \"-16px\" is: 00010000 . 00000000 . 01\n// 10 bits are reserved for decimals so values like 0.875rem are possible.\nfunction getOffset(optionsInt) {\n  // shift is BigInt(16 + 3 + 1 + 1 + 2 + 1)\n  const offsetBits = Number(BigInt(optionsInt) >> BigInt(24))\n  if (offsetBits === 0)\n    return 0\n\n  const isNegative = (offsetBits & 1) === 1\n  const isREM = (offsetBits & 2) === 2\n  const decimals = (offsetBits >> 2 /* config bits */) & 1023 // (2 ** 10) - 1\n  const integer = (offsetBits >> (12 /* config (2) + decimals (10) bits */))\n\n  const CSSSize = `${isNegative ? '-' : ''}${integer}.${decimals}${isREM ? 'rem' : 'px'}`\n  return parseCSSSize(CSSSize)\n}\n\n// Placement option can have up to 4 placement values: a main one and 3 fallbacks.\n// There are 13 possible values for one placement, stored as an array in the PLACEMENTS const.\n// The max index of this array is 12, so a placement value can be stored as an index of this array,\n// and this index value fits in 4 bits.\n// Option for placements then consists of 4 times (main and fallbacks) this index value:\n// So from 0.0.0.0 up to 15.15.15.15, or from 0 up to 65535 (0b1111111111111111)\nfunction getPlacement(optionsInt) {\n  // shift is 3 + 1 + 1 + 2 + 1, mask is 2 ** 16 - 1 or 0b1111111111111111\n  const placementBits = (optionsInt >> 8) & 65535\n  let shift = 0\n  let lastPlacement = null\n  const placements = []\n  while (lastPlacement !== \"auto\" && shift < 16) {\n    // mask is 2 ** 4 - 1\n    lastPlacement = PLACEMENTS[(placementBits >> shift) & 15]\n    placements.push(lastPlacement)\n    shift += 4\n  }\n  return placements\n}\n\nfunction getAnimation(optionsInt) {\n  // return ANIMATIONS[(optionsInt & 56) >> 5]\n  return ANIMATIONS[(optionsInt >> 5) & 7]\n}\n\nfunction getOpeningDelay(optionsInt) {\n  return ((optionsInt >> 4) & 1) === 1\n}\n\nfunction getCache(optionsInt) {\n  return (optionsInt & 8) === 8\n}\n\nfunction getLoading(optionsInt) {\n  // Shift right 1 time to remove trigger bit, mask with 3 (0b11).\n  return LOADINGS[(optionsInt >> 1) & 3]\n}\n\nfunction getTrigger(optionsInt) {\n  return TRIGGERS[optionsInt & 1]\n}\n\nconst popoverOptions = {\n  animation: undefined,\n  cache: undefined,\n  loading: undefined,\n  offset: undefined,\n  openingDelay: undefined,\n  placement: undefined,\n  trigger: undefined,\n}\n\nexport function extractOptionsFromElement(coupdoeilElement) {\n  const controller = coupdoeilElement.popoverController\n  const optionsInt = controller.optionsInt ||= parseOptionsInt((controller))\n  const options = Object.create(popoverOptions)\n\n  for (const option of ORDERED_OPTIONS) {\n    options[option] = OPTIONS[option].getter(optionsInt)\n  }\n\n  return options\n}\n\nfunction parseOptionsInt(controller) {\n  const optionsString = getOptions(controller)\n  return parseInt(optionsString, 36)\n}\n\nexport function extractOptionFromElement(coupdoeilElement, optionName) {\n  const controller = coupdoeilElement.popoverController\n  const optionsInt = controller.optionsInt ||= parseOptionsInt((controller))\n\n  return OPTIONS[optionName].getter(optionsInt)\n}\n","import {extractOptionFromElement} from \"./options_parser\";\n\nexport function getType(controller) {\n  return controller.coupdoeilElement.dataset.popoverType\n}\n\nexport function getParams(controller) {\n  return controller.coupdoeilElement.dataset.popoverParams\n}\n\nexport function getOptions(controller) {\n  return controller.coupdoeilElement.dataset.popoverOptions\n}\n\nexport function getTrigger(controller) {\n  return extractOptionFromElement(controller.coupdoeilElement, 'trigger')\n}\n\nexport function triggeredOnClick(controller) {\n  return getTrigger(controller) === 'click'\n}\n\nexport function noTriggeredOnClick(controller) {\n  return getTrigger(controller) !== 'click'\n}\n\nexport function triggeredOnHover(controller) {\n  return getTrigger(controller) === 'hover'\n}\n\nexport function notTriggeredOnHover(controller) {\n  return getTrigger(controller) !== 'hover'\n}\n\nexport function preloadedContentElement(controller) {\n  return controller.coupdoeilElement.querySelector('.popover-content')\n}\n","import {getParams, getType, preloadedContentElement} from './attributes'\n\nexport const popoverContentHTMLMap = new Map()\n\nfunction cacheMapKey(controller) {\n  if (preloadedContentElement(controller)) {\n    return controller.coupdoeilElement.uniqueId\n  }\n  return getType(controller) + getParams(controller)\n}\n\nexport function getPopoverContentHTML(controller) {\n  return popoverContentHTMLMap.get(cacheMapKey(controller))\n}\n\nexport function setPopoverContentHTML(controller, value) {\n  popoverContentHTMLMap.set(cacheMapKey(controller), value)\n}\n\nexport function clearPopoverContentCache() {\n  popoverContentHTMLMap.clear()\n}\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n  x: v,\n  y: v\n});\nconst oppositeSideMap = {\n  left: 'right',\n  right: 'left',\n  bottom: 'top',\n  top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n  start: 'end',\n  end: 'start'\n};\nfunction clamp(start, value, end) {\n  return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n  return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n  return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n  return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n  return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n  return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n  return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n  return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n  if (rtl === void 0) {\n    rtl = false;\n  }\n  const alignment = getAlignment(placement);\n  const alignmentAxis = getAlignmentAxis(placement);\n  const length = getAxisLength(alignmentAxis);\n  let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n  if (rects.reference[length] > rects.floating[length]) {\n    mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n  }\n  return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n  const oppositePlacement = getOppositePlacement(placement);\n  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n  const lr = ['left', 'right'];\n  const rl = ['right', 'left'];\n  const tb = ['top', 'bottom'];\n  const bt = ['bottom', 'top'];\n  switch (side) {\n    case 'top':\n    case 'bottom':\n      if (rtl) return isStart ? rl : lr;\n      return isStart ? lr : rl;\n    case 'left':\n    case 'right':\n      return isStart ? tb : bt;\n    default:\n      return [];\n  }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n  const alignment = getAlignment(placement);\n  let list = getSideList(getSide(placement), direction === 'start', rtl);\n  if (alignment) {\n    list = list.map(side => side + \"-\" + alignment);\n    if (flipAlignment) {\n      list = list.concat(list.map(getOppositeAlignmentPlacement));\n    }\n  }\n  return list;\n}\nfunction getOppositePlacement(placement) {\n  return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n  return {\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0,\n    ...padding\n  };\n}\nfunction getPaddingObject(padding) {\n  return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n    top: padding,\n    right: padding,\n    bottom: padding,\n    left: padding\n  };\n}\nfunction rectToClientRect(rect) {\n  const {\n    x,\n    y,\n    width,\n    height\n  } = rect;\n  return {\n    width,\n    height,\n    top: y,\n    left: x,\n    right: x + width,\n    bottom: y + height,\n    x,\n    y\n  };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n  let {\n    reference,\n    floating\n  } = _ref;\n  const sideAxis = getSideAxis(placement);\n  const alignmentAxis = getAlignmentAxis(placement);\n  const alignLength = getAxisLength(alignmentAxis);\n  const side = getSide(placement);\n  const isVertical = sideAxis === 'y';\n  const commonX = reference.x + reference.width / 2 - floating.width / 2;\n  const commonY = reference.y + reference.height / 2 - floating.height / 2;\n  const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n  let coords;\n  switch (side) {\n    case 'top':\n      coords = {\n        x: commonX,\n        y: reference.y - floating.height\n      };\n      break;\n    case 'bottom':\n      coords = {\n        x: commonX,\n        y: reference.y + reference.height\n      };\n      break;\n    case 'right':\n      coords = {\n        x: reference.x + reference.width,\n        y: commonY\n      };\n      break;\n    case 'left':\n      coords = {\n        x: reference.x - floating.width,\n        y: commonY\n      };\n      break;\n    default:\n      coords = {\n        x: reference.x,\n        y: reference.y\n      };\n  }\n  switch (getAlignment(placement)) {\n    case 'start':\n      coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n      break;\n    case 'end':\n      coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n      break;\n  }\n  return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n  const {\n    placement = 'bottom',\n    strategy = 'absolute',\n    middleware = [],\n    platform\n  } = config;\n  const validMiddleware = middleware.filter(Boolean);\n  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n  let rects = await platform.getElementRects({\n    reference,\n    floating,\n    strategy\n  });\n  let {\n    x,\n    y\n  } = computeCoordsFromPlacement(rects, placement, rtl);\n  let statefulPlacement = placement;\n  let middlewareData = {};\n  let resetCount = 0;\n  for (let i = 0; i < validMiddleware.length; i++) {\n    const {\n      name,\n      fn\n    } = validMiddleware[i];\n    const {\n      x: nextX,\n      y: nextY,\n      data,\n      reset\n    } = await fn({\n      x,\n      y,\n      initialPlacement: placement,\n      placement: statefulPlacement,\n      strategy,\n      middlewareData,\n      rects,\n      platform,\n      elements: {\n        reference,\n        floating\n      }\n    });\n    x = nextX != null ? nextX : x;\n    y = nextY != null ? nextY : y;\n    middlewareData = {\n      ...middlewareData,\n      [name]: {\n        ...middlewareData[name],\n        ...data\n      }\n    };\n    if (reset && resetCount <= 50) {\n      resetCount++;\n      if (typeof reset === 'object') {\n        if (reset.placement) {\n          statefulPlacement = reset.placement;\n        }\n        if (reset.rects) {\n          rects = reset.rects === true ? await platform.getElementRects({\n            reference,\n            floating,\n            strategy\n          }) : reset.rects;\n        }\n        ({\n          x,\n          y\n        } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n      }\n      i = -1;\n    }\n  }\n  return {\n    x,\n    y,\n    placement: statefulPlacement,\n    strategy,\n    middlewareData\n  };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n  var _await$platform$isEle;\n  if (options === void 0) {\n    options = {};\n  }\n  const {\n    x,\n    y,\n    platform,\n    rects,\n    elements,\n    strategy\n  } = state;\n  const {\n    boundary = 'clippingAncestors',\n    rootBoundary = 'viewport',\n    elementContext = 'floating',\n    altBoundary = false,\n    padding = 0\n  } = evaluate(options, state);\n  const paddingObject = getPaddingObject(padding);\n  const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n  const element = elements[altBoundary ? altContext : elementContext];\n  const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n    element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n    boundary,\n    rootBoundary,\n    strategy\n  }));\n  const rect = elementContext === 'floating' ? {\n    x,\n    y,\n    width: rects.floating.width,\n    height: rects.floating.height\n  } : rects.reference;\n  const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n  const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n    x: 1,\n    y: 1\n  } : {\n    x: 1,\n    y: 1\n  };\n  const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n    elements,\n    rect,\n    offsetParent,\n    strategy\n  }) : rect);\n  return {\n    top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n    bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n    left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n    right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n  };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n  name: 'arrow',\n  options,\n  async fn(state) {\n    const {\n      x,\n      y,\n      placement,\n      rects,\n      platform,\n      elements,\n      middlewareData\n    } = state;\n    // Since `element` is required, we don't Partial<> the type.\n    const {\n      element,\n      padding = 0\n    } = evaluate(options, state) || {};\n    if (element == null) {\n      return {};\n    }\n    const paddingObject = getPaddingObject(padding);\n    const coords = {\n      x,\n      y\n    };\n    const axis = getAlignmentAxis(placement);\n    const length = getAxisLength(axis);\n    const arrowDimensions = await platform.getDimensions(element);\n    const isYAxis = axis === 'y';\n    const minProp = isYAxis ? 'top' : 'left';\n    const maxProp = isYAxis ? 'bottom' : 'right';\n    const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n    const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n    const startDiff = coords[axis] - rects.reference[axis];\n    const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n    let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n    // DOM platform can return `window` as the `offsetParent`.\n    if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n      clientSize = elements.floating[clientProp] || rects.floating[length];\n    }\n    const centerToReference = endDiff / 2 - startDiff / 2;\n\n    // If the padding is large enough that it causes the arrow to no longer be\n    // centered, modify the padding so that it is centered.\n    const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n    const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n    const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n    // Make sure the arrow doesn't overflow the floating element if the center\n    // point is outside the floating element's bounds.\n    const min$1 = minPadding;\n    const max = clientSize - arrowDimensions[length] - maxPadding;\n    const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n    const offset = clamp(min$1, center, max);\n\n    // If the reference is small enough that the arrow's padding causes it to\n    // to point to nothing for an aligned placement, adjust the offset of the\n    // floating element itself. To ensure `shift()` continues to take action,\n    // a single reset is performed when this is true.\n    const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n    const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n    return {\n      [axis]: coords[axis] + alignmentOffset,\n      data: {\n        [axis]: offset,\n        centerOffset: center - offset - alignmentOffset,\n        ...(shouldAddOffset && {\n          alignmentOffset\n        })\n      },\n      reset: shouldAddOffset\n    };\n  }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n  const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n  return allowedPlacementsSortedByAlignment.filter(placement => {\n    if (alignment) {\n      return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n    }\n    return true;\n  });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'autoPlacement',\n    options,\n    async fn(state) {\n      var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n      const {\n        rects,\n        middlewareData,\n        placement,\n        platform,\n        elements\n      } = state;\n      const {\n        crossAxis = false,\n        alignment,\n        allowedPlacements = placements,\n        autoAlignment = true,\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n      const overflow = await detectOverflow(state, detectOverflowOptions);\n      const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n      const currentPlacement = placements$1[currentIndex];\n      if (currentPlacement == null) {\n        return {};\n      }\n      const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n      // Make `computeCoords` start from the right place.\n      if (placement !== currentPlacement) {\n        return {\n          reset: {\n            placement: placements$1[0]\n          }\n        };\n      }\n      const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n      const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n        placement: currentPlacement,\n        overflows: currentOverflows\n      }];\n      const nextPlacement = placements$1[currentIndex + 1];\n\n      // There are more placements to check.\n      if (nextPlacement) {\n        return {\n          data: {\n            index: currentIndex + 1,\n            overflows: allOverflows\n          },\n          reset: {\n            placement: nextPlacement\n          }\n        };\n      }\n      const placementsSortedByMostSpace = allOverflows.map(d => {\n        const alignment = getAlignment(d.placement);\n        return [d.placement, alignment && crossAxis ?\n        // Check along the mainAxis and main crossAxis side.\n        d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n        // Check only the mainAxis.\n        d.overflows[0], d.overflows];\n      }).sort((a, b) => a[1] - b[1]);\n      const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n      // Aligned placements should not check their opposite crossAxis\n      // side.\n      getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n      const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n      if (resetPlacement !== placement) {\n        return {\n          data: {\n            index: currentIndex + 1,\n            overflows: allOverflows\n          },\n          reset: {\n            placement: resetPlacement\n          }\n        };\n      }\n      return {};\n    }\n  };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'flip',\n    options,\n    async fn(state) {\n      var _middlewareData$arrow, _middlewareData$flip;\n      const {\n        placement,\n        middlewareData,\n        rects,\n        initialPlacement,\n        platform,\n        elements\n      } = state;\n      const {\n        mainAxis: checkMainAxis = true,\n        crossAxis: checkCrossAxis = true,\n        fallbackPlacements: specifiedFallbackPlacements,\n        fallbackStrategy = 'bestFit',\n        fallbackAxisSideDirection = 'none',\n        flipAlignment = true,\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n\n      // If a reset by the arrow was caused due to an alignment offset being\n      // added, we should skip any logic now since `flip()` has already done its\n      // work.\n      // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n      if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n        return {};\n      }\n      const side = getSide(placement);\n      const initialSideAxis = getSideAxis(initialPlacement);\n      const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n      const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n      const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n      const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n      if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n        fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n      }\n      const placements = [initialPlacement, ...fallbackPlacements];\n      const overflow = await detectOverflow(state, detectOverflowOptions);\n      const overflows = [];\n      let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n      if (checkMainAxis) {\n        overflows.push(overflow[side]);\n      }\n      if (checkCrossAxis) {\n        const sides = getAlignmentSides(placement, rects, rtl);\n        overflows.push(overflow[sides[0]], overflow[sides[1]]);\n      }\n      overflowsData = [...overflowsData, {\n        placement,\n        overflows\n      }];\n\n      // One or more sides is overflowing.\n      if (!overflows.every(side => side <= 0)) {\n        var _middlewareData$flip2, _overflowsData$filter;\n        const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n        const nextPlacement = placements[nextIndex];\n        if (nextPlacement) {\n          // Try next placement and re-run the lifecycle.\n          return {\n            data: {\n              index: nextIndex,\n              overflows: overflowsData\n            },\n            reset: {\n              placement: nextPlacement\n            }\n          };\n        }\n\n        // First, find the candidates that fit on the mainAxis side of overflow,\n        // then find the placement that fits the best on the main crossAxis side.\n        let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n        // Otherwise fallback.\n        if (!resetPlacement) {\n          switch (fallbackStrategy) {\n            case 'bestFit':\n              {\n                var _overflowsData$filter2;\n                const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n                  if (hasFallbackAxisSideDirection) {\n                    const currentSideAxis = getSideAxis(d.placement);\n                    return currentSideAxis === initialSideAxis ||\n                    // Create a bias to the `y` side axis due to horizontal\n                    // reading directions favoring greater width.\n                    currentSideAxis === 'y';\n                  }\n                  return true;\n                }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n                if (placement) {\n                  resetPlacement = placement;\n                }\n                break;\n              }\n            case 'initialPlacement':\n              resetPlacement = initialPlacement;\n              break;\n          }\n        }\n        if (placement !== resetPlacement) {\n          return {\n            reset: {\n              placement: resetPlacement\n            }\n          };\n        }\n      }\n      return {};\n    }\n  };\n};\n\nfunction getSideOffsets(overflow, rect) {\n  return {\n    top: overflow.top - rect.height,\n    right: overflow.right - rect.width,\n    bottom: overflow.bottom - rect.height,\n    left: overflow.left - rect.width\n  };\n}\nfunction isAnySideFullyClipped(overflow) {\n  return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'hide',\n    options,\n    async fn(state) {\n      const {\n        rects\n      } = state;\n      const {\n        strategy = 'referenceHidden',\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      switch (strategy) {\n        case 'referenceHidden':\n          {\n            const overflow = await detectOverflow(state, {\n              ...detectOverflowOptions,\n              elementContext: 'reference'\n            });\n            const offsets = getSideOffsets(overflow, rects.reference);\n            return {\n              data: {\n                referenceHiddenOffsets: offsets,\n                referenceHidden: isAnySideFullyClipped(offsets)\n              }\n            };\n          }\n        case 'escaped':\n          {\n            const overflow = await detectOverflow(state, {\n              ...detectOverflowOptions,\n              altBoundary: true\n            });\n            const offsets = getSideOffsets(overflow, rects.floating);\n            return {\n              data: {\n                escapedOffsets: offsets,\n                escaped: isAnySideFullyClipped(offsets)\n              }\n            };\n          }\n        default:\n          {\n            return {};\n          }\n      }\n    }\n  };\n};\n\nfunction getBoundingRect(rects) {\n  const minX = min(...rects.map(rect => rect.left));\n  const minY = min(...rects.map(rect => rect.top));\n  const maxX = max(...rects.map(rect => rect.right));\n  const maxY = max(...rects.map(rect => rect.bottom));\n  return {\n    x: minX,\n    y: minY,\n    width: maxX - minX,\n    height: maxY - minY\n  };\n}\nfunction getRectsByLine(rects) {\n  const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n  const groups = [];\n  let prevRect = null;\n  for (let i = 0; i < sortedRects.length; i++) {\n    const rect = sortedRects[i];\n    if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n      groups.push([rect]);\n    } else {\n      groups[groups.length - 1].push(rect);\n    }\n    prevRect = rect;\n  }\n  return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'inline',\n    options,\n    async fn(state) {\n      const {\n        placement,\n        elements,\n        rects,\n        platform,\n        strategy\n      } = state;\n      // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n      // ClientRect's bounds, despite the event listener being triggered. A\n      // padding of 2 seems to handle this issue.\n      const {\n        padding = 2,\n        x,\n        y\n      } = evaluate(options, state);\n      const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n      const clientRects = getRectsByLine(nativeClientRects);\n      const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n      const paddingObject = getPaddingObject(padding);\n      function getBoundingClientRect() {\n        // There are two rects and they are disjoined.\n        if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n          // Find the first rect in which the point is fully inside.\n          return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n        }\n\n        // There are 2 or more connected rects.\n        if (clientRects.length >= 2) {\n          if (getSideAxis(placement) === 'y') {\n            const firstRect = clientRects[0];\n            const lastRect = clientRects[clientRects.length - 1];\n            const isTop = getSide(placement) === 'top';\n            const top = firstRect.top;\n            const bottom = lastRect.bottom;\n            const left = isTop ? firstRect.left : lastRect.left;\n            const right = isTop ? firstRect.right : lastRect.right;\n            const width = right - left;\n            const height = bottom - top;\n            return {\n              top,\n              bottom,\n              left,\n              right,\n              width,\n              height,\n              x: left,\n              y: top\n            };\n          }\n          const isLeftSide = getSide(placement) === 'left';\n          const maxRight = max(...clientRects.map(rect => rect.right));\n          const minLeft = min(...clientRects.map(rect => rect.left));\n          const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n          const top = measureRects[0].top;\n          const bottom = measureRects[measureRects.length - 1].bottom;\n          const left = minLeft;\n          const right = maxRight;\n          const width = right - left;\n          const height = bottom - top;\n          return {\n            top,\n            bottom,\n            left,\n            right,\n            width,\n            height,\n            x: left,\n            y: top\n          };\n        }\n        return fallback;\n      }\n      const resetRects = await platform.getElementRects({\n        reference: {\n          getBoundingClientRect\n        },\n        floating: elements.floating,\n        strategy\n      });\n      if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n        return {\n          reset: {\n            rects: resetRects\n          }\n        };\n      }\n      return {};\n    }\n  };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n  const {\n    placement,\n    platform,\n    elements\n  } = state;\n  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n  const side = getSide(placement);\n  const alignment = getAlignment(placement);\n  const isVertical = getSideAxis(placement) === 'y';\n  const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n  const crossAxisMulti = rtl && isVertical ? -1 : 1;\n  const rawValue = evaluate(options, state);\n\n  // eslint-disable-next-line prefer-const\n  let {\n    mainAxis,\n    crossAxis,\n    alignmentAxis\n  } = typeof rawValue === 'number' ? {\n    mainAxis: rawValue,\n    crossAxis: 0,\n    alignmentAxis: null\n  } : {\n    mainAxis: rawValue.mainAxis || 0,\n    crossAxis: rawValue.crossAxis || 0,\n    alignmentAxis: rawValue.alignmentAxis\n  };\n  if (alignment && typeof alignmentAxis === 'number') {\n    crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n  }\n  return isVertical ? {\n    x: crossAxis * crossAxisMulti,\n    y: mainAxis * mainAxisMulti\n  } : {\n    x: mainAxis * mainAxisMulti,\n    y: crossAxis * crossAxisMulti\n  };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n  if (options === void 0) {\n    options = 0;\n  }\n  return {\n    name: 'offset',\n    options,\n    async fn(state) {\n      var _middlewareData$offse, _middlewareData$arrow;\n      const {\n        x,\n        y,\n        placement,\n        middlewareData\n      } = state;\n      const diffCoords = await convertValueToCoords(state, options);\n\n      // If the placement is the same and the arrow caused an alignment offset\n      // then we don't need to change the positioning coordinates.\n      if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n        return {};\n      }\n      return {\n        x: x + diffCoords.x,\n        y: y + diffCoords.y,\n        data: {\n          ...diffCoords,\n          placement\n        }\n      };\n    }\n  };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'shift',\n    options,\n    async fn(state) {\n      const {\n        x,\n        y,\n        placement\n      } = state;\n      const {\n        mainAxis: checkMainAxis = true,\n        crossAxis: checkCrossAxis = false,\n        limiter = {\n          fn: _ref => {\n            let {\n              x,\n              y\n            } = _ref;\n            return {\n              x,\n              y\n            };\n          }\n        },\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      const coords = {\n        x,\n        y\n      };\n      const overflow = await detectOverflow(state, detectOverflowOptions);\n      const crossAxis = getSideAxis(getSide(placement));\n      const mainAxis = getOppositeAxis(crossAxis);\n      let mainAxisCoord = coords[mainAxis];\n      let crossAxisCoord = coords[crossAxis];\n      if (checkMainAxis) {\n        const minSide = mainAxis === 'y' ? 'top' : 'left';\n        const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n        const min = mainAxisCoord + overflow[minSide];\n        const max = mainAxisCoord - overflow[maxSide];\n        mainAxisCoord = clamp(min, mainAxisCoord, max);\n      }\n      if (checkCrossAxis) {\n        const minSide = crossAxis === 'y' ? 'top' : 'left';\n        const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n        const min = crossAxisCoord + overflow[minSide];\n        const max = crossAxisCoord - overflow[maxSide];\n        crossAxisCoord = clamp(min, crossAxisCoord, max);\n      }\n      const limitedCoords = limiter.fn({\n        ...state,\n        [mainAxis]: mainAxisCoord,\n        [crossAxis]: crossAxisCoord\n      });\n      return {\n        ...limitedCoords,\n        data: {\n          x: limitedCoords.x - x,\n          y: limitedCoords.y - y,\n          enabled: {\n            [mainAxis]: checkMainAxis,\n            [crossAxis]: checkCrossAxis\n          }\n        }\n      };\n    }\n  };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    options,\n    fn(state) {\n      const {\n        x,\n        y,\n        placement,\n        rects,\n        middlewareData\n      } = state;\n      const {\n        offset = 0,\n        mainAxis: checkMainAxis = true,\n        crossAxis: checkCrossAxis = true\n      } = evaluate(options, state);\n      const coords = {\n        x,\n        y\n      };\n      const crossAxis = getSideAxis(placement);\n      const mainAxis = getOppositeAxis(crossAxis);\n      let mainAxisCoord = coords[mainAxis];\n      let crossAxisCoord = coords[crossAxis];\n      const rawOffset = evaluate(offset, state);\n      const computedOffset = typeof rawOffset === 'number' ? {\n        mainAxis: rawOffset,\n        crossAxis: 0\n      } : {\n        mainAxis: 0,\n        crossAxis: 0,\n        ...rawOffset\n      };\n      if (checkMainAxis) {\n        const len = mainAxis === 'y' ? 'height' : 'width';\n        const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n        const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n        if (mainAxisCoord < limitMin) {\n          mainAxisCoord = limitMin;\n        } else if (mainAxisCoord > limitMax) {\n          mainAxisCoord = limitMax;\n        }\n      }\n      if (checkCrossAxis) {\n        var _middlewareData$offse, _middlewareData$offse2;\n        const len = mainAxis === 'y' ? 'width' : 'height';\n        const isOriginSide = ['top', 'left'].includes(getSide(placement));\n        const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n        const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n        if (crossAxisCoord < limitMin) {\n          crossAxisCoord = limitMin;\n        } else if (crossAxisCoord > limitMax) {\n          crossAxisCoord = limitMax;\n        }\n      }\n      return {\n        [mainAxis]: mainAxisCoord,\n        [crossAxis]: crossAxisCoord\n      };\n    }\n  };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'size',\n    options,\n    async fn(state) {\n      var _state$middlewareData, _state$middlewareData2;\n      const {\n        placement,\n        rects,\n        platform,\n        elements\n      } = state;\n      const {\n        apply = () => {},\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      const overflow = await detectOverflow(state, detectOverflowOptions);\n      const side = getSide(placement);\n      const alignment = getAlignment(placement);\n      const isYAxis = getSideAxis(placement) === 'y';\n      const {\n        width,\n        height\n      } = rects.floating;\n      let heightSide;\n      let widthSide;\n      if (side === 'top' || side === 'bottom') {\n        heightSide = side;\n        widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n      } else {\n        widthSide = side;\n        heightSide = alignment === 'end' ? 'top' : 'bottom';\n      }\n      const maximumClippingHeight = height - overflow.top - overflow.bottom;\n      const maximumClippingWidth = width - overflow.left - overflow.right;\n      const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n      const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n      const noShift = !state.middlewareData.shift;\n      let availableHeight = overflowAvailableHeight;\n      let availableWidth = overflowAvailableWidth;\n      if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n        availableWidth = maximumClippingWidth;\n      }\n      if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n        availableHeight = maximumClippingHeight;\n      }\n      if (noShift && !alignment) {\n        const xMin = max(overflow.left, 0);\n        const xMax = max(overflow.right, 0);\n        const yMin = max(overflow.top, 0);\n        const yMax = max(overflow.bottom, 0);\n        if (isYAxis) {\n          availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n        } else {\n          availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n        }\n      }\n      await apply({\n        ...state,\n        availableWidth,\n        availableHeight\n      });\n      const nextDimensions = await platform.getDimensions(elements.floating);\n      if (width !== nextDimensions.width || height !== nextDimensions.height) {\n        return {\n          reset: {\n            rects: true\n          }\n        };\n      }\n      return {};\n    }\n  };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n  return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n  if (isNode(node)) {\n    return (node.nodeName || '').toLowerCase();\n  }\n  // Mocked nodes in testing environments may not be instances of Node. By\n  // returning `#document` an infinite loop won't occur.\n  // https://github.com/floating-ui/floating-ui/issues/2317\n  return '#document';\n}\nfunction getWindow(node) {\n  var _node$ownerDocument;\n  return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n  var _ref;\n  return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n  if (!hasWindow()) {\n    return false;\n  }\n  return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n  if (!hasWindow()) {\n    return false;\n  }\n  return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n  if (!hasWindow()) {\n    return false;\n  }\n  return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n  if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n    return false;\n  }\n  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n  const {\n    overflow,\n    overflowX,\n    overflowY,\n    display\n  } = getComputedStyle(element);\n  return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n  return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n  return [':popover-open', ':modal'].some(selector => {\n    try {\n      return element.matches(selector);\n    } catch (e) {\n      return false;\n    }\n  });\n}\nfunction isContainingBlock(elementOrCss) {\n  const webkit = isWebKit();\n  const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n  return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n  let currentNode = getParentNode(element);\n  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n    if (isContainingBlock(currentNode)) {\n      return currentNode;\n    } else if (isTopLayer(currentNode)) {\n      return null;\n    }\n    currentNode = getParentNode(currentNode);\n  }\n  return null;\n}\nfunction isWebKit() {\n  if (typeof CSS === 'undefined' || !CSS.supports) return false;\n  return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n  return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n  return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n  if (isElement(element)) {\n    return {\n      scrollLeft: element.scrollLeft,\n      scrollTop: element.scrollTop\n    };\n  }\n  return {\n    scrollLeft: element.scrollX,\n    scrollTop: element.scrollY\n  };\n}\nfunction getParentNode(node) {\n  if (getNodeName(node) === 'html') {\n    return node;\n  }\n  const result =\n  // Step into the shadow DOM of the parent of a slotted node.\n  node.assignedSlot ||\n  // DOM Element detected.\n  node.parentNode ||\n  // ShadowRoot detected.\n  isShadowRoot(node) && node.host ||\n  // Fallback.\n  getDocumentElement(node);\n  return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n  const parentNode = getParentNode(node);\n  if (isLastTraversableNode(parentNode)) {\n    return node.ownerDocument ? node.ownerDocument.body : node.body;\n  }\n  if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n    return parentNode;\n  }\n  return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n  var _node$ownerDocument2;\n  if (list === void 0) {\n    list = [];\n  }\n  if (traverseIframes === void 0) {\n    traverseIframes = true;\n  }\n  const scrollableAncestor = getNearestOverflowAncestor(node);\n  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n  const win = getWindow(scrollableAncestor);\n  if (isBody) {\n    const frameElement = getFrameElement(win);\n    return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n  }\n  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n  const css = getComputedStyle(element);\n  // In testing environments, the `width` and `height` properties are empty\n  // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n  let width = parseFloat(css.width) || 0;\n  let height = parseFloat(css.height) || 0;\n  const hasOffset = isHTMLElement(element);\n  const offsetWidth = hasOffset ? element.offsetWidth : width;\n  const offsetHeight = hasOffset ? element.offsetHeight : height;\n  const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n  if (shouldFallback) {\n    width = offsetWidth;\n    height = offsetHeight;\n  }\n  return {\n    width,\n    height,\n    $: shouldFallback\n  };\n}\n\nfunction unwrapElement(element) {\n  return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n  const domElement = unwrapElement(element);\n  if (!isHTMLElement(domElement)) {\n    return createCoords(1);\n  }\n  const rect = domElement.getBoundingClientRect();\n  const {\n    width,\n    height,\n    $\n  } = getCssDimensions(domElement);\n  let x = ($ ? round(rect.width) : rect.width) / width;\n  let y = ($ ? round(rect.height) : rect.height) / height;\n\n  // 0, NaN, or Infinity should always fallback to 1.\n\n  if (!x || !Number.isFinite(x)) {\n    x = 1;\n  }\n  if (!y || !Number.isFinite(y)) {\n    y = 1;\n  }\n  return {\n    x,\n    y\n  };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n  const win = getWindow(element);\n  if (!isWebKit() || !win.visualViewport) {\n    return noOffsets;\n  }\n  return {\n    x: win.visualViewport.offsetLeft,\n    y: win.visualViewport.offsetTop\n  };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n  if (isFixed === void 0) {\n    isFixed = false;\n  }\n  if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n    return false;\n  }\n  return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n  if (includeScale === void 0) {\n    includeScale = false;\n  }\n  if (isFixedStrategy === void 0) {\n    isFixedStrategy = false;\n  }\n  const clientRect = element.getBoundingClientRect();\n  const domElement = unwrapElement(element);\n  let scale = createCoords(1);\n  if (includeScale) {\n    if (offsetParent) {\n      if (isElement(offsetParent)) {\n        scale = getScale(offsetParent);\n      }\n    } else {\n      scale = getScale(element);\n    }\n  }\n  const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n  let x = (clientRect.left + visualOffsets.x) / scale.x;\n  let y = (clientRect.top + visualOffsets.y) / scale.y;\n  let width = clientRect.width / scale.x;\n  let height = clientRect.height / scale.y;\n  if (domElement) {\n    const win = getWindow(domElement);\n    const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n    let currentWin = win;\n    let currentIFrame = getFrameElement(currentWin);\n    while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n      const iframeScale = getScale(currentIFrame);\n      const iframeRect = currentIFrame.getBoundingClientRect();\n      const css = getComputedStyle(currentIFrame);\n      const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n      const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n      x *= iframeScale.x;\n      y *= iframeScale.y;\n      width *= iframeScale.x;\n      height *= iframeScale.y;\n      x += left;\n      y += top;\n      currentWin = getWindow(currentIFrame);\n      currentIFrame = getFrameElement(currentWin);\n    }\n  }\n  return rectToClientRect({\n    width,\n    height,\n    x,\n    y\n  });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n  const leftScroll = getNodeScroll(element).scrollLeft;\n  if (!rect) {\n    return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n  }\n  return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n  if (ignoreScrollbarX === void 0) {\n    ignoreScrollbarX = false;\n  }\n  const htmlRect = documentElement.getBoundingClientRect();\n  const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :\n  // RTL <body> scrollbar.\n  getWindowScrollBarX(documentElement, htmlRect));\n  const y = htmlRect.top + scroll.scrollTop;\n  return {\n    x,\n    y\n  };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n  let {\n    elements,\n    rect,\n    offsetParent,\n    strategy\n  } = _ref;\n  const isFixed = strategy === 'fixed';\n  const documentElement = getDocumentElement(offsetParent);\n  const topLayer = elements ? isTopLayer(elements.floating) : false;\n  if (offsetParent === documentElement || topLayer && isFixed) {\n    return rect;\n  }\n  let scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  let scale = createCoords(1);\n  const offsets = createCoords(0);\n  const isOffsetParentAnElement = isHTMLElement(offsetParent);\n  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n    if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n    if (isHTMLElement(offsetParent)) {\n      const offsetRect = getBoundingClientRect(offsetParent);\n      scale = getScale(offsetParent);\n      offsets.x = offsetRect.x + offsetParent.clientLeft;\n      offsets.y = offsetRect.y + offsetParent.clientTop;\n    }\n  }\n  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n  return {\n    width: rect.width * scale.x,\n    height: rect.height * scale.y,\n    x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n    y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n  };\n}\n\nfunction getClientRects(element) {\n  return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n  const html = getDocumentElement(element);\n  const scroll = getNodeScroll(element);\n  const body = element.ownerDocument.body;\n  const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n  let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n  const y = -scroll.scrollTop;\n  if (getComputedStyle(body).direction === 'rtl') {\n    x += max(html.clientWidth, body.clientWidth) - width;\n  }\n  return {\n    width,\n    height,\n    x,\n    y\n  };\n}\n\nfunction getViewportRect(element, strategy) {\n  const win = getWindow(element);\n  const html = getDocumentElement(element);\n  const visualViewport = win.visualViewport;\n  let width = html.clientWidth;\n  let height = html.clientHeight;\n  let x = 0;\n  let y = 0;\n  if (visualViewport) {\n    width = visualViewport.width;\n    height = visualViewport.height;\n    const visualViewportBased = isWebKit();\n    if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n      x = visualViewport.offsetLeft;\n      y = visualViewport.offsetTop;\n    }\n  }\n  return {\n    width,\n    height,\n    x,\n    y\n  };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n  const top = clientRect.top + element.clientTop;\n  const left = clientRect.left + element.clientLeft;\n  const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n  const width = element.clientWidth * scale.x;\n  const height = element.clientHeight * scale.y;\n  const x = left * scale.x;\n  const y = top * scale.y;\n  return {\n    width,\n    height,\n    x,\n    y\n  };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n  let rect;\n  if (clippingAncestor === 'viewport') {\n    rect = getViewportRect(element, strategy);\n  } else if (clippingAncestor === 'document') {\n    rect = getDocumentRect(getDocumentElement(element));\n  } else if (isElement(clippingAncestor)) {\n    rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n  } else {\n    const visualOffsets = getVisualOffsets(element);\n    rect = {\n      x: clippingAncestor.x - visualOffsets.x,\n      y: clippingAncestor.y - visualOffsets.y,\n      width: clippingAncestor.width,\n      height: clippingAncestor.height\n    };\n  }\n  return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n  const parentNode = getParentNode(element);\n  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n    return false;\n  }\n  return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n  const cachedResult = cache.get(element);\n  if (cachedResult) {\n    return cachedResult;\n  }\n  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n  let currentContainingBlockComputedStyle = null;\n  const elementIsFixed = getComputedStyle(element).position === 'fixed';\n  let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n    const computedStyle = getComputedStyle(currentNode);\n    const currentNodeIsContaining = isContainingBlock(currentNode);\n    if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n      currentContainingBlockComputedStyle = null;\n    }\n    const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n    if (shouldDropCurrentNode) {\n      // Drop non-containing blocks.\n      result = result.filter(ancestor => ancestor !== currentNode);\n    } else {\n      // Record last containing block for next iteration.\n      currentContainingBlockComputedStyle = computedStyle;\n    }\n    currentNode = getParentNode(currentNode);\n  }\n  cache.set(element, result);\n  return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n  let {\n    element,\n    boundary,\n    rootBoundary,\n    strategy\n  } = _ref;\n  const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n  const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n  const firstClippingAncestor = clippingAncestors[0];\n  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n    const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n    accRect.top = max(rect.top, accRect.top);\n    accRect.right = min(rect.right, accRect.right);\n    accRect.bottom = min(rect.bottom, accRect.bottom);\n    accRect.left = max(rect.left, accRect.left);\n    return accRect;\n  }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n  return {\n    width: clippingRect.right - clippingRect.left,\n    height: clippingRect.bottom - clippingRect.top,\n    x: clippingRect.left,\n    y: clippingRect.top\n  };\n}\n\nfunction getDimensions(element) {\n  const {\n    width,\n    height\n  } = getCssDimensions(element);\n  return {\n    width,\n    height\n  };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n  const isOffsetParentAnElement = isHTMLElement(offsetParent);\n  const documentElement = getDocumentElement(offsetParent);\n  const isFixed = strategy === 'fixed';\n  const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n  let scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  const offsets = createCoords(0);\n  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n    if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n    if (isOffsetParentAnElement) {\n      const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n      offsets.x = offsetRect.x + offsetParent.clientLeft;\n      offsets.y = offsetRect.y + offsetParent.clientTop;\n    } else if (documentElement) {\n      // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n      // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n      offsets.x = getWindowScrollBarX(documentElement);\n    }\n  }\n  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n  const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n  return {\n    x,\n    y,\n    width: rect.width,\n    height: rect.height\n  };\n}\n\nfunction isStaticPositioned(element) {\n  return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n  if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n    return null;\n  }\n  if (polyfill) {\n    return polyfill(element);\n  }\n  let rawOffsetParent = element.offsetParent;\n\n  // Firefox returns the <html> element as the offsetParent if it's non-static,\n  // while Chrome and Safari return the <body> element. The <body> element must\n  // be used to perform the correct calculations even if the <html> element is\n  // non-static.\n  if (getDocumentElement(element) === rawOffsetParent) {\n    rawOffsetParent = rawOffsetParent.ownerDocument.body;\n  }\n  return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n  const win = getWindow(element);\n  if (isTopLayer(element)) {\n    return win;\n  }\n  if (!isHTMLElement(element)) {\n    let svgOffsetParent = getParentNode(element);\n    while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n      if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n        return svgOffsetParent;\n      }\n      svgOffsetParent = getParentNode(svgOffsetParent);\n    }\n    return win;\n  }\n  let offsetParent = getTrueOffsetParent(element, polyfill);\n  while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n    offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n  }\n  if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n    return win;\n  }\n  return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n  const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n  const getDimensionsFn = this.getDimensions;\n  const floatingDimensions = await getDimensionsFn(data.floating);\n  return {\n    reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n    floating: {\n      x: 0,\n      y: 0,\n      width: floatingDimensions.width,\n      height: floatingDimensions.height\n    }\n  };\n};\n\nfunction isRTL(element) {\n  return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n  convertOffsetParentRelativeRectToViewportRelativeRect,\n  getDocumentElement,\n  getClippingRect,\n  getOffsetParent,\n  getElementRects,\n  getClientRects,\n  getDimensions,\n  getScale,\n  isElement,\n  isRTL\n};\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n  let io = null;\n  let timeoutId;\n  const root = getDocumentElement(element);\n  function cleanup() {\n    var _io;\n    clearTimeout(timeoutId);\n    (_io = io) == null || _io.disconnect();\n    io = null;\n  }\n  function refresh(skip, threshold) {\n    if (skip === void 0) {\n      skip = false;\n    }\n    if (threshold === void 0) {\n      threshold = 1;\n    }\n    cleanup();\n    const {\n      left,\n      top,\n      width,\n      height\n    } = element.getBoundingClientRect();\n    if (!skip) {\n      onMove();\n    }\n    if (!width || !height) {\n      return;\n    }\n    const insetTop = floor(top);\n    const insetRight = floor(root.clientWidth - (left + width));\n    const insetBottom = floor(root.clientHeight - (top + height));\n    const insetLeft = floor(left);\n    const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n    const options = {\n      rootMargin,\n      threshold: max(0, min(1, threshold)) || 1\n    };\n    let isFirstUpdate = true;\n    function handleObserve(entries) {\n      const ratio = entries[0].intersectionRatio;\n      if (ratio !== threshold) {\n        if (!isFirstUpdate) {\n          return refresh();\n        }\n        if (!ratio) {\n          // If the reference is clipped, the ratio is 0. Throttle the refresh\n          // to prevent an infinite loop of updates.\n          timeoutId = setTimeout(() => {\n            refresh(false, 1e-7);\n          }, 1000);\n        } else {\n          refresh(false, ratio);\n        }\n      }\n      isFirstUpdate = false;\n    }\n\n    // Older browsers don't support a `document` as the root and will throw an\n    // error.\n    try {\n      io = new IntersectionObserver(handleObserve, {\n        ...options,\n        // Handle <iframe>s\n        root: root.ownerDocument\n      });\n    } catch (e) {\n      io = new IntersectionObserver(handleObserve, options);\n    }\n    io.observe(element);\n  }\n  refresh(true);\n  return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n  if (options === void 0) {\n    options = {};\n  }\n  const {\n    ancestorScroll = true,\n    ancestorResize = true,\n    elementResize = typeof ResizeObserver === 'function',\n    layoutShift = typeof IntersectionObserver === 'function',\n    animationFrame = false\n  } = options;\n  const referenceEl = unwrapElement(reference);\n  const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n  ancestors.forEach(ancestor => {\n    ancestorScroll && ancestor.addEventListener('scroll', update, {\n      passive: true\n    });\n    ancestorResize && ancestor.addEventListener('resize', update);\n  });\n  const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n  let reobserveFrame = -1;\n  let resizeObserver = null;\n  if (elementResize) {\n    resizeObserver = new ResizeObserver(_ref => {\n      let [firstEntry] = _ref;\n      if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n        // Prevent update loops when using the `size` middleware.\n        // https://github.com/floating-ui/floating-ui/issues/1740\n        resizeObserver.unobserve(floating);\n        cancelAnimationFrame(reobserveFrame);\n        reobserveFrame = requestAnimationFrame(() => {\n          var _resizeObserver;\n          (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n        });\n      }\n      update();\n    });\n    if (referenceEl && !animationFrame) {\n      resizeObserver.observe(referenceEl);\n    }\n    resizeObserver.observe(floating);\n  }\n  let frameId;\n  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n  if (animationFrame) {\n    frameLoop();\n  }\n  function frameLoop() {\n    const nextRefRect = getBoundingClientRect(reference);\n    if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {\n      update();\n    }\n    prevRefRect = nextRefRect;\n    frameId = requestAnimationFrame(frameLoop);\n  }\n  update();\n  return () => {\n    var _resizeObserver2;\n    ancestors.forEach(ancestor => {\n      ancestorScroll && ancestor.removeEventListener('scroll', update);\n      ancestorResize && ancestor.removeEventListener('resize', update);\n    });\n    cleanupIo == null || cleanupIo();\n    (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n    resizeObserver = null;\n    if (animationFrame) {\n      cancelAnimationFrame(frameId);\n    }\n  };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n  // This caches the expensive `getClippingElementAncestors` function so that\n  // multiple lifecycle resets re-use the same result. It only lives for a\n  // single call. If other functions become expensive, we can add them as well.\n  const cache = new Map();\n  const mergedOptions = {\n    platform,\n    ...options\n  };\n  const platformWithCache = {\n    ...mergedOptions.platform,\n    _c: cache\n  };\n  return computePosition$1(reference, floating, {\n    ...mergedOptions,\n    platform: platformWithCache\n  });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import {\n  autoPlacement,\n  computePosition,\n  detectOverflow,\n  offset,\n  arrow\n} from \"@floating-ui/dom\"\n\nexport async function positionPopover(target, card, options) {\n  let { placement: placements, offset: offsetValue } = options\n  const placement = placements[0]\n  const arrowElement = card.querySelector('[data-popover-arrow]')\n  const middleware = [AutoPositioningWithFallbacks(placements)]\n\n  if (arrowElement) {\n    const arrowSize = arrowElement.clientWidth\n    offsetValue += arrowSize\n    middleware.push(arrow({ element: arrowElement }))\n  }\n\n  middleware.push(offset(offsetValue))\n\n  const computedPosition = await computePosition(\n    target, card, { placement, middleware }\n  )\n  const { x, y, placement: actualPlacement} = computedPosition\n\n  if (arrowElement) {\n    positionArrow(arrowElement, computedPosition)\n  }\n\n  card.dataset.placement = actualPlacement\n  Object.assign(card.style, { left: `${x}px`, top: `${y}px` })\n}\n\nconst AutoPositioningWithFallbacks = (placements) => {\n  let placementIndex = 0\n  return {\n    name: 'autoPlacement',\n    async fn(state) {\n      if (state.placement === 'auto') {\n        return autoPlacement().fn(state)\n      }\n\n      const { top, bottom, left, right } = await detectOverflow(state)\n      const isOverflowing = (top > 0 || bottom > 0 || left > 0 || right > 0)\n\n      if (placements[placementIndex] !== 'auto' && isOverflowing) {\n        placementIndex++\n        return { reset: { placement: placements[placementIndex] || 'auto' } }\n      } else if (isOverflowing) {\n        return autoPlacement().fn(state)\n      }\n      return {}\n    }\n  }\n}\n\nconst OPPOSITE_SIDES = { right: 'left', left: 'right', top: 'bottom', bottom: 'top' }\n\nfunction positionArrow(arrowElement, computedData) {\n  const arrowSize = arrowElement.clientWidth\n  const { placement, middlewareData: { arrow: arrowData } } = computedData\n  const side = placement.split(\"-\")[0]\n  const oppositeSide = OPPOSITE_SIDES[side]\n  const { x, y } = arrowData\n  const { borderWidth: parentBorderWidht } = getComputedStyle(arrowElement.parentElement)\n\n  Object.assign(arrowElement.style, {\n    left: x != null ? `${x}px` : '',\n    top: y != null ? `${y}px` : '',\n    [oppositeSide]: `calc(${-arrowSize}px + ${parentBorderWidht})`\n  })\n}\n","export async function enter(element, transitionName = null) {\n    element.classList.remove('hidden')\n    await transition('enter', element, transitionName)\n}\n\nexport async function leave(element, transitionName = null) {\n    await transition('leave', element, transitionName)\n    element.classList.add('hidden')\n}\n\nexport async function toggle(element, transitionName = null) {\n    if (element.classList.contains('hidden')) {\n        await enter(element, transitionName)\n    } else {\n        await leave(element, transitionName)\n    }\n}\n\nasync function transition(direction, element, animation) {\n    const dataset = element.dataset\n    const animationClass = animation ? `${animation}-${direction}` : direction\n    let transition = `transition${direction.charAt(0).toUpperCase() + direction.slice(1)}`\n    const genesis = dataset[transition] ? dataset[transition].split(\" \") : [animationClass]\n    const start = dataset[`${transition}Start`] ? dataset[`${transition}Start`].split(\" \") : [`${animationClass}-start`]\n    const end = dataset[`${transition}End`] ? dataset[`${transition}End`].split(\" \") : [`${animationClass}-end`]\n\n    addClasses(element, genesis)\n    addClasses(element, start)\n    await nextFrame()\n    removeClasses(element, start)\n    addClasses(element, end);\n    await afterTransition(element)\n    removeClasses(element, end)\n    removeClasses(element, genesis)\n}\n\nfunction addClasses(element, classes) {\n    element.classList.add(...classes)\n}\n\nfunction removeClasses(element, classes) {\n    element.classList.remove(...classes)\n}\n\nfunction nextFrame() {\n    return new Promise(resolve => {\n        requestAnimationFrame(() => {\n            requestAnimationFrame(resolve)\n        });\n    });\n}\n\nfunction afterTransition(element) {\n    return new Promise(resolve => {\n        // safari return string with comma separate values\n        const computedDuration = getComputedStyle(element).transitionDuration.split(\",\")[0]\n        const duration = Number(computedDuration.replace('s', '')) * 1000;\n        setTimeout(() => {\n            resolve()\n        }, duration)\n    });\n}","export const CURRENT_POPOVERS_BY_ID = new Map()\n\nexport function currentPopoversById() {\n  return CURRENT_POPOVERS_BY_ID\n}\n\nexport function addToCurrents(coupdoeilElement) {\n  CURRENT_POPOVERS_BY_ID.set(coupdoeilElement.uniqueId, coupdoeilElement)\n}\n\nexport function removeFromCurrents(coupdoeilElement) {\n  CURRENT_POPOVERS_BY_ID.delete(coupdoeilElement.uniqueId)\n}\n","import {triggeredOnHover, triggeredOnClick} from \"./attributes\"\nimport {CLOSING_DELAY_MS} from \"./config\"\nimport {leave} from \"el-transition\"\nimport {addToCurrents, CURRENT_POPOVERS_BY_ID, removeFromCurrents} from \"./current\"\n\nfunction detachFromParent(controller) {\n  if (controller.parent) {\n    controller.parent.children.delete(controller)\n    controller.parent = null\n  }\n}\n\nexport function cancelOpenCloseActions(controller) {\n  cancelOpening(controller)\n  cancelClosingRequest(controller)\n}\n\nfunction cancelOpening(controller) {\n  delete controller.coupdoeilElement.openingPopover\n}\n\nexport function cancelClosingRequest(controller) {\n  if (controller.closingRequest) {\n    clearTimeout(controller.closingRequest)\n    controller.closingRequest = null\n  }\n}\n\nexport function closeNow(controller, allowAnimation = true) {\n  if (controller.closing || (controller.isClosed && !controller.coupdoeilElement.openingPopover)) return\n\n  cancelClosingRequest(controller)\n  controller.closing = true\n\n  cancelOpenCloseActions(controller)\n\n  controller.children.forEach((childController) => {\n    closeNow(childController)\n  })\n\n  detachFromParent(controller)\n\n  if (allowAnimation && controller.card && controller.card.dataset.animation) {\n    closeWithAnimation(controller).then(() => {\n      removeFromCurrents(controller.coupdoeilElement)\n    })\n  } else {\n    closeWithoutAnimation(controller)\n    removeFromCurrents(controller.coupdoeilElement)\n  }\n}\n\nasync function closeWithAnimation(controller) {\n  await leave(controller.card, 'popover')\n\n  closeWithoutAnimation(controller)\n}\n\nfunction closeWithoutAnimation(controller) {\n  if (controller.card) {\n    controller.card.remove()\n    controller.card = null\n  }\n  delete controller.closing\n  delete controller.coupdoeilElement.dataset.popoverOpen\n}\n\nexport function clear(controller) {\n  closeNow(controller, false)\n}\n\nexport function closeLater(controller) {\n  cancelOpenCloseActions(controller)\n  controller.closingRequest = setTimeout(() => {\n    closeNow(controller)\n  }, CLOSING_DELAY_MS)\n}\n\nexport function closeChildrenNow(controller) {\n  controller.children.forEach((childController) => {\n    closeNow(childController)\n  })\n}\n\nexport function closeChildrenLater(controller) {\n  controller.children.forEach((childController) => {\n    closeLater(childController)\n  })\n}\n\n\nexport function closeOnHoverChildrenLater(controller) {\n  controller.children.forEach((childController) => {\n    if (triggeredOnHover(childController)) {\n      closeLater(childController)\n    }\n  })\n}\n\nexport function closeOnHoverNotParentsLater(controller) {\n  let topMostParent = controller\n  while (topMostParent.parent) {\n    topMostParent = topMostParent.parent\n  }\n  for (const coupdoeilElement of CURRENT_POPOVERS_BY_ID.values()) {\n    if (\n      // SKIP If:\n      // popover has a parent (Closing topmost parent will close children)\n      coupdoeilElement.popoverController.parent !== null ||\n      // popover is topmost parent of currently hovered popover (the one whose controller was passed as an argument)\n      coupdoeilElement.uniqueId === topMostParent.coupdoeilElement.uniqueId ||\n      // popover is triggered on click\n      triggeredOnClick(coupdoeilElement.popoverController)\n    ) {\n      continue\n    }\n      closeLater(coupdoeilElement.popoverController)\n  }\n}\n\nexport function closeAllNow() {\n  for (const coupdoeilElement of CURRENT_POPOVERS_BY_ID.values()) {\n    closeNow(coupdoeilElement.popoverController)\n  }\n}\n\nexport function clearAll() {\n  for (const coupdoeilElement of CURRENT_POPOVERS_BY_ID.values()) {\n    clear(coupdoeilElement.popoverController)\n  }\n}\n\nexport function closeTriggeredOnHoverNow() {\n  for (const coupdoeilElement of CURRENT_POPOVERS_BY_ID.values()) {\n    if (triggeredOnHover(coupdoeilElement.popoverController)) {\n      closeNow(coupdoeilElement.popoverController)\n    }\n  }\n}\n\nexport function closeTriggeredOnHoverLater() {\n  for (const coupdoeilElement of CURRENT_POPOVERS_BY_ID.values()) {\n    if (triggeredOnHover(coupdoeilElement.popoverController)) {\n      closeLater(coupdoeilElement.popoverController)\n    }\n  }\n}\n\nexport function closeTriggeredOnHoverNowUnlessAncestor(controller) {\n  let topMostParent = controller\n  while (topMostParent.parent) {\n    topMostParent = topMostParent.parent\n  }\n  const idToSkip = topMostParent.coupdoeilElement.uniqueId\n\n  for (const coupdoeilElement of CURRENT_POPOVERS_BY_ID.values()) {\n    if (coupdoeilElement.uniqueId !== idToSkip && triggeredOnHover(coupdoeilElement.popoverController)) {\n      closeNow(coupdoeilElement.popoverController)\n    }\n  }\n}\n","import {getParams, getType} from \"./attributes\";\nimport {clear as clearPopover} from \"./closing\";\nimport {currentPopoversById} from \"./current\";\nimport {POPOVER_CLOSE_BTN_SELECTOR} from \"./config\";\n\nexport function fetchPopoverContent(controller, lazy = false) {\n  const type = getType(controller)\n  const params = getParams(controller)\n  const authenticityToken = document.querySelector('meta[name=csrf-token]')?.content\n  let url = `/coupdoeil/popover`\n  const opts = {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json'\n    },\n    body: JSON.stringify({params, action_name: type, authenticity_token: authenticityToken, lazy})\n  }\n  return fetch(url, opts)\n    .then((response) => {\n      if (response.status >= 400) {\n        throw 'error while fetching popover content'\n      }\n      return response.text()\n    })\n}\n\nexport function executeOnNextFrameIfStillOpening(controller, callback) {\n  requestAnimationFrame(() => {\n    const openOrOpening = controller.isOpen || controller.coupdoeilElement.openingPopover;\n\n    if (controller.card && openOrOpening && !controller.closingRequest) {\n      callback.call()\n    } else {\n      clearPopover(controller)\n    }\n  })\n}\n\nexport function isElementClosePopoverButton(element) {\n  return element.closest(POPOVER_CLOSE_BTN_SELECTOR) ||\n    element.dataset.hasOwnProperty(\"popoverClose\")\n}\n\nexport function isAnyPopoverOpened() {\n  return currentPopoversById().size > 0\n}\n","import {FETCH_DELAY_MS, OPENING_DELAY_MS, POPOVER_CLASS_NAME} from \"./config\"\nimport {preloadedContentElement, triggeredOnClick} from \"./attributes\"\nimport {getPopoverContentHTML, setPopoverContentHTML} from \"./cache\"\nimport {extractOptionsFromElement} from \"./options_parser\"\nimport {positionPopover} from \"./positioning\"\nimport {enter} from \"el-transition\"\nimport {addToCurrents} from \"./current\"\nimport {cancelClosingRequest, clear as clearPopover} from \"./closing\"\nimport {lazyLoadPopoverContent} from \"./lazy_loading\";\nimport {executeOnNextFrameIfStillOpening, fetchPopoverContent} from \"./utils\";\n\nasync function loadPopoverContentHTML(controller, options, delayOptions) {\n  return new Promise((resolve) => {\n    setTimeout(async () => {\n      // If opening has been canceled then this function aborts. Note that if lazy loading is enable it will still\n      // finish to load the HTML to the content cache.\n      if (!controller.coupdoeilElement.openingPopover) return resolve()\n      // If the cache option is set to true and the content has already been fetched then this function aborts.\n      if (getPopoverContentHTML(controller) && options.cache) return resolve()\n\n      let html\n      if (options.loading === \"preload\") {\n        // If loading option is set to 'preload', the preloaded content is present in DOM,\n        // nested in the coup-doeil element, in a template tag\n        html = preloadedContentElement(controller).innerHTML\n      } else if (options.loading === \"lazy\") {\n        // If loading option is set to 'lazy', the HTML is loaded first with the 'lazy' param set to true,\n        // to require the temporary/loader content of the popover.\n        // At the same time, a second call is triggered with 'lazyLoadPopoverContent' to fetch the actual popover\n        // content and update it when received.\n        html = await fetchPopoverContent(controller, options.loading === \"lazy\")\n\n        lazyLoadPopoverContent(controller, options)\n      } else if (options.loading === \"async\") {\n        html = await fetchPopoverContent(controller)\n      }\n      // Once the HTML has been retrieved by any of the loading mode, the content cache is updated.\n      setPopoverContentHTML(controller, html)\n      resolve()\n    }, delayOptions.fetch)\n  })\n}\n\nexport async function openPopover(controller, { parent, beforeDisplay }) {\n  if (controller.isOpen) {\n    return cancelClosingRequest(controller)\n  }\n  if (parent) {\n    controller.parent = parent\n    parent.children.add(controller)\n  }\n\n  const options = extractOptionsFromElement(controller.coupdoeilElement)\n  const delays = getDelayOptionsForController(controller, options)\n\n  const openingDelay = new Promise(resolve => setTimeout(resolve, delays.opening))\n  const fetchDelay = loadPopoverContentHTML(controller, options, delays)\n  await Promise.all([fetchDelay, openingDelay])\n\n  const parentIsClosedOrClosing = controller.parent && (controller.parent.isClosed || controller.parent.closingRequest)\n\n  // but if opening has been canceled (nullified), the wait still happens, so we need to check again\n  if (controller.coupdoeilElement.openingPopover && !parentIsClosedOrClosing) {\n    await display(controller, options, beforeDisplay)\n  }\n}\n\nasync function display(controller, options, beforeDisplay) {\n  if (controller.isOpen) return;\n\n  cancelClosingRequest(controller)\n\n  if (controller.card) {\n    controller.card.remove()\n  }\n  controller.card = buildPopoverElement(controller, options)\n  document.body.appendChild(controller.card)\n\n  if (options.animation) {\n    controller.card.dataset.animation = options.animation\n  }\n\n  executeOnNextFrameIfStillOpening(controller, async () => {\n    await positionPopover(controller.coupdoeilElement, controller.card, options)\n    // popover can be closed while waiting for positioning promise to resolve\n    if (controller.card === null) {\n      return clearPopover(controller)\n    }\n\n    // see buildPopoverElement() about next 2 lines\n    controller.card.classList.add('hidden')\n    controller.card.style.removeProperty('visibility')\n\n    executeOnNextFrameIfStillOpening(controller, async () => {\n      if (beforeDisplay) {\n        beforeDisplay(controller)\n      }\n      // // adding again the card to make sure it is in the map, could be better\n      addToCurrents(controller.coupdoeilElement)\n      delete controller.coupdoeilElement.openingPopover\n      controller.coupdoeilElement.dataset.popoverOpen = true\n\n      await enter(controller.card, 'popover')\n    })\n  })\n}\n\nfunction getDelayOptionsForController(controller, options) {\n  if (options.openingDelay === false || triggeredOnClick(controller)) {\n    return { fetch: 0, opening: 0 }\n  }\n\n  return { fetch: FETCH_DELAY_MS, opening: OPENING_DELAY_MS }\n}\n\nfunction buildPopoverElement(controller, options) {\n  const el = document.createElement('div')\n  el.setAttribute('role', 'dialog')\n  el.classList.add(POPOVER_CLASS_NAME)\n  el.style.cssText = 'position: absolute; left: 0; top: 0;'\n  el.innerHTML = getPopoverContentHTML(controller)\n  el.popoverController = controller\n  el.coupdoeilElement = controller.coupdoeilElement\n  el.close = function() { this.coupdoeilElement.closePopover() }\n  el.dataset.placement = options.placement\n\n  // Initial style is not .hidden (no display: none;) and visibility: 'hidden'; so the card is inserted\n  // in DOM the without being visible.\n  // This allows the browser to compute its actual size so the positioning is computed correctly.\n  el.style.visibility = 'hidden'\n\n  return el\n}\n","import {getPopoverContentHTML, setPopoverContentHTML} from \"./cache\";\nimport {positionPopover} from \"./positioning\";\nimport {executeOnNextFrameIfStillOpening, fetchPopoverContent} from \"./utils\";\n\nconst MINIMUM_LAZY_DELAY = 600;\n\nexport function lazyLoadPopoverContent(controller, options) {\n  controller.coupdoeilElement.dataset.lazyLoading = \"true\"\n\n  // This delay ensures that popover won't blink if the actual content is quickly fetched.\n  // It also allows a consistent feeling for users across all lazy loaded popovers.\n  const lazyDelay = new Promise(resolve => setTimeout(resolve, MINIMUM_LAZY_DELAY))\n\n  fetchPopoverContent(controller).then(async (html) => {\n    // Wait for the delay if it is not resolved yet.\n    await lazyDelay\n\n    // Update popover content cache with the actual content,\n    // but doesn't update yet the rendered popover.\n    setPopoverContentHTML(controller, html)\n    delete controller.coupdoeilElement.dataset.lazyLoading\n\n    if (controller.card && !controller.closingRequest) {\n      // If popover has not been close are in the process of being closed,\n      // update its content with the newly fetch HTML.\n      controller.card.innerHTML = getPopoverContentHTML(controller)\n\n      // Since new content may change the rendered size of the popover,\n      // it must be positioned again. It is done one next frame so the browser has at least computed\n      // the new dimensions of the popover.\n      executeOnNextFrameIfStillOpening(controller, () => {\n        positionPopover(controller.coupdoeilElement, controller.card, options)\n      })\n    }\n  })\n}\n","import {PopoverController} from '../popover/controller'\nimport {openPopover} from '../popover/opening'\nimport {POPOVER_SELECTOR} from \"../popover/config\";\nimport {closeNow} from \"../popover/closing\";\nimport {addToCurrents} from \"../popover/current\";\n\nfunction generateUniqueId() {\n  const array = new Uint32Array(1)\n  window.crypto.getRandomValues(array)\n  return array[0]\n}\n\nexport default class extends HTMLElement {\n  constructor() {\n    super()\n    this.uniqueId = generateUniqueId()\n    this.popoverController = new PopoverController(this)\n  }\n\n  openPopover(triggerElement = null, callbacks) {\n    if (this.openingPopover || this.popoverController.isOpen || this.disabled) return;\n\n    this.openingPopover = true\n\n    const parent = this.closest(POPOVER_SELECTOR)?.popoverController\n    return openPopover(this.popoverController, { parent, ...callbacks })\n  }\n\n  closePopover() {\n    closeNow(this.popoverController)\n  }\n\n  get disabled() {\n    return !!this.getAttribute(\"disabled\")\n  }\n\n  set disabled(disabled) {\n    if (disabled) {\n      this.setAttribute(\"disabled\", true)\n    } else {\n      this.removeAttribute(\"disabled\")\n    }\n  }\n}\n\nexport function upgradeNativeElement(element) {\n  if (element && element.tagName !== 'COUP-DOEIL' && !element.customCoupdoeilElement) {\n    element.customCoupdoeilElement = true\n    element.uniqueId = generateUniqueId()\n    element.popoverController = new PopoverController(element)\n    element.openPopover = function(triggerElement = null, callbacks) {\n      if (this.openingPopover || this.popoverController.isOpen || this.disabled) return;\n\n      this.openingPopover = true\n\n      const parent = this.closest(POPOVER_SELECTOR)?.popoverController\n      addToCurrents(this)\n      return openPopover(this.popoverController, { parent, ...callbacks })\n    }\n    element.closePopover = function() {\n      closeNow(this.popoverController)\n    }\n  }\n}\n\nexport function downgradeNativeElement(element, {force = false} = {}) {\n  if (element.customCoupdoeilElement || force) {\n    delete element.closePopover\n    delete element.openPopover\n    delete element.popoverController\n    delete element.uniqueId\n    delete element.customCoupdoeilElement\n\n    delete element.dataset.popoverOptions\n    delete element.dataset.popoverParams\n    delete element.dataset.popoverType\n    delete element.dataset.popoverAnimation\n    delete element.dataset.popoverCache\n    delete element.dataset.popoverLoading\n    delete element.dataset.popoverOffset\n    delete element.dataset.popoverOpeningDelay\n    delete element.dataset.popoverPlacement\n    delete element.dataset.popoverTrigger\n  }\n}\n","import {POPOVER_SELECTOR} from \"../popover/config\";\nimport {noTriggeredOnClick} from \"../popover/attributes\";\nimport {closeAllNow, closeChildrenNow, closeNow} from \"../popover/closing\";\nimport {isElementClosePopoverButton} from \"../popover/utils\";\nimport {upgradeNativeElement} from \"../elements/coupdoeil_element\";\n\nexport const coupdoeilOnClickEvent = ({ target: clickedElement }) => {\n  const coupdoeilElement = clickedElement.closest('coup-doeil, [data-popover-options]')\n  upgradeNativeElement(coupdoeilElement)\n  const popoverElement = clickedElement.closest(POPOVER_SELECTOR)\n\n  if (coupdoeilElement && popoverElement) {\n    handleClickedCoupdoeilWithinPopover(coupdoeilElement, popoverElement, clickedElement)\n  }\n  else if (coupdoeilElement) {\n    handleClickedCoupdoeilOutsidePopover(coupdoeilElement, clickedElement)\n  }\n  else if (popoverElement) {\n    handleClickOutsideCoupdoeilButWithinPopover(popoverElement, clickedElement)\n  }\n  else {\n    handleClickOutsideCoupdoeilAndPopover()\n  }\n}\n\nfunction handleClickedCoupdoeilWithinPopover(coupdoeilElement, _popoverElement, clickedElement) {\n  const popover = coupdoeilElement.popoverController\n  if(noTriggeredOnClick(popover))\n    return;\n\n  if (popover.isOpen) {\n    // second click on an open popover trigger closes it\n    closeNow(popover)\n  } else {\n    // first click on a closed popover trigger opens it\n    // If any other popover is open, it is the parent popover, hence it should not be closed.\n    coupdoeilElement.openPopover(clickedElement)\n  }\n}\n\nfunction handleClickedCoupdoeilOutsidePopover(coupdoeilElement, clickedElement) {\n  const popover = coupdoeilElement.popoverController\n  if(noTriggeredOnClick(popover))\n    return;\n\n  if (popover.isOpen) {\n    // second click on an open popover trigger closes it\n    closeNow(popover)\n  } else {\n    // close any other open popover\n    closeAllNow()\n    // first click on a closed popover trigger opens it\n    coupdoeilElement.openPopover(clickedElement)\n  }\n}\n\nfunction handleClickOutsideCoupdoeilButWithinPopover(popoverElement, clickedElement) {\n  const popover = popoverElement.popoverController;\n\n  if (isElementClosePopoverButton(clickedElement)) {\n    requestAnimationFrame(() => closeNow(popover))\n  } else if (popover.children.size > 0) {\n    closeChildrenNow(popover)\n  }\n}\n\nfunction handleClickOutsideCoupdoeilAndPopover() {\n  closeAllNow()\n}\n","import {POPOVER_SELECTOR} from \"../popover/config\";\nimport {notTriggeredOnHover} from \"../popover/attributes\";\nimport {\n  cancelClosingRequest,\n  closeChildrenNow,\n  closeOnHoverChildrenLater,\n  closeOnHoverNotParentsLater,\n  closeTriggeredOnHoverLater,\n  closeTriggeredOnHoverNowUnlessAncestor\n} from \"../popover/closing\";\nimport {addToCurrents as addToCurrentPopovers} from \"../popover/current\";\nimport {isAnyPopoverOpened} from \"../popover/utils\";\nimport {upgradeNativeElement} from \"../elements/coupdoeil_element\";\n\nexport const onMouseOver = ({ target: hoveredElement }) => {\n  const coupdoeilElement = hoveredElement.closest('coup-doeil, [data-popover-options]')\n  upgradeNativeElement(coupdoeilElement)\n  const popoverElement = hoveredElement.closest(POPOVER_SELECTOR)\n\n  if (coupdoeilElement && popoverElement) {\n    handleMouseOverCoupdoeilWithinPopover(coupdoeilElement, popoverElement, hoveredElement)\n  }\n  else if (coupdoeilElement) {\n    handleMouseOverCoupdoeilOutsidePopover(coupdoeilElement, hoveredElement)\n  }\n  else if (popoverElement) {\n    handleOverOutsideCoupdoeilButWithinPopover(popoverElement)\n  }\n  else {\n    handleOverOutsideCoupdoeilAndPopover()\n  }\n}\n\nfunction handleMouseOverCoupdoeilWithinPopover(coupdoeilElement, popoverElement, hoveredElement) {\n  const childPopover = coupdoeilElement.popoverController\n  const parentPopover = popoverElement.popoverController\n  if(notTriggeredOnHover(childPopover))\n    return;\n\n  if (childPopover.isOpen) {\n    // when the mouse goes back from child popover to its coupdoeil element within parent popover\n    // it means that this child popover was already open\n    closeChildrenNow(childPopover)\n    // it should also prevent closing the child popover\n    cancelClosingRequest(childPopover)\n    addToCurrentPopovers(childPopover.coupdoeilElement)\n  } else {\n    // ensures to close other children popovers before opening the one that current one\n    closeChildrenNow(parentPopover)\n    // should also close any open popover outside of parent\n    coupdoeilElement.openPopover(hoveredElement)\n  }\n}\n\nfunction handleMouseOverCoupdoeilOutsidePopover(coupdoeilElement, hoveredElement) {\n  const popover = coupdoeilElement.popoverController\n  if(notTriggeredOnHover(popover))\n    return;\n\n  if (popover.isClosed) {\n    // Close any other open popover before opening this one\n    coupdoeilElement.openPopover(hoveredElement, { beforeDisplay: closeTriggeredOnHoverNowUnlessAncestor })\n  } else if (popover.closingRequest) {\n    // If popover is still open but was requested to close, then it must clear this closing request\n    // and ensures the popovers stays in current popovers register.\n    cancelClosingRequest(popover)\n    addToCurrentPopovers(popover.coupdoeilElement)\n  }\n}\n\nfunction handleOverOutsideCoupdoeilAndPopover() {\n  // mouse is not within any popover and not over any coupdoeil element\n  // Therefore all popovers that trigger on hover should be closed if any is open.\n  if (isAnyPopoverOpened()) {\n    closeTriggeredOnHoverLater()\n  }\n}\n\nfunction handleOverOutsideCoupdoeilButWithinPopover(popoverElement) {\n  const popover = popoverElement.popoverController\n\n  if (popover.closingRequest) {\n    // If popover is still open but was requested to close, then it must clear this closing request\n    // and ensures the popovers stays in current popovers register.\n    // This typically happens when the mouse was on coupdoeil element and moved toward the popover.\n    // But because of a small gap, it triggered the closing request. When the mouse finally enters the popover\n    // the closing request must be aborted. Since it typically happens in a child popover, it means it should also\n    // prevent all parents of this popover to close.\n    let topMostParent = popover\n    while (topMostParent) {\n      cancelClosingRequest(topMostParent)\n      addToCurrentPopovers(topMostParent.coupdoeilElement)\n      topMostParent = topMostParent.parent\n    }\n  } else if (popover.children.size > 0) {\n    // Happens when a child popover was open but mouse moved outside of it or its coupdoeil element,\n    // but stays within the parent popover\n    closeOnHoverChildrenLater(popover)\n  }\n  // Closes all other on hover popovers that are not parents of the current popover nor children.\n  closeOnHoverNotParentsLater(popover)\n}\n","import {coupdoeilOnClickEvent} from \"./events/onclick\";\nimport {onMouseOver} from \"./events/onmouseover\";\n\nimport {clearPopoverContentCache} from \"./popover/cache\";\nimport {clearAll} from \"./popover/closing\";\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n  clearPopoverContentCache()\n  document.addEventListener(\"click\", coupdoeilOnClickEvent)\n  document.documentElement.addEventListener(\"mouseover\", onMouseOver, { passive: true })\n\n  if (window.Turbo) {\n    document.addEventListener('turbo:before-cache', (_event) => {\n      clearAll()\n    })\n    document.addEventListener('turbo:load', (_event) => {\n      clearAll()\n      clearPopoverContentCache()\n    })\n  }\n})\n","import CoupdoeilElement from \"./elements/coupdoeil_element\"\nimport { upgradeNativeElement as internalUpgradeNativeElement, downgradeNativeElement } from \"./elements/coupdoeil_element\"\nimport './events'\n\nif (customElements.get(\"coup-doeil\") === undefined) {\n  customElements.define(\"coup-doeil\", CoupdoeilElement)\n}\n\nwindow.Coupdoeil = {\n  upgradeNativeElement(element) {\n    if (!element.dataset.popoverOptions) {\n      throw 'element is missing Coupdoeil popover dataset'\n    }\n    internalUpgradeNativeElement(element)\n  },\n  downgradeNativeElement\n}\n"],"names":["PopoverController","constructor","coupdoeilElement","this","card","children","Set","parent","closingRequest","isOpen","dataset","popoverOpen","isClosed","POPOVER_CLASS_NAME","POPOVER_SELECTOR","OPTIONS","animation","getter","optionsInt","ANIMATIONS","cache","loading","LOADINGS","offset","offsetBits","Number","BigInt","value","test","parseFloat","getComputedStyle","document","documentElement","fontSize","parseCSSSize","openingDelay","placement","placementBits","shift","lastPlacement","placements","PLACEMENTS","push","trigger","TRIGGERS","ORDERED_OPTIONS","popoverOptions","undefined","parseOptionsInt","controller","optionsString","getOptions","parseInt","getType","popoverType","getParams","popoverParams","getTrigger","optionName","popoverController","extractOptionFromElement","triggeredOnClick","noTriggeredOnClick","triggeredOnHover","notTriggeredOnHover","preloadedContentElement","querySelector","popoverContentHTMLMap","Map","cacheMapKey","uniqueId","getPopoverContentHTML","get","setPopoverContentHTML","set","clearPopoverContentCache","clear","sides","alignments","reduce","acc","side","concat","min","Math","max","round","createCoords","v","x","y","oppositeSideMap","left","right","bottom","top","oppositeAlignmentMap","start","end","clamp","evaluate","param","getSide","split","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","includes","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","length","mainAlignmentSide","reference","floating","getOppositePlacement","getOppositeAlignmentPlacement","replace","getPaddingObject","padding","expandPaddingObject","rectToClientRect","rect","width","height","computeCoordsFromPlacement","_ref","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","async","detectOverflow","state","options","_await$platform$isEle","platform","elements","strategy","boundary","rootBoundary","elementContext","altBoundary","paddingObject","element","clippingClientRect","getClippingRect","isElement","contextElement","getDocumentElement","offsetParent","getOffsetParent","offsetScale","getScale","elementClientRect","convertOffsetParentRelativeRectToViewportRelativeRect","hasWindow","window","getNodeName","node","isNode","nodeName","toLowerCase","getWindow","_node$ownerDocument","ownerDocument","defaultView","Node","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","isOverflowElement","overflow","overflowX","overflowY","display","isTableElement","isTopLayer","some","selector","matches","e","isContainingBlock","elementOrCss","webkit","isWebKit","css","transform","perspective","containerType","backdropFilter","filter","willChange","contain","CSS","supports","isLastTraversableNode","getNodeScroll","scrollLeft","scrollTop","scrollX","scrollY","getParentNode","result","assignedSlot","parentNode","host","getNearestOverflowAncestor","body","getOverflowAncestors","list","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","frameElement","getFrameElement","visualViewport","Object","getPrototypeOf","getCssDimensions","hasOffset","offsetWidth","offsetHeight","shouldFallback","$","unwrapElement","domElement","getBoundingClientRect","isFinite","noOffsets","getVisualOffsets","offsetLeft","offsetTop","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","isFixed","floatingOffsetParent","shouldAddVisualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","clientLeft","paddingLeft","clientTop","paddingTop","getWindowScrollBarX","leftScroll","getHTMLOffset","scroll","ignoreScrollbarX","htmlRect","getClientRectFromClippingAncestor","clippingAncestor","html","clientWidth","clientHeight","visualViewportBased","getViewportRect","scrollWidth","scrollHeight","direction","getDocumentRect","getInnerBoundingClientRect","hasFixedPositionAncestor","stopNode","position","getRectRelativeToOffsetParent","isOffsetParentAnElement","offsets","offsetRect","htmlOffset","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","svgOffsetParent","currentNode","getContainingBlock","topLayer","clippingAncestors","cachedResult","el","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","ancestor","getClippingElementAncestors","_c","firstClippingAncestor","clippingRect","accRect","getElementRects","data","getOffsetParentFn","getDimensionsFn","getDimensions","floatingDimensions","getClientRects","Array","from","isRTL","detectOverflow$1","name","fn","_middlewareData$offse","_middlewareData$arrow","middlewareData","diffCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","convertValueToCoords","arrow","alignmentOffset","autoPlacement","_middlewareData$autoP","_middlewareData$autoP2","_placementsThatFitOnE","allowedPlacements","autoAlignment","detectOverflowOptions","placements$1","getPlacementList","currentIndex","index","currentPlacement","alignmentSides","reset","currentOverflows","allOverflows","overflows","nextPlacement","placementsSortedByMostSpace","map","d","slice","sort","a","b","resetPlacement","every","arrowDimensions","isYAxis","minProp","maxProp","clientProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","min$1","center","shouldAddOffset","centerOffset","computePosition","mergedOptions","platformWithCache","config","middleware","validMiddleware","Boolean","statefulPlacement","resetCount","i","nextX","nextY","initialPlacement","computePosition$1","positionPopover","target","offsetValue","arrowElement","AutoPositioningWithFallbacks","computedPosition","actualPlacement","computedData","arrowSize","arrowData","oppositeSide","OPPOSITE_SIDES","borderWidth","parentBorderWidht","parentElement","assign","style","positionArrow","placementIndex","isOverflowing","transition","animationClass","charAt","toUpperCase","genesis","addClasses","Promise","resolve","requestAnimationFrame","removeClasses","computedDuration","transitionDuration","duration","setTimeout","afterTransition","classes","classList","add","remove","CURRENT_POPOVERS_BY_ID","addToCurrents","removeFromCurrents","delete","cancelOpenCloseActions","openingPopover","cancelOpening","cancelClosingRequest","clearTimeout","closeNow","allowAnimation","closing","forEach","childController","detachFromParent","transitionName","leave","closeWithoutAnimation","closeWithAnimation","then","closeLater","closeChildrenNow","closeAllNow","values","clearAll","closeTriggeredOnHoverNowUnlessAncestor","topMostParent","idToSkip","fetchPopoverContent","lazy","type","params","authenticityToken","content","opts","method","headers","JSON","stringify","action_name","authenticity_token","fetch","response","status","text","executeOnNextFrameIfStillOpening","callback","openOrOpening","call","clearPopover","isAnyPopoverOpened","size","loadPopoverContentHTML","delayOptions","innerHTML","lazyLoading","lazyDelay","lazyLoadPopoverContent","openPopover","beforeDisplay","create","option","extractOptionsFromElement","delays","opening","getDelayOptionsForController","fetchDelay","all","parentIsClosedOrClosing","createElement","setAttribute","cssText","close","closePopover","visibility","buildPopoverElement","appendChild","removeProperty","enter","generateUniqueId","array","Uint32Array","crypto","getRandomValues","CoupdoeilElement","super","triggerElement","callbacks","disabled","closest","getAttribute","removeAttribute","upgradeNativeElement","tagName","customCoupdoeilElement","coupdoeilOnClickEvent","clickedElement","popoverElement","_popoverElement","popover","handleClickedCoupdoeilWithinPopover","handleClickedCoupdoeilOutsidePopover","hasOwnProperty","handleClickOutsideCoupdoeilButWithinPopover","onMouseOver","hoveredElement","childPopover","parentPopover","addToCurrentPopovers","handleMouseOverCoupdoeilWithinPopover","handleMouseOverCoupdoeilOutsidePopover","closeOnHoverNotParentsLater","handleOverOutsideCoupdoeilButWithinPopover","closeTriggeredOnHoverLater","addEventListener","passive","Turbo","_event","customElements","define","Coupdoeil","internalUpgradeNativeElement","downgradeNativeElement","force","popoverAnimation","popoverCache","popoverLoading","popoverOffset","popoverOpeningDelay","popoverPlacement","popoverTrigger"],"mappings":"AAAO,MAAMA,EACX,WAAAC,CAAYC,GACVC,KAAKD,iBAAmBA,EAExBC,KAAKC,KAAO,KAEZD,KAAKE,SAAW,IAAIC,IACpBH,KAAKI,OAAS,KAEdJ,KAAKK,eAAiB,IACvB,CAED,UAAIC,GACF,QAASN,KAAKD,iBAAiBQ,QAAQC,WACxC,CAED,YAAIC,GACF,OAAQT,KAAKM,MACd,EClBI,MAAMI,EAAqB,qBACrBC,EAAmB,IAAID,ICCvBE,EAAU,CACrBC,UAAW,CAAEC,OAoFf,SAAsBC,GAEpB,OAAOC,EAAYD,GAAc,EAAK,EACxC,GAtFEE,MAAO,CAAEH,OA4FX,SAAkBC,GAChB,QAA4B,GAApBA,EACV,GA7FEG,QAAS,CAAEJ,OA+Fb,SAAoBC,GAElB,OAAOI,EAAUJ,GAAc,EAAK,EACtC,GAjGEK,OAAQ,CAAEN,OA6CZ,SAAmBC,GAEjB,MAAMM,EAAaC,OAAOC,OAAOR,IAAeQ,OAAO,KACvD,GAAmB,IAAfF,EACF,OAAO,EAQT,OA9BF,SAAsBG,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