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sC5D,IAAK0F,EAAIzB,QAAKE,GAAEY,EAAAjD,UAAUC,GACjE7B,OA5BhCyF,EAAAA,EAAAA,IAAA,CA4BsC,+BAA8B,2CACiBD,IAAMb,EAAAhE,kB,QACxDkB,GAAM,GA9BzC6D,M,mBAuB8Df,EAAAnE,aAW1CoD,EAAAA,EAAAA,IAIM,MAJN+B,EAIM,EAHF/B,EAAAA,EAAAA,IAES,UAFAG,QAAKC,EAAA,KAAAA,EAAA,qBAAEa,EAAA5B,cAAA4B,EAAA5B,gBAAA6B,UAAY,GAAE9E,MAAM,2BAA2B,aAAW,eAAc,qB,KE9BhH,E,8ECoBA,MAAM4F,GAAQC,EAAAA,EAAAA,KAERjG,EAAQkG,GAOR,OAAE5E,IAAW6E,EAAAA,EAAAA,IAAOnG,GAEpBoG,EAAe9E,EAAOpC,MAEtBmH,EAAcA,KAClBL,EAAMM,UAAUpH,OAAQqH,EAAAA,EAAAA,IAAQC,GAChCR,EAAMS,WAAW,E,8lCCrCnB,MAAMH,GAAY,UAEZI,GAAO,SAAI,GAEV,SAAST,IAMZ,OAJA,SAAY,KACRxI,SAASkJ,KAAKhJ,UAAUiJ,OAAO,WAAYF,EAAKxH,MAAM,IAGnD,CACHoH,YACAI,OAEAD,UAAW,IAAMC,EAAKxH,OAAQ,EAC9B2H,UAAW,IAAMH,EAAKxH,OAAQ,EAEtC,C","sources":["webpack://fwd-flex-frontend/./src/js/_helpers.js","webpack://fwd-flex-frontend/./src/js/partials/_float-labels.js","webpack://fwd-flex-frontend/./src/js/vuejs/stores/_general-store.js","webpack://fwd-flex-frontend/./node_modules/vue-loader/dist/exportHelper.js","webpack://fwd-flex-frontend/./src/js/vuejs/components/SearchModal.vue","webpack://fwd-flex-frontend/./src/js/vuejs/components/SearchModal.vue?57ac","webpack://fwd-flex-frontend/./src/js/vuejs/components/SearchModalButton.vue?a9b0","webpack://fwd-flex-frontend/./src/js/vuejs/components/SearchModalButton.vue","webpack://fwd-flex-frontend/./src/js/vuejs/composables/useModal.ts"],"sourcesContent":["export const getUrlParameter = (name) => {\r\n name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\r\n var regex = new RegExp('[\\\\?&]' + name + '=([^]*)');\r\n var results = regex.exec(location.search);\r\n return results === null ? '' : decodeURIComponent(results[1].replace(/\\+/g, ' '));\r\n};\r\n\r\nexport const formatCurrency = (number,locale = 'en-GB',currency = 'GBP') => {\r\n return new Intl.NumberFormat(locale, { style: 'currency', currency: currency }).format(number);\r\n}\r\n\r\nexport const findAncestor = (el, sel) => {\r\n while ((el = el.parentElement) && !((el.matches || el.matchesSelector).call(el,sel)));\r\n return el;\r\n}\r\n\r\nexport const addClass = (target,className) => {\r\n let el = typeof target === 'object' ? target : document.querySelector(target);\r\n el.classList.add(className);\r\n}\r\n\r\nexport const removeClass = (target,className) => {\r\n let el = typeof target === 'object' ? target : document.querySelector(target);\r\n el.classList.remove(className);\r\n}\r\n\r\nexport const hasClass = (target,className) => {\r\n let el = typeof target === 'object' ? target : document.querySelector(target);\r\n return el.classList.contains(className);\r\n}\r\n\r\nexport const toggleClass = (target,className) => {\r\n let el = typeof target === 'object' ? target : document.querySelector(target);\r\n if(!hasClass(el,className)) {\r\n el.classList.add(className);\r\n } else {\r\n el.classList.remove(className);\r\n }\r\n}\r\n\r\nexport const lockScroll = () => {\r\n addClass('html','noscroll');\r\n addClass('body','noscroll');\r\n};\r\n\r\nexport const unlockScroll = () => {\r\n removeClass('html','noscroll');\r\n removeClass('body','noscroll');\r\n};\r\n\r\nexport const toggleScroll = () => {\r\n const body = document.body;\r\n\r\n if (!body.classList.contains('noscroll')) {\r\n const scrollPosition = window.scrollY;\r\n body.style.setProperty('--scroll-position', `-${scrollPosition}px`);\r\n body.classList.add('noscroll');\r\n } else {\r\n const scrollPosition = parseInt(body.style.getPropertyValue('--scroll-position') || 0);\r\n body.classList.remove('noscroll');\r\n window.scrollTo(0, -scrollPosition);\r\n }\r\n};","import { addClass, removeClass, hasClass } from '../_helpers';\r\n\r\nexport const floatLabels = () => {\r\n let floatLabelsCollection = document.querySelectorAll('[data-float-labels]');\r\n\r\n for(let floatLabelsEl of [...floatLabelsCollection]) {\r\n let prefixClass = floatLabelsEl.dataset.floatLabelsClassPrefix || 'field',\r\n fieldSelectors = [\r\n '[type=text]',\r\n '[type=email]',\r\n '[type=password]',\r\n '[type=tel]',\r\n 'textarea',\r\n 'select',\r\n '[data-float-label]'\r\n ],\r\n fields = floatLabelsEl.querySelectorAll(fieldSelectors.join(','));\r\n\r\n setClasses(prefixClass,fields);\r\n }\r\n}\r\n\r\nconst setClasses = (prefixClass,fields) => {\r\n for(let field of fields) {\r\n let fieldParent = field.parentElement;\r\n if(hasClass(fieldParent,prefixClass)) {\r\n addClass(fieldParent,`${prefixClass}--floated-label`);\r\n\r\n if(isDirty(field)) {\r\n addClass(fieldParent, `${prefixClass}--floated-label-dirty`);\r\n } else {\r\n removeClass(fieldParent, `${prefixClass}--floated-label-dirty`);\r\n }\r\n\r\n field.addEventListener('input',() => {\r\n if(isDirty(field)) {\r\n addClass(fieldParent, `${prefixClass}--floated-label-dirty`);\r\n } else {\r\n removeClass(fieldParent, `${prefixClass}--floated-label-dirty`);\r\n }\r\n });\r\n\r\n field.placeholder = '';\r\n }\r\n }\r\n}\r\n\r\nconst isDirty = field => {\r\n return field.value !== null && field.value !== undefined && field.value !== '';\r\n}\r\n\r\n(() => {\r\n floatLabels();\r\n})();","import { defineStore } from 'pinia';\r\n\r\nexport const useGeneralStore = defineStore('generalStore', {\r\n state: () => ({\r\n isLoading: false,\r\n errorMessage: null\r\n }),\r\n actions: {\r\n updateIsLoading(isLoading) {\r\n this.isLoading = isLoading;\r\n },\r\n updateErrorMessage(message) {\r\n this.errorMessage = message;\r\n }\r\n },\r\n});","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// runtime helper for setting properties on components\n// in a tree-shakable way\nexports.default = (sfc, props) => {\n const target = sfc.__vccOpts || sfc;\n for (const [key, val] of props) {\n target[key] = val;\n }\n return target;\n};\n","\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n What are you looking for?\r\n \r\n \r\n \r\n Loading results...\r\n \r\n \r\n {{ result }}\r\n \r\n \r\n \r\n \r\n \r\n Search\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n","import { render } from \"./SearchModal.vue?vue&type=template&id=51133b56\"\nimport script from \"./SearchModal.vue?vue&type=script&lang=js\"\nexport * from \"./SearchModal.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import script from \"./SearchModalButton.vue?vue&type=script&setup=true&lang=js\"\nexport * from \"./SearchModalButton.vue?vue&type=script&setup=true&lang=js\"\n\nconst __exports__ = script;\n\nexport default __exports__","\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n","import { ref, watchEffect } from 'vue'\r\n\r\n// keep track of component to render\r\nconst component = ref();\r\n// keep track of whether to show modal\r\nconst show = ref(false);\r\n\r\nexport function useModal() {\r\n\r\n watchEffect(() => {\r\n document.body.classList.toggle('noscroll', show.value);\r\n });\r\n\r\n return {\r\n component,\r\n show,\r\n // methods to show/hide modal\r\n showModal: () => show.value = true,\r\n hideModal: () => show.value = false,\r\n }\r\n}"],"names":["addClass","target","className","document","querySelector","classList","add","removeClass","remove","hasClass","contains","floatLabels","floatLabelsCollection","querySelectorAll","floatLabelsEl","prefixClass","dataset","floatLabelsClassPrefix","fieldSelectors","fields","join","setClasses","field","fieldParent","parentElement","isDirty","addEventListener","placeholder","value","undefined","useGeneralStore","defineStore","state","isLoading","errorMessage","actions","updateIsLoading","this","updateErrorMessage","message","exports","sfc","props","__vccOpts","key","val","class","role","id","name","setup","store","storeToRefs","data","isOpen","results","search","arrowCounter","items","searchUrl","type","String","required","default","rootId","Number","isAsync","Boolean","watch","handler","oldValue","length","deep","methods","setResult","result","filterResults","filter","item","toLowerCase","indexOf","onChange","$emit","handleClickOutside","event","$el","onArrowDown","onArrowUp","onEnter","initSearchTerms","http","then","v","get","_ref","submitSearch","searchString","window","location","href","mounted","beforeUnmount","removeEventListener","updated","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","onClick","_cache","$event","_ctx","xmlns","height","viewBox","width","d","_hoisted_4","_hoisted_5","_hoisted_6","$data","onInput","$options","arguments","onKeydown","_withKeys","autocomplete","for","_hoisted_7","$setup","_hoisted_8","_Fragment","_renderList","i","_normalizeClass","_hoisted_9","_hoisted_10","modal","useModal","__props","toRefs","parsedRootID","openConfirm","component","markRaw","SearchModal","showModal","show","body","toggle","hideModal"],"sourceRoot":""}