{"version":3,"sources":["foot.js"],"names":["$","new_map","$el","$markers","find","args","zoom","center","google","maps","LatLng","mapTypeId","MapTypeId","ROADMAP","disableDefaultUI","map","Map","infowindow","InfoWindow","maxWidth","markers","each","$marker","latlng","attr","postId","did","icon","url","piper","piper_url","size","Size","origin","Point","anchor","icon2","marker","Marker","position","animation","Animation","DROP","addListener","getAnimation","setAnimation","BOUNCE","setIcon","push","html","event","setContent","open","marker_post_id","ajax","piper_ajax","type","data","action","post_id","dataType","success","result","markerGetPostData","addClass","close","removeClass","add_marker","this","bounds","LatLngBounds","i","lat","lng","extend","length","setCenter","getCenter","setZoom","navigator","geolocation","getCurrentPosition","pos","coords","latitude","longitude","positionError","center_map","getDealerData","$country","$zip","post_country","post_zip","error","alert","JSON","parse","console","log","find_dealer_by_did","findNearestDealer","getInternationalDealerData","address","document","getElementById","value","Geocoder","geocode","results","status","GeocoderStatus","OK","searchLocationsNear","geometry","location","dealerid","trigger","panTo","window","width","animateMapZoomTo","targetZoom","currentZoom","arguments","getZoom","addListenerOnce","setTimeout","autocomplete","fillInAddress","getPlace","disabled","closestMarkers","distances","closest","mlat","mlng","dLat","rad","dLong","a","Math","sin","cos","c","atan2","sqrt","d","find_closest_marker","x","PI","jQuery","ready","fadeOut","on","$this","places","Autocomplete","types","circle","Circle","radius","accuracy","setBounds","getBounds","e","preventDefault","country","val","geocoder","searchAddressComponents","searchPostalCode","show","address_components","short_name","hide","removeAttr","search","queryVars","vars","href","replace","m","key","search_input","inputLocation","click","sortDocuments","$sortValue","list","listitems","sort","sortNewOld","appendTo","sortOldNew","alpha","alphaReverse","sortType","b","text","listFilter","input","filter","toUpperCase","indexOf","scrollToResults","htmlBody","target","headerOffset","outerHeight","animate","scrollTop","offset","top","$target","focus","is","getDocumentData","$model_id","model_id","beforeSend","one","$solution_id","$solutionid","solution_id","currentSolution","solutionData","file_url","pub_reference_num","append","timeout","modelTitle","sortValue","which"],"mappings":"AAAA,cAQA,SAAWA,GAWT,SAASC,EAAQC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lF","sourcesContent":["\"use strict\";\n\n/**\n * Dealer Map Scripts\n *\n * @since 1.0.0\n * @package piper\n */\n(function ($) {\n /*\n * new_map\n *\n * This function will render a Google Map onto the selected jQuery element\n *\n * @since 1.0.0\n *\n * @param $el (jQuery element)\n * @return n/a\n */\n function new_map($el) {\n // var\n var $markers = $el.find('.marker'); // vars\n\n var args = {\n zoom: 6,\n center: new google.maps.LatLng(27.6648, -81.5158),\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n disableDefaultUI: false\n }; // create map\n\n var map = new google.maps.Map($el[0], args); // create info window\n\n var infowindow = new google.maps.InfoWindow({\n maxWidth: 390\n }); // add a markers reference\n\n map.markers = []; // add markers\n\n $markers.each(function () {\n add_marker($(this), map, infowindow);\n }); // center map\n\n center_map(map); // return\n\n return map;\n }\n /*\n * add_marker\n *\n * This function will add a marker to the selected Google Map\n *\n * @since 1.0.0\n *\n * @param $marker (jQuery element)\n * @param map (Google Map object)\n * @return n/a\n */\n\n\n function add_marker($marker, map, infowindow) {\n // var\n var latlng = new google.maps.LatLng($marker.attr('data-lat'), $marker.attr('data-lng'));\n var postId = $marker.attr('data-postid');\n var did = $marker.attr('data-did'); // dealer id\n // Marker svg\n\n var icon = {\n url: piper.piper_url + 'assets/images/icon.svg',\n size: new google.maps.Size(22, 30),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(11, 15)\n }; // Marker svg\n\n var icon2 = {\n url: piper.piper_url + 'assets/images/icon2.svg',\n size: new google.maps.Size(22, 30),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(11, 15)\n }; // create marker\n\n var marker = new google.maps.Marker({\n position: latlng,\n map: map,\n animation: google.maps.Animation.DROP,\n icon: icon,\n postId: postId,\n did: did\n });\n marker.addListener('mouseover', function () {\n if (marker.getAnimation() == null) {\n marker.setAnimation(google.maps.Animation.BOUNCE);\n marker.setIcon(icon2);\n } else {\n marker.setAnimation(null);\n marker.setIcon(icon);\n }\n });\n marker.addListener('mouseout', function () {\n if (marker.getAnimation() !== null) {\n marker.setAnimation(null);\n marker.setIcon(icon);\n } else {\n marker.setIcon(icon2);\n }\n }); // add to array\n\n map.markers.push(marker); // if marker contains HTML, add it to an infoWindow\n\n if ($marker.html()) {\n // show info window when marker is clicked\n google.maps.event.addListener(marker, 'click', function () {\n infowindow.setContent($marker.html());\n infowindow.open(map, marker);\n markerGetPostData(marker);\n $('.dealer-search-box-body').addClass('active');\n }); // close any open info window when map is clicked\n\n google.maps.event.addListener(map, 'click', function (event) {\n infowindow.close();\n $('.dealer-search-box-body').removeClass('active');\n $('.dealer-search-box-body').html('');\n });\n google.maps.event.addListener(infowindow, 'closeclick', function () {\n $('.dealer-search-box-body').removeClass('active');\n $('.dealer-search-box-body').html('');\n });\n }\n } // AJAX the post data into the info pannel\n\n\n function markerGetPostData($marker) {\n var marker_post_id = $marker.postId;\n $.ajax({\n url: piper.piper_ajax,\n type: 'POST',\n data: {\n action: 'get_contacts',\n post_id: marker_post_id\n },\n dataType: 'html',\n success: function success(result) {\n $('.dealer-search-box-body').html(result);\n }\n });\n } // AJAX the dealer data to get the dealer ID that we need to match to a data attribute on one of our map markers\n\n\n function getDealerData($country, $zip) {\n var data = '';\n var did = '';\n $.ajax({\n url: piper.piper_ajax,\n type: 'POST',\n data: {\n action: 'get_dealer_data',\n post_country: $country,\n post_zip: $zip\n },\n error: function error() {\n alert(\"No Dealers Found\");\n },\n success: function success(result) {\n data = JSON.parse(result);\n console.log(data['status']);\n\n if (data['status'] == 'success') {\n did = data['partner_info']['partner_id']; // If we have a dealer ID, go find it on the map\n\n find_dealer_by_did(did);\n } else {\n alert(\"No dealers found for that zipcode. Searching for nearest dealer to this location.\");\n findNearestDealer();\n }\n }\n });\n } // AJAX the international dealer data to get the dealer ID that we need to match to a data attribute on one of our map markers\n\n\n function getInternationalDealerData($country) {\n var data = '';\n var did = '';\n $.ajax({\n url: piper.piper_ajax,\n type: 'POST',\n data: {\n action: 'get_dealer_data',\n post_country: $country,\n post_zip: ''\n },\n error: function error() {\n alert(\"No Dealers Found\");\n },\n success: function success(result) {\n data = JSON.parse(result);\n console.log(data['status']);\n\n if (data['status'] == 'success') {\n did = data['partner_info']['partner_id']; // If we have a dealer ID, go find it on the map\n\n find_dealer_by_did(did);\n } else {\n alert(\"No dealers found for that zipcode. Searching for nearest dealer to this location.\");\n findNearestDealer();\n }\n }\n });\n } // find nearest if no dealer covers a zipcode\n\n\n function findNearestDealer() {\n var address = document.getElementById(\"addressInput\").value;\n var geocoder = new google.maps.Geocoder();\n geocoder.geocode({\n address: address\n }, function (results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n searchLocationsNear(results[0].geometry.location);\n } else {\n alert(address + ' not found');\n }\n });\n } // Take in dealer ID from getDealerData and find it on the map\n\n\n function find_dealer_by_did(did) {\n // sanity check\n if (map.markers.length < 1) {\n return;\n } // Marker svg to replace the default if we find a match (pseudo hover effect)\n\n\n var icon2 = {\n url: piper.piper_url + 'assets/images/icon2.svg',\n size: new google.maps.Size(22, 30),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(11, 15)\n };\n var dealerid = did;\n var i;\n\n for (i = 0; i < map.markers.length; i++) {\n if (map.markers[i].did == dealerid) {\n google.maps.event.trigger(map.markers[i], 'click');\n map.markers[i].setIcon(icon2);\n map.panTo(map.markers[i].position);\n\n if ($(window).width() > 1200) {\n animateMapZoomTo(map, 9);\n } else {\n map.setZoom(9);\n }\n\n return;\n }\n }\n }\n\n function animateMapZoomTo(map, targetZoom) {\n var currentZoom = arguments[2] || map.getZoom();\n\n if (currentZoom != targetZoom) {\n google.maps.event.addListenerOnce(map, 'zoom_changed', function (event) {\n animateMapZoomTo(map, targetZoom, currentZoom + (targetZoom > currentZoom ? 1 : -1));\n });\n setTimeout(function () {\n map.setZoom(currentZoom);\n }, 80);\n }\n }\n /*\n * center_map\n *\n * This function will center the map, showing all markers attached to this map\n *\n * @since 1.0.0\n *\n * @param map (Google Map object)\n * @return n/a\n */\n\n\n function center_map(map) {\n // vars\n var bounds = new google.maps.LatLngBounds(); // loop through all markers and create bounds\n\n $.each(map.markers, function (i, marker) {\n var latlng = new google.maps.LatLng(marker.position.lat(), marker.position.lng());\n bounds.extend(latlng);\n }); // only 1 marker?\n\n if (map.markers.length == 1) {\n // set center of map\n map.setCenter(bounds.getCenter());\n map.setZoom(16);\n } else {\n // Set map center to users location\n navigator.geolocation.getCurrentPosition(function (position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n map.setCenter(pos);\n map.setZoom(6);\n }, function (positionError) {\n map.setCenter({\n lat: 35,\n lng: -100\n });\n map.setZoom(3);\n });\n }\n }\n\n function getUrlVars() {\n var vars = {};\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\n vars[key] = value;\n });\n return vars;\n }\n\n var placeSearch, autocomplete;\n\n function initAutocomplete($this) {\n // Create the autocomplete object, restricting the search to geographical\n // location types.\n autocomplete = new google.maps.places.Autocomplete($this, {\n types: [\"(regions)\"]\n }); // When the user selects an address from the dropdown, populate the address\n // fields in the form.\n\n autocomplete.addListener('place_changed', fillInAddress);\n }\n\n function fillInAddress() {\n // Get the place details from the autocomplete object.\n var place = autocomplete.getPlace();\n $('#addressInput').value = '';\n $('#addressInput').disabled = false; // var addressType = place.address_components;\n // console.log(addressType);\n } // Bias the autocomplete object to the user's geographical location,\n // as supplied by the browser's 'navigator.geolocation' object.\n\n\n function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }\n\n function searchLocationsNear(center) {\n var pos = {\n lat: center.lat(),\n lng: center.lng()\n };\n map.setCenter(pos);\n find_closest_marker(center);\n } // find the nearest marker once location is entered\n\n\n function rad(x) {\n return x * Math.PI / 180;\n }\n\n function find_closest_marker(center) {\n // sanity check\n if (map.markers.length < 1) {\n return;\n } // Marker svg\n\n\n var icon2 = {\n url: piper.piper_url + 'assets/images/icon2.svg',\n size: new google.maps.Size(22, 30),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(11, 15)\n };\n var closestMarkers = [];\n var lat = center.lat();\n var lng = center.lng();\n var R = 6371; // radius of earth in km\n\n var distances = [];\n var closest = -1;\n var i;\n\n for (i = 0; i < map.markers.length; i++) {\n var mlat = map.markers[i].position.lat();\n var mlng = map.markers[i].position.lng();\n var dLat = rad(mlat - lat);\n var dLong = rad(mlng - lng);\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(rad(lat)) * Math.cos(rad(lat)) * Math.sin(dLong / 2) * Math.sin(dLong / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n distances[i] = d;\n\n if (distances[i] < 800) {\n closestMarkers.push(map.markers[i]);\n }\n\n if (closest == -1 || d < distances[closest]) {\n closest = i;\n }\n }\n\n google.maps.event.trigger(map.markers[closest], 'click');\n map.markers[closest].setIcon(icon2);\n map.panTo(map.markers[closest].position);\n\n if ($(window).width() > 1200) {\n animateMapZoomTo(map, 9);\n } else {\n map.setZoom(9);\n }\n }\n /*\n * document ready\n *\n * This function will render each map when the document is ready (page has loaded)\n *\n * @since 1.0.0\n *\n * @param n/a\n * @return n/a\n */\n // global var\n\n\n var map = null;\n jQuery(document).ready(function ($) {\n $('.dealer-map').each(function () {\n // create map\n map = new_map($(this)); // fade out map loader overlay\n\n map.addListener('tilesloaded', function () {\n $('.dealer-map-container .overlay').fadeOut();\n });\n });\n $('#addressInput, #search-input').on('focus', function () {\n initAutocomplete(this);\n geolocate();\n }); // handle form subission on service finder page\n\n $('.service-search-input button[type=\"submit\"]').on('click', function (e) {\n e.preventDefault();\n var address = document.getElementById(\"addressInput\").value;\n var geocoder = new google.maps.Geocoder();\n geocoder.geocode({\n address: address\n }, function (results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n searchLocationsNear(results[0].geometry.location);\n } else {\n alert(address + ' not found');\n }\n });\n }); // handle form subission on dealer finder page\n\n $('.dealer-search-input button[type=\"submit\"]').on('click', function (e) {\n e.preventDefault();\n var country = $('#countries-search-select').val();\n var address = '';\n var geocoder = new google.maps.Geocoder();\n var searchAddressComponents = \"\";\n var searchPostalCode = \"\";\n\n if (country == 'US') {\n // if we are in the US search using the postal code\n $('.dealer-search-input .zipcode-input').show();\n $('.dealer-search-input .zipcode-input #addressInput').attr('required', 'true');\n address = $('#addressInput').val();\n geocoder.geocode({\n address: address\n }, function (results, status) {\n // geocode the address from the address/zipcode input\n if (status == google.maps.GeocoderStatus.OK) {\n searchAddressComponents = results[0].address_components; // loop through the address components to see if we can find a zipcode\n\n $.each(searchAddressComponents, function () {\n if (this.types[0] == \"postal_code\") {\n searchPostalCode = this.short_name;\n }\n }); // if we dont find a zipcode return error, else get the dealer data from the piper api\n\n if (searchPostalCode == \"\") {\n alert('Invalid Postal Code');\n return null;\n } else {\n getDealerData(country, searchPostalCode);\n }\n } else {\n alert('Invalid Zip or Address');\n }\n });\n } else {\n // if we are international @TODO@\n $('.dealer-search-input .zipcode-input').hide();\n $('.dealer-search-input .zipcode-input #addressInput').attr('required', 'false');\n getInternationalDealerData(country);\n }\n }); // change form inputs based on country selected\n\n $('#countries-search-select').on('change', function (e) {\n var country = $('#countries-search-select').val();\n\n if (country == 'US') {\n $('.dealer-search-input .zipcode-input').show();\n $('.dealer-search-input .zipcode-input #addressInput').attr('required', 'true');\n } else {\n $('.dealer-search-input .zipcode-input').hide();\n $('#addressInput').removeAttr('required').val(\"\");\n }\n });\n\n if (location.search.length) {\n var queryVars = getUrlVars();\n\n if (queryVars.search_input) {\n var inputLocation = queryVars.search_input.replace(/(%2C\\+)/g, \" \");\n inputLocation = inputLocation.replace(/(\\+)/g, \" \");\n $('#addressInput').val(inputLocation);\n $('.dealer-search-input button[type=\"submit\"]').click();\n }\n }\n });\n})(jQuery);\n\"use strict\";\n\n/**\n * Request and filter Technical Publications\n *\n * @since 1.0.0\n * @package piper\n */\n(function ($) {\n jQuery(document).ready(function ($) {\n var selectedText = '';\n var selectedId = '';\n var modelTitle = $('#selected-model-title b');\n var sortValue = '';\n $('#publications-search-select').on('change', function () {\n if ($(this).val()) {\n modelTitle.html($(this).text());\n getDocumentData($(this).val());\n $('.content-results-col .content').hide();\n $('#results').show();\n scrollToResults();\n $('#sort-documents-by').val('new-old');\n sortDocuments(sortValue);\n }\n });\n $('#sort-documents-by').on('change', function () {\n sortValue = $(this).val();\n sortDocuments(sortValue);\n });\n $('#backlink').on('click', function () {\n $('.content-results-col .content').show();\n $('#results').hide();\n });\n $('#result-filter-input').on('keyup', listFilter);\n $('#result-filter-input').on('keypress', function (e) {\n return e.which !== 13;\n });\n }); // sort the list of documents based on sort select value\n\n function sortDocuments($sortValue) {\n var list = $('.results-list');\n var listitems = $('.results-list li');\n\n switch ($sortValue) {\n case 'new-old':\n listitems.sort(sortNewOld) // sort elements\n .appendTo(list); // append again to the list\n\n break;\n\n case 'old-new':\n listitems.sort(sortOldNew) // sort elements\n .appendTo(list); // append again to the list\n\n break;\n\n case 'alpha':\n listitems.sort(alpha) // sort elements\n .appendTo(list); // append again to the list\n\n break;\n\n case 'alpha-reverse':\n listitems.sort(alphaReverse) // sort elements\n .appendTo(list); // append again to the list\n\n break;\n\n case 'type':\n listitems.sort(sortType) // sort elements\n .appendTo(list); // append again to the list\n\n break;\n\n default:\n sortNewOld;\n }\n } // All of the sort functions\n\n\n function sortNewOld(a, b) {\n return $(b).data('pub-release-date') > $(a).data('pub-release-date') ? 1 : -1;\n }\n\n function sortOldNew(a, b) {\n return $(b).data('pub-release-date') < $(a).data('pub-release-date') ? 1 : -1;\n }\n\n function alpha(a, b) {\n return $(b).text() < $(a).text() ? 1 : -1;\n }\n\n function alphaReverse(a, b) {\n return $(b).text() > $(a).text() ? 1 : -1;\n }\n\n function sortType(a, b) {\n return $(b).data('type') > $(a).data('type') ? 1 : -1;\n } // filter the list\n\n\n function listFilter() {\n // Declare variables\n var input, filter, ul, li, a, i, txtValue;\n input = $('#result-filter-input');\n filter = input.val().toUpperCase();\n ul = $('.results-list');\n li = $('.results-list li'); // Loop through all list items, and hide those who don't match the search query\n\n li.each(function () {\n txtValue = $(this).text();\n\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n $(this).show();\n } else {\n $(this).hide();\n }\n });\n }\n\n function scrollToResults() {\n var htmlBody = $('html, body');\n var target = $('#results');\n var headerOffset = $('header[role=\"banner\"]').outerHeight() + 50;\n htmlBody.animate({\n scrollTop: target.offset().top - headerOffset\n }, 1000, function () {\n // callback after animation\n // must change focus!\n var $target = $(target);\n $target.focus(); // check if target was focused\n\n if ($target.is(\":focus\")) {\n return false;\n } // add tabindex for elements not focusable, then focus\n else {\n $target.attr('tabindex', '-1');\n $target.focus();\n }\n\n ;\n });\n } // AJAX the document data into the results list\n\n\n function getDocumentData($model_id) {\n $.ajax({\n url: piper.piper_ajax,\n type: 'POST',\n data: {\n action: 'piper_get_publications',\n model_id: $model_id\n },\n dataType: 'html',\n beforeSend: function beforeSend() {\n $('#results-body').html('