{"version":3,"sources":["webpack://Unipol/./src/legacy/js/_/advert/advert-details.js","webpack://Unipol/./src/legacy/js/_/advert/advert-gmap.js"],"names":["window","addEventListener","document","location","split","match","$","each","index","this","collapse","print","searchParams","URLSearchParams","search","get","attr","has","data","empty","html","removeClass","addClass","length","bxSlider","minSlides","maxSlides","moveSlides","slideWidth","pager","auto","controls","autoHover","prevText","nextText","unipolLastResortNamespace","bindToolTips","loadMap","on","event","button","relatedTarget","titleData","srcData","find","text","advertId","remove","modal","formData","serialize","ajax","url","type","success","status","XMLHttpRequest","error","alert","documentElement","$tgt","tgt","querySelector","style","height","removeAttribute","removeProperty","css","removeAttr","initMap","mapContainer","longlat","advertTypeData","title","imagePinLarge","google","maps","MarkerImage","Size","imagePinCodeLarge","imagePinCodeLargeUnipol","imagePinCodeUnipol","imagePinCode","imagePinStandard","ad_markerIcon","advertType","center","LatLng","ad_mapOptions","zoom","mapTypeId","MapTypeId","ROADMAP","streetViewControl","ad_map","Map","getElementById","ad_originMarker","Marker","position","map","icon","originMarker","addListener","infowindow","setContent","open","InfoWindow","initAdvertMap","s","createElement","src","append","loadGmapScript"],"mappings":"sLAGAA,OAAOC,iBAAiB,oBAAoB,YAatB,KAAOC,SAASC,SAAW,KAAKC,MAAM,KAAK,IAC7CC,MAAM,iBAVlBC,EAAE,4BAA4BC,MAAK,SAAUC,GACzCF,EAAEG,MAAMC,SAAS,aAErBV,OAAOW,SAWX,IAAIC,EAAe,IAAIC,gBAAgBb,OAAOG,SAASW,QAEvDR,EAAES,IAAI,gCAAkCT,EAAE,+BAA+BU,KAAK,mBAAqBJ,EAAaK,IAAI,aAAe,kBAAoB,KAAK,SAAUC,GAElKZ,EAAE,+BAA+Ba,QAAQC,KAAKF,GAE9CZ,EAAE,qBAAqBe,YAAY,aACnCf,EAAE,sBAAsBgB,SAAS,QAE7BhB,EAAE,0BAA0BiB,QAC5BjB,EAAE,0BAA0BkB,SAAS,CACjCC,UAAW,EACXC,UAAW,EACXC,WAAY,EAC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OAAOC,KAAKmB,IAAI7F,SAAS8F,eAAe,WAAYR,GAEjES,EAAkB,IAAItB,OAAOC,KAAKsB,OAAO,CAC3CC,SAAUb,EACVc,IAAKN,EACLO,KAAMjB,IAI+C,IAAUkB,EAAnE3B,OAAOC,KAAKrC,MAAMgE,YAAYN,EAAiB,SAAoBK,EAKjEL,EAJS,WACHO,EAAWC,WAAY,cAAahC,kBACpC+B,EAAWE,KAAKZ,EAAQQ,MAIhC,MAAME,EAAa,IAAI7B,OAAOC,KAAK+B,cAW3C3G,OAAO4G,cAAgBvC,EAED,iBAAXM,QAA8C,iBAAhBA,OAAOC,KAC5CP,IAVJ,WACI,MAAMwC,EAAI3G,SAAS4G,cAAc,UACjCD,EAAExD,KAAO,kBACTwD,EAAEE,IAAM,sIACRzG,IAAE,QAAQ0G,OAAOH,GAQjBI,GApIR5E,M","file":"advertDetails.9f9a2ba6dfe19ace2c64.js","sourcesContent":["import loadMap from './advert-gmap';\nimport '/node_modules/bxslider/dist/jquery.bxslider.min.js';\n\nwindow.addEventListener('DOMContentLoaded', function() {\n\n function printView() {\n //$('.epc-container').css(\"width\", \"60%\");\n $('.main .collapse:not(.in)').each(function (index) {\n $(this).collapse(\"toggle\");\n });\n window.print();\n }\n\n // $(function () {\n //$(\"[rel=tooltip]\").tooltip({ placement: 'right' });\n\n var queryString = '&' + (document.location + '?').split('?')[1];\n if (queryString.match(/&printpage=/)) {\n printView();\n }\n\n let searchParams = new URLSearchParams(window.location.search)\n\n $.get('/accommodation/propertypanel/' + $(\"#property-details-container\").attr(\"data-advert-id\") + (searchParams.has('printpage') ? '?printpage=true' : ''), function (data) {\n\n $('#property-details-container').empty().html(data);\n\n $(\".main a.collapsed\").removeClass(\"collapsed\");\n $(\".main div.collapse\").addClass(\"show\");\n\n if ($('.displayPropertyBanner').length) {\n $('.displayPropertyBanner').bxSlider({\n minSlides: 1,\n maxSlides: 1,\n moveSlides: 1,\n slideWidth: 700,\n pager: true,\n auto: false,\n controls: true,\n autoHover: true,\n prevText: \"\",\n nextText: \"\"\n });\n }\n\n window.unipolLastResortNamespace.bindToolTips();\n\n loadMap();\n\n // });\n\n $('#modal-virtual-tour').on('show.bs.modal', function (event) {\n // Get the button that triggered the modal\n var button = $(event.relatedTarget);\n\n // Extract value from the custom data-* attribute\n var titleData = button.data('title');\n var srcData = button.data('src');\n $(this).find('.modal-title span').text(titleData);\n $(this).find('.modal-body iframe').attr('src', srcData);\n $(this).find('.modal-body iframe').attr('data-caption', titleData);\n });\n\n });\n\n $(document).on(\"click\", '#btn-book-viewing', function () {\n var advertId = $(this).data(\"id\");\n\n $.get('/housing/book/' + advertId, function (data) {\n //$('.call-to-action-container').append(data);\n $('#modal-message .modal-body').html(data);\n $('#modal-message .modal-body .header-container').remove();\n $('#modal-message').modal('show');\n });\n });\n\n $(document).on(\"click\", '#btn-request-viewing', function () {\n var formData = $(\"#booking-form\").serialize();\n\n $.ajax({\n url: '/housing/bookingform',\n type: \"Post\",\n data: formData,\n success: function (data, status, XMLHttpRequest) {\n //alert('result');\n $(\"#booking-form-container\").html(data);\n },\n error: function (XMLHttpRequest, status, error) {\n if (error) {\n alert('Sorry. An error occurred: ' + error);\n }\n }\n });\n });\n\n document.documentElement.addEventListener('DOMContentLoaded', function (event) {\n var $tgt = $('.bx-viewport')[0];\n var tgt = document.querySelector('.bx-viewport');\n tgt.style.height = \"\"\n tgt.removeAttribute('height');\n tgt.style.removeProperty('height');\n $tgt.css('height', '');\n $tgt.removeAttr('height');\n\n }, false);\n});\n","import $ from 'jquery';\n\nloadMap();\nexport default function loadMap() {\n function initMap() {\n const mapContainer = $('#ad_gmap');\n if(!mapContainer.length) return;\n const longlat = $(mapContainer).attr('data-longlat').split(', ');\n const advertTypeData = $(mapContainer).attr('data-advert');\n const title = $(mapContainer).attr('data-title');\n\n const imagePinLarge = new google.maps.MarkerImage('/dist/images/noncode-dev.png',\n // This marker is 129 pixels wide by 42 pixels tall.\n null, // new google.maps.Size(80, 81),\n // The origin for this image is 0,0.\n null, // new google.maps.Point(0, 0),\n // The anchor for this image is the base of the flagpole at 18,42.\n null, // new google.maps.Point(39, 78),\n new google.maps.Size(60, 80));\n\n // Define Marker properties\n const imagePinCodeLarge = new google.maps.MarkerImage('/dist/images/code-dev.png',\n // This marker is 129 pixels wide by 42 pixels tall.\n null, // new google.maps.Size(80, 81),\n // The origin for this image is 0,0.\n null, // new google.maps.Point(0, 0),\n // The anchor for this image is the base of the flagpole at 18,42.\n null, // new google.maps.Point(39, 78),\n new google.maps.Size(60, 80));\n\n // Define Marker properties\n const imagePinCodeLargeUnipol = new google.maps.MarkerImage('/dist/images/pin-unipol-dev.png',\n // This marker is 129 pixels wide by 42 pixels tall.\n null, // new google.maps.Size(80, 81),\n // The origin for this image is 0,0.\n null, // new google.maps.Point(0, 0),\n // The anchor for this image is the base of the flagpole at 18,42.\n null, // new google.maps.Point(39, 78),\n new google.maps.Size(60, 80));\n\n // Define Marker properties\n const imagePinCodeUnipol = new google.maps.MarkerImage('/dist/images/pin-unipol-2.png',\n // This marker is 129 pixels wide by 42 pixels tall.\n null, // new google.maps.Size(80, 81),\n // The origin for this image is 0,0.\n null, // new google.maps.Point(0, 0),\n // The anchor for this image is the base of the flagpole at 18,42.\n null, // new google.maps.Point(39, 78),\n new google.maps.Size(60, 80));\n\n // Define Marker properties\n const imagePinCode = new google.maps.MarkerImage('/dist/images/code.png',\n // This marker is 129 pixels wide by 42 pixels tall.\n null, // new google.maps.Size(80, 81),\n // The origin for this image is 0,0.\n null, // new google.maps.Point(0, 0),\n // The anchor for this image is the base of the flagpole at 18,42.\n null, // new google.maps.Point(39, 78),\n new google.maps.Size(60, 80));\n\n const imagePinStandard = new google.maps.MarkerImage('/dist/images/noncode.png',\n // This marker is 129 pixels wide by 42 pixels tall.\n null, // new google.maps.Size(80, 81),\n // The origin for this image is 0,0.\n null, // new google.maps.Point(0, 0),\n // The anchor for this image is the base of the flagpole at 18,42.\n null, // new google.maps.Point(39, 78),\n new google.maps.Size(60, 80));\n\n\n let ad_markerIcon;\n const advertType = advertTypeData;\n\n $(() => {\n switch (advertType) {\n case 'Large Development':\n ad_markerIcon = imagePinLarge;\n break;\n case 'Code Large Development':\n ad_markerIcon = imagePinCodeLarge;\n break;\n case 'Unipol Large Development':\n ad_markerIcon = imagePinCodeLargeUnipol;\n break;\n case 'Unipol Housing':\n ad_markerIcon = imagePinCodeUnipol;\n break;\n case 'Unipol Code':\n ad_markerIcon = imagePinCode;\n break;\n default:\n ad_markerIcon = imagePinStandard;\n }\n\n const zoom = 17;\n const center = new google.maps.LatLng(longlat[0], longlat[1]);\n const ad_mapOptions = {\n zoom,\n center,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n streetViewControl: false\n };\n const ad_map = new google.maps.Map(document.getElementById('ad_gmap'), ad_mapOptions);\n\n const ad_originMarker = new google.maps.Marker({\n position: center,\n map: ad_map,\n icon: ad_markerIcon\n });\n\n // Wire up the infoWindow click handler\n google.maps.event.addListener(ad_originMarker, 'click', (function (originMarker) {\n return function () {\n infowindow.setContent(`

${title}

`);\n infowindow.open(ad_map, originMarker);\n };\n }(ad_originMarker)));\n\n const infowindow = new google.maps.InfoWindow();\n });\n };\n\n function loadGmapScript() {\n const s = document.createElement('script');\n s.type = 'text/javascript';\n s.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyDspHUe2de80pCPqYy9-scfmRzTdaZpZ90&libraries=places&callback=initAdvertMap';\n $('head').append(s);\n }\n\n window.initAdvertMap = initMap;\n\n if (typeof google === 'object' && typeof google.maps === 'object') {\n initMap();\n } else {\n loadGmapScript();\n }\n}\n"],"sourceRoot":""}