{"version":3,"sources":["node_modules/browser-pack/_prelude.js","src/app/AssoChooser.js","src/app/Main.js","src/app/Map.js","src/app/MapStyle.json","src/app/NameSpace.js","src/vendor/WhatsNearby.js","src/vendor/jquery.autocomplete.js","src/vendor/jquery.selectric.js","src/vendor/markerclusterer.js"],"names":[],"mappings":"AAAA;ACAA;AACA;;AAGA;;;;AACA;;;;AACA;;;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;;;AAEA,IAAI,cAAc;AACjB,MAAK,QADY;AAEjB,MAAK,QAFY;AAGjB,MAAK,cAHY;AAIjB,MAAK,iBAJY;AAKjB,MAAK,eALY;AAMjB,OAAM;AANW,CAAlB;;AASA,IAAI,WAAW;AACd,OAAM;AACL,kBAAe,gBADV;AAEL,YAAS,UAFJ;AAGL,YAAS,OAHJ;AAIL,qBAAkB,iBAJb;AAKL,cAAW,YALN;AAML,mBAAgB,kBANX;AAOL,YAAS,QAPJ;AAQL,YAAS;AARJ,EADQ;AAWd,OAAM;AACL,kBAAe,cADV;AAEL,YAAS,QAFJ;AAGL,YAAS,QAHJ;AAIL,qBAAkB,iBAJb;AAKL,cAAW,UALN;AAML,mBAAgB,eANX;AAOL,YAAS,QAPJ;AAQL,YAAS;AARJ;AAXQ,CAAf;;AAuBA,iBAAE,YAAF,CAAe,SAAf,CAAyB,YAAzB,GAAwC,YAAW;AAClD,KAAI,OAAO,IAAX;AACA,MAAK,YAAL,GAAkB,GAAlB;AACA,MAAK,cAAL,CAAoB,GAApB;AACA,CAJD;;AAMA,IAAI,OAAO,SAAP,IAAO,GAAW;AACrB,KAAI,cAAc,SAAd,WAAc,CAAS,IAAT,EAAc;AAC/B,MAAI,UAAU,EAAd;AACA,mBAAE,IAAF,CAAO,IAAP,EAAa,UAAS,KAAT,EAAgB,KAAhB,EAAsB;AAClC,WAAQ,IAAR,CAAa,KAAb;AACA,GAFD;AAGA,SAAO,OAAP;AACA,EAND;;AAQA,KAAI,eAAe,SAAf,YAAe,CAAS,IAAT,EAAe,I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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnLA;AACA;;;;;;AAIC;;;;AACA;;;;;;AAHA,IAAI,OAAO,MAAX;;AAKA,IAAG;AAAC,SAAQ,gBAAc,SAAtB,EAAiC,OAAjC;AAA4C,CAAhD,CAAgD,OAAM,CAAN,EAAQ,CAAE;;AAE1D,IAAI,KAAK,OAAO,IAAP,IAAgB,OAAO,IAAP,KAAgB,EAAzC;;AAGA,GAAG,MAAH,GAAY,sBAAE,MAAF,CAAZ;;AAEA,GAAG,OAAH,GAAc,YAAU;AACvB,KAAI,IAAJ;AACA,QAAO,YAAU;AAChB,SAAO,OAAO,QAAQ,sBAAE,M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A,QAAQ,SAAR,CAAkB,WAAlB,IAAiC,QAAQ,SAAR,CAAkB,SAAnD;AACA,QAAQ,SAAR,CAAkB,SAAlB,IAA+B,QAAQ,SAAR,CAAkB,OAAjD;AACA,QAAQ,SAAR,CAAkB,YAAlB,IAAkC,QAAQ,SAAR,CAAkB,UAApD;;AAEA,YAAY,SAAZ,CAAsB,OAAtB,IAAiC,YAAY,SAAZ,CAAsB,KAAvD;AACA,YAAY,SAAZ,CAAsB,MAAtB,IAAgC,YAAY,SAAZ,CAAsB,IAAtD;AACA,YAAY,SAAZ,CAAsB,UAAtB,IAAoC,YAAY,SAAZ,CAAsB,QAA1D","file":"app.js","sourceRoot":"/source/","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o= 0 || location.href.indexOf('clients.enclos')) {\n\t\tprotocol = \"proxy.php?url=\" + protocol;\n\t}\n\n\tvar urlAssoc = (ns.lang === \"fr\") ? \"//santeetudiante.com/json/assoc.asp\" : \"//ihaveaplan.ca/json/assoc.asp\";\n\tvar associationsCampusDef = $.ajax({\n\t\turl: protocol + urlAssoc,\n\t\tdataType: 'json'\n\t}).done(function(data) {\n\t\tonJSONLoaded(data, \"assoc\");\n\t});\n\n\tvar urlCampus = (ns.lang === \"fr\") ? \"//santeetudiante.com/json/assoccampus.asp\" : \"//ihaveaplan.ca/json/assoccampus.asp\";\n\tvar associationsDef = $.ajax({\n\t\turl: protocol + urlCampus,\n\t\tdataType: 'json'\n\t}).done(function(data) {\n\t\tonJSONLoaded(data, \"assoccampus\");\n\t});\n\n\tvar setupNetworkChooser = function (chooser, suggestion) {\n\t\tvar choice = chooser.find('.asso-choice');\n\t\tvar school = choice.find('.school');\n\t\tvar assoList = chooser.find('.asso-list');\n\t\tschool.text(suggestion.value);\n\n\t\tchooser.find('.pin, .asso-name').slideUp(300);\n\t\tassoList.slideUp(300);\n\t\tchoice.delay(400).slideDown(300);\n\n\t\tchooser.find(\".change-school\").off('click.ihp').on('click.ihp', function(){\n\t\t\tchooser.find('.pin, .asso-name').val(\"\").delay(400).slideDown(300);\n\t\t\tassoList.delay(400).slideDown(300);\n\t\t\tchoice.slideUp(300);\n\t\t});\n\n\t\tvar select = chooser.find(\"select\");\n\t\tselect.empty();\n\t\tvar selectString = (ns.lang === \"fr\") ? \"Choisir un réseau\" : \"Select a Network\";\n\t\tselect.append(\"\");\n\n\t\tvar networksLength = suggestion.networks.length;\n\t\tvar networkId, networkString;\n\t\tfor (var i = 0; i < networksLength; i++) {\n\t\t\tnetworkId = NETWORKS_ID[suggestion.networks[i].toString()];\n\t\t\tnetworkString = NETWORKS[ns.lang][networkId];\n\t\t\tselect.append(\"\");\n\t\t}\n\t\tconsole.log(select);\n\t\tselect.selectric('destroy');\n\t\tselect.selectric({\n\t\t\tonChange:function(e,f,g){\n\t\t\t\t$(e).parent().parent().addClass(\"activated\");\n\t\t\t\tvar urlRedirect = [\n\t\t\t\t\tsuggestion.url,\n\t\t\t\t\t\"?serviceModule=searchResult\",\n\t\t\t\t\t\"&searchMode=AroundCampus\",\n\t\t\t\t\t\"&viewMode=Ls\",\n\t\t\t\t\t\"&CampusId=\"+suggestion.campusId,\n\t\t\t\t\t\"&HCNNetworkCategoryId=\"+$(e).val(),\n\t\t\t\t\t\"&HCNSearchNearByWithinKilometer=15\"\n\t\t\t\t];\n\t\t\t\twindow.location.href=urlRedirect.join(\"\");\n\t\t\t},\n\t\t\tdisableOnMobile:false\n\t\t});\n\t};\n\n\tvar onSelectAssociation = function(suggestion) {\n\t\tvar chooser = $(this).parent();\n\n\t\tif(chooser.hasClass('network')) {\n\t\t\tsetupNetworkChooser(chooser, suggestion);\n\t\t} else if (chooser.hasClass('claim')) {\n\t\t\twindow.location.href=suggestion.url_claim;\n\t\t} else {\n\t\t\twindow.location.href=suggestion.url_home;\n\t\t}\n\t};\n};\n\nvar stripaccents = function(s){\n\tvar r=s.toLowerCase();\n\tr = r.replace(new RegExp(\"\\\\s\", 'g'),\"\");\n\tr = r.replace(new RegExp(\"[àáâãäå]\", 'g'),\"a\");\n\tr = r.replace(new RegExp(\"æ\", 'g'),\"ae\");\n\tr = r.replace(new RegExp(\"ç\", 'g'),\"c\");\n\tr = r.replace(new RegExp(\"[èéêë]\", 'g'),\"e\");\n\tr = r.replace(new RegExp(\"[ìíîï]\", 'g'),\"i\");\n\tr = r.replace(new RegExp(\"ñ\", 'g'),\"n\");\n\tr = r.replace(new RegExp(\"[òóôõö]\", 'g'),\"o\");\n\tr = r.replace(new RegExp(\"œ\", 'g'),\"oe\");\n\tr = r.replace(new RegExp(\"[ùúûü]\", 'g'),\"u\");\n\tr = r.replace(new RegExp(\"[ýÿ]\", 'g'),\"y\");\n\tr = r.replace(new RegExp(\"\\\\W\", 'g'),\"\");\n\treturn r;\n};\n\nns.docReady.then(function(){\n\tinit();\n});\n","\"format es6\";\n\"use strict\";\n\n\nimport ns from 'ns';\nimport $ from 'jquery';\nimport gsap from 'greensock';\n\n\nimport Autocomplete from '../vendor/jquery.autocomplete.js';\nimport Map from './Map.js';\nimport AssoChooser from './AssoChooser.js';\n\nns.docReady.then(function(){\n\tvar DAYS = [\"sun\",\"mon\",\"tue\",\"wed\",\"thu\",\"fri\",\"sat\"];\n\tvar SLIDER_URL = 'json/slider.json';\n\n\tvar LANGS = {\n\t\tfr: 2,\n\t\ten: 1\n\t};\n\n\n\t$('header .arrow-down').on('click', function(){\n\t\t$.scrollTo('#wn', 600, { axis:'y' });\n\t});\n\n\tvar header = $('header');\n\tvar tabBtns = header.find('.tab-btns');\n\tvar logoDesktop = header.find('.logo');\n\tvar onWindowResize = function() {\n\t\tvar w = $(window).width();\n\t\tif (w > 1024) {\n\t\t\tvar h = ((((w / 2) / 3) * 2) / 7);\n\t\t\ttabBtns.css(\"height\", h).css(\"line-height\", h+\"px\");\n\t\t\tlogoDesktop.find('img').width();\n\t\t\tvar imgH = h * 0.8;\n\t\t\tlogoDesktop.find('img').height(imgH);\n\t\t} else {\n\t\t\ttabBtns.css(\"height\", \"\").css(\"line-height\", \"\");\n\t\t\tlogoDesktop.find('img').height(\"\");\n\t\t}\n\n\t\tvar images = header.find('.tab img')\n\t\timages.each(function(i, el){\n\t\t\tel = $(el);\n\t\t\tif (w > 1023) {\n\t\t\t\tel.attr(\"src\", el.attr(\"src\").replace(\".mobile.jpg\", \".jpg\"));\n\t\t\t} else if ( el.attr(\"src\").indexOf('.mobile.jpg') == -1 ) {\n\t\t\t\tel.attr(\"src\", el.attr(\"src\").replace(\".jpg\", \".mobile.jpg\"));\n\t\t\t}\n\t\t});/**/\n\n\t\tvar headerHeight = header.height();\n\t\tvar IMG_W = (w > 1023) ? 1920 : 768;\n\t\tvar IMG_H = (w > 1023) ? 950 : 768;\n\t\tvar scaleW = w / IMG_W;\n\t\tvar scaleH = headerHeight / IMG_H;\n\t\tvar scale = scaleW > scaleH ? scaleW : scaleH;\n\t\tvar leftOffset = (w > 1023) ? -(scale * IMG_W) / 2 : - (w / 2);\n\t\theader.find('.tab img')\n\t\t\t.width(scale * IMG_W)\n\t\t\t.height(scale * IMG_H)\n\t\t\t.css({ marginLeft:leftOffset, marginTop:-(scale * IMG_H) / 2 });\n\t};\n\n\t$(window).on('resize', onWindowResize);\n\t$(window).trigger('resize');\n});\n","\"format es6\";\n\"use strict\";\n\n\nimport ns from 'ns';\nimport $ from 'jquery';\nimport gsap from 'greensock';\n\nimport MarkerCluster from '../vendor/markerclusterer.js';\nimport WhatsNearby from '../vendor/WhatsNearby.js';\nimport MapStyle from './MapStyle.json';\n\nns.docReady.then(function(){\n\tconst protocol = window.location.href.split(\"/\")[0];\n\tconst POINTS_URL = 'proxy.php?url='+protocol+'//ihaveaplan.ca/json/netlist.asp';\n\tconst POINT_UNIQUE_URL = 'proxy.php?url='+protocol+'//ihaveaplan.ca/json/netmember.asp';\n\tconst NETWORKS_ID = {\n\t\t\"1\": \"dental\",\n\t\t\"2\": \"vision\",\n\t\t\"3\": \"chiropractic\",\n\t\t\"6\": \"massage therapy\",\n\t\t\"7\": \"physiotherapy\",\n\t\t\"10\": \"pharmacy\"\n\t};\n\tconst NETWORKS = {\n\t\t\"fr\": {\n\t\t\t\"chiropractic\":\"Chiropraticien\",\n\t\t\t\"dental\":\"Dentiste\",\n\t\t\t\"health\":\"Santé\",\n\t\t\t\"massage therapy\":\"Massothérapeute\",\n\t\t\t\"pharmacy\":\"Pharmacien\",\n\t\t\t\"physiotherapy\":\"Physiothérapeute\",\n\t\t\t\"psychology\":\"Psychologue\",\n\t\t\t\"naturopathy\":\"Naturopathe\",\n\t\t\t\"travel\":\"Voyage\",\n\t\t\t\"vision\":\"Opticien\"\n\t\t},\n\t\t\"en\": {\n\t\t\t\"chiropractic\":\"Chiropractic\",\n\t\t\t\"dental\":\"Dental\",\n\t\t\t\"health\":\"Health\",\n\t\t\t\"massage therapy\":\"Massage Therapy\",\n\t\t\t\"pharmacy\":\"Pharmacy\",\n\t\t\t\"physiotherapy\":\"Physiotherapy\",\n\t\t\t\"psychology\":\"Psychologist\",\n\t\t\t\"naturopathy\":\"Naturopath\",\n\t\t\t\"travel\":\"Travel\",\n\t\t\t\"vision\":\"Vision\"\n\t\t}\n\t};\n\tconst LANGS = { fr: 2, en: 1 };\n\tlet isGeolocated = false;\n\tconst DEFAULT_LOCATION = { lat: 52.3148109, lng: -97.8471394 };\n\n\tconst MAP_STYLE = MapStyle;\n\n\tlet map;\n\n\t//parsers pour transformer un array (recu en ajax) en un objet selon l'ordre des clés\n\tconst Parser = (function() {\n\n\t\tvar KEYS = {\n\t\t\tpoint: ['id', 'lat', 'lng', 'type', 'secure'],\n\t\t\tdetails: [\n\t\t\t\t'providerID',\n\t\t\t\t'phone',\n\t\t\t\t'email',\n\t\t\t\t'website',\n\t\t\t\t'whatever', //semble avoir un champ de trop dans le fichier exemple fourni par emmanuel\n\t\t\t\t'isvip',\n\t\t\t\t'title',\n\t\t\t\t'firstname',\n\t\t\t\t'lastname',\n\t\t\t\t'clinic',\n\t\t\t\t'addr1',\n\t\t\t\t'address2',\n\t\t\t\t'city',\n\t\t\t\t'prov',\n\t\t\t\t'postalcode',\n\t\t\t\t'benefit'\n\t\t\t]\n\t\t};\n\n\t\tvar parse = function(ar) {\n\t\t\treturn this.reduce(function(obj, keyName, idx) {\n\t\t\t\t//console.log(obj,\"[\"+keyName+\"]\", idx, ar);\n\t\t\t\tobj[keyName] = ar[idx];\n\t\t\t\treturn obj;\n\t\t\t}, {});\n\t\t};\n\n\t\tvar types = Object.keys(KEYS);\n\t\treturn types.reduce(function(parsers, type) {\n\t\t\tparsers[type] = parse.bind(KEYS[type]);\n\t\t\treturn parsers;\n\t\t}, {});\n\n\t})();\n\n\t//callé une fois que les 2000 points sont loadés (data)\n\tvar parsePoints = function(data) {\n\t\t//transforme les points en objets et calcule leur distance par rapport à la localisation\n\t\tvar points = data.map(function(point) {\n\t\t\tpoint = Parser.point(point);\n\t\t\treturn point;\n\t\t});\n\n\t\tvar parseAdvantages = function(advantages){\n\t\t\tadvantages = advantages.replace(/-/g, \"
  • \");\n\t\t\tadvantages = advantages.replace(/^-/, \"
  • \");\n\t\t\tadvantages += \"
  • \";\n\t\t\treturn advantages;\n\t\t};\n\n\t\t///callback qui sera appelé au clic sur le marker (et sera exécuté dans le contexte du marker défini ci-bas), et doit a son tour appeler le callback donné avec en argument le markup.\n\t\tvar getInfoWindowMarkup = function(callback) {\n\t\t\tvar that = this;\n\t\t\tvar title = (ns.lang == \"en\") ? \"Healthcare Professionals\": \"Professionnels de la santé\" ;\n\t\t\t$.ajax({\n\t\t\t\turl: POINT_UNIQUE_URL + encodeURIComponent(\"?proID=\" + this.id + \"&langId=\" +LANGS.fr),\n\t\t\t\tdataType: 'json'\n\t\t\t}).then(function(res) {\n\t\t\t\tvar icon = that.icon;\n\t\t\t\tvar type = icon.split(\".\")[0].split(\"/\");\n\t\t\t\ttype = type[type.length-1];\n\t\t\t\t// console.log(\"res\", res, res);\n\t\t\t\tvar details = Parser.details(res[0]);\n\t\t\t\t//HTML du info window généré icitte\n\t\t\t\tcallback(\n\t\t\t\t\t'
    ' +\n\t\t\t\t\t\t'
    ' +\n\t\t\t\t\t\t\t'' +\n\t\t\t\t\t\t'
    ' +\n\t\t\t\t\t\t'
    ' +\n\t\t\t\t\t\t\t'

    ' + title + '

    ' +\n\t\t\t\t\t\t\t'

    ' + NETWORKS[ns.lang][type] + '

    ' +\n\t\t\t\t\t\t\t'
    ' +\n\t\t\t\t\t\t\t'

    '+details.clinic+'

    ' +\n\t\t\t\t\t\t\t'

    '+details.title+' '+details.firstname + ' ' + details.lastname +'

    ' +\n\t\t\t\t\t\t\t'

    ' + details.addr1 + '

    '+\n\t\t\t\t\t\t\t'

    ' + details.city + ', ' + details.prov + ', ' + details.postalcode +'

    ' +\n\t\t\t\t\t\t\t'

    ' + details.phone +'

    ' +\n\t\t\t\t\t\t\t'

    Advantage

    ' +\n\t\t\t\t\t\t\t'
      '+parseAdvantages(details.benefit)+'
    ' +\n\t\t\t\t\t\t'
    ' +\n\t\t\t\t\t'
    '\n\t\t\t\t);\n\t\t\t},\n\t\t\tfunction(a, b, c) {\n\t\t\t\tconsole.error(b);\n\t\t\t});\n\t\t};\n\n\t\tvar w = $(window).width();\n\t\tvar markers = points.map(function(point) {\n\t\t\treturn {\n\t\t\t\tid: point.id,\n\t\t\t\ticon: \"img/wn/\" + point.type.toLowerCase() + \".png\",\n\t\t\t\tlocation: {\n\t\t\t\t\tlat: point.lat,\n\t\t\t\t\tlng: point.lng\n\t\t\t\t},\n\t\t\t\tgetInfoWindowMarkup: (w > 568) ? getInfoWindowMarkup : function(){} //sera appelé avec cet objet comme \"this\"\n\t\t\t};\n\t\t});\n\n\t\tvar zoom = 4;\n\t\tif (isGeolocated) {\n\t\t\tzoom = 14;\n\t\t} else if (w <= 568) {\n\t\t\tzoom = 3;\n\t\t}\n\n\t\tmap = $('#wn').whatsnearby({\n\t\t\tlat: DEFAULT_LOCATION.lat,\n\t\t\tlng: DEFAULT_LOCATION.lng,\n\t\t\twidth: \"100%\",\n\t\t\theight: 870,\n\t\t\tbackgroundColor: '#dedede',\n\t\t\tzoom: zoom,\n\t\t\tplaceMainMarker: false,\n\t\t\tmainMarkerIcon: \"img/wn/mainmarker-\"+ns.lang+\".png\",\n\t\t\tdisableDefaultUI: (w < 1024),\n\t\t\tscrollwheel: false,\n\t\t\tdraggable: (w > 1024),\n\t\t\tmarkers: markers,\n\t\t\tmarkercluster: true,\n\t\t\tmarkerclusterStyles: [{\n\t\t\t\turl: 'img/wn/blank.png',\n\t\t\t\twidth: 49,\n\t\t\t\theight: 50,\n\t\t\t\tanchor: [0, 0],\n\t\t\t\ttextColor: '#ffffff',\n\t\t\t\ttextSize: 18\n\t\t\t }],\n\t\t\tmarkerclusterOptions: { maxZoom: 13 },\n\t\t\tstyle: MAP_STYLE,\n\t\t\tcenterOffsetX: (w <= 568) ? 0: -$(window).width() / 4,\n\t\t\tcenterOffsetY: (w <= 568) ? -868 / 4 : -60,\n\t\t}).data('whatsnearby');\n\n\t\tvar onLocationSuccess = function(position){\n\t\t\tisGeolocated = true;\n\t\t\t$.getJSON('http://ws.geonames.org/countryCode', {\n\t\t\t\tlat: position.coords.latitude,\n\t\t\t\tlng: position.coords.longitude,\n\t\t\t\tusername: 'lagrange',\n\t\t\t\ttype: 'JSON'\n\t\t\t}, function(result){\n\t\t\t\tif(result.countryCode == \"CA\") {\n\t\t\t\t\tmap.moveMainMarker(position.coords.latitude, position.coords.longitude, true, 14);\n\t\t\t\t} else {\n\t\t\t\t\t//not in canada so we leave the default location\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (\"geolocation\" in navigator) {\n\t\t\tnavigator.geolocation.getCurrentPosition(onLocationSuccess, function(){});\n\t\t}\n\t};\n\n\t//load la liste des points\n\tvar loadPromise = $.ajax({\n\t\turl: POINTS_URL,\n\t\tdataType: 'json'\n\t});\n\n\t//quand points lodaés et position obtenue, parse les points\n\t$.when(loadPromise).then(\n\t\tfunction(resLoad) {\n\t\t\tparsePoints(resLoad);\n\t\t}\n\t);\n});\n","module.exports=[\n {\n \"featureType\": \"all\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eff2f8\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"gamma\": 0.01\n },\n {\n \"lightness\": 20\n },\n {\n \"color\": \"#235ba8\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"saturation\": -31\n },\n {\n \"lightness\": -33\n },\n {\n \"weight\": 2\n },\n {\n \"gamma\": 0.8\n },\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"lightness\": 30\n },\n {\n \"saturation\": 30\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"saturation\": 20\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"lightness\": 20\n },\n {\n \"saturation\": -20\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#d5dded\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"lightness\": 10\n },\n {\n \"saturation\": -30\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"saturation\": 25\n },\n {\n \"lightness\": 25\n },\n {\n \"color\": \"#c6d1e6\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#c6d1e6\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station.rail\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#c6d1e6\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station.rail\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#c6d1e6\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"lightness\": -20\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#c2cee5\"\n }\n ]\n }\n]\n","'format es6';\n'use strict';\n\n\tvar name = 'aseq';\n\n\timport $ from 'jquery';\n\timport Promise from 'Promise';\n\n\ttry{require('source-map-'+'support').install();}catch(e){}\n\n\tvar ns = window[name] = (window[name] || {});\n\n\n\tns.window = $(window);\n\n\tns.getBody = (function(){\n\t\tvar body;\n\t\treturn function(){\n\t\t\treturn body = body || $('body');\n\t\t};\n\t})();\n\n\twindow.requestAnimFrame = (function(){\n\t\treturn window.requestAnimationFrame ||\n\t\t\twindow.webkitRequestAnimationFrame ||\n\t\t\twindow.mozRequestAnimationFrame ||\n\t\t\tfunction( callback ){\n\t\t\t\twindow.setTimeout(callback, 1000 / 60);\n\t\t\t};\n\t})();\n\n\tif(navigator.userAgent.match(/Edge\\/12\\./) || navigator.userAgent.match(/Trident\\/7\\./)) {\n\t\t$('body').on(\"mousewheel\", function () {\n\t\t\tevent.preventDefault();\n\t\t\tvar wd = event.wheelDelta;\n\t\t\tvar csp = window.pageYOffset;\n\t\t\twindow.scrollTo(0, csp - wd);\n\t\t});\n\t}\n\n\t/**\n\t * generates unique id\n\t */\n\tns.getUniqueID = function(){\n\t\tvar id = 0;\n\t\treturn function(){\n\t\t\treturn 'uid' + id++;\n\t\t}\n\t}();\n\n\tns.detectIE = function() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > -1) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > -1) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > -1) {\n // IE 12 => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }\n\n\tns.detectFF = function(){\n var ua = window.navigator.userAgent;\n\n\t\tvar firefox = ua.indexOf('Firefox/');\n if (firefox > -1) {\n return true;\n }\n\n\t\treturn false;\n\t}\n\n\tns.docReady = (function(){\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\t$(document).ready(function(){\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t})();\n\n\tns.QueryString = function () {\n // This function is anonymous, is executed immediately and\n // the return value is assigned to QueryString!\n var query_string = {};\n var query = window.location.search.substring(1);\n var vars = query.split(\"&\");\n for (var i=0;i true,\n\t};\n\n\t//=====================================================================\n\t// init : Public Function\n\t//\n\t// @params : options\n\t// The various parameters (see this.options) passed to WhatsNearby.\n\t//\n\t// @params : elem\n\t// Element which will be transformed into a WhatsNearby map.\n\t//\n\t// This function initialize WhatsNearby.\n\t//=====================================================================\n\tthis.init = (options, elem) => {\n\t\tthis.options = $.extend({}, this.options, options);\n\n\t\tthis.elem = elem[0];\n\t\tthis.$elem = elem;\n\n\t\tthis._markers = [];\n\n\t\tthis._build();\n\n\t\treturn this;\n\t};\n\n\tthis._markup = \"
    {{name}}{{vicinity}}
    \";\n\n\t//=====================================================================\n\t// _build : Private Function\n\t//\n\t// This function checks for an address passed as an attribute\n\t// (data-address) to the element. If no address is found and the address\n\t// option is not set, it uses the lat and lng options to setup the map.\n\t// If an address is found, we geocode it to get the LatLng coords.\n\t//=====================================================================\n\tthis._build = () => {\n\t\tconst o = this.options;\n\t\t$(this.elem).width(o.width).height(o.height);\n\n\t\tgoogle.maps.visualRefresh = true;\n\n\t\tif ($(this.elem).attr('data-address')) {\n\t\t\to.address = $(this.elem).attr('data-address');\n\t\t}\n\n\t\tif ($(this.elem).attr('data-lat') && $(this.elem).attr('data-lng')) {\n\t\t\to.lat = $(this.elem).attr('data-lat');\n\t\t\to.lng = $(this.elem).attr('data-lng');\n\t\t}\n\n\t\tif ($(this.elem).html() !== '') {\n\t\t\tthis._markup = $(this.elem).html();\n\t\t\t$(this.elem).html('');\n\t\t}\n\n\t\tif (o.address === '') {\n\t\t\tthis._setupMap(o.lat, o.lng);\n\t\t} else {\n\t\t\tthis._geocodeAddress(o.address);\n\t\t}\n\n\t\t// Fix for maps all scrambled (@$!$ Google...) when using bootstrap\n\t\t$('head').append(``);\n\t};\n\n\t//=====================================================================\n\t// _geocodeAddress : Private Function\n\t//\n\t// @params : address\n\t// String representing a physical address (Eg: 1234 Brown St, Mtl)\n\t//\n\t// This function uses Google Geocoder to parse the address and return\n\t// its LatLng coords.\n\t//=====================================================================\n\tthis._geocodeAddress = (address) => {\n\t\tconst geocoder = new google.maps.Geocoder();\n\t\tgeocoder.geocode({ address }, this._locationFound);\n\t};\n\n\t//=====================================================================\n\t// _locationFound : Private Function\n\t//\n\t// @params : address\n\t// String representing a physical address (Eg: 1234 Brown Street,\n\t// Mtl)\n\t//\n\t// This function uses Google Geocoder to parse the address and returns\n\t// its LatLng coords.\n\t//=====================================================================\n\tthis._locationFound = (results, status) => {\n\t\tif (status === 'OK') {\n\t\t\tthis._setupMap(results[0].geometry.location.lat(), results[0].geometry.location.lng());\n\t\t} else {\n\t\t\tconsole.log('An error occured while geocoding the address.');\n\t\t}\n\t};\n\n\t//=====================================================================\n\t// _setupMap : Private Function\n\t//\n\t// @params : lat\n\t// Number value containing the latitude coordinate of a position\n\t//\n\t// @params : lng\n\t// Number value containing the longitude coordinate of a position\n\t//\n\t// Using Lat and Lng passed as parameters, this function generates a\n\t// Google Map. It places a marker on the center position (if\n\t// placeMainMarker is set in the options) and searches for Places around\n\t// the center of the map (again only if places types are passed in\n\t// options).\n\t//\n\t//=====================================================================\n\tthis._setupMap = (lat, lng) => {\n\t\tconst o = this.options;\n\t\tconst mapOptions = {\n\t\t\tzoom: o.zoom,\n\t\t\tmapTypeId: this.options.mapType,\n\t\t\tcenter: new google.maps.LatLng(lat, lng),\n\t\t\tdisableDefaultUI: this.options.disableDefaultUI,\n\t\t\tbackgroundColor: this.options.backgroundColor,\n\t\t\tscrollwheel: this.options.scrollwheel,\n\t\t\tdraggable: this.options.draggable,\n\t\t\tstreetViewControl: this.options.streetViewControl,\n\t\t\tmapTypeControl: this.options.mapTypeControl,\n\t\t};\n\n\t\tthis.map = new google.maps.Map(this.elem, mapOptions);\n\n\t\tlet offsetOnce = false;\n\n\t\tthis.map.addListener('bounds_changed', (e) => {\n\t\t\tif (!offsetOnce) {\n\t\t\t\tthis._offsetCenter(\n\t\t\t\t\tmapOptions.center,\n\t\t\t\t\tthis.options.centerOffsetX,\n\t\t\t\t\tthis.options.centerOffsetY\n\t\t\t\t);\n\t\t\t\toffsetOnce = true;\n\t\t\t}\n\n\t\t\tif (this.options.onBoundsChanged) {\n\t\t\t\tthis.options.onBoundsChanged(e, this.map, this._markers);\n\t\t\t}\n\t\t});\n\n\t\tthis.map.addListener('idle', this.showMarkers);\n\n\t\tthis.map.set('styles', this.options.style);\n\n\t\tif (o.placeMainMarker) {\n\t\t\tthis._placeMainMarker(lat, lng);\n\t\t}\n\n\t\tif (o.placesTypes.length > 0) {\n\t\t\tthis._searchPlaces(lat, lng);\n\t\t}\n\n\t\t//adds custom predefined markers\n\t\tif (o.markers && o.markers.length > 0) {\n\t\t\to.markers.forEach(this._createCustomMarker);\n\t\t}\n\n\t\tif (this.options.markercluster && MarkerClusterer) {\n\t\t\tthis._markerCluster = new MarkerClusterer(\n\t\t\t\tthis.map,\n\t\t\t\tthis._markers,\n\t\t\t\tthis.options.markerclusterOptions\n\t\t\t);\n\t\t\tif (this.options.markerclusterStyles) {\n\t\t\t\tthis._markerCluster.setStyles(this.options.markerclusterStyles);\n\t\t\t}\n\t\t}\n\t};\n\n\tthis.showMarkers = () => {\n\t\tconst bounds = this.map.getBounds();\n\n\t\tif (this.options.markercluster && MarkerClusterer) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst filtered = this._markers.filter((marker) => {\n\t\t\tconst isVisible = this.options.markerVisibleHook(marker);\n\t\t\tif (!isVisible) marker.setMap(null);\n\t\t\treturn isVisible;\n\t\t});\n\t\tfiltered.forEach((marker) => {\n\t\t\tif (bounds.contains(marker.getPosition())) {\n\t\t\t\tif (marker.getMap() === null) {\n\t\t\t\t\tmarker.setMap(this.map);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmarker.setMap(null);\n\t\t\t}\n\t\t});\n\t};\n\n\t//=====================================================================\n\t// _createCustomMarker : Private Function\n\t//\n\t// @params : marker\n\t// A JSON object containing the information\n\t// {\n\t// location: {lat:x, lng:x},\n\t//\t\t\tgetInfoWindowMarkup: callback that returns the markup of the infowindow.\n\t//\t\t\tThat callback, since it can load info by ajax, also has a callback to\n\t//\t\t\tcall that opens the window\n\t// }\n\t//\n\t// This function adds a custom marker, set by a lat & lng, and adds a click event on it\n\t//\n\t//=====================================================================\n\tthis._createCustomMarker = (markerDefinition) => {\n\t\tconst mo = {};\n\t\tmo.map = null;//this.map;\n\t\tmo.position = markerDefinition.location;\n\t\tmo.icon = markerDefinition.icon;\n\t\tmo.label = (markerDefinition.label) ? markerDefinition.label : '';\n\t\tthis.infoWindow = this.infoWindow || (\n\t\t\t(this.options.useInfoBox) ?\n\t\t\t\tnew InfoBox(this.options.infoBoxOptions) : new google.maps.InfoWindow()\n\t\t);\n\t\tconst marker = new google.maps.Marker(mo);\n\t\tconst processCb = (cnt) => {\n\t\t\tthis.infoWindow.setContent(cnt);\n\t\t\tthis.infoWindow.open(this.map, marker);\n\t\t};\n\t\tgoogle.maps.event.addListener(marker, 'click', () => {\n\t\t\tmarkerDefinition.getInfoWindowMarkup.call(markerDefinition, processCb);\n\t\t});\n\t\tmarker.definition = markerDefinition;\n\t\tthis._markers.push(marker);\n\t};\n\n\t//=====================================================================\n\t// _placeMainMarker : Private Function\n\t//\n\t// @params : lat\n\t// Number value containing the latitude coordinate of a position\n\t//\n\t// @params : lng\n\t// Number value containing the longitude coordinate of a position\n\t//\n\t// Using Lat and Lng passed as parameters, this function places a main\n\t// marker on the map using the passed position. A custom icon can be set\n\t// by passing an url to the mainMarkerIcon option.\n\t//\n\t//=====================================================================\n\tthis._placeMainMarker = (lat, lng) => {\n\t\tconst mo = {};\n\t\tmo.map = (this.options.placeMainMarker) ? this.map : null;\n\t\tmo.draggable = false;\n\t\tmo.animation = google.maps.Animation.DROP;\n\t\tmo.position = new google.maps.LatLng(lat, lng);\n\n\t\tif (this.options.mainMarkerIcon !== '') {\n\t\t\tmo.icon = this.options.mainMarkerIcon;\n\t\t}\n\n\t\tif (this.mainMarker) {\n\t\t\tthis.mainMarker.setMap(null);\n\t\t}\n\n\t\tthis.mainMarker = new google.maps.Marker(mo);\n\t};\n\n\t//=====================================================================\n\t// moveMainMarker : Public Function\n\t//\n\t// @params : lat\n\t// Number value containing the latitude coordinate of a position\n\t//\n\t// @params : lng\n\t// Number value containing the longitude coordinate of a position\n\t//\n\t// @params : show\n\t// Boolean value affecting the visibility of the marker\n\t//\n\t// @params : zoom\n\t// Int value setting the map zoom\n\t//\n\t//=====================================================================\n\tthis.moveMainMarker = (lat, lng, show, zoom) => {\n\t\tthis.options.placeMainMarker = show;\n\t\tthis._placeMainMarker(lat, lng);\n\t\tthis.map.setZoom(zoom);\n\t\tthis._offsetCenter(\n\t\t\tthis.mainMarker.position,\n\t\t\tthis.options.centerOffsetX,\n\t\t\tthis.options.centerOffsetY\n\t\t);\n\t};\n\n\t//=====================================================================\n\t// _searchPlaces : Private Function\n\t//\n\t// @params : lat\n\t// Number value containing the latitude coordinate of a position\n\t//\n\t// @params : lng\n\t// Number value containing the longitude coordinate of a position\n\t//\n\t// Using Lat and Lng passed as parameters, this function searches for\n\t// nearby places (using Google Places API). Types of places can be\n\t// filtered\n\t//\n\t//=====================================================================\n\tthis._searchPlaces = (lat, lng) => {\n\t\tconst req = {};\n\t\treq.location = new google.maps.LatLng(lat, lng);\n\t\treq.radius = this.options.placesRadius;\n\t\treq.types = this.options.placesTypes;\n\n\t\tthis.infoWindow = new google.maps.InfoWindow();\n\n\t\tconst service = new google.maps.places.PlacesService(this.map);\n\t\tservice.nearbySearch(req, this._placesCallback);\n\t};\n\n\t//=====================================================================\n\t// _placesCallback : Private Function\n\t//\n\t// @params : results\n\t// A JSON object containing all places found.\n\t//\n\t// @params : status\n\t// Status of the request (successful or not)\n\t//\n\t// This function creates markers on the map using the information\n\t// contained in the JSON object result.\n\t//\n\t//=====================================================================\n\tthis._placesCallback = (results, status) => {\n\t\tif (status === google.maps.places.PlacesServiceStatus.OK) {\n\t\t\tfor (let i = 0; i < results.length; i++) {\n\t\t\t\tthis._createPlaceMarker(results[i]);\n\t\t\t}\n\t\t}\n\t};\n\n\t//=====================================================================\n\t// _createPlaceMarker : Private Function\n\t//\n\t// @params : place\n\t// A JSON object containing the information of a place (Places API)\n\t//\n\t// This function filters the places excluding those containing types in\n\t// the excludePlacesTypes option. If the place is not excluded, it\n\t// creates a marker and sets the content of the infowindow upon a click.\n\t//\n\t//=====================================================================\n\tthis._createPlaceMarker = (place) => {\n\t\tlet excluded = false;\n\n\t\tconst mainType = this._getType(place.types);\n\n\t\tfor (let i = 0; i < this.options.excludePlacesTypes.length; i++) {\n\t\t\tfor (let j = 0; j < place.types.length; j++) {\n\t\t\t\tif (this.options.excludePlacesTypes[i] === place.types[j]) {\n\t\t\t\t\texcluded = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst name = place.name.toLowerCase();\n\t\tfor (let i = 0; i < this.options.excludeByKeywords.length; i++) {\n\t\t\tif (name.indexOf(this.options.excludeByKeywords[i].toLowerCase()) >= 0) {\n\t\t\t\texcluded = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!excluded) {\n\t\t\tconst placeLocation = place.geometry.location;\n\t\t\tconst mo = {};\n\t\t\tmo.map = null;//this.map;\n\t\t\tmo.position = placeLocation;\n\n\t\t\tif (this.options.placesTypesIcon.length > 0) {\n\t\t\t\tmo.icon = this.options.placesTypesIcon[mainType];\n\t\t\t}\n\n\t\t\tconst marker = new google.maps.Marker(mo);\n\t\t\tmarker.place = this._parseMarkup(place);\n\n\t\t\tgoogle.maps.event.addListener(marker, 'click', () => {\n\t\t\t\tthis.infoWindow.setContent(marker.place);\n\t\t\t\tthis.infoWindow.open(this.map, marker);\n\t\t\t});\n\n\t\t\tthis._markers.push(marker);\n\t\t}\n\t};\n\n\t//=====================================================================\n\t// _parseMarkup : Private Function\n\t//\n\t// @params : place\n\t// A JSON object containing the information of a place (Places API)\n\t//\n\t// This function uses the markup passed in the containing div or the\n\t// default markup (this._markup) and changes the placeholders to the\n\t// relevent variables contained within the places object.\n\t//\n\t// Any variable can be accessed ex: {{geometry.location.ob}} will return\n\t// the latitude of the place object.\n\t//\n\t//=====================================================================\n\tthis._parseMarkup = (place) => {\n\t\treturn this._markup.replace(/{{([^}]+)}}/g, (match, placeholder) => {\n\t\t\tconst a = placeholder.split('.');\n\t\t\tconst iterations = a.length;\n\t\t\tlet temp = place;\n\t\t\tfor (let i = 0; i < iterations; i++) {\n\t\t\t\ttemp = temp[a[i]];\n\t\t\t\tif (!temp) break;\n\t\t\t}\n\t\t\treturn temp || '';\n\t\t});\n\t};\n\n\t//=====================================================================\n\t// _getType : Private Function\n\t//\n\t// @params : types\n\t// An array containing types of places\n\t//\n\t// This function return the index of a matched type between the parameter\n\t// and the placesTypes option.\n\t//\n\t//=====================================================================\n\tthis._getType = (types) => {\n\t\tlet type = -1;\n\n\t\tfor (let i = 0; i < types.length; i++) {\n\t\t\tif (this.options.placesTypes.indexOf(types[i]) !== -1) {\n\t\t\t\ttype = this.options.placesTypes.indexOf(types[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn type;\n\t};\n\n\t//=====================================================================\n\t// resize : Public Function\n\t//\n\t// This function asks Google API to resize the map (helps with rendering\n\t// issues)\n\t//\n\t//=====================================================================\n\tthis.resize = () => {\n\t\tgoogle.maps.event.trigger(this.map, 'resize');\n\t};\n\n\tthis.setCenterOffset = (offx, offy, update) => {\n\t\tthis.options.centerOffsetX = offx;\n\t\tthis.options.centerOffsetY = offy;\n\t\tif (update) {\n\t\t\tgoogle.maps.event.trigger(this.map, 'resize');\n\t\t}\n\t};\n\n\tthis._offsetCenter = (latlng, offsetx, offsety) => {\n\t\tconst scale = Math.pow(2, this.map.getZoom());\n\n\t\tconst worldCoordinateCenter = this.map.getProjection().fromLatLngToPoint(latlng);\n\t\tconst pixelOffset = new google.maps.Point((offsetx / scale) || 0, (offsety / scale) || 0);\n\n\t\tconst worldCoordinateNewCenter = new google.maps.Point(\n\t\t\tworldCoordinateCenter.x - pixelOffset.x,\n\t\t\tworldCoordinateCenter.y + pixelOffset.y\n\t\t);\n\n\t\tconst newCenter = this.map.getProjection().fromPointToLatLng(worldCoordinateNewCenter);\n\n\t\tthis.map.setCenter(newCenter);\n\t};\n}\n\n$.fn.whatsnearby = function whatsnearby(options) {\n\tif (this.length) {\n\t\treturn this.each(() => {\n\t\t\tconst wn = new WhatsNearby;\n\t\t\twn.init(options, this);\n\t\t\tthis.data('whatsnearby', wn);\n\t\t});\n\t}\n\treturn null;\n};\n","/**\n* Ajax Autocomplete for jQuery, version 1.2.9\n* (c) 2013 Tomas Kirda\n*\n* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.\n* For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete\n*\n*/\n\n/*jslint browser: true, white: true, plusplus: true */\n/*global define, window, document, jQuery */\n\n// Expose plugin as an AMD module if AMD loader is present:\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['jquery'], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n}(function ($) {\n 'use strict';\n\n var\n utils = (function () {\n return {\n escapeRegExChars: function (value) {\n return value.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n },\n createNode: function (containerClass) {\n var div = document.createElement('div');\n div.className = containerClass;\n div.style.position = 'absolute';\n div.style.display = 'none';\n return div;\n }\n };\n }()),\n\n keys = {\n ESC: 27,\n TAB: 9,\n RETURN: 13,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n };\n\n function Autocomplete(el, options) {\n var noop = function () { },\n that = this,\n defaults = {\n autoSelectFirst: false,\n appendTo: 'body',\n serviceUrl: null,\n lookup: null,\n onSelect: null,\n width: 'auto',\n minChars: 1,\n maxHeight: 300,\n deferRequestBy: 0,\n params: {},\n formatResult: Autocomplete.formatResult,\n delimiter: null,\n zIndex: 9999,\n type: 'GET',\n noCache: false,\n onSearchStart: noop,\n onSearchComplete: noop,\n onSearchError: noop,\n containerClass: 'autocomplete-suggestions',\n tabDisabled: false,\n dataType: 'text',\n currentRequest: null,\n triggerSelectOnValidInput: true,\n lookupFilter: function (suggestion, originalQuery, queryLowerCase) {\n return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;\n },\n paramName: 'query',\n transformResult: function (response) {\n return typeof response === 'string' ? $.parseJSON(response) : response;\n }\n };\n\n // Shared variables:\n that.element = el;\n that.el = $(el);\n that.suggestions = [];\n that.badQueries = [];\n that.selectedIndex = -1;\n that.currentValue = that.element.value;\n that.intervalId = 0;\n that.cachedResponse = {};\n that.onChangeInterval = null;\n that.onChange = null;\n that.isLocal = false;\n that.suggestionsContainer = null;\n that.options = $.extend({}, defaults, options);\n that.classes = {\n selected: 'autocomplete-selected',\n suggestion: 'autocomplete-suggestion'\n };\n that.hint = null;\n that.hintValue = '';\n that.selection = null;\n\n // Initialize and set options:\n that.initialize();\n that.setOptions(options);\n }\n\n Autocomplete.utils = utils;\n\n $.Autocomplete = Autocomplete;\n\n Autocomplete.formatResult = function (suggestion, currentValue) {\n var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';\n\n return suggestion.value.replace(new RegExp(pattern, 'gi'), '$1<\\/strong>');\n };\n\n Autocomplete.prototype = {\n\n killerFn: null,\n\n initialize: function () {\n var that = this,\n suggestionSelector = '.' + that.classes.suggestion,\n selected = that.classes.selected,\n options = that.options,\n container;\n\n // Remove autocomplete attribute to prevent native suggestions:\n that.element.setAttribute('autocomplete', 'off');\n\n that.killerFn = function (e) {\n if ($(e.target).closest('.' + that.options.containerClass).length === 0) {\n that.killSuggestions();\n that.disableKillerFn();\n }\n };\n\n that.suggestionsContainer = Autocomplete.utils.createNode(options.containerClass);\n\n container = $(that.suggestionsContainer);\n\n container.appendTo(options.appendTo);\n\n // Only set width if it was provided:\n if (options.width !== 'auto') {\n container.width(options.width);\n }\n\n // Listen for mouse over event on suggestions list:\n container.on('mouseover.autocomplete', suggestionSelector, function () {\n that.activate($(this).data('index'));\n });\n\n // Deselect active element when mouse leaves suggestions container:\n container.on('mouseout.autocomplete', function () {\n that.selectedIndex = -1;\n container.children('.' + selected).removeClass(selected);\n });\n\n // Listen for click event on suggestions list:\n container.on('click.autocomplete', suggestionSelector, function () {\n that.select($(this).data('index'));\n });\n\n that.fixPosition();\n\n that.fixPositionCapture = function () {\n if (that.visible) {\n that.fixPosition();\n }\n };\n\n $(window).on('resize.autocomplete', that.fixPositionCapture);\n\n that.el.on('keydown.autocomplete', function (e) { that.onKeyPress(e); });\n that.el.on('keyup.autocomplete', function (e) { that.onKeyUp(e); });\n that.el.on('blur.autocomplete', function () { that.onBlur(); });\n that.el.on('focus.autocomplete', function () { that.onFocus(); });\n that.el.on('change.autocomplete', function (e) { that.onKeyUp(e); });\n },\n\n onFocus: function () {\n var that = this;\n that.fixPosition();\n if (that.options.minChars <= that.el.val().length) {\n that.onValueChange();\n }\n },\n\n onBlur: function () {\n this.enableKillerFn();\n },\n\n setOptions: function (suppliedOptions) {\n var that = this,\n options = that.options;\n\n $.extend(options, suppliedOptions);\n\n that.isLocal = $.isArray(options.lookup);\n\n if (that.isLocal) {\n options.lookup = that.verifySuggestionsFormat(options.lookup);\n }\n\n // Adjust height, width and z-index:\n $(that.suggestionsContainer).css({\n 'max-height': options.maxHeight + 'px',\n 'width': options.width + 'px',\n 'z-index': options.zIndex\n });\n },\n\n clearCache: function () {\n this.cachedResponse = {};\n this.badQueries = [];\n },\n\n clear: function () {\n this.clearCache();\n this.currentValue = '';\n this.suggestions = [];\n },\n\n disable: function () {\n var that = this;\n that.disabled = true;\n if (that.currentRequest) {\n that.currentRequest.abort();\n }\n },\n\n enable: function () {\n this.disabled = false;\n },\n\n fixPosition: function () {\n var that = this,\n offset,\n styles;\n\n // Don't adjsut position if custom container has been specified:\n if (that.options.appendTo !== 'body') {\n return;\n }\n\n offset = that.el.offset();\n\n styles = {\n top: (offset.top + that.el.outerHeight()) + 'px',\n left: offset.left + 'px'\n };\n\n if (that.options.width === 'auto') {\n styles.width = (that.el.outerWidth() - 2) + 'px';\n }\n\n $(that.suggestionsContainer).css(styles);\n },\n\n enableKillerFn: function () {\n var that = this;\n $(document).on('click.autocomplete', that.killerFn);\n },\n\n disableKillerFn: function () {\n var that = this;\n $(document).off('click.autocomplete', that.killerFn);\n },\n\n killSuggestions: function () {\n var that = this;\n that.stopKillSuggestions();\n that.intervalId = window.setInterval(function () {\n that.hide();\n that.stopKillSuggestions();\n }, 50);\n },\n\n stopKillSuggestions: function () {\n window.clearInterval(this.intervalId);\n },\n\n isCursorAtEnd: function () {\n var that = this,\n valLength = that.el.val().length,\n selectionStart = that.element.selectionStart,\n range;\n\n if (typeof selectionStart === 'number') {\n return selectionStart === valLength;\n }\n if (document.selection) {\n range = document.selection.createRange();\n range.moveStart('character', -valLength);\n return valLength === range.text.length;\n }\n return true;\n },\n\n onKeyPress: function (e) {\n var that = this;\n\n // If suggestions are hidden and user presses arrow down, display suggestions:\n if (!that.disabled && !that.visible && e.which === keys.DOWN && that.currentValue) {\n that.suggest();\n return;\n }\n\n if (that.disabled || !that.visible) {\n return;\n }\n\n switch (e.which) {\n case keys.ESC:\n that.el.val(that.currentValue);\n that.hide();\n break;\n case keys.RIGHT:\n if (that.hint && that.options.onHint && that.isCursorAtEnd()) {\n that.selectHint();\n break;\n }\n return;\n case keys.TAB:\n if (that.hint && that.options.onHint) {\n that.selectHint();\n return;\n }\n // Fall through to RETURN\n case keys.RETURN:\n if (that.selectedIndex === -1) {\n that.hide();\n return;\n }\n that.select(that.selectedIndex);\n if (e.which === keys.TAB && that.options.tabDisabled === false) {\n return;\n }\n break;\n case keys.UP:\n that.moveUp();\n break;\n case keys.DOWN:\n that.moveDown();\n break;\n default:\n return;\n }\n\n // Cancel event if function did not return:\n e.stopImmediatePropagation();\n e.preventDefault();\n },\n\n onKeyUp: function (e) {\n var that = this;\n\n if (that.disabled) {\n return;\n }\n\n switch (e.which) {\n case keys.UP:\n case keys.DOWN:\n return;\n }\n\n clearInterval(that.onChangeInterval);\n\n if (that.currentValue !== that.el.val()) {\n that.findBestHint();\n if (that.options.deferRequestBy > 0) {\n // Defer lookup in case when value changes very quickly:\n that.onChangeInterval = setInterval(function () {\n that.onValueChange();\n }, that.options.deferRequestBy);\n } else {\n that.onValueChange();\n }\n }\n },\n\n onValueChange: function () {\n var that = this,\n options = that.options,\n value = that.el.val(),\n query = that.getQuery(value),\n index;\n\n if (that.selection) {\n that.selection = null;\n (options.onInvalidateSelection || $.noop).call(that.element);\n }\n\n clearInterval(that.onChangeInterval);\n that.currentValue = value;\n that.selectedIndex = -1;\n\n // Check existing suggestion for the match before proceeding:\n if (options.triggerSelectOnValidInput) {\n index = that.findSuggestionIndex(query);\n if (index !== -1) {\n that.select(index);\n return;\n }\n }\n\n if (query.length < options.minChars) {\n that.hide();\n } else {\n that.getSuggestions(query);\n }\n },\n\n findSuggestionIndex: function (query) {\n var that = this,\n index = -1,\n queryLowerCase = query.toLowerCase();\n\n $.each(that.suggestions, function (i, suggestion) {\n if (suggestion.value.toLowerCase() === queryLowerCase) {\n index = i;\n return false;\n }\n });\n\n return index;\n },\n\n getQuery: function (value) {\n var delimiter = this.options.delimiter,\n parts;\n\n if (!delimiter) {\n return value;\n }\n parts = value.split(delimiter);\n return $.trim(parts[parts.length - 1]);\n },\n\n getSuggestionsLocal: function (query) {\n var that = this,\n options = that.options,\n queryLowerCase = query.toLowerCase(),\n filter = options.lookupFilter,\n limit = parseInt(options.lookupLimit, 10),\n data;\n\n data = {\n suggestions: $.grep(options.lookup, function (suggestion) {\n return filter(suggestion, query, queryLowerCase);\n })\n };\n\n if (limit && data.suggestions.length > limit) {\n data.suggestions = data.suggestions.slice(0, limit);\n }\n\n return data;\n },\n\n getSuggestions: function (q) {\n var response,\n that = this,\n options = that.options,\n serviceUrl = options.serviceUrl,\n data,\n cacheKey;\n\n options.params[options.paramName] = q;\n data = options.ignoreParams ? null : options.params;\n\n if (that.isLocal) {\n response = that.getSuggestionsLocal(q);\n } else {\n if ($.isFunction(serviceUrl)) {\n serviceUrl = serviceUrl.call(that.element, q);\n }\n cacheKey = serviceUrl + '?' + $.param(data || {});\n response = that.cachedResponse[cacheKey];\n }\n\n if (response && $.isArray(response.suggestions)) {\n that.suggestions = response.suggestions;\n that.suggest();\n } else if (!that.isBadQuery(q)) {\n if (options.onSearchStart.call(that.element, options.params) === false) {\n return;\n }\n if (that.currentRequest) {\n that.currentRequest.abort();\n }\n that.currentRequest = $.ajax({\n url: serviceUrl,\n data: data,\n type: options.type,\n dataType: options.dataType\n }).done(function (data) {\n that.currentRequest = null;\n that.processResponse(data, q, cacheKey);\n options.onSearchComplete.call(that.element, q);\n }).fail(function (jqXHR, textStatus, errorThrown) {\n options.onSearchError.call(that.element, q, jqXHR, textStatus, errorThrown);\n });\n }\n },\n\n isBadQuery: function (q) {\n var badQueries = this.badQueries,\n i = badQueries.length;\n\n while (i--) {\n if (q.indexOf(badQueries[i]) === 0) {\n return true;\n }\n }\n\n return false;\n },\n\n hide: function () {\n var that = this;\n that.visible = false;\n that.selectedIndex = -1;\n $(that.suggestionsContainer).hide();\n that.signalHint(null);\n },\n\n suggest: function () {\n if (this.suggestions.length === 0) {\n this.hide();\n return;\n }\n\n var that = this,\n options = that.options,\n formatResult = options.formatResult,\n value = that.getQuery(that.currentValue),\n className = that.classes.suggestion,\n classSelected = that.classes.selected,\n container = $(that.suggestionsContainer),\n beforeRender = options.beforeRender,\n html = '',\n index,\n width;\n\n if (options.triggerSelectOnValidInput) {\n index = that.findSuggestionIndex(value);\n if (index !== -1) {\n that.select(index);\n return;\n }\n }\n\n // Build suggestions inner HTML:\n $.each(that.suggestions, function (i, suggestion) {\n html += '
    ' + formatResult(suggestion, value) + '
    ';\n });\n\n // If width is auto, adjust width before displaying suggestions,\n // because if instance was created before input had width, it will be zero.\n // Also it adjusts if input width has changed.\n // -2px to account for suggestions border.\n if (options.width === 'auto') {\n width = that.el.outerWidth() - 2;\n container.width(width > 0 ? width : 300);\n }\n\n container.html(html);\n\n // Select first value by default:\n if (options.autoSelectFirst) {\n that.selectedIndex = 0;\n container.children().first().addClass(classSelected);\n }\n\n if ($.isFunction(beforeRender)) {\n beforeRender.call(that.element, container);\n }\n\n container.show();\n that.visible = true;\n\n that.findBestHint();\n },\n\n findBestHint: function () {\n var that = this,\n value = that.el.val().toLowerCase(),\n bestMatch = null;\n\n if (!value) {\n return;\n }\n\n $.each(that.suggestions, function (i, suggestion) {\n var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;\n if (foundMatch) {\n bestMatch = suggestion;\n }\n return !foundMatch;\n });\n\n that.signalHint(bestMatch);\n },\n\n signalHint: function (suggestion) {\n var hintValue = '',\n that = this;\n if (suggestion) {\n hintValue = that.currentValue + suggestion.value.substr(that.currentValue.length);\n }\n if (that.hintValue !== hintValue) {\n that.hintValue = hintValue;\n that.hint = suggestion;\n (this.options.onHint || $.noop)(hintValue);\n }\n },\n\n verifySuggestionsFormat: function (suggestions) {\n // If suggestions is string array, convert them to supported format:\n if (suggestions.length && typeof suggestions[0] === 'string') {\n return $.map(suggestions, function (value) {\n return { value: value, data: null };\n });\n }\n\n return suggestions;\n },\n\n processResponse: function (response, originalQuery, cacheKey) {\n var that = this,\n options = that.options,\n result = options.transformResult(response, originalQuery);\n\n result.suggestions = that.verifySuggestionsFormat(result.suggestions);\n\n // Cache results if cache is not disabled:\n if (!options.noCache) {\n that.cachedResponse[cacheKey] = result;\n if (result.suggestions.length === 0) {\n that.badQueries.push(cacheKey);\n }\n }\n\n // Return if originalQuery is not matching current query:\n if (originalQuery !== that.getQuery(that.currentValue)) {\n return;\n }\n\n that.suggestions = result.suggestions;\n that.suggest();\n },\n\n activate: function (index) {\n var that = this,\n activeItem,\n selected = that.classes.selected,\n container = $(that.suggestionsContainer),\n children = container.children();\n\n container.children('.' + selected).removeClass(selected);\n\n that.selectedIndex = index;\n\n if (that.selectedIndex !== -1 && children.length > that.selectedIndex) {\n activeItem = children.get(that.selectedIndex);\n $(activeItem).addClass(selected);\n return activeItem;\n }\n\n return null;\n },\n\n selectHint: function () {\n var that = this,\n i = $.inArray(that.hint, that.suggestions);\n\n that.select(i);\n },\n\n select: function (i) {\n var that = this;\n that.hide();\n that.onSelect(i);\n },\n\n moveUp: function () {\n var that = this;\n\n if (that.selectedIndex === -1) {\n return;\n }\n\n if (that.selectedIndex === 0) {\n $(that.suggestionsContainer).children().first().removeClass(that.classes.selected);\n that.selectedIndex = -1;\n that.el.val(that.currentValue);\n that.findBestHint();\n return;\n }\n\n that.adjustScroll(that.selectedIndex - 1);\n },\n\n moveDown: function () {\n var that = this;\n\n if (that.selectedIndex === (that.suggestions.length - 1)) {\n return;\n }\n\n that.adjustScroll(that.selectedIndex + 1);\n },\n\n adjustScroll: function (index) {\n var that = this,\n activeItem = that.activate(index),\n offsetTop,\n upperBound,\n lowerBound,\n heightDelta = 25;\n\n if (!activeItem) {\n return;\n }\n\n offsetTop = activeItem.offsetTop;\n upperBound = $(that.suggestionsContainer).scrollTop();\n lowerBound = upperBound + that.options.maxHeight - heightDelta;\n\n if (offsetTop < upperBound) {\n $(that.suggestionsContainer).scrollTop(offsetTop);\n } else if (offsetTop > lowerBound) {\n $(that.suggestionsContainer).scrollTop(offsetTop - that.options.maxHeight + heightDelta);\n }\n\n that.el.val(that.getValue(that.suggestions[index].value));\n that.signalHint(null);\n },\n\n onSelect: function (index) {\n var that = this,\n onSelectCallback = that.options.onSelect,\n suggestion = that.suggestions[index];\n\n that.currentValue = that.getValue(suggestion.value);\n that.el.val(that.currentValue);\n that.signalHint(null);\n that.suggestions = [];\n that.selection = suggestion;\n\n if ($.isFunction(onSelectCallback)) {\n onSelectCallback.call(that.element, suggestion);\n }\n },\n\n getValue: function (value) {\n var that = this,\n delimiter = that.options.delimiter,\n currentValue,\n parts;\n\n if (!delimiter) {\n return value;\n }\n\n currentValue = that.currentValue;\n parts = currentValue.split(delimiter);\n\n if (parts.length === 1) {\n return value;\n }\n\n return currentValue.substr(0, currentValue.length - parts[parts.length - 1].length) + value;\n },\n\n dispose: function () {\n var that = this;\n that.el.off('.autocomplete').removeData('autocomplete');\n that.disableKillerFn();\n $(window).off('resize.autocomplete', that.fixPositionCapture);\n $(that.suggestionsContainer).remove();\n }\n };\n\n // Create chainable jQuery plugin:\n $.fn.autocomplete = function (options, args) {\n var dataKey = 'autocomplete';\n // If function invoked without argument return\n // instance of the first matched element:\n if (arguments.length === 0) {\n return this.first().data(dataKey);\n }\n\n return this.each(function () {\n var inputElement = $(this),\n instance = inputElement.data(dataKey);\n\n if (typeof options === 'string') {\n if (instance && typeof instance[options] === 'function') {\n instance[options](args);\n }\n } else {\n // If instance already exists, destroy it:\n if (instance && instance.dispose) {\n instance.dispose();\n }\n instance = new Autocomplete(this, options);\n inputElement.data(dataKey, instance);\n }\n });\n };\n}));\n",";(function ($) {\n 'use strict';\n\n var pluginName = 'selectric',\n classList = 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive Above',\n bindSufix = '.sl',\n defaults = {\n onOpen: $.noop,\n onClose: $.noop,\n onChange: function(elm) { $(elm).change(); },\n maxHeight: 300,\n keySearchTimeout: 500,\n arrowButtonMarkup: '',\n disableOnMobile: true,\n openOnHover: false,\n expandToItemText: false,\n responsive: false,\n preventWindowScroll: true,\n customClass: {\n prefix: pluginName,\n postfixes: classList,\n camelCase: true\n },\n optionsItemBuilder: '{text}' // function(itemData, element, index)\n },\n _utils = {\n // Replace diacritics\n replaceDiacritics: function(s) {\n // /[\\340-\\346]/g, // a\n // /[\\350-\\353]/g, // e\n // /[\\354-\\357]/g, // i\n // /[\\362-\\370]/g, // o\n // /[\\371-\\374]/g, // u\n // /[\\361]/g, // n\n // /[\\347]/g, // c\n // /[\\377]/g // y\n var d = '40-46 50-53 54-57 62-70 71-74 61 47 77'.replace(/\\d+/g, '\\\\3$&').split(' '),\n k = d.length;\n\n while (k--)\n s = s.toLowerCase().replace(RegExp('[' + d[k] + ']', 'g'), 'aeiouncy'.charAt(k));\n\n return s;\n },\n // https://gist.github.com/atesgoral/984375\n format: function(f) {var a=arguments;return(\"\"+f).replace(/{(\\d+|(\\w+))}/g,function(s,i,p){return p&&a[1]?a[1][p]:a[i]})},\n nextEnabledItem: function(selectItems, selected) {\n while ( selectItems[ selected = (selected + 1) % selectItems.length ].disabled ){}\n return selected;\n },\n previousEnabledItem: function(selectItems, selected) {\n while ( selectItems[ selected = (selected > 0 ? selected : selectItems.length) - 1 ].disabled ){}\n return selected;\n }\n },\n $doc = $(document),\n $win = $(window),\n Selectric = function(element, opts) {\n var _this = this,\n $original = $(element),\n $input, $items, $wrapper, $label, $outerWrapper, $li,\n isOpen = false,\n isEnabled = false,\n selected,\n currValue,\n itemsHeight,\n itemsInnerHeight,\n finalWidth,\n optionsLength,\n eventTriggers,\n isMobile = /android|ip(hone|od|ad)/i.test(navigator.userAgent);\n\n function _init(opts) {\n _this.options = $.extend(true, {}, defaults, _this.options, opts);\n _this.classes = {};\n\n // Disable on mobile browsers\n if ( _this.options.disableOnMobile && isMobile ){\n _this.disableOnMobile = true;\n return;\n }\n\n // Preserve data\n _destroy(true);\n\n // Generate classNames for elements\n var customClass = _this.options.customClass,\n postfixes = customClass.postfixes.split(' ');\n\n $.each(classList.split(' '), function(i, elm){\n var c = customClass.prefix + postfixes[i];\n _this.classes[elm.toLowerCase()] = customClass.camelCase ? c : c.replace(/([A-Z])/g, \"-$&\").toLowerCase();\n });\n\n $input = $('').prop('readonly', isMobile);\n $items = $('
    ');\n $wrapper = $('
    ' + _this.options.arrowButtonMarkup + '
    ');\n $label = $('

    ');\n $outerWrapper = $original.wrap('

    ').parent().append($wrapper.prepend($label), $items, $input);\n\n eventTriggers = {\n open : _open,\n close : _close,\n destroy : _destroy,\n refresh : _populate,\n init : _init\n };\n\n $original.on(eventTriggers).wrap('
    ');\n $.extend(_this, eventTriggers);\n\n isEnabled = true;\n\n _populate();\n }\n\n // Generate options markup and event binds\n function _populate() {\n _this.items = [];\n\n var $options = $original.children(),\n _$li = '
      ',\n selectedIndex = $options.filter(':selected').index();\n\n currValue = (selected = ~selectedIndex ? selectedIndex : 0);\n\n if ( optionsLength = $options.length ) {\n // Build options markup\n $options.each(function(i){\n var $elm = $(this),\n optionText = $elm.html(),\n selectDisabled = $elm.prop('disabled'),\n itemBuilder = _this.options.optionsItemBuilder;\n\n _this.items[i] = {\n value : $elm.val(),\n text : optionText,\n slug : _utils.replaceDiacritics(optionText),\n disabled : selectDisabled\n };\n\n _$li += _utils.format('
    • {2}
    • ',\n $.trim([i == currValue ? 'selected' : '', i == optionsLength - 1 ? 'last' : '', selectDisabled ? 'disabled' : ''].join(' ')),\n $.isFunction(itemBuilder) ? itemBuilder(_this.items[i], $elm, i) : _utils.format(itemBuilder, _this.items[i])\n );\n });\n\n $items.html(_$li + '
    ');\n\n $label.html(_this.items[currValue].text);\n }\n\n $wrapper.add($original).off(bindSufix);\n\n $outerWrapper.prop('class', [_this.classes.disabled, _this.classes.wrapper, $original.prop('class').replace(/\\S+/g, pluginName + '-$&'), _this.options.responsive ? _this.classes.responsive : ''].join(' '));\n\n if ( !$original.prop('disabled') ){\n // Not disabled, so... Removing disabled class and bind hover\n $outerWrapper.removeClass(_this.classes.disabled).hover(function(){\n $(this).toggleClass(_this.classes.hover);\n });\n\n // Click on label and :focus on original select will open the options box\n _this.options.openOnHover && $wrapper.on('mouseenter' + bindSufix, _open);\n\n // Toggle open/close\n $wrapper.on('click' + bindSufix, function(e){\n isOpen ? _close() : _open(e);\n });\n\n $input.prop('disabled', false).off().on({\n keypress: _handleSystemKeys,\n keydown: function(e){\n _handleSystemKeys(e);\n\n // Clear search\n clearTimeout(_this.resetStr);\n _this.resetStr = setTimeout(function(){\n $input.val('');\n }, _this.options.keySearchTimeout);\n\n var key = e.keyCode || e.which;\n\n // If it's a directional key\n // 37 => Left\n // 38 => Up\n // 39 => Right\n // 40 => Down\n if ( key > 36 && key < 41 )\n _select(_utils[(key < 39 ? 'previous' : 'next') + 'EnabledItem'](_this.items, selected));\n },\n focusin: function(e){\n // Stupid, but necessary... Prevent the flicker when\n // focusing out and back again in the browser window\n $input.one('blur', function(){\n $input.blur();\n });\n\n isOpen || _open(e);\n }\n }).on('oninput' in $input[0] ? 'input' : 'keyup', function(){\n if ( $input.val().length ){\n // Search in select options\n $.each(_this.items, function(i, elm){\n if ( RegExp('^' + $input.val(), 'i').test(elm.slug) && !elm.disabled ){\n _select(i);\n return false;\n }\n });\n }\n });\n\n // Remove styles from items box\n // Fix incorrect height when refreshed is triggered with fewer options\n $li = $('li', $items.removeAttr('style')).click(function(){\n // The second parameter is to close the box after click\n _select($(this).index(), true);\n\n // Chrome doesn't close options box if select is wrapped with a label\n // We need to 'return false' to avoid that\n return false;\n });\n } else\n $input.prop('disabled', true);\n }\n\n // Behavior when system keys is pressed\n function _handleSystemKeys(e) {\n // Tab / Enter / ESC\n if ( /^(9|13|27)$/.test(e.keyCode || e.which) ) {\n e.stopPropagation();\n _select(selected, true);\n }\n }\n\n // Set options box width/height\n function _calculateOptionsDimensions() {\n var visibleParent = $items.closest(':visible').children(':hidden'),\n maxHeight = _this.options.maxHeight;\n\n // Calculate options box height\n // Set a temporary class on the hidden parent of the element\n visibleParent.addClass(_this.classes.tempshow);\n\n var itemsWidth = $items.outerWidth(),\n wrapperWidth = $wrapper.outerWidth() - (itemsWidth - $items.width());\n\n // Set the dimensions, minimum is wrapper width, expand for long items if option is true\n if ( !_this.options.expandToItemText || wrapperWidth > itemsWidth )\n finalWidth = wrapperWidth;\n else {\n // Make sure the scrollbar width is included\n $items.css('overflow', 'scroll');\n\n // Set a really long width for $outerWrapper\n $outerWrapper.width(9e4);\n finalWidth = $items.width();\n // Set scroll bar to auto\n $items.css('overflow', '');\n $outerWrapper.width('');\n }\n\n $items.width(finalWidth).height() > maxHeight && $items.height(maxHeight);\n\n // Remove the temporary class\n visibleParent.removeClass(_this.classes.tempshow);\n }\n\n // Open the select options box\n function _open(e) {\n if (e){\n e.preventDefault();\n e.stopPropagation();\n }\n\n if (isEnabled){\n _calculateOptionsDimensions();\n\n // Find any other opened instances of select and close it\n $('.' + _this.classes.open).removeClass(_this.classes.open);\n\n isOpen = true;\n itemsHeight = $items.outerHeight(),\n itemsInnerHeight = $items.height();\n\n // Give dummy input focus\n $input.val('').is(':focus') || $input.focus();\n\n $doc.on('click' + bindSufix, _close).on('scroll' + bindSufix, _isInViewport);\n _isInViewport();\n\n // Prevent window scroll when using mouse wheel inside items box\n if ( _this.options.preventWindowScroll ){\n $doc.on('mousewheel' + bindSufix + ' DOMMouseScroll' + bindSufix, '.' + _this.classes.items, function(e){\n var orgEvent = e.originalEvent,\n scrollTop = $items.scrollTop(),\n deltaY = 0;\n\n if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }\n if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }\n if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }\n if ( 'deltaY' in orgEvent ) { deltaY = orgEvent.deltaY * -1; }\n\n if ( scrollTop == (this.scrollHeight - itemsInnerHeight) && deltaY < 0 || scrollTop == 0 && deltaY > 0 )\n e.preventDefault();\n });\n }\n\n // Delay close effect when openOnHover is true\n if ( _this.options.openOnHover ){\n clearTimeout(_this.closeTimer);\n $outerWrapper.one('mouseleave' + bindSufix, function(){\n _this.closeTimer = setTimeout(_close, 500);\n });\n }\n\n // Toggle options box visibility\n $outerWrapper.addClass(_this.classes.open);\n _detectItemVisibility(selected);\n\n _this.options.onOpen(element);\n }\n }\n\n // Detect is the options box is inside the window\n function _isInViewport() {\n _calculateOptionsDimensions();\n $outerWrapper.toggleClass(_this.classes.above, $outerWrapper.offset().top + $outerWrapper.outerHeight() + itemsHeight > $win.scrollTop() + $win.height());\n }\n\n // Close the select options box\n function _close(e) {\n if ( !e && currValue != selected ){\n var text = _this.items[selected].text;\n\n // Apply changed value to original select\n $original\n .prop('selectedIndex', currValue = selected)\n .data('value', text);\n\n _this.options.onChange(element);\n\n // Change label text\n $label.html(text);\n }\n\n // Remove click on document\n $doc.off(bindSufix);\n\n // Remove visible class to hide options box\n $outerWrapper.removeClass(_this.classes.open);\n\n isOpen = false;\n\n _this.options.onClose(element);\n }\n\n // Select option\n function _select(index, close) {\n // If element is disabled, can't select it\n if ( !_this.items[selected = index].disabled ){\n // If 'close' is false (default), the options box won't close after\n // each selected item, this is necessary for keyboard navigation\n $li.removeClass('selected').eq(index).addClass('selected');\n _detectItemVisibility(index);\n close && _close();\n }\n }\n\n // Detect if currently selected option is visible and scroll the options box to show it\n function _detectItemVisibility(index) {\n var liHeight = $li.eq(index).outerHeight(),\n liTop = $li[index].offsetTop,\n itemsScrollTop = $items.scrollTop(),\n scrollT = liTop + liHeight * 2;\n\n $items.scrollTop(\n scrollT > itemsScrollTop + itemsHeight ? scrollT - itemsHeight :\n liTop - liHeight < itemsScrollTop ? liTop - liHeight :\n itemsScrollTop\n );\n }\n\n // Unbind and remove\n function _destroy(preserveData) {\n if ( isEnabled ){\n $items.add($wrapper).add($input).remove();\n !preserveData && $original.removeData(pluginName).removeData('value');\n $original.off(bindSufix).off(eventTriggers).unwrap().unwrap();\n isEnabled = false;\n }\n }\n\n _init(opts);\n };\n\n // A really lightweight plugin wrapper around the constructor,\n // preventing against multiple instantiations\n $.fn[pluginName] = function(args) {\n return this.each(function() {\n var data = $.data(this, pluginName);\n\n if ( data && !data.disableOnMobile )\n (''+args === args && data[args]) ? data[args]() : data.init(args);\n else\n $.data(this, pluginName, new Selectric(this, args));\n });\n };\n}(jQuery));\n","// ==ClosureCompiler==\n// @compilation_level ADVANCED_OPTIMIZATIONS\n// @externs_url http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/maps/google_maps_api_v3_3.js\n// ==/ClosureCompiler==\n\n/**\n * @name MarkerClusterer for Google Maps v3\n * @version version 1.0\n * @author Luke Mahe\n * @fileoverview\n * The library creates and manages per-zoom-level clusters for large amounts of\n * markers.\n *
    \n * This is a v3 implementation of the\n * v2 MarkerClusterer.\n */\n\n/**\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * A Marker Clusterer that clusters markers.\n *\n * @param {google.maps.Map} map The Google map to attach to.\n * @param {Array.=} opt_markers Optional markers to add to\n * the cluster.\n * @param {Object=} opt_options support the following options:\n * 'gridSize': (number) The grid size of a cluster in pixels.\n * 'maxZoom': (number) The maximum zoom level that a marker can be part of a\n * cluster.\n * 'zoomOnClick': (boolean) Whether the default behaviour of clicking on a\n * cluster is to zoom into it.\n * 'averageCenter': (boolean) Wether the center of each cluster should be\n * the average of all markers in the cluster.\n * 'minimumClusterSize': (number) The minimum number of markers to be in a\n * cluster before the markers are hidden and a count\n * is shown.\n * 'styles': (object) An object that has style properties:\n * 'url': (string) The image url.\n * 'height': (number) The image height.\n * 'width': (number) The image width.\n * 'anchor': (Array) The anchor position of the label text.\n * 'textColor': (string) The text color.\n * 'textSize': (number) The text size.\n * 'backgroundPosition': (string) The position of the backgound x, y.\n * 'iconAnchor': (Array) The anchor position of the icon x, y.\n * @constructor\n * @extends google.maps.OverlayView\n */\nfunction MarkerClusterer(map, opt_markers, opt_options) {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n this.extend(MarkerClusterer, google.maps.OverlayView);\n this.map_ = map;\n\n /**\n * @type {Array.}\n * @private\n */\n this.markers_ = [];\n\n /**\n * @type {Array.}\n */\n this.clusters_ = [];\n\n this.sizes = [53, 56, 66, 78, 90];\n\n /**\n * @private\n */\n this.styles_ = [];\n\n /**\n * @type {boolean}\n * @private\n */\n this.ready_ = false;\n\n var options = opt_options || {};\n\n /**\n * @type {number}\n * @private\n */\n this.gridSize_ = options['gridSize'] || 60;\n\n /**\n * @private\n */\n this.minClusterSize_ = options['minimumClusterSize'] || 2;\n\n\n /**\n * @type {?number}\n * @private\n */\n this.maxZoom_ = options['maxZoom'] || null;\n\n this.styles_ = options['styles'] || [];\n\n /**\n * @type {string}\n * @private\n */\n this.imagePath_ = options['imagePath'] ||\n this.MARKER_CLUSTER_IMAGE_PATH_;\n\n /**\n * @type {string}\n * @private\n */\n this.imageExtension_ = options['imageExtension'] ||\n this.MARKER_CLUSTER_IMAGE_EXTENSION_;\n\n /**\n * @type {boolean}\n * @private\n */\n this.zoomOnClick_ = true;\n\n if (options['zoomOnClick'] != undefined) {\n this.zoomOnClick_ = options['zoomOnClick'];\n }\n\n /**\n * @type {boolean}\n * @private\n */\n this.averageCenter_ = false;\n\n if (options['averageCenter'] != undefined) {\n this.averageCenter_ = options['averageCenter'];\n }\n\n this.setupStyles_();\n\n this.setMap(map);\n\n /**\n * @type {number}\n * @private\n */\n this.prevZoom_ = this.map_.getZoom();\n\n // Add the map event listeners\n var that = this;\n google.maps.event.addListener(this.map_, 'zoom_changed', function() {\n var zoom = that.map_.getZoom();\n\n if (that.prevZoom_ != zoom) {\n that.prevZoom_ = zoom;\n that.resetViewport();\n }\n });\n\n google.maps.event.addListener(this.map_, 'idle', function() {\n that.redraw();\n });\n\n // Finally, add the markers\n if (opt_markers && opt_markers.length) {\n this.addMarkers(opt_markers, false);\n }\n}\n\n\n/**\n * The marker cluster image path.\n *\n * @type {string}\n * @private\n */\nMarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ =\n 'https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/' +\n 'images/m';\n\n\n/**\n * The marker cluster image path.\n *\n * @type {string}\n * @private\n */\nMarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_ = 'png';\n\n\n/**\n * Extends a objects prototype by anothers.\n *\n * @param {Object} obj1 The object to be extended.\n * @param {Object} obj2 The object to extend with.\n * @return {Object} The new extended object.\n * @ignore\n */\nMarkerClusterer.prototype.extend = function(obj1, obj2) {\n return (function(object) {\n for (var property in object.prototype) {\n this.prototype[property] = object.prototype[property];\n }\n return this;\n }).apply(obj1, [obj2]);\n};\n\n\n/**\n * Implementaion of the interface method.\n * @ignore\n */\nMarkerClusterer.prototype.onAdd = function() {\n this.setReady_(true);\n};\n\n/**\n * Implementaion of the interface method.\n * @ignore\n */\nMarkerClusterer.prototype.draw = function() {};\n\n/**\n * Sets up the styles object.\n *\n * @private\n */\nMarkerClusterer.prototype.setupStyles_ = function() {\n if (this.styles_.length) {\n return;\n }\n\n for (var i = 0, size; size = this.sizes[i]; i++) {\n this.styles_.push({\n url: this.imagePath_ + (i + 1) + '.' + this.imageExtension_,\n height: size,\n width: size\n });\n }\n};\n\n/**\n * Fit the map to the bounds of the markers in the clusterer.\n */\nMarkerClusterer.prototype.fitMapToMarkers = function() {\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (var i = 0, marker; marker = markers[i]; i++) {\n bounds.extend(marker.getPosition());\n }\n\n this.map_.fitBounds(bounds);\n};\n\n\n/**\n * Sets the styles.\n *\n * @param {Object} styles The style to set.\n */\nMarkerClusterer.prototype.setStyles = function(styles) {\n this.styles_ = styles;\n};\n\n\n/**\n * Gets the styles.\n *\n * @return {Object} The styles object.\n */\nMarkerClusterer.prototype.getStyles = function() {\n return this.styles_;\n};\n\n\n/**\n * Whether zoom on click is set.\n *\n * @return {boolean} True if zoomOnClick_ is set.\n */\nMarkerClusterer.prototype.isZoomOnClick = function() {\n return this.zoomOnClick_;\n};\n\n/**\n * Whether average center is set.\n *\n * @return {boolean} True if averageCenter_ is set.\n */\nMarkerClusterer.prototype.isAverageCenter = function() {\n return this.averageCenter_;\n};\n\n\n/**\n * Returns the array of markers in the clusterer.\n *\n * @return {Array.} The markers.\n */\nMarkerClusterer.prototype.getMarkers = function() {\n return this.markers_;\n};\n\n\n/**\n * Returns the number of markers in the clusterer\n *\n * @return {Number} The number of markers.\n */\nMarkerClusterer.prototype.getTotalMarkers = function() {\n return this.markers_.length;\n};\n\n\n/**\n * Sets the max zoom for the clusterer.\n *\n * @param {number} maxZoom The max zoom level.\n */\nMarkerClusterer.prototype.setMaxZoom = function(maxZoom) {\n this.maxZoom_ = maxZoom;\n};\n\n\n/**\n * Gets the max zoom for the clusterer.\n *\n * @return {number} The max zoom level.\n */\nMarkerClusterer.prototype.getMaxZoom = function() {\n return this.maxZoom_;\n};\n\n\n/**\n * The function for calculating the cluster icon image.\n *\n * @param {Array.} markers The markers in the clusterer.\n * @param {number} numStyles The number of styles available.\n * @return {Object} A object properties: 'text' (string) and 'index' (number).\n * @private\n */\nMarkerClusterer.prototype.calculator_ = function(markers, numStyles) {\n var index = 0;\n var count = markers.length;\n var dv = count;\n while (dv !== 0) {\n dv = parseInt(dv / 10, 10);\n index++;\n }\n\n index = Math.min(index, numStyles);\n return {\n text: count,\n index: index\n };\n};\n\n\n/**\n * Set the calculator function.\n *\n * @param {function(Array, number)} calculator The function to set as the\n * calculator. The function should return a object properties:\n * 'text' (string) and 'index' (number).\n *\n */\nMarkerClusterer.prototype.setCalculator = function(calculator) {\n this.calculator_ = calculator;\n};\n\n\n/**\n * Get the calculator function.\n *\n * @return {function(Array, number)} the calculator function.\n */\nMarkerClusterer.prototype.getCalculator = function() {\n return this.calculator_;\n};\n\n\n/**\n * Add an array of markers to the clusterer.\n *\n * @param {Array.} markers The markers to add.\n * @param {boolean=} opt_nodraw Whether to redraw the clusters.\n */\nMarkerClusterer.prototype.addMarkers = function(markers, opt_nodraw) {\n for (var i = 0, marker; marker = markers[i]; i++) {\n this.pushMarkerTo_(marker);\n }\n if (!opt_nodraw) {\n this.redraw();\n }\n};\n\n\n/**\n * Pushes a marker to the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @private\n */\nMarkerClusterer.prototype.pushMarkerTo_ = function(marker) {\n marker.isAdded = false;\n if (marker['draggable']) {\n // If the marker is draggable add a listener so we update the clusters on\n // the drag end.\n var that = this;\n google.maps.event.addListener(marker, 'dragend', function() {\n marker.isAdded = false;\n that.repaint();\n });\n }\n this.markers_.push(marker);\n};\n\n\n/**\n * Adds a marker to the clusterer and redraws if needed.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @param {boolean=} opt_nodraw Whether to redraw the clusters.\n */\nMarkerClusterer.prototype.addMarker = function(marker, opt_nodraw) {\n this.pushMarkerTo_(marker);\n if (!opt_nodraw) {\n this.redraw();\n }\n};\n\n\n/**\n * Removes a marker and returns true if removed, false if not\n *\n * @param {google.maps.Marker} marker The marker to remove\n * @return {boolean} Whether the marker was removed or not\n * @private\n */\nMarkerClusterer.prototype.removeMarker_ = function(marker) {\n var index = -1;\n if (this.markers_.indexOf) {\n index = this.markers_.indexOf(marker);\n } else {\n for (var i = 0, m; m = this.markers_[i]; i++) {\n if (m == marker) {\n index = i;\n break;\n }\n }\n }\n\n if (index == -1) {\n // Marker is not in our list of markers.\n return false;\n }\n\n marker.setMap(null);\n\n this.markers_.splice(index, 1);\n\n return true;\n};\n\n\n/**\n * Remove a marker from the cluster.\n *\n * @param {google.maps.Marker} marker The marker to remove.\n * @param {boolean=} opt_nodraw Optional boolean to force no redraw.\n * @return {boolean} True if the marker was removed.\n */\nMarkerClusterer.prototype.removeMarker = function(marker, opt_nodraw) {\n var removed = this.removeMarker_(marker);\n\n if (!opt_nodraw && removed) {\n this.resetViewport();\n this.redraw();\n return true;\n } else {\n return false;\n }\n};\n\n\n/**\n * Removes an array of markers from the cluster.\n *\n * @param {Array.} markers The markers to remove.\n * @param {boolean=} opt_nodraw Optional boolean to force no redraw.\n */\nMarkerClusterer.prototype.removeMarkers = function(markers, opt_nodraw) {\n var removed = false;\n\n for (var i = 0, marker; marker = markers[i]; i++) {\n var r = this.removeMarker_(marker);\n removed = removed || r;\n }\n\n if (!opt_nodraw && removed) {\n this.resetViewport();\n this.redraw();\n return true;\n }\n};\n\n\n/**\n * Sets the clusterer's ready state.\n *\n * @param {boolean} ready The state.\n * @private\n */\nMarkerClusterer.prototype.setReady_ = function(ready) {\n if (!this.ready_) {\n this.ready_ = ready;\n this.createClusters_();\n }\n};\n\n\n/**\n * Returns the number of clusters in the clusterer.\n *\n * @return {number} The number of clusters.\n */\nMarkerClusterer.prototype.getTotalClusters = function() {\n return this.clusters_.length;\n};\n\n\n/**\n * Returns the google map that the clusterer is associated with.\n *\n * @return {google.maps.Map} The map.\n */\nMarkerClusterer.prototype.getMap = function() {\n return this.map_;\n};\n\n\n/**\n * Sets the google map that the clusterer is associated with.\n *\n * @param {google.maps.Map} map The map.\n */\nMarkerClusterer.prototype.setMap = function(map) {\n this.map_ = map;\n};\n\n\n/**\n * Returns the size of the grid.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getGridSize = function() {\n return this.gridSize_;\n};\n\n\n/**\n * Sets the size of the grid.\n *\n * @param {number} size The grid size.\n */\nMarkerClusterer.prototype.setGridSize = function(size) {\n this.gridSize_ = size;\n};\n\n\n/**\n * Returns the min cluster size.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getMinClusterSize = function() {\n return this.minClusterSize_;\n};\n\n/**\n * Sets the min cluster size.\n *\n * @param {number} size The grid size.\n */\nMarkerClusterer.prototype.setMinClusterSize = function(size) {\n this.minClusterSize_ = size;\n};\n\n\n/**\n * Extends a bounds object by the grid size.\n *\n * @param {google.maps.LatLngBounds} bounds The bounds to extend.\n * @return {google.maps.LatLngBounds} The extended bounds.\n */\nMarkerClusterer.prototype.getExtendedBounds = function(bounds) {\n var projection = this.getProjection();\n\n // Turn the bounds into latlng.\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),\n bounds.getNorthEast().lng());\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),\n bounds.getSouthWest().lng());\n\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(tr);\n trPix.x += this.gridSize_;\n trPix.y -= this.gridSize_;\n\n var blPix = projection.fromLatLngToDivPixel(bl);\n blPix.x -= this.gridSize_;\n blPix.y += this.gridSize_;\n\n // Convert the pixel points back to LatLng\n var ne = projection.fromDivPixelToLatLng(trPix);\n var sw = projection.fromDivPixelToLatLng(blPix);\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(ne);\n bounds.extend(sw);\n\n return bounds;\n};\n\n\n/**\n * Determins if a marker is contained in a bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @param {google.maps.LatLngBounds} bounds The bounds to check against.\n * @return {boolean} True if the marker is in the bounds.\n * @private\n */\nMarkerClusterer.prototype.isMarkerInBounds_ = function(marker, bounds) {\n return bounds.contains(marker.getPosition());\n};\n\n\n/**\n * Clears all clusters and markers from the clusterer.\n */\nMarkerClusterer.prototype.clearMarkers = function() {\n this.resetViewport(true);\n\n // Set the markers a empty array.\n this.markers_ = [];\n};\n\n\n/**\n * Clears all existing clusters and recreates them.\n * @param {boolean} opt_hide To also hide the marker.\n */\nMarkerClusterer.prototype.resetViewport = function(opt_hide) {\n // Remove all the clusters\n for (var i = 0, cluster; cluster = this.clusters_[i]; i++) {\n cluster.remove();\n }\n\n // Reset the markers to not be added and to be invisible.\n for (var i = 0, marker; marker = this.markers_[i]; i++) {\n marker.isAdded = false;\n if (opt_hide) {\n marker.setMap(null);\n }\n }\n\n this.clusters_ = [];\n};\n\n/**\n *\n */\nMarkerClusterer.prototype.repaint = function() {\n var oldClusters = this.clusters_.slice();\n this.clusters_.length = 0;\n this.resetViewport();\n this.redraw();\n\n // Remove the old clusters.\n // Do it in a timeout so the other clusters have been drawn first.\n window.setTimeout(function() {\n for (var i = 0, cluster; cluster = oldClusters[i]; i++) {\n cluster.remove();\n }\n }, 0);\n};\n\n\n/**\n * Redraws the clusters.\n */\nMarkerClusterer.prototype.redraw = function() {\n this.createClusters_();\n};\n\n\n/**\n * Calculates the distance between two latlng locations in km.\n * @see http://www.movable-type.co.uk/scripts/latlong.html\n *\n * @param {google.maps.LatLng} p1 The first lat lng point.\n * @param {google.maps.LatLng} p2 The second lat lng point.\n * @return {number} The distance between the two points in km.\n * @private\n*/\nMarkerClusterer.prototype.distanceBetweenPoints_ = function(p1, p2) {\n if (!p1 || !p2) {\n return 0;\n }\n\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n return d;\n};\n\n\n/**\n * Add a marker to a cluster, or creates a new cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @private\n */\nMarkerClusterer.prototype.addToClosestCluster_ = function(marker) {\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n var pos = marker.getPosition();\n for (var i = 0, cluster; cluster = this.clusters_[i]; i++) {\n var center = cluster.getCenter();\n if (center) {\n var d = this.distanceBetweenPoints_(center, marker.getPosition());\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n var cluster = new Cluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n};\n\n\n/**\n * Creates the clusters.\n *\n * @private\n */\nMarkerClusterer.prototype.createClusters_ = function() {\n if (!this.ready_) {\n return;\n }\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n var mapBounds = new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),\n this.map_.getBounds().getNorthEast());\n var bounds = this.getExtendedBounds(mapBounds);\n\n for (var i = 0, marker; marker = this.markers_[i]; i++) {\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n this.addToClosestCluster_(marker);\n }\n }\n};\n\n\n/**\n * A cluster that contains markers.\n *\n * @param {MarkerClusterer} markerClusterer The markerclusterer that this\n * cluster is associated with.\n * @constructor\n * @ignore\n */\nfunction Cluster(markerClusterer) {\n this.markerClusterer_ = markerClusterer;\n this.map_ = markerClusterer.getMap();\n this.gridSize_ = markerClusterer.getGridSize();\n this.minClusterSize_ = markerClusterer.getMinClusterSize();\n this.averageCenter_ = markerClusterer.isAverageCenter();\n this.center_ = null;\n this.markers_ = [];\n this.bounds_ = null;\n this.clusterIcon_ = new ClusterIcon(this, markerClusterer.getStyles(),\n markerClusterer.getGridSize());\n}\n\n/**\n * Determins if a marker is already added to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker is already added.\n */\nCluster.prototype.isMarkerAlreadyAdded = function(marker) {\n if (this.markers_.indexOf) {\n return this.markers_.indexOf(marker) != -1;\n } else {\n for (var i = 0, m; m = this.markers_[i]; i++) {\n if (m == marker) {\n return true;\n }\n }\n }\n return false;\n};\n\n\n/**\n * Add a marker the cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @return {boolean} True if the marker was added.\n */\nCluster.prototype.addMarker = function(marker) {\n if (this.isMarkerAlreadyAdded(marker)) {\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l-1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l-1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n\n marker.isAdded = true;\n this.markers_.push(marker);\n\n var len = this.markers_.length;\n if (len < this.minClusterSize_ && marker.getMap() != this.map_) {\n // Min cluster size not reached so show the marker.\n marker.setMap(this.map_);\n }\n\n if (len == this.minClusterSize_) {\n // Hide the markers that were showing.\n for (var i = 0; i < len; i++) {\n this.markers_[i].setMap(null);\n }\n }\n\n if (len >= this.minClusterSize_) {\n marker.setMap(null);\n }\n\n this.updateIcon();\n return true;\n};\n\n\n/**\n * Returns the marker clusterer that the cluster is associated with.\n *\n * @return {MarkerClusterer} The associated marker clusterer.\n */\nCluster.prototype.getMarkerClusterer = function() {\n return this.markerClusterer_;\n};\n\n\n/**\n * Returns the bounds of the cluster.\n *\n * @return {google.maps.LatLngBounds} the cluster bounds.\n */\nCluster.prototype.getBounds = function() {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n var markers = this.getMarkers();\n for (var i = 0, marker; marker = markers[i]; i++) {\n bounds.extend(marker.getPosition());\n }\n return bounds;\n};\n\n\n/**\n * Removes the cluster\n */\nCluster.prototype.remove = function() {\n this.clusterIcon_.remove();\n this.markers_.length = 0;\n delete this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster.\n *\n * @return {number} The cluster center.\n */\nCluster.prototype.getSize = function() {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the center of the cluster.\n *\n * @return {Array.} The cluster center.\n */\nCluster.prototype.getMarkers = function() {\n return this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster.\n *\n * @return {google.maps.LatLng} The cluster center.\n */\nCluster.prototype.getCenter = function() {\n return this.center_;\n};\n\n\n/**\n * Calculated the extended bounds of the cluster with the grid.\n *\n * @private\n */\nCluster.prototype.calculateBounds_ = function() {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n};\n\n\n/**\n * Determines if a marker lies in the clusters bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker lies in the bounds.\n */\nCluster.prototype.isMarkerInClusterBounds = function(marker) {\n return this.bounds_.contains(marker.getPosition());\n};\n\n\n/**\n * Returns the map that the cluster is associated with.\n *\n * @return {google.maps.Map} The map.\n */\nCluster.prototype.getMap = function() {\n return this.map_;\n};\n\n\n/**\n * Updates the cluster icon\n */\nCluster.prototype.updateIcon = function() {\n var zoom = this.map_.getZoom();\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz && zoom > mz) {\n // The zoom is greater than our max zoom so show all the markers in cluster.\n for (var i = 0, marker; marker = this.markers_[i]; i++) {\n marker.setMap(this.map_);\n }\n return;\n }\n\n if (this.markers_.length < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n var numStyles = this.markerClusterer_.getStyles().length;\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.setSums(sums);\n this.clusterIcon_.show();\n};\n\n\n/**\n * A cluster icon\n *\n * @param {Cluster} cluster The cluster to be associated with.\n * @param {Object} styles An object that has style properties:\n * 'url': (string) The image url.\n * 'height': (number) The image height.\n * 'width': (number) The image width.\n * 'anchor': (Array) The anchor position of the label text.\n * 'textColor': (string) The text color.\n * 'textSize': (number) The text size.\n * 'backgroundPosition: (string) The background postition x, y.\n * @param {number=} opt_padding Optional padding to apply to the cluster icon.\n * @constructor\n * @extends google.maps.OverlayView\n * @ignore\n */\nfunction ClusterIcon(cluster, styles, opt_padding) {\n cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);\n\n this.styles_ = styles;\n this.padding_ = opt_padding || 0;\n this.cluster_ = cluster;\n this.center_ = null;\n this.map_ = cluster.getMap();\n this.div_ = null;\n this.sums_ = null;\n this.visible_ = false;\n\n this.setMap(this.map_);\n}\n\n\n/**\n * Triggers the clusterclick event and zoom's if the option is set.\n *\n * @param {google.maps.MouseEvent} event The event to propagate\n */\nClusterIcon.prototype.triggerClusterClick = function(event) {\n var markerClusterer = this.cluster_.getMarkerClusterer();\n\n // Trigger the clusterclick event.\n google.maps.event.trigger(markerClusterer, 'clusterclick', this.cluster_, event);\n\n if (markerClusterer.isZoomOnClick()) {\n // Zoom into the cluster.\n this.map_.fitBounds(this.cluster_.getBounds());\n }\n};\n\n\n/**\n * Adding the cluster icon to the dom.\n * @ignore\n */\nClusterIcon.prototype.onAdd = function() {\n this.div_ = document.createElement('DIV');\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n this.div_.innerHTML = this.sums_.text;\n }\n\n var panes = this.getPanes();\n panes.overlayMouseTarget.appendChild(this.div_);\n\n var that = this;\n google.maps.event.addDomListener(this.div_, 'click', function(event) {\n that.triggerClusterClick(event);\n });\n};\n\n\n/**\n * Returns the position to place the div dending on the latlng.\n *\n * @param {google.maps.LatLng} latlng The position in latlng.\n * @return {google.maps.Point} The position in pixels.\n * @private\n */\nClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n\n if (typeof this.iconAnchor_ === 'object' && this.iconAnchor_.length === 2) {\n pos.x -= this.iconAnchor_[0];\n pos.y -= this.iconAnchor_[1];\n } else {\n pos.x -= parseInt(this.width_ / 2, 10);\n pos.y -= parseInt(this.height_ / 2, 10);\n }\n return pos;\n};\n\n\n/**\n * Draw the icon.\n * @ignore\n */\nClusterIcon.prototype.draw = function() {\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.top = pos.y + 'px';\n this.div_.style.left = pos.x + 'px';\n }\n};\n\n\n/**\n * Hide the icon.\n */\nClusterIcon.prototype.hide = function() {\n if (this.div_) {\n this.div_.style.display = 'none';\n }\n this.visible_ = false;\n};\n\n\n/**\n * Position and show the icon.\n */\nClusterIcon.prototype.show = function() {\n if (this.div_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n this.div_.style.display = '';\n }\n this.visible_ = true;\n};\n\n\n/**\n * Remove the icon from the map\n */\nClusterIcon.prototype.remove = function() {\n this.setMap(null);\n};\n\n\n/**\n * Implementation of the onRemove interface.\n * @ignore\n */\nClusterIcon.prototype.onRemove = function() {\n if (this.div_ && this.div_.parentNode) {\n this.hide();\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n\n\n/**\n * Set the sums of the icon.\n *\n * @param {Object} sums The sums containing:\n * 'text': (string) The text to display in the icon.\n * 'index': (number) The style index of the icon.\n */\nClusterIcon.prototype.setSums = function(sums) {\n this.sums_ = sums;\n this.text_ = sums.text;\n this.index_ = sums.index;\n if (this.div_) {\n this.div_.innerHTML = sums.text;\n }\n\n this.useStyle();\n};\n\n\n/**\n * Sets the icon to the the styles.\n */\nClusterIcon.prototype.useStyle = function() {\n var index = Math.max(0, this.sums_.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n var style = this.styles_[index];\n this.url_ = style['url'];\n this.height_ = style['height'];\n this.width_ = style['width'];\n this.textColor_ = style['textColor'];\n this.anchor_ = style['anchor'];\n this.textSize_ = style['textSize'];\n this.backgroundPosition_ = style['backgroundPosition'];\n this.iconAnchor_ = style['iconAnchor'];\n};\n\n\n/**\n * Sets the center of the icon.\n *\n * @param {google.maps.LatLng} center The latlng to set as the center.\n */\nClusterIcon.prototype.setCenter = function(center) {\n this.center_ = center;\n};\n\n\n/**\n * Create the css text based on the position of the icon.\n *\n * @param {google.maps.Point} pos The position.\n * @return {string} The css style text.\n */\nClusterIcon.prototype.createCss = function(pos) {\n var style = [];\n style.push('background-image:url(' + this.url_ + ');');\n var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';\n style.push('background-position:' + backgroundPosition + ';');\n\n if (typeof this.anchor_ === 'object') {\n if (typeof this.anchor_[0] === 'number' && this.anchor_[0] > 0 &&\n this.anchor_[0] < this.height_) {\n style.push('height:' + (this.height_ - this.anchor_[0]) +\n 'px; padding-top:' + this.anchor_[0] + 'px;');\n } else if (typeof this.anchor_[0] === 'number' && this.anchor_[0] < 0 &&\n -this.anchor_[0] < this.height_) {\n style.push('height:' + this.height_ + 'px; line-height:' + (this.height_ + this.anchor_[0]) +\n 'px;');\n } else {\n style.push('height:' + this.height_ + 'px; line-height:' + this.height_ +\n 'px;');\n }\n if (typeof this.anchor_[1] === 'number' && this.anchor_[1] > 0 &&\n this.anchor_[1] < this.width_) {\n style.push('width:' + (this.width_ - this.anchor_[1]) +\n 'px; padding-left:' + this.anchor_[1] + 'px;');\n } else {\n style.push('width:' + this.width_ + 'px; text-align:center;');\n }\n } else {\n style.push('height:' + this.height_ + 'px; line-height:' +\n this.height_ + 'px; width:' + this.width_ + 'px; text-align:center;');\n }\n\n var txtColor = this.textColor_ ? this.textColor_ : 'black';\n var txtSize = this.textSize_ ? this.textSize_ : 11;\n\n style.push('cursor:pointer; top:' + pos.y + 'px; left:' +\n pos.x + 'px; color:' + txtColor + '; position:absolute; font-size:' +\n txtSize + 'px; font-family:Arial,sans-serif; font-weight:bold');\n return style.join('');\n};\n\n\n// Export Symbols for Closure\n// If you are not going to compile with closure then you can remove the\n// code below.\nwindow['MarkerClusterer'] = MarkerClusterer;\nMarkerClusterer.prototype['addMarker'] = MarkerClusterer.prototype.addMarker;\nMarkerClusterer.prototype['addMarkers'] = MarkerClusterer.prototype.addMarkers;\nMarkerClusterer.prototype['clearMarkers'] =\n MarkerClusterer.prototype.clearMarkers;\nMarkerClusterer.prototype['fitMapToMarkers'] =\n MarkerClusterer.prototype.fitMapToMarkers;\nMarkerClusterer.prototype['getCalculator'] =\n MarkerClusterer.prototype.getCalculator;\nMarkerClusterer.prototype['getGridSize'] =\n MarkerClusterer.prototype.getGridSize;\nMarkerClusterer.prototype['getExtendedBounds'] =\n MarkerClusterer.prototype.getExtendedBounds;\nMarkerClusterer.prototype['getMap'] = MarkerClusterer.prototype.getMap;\nMarkerClusterer.prototype['getMarkers'] = MarkerClusterer.prototype.getMarkers;\nMarkerClusterer.prototype['getMaxZoom'] = MarkerClusterer.prototype.getMaxZoom;\nMarkerClusterer.prototype['getStyles'] = MarkerClusterer.prototype.getStyles;\nMarkerClusterer.prototype['getTotalClusters'] =\n MarkerClusterer.prototype.getTotalClusters;\nMarkerClusterer.prototype['getTotalMarkers'] =\n MarkerClusterer.prototype.getTotalMarkers;\nMarkerClusterer.prototype['redraw'] = MarkerClusterer.prototype.redraw;\nMarkerClusterer.prototype['removeMarker'] =\n MarkerClusterer.prototype.removeMarker;\nMarkerClusterer.prototype['removeMarkers'] =\n MarkerClusterer.prototype.removeMarkers;\nMarkerClusterer.prototype['resetViewport'] =\n MarkerClusterer.prototype.resetViewport;\nMarkerClusterer.prototype['repaint'] =\n MarkerClusterer.prototype.repaint;\nMarkerClusterer.prototype['setCalculator'] =\n MarkerClusterer.prototype.setCalculator;\nMarkerClusterer.prototype['setGridSize'] =\n MarkerClusterer.prototype.setGridSize;\nMarkerClusterer.prototype['setMaxZoom'] =\n MarkerClusterer.prototype.setMaxZoom;\nMarkerClusterer.prototype['onAdd'] = MarkerClusterer.prototype.onAdd;\nMarkerClusterer.prototype['draw'] = MarkerClusterer.prototype.draw;\n\nCluster.prototype['getCenter'] = Cluster.prototype.getCenter;\nCluster.prototype['getSize'] = Cluster.prototype.getSize;\nCluster.prototype['getMarkers'] = Cluster.prototype.getMarkers;\n\nClusterIcon.prototype['onAdd'] = ClusterIcon.prototype.onAdd;\nClusterIcon.prototype['draw'] = ClusterIcon.prototype.draw;\nClusterIcon.prototype['onRemove'] = ClusterIcon.prototype.onRemove;\n"]}