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AAKiB,WAAWM,uBAApBD,qBACAD,OACKG,EAAL,EAAYA,EAAZ,EAAoBA,IAChBF,EAAAA,GAAAA,gBAAAA,SAEJtB,KAAA,yCACA,MAGRmB,EAAAA,WAEJR,EAAAA,YAAAA,GAEJN,EAAAA,GAAAA,YAAAA,GACAK,EAAAA,iBAAAA,SAA4B,SAAUI,GAGlCA,EAAAA,kBACAW,EAAAA,MACAzB,KAAA,sDACAA,KAAA,kDAGR,cAGI,cAKI0B,EALJ,GAUA,IAJArB,EAAIC,SAAAA,uBAAJD,gBACAiB,EAAIhB,SAAAA,uBAAJgB,mBACAK,EAAKtB,EAALsB,OACAN,EAAKC,EAALD,OACKd,EAAL,EAAYA,EAAZ,EAAoBA,IACZqB,GAASN,EAAbf,GACImB,EAAAA,KAAAA,GAEAJ,EAAAA,GAAAA,UAAAA,OAAAA,8BAGR,IAAKf,EAAL,EAAYA,EAAZ,EAAoBA,IACZmB,EAAAA,QAAJnB,IACIF,EAAAA,GAAAA,UAAAA,IAAAA,yBAKZC,SAAAA,iBAAAA,QAAAA,O,EA3GFP,GAgHN,IAAIA,G,iBChHJ8B,EAAOC,QAAUC,OAAe,S","sources":["webpack://sage/./resources/scripts/modules/modal-form.js","webpack://sage/external window \"jQuery\""],"sourcesContent":["class modalPopup {\n constructor() {\n this.customSelect();\n this.modalInit();\n }\n\n modalInit() {\n $('#request-form').on( 'click', function(){\n var name = $( '#your-name' ).val();\n var email = $( '#your-email' ).val();\n if ( name && email ) {\n $('.modal-request-form').addClass('open');\n $( '#your-name-popup' ).val( name );\n $( '#your-email-popup' ).val( email );\n }\n }); \n\n $('.modal-request-form__close').on( 'click', function(){\n $('.modal-request-form').removeClass('open');\n });\n }\n\n customSelect() {\n var x, i, j, l, ll, selElmnt, a, b, c;\n /*look for any elements with the class \"custom-select\":*/\n x = document.getElementsByClassName('custom-select-partner');\n l = x.length;\n for (i = 0; i < l; i++) {\n selElmnt = x[i].getElementsByTagName('select')[0];\n ll = selElmnt.length;\n /*for each element, create a new DIV that will act as the selected item:*/\n a = document.createElement('DIV');\n a.setAttribute('class', 'select-selected position-relative');\n a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;\n x[i].appendChild(a);\n /*for each element, create a new DIV that will contain the option list:*/\n b = document.createElement('DIV');\n b.setAttribute('class', 'select-items select-items--is-hide');\n for (j = 1; j < ll; j++) {\n /*for each option in the original select element,\n create a new DIV that will act as an option item:*/\n c = document.createElement('DIV');\n c.innerHTML = selElmnt.options[j].innerHTML;\n c.setAttribute( 'data-value', selElmnt.options[j].getAttribute('value') );\n c.addEventListener('click', function (e) {\n /*when an item is clicked, update the original select box,\n and the selected item:*/\n var y, i, k, s, h, sl, yl, currentText;\n s = this.parentNode.parentNode.getElementsByTagName('select')[0];\n sl = s.length;\n h = this.parentNode.previousSibling;\n for (i = 0; i < sl; i++) {\n if (s.options[i].innerHTML == this.innerHTML) {\n s.selectedIndex = i;\n currentText = this.innerHTML;\n currentText = ( '—' == currentText ) ? 'Filter' : currentText;\n h.innerHTML = currentText;\n y = this.parentNode.getElementsByClassName('same-as-selected');\n yl = y.length;\n for (k = 0; k < yl; k++) {\n y[k].removeAttribute('class');\n }\n this.setAttribute('class', 'same-as-selected');\n break;\n }\n }\n h.click();\n });\n b.appendChild(c);\n }\n x[i].appendChild(b);\n a.addEventListener('click', function (e) {\n /*when the select box is clicked, close any other select boxes,\n and open/close the current select box:*/\n e.stopPropagation();\n closeAllSelect(this);\n this.nextSibling.classList.toggle('select-items--is-hide');\n this.classList.toggle('select-selected--is-active');\n });\n }\n function closeAllSelect(elmnt) {\n /*a function that will close all select boxes in the document,\n except the current select box:*/\n var x,\n y,\n i,\n xl,\n yl,\n arrNo = [];\n x = document.getElementsByClassName('select-items');\n y = document.getElementsByClassName('select-selected');\n xl = x.length;\n yl = y.length;\n for (i = 0; i < yl; i++) {\n if (elmnt == y[i]) {\n arrNo.push(i);\n } else {\n y[i].classList.remove('select-selected--is-active');\n }\n }\n for (i = 0; i < xl; i++) {\n if (arrNo.indexOf(i)) {\n x[i].classList.add('select-items--is-hide');\n }\n }\n }\n /*if the user clicks anywhere outside the select box,then close all select boxes:*/\n document.addEventListener('click', closeAllSelect);\n }\n}\n\nexport default modalPopup;\nnew modalPopup();\n","module.exports = window[\"jQuery\"];"],"names":["modalPopup","this","$","name","email","l","x","document","i","ll","selElmnt","a","b","j","c","e","sl","s","parentNode","getElementsByTagName","h","currentText","yl","y","getElementsByClassName","k","closeAllSelect","arrNo","xl","elmnt","module","exports","window"],"sourceRoot":""}