{"version":3,"sources":["webpack://loftware/./src/js/helpers/setupPhoneInput.js","webpack://loftware/./src/js/helpers/checkDropdowns.js","webpack://loftware/./src/js/helpers/addFormLabelsPlaceholder.js","webpack://loftware/./src/js/components/Dropdown.js","webpack://loftware/./src/js/helpers/countryPhoneCodes.js","webpack://loftware/./src/js/modules/ContentDetailGatedForm.js"],"names":[],"mappings":"4HAEA,KAAM,GAAsB,GAAK,CAE/B,KAAM,GAAc,EADL,OAAO,QAAQ,mBACL,cAAc,wBAEvC,GAAI,EAAa,CACf,KAAM,GAAU,EAAE,OAAO,MACzB,EAAY,MAAQ,IAAI,IAAa,KACrC,EAAY,UAIV,EAAkB,GAAM,CAC5B,KAAM,GAAO,EAAG,cAAc,mBAE9B,GAAI,CAAC,EAAM,OAEX,KAAM,GAAgB,EAAK,cAAc,yBAEzC,CAAK,GAEL,EAAc,iBAAiB,SAAU,IAG3C,IAAe,G,qCCvBf,KAAM,GAAiB,GAAQ,CAC7B,GAAI,CAAC,EAAI,OACT,KAAM,GAAY,EAAG,iBAAiB,aAEtC,CAAI,EAAU,QACd,CAAC,GAAG,GAAW,QAAQ,GAAY,CACjC,GAAI,WAAS,MAIjB,IAAe,G,oBCZf,KAAM,GAAc,GAAK,CACvB,KAAM,GAAQ,EAAE,QAAU,EAEpB,EAAQ,EADU,QAAQ,mBACP,cAAc,2BACvC,GACM,GAAM,OAAS,IAAU,SAAS,cACpC,EAAM,UAAU,IAAI,aAEpB,EAAM,UAAU,OAAO,eAKvB,EAA2B,GAAM,CACrC,KAAM,GAAO,EAAG,cAAc,mBAC9B,GAAI,CAAC,EAAM,OACX,KAAM,GAAS,EAAK,iBAAiB,SAC/B,EAAY,EAAK,iBAAiB,YAExC,EADoB,iBAAiB,4BAC7B,QAAQ,GAAS,CACvB,GAAa,EAAM,mBAAmB,QAAQ,gBAAkB,UAC9D,EAAM,UAAU,IAAI,kBAIxB,GAAQ,QAAQ,GAAS,CACvB,EAAM,iBAAiB,QAAS,GAChC,EAAM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odes';\r\n\r\nconst handleCountrySelect = e => {\r\n  const form = e.target.closest('.Form__MainBody');\r\n  const phonePrefix = form.querySelector('.FormPhoneCode__Code');\r\n\r\n  if (phonePrefix) {\r\n    const country = e.target.value;\r\n    phonePrefix.value = `+${countryCodes[country]}`;\r\n    phonePrefix.focus();\r\n  }\r\n};\r\n\r\nconst setupPhoneInput = el => {\r\n  const form = el.querySelector('.Form__MainBody');\r\n\r\n  if (!form) return;\r\n\r\n  const countrySelect = form.querySelector('.Form__Country select');\r\n\r\n  if (!countrySelect) return;\r\n\r\n  countrySelect.addEventListener('change', handleCountrySelect);\r\n};\r\n\r\nexport default setupPhoneInput;\r\n","import Dropdown from \"../components/Dropdown\";\r\n\r\nconst checkDropdowns = (el) => {\r\n  if (!el) return;\r\n  const dropdowns = el.querySelectorAll('.dropdown');\r\n\r\n  if(!dropdowns.length) return;\r\n  [...dropdowns].forEach(dropdown => {\r\n    new Dropdown(dropdown);\r\n  });\r\n}\r\n\r\nexport default checkDropdowns;\r\n","const updateLabel = e => {\r\n  const input = e.target || e;\r\n  const fieldWrap = input.closest('.Form__Element');\r\n  const label = fieldWrap?.querySelector('.Form__Element__Caption');\r\n  if (label) {\r\n    if (input.value || input === document.activeElement) {\r\n      label.classList.add('is-active');\r\n    } else {\r\n      label.classList.remove('is-active');\r\n    }\r\n  }\r\n};\r\n\r\nconst addFormLabelsPlaceholder = el => {\r\n  const form = el.querySelector('.Form__MainBody');\r\n  if (!form) return;\r\n  const inputs = form.querySelectorAll('input');\r\n  const textareas = form.querySelectorAll('textarea');\r\n  const labels = form.querySelectorAll('.Form__Element__Caption');\r\n  labels?.forEach(label => {\r\n    if (label && label.nextElementSibling.tagName.toLowerCase() === 'select') {\r\n      label.classList.add('select-label');\r\n    }\r\n  });\r\n\r\n  inputs?.forEach(input => {\r\n    input.addEventListener('focus', updateLabel);\r\n    input.addEventListener('blur', updateLabel);\r\n    input.addEventListener('input', updateLabel);\r\n    updateLabel(input);\r\n  });\r\n\r\n  textareas?.forEach(textarea => {\r\n    textarea.addEventListener('focus', updateLabel);\r\n    textarea.addEventListener('blur', updateLabel);\r\n    textarea.addEventListener('input', updateLabel);\r\n    updateLabel(textarea);\r\n  });\r\n};\r\n\r\nexport default addFormLabelsPlaceholder;\r\n","import {Component} from '@verndale/core';\r\nimport countryCodes from \"../helpers/countryPhoneCodes\";\r\n\r\nclass Dropdown extends Component {\r\n  constructor(el) {\r\n    super(el);\r\n    this.selectedListItem = null;\r\n    this.storedValue = null;\r\n  }\r\n\r\n  setupDefaults() {\r\n    const form = this.el.closest('.Form__MainBody').parentElement;\r\n    this.phonePrefix = form.querySelector('.FormPhoneCode__Code');\r\n    this.phoneLabel = this.phonePrefix?.parentElement?.querySelector('.Form__Element__Caption');\r\n\r\n    this.dom = {\r\n      input: this.el.querySelector('.dropdown__input'),\r\n      label: this.el.querySelector('.Form__Element__Caption'),\r\n      listElement: this.el.querySelector('.dropdown__list'),\r\n      listItems: this.el.querySelectorAll('.dropdown__list-item'),\r\n      hiddenSelect: this.el.querySelector('.dropdown__hidden-select'),\r\n    };\r\n\r\n    this.dom.listElement.style.display = 'none';\r\n\r\n    if (!this.dom.hiddenSelect.value) {\r\n      return;\r\n    }\r\n    this.resetList();\r\n    const selectedValue = this.dom.hiddenSelect.value;\r\n\r\n    this.dom.input.value = this.dom.hiddenSelect.options[this.dom.hiddenSelect.selectedIndex].text;\r\n    this.storedValue = selectedValue;\r\n    this.clearSelected();\r\n    this.dom.listElement.style.display = 'none';\r\n    this.setActive();\r\n    this.setPhonePrefixOnLoad();\r\n    this.setSelectValue();\r\n    this.storedValue = null;\r\n  }\r\n\r\n  addListeners() {\r\n    this.dom.input.addEventListener('click', () => {\r\n      this.dom.listElement.style.display = 'block';\r\n      this.dom.input.value = '';\r\n    });\r\n\r\n    this.dom.input.addEventListener('input', (e) => {\r\n      this.inputValue = e.target.value;\r\n\r\n      this.filterOptions(this.inputValue);\r\n      this.dom.listElement.style.display = this.inputValue ? 'block' : 'none';\r\n\r\n      if (this.inputValue.length > 2) {\r\n        this.clearSelected();\r\n        this.setActive();\r\n      }\r\n    });\r\n\r\n    this.dom.listElement.addEventListener('click', (event) => {\r\n      if (event.target.classList.contains('dropdown__list-item')) {\r\n        this.resetList();\r\n        const selectedValue = event.target.getAttribute('data-value');\r\n\r\n        this.dom.input.value = event.target.textContent;\r\n        this.storedValue = selectedValue;\r\n        this.clearSelected();\r\n        this.dom.listElement.style.display = 'none';\r\n        this.setActive();\r\n        this.setPhonePrefix();\r\n        this.setSelectValue();\r\n        this.storedValue = null;\r\n      }\r\n    });\r\n\r\n    this.dom.input.addEventListener('keydown', (event => {\r\n      if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\r\n        event.preventDefault();\r\n        this.navigateList(event.key);\r\n\r\n        if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\r\n          this.dom.listElement.style.display = 'block';\r\n        }\r\n\r\n      } else if (event.key === 'Enter' && this.selectedListItem) {\r\n        event.preventDefault();\r\n        const selectedValue = this.selectedListItem.getAttribute('data-value');\r\n\r\n        this.dom.input.value = this.selectedListItem.textContent;\r\n        this.storedValue = selectedValue;\r\n        this.clearSelected();\r\n        this.dom.listElement.style.display = 'none';\r\n        this.setPhonePrefix();\r\n        this.setSelectValue();\r\n        this.storedValue = null;\r\n\r\n      } else if (event.key === 'Escape') {\r\n\r\n        this.dom.listElement.style.display = 'none';\r\n        this.clearSelected();\r\n\r\n        this.dom.input.value = '';\r\n        this.storedValue = null;\r\n      } else if (event.key === 'Tab' && !this.storedValue) {\r\n        this.resetList();\r\n        this.dom.input.value = '';\r\n        this.dom.listElement.style.display = 'none';\r\n        this.clearSelected();\r\n        this.storedValue = null;\r\n      }\r\n    }));\r\n\r\n    document.addEventListener('click', (event) => {\r\n      const isClickInsideDropdown = this.el.contains(event.target);\r\n      const isClickInsideList = this.dom.listElement.contains(event.target);\r\n\r\n      if (!isClickInsideDropdown && !isClickInsideList) {\r\n\r\n        if (this.storedValue === null) {\r\n          this.dom.listElement.style.display = 'none';\r\n          this.clearSelected();\r\n        } else {\r\n          this.dom.listElement.style.display = 'none';\r\n        }\r\n      }\r\n    });\r\n  }\r\n\r\n  setActive() {\r\n    this.dom.label.classList.add('is-active');\r\n  }\r\n\r\n  navigateList(direction) {\r\n    const currentArray = this.inputValue ? this.filteredOptions : [...this.dom.listItems];\r\n    let currentIndex = this.inputValue ? currentArray.indexOf(this.reset ? this.filteredOptions[0] : this.selectedListItem) : currentArray.indexOf(this.selectedListItem);\r\n\r\n    if (direction === 'ArrowDown' && currentIndex < currentArray.length - 1) {\r\n      currentIndex += 1;\r\n    } else if (direction === 'ArrowUp' && currentIndex > 0) {\r\n      currentIndex -= 1;\r\n    }\r\n\r\n    this.clearSelected();\r\n\r\n    if (currentArray[currentIndex]) {\r\n      currentArray[currentIndex].classList.add('selected');\r\n      this.selectedListItem = currentArray[currentIndex];\r\n      this.dom.listElement.scrollTop = this.selectedListItem.offsetTop;\r\n      this.reset = false;\r\n    }\r\n\r\n  }\r\n\r\n  clearSelected() {\r\n    if (this.selectedListItem) {\r\n      this.selectedListItem.classList.remove('selected');\r\n      this.selectedListItem = null;\r\n    }\r\n  }\r\n\r\n  resetList() {\r\n    [...this.dom.listItems].forEach((item) => {\r\n      item.style.display = 'block';\r\n      item.removeAttribute('tabindex')\r\n    });\r\n  }\r\n\r\n  filterOptions(value) {\r\n    this.filteredOptions = Array.from(this.dom.listItems).filter((item) => item.textContent.toLowerCase().includes(value.toLowerCase()));\r\n\r\n    this.dom.listItems.forEach((item) => {\r\n      item.style.display = 'none';\r\n      item.tabIndex = -1;\r\n    });\r\n\r\n    this.filteredOptions.forEach((item) => {\r\n      item.style.display = 'block';\r\n      item.removeAttribute('tabindex')\r\n    });\r\n\r\n    this.reset = true;\r\n  }\r\n\r\n  setSelectValue() {\r\n    if (this.storedValue) {\r\n      this.dom.hiddenSelect.value = this.storedValue;\r\n\r\n      // trigger change event manually to make sure opti form dependency works \r\n      const changeEvt = new Event(\"change\");\r\n      this.dom.hiddenSelect.dispatchEvent(changeEvt);\r\n    }\r\n  }\r\n\r\n  setPhonePrefix() {\r\n    if (this.phonePrefix) {\r\n      this.phonePrefix.value = `+${countryCodes[this.storedValue]}`;\r\n      this.phonePrefix.focus();\r\n    }\r\n  }\r\n\r\n  setPhonePrefixOnLoad() {\r\n    if (!this.phonePrefix) {\r\n      return;\r\n    }\r\n\r\n    // Do not overwrite the phone prefix value if it exists\r\n    if (this.phonePrefix.value) {\r\n      return;\r\n    }\r\n\r\n    this.phonePrefix.value = `+${countryCodes[this.storedValue]}`;\r\n\r\n    if (this.phonePrefix.value) {\r\n      this.phoneLabel.classList.add('is-active');\r\n    }\r\n  }\r\n}\r\n\r\nexport default Dropdown;\r\n","const countryCodes = {\r\n  AF: '93',\r\n  AX: '358',\r\n  AL: '355',\r\n  DZ: '213',\r\n  AS: '1684',\r\n  AD: '376',\r\n  AO: '244',\r\n  AI: '1264',\r\n  AQ: '672',\r\n  AG: '1268',\r\n  AR: '54',\r\n  AM: '374',\r\n  AW: '297',\r\n  AU: '61',\r\n  AT: '43',\r\n  AZ: '994',\r\n  BS: '1242',\r\n  BH: '973',\r\n  BD: '880',\r\n  BB: '1246',\r\n  BY: '375',\r\n  BE: '32',\r\n  BZ: '501',\r\n  BJ: '229',\r\n  BM: '1441',\r\n  BT: '975',\r\n  BO: '591',\r\n  BA: '387',\r\n  BW: '267',\r\n  BR: '55',\r\n  IO: '246',\r\n  VG: '1284',\r\n  BN: '673',\r\n  BG: '359',\r\n  BF: '226',\r\n  BI: '257',\r\n  KH: '855',\r\n  CM: '237',\r\n  CA: '1',\r\n  CV: '238',\r\n  KY: '1345',\r\n  CF: '236',\r\n  TD: '235',\r\n  CL: '56',\r\n  CN: '86',\r\n  CX: '61',\r\n  CC: '61',\r\n  CO: '57',\r\n  KM: '269',\r\n  CK: '682',\r\n  CR: '506',\r\n  HR: '385',\r\n  CU: '53',\r\n  CW: '599',\r\n  CY: '357',\r\n  CZ: '420',\r\n  CD: '243',\r\n  DK: '45',\r\n  DJ: '253',\r\n  DM: '1767',\r\n  DO: '1809, 1829, 1849',\r\n  TL: '670',\r\n  EC: '593',\r\n  EG: '20',\r\n  SV: '503',\r\n  GQ: '240',\r\n  ER: '291',\r\n  EE: '372',\r\n  ET: '251',\r\n  FK: '500',\r\n  FO: '298',\r\n  FJ: '679',\r\n  FI: '358',\r\n  FR: '33',\r\n  PF: '689',\r\n  GA: '241',\r\n  GM: '220',\r\n  GE: '995',\r\n  DE: '49',\r\n  GH: '233',\r\n  GI: '350',\r\n  GR: '30',\r\n  GL: '299',\r\n  GD: '1473',\r\n  GU: '1671',\r\n  GT: '502',\r\n  GG: '441481',\r\n  GN: '224',\r\n  GW: '245',\r\n  GY: '592',\r\n  HT: '509',\r\n  HN: '504',\r\n  HK: '852',\r\n  HU: '36',\r\n  IS: '354',\r\n  IN: '91',\r\n  ID: '62',\r\n  IR: '98',\r\n  BV: '',\r\n  BQ: '599',\r\n  CG: '242',\r\n  CI: '225',\r\n  SZ: '268',\r\n  GF: '594',\r\n  TF: '',\r\n  GP: '590',\r\n  HM: '',\r\n  IQ: '964',\r\n  IE: '353',\r\n  IM: '441624',\r\n  IL: '972',\r\n  IT: '39',\r\n  JM: '1876',\r\n  JP: '81',\r\n  JE: '441534',\r\n  JO: '962',\r\n  KZ: '7',\r\n  KE: '254',\r\n  KI: '686',\r\n  XK: '383',\r\n  KW: '965',\r\n  KG: '996',\r\n  LA: '856',\r\n  LV: '371',\r\n  LB: '961',\r\n  LS: '266',\r\n  LR: '231',\r\n  LY: '218',\r\n  LI: '423',\r\n  LT: '370',\r\n  LU: '352',\r\n  MO: '853',\r\n  MG: '261',\r\n  MW: '265',\r\n  MY: '60',\r\n  MV: '960',\r\n  ML: '223',\r\n  MT: '356',\r\n  MH: '692',\r\n  MQ: '596',\r\n  MR: '222',\r\n  MU: '230',\r\n  YT: '262',\r\n  MX: '52',\r\n  FM: '691',\r\n  MD: '373',\r\n  MC: '377',\r\n  MN: '976',\r\n  ME: '382',\r\n  MS: '1664',\r\n  MA: '212',\r\n  MZ: '258',\r\n  MM: '95',\r\n  NA: '264',\r\n  NR: '674',\r\n  NP: '977',\r\n  NL: '31',\r\n  NC: '687',\r\n  NZ: '64',\r\n  NI: '505',\r\n  NE: '227',\r\n  NG: '234',\r\n  NU: '683',\r\n  NF: '672',\r\n  KP: '850',\r\n  MK: '389',\r\n  MP: '1670',\r\n  NO: '47',\r\n  OM: '968',\r\n  PK: '92',\r\n  PW: '680',\r\n  PS: '970',\r\n  PA: '507',\r\n  PG: '675',\r\n  PY: '595',\r\n  PE: '51',\r\n  PH: '63',\r\n  PN: '870',\r\n  PL: '48',\r\n  PT: '351',\r\n  PR: '1787',\r\n  QA: '974',\r\n  RE: '262',\r\n  RO: '40',\r\n  RU: '7',\r\n  RW: '250',\r\n  WS: '685',\r\n  SM: '378',\r\n  ST: '239',\r\n  SA: '966',\r\n  SN: '221',\r\n  RS: '381',\r\n  SC: '248',\r\n  SL: '232',\r\n  SG: '65',\r\n  SX: '1721',\r\n  SK: '421',\r\n  SI: '386',\r\n  SB: '677',\r\n  SO: '252',\r\n  ZA: '27',\r\n  GS: '500',\r\n  KR: '82',\r\n  SS: '211',\r\n  ES: '34',\r\n  LK: '94',\r\n  BL: '590',\r\n  SH: '290',\r\n  KN: '1869',\r\n  LC: '1758',\r\n  MF: '590',\r\n  PM: '508',\r\n  VC: '1784',\r\n  SD: '249',\r\n  SR: '597',\r\n  SJ: '47',\r\n  SE: '46',\r\n  CH: '41',\r\n  SY: '963',\r\n  TW: '886',\r\n  TJ: '992',\r\n  TZ: '255',\r\n  TH: '66',\r\n  TG: '228',\r\n  TK: '690',\r\n  TO: '676',\r\n  TT: '1868',\r\n  TN: '216',\r\n  TR: '90',\r\n  TM: '993',\r\n  TC: '1649',\r\n  TV: '688',\r\n  UM: '1',\r\n  VI: '1340',\r\n  UG: '256',\r\n  UA: '380',\r\n  AE: '971',\r\n  GB: '44',\r\n  US: '1',\r\n  UY: '598',\r\n  UZ: '998',\r\n  VU: '678',\r\n  VA: '3906',\r\n  VE: '58',\r\n  VN: '84',\r\n  WF: '681',\r\n  EH: '212',\r\n  YE: '967',\r\n  ZM: '260',\r\n  ZW: '263'\r\n};\r\n\r\nexport default countryCodes;\r\n","import { Component } from '@verndale/core';\r\nimport addFormLabelsPlaceholder from '../helpers/addFormLabelsPlaceholder';\r\nimport setupPhoneInput from '../helpers/setupPhoneInput';\r\nimport checkDropdowns from '../helpers/checkDropdowns';\r\n\r\nclass ContentDetailGatedForm extends Component {\r\n  setupDefaults() {\r\n    this.dom = {\r\n      heroBackgroundContainer: this.el.querySelector(\r\n        '.content-detail__hero-background'\r\n      ),\r\n      heroContentContainer: this.el.querySelector('.content-detail-hero')\r\n    };\r\n    this.updateHeroBackgroundHeight();\r\n    addFormLabelsPlaceholder(this.el);\r\n    setupPhoneInput(this.el);\r\n    checkDropdowns(this.el);\r\n  }\r\n\r\n  addListeners() {\r\n    window.addEventListener('load', this.updateHeroBackgroundHeight.bind(this));\r\n    window.addEventListener(\r\n      'resize',\r\n      this.updateHeroBackgroundHeight.bind(this)\r\n    );\r\n  }\r\n\r\n  updateHeroBackgroundHeight() {\r\n    const contentHeight = this.dom.heroContentContainer.offsetHeight;\r\n    this.dom.heroBackgroundContainer.style.height = `${contentHeight}px`;\r\n  }\r\n}\r\n\r\nexport default ContentDetailGatedForm;\r\n"],"sourceRoot":""}