{"version":3,"sources":["_scripts.es6.js","../templates/views/_acclaim_db_filters.es6.js","../templates/components/jfe-more-less-toggle/_jfe-more-less-toggle.es6.js","../templates/components/toggle-switch/toggle-switch.es6.js","../templates/global/helpers/_jfe_helpers.es6.js","../templates/paragraph/jfe-accordion/_jfe-accordion.es6.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACvBA,CAAC,UAAU,CAAV,EAAa,MAAb,EAAqB;AACpB,EAAA,MAAM,CAAC,SAAP,CAAiB,cAAjB,GAAkC;AAChC,IAAA,MAAM,EAAE,gBAAU,OAAV,EAAmB,QAAnB,EAA6B;AACnC;AACA,MAAA,CAAC,CAAC,QAAD,CAAD,CAAY,QAAZ,CAAqB,MAArB,EAA6B,MAA7B,GAFmC,CAGnC;;AACA,MAAA,CAAC,CAAC,mBAAD,CAAD,CAAuB,KAAvB,CAA6B,UAAU,CAAV,EAAa;AACxC,QAAA,CAAC,CAAC,4BAAD,CAAD,CAAgC,KAAhC;AACD,OAFD,EAJmC,CAOnC;;AACA,MAAA,CAAC,CAAC,sBAAD,CAAD,CAA0B,MAA1B,CAAiC,UAAS,CAAT,EAAY;AAC3C,YAAI,QAAQ,GAAG,CAAC,CAAC,MAAF,CAAS,KAAxB;AACA,YAAI,mBAAmB,6BAAsB,CAAC,CAAC,MAAF,CAAS,EAA/B,CAAvB;AACA,QAAA,OAAO,CAAC,GAAR,6BAAiC,QAAjC;AACA,QAAA,OAAO,CAAC,GAAR,uBAA2B,CAAC,CAAC,MAAF,CAAS,EAApC;AACA,QAAA,CAAC,CAAC,mBAAD,CAAD,CAAuB,GAAvB,CAA2B,QAA3B,EAAqC,OAArC,CAA6C,gBAA7C;AACD,OAND,EARmC,CAenC;;AACA,UAAI,CAAC,CAAC,wBAAD,CAAD,CAA4B,MAAhC,EAAwC;AACtC,QAAA,CAA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CAAW,aAAX,GAA2B,OAAO,CAAC,YAAnC;;AACA,QAAI,CAAC,EAAE,CAAC,SAAH,CAAa,QAAb,CAAsB,SAAtB,CAAL,EAAuC;AACrC,MAAA,EAAE,CAAC,SAAH,CAAa,GAAb,CAAiB,WAAjB;AACD;;AACD,IAAA,EAAE,CAAC,SAAH,CAAa,GAAb,CAAiB,cAAjB;AACA,IAAA,MAAM,CAAC,SAAP,CAAiB,GAAjB,CAAqB,cAArB;AACA,IAAA,MAAM,CAAC,gBAAP,CAAwB,OAAxB,EAAiC,eAAjC;AACD,GAVD;AAYA,EAAA,MAAM,CAAC,gBAAP,CAAwB,QAAxB,EAAkC,qBAAlC;AACA,EAAA,MAAM,CAAC,gBAAP,CAAwB,mBAAxB,EAA6C,qBAA7C;AACD,CApED;;AAsEA,CAAC,UAAU,MAAV,EAAkB;AACjB,EAAA,MAAM,CAAC,SAAP,CAAiB,YAAjB,GAAgC;AAC9B,IAAA,MAAM,EAAE,gBAAU,OAAV,EAAmB,QAAnB,EAA6B;AACnC,MAAA,cAAc,CAAC,OAAD,CAAd;AACD;AAH6B,GAAhC;AAKD,CAND,EAMG,MANH","file":"scripts.js","sourcesContent":["/**\n * @file\n * Primary JS file for theme (note component/brick js will load below this file)\n */\n\n///// Starter with jQuery /////\n// note: to use this you also have to add core/jquery dependency\n// (function ($, Drupal) {\n// Drupal.behaviors.myModuleBehavior = {\n// attach: function (context, settings) {\n// $('input.myCustomBehavior', context).once('myCustomBehavior').each(function () {\n// // Apply the myCustomBehaviour effect to the elements only once.\n// });\n// }\n// };\n// })(jQuery, Drupal);\n\n///// Starter with vanillaJS /////\n// (function (Drupal) {\n// Drupal.behaviors.myModuleBehavior = {\n// attach: function (context, settings) {\n// // Enter code here.\n// }\n// };\n// })(Drupal);","\n(function ($, Drupal) {\n Drupal.behaviors.acclaimFilters = {\n attach: function (context, settings) {\n // show filter fields and intiate chosen.\n $('select').addClass('show').chosen();\n // activate apply button\n $('.js-filter-submit').click(function (e) {\n $('#edit-submit-acclaim-pages').click();\n });\n // make changes to top affect the sidebar values\n $('.view__header select').change(function(e) {\n var newValue = e.target.value;\n var correspondingSelect = `.view__filters #${e.target.id}`;\n console.log(`newSelectedValue: ${newValue}`);\n console.log(`selected in ${e.target.id}`);\n $(correspondingSelect).val(newValue).trigger(\"chosen:updated\"); \n });\n // show-hide filters\n if ($('.acclaim--show-filters').length) {\n $('.js-filter-drawer-trigger').click(function(e) {\n $('.view__filters').toggleClass('view__filters--shown');\n });\n } else {\n $('.js-filter-drawer-trigger').hide();\n }\n }\n };\n\n Drupal.behaviors.sendEmail = {\n attach: function (context, settings) {\n $('.js-email-url').click(function() {\n const encurl = encodeURIComponent(window.location);\n const link = `mailto:?subject=JFW Acclaim Database Link&body=${encurl}`;\n window.location = link;\n });\n }\n };\n})(jQuery, Drupal);","/* eslint-disable no-console */\n/**\n * Additional functionality for jfe-more-less-toggle.\n * @param {string} collapseHeight - How much of content should be\n * shown when collapsed (in css terms)\n * @param {boolean} ease - Whether to animate the expanding of content.\n * @param {element} context - context of command (default whole document)\n *\n * To use, add\n * import moreLessToggle from '../../source/_patterns/04-components/jfe-more-less-toggle/_jfe-more-less-toggle.es6';\n * to top of js file\n * add\n * moreLessToggle();\n * to domready\n */\n\nfunction moreLessToggleInit (\n collapseHeight = '2.5em',\n ease = true,\n context = document\n) {\n //alert('jfe-more-less-toggle is loading!');\n\n // setup functions\n const toggleContent = el => {\n const wrapper = el.parentElement;\n const isCollapsed = wrapper.classList.contains('is-collapsed');\n const content = wrapper.querySelector('.jfe-more-less-toggle__content');\n const moreText = el.dataset.toggleTextMore;\n const lessText = el.dataset.toggleTextLess;\n\n console.log('toggleContent');\n if (content && isCollapsed) {\n wrapper.classList.add('is-open');\n wrapper.classList.remove('is-collapsed');\n if (ease) {\n content.style.maxHeight = `${el.dataset.toggleHeight}px`;\n } else {\n content.style.maxHeight = 'none';\n }\n el.innerText = lessText;\n } else {\n wrapper.classList.add('is-collapsed');\n wrapper.classList.remove('is-open');\n content.style.maxHeight = collapseHeight;\n el.innerText = moreText;\n }\n };\n\n const toggleContentEvent = evt => {\n evt.preventDefault();\n toggleContent(evt.target);\n evt.target.blur();\n return false;\n };\n\n const toggleEls = context.querySelectorAll(\n '.jfe-more-less-toggle__trigger:not(.processed)'\n );\n // TODO: Hide trigger and leave open if height < collapsedHeight\n [].forEach.call(toggleEls, toggle => {\n const toggleContentHeight = toggle.parentElement.querySelector(\n '.jfe-more-less-toggle__content'\n ).clientHeight;\n toggle.dataset.toggleHeight = toggleContentHeight;\n if (toggle.parentElement.classList.contains('is-open')) {\n // leave open\n } else {\n toggleContent(toggle);\n }\n\n toggle.addEventListener('click', toggleContentEvent);\n toggle.classList.add('processed');\n });\n // TODO: Add listeners to resize and orientation change: recalculate heights\n}\n\n(function (Drupal) {\n Drupal.behaviors.jfeMoreLessToggles = {\n attach: function (context, settings) {\n moreLessToggleInit(\"3em\", true, context);\n }\n };\n})(Drupal);\n\n\n","\n(function ($, Drupal) {\n Drupal.behaviors.toggleSwitch = {\n attach: function (context, settings) {\n\n // only show if on main acclaim search page\n if ($('.acclaim--rows-of-cards').length) {\n // initialize toggle switch\n $(context).find('.js-toggle-switch').click(function(e) {\n if ($(this).hasClass('toggle-switch--off')) {\n $(this).addClass('toggle-switch--on').removeClass('toggle-switch--off');\n $('.acclaim--rows-of-cards').addClass('show-reviews');\n setCookie('showReviews', 1, 1);\n } else {\n $(this).addClass('toggle-switch--off').removeClass('toggle-switch--on');\n $('.acclaim--rows-of-cards').removeClass('show-reviews');\n setCookie('showReviews', 0, 0);\n }\n });\n // check cookie and click toggle if found;\n if (getCookie('showReviews') == 1) {\n $(context).find('.js-toggle-switch').click();\n }\n } else {\n // no need to show\n $('.js-toggle-switch').hide();\n }\n\n function setCookie(cname, cvalue, exdays) {\n const d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n let expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }\n\n function getCookie(cname) {\n let name = cname + \"=\";\n let decodedCookie = decodeURIComponent(document.cookie);\n let ca = decodedCookie.split(';');\n for(let i = 0; i {\n Cookies.set('ISLEGAL', 'faked', {\n expires: 1,\n path: '/',\n sameSite: 'strict',\n secure: true,\n });\n};","const initAccordions = (context = document) => {\n const spacer = 50;\n\n const accordions = context.querySelectorAll(\n '.jfe-accordion:not(.js-processed)'\n );\n\n const getAccordionTop = el => {\n // eslint-disable-next-line no-param-reassign\n for (; el && el !== document; el = el.parentNode) {\n if (el.classList.contains('jfe-accordion')) {\n return el;\n }\n }\n return null;\n };\n\n const toggleAccordion = evt => {\n const accordion = getAccordionTop(evt.target);\n // eslint-disable-next-line no-console\n console.log(evt.target, accordion);\n const drawer = accordion.querySelector('.jfe-accordion__content-drawer');\n const content = accordion.querySelector('.jfe-accordion__content-wrapper');\n const contentHeight = content.clientHeight + spacer;\n if (accordion.classList.contains('is-closed')) {\n // open it\n accordion.classList.remove('is-closed');\n accordion.classList.add('is-open');\n drawer.style.maxHeight = `${contentHeight}px`;\n } else {\n // close it\n accordion.classList.add('is-closed');\n accordion.classList.remove('is-open');\n drawer.style.maxHeight = 0;\n }\n };\n\n // update accordion height function\n const updateAccordionHeight = evt => {\n accordions.forEach(accordion => {\n if (accordion.classList.contains('is-open')) {\n const content = accordion.querySelector(\n '.jfe-accordion__content-wrapper'\n );\n const contentHeight = content.clientHeight + spacer;\n const drawer = accordion.querySelector(\n '.jfe-accordion__content-drawer'\n );\n drawer.style.maxHeight = `${contentHeight}px`;\n }\n });\n };\n\n // setup accordions\n accordions.forEach(el => {\n const button = el.querySelector('button.jfe-accordion__trigger');\n const content = el.querySelector('.jfe-accordion__content-wrapper');\n el.dataset.contentHeight = content.clientHeight;\n if (!el.classList.contains('is-open')) {\n el.classList.add('is-closed');\n }\n el.classList.add('js-processed');\n button.classList.add('js-activated');\n button.addEventListener('click', toggleAccordion);\n });\n\n window.addEventListener('resize', updateAccordionHeight);\n window.addEventListener('orientationchange', updateAccordionHeight);\n};\n\n(function (Drupal) {\n Drupal.behaviors.jfeAccordion = {\n attach: function (context, settings) {\n initAccordions(context);\n }\n };\n})(Drupal);\n"]}