{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./vendor/bundle/ruby/3.3.0/gems/store_connect-18.0.26/app/assets/javascripts/theme/loader.js","webpack:///./vendor/bundle/ruby/3.3.0/gems/store_connect-18.0.26/app/assets/javascripts/theme/utils/color.js","webpack:///./vendor/bundle/ruby/3.3.0/gems/store_connect-18.0.26/app/assets/javascripts/theme/location-map.js","webpack:///./vendor/bundle/ruby/3.3.0/gems/store_connect-18.0.26/app/assets/javascripts/theme/geolocation.js","webpack:///./vendor/bundle/ruby/3.3.0/gems/store_connect-18.0.26/app/assets/javascripts/theme/utils/window.js","webpack:///./vendor/bundle/ruby/3.3.0/gems/store_connect-18.0.26/app/assets/javascripts/packs/location.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","startLoader","container","contextual","loader","getLoader","classList","contains","add","activate","target","document","createElement","spinner","url","svg","createElementNS","circle","setAttribute","appendChild","createSpinner","destination","querySelector","prepend","append","createLoader","stopLoader","remove","settings","on","off","getHSLFromCSSColor","element","rgb","sep","indexOf","substr","split","R","Math","round","length","g","b","cmin","min","cmax","max","delta","h","abs","toFixed","RGBToHSL","getComputedStyle","color","map","markers","nearMarker","async","createMap","latLng","onMapLoaded","Map","google","maps","importLibrary","zoom","center","disableDefaultUI","zoomControl","createLocationMarker","marker","Marker","position","LatLng","icon","getRestingLocationIcon","push","onClickMarker","callback","event","addListener","setNearBeacon","setPosition","anchor","Point","createNearMarker","console","log","panTo","setFocusedMarker","restingIcon","focusedIcon","size","getThemeColor","getFocusedLocationIcon","lat","getPosition","lng","forEach","setIcon","setZoomForSingleResult","bounds","getNorthEast","equals","getSouthWest","extendPoint1","extendPoint2","extend","clearLocationMarkers","setMap","getClientGeolocation","geolocation","JSON","parse","window","sessionStorage","getItem","navigator","StoreConnectTestMode","getCurrentPosition","coords","latitude","longitude","getLatLngFromPosition","geoloc","setItem","stringify","setGeolocationToSession","setContainerToWindowHeight","offset","getElementById","offsetHeight","style","height","dataset","parseFloat"],"mappings":"aACE,IAAIA,EAAmB,CAAC,EAGxB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,CAAC,GAUX,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,OACf,CAIAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,GAEhE,EAGAZ,EAAoBkB,EAAI,SAAShB,GACX,qBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,GACvD,EAOArB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,kBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,EAAM,EAAEC,KAAK,KAAMD,IAC9I,OAAOF,CACR,EA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AAG,IAAK9B,EAAG,GAC/D,C,mCCzHO,SAAS6I,EAAqBhC,GACnC,MAAMiC,EAsBCC,KAAKC,MAAMC,OAAOC,eAAeC,QAAQ,gBApBhD,OAAIL,EAAoBjC,EAASiC,GAC5BM,WAAcA,UAAUN,YAEO,YAAhCG,OAAOI,qBAA2CxC,SAEtDuC,UAAUN,YAAYQ,oBACnB/C,IACC,MAAMb,EAqBL,SAA+Ba,GACpC,MAAO,CAAEuB,IAAKvB,EAASgD,OAAOC,SAAUxB,IAAKzB,EAASgD,OAAOE,UAC/D,CAvBqBC,CAAsBnD,IAgBpC,SAAiCoD,GACtC,GAAe,OAAXA,EAAiB,OACrBV,OAAOC,eAAeU,QAAQ,cAAeb,KAAKc,UAAUF,GAC9D,CAjBMG,CAAwBpE,GACxBmB,EAASnB,EAAM,IAEjB,KACE2B,QAAQC,IAAI,sBACZT,GAAS,IAboCA,GAgBnD,CAtBA,iC,mCCAO,SAASkD,EAA2B/H,GACzC,MACMgI,EADSvH,SAASwH,eAAe,aACjBC,aAEtBlI,EAAUmI,MAAMC,OAAS,gBAAiBJ,MAC5C,CALA,iC,mCCAA,WAqBQ3E,EACAyC,EACAE,EAvBR,oCAKMhG,EAAYS,SAASW,cAAc,0BACnCsC,GAeEL,EAAM5C,SAASW,cAAc,uBAC7B0E,EAAMzC,EAAIgF,QAAQvC,IAClBE,EAAM3C,EAAIgF,QAAQrC,IAEjBF,GAAOE,EAAM,CAClBF,IAAKwC,WAAWxC,GAChBE,IAAKsC,WAAWtC,IACd,MApBN+B,YAA2B/H,GAC3BD,YAAYC,GACZ6G,aAAqB,SAAAC,GACnBrD,YAAUC,GAAQ,WAChB,IAAMW,EAASD,YAAqBV,GAEpClC,YAAWxB,GACXgF,YAAc8B,GACdtB,YAAiBnB,EACnB,GACF,G","file":"js/location-b30519fe17c75e3c8eca.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 = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 399);\n","function Loader(settings) {\n const target = settings.target || null;\n const contextual = settings.contextual;\n\n return {\n on: () => stopLoader(target),\n off: () => startLoader(target, contextual)\n }\n}\n\nexport function startLoader(container, contextual = false) {\n const loader = getLoader(container);\n\n if (loader) {\n activate(loader, contextual)\n } else {\n createLoader(container, contextual);\n }\n}\n\nexport function stopLoader(container) {\n const loader = getLoader(container);\n\n if (loader === null) return;\n loader.classList.remove('is-active');\n}\n\nfunction getLoader(target) {\n const origin = target || document.querySelector('body');\n return origin.querySelector('[data-loader]');\n}\n\nfunction activate(loader, contextual = false) {\n if (loader.classList.contains('Loader')) {\n loader.classList.add('is-active');\n } else if (contextual) {\n loader.classList.add('Loader','is-active', 'is-contextual');\n } else {\n loader.classList.add('Loader','is-active');\n }\n}\n\nfunction createLoader(target, contextual = false) {\n const loader = document.createElement('div');\n const spinner = createSpinner();\n const destination = target || document.querySelector('body');\n\n loader.setAttribute('data-loader', '');\n loader.classList.add('Loader','is-active');\n if (contextual) loader.classList.add('is-contextual');\n destination.prepend(loader);\n loader.append(spinner);\n}\n\nfunction createSpinner() {\n const url = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(url, 'svg');\n const circle = document.createElementNS(url, 'circle');\n\n svg.setAttribute('viewBox', '0 0 50 50');\n svg.classList.add('spinner');\n circle.setAttribute('cx', '25');\n circle.setAttribute('cy', '25');\n circle.setAttribute('r','20');\n circle.setAttribute('fill', 'none');\n circle.setAttribute('stroke-width', '5');\n circle.classList.add('path');\n svg.appendChild(circle);\n\n return svg;\n}\n\nexport default Loader","export function getHSLFromCSSColor(element) {\n return RGBToHSL(getComputedStyle(element).color)\n}\n\nfunction RGBToHSL(rgb) {\n let sep = rgb.indexOf(',') > -1 ? ',' : ' '\n rgb = rgb.substr(4).split(')')[0].split(sep)\n\n for (let R in rgb) {\n let r = rgb[R]\n if (r.indexOf('%') > -1) rgb[R] = Math.round(r.substr(0,r.length - 1) / 100 * 255)\n }\n\n let r = rgb[0] / 255,\n g = rgb[1] / 255,\n b = rgb[2] / 255\n\n let cmin = Math.min(r,g,b),\n cmax = Math.max(r,g,b),\n delta = cmax - cmin,\n h = 0,\n s = 0,\n l = 0\n\n if (delta == 0) h = 0\n else if (cmax == r) h = ((g - b) / delta) % 6\n else if (cmax == g) h = (b - r) / delta + 2\n else h = (r - g) / delta + 4\n\n h = Math.round(h * 60)\n\n if (h < 0) h += 360\n\n l = (cmax + cmin) / 2\n s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1))\n s = +(s * 100).toFixed(1)\n l = +(l * 100).toFixed(1)\n\n return { h: h, s: s, l: l }\n}\n","import { getHSLFromCSSColor } from './utils/color'\n\nlet map\nlet markers = []\nlet nearMarker = null\n\nexport async function createMap(latLng, onMapLoaded) {\n const container = document.querySelector('[data-location-map]')\n const { Map } = await google.maps.importLibrary('maps')\n\n map = new Map(container, {\n zoom: 14,\n center: latLng,\n disableDefaultUI: true,\n zoomControl: true,\n })\n onMapLoaded(map)\n}\n\nexport function createLocationMarker(latLng) {\n const marker = new google.maps.Marker({\n map,\n position: new google.maps.LatLng(latLng),\n icon: getRestingLocationIcon(),\n })\n\n markers.push(marker)\n return marker\n}\n\nexport function onClickMarker(marker, callback) {\n google.maps.event.addListener(marker, 'click', () => {\n callback(marker)\n })\n}\n\nexport function setNearBeacon(latLng = null) {\n if (latLng === null) return\n\n const position = new google.maps.LatLng(latLng)\n\n nearMarker ?\n nearMarker.setPosition(position) :\n nearMarker = createNearMarker(position)\n console.log(position)\n map.panTo(position)\n}\n\nexport function setFocusedMarker(marker = null) {\n if (marker === null) return\n const restingIcon = getRestingLocationIcon()\n const focusedIcon = getFocusedLocationIcon()\n const lat = marker.getPosition().lat()\n const lng = marker.getPosition().lng()\n const position = new google.maps.LatLng({ lat, lng })\n\n markers.forEach(m => m.setIcon(restingIcon))\n marker.setIcon(focusedIcon)\n map.panTo(position)\n}\n\nexport function setZoomForSingleResult(bounds) {\n if (bounds.getNorthEast().equals(bounds.getSouthWest())) {\n const extendPoint1 = new google.maps.LatLng(bounds.getNorthEast().lat() + 0.01, bounds.getNorthEast().lng() + 0.01)\n const extendPoint2 = new google.maps.LatLng(bounds.getNorthEast().lat() - 0.01, bounds.getNorthEast().lng() - 0.01)\n\n bounds.extend(extendPoint1)\n bounds.extend(extendPoint2)\n }\n}\n\nexport function getMapMarkerByLatLng(latLng) {\n return markers.find(marker => marker.getPosition().equals(latLng))\n}\n\nexport function clearLocationMarkers() {\n markers.forEach(marker => marker.setMap(null))\n markers = []\n}\n\nfunction getFocusedLocationIcon(size = 50) {\n const color = getThemeColor()\n return {\n anchor: new google.maps.Point(size/2, size),\n url: `data:image/svg+xml;utf-8,\\\n \\\n \\\n \\\n `\n }\n}\n\nfunction getRestingLocationIcon(size = 40) {\n const color = getThemeColor()\n return {\n anchor: new google.maps.Point(size/2, size),\n url: `data:image/svg+xml;utf-8,\\\n \\\n \\\n \\\n `\n }\n}\n\nfunction createNearMarker(position) {\n return new google.maps.Marker({\n map,\n position,\n icon: {\n anchor: new google.maps.Point(15, 15),\n url: `data:image/svg+xml;utf-8, \\\n \\\n \\\n \\\n \\\n `,\n }\n })\n}\n\nfunction getThemeColor() {\n const container = document.querySelector('[data-location-map]')\n return getHSLFromCSSColor(container) || { h: 212, s: 100, l: 50 }\n}\n","// Returns geolocation coordinates from the session if available,\n// otherwise attempts to fetch and return the current geolocation\nexport function getClientGeolocation(callback) {\n const geolocation = getGeolocationFromSession()\n\n if (geolocation) return callback(geolocation)\n if (!navigator || !navigator.geolocation) return callback()\n\n if (window.StoreConnectTestMode === 'enabled') return callback()\n\n navigator.geolocation.getCurrentPosition(\n (position) => {\n const latLng = getLatLngFromPosition(position)\n\n setGeolocationToSession(latLng)\n callback(latLng)\n },\n () => {\n console.log('Geolocation failed')\n callback()\n }\n )\n}\n\nexport function getGeolocationFromSession() {\n return JSON.parse(window.sessionStorage.getItem('geolocation'));\n}\n\nexport function setGeolocationToSession(geoloc) {\n if (geoloc === null) return\n window.sessionStorage.setItem('geolocation', JSON.stringify(geoloc));\n}\n\nexport function getLatLngFromPosition(position) {\n return { lat: position.coords.latitude, lng: position.coords.longitude }\n}\n","export function setContainerToWindowHeight(container) {\n const header = document.getElementById('SC-Header')\n const offset = header.offsetHeight\n\n container.style.height = `calc(100vh - ${ offset }px)`\n}\n","import { createMap, createLocationMarker, setNearBeacon, setFocusedMarker } from '../theme/location-map'\nimport { getClientGeolocation } from '../theme/geolocation'\nimport { startLoader, stopLoader } from '../theme/loader'\nimport { setContainerToWindowHeight } from '../theme/utils/window'\n\nconst container = document.querySelector('[data-location-record]')\nconst latLng = getLatLngFromMap()\n\nsetContainerToWindowHeight(container)\nstartLoader(container)\ngetClientGeolocation(geolocation => {\n createMap(latLng, () => {\n const marker = createLocationMarker(latLng)\n\n stopLoader(container)\n setNearBeacon(geolocation)\n setFocusedMarker(marker)\n })\n})\n\nfunction getLatLngFromMap() {\n const map = document.querySelector('[data-location-map]')\n const lat = map.dataset.lat\n const lng = map.dataset.lng\n\n return lat && lng ? {\n lat: parseFloat(lat),\n lng: parseFloat(lng),\n } : null\n}\n"],"sourceRoot":""}