{"version":3,"sources":["webpack:///./assets/javascripts/modules/components/StoreLocatorDetailComponent.js","webpack:///./assets/javascripts/modules/storelocator-subs/sl_detail.js","webpack:///./assets/javascripts/modules/utils/LoaderUtil.js"],"names":["StoreLocatorDetailComponent","Component","_get","prototype","__proto__","Object","getPrototypeOf","this","call","window","InitGoogle","apiUrl","$","val","moduleLoader","loadExternalScript","then","Zero","Components","create","ZDetail","start","Logger","element","_classCallCheck","_this","_possibleConstructorReturn","MapEl","find","Selectors","DetailMap","ZoomIn","ZoomOut","BaGoto","BaTarget","onInitDetailMap","setDetailContentDimensions","basicPrivacyAcceptance","msg","StoreLocator","d_Lat","data","lat","d_Lng","lng","detailMap","google","maps","Map","zoom","center","styles","stylers","saturation","disableDefaultUI","scaleControl","gestureHandling","mapTypeId","detail_marker","url","marker","icon","Url","scaledSize","Size","h","w","Marker","position","map","addClass","on","e","setZoom","getZoom","stopImmediatePropagation","detailHeader","detailContent","css","display","detailHeaderHeight","outerHeight","padding-top","attr","is","StoreLocator:Init","onStoreLocatorInit","LoaderUtil","SELECTORS","loaderContainerSel","removeClass","cssActiveLoaderClass","hideAllLoaderContainers","pageBrandLogoLoaderSel","pageSpinLogoLoaderSel"],"mappings":"uYAIqBA,grBAAoCC,uSAGrDC,CAAAF,EAAAG,UAAAC,WAAAC,OAAAC,eAAAN,EAAAG,WAAA,SAAAI,MAAAC,KAAAD,MAGAE,OAAOC,WAAa,aACpB,IAGMC,wDAHeC,EAAE,iBAAiBC,MAGlC,2DAFiBD,EAAE,mBAAmBC,MAI5CN,KAAKO,aAAaC,mBAAmBJ,GAAQK,KAAK,WAChDP,OAAOQ,KAAOA,OAEdC,aAAWC,OAAO,UAAWC,KAE7BH,OAAKI,qBAjBUrB,6YCET,IAAIsB,SAAO,WAAvB,IAEqBF,cAiHnB,SAAAA,EAAYG,gGAASC,CAAAjB,KAAAa,GAAA,IAAAK,mKAAAC,CAAAnB,MAAAa,EAAAhB,WAAAC,OAAAC,eAAAc,IAAAZ,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AAgBhE,EAAE,wBAClBiE,EAAiBjE,EAAE,0BAEvBgE,EAAaE,KAAKC,QAAU,UAC5B,IAAIC,EAAsBJ,EAAaK,aAAY,GAEhDD,GACDH,EAAcC,KAAKI,cAAeF,qDAUpCpE,EAAE,yBAAyBuE,KAAK,WAAW,GAE3CvE,EAAE,QAAQ2D,GAAG,aAAc,0BAA2B,SAASC,GAE1D5D,EAAE,yBAAyBwE,GAAG,aAC/BxE,EAAE,2BAA2BgB,KAAK,yBAAyBuD,KAAK,YAAY,IAC/D,IAEbvE,EAAE,2BAA2BgB,KAAK,yBAAyBuD,KAAK,YAAY,IAC/D,sCAtGjB,OACEE,oBAAqB9E,KAAK+E,sDAK5B,OAGEvD,OAAQ,2BACRC,QAAS,4BACTF,UAAW,4gBCTblB,EAAE2E,EAAWC,UAAUC,oBAAoBC,YAAYH,EAAWC,UAAUG,wEAO5EJ,EAAWK,0BAEXhF,EAAE2E,EAAWC,UAAUK,wBAAwBvB,SAASiB,EAAWC,UAAUG,wEAO7E/E,EAAE2E,EAAWC,UAAUK,wBAAwBH,YAAYH,EAAWC,UAAUG,uEAOhFJ,EAAWK,0BACXhF,EAAE2E,EAAWC,UAAUM,uBAAuBxB,SAASiB,EAAWC,UAAUG,uEAQ5E/E,EAAE2E,EAAWC,UAAUM,uBAAuBJ,YAAYH,EAAWC,UAAUG,wDAzC/E,OACEE,uBAAwB,0BACxBC,sBAAuB,oBACvBL,mBAAoB,oBACpBE,qBAAsB","file":"component-StoreLocatorDetailComponent.chunks.js","sourcesContent":["import Component from '../abstracts/Component';\nimport {Zero, Components} from 'Zero';\nimport {ZDetail} from \"StoreLocatorSubcomponents/sl_detail.js\";\n\nexport default class StoreLocatorDetailComponent extends Component {\n\n  render() {\n    super.render();\n    let _this = this;\n\n    window.InitGoogle = function () {};\n    const googleApiKey = $(\"#googleApiKey\").val();\n    const googleLanguage = $(\"#googleLanguage\").val();\n\n    const apiUrl = `https://maps.googleapis.com/maps/api/js?v=3.35&key=${googleApiKey}&libraries=places,geometry&callback=InitGoogle&language=${googleLanguage}`;\n\n    this.moduleLoader.loadExternalScript(apiUrl).then(() => {\n      window.Zero = Zero;\n\n      Components.create('ZDetail', ZDetail);\n\n      Zero.start( {} );\n\n    });\n  }\n}\n","import {Zero, Components, Logger} from 'Zero';\nimport {GoogleMap} from 'Vendor/@openmind/storelocator/dist/googlemap.umd.js';\nimport StoreLocator from 'Vendor/@openmind/storelocator/dist/storelocator.umd.js';\nimport LoaderUtil from '../utils/LoaderUtil';\nimport { SmoothScroll } from '../utils/SmoothScroll';\n\nconst Log = new Logger('ZDetail');\n\nexport default class ZDetail extends Components {\n\n\n  get Messages() {\n    return {\n      \"StoreLocator:Init\": this.onStoreLocatorInit\n    };\n  }\n\n  get Selectors() {\n    return {\n      // DetailTemplate: '#dealer-detail-template',\n      /// DetailResultContainer: '#detail-result-container',\n      ZoomIn: '#detail-controls_zoom_in',\n      ZoomOut: '#detail-controls_zoom_out',\n      DetailMap: '#detail-map'\n      // BaGoto: '.js-goto-ba',\n      // BaTarget: '#bookAppointment'\n    }\n  }\n\n  onStoreLocatorInit(msg) {\n    this.StoreLocator = msg.StoreLocator;\n  }\n\n\n  onInitDetailMap(msg) {\n    const d_Lat = this.data.lat;\n    const d_Lng = this.data.lng;\n    // const _styles = [{\"featureType\":\"administrative.land_parcel\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"labels.text\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi.business\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road.local\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"stylers\":[{\"visibility\":\"off\"}]}];\n    const _styles = [{\"stylers\":[{\"saturation\":-100}]}];\n\n    let detailMap = new google.maps.Map(this.MapEl[0], {\n      zoom: 16,\n      center: {lat: d_Lat, lng: d_Lng},\n      styles: _styles,\n      disableDefaultUI: true,\n      scaleControl: true,\n      gestureHandling: 'cooperative',\n      mapTypeId: 'roadmap'\n    });\n\n    const detail_marker = {\n      url: this.data.marker.icon.Url,\n      scaledSize: new google.maps.Size(this.data.marker.icon.Size.h, this.data.marker.icon.Size.w),\n    };\n\n    let detailMarker = new google.maps.Marker({\n      position: {lat: d_Lat, lng: d_Lng},\n      map: detailMap,\n      icon: detail_marker\n    });\n\n    this.element.addClass('is-visible');\n\n    this.ZoomIn.on(\"click.zmap\", (e) => {\n       detailMap.setZoom(detailMap.getZoom() + 1);\n       e.stopImmediatePropagation();\n    });\n\n    this.ZoomOut.on(\"click.zmap\", (e) => {\n      detailMap.setZoom(detailMap.getZoom() - 1);\n      e.stopImmediatePropagation();\n    });\n  }\n\n  // goToBookAppointment() {\n  //   if(this.BaTarget || this.BaGoto) {\n  //     let self = this;\n\n  //     this.BaGoto.on('click.gotobo', (e) => {\n  //       e.preventDefault;\n  //       const BToffset = self.BaTarget.offset().top - 300;\n  //       SmoothScroll(window, BToffset , 0, 'smooth')\n  //     })\n  //   }\n  // }\n\n  setDetailContentDimensions(msg) {\n    let headerHeight = msg;\n    let detailHeader =  $('.mc-sl-detail-header');\n    let detailContent =  $('.store-details-content');\n\n    detailHeader.css({'display':'block'});\n    let detailHeaderHeight =  detailHeader.outerHeight(true);\n\n    if(detailHeaderHeight) {\n      detailContent.css({'padding-top': detailHeaderHeight});\n    }\n  }\n\n\n\n  // da bindare controllo privacy booking tool\n  basicPrivacyAcceptance() {\n    let isDisabled = true;\n\n    $('input[name=\"isPrivacy').attr('checked', false);\n\n    $('body').on('change.bpr', 'input[name=\"isPrivacy\"]', function(e) {\n\n      if($('input[name=\"isPrivacy').is(':checked')) {\n        $('.book-appintment-submit').find('button[type=\"submit\"]').attr(\"disabled\", false)\n        isDisabled = false\n      } else {\n        $('.book-appintment-submit').find('button[type=\"submit\"]').attr(\"disabled\", true)\n        isDisabled = true\n      }\n    });\n  }\n\n\n\n  constructor(element) {\n    super(element);\n\n    // this.DetailResultsEl = this.element.find( this.Selectors.DetailResultContainer );\n    this.MapEl = this.element.find( this.Selectors.DetailMap );\n    this.ZoomIn = this.element.find( this.Selectors.ZoomIn );\n    this.ZoomOut = this.element.find( this.Selectors.ZoomOut );\n    this.BaGoto = this.element.find( this.Selectors.BaGoto );\n    this.BaTarget = this.element.find( this.Selectors.BaTarget );\n\n    this.onInitDetailMap();\n    this.setDetailContentDimensions();\n    this.basicPrivacyAcceptance();\n    // this.goToBookAppointment();\n  }\n}\n\nexport {\n  ZDetail\n}\n\n","/**\n * This utility class helps to manage the loaders in the project\n */\nexport default class LoaderUtil {\n  static get SELECTORS() {\n    return {\n      pageBrandLogoLoaderSel: '#page-brand-logo-loader',\n      pageSpinLogoLoaderSel: '#page-spin-loader',\n      loaderContainerSel: '.loader-container',\n      cssActiveLoaderClass: 'active',\n    };\n  }\n\n  static hideAllLoaderContainers() {\n    $(LoaderUtil.SELECTORS.loaderContainerSel).removeClass(LoaderUtil.SELECTORS.cssActiveLoaderClass);\n  }\n\n  /**\n   * Show the brand logo loader in the page\n   */\n  static showPageBrandLogoLoader() {\n    LoaderUtil.hideAllLoaderContainers();\n\n    $(LoaderUtil.SELECTORS.pageBrandLogoLoaderSel).addClass(LoaderUtil.SELECTORS.cssActiveLoaderClass);\n  }\n\n  /**\n   * Hide the brand logo loader in the page\n   */\n  static hidePageBrandLogoLoader() {\n    $(LoaderUtil.SELECTORS.pageBrandLogoLoaderSel).removeClass(LoaderUtil.SELECTORS.cssActiveLoaderClass);\n  }\n\n  /**\n   * Show the spin loader in the page\n   */\n  static showPageSpinLogoLoader() {\n    LoaderUtil.hideAllLoaderContainers();\n    $(LoaderUtil.SELECTORS.pageSpinLogoLoaderSel).addClass(LoaderUtil.SELECTORS.cssActiveLoaderClass);\n\n  }\n\n  /**\n   * Hide the spin loader in the page\n   */\n  static hidePageSpinLogoLoader() {\n    $(LoaderUtil.SELECTORS.pageSpinLogoLoaderSel).removeClass(LoaderUtil.SELECTORS.cssActiveLoaderClass);\n  }\n}\n"],"sourceRoot":""}