{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./assets/scripts/contact.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","window","jQuery","change","addClass","hide","dontStopBelieving","this","val","show","document","on","dropdown","region","chosen_journey","parents","find","css","getElementById","options","selectedIndex","dataset","fake","closest","prev","text","each","is","tag","append","hasClass","next","tag_value","data","prop","remove","fadeIn","baa","cDropdown","selectedRam","checkboxes","querySelectorAll","selectedValues","forEach","checkbox","push","hasAttribute","getAttribute","trim","some","toLowerCase","includes","selectedId","showRamContact"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAA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AASQ,eAAe,aAEpCqB,EAAcD,EAAUnB,QAAQmB,EAAUlB,eAE1CoB,EAAa9B,SAAS+B,iBAAiB,8CAEzCC,EAAiB,GAOrB,GALAF,EAAWG,SAAQ,SAASC,GACxBF,EAAeG,KAAKD,EAAS3D,UAI7BsD,GAAeA,EAAYO,aAAa,eAAmE,KAAlDP,EAAYQ,aAAa,cAAcC,QAAmE,MAAlDT,EAAYQ,aAAa,cAAcC,OAAgB,CAK1K,GAF0BN,EAAeO,MAAK,SAAAhE,GAAK,OAAIA,EAAMiE,cAAcC,SAAS,iBAelF,GAAIZ,GAAeA,EAAYO,aAAa,aAA+D,KAAhDP,EAAYQ,aAAa,YAAYC,QAAiE,MAAhDT,EAAYQ,aAAa,YAAYC,OAAgB,CAClK,IAAII,EAAab,EAAYQ,aAAa,YAAYC,OACtDhD,EAAE,2CAA6CoD,EAAa,MAAM3C,YAIpET,EAAE,kDAAkDS,YAjBrD,GAAI8B,GAAeA,EAAYO,aAAa,eAAmE,KAAlDP,EAAYQ,aAAa,cAAcC,QAAmE,MAAlDT,EAAYQ,aAAa,cAAcC,OAAgB,CACzK,IAAII,EAAab,EAAYQ,aAAa,cAAcC,OACxDhD,EAAE,2CAA6CoD,EAAa,MAAM3C,YAIpET,EAAE,kDAAkDS,YAiBrD,GAAK8B,GAAeA,EAAYO,aAAa,aAA+D,KAAhDP,EAAYQ,aAAa,YAAYC,QAAiE,MAAhDT,EAAYQ,aAAa,YAAYC,OAAgB,CAC1K,IAAII,EAAab,EAAYQ,aAAa,YAAYC,OACtDhD,EAAE,2CAA6CoD,EAAa,MAAM3C,YAKlET,EAAE,kDAAkDS,OAnEtD4C","file":"/scripts/contact.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 = 4);\n","const $ = window.jQuery;\n\n// button choices to begin journey\n$('#cfChoices input[type=\"radio\"]').change(function() {\n $('#cfChoices').addClass('journey-selected');\n $('.m-contact-journey__form-wrapper').hide(); // in case user had already chosen different form, hide it\n const dontStopBelieving = $(this).val();\n $('.m-contact-journey__form-wrapper[data-journey=\"' + dontStopBelieving + '\"]').show(); // show chosen form\n});\n\n// Bind to the change event of fields that affect the submit button visibility\n$(document).on('change', '.ginput_container_select select', function() {\n // get choice from earlier\n const chosen_journey = $('#cfChoices input[type=\"radio\"]:checked').val();\n if ( chosen_journey != 'cfNs' && chosen_journey != 'steve_perry') { // do not show footer yet on new sales inquiry\n $(this).parents('.m-contact-journey__form-wrapper').find('.gform_footer').css('opacity', 1);\n }\n\n if ( chosen_journey == 'cfHs' ) { // help and support\n showHelpContact();\n }\n \n});\n\n// things below are for the new sales inquiry form\n\n// checkboxes on new sales inquiry\n$('.gf-contact-journey input[type=\"checkbox\"]').change(function() {\n let fake = 'no'; // only show done with selection button if something is checked\n $(this).closest('.ginput_container_checkbox').prev('legend').text('');\n $(this).closest('.ginput_container_checkbox').find('input[type=\"checkbox\"]').each(function() {\n if ($(this).is(':checked')) {\n let tag = $(this).val();\n $(this).closest('.ginput_container_checkbox').prev('legend').append('<span data-tag=\"' + tag + '\">' + tag + '</span>');\n fake = 'yes';\n }\n if (fake === 'yes') {\n $('.fake-button').css('display', 'inline-block');\n } \n else {\n $('.fake-button').hide();\n }\n })\n});\n// show checkbox choices after clicking the fake dropdown\n$('.gf-contact-journey .gfield--type-checkbox legend:not(.legend-opened').on('click', function() {\n if ( !$(this).hasClass('legend-fulfilled') ) {\n $(this).next('.ginput_container_checkbox').show();\n }\n});\n// tags above the new sales inquiry checkbox area\n$('.gf-contact-journey .gfield--type-checkbox legend').on('click', 'span', function() {\n let fake = 'no';\n let tag_value = $(this).data('tag');\n // uncheck the box this span tag corresponds to\n $(this).closest('.gfield--type-checkbox').find('input[type=\"checkbox\"][value=\"' + tag_value + '\"]').prop('checked', false);\n // if checked boxes remain, continue to show button, if not, hide it\n $(this).closest('.gfield--type-checkbox').find('input[type=\"checkbox\"]').each(function() {\n if ($(this).is(':checked')) {\n fake = 'yes';\n }\n });\n if ( fake === 'yes' ) {\n $('.fake-button').css('display', 'inline-block');\n } \n else {\n $('.fake-button').hide();\n }\n // remove this tag\n $(this).remove();\n \n});\n\n$('#doneSelection').on('click', function() {\n $('.new-inquiry-hidden').fadeIn(130);\n $(this).closest('.gfield--type-html').prev('.gfield--type-checkbox').find('legend').css('background-color', '#e31b23').addClass('legend-fulfilled');\n $(this).closest('.gfield--type-html').prev('.gfield--type-checkbox').find('.ginput_container_checkbox').hide();\n $(this).parents('form').find('.gform_footer').css('opacity', 1);\n $(this).hide();\n showRamContact();\n});\n\n// help and support path\nfunction showHelpContact() {\n const dropdown = document.getElementById('input_5_6');\n // Get the selected option\n const selectedOption = dropdown.options[dropdown.selectedIndex];\n // Get the region from selected option\n const region = selectedOption.dataset.region;\n // Show the contact info for the region\n $('.cf-help-contact').hide(); // hide them all, in case one was already selected previously\n $('.cf-help-contact[data-region=\"' + region + '\"]').show(); // show the selected region contact info\n}\n\n// new sales inquiry\nfunction showRamContact(baa) {\n const cDropdown = document.getElementById('input_4_6');\n // get selected country option\n const selectedRam = cDropdown.options[cDropdown.selectedIndex];\n // get selected product(s)\n const checkboxes = document.querySelectorAll('#input_4_22 input[type=\"checkbox\"]:checked');\n // Create an array to store the selected values\n let selectedValues = [];\n // Loop through the selected checkboxes and get their values\n checkboxes.forEach(function(checkbox) {\n selectedValues.push(checkbox.value);\n });\n\n // if selected country has ram-2 listed\n if (selectedRam && selectedRam.hasAttribute('data-ram-2') && selectedRam.getAttribute('data-ram-2').trim() !== '' && selectedRam.getAttribute('data-ram-2').trim() !== '-') {\n // check if soft bread & buns was checked\n // Check if any string contains \"soft bread\" (case insensitive)\n const containsSoftBread = selectedValues.some(value => value.toLowerCase().includes('soft bread'));\n\n if ( !containsSoftBread) { // show ram-2\n // get ram info\n if (selectedRam && selectedRam.hasAttribute('data-ram-2') && selectedRam.getAttribute('data-ram-2').trim() !== '' && selectedRam.getAttribute('data-ram-2').trim() !== '-') {\n let selectedId = selectedRam.getAttribute('data-ram-2').trim();\n $('.gf-contact-info__rep-wrapper[data-rep=\"' + selectedId + '\"]').show();\n }\n // for some reason there is a ram-2 but no ram, so show generic card\n else {\n $('.gf-contact-info__rep-wrapper[data-rep=\"nope\"]').show();\n }\n }\n else { // soft bread & buns is checked so show ram from column 1\n // get ram info\n if (selectedRam && selectedRam.hasAttribute('data-ram') && selectedRam.getAttribute('data-ram').trim() !== '' && selectedRam.getAttribute('data-ram').trim() !== '-') {\n let selectedId = selectedRam.getAttribute('data-ram').trim();\n $('.gf-contact-info__rep-wrapper[data-rep=\"' + selectedId + '\"]').show();\n }\n // for some reason there is a ram-2 but no ram, so show generic card\n else {\n $('.gf-contact-info__rep-wrapper[data-rep=\"nope\"]').show();\n }\n }\n }\n\n // if selected country only has ram listed (no ram-2)\n else if ( selectedRam && selectedRam.hasAttribute('data-ram') && selectedRam.getAttribute('data-ram').trim() !== '' && selectedRam.getAttribute('data-ram').trim() !== '-') {\n let selectedId = selectedRam.getAttribute('data-ram').trim();\n $('.gf-contact-info__rep-wrapper[data-rep=\"' + selectedId + '\"]').show();\n }\n\n // if selected country has neither, show generic card\n else {\n $('.gf-contact-info__rep-wrapper[data-rep=\"nope\"]').show();\n }\n \n}"],"sourceRoot":""}