"use strict";$(function(){window.console&&"iposnet.kkclocator.jp"!==location.host||(window.console.log=function(){});var e,o,w=function(e,t){return e=e.replace(/[ぁ-ゔ]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+96)}).replace(/゙/g,"゛").replace(/゚/g,"゜").replace(/(ウ゛)/g,"ヴ").replace(/(ワ゛)/g,"ヷ").replace(/(ヰ゛)/g,"ヸ").replace(/(ヱ゛)/g,"ヹ").replace(/(ヲ゛)/g,"ヺ").replace(/(ゝ゛)/g,"ヾ").replace(/ゝ/g,"ヽ").replace(/ゞ/g,"ヾ"),!1!==t&&(e=e.replace(/ゕ/g,"ヵ").replace(/ゖ/g,"ヶ")),e},y=function(e){var t={"ガ":"ガ","ギ":"ギ","グ":"グ","ゲ":"ゲ","ゴ":"ゴ","ザ":"ザ","ジ":"ジ","ズ":"ズ","ゼ":"ゼ","ゾ":"ゾ","ダ":"ダ","ヂ":"ヂ","ヅ":"ヅ","デ":"デ","ド":"ド","バ":"バ","ビ":"ビ","ブ":"ブ","ベ":"ベ","ボ":"ボ","パ":"パ","ピ":"ピ","プ":"プ","ペ":"ペ","ポ":"ポ","ヴ":"ヴ","ヷ":"ヷ","ヺ":"ヺ","ア":"ア","イ":"イ","ウ":"ウ","エ":"エ","オ":"オ","カ":"カ","キ":"キ","ク":"ク","ケ":"ケ","コ":"コ","サ":"サ","シ":"シ","ス":"ス","セ":"セ","ソ":"ソ","タ":"タ","チ":"チ","ツ":"ツ","テ":"テ","ト":"ト","ナ":"ナ","ニ":"ニ","ヌ":"ヌ","ネ":"ネ","ノ":"ノ","ハ":"ハ","ヒ":"ヒ","フ":"フ","ヘ":"ヘ","ホ":"ホ","マ":"マ","ミ":"ミ","ム":"ム","メ":"メ","モ":"モ","ヤ":"ヤ","ユ":"ユ","ヨ":"ヨ","ラ":"ラ","リ":"リ","ル":"ル","レ":"レ","ロ":"ロ","ワ":"ワ","ヲ":"ヲ","ン":"ン","ァ":"ァ","ィ":"ィ","ゥ":"ゥ","ェ":"ェ","ォ":"ォ","ッ":"ッ","ャ":"ャ","ュ":"ュ","ョ":"ョ","。":"。","、":"、","ー":"ー","「":"「","」":"」","・":"・"},o=new RegExp("("+Object.keys(t).join("|")+")","g");return e.replace(o,function(e){return t[e]}).replace(/゙/g,"゛").replace(/゚/g,"゜")};function n(n){return"string"==typeof n&&(n=n.split(".")),o(n)||(n=[n]),function(e){for(var t=0,o=n.length;te-100?m.fadeIn():m.fadeOut()}),m.on("click",function(){return $(".mdl-layout__content").animate({scrollTop:0},500),!1}),$(".search").on("click",function(){$(this).toggleClass("on");var e=$(this).find("span").data("id"),t=$(this).find("span").data("name");$(this).hasClass("on")?T[e]=t:delete T[e],f(),Y(!1)}),$(".category-wrap").on("click",function(){$(this).toggleClass("on");var e=$(this).find("span").data("id");$(this).hasClass("on")?L[e]=e:delete L[e],f(),Y(!1)}),$(".filter-menu-toggle").on("click",function(){$("#side_left_button").trigger("click")}),$(".search-reset-btn").on("click",function(){B=0,H={},h(),X(!0,!1,!1,!1)}),$("#side_left_button").on("click",function(){var t=this,o=$(t).hasClass("on"),e=768<$(window).width()?$(".mdl-layout-title"):$(".right_content");p()&&e.hasClass("open")&&$("#side_button").trigger("click"),$(t).hasClass("on")?p()&&$("#mobile_search").show():$("#mobile_search").hide(),$("#search_content").animate({left:o?"-320px":"0"},20,function(){var e=479<$(window).width()?280:230;$(t).css("left",o?320:e).find("i").text(o?"keyboard_arrow_right":"keyboard_arrow_left"),$(t).toggleClass("on")})}),p()?($(".right_content ").css("width",0),$("#mobile_search").show(),$(".sp-hidden").remove(),$(".search-field").css("width","72%")):($("#mobile_search").remove(),$(".sp-hidden").removeClass("sp-hidden"),$("#side_left_button").trigger("click"),$(".mdl-layout-title").addClass("open"),$("#side_button i").text("keyboard_arrow_right")),$("#side_button").click(function(){p()&&$("#side_left_button").hasClass("on")&&$("#side_left_button").trigger("click");var e=$(window).width(),t=768',"",this.div_=document.createElement("div"),this.div_.style.position="absolute",this.div_.style["z-index"]=99999,this.div_.innerHTML='
',this.getPanes().overlayLayer.appendChild(this.div_)}var e=this.getProjection().fromLatLngToDivPixel(new google.maps.LatLng(this.lat_,this.lng_));this.div_.style.left=parseInt(e.x,10)-14+"px",this.div_.style.top=parseInt(e.y,10)-40+"px"},F.prototype.remove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)};var J=void 0;function Y(e){var t;if(1===B){var i=["name","address","name_kana"],o=$.trim($(".search-field:visible").val()),n=w(o),a=y(n),s=new RegExp(o),r=new RegExp(a);for(var l in i)if(t=_.filter(V,function(o){var e=i[l];if(("name"===e||"address"===e)&&!o[e].match(s))return!1;var t=y(o.name_kana);if("name_kana"===e&&!t.match(r))return!1;if(0<_.size(L)&&!_.has(L,o.category))return!1;if(0<_.size(T)){var n=!0;if(_.each(T,function(e,t){0===o.icons[t]&&(n=!1)}),!n)return!1}return!0}),_.size(t))break}else t=_.filter(V,function(o){if(0===B&&!E.getBounds().contains(new google.maps.LatLng(o.latitude,o.longitude)))return!1;if(0<_.size(L)&&!_.has(L,o.category))return!1;if(0<_.size(T)){var n=!0;if(_.each(T,function(e,t){0===o.icons[t]&&(n=!1)}),!n)return!1}return!0});var c=_.filter(0===_.size(H)?V:H,function(o){if(0===_.size(H)&&!E.getBounds().contains(new google.maps.LatLng(o.latitude,o.longitude)))return!1;if(0<_.size(L)&&!_.has(L,o.category))return!1;if(0<_.size(T)){var n=!0;if(_.each(T,function(e,t){0===o.icons[t]&&(n=!1)}),!n)return!1}return!0}),g=G?G.getPosition():E.getCenter();if(t=_.sortBy(t,function(e){return google.maps.geometry.spherical.computeDistanceBetween(g,new google.maps.LatLng(e.latitude,e.longitude))}),c=_.sortBy(c,function(e){return google.maps.geometry.spherical.computeDistanceBetween(g,new google.maps.LatLng(e.latitude,e.longitude))}),O.refreshVisibleShops(property(t,"id")),E.data.setStyle(O.getStyleOptions()),J=c,_.size(t)||_.size(c)){if(e){var d=new google.maps.LatLngBounds,p=null,u=null;_.each(t,function(e){p=new google.maps.LatLng(e.latitude,e.longitude),d.extend(p)}),_.each(c,function(e){p=new google.maps.LatLng(e.latitude,e.longitude),null===u&&(u=p)}),"freeword"===P&&null!==u?(Z(u),E.setCenter(u),E.setZoom(k)):1===_.size(t)?E.setCenter(p):1<_.size(t)?E.fitBounds(d):P&&K($.trim($(".search-field:visible").val()))}var m;if(_.size(c)){var f=[];_.each(c,function(e){var t=$("#shop-template").text(),o=_.template(t);e.vacancy_img=b(O.getVacancy(e.id).manku_moji),f.push(o(e))}),$("#side_content").scrollTop(0),S.empty().append(f),$(".s_template").parent().off("mouseenter mouseleave"),$(".s_template").parent().on("mouseenter",function(){O.mouseenter($(this).data("id")),E.data.setStyle(O.getStyleOptions())}),$(".s_template").parent().on("mouseleave",function(){O.mouseleave(),E.data.setStyle(O.getStyleOptions())});var h=_.size(f),v="周辺の"+h+"件を表示しました";m="検索の結果、"+h+"件見つかりました",0!==_.size(H)&&(v=m),$("#number").text(v)}e&&m?C(m,!0):A&&C("周辺の駐車場を表示しました",!(A=!1))}else{S.empty();v="地図内に、見つかりませんでした";B&&(v="検索の結果、見つかりませんでした"),$("#number").text(v),(e||A)&&(A=!1,C(-1!==$.inArray(P,["freeword","shopno","shopname","address"])?"該当するものが見つかりませんでした":"周辺の駐車場を表示しました",!1)),e&&1===B&&"freeword"===P&&K($.trim($(".search-field:visible").val()))}}var q={coords:!0,input:!1};function X(e,t,n,o){if(void 0===e&&(e=q.coords),void 0===t&&(t=q.input),q={coords:e,input:t},!o&&E.getZoom()<15)return f(),S.empty(),$("#number").text("地図内に、見つかりませんでした"),E.data.setStyle(function(){return{visible:!1}}),void $(".modal_window").removeClass("invisible");$(".modal_window").addClass("invisible"),U=!0;var i=E.getCenter();!function(e,t,o){if(e){var n=e+"="+escape(t);if(n+="; path="+location.pathname,o){var i=(new Date).getTime();n+="; expires="+(o=(o=new Date(i+o)).toUTCString())}!1,document.cookie=n}}(r,i.lat()+","+i.lng()+","+E.getZoom(),7776e6);var a={};e&&(a=j());var s=$.trim($(".search-field:visible").val());t&&(a[P]=s),a.shopids=Object.keys(V).join(","),$.rbgrApi.shopList(a).done(function(e){if(_.size(e)){E.data.addGeoJson(e),E.data.addListener("click",function(e){var t=e.feature.getProperty(0);if(!t||!V[t])return!1;var o,n=V[t],i=new google.maps.LatLng(n.latitude,n.longitude);o=320<$(window).width()?i:new google.maps.LatLng(n.latitude+.009,n.longitude);var a=$("#marker-template").text(),s=_.template(a),r=new google.maps.Size(0,-30),l={content:s(n),pixelOffset:r},c=new google.maps.InfoWindow(l);I&&I.close(),c.open(E),c.setPosition(i),p()&&E.panTo(o),I=c}),E.data.addListener("mouseover",function(e){var t=e.feature;O.mouseenter(t.getProperty(0)),E.data.setStyle(O.getStyleOptions())}),E.data.addListener("mouseout",function(){O.mouseleave(),E.data.setStyle(O.getStyleOptions())});var t=e.features;_.each(t,function(e){var t=e.properties,o=e.geometry.coordinates,n={id:t[0],name:t[1],address:t[2],shop_no:t[3],name_kana:t[4],shop_active_id:t[5],icons:t[6],category:null,latitude:o[1],longitude:o[0]};V[n.id]=n}),0!==B&&0===_.size(H)&&(H=$.extend(!0,{},V))}Y(n);var o=j();o.maxrec=1e3,$.rbgrApi.vacancyList(o).done(function(e){O.refreshVacancies(e.parkings,V)}).fail(function(){}).always(function(){!function(){var e=J;E.data.setStyle(O.getStyleOptions()),_.size(e)&&_.each(e,function(e){$("#vacancy_img_"+e.id).attr("src",b(O.getVacancy(e.id).manku_moji))}),E.getZoom()<15&&E.data.setStyle(function(){return{visible:!1}})}()})}).fail(function(){}).always(function(){U=!1,1===B&&(B=0)})}var ee=function(e){if(e&&document.cookie)for(var t=document.cookie.split("; "),o=0;o").html(e.station).val(e.latitude+","+e.longitude);o.push(t)}),_.size(o)?$("#sub-select").append(o):$("#sub-select").remove()});var ce={nelat:le.latitude+.001,swlat:le.latitude-.001,nelng:le.longitude+.001,swlng:le.longitude-.001,maxrec:50};$.rbgrApi.vacancyList(ce).done(function(e){var t={};t[SHOPINFO.id]={id:SHOPINFO.id,shop_no:SHOPINFO.shop_no},O.refreshVacancies(e.parkings,t),$("#vacancy_img").attr("src",b(O.getVacancy(SHOPINFO.id).manku_moji))}).fail(function(){}).always(function(){!function(n,e){var t={position:new google.maps.LatLng(n.latitude,n.longitude),map:E,icon:a(O.getVacancy(n.id).manku_moji)},o=new google.maps.Marker(t);o.data=n,e&&google.maps.event.addListener(o,"click",function(){E.panTo(this.getPosition());var e=$("#marker-template").text(),t={content:_.template(e)(n)},o=new google.maps.InfoWindow(t);I&&I.close(),o.open(E,this),I=o})}(SHOPINFO,!1),p()||$('option[value="current-position"]').remove()})}else"index"===PAGENAME&&Q()});