{"version":3,"file":"site-C5LLO_kM.js","sources":["../../../assets/javascripts/common/base/talk-load-more.js","../../../assets/javascripts/site/components/promo-video.js","../../../assets/javascripts/site/components/news-ticker.js","../../../assets/javascripts/site/components/dynamic-illustrations.js","../../../assets/javascripts/site/components/purchase-flow/company-creation-modal.js","../../../assets/javascripts/site/components/purchase-flow/step-1.js","../../../assets/javascripts/site/components/purchase-flow/step-2.js","../../../assets/javascripts/site/components/purchase-flow.js","../../../assets/javascripts/site/components/wp-video.js"],"sourcesContent":["import $ from 'jquery';\n\nwindow.addEventListener(\"load\", () => {\n  if (document.getElementById(\"next_link\")) {\n    const element = document.querySelector(\"#next_link\");\n    element.addEventListener(\"ajax:beforeSend\", () => {\n      $(\"body\").css(\"cursor\", \"progress\");\n    });\n  }\n});\n","import { getElements } from 'js-utils/src/selector';\n\nimport init from '../../common/base/init';\n\n// modal\n\ninit(() => {\n  const modal = document.querySelector('#promo-video-modal');\n  if(!modal) return;\n\n  const playerContainer = modal.querySelector('.-player');\n\n  modal.A11yDialogInstance.on('show', () => {\n    playerContainer.innerHTML = modal.querySelector('.js--player-markup').innerHTML;\n  });\n\n  modal.A11yDialogInstance.on('hide', () => {\n    playerContainer.innerHTML = '';\n  });\n});\n\n// cta's\n\ninit(() => {\n  const containers = getElements('.promo-video');\n  if(!containers.length) return;\n\n  containers.forEach((container) => {\n    const triggerBtn = container.querySelector('.js--trigger-btn');\n    const triggerImg = container.querySelector('.js--trigger-img');\n    if(!triggerBtn || !triggerImg) return;\n\n    const showTriggerBtn = () => {\n      triggerBtn.classList.remove('is-hidden');\n    };\n\n    if(triggerImg.complete) {\n      showTriggerBtn();\n    }\n    else {\n      triggerImg.addEventListener('load', showTriggerBtn);\n    }\n  });\n});\n","import init from '../../common/base/init';\n\n// Set animation duration on news ticker depending on width\n\ninit(() => {\n  const newsTicker = document.querySelector('.news-ticker ul');\n  if(!newsTicker) return;\n\n  const tickerWidth = newsTicker.offsetWidth;\n  const animationDuration = tickerWidth/100;\n  newsTicker.style.animationDuration = animationDuration + 's';\n});\n","import { getElements } from 'js-utils/src/selector';\nimport { addClass, removeClass } from 'js-utils/src/attribute';\n\nimport init from '../../common/base/init';\n\n// NEWS\n// News bubbling up on iPhone\n\ninit(() => {\n  if(!document.querySelector('.dynamic-illustration--news')) return;\n\n  const articleContainer = getElements('.dynamic-illustration--news .dynamic-illustration__items');\n  const articles = getElements('.dynamic-illustration--news .news-box');\n  let currentArticle = 0;\n\n  articles.forEach((article) => {\n    const cardWidth = 80 + Math.round(Math.random()*20);\n    article.style.width = cardWidth + \"%\";\n    const marginLeft = Math.round(Math.random()*(100 - cardWidth))\n    article.style.marginLeft = marginLeft + \"%\";\n    article.style.opacity = 1;\n  });\n\n  const cycleArticles = () => {\n    if(currentArticle < articles.length - 1) {\n      currentArticle++;\n    } else {\n      setTimeout(function() {\n        articles.forEach((article) => {\n          article.style.opacity = 1;\n          article.style.transform = \"scale(1)\";\n        });\n      }, 1000);\n      currentArticle = 0;\n    }\n\n    const offset = articles[currentArticle].offsetTop - 20;\n    articleContainer[0].style.transform = \"translateY(-\" + offset + \"px)\";\n\n    if(currentArticle > 0) {\n      articles[currentArticle - 1].style.opacity = 0;\n      articles[currentArticle - 1].style.transform = \"scale(0.8)\";\n    }\n  };\n\n  if(articles.length) {\n    setInterval(cycleArticles, 5000);\n  }\n});\n\n// PLAY\n// Play videos moving side-to-side\n\ninit(() => {\n  if(!document.querySelector('.dynamic-illustration--videos')) return;\n\n  const videoContainer = getElements('.dynamic-illustration--videos .dynamic-illustration__items');\n  const videos = getElements('.dynamic-illustration--videos .news-box');\n  let currentVideo = 0;\n  let offset = 0;\n\n  const resetVideos = () => {\n    videos[currentVideo].style.opacity = 0;\n    videos[currentVideo].style.transform = \"scale(0.8)\";\n\n    offset = 0;\n    currentVideo = 0;\n\n    setTimeout(function() {\n      videoContainer[0].style.transform = \"translate(0, -50%)\";\n    }, 100);\n\n    setTimeout(function() {\n      videos.forEach((video) => {\n        video.style.opacity = 0.8;\n        video.style.transform = \"scale(0.9)\";\n      });\n\n      videos[currentVideo].style.transform = \"scale(1)\";\n      videos[currentVideo].style.opacity = 1;\n    }, 1000);\n  };\n\n  if(videos.length) {\n    resetVideos();\n  }\n\n  const cycleVideos = () => {\n    if(currentVideo < videos.length - 1) {\n      currentVideo++;\n      offset += videos[currentVideo].offsetWidth + 20;\n\n      setTimeout(function() {\n        videoContainer[0].style.transform = \"translate(\" + offset + \"px, -50%)\";\n      }, 200);\n    }\n    else {\n      resetVideos();\n    }\n\n    if(currentVideo > 0) {\n      videos[currentVideo - 1].style.opacity = 0;\n      videos[currentVideo - 1].style.transform = \"scale(0.8)\";\n    }\n\n    setTimeout(function() {\n      videos[currentVideo].style.transform = \"scale(1)\";\n      videos[currentVideo].style.opacity = 1;\n    }, 1200);\n\n  };\n\n  if(videos.length) {\n    setInterval(cycleVideos, 7000);\n  }\n});\n\n// ANALYSES\n// Expertkommentarer analyses flowing up\n\ninit(() => {\n  if(!document.querySelector('.dynamic-illustration--analyses')) return;\n\n  const analyses = getElements('.dynamic-illustration--analyses .news-box');\n  let currentAnalysis = 0;\n\n  const cycleAnalyses = () => {\n    setTimeout(function() {\n      removeClass(analyses[currentAnalysis], '-visible');\n    }, 100);\n    setTimeout(function() {\n      removeClass(analyses[currentAnalysis + 1], '-visible');\n    }, 200);\n\n    setTimeout(function() {\n      removeClass(analyses[currentAnalysis + 2], '-visible');\n\n      if(currentAnalysis < analyses.length - 4) {\n        currentAnalysis += 3;\n      } else {\n        currentAnalysis = 0;\n      }\n\n      setTimeout(function() {\n        addClass(analyses[currentAnalysis], '-visible');\n      }, 400);\n      setTimeout(function() {\n        addClass(analyses[currentAnalysis + 1], '-visible');\n      }, 500);\n      setTimeout(function() {\n        addClass(analyses[currentAnalysis + 2], '-visible');\n      }, 600);\n    }, 300);\n\n  };\n\n  if(analyses.length) {\n    cycleAnalyses();\n    setInterval(cycleAnalyses, 8000);\n  }\n});\n\n// PRACTICES\n// Praxis flowing up\n\ninit(() => {\n  if(!document.querySelector('.dynamic-illustration--practices')) return;\n\n  const analyses = getElements('.dynamic-illustration--practices .news-box');\n  let currentAnalysis = 0;\n\n  const cycleAnalyses = () => {\n    setTimeout(function() {\n      removeClass(analyses[currentAnalysis], '-visible');\n    }, 100);\n    setTimeout(function() {\n      removeClass(analyses[currentAnalysis + 1], '-visible');\n    }, 200);\n\n    setTimeout(function() {\n      removeClass(analyses[currentAnalysis + 2], '-visible');\n\n      if(currentAnalysis < analyses.length - 4) {\n        currentAnalysis += 3;\n      } else {\n        currentAnalysis = 0;\n      }\n\n      setTimeout(function() {\n        addClass(analyses[currentAnalysis], '-visible');\n      }, 400);\n      setTimeout(function() {\n        addClass(analyses[currentAnalysis + 1], '-visible');\n      }, 500);\n      setTimeout(function() {\n        addClass(analyses[currentAnalysis + 2], '-visible');\n      }, 600);\n    }, 300);\n\n  };\n\n  if(analyses.length) {\n    cycleAnalyses();\n    setInterval(cycleAnalyses, 8000);\n  }\n});\n\n// SEMINARS\n// Seminars cycling through a Pixel phone\n\ninit(() => {\n  if(!document.querySelector('.dynamic-illustration--seminars')) return;\n\n  const seminars = getElements('.dynamic-illustration--seminars .news-box');\n  let currentSeminar = seminars.length - 1;\n  let seminarInBottom = false;\n\n  const resetSeminars = () => {\n    seminarInBottom = getElements('.dynamic-illustration--seminars')[0].classList.contains('--bottom') ? true : false;\n\n    seminars.forEach((seminar, i) => {\n      setTimeout(function() {\n        const scale = 1 - (seminars.length-1-i)/10;\n        seminar.style.opacity = scale;\n        seminar.style.transform = \"translateX(-50%) translateY(10%) scale(\" + scale + \")\";\n\n        if(seminarInBottom)\n          seminar.style.bottom = scale * 100 + \"px\";\n        else\n          seminar.style.top = scale * 100 + \"px\";\n      }, (seminars.length - i) * 10);\n    });\n\n    currentSeminar = seminars.length - 1;\n  };\n\n  if(seminars.length) {\n    resetSeminars();\n  }\n\n  const cycleSeminars = () => {\n    seminars[currentSeminar].style.opacity = 0;\n    seminars[currentSeminar].style.transform = \"translateX(-50%) translateY(100%) scale(1.1)\";\n    seminars[currentSeminar].style.pointerEvents = \"none\";\n\n    if(currentSeminar > 0) {\n      currentSeminar--;\n    } else {\n      resetSeminars();\n    }\n\n    for (let i = currentSeminar; i >= 0; i--) {\n      setTimeout(function() {\n        const scale = 1 - (currentSeminar-i)/10;\n        seminars[i].style.opacity = scale;\n        seminars[i].style.transform = \"translateX(-50%) translateY(10%) scale(\" + scale + \")\";\n        seminars[i].style.pointerEvents = \"all\";\n      }, (seminars.length - i) * 100);\n    }\n  };\n\n  if(seminars.length) {\n    setInterval(cycleSeminars, 6000);\n  }\n});\n","import init from '../../../common/base/init';\nimport initChoices from '../../../common/components/choices';\n\ninit(() => {\n  const container = document.querySelector('.purchase-company-create');\n  if(!container) return;\n\n  const modal = container.closest('.a11ydialog');\n\n  const trackAjax = () => {\n    const form = container.querySelector('form');\n    if(!form) return;\n\n    form.addEventListener('ajax:success', (e) => {\n      const [data] = e.detail;\n\n      if(data.status === 'error') {\n        form.outerHTML = data.form;\n        modal.dispatchEvent(new CustomEvent('scroll-to-top'));\n        initChoices(form);\n        trackAjax();\n      }\n      else { // success\n        window.location.reload();\n      }\n    });\n  };\n\n  trackAjax();\n});\n","import Cookies from \"js-cookie\";\n\nconst step1 = () => {\n  const rangeSlider = document.getElementById(\"range-slider\");\n  const rangeInput = document.getElementById(\"range-slider-number-input\");\n  const columnsWrapper = document.querySelector(\".columns-wrapper\");\n  const packages = columnsWrapper.querySelectorAll(\".column\");\n  const columnSections = columnsWrapper.querySelectorAll(\".column__section\");\n  const discountTooltip = document.querySelector(\n    \".range-slider-wrapper__discount-tooltip\"\n  );\n  const discountPercentageEl = document.querySelector(\".discount-percentage\");\n  let customPlanMessageOpen = false;\n  let seatAmount = 1;\n\n  let priceTimer;\n\n  const ValidateBasePackage = lineItems => {\n    return Object.keys(lineItems).length >= 1;\n  };\n  const ValidateFlexPackage = lineItems => {\n    return Object.keys(lineItems).length >= 2;\n  };\n  const ValidatePremiumPackage = lineItems => {\n    const playCategories = Object.values(lineItems).filter(item => {\n      return item.orderable_attributes.product_id === \"71\" ? item : null;\n    });\n    const analysisCategories = Object.values(lineItems).filter(item => {\n      return item.orderable_attributes.product_id === \"70\" ? item : null;\n    });\n    return (\n      Object.keys(playCategories).length >= 1 &&\n      Object.keys(analysisCategories).length >= 1\n    );\n  };\n  const ValidateOrder = orderJSON => {\n    const pkg = JSON.parse(orderJSON).order.pricing_package_id;\n    const lineItems = JSON.parse(orderJSON).order.order_line_items_attributes;\n\n    switch (pkg) {\n      case \"1\":\n        return ValidateBasePackage(lineItems);\n      case \"2\":\n        return ValidateFlexPackage(lineItems);\n      case \"3\":\n        return ValidatePremiumPackage(lineItems);\n    }\n  };\n\n  // This function builds the JSON for saving an order\n  // and grabbing the price from the API\n  const buildOrder = pricePackage => {\n    let orderJSON = new Object();\n    let lineItems = new Object();\n\n    const products = pricePackage.querySelectorAll(\".column__section\");\n    const pricingPackageID = pricePackage.querySelector(\".pricing_package_id\");\n\n    // Iterate through products\n    products.forEach(product => {\n      const checkbox = product.querySelector(\".-select-product\");\n      const productId = product.querySelector(\".-product-id\");\n\n      // If the product is selected\n      if (checkbox && checkbox.checked) {\n        const legalAreas = product.querySelector(\".js--choices-purchaseflow\");\n\n        // If the product has legal areas\n        if (legalAreas) {\n          const selectedOptions = legalAreas.querySelectorAll(\"option\");\n\n          // Iterate through all selected legal areas\n          selectedOptions.forEach(option => {\n            const liHash = Math.round(Math.random() * 100);\n\n            const newLineItem = {\n              [liHash]: {\n                cancelled: \"0\",\n                orderable_type: \"OrderedProduct\",\n                orderable_attributes: {\n                  product_id: productId.value,\n                  category_id: option.value,\n                  archive: \"1\"\n                },\n                _destroy: \"false\"\n              }\n            };\n\n            lineItems = Object.assign({}, lineItems, newLineItem);\n          });\n\n          // If the product doesn't have legal areas,\n          // then add the entire product (category_id: \"\")\n        } else {\n          const liHash = Math.round(Math.random() * 100);\n\n          const newLineItem = {\n            [liHash]: {\n              cancelled: \"0\",\n              orderable_type: \"OrderedProduct\",\n              orderable_attributes: {\n                product_id: productId.value,\n                category_id: \"\",\n                archive: \"1\"\n              },\n              _destroy: \"false\"\n            }\n          };\n\n          lineItems = Object.assign({}, lineItems, newLineItem);\n        }\n      }\n    });\n\n    orderJSON.pricing_package_id = pricingPackageID.value;\n    orderJSON.users_amount = seatAmount;\n    orderJSON.status = \"created\";\n    orderJSON.order_line_items_attributes = lineItems;\n\n    orderJSON = JSON.stringify({\n      order: orderJSON\n    });\n\n    return orderJSON;\n  };\n\n  const getPrices = (pkg = 0) => {\n    const getPackagePrice = pkg => {\n      // Get the JSON needed to create order\n      const orderJSON = buildOrder(pkg);\n      const packagePriceContainer = pkg.querySelector(\".price\");\n      const packagePrice = pkg.querySelectorAll(\".-dynamic-price\");\n\n      packagePriceContainer.classList.add(\"--loading\");\n\n      // Create a new XMLHttpRequest\n      let xmlhttp = new XMLHttpRequest();\n\n      // Listen for state change\n      xmlhttp.onreadystatechange = function() {\n        if (xmlhttp.readyState == XMLHttpRequest.DONE) {\n          // If successful, grab the price and update\n          if (xmlhttp.status == 200) {\n            const response = JSON.parse(xmlhttp.responseText);\n            Array.from(packagePrice).map(\n              item => (item.innerHTML = response[\"price\"])\n            );\n          } else {\n            // Otherwise, reset to base price\n            Array.from(packagePrice).map(\n              item => (item.innerHTML = item.dataset.basePrice)\n            );\n          }\n\n          packagePriceContainer.classList.remove(\"--loading\");\n        }\n      };\n\n      // Call the API\n      xmlhttp.open(\"POST\", \"/api/v1/orders/price\");\n      xmlhttp.setRequestHeader(\"Content-Type\", \"application/json\");\n\n      // Send the parsed JSON\n      xmlhttp.send(orderJSON);\n    };\n\n    // If a package was specified in the getPrices() variable,\n    // only query and update that package\n    if (pkg) {\n      getPackagePrice(pkg);\n\n      // Otherwise, iterate through all packages\n    } else {\n      packages.forEach(pkg => getPackagePrice(pkg));\n    }\n  };\n\n  const createOrder = pkg => {\n    const loadingSpinner = document.querySelector(\".columns-wrapper\");\n    loadingSpinner.classList.add(\"--loading\");\n\n    document.querySelectorAll(\".-place-order\").forEach(el => {\n      el.disabled = true;\n    });\n\n    // Get the JSON needed to create order\n    const orderJSON = buildOrder(pkg);\n\n    // Create a new XMLHttpRequest\n    let xmlhttp = new XMLHttpRequest();\n\n    // Listen for state change\n    xmlhttp.onreadystatechange = function() {\n      if (xmlhttp.readyState == XMLHttpRequest.DONE) {\n        // If successful, grab the price and update\n        if (xmlhttp.status == 200) {\n          const response = JSON.parse(xmlhttp.responseText);\n\n          if (response[\"token\"]) {\n            // Store a cookie with the order token\n            Cookies.set(\"order_token\", response[\"token\"], { expires: 15 });\n\n            // Redirect user to order page\n            // TODO: Improve this redirect\n            window.location.href = \"/bestall/\" + response[\"token\"];\n          }\n        } else {\n          document.querySelectorAll(\".-place-order\").forEach(el => {\n            el.disabled = false;\n          });\n          showValidationNotice(pkg);\n        }\n\n        loadingSpinner.classList.remove(\"--loading\");\n      }\n    };\n\n    // Call the API\n    xmlhttp.open(\"POST\", \"/api/v1/orders/\");\n    xmlhttp.setRequestHeader(\"Content-Type\", \"application/json\");\n\n    if (ValidateOrder(orderJSON)) {\n      xmlhttp.send(orderJSON);\n    } else {\n      loadingSpinner.classList.remove(\"--loading\");\n      document.querySelectorAll(\".-place-order\").forEach(el => {\n        el.disabled = false;\n      });\n      showValidationNotice(pkg);\n    }\n  };\n\n  // Add listener events to the package purchase buttons\n  document.querySelectorAll(\".-place-order\").forEach(el => {\n    const pkg = el.closest(\".column\");\n\n    el.addEventListener(\"click\", function(event) {\n      if (!pkg) return;\n\n      createOrder(pkg);\n\n      event.preventDefault();\n    });\n  });\n\n  // Check which products are active and enable\n  // the legal area dropdowns\n  const enableLegalAreas = () => {\n    columnSections.forEach(el => {\n      const checkbox = el.querySelector(\".-select-product\");\n      const legalAreaDropdown = el.querySelector(\".js--choices-purchaseflow\");\n\n      if (legalAreaDropdown) {\n        if (checkbox && checkbox.checked) {\n          legalAreaDropdown.CHOICES_INSTANCE.enable();\n        } else if (checkbox) {\n          legalAreaDropdown.CHOICES_INSTANCE.disable();\n        }\n      }\n    });\n  };\n\n  document.querySelectorAll(\".js--choices-purchaseflow\").forEach(el => {\n    let instance = el.parentElement.querySelector(\"select\").CHOICES_INSTANCE;\n    const parentPackage = el.closest(\".column\");\n    const addonPrice = parentPackage.querySelector(\".addon_price\").value;\n\n    el.addEventListener(\"removeItem\", function() {\n      if (instance.getValue().length == 0) {\n        instance.input.element.classList.remove(\"-additional-legal-area\");\n        instance.input.element.setAttribute(\"placeholder\", \"Välj rättsområde\");\n      }\n\n      clearTimeout(priceTimer);\n      priceTimer = setTimeout(function() {\n        getPrices(parentPackage);\n      }, 500);\n    });\n\n    el.addEventListener(\"addItem\", function() {\n      if (instance.getValue().length > 0) {\n        instance.input.element.classList.add(\"-additional-legal-area\");\n        instance.input.element.setAttribute(\n          \"placeholder\",\n          \"Lägg till extra rättsområde (+\" + addonPrice + \" kr)\"\n        );\n      }\n\n      clearTimeout(priceTimer);\n      priceTimer = setTimeout(function() {\n        getPrices(parentPackage);\n      }, 500);\n    });\n  });\n\n  // Add listener events to the product checkboxes\n  // and radio inputs\n  const addProductListeners = () => {\n    columnSections.forEach(el => {\n      const checkbox = el.querySelector(\".-select-product\");\n      const parentPackage = el.closest(\".column\");\n\n      if (checkbox) {\n        checkbox.addEventListener(\"change\", () => {\n          enableLegalAreas();\n          getPrices(parentPackage);\n        });\n      }\n    });\n  };\n\n  let updateTooltip = () => {\n    discountTooltip.style.left = (seatAmount - 1) * 7.14285714 + \"%\";\n\n    // this offsets discount tooltip as range slider progresses\n    // because it's thumb doesn't go 100% from the left but more like (100% - it's width)\n    discountTooltip.style.marginLeft =\n      -34 - (38 / 14) * (seatAmount - 1) + \"px\";\n\n    if (seatAmount >= 5 && seatAmount != 15) {\n      discountTooltip.classList.add(\"visible\");\n    } else {\n      discountTooltip.classList.remove(\"visible\");\n    }\n\n    if (seatAmount >= 5 && seatAmount < 10) {\n      discountPercentageEl.innerHTML = \"10\";\n    } else if (seatAmount >= 10) {\n      discountPercentageEl.innerHTML = \"15\";\n    }\n  };\n\n  let updateSeatAmount = el => {\n    seatAmount = el.value;\n    rangeInput.value = seatAmount;\n    rangeSlider.value = seatAmount;\n    rangeInput.setAttribute(\"value\", seatAmount);\n\n    //tooltip\n    updateTooltip();\n\n    if (seatAmount == 15) {\n      customPlanMessageOpen = true;\n      columnsWrapper.classList.add(\"-columns-hidden\");\n    } else if (seatAmount < 15 && customPlanMessageOpen) {\n      customPlanMessageOpen = false;\n      columnsWrapper.classList.remove(\"-columns-hidden\");\n    }\n  };\n\n  rangeSlider.addEventListener(\"input\", function() {\n    updateSeatAmount(this);\n  });\n\n  rangeSlider.addEventListener(\"change\", function() {\n    updateSeatAmount(this);\n\n    getPrices();\n  });\n\n  rangeInput.addEventListener(\"input\", function() {\n    //if entered number is larger than max attribute we force value to be the last valid number entered\n    if (parseInt(this.value) > parseInt(this.getAttribute(\"max\"))) {\n      this.value = this.getAttribute(\"value\");\n    } else if (this.value == \"\") {\n      this.value = 1;\n    }\n    updateSeatAmount(this);\n  });\n\n  rangeInput.addEventListener(\"change\", function() {\n    updateSeatAmount(this);\n\n    getPrices();\n  });\n\n  // Enable/disable legal areas\n  enableLegalAreas();\n\n  // Attach event listeners to product radios/checkboxes\n  addProductListeners();\n\n  // Load real prices the first time\n  getPrices();\n\n  const showValidationNotice = pkg => {\n    pkg.querySelector(\".validation-notice\").classList.add(\"-visible\");\n\n    setTimeout(function() {\n      pkg.querySelector(\".validation-notice\").classList.remove(\"-visible\");\n    }, 5000);\n  };\n\n  const hideValidationNotice = pkg => {\n    pkg.querySelector(\".validation-notice\").classList.remove(\"-visible\");\n  };\n\n  //hide validation notice if some inputs changed\n  document.querySelectorAll(\"form.column input\").forEach(function(el) {\n    const pkg = el.closest(\".column\");\n\n    el.addEventListener(\"change\", function() {\n      hideValidationNotice(pkg);\n    });\n  });\n\n  //tab navigation on mobile\n  document.querySelectorAll(\".column__heading\").forEach(function(el) {\n    el.addEventListener(\"click\", function() {\n      let targetColumn = this.getAttribute(\"data-columnname\");\n\n      document\n        .querySelectorAll(\".columns-wrapper__column-wrapper\")\n        .forEach(function(el) {\n          el.classList.remove(\"-active\");\n        });\n\n      document\n        .querySelector(\n          \".columns-wrapper__column-wrapper[data-column=\" + targetColumn + \"]\"\n        )\n        .classList.add(\"-active\");\n    });\n  });\n\n  const tooltips = document.querySelectorAll(\".tooltip__trigger\");\n\n  const hideAllTooltips = () => {\n    const visibleTooltips = document.querySelectorAll(\".tooltip--visible\");\n    visibleTooltips.forEach(item => item.classList.remove(\"tooltip--visible\"));\n  };\n\n  document.addEventListener(\"click\", function(event) {\n    hideAllTooltips();\n\n    tooltips.forEach(tooltip => {\n      tooltip.addEventListener(\"click\", function(e) {\n        e.preventDefault();\n      });\n\n      if (tooltip.contains(event.target)) {\n        const tooltipWrapper = tooltip.closest(\".tooltip\");\n        tooltipWrapper.classList.add(\"tooltip--visible\");\n      }\n    });\n  });\n};\n\nexport default step1;\n","const step2 = () => {\n  /* const addCouponButton = document.getElementById('coupon-code-button');\n  const closeCouponButton = document.getElementById('close-coupon-form-button');\n  const couponForm = document.getElementById('coupon-code-form');\n  const discountInput = document.getElementById('discount-code-input');\n  const form = couponForm.firstElementChild;\n\n  addCouponButton.addEventListener('click', function() {\n    couponForm.style.display = 'block';\n    addCouponButton.style.display = 'none';\n  });\n\n  closeCouponButton.addEventListener('click', function() {\n    couponForm.style.display = 'none';\n    addCouponButton.style.display = 'block';\n    discountInput.value = '';\n  });\n\n  form.addEventListener('submit', function(e) {\n    e.preventDefault();\n\n    let couponDiscount = 5;\n\n    let couponInfoLeft = document.createElement('div');\n    couponInfoLeft.classList.add('summary__item__left');\n    couponInfoLeft.innerText = couponDiscount+'% coupon discount';\n\n    let couponInfoRight = document.createElement('div');\n    couponInfoRight.classList.add('summary__item__right');\n    couponInfoRight.classList.add('highlight-red');\n    couponInfoRight.innerText = '-703 kr';\n\n    addCouponButton.remove();\n    couponForm.remove();\n\n    let container = document.createElement('div');\n    container.classList.add('-coupon-discount-final');\n\n    container.append(couponInfoLeft);\n    container.append(couponInfoRight);\n\n    document.getElementById('coupon-code-section').append(container);\n\n  }); */\n\n  const autoSubmit = document.querySelector('input[name=\"purchase-auto-submit\"]');\n  if (autoSubmit) {\n    const purchaseForm = document.getElementById('new_order');\n    if(!purchaseForm) return;\n    purchaseForm.submit();\n  }\n\n  // Payment owner inputs group\n  // Iterate through all payment method inputs first\n  document.querySelectorAll('.-owner input').forEach( (el) => {\n    const validateOrderType = () => {\n      const formContainer = document.querySelector('.details');\n      const orderedByType = document.querySelector('input[name=\"order[ordered_by_type]\"]:checked');\n      const orderedById = document.querySelector('input[name=\"order[ordered_by_id]\"]');\n\n      if(orderedByType.value === \"Company\") {\n        const companyId = document.querySelector('input[name=\"company_id\"]');\n        formContainer.classList.add('--company');\n        formContainer.classList.remove('--user');\n\n        if(companyId)\n          orderedById.value = companyId.value;\n      } else {\n        const userId = document.querySelector('input[name=\"user_id\"]');\n        formContainer.classList.add('--user');\n        formContainer.classList.remove('--company');\n\n        if(userId)\n          orderedById.value = userId.value;\n      }\n    }\n\n    el.addEventListener('click', validateOrderType);\n\n    validateOrderType();\n  });\n\n\n  // Payment method inputs group\n  // Iterate through all payment method inputs first\n  document.querySelectorAll('.-method input').forEach( (el) => {\n    el.addEventListener('click', function() {\n      // Get the monthly billing period elements\n      const monthlyPeriodContainer = document.querySelector('.-period--monthly');\n      if (!monthlyPeriodContainer) return;\n      const monthlyPeriodInput = monthlyPeriodContainer.querySelector('input');\n\n      // 0 = Invoice\n      // 1 = Credit Card\n      if(el.value === \"0\" && el.checked === true) {\n        monthlyPeriodInput.disabled = true;\n        monthlyPeriodContainer.classList.add('--disabled');\n      } else {\n        monthlyPeriodInput.disabled = false;\n        monthlyPeriodContainer.classList.remove('--disabled');\n      }\n    });\n  });\n\n  // Payment billing period inputs group\n  // Iterate through all payment billing periods first\n  document.querySelectorAll('.-period input').forEach( (el) => {\n    el.addEventListener('click', function() {\n      // Get the monthly billing period elements\n      const invoiceMethodContainer = document.querySelector('.-method--invoice');\n      if (!invoiceMethodContainer) return;\n      const invoiceMethodInput = invoiceMethodContainer.querySelector('input');\n\n      // 0 = Yearly\n      // 1 = Monthly\n      if(el.value === \"1\" && el.checked === true) {\n        invoiceMethodInput.disabled = true;\n        invoiceMethodContainer.classList.add('--disabled');\n      } else {\n        invoiceMethodInput.disabled = false;\n        invoiceMethodContainer.classList.remove('--disabled');\n      }\n    });\n  });\n\n  //increase / decrease the amount of users\n  let usersAmount = 1;\n  let pricePerUser = 1690;\n  let totalPrice = 0;\n  let discount = 0;\n  let discountedPrice = 0;\n\n\n  let updateAmount = () => {\n\n    if( usersAmount > 9 ){\n      discount = 10;\n      document.querySelector('.-discount-section').classList.remove('hidden');\n    }else if ( usersAmount > 4 ){\n      discount = 5;\n      document.querySelector('.-discount-section').classList.remove('hidden');\n    }else {\n      discount = 0;\n      document.querySelector('.-discount-section').classList.add('hidden');\n    }\n\n    totalPrice = pricePerUser*usersAmount;\n    discountedPrice = totalPrice * (1-(discount/100));\n\n    document.querySelector('.-discount-section .discount-percentage').innerHTML = discount;\n    document.querySelector('.-discount-section .user-amount').innerHTML = usersAmount;\n    document.querySelector('.-discount-section .discount-amount').innerHTML = totalPrice-discountedPrice;\n\n    document.querySelector('.total-price').innerHTML = discountedPrice;\n\n    updateUserInformation();\n  }\n\n  let updateUserInformation = () => {\n    document.querySelector('.user-amount .user-number').innerHTML = usersAmount;\n    document.querySelector('.subtotal-price').innerHTML = totalPrice;\n  }\n\n  let adjustUserAmount = (inc) => {\n    if( inc == 'true' && usersAmount < 15 ){\n      usersAmount += 1;\n    }else if ( inc == 'false' && usersAmount > 1) {\n      usersAmount -= 1;\n    }\n    updateAmount();\n  }\n\n  document.querySelectorAll('.user-amount__control').forEach( (el) => {\n    el.addEventListener('click', function(){\n      let increase = this.getAttribute('data-increase');\n      adjustUserAmount(increase);\n    })\n  });\n}\n\nexport default step2;\n","import init from '../../common/base/init';\n\nimport './purchase-flow/company-creation-modal';\nimport step1 from './purchase-flow/step-1';\nimport step2 from './purchase-flow/step-2';\n\ninit(() => {\n\n  // step 1\n  if( document.getElementById('range-slider') ) {\n    step1();\n  }\n\n  // step 2\n  if( document.getElementById('purchase-step-2') ) {\n    step2();\n  }\n\n});\n","import init from \"../../common/base/init\";\n\nimport { getElements } from \"js-utils/src/selector\";\n\n// modal\n\ninit(() => {\n  const modals = document.querySelectorAll(\".wp-video-modal\");\n  if (!modals) return;\n\n  modals.forEach((modal) => {\n    modal = modal.closest(`.a11ydialog`);\n    const playerContainer = modal.querySelector(\".-player\");\n\n    modal.A11yDialogInstance.on(\"show\", () => {\n      playerContainer.innerHTML = modal.querySelector(\n        \".js--player-markup\"\n      ).innerHTML;\n    });\n\n    modal.A11yDialogInstance.on(\"hide\", () => {\n      playerContainer.innerHTML = \"\";\n    });\n  });\n});\n\n// cta's\n\ninit(() => {\n  const containers = getElements(\".wp-video\");\n  if (!containers.length) return;\n\n  containers.forEach((container) => {\n    const triggerBtn = container.querySelector(\".js--trigger-btn\");\n    const triggerImg = container.querySelector(\".js--trigger-img\");\n    if (!triggerBtn || !triggerImg) return;\n\n    const showTriggerBtn = () => {\n      triggerBtn.classList.remove(\"is-hidden\");\n    };\n\n    if (triggerImg.complete) {\n      showTriggerBtn();\n    } else {\n      triggerImg.addEventListener(\"load\", showTriggerBtn);\n    }\n  });\n});\n\n// Get Vimeo video thumbnails\n\nexport const initVimeoThumbnails = () => {\n  const getVimeoThumbnail = async (videoId) => {\n    const url = `https://vimeo.com/api/oembed.json?url=https://player.vimeo.com/video/${videoId}&width=1920&height=1080`;\n    const imageUrl = fetch(url)\n      .then((response) => response.json())\n      .then((json) => json.thumbnail_url);\n\n    return await imageUrl;\n  };\n\n  const vimeoVideos = document.querySelectorAll(`.wp-video`);\n  if (vimeoVideos.length <= 0) {\n    return null;\n  }\n\n  Array.from(vimeoVideos).map(async (video) => {\n    const videoId = video.dataset[`videoid`];\n    const imageUrl = await getVimeoThumbnail(videoId);\n    const imageTag = document.createElement(`img`);\n    imageTag.src = imageUrl;\n\n    video.prepend(imageTag);\n  });\n};\n\ninit(() => {\n  initVimeoThumbnails();\n});\n"],"names":["$","init","modal","playerContainer","containers","getElements","container","triggerBtn","triggerImg","showTriggerBtn","newsTicker","animationDuration","articleContainer","articles","currentArticle","article","cardWidth","marginLeft","cycleArticles","offset","videoContainer","videos","currentVideo","resetVideos","video","cycleVideos","analyses","currentAnalysis","cycleAnalyses","removeClass","addClass","seminars","currentSeminar","seminarInBottom","resetSeminars","seminar","i","scale","cycleSeminars","trackAjax","form","e","data","initChoices","step1","rangeSlider","rangeInput","columnsWrapper","packages","columnSections","discountTooltip","discountPercentageEl","customPlanMessageOpen","seatAmount","priceTimer","ValidateBasePackage","lineItems","ValidateFlexPackage","ValidatePremiumPackage","playCategories","item","analysisCategories","ValidateOrder","orderJSON","pkg","buildOrder","pricePackage","products","pricingPackageID","product","checkbox","productId","legalAreas","option","newLineItem","getPrices","getPackagePrice","packagePriceContainer","packagePrice","xmlhttp","response","createOrder","loadingSpinner","el","Cookies","showValidationNotice","event","enableLegalAreas","legalAreaDropdown","instance","parentPackage","addonPrice","addProductListeners","updateTooltip","updateSeatAmount","hideValidationNotice","targetColumn","tooltips","hideAllTooltips","tooltip","step2","purchaseForm","validateOrderType","formContainer","orderedByType","orderedById","companyId","userId","monthlyPeriodContainer","monthlyPeriodInput","invoiceMethodContainer","invoiceMethodInput","usersAmount","pricePerUser","totalPrice","discount","discountedPrice","updateAmount","updateUserInformation","adjustUserAmount","inc","increase","modals","initVimeoThumbnails","getVimeoThumbnail","videoId","url","json","vimeoVideos","imageUrl","imageTag"],"mappings":"sKAEA,OAAO,iBAAiB,OAAQ,IAAM,CAChC,SAAS,eAAe,WAAW,GACrB,SAAS,cAAc,YAAY,EAC3C,iBAAiB,kBAAmB,IAAM,CAChDA,EAAE,MAAM,EAAE,IAAI,SAAU,UAAU,CACxC,CAAK,CAEL,CAA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