{
  "version": 3,
  "sources": ["/cdn/shop/t/113/assets/ada-tabbed-choices.js?theme_ada=20261002-3"],
  "sourcesContent": ["(() => {\n  const choiceSelector = [\n    \"input[type='radio']:not([disabled])\",\n    \"input[type='checkbox']:not([disabled])\",\n    \"[role='radio']:not([aria-disabled='true'])\",\n    \"[role='checkbox']:not([aria-disabled='true'])\"\n  ].join(\",\");\n  const radioSelector = \"input[type='radio']:not([disabled]), [role='radio']:not([aria-disabled='true'])\";\n\n  const roots = new Set();\n\n  const isShown = (element) => element.getClientRects().length > 0;\n\n  // The radios that behave as one group: those in the same fieldset or radiogroup (apps such as Fly Bundles give\n  // the radios of one group different names, so the name alone isn't enough), otherwise those sharing a name.\n  const getRadioGroup = (choice) => {\n    const container = choice.closest(\"fieldset, [role='radiogroup']\");\n    if (container) {\n      const radios = Array.from(container.querySelectorAll(radioSelector)).filter(isShown);\n      if (radios.length > 1) return radios;\n    }\n\n    const root = choice.getRootNode();\n\n    if (choice.matches(\"input[type='radio']\") && choice.name) {\n      return Array.from(root.querySelectorAll(\"input[type='radio']:not([disabled])\")).filter(\n        (radio) => radio.name === choice.name && radio.form === choice.form && isShown(radio)\n      );\n    }\n\n    if (choice.matches(\"[role='radio']\")) {\n      const group = choice.parentElement;\n      return group ? Array.from(group.querySelectorAll(\"[role='radio']:not([aria-disabled='true'])\")).filter(isShown) : [];\n    }\n\n    return [choice];\n  };\n\n  // Fly Bundles' volume tiers select on a click on the tier card, not on the radio, and re-render it, so click the\n  // card and put focus back on the (new) radio.\n  const selectChoice = (choice) => {\n    const tierCard = choice.closest(\".gfbVolumeDiscountRadioLabelWrapper\");\n    if (choice.matches(\".gfbVolumeDiscountWidgetOfferDiscountTierRadio\") && tierCard) {\n      const choiceId = choice.id;\n      tierCard.click();\n      window.setTimeout(() => document.getElementById(choiceId)?.focus(), 50);\n    } else {\n      choice.click();\n    }\n  };\n\n  const isChecked = (radio) => (radio.matches(\"input\") ? radio.checked : radio.getAttribute(\"aria-checked\") === \"true\");\n\n  // One Tab stop per group, on the selected option (or the first one when nothing is selected yet); the arrow\n  // keys move between the options.\n  const updateRovingTabStop = (group) => {\n    const active = group.find(isChecked) || group[0];\n    group.forEach((radio) => {\n      const tabIndex = radio === active ? 0 : -1;\n      if (radio.tabIndex !== tabIndex) radio.tabIndex = tabIndex;\n    });\n  };\n\n  // The listeners sit on the document and on every shadow root, so a key press inside a shadow root reaches them\n  // more than once; act on it only the first time.\n  const handledEvents = new WeakSet();\n\n  const handleChoiceKeys = (event) => {\n    if (handledEvents.has(event)) return;\n    handledEvents.add(event);\n\n    const choice = event.composedPath().find(\n      (element) => element instanceof Element && element.matches(choiceSelector)\n    );\n    if (!choice) return;\n\n    // Standard radio group keys: Up/Left selects the previous option, Down/Right the next one, wrapping around.\n    // Handled here rather than by the browser because some groups mix radio names or use role=\"radio\".\n    if (choice.matches(radioSelector) && [\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\"].includes(event.key)) {\n      const group = getRadioGroup(choice);\n      if (group.length < 2) return;\n\n      event.preventDefault();\n      const step = [\"ArrowLeft\", \"ArrowUp\"].includes(event.key) ? -1 : 1;\n      const nextChoice = group[(group.indexOf(choice) + step + group.length) % group.length];\n      nextChoice.focus();\n      if (!isChecked(nextChoice)) selectChoice(nextChoice);\n      updateRovingTabStop(group);\n      return;\n    }\n\n    if (\n      choice.matches(\".gfbVolumeDiscountWidgetOfferDiscountTierRadio\") &&\n      [\"Enter\", \" \"].includes(event.key) &&\n      !event.repeat\n    ) {\n      event.preventDefault();\n      selectChoice(choice);\n      return;\n    }\n\n    if (event.key === \"Enter\" && !event.repeat) {\n      event.preventDefault();\n      choice.click();\n    }\n  };\n\n  const handleChoiceChange = (event) => {\n    const radio = event.composedPath().find((element) => element instanceof Element && element.matches(radioSelector));\n    if (radio) updateRovingTabStop(getRadioGroup(radio));\n  };\n\n  const enhanceRoot = (root) => {\n    if (!roots.has(root)) {\n      roots.add(root);\n      root.addEventListener(\"keydown\", handleChoiceKeys, true);\n      root.addEventListener(\"change\", handleChoiceChange, true);\n    }\n\n    const grouped = new Set();\n    root.querySelectorAll(choiceSelector).forEach((choice) => {\n      // UpCart add-on switches are focused through their <label> (see ada-accessibility.js), and Junip's\n      // \"Photos & videos\" through its role=\"checkbox\" wrapper (see ada-component-structure.js).\n      if (choice.matches(\".upcart-public-addons__toggle-switch input, .junip-checkbox[role='checkbox'] input\")) return;\n\n      if (choice.matches(radioSelector)) {\n        if (grouped.has(choice)) return;\n        const group = getRadioGroup(choice);\n        group.forEach((radio) => grouped.add(radio));\n        updateRovingTabStop(group);\n      } else if (choice.tabIndex !== 0) {\n        choice.tabIndex = 0;\n      }\n    });\n\n    root.querySelectorAll(\"*\").forEach((element) => {\n      if (element.shadowRoot) {\n        enhanceRoot(element.shadowRoot);\n      }\n    });\n  };\n\n  const enhanceChoices = () => enhanceRoot(document);\n\n  enhanceChoices();\n  new MutationObserver(enhanceChoices).observe(document.documentElement, {\n    childList: true,\n    subtree: true\n  });\n})();\n"],
  "mappings": "CAAC,IAAM,CACL,MAAM,eAAiB,CACrB,sCACA,yCACA,6CACA,+CACF,EAAE,KAAK,GAAG,EACJ,cAAgB,kFAEhB,MAAQ,IAAI,IAEZ,QAAW,SAAY,QAAQ,eAAe,EAAE,OAAS,EAIzD,cAAiB,QAAW,CAChC,MAAM,UAAY,OAAO,QAAQ,+BAA+B,EAChE,GAAI,UAAW,CACb,MAAM,OAAS,MAAM,KAAK,UAAU,iBAAiB,aAAa,CAAC,EAAE,OAAO,OAAO,EACnF,GAAI,OAAO,OAAS,EAAG,OAAO,MAChC,CAEA,MAAM,KAAO,OAAO,YAAY,EAEhC,GAAI,OAAO,QAAQ,qBAAqB,GAAK,OAAO,KAClD,OAAO,MAAM,KAAK,KAAK,iBAAiB,qCAAqC,CAAC,EAAE,OAC7E,OAAU,MAAM,OAAS,OAAO,MAAQ,MAAM,OAAS,OAAO,MAAQ,QAAQ,KAAK,CACtF,EAGF,GAAI,OAAO,QAAQ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