Google
Edit File: image-zoom-09112d6c00df3cb72220-min.js
webpackJsonp([35],{0:function(h,k,b){b(922);b(332)},332:function(h,k){YUI.add("squarespace-rendering",function(b){b.Squarespace.Rendering={getWidthForHeight:function(a,c,b){return a/c*b},getHeightForWidth:function(a,c,b){return c/a*b},getDimensionsFromNode:function(a){if(a=a.getAttribute("data-image-dimensions")){if(b.Lang.isString(a))return a=a.split("x"),{width:parseInt(a[0],10),height:parseInt(a[1],10)}}else return{width:null,height:null}},getSquarespaceSizeForWidth:function(a){b.config.win.devicePixelRatio&& (a*=b.config.win.devicePixelRatio);return 1500<a?"2500w":1E3<a?"1500w":750<a?"1000w":500<a?"750w":300<a?"500w":100<a?"300w":"100w"},splitScriptsAndHTML:function(a){for(var c=a.indexOf("<script>"),b=-1,e="",d="",f=0;;){b=a.indexOf("\x3c/script>",f);if(-1==b||-1==c)return{html:a,script:""};var l=a.substring(c+8,b),d=d+l,e=e+a.substring(f,c),f=b+9,c=a.indexOf("<script>",f);if(-1===c)return 0===d.length&&(d=null),e+=a.substring(f),{html:e,script:d}}},getPixelSize:function(a){a=a.split("x");return parseInt(a[0], 10)*parseInt(a[1],10)},scaleEmbed:function(a,c){var b=/height="([0-9]+)"/.exec(a);if(!b)return a;var b=parseInt(b[1],10),e=/width="([0-9]+)"/.exec(a);if(!e)return a;e=parseInt(e[1],10);return a.replace(/height="([0-9]+)"/,'height="'+b*(c/e)+'"').replace(/width="([0-9]+)"/,'width="'+c+'"')},applyStyleToMap:function(a,c){var b=new google.maps.StyledMapType(c,{name:"Custom"});a.mapTypes.set("custom",b);a.setMapTypeId("custom")},createGrayscaleMap:function(a){this.applyStyleToMap(a,[{featureType:"landscape.man_made", elementType:"all",stylers:[{lightness:51}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"all",stylers:[{gamma:2.51}]},{featureType:"road.arterial",elementType:"all",stylers:[{gamma:1.9}]},{featureType:"water",elementType:"all",stylers:[{gamma:1.36}]},{featureType:"road.highway",elementType:"all",stylers:[{gamma:1.33}]},{featureType:"transit.station.rail",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"transit.station.bus", elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"transit",elementType:"all",stylers:[{gamma:1.2},{hue:"#0033ff"}]},{featureType:"administrative.neighborhood",elementType:"labels",stylers:[{gamma:1.43}]},{featureType:"water",elementType:"all",stylers:[{lightness:-47}]},{featureType:"all",elementType:"all",stylers:[{saturation:-100}]},{featureType:"road.arterial",elementType:"labels",stylers:[{lightness:23}]}])},getIconUrl:function(a,c,b){return"/universal/images-v6/icons/icon-"+ a+"-"+c+"-"+b+".png"},onMapConfigure:function(a){if(a=b.one(a)){var c=a.getAncestorData("layout-engine");a=a.getAncestorData("manager");c&&a&&c.lm.configureBlock(null,a.boundingEl)}},renderMap:function(a,c,g,e){c=b.merge({location:{mapLat:40.720882,mapLng:-74.000988,mapZoom:12},vSize:12},c);if(a){g=g||{};var d=a._node;if(d.__map)google.maps.event.trigger(d.__map,"resize");else{a.addClass("page-map");a.set("innerHTML"," ");var f=b.bind(function(){d.__geocoder=new google.maps.Geocoder;d.__map= new google.maps.Map(d,{zoom:c.location.mapZoom,center:new google.maps.LatLng(c.location.mapLat,c.location.mapLng),mapTypeId:google.maps.MapTypeId.ROADMAP,draggable:!0,scrollwheel:!0,disableDefaultUI:!0});b.Lang.isUndefined(e)?b.Squarespace.Rendering.createGrayscaleMap(d.__map):this.applyStyleToMap(d.__map,e);var a=c.location,f;a.addressLine1||a.addressLine2?(f=a.addressLine1+" "+a.addressLine2,a.addressCountry&&(f+=", "+a.addressCountry)):f=c.location.mapLat+","+c.location.mapLng;if(c.location.markerLat&& c.location.markerLng){var h=new google.maps.LatLng(c.location.markerLat,c.location.markerLng);d.__marker=new google.maps.Marker({map:d.__map,animation:google.maps.Animation.DROP,draggable:!1,position:h,title:a.addressTitle?a.addressTitle+" "+f:f,icon:{url:"../../universal/images-v6/icons/icon-map-marker-2x.png",size:new google.maps.Size(52,68),scaledSize:new google.maps.Size(26,34),anchor:new google.maps.Point(13,34)}});b.Lang.isObject(g.infoWindow)&&(d.__infoWindow=new google.maps.InfoWindow(b.merge({pixelOffset:new google.maps.Size(-13, 10)},g.infoWindow)),g.infoWindow.autoOpen&&d.__infoWindow.open(d.__map,d.__marker));google.maps.event.addListener(d.__marker,"click",b.bind(function(a,c){if(d.__infoWindow)d.__infoWindow.open(d.__map,d.__marker);else{a=a.toUrlValue();var e=c.getZoom(),e=b.QueryString.stringify({sll:a,q:f,z:e});window.open("http://maps.google.com/maps?"+e)}},this,h,d.__map))}d.startEditing=function(){d.__map.setOptions({draggable:!0,scrollwheel:!0,disableDefaultUI:!1});d.__marker&&d.__marker.setOptions({draggable:!0})}; d.stopEditing=function(){d.__map.setOptions({draggable:!1,scrollwheel:!1,disableDefaultUI:!0});d.__marker&&d.__marker.setOptions({draggable:!1})};b.one(d).fire("maps-loaded");google.maps.event.addListener(d.__map,"rightclick",b.bind(this.onMapConfigure,this,d))},this);b.Squarespace.GoogleMap.loaded?f():(d.__loadingMap=!0,b.Squarespace.GoogleMap.on("load-success",function(){d.__loadingMap=!1;f()}),b.Squarespace.GoogleMap.load())}}else console.error("Page map node missing...")}}},"1.0",{requires:[]})}, 922:function(h,k){YUI.add("squarespace-image-zoom",function(b){b.namespace("Squarespace");var a=b.Squarespace.ImageZoom=b.Base.create("image-zoom",b.Base,[],{initializer:function(){!b.UA.mobile&&Modernizr.csstransforms&&(this.get("host")?this._initializeZoom():console.warn("[squarespace-image-zoom]: Missing host attribute."))},destructor:function(){this._host.removeClass(a.CSS_PREFIX);this._host.removeClass(a.CSS_PREFIX+"--behavior-"+this.get("behavior"));this._dropzone.setStyle("position","");this._dropzone.removeClass(a.CSS_PREFIX+ "-dropzone");this._dupeWrapper.remove(!0);this._hostImageLoadEvent&&this._hostImageLoadEvent.detach();this._primaryEvent.detach();this._mouseMoveEvent.detach();this._mouseOutEvent.detach();this._resizeEvent.detach();this._dupeImage=this._dupeWrapper=this._dropzone=this._host=this._resizeEvent=this._mouseOutEvent=this._mouseMoveEvent=this._primaryEvent=this._hostImageLoadEvent=null},_initializeZoom:function(){this._host=b.one(this.get("host"));this._dropzone=b.one(this.get("dropzone"));"static"=== this._dropzone.getStyle("position")&&this._dropzone.setStyle("position","relative");var a=this._host.one("img");a.getAttribute("src")?this._injectMarkupAndBindEvents():this._hostImageLoadEvent=a.on("load",function(){this._injectMarkupAndBindEvents()},this)},_injectMarkupAndBindEvents:function(){this._injectDuplicateImage();b.later(0,this,function(){this._dropzone.addClass(a.CSS_PREFIX+"-dropzone");this._host.addClass(a.CSS_PREFIX);this._host.addClass(a.CSS_PREFIX+"--behavior-"+this.get("behavior")); this._primaryEvent=this._host.on(this.get("behavior"),this._toggleZoom,this);this._mouseMoveEvent=this._host.on("mousemove",this._trackMovement,this);this._mouseOutEvent=this._host.on("mouseout",this._zoomOut,this)})},_toggleZoom:function(a){this.get("_isZoomedIn")?this._zoomOut():this._zoomIn(a);a.stopPropagation()},_zoomIn:function(a){this.get("host").addClass("is-zoomed");this.set("_isZoomedIn",!0);this._trackMovement(a)},_zoomOut:function(){this.get("host").removeClass("is-zoomed");this.set("_isZoomedIn", !1)},_trackMovement:function(a){if(this.get("_isZoomedIn")){var b=Math.max(100*((a.pageX-this._host.getX())/this._host.get("clientWidth")),0);a=Math.max(100*((a.pageY-this._host.getY())/this._host.get("clientHeight")),0);this._dupeWrapper.setStyle("transformOrigin",b+"% "+a+"%")}},_injectDuplicateImage:function(){this._dropzone.append(this._getDuplicateImageMarkup());this._dupeWrapper=this.get("dropzone").one("."+a.CSS_PREFIX+"-duplicate");this._dupeImage=this._dupeWrapper.one("img");this._dupeWrapper.setStyle("transform", "scale("+this.get("zoom")+")");this._loadDupeImage();this._resizeEvent=b.one(window).on("resize",this._dupeImage.fire("refresh"),this)},_loadDupeImage:function(){this._dupeImage.plug(b.Squarespace.Loader2,{load:!0,mode:"fill"})},_getDuplicateImageMarkup:function(){var c=this._host.one("img"),g=this._host.get("clientWidth")*this.get("zoom"),g=b.Squarespace.Rendering.getSquarespaceSizeForWidth(g),e=c.getData("src");if(!e)return null;var d=c.getData("image-dimensions");d||(d=c.get("clientWidth")+"x"+ c.get("clientHeight"));(c=c.getData("image-focal-point"))||(c="0.5,0.5");return'<div class="'+a.CSS_PREFIX+'-duplicate"><img src="'+e+"?format="+g+'" data-image-dimensions="'+d+'" data-image-focal-point="'+c+'"></div>'}},{CSS_PREFIX:"sqs-image-zoom",ATTRS:{host:{value:null,validator:function(a){a=b.one(a);return b.instanceOf(a,b.Node)&&a.one("img")&&2>a.all("img").size()},writeOnce:!0},dropzone:{valueFn:function(){return this.get("host")},validator:function(a){return b.instanceOf(b.one(a),b.Node)}, writeOnce:!0},behavior:{value:"hover",validator:function(a){return"hover"!==a&&"click"!==a?(console.warn("[squarespace-image-zoom]: Not a valid behavior, defaulting to hover."),!1):!0},writeOnce:!0},zoom:{value:1.5,validator:function(a){("number"!==typeof a||1>=a||5<a)&&console.warn("[squarespace-image-zoom]: Not a valid zoom value, defaulting to 1.5.");return!0},writeOnce:!0},_isZoomedIn:{value:!1}}})},"1.0",{requires:"node base event yui-base squarespace-image-loader squarespace-rendering".split(" ")})}});