{"version":3,"file":"default/js/privacy.js","sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/org_arlo/cartridge/client/default/js/config/slickConfigs.js","webpack:///./cartridges/org_arlo/cartridge/client/default/js/privacy.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./cartridges/org_arlo/cartridge/client/default/js/privacy.js\");\n","'use strict';\n\n/**\n * Reusable slick carousel configurations\n * @example - $('.product-carousel').slick(slickConfigs.pdp)\n */\n\nmodule.exports = {\n hero: {\n autoplay: true,\n autoplaySpeed: 5000,\n easing: 'swing',\n infinite: false,\n speed: 800,\n dots: true,\n arrows: true,\n slidesToShow: 1,\n slidesToScroll: 1\n },\n\n productTiles: {\n infinite: false,\n speed: 300,\n dots: false,\n arrows: true,\n slidesToShow: 3.1,\n slidesToScroll: 3,\n responsive: [\n {\n breakpoint: 900,\n settings: {\n slidesToShow: 1.5,\n slidesToScroll: 1,\n dots: false,\n arrows: true\n }\n },\n {\n breakpoint: 480,\n settings: {\n slidesToShow: 1.1,\n slidesToScroll: 1,\n dots: true,\n arrows: false\n }\n }\n ]\n },\n\n pdp: {\n // infinite: false,\n // speed: 400,\n dots: true,\n arrows: true// ,\n // slidesToShow: 1,\n },\n\n pdpNew: {\n asNavFor: '[data-product-thumbnail-slider]',\n centerMode: false,\n variableWidth: false,\n infinite: true,\n draggable: false,\n arrows: true,\n dots: false,\n slidesToScroll: 1,\n slidesToShow: 1,\n rows: 0,\n responsive: [\n {\n breakpoint: 480,\n settings: {\n arrows: false,\n dots: true\n }\n }\n ]\n },\n\n pdpThumbnails: {\n asNavFor: '[data-product-media-slider]',\n centerMode: false,\n slidesToShow: $('.product-overview__gallery-thumbnail ').find('img').length,\n infinite: true,\n vertical: true,\n draggable: false,\n arrows: false,\n dots: false,\n focusOnSelect: true,\n slidesToScroll: 1,\n rows: 0\n },\n privacySlider: {\n dots: true,\n arrows: false,\n settings: 'unslick',\n responsive: [{\n breakpoint: 960\n }]\n }\n};\n","'use strict';\n// var cleave = require('./components/cleave');\nvar slickConfigs = require('../js/config/slickConfigs');\n\n\n/**\n * Validate Phone input\n * @param {Object} input - input phone\n * @returns {Object} thisInput\n */\nfunction phoneFormatAusMobile(input) {\n // Strip all characters from the input except digits\n var thisInput = input;\n thisInput = thisInput.replace(/\\D/g, '');\n\n // Trim the remaining input to ten characters, to preserve phone number format\n thisInput = thisInput.substring(0, 10);\n\n return thisInput;\n}\n\n/**\n * Validate Phone input\n * @param {Object} input - input phone\n * @returns {Object} thisInput\n */\nfunction phoneFormatAus(input) {\n // Strip all characters from the input except digits\n var thisInput = input;\n thisInput = thisInput.replace(/\\D/g, '');\n\n // Trim the remaining input to ten characters, to preserve phone number format\n thisInput = thisInput.substring(0, 10);\n\n // Based upon the length of the string, we add formatting as necessary\n var size = thisInput.length;\n\n if (size === 0) {\n thisInput = input;\n } else if (size < 3) {\n thisInput = '(' + thisInput;\n } else if (size < 7) {\n thisInput = '(' + thisInput.substring(0, 2) + ') ' + thisInput.substring(2, 6);\n } else {\n thisInput = '(' + thisInput.substring(0, 2) + ') ' + thisInput.substring(2, 6) + '-' + thisInput.substring(6, 10);\n }\n\n return thisInput;\n}\n\n/**\n * Add Formatting on Phone Number\n * @param {Object} phoneFieldSelector - field selector\nfunction phoneNumberFormat(phoneFieldSelector) {\n if ($('input[name$=aus]').val() !== 'AU') {\n cleave.handleFormatPhoneNumber(phoneFieldSelector);\n }\n}*/\n\n/**\n * Add Validation on Name\n * @param {Object} nameField - field selector\n */\nfunction nameValidation(nameField) {\n $(nameField).addClass('is-invalid');\n var parent = $(nameField).closest('.form-float-container');\n var invalid = $(parent).find('.invalid-feedback');\n $(invalid).addClass('is-invalid').text('Digits are not allowed.');\n}\n\n/**\n * Add Validation on Comments\n * @param {Object} commentField - field selector\n * @param {string} regexError - string\n */\nfunction commentValidation(commentField, regexError) {\n $(commentField).addClass('is-invalid');\n var parent = $(commentField).closest('.form-float-container');\n var invalid = $(parent).find('.invalid-feedback');\n if (regexError && regexError === 'true') {\n $(invalid).addClass('is-invalid').text('Only text is allowed. Remove all special characters except \" . \"');\n } else {\n $(invalid).addClass('is-invalid').text('Please fill out this field.');\n }\n}\n\n$(document).ready(function () {\n /* if ($('#PhoneNumber')) {\n phoneNumberFormat($('#PhoneNumber'));\n } */\n\n // eslint-disable-next-line require-jsdoc\n function privacySlickSlider() {\n $('.privacySlider').slick(slickConfigs.privacySlider);\n }\n\n // eslint-disable-next-line require-jsdoc\n function privacyDestroySlickSlider() {\n if ($('.privacySlider').hasClass('slick-initialized')) {\n $('.privacySlider').slick('unslick');\n }\n }\n\n if ($(window).width() < 960) {\n privacySlickSlider();\n }\n\n $(window).on('resize', function () {\n if ($(window).width() < 960) {\n privacySlickSlider();\n } else {\n privacyDestroySlickSlider();\n }\n });\n\n var urlParams = new URLSearchParams(window.location.search);\n var anyMsg = urlParams.get('msg');\n if (anyMsg === 'success' || anyMsg === 'error') {\n $('body,html').animate({\n scrollTop: $('.privacy-form').offset().top\n }, 800);\n\n if (anyMsg === 'success') {\n $('.privacy-form__result').addClass('alert alert-success').text('Submission Successful');\n } else {\n $('.privacy-form__result').addClass('alert alert-danger').text('Oops! something went wrong. Please try again');\n }\n }\n\n var regexp = /\\d/;\n $('.privacy-form__submit').off('click').on('click', function (e) {\n var firstName = $('#FirstName');\n var lastName = $('#LastName');\n var comment = $('#Comments');\n var firstNameVal = $(firstName).val();\n var lastNameVal = $(lastName).val();\n var commentVal = $(comment).val();\n\n if (regexp.test(firstNameVal)) {\n e.preventDefault();\n nameValidation(firstName);\n }\n if (regexp.test(lastNameVal)) {\n e.preventDefault();\n nameValidation(lastName);\n }\n if (!commentVal || !commentVal.trim()) {\n commentValidation(comment);\n } else {\n var commentsRegex = /[^A-za-z0-9. ]/g;\n if (commentsRegex.test(commentVal)) {\n commentValidation(comment, 'true');\n e.preventDefault();\n }\n }\n if ($(\".js-form-checkboxes-ctnr input[type='checkbox']:checked\").length) {\n $(\".js-form-checkboxes-ctnr input[type='checkbox']:checked\").each(function () {\n $(this).val('true');\n });\n }\n });\n\n $(document).on('click', '.js-Back-to-Top', function () {\n $('html,body').animate({\n scrollTop: 0\n }, 1000);\n });\n\n $('.privacyWithArlo-list li').click(function (e) {\n e.preventDefault();\n var url = $(this).find('a').attr('href');\n window.open(url, '_blank');\n });\n});\n\n/**\n * listener for phoneFormat\n * @param {event} keyup - listener\n */\n$('#PhoneNumber').on('change paste keyup', function () {\n var phoneNumber = document.getElementById('PhoneNumber');\n // var charCode = (evt.which) ? evt.which : evt.keyCode;\n var aus = $('input[name=aus]').val();\n if (aus === 'AU') {\n if (phoneNumber.value.substring(0, 2) === '04' || phoneNumber.value.substring(0, 3) === '(04') {\n phoneNumber.value = phoneFormatAusMobile(phoneNumber.value);\n } else {\n phoneNumber.value = phoneFormatAus(phoneNumber.value);\n }\n }\n});\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpGA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;A","sourceRoot":""}