"use strict";function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function storageAvailable(n){var t,r;try{return t=window[n],r="__storage_test__",t.setItem(r,r),t.removeItem(r),!0}catch(i){return i instanceof DOMException&&(i.code===22||i.code===1014||i.name==="QuotaExceededError"||i.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0}}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function resultMessage(n){var t,i;if(n.Type&&n.Message&&n.CanShow){t="";switch(n.Type){case ResultType.Create:t="Create";break;case ResultType.GetFacility:t="Get facility";break;case ResultType.GetUserInfo:t="Get user info";break;case ResultType.LetUsKnow:t="Let us know";break;case ResultType.Login:t="Login";break;case ResultType.Register:t="Register";break;case ResultType.Save:t="Save";break;case ResultType.Update:t="Update";break;case ResultType.ForgotPassword:t="Forgot password";break;case ResultType.LogOut:t="Log out";break;case ResultType.ChangePassword:t="Change password";break;case ResultType.ChangeEmail:t="Change email";break;case ResultType.Delete:t="Delete"}t+=n.IsError?" failed":n.IsSuccess?" successful":"";Messages.display(n.IsSuccess?MessageType.success:n.IsError?MessageType.error:MessageType.info,t,n.Message,1e4)}else n.IsError&&n.ValidationErrors&&n.ValidationErrors.length>0&&(i="",n.ValidationErrors.forEach(function(n){return i+=n+" "}),Messages.display(MessageType.error,null,i,1e4))}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _typeof(n){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_typeof(n)}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _typeof(n){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_typeof(n)}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _typeof(n){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_typeof(n)}function _wrapRegExp(){function i(n,i,u){var f=r.call(this,n,i);return t.set(f,u||t.get(n)),f}function u(n,i){var r=t.get(i);return Object.keys(r).reduce(function(t,i){return t[i]=n[r[i]],t},Object.create(null))}_wrapRegExp=function(n,t){return new i(n,undefined,t)};var r=_wrapNativeSuper(RegExp),n=RegExp.prototype,t=new WeakMap;return _inherits(i,r),i.prototype.exec=function(t){var i=n.exec.call(this,t);return i&&(i.groups=u(i,this)),i},i.prototype[Symbol.replace]=function(i,r){var f,e;return typeof r=="string"?(f=t.get(this),n[Symbol.replace].call(this,i,r.replace(/\$<([^>]+)>/g,function(n,t){return"$"+f[t]}))):typeof r=="function"?(e=this,n[Symbol.replace].call(this,i,function(){var n=[];return n.push.apply(n,arguments),_typeof(n[n.length-1])!=="object"&&n.push(u(n,e)),r.apply(this,n)})):n[Symbol.replace].call(this,i,r)},_wrapRegExp.apply(this,arguments)}function _inherits(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&_setPrototypeOf(n,t)}function _possibleConstructorReturn(n,t){return t&&(_typeof(t)==="object"||typeof t=="function")?t:_assertThisInitialized(n)}function _assertThisInitialized(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function _wrapNativeSuper(n){var t=typeof Map=="function"?new Map:undefined;return _wrapNativeSuper=function(n){function i(){return _construct(n,arguments,_getPrototypeOf(this).constructor)}if(n===null||!_isNativeFunction(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(n))return t.get(n);t.set(n,i)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(i,n)},_wrapNativeSuper(n)}function _construct(){return _construct=_isNativeReflectConstruct()?Reflect.construct:function(n,t,i){var r=[null],f,u;return r.push.apply(r,t),f=Function.bind.apply(n,r),u=new f,i&&_setPrototypeOf(u,i.prototype),u},_construct.apply(null,arguments)}function _isNativeReflectConstruct(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function _isNativeFunction(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function _setPrototypeOf(n,t){return _setPrototypeOf=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},_setPrototypeOf(n,t)}function _getPrototypeOf(n){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf(n)}function selectAddressResult(n){return n.filter(function(n){return n.address_components!=null&&(n.address_components.some(function(n){return n.types.some(function(n){return n==="street_number"})})||n.address_components.some(function(n){return n.types.some(function(n){return n==="route"})}))})}function _toConsumableArray(n){return _arrayWithoutHoles(n)||_iterableToArray(n)||_unsupportedIterableToArray(n)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(n,t){if(n){if(typeof n=="string")return _arrayLikeToArray(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);return(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(n,t):void 0}}function _iterableToArray(n){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(n))return Array.from(n)}function _arrayWithoutHoles(n){if(Array.isArray(n))return _arrayLikeToArray(n)}function _arrayLikeToArray(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=n[i];return r}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function _typeof(n){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_typeof(n)}function _wrapRegExp(){function i(n,i,u){var f=r.call(this,n,i);return t.set(f,u||t.get(n)),f}function u(n,i){var r=t.get(i);return Object.keys(r).reduce(function(t,i){return t[i]=n[r[i]],t},Object.create(null))}_wrapRegExp=function(n,t){return new i(n,undefined,t)};var r=_wrapNativeSuper(RegExp),n=RegExp.prototype,t=new WeakMap;return _inherits(i,r),i.prototype.exec=function(t){var i=n.exec.call(this,t);return i&&(i.groups=u(i,this)),i},i.prototype[Symbol.replace]=function(i,r){var f,e;return typeof r=="string"?(f=t.get(this),n[Symbol.replace].call(this,i,r.replace(/\$<([^>]+)>/g,function(n,t){return"$"+f[t]}))):typeof r=="function"?(e=this,n[Symbol.replace].call(this,i,function(){var n=[];return n.push.apply(n,arguments),_typeof(n[n.length-1])!=="object"&&n.push(u(n,e)),r.apply(this,n)})):n[Symbol.replace].call(this,i,r)},_wrapRegExp.apply(this,arguments)}function _inherits(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&_setPrototypeOf(n,t)}function _possibleConstructorReturn(n,t){return t&&(_typeof(t)==="object"||typeof t=="function")?t:_assertThisInitialized(n)}function _assertThisInitialized(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function _wrapNativeSuper(n){var t=typeof Map=="function"?new Map:undefined;return _wrapNativeSuper=function(n){function i(){return _construct(n,arguments,_getPrototypeOf(this).constructor)}if(n===null||!_isNativeFunction(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(n))return t.get(n);t.set(n,i)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(i,n)},_wrapNativeSuper(n)}function _construct(){return _construct=_isNativeReflectConstruct()?Reflect.construct:function(n,t,i){var r=[null],f,u;return r.push.apply(r,t),f=Function.bind.apply(n,r),u=new f,i&&_setPrototypeOf(u,i.prototype),u},_construct.apply(null,arguments)}function _isNativeReflectConstruct(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function _isNativeFunction(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function _setPrototypeOf(n,t){return _setPrototypeOf=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},_setPrototypeOf(n,t)}function _getPrototypeOf(n){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf(n)}function hidePanel(n){var t=document.getElementById(n);t&&t.classList.contains("active")&&(navButtons.forEach(function(n){return n.classList.remove("active")}),overlay&&overlay.classList.remove("visible"),t.blur(),t.classList.remove("active"),app.currentPanel=null)}function showPanel(n){var t=document.getElementById(n);t&&(panels&&panels.forEach(function(n){return n.classList.remove("active")}),overlay&&overlay.classList.add("visible"),message&&message.classList.remove("active"),t.classList.add("active"),t.focus(),app.currentPanel=n)}function initMaps(){var i,r,o,s;app&&(app.updateDefaultSearchMask(),app.defaultMaskDialogVisible=!0);localforage.config({name:"National Public Toilet Map"});var t=document.getElementById("InitialFacility").value,h=document.getElementById("InitialFacility").getAttribute("data-editmode")==="true",c=document.getElementById("InitialCreate").value==="true",u=document.getElementById("InitialState").value,f=document.getElementById("InitialLocality").value,n=document.getElementById("InitialMapMode").value,e=document.getElementById("CustomMapID").value;if(n)switch(n){case"initial":n=MapState.initial;break;case"BoundingBox":case"panning":n=MapState.panning;break;case"provider":n=MapState.provider;break;case"searching":n=MapState.searching;break;case"tracking":n=MapState.tracking;break;case"custom":n=MapState.custom;break;default:n=MapState.initial}else n=MapState.initial;t?Vue.http.get("/api/AppAPI/GetFacilityFull/"+t).then(function(i){i.json().then(function(i){createMap(i.Info.LA,i.Info.LO);createStartingFacility(t,i);h?showPanel("editors-panel"):(initFullMapControl(n),app.selectFacility(t),showPanel("details-panel"),app.current={lat:i.Info.LA,lng:i.Info.LO})})},function(n){typeof Sentry!="undefined"&&Sentry.captureException(n);Messages.display(MessageType.error,"Get facility","Failed to load the facility",1e4)}):e?(i="Desktop",r=window.innerWidth,r<768?i="Phone":r<992&&(i="Tablet"),o=encodeURIComponent(dateTimeToHsFormat(new Date)),Vue.http.get("/api/AppAPI/GetCustomMap/"+e+"?xIdiom="+i+"&cDate="+o+"&openNow=false&enforcePrefs=false&appType=Mobile").then(function(t){t.json().then(function(t){var u=new google.maps.LatLngBounds(new google.maps.LatLng(t.Lat-t.LatDegrees/2.1,t.Lon-t.LonDegrees/2.1),new google.maps.LatLng(t.Lat+t.LatDegrees/2.1,t.Lon+t.LonDegrees/2.1)),i,r;createMap(t.Lat,t.Lon);app.customMapSearchMask=t.MapMask;app.originalCustomMapSearchMask=t.MapMask;app.usingCustomMap=!0;SearchMask.hasFlag(app.customMapSearchMask,SearchMask.xISOPENALLHOURS)?app.open24=!0:app.openAll=!0;app.customMapSearchMask=SearchMask.mergeMaskForCustomMapUse(t.MapMask,app.searchMask);app.customMapSearchMaskOverride=SearchMask.mergeMaskForOverride(t.MapMask,app.searchMask);app.customMapTitle=t.Title;initFullMapControl(n);app.current={lat:t.Lat,lng:t.Lon};app.customMapOrigin={lat:t.Lat,lng:t.Lon};i="Desktop";r=window.innerWidth;r<768?i="Phone":r<992&&(i="Tablet");app.processFacilityResults(t,!1,i);app.map.fitBounds(u,0);app.showMapDetails=!0;showPanel("find-panel")})},function(n){typeof Sentry!="undefined"&&Sentry.captureException(n);Messages.display(MessageType.error,"Get map","Failed to load the map",1e4)})):f||u?(s=new google.maps.Geocoder,s.geocode({componentRestrictions:{country:"AU"},address:f+" "+u+" Australia"},function(t){n==MapState.panning?createMapB(t[0].geometry.bounds,t[0].geometry.location.lat(),t[0].geometry.location.lng()):createMap(t[0].geometry.location.lat(),t[0].geometry.location.lng());initFullMapControl(n);app.current={lat:t[0].geometry.location.lat(),lng:t[0].geometry.location.lng()}})):(createMap(start.lat,start.lng),initFullMapControl(n),c&&showPanel("create-panel"))}function createMap(n,t){app.map=new google.maps.Map(document.getElementById("map"),{center:{lat:n,lng:t},zoom:start.zoom,mapTypeControl:!0,fullscreenControl:!1,streetViewControl:window.innerWidth>992,clickableIcons:!1,mapTypeControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM},gestureHandling:"greedy"})}function createMapB(n,t,i){var r={height:0,width:0},u=document.getElementById("map");r.height=u.offsetHeight;r.width=u.offsetWidth;app.map=new google.maps.Map(document.getElementById("map"),{center:{lat:t,lng:i},zoom:getBoundsZoomLevel(n,r),mapTypeControl:!0,fullscreenControl:!1,streetViewControl:window.innerWidth>992,clickableIcons:!1,mapTypeControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM},gestureHandling:"greedy"})}function initFullMapControl(n){var s=document.getElementById("pid").value,r,t,u,h,f,e,c,o,l,i;google.maps.event.addListener(app.map,"idle",app.updateRegion);r=document.createElement("div");t=document.createElement("div");t.className="recenter-button";t.title="Click to recenter the map at your location.";r.appendChild(t);u=document.createElement("img");u.src="/Content/img/radar.svg";u.alt="Recenter";t.appendChild(u);r.index=1;t.addEventListener("click",function(){!app.geolocationAttempted&&navigator.geolocation&&(app.geolocationAttempted=!0,app.wpid=navigator.geolocation.watchPosition(app.geoUpdate,app.geoError,{enableHighAccuracy:!1,maximumAge:3e3,timeout:2e4}));app.state!==MapState.tracking&&app.state!==MapState.provider?(app.state=MapState.tracking,ga("send","event","Recenter","StartTracking"),gtag("event","Recenter",{action:"StartTracking"}),app.distances=[],app.map.panTo(app.my)):(app.map.panTo(app.my),ga("send","event","Recenter","GotoLast"),gtag("event","Recenter",{action:"GotoLast"}))});google.maps.event.addListener(app.map,"click",function(){var n=Array.from(document.getElementsByClassName("nav-button"));n.forEach(function(n){return n.classList.remove("active")})});app.map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(r);app.map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(document.getElementById("shareMapButtonDiv"));app.state=n;app.marker===null&&(h={url:"/Content/img/location.svg",size:new google.maps.Size(26,26),scaledSize:new google.maps.Size(26,26),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(13,13)},app.marker=new google.maps.Marker({position:app.my,map:app.map,icon:h,title:"Return to your current location",clickable:!1,optimized:!1}),f=new google.maps.OverlayView,f.draw=function(){this.getPanes().markerLayer.id="positionMarkerLayer"},f.setMap(app.map));window.innerWidth>992&&(e=app.map.getStreetView(),google.maps.event.addListener(e,"visible_changed",function(){e.getVisible()&&(ga("send","event","StreetView","On"),gtag("event","Map",{StreetView:"On"}))}));google.maps.event.addListener(app.map,"maptypeid_changed",function(){ga("send","event","MapType",app.map.getMapTypeId());gtag("event","Map",{MapType:app.map.getMapTypeId()})});c={componentRestrictions:{country:"au"}};o=document.getElementById("find-text");o&&(app.searchBox=new google.maps.places.Autocomplete(o,c),google.maps.event.addListener(app.searchBox,"place_changed",app.search));!app.usingCustomMap&&app.showMOTD&&Vue.http.get("/api/AppAPI/GetMOTD").then(function(n){n.json().then(function(n){(n.Header!=null||n.Paragraphs!=null&&(!Array.isArray(n.Paragraphs)||n.Paragraphs.length>0))&&(Messages.display(MessageType.site,n.Header,n.Paragraphs,3e4),storageAvailable("localStorage")&&(window.localStorage.motd_date=(new Date).toDateString()))})},function(){Messages.display(MessageType.site,"Welcome to the National Public Toilet Map",['There is a problem connecting to the National Public Toilet Map database. Please check that your mobile data or wi-fi connection are working properly by trying <a href="https://toiletmap.gov.au" title="Re-try the National Public Toilet Map site">https://toiletmap.gov.au<\/a> in your browser.'],3e4);storageAvailable("localStorage")&&(window.localStorage.motd_date=(new Date).toDateString())});!app.usingCustomMap&&navigator.geolocation&&(app.geolocationAttempted=!0,app.wpid=navigator.geolocation.watchPosition(app.geoUpdate,app.geoError,{enableHighAccuracy:!1,maximumAge:3e3,timeout:2e4}));s&&(app.provider=s);app.setFirstLaunch();app.incrementLaunchesWithDefaultMaskCount();l=new URLSearchParams(window.location.search);i=l.get("target");i=="find"?(showPanel("find-panel"),window.history.replaceState({},document.title,"/")):i=="myfacilities"?(showPanel("myfacilities-panel"),window.history.replaceState({},document.title,"/")):i=="preferences"?(showPanel("preferences-panel"),window.history.replaceState({},document.title,"/")):i=="results"&&(showPanel("results-panel"),window.history.replaceState({},document.title,"/"))}function createStartingFacility(n,t){var i=new Toilet(t.Info);app.addToilet(i);app.selectFacility(n);i.refreshInfo()}function isBot(){return navigator.userAgent&&/bot|googlebot|crawler|spider|robot|crawling/i.test(navigator.userAgent)}function getBoundsZoomLevel(n,t){function u(n){var t=Math.sin(n*Math.PI/180),i=Math.log((1+t)/(1-t))/2;return Math.max(Math.min(i,Math.PI),-Math.PI)/2}function f(n,t,i){return Math.floor(Math.log(n/t/i)/Math.LN2)}var r={height:256,width:256},e=n.getNorthEast(),o=n.getSouthWest(),s=(u(e.lat())-u(o.lat()))/Math.PI,i=e.lng()-o.lng(),h=(i<0?i+360:i)/360,c=f(t.height,r.height,s),l=f(t.width,r.width,h);return Math.min(c,l,21)}function dateTimeToHsFormat(n){var i=numberToZeroleadString(n.getDate()),t="";switch(n.getMonth()+1){case 1:t="Jan";break;case 2:t="Feb";break;case 3:t="Mar";break;case 4:t="Apr";break;case 5:t="May";break;case 6:t="Jun";break;case 7:t="Jul";break;case 8:t="Aug";break;case 9:t="Sep";break;case 10:t="Oct";break;case 11:t="Nov";break;case 12:t="Dec"}var r=n.getFullYear().toString(),u=numberToZeroleadString(n.getHours()),f=numberToZeroleadString(n.getMinutes()),e=numberToZeroleadString(n.getSeconds());return"".concat(i," ").concat(t," ").concat(r," ").concat(u,":").concat(f,":").concat(e)}function numberToZeroleadString(n){return n>=10?n.toString():"0"+n.toString()}function _typeof(n){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_typeof(n)}function _possibleConstructorReturn(n,t){return t&&(_typeof(t)==="object"||typeof t=="function")?t:_assertThisInitialized(n)}function _assertThisInitialized(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function _getPrototypeOf(n){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf(n)}function _inherits(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&_setPrototypeOf(n,t)}function _setPrototypeOf(n,t){return _setPrototypeOf=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},_setPrototypeOf(n,t)}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}var AutoComplete=function(){function n(t){var i=this;_classCallCheck(this,n);this.ForceOpen=!1;this.URL=null;t.URL&&(this.URL=t.URL);this.SingleURL=null;t.SingleURL&&(this.SingleURL=t.SingleURL);this.StaticData=null;t.StaticData&&(this.StaticData=t.StaticData);this.URLFormatter=null;this.URLFormatter=t.URLFormatter?t.URLFormatter:function(n,t){return n+"?search="+encodeURI(t)};this.CreateSuggestion=null;this.CreateSuggestion=t.CreateSuggestion?t.CreateSuggestion:function(n){return new AutoCompleteSuggestion(n.id,n.text)};this.GetJsonArray=null;this.GetJsonArray=t.GetJsonArray?t.GetJsonArray:function(n){return n};this.UseThrottle=!0;t.UseThrottle!==null&&t.UseThrottle!==undefined&&(this.UseThrottle=t.UseThrottle);this.ThrottleTime=500;t.ThrottleTime&&(this.ThrottleTime=t.ThrottleTime);this.OnChange=t.OnChange;this.Suggestions=null;this.StaticData&&(this.Suggestions=this.StaticData);this.Selection=null;this.OnBlur=t.OnBlur?t.OnBlur:function(){};this.OnSingleFetch=t.OnSingleFetch?t.OnSingleFetch:function(n){return i.CreateSuggestion(n)};this.Input=null;this.IsOpened=!1;this.Current=0;this.OnClear=t.OnClear?t.OnClear:function(){};this.Waiting=!1;_&&typeof _.throttle=="function"?(this.ThrottledCall=_.throttle(this.BuildSuggestionsInner,this.ThrottleTime),this.DelayedWait=_.debounce(function(){this.Waiting=!0},1e3),this.DelayedClose=_.debounce(function(){this.InnerClose()},200)):(this.DelayedWait=function(){this.Waiting=!0},this.DelayedClose=function(){window.setTimeout(function(){this.InnerClose()},200)})}return _createClass(n,[{key:"BuildSuggestions",value:function(){this.IsDynamic&&(this.DelayedWait(),this.UseThrottle&&_&&typeof _.throttle=="function"?this.ThrottledCall():this.BuildSuggestionsInner())}},{key:"BuildSuggestionsInner",value:function(){var n=this,t=this.URLFormatter(this.URL,this.Input);Vue.http.get(t).then(function(t){t.json().then(function(t){var i=n.GetJsonArray(t);n.Suggestions=[];i.forEach(function(t){var i=n.CreateSuggestion(t);i.InputGet=function(){return n.Input};n.Suggestions.push(i)})})},function(){}).finally(function(){n.DelayedWait.cancel&&n.DelayedWait.cancel();n.Waiting=!1})}},{key:"Select",value:function(n){this.CurrentSelection=this.Matches[n];this.IsOpened=!1}},{key:"SelectCurrent",value:function(){this.CurrentSelection=this.Matches[this.Current];this.IsOpened=!1}},{key:"Previous",value:function(){this.Current>0&&this.Current--}},{key:"Next",value:function(){this.Current<this.Matches.length-1&&this.Current++}},{key:"IsActive",value:function(n){return n===this.Current}},{key:"Close",value:function(){this.DelayedClose()}},{key:"InnerClose",value:function(){this.IsOpened=!1;this.ForceOpen=!1;this.OnBlur(this.Input,this.CurrentSelection);this.CurrentSelection===null&&this.Input!==null&&this.FetchSingle();this.Input===null&&this.CurrentSelection!==null&&(this.CurrentSelection=null)}},{key:"FetchSingle",value:function(){var n=this,t;this.SingleURL?(t=this.URLFormatter(this.SingleURL,this.Input),Vue.http.get(t).then(function(t){t?t.json().then(function(t){var i,r;t&&(i=n.OnSingleFetch(t),n.Suggestions==null&&(n.Suggestions=[]),r=n.Suggestions.find(function(n){return n.ID===i.ID}),r?n.CurrentSelection=r:(i.InputGet=function(){return n.Input},n.CurrentSelection=i,n.Suggestions.push(i)))}):n.CurrentSelection=null},function(){n.CurrentSelection=null})):this.CurrentSelection=null}},{key:"CurrentSelection",get:function(){return this.Selection},set:function(n){this.ForceOpen=!1;this.Selection=n;n!==null?(this.Input=n.Text,this.OnChange&&this.OnChange(n)):(this.Input=null,this.OnClear(n))}},{key:"CurrentInput",get:function(){return this.Input},set:function(n){var t=this.Input;this.ForceOpen=!1;this.Input=n;n?(this.BuildSuggestions(),this.IsOpened||(this.IsOpened=!0,this.Current=0)):this.IsOpened=!1;t!==n&&(this.Selection=null,this.OnClear())}},{key:"IsStatic",get:function(){return this.StaticData!==null}},{key:"IsDynamic",get:function(){return this.URL!==null}},{key:"Matches",get:function(){var n=this;return this.IsStatic?this.Input?this.Suggestions.filter(function(t){return t.Text.toLowerCase().indexOf(n.Input.toLowerCase())>=0}):this.ForceOpen?this.Suggestions:[]:this.Suggestions}},{key:"ShouldSuggestionsOpen",get:function(){return(this.Input&&this.IsOpened||this.ForceOpen)&&this.Matches&&this.Matches.length>0}}]),n}(),AutoCompleteSuggestion=function(){function n(t,i,r){_classCallCheck(this,n);this.ID=t;this.Text=i;this.Additions=r;this.InputGet=null;this.LastInput=null;this.CurrentComponents=[]}return _createClass(n,[{key:"Components",get:function(){var t=this,i=this.InputGet(),n;if(this.LastInput!==i){this.CurrentComponents=[];var u=i===null?[]:i.toLowerCase().split(" "),f=this.Text.toLowerCase(),r=[];u.forEach(function(n){var t=f.indexOf(n),i;t>-1&&(i=t+n.length,r.some(function(n){return t>=n.start&&t<=n.end||i>=n.start&&i<=n.end})||r.push({start:t,end:i}))});r.sort(function(n,t){return n.start===t.start?0:n.start>t.start?1:-1});n=0;r.forEach(function(i){n<i.start&&t.CurrentComponents.push(new AutoCompleteSuggestionComponent(t.Text.substring(n,i.start),!1));t.CurrentComponents.push(new AutoCompleteSuggestionComponent(t.Text.substring(i.start,i.end),!0));n=i.end});n<this.Text.length&&this.CurrentComponents.push(new AutoCompleteSuggestionComponent(this.Text.substring(n),!1))}else this.CurrentComponents.length===0&&this.Text!==null&&this.CurrentComponents.push(new AutoCompleteSuggestionComponent(this.Text,!1));return this.LastInput=i,this.CurrentComponents}}]),n}(),AutoCompleteSuggestionComponent=function AutoCompleteSuggestionComponent(n,t){_classCallCheck(this,AutoCompleteSuggestionComponent);this.Text=n;this.IsMatch=t},facilitiesToCheck,Geo,AccountDisplayMode,AccountManager,ButtonClasses,Editor,UserInfo,AgencyInfo,spinnerbutton,registerpanel,amenitiespanel,amenitiessummary,accesspanel,accesssummary,ShareMap,CustomMap,start;Vue.component("AutoComplete",{props:["autocomplete","id","placeholder","validator"],template:'\n        <div class="autocomplete" v-bind:class="{\'open\':autocomplete.ShouldSuggestionsOpen}">\n            <input class="form-control" :class="{\'input-validation-error\': validator && !validator.Result.Success}" type="text" v-model="autocomplete.CurrentInput" :id="id" :placeholder="placeholder" autocomplete="off"\n                @keydown.enter = \'enter\'\n                @keydown.down = \'down\'\n                @keydown.up = \'up\'\n                @blur = \'exit\'\n            />\n            <div v-if="autocomplete.Waiting" class="ta_spinner">\n                <spinner><\/spinner>\n            <\/div>\n            <div class="dropdown-menu" style="width:100%" v-bind:class="{\'show\':autocomplete.ShouldSuggestionsOpen}">\n                <a v-for="(suggestion,index) in autocomplete.Matches"\n                    v-bind:class="{\'active\': autocomplete.IsActive(index)}"\n                    @click="suggestionClick(index)"\n                    class="dropdown-item"\n                    href="#"\n                >\n                    <span v-for="part in suggestion.Components" :class="{\'font-weight-bold\':part.IsMatch}">{{part.Text}}<\/span>\n                    <span v-if="suggestion.Additions"> - <i>{{suggestion.Additions}}<\/i><\/span>\n                <\/a>\n            <\/div>\n        <\/div>\n    ',methods:{enter:function(){this.autocomplete.SelectCurrent()},up:function(){this.autocomplete.Previous()},down:function(){this.autocomplete.Next()},suggestionClick:function(n){this.autocomplete.Select(n)},exit:function(){this.autocomplete.Close();this.$emit("blur")}}});"use strict";var ValidatorCollection=function(){function n(t){var i=this;_classCallCheck(this,n);this.Success=!0;this.Validators=[];this.DValidators={};t&&t.forEach(function(n){i.Validators.push(n);i[n.Name]=n})}return _createClass(n,[{key:"Validate",value:function(n){var t=this;return this.Success=!0,this.Validators.forEach(function(i){var r=i.Validate(n);r.Success||(t.Success=!1)}),this.Success}},{key:"Reset",value:function(){this.Validators.forEach(function(n){return n.Reset()})}},{key:"ValidateAndRun",value:function(n,t){this.ValidatWithCheck(n)&&t()}},{key:"ValidateWithCheck",value:function(n){return this.Validate(n)||window.setTimeout(function(){var n=document.getElementsByClassName("input-validation-error"),i,t;n&&n.length>0&&(i=!1,n[0].id&&(t=document.querySelectorAll('[data-validatorfor="'+n[0].id+'"]'),t&&t.length>0&&(t[0].scrollIntoView(),i=!0)),i||n[0].scrollIntoView())},10),this.Success}},{key:"Messages",get:function(){var n=[];return this.Validators.forEach(function(t){t.Result.Success||n.push(t.Result.Message)}),n}}]),n}(),ValidationResult=function ValidationResult(n,t){_classCallCheck(this,ValidationResult);this.Success=n;this.Message=t},Validator=function(){function n(t,i,r,u){_classCallCheck(this,n);this.Name=t;this.VFunc=i;this.Result=new ValidationResult(!0);this.MessageIsList=u;this.IsRequired=r===!0}return _createClass(n,[{key:"Validate",value:function(n){return this.Result=this.VFunc(n),this.Result}},{key:"Reset",value:function(){this.Result=new ValidationResult(!0)}}],[{key:"TestEmail",value:function(n,t){var i=!0,r="";return n?/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)||(i=!1,r="The Email address entered is not a valid e-mail address."):t&&(r="You must enter an email address.",i=!1),new ValidationResult(i,r)}},{key:"TestEmailSimple",value:function(n){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)}},{key:"IsNumber",value:function(n){return/^-?\d+$/.test(n)}}]),n}();Vue.component("validationmessage",{props:["validator","mainmodel","value","inline","simple","inputid"],data:function(){return{needtovalidate:!1}},computed:{myValue:{get:function(){return this.mainmodel&&this.needtovalidate?(this.validator.Validate(this.mainmodel),this.value):(this.needtovalidate=!0,this.value)}},useP:{get:function(){return!this.inline&&!this.simple&&!this.validator.Result.Success&&!this.validator.MessageIsList}},useSpan:{get:function(){return this.inline&&!this.simple&&!this.validator.Result.Success&&!this.validator.MessageIsList}},useSimple:{get:function(){return this.simple&&!this.validator.Result.Success&&!this.validator.MessageIsList}},useList:{get:function(){return!this.validator.Result.Success&&this.validator.MessageIsList}}},template:'\n        <div class="validatormessage" :class="{\'d-inline\': useSpan, \'invalid-feedback\': simple}" :data-validatorfor="inputid" :data-hasvalue="myValue!=null && myValue!=\'\'">\n            <p v-if="useP" class="text-danger" :class="{\'field-validation-error\': !validator.Result.Success}">{{validator.Result.Message}}<\/p>\n            <span v-if="useSpan" class="text-danger ml-2" :class="{\'field-validation-error\': !validator.Result.Success}">{{validator.Result.Message}}<\/span>\n            <span v-if="useSimple">{{validator.Result.Message}}<\/span>\n            <ul v-if="useList" class="text-danger">\n                <li v-for="m in validator.Result.Message">{{m}}<\/li>\n            <\/ul>\n        <\/div>\n    '});Vue.component("validationinput",{props:["validator","value","disabled","type","rows"],data:function(){return{trows:this.rows?this.rows:3}},computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},template:'\n        <textarea v-if="type==\'textarea\'" v-model="myValue" :class="{\'input-validation-error\': !validator.Result.Success, disabled: disabled}" :required="validator.IsRequired" v-on:change="$emit(\'change\',value)" :disabled="disabled" :rows="trows"><\/textarea>\n        <input v-else v-model="myValue" :type="type" :class="{\'input-validation-error\': !validator.Result.Success, disabled: disabled}" :required="validator.IsRequired" v-on:change="$emit(\'change\',value)" :disabled="disabled" />\n    '});Vue.component("validationselect",{props:["validator","value","options","disabled"],computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},template:'\n        <select v-model="myValue" :class="{\'input-validation-error\': !validator.Result.Success, disabled:disabled}" :required="validator.IsRequired" v-on:change="$emit(\'change\',value)" :disabled="disabled" >\n            <slot>\n                <option v-if="options" v-for="o in options" :value="o.Value">{{o.Text}}<\/option>\n            <\/slot>\n        <\/select>\n    '});Vue.component("inputcontrol",{props:["id","title","placeholder","validator","value","model","type","selectoptions","controlclass","disabled","rows"],data:function(){return{cclass:this.controlclass?this.controlclass:"form-control",trows:this.rows?this.rows:3}},computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},template:'\n        <validationselect v-if="type==\'select\' && validator" :validator="validator" :title="title" :id="id" :class="cclass" v-model="myValue" :disabled="disabled" v-on:change="$emit(\'change\', value)">\n            <slot name="vselectoptions">\n                <option v-for="o in selectoptions" :value="o.Value">{{o.Text}}<\/option>\n            <\/slot>\n        <\/validationselect>\n        <select v-else-if="type==\'select\' && !validator" :id="id" :title="title" :class="[{disabled: disabled}, cclass]" v-model="myValue" :disabled="disabled" v-on:change="$emit(\'change\', value)">\n            <slot name="selectoptions">\n                <option v-for="o in selectoptions" :value="o.Value">{{o.Text}}<\/option>\n            <\/slot>\n        <\/select>\n        <validationinput v-else-if="validator" :validator="validator" :id="id" :title="title" :class="cclass" v-model="myValue" :rows="trows" :type="type" :placeholder="placeholder" :disabled="disabled" v-on:change="$emit(\'change\', value)"><\/validationinput>\n        <textarea v-else-if="type==\'textarea\'" :id="id" :class="[{disabled: disabled}, cclass]" v-model="myValue" :rows="trows" :placeholder="placeholder" :title="title" :disabled="disabled" v-on:change="$emit(\'change\', value)"><\/textarea>\n        <input v-else :id="id" :class="[{disabled: disabled}, cclass]" v-model="myValue" :type="type" :placeholder="placeholder" :title="title" :disabled="disabled" v-on:change="$emit(\'change\', value)"><\/input>\n    '});"use strict";var MonitorCheckResult={TerminatingFail:0,Fail:1,Pass:2,Error:3},Monitor=function(){function n(t){var i=this;_classCallCheck(this,n);this.Frequency=1e3;t.Frequency&&(this.Frequency=t.Frequency);this.CurrentFrequency=this.Frequency;this.MyObject=null;t.MyObject&&(this.MyObject=t.MyObject);this.MyCheck=null;t.MyCheck&&(this.MyCheck=t.MyCheck);this.MyCallback;t.MyCallback&&(this.MyCallback=t.MyCallback);this.URL=null;t.URL&&(this.URL=t.URL);this.FailCallback=t.FailCallback;this.StopOnSuccess=!1;t.StopOnSuccess&&(this.StopOnSuccess=t.StopOnSuccess);this.StopCallback=null;t.StopCallback&&(this.StopCallback=t.StopCallback);this.MaxErrorRetries=100;t.MaxErrorRetries&&(this.MaxErrorRetries=t.MaxErrorRetries);this.ErrorCount=0;this.ErrorFrequencyLevel=0;this.ErrorCallback=function(n){return i.DoErrorCountCheck()?n.status===404?!1:n.status===401?(i.CurrentFrequency=i.Frequency+6e5,!0):(i.TrackErrorCount(),!0):!1};t.ErrorCallback&&(this.ErrorCallback=t.ErrorCallback);this.Handler=null;this.CurrentRequest=null;this.Start()}return _createClass(n,[{key:"Start",value:function(){var n=this;this.Handler=window.setTimeout(function(){n.DoTheMonitoring()},this.CurrentFrequency)}},{key:"Stop",value:function(n){this.Handler&&(window.clearTimeout(this.Handler),this.Handler=null);this.CurrentRequest&&(this.CurrentRequest.abort(),this.CurrentRequest=null);this.StopCallback&&!n&&this.StopCallback.call(this,this.IsObjectCheck?this.MyObject:null)}},{key:"DoTheMonitoring",value:function(){var n=this,t,i;this.IsObjectCheck?(t=this.CheckObject(this.MyObject),t===MonitorCheckResult.Pass?(this.Action(this.MyObject),this.StopOnSuccess?this.StopCallback&&this.StopCallback.call(this,this.MyObject):this.Start()):t===MonitorCheckResult.Fail&&this.Start()):(i=this,Vue.http.get(this.URL,{before:function(n){i.CurrentRequest=n}}).then(function(t){t.json().then(function(t){var i=n.CheckObject(t);n.CurrentFrequency=n.Frequency;i===MonitorCheckResult.Pass?(n.ErrorFrequencyLevel=0,n.ErrorCount=0,n.Action(t),n.StopOnSuccess?n.StopCallback&&n.StopCallback.call(n,t):n.Start()):i===MonitorCheckResult.Error?(n.TrackErrorCount(),n.DoErrorCountCheck()&&n.Start()):i===MonitorCheckResult.Fail&&(n.ErrorFrequencyLevel=0,n.ErrorCount=0,n.Start())})},function(t){n.ErrorCallback.call(n,t)?n.CurrentRequest&&n.Start():n.StopCallback&&n.StopCallback.call(n,null)}))}},{key:"TrackErrorCount",value:function(){this.ErrorCount++;this.ErrorFrequencyLevel++;this.ErrorFrequencyLevel>5&&(this.ErrorFrequencyLevel=5);switch(this.ErrorFrequencyLevel){case 1:this.CurrentFrequency+=6e4;break;case 2:this.CurrentFrequency+=3e5;break;case 3:this.CurrentFrequency+=6e5;break;case 4:this.CurrentFrequency+=18e5;break;case 5:this.CurrentFrequency+=36e5}}},{key:"DoErrorCountCheck",value:function(){return this.ErrorCount<=this.MaxErrorRetries}},{key:"Action",value:function(n){this.MyCallback&&this.MyCallback.call(this,n)}},{key:"CheckObject",value:function(n){if(this.MyCheck){var t=this.MyCheck.call(this,n);return t===MonitorCheckResult.Fail&&this.FailCallback&&this.FailCallback.call(this,n),t}return n&&(n.Success===!1||n.IsError===!0)?MonitorCheckResult.Error:MonitorCheckResult.Pass}},{key:"IsObjectCheck",get:function(){return this.URL===null}},{key:"IsURLCheck",get:function(){return this.URL!==null}}]),n}(),PersistantMonitor=function PersistantMonitor(n,t,i,r){_classCallCheck(this,PersistantMonitor);this.CustomData=r;this.URL=i;this.ID=n;this.Type=t;this.Monitor=null},PersistantMonitorConfiguration=function PersistantMonitorConfiguration(n,t){_classCallCheck(this,PersistantMonitorConfiguration);this.Type=n;this.Frequency=null;t.Frequency&&(this.Frequency=t.Frequency);this.MyCheck=null;t.MyCheck&&(this.MyCheck=t.MyCheck);this.MyCallback=null;t.MyCallback&&(this.MyCallback=t.MyCallback);this.FailCallback=t.FailCallback;this.StopOnSuccess=!1;t.StopOnSuccess&&(this.StopOnSuccess=t.StopOnSuccess);this.MaxErrorRetries=100;t.MaxErrorRetries&&(this.MaxErrorRetries=t.MaxErrorRetries);this.ErrorCallback=null;t.ErrorCallback&&(this.ErrorCallback=t.ErrorCallback);this.DontStore=!1;t.DontStore&&(this.DontStore=t.DontStore)},PersistantMonitorManager=function(){function n(t){_classCallCheck(this,n);this.Configurations=t;this.Data=[]}return _createClass(n,[{key:"CreateMonitor",value:function(n){var i=this.Find(n.ID);if(i)return i.Monitor.CurrentFrequency=i.Monitor.Frequency,i.ErrorFrequencyLevel=0,i.ErrorCount=0,i.Monitor;var t=this.Configurations.find(function(t){return t.Type===n.Type}),u=this,r=new Monitor({Frequency:t.Frequency,MyObject:n,URL:n.URL,MyCheck:t.MyCheck,MyCallback:t.MyCallback,FailCallback:t.FailCallback,ErrorCallback:t.ErrorCallback,StopCallback:function(){u.RemoveMonitor(this.MyObject)},MaxErrorRetries:t.MaxErrorRetries,StopOnSuccess:t.StopOnSuccess});return this.AddMonitor(n,r,!t.DontStore),r}},{key:"AddMonitor",value:function(n,t,i){var r=this;this.Data.some(function(t){return t.ID===n.ID})||(i?localforage.setItem("monitor_"+n.ID,n).then(function(){r.Data.push(n);n.Monitor=t}):(this.Data.push(n),n.Monitor=t))}},{key:"RemoveMonitor",value:function(n){var t=this;this.Data.some(function(t){return t.ID===n.ID})&&localforage.removeItem("monitor_"+n.ID).then(function(){t.Data=t.Data.filter(function(t){return t.ID!==n.ID})})}},{key:"Init",value:function(){var n=this;localforage.iterate(function(t,i){i.startsWith("monitor_")&&n.CreateMonitor(t)})}},{key:"Disable",value:function(){this.Data.forEach(function(n){return n.Monitor.Stop(!0)})}},{key:"ForEachWhen",value:function(n,t){this.Data.filter(function(n){return t(n)}).forEach(function(t){return n(t)})}},{key:"Find",value:function(n){return this.Data.find(function(t){return t.ID===n})}},{key:"FindWhen",value:function(n){return this.Data.find(function(t){return n(t)})}},{key:"Any",value:function(n){return this.Data.some(function(t){return n(t)})}},{key:"Purge",value:function(){var n=this,t=this.Data.filter(function(){return!0});t.forEach(function(t){t.Monitor.Stop(!0);n.RemoveMonitor(t)})}}]),n}();facilitiesToCheck=[];Geo=function(){function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"samePosition",value:function(n,t,i){var r=i||0;return distanceBetween(n,t)<=r}},{key:"fixCoord",value:function(n){return typeof n=="function"?n():n}},{key:"distanceBetween",value:function(n,t){var u=typeof n.lat=="function"?n.lat():n.lat,f=typeof t.lat=="function"?t.lat():t.lat,e=typeof n.lng=="function"?n.lng():n.lng,o=typeof t.lng=="function"?t.lng():t.lng,i=.017453292519943295,r=Math.cos,s=.5-r((f-u)*i)/2+r(u*i)*r(f*i)*(1-r((o-e)*i))/2;return 12742e3*Math.asin(Math.sqrt(s))}},{key:"addToFacilitiesToCheck",value:function(n){facilitiesToCheck.push(n)}},{key:"clearFacilitiesToCheck",value:function(){facilitiesToCheck=[]}},{key:"runDistanceCheck",value:function(n){var r=this,i;if(facilitiesToCheck.length>0){var u=typeof n.lat=="function"?n.lat():n.lat,f=typeof n.lng=="function"?n.lng():n.lng,t=[];facilitiesToCheck.forEach(function(n){t.push(new google.maps.LatLng(n.lat,n.lng))});i=new google.maps.DistanceMatrixService;i.getDistanceMatrix({origins:[new google.maps.LatLng(u,f)],destinations:t,travelMode:app.inCar?"DRIVING":"WALKING",unitSystem:google.maps.UnitSystem.METRIC},function(t,i){if(i!=="OK"||t.rows.length===0||t.rows[0].elements.length!==facilitiesToCheck.length)facilitiesToCheck.forEach(function(t){t.routeDistance=r.distanceBetween(n,t);t.updateDistanceMap(n,!1);t.refreshInfo()});else for(var u=0;u<facilitiesToCheck.length;u++)facilitiesToCheck[u].routeDistance=t.rows[0].elements[u].distance.value,facilitiesToCheck[u].updateDistanceMap(n,!0),facilitiesToCheck[u].refreshInfo()})}}},{key:"routeDistanceBetween",value:function(n,t){var i=this,r=typeof n.lat=="function"?n.lat():n.lat,u=typeof t.lat=="function"?t.lat():t.lat,f=typeof n.lng=="function"?n.lng():n.lng,e=typeof t.lng=="function"?t.lng():t.lng;return new Promise(function(o){var s=new google.maps.DistanceMatrixService;s.getDistanceMatrix({origins:[new google.maps.LatLng(r,f)],destinations:[new google.maps.LatLng(u,e)],travelMode:app.inCar?"DRIVING":"WALKING",unitSystem:google.maps.UnitSystem.METRIC},function(r,u){u!=="OK"||r.rows.length===0||r.rows[0].elements.length===0||r.rows[0].elements[0].status!=="OK"?o(i.distanceBetween(n,t)):o(r.rows[0].elements[0].distance.value)})})}},{key:"bounds",value:function(n,t){var u=typeof n.lat=="function"?n.lat():n.lat,l=typeof n.lng=="function"?n.lng():n.lng,i=12742*Math.PI,f=.001/i*360,e=t/1e3,a=Math.min(Math.max(e/i*720,f),90),v=i*Math.cos(u*Math.PI/180),y=Math.min(Math.max(e/v*720,f),180),r=Math.max(Math.min(u,85),-85),p=Math.min(85-r,85+r)*2,o=r,s=l,h=Math.min(a,p),c=y;return{east:s+c/2,north:o+h/2,south:o-h/2,west:s-c/2}}}]),n}();String.prototype.sentenced=function(){return this.trim()+(this.trim().substr(-1)==="."?"":".")};var pin_aspect=35/50,pin_height=50,pin_width=pin_height*pin_aspect,distanceMatrixLimit=Number(document.getElementById("DistanceMatrixLimit").value),Toilet=function(){function n(t){var i=this;_classCallCheck(this,n);this.iteration=0;this.loadIteration=0;t.Info&&t.Extras?(this.id=t.Info.ID,this.title=t.Info.T,this.closed=t.Info.C,this.facilityType=t.Info.F,this.address1=t.Info.A1,this.searchMask=t.Info.FM,this.lat=t.Info.LA,this.lng=t.Info.LO,this.openingHours=t.Info.O,this.locality=t.Info.L,this.state=t.Info.ST,this.score=t.Info.S,this.contentID=t.Extras.CId,this.accessNote=t.Extras.AceNt,this.adultChangeNote=t.Extras.AChNt,this.addressNote=t.Extras.AdNt,this.babyChangeNote=t.Extras.BChNt,this.dumpPointNote=t.Extras.DPNt,this.parkingNote=t.Extras.PkNt,this.openingHoursNote=t.Extras.OhNt,this.toiletNote=t.Extras.TNt,this.yearAdultChange=t.Extras.YAch,this.YearToilet=t.Extras.YT,this.gids=t.Extras.GIds,this.gids.forEach(function(n){(new Image).src=i.thumbnailUri(n)}),this.AgencyID=t.AID,this.AgencyID||(this.AgencyID=t.Extras.AID),this.providerTitle=t.Extras.PT,this.providerEmail=t.Extras.PE,this.providerPhone=t.Extras.PP,this.providerURI=t.Extras.PW,this.providerGId=t.Extras.PGId,this.providerGId&&((new Image).src=this.providerLogoUri),this.extrasLoaded=!0):(this.id=t.ID,this.title=t.T,this.closed=t.C,this.facilityType=t.F,this.address1=t.A1,this.searchMask=t.FM,this.lat=t.LA,this.lng=t.LO,this.openingHours=t.O,this.locality=t.L,this.state=t.ST,this.score=t.S,this.expanded=!1,this.extrasLoaded=!1);this.routeDistance=null;this.liked=!1;this.onMarkerClick=null;this.IsSelected=!1;typeof google!="undefined"&&(this.info=new google.maps.InfoWindow({content:"",disableAutoPan:!0}),this.info.addListener("closeclick",function(){app.selectFacility(null);i.IsSelected=!1}),this.marker=new google.maps.Marker({position:{lat:this.lat,lng:this.lng},title:this.title,icon:this.pinIcon}),this.marker.addListener("click",function(){i.map!=null&&(i.onMarkerClick!=null&&i.onMarkerClick(),app.selectFacility(i.id,!1))}));localforage.getItem("l_".concat(this.id)).then(function(n){n&&(i.liked=!0,i.refreshInfo(),i.iteration+=1,i.loadIteration+=1)}).catch(function(n){console.error(n)})}return _createClass(n,[{key:"calculateRouteDistance",value:function(){var n=this,t,i;isBot()?this.routeDistance=0:(t=app.distances.find(function(t){return t.ID===n.id}),t?(this.routeDistance=t.Distance,this.refreshInfo()):app.distanceFromHere&&(i=this.distanceFrom(app.distanceFromHere.lat,app.distanceFromHere.lng),i>distanceMatrixLimit||!this.IsSelected?(this.routeDistance=_.round(i,1),app.distances.push(new ToiletDistance(this.id,this.routeDistance,app.distanceFromHere,!1)),this.refreshInfo()):Geo.routeDistanceBetween(app.distanceFromHere,{lat:this.lat,lng:this.lng}).then(function(t){n.routeDistance=t;n.updateDistanceMap(app.distanceFromHere,!0);n.refreshInfo()})))}},{key:"recalculateRouteDistance",value:function(){var n=this,t=app.distances.find(function(t){return t.ID===n.id}),i;t&&t.From==app.distanceFromHere&&t.IsPrecise?(this.routeDistance=t.Distance,this.refreshInfo()):app.distanceFromHere&&(i=this.distanceFrom(app.distanceFromHere.lat,app.distanceFromHere.lng),i>distanceMatrixLimit||!this.IsSelected?(this.routeDistance=_.round(i,1),this.updateDistanceMap(app.distanceFromHere,!1),this.refreshInfo()):Geo.routeDistanceBetween(app.distanceFromHere,{lat:this.lat,lng:this.lng}).then(function(t){n.routeDistance=t;n.updateDistanceMap(app.distanceFromHere,!0);n.refreshInfo()}))}},{key:"updateDistanceMap",value:function(n,t){var r=this,i;n||(n=app.distanceFromHere);i=app.distances.find(function(n){return n.ID===r.id});i?(i.Distance=this.routeDistance,i.From=n,i.IsPrecise=t):app.distances.push(new ToiletDistance(this.id,this.routeDistance,n.isPrecise))}},{key:"refreshMapData",value:function(){this.updatePin(app.map);this.refreshInfo()}},{key:"refreshInfo",value:function(){this.info.setContent('\n                <div class=\'info\'>\n                    <header class="facility-header">\n                        <svg class="icon large facility"><use xlink:href="/Content/img/icons/icons.svg#'.concat(this.primaryIcon,'" /><\/svg>\n                        <div>\n                            <h1>').concat(this.title,'<\/h1>\n                            <a class="address" onclick="app.directionsToSelected(); event.preventDefault();" href="#" target="_blank" rel="noopener noreferrer">').concat(this.address,'<\/a>\n                            <p class="distance" style="').concat(this.routeDistanceStyle,'">').concat(this.routeDistanceDisplay,'<\/p>\n                        <\/div>\n                    <\/header>\n                    <div class="icon-list toilet">\n                        ').concat(this.listHTML(app.providerSearchMask),'\n                    <\/div>\n                    <div class="details">\n                        <ul>\n                            <li class="openingHours">').concat(this.openingHours,'<\/li>\n                            <li><a class="more-information" href="').concat(this.id,'" onclick="app.showDetails(').concat(this.id,'); event.preventDefault();">More information<\/a><\/li>\n                        <\/ul>\n                        <a href="#facility-list-').concat(this.id,'">\n                            <svg class="heart').concat(this.isLiked?" liked":"",'" onclick="app.likeFacility(').concat(this.id,');">\n                                <title>').concat(this.isLiked?"Remove from My facilities":"Add to My facilities",'<\/title>\n                                <use xlink:href="/Content/img/icons/icons.svg#heart" />\n                            <\/svg>\n                        <\/a>\n                    <\/div>\n                <\/div>'))}},{key:"directionsFrom",value:function(n,t){return"https://www.google.com/maps/dir/?api=1&origin=".concat(_.escape(Geo.fixCoord(n)),",").concat(_.escape(Geo.fixCoord(t)),"&destination=").concat(_.escape(this.lat),",").concat(_.escape(this.lng),"&travelmode=").concat(window.localStorage.transportFilter==="true"||!1?"driving":"walking")}},{key:"distanceFrom",value:function(n,t){return Geo.distanceBetween({lat:this.lat,lng:this.lng},{lat:n,lng:t})}},{key:"routeDistanceFrom",value:function(n,t){return Geo.routeDistanceBetween({lat:this.lat,lng:this.lng},{lat:n,lng:t})}},{key:"addPin",value:function(n){this.marker!=null&&(this.map=n,this.marker.setMap(n))}},{key:"removePin",value:function(){this.marker!=null&&(this.map=null,this.marker.setMap(null))}},{key:"updatePin",value:function(n){this.marker!=null&&this.marker.getIcon().url!==this.pinIcon.url&&(this.removePin(),this.marker.setIcon(this.pinIcon),this.addPin(n))}},{key:"thumbnailUri",value:function(n){return n?"/api/AppAPI/GetImage/TN/".concat(n):null}},{key:"photoUri",value:function(n){return n?"/api/AppAPI/GetImage/".concat(n):null}},{key:"hasPhoto",value:function(n){return this.gids.includes(n)}},{key:"lightBox",value:function(){}},{key:"like",value:function(){var n=this;this.liked=!this.liked;this.liked?localforage.setItem("l_".concat(this.id),Date.now()).then(function(){n.iteration+=1;n.refreshInfo();ga("send","event","Favourite","Add",n.id);gtag("event","Favourite",{Add:n.id})}):localforage.removeItem("l_".concat(this.id)).then(function(){n.iteration+=1;n.refreshInfo();ga("send","event","Favourite","Remove",n.id);gtag("event","Favourite",{Remove:n.id})})}},{key:"dislike",value:function(){var n=this;this.liked=!1;localforage.removeItem("l_".concat(this.id)).then(function(){n.iteration+=1})}},{key:"listIcons",value:function(n){var t=[],i;return SearchMask.noFacility(n)?this.isAccessible?t.push({icon:ToiletMap.iconClass(SearchMask.xISACCESSIBLE),flag:this.isAccessible,mask:SearchMask.xISACCESSIBLE}):this.isInclusive?t.push({icon:ToiletMap.iconClass(SearchMask.xISINCLUSIVE),flag:this.isInclusive,mask:SearchMask.xISINCLUSIVE}):this.isUnisex?t.push({icon:ToiletMap.iconClass(SearchMask.xISUNISEX),flag:this.isUnisex,mask:SearchMask.xISUNISEX}):this.isMale&&this.isFemale?t.push({icon:ToiletMap.iconClass(SearchMask.xISMALE|SearchMask.xISFEMALE),flag:!0,mask:SearchMask.xISMALE|SearchMask.xISFEMALE}):this.isFemale?t.push({icon:ToiletMap.iconClass(SearchMask.xISFEMALE),flag:this.isFemale,mask:SearchMask.xISFEMALE}):this.isMale?t.push({icon:ToiletMap.iconClass(SearchMask.xISMALE),flag:this.isMale,mask:SearchMask.xISMALE}):this.isChangingPlaces?t.push({icon:ToiletMap.iconClass(SearchMask.xISCHANGINGPLACES),flag:this.isChangingPlaces,mask:SearchMask.xISCHANGINGPLACES}):this.isAdultChange?t.push({icon:ToiletMap.iconClass(SearchMask.xISADULTCHANGE),flag:this.isAdultChange,mask:SearchMask.xISADULTCHANGE}):this.isBabyChange?t.push({icon:ToiletMap.iconClass(SearchMask.xISBABYCHANGE),flag:this.isBabyChange,mask:SearchMask.xISBABYCHANGE}):this.isDumpPoint&&t.push({icon:ToiletMap.iconClass(SearchMask.xISDUMPPOINT),flag:this.isDumpPoint,mask:SearchMask.xISDUMPPOINT}):((n===0||SearchMask.hasFlag(n,SearchMask.xISACCESSIBLE))&&t.push({icon:ToiletMap.iconClass(SearchMask.xISACCESSIBLE),flag:this.isAccessible,mask:SearchMask.xISACCESSIBLE}),(n===0||SearchMask.hasFlag(n,SearchMask.xISMALE))&&t.push({icon:ToiletMap.iconClass(SearchMask.xISMALE),flag:this.isMale,mask:SearchMask.xISMALE}),(n===0||SearchMask.hasFlag(n,SearchMask.xISFEMALE))&&t.push({icon:ToiletMap.iconClass(SearchMask.xISFEMALE),flag:this.isFemale,mask:SearchMask.xISFEMALE}),(n===0||SearchMask.hasFlag(n,SearchMask.xISUNISEX))&&t.push({icon:ToiletMap.iconClass(SearchMask.xISUNISEX),flag:this.isUnisex,mask:SearchMask.xISUNISEX}),(n===0||SearchMask.hasFlag(n,SearchMask.xISINCLUSIVE))&&t.push({icon:ToiletMap.iconClass(SearchMask.xISINCLUSIVE),flag:this.isInclusive,mask:SearchMask.xISINCLUSIVE}),n===0||SearchMask.hasFlag(n,SearchMask.xISADULTCHANGE)&&!this.isChangingPlaces?t.push({icon:ToiletMap.iconClass(SearchMask.xISADULTCHANGE),flag:this.isAdultChange,mask:SearchMask.xISADULTCHANGE}):!SearchMask.hasFlag(n,SearchMask.xISCHANGINGPLACES)&&SearchMask.hasFlag(n,SearchMask.xISADULTCHANGE)&&this.isChangingPlaces&&t.push({icon:ToiletMap.iconClass(SearchMask.xISCHANGINGPLACES),flag:this.isChangingPlaces,mask:SearchMask.xISCHANGINGPLACES}),SearchMask.hasFlag(n,SearchMask.xISCHANGINGPLACES)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISCHANGINGPLACES),flag:this.isChangingPlaces,mask:SearchMask.xISCHANGINGPLACES}),(n===0||SearchMask.hasFlag(n,SearchMask.xISBABYCHANGE)||SearchMask.noFacility(n)&&this.isBabyChange)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISBABYCHANGE),flag:this.isBabyChange,mask:SearchMask.xISBABYCHANGE}),(n===0||SearchMask.hasFlag(n,SearchMask.xISDUMPPOINT)||SearchMask.noFacility(n)&&this.isDumpPoint)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISDUMPPOINT),flag:this.isDumpPoint,mask:SearchMask.xISDUMPPOINT}),(SearchMask.hasFlag(n,SearchMask.xISMALE)||SearchMask.hasFlag(n,SearchMask.xISFEMALE)||SearchMask.hasFlag(n,SearchMask.xISINCLUSIVE))&&!SearchMask.hasFlag(n,SearchMask.xISUNISEX)&&this.isUnisex&&t.push({icon:ToiletMap.iconClass(SearchMask.xISUNISEX),flag:this.isUnisex,mask:SearchMask.xISUNISEX})),SearchMask.hasFlag(n,SearchMask.xISLHTRANSFER)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISLHTRANSFER),flag:this.isLHTransfer,mask:SearchMask.xISLHTRANSFER}),SearchMask.hasFlag(n,SearchMask.xISRHTRANSFER)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISRHTRANSFER),flag:this.isRHTransfer,mask:SearchMask.xISRHTRANSFER}),SearchMask.hasFlag(n,SearchMask.xISAMBULANT)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISAMBULANT),flag:this.isAmbulant,mask:SearchMask.xISAMBULANT}),this.isWashout&&SearchMask.hasFlag(n,SearchMask.xISWASHOUT)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISWASHOUT),flag:this.isWashout,mask:SearchMask.xISWASHOUT}),this.isAfterHours&&SearchMask.hasFlag(n,SearchMask.xISAFTERHOURS)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISAFTERHOURS),flag:this.isAfterHours,mask:SearchMask.xISAFTERHOURS}),SearchMask.hasFlag(n,SearchMask.xISPARKING)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISPARKING),flag:this.isParking,mask:SearchMask.xISPARKING}),SearchMask.hasFlag(n,SearchMask.xISPARKINGACCESSIBLE)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISPARKINGACCESSIBLE),flag:this.isParkingAccessible,mask:SearchMask.xISPARKINGACCESSIBLE}),SearchMask.hasFlag(n,SearchMask.xISSHARPSDISPOSAL)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISSHARPSDISPOSAL),flag:this.isSharpsDisposal,mask:SearchMask.xISSHARPSDISPOSAL}),!SearchMask.hasFlag(n,SearchMask.xISSHOWERS)||!this.isShowers&&SearchMask.hasFlag(n,SearchMask.xISACSHOWER)&&this.isAdultChangeShower||t.push({icon:ToiletMap.iconClass(SearchMask.xISSHOWERS),flag:this.isShowers,mask:SearchMask.xISSHOWERS}),SearchMask.hasFlag(n,SearchMask.xISSANITARYDISPOSAL)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISSANITARYDISPOSAL),flag:this.isSanitaryDisposal,mask:SearchMask.xISSANITARYDISPOSAL}),SearchMask.hasFlag(n,SearchMask.xISDRINKINGWATER)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISDRINKINGWATER),flag:this.isDrinkingWater,mask:SearchMask.xISDRINKINGWATER}),SearchMask.hasFlag(n,SearchMask.xISKEYREQUIRED)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISKEYREQUIRED),flag:this.isKeyRequired,mask:SearchMask.xISKEYREQUIRED}),SearchMask.hasFlag(n,SearchMask.xISCLOSED)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISCLOSED),flag:this.isClosed,mask:SearchMask.xISCLOSED}),this.isBYOSling&&SearchMask.hasFlag(n,SearchMask.xISBYOSLING)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISBYOSLING),flag:this.isBYOSling,mask:SearchMask.xISBYOSLING}),!this.isAdultChangeShower||!SearchMask.hasFlag(n,SearchMask.xISACSHOWER)||!this.isAdultChangeShower&&SearchMask.hasFlag(n,SearchMask.xISSHOWERS)&&this.isShowers||t.push({icon:ToiletMap.iconClass(SearchMask.xISACSHOWER),flag:this.isAdultChangeShower,mask:SearchMask.xISACSHOWER}),this.isMensPadDisposal&&SearchMask.hasFlag(n,SearchMask.xISMENSPADDISPOSAL)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISMENSPADDISPOSAL),flag:this.isMensPadDisposal,mask:SearchMask.xISMENSPADDISPOSAL}),SearchMask.hasFlag(n,SearchMask.xISBABYCAREROOM)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISBABYCAREROOM),flag:this.isBabyCareRoom,mask:SearchMask.xISBABYCAREROOM}),SearchMask.hasFlag(n,SearchMask.xISPAYMENTREQUIRED)&&t.push({icon:ToiletMap.iconClass(SearchMask.xISPAYMENTREQUIRED),flag:this.isPaymentRequired,mask:SearchMask.xISPAYMENTREQUIRED}),this.isMLAKKey||this.isMLAKAfterHours?(i=t.slice(0,6),this.isMLAKKey?i.push({icon:ToiletMap.iconClass(SearchMask.xISMLAKKEY),flag:this.isMLAKKey,mask:SearchMask.xISMLAKKEY}):i.push({icon:ToiletMap.iconClass(SearchMask.xISMLAKAFTERHOURS),flag:this.isMLAKAfterHours,mask:SearchMask.xISMLAKAFTERHOURS}),i):t.slice(0,7)}},{key:"listHTML",value:function(n){return this.listIcons(n).map(function(n){return"<svg class='icon".concat(n.flag?"":" disabled").concat(SearchMask.classOverride(n.mask)?" "+SearchMask.classOverride(n.mask):"","'>").concat(n.icon==="toilet"?"<title>"+ToiletMap.iconName(n.mask)+"<\/title>":"","<use xlink:href='/Content/img/icons/icons.svg#").concat(n.icon,"' /><\/svg>")}).join("")}},{key:"expand",value:function(){var n=this,t;this.extrasLoaded||(t="/api/AppAPI/GetFacilityExtras/".concat(this.id),Vue.http.get(t).then(function(t){t.json().then(function(t){n.contentID=t.CId;n.accessNote=t.AceNt;n.adultChangeNote=t.AChNt;n.addressNote=t.AdNt;n.babyChangeNote=t.BChNt;n.dumpPointNote=t.DPNt;n.parkingNote=t.PkNt;n.openingHoursNote=t.OhNt;n.toiletNote=t.TNt;n.yearAdultChange=t.YAch;n.YearToilet=t.YT;n.gids=t.GIds;n.gids.forEach(function(t){(new Image).src=n.thumbnailUri(t)});n.providerTitle=t.PT;n.providerEmail=t.PE;n.providerPhone=t.PP;n.providerURI=t.PW;n.providerGId=t.PGId;n.AgencyID=t.AID;n.providerGId&&((new Image).src=n.providerLogoUri);n.iteration+=1;n.extrasLoaded=!0})},function(n){n&&n.status===404?Message.display(MessageType.error,null,"Facility not found",1e4):Sentry.captureException(n)}))}},{key:"address",get:function(){return[this.address1,this.locality].filter(function(n){return n==null?"":n}).join(", ")}},{key:"directionsName",get:function(){return this.title.includes(this.locality)?this.title:[this.title,this.locality].filter(function(n){return n==null?"":n}).join(", ")}},{key:"showRouteDistance",get:function(){return!(this.routeDistance===null||this.routeDistance>1e5)}},{key:"routeDistanceStyle",get:function(){return this.showRouteDistance&&!isBot()?"":"display: none;"}},{key:"routeDistanceDisplay",get:function(){var r,n,t,i;if(this.routeDistance===null)return null;if(this.routeDistance<1e3)return Math.round(this.routeDistance).toString()+" m";if(r="",n=this.routeDistance/1e3,n<=1e3)return n===1?_.round(n,1).toString()+" km":_.round(n,1).toString()+" km";for(t=0,i=Math.round(n).toString();n>=1;)r=(n>1e3?",":"")+i.substring(i.length-t-Math.min(3,i.length-t),i.length-t)+r,n=n/1e3,t+=3;return r+" km"}},{key:"pinIcon",get:function(){return{url:"/Content/img/pins/".concat(this.pin),size:new google.maps.Size(pin_width,pin_height),scaledSize:new google.maps.Size(pin_width,pin_height),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(pin_width*.5,pin_height)}}},{key:"primaryIcon",get:function(){switch(this.facilityType){case"Bus station":return"bus";case"Caravan park":return"caravan";case"Camping ground":return"camping";case"Car park":return"car-park";case"Train station":return"train";case"Service station":return"service_station";case"Park or reserve":return"park";case"Airport":return"airport";case"Sporting facility":return"sports";case"Food outlet":return"food";case"Shopping centre":return"shopping_centre";case"Swimming pool":return"swimming";case"Rest area":return"rest_area";case"Beach":return"beach";case"Jetty":return"jetty";case"Cemetery":return"cemetery";case"Community building":return"community_building";default:return SearchMask.isToilet(this.searchMask)?"toilet":SearchMask.hasFlag(this.searchMask,SearchMask.xISDUMPPOINT)?"dump-point":SearchMask.hasFlag(this.searchMask,SearchMask.xISADULTCHANGE)?"adult-change":SearchMask.hasFlag(this.searchMask,SearchMask.xISBABYCHANGE)?"baby-change":"toilet"}}},{key:"primaryAlt",get:function(){switch(this.facilityType){case"Bus station":case"Caravan park":case"Camping ground":case"Car park":case"Train station":case"Service station":case"Park or reserve":case"Airport":case"Sporting facility":case"Food outlet":case"Shopping centre":case"Swimming pool":return this.facilityType;default:return SearchMask.hasFlag(this.searchMask,SearchMask.xISUNISEX)||SearchMask.hasFlag(this.searchMask,SearchMask.xISMALE)||SearchMask.hasFlag(this.searchMask,SearchMask.xISFEMALE)||SearchMask.hasFlag(this.searchMask,SearchMask.xISINCLUSIVE)?SearchMask.hasFlag(this.searchMask,SearchMask.xISACCESSIBLE)?"Accessible toilet":"Toilet":null}}},{key:"providerLogoUri",get:function(){return this.providerGId?"/api/AppAPI/GetImage/".concat(this.providerGId):null}},{key:"isToilet",get:function(){return SearchMask.isToilet(this.searchMask)}},{key:"isMale",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISMALE)}},{key:"isFemale",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISFEMALE)}},{key:"isUnisex",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISUNISEX)}},{key:"isInclusive",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISINCLUSIVE)}},{key:"isAccessible",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISACCESSIBLE)}},{key:"isDumpPoint",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISDUMPPOINT)}},{key:"isWashout",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISWASHOUT)}},{key:"isAfterHours",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISAFTERHOURS)}},{key:"isParking",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISPARKING)}},{key:"isParkingAccessible",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISPARKINGACCESSIBLE)}},{key:"isBabyChange",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISBABYCHANGE)}},{key:"isSharpsDisposal",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISSHARPSDISPOSAL)}},{key:"isShowers",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISSHOWERS)}},{key:"isSanitaryDisposal",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISSANITARYDISPOSAL)}},{key:"isDrinkingWater",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISDRINKINGWATER)}},{key:"isPaymentRequired",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISPAYMENTREQUIRED)}},{key:"isKeyRequired",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISKEYREQUIRED)}},{key:"isMLAKKey",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISMLAKKEY)}},{key:"isMLAKAfterHours",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISMLAKAFTERHOURS)}},{key:"isOpenAllHours",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISOPENALLHOURS)}},{key:"isOpenDaylightHours",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISOPENDAYLIGHTHOURS)}},{key:"isClosed",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISCLOSED)}},{key:"isOpeningHoursVariable",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISOPENINGHOURSVARIABLE)}},{key:"isOpenVenueHours",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISOPENVENUEHOURS)}},{key:"isOpenSchedule",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISOPENSCHEDULE)}},{key:"isAmbulant",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISAMBULANT)}},{key:"isLHTransfer",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISLHTRANSFER)}},{key:"isRHTransfer",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISRHTRANSFER)}},{key:"isAdultChange",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISADULTCHANGE)}},{key:"isBYOSling",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISBYOSLING)}},{key:"isAdultChangeShower",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISACSHOWER)}},{key:"isMensPadDisposal",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISMENSPADDISPOSAL)}},{key:"isChangingPlaces",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISCHANGINGPLACES)}},{key:"isBabyCareRoom",get:function(){return SearchMask.hasFlag(this.searchMask,SearchMask.xISBABYCAREROOM)}},{key:"isLiked",get:function(){return this.liked}},{key:"sortScore",get:function(){return this.score+(this.liked?1e4:0)}},{key:"pin",get:function(){var n=app.searchMask;return this.isAccessible&&(SearchMask.hasFlag(n,SearchMask.xISACCESSIBLE)||SearchMask.noFacility(n))?"pin_a.svg":this.isInclusive&&(SearchMask.hasFlag(n,SearchMask.xISINCLUSIVE)||SearchMask.noFacility(n))?"pin_i.svg":(this.isUnisex||this.isMale&&this.isFemale)&&(SearchMask.hasFlag(n,SearchMask.xISUNISEX)||SearchMask.hasFlag(n,SearchMask.xISFEMALE)||SearchMask.hasFlag(n,SearchMask.xISMALE)||SearchMask.noFacility(n))?"pin_u.svg":this.isFemale&&(SearchMask.hasFlag(n,SearchMask.xISFEMALE)||SearchMask.noFacility(n))?"pin_f.svg":this.isMale&&(SearchMask.hasFlag(n,SearchMask.xISMALE)||SearchMask.noFacility(n))?"pin_m.svg":this.isChangingPlaces&&SearchMask.hasFlag(n,SearchMask.xISCHANGINGPLACES)&&!SearchMask.isMatchingToilet(n,this.searchMask)?"pin_changingplaces.svg":this.isChangingPlaces&&SearchMask.hasFlag(n,SearchMask.xISADULTCHANGE)&&!SearchMask.isMatchingToilet(n,this.searchMask)?"pin_changingplaces.svg":this.isAdultChange&&SearchMask.hasFlag(n,SearchMask.xISADULTCHANGE)&&!SearchMask.isMatchingToilet(n,this.searchMask)?"pin_ac.svg":this.isBabyChange&&SearchMask.hasFlag(n,SearchMask.xISBABYCHANGE)&&!SearchMask.isMatchingToilet(n,this.searchMask)?"pin_b.svg":this.isDumpPoint&&SearchMask.hasFlag(n,SearchMask.xISDUMPPOINT)&&!SearchMask.isMatchingToilet(n,this.searchMask)?"pin_dp.svg":this.isAccessible?"pin_a.svg":this.isInclusive?"pin_i.svg":this.isUnisex||this.isMale&&this.isFemale?"pin_u.svg":this.isFemale?"pin_f.svg":this.isMale?"pin_m.svg":this.isChangingPlaces?"pin_changingplaces.svg":this.isAdultChange?"pin_ac.svg":this.isBabyChange?"pin_b.svg":this.isDumpPoint?"pin_dp.svg":(Messages.display(MessageType.error,"There is a toilet with an ambiguous icon!",["Toilet ".concat(this.id," (").concat(this.title,") has an icon that cannot be determined!"),"This is usually invalid data but you had better check it out."]),console.error("Unknown pin type for toilet ".concat(this.id," (").concat(this.title,").")),"pin_unknown.svg")}}]),n}(),ToiletDistance=function ToiletDistance(n,t,i,r){_classCallCheck(this,ToiletDistance);this.ID=n;this.Distance=t;this.From=i;this.IsPrecise=r};"use strict";var minimumRadius=100,ToiletMap=function(){function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"minimumDistanceToEnterPanning",value:function(n){return n<=11?1e3:n>=18?0:n===12?800:n===13?500:n===14?200:100}},{key:"maximumDistanceToEnterTracking",value:function(n){switch(n){case 18:case 19:case 20:case 21:case 22:return 0;default:return 100}}},{key:"moreInformation",value:function(n){switch(n){case SearchMask.xISCHANGINGPLACES:return{title:"What are Changing Places?",content:["Changing Places provide an adult sized changing tables, ceiling hoist, a peninsular toilet, privacy screen and additional circulation space for people with complex toileting needs.","See <a href='https://changingplaces.org.au' target='_blank' rel='noopener noreferrer'>changingplaces.org.au<\/a> for more information."]};case SearchMask.xISMENSPADDISPOSAL:return{title:"What are BINS4Blokes?",content:["BINS4Blokes is an Australia-wide awareness and advocacy campaign promoting the installation of incontinence bins in male public toilet facilities.","See <a href='https://bins4blokes.org.au/' target='_blank' rel='noopener noreferrer'>bins4blokes.org.au<\/a> for more information."]}}return null}},{key:"iconClass",value:function(n){switch(n){case SearchMask.xISMALE|SearchMask.xISFEMALE:return"malefemale";case SearchMask.xISMALE:return"male";case SearchMask.xISFEMALE:return"female";case SearchMask.xISUNISEX:return"unisex";case SearchMask.xISINCLUSIVE:return"inclusive";case SearchMask.xISACCESSIBLE:return"accessible";case SearchMask.xISDUMPPOINT:return"dump-point";case SearchMask.xISWASHOUT:return"chemical-washout";case SearchMask.xISPARKING:return"parking";case SearchMask.xISPARKINGACCESSIBLE:return"accessible-parking";case SearchMask.xISBABYCHANGE:return"baby-change";case SearchMask.xISSHARPSDISPOSAL:return"sharps-disposal";case SearchMask.xISSHOWERS:return"showers";case SearchMask.xISSANITARYDISPOSAL:return"sanitary-disposal";case SearchMask.xISDRINKINGWATER:return"drinking-water";case SearchMask.xISKEYREQUIRED:return"key";case SearchMask.xISMLAKKEY:return"mlak";case SearchMask.xISMLAKAFTERHOURS:return"mlak-after-hours";case SearchMask.xISAMBULANT:return"ambulant";case SearchMask.xISLHTRANSFER:return"lh-transfer";case SearchMask.xISRHTRANSFER:return"rh-transfer";case SearchMask.xISADULTCHANGE:return"adult-change";case SearchMask.xISBYOSLING:return"byo-sling";case SearchMask.xISACSHOWER:return"adult-change-shower";case SearchMask.xISMENSPADDISPOSAL:return"mens-pads";case SearchMask.xISCHANGINGPLACES:return"changing-places-icon";case SearchMask.xISPAYMENTREQUIRED:return"payment";default:return"toilet"}}},{key:"rollover",value:function(n){switch(n){case"male":return"Male toilet";case"female":return"Female toilet";case"unisex":return"Unisex toilet";case"malefemale":return"Male and female toilets";case"accessible":return"Accessible toilets";case"adult-change":return"Adult change facilities";case"changing-places-icon":return"Changing Places accredited adult change facilities";case"ambulant":return"Ambulant facilities";case"baby-change":return"Baby change facilities";case"camping":return"Camp ground";case"airport":return"Airport";case"bus":return"Bus station";case"caravan":return"Caravan park";case"food":return"Food outlet";case"car-park":return"Parking station";case"park":return"Park or reserve";case"service_station":return"Service station";case"shopping_centre":return"Shopping centre";case"sports":return"Sporting facility";case"swimming":return"Swimming pool";case"train":return"Train station";case"community_building":return"Community building";case"rest_area":return"Rest area";case"beach":return"Beach";case"cemetery":return"Cemetery";case"jetty":return"Jetty";case"dump-point":return"Caravan dump point";case"inclusive":return"All gender";case"lh-transfer":return"Left hand transfer";case"payment":return"Payment";case"rh-transfer":return"Right hand transfer";case"showers":return"Showers";case"sharps-disposal":return"Sharps disposal";case"drinking-water":return"Drinking water";case"sanitary-disposal":return"Sanitary disposal";case"mens-pads":return"Men's pad disposal";case"byo-sling":return"BYO sling";case"on-foot":return"On foot";case"in-car":return"In car";case"open-all":return"Open any time";case"open-24":return"Open 24 hours";case"open-now":return"Open now";case"mlak":return"MLAK key";case"adult-change-shower":return"Shower in adult change room";case"chemical-washout":return"Chemical toilet wash out water";case"parking":return"Parking";case"accessible-parking":return"Accessible parking";case"key":return"Key";case"mlak-after-hours":return"MLAK key required after hours";case"after-hours":return"Dump point after hours";case"changing-places":return"Changing places - transforming lives";case"baby-care":return"Certified baby care room";default:return"Toilet"}}},{key:"iconName",value:function(n){switch(n){case SearchMask.xISMALE:return"Male toilet";case SearchMask.xISFEMALE:return"Female toilet";case SearchMask.xISUNISEX:return"Unisex toilet";case SearchMask.xISINCLUSIVE:return"All gender toilet";case SearchMask.xISACCESSIBLE:return"Accessible facilities";case SearchMask.xISDUMPPOINT:return"Dump point";case SearchMask.xISWASHOUT:return"Washout water";case SearchMask.xISAFTERHOURS:return"Available after hours";case SearchMask.xISPARKING:return"Parking";case SearchMask.xISPARKINGACCESSIBLE:return"Accessible parking";case SearchMask.xISBABYCHANGE:return"Baby change facilities";case SearchMask.xISSHARPSDISPOSAL:return"Sharps disposal";case SearchMask.xISSHOWERS:return"Showers";case SearchMask.xISSANITARYDISPOSAL:return"Sanitary disposal";case SearchMask.xISDRINKINGWATER:return"Drinking water";case SearchMask.xISKEYREQUIRED:return"Key required";case SearchMask.xISMLAKKEY:return"MLAK key required";case SearchMask.xISMLAKAFTERHOURS:return"MLAK key required after hours";case SearchMask.xISAMBULANT:return"Ambulant facilities";case SearchMask.xISLHTRANSFER:return"Left-hand transfer";case SearchMask.xISRHTRANSFER:return"Right-hand transfer";case SearchMask.xISADULTCHANGE:return"Adult change facilities";case SearchMask.xISBYOSLING:return"BYO sling is required";case SearchMask.xISACSHOWER:return"Adult change showers";case SearchMask.xISMENSPADDISPOSAL:return"BINS4Blokes";case SearchMask.xISCHANGINGPLACES:return"Changing Places facilities";case SearchMask.xISPAYMENTREQUIRED:return"Payment required";default:return"Facility"}}}]),n}(),SearchMask={xISMALE:1,xISFEMALE:2,xISUNISEX:4,xISINCLUSIVE:8,xISACCESSIBLE:16,xISDUMPPOINT:32,xISWASHOUT:64,xISAFTERHOURS:128,xISPARKING:256,xISPARKINGACCESSIBLE:512,xISBABYCHANGE:1024,xISSHARPSDISPOSAL:2048,xISSHOWERS:4096,xISSANITARYDISPOSAL:8192,xISDRINKINGWATER:16384,xISKEYREQUIRED:32768,xISMLAKKEY:65536,xISMLAKAFTERHOURS:131072,xISOPENALLHOURS:262144,xISOPENDAYLIGHTHOURS:524288,xISCLOSED:1048576,xISOPENINGHOURSVARIABLE:2097152,xISOPENVENUEHOURS:4194304,xISOPENSCHEDULE:8388608,xISAMBULANT:16777216,xISLHTRANSFER:33554432,xISRHTRANSFER:67108864,xISADULTCHANGE:134217728,xISBYOSLING:268435456,xISACSHOWER:536870912,xISMENSPADDISPOSAL:1073741824,xISCHANGINGPLACES:2147483648,xISBABYCAREROOM:4294967296,xISAS1428ADULTCHANGE:8589934592,xISBCA2020ADULTCHANGE:17179869184,xISPRE2010ADULTCHANGE:34359738368,xISAS1428TOILET:68719476736,xISBCA2020TOILET:137438953472,xISPRE2010TOILET:274877906944,xISTOILET:549755813888,xISPAYMENTREQUIRED:1099511627776,hasFlag:function(n,t){var i=~~(n/2147483648),r=~~(t/2147483648),u=n&2147483647,f=t&2147483647;return(i&r)*2147483648+(u&f)==t},hasFlagInEither:function(n,t,i){return this.hasFlag(n,i)||this.hasFlag(t,i)},setFlag:function(n,t){var i=~~(n/2147483648),r=~~(t/2147483648),u=n&2147483647,f=t&2147483647;return(i|r)*2147483648+(u|f)},unsetFlag:function(n,t){var i=~~(n/2147483648),r=~~(t/2147483648),u=n&2147483647,f=t&2147483647;return(i&~r)*2147483648+(u&~f)},allFlags:function(){return[this.xISMALE,this.xISFEMALE,this.xISUNISEX,this.xISINCLUSIVE,this.xISACCESSIBLE,this.xISDUMPPOINT,this.xISWASHOUT,this.xISAFTERHOURS,this.xISPARKING,this.xISPARKINGACCESSIBLE,this.xISBABYCHANGE,this.xISSHARPSDISPOSAL,this.xISSHOWERS,this.xISSANITARYDISPOSAL,this.xISDRINKINGWATER,this.xISKEYREQUIRED,this.xISMLAKKEY,this.xISMLAKAFTERHOURS,this.xISOPENALLHOURS,this.xISOPENDAYLIGHTHOURS,this.xISCLOSED,this.xISOPENINGHOURSVARIABLE,this.xISOPENVENUEHOURS,this.xISOPENSCHEDULE,this.xISAMBULANT,this.xISLHTRANSFER,this.xISRHTRANSFER,this.xISADULTCHANGE,this.xISBYOSLING,this.xISACSHOWER,this.xISMENSPADDISPOSAL,this.xISCHANGINGPLACES,this.xISBABYCAREROOM,this.xISAS1428ADULTCHANGE,this.xISBCA2020ADULTCHANGE,this.xISPRE2010ADULTCHANGE,this.xISAS1428TOILET,this.xISBCA2020TOILET,this.xISPRE2010TOILET,this.xISTOILET,this.xISPAYMENTREQUIRED]},flags:function(n){var t=this;return this.allFlags().filter(function(i){return t.hasFlag(n,i)})},name:function(n){switch(n){case SearchMask.xISMALE:return"male";case SearchMask.xISFEMALE:return"female";case SearchMask.xISUNISEX:return"unisex";case SearchMask.xISINCLUSIVE:return"all gender";case SearchMask.xISACCESSIBLE:return"accessible";case SearchMask.xISDUMPPOINT:return"dump point";case SearchMask.xISWASHOUT:return"washout water";case SearchMask.xISAFTERHOURS:return"after hours";case SearchMask.xISPARKING:return"parking";case SearchMask.xISPARKINGACCESSIBLE:return"accessible parking";case SearchMask.xISBABYCHANGE:return"baby change";case SearchMask.xISSHARPSDISPOSAL:return"sharps";case SearchMask.xISSHOWERS:return"showers";case SearchMask.xISSANITARYDISPOSAL:return"sanitary";case SearchMask.xISDRINKINGWATER:return"drinking water";case SearchMask.xISKEYREQUIRED:return"key";case SearchMask.xISMLAKKEY:return"mlak";case SearchMask.xISMLAKAFTERHOURS:return"mlak after hours";case SearchMask.xISOPENALLHOURS:return"all hours";case SearchMask.xISOPENDAYLIGHTHOURS:return"daylight hours";case SearchMask.xISCLOSED:return"closed";case SearchMask.xISOPENINGHOURSVARIABLE:return"variable hours";case SearchMask.xISOPENVENUEHOURS:return"venue hours";case SearchMask.xISOPENSCHEDULE:return"schedule";case SearchMask.xISAMBULANT:return"ambulant";case SearchMask.xISLHTRANSFER:return"lh transfer";case SearchMask.xISRHTRANSFER:return"rh transfer";case SearchMask.xISADULTCHANGE:return"adult change";case SearchMask.xISBYOSLING:return"byo sling";case SearchMask.xISACSHOWER:return"ac shower";case SearchMask.xISMENSPADDISPOSAL:return"BINS4Blokes";case SearchMask.xISCHANGINGPLACES:return"changing places";case SearchMask.xISBABYCAREROOM:return"baby care room";case SearchMask.xISTOILET:return"toilet";case SearchMask.xISPAYMENTREQUIRED:return"payment";default:return"UNKNOWN"}},classOverride:function(n){switch(n){case SearchMask.xISWASHOUT:return"amenity";case SearchMask.xISSHARPSDISPOSAL:return"amenity";case SearchMask.xISSHOWERS:return"amenity";case SearchMask.xISSANITARYDISPOSAL:return"amenity";case SearchMask.xISDRINKINGWATER:return"amenity";case SearchMask.xISAMBULANT:return"amenity";case SearchMask.xISLHTRANSFER:return"amenity";case SearchMask.xISRHTRANSFER:return"amenity";case SearchMask.xISBYOSLING:return"amenity";case SearchMask.xISACSHOWER:return"amenity";case SearchMask.xISMENSPADDISPOSAL:return"amenity";case SearchMask.xISCHANGINGPLACES:return"changing places";default:return null}},names:function(n){var t=this;return this.flags(n).map(function(n){return t.name(n)}).join(", ")},matches:function(n,t){return(n&t)===t},isMatchingToilet:function(n,t){return this.hasFlag(n,this.xISACCESSIBLE)&&this.hasFlag(t,this.xISACCESSIBLE)||this.hasFlag(n,this.xISINCLUSIVE)&&this.hasFlag(t,this.xISINCLUSIVE)||this.hasFlag(n,this.xISUNISEX)&&this.hasFlag(t,this.xISUNISEX)||this.hasFlag(n,this.xISFEMALE)&&this.hasFlag(t,this.xISFEMALE)||this.hasFlag(n,this.xISMALE)&&this.hasFlag(t,this.xISMALE)},isToilet:function(n){return this.hasFlag(n,this.xISACCESSIBLE)||this.hasFlag(n,this.xISINCLUSIVE)||this.hasFlag(n,this.xISUNISEX)||this.hasFlag(n,this.xISFEMALE)||this.hasFlag(n,this.xISMALE)},noFacility:function(n){return!(this.hasFlag(n,this.xISACCESSIBLE)||this.hasFlag(n,this.xISINCLUSIVE)||this.hasFlag(n,this.xISUNISEX)||this.hasFlag(n,this.xISFEMALE)||this.hasFlag(n,this.xISMALE)||this.hasFlag(n,this.xISCHANGINGPLACES)||this.hasFlag(n,this.xISADULTCHANGE)||this.hasFlag(n,this.xISBABYCHANGE)||this.hasFlag(n,this.xISDUMPPOINT))},flipMask:function(n,t){var i=this,r=t;return this.allFlags().forEach(function(u){i.hasFlag(n,u)&&i.hasFlag(t,u)&&(r=i.unsetFlag(r,u))}),r},mergeMaskForCustomMapUse:function(n,t){var i=this,r=0;return this.allFlags().forEach(function(u){(i.hasFlag(t,u)||i.hasFlag(n,u))&&(r=i.setFlag(r,u))}),r},mergeMaskForOverride:function(n,t){var i=this,r=0;return this.allFlags().forEach(function(u){i.hasFlag(t,u)&&!i.hasFlag(n,u)&&(r=i.setFlag(r,u))}),r}},oldDefaultSearchMask=SearchMask.xISMALE|SearchMask.xISFEMALE|SearchMask.xISUNISEX|SearchMask.xISACCESSIBLE|SearchMask.xISMLAKKEY,defaultSearchMask=SearchMask.xISMALE|SearchMask.xISFEMALE|SearchMask.xISUNISEX|SearchMask.xISACCESSIBLE,fullSearchMask=SearchMask.xISMALE|SearchMask.xISFEMALE|SearchMask.xISUNISEX|SearchMask.xISINCLUSIVE|SearchMask.xISACCESSIBLE|SearchMask.xISDUMPPOINT|SearchMask.xISWASHOUT|SearchMask.xISAFTERHOURS|SearchMask.xISPARKING|SearchMask.xISPARKINGACCESSIBLE|SearchMask.xISBABYCHANGE|SearchMask.xISSHARPSDISPOSAL|SearchMask.xISSHOWERS|SearchMask.xISSANITARYDISPOSAL|SearchMask.xISDRINKINGWATER|SearchMask.xISKEYREQUIRED|SearchMask.xISMLAKKEY|SearchMask.xISMLAKAFTERHOURS|SearchMask.xISOPENALLHOURS|SearchMask.xISOPENDAYLIGHTHOURS|SearchMask.xISCLOSED|SearchMask.xISOPENINGHOURSVARIABLE|SearchMask.xISOPENVENUEHOURS|SearchMask.xISOPENSCHEDULE|SearchMask.xISAMBULANT|SearchMask.xISLHTRANSFER|SearchMask.xISRHTRANSFER|SearchMask.xISADULTCHANGE|SearchMask.xISBYOSLING|SearchMask.xISACSHOWER|SearchMask.xISMENSPADDISPOSAL|SearchMask.xISCHANGINGPLACES|SearchMask.xISBABYCAREROOM|SearchMask.xISAS1428ADULTCHANGE|SearchMask.xISBCA2020ADULTCHANGE|SearchMask.xISPRE2010ADULTCHANGE|SearchMask.xISAS1428TOILET|SearchMask.xISBCA2020TOILET|SearchMask.xISPRE2010TOILET|SearchMask.xISTOILET|SearchMask.xISPAYMENTREQUIRED,initialLocations=[{lat:-16.9117592,lng:145.758895,zoom:15},{lat:-42.8862339,lng:147.3338587,zoom:17},{lat:-37.8176935,lng:144.9679913,zoom:16},{lat:-32.0091923,lng:115.4904409,zoom:14},{lat:-27.4797979,lng:153.0136087,zoom:15},{lat:-33.8582054,lng:151.2104902,zoom:17},{lat:-12.4275476,lng:130.8322733,zoom:16}];"use strict";var IconType={toilet:0,amenity:1,facility:2,access:3,"class":function(n){switch(n){case IconType.toilet:return"toilet";case IconType.amenity:return"amenity";case IconType.facility:return"facility";case IconType.access:return"access";default:return""}}},Icon={props:["iconType","isDisabled","rollover","classOverride"],template:'\n        <svg tabindex="0" class="icon" :class="{disabled: isDisabled, amenity: classOverride === \'amenity\', find: classOverride === \'find\', facility: classOverride === \'facility\'}">\n            <title v-if="rollover">{{rollover}}<\/title>\n            <title v-else>{{rolloverText(iconType)}}<\/title>\n\n            <use :xlink:href="\'/Content/img/icons/icons.svg#\' + iconType" />\n        <\/svg>',methods:{rolloverText:function(n){return ToiletMap.rollover(n)},callout:function(n){Messages.display(MessageType.rollover,null,n,5e3)}}},Badge={props:["badgeType","rollover"],template:'\n        <a class="icon-badge" @click.prevent="callout(rollover, true)">\n            <svg>\n                <title v-if="rollover">{{rollover}}<\/title>\n                <use :xlink:href="\'/Content/img/badges/badges.svg#\' + badgeType" />\n            <\/svg>\n        <\/a>\n    ',methods:{callout:function(n){Messages.display(MessageType.rollover,null,n,5e3)}}},FacilityHeader={props:["facility","showCallout"],template:'\n        <header class="facility-header">\n            <svg class="icon large facility"><title v-if="facility.primaryAlt">{{facility.primaryAlt}}<\/title><use :xlink:href=\'"/Content/img/icons/icons.svg#" + facility.primaryIcon\' /><\/svg>\n            <div>\n                <h1 @click="callout(facility.title, facility.address)">{{facility.title}}<\/h1>\n                <a class="address" href="#" @click.stop="$emit(\'directions\')">{{facility.address}}<\/a>\n                <p v-if="facility.showRouteDistance" class="distance">{{facility.routeDistanceDisplay}}<\/p>\n            <\/div>\n            <a>\n                <svg class="heart" :class="{liked: facility.isLiked}" @click="$emit(\'like\', facility.id);">\n                    <title v-if="facility.isLiked">Remove from My facilities<\/title>\n                    <title v-else>Add to My facilities<\/title>\n                    <use xlink:href="/Content/img/icons/icons.svg#heart" />\n                <\/svg>\n            <\/a>\n        <\/header>',methods:{callout:function(n,t){this.showCallout&&Messages.display(MessageType.rollover,null,"".concat(n,"<br /><span class='small'>").concat(t,"<\/span>"),5e3)}}},FacilityListItem={components:{FacilityHeader:FacilityHeader,Icon:Icon},props:["facility","searchmask","lat","lng"],template:'\n        <div tabindex="0" @click="$emit(\'select-facility\')">\n            <facility-header :key="\'header\'+facility.iteration" :facility="facility" :lat="lat" :lng="lng" @like="$emit(\'like\', $event);" @directions="$emit(\'directions\')"><\/facility-header>\n            <div class="icon-list toilet">\n                <icon v-for="i in facility.listIcons(searchmask)" :classOverride="classOverride(i.mask)" :key="i.icon" :icon-type=\'i.icon\' :is-disabled=\'!i.flag\' :rollover="i.icon==\'toilet\' ? iconName(i.mask) : null"><\/icon>\n            <\/div>\n            <ul>\n                <li tabindex="0" v-if="facility.openingHours" class="openingHours">{{facility.openingHours}}<\/li>\n                <li><a :href="facility.id" class="more-information" @click.prevent="$emit(\'more-info\', facility.id)">More information<\/a>\n                <\/li>\n            <\/ul>\n        <\/div>\n    ',methods:{iconName:function(n){return ToiletMap.iconName(n)},classOverride:function(n){return SearchMask.classOverride(n)}}},PreferenceItem={components:{Icon:Icon},props:["icon","enabled","name","mask"],template:'<div :title="\'Toggle \' + name + \' preference\'">\n                    <a @click="$emit(\'toggle\', mask)"><icon  :id="\'icon_\' + icon" :is-disabled="!enabled" :icon-type=\'icon\'><\/icon><\/a>\n                    <div class="preference-description">\n                        <span @click="$emit(\'toggle\', mask)">{{name}}<\/span>\n                        <a v-if="title(mask)!==null" href="#" @click.prevent="callout(mask)">{{title(mask)}}<\/a>\n                    <\/div>\n                <\/div>',methods:{callout:function(n){var t=ToiletMap.moreInformation(n);Messages.display(MessageType.info,t.title,t.content)},title:function(n){var t=ToiletMap.moreInformation(n);return t?t.title:null}}},PreferenceIcon={components:{Icon:Icon},props:["icon","enabled","mask"],template:"<div @click=\"$emit('toggle', mask)\"><icon :id=\"'icon_' + icon\" :is-disabled=\"!enabled\" :icon-type='icon'><\/icon><\/div>"},FindItem={components:{Icon:Icon},props:["icon","enabled","name","mask"],template:'<div @click="$emit(\'toggle\', mask)" :title="\'Toggle \' + name"><icon classOverride="find" :id="\'icon_\' + icon" :is-disabled="!enabled" :icon-type=\'icon\'><\/icon><span>{{name}}<\/span><\/div>'},DetailsToiletList={components:{icon:Icon},data:function(){return{sm:SearchMask}},props:["facility","preferences","highlight","showAll"],template:"\n    <section :class=\"{ highlight: highlight }\">\n        <h2>Toilets<\/h2>\n        <div class=\"icon-list toilet\">\n            <a @click.prevent=\"callout(sm.xISACCESSIBLE, facility.isAccessible)\"><icon icon-type='accessible' :is-disabled='!facility.isAccessible'><\/icon><\/a>\n            <a @click.prevent=\"callout(sm.xISMALE, facility.isMale)\"><icon icon-type='male' :is-disabled='!facility.isMale'><\/icon><\/a>\n            <a @click.prevent=\"callout(sm.xISFEMALE, facility.isFemale)\"><icon icon-type='female' :is-disabled='!facility.isFemale'><\/icon><\/a>\n            <a @click.prevent=\"callout(sm.xISUNISEX, facility.isUnisex)\"><icon icon-type='unisex' :is-disabled='!facility.isUnisex'><\/icon><\/a>\n            <a @click.prevent=\"callout(sm.xISINCLUSIVE, facility.isInclusive)\"><icon icon-type='inclusive' :is-disabled='!facility.isInclusive'><\/icon><\/a>\n            <a @click.prevent=\"callout(sm.xISLHTRANSFER, facility.isLHTransfer)\"><icon classOverride=\"amenity\" icon-type='lh-transfer' :is-disabled='!facility.isLHTransfer'><\/icon><\/a>\n            <a @click.prevent=\"callout(sm.xISRHTRANSFER, facility.isRHTransfer)\"><icon classOverride=\"amenity\" icon-type='rh-transfer' :is-disabled='!facility.isRHTransfer'><\/icon><\/a>\n            <a @click.prevent=\"callout(sm.xISAMBULANT, facility.isAmbulant)\"><icon classOverride=\"amenity\" icon-type='ambulant' :is-disabled='!facility.isAmbulant'><\/icon><\/a>\n        <\/div>\n        <p v-if=\"facility.toiletNote\" v-for=\"p in paragraphs(facility.toiletNote)\">{{p}}<\/p>\n    <\/section>\n    ",methods:{paragraphs:function(n){return n.split(/\r?\n/)},callout:function(n,t){Messages.display(MessageType.rollover,null,"".concat(ToiletMap.iconName(n)," ").concat(t?" available":" not available"),5e3)}}},DetailsAdultChangeList={components:{icon:Icon,badge:Badge},data:function(){return{sm:SearchMask}},props:["facility","preferences","highlight","showAll"],template:'\n    <section :class="{ highlight: highlight }">\n        <h2>Adult Change<\/h2>\n        <div class="icon-list toilet">\n            <a v-if="facility.isChangingPlaces" @click.prevent="callout(sm.xISCHANGINGPLACES, facility.isChangingPlaces)"><icon icon-type=\'changing-places-icon\' :is-disabled=\'!facility.isChangingPlaces\'><\/icon><\/a>\n            <a v-else @click.prevent="callout(sm.xISADULTCHANGE, facility.isAdultChange)"><icon icon-type=\'adult-change\' :is-disabled=\'!facility.isAdultChange\'><\/icon><\/a>\n            <a v-if="facility.isAdultChangeShower || showAll" @click.prevent="callout(sm.xISACSHOWER, facility.isAdultChangeShower)"><icon classOverride="amenity" icon-type=\'adult-change-shower\' :is-disabled=\'!facility.isAdultChangeShower\'><\/icon><\/a>\n            <a v-if="facility.isBYOSling || showAll" @click.prevent="callout(sm.xISBYOSLING, facility.isBYOSling)"><icon classOverride="amenity" icon-type=\'byo-sling\' :is-disabled=\'!facility.isBYOSling\' rollover=\'BYO sling is required\'><\/icon><\/a>\n            <badge v-if="facility.isChangingPlaces" badge-type=\'changingplaces\' rollover="Changing Places - Transforming Lives"><\/badge>\n        <\/div>\n        <p v-if="facility.adultChangeNote" v-for="p in paragraphs(facility.adultChangeNote)">{{p}}<\/p>\n    <\/section>\n    ',methods:{paragraphs:function(n){return n.split(/\r?\n/)},callout:function(n,t){var i=ToiletMap.iconName(n);i.includes("required")?t||(i=i.replace("required","not required")):i=i+(t?" available":" not available");Messages.display(MessageType.rollover,null,i,5e3)}}},DetailsBabyChangeList={components:{icon:Icon,badge:Badge},data:function(){return{sm:SearchMask}},props:["facility","preferences","highlight"],template:'\n    <section :class="{ highlight: highlight }">\n        <h2>Baby Change<\/h2>\n        <div class="icon-list toilet">\n            <a @click.prevent="callout(sm.xISBABYCHANGE, facility.isBabyChange)"><icon icon-type=\'baby-change\' :is-disabled=\'!facility.isBabyChange\'><\/icon><\/a>\n            <badge v-if="facility.isBabyCareRoom" badge-type=\'babycare\' rollover="Australian Breastfeeding Association - Baby Care Room"><\/badge>\n        <\/div>\n        <p v-if="facility.babyChangeNote"  v-for="p in paragraphs(facility.babyChangeNote)">{{p}}<\/p>\n    <\/section>\n    ',methods:{paragraphs:function(n){return n.split(/\r?\n/)},callout:function(n,t){Messages.display(MessageType.rollover,null,"".concat(ToiletMap.iconName(n)," ").concat(t?" available":" not available"),5e3)}}},DetailsDumpPointList={components:{icon:Icon},data:function(){return{sm:SearchMask}},props:["facility","preferences","highlight","showAll"],template:'\n    <section :class="{ highlight: highlight }">\n        <h2>Dump Point<\/h2>\n        <div class="icon-list toilet">\n            <a @click.prevent="callout(sm.xISDUMPPOINT, facility.isDumpPoint)"><icon icon-type=\'dump-point\' :is-disabled=\'!facility.isDumpPoint\'><\/icon><\/a>\n            <a v-if="facility.isWashout || showAll" @click.prevent="callout(sm.xISWASHOUT, facility.isWashout)"><icon classOverride="amenity" icon-type=\'chemical-washout\' :is-disabled=\'!facility.isWashout\'><\/icon><\/a>\n            <a v-if="facility.isAfterHours || showAll" @click.prevent="callout(sm.xISAFTERHOURS, facility.isAfterHours)"><icon icon-type="after-hours" :is-disabled="!facility.isAfterHours" rollover="Available after hours"><\/icon><\/a>\n        <\/div>\n        <p v-if="facility.dumpPointNote" v-for="p in paragraphs(facility.dumpPointNote)">{{p}}<\/p>\n    <\/section>\n    ',methods:{paragraphs:function(n){return n.split(/\r?\n/)},callout:function(n,t){Messages.display(MessageType.rollover,null,"".concat(ToiletMap.iconName(n)," ").concat(t?" available":" not available"),5e3)}}},DetailsAccessList={components:{icon:Icon},data:function(){var n={sm:SearchMask,showAccess:!0,showOpeningHours:!0};return!this.onlyAccess&&this.onlyOpeningHours&&(n.showAccess=!1),!this.onlyOpeningHours&&this.onlyAccess&&(n.showOpeningHours=!1),n},props:["facility","preferences","highlight","onlyAccess","onlyOpeningHours"],template:'\n    <section :class="{ highlight: highlight }">\n        <h2 v-if="showAccess">Access<\/h2>\n        <h2 v-if="onlyOpeningHours">Opening hours<\/h2>\n        <div v-if="showAccess" class="icon-list access">\n            <a @click.prevent="callout(sm.xISPARKING, facility.isParking)"><icon icon-type="parking" :is-disabled="!facility.isParking" rollover="Parking"><\/icon><\/a>\n            <a @click.prevent="callout(sm.xISPARKINGACCESSIBLE, facility.isParkingAccessible)"><icon icon-type="accessible-parking" :is-disabled="!facility.isParkingAccessible" rollover="Accessible parking"><\/icon><\/a>\n            <a @click.prevent="callout(sm.xISPAYMENTREQUIRED, facility.isPaymentRequired)"><icon icon-type=\'payment\' :is-disabled=\'!facility.isPaymentRequired\'><\/icon><\/a>\n\n            <a v-if="!facility.isMLAKKey && !facility.isMLAKAfterHours" @click.prevent="callout(sm.xISKEYREQUIRED)"><icon icon-type="key" :is-disabled="!facility.isKeyRequired" rollover="A key is required"><\/icon><\/a>\n            <a v-else-if="facility.isMLAKAfterHours" @click.prevent="callout(sm.xISMLAKAFTERHOURS, facility.isMLAKAfterHours)"><icon icon-type="mlak-after-hours" rollover="An MLAK key is required after hours"><\/icon><\/a>\n            <a v-else @click.prevent="callout(sm.xISMLAKKEY, facility.isMLAKKey)"><icon icon-type="mlak" rollover="MLAK key"><\/icon><\/a>\n        <\/div>\n        <ul class="list-unstyled">\n            <li v-if="facility.openingHours && showOpeningHours">{{facility.openingHours}}<\/li>\n            <li v-if="facility.openingHoursNote && showOpeningHours"><p v-for="p in paragraphs(facility.openingHoursNote)">{{p}}<\/p><\/li>\n            <li v-if="facility.addressNote && showAccess"><p v-for="p in paragraphs(facility.addressNote)">{{p}}<\/p><\/li>\n            <li v-if="facility.accessNote && showAccess"><p v-for="p in paragraphs(facility.accessNote)">{{p}}<\/p><\/li>\n            <li v-if="facility.parkingNote && showAccess"><p v-for="p in paragraphs(facility.parkingNote)">{{p}}<\/p><\/li>\n        <\/ul>\n    <\/section>\n    ',methods:{paragraphs:function(n){return n.split(/\r?\n/)},callout:function(n,t){var i=ToiletMap.iconName(n);i.includes("required")?t||(i=i.replace("required","not required")):i=i+(t?" available":" not available");Messages.display(MessageType.rollover,null,i,5e3)}}},DetailsAmenitiesList={components:{icon:Icon},data:function(){return{sm:SearchMask}},props:["facility","preferences","highlight","alwaysShow"],template:'\n    <section :class="{ highlight: highlight }">\n        <h2>Amenities<\/h2>\n        <div class="icon-list amenity">\n            <a @click.prevent="callout(sm.xISDRINKINGWATER, facility.isDrinkingWater)"><icon icon-type="drinking-water" :is-disabled="!facility.isDrinkingWater" rollover="Drinking water"><\/icon><\/a>\n            <a @click.prevent="callout(sm.xISSHARPSDISPOSAL, facility.isSharpsDisposal)"><icon icon-type="sharps-disposal" :is-disabled="!facility.isSharpsDisposal" rollover="Sharps disposal"><\/icon><\/a>\n            <a @click.prevent="callout(sm.xISSHOWERS, facility.isShowers)"><icon icon-type=\'showers\' :is-disabled=\'!facility.isShowers\'><\/icon><\/a>\n            <a @click.prevent="callout(sm.xISSANITARYDISPOSAL, facility.isSanitaryDisposal)"><icon icon-type="sanitary-disposal" :is-disabled="!facility.isSanitaryDisposal" rollover="Sanitary disposal"><\/icon><\/a>\n            <a @click.prevent="callout(sm.xISMENSPADDISPOSAL, facility.isMensPadDisposal)"><icon icon-type="mens-pads" :is-disabled="!facility.isMensPadDisposal" rollover="Male incontinence bin"><\/icon><\/a>\n        <\/div>\n    <\/section>\n    ',methods:{callout:function(n,t){Messages.display(MessageType.rollover,null,"".concat(ToiletMap.iconName(n)," ").concat(t?" available":" not available"),5e3)}}},DetailsPhotos={props:["facility","preferences","highlight"],data:function(){return{spinners:[]}},template:'\n    <section class="photos" :class="{ highlight: highlight }">\n        <h2>Photos<\/h2>\n        <div class="photos-list">\n            <div class="photo" v-for="g in facility.gids" :key="\'thumbnail_\' + g">\n                <div v-if="!spinners.includes(\'thumbnail_spinner_\'+g)" :id="\'thumbnail_spinner_\'+g" class="spinner">Loading...<\/div>\n                <a :href="facility.photoUri(g)" v-on:click.prevent="$emit(\'lightbox\', g)"><img :data-spinner="\'thumbnail_spinner_\'+g" :id="g" :src="facility.thumbnailUri(g)" v-on:load="changed"><\/a>\n            <\/div>\n        <\/div>\n    <\/section>\n    ',methods:{changed:function(n){if(n.target){var t=n.target.getAttribute("data-spinner");t&&this.spinners.push(t)}}}},DetailsProvider={props:["facility","highlight"],data:function(){return{isBot:isBot()}},template:'\n    <section v-if="facility.providerTitle" class="provider" :class="{ highlight: highlight }" itemscope itemtype="http://schema.org/LocalBusiness">        \n        <h2>Provided by<\/h2>\n        <div>\n            <ul>\n                <li v-if="facility.providerURI"><span itemprop="name"><a :href="facility.providerURI" itemprop="url" target="_blank" rel="noopener noreferrer">{{facility.providerTitle}}<\/a><\/span><\/li>\n                <li v-else ><span itemprop="name">{{facility.providerTitle}}<\/span><\/li>\n                <li v-if="facility.providerEmail"><span itemprop="email"><a :href="\'mailto:\' + facility.providerEmail" >{{facility.providerEmail}}<\/a><\/span><\/li>\n                <li v-if="facility.providerPhone" ><span itemprop="telephone"><a :href="\'tel:\' + facility.providerPhone">{{facility.providerPhone}}<\/a><\/span><\/li>\n            <\/ul>\n            <img v-if="facility.providerGId" :src="facility.providerLogoUri" alt="Logo">\n        <\/div>\n    <\/section>\n    '},Lightbox={props:["facility","gid"],data:function(){return{photo_id:this.gid,preloaded:[],waiting:!0,loadedOne:!1}},template:'\n        <div id="lightbox-container"">\n            <div id="lightbox">\n                <div class="image">\n                    <div v-if="waiting" class="spinner">Loading...<\/div>\n                    <img :id="\'photo_\'+photo_id" :src="facility.photoUri(photo_id)" v-on:load="loaded">\n                    <a v-if="loadedOne" href="#" @click.prevent="$emit(\'close-lightbox\')" class="dismiss" title="Close"><span>x<\/span><\/a>\n                <\/div>\n            <\/div>\n            <button class="arrow left" :class="{ disabled: !has_prev }" :title="has_prev ? \'Previous photo\' : \'\'" @click.stop="prevPhoto" ><\/button>\n            <button class="arrow right" :class="{ disabled: !has_next }" :title="has_next ? \'Next photo\' : \'\'" @click.stop="nextPhoto"><\/button>\n        <\/div>\n    ',methods:{nextPhoto:function(){this.next&&(this.photo_id=this.next)},prevPhoto:function(){this.prev&&(this.photo_id=this.prev)},preload:function(n){this.preloaded.indexOf(n)===-1&&((new Image).src=this.facility.photoUri(n),this.preloaded.push(n))},loaded:function(){this.waiting=!1;this.loadedOne=!0}},computed:{index:function(){return this.facility.gids.indexOf(this.photo_id)},count:function(){return this.facility.gids.length},has_next:function(){return this.index<this.count-1},has_prev:function(){return this.index>0},next:function(){return this.has_next?this.facility.gids[this.index+1]:null},prev:function(){return this.has_prev?this.facility.gids[this.index-1]:null}},mounted:function(){this.preloaded.push(this.photo_id);this.has_next&&this.preload(this.next);this.has_prev&&this.preload(this.prev)},watch:{photo_id:function(){this.has_next&&this.preload(this.next);this.has_prev&&this.preload(this.prev);this.waiting=!0}}};"use strict";var Competition=function Competition(n){_classCallCheck(this,Competition);this.ID=n.ID;this.Title=n.Title;this.Description=n.Description},EntryStatus={Entered:"Y",Refused:"N",NotAnswered:"U"},UserComp=function(){function n(t){_classCallCheck(this,n);this.UserId=t.UserId;this.ES=t.ES;this.Competition=null;this.FacilityItemID=t.FacilityItemID;this.TermsAccepted=!1;this.Entering=!1;this.Refusing=!1;t.Comp&&(this.Competition=new Competition(t.Comp))}return _createClass(n,[{key:"EnterCompetition",value:function(){var n=this,t={FacilityItemID:this.FacilityItemID,Accepted:!0,CompetitionID:this.Competition.ID};this.Entering=!0;Vue.http.post("/api/AppApi/AcceptCompetition",t).then(function(t){t.json().then(function(t){t.Success&&(n.ES=EntryStatus.Entered,Messages.display(MessageType.success,n.Competition.Title,t.Message,1e4),MainEditorManager.CreateMode&&(MainEditorManager.CreateMode=!1,hidePanel("create-panel")))})}).finally(function(){n.Entering=!1})}},{key:"RefuseCompetition",value:function(){var n=this,t;this.Refusing=!0;t={FacilityItemID:this.FacilityItemID,Accepted:!1,CompetitionID:this.Competition.ID};this.Entering=!0;Vue.http.post("/api/AppApi/AcceptCompetition",t).then(function(t){t.json().then(function(t){t.Success&&(n.ES=EntryStatus.Refused,Messages.display(MessageType.success,n.Competition.Title,"Competition refused",1e4),MainEditorManager.CreateMode&&(MainEditorManager.CreateMode=!1,hidePanel("create-panel")))})}).finally(function(){n.Refusing=!1})}},{key:"EntryStatus",get:function(){switch(this.ES){case"Y":return EntryStatus.Entered;case"N":return EntryStatus.Refused;case"U":return EntryStatus.NotAnswered}}}]),n}();"use strict";var ResultType={Save:0,Update:1,Create:2,GetFacility:3,GetUserInfo:4,Login:5,Register:6,LetUsKnow:7,ForgotPassword:8,LogOut:9,ChangePassword:10,ChangeEmail:11,Delete:12,Publish:13,DeleteUser:14},EditResult={NotPublished:-10,OK:5,Edited:10,Approved:15,Submitted:20,LetUsKnowCreated:30,PhotoCreated:31},ContentStatus={New:0,Submitted:1,Rejected:2,Approved:3,Published:4,Suspended:5,Withdrawn:6},FacilityResult=function(){function n(t,i){_classCallCheck(this,n);this.IsError=t.IsError;this.IsSuccess=!t.IsError;this.Message=t.Message;this.ValidationErrors=t.ValidationErrors;this.NewContentID=t.NewContentID;this.Status=t.Status;this.StatusCode=null;this.Type=i;this.ResultInt=t.Result;this.CanShow=this.Result!==EditResult.NotPublished;this.NewStatus=t.NewStatus;this.StatusAndIDs=t.StatusAndIDs;this.UserComp=null;t.CompetitionInfo&&(this.UserComp=new UserComp(t.CompetitionInfo));resultMessage(this)}return _createClass(n,[{key:"Result",get:function(){switch(this.ResultInt){case-10:return EditResult.NotPublished;case 5:return EditResult.OK;case 10:return EditResult.Edited;case 15:return EditResult.Approved;case 20:return EditResult.Submitted;case 30:return EditResult.LetUsKnowCreated;case 31:return EditResult.PhotoCreated}return null}}]),n}(),AccountResult=function AccountResult(n,t){_classCallCheck(this,AccountResult);this.IsSuccess=n.Success;this.IsError=!n.Success;this.Message=n.Message;this.ValidationErrors=n.ValidationErrors;this.NeedToCompleteRegistration=n.NeedToCompleteRegistration;this.NewContentID=null;this.Status=null;this.StatusCode=null;this.Type=t;this.UserNotFound=n.UserNotFound;this.CanShow=!this.NeedToCompleteRegistration&&!this.UserNotFound;resultMessage(this)},ResponseResult=function ResponseResult(n,t){_classCallCheck(this,ResponseResult);this.IsSuccess=n.status===200;this.IsError=!this.IsSuccess;this.Message=n.statusText;this.Message||(this.Message=n.body.Message);this.ValidationErrors=null;this.NewContentID=null;this.Status=null;this.StatusCode=n.status;this.Type=t;this.CanShow=this.StatusCode!==401;resultMessage(this)};"use strict";var LoginModel=function(){function n(){_classCallCheck(this,n);this.Email=null;this.Password=null;this.Validators=new ValidatorCollection([new Validator("Email",function(n){return new ValidationResult(n.Email!==null&&n.Email!=="","You must enter your email address.")},!0),new Validator("Password",function(n){return new ValidationResult(n.Password!==null&&n.Password!=="","You must enter your password.")},!0)])}return _createClass(n,[{key:"Clear",value:function(){this.Email=null;this.Password=null}},{key:"Validate",value:function(){return this.Validators.Validate(this),this.Validators.Success}}]),n}(),EmailModel=function(){function n(){_classCallCheck(this,n);this.Email=null;this.Validators=new ValidatorCollection([new Validator("Email",function(n){var t=!0,i="";return n.Email?/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n.Email)||(t=!1,i="The Email address field is not a valid e-mail address."):(i="An email is required.",t=!1),new ValidationResult(t,i)},!0)])}return _createClass(n,[{key:"Clear",value:function(){this.Email=null}},{key:"Validate",value:function(){return this.Validators.Validate(this),this.Validators.Success}}]),n}(),ChangePasswordModel=function(){function n(){_classCallCheck(this,n);this.Email=null;this.Password=null;this.NewPassword=null;this.ConfirmPassword=null;this.Validators=new ValidatorCollection([new Validator("Password",function(n){return new ValidationResult(n.Password!==null&&n.Password!=="","You must enter your password.")},!0),new Validator("NewPassword",function(n){var t=!0,i="";return n.NewPassword?n.NewPassword.length<8?(t=!1,i="The New Password must be at least 8 characters long."):/(?=.*[0-9])(?=.*[a-zA-Z])/.test(n.NewPassword)||(t=!1,i="The New Password must contain at least one character and one number."):(i="A new Password is required",t=!1),new ValidationResult(t,i)},!0),new Validator("ConfirmPassword",function(n){var t=!0,i="";return n.ConfirmPassword?n.ConfirmPassword!==n.NewPassword&&(t=!1,i="The new password and confirmation password do not match."):(t=!1,i="You must confirm your password."),new ValidationResult(t,i)},!0)])}return _createClass(n,[{key:"Clear",value:function(){this.Email=null;this.Password=null;this.NewPassword=null;this.ConfirmPassword=null}},{key:"Validate",value:function(){return this.Validators.Validate(this),this.Validators.Success}}]),n}(),RegisterModel=function(){function n(){_classCallCheck(this,n);this.Name=null;this.Password=null;this.ConfirmPassword=null;this.Email=null;this.Success=!1;this.Token=null;this.FailedToken=!1;this.CanSubmit=!0;this.ReCaptcha=null;this.Validators=new ValidatorCollection([new Validator("Name",function(n){var t=!0,i="",r=n.TheName;return r?/^([\w\-\s\.@']*)$/.test(r)?/[a-zA-Z]+/.test(r)||(t=!1,i="Your Name must contain at least one letter."):(t=!1,i="Your Name can only contain letters, numbers, hyphen, apostrophe and the space character."):(i="Your name is required.",t=!1),new ValidationResult(t,i)},!0),new Validator("Password",function(n){var t=!0,i="";return n.Password?n.Password.length<8?(t=!1,i="The Password must be at least 8 characters long."):/(?=.*[0-9])(?=.*[a-zA-Z])/.test(n.Password)||(t=!1,i="The Password must contain at least one character and one number."):(i="A password is required",t=!1),new ValidationResult(t,i)},!0),new Validator("ConfirmPassword",function(n){var t=!0,i="";return n.ConfirmPassword?n.ConfirmPassword!==n.Password&&(t=!1,i="The password and confirmation password do not match."):(t=!1,i="You must confirm your password."),new ValidationResult(t,i)},!0),new Validator("Email",function(n){var t=!0,i="",r=n.TheEmail;return r?/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)||(t=!1,i="The Email address field is not a valid e-mail address."):(i="An email is required.",t=!1),new ValidationResult(t,i)},!0)])}return _createClass(n,[{key:"Clear",value:function(){this.Name=null;this.Password=null;this.ConfirmPassword=null;this.Email=null;this.FailedToken=!1;this.Token=null;this.CanSubmit=!0}},{key:"Validate",value:function(){return this.Validators.ValidateWithCheck(this)}},{key:"InitialiseRecaptcha",value:function(){var n=this;this.ReCaptcha=new ReCaptcha(new ReCaptchaV3Options(document.getElementById("RecaptchaMainKey").value,this,"Register").SetError(function(){Messages.display(MessageType.error,"Register","An error occured running recaptcha",1e4)}),new ReCaptchaV2Options(document.getElementById("RecaptchaSecondaryKey").value,"RegisterRecaptcha",this).SetPreStart(function(){n.CanSubmit=!1;n.FailedToken=!0}).SetSuccess(function(){n.CanSubmit=!0}).SetExpire(function(){n.CanSubmit=!1}).SetInvalid(function(){}).SetFail(function(){grecaptcha.reset();n.CanSubmit=!1}));this.ReCaptcha.Run(this.FailedToken)}},{key:"TheName",get:function(){return this.Name?this.Name.trim():null}},{key:"TheEmail",get:function(){return this.Email?this.Email.trim():null}}]),n}();AccountDisplayMode={MyAccount:0,Login:1,Register:2,ChangePassword:3,ChangeEmail:4,Unauthorised:5,DeleteUser:6};AccountManager=function(){function n(){_classCallCheck(this,n);this.LoggedIn=document.getElementById("loggedin").value==="True";this.Login=new LoginModel;this.Register=new RegisterModel;this.Email=new EmailModel;this.ChangePassword=new ChangePasswordModel;this.LastResult=null;this.DisplayMode=this.LoggedIn?AccountDisplayMode.MyAccount:AccountDisplayMode.Unauthorised;typeof MainEditorManager!="undefined"&&MainEditorManager&&this.LoggedIn&&MainEditorManager.loadUserInfo().then(function(){MainEditorManager.Editors.forEach(function(n){return n.UserInfo=MainEditorManager.UserInfo});app.monitorManager.Init()},function(){})}return _createClass(n,[{key:"ShowUnauthorised",value:function(){this.DisplayMode=AccountDisplayMode.Unauthorised}},{key:"ShowLogin",value:function(){this.DisplayMode=AccountDisplayMode.Login}},{key:"ShowRegister",value:function(){this.DisplayMode=AccountDisplayMode.Register}},{key:"clearAC",value:function(){this.Register.Clear();this.Login.Clear;this.Email.Clear();this.ChangePassword.Clear()}},{key:"login",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/Account/Login",{Login:n.Login.Email,Password:n.Login.Password}).then(function(r){r.json().then(function(r){r.Success?(n.LoggedIn=!0,n.DisplayMode=AccountDisplayMode.MyAccount,MainEditorManager.DisplayMode=EditorManagerDisplayMode.Editor,t(),n.Login.Clear(),MainEditorManager.loadUserInfo().then(function(){MainEditorManager.Editors.forEach(function(n){return n.UserInfo=MainEditorManager.UserInfo});app.monitorManager.Init()})):(n.LastResult=new AccountResult(r,ResultType.Login),i(r))})},function(t){n.LastResult=new ResponseResult(t,ResultType.Login);typeof Sentry!="undefined"&&Sentry.captureException(t);i(t)})})}},{key:"register",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/Account/Register",{Name:n.Register.TheName,Email:n.Register.TheEmail,Password:n.Register.Password,ConfirmPassword:n.Register.ConfirmPassword,Token:n.Register.Token,FailedToken:n.Register.FailedToken}).then(function(r){r.json().then(function(r){if(r.Success){var u=n.Register;n.Register.ReCaptcha.HandleVerifyResult(r.Result,function(){t();u.Clear()},r);r.Result!=="Pass"&&i()}else n.Register.ReCaptcha.HandleVerifyResult(r.Result,null,r),n.LastResult=new AccountResult(r,ResultType.Register),i(r)})},function(t){n.LastResult=new ResponseResult(t,ResultType.Register);typeof Sentry!="undefined"&&Sentry.captureException(t);i(t)})})}},{key:"reconfirm",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/Account/NeedToReConfirmEmail",{Login:n.Login.Email,Password:n.Login.Password}).then(function(r){r.json().then(function(r){r.Success?t():(n.LastResult=new AccountResult(r,ResultType.Login),i(r))})},function(t){n.LastResult=new ResponseResult(t,ResultType.Login);typeof Sentry!="undefined"&&Sentry.captureException(t);i(t)})})}},{key:"resendconfirm",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/Account/ResendRegistrationConfirmation",{Login:n.Login.Email,Email:n.Login.Email,Password:n.Login.Password}).then(function(r){r.json().then(function(r){n.LastResult=new AccountResult(r,ResultType.Login);r.Success?t():i(r)})},function(t){n.LastResult=new ResponseResult(t,ResultType.Login);typeof Sentry!="undefined"&&Sentry.captureException(t);i(t)})})}},{key:"forgotPassword",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/Account/ForgottenPassword",{Email:n.Login.Email}).then(function(r){r.json().then(function(r){r.Success?t():(n.LastResult=new AccountResult(r,ResultType.ForgotPassword),i(r))})},function(t){n.LastResult=new ResponseResult(t,ResultType.ForgotPassword);typeof Sentry!="undefined"&&Sentry.captureException(t);i(t)})})}},{key:"LogOut",value:function(){var n=this;return new Promise(function(t,i){Vue.http.get("/api/Account/LogOut").then(function(r){r.json().then(function(r){r.Success?(n.LoggedIn=!1,MainEditorManager.UserInfo=null,MainEditorManager.Editors.forEach(function(n){return n.UserInfo=MainEditorManager.UserInfo}),app.monitorManager.Disable(),n.DisplayMode=AccountDisplayMode.Unauthorised,t()):(n.LastResult=new AccountResult(r,ResultType.LogOut),i(r))})},function(t){n.LastResult=new ResponseResult(t,ResultType.LogOut);typeof Sentry!="undefined"&&Sentry.captureException(t);i(t)})})}},{key:"changePassword",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/Account/ChangePassword",{OldPassword:n.ChangePassword.Password,NewPassword:n.ChangePassword.NewPassword,ConfirmPassword:n.ChangePassword.ConfirmPassword}).then(function(r){r.json().then(function(r){r.Success?(t(),n.ChangePassword.Clear()):(n.LastResult=new AccountResult(r,ResultType.ChangePassword),i(r))})},function(t){n.LastResult=new ResponseResult(t,ResultType.ChangePassword);n.LastResult.StatusCode===401?(n.DisplayMode=AccountDisplayMode.Login,Messages.display(MessageType.error,"Change password failed","You have been logged out due to inactivity. Please login and try again.",1e4),i(null)):(typeof Sentry!="undefined"&&Sentry.captureException(t),i(t))})})}},{key:"changeEmail",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/Account/ChangeEmailAddress",{Email:n.Email.Email}).then(function(r){r.json().then(function(r){r.Success?(t(),n.Email.Clear()):(n.LastResult=new AccountResult(r,ResultType.ChangeEmail),i(r))})},function(t){n.LastResult=new ResponseResult(t,ResultType.ChangeEmail);n.LastResult.StatusCode===401?(n.DisplayMode=AccountDisplayMode.Login,Messages.display(MessageType.error,"Change email address failed","You have been logged out due to inactivity. Please login and try again.",1e4),i(null)):(typeof Sentry!="undefined"&&Sentry.captureException(t),i(t))})})}},{key:"deleteUser",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/Account/DeleteUser").then(function(r){r.json().then(function(r){r.Success?(n.LoggedIn=!1,MainEditorManager.UserInfo=null,MainEditorManager.Editors.forEach(function(n){return n.UserInfo=MainEditorManager.UserInfo}),app.monitorManager.Disable(),t()):(n.LastResult=new AccountResult(r,ResultType.DeleteUser),i(r))})},function(t){n.LastResult=new ResponseResult(t,ResultType.DeleteUser);n.LastResult.StatusCode===401?(n.DisplayMode=AccountDisplayMode.Login,Messages.display(MessageType.error,"Delete user failed","You have been logged out due to inactivity. Please login and try again.",1e4),i(null)):(typeof Sentry!="undefined"&&Sentry.captureException(t),i(t))})})}},{key:"ShowingUnauthorised",get:function(){return this.DisplayMode===AccountDisplayMode.Unauthorised}},{key:"ShowingLogin",get:function(){return this.DisplayMode===AccountDisplayMode.Login}},{key:"ShowingRegister",get:function(){return this.DisplayMode===AccountDisplayMode.Register}}]),n}();ButtonClasses={PrimaryClass:"btn btn-primary",SecondaryClass:"btn btn-secondary",NavigationClass:"navigation",NavigationDirection:null};Vue.component("buttonext",{props:["text","running","disabled","isprimary","isnavigation","issecondary","navdirection","myclass","rightspinner","issubmit"],data:function(){return{btnClass:this.myclass?this.myclass:(this.isnavigation||this.navdirection)&&!this.issecondary?ButtonClasses.NavigationClass+(this.navdirection?" "+this.navdirection:""):this.isprimary?ButtonClasses.PrimaryClass:ButtonClasses.SecondaryClass+(this.navdirection?" "+this.navdirection:""),type:this.issubmit?"submit":"button"}},template:'\n        <button :type="type" v-on:click="$emit(\'click\')" :class="[{disabled: running||disabled}, btnClass]" :disabled="disabled || running">\n            <slot name="spinner" v-if="running && !rightspinner"><spinner><\/spinner><\/slot>\n            <slot>\n                {{text}}\n            <\/slot>\n            <slot name="spinner" v-if="running && rightspinner"><spinner><\/spinner><\/slot>\n        <\/button>\n    '});Vue.component("InputGroup",{props:["isprepend","isbutton","icon","text","preicon","iconsize","iconclass","btnclass","id","title","placeholder","validator","value","model","type","selectoptions","controlclass","disabled"],data:function(){return{picon:this.preicon?this.preicon:"far fa-",addition:(this.iconsize||this.iconclass?" ":"")+(this.iconsize?this.iconsize:"")+(this.iconsize&&this.iconclass?" ":"")+(this.iconclass?this.iconclass:""),buttonclass:this.btnclass?this.btnclass:"btn btn-light border"}},computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},template:'\n        <div class="input-group">\n            <div v-if="isprepend" class="input-group-prepend" v-on:click="$emit(\'additionclick\')">\n                <slot name="prepend">\n                    <button v-if="isbutton" :class="buttonclass" v-on:click="$emit(\'additionclick\')">\n                        {{text}}\n                        <i v-if="icon" :class="picon + icon + addition"><\/i>\n                    <\/button>\n                    <span v-else class="input-group-text">\n                        {{text}}\n                        <i v-if="icon" :class="picon + icon + addition"><\/i>\n                    <\/span>\n                <\/slot>\n            <\/div>\n            <slot>\n                <inputcontrol :id="id" :title="title" :placeholder="placeholder" :validator="validator" v-model="myValue" :model="model" :type="type" :selectoptions="selectoptions" :controlclass="controlclass" :disabled="disabled" v-on:change="$emit(\'change\', value)"><\/inputcontrol>\n            <\/slot>\n            <div v-if="!isprepend" class="input-group-append" v-on:click="$emit(\'additionclick\')">\n                <slot name="append">\n                    <button v-if="isbutton" :class="buttonclass" v-on:click="$emit(\'additionclick\')">\n                        {{text}}\n                        <i v-if="icon" :class="picon + icon + addition"><\/i>\n                    <\/button>\n                    <span v-else class="input-group-text">\n                        {{text}}\n                        <i v-if="icon" :class="picon + icon + addition"><\/i>\n                    <\/span>\n                <\/slot>\n            <\/div>\n        <\/div>\n    '});Vue.component("FormGroup",{inheritAttrs:!1,props:["label","hint","id","title","placeholder","validator","value","model","type","selectoptions","controlclass","labelclass","disabled"],data:function(){return{cclass:this.controlclass?this.controlclass:"form-control"}},computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},template:'\n        <div :id="id+\'MainDiv\'" class="form-group">\n            <slot name="label"><label :for="id" :class="labelclass" :title="title">{{label}}<\/label><\/slot>\n            <slot>\n                <inputcontrol v-bind="$attrs" :id="id" :title="title" :placeholder="placeholder" :validator="validator" v-model="myValue" :model="model" :type="type" :selectoptions="selectoptions" :controlclass="controlclass" :disabled="disabled" v-on:change="$emit(\'change\', value)"><\/inputcontrol>\n                <small v-if="hint" class="d-block text-muted">{{hint}}<\/small>\n                <validationmessage v-if="validator" :validator="validator" v-model="myValue" :mainmodel="model"><\/validationmessage>\n            <\/slot>\n            <slot name="additional">\n            <\/slot>\n        <\/div>\n    '});Editor=function(){function n(t,i,r,u,f,e,o,s,h,c){_classCallCheck(this,n);this.PostURL=r;this.Name=t;this.DisplayName=i;this.Form=t+"_Form";this.ParentDiv=t+"_Parentdiv";this.Loaded=!1;this.CurrentHRID=null;this.UserInfo=null;this.Facility=null;this.GetData=e;this.View=null;this.Template=u;this.CompactTemplate=f;this.Validators=new ValidatorCollection(o);this.Show=!1;this.Compact=!1;this.Saving=!1;this.IsMultipart=!1;this.CheckForChanges=s;this.OriginalData=null;this.UpdateIDAndStatus=h;this.BaseCanUse=function(n){return n.Facility&&MainEditorManager.UserInfo.HasEditRights(MainEditorManager.Facility.AgencyID)};this.CanUse=function(n){return n.BaseCanUse(n)};c&&(this.CanUse=c)}return _createClass(n,[{key:"UpdateLinkText",value:function(n,t){var i=app.monitorManager.Any(function(n){return t.some(function(t){return t&&(t===n.CustomData.ID||t===n.CustomData.Old)})});return i?n===ContentStatus.Published?"Update":n===ContentStatus.Approved?"Awaiting publication":"Awaiting moderation":(n===ContentStatus.Published||this.Saving||app.monitorManager.CreateMonitor(new PersistantMonitor("facilitycheck_"+this.Facility.TitleShort,"FacilityCheck","/api/FacilityEditor/CheckStatus/"+this.Facility.TitleShort,{Facility:this.Facility,ID:this.Facility.TitleShort})),n===ContentStatus.Published?"Update":"Update in progress")}},{key:"setFacility",value:function(n){this.CurrentHRID!==n.HRID?(this.CurrentHRID=n.HRID,this.Facility=n,this.Compact=!0,this.Show=!1,this.Validators.Reset()):this.Facility=n;n&&this.CheckForChanges&&!this.IsCreateMode&&(this.OriginalData=this.GetData(n,this))}},{key:"save",value:function(){var n=this;return MainEditorManager.LastResult=null,new Promise(function(t,i){Vue.http.post(n.CurrentPostURL,n.GetData(n.Facility,n),n.IsMultipart?{headers:{"content-type":"multipart/form-data"}}:null).then(function(r){r.json().then(function(r){var u=MainEditorManager.LastResult=new FacilityResult(r,n.IsCreateMode?ResultType.Create:ResultType.Update),o=n.IsCreateMode,f,e;r.IsError?i(r):(u.UserComp&&(MainEditorManager.CompetitionInformation=u.UserComp),n.IsCreateMode&&u.NewContentID&&(n.Facility.ContentID=u.NewContentID,MainEditorManager.ShowCompetition||(MainEditorManager.CreateMode=!1)),(u.NewStatus===ContentStatus.Approved||u.NewStatus===ContentStatus.New||u.NewStatus===ContentStatus.Submitted)&&u.NewContentID&&(f={NewID:u.NewContentID,OldID:null,SuccessStatus:ContentStatus.Published},n.UpdateIDAndStatus&&(e=n.UpdateIDAndStatus(u.StatusAndIDs,n),e&&e.NewID&&e.OldID&&(f=e)),app.monitorManager.CreateMonitor(new PersistantMonitor(f.NewID+"_"+n.Name,"FacilityMonitor","/api/FacilityEditor/MonitorStatus/"+f.NewID,{TitleShort:n.Facility.TitleShort,ID:f.NewID,Old:f.OldID,S_Status:f.SuccessStatus,FacilityID:n.Facility.ContentID,Title:n.Facility.Title,Section:n.DisplayName,Frequency:o?36e5:3e4}))),n.OriginalData=n.GetData(n.Facility,n),t(r))})},function(t){MainEditorManager.LastResult=new ResponseResult(t,n.IsCreateMode?ResultType.Create:ResultType.Update);t&&t.status===401&&(MainEditorManager.DisplayMode=EditorManagerDisplayMode.Unauthorised,MainEditorManager.UserInfo=null);typeof Sentry=="undefined"||t&&t.status===401||Sentry.captureException(t);i(t)})})}},{key:"validate",value:function(){return this.Validators.ValidateWithCheck(this.Facility)}},{key:"doesObjectHaveChanges",value:function(n,t){var r=!1;for(var i in n)n[i]===null&&t[i]===null,n[i]===null&&t[i]!==null||n[i]!==null&&t[i]===null?r=!0:_typeof(n[i])==="object"?r=r||this.doesObjectHaveChanges(n[i],t[i]):n[i]!==t[i]&&(r=!0);return r}},{key:"CanUseStandard",get:function(){return this.CanUse(this)&&this.Show}},{key:"CanUseCompact",get:function(){return this.CanUse(this)&&this.Compact&&this.CompactTemplate}},{key:"CurrentEditorRole",get:function(){return this.Facility&&this.UserInfo?this.UserInfo.IsProviderOf(this.Facility.AgencyID)?"Provider":this.UserInfo.IsTrusted?"Trusted":this.UserInfo.IsCrowdsource?"CrowdSource":"NoEditRights":"Unknown"}},{key:"IsProvider",get:function(){return this.UserInfo.IsProviderOf(this.Facility.AgencyID)}},{key:"IsTrusted",get:function(){return this.UserInfo.IsTrusted&&!this.IsProvider}},{key:"IsCrowdsource",get:function(){return this.UserInfo.IsCrowdsource&&!this.IsTrusted&&!this.IsProvider}},{key:"HasEditRights",get:function(){return this.UserInfo.HasEditRights(this.Facility.AgencyID)}},{key:"CurrentPostURL",get:function(){if(typeof this.PostURL=="function")return this.PostURL(this);var n="";return this.Facility&&this.UserInfo&&(this.UserInfo.IsProviderOf(this.Facility.AgencyID)?n="_P":this.UserInfo.IsTrusted?n="_T":this.UserInfo.IsCrowdsource&&(n="_C")),this.PostURL+n}},{key:"IsCreateMode",get:function(){return MainEditorManager.CreateMode}},{key:"EditorManager",get:function(){return MainEditorManager}},{key:"HasChanges",get:function(){if(this.CheckForChanges&&!this.IsCreateMode){var n=this.GetData(this.Facility,this);return this.doesObjectHaveChanges(this.OriginalData,n)}return!1}}]),n}();"use strict";var EditorManagerDisplayMode={Editor:0,Summary:1,LetUSKnow:2,Unauthorised:3,Login:4,Register:5,Delete:6},EditorManager=function(){function n(t){var r,i;_classCallCheck(this,n);this.Editors=[];this.HRID=null;this.Loaded=!1;this.UserInfo=null;this.Facility=new Facility({});this.Address=null;this.Amenities=null;this.Access=null;this.Facilities=null;this.OpeningHours=null;this.Photos=null;this.LetUsKnow=null;this.CreateNew=null;this.ReadOnlyToilet=null;this.AutoLoad=!0;this.CreateMode=!1;this.Loading=!1;this.Publishing=!1;this.FetingPublishItems=!1;this.DeleteModel=null;this.ItemsToPublish=!1;this.ItemsAwaitingPublish=[];this.CompetitionInformation=null;this.PhotoTermsAndConditions=null;this.DisplayMode=EditorManagerDisplayMode.Editors;for(r in t){i=t[r];this.Editors.push(t[r]);switch(i.Name){case"Access":this.Access=i;break;case"Address":this.Address=i;break;case"Amenities":this.Amenities=i;break;case"Facilities":this.Facilities=i;break;case"OpeningHours":this.OpeningHours=i;break;case"Photos":this.Photos=i;break;case"LetUsKnow":this.LetUsKnow=i;break;case"CreateNew":this.CreateNew=i}}this.LastResult=null;this.ReloadNeeded=!1;MainEditorManager=this;this.AgencyAutoComplete=new AutoComplete({URL:"/api/FacilityEditor/FindAgencies",CreateSuggestion:function(n){return new AutoCompleteSuggestion(n.AgencyID,n.Title)},OnChange:function(n){MainEditorManager.Facility.AgencyID=n.ID}})}return _createClass(n,[{key:"AddEditor",value:function(n){this.Editors.push(n)}},{key:"GetNextEditor",value:function(n){if(!this.CreateMode||this.UserInfo&&!this.UserInfo.HasEditRights(this.Facility.AgencyID))return null;switch(n.Name){case"Address":return this.Facilities;case"Amenities":return this.Photos;case"Access":return this.OpeningHours;case"Facilities":return this.Access;case"OpeningHours":return this.Amenities;case"Photos":return null;case"LetUsKnow":return null}}},{key:"GetPreviouisEditor",value:function(n){if(!this.CreateMode||this.UserInfo&&!this.UserInfo.HasEditRights(this.Facility.AgencyID))return null;switch(n.Name){case"Address":return null;case"Amenities":return this.OpeningHours;case"Access":return this.Facilities;case"Facilities":return this.Address;case"OpeningHours":return this.Access;case"Photos":return this.Amenities;case"LetUsKnow":return this.Photos}}},{key:"EnterDetailsMode",value:function(){this.DisplayMode=EditorManagerDisplayMode.Editor;this.Editors.forEach(function(n){return n.Compact=!1})}},{key:"EnterCompactMode",value:function(){this.DisplayMode=EditorManagerDisplayMode.Summary;this.Editors.forEach(function(n){n.Compact=!0;n.Show=!1})}},{key:"setHRID",value:function(n,t,i,r){var u=this;return this.LastResult=null,new Promise(function(f,e){var o=!t&&!i&&u.HRID===n&&u.UserInfo&&u.Facility;app.getToiletTitleBlackListWords();o?(u.HRID=n,f()):app.accountmanager.LoggedIn||r?(u.Loading=!0,r?u.loadFacility(n,t).then(function(){u.HRID=n;u.Editors.forEach(function(n){return n.setFacility(u.Facility)});u.Loading=!1;f(u.Facility)},function(n){u.Loading=!1;e(n)}):u.UserInfo?u.loadFacility(n,t).then(function(){u.HRID=n;u.Editors.forEach(function(n){return n.setFacility(u.Facility)});u.Loading=!1;f(u.Facility)},function(n){u.Loading=!1;e(n)}):u.loadUserInfo().then(function(){u.Editors.forEach(function(n){return n.UserInfo=u.UserInfo});u.loadFacility(n,t).then(function(){u.HRID=n;u.Editors.forEach(function(n){return n.setFacility(u.Facility)});u.Loading=!1;f(u.Facility)},function(n){u.Loading=!1;e(n)})},function(n){u.Loading=!1;e(n)})):u.DisplayMode=EditorManagerDisplayMode.Unauthorised})}},{key:"EnterCreateMode",value:function(){var n=this;return this.CreateMode=!0,this.HRID=null,this.AgencyAutoComplete.Input=null,new Promise(function(t,i){app.accountmanager.LoggedIn?new Promise(function(t,i){n.Loading=!0;n.UserInfo?(t(),n.Loading=!1):n.loadUserInfo().then(function(i){n.Editors.forEach(function(t){return t.UserInfo=n.UserInfo});t(i)},function(n){i(n)}).finally(function(){n.Loading=!1})}).then(function(i){var r=new Facility({IsOpeningHoursVariable:n.UserInfo.IsCrowdsourceOnly,AgencyID:n.UserInfo.CreateAgencyID});n.Facility=r;n.Editors.forEach(function(t){return t.setFacility(n.Facility)});n.EnterCompactMode();n.EnterDetailsMode();n.Editors[0].Show=!0;n.DisplayMode=EditorManagerDisplayMode.Editor;t(i)},function(n){i(n)}):(n.DisplayMode=EditorManagerDisplayMode.Unauthorised,i())})}},{key:"EnterDeleteMode",value:function(){var n=this;this.Loading=!0;this.DisplayMode=EditorManagerDisplayMode.Delete;this.AutoLoad=!1;showPanel("editors-panel");this.setHRID(app.selectedFacility.id).then(function(){n.DeleteModel=new DeleteFacility(n.Facility.ContentID)},function(t){n.DisplayMode=EditorManagerDisplayMode.Summary;hidePanel("editors-panel");t&&t.status===404&&Messages.display(MessageType.error,null,"Facility not found",1e4)}).finally(function(){n.Loading=!1;n.AutoLoad=!0})}},{key:"loadFacility",value:function(n,t){var i=this;return new Promise(function(r,u){Vue.http.get("/api/FacilityEditor/GetFacilityInfo/"+n).then(function(n){n.json().then(function(n){i.LastResult=new FacilityResult(n,ResultType.GetFacility);n.IsError?u(n):(t?i.Facility.UpdateIDs(n.FacilityInfo):i.Facility=new Facility(n.FacilityInfo,n.StatusAndIDs),r(i.Facility))})},function(n){i.LastResult=new ResponseResult(n,ResultType.GetFacility);typeof Sentry!="undefined"&&i.LastResult.StatusCode!==401&&Sentry.captureException(n);u(n)})})}},{key:"loadUserInfo",value:function(){var n=this;return new Promise(function(t,i){Vue.http.get("/api/FacilityEditor/GetUserInfo").then(function(r){r.json().then(function(r){r.IsError?(n.LastResult=new FacilityResult(r),i(r)):(n.UserInfo=new UserInfo(r.UserInfo),t(n.UserID))})},function(t){n.LastResult=new ResponseResult(t,ResultType.GetUserInfo);typeof Sentry!="undefined"&&n.LastResult.StatusCode!==401&&Sentry.captureException(t);i(t)})})}},{key:"checkForDuplicate",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/AppApi/CheckForDuplicate",{Latitude:n.Facility.Latitude,Longitude:n.Facility.Longitude}).then(function(n){n.json().then(function(n){t(n)})},function(n){i(n)})})}},{key:"delete",value:function(){var n=this;return new Promise(function(t,i){Vue.http.post("/api/FacilityEditor/WithdrawFacility/",n.DeleteModel.Post).then(function(r){r.json().then(function(r){if(n.LastResult=new FacilityResult(r,ResultType.Delete),r.IsError)i(r);else{var u=app.monitorManager.CreateMonitor(new PersistantMonitor(n.LastResult.NewContentID+"_DELEETE","FacilityMonitor","/api/FacilityEditor/MonitorStatus/"+n.LastResult.NewContentID,{TitleShort:n.Facility.TitleShort,ID:n.LastResult.NewContentID,Old:n.Facility.ContentID,FacilityID:n.Facility.ContentID,Title:n.Facility.Title,Section:"Delete"}));u.FailCallback=null;u.MyCheck=function(n){return n.NewStatus===ContentStatus.Withdrawn};n.Facility.ContentID=n.LastResult.NewContentID;n.Facility.Status=n.LastResult.NewStatus;t(n.LastResult)}})},function(t){n.LastResult=new ResponseResult(t,ResultType.Delete);typeof Sentry!="undefined"&&n.LastResult.StatusCode!==401&&Sentry.captureException(t);i(t)})})}},{key:"publish",value:function(){var n=this;return new Promise(function(t,i){n.Publishing=!0;Vue.http.get("/api/AppAPI/PublishImmediately/").then(function(r){r.json().then(function(r){r.Success?(Messages.display(MessageType.success,"Publish","Publish successful",1e4),app.monitorManager.ForEachWhen(function(n){n.Monitor.Handler&&(window.clearTimeout(n.Monitor.Handler),n.Monitor.Handler=null);n.Monitor.DoTheMonitoring()},function(n){return n.Type=="FacilityMonitor"}),n.ItemsAwaitingPublish=[],t(r)):(Messages.display(MessageType.error,"Publish",r.Message,1e4),i())})},function(t){n.LastResult=new ResponseResult(t,ResultType.Publish);typeof Sentry!="undefined"&&n.LastResult.StatusCode!==401&&Sentry.captureException(t);i(t)})}).finally(function(){return n.Publishing=!1})}},{key:"anythingToPublish",value:function(){var n=this;return new Promise(function(t,i){Vue.http.get("/api/AppAPI/AnythingToPublish/").then(function(i){n.ItemsToPublish=i.body==!0;t(n.ItemsToPublish)},function(t){n.ItemsToPublish=!1;i(t)})})}},{key:"getItemsAwaitingPublish",value:function(){var n=this;return new Promise(function(t,i){n.FetingPublishItems=!0;Vue.http.get("/api/AppAPI/AwaitingPublish/").then(function(r){r.json().then(function(r){r.Success?(n.ItemsAwaitingPublish=r.Items,t(r)):(Messages.display(MessageType.error,"Awaiting publish",r.Message,1e4),n.ItemsAwaitingPublish=[],i())})},function(t){n.LastResult=new ResponseResult(t,ResultType.Publish);typeof Sentry!="undefined"&&n.LastResult.StatusCode!==401&&Sentry.captureException(t);n.ItemsAwaitingPublish=[];i(t)})}).finally(function(){return n.FetingPublishItems=!1})}},{key:"removePhoto",value:function(n){var t=this;return new Promise(function(i,r){Vue.http.post("/api/FacilityEditor/RemovePhoto"+(t.UserInfo.IsProviderOf(t.Facility.AgencyID)?"_P":t.UserInfo.IsTrusted?"_T":"_C")+"/",{ContentID:n.ContentID,Reason:"User wants to remove this photo."}).then(function(u){u.json().then(function(u){t.LastResult=new FacilityResult(u,ResultType.Delete);u.IsError?r(u):(t.Facility.ExistingPhotos=t.Facility.ExistingPhotos.filter(function(t){return t.ContentID!==n.ContentID}),i(t.LastResult))})},function(n){t.LastResult=new ResponseResult(n,ResultType.Delete);typeof Sentry!="undefined"&&t.LastResult.StatusCode!==401&&Sentry.captureException(n);r(n)})})}},{key:"getPhotoTermsAndConditions",value:function(){var n=this;return new Promise(function(t){n.PhotoTermsAndConditions?t(n.PhotoTermsAndConditions):Vue.http.get("/api/AppAPI/GetPhotoTermsAndConditions").then(function(i){i.json().then(function(i){n.PhotoTermsAndConditions=i;t(i)})},function(){n.PhotoTermsAndConditions="Any photos you add were taken by you and you grant us permission to publish these photos on the National Public Toilet Map without attribution.";t([])})})}},{key:"LaunchLetUsKnow",value:function(){var n=this;this.AutoLoad=!1;this.CreateMode=!1;app.currentPanel!=="editors-panel"&&showPanel("editors-panel");this.Editors.forEach(function(n){n.Show=!1;n.Compact=!1});this.setHRID(app.selectedFacility.id,!1,!1,!0).then(function(){n.EnterDetailsMode();n.LetUsKnow.Show=!0;n.DisplayMode=EditorManagerDisplayMode.LetUSKnow},function(t){t&&t.status===401&&(n.EnterDetailsMode(),n.LetUsKnow.Show=!0,n.DisplayMode=EditorManagerDisplayMode.LetUSKnow);n.Facility=new Facility({Title:app.selectedFacility.title,TitleShort:app.selectedFacility.id,Address1:app.selectedFacility.address1,FacilityIcon:app.selectedFacility.facilityType,Town:app.selectedFacility.locality,State:app.selectedFacility.state});n.LetUsKnow.Facility=n.Facility}).finally(function(){n.AutoLoad=!0})}},{key:"ShowEditors",get:function(){return this.DisplayMode===EditorManagerDisplayMode.Editor}},{key:"ShowUnauthorised",get:function(){return this.DisplayMode===EditorManagerDisplayMode.Unauthorised}},{key:"ShowLogin",get:function(){return this.DisplayMode===EditorManagerDisplayMode.Login}},{key:"ShowRegister",get:function(){return this.DisplayMode===EditorManagerDisplayMode.Register}},{key:"ShowSummaries",get:function(){return this.DisplayMode===EditorManagerDisplayMode.Summary}},{key:"ShowLetUsKnow",get:function(){return this.DisplayMode===EditorManagerDisplayMode.LetUSKnow}},{key:"ShowDelete",get:function(){return this.DisplayMode===EditorManagerDisplayMode.Delete}},{key:"ShowCompetition",get:function(){return this.CompetitionInformation!=null&&this.CompetitionInformation.EntryStatus==EntryStatus.NotAnswered}},{key:"AnyEditorsShowing",get:function(){return this.Editors.some(function(n){return n.Show})}},{key:"CurrentEditor",get:function(){return this.Editors.find(function(n){return n.Show&&!n.Compact})}},{key:"IsCompactMode",get:function(){return this.DisplayMode==EditorManagerDisplayMode.Summary}},{key:"CanEdit",get:function(){return this.UserInfo&&app.accountmanager.LoggedIn?app.selectedFacility?app.selectedFacility.AgencyID?this.UserInfo.HasEditRights(app.selectedFacility.AgencyID):this.Facility?app.selectedFacility.id===this.Facility.TitleShort?this.UserInfo.HasEditRights(this.Facility.AgencyID):!1:!1:!1:!1}},{key:"CanDelete",get:function(){return this.UserInfo&&app.accountmanager.LoggedIn?app.selectedFacility?app.selectedFacility.AgencyID?this.UserInfo.HasDeleteRights(app.selectedFacility.AgencyID):this.Facility?app.selectedFacility.id===this.Facility.TitleShort?this.UserInfo.HasDeleteRights(this.Facility.AgencyID):!1:!1:!1:!1}},{key:"CanPublish",get:function(){return this.UserInfo&&app.accountmanager.LoggedIn&&app.selectedFacility&&this.UserInfo.IsAdmin&&this.Facility&&!this.CreateMode}}]),n}(),MainEditorManager=null;"use strict";var Facility=function(){function n(t,i){var r=this;_classCallCheck(this,n);this.ContentID=t.ContentID===undefined?null:t.ContentID;this.HRID=t.TitleShort===undefined?null:t.TitleShort;this.AgencyID=t.AgencyID===undefined?null:t.AgencyID;this.YourID=t.YourID===undefined?null:t.YourID;this.DatePublished=t.DatePublished===undefined?null:t.DatePublished;this.Title=t.Title===undefined?null:t.Title;this.TitleShort=t.TitleShort===undefined?null:t.TitleShort;this.BFacilityMask=t.BFacilityMask===undefined?null:t.BFacilityMask;this.FacilityIcon=t.FacilityIcon===undefined?null:t.FacilityIcon;this.Address1=t.Address1===undefined?null:t.Address1;this.Town=t.Town===undefined?null:t.Town;this.State=t.State===undefined?null:t.State;this.Latitude=t.Latitude===undefined?null:t.Latitude;this.Longitude=t.Longitude===undefined?null:t.Longitude;this.AddressNote=t.AddressNote===undefined?null:t.AddressNote;this.IsClosed=t.IsClosed===undefined?null:t.IsClosed;this.IsOpenAllHours=t.IsOpenAllHours===undefined?null:t.IsOpenAllHours;this.IsOpenDaylightHours=t.IsOpenDaylightHours===undefined?null:t.IsOpenDaylightHours;this.IsOpeningHoursVariable=t.IsOpeningHoursVariable===undefined?null:t.IsOpeningHoursVariable;this.IsOpenSchedule=t.IsOpenSchedule===undefined?null:t.IsOpenSchedule;this.IsOpenVenueHours=t.IsOpenVenueHours===undefined?null:t.IsOpenVenueHours;this.OpeningHoursNote=t.OpeningHoursNote===undefined?null:t.OpeningHoursNote;this.OpeningHoursDisplay=t.OpeningHoursDisplay===undefined?null:t.OpeningHoursDisplay;this.AccessNote=t.AccessNote===undefined?null:t.AccessNote;this.IsKeyRequired=t.IsKeyRequired===undefined?null:t.IsKeyRequired;this.IsMLAKAfterHours=t.IsMLAKAfterHours===undefined?null:t.IsMLAKAfterHours;this.IsMLAKKey=t.IsMLAKKey===undefined?null:t.IsMLAKKey;this.IsParking=t.IsParking===undefined?null:t.IsParking;this.IsParkingAccessible=t.IsParkingAccessible===undefined?null:t.IsParkingAccessible;this.ParkingNote=t.ParkingNote===undefined?null:t.ParkingNote;this.IsPaymentRequired=t.IsPaymentRequired===undefined?null:t.IsPaymentRequired;this.IsAdultChange=t.IsAdultChange===undefined?null:t.IsAdultChange;this.AdultChangeNote=t.AdultChangeNote===undefined?null:t.AdultChangeNote;this.IsACShower=t.IsACShower===undefined?null:t.IsACShower;this.IsAS1428_AdultChange=t.IsAS1428_AdultChange===undefined?null:t.IsAS1428_AdultChange;this.IsBCA2020_AdultChange=t.IsBCA2020_AdultChange===undefined?null:t.IsBCA2020_AdultChange;this.IsBYOSling=t.IsBYOSling===undefined?null:t.IsBYOSling;this.IsChangingPlaces=t.IsChangingPlaces===undefined?null:t.IsChangingPlaces;this.IsPre2010_AdultChange=t.IsPre2010_AdultChange===undefined?null:t.IsPre2010_AdultChange;this.Year_AdultChange=t.Year_AdultChange===undefined?null:t.Year_AdultChange;this.IsDrinkingWater=t.IsDrinkingWater===undefined?null:t.IsDrinkingWater;this.IsMensPadDisposal=t.IsMensPadDisposal===undefined?null:t.IsMensPadDisposal;this.IsSanitaryDisposal=t.IsSanitaryDisposal===undefined?null:t.IsSanitaryDisposal;this.IsSharpsDisposal=t.IsSharpsDisposal===undefined?null:t.IsSharpsDisposal;this.IsShower=t.IsShower===undefined?null:t.IsShower;this.IsBabyChange=t.IsBabyChange===undefined?null:t.IsBabyChange;this.BabyChangeNote=t.BabyChangeNote===undefined?null:t.BabyChangeNote;this.IsBabyCareRoom=t.IsBabyCareRoom===undefined?null:t.IsBabyCareRoom;this.IsDumpPoint=t.IsDumpPoint===undefined?null:t.IsDumpPoint;this.DumpPointNote=t.DumpPointNote===undefined?null:t.DumpPointNote;this.IsAfterHours=t.IsAfterHours===undefined?null:t.IsAfterHours;this.IsWashout=t.IsWashout===undefined?null:t.IsWashout;this.IsToilet=t.IsToilet===undefined?null:t.IsToilet;this.IsAccessible=t.IsAccessible===undefined?null:t.IsAccessible;this.IsAmbulant=t.IsAmbulant===undefined?null:t.IsAmbulant;this.IsAS1428_Toilet=t.IsAS1428_Toilet===undefined?null:t.IsAS1428_Toilet;this.IsBCA2020_Toilet=t.IsBCA2020_Toilet===undefined?null:t.IsBCA2020_Toilet;this.IsFemale=t.IsFemale===undefined?null:t.IsFemale;this.IsInclusive=t.IsInclusive===undefined?null:t.IsInclusive;this.IsLHTransfer=t.IsLHTransfer===undefined?null:t.IsLHTransfer;this.IsMale=t.IsMale===undefined?null:t.IsMale;this.IsPre2010_Toilet=t.IsPre2010_Toilet===undefined?null:t.IsPre2010_Toilet;this.IsRHTransfer=t.IsRHTransfer===undefined?null:t.IsRHTransfer;this.IsUnisex=t.IsUnisex===undefined?null:t.IsUnisex;this.ToiletNote=t.ToiletNote===undefined?null:t.ToiletNote;this.Year_Toilet=t.Year_Toilet===undefined?null:t.Year_Toilet;this.Provider=t.Provider===undefined?null:t.Provider;this.HRProviderID=t.HRProviderID===undefined?null:t.HRProviderID;this.ContactEmail=t.ContentEmail===undefined?null:t.ContactEmail;this.ContactPhone=t.ContactPhone===undefined?null:t.ContactPhone;this.ContactWebsite=t.ContactWebsite===undefined?null:t.ContactWebsite;this.ProviderType=t.ProviderType===undefined?null:t.ProviderType;this.AddressID=t.AddressID===undefined?null:t.AddressID;this.OpeningHoursID=t.OpeningHoursID===undefined?null:t.OpeningHoursID;this.AccessID=t.ContentID===this.AccessID?null:t.AccessID;this.AdultChangeID=t.AdultChangeID===undefined?null:t.AdultChangeID;this.AmenitiesID=t.AmenitiesID===undefined?null:t.AmenitiesID;this.BabyChangeID=t.BabyChangeID===undefined?null:t.BabyChangeID;this.DumpPointID=t.DumpPointID===undefined?null:t.DumpPointID;this.ToiletID=t.ToiletID===undefined?null:t.ToiletID;this.ProviderID=t.ProviderID===undefined?null:t.ProviderID;this.Status=null;this.AddressStatus=null;this.OpeningHoursStatus=null;this.AccessStatus=null;this.AmenitiesStatus=null;this.ToiletStatus=null;this.AdultChangeStatus=null;this.BabyChangeStatus=null;this.DumpPointStatus=null;this.WasClosed=!1;i&&this.UpdateStatuses(i);this.OpeningHoursSchedules=[];this.IsOpenSchedule&&t.Schedules.forEach(function(n){r.OpeningHoursSchedules.push(new Schedule(n))});this.ExistingPhotos=[];t.Graphics&&t.Graphics.forEach(function(n){var t=new Photo;t.ContentID=n;t.ID="Existing_"+n;r.ExistingPhotos.push(t)});this.Photos=[];this.LetUsKnow=new LetUsKnow;this.AddingSchedule=!1;this.CurrentSchedule=this.IsOpenSchedule?this.OpeningHoursSchedules[0]:null;this.AddressMode=AddressModeTypes.Collapsed;this.AddressFull=null;this.RebuildAddressFull();this.AddressNote_CS=null;this.OpeningHoursNote_CS=null;this.FacilitiesNote=null;this.AccessAndParkingNote=null}return _createClass(n,[{key:"RebuildOpeningHoursDisplayText",value:function(){var n=this;this.IsClosed?this.OpeningHoursDisplay="Currently closed":this.IsOpenAllHours?this.OpeningHoursDisplay="OPEN: 24 hours":this.IsOpenDaylightHours?this.OpeningHoursDisplay="OPEN: Daylight hours":this.IsOpeningHoursVariable?this.OpeningHoursDisplay="OPEN: Variable hours":this.IsOpenVenueHours?this.OpeningHoursDisplay="OPEN: Venue hours":this.IsOpenSchedule?(this.OpeningHoursDisplay="OPEN: ",this.OpeningHoursSchedules.forEach(function(t){n.OpeningHoursDisplay!=="OPEN: "&&(n.OpeningHoursDisplay+=", ");n.OpeningHoursDisplay+=t.Description})):this.OpeningHoursDisplay="Open unknown hours"}},{key:"RebuildAddressFull",value:function(){this.AddressFull=(this.Address1?this.Address1+(this.Town||this.State?", ":""):"")+(this.Town?this.Town+(this.State?", ":""):"")+(this.State?this.State:"")}},{key:"UpdateIDs",value:function(n){var t=this;this.ContentID=n.ContentID;this.AddressID=n.AddressID;this.OpeningHoursID=n.OpeningHoursID;this.AccessID=n.AccessID;this.AdultChangeID=n.AdultChangeID;this.AmenitiesID=n.AmenitiesID;this.BabyChangeID=n.BabyChangeID;this.DumpPointID=n.DumpPointID;this.ToiletID=n.ToiletID;this.ProviderID=n.ProviderID;this.OpeningHoursSchedules=[];this.IsOpenSchedule&&n.Schedules.forEach(function(n){t.OpeningHoursSchedules.push(new Schedule(n))})}},{key:"UpdateStatuses",value:function(n){this.Status=n.FacilityStatus===undefined?null:n.FacilityStatus;this.AddressStatus=n.AddressStatus===undefined?null:n.AddressStatus;this.OpeningHoursStatus=n.OpeningHoursStatus===undefined?null:n.OpeningHoursStatus;this.AccessStatus=n.AccessStatus===undefined?null:n.AccessStatus?n.AccessStatus:ContentStatus.Published;this.AmenitiesStatus=n.AmenitiesStatus===undefined?null:n.AmenitiesStatus?n.AmenitiesStatus:ContentStatus.Published;this.ToiletStatus=n.ToiletStatus===undefined?null:n.ToiletStatus?n.ToiletStatus:ContentStatus.Published;this.AdultChangeStatus=n.AdultChangeStatus===undefined?null:n.AdultChangeStatus?n.AdultChangeStatus:ContentStatus.Published;this.BabyChangeStatus=n.BabyChangeStatus===undefined?null:n.BabyChangeStatus?n.BabyChangeStatus:ContentStatus.Published;this.DumpPointStatus=n.DumpPointStatus===undefined?null:n.DumpPointStatus?n.DumpPointStatus:ContentStatus.Published}},{key:"UpdateStatus",value:function(n,t,i,r){this.TitleShort===n&&(this.ContentID===t||this.ContentID===i?this.Status=r:this.AddressID===t||this.AddressID===i?this.AddressStatus=r:this.OpeningHoursID===t||this.OpeningHoursID===i?this.OpeningHoursStatus=r:this.AccessID===t||this.AccessID===i?this.AccessStatus=r:this.AmenitiesID===t||this.AmenitiesID===i?this.AmenitiesStatus=r:this.ToiletID===t||this.ToiletID===i?this.ToiletStatus=r:this.AdultChangeID===t||this.AdultChangeID===i?this.AdultChangeStatus=r:this.BabyChangeID===t||this.BabyChangeID===i?this.BabyChangeStatus=r:(this.DumpointID===t||this.DumpointID===i)&&(this.DumpPointStatus=r))}},{key:"AddToFormData",value:function(n,t,i){for(var r in i)i[r]!==undefined&&(i[r]!==null&&_typeof(i[r])==="object"?Array.isArray(i)?this.AddToFormData(n,(t?t:"")+"["+r+"].",i[r]):Array.isArray(i[r])?this.AddToFormData(n,(t?t:"")+r,i[r]):this.AddToFormData(n,(t?t:"")+r+".",i[r]):Array.isArray(i)?n.append((t?t:"")+"["+r+"]",i[r]):n.append((t?t:"")+r,i[r]))}},{key:"VisibleExistingPhotos",get:function(){return this.ExistingPhotos.length<=4?this.ExistingPhotos:this.ExistingPhotos.slice(0,4)}},{key:"MinimumStatus",get:function(){return Math.min(this.Status,this.AccessStatus?this.AccessStatus:ContentStatus.Published,this.AddressStatus?this.AddressStatus:ContentStatus.Published,this.AdultChangeStatus?this.AdultChangeStatus:ContentStatus.Published,this.AmenitiesStatus?this.AmenitiesStatus:ContentStatus.Published,this.BabyChangeStatus?this.BabyChangeStatus:ContentStatus.Published,this.DumpPointStatus?this.DumpPointStatus:ContentStatus.Published,this.OpeningHoursStatus?this.OpeningHoursStatus:ContentStatus.Published,this.ToiletStatus?this.ToiletStatus:ContentStatus.Published)}},{key:"IsAwaitingPublish",get:function(){return this.MinimumStatus!=ContentStatus.Published}},{key:"HasFacility",get:function(){return this.IsMale||this.IsFemale||this.IsUnisex||this.IsInclusive||this.IsAccessible||this.IsAdultChange||this.IsBabyChange||this.IsDumpPoint}},{key:"IsMale_GS",get:function(){return this.IsMale},set:function(n){this.IsMale=n}},{key:"IsFemale_GS",get:function(){return this.IsFemale},set:function(n){this.IsFemale=n}},{key:"IsUnisex_GS",get:function(){return this.IsUnisex},set:function(n){this.IsUnisex=n;n&&(this.IsInclusive=!1)}},{key:"IsInclusive_GS",get:function(){return this.IsInclusive},set:function(n){this.IsInclusive=n;n&&(this.IsUnisex=!1)}},{key:"IsAccessible_GS",get:function(){return this.IsAccessible},set:function(n){this.IsAccessible=n;n||(this.IsLHTransfer=!1,this.IsRHTransfer=!1)}},{key:"IsAdultChange_GS",get:function(){return this.IsAdultChange},set:function(n){this.IsAdultChange=n;n?this.IsBYOSling=!0:(this.IsBYOSling=!1,this.IsACShower=!1,this.IsChangingPlaces=!1,this.AdultChangeNote=null)}},{key:"IsDumpPoint_GS",get:function(){return this.IsDumpPoint},set:function(n){this.IsDumpPoint=n;n||(this.IsWashout=!1,this.IsAfterHours=!1,this.DumpPointNote=null)}},{key:"IsBabyChange_GS",get:function(){return this.IsBabyChange},set:function(n){this.IsBabyChange=n;n||(this.IsBabyCareRoom=!1,this.BabyChangeNote=null)}},{key:"IsToilet_GS",get:function(){return this.IsToilet},set:function(n){this.IsToilet=n;n||(this.IsMale=!1,this.IsFemale=!1,this.IsUnisex=!1,this.IsInclusive=!1,this.IsLHTransfer=!1,this.IsRHTransfer=!1,this.IsAmbulant=!1,this.IsAccessible=!1)}},{key:"IsMLAKKey_GS",get:function(){return this.IsMLAKKey},set:function(n){this.IsMLAKKey=n;n&&(this.IsKeyRequired=!1,this.IsMLAKAfterHours=!1)}},{key:"IsMLAKAfterHours_GS",get:function(){return this.IsMLAKAfterHours},set:function(n){this.IsMLAKAfterHours=n;n&&(this.IsKeyRequired=!1,this.IsMLAKKey=!1)}},{key:"IsKeyRequired_GS",get:function(){return this.IsKeyRequired},set:function(n){this.IsKeyRequired=n;n&&(this.IsMLAKKey=!1,this.IsMLAKAfterHours=!1)}},{key:"ActualFacilityIcon",get:function(){switch(this.FacilityIcon){case"Airport":return"airport";case"Beach":return"beach";case"Bus station":return"bus";case"Camping ground":return"camping";case"Car park":return"car-park";case"Caravan park":return"caravan";case"Cemetery":return"cemetery";case"Community building":return"community_building";case"Food outlet":return"food";case"Jetty":return"jetty";case"Other":return"toilet";case"Park or reserve":return"park";case"Rest area":return"rest_area";case"Service station":return"service_station";case"Shopping centre":return"shopping_centre";case"Sporting facility":return"sports";case"Swimming pool":return"swimming";case"Train station":return"train";default:return"toilet"}}},{key:"DisplayAddress",get:function(){return this.AddressFull}},{key:"AccessKeys",get:function(){return!this.IsKeyRequired&&!this.IsMLAKKey?0:this.IsKeyRequired?1:2},set:function(n){switch(n){case 0:this.IsKeyRequired=!1;this.IsMLAKKey=!1;break;case 1:this.IsKeyRequired=!0;this.IsMLAKKey=!1;break;case 2:this.IsKeyRequired=!1;this.IsMLAKKey=!0}}},{key:"Address",get:function(){return MainEditorManager.ReloadNeeded=!0,{AgencyID:this.AgencyID,ContentID:this.ContentID,FacilityID:this.ContentID,AddressID:this.AddressID,YourID:this.YourID,Title:this.Title?this.Title.trim():null,FacilityIcon:this.FacilityIcon,Latitude:this.Latitude,Longitude:this.Longitude,Address1:this.Address1?this.Address1.trim():null,Town:this.Town?this.Town.trim():null,State:this.State?this.State.trim():null,AddressNote:this.AddressNote_CS?this.AddressNote_CS:this.AddressNote,WasClosed:this.WasClosed}}},{key:"Facilities",get:function(){return this.IsToilet=this.IsMale||this.IsFemale||this.IsUnisex||this.IsInclusive||this.IsAccessible?!0:!1,MainEditorManager.ReloadNeeded=!0,MainEditorManager.Facilities.IsCrowdsource&&(this.AccessAndParkingNote&&(this.AccessNote=this.AccessAndParkingNote),this.FacilitiesNote&&(this.ToiletNote=this.FacilitiesNote)),{FacilityID:this.ContentID,ContentID:this.ContentID,AgencyID:this.AgencyID,ToiletID:this.ToiletID,AdultChangeID:this.AdultChangeID,BabyChangeID:this.BabyChangeID,DumpPointID:this.DumpPointID,IsAdultChange:this.IsAdultChange,AdultChangeNote:this.AdultChangeNote,IsACShower:this.IsACShower,IsAS1428_AdultChange:this.IsAS1428_AdultChange,IsBCA2020_AdultChange:this.IsBCA2020_AdultChange,IsBYOSling:this.IsBYOSling,IsChangingPlaces:this.IsChangingPlaces,IsPre2010_AdultChange:this.IsPre2010_AdultChange,Year_AdultChange:this.Year_AdultChange,IsBabyChange:this.IsBabyChange,BabyChangeNote:this.BabyChangeNote,IsBabyCareRoom:this.IsBabyCareRoom,IsDumpPoint:this.IsDumpPoint,DumpPointNote:this.DumpPointNote,IsAfterHours:this.IsAfterHours,IsWashout:this.IsWashout,IsToilet:this.IsToilet,IsAccessible:this.IsAccessible,IsAmbulant:this.IsAmbulant,IsAS1428_Toilet:this.IsAS1428_Toilet,IsBCA2020_Toilet:this.IsBCA2020_Toilet,IsFemale:this.IsFemale,IsInclusive:this.IsInclusive,IsLHTransfer:this.IsLHTransfer,IsMale:this.IsMale,IsPre2010_Toilet:this.IsPre2010_Toilet,IsRHTransfer:this.IsRHTransfer,IsUnisex:this.IsUnisex,ToiletNote:this.FacilitiesNote?this.FacilitiesNote:this.ToiletNote,Year_Toilet:this.Year_Toilet,WasClosed:this.WasClosed}}},{key:"Amenities",get:function(){return{FacilityID:this.ContentID,ContentID:this.AmenitiesID,AgencyID:this.AgencyID,IsShower:this.IsShower,IsSharpsDisposal:this.IsSharpsDisposal,IsSanitaryDisposal:this.IsSanitaryDisposal,IsMensPadDisposal:this.IsMensPadDisposal,IsDrinkingWater:this.IsDrinkingWater,WasClosed:this.WasClosed}}},{key:"Access",get:function(){return{FacilityID:this.ContentID,ContentID:this.AccessID,AgencyID:this.AgencyID,IsParking:this.IsParking,IsParkingAccessible:this.IsParkingAccessible,ParkingNote:this.ParkingNote,IsKeyRequired:this.IsKeyRequired,IsMLAKAfterHours:this.IsMLAKAfterHours,IsMLAKKey:this.IsMLAKKey,IsPaymentRequired:this.IsPaymentRequired,AccessNote:this.AccessAndParkingNote?this.AccessAndParkingNote:this.AccessNote,WasClosed:this.WasClosed}}},{key:"OpeningHours",get:function(){return MainEditorManager.ReloadNeeded=this.OpeningHoursSchedules&&this.OpeningHoursSchedules.length>0,{FacilityID:this.ContentID,ContentID:this.OpeningHoursID,AgencyID:this.AgencyID,IsClosed:this.IsClosed,IsOpenAllHours:this.IsOpenAllHours,IsOpenDaylightHours:this.IsOpenDaylightHours,IsOpeningHoursVariable:this.IsOpeningHoursVariable,IsOpenSchedule:this.IsOpenSchedule,IsOpenVenueHours:this.IsOpenVenueHours,OpeningHoursNote:this.OpeningHoursNote_CS?this.OpeningHoursNote_CS:this.OpeningHoursNote,OpeningHoursDisplay:this.OpeningHoursDisplay,Schedules:this.OpeningHoursSchedules.map(function(n){var t,i;return{ContentID:n.ContentID,DayMask:(t=n.DayMask)===null||t===void 0?void 0:t.trim(),MonthMask:(i=n.MonthMask)===null||i===void 0?void 0:i.trim(),OpeningTime:"1900-Jan-01 "+n.OpeningTime_24,ClosingTime:"1900-Jan-01 "+n.ClosingTime_24}})}}},{key:"Photo",get:function(){var n=new FormData;return n.append("ContentID",this.ContentID),n.append("AgencyID",this.AgencyID),n.append("WasClosed",this.WasClosed),this.Photos.forEach(function(t){n.append("Photos",t.Image,t.Image.name)}),n}},{key:"NewFacility",get:function(){var t,n;return this.IsToilet=this.IsMale||this.IsFemale||this.IsUnisex||this.IsInclusive||this.IsAccessible?!0:!1,t={AgencyID:this.AgencyID,Title:this.Title,FacilityIcon:this.FacilityIcon,Latitude:this.Latitude,Longitude:this.Longitude,Address1:this.Address1,Town:this.Town,State:this.State,AddressNote:this.AddressNote_CS?this.AddressNote_CS:this.AddressNote,IsAdultChange:this.IsAdultChange,AdultChangeNote:this.AdultChangeNote,IsACShower:this.IsACShower,IsAS1428_AdultChange:this.IsAS1428_AdultChange,IsBCA2020_AdultChange:this.IsBCA2020_AdultChange,IsBYOSling:this.IsBYOSling,IsChangingPlaces:this.IsChangingPlaces,IsPre2010_AdultChange:this.IsPre2010_AdultChange,Year_AdultChange:this.Year_AdultChange,IsBabyChange:this.IsBabyChange,BabyChangeNote:this.BabyChangeNote,IsBabyCareRoom:this.IsBabyCareRoom,IsDumpPoint:this.IsDumpPoint,DumpPointNote:this.DumpPointNote,IsAfterHours:this.IsAfterHours,IsWashout:this.IsWashout,IsToilet:this.IsToilet,IsAccessible:this.IsAccessible,IsAmbulant:this.IsAmbulant,IsAS1428_Toilet:this.IsAS1428_Toilet,IsBCA2020_Toilet:this.IsBCA2020_Toilet,IsFemale:this.IsFemale,IsInclusive:this.IsInclusive,IsLHTransfer:this.IsLHTransfer,IsMale:this.IsMale,IsPre2010_Toilet:this.IsPre2010_Toilet,IsRHTransfer:this.IsRHTransfer,IsUnisex:this.IsUnisex,ToiletNote:this.FacilitiesNote?this.FacilitiesNote:this.ToiletNote,Year_Toilet:this.Year_Toilet,IsShower:this.IsShower,IsSharpsDisposal:this.IsSharpsDisposal,IsSanitaryDisposal:this.IsSanitaryDisposal,IsMensPadDisposal:this.IsMensPadDisposal,IsDrinkingWater:this.IsDrinkingWater,IsParking:this.IsParking,IsParkingAccessible:this.IsParkingAccessible,ParkingNote:this.ParkingNote,IsKeyRequired:this.IsKeyRequired,IsMLAKAfterHours:this.IsMLAKAfterHours,IsMLAKKey:this.IsMLAKKey,IsPaymentRequired:this.IsPaymentRequired,AccessNote:this.AccessAndParkingNote?this.AccessAndParkingNote:this.AccessNote,IsClosed:this.IsClosed,IsOpenAllHours:this.IsOpenAllHours,IsOpenDaylightHours:this.IsOpenDaylightHours,IsOpeningHoursVariable:this.IsOpeningHoursVariable,IsOpenSchedule:this.IsOpenSchedule,IsOpenVenueHours:this.IsOpenVenueHours,OpeningHoursNote:this.OpeningHoursNote_CS?this.OpeningHoursNote_CS:this.OpeningHoursNote,OpeningHoursDisplay:this.OpeningHoursDisplay,Schedules:this.OpeningHoursSchedules.map(function(n){return{ContentID:n.ContentID,DayMask:n.DayMask,MonthMask:n.MonthMask,OpeningTime:"1900-Jan-01 "+n.OpeningTime_24,ClosingTime:"1900-Jan-01 "+n.ClosingTime_24}}),LetUsKnowMessage:this.LetUsKnow.Message},this.Photos.length>0?(n=new FormData,this.AddToFormData(n,null,t),this.Photos.forEach(function(t){n.append("Photos",t.Image,t.Image.name)}),n):t}}]),n}(),Schedule=function(){function n(t){_classCallCheck(this,n);this.ContentID=t.ContentID;this.OpeningTime=null;this.OpeningTime=typeof t.OpeningTime=="Date"?t.OpeningTime:new Date(t.OpeningTime);this.ClosingTime=null;this.ClosingTime=typeof t.ClosingTime=="Date"?t.ClosingTime:new Date(t.ClosingTime);this.DayMask=t.DayMask;this.MonthMask=t.MonthMask;this.Description=t.Description;this.OpeningTime_XT=this.OpeningTime.getHours()>=12?"PM":"AM";this.ClosingTime_XT=this.ClosingTime.getHours()>=12?"PM":"AM";this.ShowDays=this.HasSunday||this.HasMonday||this.HasTuesday||this.HasWednesday||this.HasThursday||this.HasFriday||this.HasSaturday;this.ShowMonths=this.HasJanuary||this.HasFebruary||this.HasMarch||this.HasApril||this.HasMay||this.HasJune||this.HasJuly||this.HasAugust||this.HasSeptember||this.HasOctober||this.HasNovember||this.HasDecember;this.OpeningTimeText=this.OpeningTime_GS.toString();this.ClosingTimeText=this.ClosingTime_GS.toString();this.calculateDescription()}return _createClass(n,[{key:"hasDay",value:function(n){return this.DayMask.indexOf(n)>-1}},{key:"setDay",value:function(n,t){t?this.hasDay(n)||(this.DayMask+=n):this.hasDay(n)&&(this.DayMask=this.DayMask.replace(n,""));this.calculateDescription()}},{key:"hasMonth",value:function(n){return this.MonthMask.indexOf(n)>-1}},{key:"setMonth",value:function(n,t){t?this.hasMonth(n)||(this.MonthMask+=n):this.hasMonth(n)&&(this.MonthMask=this.MonthMask.replace(n,""));this.calculateDescription()}},{key:"calculateDescription",value:function(){var n=this.AllMonths?"":this.monthDescription,t=this.AllDays?"":this.dayDescription,i=this.OpeningTime_GS+" "+this.OpeningTime_XT+"-"+this.ClosingTime_GS+" "+this.ClosingTime_XT;this.Description=n+t+i}},{key:"AllDays",get:function(){return this.HasSunday&&this.HasMonday&&this.HasTuesday&&this.HasWednesday&&this.HasThursday&&this.HasFriday&&this.HasSaturday}},{key:"AllMonths",get:function(){return this.HasJanuary&&this.HasFebruary&&this.HasMarch&&this.HasApril&&this.HasMay&&this.HasJune&&this.HasJuly&&this.HasAugust&&this.HasSeptember&&this.HasOctober&&this.HasNovember&&this.HasDecember}},{key:"DisplayLabel",get:function(){return this.Description?this.Description:"New schedule"}},{key:"OpeningTime_24",get:function(){return this.OpeningTime.getHours()+":"+(this.OpeningTime.getMinutes()<10?"0"+this.OpeningTime.getMinutes():this.OpeningTime.getMinutes())}},{key:"OpeningTime_GS",get:function(){var n=this.OpeningTime.getHours()>12?this.OpeningTime.getHours()-12:this.OpeningTime.getHours();return n===0&&(n=12),n+":"+(this.OpeningTime.getMinutes()<10?"0"+this.OpeningTime.getMinutes():this.OpeningTime.getMinutes())},set:function(n){this.OpeningTime.setHours(Number(n.substring(0,n.indexOf(":")))+(this.OpeningTime_XT==="PM"&&Number(n.substring(0,n.indexOf(":")))!==12?12:0),n.substring(n.indexOf(":")+1));this.calculateDescription()}},{key:"ClosingTime_24",get:function(){return this.ClosingTime.getHours()+":"+(this.ClosingTime.getMinutes()<10?"0"+this.ClosingTime.getMinutes():this.ClosingTime.getMinutes())}},{key:"ClosingTime_GS",get:function(){var n=this.ClosingTime.getHours()>12?this.ClosingTime.getHours()-12:this.ClosingTime.getHours();return n===0&&(n=12),n+":"+(this.ClosingTime.getMinutes()<10?"0"+this.ClosingTime.getMinutes():this.ClosingTime.getMinutes())},set:function(n){this.ClosingTime.setHours(Number(n.substring(0,n.indexOf(":")))+(this.ClosingTime_XT==="PM"&&Number(n.substring(0,n.indexOf(":")))!==12?12:0),n.substring(n.indexOf(":")+1));this.calculateDescription()}},{key:"OpeningTime_XT_GS",get:function(){return this.OpeningTime_XT},set:function(n){n!==this.OpeningTime_XT&&(n==="AM"?this.OpeningTime.setHours(this.OpeningTime.getHours()-12):this.OpeningTime.setHours(this.OpeningTime.getHours()+12));this.OpeningTime_XT=n;this.calculateDescription()}},{key:"ClosingTime_XT_GS",get:function(){return this.ClosingTime_XT},set:function(n){n!==this.ClosingTime_XT&&(n==="AM"?this.ClosingTime.setHours(this.ClosingTime.getHours()-12):this.ClosingTime.setHours(this.ClosingTime.getHours()+12));this.ClosingTime_XT=n;this.calculateDescription()}},{key:"ShowDays_GS",get:function(){return this.ShowDays},set:function(n){n?(this.ShowDays=n,this.DayMask=this.FullDayMask):this.DayMask="";this.calculateDescription()}},{key:"FullDayMask",get:function(){return"MonTueWedThuFriSatSun"}},{key:"FullDayMaskExt",get:function(){return this.FullDayMask+"Sun"}},{key:"ShowMonths_GS",get:function(){return this.ShowMonths},set:function(n){n?(this.ShowMonths=n,this.MonthMask="JanFebMarAprMayJunJulAugSepOctNovDec"):this.MonthMask="";this.calculateDescription()}},{key:"FullMonthMask",get:function(){return"JanFebMarAprMayJunJulAugSepOctNovDec"}},{key:"FullMonthMaskExt",get:function(){return this.FullMonthMask+"Jan"}},{key:"HasSunday",get:function(){return this.hasDay("Sun")},set:function(n){this.setDay("Sun",n)}},{key:"HasMonday",get:function(){return this.hasDay("Mon")},set:function(n){this.setDay("Mon",n)}},{key:"HasTuesday",get:function(){return this.hasDay("Tue")},set:function(n){this.setDay("Tue",n)}},{key:"HasWednesday",get:function(){return this.hasDay("Wed")},set:function(n){this.setDay("Wed",n)}},{key:"HasThursday",get:function(){return this.hasDay("Thu")},set:function(n){this.setDay("Thu",n)}},{key:"HasFriday",get:function(){return this.hasDay("Fri")},set:function(n){this.setDay("Fri",n)}},{key:"HasSaturday",get:function(){return this.hasDay("Sat")},set:function(n){this.setDay("Sat",n)}},{key:"HasJanuary",get:function(){return this.hasMonth("Jan")},set:function(n){this.setMonth("Jan",n)}},{key:"HasFebruary",get:function(){return this.hasMonth("Feb")},set:function(n){this.setMonth("Feb",n)}},{key:"HasMarch",get:function(){return this.hasMonth("Mar")},set:function(n){this.setMonth("Mar",n)}},{key:"HasApril",get:function(){return this.hasMonth("Apr")},set:function(n){this.setMonth("Apr",n)}},{key:"HasMay",get:function(){return this.hasMonth("May")},set:function(n){this.setMonth("May",n)}},{key:"HasJune",get:function(){return this.hasMonth("Jun")},set:function(n){this.setMonth("Jun",n)}},{key:"HasJuly",get:function(){return this.hasMonth("Jul")},set:function(n){this.setMonth("Jul",n)}},{key:"HasAugust",get:function(){return this.hasMonth("Aug")},set:function(n){this.setMonth("Aug",n)}},{key:"HasSeptember",get:function(){return this.hasMonth("Sep")},set:function(n){this.setMonth("Sep",n)}},{key:"HasOctober",get:function(){return this.hasMonth("Oct")},set:function(n){this.setMonth("Oct",n)}},{key:"HasNovember",get:function(){return this.hasMonth("Nov")},set:function(n){this.setMonth("Nov",n)}},{key:"HasDecember",get:function(){return this.hasMonth("Dec")},set:function(n){this.setMonth("Dec",n)}},{key:"dayDescription",get:function(){var n,i;if(this.DayMask.length===3)return this.DayMask+" ";for(n=this.HasMonday?"1":"0",n+=this.HasTuesday?"1":"0",n+=this.HasWednesday?"1":"0",n+=this.HasThursday?"1":"0",n+=this.HasFriday?"1":"0",n+=this.HasSaturday?"1":"0",n+=this.HasSunday?"1":"0",n+="0",i=n;i.indexOf("00")>-1;)i=i.replace("00","0");while(i.indexOf("11")>-1)i=i.replace("11","1");for(var r=n.indexOf("1"),t=n.indexOf("10"),u="",f=i.length>2?", ":"";r>-1&&r<n.length;)u+=r===t||t===-1?this.FullDayMask.substr(r*3,3)+f:this.FullDayMask.substr(r*3,3)+"-"+this.FullDayMask.substr(t*3,3)+f,r=t===-1?-1:t+1<n.length?n.indexOf("1",t+1):-1,t=t===-1?-1:t+1<n.length?n.indexOf("10",t+1):-1;return u+" "}},{key:"monthDescription",get:function(){var n,i;if(this.MonthMask.length===3)return this.MonthMask+" ";for(n=this.HasJanuary?"1":"0",n+=this.HasFebruary?"1":"0",n+=this.HasMarch?"1":"0",n+=this.HasApril?"1":"0",n+=this.HasMay?"1":"0",n+=this.HasJune?"1":"0",n+=this.HasJuly?"1":"0",n+=this.HasAugust?"1":"0",n+=this.HasSeptember?"1":"0",n+=this.HasOctober?"1":"0",n+=this.HasNovember?"1":"0",n+=this.HasDecember?"1":"0",n+="0",i=n;i.indexOf("00")>-1;)i=i.replace("00","0");while(i.indexOf("11")>-1)i=i.replace("11","1");for(var r=n.indexOf("1"),t=n.indexOf("10"),u="",f=i.length>2?", ":"";r>-1&&r<n.length;)u+=r===t||t===-1?this.FullMonthMask.substr(r*3,3)+f:this.FullMonthMask.substr(r*3,3)+"-"+this.FullMonthMask.substr(t*3,3)+f,r=t===-1?-1:t+1<n.length?n.indexOf("1",t+1):-1,t=t===-1?-1:t+1<n.length?n.indexOf("10",t+1):-1;return u+" "}}]),n}(),Photo=function Photo(){_classCallCheck(this,Photo);this.ContentID=null;this.Data=null;this.Image=null;this.Loaded=!1;this.Number=0;this.ID=null;this.Saved=!1;this.Removing=!1},LetUsKnow=function(){function n(){_classCallCheck(this,n);this.Message=null;this.Token=null;this.FailedToken=!1;this.CanSubmit=!0;this.ReCaptcha=null}return _createClass(n,[{key:"InitialiseRecaptcha",value:function(){this.FailedToken=!1;this.Token=null;var n=this;this.ReCaptcha=new ReCaptcha(new ReCaptchaV3Options(document.getElementById("RecaptchaMainKey").value,this,"LetUsKnow").SetError(function(){Messages.display(MessageType.error,"Let us know","An error occured running recaptcha",1e4)}),new ReCaptchaV2Options(document.getElementById("RecaptchaSecondaryKey").value,"LetUsKnowRecaptcha",this).SetPreStart(function(){n.CanSubmit=!1;n.FailedToken=!0}).SetSuccess(function(){n.CanSubmit=!0}).SetExpire(function(){n.CanSubmit=!1}).SetInvalid(function(){}));this.ReCaptcha.Run(this.FailedToken)}},{key:"Post",get:function(){return{Message:this.Message,Token:this.Token,FailedToken:this.FailedToken}}}]),n}(),DeleteFacility=function(){function n(t){_classCallCheck(this,n);this.ContentID=t;this.Reason=null;this.MinLength=7;this.Validators=new ValidatorCollection([new Validator("Reason",function(n){return new ValidationResult(n.Reason&&n.Reason.length>=7,"A reason is required and must be at least "+n.MinLength+" characters long.")})])}return _createClass(n,[{key:"Validate",value:function(){return this.Validators.Validate(this),this.Validators.Success}},{key:"Post",get:function(){return{ContentID:this.ContentID,Reason:this.Reason}}}]),n}(),AddressModeTypes={Collapsed:0,Phone:1,Address:2,Pin:3,LatLng:4};UserInfo=function(){function n(t){var i=this;_classCallCheck(this,n);this.Roles=[];this.Agencies=[];t.Roles.forEach(function(n){return i.Roles.push(n)});t.Agencies.forEach(function(n){return i.Agencies.push(new AgencyInfo(n))});this.CreateAgencyID=this.DefaultAgencyID}return _createClass(n,[{key:"IsProviderOf",value:function(n){return this.Roles.indexOf("Provider")>-1&&this.Agencies.find(function(t){return(t.AgencyID===n||t.Title==="SYSTEM")&&t.Title!=="CrowdSource"})}},{key:"HasEditRights",value:function(n){return this.IsProviderOf(n)||this.IsTrusted||this.IsCrowdsource}},{key:"HasDeleteRights",value:function(n){return this.IsProviderOf(n)||this.IsAdmin}},{key:"IsTrusted",get:function(){return this.Roles.indexOf("Trusted")>-1}},{key:"IsCrowdsource",get:function(){return this.Roles.indexOf("CrowdSource")>-1}},{key:"IsAdmin",get:function(){return this.Roles.indexOf("Admin")>-1}},{key:"IsCrowdsourceOnly",get:function(){return this.IsCrowdsource&&!this.IsTrusted&&this.Roles.indexOf("Provider")===-1}},{key:"IsAProvider",get:function(){return this.Roles.indexOf("Provider")>-1}},{key:"ProviderAgencies",get:function(){return this.Agencies.filter(function(n){return n.Title!=="SYSTEM"&&n.Title!=="CrowdSource"})}},{key:"DefaultAgencyID",get:function(){if(this.Roles.indexOf("Provider")>-1){var n=this.Agencies.find(function(n){return n.Title!=="SYSTEM"&&n.Title!=="CrowdSource"});return n?n.AgencyID:null}return this.IsCrowdsource?this.Agencies.find(function(n){return n.Title==="CrowdSource"}).AgencyID:this.Agencies.length>0?this.Agencies[0].AgencyID:null}},{key:"HasDefaultAgency",get:function(){return this.DefaultAgencyID!==null}},{key:"CanUseSystem",get:function(){return this.IsAdmin&&this.Agencies.find(function(n){return n.Title==="SYSTEM"})}}]),n}();AgencyInfo=function AgencyInfo(n){_classCallCheck(this,AgencyInfo);this.AgencyID=n.AgencyID;this.Title=n.Title};spinnerbutton={props:["disabled","text","isSubmit","disabledonly","islight"],computed:{isprimary:{get:function(){return!this.islight}},btntype:{get:function(){return this.isSubmit?"submit":"button"}}},template:'\n        <button :type="btntype" class=\'btn\' :class="{disabled: disabled || disabledonly, \'btn-primary\': isprimary, \'btn-light\': islight}" :disabled="disabled || disabledonly" v-on:click="$emit(\'click\')" v-on:keyup.enter="$emit(\'click\')" >{{text}}<svg v-if="disabled" xmlns="http://www.w3.org/2000/svg" class="c-spinner" width="17" height="17"><path fill="none" stroke="#ffffff" stroke-width="1.75" d="M8.5 2A6.5 6.5 0 0 0 2 8.5"/><\/svg><\/button>               \n    '};"use strict";var iconswitch={props:["display","icon","value","disabled","readonly"],components:{Icon:Icon},computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}},myIcon:{get:function(){if(this.icon.indexOf(",")>-1){var n=this.icon.split(","),t=this.value===null?0:this.value===!1?0:this.value===!0?1:this.value;return n[t]}return this.icon}}},template:'\n            <button type="button" class="icon-button" :class="{disabled: disabled}" :disabled="disabled" v-on:click="click">\n                <icon :icon-type="myIcon" :is-disabled="!value || value==0"><\/icon>\n                <span>{{display}}<\/span>\n            <\/button>\n        ',methods:{click:function(){if(!this.readonly){var n=this.value,t=this.icon.split(",").length;t>2?(n=(this.value===null?0:this.value)+1,n>t-1&&(n=0)):n=!(this.value===null?!1:this.value);this.myValue=n}}}},iconswitchrow={props:["display","icon","iconext","value","disabled"],components:{icon:iconswitch},computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},template:'\n        <icon :value="myValue" :display="display" :icon="icon" :iconext="iconext" :disabled="disabled" v-on:input="input"><\/icon>\n    ',methods:{input:function(n){this.myValue=n}}},notefield={props:["value","watermark","maxlength","title","minlength","validator","mainmodel"],computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}},textLength:{get:function(){return this.maxlength?(this.value===null?0:this.value.length)+"/"+this.maxlength:this.minlength?this.value===null?0:this.value.length:void 0}}},template:'\n        <div class="note">\n            <label v-if="title">{{title}}<\/label>\n            <textarea class="form-control" type="text" rows="3" v-model="myValue" :maxlength="maxlength" :placeholder="watermark" v-on:changed="$emit(\'change\')" ><\/textarea>\n            <span v-if="maxlength || minlength" class="counter text-muted">{{textLength}}<\/span>\n            <validationmessage v-if="validator && mainmodel" :validator="validator" :mainmodel="mainmodel" v-model="myValue"><\/validationmessage>\n        <\/div>\n    '},checkbox={props:["value","label","heading","id"],computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},template:'\n        <div class="form-horizontal">\n            <input type="checkbox" :id="id" v-model="myValue">\n            <label :for="id" :class="{ hint: heading != null }"><span v-if="heading">{{heading}}<\/span>{{label}}<\/label>\n        <\/div>\n    '},controlrow={props:["editor","updatetext","createtext","canceltext","emitsave","emitcreate","createInstruction","nocancel","nosave"],components:{spinnerbutton:spinnerbutton},data:function(){var n=MainEditorManager.GetPreviouisEditor(this.editor),t=MainEditorManager.GetNextEditor(this.editor),i=n===null?"none":n.DisplayName,r=t===null?"none":t.DisplayName;return{previousEditor:n,nextEditor:t,previousText:i,nextText:r,validationResult:null,save_then_next:!1,save_then_prev:!1}},computed:{buttontext:{get:function(){return this.updatetext?this.updatetext:"Save"}},mycreatetext:{get:function(){return this.createtext?this.createtext:"Create facility"}},mycanceltext:{get:function(){return this.canceltext?this.canceltext:"Cancel"}},saving:{get:function(){return MainEditorManager.CreateMode?MainEditorManager.CreateNew.Saving:this.editor.Saving}}},template:'\n        <div class="buttons">\n                <button v-if="previousEditor" type="button" class="btn btn-left" v-on:click="previous" :title="previousText">\n                    <img src="/Content/img/left.svg" />\n                    <label>{{previousText}}<\/label>\n                <\/button>\n                <slot><\/slot>\n                <spinnerbutton v-if="editor.IsCreateMode && nextEditor==null && !nosave" type="button" v-on:click="create" :text="mycreatetext" :disabled="saving"><\/spinnerbutton>\n                <spinnerbutton v-if="!editor.IsCreateMode && !nosave" v-on:click="save" type="button" :text="buttontext" :disabled="saving"><\/spinnerbutton>\n                <spinnerbutton v-if="!editor.IsCreateMode && !nocancel" v-on:click="cancel" type="button" :text="mycanceltext" :disabled="saving" :islight="true"><\/spinnerbutton>\n                <slot name="append"><\/slot> \n                <span v-if="editor.IsCreateMode && createInstruction">{{createInstruction}}<\/span>                \n                <button v-if="nextEditor" type="button" class="btn btn-right" v-on:click="next" :title="nextText">\n                    <img src="/Content/img/right.svg" />\n                    <label>{{nextText}}<\/label>\n                <\/button>\n        <\/div>\n    ',methods:{previous:function(){this.navigate(this.previousEditor,!1)},next:function(){this.navigate(this.nextEditor,!0)},navigate:function(n,t){var i=this,r,u,f;this.save_then_next=!1;this.save_then_prev=!1;n&&(!this.editor.IsCreateMode||!t||this.editor.validate())&&(this.editor.HasChanges?(Messages.display(0,"Save changes","Do you want to save your changes before you continue?"),r=document.getElementById("message-content"),r.innerHTML=r.innerHTML+"<div><button id='savechanges' type='button' class='btn btn-primary'>Save changes<\/button><button id='dontsavechanges' type='button' class='btn btn-light'>Dont save<\/button><\/div>",u=document.getElementById("savechanges"),f=document.getElementById("dontsavechanges"),u.onclick=function(){i.save_then_next=n==i.nextEditor;i.save_then_prev=n==i.previousEditor;Messages.hide();i.save()},f.onclick=function(){Messages.hide();MainEditorManager.setHRID(i.editor.Facility.TitleShort,!1,!0).finally(function(){i.navigate(n)})}):(MainEditorManager.DisplayMode=EditorManagerDisplayMode.Editor,MainEditorManager.LastResult=null,this.editor.Show=!1,n.Show=!0))},save:function(){var n=this;this.emitsave?this.$emit("save"):this.editor.validate()&&(this.editor.Saving=!0,this.editor.save().then(function(){MainEditorManager.EnterCompactMode()},function(t){t.Result===EditResult.NotPublished&&MainEditorManager.setHRID(MainEditorManager.HRID,!0).then(function(){n.editor.Show=!0;MainEditorManager.LastResult=new FacilityResult({IsError:!0,Message:"The facility information was out of date and was reloaded. You may need to re-enter your changes then press the update button again."},ResultType.Update)},function(){})}).finally(function(){return n.editor.Saving=!1}))},cancel:function(){var n=this;this.editor.HasChanges?(this.editor.Saving=!0,MainEditorManager.setHRID(this.editor.Facility.TitleShort,!1,!0).finally(function(){n.editor.Saving=!1;MainEditorManager.EnterCompactMode()})):MainEditorManager.EnterCompactMode()},create:function(){this.emitcreate?this.$emit("create"):MainEditorManager.CreateNew.validate()&&(MainEditorManager.CreateNew.Saving=!0,MainEditorManager.CreateNew.save().then(function(){MainEditorManager.ShowCompetition||hidePanel("create-panel")},function(){}).finally(function(){return MainEditorManager.CreateNew.Saving=!1}))}}},heading={props:["editor"],template:'\n        <header class="facility-header">\n            <svg class="icon large facility"><use :xlink:href=\'"/Content/img/icons/icons.svg#" + editor.Facility.ActualFacilityIcon\' /><\/svg>\n            <div>\n                <h1>{{editor.Facility.Title}}<\/h1>\n                <p>{{editor.Facility.DisplayAddress}}<\/p>\n            <\/div>\n        <\/header>\n    '},subheading={props:["editor","instruction","hideheading"],template:'\n        <div>                        \n            <h2 v-if="!hideheading">{{editor.DisplayName}}<\/h2>\n            <p v-if="instruction">{{instruction}}<\/p>\n        <\/div>\n    '},editorsection={props:["editor"],components:{subheading:subheading,controls:controlrow},template:'\n        <div v-if="editor.Facility && editor.Facility.ContentID && editor.Show">\n            <component v-bind:is="editor.Template" v-bind:editor="editor"><\/component>\n            <controls :editor="editor"><\/controls>\n        <\/div>\n    '};registerpanel={props:["manager"],components:{spinnerbutton:spinnerbutton},data:function(){return{namemessage:null,passwordmessage:null,cpasswordmessage:null,emailmessage:null,registering:!1}},template:'\n        <div>\n            <div v-if="manager.Register.Success">\n                <p>A registration email has been sent to your email address. Please click on the link in the email to complete your registration.<\/p>\n            <\/div>\n            <form v-else @submit="register">\n                <form-group :id="\'Name\'" :placeholder="\'Name\'" :label="\'Name\'" :title="\'Your name\'" maxlengh="200" v-model="manager.Register.Name" :model="manager.Register" :validator="manager.Register.Validators.Name"><\/form-group>\n                <form-group :id="\'Email\'" :placeholder="\'Your email address\'" :label="\'Email address\'" :title="\'Your email address\'" v-model="manager.Register.Email" :model="manager.Register" :validator="manager.Register.Validators.Email" :type="\'email\'"><\/form-group>\n                <form-group :id="\'Password\'" :placeholder="\'Password\'" :label="\'Password\'" :title="\'Set new password\'" :hint="\'At least eight characters with one letter &amp; one number.\'" minlength="8" maxlength="100" v-model="manager.Register.Password" :model="manager.Register" :validator="manager.Register.Validators.Password" :type="\'password\'" ><\/form-group>\n                <form-group :id="\'ConfirmPassword\'" :placeholder="\'Password\'" :label="\'Confirm password\'" :title="\'Set new password\'" v-model="manager.Register.ConfirmPassword" :model="manager.Register" :validator="manager.Register.Validators.ConfirmPassword" :type="\'password\'"><\/form-group>\n\n\n                <div id="RegisterRecaptcha" class="mt-2">\n                <\/div>\n\n                <div class="buttons">\n                        <spinnerbutton v-on:click="register" :text="\'Register\'" :disabled="registering" :disabledonly="!manager.Register.CanSubmit" :isSubmit="true"><\/spinnerbutton>\n                        <button class="btn btn-light" :class="{disabled: registering}" :disabled="registering" type="button" title="Cancel" v-on:click="cancel">Cancel<\/button>\n                <\/div>\n\n                <p class="small footnote">\n                    This site is protected by reCAPTCHA and the Google\n                    <a href="https://policies.google.com/privacy" target="_blank">Privacy Policy<\/a> and\n                    <a href="https://policies.google.com/terms" target="_blank">Terms of Service<\/a> apply.\n                <\/p>\n\n            <\/form>\n        <\/div>\n    ',methods:{register:function(n){var t=this;n&&n.preventDefault();this.manager.Register.Validate()&&(this.$emit("register"),this.registering=!0,this.manager.register().then(function(){t.manager.Register.Success=!0},function(){}).finally(function(){t.registering=!1}))},cancel:function(){this.$emit("cancel");this.manager.Register.Clear()}},mounted:function(){this.manager.Register.InitialiseRecaptcha()},updated:function(){this.manager.Register.ReCaptcha||this.manager.Register.InitialiseRecaptcha()}};"use strict";var lgDisplayMode={Login:0,NeedToReConfirm:1,Reconfirmed:2,RegistrationConfirmationRequired:3,ResetRegistrationConfirmation:4,ForgotPassword:5,ForgotPasswordSuccess:6},loginpanel={props:["manager","afterlogin"],components:{spinnerbutton:spinnerbutton},data:function(){return{loggingin:!1,displayMode:lgDisplayMode.Login,lgDisplayMode:lgDisplayMode}},computed:{heading:{get:function(){var n=null;switch(this.displayMode){case lgDisplayMode.ForgotPassword:case lgDisplayMode.ForgotPasswordSuccess:n="Reset password"}return n}}},template:'\n        <div>\n            <h2 v-if="heading">{{heading}}<\/h2>\n            <form v-if="displayMode == lgDisplayMode.Login" @submit="submit" >\n                <form-group id="Login" type="email" label="Email address" placeholder="Your email address" title="Enter your email address" v-model="manager.Login.Email" :model="manager.Login" :validator="manager.Login.Validators.Email"><\/form-group>\n                <form-group id="Password" label="Password" type="password" placeholder="Your password" title="Enter your password" v-model="manager.Login.Password" :model="manager.Login" :validator="manager.Login.Validators.Password"><\/form-group>\n                \n                <div class="buttons">\n                        <spinnerbutton v-on:click="submit" text="Login" :disabled="loggingin" :isSubmit="true"><\/spinnerbutton>\n                        <button type="button" class="btn btn-light" v-on:click="StartForgotPassword" title="Forgotten your password? Then reset your password to something new.">Forgot password<\/button>\n                        <button type="button" class="btn btn-light" v-on:click="cancel" :class="{disabled: loggingin}" :disabled="loggingin" title="Cancel">Cancel<\/button>\n                <\/div>\n            <\/form>\n            <form v-if="displayMode == lgDisplayMode.ForgotPassword">\n                <p>Enter your email address below to send yourself an email with a link to reset your password.<\/p>\n                <form-group id="Login" label="Email adress" type="email" placeholder="Your email address" title="Enter your email address" v-model="manager.Login.Email" :model="manager.Login" :validator="manager.Login.Validators.Email">\n                    <template v-name="additional">\n                        <p class="text-danger" v-if="manager.LastResult && manager.LastResult.UserNotFound">Email address not found.<\/p>\n                    <\/template>\n                <\/form-group>\n                <div class="buttons">\n                    <spinnerbutton v-on:click="ForgotPassword" text="Send email" :disabled="loggingin"><\/spinnerbutton>\n                    <button type="button" class="btn btn-light" v-on:click="cancelForgotPassword" :class="{disabled: loggingin}" :disabled="loggingin" title="Cancel">Cancel<\/button>\n                <\/div>\n            <\/form>\n            <div v-if="displayMode == lgDisplayMode.ForgotPasswordSuccess">\n                <p>If an account exists for {{manager.Login.Email}}, an email will have been sent to {{manager.Login.Email}} containing a link for you to click to reset your password.<\/p>\n            <\/div>\n            <div v-if="displayMode == lgDisplayMode.Reconfirmed">\n                <p>An email has been sent to {{manager.Login.Email}} Click on the link in the email to confirm this is still your email address.<\/p>\n            <\/div>\n            <div v-if="displayMode == lgDisplayMode.NeedToReConfirm">\n                <div class="col">\n                    <p>You need to confirm your email address. An email has been sent to {{manager.Login.Email}} – please follow the instructions it contains to confirm this is still your email address.<\/p>\n                    <spinnerbutton v-on:click="reconfirm" text="Resend email" :disabled="loggingin"><\/spinnerbutton>\n                <\/div>\n            <\/div>\n            <div v-if="displayMode == lgDisplayMode.ResetRegistrationConfirmation">\n                <p>An email has been sent to your account. Click on the link in the email to complete your registration.<\/p>\n            <\/div>\n            <div v-if="displayMode == lgDisplayMode.RegistrationConfirmationRequired">\n                <p>You can not log in as your account is not yet confirmed. A confirmation email will be sent to your email address. You will need to click on the link to complete your registration. <\/p>\n                \n                <spinnerbutton v-on:click="resendConfirmation" text="Resend email" :disabled="loggingin">Resend confirmation email<\/spinnerbutton>\n                    \n            <\/div>\n        <\/div>\n    ',methods:{submit:function(n){var t=this;n&&n.preventDefault();this.manager.Login.Validate()&&(this.loggingin=!0,this.manager.login().then(function(){t.afterlogin&&t.afterlogin()},function(n){n.ReConfirmEmailSent?t.displayMode=lgDisplayMode.Reconfirmed:n.ReConfirmEmail?t.displayMode=lgDisplayMode.NeedToReConfirm:n.NeedToCompleteRegistration&&(t.displayMode=lgDisplayMode.RegistrationConfirmationRequired)}).finally(function(){t.loggingin=!1}))},cancel:function(){this.$emit("cancel");this.manager.Login.Clear()},StartForgotPassword:function(){this.displayMode=lgDisplayMode.ForgotPassword},ForgotPassword:function(){var n=this;this.manager.Login.Validators.Email.Validate(this.manager.Login).Success&&(this.loggingin=!0,this.manager.forgotPassword().then(function(){n.displayMode=lgDisplayMode.ForgotPasswordSuccess},function(){}).finally(function(){n.loggingin=!1}))},cancelForgotPassword:function(){this.displayMode=lgDisplayMode.Login},reconfirm:function(){var n=this;this.loggingin=!0;this.manager.reconfirm().then(function(){},function(t){t.ReConfirmEmailSent?n.displayMode=lgDisplayMode.Reconfirmed:t.ReConfirmEmail&&(n.displayMode=lgDisplayMode.NeedToReConfirm)}).finally(function(){n.loggingin=!1})},resendConfirmation:function(){var n=this;this.loggingin=!0;this.manager.resendconfirm().then(function(){n.displayMode=lgDisplayMode.ResetRegistrationConfirmation},function(){}).finally(function(){n.loggingin=!1})}}},changeEmailPanel={props:["manager"],components:{spinnerbutton:spinnerbutton},data:function(){return{running:!1,done:!1,modes:AccountDisplayMode}},template:'\n        <div>\n            <h3>Change email address<\/h3>\n            <div v-if="done">\n                <p>A confirmation email has been sent to your new email address, click on the link to complete the change.<\/p>\n                <p>An email has also been sent to the old address notifying of the change.<\/p>\n                <div class="buttons">\n                    <button type="button" class="btn btn-primary" v-on:click="close">Close<\/button>\n                <\/div>\n            <\/div>\n            <form v-else @submit="changeemail">\n                <form-group id="Login" type="email" label="New email address" placeholder="Your email address" title="Enter your email address" v-model="manager.Email.Email" :model="manager.Email" :validator="manager.Email.Validators.Email"><\/form-group>                \n\n                <div class="buttons">\n                    <spinnerbutton v-on:click="changeemail" text="Change email" :disabled="running" :isSubmit="true"><\/spinnerbutton>\n                    <button class="btn btn-light" :class="{disabled: running}" :disabled="running" type="button" title="Cancel" v-on:click="cancel">Cancel<\/button>\n                <\/div>\n            <\/form>\n        <\/div>\n    ',methods:{changeemail:function(n){var t=this;n&&n.preventDefault();this.manager.Email.Validate()&&(this.running=!0,this.manager.changeEmail().then(function(){t.done=!0},function(){}).finally(function(){return t.running=!1}))},cancel:function(){this.manager.DisplayMode=this.modes.MyAccount},close:function(){hidePanel("account-panel")}}},changePasswordPanel={props:["manager"],components:{spinnerbutton:spinnerbutton},data:function(){return{running:!1,done:!1,modes:AccountDisplayMode}},template:'\n        <div>\n            <h3>Change password<\/h3>\n            <div v-if="done">\n                <p>Your password has been changed.<\/p>\n                <div class="buttons">\n                    <button type="button" class="btn btn-primary" v-on:click="close">Close<\/button>\n                <\/div>\n            <\/div>\n            <form v-else @submit="submit">\n                <form-group id="Password" type="password" label="Current password" placeholder="Your password" title="Enter your password" v-model="manager.ChangePassword.Password" :model="manager.ChangePassword" :validator="manager.ChangePassword.Validators.Password"><\/form-group>\n                <form-group id="NewPassword" type="password" label="New password" placeholder="New password" title="Enter your new password" v-model="manager.ChangePassword.NewPassword" :model="manager.ChangePassword" :validator="manager.ChangePassword.Validators.NewPassword"><\/form-group>\n                <form-group id="ConfirmPassword" type="password" label="Re-enter password" placeholder="Re-enter password" title="Enter your new password in again" v-model="manager.ChangePassword.ConfirmPassword" :model="manager.ChangePassword" :validator="manager.ChangePassword.Validators.ConfirmPassword"><\/form-group>\n                \n                <div class="buttons">\n                        <spinnerbutton v-on:click="submit" :text="\'Change password\'" :disabled="running" :isSubmit="true"><\/spinnerbutton>\n                        <button type="button" class="btn btn-light" v-on:click="cancel" :class="{disabled: running}" :disabled="running" title="Cancel">Cancel<\/button>\n                <\/div>\n            <\/form>\n        <\/div>\n    ',methods:{submit:function(n){var t=this;n&&n.preventDefault();this.manager.ChangePassword.Validate()&&(this.running=!0,this.manager.changePassword().then(function(){t.done=!0},function(){}).finally(function(){return t.running=!1}))},cancel:function(){this.manager.DisplayMode=this.modes.MyAccount},close:function(){hidePanel("account-panel")}}},deleteUserPanel={props:["manager"],components:{spinnerbutton:spinnerbutton},data:function(){return{running:!1,done:!1,modes:AccountDisplayMode}},template:'\n        <div>\n            <h3>Delete account<\/h3>\n            <div v-if="done">\n                <p>Your account has been successfully deleted.<\/p>\n                <div class="buttons">\n                    <button type="button" class="btn btn-primary" v-on:click="close">Close<\/button>\n                <\/div>\n            <\/div>\n            <form v-else @submit="submit">\n\n                <p>Deleting your account will permanently remove your login details from the National Public Toilet Map.<\/p>\n                <p>Any toilets added or updated will not be deleted.<\/p>\n                \n                <div class="buttons">\n                        <spinnerbutton v-on:click="submit" :text="\'Delete account\'" :disabled="running" :isSubmit="true"><\/spinnerbutton>\n                        <button type="button" class="btn btn-light" v-on:click="cancel" :class="{disabled: running}" :disabled="running" title="Cancel">Cancel<\/button>\n                <\/div>\n            <\/form>\n        <\/div>\n    ',methods:{submit:function(n){var t=this;n&&n.preventDefault();this.running=!0;this.manager.deleteUser().then(function(){t.done=!0},function(){}).finally(function(){return t.running=!1})},cancel:function(){this.manager.DisplayMode=this.modes.MyAccount},close:function(){hidePanel("account-panel")}}},accountPanel={props:["manager"],components:{login:loginpanel,register:registerpanel,changepassword:changePasswordPanel,changeemail:changeEmailPanel,deleteuser:deleteUserPanel},data:function(){return{modes:AccountDisplayMode,editorManager:MainEditorManager,agencySelect:new AutoComplete({URL:"/api/FacilityEditor/FindAgencies",CreateSuggestion:function(n){return new AutoCompleteSuggestion(n.AgencyID,n.Title)}})}},computed:{heading:{get:function(){var n="My Account";switch(this.manager.DisplayMode){case AccountDisplayMode.Register:n="Register";this.manager.Register.Success&&(n="Registration");break;case AccountDisplayMode.Unauthorised:case AccountDisplayMode.Login:n="Login"}return n}}},template:'\n        <div>\n            <button draggable="false" title="Close" aria-label="Close" type="button" class="panel-close-button" v-on:click="cancel">&#10006<\/button>\n            <h1>{{heading}}<\/h1>\n            <div v-if="manager.DisplayMode == modes.MyAccount">\n                <p>You can manage your account details from here.<\/p>\n                <div class="buttons">\n                    <button type="button" class="btn btn-primary" v-on:click="startChangePassword">Change password<\/button>\n                    <button type="button" class="btn btn-primary" v-on:click="startChangeEmail">Change email address<\/button>\n                    <button type="button" class="btn btn-primary" v-on:click="startDelete">Delete account<\/button>\n                    <button type="button" class="btn btn-primary" v-on:click="logout">Logout<\/button>\n                <\/div>\n                <div v-if="editorManager.UserInfo && (editorManager.UserInfo.IsAProvider || editorManager.UserInfo.IsAdmin)">\n                    <p>See toilets I manage for<\/p>\n                    <div v-if="editorManager.UserInfo.CanUseSystem" class="providerselection">\n                        <auto-complete v-if="agencySelect" :autocomplete="agencySelect"><\/auto-complete>\n                        <a v-if="agencySelect && agencySelect.Selection" target="_blank" :href="\'/Provider/\' + agencySelect.Selection.ID">{{agencySelect.Selection.Text}}<\/a>\n                    <\/div>\n                    <ul v-else>\n                        <li v-for="agency in editorManager.UserInfo.ProviderAgencies">\n                            <a target="_blank" :href="\'/Provider/\' + agency.AgencyID">{{agency.Title}}<\/a>\n                        <\/li>\n                    <\/ul>\n                <\/div>\n            <\/div>\n            <div v-if="manager.DisplayMode == modes.Unauthorised">\n                <p>Register or login to update facility information and share maps on the National Public Toilet Map.<\/p>\n                <div class="buttons">\n                        <button type="button" class="btn btn-primary" v-on:click="login">Login<\/button>\n                        <button type="button" class="btn btn-primary" v-on:click="register">Register<\/button>\n                <\/div>\n            <\/div>\n            <login v-if="manager.DisplayMode == modes.Login" :manager="manager" v-on:loggin="loggedIn" v-on:cancel="cancelLogin"><\/login>\n            <register v-if="manager.DisplayMode == modes.Register" :manager="manager" v-on:cancel="cancelRegister"><\/register>\n            <changepassword v-if="manager.DisplayMode == modes.ChangePassword" :manager="manager"><\/changepassword>\n            <changeemail v-if="manager.DisplayMode == modes.ChangeEmail" :manager="manager"><\/changeemail>\n            <deleteuser v-if="manager.DisplayMode == modes.DeleteUser" :manager="manager"><\/deleteuser>\n        <\/div>\n    ',methods:{login:function(){this.manager.DisplayMode=this.modes.Login},register:function(){this.manager.DisplayMode=this.modes.Register},loggedIn:function(){this.manager.DisplayMode=this.modes.MyAccount},cancelLogin:function(){this.manager.DisplayMode=this.modes.Unauthorised},cancelRegister:function(){this.manager.DisplayMode=this.modes.Unauthorised},logout:function(){this.manager.LogOut().then(function(){},function(){})},startChangePassword:function(){this.manager.DisplayMode=this.modes.ChangePassword},startChangeEmail:function(){this.manager.DisplayMode=this.modes.ChangeEmail},startDelete:function(){this.manager.DisplayMode=this.modes.DeleteUser},cancel:function(){hidePanel("account-panel")}}};"use strict";var resultmessage={props:["result"],template:'\n        <div>\n            <p v-if="result.IsError" class="text-danger">{{result.Message}}<\/p>\n            <p v-if="result.IsSuccess && result.Message" class="text-success">{{result.Message}}<\/p>\n            <ul v-if="result.ValidationErrors" class="text-danger">\n                <li v-for="ve in result.ValidationErrors">{{ve}}<\/li>\n            <\/ul>\n        <\/div>\n    '},unauthorisedpanel={props:["manager"],template:'\n        <div>\n            <h1 v-if="manager.CreateMode">Create a new facility<\/h1>\n            <h1 v-else>Update facility<\/h1>\n            <p v-if="manager.CreateMode">You must login or register before you can create a new facility.<\/p>\n            <p v-else>You must login or register before you can update Toilet Map information, or you can just let us know what\'s missing, incorrect or inadequate in the information we provide.<\/p>\n            <div class="buttons">\n                <button type="button" class="btn btn-primary" v-on:click="login">Login<\/button>\n                <button type="button" class="btn btn-primary" v-on:click="register">Register<\/button>\n                <button v-if="!manager.CreateMode" type="button" class="btn btn-primary" v-on:click="letusknow">Let us know<\/button>            \n            <\/div>\n        <\/div>\n    ',methods:{login:function(){this.manager.DisplayMode=EditorManagerDisplayMode.Login},register:function(){this.manager.DisplayMode=EditorManagerDisplayMode.Register},letusknow:function(){this.manager.LaunchLetUsKnow()}}},letusknow={props:["editor"],components:{note:notefield,subheading:subheading,controls:controlrow},template:'\n        <div class="letusknow" v-if="editor.Facility && editor.Show">\n            <subheading :editor="editor"><\/subheading>\n            <note v-model="editor.Facility.LetUsKnow.Message" watermark="What\'s missing, incorrect or inadequate in the information we provide." maxlength="1000"><\/note>\n            <validationmessage :validator="editor.Validators.LetUsKnowNote" :mainmodel="editor.Facility" v-model="editor.Facility.LetUsKnow.Message"><\/validationmessage>\n            <div v-if="!editor.UserInfo">\n                <div id="LetUsKnowRecaptcha">\n                <\/div>\n            <\/div>\n            <controls :editor="editor" :updatetext="editor.DisplayName" :emitsave="true" v-on:save="save" :nocancel="true"><\/controls>\n            <p v-if="!editor.UserInfo" class="small">\n                This site is protected by reCAPTCHA and the Google\n                <a href="https://policies.google.com/privacy" target="_blank">Privacy Policy<\/a> and\n                <a href="https://policies.google.com/terms" target="_blank">Terms of Service<\/a> apply.\n            <\/p>\n        <\/div>\n    ',methods:{save:function(){var n=this;this.editor.validate()&&(this.editor.Saving=!0,this.editor.save().then(function(t){t.RecaptchaResult?n.editor.Facility.LetUsKnow.ReCaptcha.HandleVerifyResult(t.RecaptchaResult,function(){hidePanel("editors-panel");MainEditorManager.LastResult.Type=ResultType.LetUsKnow;resultMessage(MainEditorManager.LastResult)},t):hidePanel("editors-panel")},function(t){t.RecaptchaResult&&n.editor.Facility.LetUsKnow.ReCaptcha.HandleVerifyResult(t.RecaptchaResult,null,t)}).finally(function(){return n.editor.Saving=!1}))}},mounted:function(){this.editor.UserInfo||this.editor.Facility.LetUsKnow.InitialiseRecaptcha()},updated:function(){this.editor.UserInfo||this.editor.Facility.LetUsKnow.ReCaptcha||this.editor.Facility.LetUsKnow.InitialiseRecaptcha()}},letusknowsummary={props:["editor","pfacility"],template:'\n        <p class="mb-0">If it doesn’t fit in one of the above, just <a href="#" @click.prevent="click">Let us know<\/a> what needs updating.<\/p>\n    ',methods:{click:function(){MainEditorManager.EnterDetailsMode();this.editor.Show=!0}}},compentry={props:["competition"],components:{spinnerbutton:spinnerbutton},data:function(){return{etext:"Enter competition",dtext:"Don't enter competition"}},template:'\n        <div>\n            <button draggable="false" title="Close" aria-label="Close" type="button" class="panel-close-button" v-on:click="cancel">&#10006<\/button>\n            <h1>{{competition.Competition.Title}}<\/h1>\n            <div v-html="competition.Competition.Description"><\/div>\n            <label><input type="checkbox" v-model="competition.TermsAccepted" class="mr-2"><\/input>I accept all terms and conditions<\/label>\n            <div>\n                <spinnerbutton :text="etext" v-on:click="enter" :disabled="competition.Accepting" :disabledonly="!competition.TermsAccepted || competition.Refusing"><\/spinnerbutton>\n                <spinnerbutton :text="dtext" v-on:click="refuse" :disabled="competition.Refusing" :disabledonly="competition.Accepting"><\/spinnerbutton>\n            <\/div>\n            \n        <\/div>\n    ',methods:{enter:function(){this.competition.EnterCompetition()},refuse:function(){this.competition.RefuseCompetition()},cancel:function(){MainEditorManager.CompetitionInformation=null;hidePanel(app.currentPanel)}}},managerpanel={props:["manager","pfacility"],components:{heading:heading,unauthorised:unauthorisedpanel,login:loginpanel,register:registerpanel,result:resultmessage,letusknow:letusknow,note:notefield,spinnerbutton:spinnerbutton,compentry:compentry},data:function(){return{accounts:app.accountmanager,deleting:!1,updateloading:!1}},template:'\n        <compentry v-if="manager.ShowCompetition" :competition="manager.CompetitionInformation" :pfacility="pfacility"><\/compentry>\n        <div v-else>\n            <button draggable="false" title="Close" aria-label="Close" type="button" class="panel-close-button" v-on:click="cancel">&#10006<\/button>\n            <div v-if="manager.Loading">\n                <div class="spinner">\n                <\/div>\n            <\/div>\n            <div v-else-if="manager.CreateMode && manager.UserInfo != null && (!manager.UserInfo.HasDefaultAgency && !manager.UserInfo.CanUseSystem)">\n                <p>Your account lacks the create facility rights. Contact the helpdesk to gain the Crowdsource role.<\/p>\n            <\/div>\n            <div v-else-if="manager.ShowDelete">\n                <h1>Delete facility<\/h1>\n                <div v-if="manager.UserInfo.HasDeleteRights(manager.Facility.AgencyID)">\n                    <div v-if="manager.DeleteModel">\n                        <div class="card text-white bg-danger">\n                            <div class="card-body">\n                                <p class="card-text">Deleting this facility will remove it from the National Public Toilet Map permanently. If you just want to close this facility, press \'Update facility\', update the opening hours section and set the \'Closed temporarily\' check box then press \'Update\'. Are you sure you want to delete this facility?<\/p>\n                            <\/div>\n                        <\/div>\n                        <note v-model="manager.DeleteModel.Reason" :maxlength="1000" :title="\'Reason\'" :watermark="\'Please provide a reason for removing this Facility of at least 7 characters.\'"><\/note>\n                        <validationmessage v-model="manager.DeleteModel.Reason" :validator="manager.DeleteModel.Validators.Reason" :mainmodel="manager.DeleteModel"><\/validationmessage>\n                        <div class="buttons">\n                            <spinnerbutton :text="\'Delete\'" v-on:click="deleteFacility" :disabled="deleting" :disabledonly="updateloading"><\/spinnerbutton>\n                            <spinnerbutton :text="\'Update facility\'" v-on:click="updateFacility_OH" :disabled="updateloading" :disabledonly="deleting"><\/spinnerbutton>\n                            <button type="button" class="btn btn-light" v-on:click="cancelDelete">Cancel<\/button>\n                        <\/div>\n                    <\/div>\n                <\/div>\n                <div v-else>\n                    <p>You don\'t have the rights to delete this facility.<\/p>\n                    <div class="buttons">\n                        <button type="button" class="btn btn-light" v-on:click="cancelDelete">Cancel<\/button>\n                    <\/div>\n\n                <\/div>\n            <\/div\n            <div v-else>                \n                <heading v-if="manager.Facility && (manager.ShowEditors || manager.ShowSummaries || manager.ShowLetUsKnow ) && manager.AnyEditorsShowing" v-bind:editor="manager"><\/heading>\n                <div v-if="manager.Facility && manager.ShowSummaries && !manager.AnyEditorsShowing">\n                    <h1>Update facility<\/h1>\n                    <p>Tap a panel to edit that section<\/p>\n                <\/div>\n                <unauthorised v-if="manager.ShowUnauthorised" v-bind:manager="manager"><\/unauthorised>\n                <h1 v-if="manager.ShowLogin">Login<\/h1>\n                <login v-if="manager.ShowLogin" v-bind:manager="accounts" v-on:Login="loggedin" :afterlogin="loggedin" v-on:cancel="cancelLogin"><\/login>\n                <h1 v-if="manager.ShowRegister">Register<\/h1>\n                <register v-if="manager.ShowRegister" v-bind:manager="accounts" v-on:cancel="cancelRegister"><\/register>\n                <div v-if="(manager.ShowEditors || manager.ShowSummaries ) && manager.UserInfo !== null">\n                    <div v-if="manager.CreateMode && ((manager.UserInfo.Agencies.length>1 && manager.UserInfo.HasDefaultAgency) || manager.UserInfo.CanUseSystem) && manager.Editors[0].Show">\n                        <p>Which provider are you creating this facility for?<\/p>\n                        <div class="form-group">\n                            <label for="Provider">Provider<\/label>\n                            <select v-if="manager.UserInfo.Agencies.length>1" id="Provider" v-model="manager.Facility.AgencyID" class="form-control">\n                                    <option v-for="a in manager.UserInfo.Agencies" :key="a.AgencyID" v-if="a.Title != \'SYSTEM\'" :value="a.AgencyID">{{a.Title}}<\/option>\n                            <\/select>\n                            <auto-complete v-else :autocomplete="manager.AgencyAutoComplete" :validator="manager.Address.Validators.Agency"><\/auto-complete>\n                            <validationmessage :validator="manager.Address.Validators.Agency" :mainmodel="manager.Facility" v-model="manager.Facility.AgencyID"><\/validationmessage>\n                        <\/div>\n                    <\/div>\n                    <component v-for="editor in manager.Editors" :key="editor.Name" v-if="editor.CanUseStandard" v-bind:is="editor.Template" v-bind:editor="editor"><\/component>\n                    <component v-for="editor in manager.Editors" :key="editor.Name+\'_Compact\'" v-if="editor.CanUseCompact" v-bind:is="editor.CompactTemplate" v-bind:editor="editor" :pfacility="pfacility"><\/component>\n                    <validationmessage v-if="manager.CreateMode" :validator="manager.CreateNew.Validators.AllValidators"><\/validationmessage>                    \n                    <div v-if="manager.CanPublish && manager.IsCompactMode" class="buttons">\n                        <spinnerbutton v-on:click="publish" type="button" :text="\'Publish now\'" :disabled="manager.Publishing" :disabledonly="!manager.ItemsToPublish"><\/spinnerbutton>\n                        <spinnerbutton v-on:click="showtobepublished" type="button" :text="\'Show awaiting publish\'" :islight="true" :disabled="manager.FetingPublishItems" :disabledonly="!manager.ItemsToPublish"><\/spinnerbutton>\n                    <\/div>\n                    <div v-if="manager.CanPublish && manager.IsCompactMode && manager.ItemsAwaitingPublish.length>0" class="card">\n                        <div class="card-header">\n                            Awaiting publish\n                        <\/div>\n                        <div class="list-group list-group-flush">\n                            <a v-for="p in manager.ItemsAwaitingPublish" class="list-group-item list-group-item-action" :href="\'../Facility/\'+p.ID" target="_blank">{{p.Title}}<\/a>\n                        <\/div>\n                    <\/div>\n                    <p v-if="manager.Facility && !manager.UserInfo.HasEditRights(manager.Facility.AgencyID)">Unfortunately you do not have permission to edit this facility. Contact the help desk to enable crowdsource on your account.<\/p>\n                <\/div>\n                <div v-else-if="manager.ShowLetUsKnow"><letusknow :editor="manager.LetUsKnow"><\/letusknow><\/div>         \n            <\/div>\n        <\/div>\n        \n    ',methods:{cancel:function(){var n=this,t,i,r;this.manager.CurrentEditor&&this.manager.CurrentEditor.HasChanges?(Messages.display(0,"Save changes","Do you want to save your changes before you continue?"),t=document.getElementById("message-content"),t.innerHTML=t.innerHTML+"<div><button id='savechanges' type='button' class='btn btn-primary'>Save changes<\/button><button id='dontsavechanges' type='button' class='btn btn-light'>Dont save<\/button><\/div>",i=document.getElementById("savechanges"),r=document.getElementById("dontsavechanges"),i.onclick=function(){Messages.hide();n.manager.CurrentEditor.Saving=!0;n.manager.CurrentEditor.save().then(function(){hidePanel(app.currentPanel)},function(){}).finally(function(){n.manager.CurrentEditor.Saving=!1})},r.onclick=function(){Messages.hide();n.manager.setHRID(n.manager.Facility.TitleShort,!1,!0).finally(function(){hidePanel(app.currentPanel)})}):hidePanel(app.currentPanel)},loggedin:function(){var n=this;this.manager.CreateMode?this.manager.EnterCreateMode().then(function(){},function(t){t&&t.status===401&&(n.manager.DisplayMode=EditorManagerDisplayMode.Unauthorised,n.manager.UserInfo=null)}):(this.manager.DisplayMode=EditorManagerDisplayMode.Summary,this.manager.setHRID(app.selectedFacility.id).then(function(){},function(){}))},cancelLogin:function(){this.manager.DisplayMode=EditorManagerDisplayMode.Unauthorised},cancelRegister:function(){this.manager.DisplayMode=EditorManagerDisplayMode.Unauthorised},cancelDelete:function(){showPanel("details-panel")},updateFacility_OH:function(){var n=this;this.updateloading=!0;this.manager.setHRID(app.selectedFacility.id).then(function(){n.manager.EnterCompactMode();n.manager.EnterDetailsMode();n.manager.OpeningHours.Show=!0},function(){}).finally(function(){n.updateloading=!1})},deleteFacility:function(){var n=this;this.manager.DeleteModel.Validate()&&(this.deleting=!0,this.manager.delete().then(function(){hidePanel("editors-panel")},function(){}).finally(function(){n.deleting=!1}))},publish:function(){this.manager.publish()},showtobepublished:function(){this.manager.getItemsAwaitingPublish().finally(function(){document.getElementById("editors-panel").firstChild.scrollTop=document.getElementById("editors-panel").firstChild.scrollHeight})}},updated:function(){this.manager.anythingToPublish()},mounted:function(){this.manager.anythingToPublish()}};amenitiespanel={components:{icon:iconswitchrow,controls:controlrow,subheading:subheading},props:["editor"],template:'\n        <div class="editor-section">\n            <subheading v-bind:editor="editor"><\/subheading>\n            <section>\n                <div class="icon-list">\n                    <icon v-bind:name="\'Sharps\'" v-bind:display="\'Sharps disposal\'" v-bind:icon="\'sharps-disposal\'" v-model="editor.Facility.IsSharpsDisposal"><\/icon>\n                    <icon v-bind:name="\'Showers\'" v-bind:display="\'Showers\'" v-bind:icon="\'showers\'" v-model="editor.Facility.IsShower"><\/icon>\n                    <icon v-bind:name="\'Sanitary\'" v-bind:display="\'Sanitary disposal\'" v-bind:icon="\'sanitary-disposal\'" v-model="editor.Facility.IsSanitaryDisposal"><\/icon>\n                    <icon v-bind:name="\'MensPads\'" v-bind:display="\'BINS4Blokes\'" v-bind:icon="\'mens-pads\'" v-model="editor.Facility.IsMensPadDisposal"><\/icon>\n                    <icon v-bind:name="\'Water\'" v-bind:display="\'Drinking water\'" v-bind:icon="\'drinking-water\'" v-model="editor.Facility.IsDrinkingWater"><\/icon>  \n                <\/div>\n            <\/section>\n            <controls v-bind:editor="editor"><\/controls>\n        <\/div>\n    '};amenitiessummary={props:["editor","pfacility"],components:{Amenities:DetailsAmenitiesList},computed:{enabled:{get:function(){return this.editor.Facility.AmenitiesStatus===ContentStatus.Published}},updateText:{get:function(){return this.editor.UpdateLinkText(this.editor.Facility.AmenitiesStatus,[this.editor.Facility.AmenitiesID])}},pretendFacility:{get:function(){return{isDrinkingWater:this.editor.Facility.IsDrinkingWater,isSharpsDisposal:this.editor.Facility.IsSharpsDisposal,isShowers:this.editor.Facility.IsShower,isSanitaryDisposal:this.editor.Facility.IsSanitaryDisposal,isMensPadDisposal:this.editor.Facility.IsMensPadDisposal}}}},template:'\n        <div class="index-section" :class="{\'index-section-enabled\': enabled, \'index-section-disabled\': !enabled}" v-on:click="click" tabindex="0" v-on:keyup.enter="click">\n            <h2 class="float-right text-danger">{{updateText}}<\/h2>\n            <Amenities :facility="pretendFacility" :alwaysShow="true"><\/Amenities>\n        <\/div>\n    ',methods:{click:function(){this.enabled&&(MainEditorManager.EnterDetailsMode(),this.editor.Show=!0)}}};accesspanel={components:{icon:iconswitch,iconrow:iconswitchrow,note:notefield,controls:controlrow,subheading:subheading},props:["editor"],template:'\n        <div class="editor-section">\n            <subheading v-bind:editor="editor"><\/subheading>\n            <section>\n                <div class="icon-list">\n                    <icon v-bind:display="\'Parking\'" v-bind:icon="\'parking\'" v-model="editor.Facility.IsParking"><\/icon>\n                    <icon v-bind:display="\'Accessible parking\'" v-bind:icon="\'accessible-parking\'"  v-model="editor.Facility.IsParkingAccessible"><\/icon>\n                <\/div>  \n                <note v-if="!editor.IsCrowdsource" v-model="editor.Facility.ParkingNote" :validator="editor.Validators.ParkingNote" :mainmodel="editor.Facility" v-bind:tooltip="\'Enter a parking note.\'" v-bind:watermark="\'A note about the parking\'" v-bind:maxlength="300" title="Parking note:"><\/note>\n                <p v-else>{{editor.Facility.ParkingNote}}<\/p>\n            <\/section>\n            <section>\n                <div class="icon-list">                    \n                    <icon v-bind:display="\'Key required\'" v-bind:icon="\'key\'" v-model="editor.Facility.IsKeyRequired_GS" ><\/icon>\n                    <icon v-bind:display="\'MLAK key\'" v-bind:icon="\'mlak\'" v-model="editor.Facility.IsMLAKKey_GS" ><\/icon>\n                    <icon v-bind:display="\'MLAK after hours\'" v-bind:icon="\'mlak-after-hours\'" v-model="editor.Facility.IsMLAKAfterHours_GS" ><\/icon>\n                    <icon v-bind:display="\'Charges apply\'" v-bind:icon="\'payment\'" v-model="editor.Facility.IsPaymentRequired"><\/icon>\n                <\/div>\n                <note v-if="!editor.IsCrowdsource" v-model="editor.Facility.AccessNote" v-bind:tooltip="\'Enter an access note.\'" :validator="editor.Validators.AccessNote" :mainmodel="editor.Facility" v-bind:watermark="\'A note about where to get the key or where to pay\'" v-bind:maxlength="300" title="Access note:"><\/note>\n                <p v-else>{{editor.Facility.AccessNote}}<\/p>\n                <note v-if="editor.IsCrowdsource" v-model="editor.Facility.AccessAndParkingNote" v-bind:tooltip="\'Enter an access note.\'" :validator="editor.Validators.AccessAndParkingNote" :mainmodel="editor.Facility" v-bind:watermark="\'Notes about parking or where to get the key\'" :maxlength="300" title="Suggested updates:"><\/note>\n            <\/section>\n            <controls v-bind:editor="editor" :createInstruction="\'When is the facility open?\'"><\/controls>\n        <\/div>\n    '};accesssummary={props:["editor","pfacility"],components:{Access:DetailsAccessList},computed:{enabled:{get:function(){return this.editor.Facility.AccessStatus===ContentStatus.Published}},updateText:{get:function(){return this.editor.UpdateLinkText(this.editor.Facility.AccessStatus,[this.editor.Facility.AccessID])}},pretendFacility:{get:function(){return{isParking:this.editor.Facility.IsParking,isParkingAccessible:this.editor.Facility.IsParkingAccessible,isPaymentRequired:this.editor.Facility.IsPaymentRequired,isKeyRequired:this.editor.Facility.IsKeyRequired,isMLAKAfterHours:this.editor.Facility.IsMLAKAfterHours,isMLAKKey:this.editor.Facility.IsMLAKKey,accessNote:this.editor.Facility.AccessNote,parkingNote:this.editor.Facility.ParkingNote}}}},template:'\n        <div class="index-section" :class="{\'index-section-enabled\': enabled, \'index-section-disabled\': !enabled}" v-on:click="click" tabindex="0" v-on:keyup.enter="click">\n            <h2 class="float-right text-danger">{{updateText}}<\/h2>\n            <Access :facility="pretendFacility" :onlyAccess="true"><\/Access>\n        <\/div>\n    ',methods:{click:function(){this.enabled&&(MainEditorManager.EnterDetailsMode(),this.editor.Show=!0)}}};"use strict";var iconheading={props:["value","icon","heading"],components:{Icon:Icon},computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},template:'\n        <div class="header-button"><button type="button" v-on:click="click"><icon :icon-type="icon" :is-disabled="!value"><\/icon><span>{{heading}}<\/span><\/button><\/div>\n    ',methods:{click:function(){this.myValue=!(this.value===null?!1:this.value)}}},toiletssection={props:["editor"],components:{heading:iconheading,note:notefield,icon:iconswitch,iconrow:iconswitchrow},data:function(){for(var t=[{text:"Pre-2010",value:2009}],i=new Date,n=2010;n<=i.getFullYear();n++)t.push({text:n,value:n});return{years:t,standard:this.editor.Facility.IsPre2010_Toilet?"Pre 2010":this.editor.Facility.IsAS1428_Toilet?"AIS 1428":this.editor.Facility.IsBCA2020_Toilet?"BCA 2020":"unknown"}},template:'\n        <div>\n            <heading v-model="editor.Facility.IsToilet_GS" :icon="\'toilet\'" :heading="\'Toilets\'"><\/heading>\n            <section v-if="editor.Facility.IsToilet" class="dependency">\n                <div class="icon-list">\n                    <icon v-bind:display="\'Accessible facilities\'" v-bind:icon="\'accessible\'" v-model="editor.Facility.IsAccessible_GS"><\/icon>\n                    <icon v-bind:display="\'Left hand transfer\'" v-bind:icon="\'lh-transfer\'" v-model="editor.Facility.IsLHTransfer" :disabled="!editor.Facility.IsAccessible"><\/icon>\n                    <icon v-bind:display="\'Male toilet\'" v-bind:icon="\'male\'" v-model="editor.Facility.IsMale_GS"><\/icon>\n                    <icon v-bind:display="\'Right hand transfer\'" v-bind:icon="\'rh-transfer\'" v-model="editor.Facility.IsRHTransfer" :disabled="!editor.Facility.IsAccessible"><\/icon>\n                    <icon v-bind:display="\'Female toilet\'" v-bind:icon="\'female\'" v-model="editor.Facility.IsFemale_GS"><\/icon>\n                    <icon v-bind:display="\'Ambulant\'" v-bind:icon="\'ambulant\'" v-model="editor.Facility.IsAmbulant"><\/icon>\n                    <icon v-bind:display="\'Unisex toilet\'" v-bind:icon="\'unisex\'" v-model="editor.Facility.IsUnisex_GS"><\/icon>\n                    <icon v-bind:display="\'All gender toilet\'" v-bind:icon="\'inclusive\'" v-model="editor.Facility.IsInclusive_GS"><\/icon>\n                <\/div>\n\n                <div v-if="editor.IsTrusted || editor.IsProvider" class="form-horizontal">\n                    <label for="lastrenovation">Last renovation<\/label>\n                    <select id="lastrenovation" class="form-control" v-model="editor.Facility.Year_Toilet" v-on:change="yearchanged">\n                        <option v-for="year in years" v-bind:value="year.value">{{year.text}}<\/option>\n                    <\/select>\n                    <label>{{standard}}<\/label>\n                <\/div>\n\n                <note v-if="editor.IsTrusted || editor.IsProvider" v-model="editor.Facility.ToiletNote" :validator="editor.Validators.ToiletNote" :mainmodel="editor.Facility" :maxlength="300" :watermark="\'Notes about these toilets.\'" title="Toilet notes:"><\/note>\n                <p v-else>{{editor.Facility.ToiletNote}}<\/p>\n            <\/section>\n        <\/div>\n    ',methods:{yearchanged:function(){this.editor.Facility.IsBCA2020_Toilet=this.editor.Facility.Year_Toilet===2020;this.editor.Facility.IsAS1428_Toilet=this.editor.Facility.Year_Toilet<2020&&this.editor.Facility.Year_Toilet>=2010;this.editor.Facility.IsPre2010_Toilet=this.editor.Facility.Year_Toilet<2010;this.standard=this.editor.Facility.IsPre2010_Toilet?"Pre 2010":this.editor.Facility.IsAS1428_Toilet?"AIS 1428":this.editor.Facility.IsBCA2020_Toilet?"BCA 2020":"unknown"}}},facilitiessection={props:["editor"],components:{heading:iconheading,note:notefield,icon:iconswitch},template:'\n        <div v-if="editor.IsCrowdsource">\n            <section>\n                <div class="icon-list">\n                    <icon v-bind:display="\'Accessible facilities\'" v-bind:icon="\'accessible\'" v-model="editor.Facility.IsAccessible_GS"><\/icon>\n                    <icon v-bind:display="\'Adult change\'" v-bind:icon="\'adult-change\'" v-model="editor.Facility.IsAdultChange_GS"><\/icon>\n                    <icon v-bind:display="\'Male toilet\'" v-bind:icon="\'male\'" v-model="editor.Facility.IsMale_GS"><\/icon>\n                    <icon v-bind:display="\'Adult change shower\'" v-bind:icon="\'showers\'" v-model="editor.Facility.IsACShower" :disabled="!editor.Facility.IsAdultChange"><\/icon>\n                    <icon v-bind:display="\'Female toilet\'" v-bind:icon="\'female\'" v-model="editor.Facility.IsFemale_GS"><\/icon>\n                    <icon v-bind:display="\'BYO sling\'" v-bind:icon="\'byo-sling\'" v-model="editor.Facility.IsBYOSling" :disabled="!editor.Facility.IsAdultChange"><\/icon>\n                    <icon v-bind:display="\'Unisex toilet\'" v-bind:icon="\'unisex\'" v-model="editor.Facility.IsUnisex_GS"><\/icon>\n                    <icon v-bind:display="\'Baby change\'" v-bind:icon="\'baby-change\'" v-model="editor.Facility.IsBabyChange"><\/icon>\n                    <icon v-bind:display="\'All gender toilet\'" v-bind:icon="\'inclusive\'" v-model="editor.Facility.IsInclusive_GS"><\/icon>\n                    <icon v-bind:display="\'Dump point\'" v-bind:icon="\'dump-point\'" v-model="editor.Facility.IsDumpPoint_GS"><\/icon>\n                    <icon v-bind:display="\'Left hand transfer\'" v-bind:icon="\'lh-transfer\'" v-model="editor.Facility.IsLHTransfer" :disabled="!editor.Facility.IsAccessible"><\/icon>\n                    <icon v-bind:display="\'Washout water\'" v-bind:icon="\'chemical-washout\'" v-model="editor.Facility.IsWashout" :disabled="!editor.Facility.IsDumpPoint"><\/icon>\n                    <icon v-bind:display="\'Right hand transfer\'" v-bind:icon="\'rh-transfer\'" v-model="editor.Facility.IsRHTransfer" :disabled="!editor.Facility.IsAccessible"><\/icon>\n                    <icon v-bind:display="\'After hour access\'" v-bind:icon="\'after-hours\'" v-model="editor.Facility.IsAfterHours" :disabled="!editor.Facility.IsDumpPoint"><\/icon>\n                    <icon v-bind:display="\'Ambulant\'" v-bind:icon="\'ambulant\'" v-model="editor.Facility.IsAmbulant"><\/icon>\n                <\/div> \n                <note v-model="editor.Facility.FacilitiesNote" :validator="editor.Validators.FacilitiesNote" :mainmodel="editor.Facility" :watermark="\'Notes about the facilities, each starting on a new line.\'" :maxlength="1000" title="Facilities notes:"><\/note>\n            <\/section>\n        <\/div>\n    '},babychangesection={props:["editor"],components:{heading:iconheading,note:notefield,icon:iconswitchrow},template:'\n        <div>\n            <heading v-model="editor.Facility.IsBabyChange_GS" :icon="\'baby-change\'" :heading="\'Baby change\'"><\/heading>\n            <section v-if="editor.Facility.IsBabyChange && editor.IsProvider" class="dependency">\n                <div class="icon-list">\n                    <icon v-bind:display="\'Baby Care Room\'" v-bind:icon="\'baby-care\'" v-model="editor.Facility.IsBabyCareRoom" :readonly="editor.IsTrusted || editor.IsProvider"><\/icon>\n                <\/div>\n                <note v-if="editor.IsTrusted || editor.IsProvider" v-model="editor.Facility.BabyChangeNote" :validator="editor.Validators.BabyChangeNote" :mainmodel="editor.Facility" maxlength="300" watermark="Notes about this baby change facility." title="Baby change note:"><\/note>\n                <p v-else>{{editor.Facility.BabyChangeNote}}<\/p>\n            <\/section>\n        <\/div>\n    '},dumppointsection={props:["editor"],components:{heading:iconheading,note:notefield,icon:iconswitchrow},template:'\n        <div>\n            <heading v-model="editor.Facility.IsDumpPoint_GS" :icon="\'dump-point\'" :heading="\'Dump point\'"><\/heading>\n            <section v-if="editor.Facility.IsDumpPoint" class="dependency">\n                <div class="icon-list">\n                    <icon v-bind:display="\'Washout water\'" v-bind:icon="\'chemical-washout\'" v-model="editor.Facility.IsWashout"><\/icon>\n                    <icon v-bind:display="\'After hour access\'" v-bind:icon="\'after-hours\'" v-model="editor.Facility.IsAfterHours"><\/icon>\n                <\/div>\n                <note v-if="editor.IsTrusted || editor.IsProvider" v-model="editor.Facility.DumpPointNote" :validator="editor.Validators.DumpPointNote" :mainmodel="editor.Facility" maxlength="300" watermark="Notes about this dump point facility." title="Dump point note:"><\/note>\n                <p v-else>{{editor.Facility.DumpPointNote}}<\/p>\n            <\/section>\n        <\/div>\n    '},adultchangesection={props:["editor"],components:{heading:iconheading,note:notefield,icon:iconswitchrow},data:function(){for(var t=[{text:"Pre-2010",value:2009}],i=new Date,n=2010;n<=i.getFullYear();n++)t.push({text:n,value:n});return{years:t,standard:this.editor.Facility.IsPre2010_AdultChange?"Pre 2010":this.editor.Facility.IsAS1428_AdultChange?"AIS 1428":this.editor.Facility.IsBCA2020_AdultChange?"BCA 2020":"unknown"}},template:'\n        <div>\n            <heading v-model="editor.Facility.IsAdultChange_GS" :icon="\'adult-change\'" :heading="\'Adult change\'"><\/heading>\n            <section v-if="editor.Facility.IsAdultChange" class="dependency">\n                <div class="icon-list">\n                    <icon v-bind:display="\'Adult change shower\'" v-bind:icon="\'showers\'" v-model="editor.Facility.IsACShower"><\/icon>   \n                    <icon v-bind:display="\'BYO sling\'" v-bind:icon="\'byo-sling\'" v-model="editor.Facility.IsBYOSling"><\/icon>    \n                    <icon v-if="editor.IsProvider" v-bind:display="\'Changing Places\'" v-bind:icon="\'changing-places\'" v-model="editor.Facility.IsChangingPlaces" ><\/icon>   \n                <\/div>\n                <div v-if="editor.IsTrusted || editor.IsProvider" class="form-horizontal">\n                    <label for="lastrenovation_ac">Last renovation<\/label>\n                    <select id="lastrenovation_ac" class="form-control" v-model="editor.Facility.Year_AdultChange" v-on:change="yearchanged">\n                        <option v-for="year in years" v-bind:value="year.value">{{year.text}}<\/option>\n                    <\/select>\n                    <label>{{standard}}<\/label>\n                <\/div>\n                <note v-if="editor.IsTrusted || editor.IsProvider" v-model="editor.Facility.AdultChangeNote" :validator="editor.Validators.AdultChangeNote" :mainmodel="editor.Facility" :maxlength="300" :watermark="\'Notes about this adult change facility.\'" title="Adult change note:"><\/note>\n                <p v-else>{{editor.Facility.AdultChangeNote}}<\/p>\n            <\/section>\n        <\/div>\n    ',methods:{yearchanged:function(){this.editor.Facility.IsBCA2020_AdultChange=this.editor.Facility.Year_AdultChange===2020;this.editor.Facility.IsAS1428_AdultChange=this.editor.Facility.Year_AdultChange<2020&&this.editor.Facility.Year_AdultChange>=2010;this.editor.Facility.IsPre2010_AdultChange=this.editor.Facility.Year_AdultChange<2010;this.standard=this.editor.Facility.IsPre2010_AdultChange?"Pre 2010":this.editor.Facility.IsAS1428_AdultChange?"AIS 1428":this.editor.Facility.IsBCA2020_AdultChange?"BCA 2020":"unknown"}}},facilitiespanel={props:["editor"],components:{subheading:subheading,controls:controlrow,facilities:facilitiessection,toilets:toiletssection,adultchange:adultchangesection,babychange:babychangesection,dumppoint:dumppointsection,note:notefield},template:'\n        <div class="editor-section">\n            <subheading v-bind:editor="editor"><\/subheading>\n            <toilets :editor="editor"><\/toilets>\n            <adultchange :editor="editor"><\/adultchange>\n            <babychange :editor="editor"><\/babychange>\n            <dumppoint :editor="editor"><\/dumppoint>\n            <note v-if="editor.IsCrowdsource" v-model="editor.Facility.FacilitiesNote" :validator="editor.Validators.FacilitiesNote" :mainmodel="editor.Facility" :maxlength="300" :watermark="\'Let us know about anything else about the toilets, baby change, adult change or dump points.\'" title="Suggested updates:"><\/note>\n            <validationmessage :validator="editor.Validators.FType" :mainmodel="editor.Facility" v-model="editor.Facility.HasFacility"><\/validationmessage>\n            <controls v-bind:editor="editor" :createInstruction="\'Now can you tell us about parking please.\'"><\/controls>\n        <\/div>\n    '},facilitiessummary={props:["editor","pfacility"],components:{Toilets:DetailsToiletList,AdultChange:DetailsAdultChangeList,BabyChange:DetailsBabyChangeList,DumpPoint:DetailsDumpPointList},computed:{status:{get:function(){return Math.min(this.editor.Facility.ToiletStatus,this.editor.Facility.AdultChangeStatus,this.editor.Facility.BabyChangeStatus,this.editor.Facility.DumpPointStatus)}},enabled:{get:function(){return this.status===ContentStatus.Published}},updateText:{get:function(){return this.editor.UpdateLinkText(this.status,[this.editor.Facility.ToiletID,this.editor.Facility.AdultChangeID,this.editor.Facility.BabyChangeID,this.editor.Facility.DumpPointID])}},pretendFacility:{get:function(){return{isAdultChange:this.editor.Facility.IsAdultChange,adultChangeNote:this.editor.Facility.AdultChangeNote?this.editor.Facility.AdultChangeNote:"",isAdultChangeShower:this.editor.Facility.IsACShower,isBYOSling:this.editor.Facility.IsBYOSling,isChangingPlaces:this.editor.Facility.IsChangingPlaces,isDrinkingWater:this.editor.Facility.IsDrinkingWater,isMensPadDisposal:this.editor.Facility.IsMensPadDisposal,isSanitaryDisposal:this.editor.Facility.IsSanitaryDisposal,isSharpsDisposal:this.editor.Facility.IsSharpsDisposal,isShower:this.editor.Facility.IsShower,isBabyChange:this.editor.Facility.IsBabyChange,babyChangeNote:this.editor.Facility.BabyChangeNote?this.editor.Facility.BabyChangeNote:"",isBabyCareRoom:this.editor.Facility.IsBabyCareRoom,isDumpPoint:this.editor.Facility.IsDumpPoint,dumpPointNote:this.editor.Facility.DumpPointNote?this.editor.Facility.DumpPointNote:"",isAfterHours:this.editor.Facility.IsAfterHours,isWashout:this.editor.Facility.IsWashout,isToilet:this.editor.Facility.IsToilet,isAccessible:this.editor.Facility.IsAccessible,isAmbulant:this.editor.Facility.IsAmbulant,isFemale:this.editor.Facility.IsFemale,isInclusive:this.editor.Facility.IsInclusive,isLHTransfer:this.editor.Facility.IsLHTransfer,isMale:this.editor.Facility.IsMale,isRHTransfer:this.editor.Facility.IsRHTransfer,isUnisex:this.editor.Facility.IsUnisex,toiletNote:this.editor.Facility.ToiletNote?this.editor.Facility.ToiletNote:""}}}},template:'\n        <div class="index-section" :class="{\'index-section-enabled\': enabled, \'index-section-disabled\': !enabled}" v-on:click="click" tabindex="0" v-on:keyup.enter="click">\n            <h2 class="float-right text-danger">{{updateText}}<\/h2>\n            <Toilets :facility="pretendFacility" :showAll="true"><\/Toilets>\n            <AdultChange :facility="pretendFacility" :showAll="true"><\/AdultChange>\n            <BabyChange :facility="pretendFacility" :showAll="true"><\/BabyChange>\n            <DumpPoint :facility="pretendFacility" :showAll="true"><\/DumpPoint>\n        <\/div>\n    ',methods:{click:function(){this.enabled&&(MainEditorManager.EnterDetailsMode(),this.editor.Show=!0)}}};"use strict";var undefinedAddressString=null,addressmap={props:["Facility"],template:'\n        <div id="movepinmap">\n            \n        <\/div>\n    ',mounted:function(){var i=new google.maps.Map(document.getElementById("movepinmap"),{center:{lat:this.Facility.Latitude,lng:this.Facility.Longitude},zoom:start.zoom,mapTypeControl:!0,fullscreenControl:!1,streetViewControl:!0,mapTypeControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM},gestureHandling:"cooperative"}),n=new google.maps.Marker({position:{lat:this.Facility.Latitude,lng:this.Facility.Longitude},title:this.Facility.Title,icon:app.selectedFacility?app.selectedFacility.pinIcon:{url:"/Content/img/pins/pin_u.svg",size:new google.maps.Size(pin_width,pin_height),scaledSize:new google.maps.Size(pin_width,pin_height),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(pin_width*.5,pin_height)},draggable:!0}),t=this.Facility,r=this;google.maps.event.addListener(n,"dragend",function(){var i=n.getPosition();t.Latitude=i.lat();t.Longitude=i.lng();r.$emit("pinmoved")});n.setMap(i)}},addressform={props:["editor"],data:function(){return{autocomplete:null,delayedBlur:_.debounce(function(){this.setaddress()},1e3)}},template:'\n        <div>\n            <div class="street">\n                <input id="address1input" class="form-control" type="text" placeholder="Enter an address, suburb or place name." v-model="editor.Facility.AddressFull" v-on:blur="blur" v-on:keyup.enter="blur" />\n                <validationmessage :validator="editor.Validators.AddressFull" :mainmodel="editor.Facility" v-model="editor.Facility.AddressFull"><\/validationmessage>\n            <\/div>\n        <\/div>\n    ',methods:{blur:function(){this.delayedBlur()},setaddress:function(){var i=this,u=_wrapRegExp(/(^[\+\x2D]?(?:[1-8]?[0-9](?:\.[0-9]+)?|90(?:\.0+)?))[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*([\+\x2D]?(?:180(?:\.0+)?|(?:1[0-7][0-9]|[1-9]?[0-9])(?:\.[0-9]+)?))$/,{lat:1,lng:2}),t=u.exec(this.editor.Facility.AddressFull),n,r;t&&t.groups.lat&&t.groups.lng?this.$emit("updateaddresslatlng",{lat:Number(t.groups.lat),lng:Number(t.groups.lng)}):this.autocomplete&&(n=this.autocomplete.getPlace(),n&&n.geometry?(this.$emit("updatedaddresspos",n.geometry.location),n.address_components&&this.$emit("updateaddresscomponents_blur",n.address_components)):(r=new google.maps.places.AutocompleteService,r.getPlacePredictions({input:this.editor.Facility.AddressFull,componentRestrictions:{country:"au"}},function(n){var t=new google.maps.places.PlacesService(app.map);t.getDetails({reference:n[0].reference},function(n,t){t==="OK"&&(i.$emit("updatedaddresspos",n.geometry.location),n.address_components&&i.$emit("updateaddresscomponents_blur",n.address_components))})})))}},mounted:function(){var n=this,t=document.getElementById("address1input");this.autocomplete=new google.maps.places.Autocomplete(t);this.autocomplete.setComponentRestrictions({country:"au"});this.autocomplete.addListener("place_changed",function(){n.delayedBlur.cancel();var t=n.autocomplete.getPlace();t.geometry&&(n.$emit("updatedaddresspos",t.geometry.location),t.address_components&&n.$emit("updateaddresscomponents",t.address_components))})}},addresspanel={props:["editor"],components:{controls:controlrow,note:notefield,Icon:Icon,addressmap:addressmap,addressform:addressform},data:function(){return{AddressModeTypes:AddressModeTypes,canusephone:app.my.lat!==-23.845636&&app.my.lng!==133.899295,DelayedPinMove:_.debounce(this.pinwasmoved,1e3),addressChanging:!1,addressChanging_newPos:null,pinChanging:!1,pinChanging_newAddress:null,pinChanging_newAddress_display:null,needToChooseAddress:!1,needToChooseAddress_components:null,needToChooseAddress_display:null,duplicateFacility:null,lastDuplicate:null,loadingDuplicate:!1}},template:'\n        <div v-if="duplicateFacility">\n            <div v-if="loadingDuplicate">\n                <p>Loading facility, please wait...<\/p>\n            <\/div>\n            <div v-else>\n                <p>There is a facility {{Math.round(duplicateFacility.Distance)}} metres away - \'{{duplicateFacility.Title}}\'. Do you want to update that facility instead?<\/p>\n                <button type="button" class="btn btn-primary" v-on:click="loadDuplicate(false)">Update the existing facility<\/button>\n                <button type="button" class="btn btn-light" v-on:click="noDuplicate">Add a new facility<\/button>\n                <button type="button" class="btn btn-light" v-on:click="cancel">Cancel<\/button>\n            <\/div>\n        <\/div>\n        <div v-else-if="needToChooseAddress">\n            <p>Update address to {{needToChooseAddress_display}}?<\/p>\n            <button type="button" class="btn btn-primary" v-on:click="acceptAddress">Yes<\/button>\n            <button type="button" class="btn btn-light" v-on:click="rejectAddress">No<\/button>\n        <\/div>\n        <div v-else-if="addressChanging">\n            <p>Do you want to update the position of the facility to match the address you just entered?<\/p>\n            <button type="button" class="btn btn-primary" v-on:click="acceptNewPos">Yes<\/button>\n            <button type="button" class="btn btn-light" v-on:click="rejectNewPos">No<\/button>\n        <\/div>\n        <div v-else-if="pinChanging">\n            <p>Do you want to update the address of the facility to match the new location? ({{pinChanging_newAddress_display}})<\/p>\n            <button type="button" class="btn btn-primary" v-on:click="acceptNewAddress">Yes<\/button>\n            <button type="button" class="btn btn-light" v-on:click="rejectNewAddress">No<\/button>\n        <\/div>\n        <form v-else autocomplete="off">\n            <form-group :id="\'facilityname\'" :type="\'text\'" :label="\'Name\'" v-model="editor.Facility.Title" placeholder="Enter a name" maxlength="200" :validator="editor.Validators.FacilityName" :model="editor.Facility"><\/form-group>            \n            <div class="form-group">\n                <label for="facilitytype">Type<\/label>\n                <div class="d-flex">\n                <icon :icon-type="editor.Facility.ActualFacilityIcon" :classOverride="\'facility\'"><\/icon>\n                <validationselect class="form-control" v-model="editor.Facility.FacilityIcon" id="facilitytype" :validator="editor.Validators.FacilityType">\n                    <option value="Airport">Airport<\/option>\n                    <option value="Beach">Beach<\/option>\n                    <option value="Bus station">Bus station<\/option>\n                    <option value="Camping ground">Camping ground<\/option>\n                    <option value="Car park">Car park<\/option>\n                    <option value="Caravan park">Caravan park<\/option>\n                    <option value="Cemetery">Cemetery<\/option>\n                    <option value="Community building">Community building<\/option>\n                    <option value="Food outlet">Food outlet<\/option>\n                    <option value="Jetty">Jetty<\/option>\n                    <option value="Park or reserve">Park or reserve<\/option>\n                    <option value="Rest area">Rest area<\/option>\n                    <option value="Service station">Service station<\/option>\n                    <option value="Shopping centre">Shopping centre<\/option>\n                    <option value="Sporting facility">Sporting facility<\/option>\n                    <option value="Swimming pool">Swimming pool<\/option>\n                    <option value="Train station">Train station<\/option>\n                    <option value="Other">Other<\/option>\n                <\/validationselect>\n                <\/div>\n                <validationmessage :validator="editor.Validators.FacilityType" :mainmodel="editor.Facility" v-model="editor.Facility.FacilityIcon"><\/validationmessage>\n            <\/div>\n            <h2 class="mt-4">Address<\/h2>                   \n            <div v-if="canusephone">\n                <div class="address-option">\n                    <p>Go to the entrance and use your phone for the location:<\/p>\n                    <button type="button" class="btn btn-sm btn-light" v-on:click="phonelocation">Use phone<\/button>\n                <\/div>\n                <p v-if="editor.Facility.AddressMode==AddressModeTypes.Phone" class="text-success">The address and location have been set to your current location. Press the \'<strong>{{editor.IsCreateMode ? \'Create facility\' : \'Update address\'}}<\/strong>\' button to finish updating.<\/p>\n            <\/div>\n            <div class="mt-2">\n                <div class="address-option">   \n                    <p>Enter the address details:<\/p>\n                    <button type="button" class="btn btn-sm btn-light" v-on:click="enteraddress">Enter address<\/button>\n                <\/div>\n                <addressform v-if="editor.Facility.AddressMode==AddressModeTypes.Address" :editor="editor" v-on:addresschanged="addresschanged" v-on:updateaddresscomponents="processAddressComponent($event)" v-on:updateaddresscomponents_blur="chooseaddress($event)" v-on:updatedaddresspos="posChanged($event)" v-on:updateaddresslatlng="addressLatLng"><\/addressform>\n                <validationmessage :validator="editor.Validators.AddressCombo" :mainmodel="editor.Facility" v-model="editor.Facility.AddressFull"><\/validationmessage>\n            <\/div>\n            <div class="mt-2" v-if="editor.Facility.Latitude!=null && editor.Facility.Longitude!=null">\n                <div class="address-option">     \n                    <p>Adjust the pin on the map:<\/p>\n                    <button type="button" class="btn btn-sm btn-light" v-on:click="startmovepin">Pin on map<\/button>\n                <\/div>\n                <p v-if="editor.Facility.AddressMode == AddressModeTypes.Pin"><\/p>\n            <\/div>  \n            <div class="mt-2" v-if="this.editor.Facility.AddressMode == AddressModeTypes.Pin">\n                <addressmap :Facility="editor.Facility" v-on:pinmoved="pinwasmovedD"><\/addressmap>\n                <validationmessage :validator="editor.Validators.Position" :mainmodel="editor.Facility" v-model="editor.Facility.Latitude"><\/validationmessage>\n            <\/div>            \n            <validationmessage :validator="editor.Validators.Address" :mainmodel="editor.Facility" v-model="editor.Facility"><\/validationmessage>\n            <note v-if="editor.IsTrusted || editor.IsProvider" class="mt-2" v-model="editor.Facility.AddressNote" :validator="editor.Validators.AddressNote" :mainmodel="editor.Facility" :watermark="\'Note about the address - landmarks, ...\'" :maxlength="300" title="Address note:"><\/note>\n            <div v-else>\n                <p>{{editor.Facility.AddressNote}}<\/p>\n                <note class="mt-2" v-model="editor.Facility.AddressNote_CS" :validator="editor.Validators.AddressNote_CS" :mainmodel="editor.Facility" :watermark="\'Note about the address - landmarks, ...\'" :maxlength="300" title="Suggested updates:"><\/note>\n            <\/div>            \n            <controls v-bind:editor="editor" :createInstruction="\'Next we need you to tell us what facilities there are.\'"><\/controls>\n            \n        <\/form>\n    ',methods:{noDuplicate:function(){this.lastDuplicate=this.duplicateFacility;this.duplicateFacility=null},loadDuplicate:function(){var t=this,n;this.loadingDuplicate=!0;n=this;Vue.http.get("/api/AppAPI/GetFacilityFull/"+this.duplicateFacility.ID).then(function(t){t.json().then(function(t){if(app.toilets.some(function(n){return n.id==t.Info.ID}))app.selectFacility(t.Info.ID);else{var i=new Toilet(t);app.addToilet(i);app.selectFacility(t.Info.ID);i.refreshInfo()}MainEditorManager.AutoLoad=!1;showPanel("editors-panel");MainEditorManager.CreateMode=!1;MainEditorManager.ReadOnlyToilet=app.selectedFacility;MainEditorManager.EnterCompactMode();n.loadingDuplicate=!0;MainEditorManager.setHRID(t.Info.ID).then(function(){n.loadDuplicate=!1;n.duplicateFacility=!1;n.lastDuplicate=!1;MainEditorManager.Facility.IsClosed&&(MainEditorManager.Facility.WasClosed=!0,MainEditorManager.Facility.IsClosed=!1,MainEditorManager.Facility.IsOpenAllHours||MainEditorManager.Facility.IsOpenDaylightHours||MainEditorManager.Facility.IsOpeningHoursVariable||MainEditorManager.Facility.IsOpenSchedule||MainEditorManager.Facility.IsOpenVenueHours||(MainEditorManager.Facility.IsOpenAllHours=!0),MainEditorManager.Facility.RebuildOpeningHoursDisplayText());ga("send","event","Edit","Started",t.Info.ID);gtag("event","Edit",{Started:t.Info.ID})}).finally(function(){MainEditorManager.AutoLoad=!0})})},function(n){typeof Sentry!="undefined"&&Sentry.captureException(n);Messages.display(MessageType.error,"Get facility","Failed to load the facility",1e4)}).finally(function(){t.loadingDuplicate=!1})},phonelocation:function(){this.editor.Facility.AddressMode=AddressModeTypes.Phone;this.reverseGeoCode(app.my,AddressModeTypes.Phone)},enteraddress:function(){this.editor.Facility.AddressMode=AddressModeTypes.Address},startmovepin:function(){this.editor.Facility.AddressMode=AddressModeTypes.Pin},pinwasmovedD:function(){this.editor.Saving=!0;this.DelayedPinMove()},pinwasmoved:function(){this.reverseGeoCode(new google.maps.LatLng(this.editor.Facility.Latitude,this.editor.Facility.Longitude),AddressModeTypes.Pin)},acceptNewPos:function(){this.editor.Facility.Latitude=this.addressChanging_newPos.lat();this.editor.Facility.Longitude=this.addressChanging_newPos.lng();this.addressChanging_newPos=null;this.addressChanging=!1;this.checkForDuplicate()},rejectNewPos:function(){this.addressChanging_newPos=null;this.addressChanging=!1},acceptNewAddress:function(){this.processAddressComponent(this.pinChanging_newAddress);this.pinChanging_newAddress=null;this.pinChanging=!1},rejectNewAddress:function(){this.pinChanging_newAddress=null;this.pinChanging=!1},addressLatLng:function(n){this.editor.Facility.Latitude=n.lat;this.editor.Facility.Longitude=n.lng;this.reverseGeoCode(new google.maps.LatLng(n.lat,n.lng),AddressModeTypes.LatLng)},addresschanged:function(){var t=this,n;this.editor.Validators.AddressFull.Result.Success&&(n=new google.maps.Geocoder,n.geocode({componentRestrictions:{country:"AU"},address:this.editor.Facility.AddressFull+" Australia"},function(n,i){t.proccessResult(n,i,AddressModeTypes.Address)}))},posChanged:function(n){this.editor.Facility.Latitude!=null&&this.editor.Facility.Longitude!=null?(this.addressChanging=!0,this.addressChanging_newPos=n):(this.editor.Facility.Latitude=n.lat(),this.editor.Facility.Longitude=n.lng(),this.addressChanging_newPos=null,this.addressChanging=!1,this.checkForDuplicate())},reverseGeoCode:function(n,t){var i=this,r=new google.maps.Geocoder;r.geocode({location:n},function(n,r){i.editor.Saving=!1;i.proccessResult(n,r,t)})},proccessResult:function(n,t,i){var e,r,u,f;t==="OK"?(e=selectAddressResult(n),r=e[0]?e[0]:n[0],r?i==AddressModeTypes.Pin?(u=this.loadAddressComponents(r.address_components),u.Full&&u.Full!==this.editor.Facility.AddressFull&&(this.pinChanging=!0,this.pinChanging_newAddress=r.address_components,this.pinChanging_newAddress_display=u.Full),this.checkForDuplicate()):i==AddressModeTypes.LatLng?(f=this.loadAddressComponents(r.address_components),f.Full&&f.Full!==this.editor.Facility.AddressFull&&(this.pinChanging=!0,this.pinChanging_newAddress=r.address_components,this.pinChanging_newAddress_display=f.Full),this.checkForDuplicate()):(this.processAddressComponent(r.address_components),i==AddressModeTypes.Phone?(this.editor.Facility.Latitude=app.my.lat,this.editor.Facility.Longitude=app.my.lng,this.checkForDuplicate()):i==AddressModeTypes.Address&&(this.addressChanging_newPos=r.geometry.location,this.editor.Facility.Latitude!=null&&this.editor.Facility.Longitude!=null?this.addressChanging=!0:(this.editor.Facility.Latitude=this.addressChanging_newPos.lat(),this.editor.Facility.Longitude=this.addressChanging_newPos.lng(),this.addressChanging_newPos=null,this.addressChanging=!1,this.checkForDuplicate())),this.editor.Facility.AddressMode=AddressModeTypes.Pin):i==AddressModeTypes.Phone?Messages.display(MessageType.error,"Use phone","Could not find an address for your location.",1e3):i==AddressModeTypes.Pin?Messages.display(MessageType.error,"Move pin","Could not find an address for the selected location.",1e3):i==AddressModeTypes.Address&&Messages.display(MessageType.error,"Enter address","The map pin was not moved as we could not verify the new address entered.",1e3)):i==AddressModeTypes.Phone?Messages.display(MessageType.error,"Use phone","Failed to get location because: "+t):i==AddressModeTypes.Pin?Messages.display(MessageType.error,"Move pin","Failed to get location because: "+t):i==AddressModeTypes.Address&&Messages.display(MessageType.error,"Enter address","Failed to get location because: "+t)},processAddressComponent:function(n){var t=this.loadAddressComponents(n);this.editor.Facility.Address1=t.Address1;this.editor.Facility.Town=t.Town;this.editor.Facility.State=t.State;this.editor.Facility.RebuildAddressFull();this.editor.Validators.Address.Validate(this.editor.Facility);this.editor.Validators.AddressFull.Validate(this.editor.Facility);this.editor.Validators.AddressCombo.Validate(this.editor.Facility);this.editor.Facility.AddressMode=AddressModeTypes.Pin},chooseaddress:function(n){var t=this.loadAddressComponents(n);t.Full!==this.editor.Facility.AddressFull?(this.needToChooseAddress=!0,this.needToChooseAddress_components=n,this.needToChooseAddress_display=t.Full):t.Address1!==this.editor.Facility.Address1||t.Town!==this.editor.Facility.Town||t.State!==this.editor.Facility.State?this.processAddressComponent(n):(this.addressChanging=!1,this.addressChanging_newPos=null,this.editor.Facility.AddressMode=AddressModeTypes.Pin)},acceptAddress:function(){this.needToChooseAddress=!1;this.processAddressComponent(this.needToChooseAddress_components);this.needToChooseAddress_components=null},rejectAddress:function(){this.needToChooseAddress=!1;this.needToChooseAddress_components=null;this.addressChanging=!1;this.addressChanging_newPos=null},loadAddressComponents:function(n){var l=n.find(function(n){return n.types.some(function(n){return n==="street_address"})}),f=n.find(function(n){return n.types.some(function(n){return n==="street_number"})}),i=n.find(function(n){return n.types.some(function(n){return n==="route"})}),e=n.find(function(n){return n.types.some(function(n){return n==="establishment"})}),o=n.find(function(n){return n.types.some(function(n){return n==="natural_feature"})}),s=n.find(function(n){return n.types.some(function(n){return n==="locality"})}),h=n.find(function(n){return n.types.some(function(n){return n==="administrative_area_level_1"})}),u=f?f.long_name+(i?" "+i.long_name:""):i?i.long_name:e?e.long_name:o?o.long_name:undefinedAddressString,r=s?s.long_name:null,t=h?h.short_name:null,c=(u?u+(r||t?", ":""):"")+(r?r+(t?", ":""):"")+(t?t:"");return{Address1:u,Town:r,State:t,Full:c}},checkForDuplicate:function(){var n=this;MainEditorManager.CreateMode&&MainEditorManager.checkForDuplicate().then(function(t){n.duplicateFacility=t})},cancel:function(){hidePanel("create-panel")}}},addresssummary={props:["editor","pfacility"],components:{Heading:heading},computed:{status:{get:function(){return Math.min(this.editor.Facility.Status,this.editor.Facility.AddressStatus)}},enabled:{get:function(){return this.status===ContentStatus.Published}},updateText:{get:function(){return this.editor.UpdateLinkText(this.status,[this.editor.Facility.AddressID,this.editor.Facility.ContentID])}}},template:'\n        <div class="index-section" :class="{\'index-section-enabled\': enabled, \'index-section-disabled\': !enabled}" v-on:click="click" tabindex="0" v-on:keyup.enter="click">\n            <h2 class="float-right text-danger">{{updateText}}<\/h2>\n            <Heading :editor="editor"><\/Heading>\n            <p v-if="editor.Facility.AddressNote">{{editor.Facility.AddressNote}}<\/p>\n        <\/div>\n    ',methods:{click:function(){this.enabled&&(MainEditorManager.EnterDetailsMode(),this.editor.Show=!0)}}};"use strict";var scheduletimeinput={props:["value"],computed:{myValue:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},template:'\n        <input class="form-control" v-model="myValue" v-on:keydown="timeinput($event)" v-on:change="timechange" />\n    ',methods:{timechange:function(){this.$emit("change")},timeinput:function(n){var i=n.keyCode?n.keyCode:n.which,t=this.myValue;if(t||(t=""),i!==8&&i!==9&&i!==37&&i!==38&&i!==39&&i!==40&&i!==46){if(!(i>=48&&i<=57)&&!(i>=96&&i<=105))return n.preventDefault(),!1;var o=n.target,e=Number(this.myValue),r=t.indexOf(":"),s=this.isTextSelected(o),f=this.getTextIndex(o),u=Number(String.fromCharCode(96<=i&&i<=105?i-48:i));if(!s&&r>-1&&t.length-(r+1)==2&&r>0)if(f===t.length&&t.substr(0,1)==="1"&&t.substr(1,1)===":"&&Number(t.substr(2,1))<=2&&Number(t.substr(3,1))<=5)t=t.replace(":",""),t=t.substr(0,2)+":"+t.substr(2,1),r=t.indexOf(":"),this.myValue=t,this.$emit("change");else return f===0&&r===1&&Number(t.substr(0,1))<3&&u===1?(t="1"+t,this.myValue=t,this.$emit("change"),n.preventDefault(),!1):f===1&&r===1&&Number(t.substr(0,1))===1&&u<3?(t=t.substr(0,1)+u.toString()+t.substr(1,t.length-1),this.myValue=t,this.$emit("change"),n.preventDefault(),!1):(n.preventDefault(),!1);if((t.length<=2&&e>1||t.length===2||e===1&&u<6)&&r===-1)t+=":",this.myValue=t,this.$emit("change"),f++;else if(t.length===1&&e===1&&u>2||t.length===0&&u===0)return n.preventDefault(),!1;if(t.charAt(f-1)===":"&&u>5)return n.preventDefault(),!1}},isTextSelected:function(n){var i=this.getSelection(n),r=i.start,u=i.end,t=document.selection;return t&&t.createRange().text.length!==0?!0:!t&&n.value.substring(r,u).length!==0?!0:!1},getTextIndex:function(n){var t=this.getSelection(n);return t.start},getSelection:function(n){var t={start:0,end:0};if(typeof n.selectionStart=="number"&&typeof n.selectionEnd=="number")t.start=n.selectionStart,t.end=n.selectionEnd;else if(document.selection){var u=document.selection.createRange().getBookmark(),i=n.createTextRange(),r=i.duplicate();i.moveToBookmark(u);r.setEndPoint("EndToStart",i);t.start=r.text.length;t.end=t.start+i.text.length}return t}}},openinghourspanel={props:["editor"],components:{subheading:subheading,controls:controlrow,note:notefield,checkbox:checkbox,scheduletimeinput:scheduletimeinput},data:function(){return{OpeningHoursOptions:[{text:"",value:"none"},{text:"Open 24 hours",value:"OpenAll"},{text:"Open daylight hours",value:"OpenDaylight"},{text:"Open variable hours",value:"OpenVariable"},{text:"Open venue hours",value:"Venue"},{text:"Scheduled hours",value:"Schedule"}]}},computed:{OpeningHoursType:{get:function(){return this.editor.Facility.IsOpenAllHours?"OpenAll":this.editor.Facility.IsOpenDaylightHours?"OpenDaylight":this.editor.Facility.IsOpeningHoursVariable?"OpenVariable":this.editor.Facility.IsOpenVenueHours?"Venue":this.editor.Facility.IsOpenSchedule?"Schedule":"none"},set:function(n){switch(n){case"none":this.editor.Facility.IsOpenAllHours=!1;this.editor.Facility.IsOpenDaylightHours=!1;this.editor.Facility.IsOpeningHoursVariable=!1;this.editor.Facility.IsOpenVenueHours=!1;this.editor.Facility.IsOpenSchedule=!1;this.editor.Facility.OpeningHoursDisplay="Open unknown hours";break;case"OpenAll":this.editor.Facility.IsOpenAllHours=!0;this.editor.Facility.IsOpenDaylightHours=!1;this.editor.Facility.IsOpeningHoursVariable=!1;this.editor.Facility.IsOpenVenueHours=!1;this.editor.Facility.IsOpenSchedule=!1;this.editor.Facility.OpeningHoursDisplay="OPEN: 24 hours";break;case"OpenDaylight":this.editor.Facility.IsOpenAllHours=!1;this.editor.Facility.IsOpenDaylightHours=!0;this.editor.Facility.IsOpeningHoursVariable=!1;this.editor.Facility.IsOpenVenueHours=!1;this.editor.Facility.IsOpenSchedule=!1;this.editor.Facility.OpeningHoursDisplay="OPEN: Daylight hours";break;case"OpenVariable":this.editor.Facility.IsOpenAllHours=!1;this.editor.Facility.IsOpenDaylightHours=!1;this.editor.Facility.IsOpeningHoursVariable=!0;this.editor.Facility.IsOpenVenueHours=!1;this.editor.Facility.IsOpenSchedule=!1;this.editor.Facility.OpeningHoursDisplay="OPEN: Variable hours";break;case"Venue":this.editor.Facility.IsOpenAllHours=!1;this.editor.Facility.IsOpenDaylightHours=!1;this.editor.Facility.IsOpeningHoursVariable=!1;this.editor.Facility.IsOpenVenueHours=!0;this.editor.Facility.IsOpenSchedule=!1;this.editor.Facility.OpeningHoursDisplay="OPEN: Venue hours";break;case"Schedule":this.editor.Facility.IsOpenAllHours=!1;this.editor.Facility.IsOpenDaylightHours=!1;this.editor.Facility.IsOpeningHoursVariable=!1;this.editor.Facility.IsOpenVenueHours=!1;this.editor.Facility.IsOpenSchedule=!0;this.editor.Facility.OpeningHoursDisplay="OPEN:"}}}},template:'\n        <div class="editor-section">\n            <subheading v-bind:editor="editor" v-bind:instruction="editor.IsTrusted || editor.IsProvider ? \'Select the opening hours for this facility.\' : null" ><\/subheading>\n            <section v-if="editor.IsTrusted || editor.IsProvider || !editor.IsCreateMode">\n                <select v-if="editor.IsTrusted || editor.IsProvider" v-model="OpeningHoursType" class="form-control">\n                    <option v-for="htype in OpeningHoursOptions" :value="htype.value">{{htype.text}}<\/option>\n                <\/select>\n                <validationmessage v-if="editor.IsTrusted || editor.IsProvider" :validator="editor.Validators.OpeningHoursType" :mainmodel="editor.Facility" v-model="OpeningHoursType"><\/validationmessage>                \n                <p v-else>{{editor.Facility.OpeningHoursDisplay}}<\/p>\n                <div v-if="!editor.IsCreateMode">\n                    <checkbox v-model="editor.Facility.IsClosed" :label="\'Closed temporarily\'" :id="\'isClosedCheck\'"><\/checkbox>\n                <\/div>\n            <\/section>\n            \n            <div v-if="editor.Facility.IsOpenSchedule && (editor.IsTrusted || editor.IsProvider)">\n                <section class="schedule-list">\n                    <div v-for="schedule in editor.Facility.OpeningHoursSchedules">\n                        <button type="button" class="btn schedulebutton" :class="{\'btn-light\': editor.Facility.CurrentSchedule != schedule, \'btn-light\': editor.Facility.CurrentSchedule==schedule}" v-on:click="selectSchedule(schedule)">{{schedule.DisplayLabel}}<\/button>\n                        <button v-if="editor.Facility.CurrentSchedule == schedule" type="button" class="btn btn-link" v-on:click="deleteSchedule(schedule)">Delete<\/button>\n                    <\/div>\n                <\/section>\n\n                <section v-if="editor.Facility.CurrentSchedule">\n                    <div class="form-horizontal">\n                        <label for="openHours">Open<\/label>\n                        <scheduletimeinput id="openHours" v-model="editor.Facility.CurrentSchedule.OpeningTimeText" v-on:change="timechange_open" />\n                        <select class="form-control" v-model="editor.Facility.CurrentSchedule.OpeningTime_XT_GS">\n                            <option value="AM">AM<\/option>\n                            <option value="PM">PM<\/option>\n                        <\/select>\n                    <\/div>\n                    <validationmessage :validator="editor.Validators.OpeningTime" :mainmodel="editor.Facility" v-model="editor.Facility.CurrentSchedule.OpeningTimeText"><\/validationmessage>\n\n                    <div class="form-horizontal">\n                        <label for="closeHours">Close<\/label>\n                        <scheduletimeinput id="closeHours" v-model="editor.Facility.CurrentSchedule.ClosingTimeText" v-on:change="timechange_close" />\n                        <select class="form-control" v-model="editor.Facility.CurrentSchedule.ClosingTime_XT_GS">\n                            <option value="AM">AM<\/option>\n                            <option value="PM">PM<\/option>\n                        <\/select>\n                    <\/div>\n                    <validationmessage :validator="editor.Validators.ClosingTime" :mainmodel="editor.Facility" v-model="editor.Facility.CurrentSchedule.ClosingTimeText"><\/validationmessage>\n\n                    <checkbox v-model="editor.Facility.CurrentSchedule.ShowDays_GS" :heading="\'Days\'" :id="\'hasDays\'"><\/checkbox>\n\n                    <div class="mb-5">\n                    <section class="dependency checkbox-list mb-0">\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasMonday" :label="\'Mon\'" :id="\'hasMonday\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasTuesday" :label="\'Tue\'" :id="\'hasTuesday\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasWednesday" :label="\'Wed\'" :id="\'hasWednesday\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasThursday" :label="\'Thu\'" :id="\'hasThursday\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasFriday" :label="\'Fri\'" :id="\'hasFriday\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasSaturday" :label="\'Sat\'" :id="\'hasSaturday\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasSunday" :label="\'Sun\'" :id="\'hasSunday\'"><\/checkbox>\n                    <\/section>\n                    <validationmessage :validator="editor.Validators.Days" :mainmodel="editor.Facility" v-model="editor.Facility.CurrentSchedule.DayMask"><\/validationmessage>\n                    <\/div>\n\n                    <checkbox v-model="editor.Facility.CurrentSchedule.ShowMonths_GS" :heading="\'Months\'" :id="\'hasMonths\'"><\/checkbox>\n\n                    <div class="mb-5">\n                    <section class="dependency checkbox-list mb-0">\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasJanuary" :label="\'Jan\'" :id="\'HasJanuary\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasFebruary" :label="\'Feb\'" :id="\'HasFebruary\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasMarch" :label="\'Mar\'" :id="\'HasMarch\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasApril" :label="\'Apr\'" :id="\'HasApril\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasMay" :label="\'May\'" :id="\'HasMay\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasJune" :label="\'Jun\'" :id="\'HasJune\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasJuly" :label="\'Jul\'" :id="\'HasJuly\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasAugust" :label="\'Aug\'" :id="\'HasAugust\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasSeptember" :label="\'Sep\'" :id="\'HasSeptember\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasOctober" :label="\'Oct\'" :id="\'HasOctober\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasNovember" :label="\'Nov\'" :id="\'HasNovember\'"><\/checkbox>\n                        <checkbox v-model="editor.Facility.CurrentSchedule.HasDecember" :label="\'Dec\'" :id="\'HasDecember\'"><\/checkbox>\n                    <\/section>\n                    <validationmessage :validator="editor.Validators.Months" :mainmodel="editor.Facility" v-model="editor.Facility.CurrentSchedule.MonthMask"><\/validationmessage>\n                    <\/div>\n                <\/section>\n                <section>\n                    <div>\n                        <a href="#" @click="addSchedule">Add a schedule<\/a>\n                        <validationmessage :validator="editor.Validators.Schedule"><\/validationmessage>\n                    <\/div>\n                <\/section>\n            <\/div>\n\n            <section v-if="editor.IsCrowdsource">\n                    <p>{{editor.Facility.OpeningHoursNote}}<\/p>\n                    <note v-model="editor.Facility.OpeningHoursNote_CS" :validator="editor.Validators.OpeningHoursNote_CS" :mainmodel="editor.Facility" :watermark="\'Enter a note about opening hours.\'" :maxlength="300" title="Suggested updates:"><\/note>\n            <\/section>\n            <section v-else>\n                <note v-model="editor.Facility.OpeningHoursNote" :validator="editor.Validators.OpeningHoursNote" :mainmodel="editor.Facility" :watermark="\'Enter a note about opening hours.\'" :maxlength="300" title="Opening hours note:"><\/note>\n            <\/section>\n            <controls v-bind:editor="editor" :createInstruction="\'Finally, what other amenities are there?\'"><\/controls>\n        <\/div>\n    ',methods:{selectSchedule:function(n){this.editor.validate()&&(this.editor.Facility.CurrentSchedule=n)},deleteSchedule:function(n){this.editor.Facility.OpeningHoursSchedules=this.editor.Facility.OpeningHoursSchedules.filter(function(t){return t!==n});this.editor.Facility.CurrentSchedule=this.editor.Facility.OpeningHoursSchedules.length>0?this.editor.Facility.OpeningHoursSchedules[0]:null},addSchedule:function(){if(this.editor.Facility.AddingSchedule=!0,this.editor.validate()){var n=new Schedule({OpeningTime:new Date(1900,0,1,9,0,0,0),ClosingTime:new Date(1900,0,1,17,0,0,0),DayMask:"MonTueWedThuFriSatSun",MonthMask:"JanFebMarAprMayJunJulAugSepOctNovDec"});this.editor.Facility.OpeningHoursSchedules.push(n);this.editor.Facility.CurrentSchedule=n}this.editor.Facility.AddingSchedule=!1},timechange_open:function(){this.editor.Validators.OpeningTime.Validate(this.editor.Facility).Success&&(this.editor.Facility.CurrentSchedule.OpeningTime_GS=this.editor.Facility.CurrentSchedule.OpeningTimeText)},timechange_close:function(){this.editor.Validators.ClosingTime.Validate(this.editor.Facility).Success&&(this.editor.Facility.CurrentSchedule.ClosingTime_GS=this.editor.Facility.CurrentSchedule.ClosingTimeText)}}},openinghourssummary={props:["editor","pfacility"],components:{Access:DetailsAccessList},computed:{enabled:{get:function(){return this.editor.Facility.OpeningHoursStatus===ContentStatus.Published}},updateText:{get:function(){return this.editor.UpdateLinkText(this.editor.Facility.OpeningHoursStatus,[this.editor.Facility.OpeningHoursID])}},pretendFacility:{get:function(){var n=this;return this.editor.Facility.IsOpenSchedule&&(this.editor.Facility.OpeningHoursDisplay="OPEN: ",this.editor.Facility.OpeningHoursSchedules.forEach(function(t){n.editor.Facility.OpeningHoursDisplay!=="OPEN: "&&(n.editor.Facility.OpeningHoursDisplay+=", ");n.editor.Facility.OpeningHoursDisplay+=t.Description})),{openingHoursNote:this.editor.Facility.OpeningHoursNote,openingHours:this.editor.Facility.OpeningHoursDisplay}}}},template:'\n        <div class="index-section" :class="{\'index-section-enabled\': enabled, \'index-section-disabled\': !enabled}" v-on:click="click" tabindex="0" v-on:keyup.enter="click">\n            <h2 class="float-right text-danger">{{updateText}}<\/h2>\n            <Access :facility="pretendFacility" :onlyOpeningHours="true"><\/Access>\n        <\/div>\n    ',methods:{click:function(){this.enabled&&(MainEditorManager.EnterDetailsMode(),this.editor.Show=!0)}}};"use strict";var editorLightbox={props:["facility","photos","photo"],data:function(){return{current:this.photo,preloaded:[],waiting:!0,loadedOne:!1}},template:'\n        <div id="lightbox-container">\n            <div id="lightbox">\n                <div class="image">\n                    <div v-if="waiting" class="spinner">Loading...<\/div>\n                    <img v-if="current.ContentID" :id="\'photo_\' + current.ID" :src="\'/api/AppAPI/GetImage/\'+current.ContentID" v-on:load="loaded">\n                    <img v-if="current.Data" :id="\'photo_\'+current.ID" :src="current.Data" v-on:load="loaded">\n                    <a v-if="loadedOne" href="#" @click.prevent="$emit(\'close-lightbox\')" class="dismiss" title="Close"><span>x<\/span><\/a>\n                <\/div>\n            <\/div>\n            <button class="arrow left" :class="{ disabled: !has_prev }" :title="has_prev ? \'Previous photo\' : \'\'" @click.stop="prevPhoto" ><\/button>\n            <button class="arrow right" :class="{ disabled: !has_next }" :title="has_next ? \'Next photo\' : \'\'" @click.stop="nextPhoto"><\/button>\n        <\/div>\n    ',methods:{nextPhoto:function(){this.next&&(this.current=this.next)},prevPhoto:function(){this.prev&&(this.current=this.prev)},preload:function(n){this.preloaded.indexOf(n)===-1&&(n.ContentID&&((new Image).src="/api/AppAPI/GetImage/"+n.ContentID),this.preloaded.push(n))},loaded:function(){this.waiting=!1;this.loadedOne=!0}},computed:{index:function(){return this.photos.indexOf(this.current)},count:function(){return this.photos.length},has_next:function(){return this.index<this.count-1},has_prev:function(){return this.index>0},next:function(){return this.has_next?this.photos[this.index+1]:null},prev:function(){return this.has_prev?this.photos[this.index-1]:null}},mounted:function(){this.preloaded.push(this.current);this.has_next&&this.preload(this.next);this.has_prev&&this.preload(this.prev)},watch:{current:function(){this.has_next&&this.preload(this.next);this.has_prev&&this.preload(this.prev);this.waiting=!0}}},photodisplay={props:["photo","canremove"],data:function(){return{iOSSafari:!!window.navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&!!window.navigator.userAgent.match(/AppleWebKit/)}},template:'\n        <div class="photo">\n            <button v-if="!photo.Removing && canremove && iOSSafari" type="button" title="Remove" class="panel-close-button" v-on:click="$emit(\'remove\',photo)">X<\/button>\n            <button v-else-if="!photo.Removing && canremove && !iOSSafari" type="button" title="Remove" class="panel-close-button" v-on:click="$emit(\'remove\',photo)">&#10006<\/button>\n            <button v-else-if="photo.Removing" type="button" title="Removing" class="panel-close-button"><svg xmlns="http://www.w3.org/2000/svg" class="c-spinner" width="17" height="17"><path fill="none" stroke="#ffffff" stroke-width="1.75" d="M8.5 2A6.5 6.5 0 0 0 2 8.5"/><\/svg><\/button>\n            <div v-if="!photo.Loaded" :id="\'spinner_\'+photo.ID" class="spinner">Loading...<\/div>\n            <img v-if="photo.ContentID" :data-spinner="\'spinner_\'+photo.ID" :id="photo.ID" :src="\'/api/AppAPI/GetImage/TN/\' + photo.ContentID" v-on:load="loaded" v-on:click="$emit(\'show\', photo)" /> \n            <img  v-if="photo.Data" :data-spinner="\'spinner_\'+photo.ID" :id="photo.ID" :src="photo.Data" v-on:load="loaded" v-on:click="$emit(\'show\', photo)"/>\n        <\/div>\n    ',methods:{loaded:function(){this.photo.Loaded=!0}}},photopanel={props:["editor"],components:{photo:photodisplay,controls:controlrow,subheading:subheading,lightbox:editorLightbox,spinnerbutton:spinnerbutton},data:function(){return{showing:!1,displaying:null,current:null,askpermission:!1,asktodelete:!1,phototodelete:null,savebuttontext:this.editor.IsCreateMode?"Create facility":"Save photos",finalsavebuttontext:"I agree",finalcancelbuttontext:"Cancel",photoTermsAndConditions:MainEditorManager.PhotoTermsAndConditions}},computed:{counttext:{get:function(){return(this.editor.Facility.Photos.length==4?"Maximum number of photos uploaded.":this.editor.Facility.Photos.length+" of 4 photos uploaded.")+" Press '"+this.savebuttontext+"' to upload your photos."}},saving:{get:function(){return MainEditorManager.CreateMode?MainEditorManager.CreateNew.Saving:this.editor.Saving}}},template:'\n        <div v-if="askpermission">\n            <p><b>Terms & Conditions:<\/b> {{photoTermsAndConditions}}<\/p>\n            <controls v-bind:editor="editor" :updatetext="finalsavebuttontext" :createtext="finalsavebuttontext" v-on:save="save" :nocancel="true">\n                <template v-slot:append><spinnerbutton v-on:click="cancelsave" type="button" :text="finalcancelbuttontext" :disabled="saving" :islight="true"><\/spinnerbutton><\/template>\n            <\/controls>\n        <\/div>\n        <div v-else-if="asktodelete">\n            <p>Are you sure you want to delete the photo?<\/p>\n            <div class="photos-list">\n                <photo :photo="phototodelete" v-on:show="showPhoto"><\/photo>\n            <\/div>\n            <controls v-bind:editor="editor" :nosave="true" :nocancel="true">\n                <spinnerbutton v-on:click="dodelete" type="button" text="Delete" :disabled="phototodelete.Removing"><\/spinnerbutton>\n                <spinnerbutton v-on:click="canceldelete" type="button" text="Cancel" :disabled="phototodelete.Removing" :islight="true"><\/spinnerbutton>\n            <\/controls>\n            <lightbox v-if="showing" v-on:close-lightbox="closeLightbox" :photos="displaying" :photo="current"><\/lightbox>\n        <\/div>\n        <div v-else>\n            <h2 v-if="editor.Facility.ExistingPhotos.length>0">Existing photos<\/h2>\n            <p v-if="(editor.Facility.ExistingPhotos.length>0) && (editor.IsTrusted || editor.IsProvider)">Click on an <span class="font-weight-bold">&#10006<\/span> to remove an existing photo.<\/p>\n            <div class="photos-list">\n                <photo v-for="p in editor.Facility.VisibleExistingPhotos" :key="p.ID" :photo="p" :canremove="(editor.IsTrusted || editor.IsProvider)" v-on:remove="remove" v-on:show="showPhoto"><\/photo>\n            <\/div>\n            <h2>New photos (maximum of 4)<\/h2>\n            <p>Press \'{{savebuttontext}}\' to add them to this facility. Photos will be reviewed before publication.<\/p>                        \n            <p v-if="(editor.Facility.Photos.length>0)">Click on an <span class="font-weight-bold">&#10006<\/span> to remove a photo.<\/p>\n            <div class="photos-list">\n                <photo v-for="p in editor.Facility.Photos" :key="p.ID" :photo="p" :canremove="true" v-on:remove="remove" v-on:show="showPhoto"><\/photo>\n            <\/div>\n            <input v-show="false" id="photoloader" type="file" accept="image/*" v-on:change="showNewImage" />\n            <controls v-bind:editor="editor" :updatetext="savebuttontext" :createtext="savebuttontext" :emitsave="true" :emitcreate="true" v-on:save="startsave" v-on:create="startcreate" :nosave="editor.Facility.Photos.length==0 && !editor.IsCreateMode">\n                <spinnerbutton v-if="editor.Facility.Photos.length<4" type="button" :islight="editor.Facility.Photos.length>0" v-on:click="launchphotoloader" :disabled="saving" :text="\'Upload photo\'"><\/spinnerbutton>\n            <\/controls>            \n            <p><b>Terms & Conditions:<\/b> {{photoTermsAndConditions}}<\/p>\n            <lightbox v-if="showing" v-on:close-lightbox="closeLightbox" :photos="displaying" :photo="current"><\/lightbox>\n        <\/div>\n    ',methods:{launchphotoloader:function(){document.getElementById("photoloader").click()},showNewImage:function(n){var r=this,t,i;n.target.files.length>0&&(t=n.target.files[0],t.size>Number(document.getElementById("MaxFileUploadSize").value)?Messages.display(MessageType.error,"Photo upload","The photo you have selected is too large. Try again with a smaller photo.",1e4):t.type=="image/tiff"?Messages.display(MessageType.error,"Photo upload","Tiff files are not supported. Try a different photo.",1e4):(i=new FileReader,i.readAsDataURL(t),i.onload=function(n){var i=new Photo;i.Data=n.target.result;i.Image=t;i.Number=r.getNewNumber();i.ID="newphoto_"+i.Number;r.editor.Facility.Photos.push(i)}))},startsave:function(){this.editor.validate()&&(this.askpermission=!0)},startcreate:function(){this.editor.Facility.Photos.length>0?MainEditorManager.CreateNew.validate()&&(this.askpermission=!0):this.save()},save:function(){var n=this,i=MainEditorManager.CreateMode,t=MainEditorManager.CreateMode?MainEditorManager.CreateNew:this.editor;t.Saving=!0;t.save().then(function(t){t.Dependents&&t.Dependents.forEach(function(t){var i=new Photo;i.ContentID=t;n.editor.Facility.ExistingPhotos=[i].concat(n.editor.Facility.ExistingPhotos)});n.editor.Facility.Photos=[];i?MainEditorManager.ShowCompetition||hidePanel("create-panel"):MainEditorManager.EnterCompactMode()},function(){}).finally(function(){t.Saving=!1})},remove:function(n){n.ContentID?(this.asktodelete=!0,this.phototodelete=n):this.editor.Facility.Photos=this.editor.Facility.Photos.filter(function(t){return t.ID!==n.ID})},dodelete:function(){var n=this;this.phototodelete.Removing=!0;MainEditorManager.removePhoto(this.phototodelete).then(function(){n.asktodelete=!1;n.phototodelete=null},function(){}).finally(function(){n.phototodelete.Removing=!1})},getNewNumber:function(){return this.editor.Facility.Photos.length===0?0:Math.max.apply(Math,_toConsumableArray(this.editor.Facility.Photos.map(function(n){return n.Number})))+1},closeLightbox:function(){this.showing=!1},showPhoto:function(n){this.displaying=this.editor.Facility.ExistingPhotos.indexOf(n)>-1?this.editor.Facility.ExistingPhotos:this.editor.Facility.Photos;this.current=n;this.showing=!0},cancelsave:function(){this.askpermission=!1},canceldelete:function(){this.asktodelete=!1}},mounted:function(){var n=this;MainEditorManager.getPhotoTermsAndConditions().then(function(t){n.photoTermsAndConditions=t})}},photosummary={props:["editor","pfacility"],components:{photos:DetailsPhotos},computed:{pretendFacility:{get:function(){return{gids:this.editor.Facility.VisibleExistingPhotos.map(function(n){return n.ContentID}),photoUri:this.pfacility==null?"":this.pfacility.photoUri,thumbnailUri:this.pfacility==null?"":this.pfacility.thumbnailUri}}}},template:'        \n        <div class="index-section index-section-enabled" v-on:click="click" tabindex="0" v-on:keyup.enter="click">\n            <h2 class="float-right text-danger">Update<\/h2>\n            <photos :facility="pretendFacility"><\/photos>\n            <p v-if="editor.Facility.ExistingPhotos.length==0">No photos for this facility<\/p>\n        <\/div>\n    ',methods:{click:function(){MainEditorManager.EnterDetailsMode();this.editor.Show=!0}}};ShareMap=function(){function n(){_classCallCheck(this,n);this.Title=null;this.MapKey=null;this.Saving=!1;this.MapButtonInitiated=!1;this.Validators=new ValidatorCollection([new Validator("Title",function(n){return n.Title===null||n.Title.trim()===""?new ValidationResult(!1,"You must enter a description for the map."):app.isTextLinkFree(n.Title)?app.isTextTagFree(n.Title)?new ValidationResult(!0,""):new ValidationResult(!1,"Invalid characters."):new ValidationResult(!1,"Links are not allowed for the map description - please remove your link before sharing.")},!0)]);this._showMapButton=_.debounce(function(){this.MapButtonInitiated=!0},1e3)}return _createClass(n,[{key:"ShowMapButton",value:function(){this._showMapButton()}},{key:"Validate",value:function(){return this.Validators.ValidateWithCheck(this)}},{key:"Save",value:function(){var n=this;if(this.Saving=!0,this.Validate()){var i=app.overriddenSearchMask,r=typeof app.current.lat=="function"?app.current.lat():app.current.lat,u=typeof app.current.lng=="function"?app.current.lng():app.current.lng,f=app.map.getBounds(),t=f.toSpan();Vue.http.post("/api/AppAPI/SaveCustomMap",{Title:this.Title,Lat:r,Lon:u,LatDegrees:Math.max(1e-5,t.lat()),LonDegrees:Math.max(1e-5,t.lng()),SearchMask:i,AppType:"Mobile"}).then(function(t){t.json().then(function(t){n.MapKey=t.MapKey;var i=new CustomMap(n.MapKey,n.Title);i.like();app.myMaps.push(i);Messages.display(MessageType.info,null,t.Msg)})},function(n){app.previousRequestAborted||(Messages.display(MessageType.error,null,"Unable to connect to the Toilet Map server.",1e4),console.log(n));n.status!==0&&typeof Sentry!="undefined"&&Sentry.captureException(n)}).finally(function(){n.Saving=!1})}else this.Saving=!1}},{key:"CopyWebLink",value:function(){this.MapKey&&navigator.clipboard.writeText(this.MapFullURL).then(function(){Messages.display(MessageType.info,null,"Map weblink has been copied to your clipboard.",1e4)},function(){Messages.display(MessageType.error,null,"You have not granted permission to copy to the clipboard.",1e4)})}},{key:"CopyQRCode",value:function(){this.MapKey&&fetch(this.QRURL).then(function(n){n.blob().then(function(n){navigator.clipboard.write([new ClipboardItem({"image/png":n})]).then(function(){Messages.display(MessageType.info,null,"Map QR code has been copied to your clipboard.",1e4)},function(){Messages.display(MessageType.error,null,"You have not granted permission to copy to the clipboard.",1e4)})},function(){Messages.display(MessageType.error,null,"Failed to copy to the clipboard.",1e4)})},function(){Messages.display(MessageType.error,null,"Failed to copy to the clipboard.",1e4)})}},{key:"MapURL",get:function(){return this.MapKey?"/map/"+this.MapKey.toLowerCase():null}},{key:"QRURL",get:function(){return this.MapKey?"/app/GenerateQRCodeForMap/"+this.MapKey.toLowerCase():null}},{key:"MapFullURL",get:function(){return this.MapKey?window.location.origin+"/map/"+this.MapKey.toLowerCase():null}},{key:"QRFullURL",get:function(){return this.MapKey?window.location.origin+"/app/GenerateQRCodeForMap/"+this.MapKey.toLowerCase():null}},{key:"CanUseCopyQRCode",get:function(){return typeof ClipboardItem!="undefined"}}]),n}();CustomMap=function(){function n(t,i){_classCallCheck(this,n);this.MapKey=t;this.Title=i;this.liked=!1;this.iteration=0}return _createClass(n,[{key:"like",value:function(){var n=this;this.liked=!this.liked;this.liked?localforage.setItem("m_".concat(this.MapKey),Date.now()).then(function(){n.iteration+=1}):localforage.removeItem("m_".concat(this.MapKey)).then(function(){n.iteration+=1})}},{key:"dislike",value:function(){var n=this;this.liked=!1;localforage.removeItem("m_".concat(this.MapKey)).then(function(){n.iteration+=1})}},{key:"isLiked",get:function(){return this.liked}}]),n}();!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this;t.localforage=n()}}(function(){return function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){var i=t[f][1][n];return u(i||n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;f<r.length;f++)u(r[f]);return u}({1:[function(n,t){(function(n){function r(){e=!0;for(var n,r,t=i.length;t;){for(r=i,i=[],n=-1;++n<t;)r[n]();t=i.length}e=!1}function c(n){1!==i.push(n)||e||u()}var u,o=n.MutationObserver||n.WebKitMutationObserver,f,e,i;if(o){var s=0,l=new o(r),h=n.document.createTextNode("");l.observe(h,{characterData:!0});u=function(){h.data=s=++s%2}}else n.setImmediate||void 0===n.MessageChannel?u="document"in n&&"onreadystatechange"in n.document.createElement("script")?function(){var t=n.document.createElement("script");t.onreadystatechange=function(){r();t.onreadystatechange=null;t.parentNode.removeChild(t);t=null};n.document.documentElement.appendChild(t)}:function(){setTimeout(r,0)}:(f=new n.MessageChannel,f.port1.onmessage=r,u=function(){f.port2.postMessage(0)});i=[];t.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(n,t){function u(){}function r(n){if("function"!=typeof n)throw new TypeError("resolver must be a function");this.state=l;this.queue=[];this.outcome=void 0;n!==u&&s(this,n)}function f(n,t,i){this.promise=n;"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled);"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function e(n,t,r){b(function(){var u;try{u=t(r)}catch(t){return i.reject(n,t)}u===n?i.reject(n,new TypeError("Cannot resolve promise with itself")):i.resolve(n,u)})}function a(n){var t=n&&n.then;if(n&&("object"==typeof n||"function"==typeof n)&&"function"==typeof t)return function(){t.apply(n,arguments)}}function s(n,t){function u(t){r||(r=!0,i.reject(n,t))}function e(t){r||(r=!0,i.resolve(n,t))}function o(){t(e,u)}var r=!1,f=h(o);"error"===f.status&&u(f.value)}function h(n,t){var i={};try{i.value=n(t);i.status="success"}catch(n){i.status="error";i.value=n}return i}function v(n){return n instanceof this?n:i.resolve(new this(u),n)}function y(n){var t=new this(u);return i.reject(t,n)}function p(n){function s(n,u){function f(n){o[u]=n;++c!==t||r||(r=!0,i.resolve(e,o))}h.resolve(n).then(f,function(n){r||(r=!0,i.reject(e,n))})}var h=this,t,r;if("[object Array]"!==Object.prototype.toString.call(n))return this.reject(new TypeError("must be an array"));if(t=n.length,r=!1,!t)return this.resolve([]);for(var o=new Array(t),c=0,f=-1,e=new this(u);++f<t;)s(n[f],f);return e}function w(n){function o(n){s.resolve(n).then(function(n){t||(t=!0,i.resolve(r,n))},function(n){t||(t=!0,i.reject(r,n))})}var s=this,f,t,e,r;if("[object Array]"!==Object.prototype.toString.call(n))return this.reject(new TypeError("must be an array"));if(f=n.length,t=!1,!f)return this.resolve([]);for(e=-1,r=new this(u);++e<f;)o(n[e]);return r}var b=n(1),i={},c=["REJECTED"],o=["FULFILLED"],l=["PENDING"];t.exports=r;r.prototype.catch=function(n){return this.then(null,n)};r.prototype.then=function(n,t){if("function"!=typeof n&&this.state===o||"function"!=typeof t&&this.state===c)return this;var i=new this.constructor(u);return this.state!==l?e(i,this.state===o?n:t,this.outcome):this.queue.push(new f(i,n,t)),i};f.prototype.callFulfilled=function(n){i.resolve(this.promise,n)};f.prototype.otherCallFulfilled=function(n){e(this.promise,this.onFulfilled,n)};f.prototype.callRejected=function(n){i.reject(this.promise,n)};f.prototype.otherCallRejected=function(n){e(this.promise,this.onRejected,n)};i.resolve=function(n,t){var r=h(a,t),u,f,e;if("error"===r.status)return i.reject(n,r.value);if(u=r.value,u)s(n,u);else for(n.state=o,n.outcome=t,f=-1,e=n.queue.length;++f<e;)n.queue[f].callFulfilled(t);return n};i.reject=function(n,t){n.state=c;n.outcome=t;for(var i=-1,r=n.queue.length;++i<r;)n.queue[i].callRejected(t);return n};r.resolve=v;r.reject=y;r.all=p;r.race=w},{1:1}],3:[function(n){(function(t){"function"!=typeof t.Promise&&(t.Promise=n(2))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(n,t){function yi(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function pi(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(n){return}}function wi(){try{if(!c||!c.open)return!1;var n="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!n||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(n){return!1}}function k(n,t){n=n||[];t=t||{};try{return new Blob(n,t)}catch(r){if("TypeError"!==r.name)throw r;for(var f="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,u=new f,i=0;i<n.length;i+=1)u.append(n[i]);return u.getBlob(t.type)}}function r(n,t){t&&n.then(function(n){t(null,n)},function(n){t(n)})}function h(n,t,i){"function"==typeof t&&n.then(t);"function"==typeof i&&n.catch(i)}function f(n){return"string"!=typeof n&&(console.warn(n+" used as a key, but it is not a string."),n=String(n)),n}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function bi(n){for(var i=n.length,r=new ArrayBuffer(i),u=new Uint8Array(r),t=0;t<i;t++)u[t]=n.charCodeAt(t);return r}function ki(n){return new i(function(t){var i=n.transaction(ft,p),r=k([""]);i.objectStore(ft).put(r,"key");i.onabort=function(n){n.preventDefault();n.stopPropagation();t(!1)};i.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);t(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function di(n){return"boolean"==typeof et?i.resolve(et):ki(n).then(function(n){return et=n})}function y(n){var r=u[n.name],t={};t.promise=new i(function(n,i){t.resolve=n;t.reject=i});r.deferredOperations.push(t);r.dbReady=r.dbReady?r.dbReady.then(function(){return t.promise}):t.promise}function g(n){var i=u[n.name],t=i.deferredOperations.pop();if(t)return t.resolve(),t.promise}function nt(n,t){var r=u[n.name],i=r.deferredOperations.pop();if(i)return i.reject(t),i.promise}function at(n,t){return new i(function(i,r){var e,f;if(u[n.name]=u[n.name]||wt(),n.db){if(!t)return i(n.db);y(n);n.db.close()}e=[n.name];t&&e.push(n.version);f=c.open.apply(c,e);t&&(f.onupgradeneeded=function(t){var i=f.result;try{i.createObjectStore(n.storeName);t.oldVersion<=1&&i.createObjectStore(ft)}catch(i){if("ConstraintError"!==i.name)throw i;console.warn('The database "'+n.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+n.storeName+'" already exists.')}});f.onerror=function(n){n.preventDefault();r(f.error)};f.onsuccess=function(){i(f.result);g(n)}})}function tt(n){return at(n,!1)}function it(n){return at(n,!0)}function vt(n,t){var i;if(!n.db)return!0;var r=!n.db.objectStoreNames.contains(n.storeName),u=n.version<n.db.version,f=n.version>n.db.version;return(u&&(n.version!==t&&console.warn('The database "'+n.name+"\" can't be downgraded from version "+n.db.version+" to version "+n.version+"."),n.version=n.db.version),f||r)?(r&&(i=n.db.version+1,i>n.version&&(n.version=i)),!0):!1}function gi(n){return new i(function(t,i){var r=new FileReader;r.onerror=i;r.onloadend=function(i){var r=btoa(i.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:n.type})};r.readAsBinaryString(n)})}function yt(n){return k([bi(atob(n.data))],{type:n.type})}function pt(n){return n&&n.__local_forage_encoded_blob}function nr(n){var t=this,i=t._initReady().then(function(){var n=u[t._dbInfo.name];if(n&&n.dbReady)return n.dbReady});return h(i,n,n),i}function tr(n){var i;y(n);for(var f=u[n.name],t=f.forages,r=0;r<t.length;r++)i=t[r],i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null);return n.db=null,tt(n).then(function(t){return n.db=t,vt(n)?it(n):t}).then(function(i){n.db=f.db=i;for(var r=0;r<t.length;r++)t[r]._dbInfo.db=i}).catch(function(t){throw nt(n,t),t;})}function e(n,t,r,u){void 0===u&&(u=1);try{var f=n.db.transaction(n.storeName,t);r(null,f)}catch(f){if(u>0&&(!n.db||"InvalidStateError"===f.name||"NotFoundError"===f.name))return i.resolve().then(function(){if(!n.db||"NotFoundError"===f.name&&!n.db.objectStoreNames.contains(n.storeName)&&n.version<=n.db.version)return n.db&&(n.version=n.db.version+1),it(n)}).then(function(){return tr(n).then(function(){e(n,t,r,u-1)})}).catch(r);r(f)}}function wt(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ir(n){function l(){return i.resolve()}var f=this,t={db:null},o,r,s,e,h,c;if(n)for(o in n)t[o]=n[o];for(r=u[t.name],r||(r=wt(),u[t.name]=r),r.forages.push(f),f._initReady||(f._initReady=f.ready,f.ready=nr),s=[],e=0;e<r.forages.length;e++)h=r.forages[e],h!==f&&s.push(h._initReady().catch(l));return c=r.forages.slice(0),i.all(s).then(function(){return t.db=r.db,tt(t)}).then(function(n){return t.db=n,vt(t,f._defaultConfig.version)?it(t):n}).then(function(n){var i,u;for(t.db=r.db=n,f._dbInfo=t,i=0;i<c.length;i++)u=c[i],u!==f&&(u._dbInfo.db=t.db,u._dbInfo.version=t.version)})}function rr(n,t){var u=this,o;return n=f(n),o=new i(function(t,i){u.ready().then(function(){e(u._dbInfo,a,function(r,f){if(r)return i(r);try{var o=f.objectStore(u._dbInfo.storeName),e=o.get(n);e.onsuccess=function(){var n=e.result;void 0===n&&(n=null);pt(n)&&(n=yt(n));t(n)};e.onerror=function(){i(e.error)}}catch(n){i(n)}})}).catch(i)}),r(o,t),o}function ur(n,t){var u=this,f=new i(function(t,i){u.ready().then(function(){e(u._dbInfo,a,function(r,f){if(r)return i(r);try{var o=f.objectStore(u._dbInfo.storeName),e=o.openCursor(),s=1;e.onsuccess=function(){var r=e.result,i,u;r?(i=r.value,pt(i)&&(i=yt(i)),u=n(i,r.key,s++),void 0!==u?t(u):r.continue()):t()};e.onerror=function(){i(e.error)}}catch(n){i(n)}})}).catch(i)});return r(f,t),f}function fr(n,t,u){var o=this,s;return n=f(n),s=new i(function(i,r){var u;o.ready().then(function(){return u=o._dbInfo,"[object Blob]"===gu.call(t)?di(u.db).then(function(n){return n?t:gi(t)}):t}).then(function(t){e(o._dbInfo,p,function(u,f){var s,e;if(u)return r(u);try{s=f.objectStore(o._dbInfo.storeName);null===t&&(t=void 0);e=s.put(t,n);f.oncomplete=function(){void 0===t&&(t=null);i(t)};f.onabort=f.onerror=function(){var n=e.error?e.error:e.transaction.error;r(n)}}catch(n){r(n)}})}).catch(r)}),r(s,u),s}function er(n,t){var u=this,o;return n=f(n),o=new i(function(t,i){u.ready().then(function(){e(u._dbInfo,p,function(r,f){if(r)return i(r);try{var o=f.objectStore(u._dbInfo.storeName),e=o.delete(n);f.oncomplete=function(){t()};f.onerror=function(){i(e.error)};f.onabort=function(){var n=e.error?e.error:e.transaction.error;i(n)}}catch(n){i(n)}})}).catch(i)}),r(o,t),o}function or(n){var t=this,u=new i(function(n,i){t.ready().then(function(){e(t._dbInfo,p,function(r,u){if(r)return i(r);try{var e=u.objectStore(t._dbInfo.storeName),f=e.clear();u.oncomplete=function(){n()};u.onabort=u.onerror=function(){var n=f.error?f.error:f.transaction.error;i(n)}}catch(n){i(n)}})}).catch(i)});return r(u,n),u}function sr(n){var t=this,u=new i(function(n,i){t.ready().then(function(){e(t._dbInfo,a,function(r,u){if(r)return i(r);try{var e=u.objectStore(t._dbInfo.storeName),f=e.count();f.onsuccess=function(){n(f.result)};f.onerror=function(){i(f.error)}}catch(n){i(n)}})}).catch(i)});return r(u,n),u}function hr(n,t){var u=this,f=new i(function(t,i){if(n<0)return void t(null);u.ready().then(function(){e(u._dbInfo,a,function(r,f){if(r)return i(r);try{var s=f.objectStore(u._dbInfo.storeName),o=!1,e=s.openKeyCursor();e.onsuccess=function(){var i=e.result;if(!i)return void t(null);0===n?t(i.key):o?t(i.key):(o=!0,i.advance(n))};e.onerror=function(){i(e.error)}}catch(n){i(n)}})}).catch(i)});return r(f,t),f}function cr(n){var t=this,u=new i(function(n,i){t.ready().then(function(){e(t._dbInfo,a,function(r,u){if(r)return i(r);try{var o=u.objectStore(t._dbInfo.storeName),f=o.openKeyCursor(),e=[];f.onsuccess=function(){var t=f.result;if(!t)return void n(e);e.push(t.key);t.continue()};f.onerror=function(){i(f.error)}}catch(n){i(n)}})}).catch(i)});return r(u,n),u}function lr(n,t){var f,e,o,h,s;return t=d.apply(this,arguments),f=this.config(),n="function"!=typeof n&&n||{},n.name||(n.name=n.name||f.name,n.storeName=n.storeName||f.storeName),o=this,n.name?(h=n.name===f.name&&o._dbInfo.db,s=h?i.resolve(o._dbInfo.db):tt(n).then(function(t){var r=u[n.name],f=r.forages,i;for(r.db=t,i=0;i<f.length;i++)f[i]._dbInfo.db=t;return t}),e=n.storeName?s.then(function(t){var e,o,r,f,s;if(t.objectStoreNames.contains(n.storeName)){for(e=t.version+1,y(n),o=u[n.name],r=o.forages,t.close(),f=0;f<r.length;f++)s=r[f],s._dbInfo.db=null,s._dbInfo.version=e;return new i(function(t,i){var r=c.open(n.name,e);r.onerror=function(n){r.result.close();i(n)};r.onupgradeneeded=function(){r.result.deleteObjectStore(n.storeName)};r.onsuccess=function(){var n=r.result;n.close();t(n)}}).then(function(n){var t,i;for(o.db=n,t=0;t<r.length;t++)i=r[t],i._dbInfo.db=n,g(i._dbInfo)}).catch(function(t){throw(nt(n,t)||i.resolve()).catch(function(){}),t;})}}):s.then(function(t){var e,r,f;for(y(n),e=u[n.name],r=e.forages,t.close(),f=0;f<r.length;f++)r[f]._dbInfo.db=null;return new i(function(t,i){var r=c.deleteDatabase(n.name);r.onerror=r.onblocked=function(n){var t=r.result;t&&t.close();i(n)};r.onsuccess=function(){var n=r.result;n&&n.close();t(n)}}).then(function(n){e.db=n;for(var t=0;t<r.length;t++)g(r[t]._dbInfo)}).catch(function(t){throw(nt(n,t)||i.resolve()).catch(function(){}),t;})})):e=i.reject("Invalid arguments"),r(e,t),e}function ar(){return"function"==typeof openDatabase}function bt(n){var t,h,r,u,c,f=.75*n.length,l=n.length,e=0,o,i;for("="===n[n.length-1]&&(f--,"="===n[n.length-2]&&f--),o=new ArrayBuffer(f),i=new Uint8Array(o),t=0;t<l;t+=4)h=s.indexOf(n[t]),r=s.indexOf(n[t+1]),u=s.indexOf(n[t+2]),c=s.indexOf(n[t+3]),i[e++]=h<<2|r>>4,i[e++]=(15&r)<<4|u>>2,i[e++]=(3&u)<<6|63&c;return o}function rt(n){for(var r=new Uint8Array(n),t="",i=0;i<r.length;i+=3)t+=s[r[i]>>2],t+=s[(3&r[i])<<4|r[i+1]>>4],t+=s[(15&r[i+1])<<2|r[i+2]>>6],t+=s[63&r[i+2]];return r.length%3==2?t=t.substring(0,t.length-1)+"=":r.length%3==1&&(t=t.substring(0,t.length-2)+"=="),t}function vr(n,t){var i="",u,r,f;if(n&&(i=li.call(n)),n&&("[object ArrayBuffer]"===i||n.buffer&&"[object ArrayBuffer]"===li.call(n.buffer)))r=w,n instanceof ArrayBuffer?(u=n,r+=st):(u=n.buffer,"[object Int8Array]"===i?r+=ti:"[object Uint8Array]"===i?r+=ii:"[object Uint8ClampedArray]"===i?r+=ri:"[object Int16Array]"===i?r+=ui:"[object Uint16Array]"===i?r+=ei:"[object Int32Array]"===i?r+=fi:"[object Uint32Array]"===i?r+=oi:"[object Float32Array]"===i?r+=si:"[object Float64Array]"===i?r+=hi:t(new Error("Failed to get type for BinaryArray"))),t(r+rt(u));else if("[object Blob]"===i)f=new FileReader,f.onload=function(){var i=tf+n.type+"~"+rt(this.result);t(w+ht+i)},f.readAsArrayBuffer(n);else try{t(JSON.stringify(n))}catch(i){console.error("Couldn't convert value into a JSON string: ",n);t(null,i)}}function yr(n){var f,i,r,u,t;if(n.substring(0,ot)!==w)return JSON.parse(n);i=n.substring(ci);r=n.substring(ot,ci);r===ht&&ni.test(i)&&(u=i.match(ni),f=u[1],i=i.substring(u[0].length));t=bt(i);switch(r){case st:return t;case ht:return k([t],{type:f});case ti:return new Int8Array(t);case ii:return new Uint8Array(t);case ri:return new Uint8ClampedArray(t);case ui:return new Int16Array(t);case ei:return new Uint16Array(t);case fi:return new Int32Array(t);case oi:return new Uint32Array(t);case si:return new Float32Array(t);case hi:return new Float64Array(t);default:throw new Error("Unkown type: "+r);}}function kt(n,t,i,r){n.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,r)}function pr(n){var f=this,t={db:null},r,u;if(n)for(r in n)t[r]="string"!=typeof n[r]?n[r].toString():n[r];return u=new i(function(n,i){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(n){return i(n)}t.db.transaction(function(r){kt(r,t,function(){f._dbInfo=t;n()},function(n,t){i(t)})},i)}),t.serializer=ct,u}function o(n,t,i,r,u,f){n.executeSql(i,r,u,function(n,e){e.code===e.SYNTAX_ERR?n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(n,o){o.rows.length?f(n,e):kt(n,t,function(){n.executeSql(i,r,u,f)},f)},f):f(n,e)},f)}function wr(n,t){var e=this,u;return n=f(n),u=new i(function(t,i){e.ready().then(function(){var r=e._dbInfo;r.db.transaction(function(u){o(u,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[n],function(n,i){var u=i.rows.length?i.rows.item(0).value:null;u&&(u=r.serializer.deserialize(u));t(u)},function(n,t){i(t)})})}).catch(i)}),r(u,t),u}function br(n,t){var u=this,f=new i(function(t,i){u.ready().then(function(){var r=u._dbInfo;r.db.transaction(function(u){o(u,r,"SELECT * FROM "+r.storeName,[],function(i,u){for(var o,f,s=u.rows,h=s.length,e=0;e<h;e++)if(o=s.item(e),f=o.value,f&&(f=r.serializer.deserialize(f)),void 0!==(f=n(f,o.key,e+1)))return void t(f);t()},function(n,t){i(t)})})}).catch(i)});return r(f,t),f}function dt(n,t,u,e){var s=this,h;return n=f(n),h=new i(function(i,r){s.ready().then(function(){void 0===t&&(t=null);var h=t,f=s._dbInfo;f.serializer.serialize(t,function(t,c){c?r(c):f.db.transaction(function(u){o(u,f,"INSERT OR REPLACE INTO "+f.storeName+" (key, value) VALUES (?, ?)",[n,t],function(){i(h)},function(n,t){r(t)})},function(t){if(t.code===t.QUOTA_ERR){if(e>0)return void i(dt.apply(s,[n,h,u,e-1]));r(t)}})})}).catch(r)}),r(h,u),h}function kr(n,t,i){return dt.apply(this,[n,t,i,1])}function dr(n,t){var e=this,u;return n=f(n),u=new i(function(t,i){e.ready().then(function(){var r=e._dbInfo;r.db.transaction(function(u){o(u,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[n],function(){t()},function(n,t){i(t)})})}).catch(i)}),r(u,t),u}function gr(n){var t=this,u=new i(function(n,i){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){o(t,r,"DELETE FROM "+r.storeName,[],function(){n()},function(n,t){i(t)})})}).catch(i)});return r(u,n),u}function nu(n){var t=this,u=new i(function(n,i){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){o(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],function(t,i){var r=i.rows.item(0).c;n(r)},function(n,t){i(t)})})}).catch(i)});return r(u,n),u}function tu(n,t){var u=this,f=new i(function(t,i){u.ready().then(function(){var r=u._dbInfo;r.db.transaction(function(u){o(u,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[n+1],function(n,i){var r=i.rows.length?i.rows.item(0).key:null;t(r)},function(n,t){i(t)})})}).catch(i)});return r(f,t),f}function iu(n){var t=this,u=new i(function(n,i){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){o(t,r,"SELECT key FROM "+r.storeName,[],function(t,i){for(var u=[],r=0;r<i.rows.length;r++)u.push(i.rows.item(r).key);n(u)},function(n,t){i(t)})})}).catch(i)});return r(u,n),u}function ru(n){return new i(function(t,i){n.transaction(function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(i,r){for(var f=[],u=0;u<r.rows.length;u++)f.push(r.rows.item(u).name);t({db:n,storeNames:f})},function(n,t){i(t)})},function(n){i(n)})})}function uu(n,t){var u,f,e;return t=d.apply(this,arguments),u=this.config(),n="function"!=typeof n&&n||{},n.name||(n.name=n.name||u.name,n.storeName=n.storeName||u.storeName),e=this,f=n.name?new i(function(t){var i;i=n.name===u.name?e._dbInfo.db:openDatabase(n.name,"","",0);t(n.storeName?{db:i,storeNames:[n.storeName]}:ru(i))}).then(function(n){return new i(function(t,r){n.db.transaction(function(u){function o(n){return new i(function(t,i){u.executeSql("DROP TABLE IF EXISTS "+n,[],function(){t()},function(n,t){i(t)})})}for(var e=[],f=0,s=n.storeNames.length;f<s;f++)e.push(o(n.storeNames[f]));i.all(e).then(function(){t()}).catch(function(n){r(n)})},function(n){r(n)})})}):i.reject("Invalid arguments"),r(f,t),f}function fu(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(n){return!1}}function gt(n,t){var i=n.name+"/";return n.storeName!==t.storeName&&(i+=n.storeName+"/"),i}function eu(){var n="_localforage_support_test";try{return localStorage.setItem(n,!0),localStorage.removeItem(n),!1}catch(n){return!0}}function ou(){return!eu()||localStorage.length>0}function su(n){var u=this,t={},r;if(n)for(r in n)t[r]=n[r];return t.keyPrefix=gt(n,u._defaultConfig),ou()?(u._dbInfo=t,t.serializer=ct,i.resolve()):i.reject()}function hu(n){var t=this,i=t.ready().then(function(){for(var i,r=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--)i=localStorage.key(n),0===i.indexOf(r)&&localStorage.removeItem(i)});return r(i,n),i}function cu(n,t){var u=this,i;return n=f(n),i=u.ready().then(function(){var i=u._dbInfo,t=localStorage.getItem(i.keyPrefix+n);return t&&(t=i.serializer.deserialize(t)),t}),r(i,t),i}function lu(n,t){var i=this,u=i.ready().then(function(){for(var r,t,f=i._dbInfo,e=f.keyPrefix,o=e.length,s=localStorage.length,h=1,u=0;u<s;u++)if(r=localStorage.key(u),0===r.indexOf(e)&&(t=localStorage.getItem(r),t&&(t=f.serializer.deserialize(t)),void 0!==(t=n(t,r.substring(o),h++))))return t});return r(u,t),u}function au(n,t){var i=this,u=i.ready().then(function(){var t,r=i._dbInfo;try{t=localStorage.key(n)}catch(n){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t});return r(u,t),u}function vu(n){var t=this,i=t.ready().then(function(){for(var i,r=t._dbInfo,f=localStorage.length,u=[],n=0;n<f;n++)i=localStorage.key(n),0===i.indexOf(r.keyPrefix)&&u.push(i.substring(r.keyPrefix.length));return u});return r(i,n),i}function yu(n){var i=this,t=i.keys().then(function(n){return n.length});return r(t,n),t}function pu(n,t){var u=this,i;return n=f(n),i=u.ready().then(function(){var t=u._dbInfo;localStorage.removeItem(t.keyPrefix+n)}),r(i,t),i}function wu(n,t,u){var o=this,e;return n=f(n),e=o.ready().then(function(){void 0===t&&(t=null);var r=t;return new i(function(i,u){var f=o._dbInfo;f.serializer.serialize(t,function(t,e){if(e)u(e);else try{localStorage.setItem(f.keyPrefix+n,t);i(r)}catch(n){"QuotaExceededError"!==n.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==n.name||u(n);u(n)}})})}),r(e,u),e}function bu(n,t){var u,f,e;return(t=d.apply(this,arguments),n="function"!=typeof n&&n||{},n.name)||(u=this.config(),n.name=n.name||u.name,n.storeName=n.storeName||u.storeName),e=this,f=n.name?new i(function(t){t(n.storeName?gt(n,e._defaultConfig):n.name+"/")}).then(function(n){for(var i,t=localStorage.length-1;t>=0;t--)i=localStorage.key(t),0===i.indexOf(n)&&localStorage.removeItem(i)}):i.reject("Invalid arguments"),r(f,t),f}function ku(n,t){n[t]=function(){var i=arguments;return n.ready().then(function(){return n[t].apply(n,i)})}}function ut(){for(var n,t,i=1;i<arguments.length;i++)if(n=arguments[i],n)for(t in n)n.hasOwnProperty(t)&&(arguments[0][t]=ai(n[t])?n[t].slice():n[t]);return arguments[0]}var du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},c=pi();"undefined"==typeof Promise&&n(3);var i=Promise,ft="local-forage-detect-blob-support",et=void 0,u={},gu=Object.prototype.toString,a="readonly",p="readwrite",nf={_driver:"asyncStorage",_initStorage:ir,_support:wi(),iterate:ur,getItem:rr,setItem:fr,removeItem:er,clear:or,length:sr,key:hr,keys:cr,dropInstance:lr},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tf="~~local_forage_type~",ni=/^~~local_forage_type~([^~]+)~/,w="__lfsc__:",ot=w.length,st="arbf",ht="blob",ti="si08",ii="ui08",ri="uic8",ui="si16",fi="si32",ei="ur16",oi="ui32",si="fl32",hi="fl64",ci=ot+st.length,li=Object.prototype.toString,ct={serialize:vr,deserialize:yr,stringToBuffer:bt,bufferToString:rt},rf={_driver:"webSQLStorage",_initStorage:pr,_support:ar(),iterate:br,getItem:wr,setItem:kr,removeItem:dr,clear:gr,length:nu,key:tu,keys:iu,dropInstance:uu},uf={_driver:"localStorageWrapper",_initStorage:su,_support:fu(),iterate:lu,getItem:cu,setItem:wu,removeItem:pu,clear:hu,length:yu,key:au,keys:vu,dropInstance:bu},ff=function(n,t){return n===t||"number"==typeof n&&"number"==typeof t&&isNaN(n)&&isNaN(t)},ef=function(n,t){for(var r=n.length,i=0;i<r;){if(ff(n[i],t))return!0;i++}return!1},ai=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},v={},vi={},l={INDEXEDDB:nf,WEBSQL:rf,LOCALSTORAGE:uf},of=[l.INDEXEDDB._driver,l.WEBSQL._driver,l.LOCALSTORAGE._driver],b=["dropInstance"],lt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(b),sf={description:"",driver:of.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},hf=function(){function n(t){var i,r,u;yi(this,n);for(i in l)l.hasOwnProperty(i)&&(r=l[i],u=r._driver,this[i]=u,v[u]||this.defineDriver(r));this._defaultConfig=ut({},sf);this._config=ut({},this._defaultConfig,t);this._driverSet=null;this._initDriver=null;this._ready=!1;this._dbInfo=null;this._wrapLibraryMethodsWithReady();this.setDriver(this._config.driver).catch(function(){})}return n.prototype.config=function(n){if("object"===(void 0===n?"undefined":du(n))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in n){if("storeName"===t&&(n[t]=n[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof n[t])return new Error("Database version must be a number.");this._config[t]=n[t]}return!("driver"in n&&n.driver)||this.setDriver(this._config.driver)}return"string"==typeof n?this._config[n]:this._config},n.prototype.defineDriver=function(n,t,u){var f=new i(function(t,u){var f,s,e,o;try{if(f=n._driver,s=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"),!n._driver)return void u(s);for(var c=lt.concat("_initStorage"),h=0,l=c.length;h<l;h++)if(e=c[h],(!ef(b,e)||n[e])&&"function"!=typeof n[e])return void u(s);(function(){for(var t,f=function(n){return function(){var u=new Error("Method "+n+" is not implemented by the current driver"),t=i.reject(u);return r(t,arguments[arguments.length-1]),t}},u=0,e=b.length;u<e;u++)t=b[u],n[t]||(n[t]=f(t))})();o=function(i){v[f]&&console.info("Redefining LocalForage driver: "+f);v[f]=n;vi[f]=i;t()};"_support"in n?n._support&&"function"==typeof n._support?n._support().then(o,u):o(!!n._support):o(!0)}catch(n){u(n)}});return h(f,t,u),f},n.prototype.driver=function(){return this._driver||null},n.prototype.getDriver=function(n,t,r){var u=v[n]?i.resolve(v[n]):i.reject(new Error("Driver not found."));return h(u,t,r),u},n.prototype.getSerializer=function(n){var t=i.resolve(ct);return h(t,n),t},n.prototype.ready=function(n){var t=this,i=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return h(i,n,n),i},n.prototype.setDriver=function(n,t,r){function f(){u._config.driver=u.driver()}function s(n){return u._extend(n),f(),u._ready=u._initStorage(u._config),u._ready}function c(n){return function(){function r(){for(var e,o;t<n.length;)return e=n[t],t++,u._dbInfo=null,u._ready=null,u.getDriver(e).then(s).catch(r);return f(),o=new Error("No available storage method found."),u._driverSet=i.reject(o),u._driverSet}var t=0;return r()}}var u=this,e,o;return ai(n)||(n=[n]),e=this._getSupportedDrivers(n),o=null!==this._driverSet?this._driverSet.catch(function(){return i.resolve()}):i.resolve(),this._driverSet=o.then(function(){var n=e[0];return u._dbInfo=null,u._ready=null,u.getDriver(n).then(function(n){u._driver=n._driver;f();u._wrapLibraryMethodsWithReady();u._initDriver=c(e)})}).catch(function(){f();var n=new Error("No available storage method found.");return u._driverSet=i.reject(n),u._driverSet}),h(this._driverSet,t,r),this._driverSet},n.prototype.supports=function(n){return!!vi[n]},n.prototype._extend=function(n){ut(this,n)},n.prototype._getSupportedDrivers=function(n){for(var i,r=[],t=0,u=n.length;t<u;t++)i=n[t],this.supports(i)&&r.push(i);return r},n.prototype._wrapLibraryMethodsWithReady=function(){for(var n=0,t=lt.length;n<t;n++)ku(this,lt[n])},n.prototype.createInstance=function(t){return new n(t)},n}(),cf=new hf;t.exports=cf},{3:3}]},{},[4])(4)});"use strict";var MessageType={info:0,success:1,warning:2,error:3,site:4,rollover:5},_messageTimerHandle=null,_activeMessageType=null,Messages=function(){function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"messageTypeStyle",value:function(n){switch(n){case MessageType.info:return"message-info";case MessageType.success:return"message-";case MessageType.warning:return"message-warning";case MessageType.error:return"message-error";case MessageType.rollover:return"message-rollover"}}},{key:"currentMessageType",value:function(){return _activeMessageType}},{key:"display",value:function(t,i,r,u){var f=document.getElementById("message"),e=document.getElementById("message-content");_activeMessageType=t;f.className="";f.classList.add(n.messageTypeStyle(t));_messageTimerHandle&&(clearTimeout(_messageTimerHandle),_messageTimerHandle=null);e&&(e.innerHTML=i?"<h1>".concat(n.clean(i),"<\/h1>").concat(n.formatText(r)):n.formatText(r),f.classList.add("active"),u&&(_messageTimerHandle=setTimeout(function(){n.hide()},Number(u))))}},{key:"formatText",value:function(t){var i="";return Array.isArray(t)?t.forEach(function(t){i+="<p>".concat(n.clean(t),"<\/p>")}):i="<p>".concat(n.clean(t),"<\/p>"),i}},{key:"clean",value:function(n){return n.replace("<p>","").replace("<\/p>","")}},{key:"hide",value:function(){var n=document.getElementById("message");n&&n.classList.remove("active");_activeMessageType=null}}]),n}();start=initialLocations[Math.floor(Math.random()*Math.floor(initialLocations.length))];storageAvailable("localStorage")&&window.localStorage.start_lat&&window.localStorage.start_lng&&(start.lat=Number(window.localStorage.start_lat),start.lng=Number(window.localStorage.start_lng));var MapState={tracking:0,searching:1,panning:2,initial:3,provider:4,custom:5},OpenState={openNow:0,open24:1,all:2},app=new Vue({el:"#content",components:{FacilityHeader:FacilityHeader,FacilityListItem:FacilityListItem,PreferenceItem:PreferenceItem,PreferenceIcon:PreferenceIcon,FindItem:FindItem,DetailsProvider:DetailsProvider,DetailsToiletList:DetailsToiletList,DetailsAdultChangeList:DetailsAdultChangeList,DetailsBabyChangeList:DetailsBabyChangeList,DetailsDumpPointList:DetailsDumpPointList,DetailsAccessList:DetailsAccessList,DetailsAmenitiesList:DetailsAmenitiesList,DetailsPhotos:DetailsPhotos,EditorManager:managerpanel,Lightbox:Lightbox,AccountManager:accountPanel,spinnerbutton:spinnerbutton,login:loginpanel,register:registerpanel},data:{provider:null,providerName:null,toilets:[],myfacilities:[],distances:[],map:null,marker:null,state:MapState.initial,searchMask:storageAvailable("localStorage")&&window.localStorage.searchMask?window.localStorage.searchMask:defaultSearchMask,searchMaskOverride:storageAvailable("sessionStorage")&&window.sessionStorage.searchMaskOverride?window.sessionStorage.searchMaskOverride:0,originalCustomMapSearchMask:0,customMapSearchMask:0,customMapSearchMaskOverride:0,usingCustomMap:!1,customMapTitle:null,showMapDetails:!1,myMaps:[],bannerHidden:storageAvailable("sessionStorage")&&window.sessionStorage.bannerHidden,current:{lat:start.lat,lng:start.lng},my:{lat:start.lat,lng:start.lng},origin:{lat:start.lat,lng:start.lng},gps:{lat:start.lat,lng:start.lng},searchedLocation:null,inCar:storageAvailable("localStorage")&&window.localStorage.transportFilter=="true"||!1,open:storageAvailable("localStorage")&&window.localStorage.openState?Number(window.localStorage.openState):OpenState.openNow,openOverride:storageAvailable("sessionStorage")&&window.sessionStorage.openOverride?Number(window.sessionStorage.openOverride):null,customMapOpen:OpenState.all,customMapOpenOverride:null,customMapOrigin:null,geolocationAttempted:!1,geolocationAvailable:!1,lastUpdateFromGeolocation:!1,panningSwitchDisabled:!1,wpid:null,previousRequest:null,previousRequestAborted:!1,selectedFacility:null,lastMessage:null,lastMessageTime:null,listMessage:null,lastFindValue:null,currentPanel:null,searchBox:null,totalLikedFacilities:null,loadedLikedFacilities:null,likedFacilitiesLoaded:!1,zoom:start.zoom,showDirectionsDialog:!1,showClearDialog:!1,defaultMaskDialogVisible:!1,clearSaved:!1,clearPreferences:!1,clearLocation:!1,lightBoxImageGid:null,titleblacklistwords:null,showMOTD:!storageAvailable("localStorage")||!window.localStorage.motd_date||window.localStorage.motd_date!==(new Date).toDateString(),editormanager:new EditorManager([new Editor("Address","Address","/api/FacilityEditor/UpdateAddress",addresspanel,addresssummary,function(n){return n.Address},[new Validator("FacilityName",function(n){var t="",r=app.isRequiredTextLinkFree(n.Title),u=r&&!app.titleblacklistwords.some(function(t){return n.Title.toLowerCase().indexOf(t)!==-1}),i;return r&&u?new ValidationResult(!0,""):r?(app.titleblacklistwords.forEach(function(n){return t+=(t==""?"":", ")+"'"+n+"'"}),i=t.lastIndexOf(", "),i>-1&&(t=t.substring(0,i)+" or "+t.substring(i+1)),new ValidationResult(!1,"The name must not contain "+t+" - you can use the place name or street name eg. Smith Park or Smith Street.")):new ValidationResult(!1,"You must enter a name for the facility.")},!0),new Validator("FacilityType",function(n){return new ValidationResult(n.FacilityIcon!==null,"You must select a type for the facility.")}),new Validator("AddressFull",function(n){return new ValidationResult(n.AddressMode===AddressModeTypes.Collapsed||n.AddressFull!==null&&n.AddressFull.trim()!=="","You must enter an address for the facility.")}),new Validator("AddressCombo",function(n){return new ValidationResult(n.AddressMode===AddressModeTypes.Collapsed||n.AddressFull===null||n.AddressFull.trim()===""||n.Town!==null&&n.Town.trim()!==""&&n.State!==null,"The address entered is not valid.")}),new Validator("Position",function(n){return new ValidationResult(n.AddressMode===AddressModeTypes.Collapsed||n.Address1===null||n.Address1.trim()===""||n.Town===null||n.Town.trim()===""||n.State===null||n.Latitude>=-43.7405096&&n.Latitude<=-9.14217377&&n.Longitude>=112.921114&&n.Longitude<=159.1092224,"The facility must be located with in Australia.")}),new Validator("Address",function(n){return new ValidationResult(n.AddressMode!==AddressModeTypes.Collapsed||n.AddressFull!==null&&n.AddressFull.trim()!=="","You need to give the facility an address. You can do this by either pressing the 'Use phone' button or the 'Enter address' button.")}),new Validator("Agency",function(n){return new ValidationResult(n.AgencyID!==null,"You must set a provider")}),new Validator("AddressNote",function(n){return app.validateText(n.AddressNote)}),new Validator("AddressNote_CS",function(n){return app.validateText(n.AddressNote_CS)})],!0,function(n,t){var i={NewID:null,OldID:null,SuccessStatus:ContentStatus.Published};return n.FacilityID?(i.NewID=n.FacilityID,i.OldID=t.Facility.ContentID):n.AddressID&&(i.NewID=n.AddressID,i.OldID=t.Facility.AddressID),t.Facility.Status=n.FacilityStatus?n.FacilityStatus:t.Facility.FacilityStatus,t.Facility.AddressID=n.AddressID?n.AddressID:t.Facility.AddressID,t.Facility.AddressStatus=n.AddressStatus?n.AddressStatus:t.Facility.AddressStatus,i}),new Editor("Facilities","Facilities","/api/FacilityEditor/UpdateFacilities",facilitiespanel,facilitiessummary,function(n){return n.Facilities},[new Validator("FType",function(n){return new ValidationResult(n.HasFacility,"You need at least a toilet, adult change, baby change or dump point.")}),new Validator("ToiletNote",function(n){return app.validateText(n.ToiletNote)}),new Validator("BabyChangeNote",function(n){return app.validateText(n.BabyChangeNote)}),new Validator("AdultChangeNote",function(n){return app.validateText(n.AdultChangeNote)}),new Validator("DumpPointNote",function(n){return app.validateText(n.DumpPointNote)}),new Validator("FacilitiesNote",function(n){return app.validateText(n.FacilitiesNote)})],!0,function(n,t){var i={NewID:null,OldID:null,SuccessStatus:ContentStatus.Published},r=!0;return n.ToiletID?(i.NewID=n.ToiletID,i.OldID=t.Facility.ToiletID,r=t.Facility.IsToilet):n.AdultChangeID?(i.NewID=n.AdultChangeID,i.OldID=t.Facility.AdultChangeID,r=t.Facility.isAdultChange):n.BabyChangeID?(i.NewID=n.BabyChangeID,i.OldID=t.Facility.BabyChangeID,r=t.Facility.isBabyChange):n.DumpPointID&&(i.NewID=n.DumpPointID,i.OldID=t.Facility.DumpPointID,r=t.Facility.isDumpPoint),i.SuccessStatus=r?ContentStatus.Published:ContentStatus.Withdrawn,t.Facility.ToiletID=n.ToiletID?n.ToiletID:t.Facility.ToiletID,t.Facility.ToiletStatus=n.ToiletStatus?n.ToiletStatus:t.Facility.ToiletStatus,t.Facility.AdultChangeID=n.AdultChangeID?n.AdultChangeID:t.Facility.AdultChangeID,t.Facility.AdultChangeStatus=n.AdultChangeStatus?n.AdultChangeStatus:t.Facility.AdultChangeStatus,t.Facility.BabyChangeID=n.BabyChangeID?n.BabyChangeID:t.Facility.BabyChangeID,t.Facility.BabyChangeStatus=n.BabyChangeStatus?n.BabyChangeStatus:t.Facility.BabyChangeStatus,t.Facility.DumpPointID=n.DumpPointID?n.DumpPointID:t.Facility.DumpPointID,t.Facility.DumpPointStatus=n.DumpPointStatus?n.DumpPointStatus:t.Facility.DumpPointStatus,i}),new Editor("Access","Access","/api/AccessEditor/UpdateAccess",accesspanel,accesssummary,function(n){return n.Access},[new Validator("AccessNote",function(n){return app.validateText(n.AccessNote)}),new Validator("ParkingNote",function(n){return app.validateText(n.ParkingNote)}),new Validator("AccessAndParkingNote",function(n){return app.validateText(n.AccessAndParkingNote)})],!0,function(n,t){var i={NewID:n.AccessID,OldID:t.Facility.AccessID,SuccessStatus:ContentStatus.Published};return t.Facility.AccessID=n.AccessID,t.Facility.AccessStatus=n.AccessStatus,i}),new Editor("OpeningHours","Opening hours","/api/OpeningHoursEditor/UpdateOpeningHours",openinghourspanel,openinghourssummary,function(n){return n.OpeningHours},[new Validator("OpeningHoursType",function(n){return new ValidationResult(MainEditorManager.OpeningHours.IsCrowdsource||n.IsOpenSchedule||n.IsOpenAllHours||n.IsOpeningHoursVariable||n.IsOpenVenueHours||n.IsOpenDaylightHours,"You must select an opening hours option for this facility.")}),new Validator("OpeningTime",function(n){return new ValidationResult(n.CurrentSchedule===null||/[01]?[0-9]{1}:[0-5]{1}[0-9]{1}/.test(n.CurrentSchedule.OpeningTimeText),"You must enter a valid time.")}),new Validator("ClosingTime",function(n){return new ValidationResult(n.CurrentSchedule===null||/[01]?[0-9]{1}:[0-5]{1}[0-9]{1}/.test(n.CurrentSchedule.ClosingTimeText),"You must enter a valid time.")}),new Validator("Days",function(n){return new ValidationResult(n.CurrentSchedule===null||n.CurrentSchedule.DayMask,"You must have at least one day selected.")}),new Validator("Months",function(n){return new ValidationResult(n.CurrentSchedule===null||n.CurrentSchedule.MonthMask,"You must have at least one month selected.")}),new Validator("Schedule",function(n){return new ValidationResult(!n.IsOpenSchedule||n.AddingSchedule||n.CurrentSchedule,"You must have at least one schedule.")}),new Validator("OpeningHoursNote",function(n){return app.validateText(n.OpeningHoursNote)}),new Validator("OpeningHoursNote_CS",function(n){return app.validateText(n.OpeningHoursNote_CS)})],!0,function(n,t){var i={NewID:n.OpeningHoursID,OldID:t.Facility.OpeningHoursID,SuccessStatus:ContentStatus.Published};return t.Facility.OpeningHoursID=n.OpeningHoursID,t.Facility.OpeningHoursStatus=n.OpeningHoursStatus,i}),new Editor("Amenities","Amenities","/api/AmenitiesEditor/UpdateAmenities",amenitiespanel,amenitiessummary,function(n){return n.Amenities},null,!0,function(n,t){var i={NewID:n.AmenitiesID,OldID:t.Facility.AmenitiesID,SuccessStatus:ContentStatus.Published};return t.Facility.AmenitiesID=n.AmenitiesID,t.Facility.AmenitiesStatus=n.AmenitiesStatus,i}),new Editor("Photos","Photos","/api/FacilityEditor/AddPhoto",photopanel,photosummary,function(n,t){return t.IsMultipart=!0,n.Photo},null,!1),new Editor("LetUsKnow","Let us know",function(n){return"/api/FacilityEditor/LetUsKnow/"+n.Facility.TitleShort},letusknow,null,function(n){return n.LetUsKnow.Post},[new Validator("LetUsKnowNote",function(n){return app.validateText(n.LetUsKnow.Message,!0)}),new Validator("LetUsKnowRC",function(n){return new ValidationResult(n.LetUsKnow.CanSubmit,"Please complete the recaptcha.")})],!1),new Editor("CreateNew","CreateNew","/api/FacilityEditor/CreateFacility",null,null,function(n,t){return t.IsMultipart=n.Photos.length>0,n.NewFacility},[new Validator("AllValidators",function(n){var i=[],t=!0;return MainEditorManager.Editors.forEach(function(r){r.Name!=="CreateNew"&&r.Name!=="LetUsKnow"&&r.Validators.Validators.forEach(function(u){var f=u.Validate(n);t=t&&f.Success;f.Success||i.push(f.Message+" (See the "+r.DisplayName+" page)")})}),new ValidationResult(t,i)},!0)],!1)]),accountmanager:new AccountManager,shareMap:new ShareMap,monitorManager:new PersistantMonitorManager([new PersistantMonitorConfiguration("FacilityMonitor",{MyCheck:function(n){return n&&n.NewStatus===this.MyObject.CustomData.S_Status?MonitorCheckResult.Pass:n&&n.NewStatus===ContentStatus.Withdrawn?MonitorCheckResult.TerminatingFail:n&&n.IsError?MonitorCheckResult.Error:MonitorCheckResult.Fail},MyCallback:function(n){var i=this,t;app.monitoredUpdates||(app.monitoredUpdates=[]);t=app.monitoredUpdates.find(function(n){return n.ID===i.MyObject.CustomData.FacilityID});t||(t={ID:this.MyObject.CustomData.FacilityID,Title:this.MyObject.CustomData.Title,Sections:[],Type:"Edit"},app.monitoredUpdates.push(t));t.Sections.push(this.MyObject.CustomData.Section);t.Type=this.MyObject.CustomData.Section==="CreateNew"?"New":this.MyObject.CustomData.Section==="Delete"?"Delete":"Edit";app.editormanager.Facility&&app.editormanager.Facility.UpdateStatus(this.MyObject.CustomData.TitleShort,this.MyObject.CustomData.ID,this.MyObject.CustomData.Old,n.NewStatus);app.monitoredUpdatesDisplay()},StopOnSuccess:!0,Frequency:3e4}),new PersistantMonitorConfiguration("FacilityCheck",{Frequency:3e4,MyCheck:function(n){return n.IsError?MonitorCheckResult.Error:(this.MyObject.CustomData.Facility.UpdateStatuses(n.StatusAndIDs),this.MyObject.CustomData.Facility.MinimumStatus===ContentStatus.Published?MonitorCheckResult.Pass:this.MyObject.CustomData.Facility.TitleShort!==app.editormanager.Facility.TitleShort||app.currentPanel!=="editors-panel"?MonitorCheckResult.TerminatingFail:MonitorCheckResult.Fail)},MyCallback:function(n){this.MyObject.CustomData.Facility.UpdateStatuses(n.StatusAndIDs);this.MyObject.CustomData.Facility.TitleShort===app.editormanager.Facility.TitleShort&&app.currentPanel==="editors-panel"&&app.editormanager.ShowSummaries&&MainEditorManager.setHRID(this.MyObject.CustomData.Facility.TitleShort,!1,!0)},StopOnSuccess:!0,DontStore:!0})]),monitoredUpdates:null,monitoredUpdatesDisplay:_.debounce(function(){if(app.monitoredUpdates){var n=[];app.monitoredUpdates.forEach(function(t){var r="Your changes to the ",i,u;if(t.Type==="New")r="Your new facility '"+t.Title+"' has been published.";else if(t.Type==="Delete")r="Your facility '"+t.Title+"' has been deleted.";else{i=null;for(u in t.Sections)i!==null?i+=u<t.Sections.length-1?", ":" and ":i="",i+=t.Sections[u];r+=i+" section"+(t.Sections.length>1?"":"s")+" for the facility '"+t.Title+"' have been published."}n.push(r)});Messages.display(MessageType.success,(app.monitoredUpdates.length>1?"Facilities":"Facility")+" published",n);app.monitoredUpdates=null}},2e3)},updated:function(){this.scrollToSelectedFacility()},methods:{isRequiredTextLinkFree:function(n){return n!==null&&n.trim()!==""&&this.isTextLinkFree(n)},isTextLinkFree:function(n){return!/((http(s)?:\/\/)?(www)?(\.?[-a-zA-Z0-9@:%_\+~#=]{2,256})+\.[a-z]{2,6}\b(\?.[-a-zA-Z0-9@:%_\+.~#&//=]*)?)/g.test(n)},isTextTagFree:function(n){return!/[<>]/g.test(n)},getToiletTitleBlackListWords:function(){var n=this;new Promise(function(t){n.titleblacklistwords&&n.titleblacklistwords!=[]?t(n.titleblacklistwords):Vue.http.get("/api/AppAPI/GetToiletTitleBlackListWords").then(function(i){i.json().then(function(i){n.titleblacklistwords=i;t(i)})},function(){n.titleblacklistwords=[];t([])})})},validateText:function(n,t){return n===null||n.trim()===""?new ValidationResult(!t,"You haven't typed anything in the text box."):app.isTextLinkFree(n)?app.isTextTagFree(n)?new ValidationResult(!0,""):new ValidationResult(!1,"Invalid characters."):new ValidationResult(!1,"Links are not allowed in notes fields - please remove your link before saving.")},setFirstLaunch:function(){this.firstLaunch==-1&&storageAvailable("localStorage")&&(window.localStorage.firstLaunch=Date.now())},incrementLaunchesWithDefaultMaskCount:function(){storageAvailable("localStorage")&&(window.localStorage.launchesWithDefaultMask=this.isDefaultSearchMask?window.localStorage.launchesWithDefaultMask!=null?parseInt(window.localStorage.launchesWithDefaultMask)+1:1:0)},setLastDefaultMaskAlert:function(){storageAvailable("localStorage")&&(window.localStorage.lastDefaultMaskAlert=Date.now())},updateDefaultSearchMask:function(){storageAvailable("localStorage")&&!window.localStorage.searchMaskUpdated&&this.searchMask==oldDefaultSearchMask&&(this.searchMask=defaultSearchMask,this.searchMaskOverride=SearchMask.unsetFlag(this.searchMaskOverride,SearchMask.xISMLAKKEY),window.localStorage.setItem("searchMaskUpdated",Date.now()))},directionsToSelected:function(){this.showDirectionsDialog=this.selectedFacility!==null},directionsToFacility:function(n){this.selectFacility(n,!1);this.directionsToSelected()},doDirections:function(){ga("send","event","Directions","Get",this.selectedFacility.id);gtag("event","Directions",{Get:this.selectedFacility.id});this.showDirectionsDialog=!1},cancelDirections:function(){ga("send","event","Directions","Cancel",this.selectedFacility.id);gtag("event","Directions",{Cancel:this.selectedFacility.id});this.showDirectionsDialog=!1},hideBanner:function(){storageAvailable("sessionStorage")&&(window.sessionStorage.bannerHidden=!0);this.bannerHidden=!0},fitMap:_.throttle(function(){(this.state===MapState.tracking||this.state===MapState.searching||this.state===MapState.custom)&&this.map.fitBounds(this.displaySpan,0)},250),updateRegion:_.debounce(function(){var r,i;if(this.state!=MapState.provider){var n=this.map.getCenter(),t=this.map.getZoom(),u=Geo.distanceBetween(n,this.my),f=ToiletMap.minimumDistanceToEnterPanning(this.map.getZoom());this.state==MapState.initial||this.panningSwitchDisabled||this.lastUpdateFromGeolocation||!(this.state===MapState.tracking&&Geo.distanceBetween(n,this.my)>ToiletMap.minimumDistanceToEnterPanning(this.map.getZoom())||(this.state===MapState.searching||this.state===MapState.custom)&&Geo.distanceBetween(n,this.current)>ToiletMap.minimumDistanceToEnterPanning(this.map.getZoom()))||(this.state=MapState.panning);(this.state===MapState.panning||this.state==MapState.initial)&&(this.current=n,r=Geo.distanceBetween(n,this.my),i=ToiletMap.maximumDistanceToEnterTracking(t),i>0&&r<i&&(this.state=MapState.tracking));this.zoom!==t&&(this.zoom=t);this.lastUpdateFromGeolocation=!1}},250),search:function(){var i=this,r=document.getElementById("find-text"),u,f,n,e,t,o;r.blur();this.selectFacility(null);u=document.getElementById("results-content");u&&u.scrollTo(0,0);r.value===""?(!this.geolocationAttempted&&navigator.geolocation&&(this.geolocationAttempted=!0,this.wpid=navigator.geolocation.watchPosition(app.geoUpdate,app.geoError,{enableHighAccuracy:!1,maximumAge:3e3,timeout:2e4})),this.lastFindValue=null,this.state!==MapState.tracking&&(this.distances=[]),this.state=MapState.tracking,hidePanel("find-panel")):(this.distances=[],f=this.lastFindValue!==r.value,this.lastFindValue=r.value,n=this.searchBox.getPlace(),n===undefined||n.geometry===undefined||f?(e=_wrapRegExp(/(^[\+\x2D]?(?:[1-8]?[0-9](?:\.[0-9]+)?|90(?:\.0+)?))[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*([\+\x2D]?(?:180(?:\.0+)?|(?:1[0-7][0-9]|[1-9]?[0-9])(?:\.[0-9]+)?))$/,{lat:1,lng:2}),t=e.exec(r.value),t&&t.groups.lat&&t.groups.lng?(this.current={lat:Number(t.groups.lat),lng:Number(t.groups.lng)},this.searchedLocation={lat:Number(t.groups.lat),lng:Number(t.groups.lng)},this.state=MapState.searching):(o=new google.maps.places.AutocompleteService,o.getPlacePredictions({input:r.value,componentRestrictions:{country:"au"}},function(n,t){if(n===null||n.length===0||t!==google.maps.places.PlacesServiceStatus.OK)Messages.display(MessageType.warning,"No Search Results",["A matching location could not be found, please try with a new location."]);else{var r=new google.maps.places.PlacesService(app.map);r.getDetails({reference:n[0].reference},function(n,t){t===google.maps.places.PlacesServiceStatus.OK?(i.state!==MapState.tracking||i.geolocationAvailable||(i.my={lat:n.geometry.location.lat(),lng:n.geometry.location.lng()}),i.current={lat:n.geometry.location.lat(),lng:n.geometry.location.lng()},i.searchedLocation={lat:n.geometry.location.lat(),lng:n.geometry.location.lng()},i.state=MapState.searching):(Sentry.captureMessage("An error occurred while retrieving location information: "+t),Messages.display(MessageType.error,"An Error Occurred",["An error occurred while retrieving location information.","Please try again."]))})}}))):(this.state!==MapState.tracking||this.geolocationAvailable||(this.my={lat:n.geometry.location.lat(),lng:n.geometry.location.lng()}),this.current={lat:n.geometry.location.lat(),lng:n.geometry.location.lng()},this.searchedLocation={lat:n.geometry.location.lat(),lng:n.geometry.location.lng()},this.state!=MapState.provider&&(this.state=MapState.searching)))},geoUpdate:function(n){this.geolocationAvailable=!0;this.gps={lat:n.coords.latitude,lng:n.coords.longitude}},geoError:function(){},getToilets:function(n){var f=this,t="Desktop",e=window.innerWidth,r,u;e<768?t="Phone":e<992&&(t="Tablet");var o=encodeURIComponent(dateTimeToHsFormat(new Date)),s=app.overriddenOpen===OpenState.openNow,y=app.inCar,h=this.overriddenSearchMask,c=typeof app.current.lat=="function"?app.current.lat():app.current.lat,l=typeof app.my.lat=="function"?app.my.lat():app.my.lat,a=typeof app.current.lng=="function"?app.current.lng():app.current.lng,v=typeof app.my.lng=="function"?app.my.lng():app.my.lng,i="";if(this.state===MapState.provider)i="/api/AppAPI/GetFacilitysForAgency/".concat(this.provider);else if(this.state===MapState.panning){if(r=app.map.getBounds(),!r)return;u=r.toSpan();i="/api/AppAPI/GetFacilitysInBoundingBox?&xIdiom=".concat(t,"&lat=").concat(c,"&lon=").concat(a,"&latDegrees=").concat(Math.max(1e-5,u.lat()),"&lonDegrees=").concat(Math.max(1e-5,u.lng()),"&clat=").concat(l,"&clon=").concat(v,"&cDate=").concat(o,"&openNow=").concat(s,"&mask=").concat(h,"&enforcePrefs=false&appType=Mobile")}else i="/api/AppAPI/GetNearestFacilities?xIdiom=".concat(t,"&lat=").concat(c,"&lon=").concat(a,"&clat=").concat(l,"&clon=").concat(v,"&mask=").concat(h,"&cDate=").concat(o,"&openNow=").concat(s,"&inCar=").concat(y,"&appType=Mobile");Vue.http.get(i,{before:function(n){app.previousRequest?(app.previousRequest.abort(),app.previousRequestAborted=!0):app.previousRequestAborted=!1;app.previousRequest=n}}).then(function(i){i.json().then(function(i){f.processFacilityResults(i,n,t);_.debounce;f.shareMap.ShowMapButton()})},function(n){app.previousRequestAborted||(Messages.display(MessageType.error,null,"Unable to connect to the Toilet Map server, so no facility information is available.",1e4),console.log(n));n.status!==0&&typeof Sentry!="undefined"&&Sentry.captureException(n)})},processFacilityResults:function(n,t,i){var s=this,r,e,o;if(n.Ct>0&&!(n.Msg!==null&&n.Msg.startsWith("No facilities match your"))){this.listMessage=null;Messages.currentMessageType()!=MessageType.site&&n.Msg!==null&&n.Msg!==""&&(this.lastMessage!==n.Msg||this.lastMessageTime!==null&&Date.now()-this.lastMessageTime>2e4)&&(Messages.display(MessageType.info,null,n.Msg,5e3),this.lastMessage=n.Msg,this.lastMessageTime=Date.now());this.providerName=this.provider&&n.Provider?n.Provider:null;var h=n.Facilitys,u=[],f=[];h.forEach(function(n){var t=new Toilet(n);u.push(t)},this);r=this.toilets;f=_.differenceWith(this.toilets,u,function(n,t){return n.id===t.id});r=_.unionWith(this.toilets,u,function(n,t){return n.id===t.id});_.pullAllWith(r,f,function(n,t){return n.id===t.id});_.pullAllWith(r,this.toilets,function(n,t){return n.id===t.id});f.forEach(function(n){s.removeToilet(n)});r.forEach(function(n){s.addToilet(n);n.refreshInfo()});this.state===MapState.tracking||this.state===MapState.searching?this.fitMap():this.state==MapState.provider&&(e={bottom:60,left:60,right:60,top:60},i!="Desktop"&&(e.top=150),o=new google.maps.LatLngBounds,this.toilets.forEach(function(n){return o.extend(n)}),this.map.fitBounds(o,e),this.toilets.sort(function(n,t){return n.title.localeCompare(t.title)}));t&&this.state==MapState.searching&&hidePanel("find-panel");this.toilets.forEach(function(n){n.calculateRouteDistance()})}else{for(n.Msg!==null?(this.listMessage=n.Msg,Messages.currentMessageType()!=MessageType.site&&(n.Msg!==null&&n.Msg!==""?Messages.display(MessageType.info,null,n.Msg,1e4):Messages.currentMessageType()!=MessageType.error&&Messages.hide())):this.listMessage=null;this.toilets.length>0;)this.removeToilet(this.toilets[0]);this.state===MapState.searching&&this.map.panTo(app.current)}},saveMap:function(){this.shareMap.Save()},copyMapUrl:function(){this.shareMap.CopyWebLink()},copyMapQRCode:function(){this.shareMap.CopyQRCode()},reSort:function(){var n=this;this.toilets.sort(function(t,i){if(t.sortScore>i.sortScore)return-1;if(t.sortScore<i.sortScore)return 1;var r=t.distanceFrom(n.my.lat,n.my.lng),u=i.distanceFrom(n.my.lat,n.my.lng);return r>u?1:r<u?-1:void 0})},addToilet:function(n){var t=this;n.onMarkerClick=function(){t.pauseTracking();t.toilets.forEach(function(n){n.info.close()})};n.addPin(this.map);app.toilets.push(n)},removeToilet:function(n){n.removePin();app.toilets.splice(app.toilets.findIndex(function(t){return t.id==n.id}),1)},expand:function(n,t){this.toilets.forEach(function(n){n.expanded=!1;t===!0&&n.info.close()});n.expanded=!0;n.expand();t===!0&&(this.pauseTracking(),n.info.open(n.map,n.marker))},pauseTracking:function(){this.panningSwitchDisabled=!0;this.resetTracking()},resetTracking:_.debounce(function(){this.panningSwitchDisabled=!1},1e3),showDetails:function(n){this.selectFacility(n,!0);showPanel("details-panel")},selectFacility:function(n,t){n!==null?(this.toilets.forEach(function(t){t.id!==n&&(t.info.close(),t.IsSelected=!1)}),this.selectedFacility=this.toilets.find(function(t){return t.id==n}),this.pauseTracking(),this.selectedFacility.IsSelected=!0,this.selectedFacility.recalculateRouteDistance(),this.selectedFacility.info.open(app.map,this.selectedFacility.marker),t&&this.selectedFacility&&this.selectedFacility.expand()):(this.toilets.forEach(function(n){n.info.close();n.IsSelected=!1}),this.selectedFacility=null)},scrollToSelectedFacility:function(){if(this.selectedFacility){var n=document.getElementById("facility-list-".concat(this.selectedFacility.id));n&&n.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}},showFavouriteDetails:function(n){n!==null?(this.selectedFacility=this.myfacilities.find(function(t){return t.id==n}),this.selectedFacility&&this.selectedFacility.expand()):this.selectedFacility=null;showPanel("details-panel")},showPreferences:function(){showPanel("preferences-panel")},openPreferences:function(){this.setLastDefaultMaskAlert();this.defaultMaskDialogVisible=!1;this.showPreferences()},cancelPreferences:function(){this.setLastDefaultMaskAlert();this.defaultMaskDialogVisible=!1},loadMyFacilities:function(n){var t=this,i;n==0&&(this.likedFacilitiesLoaded=!1,this.myfacilities=[]);i=[];localforage.iterate(function(n,t){t.startsWith("l_")&&i.push({t:Number(t.substring(2)),d:Number(n)})}).then(function(){i.sort(function(n,t){return n.d-t.d});var r=i.map(function(n){return n.t}).slice(n,n+20);t.totalLikedFacilities=i.length;t.loadedLikedFacilities=n+r.length;t.$http.post("/api/AppAPI/GetFavourites",r).then(function(n){n.body.Facilitys.forEach(function(n){return t.myfacilities.push(new Toilet(n))});t.likedFacilitiesLoaded=!0})})},loadMoreFacilities:function(){this.likedFacilitiesToLoad>0&&this.loadMyFacilities(this.loadedLikedFacilities)},likeFacility:function(n){var t=this.toilets.find(function(t){return t.id==n});t&&(t.like(),this.selectFacility(n))},removeLikedFacility:function(n){var t=this.myfacilities.findIndex(function(t){return t.id==n}),i;t!==-1&&(this.myfacilities[t].dislike(),this.myfacilities.splice(t,1));i=this.toilets.find(function(t){return t.id==n});i&&i.dislike()},iconClass:function(n){return ToiletMap.iconClass(n)},iconName:function(n){return ToiletMap.iconName(n)},searchMaskHas:function(n){return SearchMask.hasFlag(this.maskToUse,n)},togglePreference:function(n){this.state===MapState.custom&&(this.state=MapState.panning);var t=this.maskToUse,i=this.maskOverrideToUse;SearchMask.hasFlag(t,n)?(t=SearchMask.unsetFlag(t,n),i=SearchMask.unsetFlag(i,n),n!==SearchMask.xISMALE||SearchMask.hasFlag(t,SearchMask.xISFEMALE)||SearchMask.hasFlag(t,SearchMask.xISUNISEX)||(t=SearchMask.unsetFlag(t,SearchMask.xISAMBULANT),i=SearchMask.unsetFlag(i,SearchMask.xISAMBULANT)),n!==SearchMask.xISFEMALE||SearchMask.hasFlag(t,SearchMask.xISMALE)||SearchMask.hasFlag(t,SearchMask.xISUNISEX)||(t=SearchMask.unsetFlag(t,SearchMask.xISAMBULANT),i=SearchMask.unsetFlag(i,SearchMask.xISAMBULANT)),n!==SearchMask.xISUNISEX||SearchMask.hasFlag(t,SearchMask.xISMALE)||SearchMask.hasFlag(t,SearchMask.xISFEMALE)||(t=SearchMask.unsetFlag(t,SearchMask.xISAMBULANT),i=SearchMask.unsetFlag(i,SearchMask.xISAMBULANT)),n===SearchMask.xISACCESSIBLE&&(t=SearchMask.unsetFlag(t,SearchMask.xISLHTRANSFER),t=SearchMask.unsetFlag(t,SearchMask.xISRHTRANSFER),i=SearchMask.unsetFlag(i,SearchMask.xISLHTRANSFER),i=SearchMask.unsetFlag(i,SearchMask.xISRHTRANSFER))):t=SearchMask.setFlag(t,n);t=SearchMask.unsetFlag(t,SearchMask.xISACSHOWER);SearchMask.hasFlag(t,SearchMask.xISSHOWERS)&&(SearchMask.noFacility(t)?t=SearchMask.setFlag(t,SearchMask.xISACSHOWER):SearchMask.hasFlag(t,SearchMask.xISADULTCHANGE)&&(t=SearchMask.setFlag(t,SearchMask.xISACSHOWER)));SearchMask.hasFlag(t,SearchMask.xISACSHOWER)||(i=SearchMask.unsetFlag(i,SearchMask.xISACSHOWER));this.updateMaskToUse(t);this.updateMaskOverideToUse(i)},removeData:function(){this.clearLocation=!1;this.clearPreferences=!1;this.clearSaved=!1;this.showClearDialog=!0},clearSavedData:function(){var n=this;this.clearSaved&&localforage.keys().then(function(t){t.forEach(function(t){t.startsWith("l_")&&localforage.removeItem(t).then(function(){var i=n.toilets.find(function(n){return n.id==t.substring(2)});i&&(i.liked=!1,i.refreshMapData())});t.startsWith("m_")&&localforage.removeItem(t).then(function(){var i=n.myMaps.find(function(n){return n.MapKey==t.substring(2)});i&&(i.liked=!1)})});n.myfacilities=[];n.myMaps=[]});this.clearPreferences&&(this.searchMask=defaultSearchMask,this.transportFilter=!1,this.openState=OpenState.openNow,storageAvailable("localStorage")&&(window.localStorage.removeItem("searchMask"),window.localStorage.removeItem("transportFilter"),window.localStorage.removeItem("openState"),window.localStorage.removeItem("firstLaunch"),window.localStorage.removeItem("launchesWithDefaultMask"),window.localStorage.removeItem("motd_date")),this.bannerHidden=!1,this.searchMaskOverride=0,this.openOverride=null,storageAvailable("sessionStorage")&&(window.sessionStorage.removeItem("searchMaskOverride"),window.sessionStorage.removeItem("bannerHidden")));this.clearLocation&&storageAvailable("localStorage")&&(window.localStorage.removeItem("start_lat"),window.localStorage.removeItem("start_lng"));this.getToilets();this.toilets.forEach(function(n){return n.iteration+=1});this.showClearDialog=!1;this.monitorManager.Purge()},searchMaskOverrideHas:function(n){return SearchMask.hasFlag(this.maskOverrideToUse,n)},toggleOverride:function(n){this.state===MapState.custom&&(this.state=MapState.panning);var t=this.maskOverrideToUse,i=this.maskToUse;t=SearchMask.hasFlag(t,n)?SearchMask.unsetFlag(t,n):SearchMask.setFlag(t,n);SearchMask.hasFlag(i,SearchMask.xISLHTRANSFER)&&SearchMask.hasFlag(t,SearchMask.xISACCESSIBLE)&&(t=SearchMask.setFlag(t,SearchMask.xISLHTRANSFER));SearchMask.hasFlag(i,SearchMask.xISRHTRANSFER)&&SearchMask.hasFlag(t,SearchMask.xISACCESSIBLE)&&(t=SearchMask.setFlag(t,SearchMask.xISRHTRANSFER));SearchMask.hasFlag(i,SearchMask.xISAMBULANT)&&SearchMask.hasFlag(t,SearchMask.xISMALE)&&SearchMask.hasFlag(t,SearchMask.xISFEMALE)&&SearchMask.hasFlag(t,SearchMask.xISUNISEX)&&(t=SearchMask.setFlag(t,SearchMask.xISAMBULANT));SearchMask.hasFlag(i,SearchMask.xISACSHOWER)&&(t=SearchMask.unsetFlag(t,SearchMask.xISACSHOWER),SearchMask.hasFlag(t,SearchMask.xISADULTCHANGE)&&(t=SearchMask.setFlag(t,SearchMask.xISACSHOWER)),SearchMask.hasFlag(t,SearchMask.xISSHOWERS)&&(t=SearchMask.setFlag(t,SearchMask.xISACSHOWER)));this.updateMaskOverideToUse(t)},toggleMLAK:function(){this.togglePreference(SearchMask.xISMLAKKEY)},hintMLAK:function(){Messages.display(MessageType.info,"What is MLAK?",["The Master Locksmiths Access Key (MLAK) system allows people with a disability access to dedicated public facilities by purchasing an MLAK key which will open all toilets, playground equipment and other facilities fitted with a lock that uses the special MLAK cylinder.","You can order an MLAK key from <a href='https://masterlocksmiths.com.au/mlak/' target='_blank' rel='noopener noreferrer'>masterlocksmiths.com.au/mlak/<\/a>."])},startLightBox:function(n){this.selectedFacility.hasPhoto(n)&&(this.lightBoxImageGid=n)},updateMaskToUse:function(n){this.usingCustomMap?this.customMapSearchMask=n:this.searchMask=n},updateMaskOverideToUse:function(n){this.usingCustomMap?this.customMapSearchMaskOverride=n:this.searchMaskOverride=n},endMapMode:function(){this.searchMaskOverride=0;this.usingCustomMap=!1;this.getToilets();document.title="National Public Toilet Map";document.querySelector("meta[name='description']").setAttribute("content","National Public Toilet Map")}},computed:{sortCheck:function(){var n=this;return this.toilets.reduce(function(t,i){return t+Number(i.score+Math.max(2e5-i.distanceFrom(n.my.lat,n.my.lng),0))},0)},loadSortCheck:function(){return this.toilets.reduce(function(n,t){return n+t.loadIteration},0)},displaySpan:function(){var t=this,n=0;return this.toilets.forEach(function(i){var r=i.distanceFrom(t.current.lat,t.current.lng);r>n&&(n=r)}),Geo.bounds(this.current,Math.max(n,minimumRadius))},maskToUse:function(){return this.usingCustomMap?this.customMapSearchMask:this.searchMask},maskOverrideToUse:function(){return this.usingCustomMap?this.customMapSearchMaskOverride:this.searchMaskOverride},facilityPreferenceList:function(){return[SearchMask.xISACCESSIBLE,SearchMask.xISADULTCHANGE,SearchMask.xISMALE,SearchMask.xISCHANGINGPLACES,SearchMask.xISFEMALE,SearchMask.xISBABYCHANGE,SearchMask.xISUNISEX,SearchMask.xISDUMPPOINT,SearchMask.xISINCLUSIVE]},amenityPreferenceList:function(){return[SearchMask.hasFlag(this.searchMask,SearchMask.xISACCESSIBLE)?SearchMask.xISLHTRANSFER:null,SearchMask.xISSHARPSDISPOSAL,SearchMask.hasFlag(this.searchMask,SearchMask.xISACCESSIBLE)?SearchMask.xISRHTRANSFER:null,SearchMask.xISSHOWERS,SearchMask.hasFlag(this.searchMask,SearchMask.xISFEMALE)||SearchMask.hasFlag(this.searchMask,SearchMask.xISMALE)||SearchMask.hasFlag(this.searchMask,SearchMask.xISUNISEX)?SearchMask.xISAMBULANT:null,SearchMask.xISSANITARYDISPOSAL,SearchMask.xISMENSPADDISPOSAL,SearchMask.xISDRINKINGWATER].filter(function(n){return n})},currentPreferenceList:function(){var n=[];return SearchMask.hasFlag(this.maskToUse,SearchMask.xISACCESSIBLE)&&n.push(SearchMask.xISACCESSIBLE),SearchMask.hasFlag(this.maskToUse,SearchMask.xISMALE)&&n.push(SearchMask.xISMALE),SearchMask.hasFlag(this.maskToUse,SearchMask.xISFEMALE)&&n.push(SearchMask.xISFEMALE),SearchMask.hasFlag(this.maskToUse,SearchMask.xISUNISEX)&&n.push(SearchMask.xISUNISEX),SearchMask.hasFlag(this.maskToUse,SearchMask.xISINCLUSIVE)&&n.push(SearchMask.xISINCLUSIVE),SearchMask.hasFlag(this.maskToUse,SearchMask.xISBABYCHANGE)&&n.push(SearchMask.xISBABYCHANGE),SearchMask.hasFlag(this.maskToUse,SearchMask.xISCHANGINGPLACES)&&n.push(SearchMask.xISCHANGINGPLACES),SearchMask.hasFlag(this.maskToUse,SearchMask.xISADULTCHANGE)&&n.push(SearchMask.xISADULTCHANGE),SearchMask.hasFlag(this.maskToUse,SearchMask.xISDUMPPOINT)&&n.push(SearchMask.xISDUMPPOINT),SearchMask.hasFlag(this.maskToUse,SearchMask.xISLHTRANSFER)&&n.push(SearchMask.xISLHTRANSFER),SearchMask.hasFlag(this.maskToUse,SearchMask.xISRHTRANSFER)&&n.push(SearchMask.xISRHTRANSFER),SearchMask.hasFlag(this.maskToUse,SearchMask.xISSHARPSDISPOSAL)&&n.push(SearchMask.xISSHARPSDISPOSAL),(SearchMask.hasFlag(this.maskToUse,SearchMask.xISSHOWERS)||SearchMask.hasFlag(this.maskToUse,SearchMask.xISACSHOWER))&&n.push(SearchMask.xISSHOWERS),SearchMask.hasFlag(this.maskToUse,SearchMask.xISAMBULANT)&&n.push(SearchMask.xISAMBULANT),SearchMask.hasFlag(this.maskToUse,SearchMask.xISSANITARYDISPOSAL)&&n.push(SearchMask.xISSANITARYDISPOSAL),SearchMask.hasFlag(this.maskToUse,SearchMask.xISDRINKINGWATER)&&n.push(SearchMask.xISDRINKINGWATER),SearchMask.hasFlag(this.maskToUse,SearchMask.xISMENSPADDISPOSAL)&&n.push(SearchMask.xISMENSPADDISPOSAL),n},customMapPreferenceList:function(){var n=[];return SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISACCESSIBLE)&&n.push(SearchMask.xISACCESSIBLE),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISMALE)&&n.push(SearchMask.xISMALE),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISFEMALE)&&n.push(SearchMask.xISFEMALE),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISUNISEX)&&n.push(SearchMask.xISUNISEX),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISINCLUSIVE)&&n.push(SearchMask.xISINCLUSIVE),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISBABYCHANGE)&&n.push(SearchMask.xISBABYCHANGE),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISCHANGINGPLACES)&&n.push(SearchMask.xISCHANGINGPLACES),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISADULTCHANGE)&&n.push(SearchMask.xISADULTCHANGE),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISDUMPPOINT)&&n.push(SearchMask.xISDUMPPOINT),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISLHTRANSFER)&&n.push(SearchMask.xISLHTRANSFER),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISRHTRANSFER)&&n.push(SearchMask.xISRHTRANSFER),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISSHARPSDISPOSAL)&&n.push(SearchMask.xISSHARPSDISPOSAL),(SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISSHOWERS)||SearchMask.hasFlag(this.maskToUse,SearchMask.xISACSHOWER))&&n.push(SearchMask.xISSHOWERS),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISAMBULANT)&&n.push(SearchMask.xISAMBULANT),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISSANITARYDISPOSAL)&&n.push(SearchMask.xISSANITARYDISPOSAL),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISDRINKINGWATER)&&n.push(SearchMask.xISDRINKINGWATER),SearchMask.hasFlag(this.originalCustomMapSearchMask,SearchMask.xISMENSPADDISPOSAL)&&n.push(SearchMask.xISMENSPADDISPOSAL),n},overriddenSearchMask:function(){var t=~~(this.maskToUse/2147483648),i=~~(this.maskOverrideToUse/2147483648),r=this.maskToUse&2147483647,u=this.maskOverrideToUse&2147483647,f=t^i,n=r^u;return this.openOverrideToUse!=null&&(n=this.openOverrideToUse==OpenState.open24?n|262144:n&-262145),f*2147483648+n},overriddenOpen:function(){return this.openOverrideToUse!=null?this.openOverrideToUse==OpenState.open24?OpenState.all:this.openOverrideToUse:this.openToUse},providerSearchMask:function(){return this.state==MapState.provider?fullSearchMask:this.overriddenSearchMask},isDefaultSearchMask:function(){var n=SearchMask.unsetFlag(this.searchMask,SearchMask.xISOPENALLHOURS);return n===defaultSearchMask},hasAnyOverrides:function(){var n=this;return this.currentPreferenceList.some(function(t){return n.searchMaskOverrideHas(t)})},showToilet:function(){return this.state==MapState.provider||SearchMask.isToilet(this.searchMask)||this.selectedFacility&&this.selectedFacility.isToilet},showBabyChange:function(){return this.state==MapState.provider||this.searchMaskHas(SearchMask.xISBABYCHANGE)||this.selectedFacility&&this.selectedFacility.isBabyChange&&SearchMask.noFacility(this.searchMask)},showDumpPoint:function(){return this.state==MapState.provider||this.searchMaskHas(SearchMask.xISDUMPPOINT)||this.selectedFacility&&this.selectedFacility.isDumpPoint&&SearchMask.noFacility(this.searchMask)},showAdultChange:function(){return this.state==MapState.provider||this.searchMaskHas(SearchMask.xISCHANGINGPLACES)||this.searchMaskHas(SearchMask.xISADULTCHANGE)||this.selectedFacility&&this.selectedFacility.isAdultChange&&SearchMask.noFacility(this.searchMask)},firstLaunch:{get:function(){return storageAvailable("localStorage")&&window.localStorage.firstLaunch!=null?window.localStorage.firstLaunch:-1}},lastDefaultMaskAlert:{get:function(){return storageAvailable("localStorage")&&window.localStorage.lastDefaultMaskAlert!=null?parseInt(window.localStorage.lastDefaultMaskAlert):0}},daysSinceFirstLaunch:{get:function(){return this.firstLaunch>=0?Math.round((Date.now()-this.firstLaunch)/864e5):0}},launchesWithDefaultMask:{get:function(){return storageAvailable("localStorage")&&window.localStorage.launchesWithDefaultMask!=null?parseInt(window.localStorage.launchesWithDefaultMask):0}},lastDefaultMaskAlertDays:{get:function(){return this.lastDefaultMaskAlert>=0?Math.round((Date.now()-this.lastDefaultMaskAlert)/864e5):61}},showDefaultMaskDialog:{get:function(){return this.lastDefaultMaskAlertDays>60&&this.daysSinceFirstLaunch>5&&this.launchesWithDefaultMask>=10}},openToUse:{get:function(){return this.usingCustomMap?this.customMapOpen:this.open},set:function(n){this.usingCustomMap?this.customMapOpen=n:this.open=n}},openOverrideToUse:{get:function(){return this.usingCustomMap?this.customMapOpenOverride:this.openOverride},set:function(n){this.usingCustomMap?this.customMapOpenOverride=n:this.openOverride=n}},openAll:{get:function(){return this.openToUse===OpenState.all},set:function(){this.openToUse=OpenState.all}},openNow:{get:function(){return this.openToUse===OpenState.openNow},set:function(){this.openToUse=OpenState.openNow}},open24:{get:function(){return this.openToUse===OpenState.open24},set:function(){this.openToUse=OpenState.open24}},hasMLAK:function(){return SearchMask.hasFlag(this.maskToUse,SearchMask.xISMLAKKEY)},likedFacilitiesToLoad:function(){return this.totalLikedFacilities&&this.loadedLikedFacilities?Math.min(this.totalLikedFacilities-this.loadedLikedFacilities,20):0},distanceFromHere:function(){return this.searchedLocation!==null?this.searchedLocation:this.usingCustomMap?this.customMapOrigin:this.my},isMobile:function(){var n=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(n=!0)}(navigator.userAgent||navigator.vendor||window.opera),n}},watch:{my:function(n){this.state===MapState.tracking&&(this.current=n,storageAvailable("localStorage")&&(window.localStorage.setItem("start_lat",n.lat),window.localStorage.setItem("start_lng",n.lng)));this.searchedLocation==null||this.usingCustomMap||this.toilets.forEach(function(n){return n.recalculateRouteDistance()})},gps:function(n){if(this.lastUpdateFromGeolocation=!0,this.geolocationAvailable=!0,this.state==MapState.initial)this.state=MapState.tracking,this.my={lat:n.lat,lng:n.lng},this.map.panTo(app.my);else{var t=this.inCar?500:100;Geo.distanceBetween(this.my,n)>t&&(this.my={lat:n.lat,lng:n.lng})}this.state===MapState.tracking&&(this.marker.setPosition(n),this.origin=n,this.fitMap())},state:function(n){n===MapState.tracking&&(this.current=this.my);(n===MapState.tracking||n===MapState.searching||n===MapState.provider)&&this.marker.setPosition(this.current);(n===MapState.tracking||n===MapState.custom)&&(this.searchedLocation=null)},current:function(n){(this.state===MapState.initial||this.state===MapState.searching||this.state===MapState.custom)&&(this.marker.setPosition(n),this.origin=n);this.state!==MapState.custom&&this.getToilets(!0)},zoom:function(){this.state!==MapState.tracking&&this.state!==MapState.searching&&(this.state!==MapState.custom?this.getToilets(!0):this.state=MapState.panning)},searchMask:function(n){storageAvailable("localStorage")&&(localStorage.searchMask=n,localStorage.launchesWithDefaultMask=0);this.toilets.forEach(function(n){return n.refreshMapData()});this.getToilets()},searchMaskOverride:function(n){storageAvailable("sessionStorage")&&(sessionStorage.searchMaskOverride=n);storageAvailable("localStorage")&&(localStorage.launchesWithDefaultMask=0);this.toilets.forEach(function(n){return n.refreshMapData()});this.getToilets()},customMapSearchMask:function(){this.toilets.forEach(function(n){return n.refreshMapData()});this.state!==MapState.custom&&this.getToilets()},customMapSearchMaskOverride:function(){this.toilets.forEach(function(n){return n.refreshMapData()});this.state!==MapState.custom&&this.getToilets()},selectedFacility:function(n){n&&n.expand()},inCar:function(n){storageAvailable("localStorage")&&window.localStorage.setItem("transportFilter",n);this.distances=[];this.getToilets()},open:function(n){this.usingCustomMap||(this.searchMask=n===OpenState.open24?SearchMask.setFlag(this.searchMask,SearchMask.xISOPENALLHOURS):SearchMask.unsetFlag(this.searchMask,SearchMask.xISOPENALLHOURS),storageAvailable("localStorage")&&window.localStorage.setItem("openState",n),this.getToilets())},openOverride:function(n){n?storageAvailable("sessionStorage")&&window.sessionStorage.setItem("openOverride",n):storageAvailable("sessionStorage")&&window.sessionStorage.removeItem("openOverride");this.getToilets()},customMapOpen:function(n){n===OpenState.open24?this.updateMaskToUse(SearchMask.setFlag(this.maskToUse,SearchMask.xISOPENALLHOURS)):this.updateMaskToUse(SearchMask.unsetFlag(this.maskToUse,SearchMask.xISOPENALLHOURS));this.state!==MapState.custom&&this.getToilets()},customMapOpenOverride:function(){this.getToilets()},currentPanel:function(n){var t=this;this.accountmanager.clearAC();n!==null&&n==="editors-panel"&&this.editormanager.AutoLoad?this.selectedFacility?(this.editormanager.CreateMode=!1,this.editormanager.ReadOnlyToilet=this.selectedFacility,this.editormanager.EnterCompactMode(),this.editormanager.setHRID(this.selectedFacility.id).then(function(){ga("send","event","Edit","Started",t.selectedFacility.id);gtag("event","Edit",{Started:t.selectedFacility.id});t.editormanager.UserInfo.HasEditRights(t.editormanager.Facility.AgencyID)||(t.editormanager.Editors.forEach(function(n){n.Show=!1;n.Compact=!1}),t.editormanager.LetUsKnow.Show=!0,t.editormanager.DisplayMode=EditorManagerDisplayMode.LetUSKnow)},function(n){n&&n.status===401?(t.editormanager.DisplayMode=EditorManagerDisplayMode.Unauthorised,t.editormanager.UserInfo=null):n&&n.status===404&&(hidePanel("editors-panel"),Message.display(MessageType.error,null,"Facility not found",1e4))})):hidePanel("editors-panel"):n!==null&&n==="create-panel"?(this.getToiletTitleBlackListWords(),this.editormanager.EnterCreateMode().then(function(){ga("send","event","CreateNew","Started");gtag("event","CreateNew",{action:"Started"})},function(n){n&&n.status===401&&(t.editormanager.DisplayMode=EditorManagerDisplayMode.Unauthorised,t.editormanager.UserInfo=null)})):n==="account-panel"?this.accountmanager.DisplayMode=this.accountmanager.LoggedIn?AccountDisplayMode.MyAccount:AccountDisplayMode.Unauthorised:n&&n==="myfacilities-panel"?(this.loadMyFacilities(0),ga("send","event","MyFacilities","Show"),gtag("event","MyFacilities",{action:"Show"})):n&&n==="details-panel"?(ga("send","event","Details","Show",this.selectedFacility.id.toString()),gtag("event","Details",{Show:this.selectedFacility.id})):n==="find-panel"?(this.openOverrideToUse=null,this.showMapDetails||(ga("send","event","Find","Show"),gtag("event","Find",{action:"Show"}))):n==="preferences-panel"?(this.openOverrideToUse=null,this.usingCustomMap||(this.searchMaskOverride=0),ga("send","event","Preferences","Show"),gtag("event","Preferences",{action:"Show"})):n==="custommap-panel"&&(this.shareMap.Title=null,this.shareMap.MapKey=null,ga("send","event","custommap","Show"),gtag("event","CustomMap",{action:"Show"}))},sortCheck:function(){this.reSort()},loadSortCheck:function(){this.reSort()},provider:function(){this.state=MapState.provider;this.getToilets()}}}),navButtons=Array.from(document.getElementsByClassName("nav-button")),panels=Array.from(document.getElementsByClassName("panel")),overlay=document.getElementById("modal-overlay"),message=document.getElementById("message"),messageCloseButton=document.getElementById("message-close");messageCloseButton.addEventListener("click",function(){message.classList.remove("active")});overlay.addEventListener("click",function(){app.currentPanel!=="editors-panel"&&(navButtons.forEach(function(n){return n.classList.remove("active")}),overlay.classList.remove("visible"),panels.forEach(function(n){n.classList.remove("active")}),app.currentPanel=null)});navButtons.forEach(function(n){n.classList.remove("active");n.addEventListener("click",function(){if(!n.classList.contains("disabled")){var i=n.getAttribute("data-panel"),r=document.getElementById(i),u=n.getElementsByClassName("menu-wrapper"),t=u.length>0;if(t||panels.forEach(function(n){return n.classList.remove("active")}),t){var f=u[0],e=f.getElementsByTagName("ul")[0],o=Array.from(e.getElementsByTagName("li"));o.forEach(function(t){t.hasAttribute("data-panel")&&t.addEventListener("click",function(i){if(i.stopPropagation(),!t.classList.contains("disabled")){panels.forEach(function(n){return n.classList.remove("active")});var r=document.getElementById(t.getAttribute("data-panel"));message&&message.classList.remove("active");overlay.classList.add("visible");r.classList.add("active");r.focus();n.classList.remove("active");r.id==="find-panel"&&(app.showMapDetails=!1);app.currentPanel=r.id}})})}n.classList.contains("active")?(n.classList.remove("active"),t||overlay.classList.remove("visible")):(navButtons.forEach(function(n){return n.classList.remove("active")}),n.classList.add("active"),t||(r?(message&&message.classList.remove("active"),overlay.classList.add("visible"),r.classList.add("active"),r.focus(),i==="find-panel"&&(app.showMapDetails=!1),app.currentPanel=i):overlay.classList.remove("visible")))}})});typeof Sentry!="undefined"&&Sentry.init({dsn:"https://6df986d7bdc948a68bc4cb4e4382359f@o251279.ingest.sentry.io/1450105",allowUrls:["toiletmap.gov.au"]});"use strict";var ReCaptchaManager=function(){function n(){_classCallCheck(this,n);this.CurrentRecaptcha=null}return _createClass(n,[{key:"IsFunction",value:function(n){return n?typeof n=="function":!1}}]),n}(),RC_Manager=new ReCaptchaManager,ReCaptcha=function(){function n(t,i){_classCallCheck(this,n);this.V3Options=t;this.V2Options=i;RC_Manager.CurrentRecaptcha=this;this.V2Rendered=!1}return _createClass(n,[{key:"Run",value:function(n){var t,i;n||!this.V3Options?this.V2Options?(t=this,this.V3Options?grecaptcha.ready(function(){t.V2Options.Start();t.V2Rendered?grecaptcha.reset():(grecaptcha.render(t.V2Options.Element,{sitekey:t.V2Options.Key,callback:HS_Recaptcha_Submit,"expired-callback":HS_Recaptcha_Expire}),t.V2Rendered=!0)}):n?this.V2Options.Challenge():(t.V2Options.Start(),t.V2Rendered?grecaptcha.reset():(grecaptcha.render(t.V2Options.Element,{sitekey:t.V2Options.Key,callback:HS_Recaptcha_Submit,"expired-callback":HS_Recaptcha_Expire}),t.V2Rendered=!0))):this.V3Options&&this.V3Options.Challenge():this.V3Options&&(i=this,grecaptcha.ready(function(){i.V3Options.Start();grecaptcha.execute(i.V3Options.Key,{action:i.V3Options.Action}).then(function(n){i.V3Options.SetToken(n);i.V3Options.Success(n)},function(n){i.V3Options.Error(n)})}))}},{key:"HandleVerifyResult",value:function(n,t,i){n==="Pass"?t&&t(i):n==="Fail"?this.V2Options.Fail(i):n==="V2CheckRequired"?this.Run(!0):n==="ActionRequired"?this.V3Options.Challenge(i):n==="Errors"?this.V3Options?this.V3Options.Error(i):this.V2Options.Error(i):n==="Invalid"&&(this.V3Options?this.V3Options.Invalid(i):this.V2Options.Invalid(i))}},{key:"OnSubmit",value:function(n){this.V2Options.SetToken(n);this.V2Options.Success()}},{key:"OnExpire",value:function(){this.V2Options.SetToken("");this.V2Options.Expire()}}]),n}(),HS_Recaptcha_Submit=function(n){RC_Manager.CurrentRecaptcha.OnSubmit(n)},HS_Recaptcha_Expire=function(){RC_Manager.CurrentRecaptcha.OnExpire()},ReCaptchaOptions=function(){function n(t,i){_classCallCheck(this,n);this.Key=t;this.OnSuccess=null;this.OnExpire=null;this.OnError=null;this.OnInvalid=null;this.OnFail=null;this.OnChallenge=null;this.PreStart=null;this.TokenElement=i}return _createClass(n,[{key:"SetSuccess",value:function(n){return this.OnSuccess=this.SetFunction(n),this}},{key:"SetExpire",value:function(n){return this.OnExpire=this.SetFunction(n),this}},{key:"SetError",value:function(n){return this.OnError=this.SetFunction(n),this}},{key:"SetInvalid",value:function(n){return this.OnInvalid=this.SetFunction(n),this}},{key:"SetFail",value:function(n){return this.OnFail=this.SetFunction(n),this}},{key:"SetChallenge",value:function(n){return this.OnChallenge=this.SetFunction(n),this}},{key:"SetPreStart",value:function(n){return this.PreStart=this.SetFunction(n),this}},{key:"Success",value:function(n){RC_Manager.IsFunction(this.OnSuccess)&&this.OnSuccess(n)}},{key:"Expire",value:function(){RC_Manager.IsFunction(this.OnExpire)&&this.OnExpire()}},{key:"Error",value:function(n){RC_Manager.IsFunction(this.OnError)&&this.OnError(n)}},{key:"Invalid",value:function(n){RC_Manager.IsFunction(this.OnInvalid)&&this.OnInvalid(n)}},{key:"Fail",value:function(n){RC_Manager.IsFunction(this.OnFail)&&this.OnFail(n)}},{key:"Challenge",value:function(n){RC_Manager.IsFunction(this.OnChallenge)&&this.OnChallenge(n)}},{key:"Start",value:function(){RC_Manager.IsFunction(this.PreStart)&&this.PreStart()}},{key:"SetToken",value:function(n){typeof this.TokenElement=="string"?document.getElementById(this.TokenElement).value=n:typeof this.TokenElement=="function"?this.TokenElement(n):this.TokenElement.Token!==undefined?this.TokenElement.Token=n:window.jQuery&&$(this.TokenElement).val(n)}},{key:"SetFunction",value:function(n){return RC_Manager.IsFunction(n)?n:null}}]),n}(),ReCaptchaV2Options=function(n){function t(n,i,r){var u;return _classCallCheck(this,t),u=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,n,r)),u.Element=i,u}return _inherits(t,n),t}(ReCaptchaOptions),ReCaptchaV3Options=function(n){function t(n,i,r){var u;return _classCallCheck(this,t),u=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,n,i)),u.Action=r,u}return _inherits(t,n),t}(ReCaptchaOptions)