Google
Edit File: simple-liking-7416099a95cb4c1f8c1e-min.js
webpackJsonp([19],{0:function(l,h,d){d(1853);d(488);d(149);d(175);d(176);d(482);d(495);d(483);d(484);d(487);d(272);d(481);d(333);d(292);d(332);d(486);d(485);d(489);d(490);d(491);d(492);d(493);d(494);d(496)},56:function(l,h,d){var a=d(8)["default"],m=d(5)["default"],e=d(21)["default"],f=d(74)["default"];h=d(10);var b=d(110),g=d(101),c=d(73),k=d(102),q=d(185),n=d(301);d=d(304);var p=d.DEFAULT_COLLECTION_CONFIGURATIONS,r=d.DEFAULT_COLLECTION_CONFIGURATION,s=d.DEFAULT_TEMPLATE_PAGE_CONFIGURATION;d=function(){function d(){m(this, d);this.bindListeners({handleLoadTemplate:g.LOAD_TEMPLATE,staticInitialized:k.BOOTSTRAP});this.exportPublicMethods({isTemplateOwner:this.isTemplateOwner,getCollectionConfig:this.getCollectionConfig,getCustomType:this.getCustomType,getPageConfig:this.getPageConfig})}a(d,[{key:"getCollectionConfig",value:function(c){return this.getState().collectionConfigs[c]}},{key:"getCustomType",value:function(c){return this.getState().customTypes[c]}},{key:"getPageConfig",value:function(c){return this.getState().pageConfigs[c]}}, {key:"isTemplateOwner",value:function(){var c=this.getState();return c.ownerWebsiteId===c.websiteId}},{key:"staticInitialized",value:function(c){this.setTemplateData(c.template);this.demoCollections=this.processDemoCollections(c.demoCollections);this.websiteId=c.website.id}},{key:"handleLoadTemplate",value:function(b){this.waitFor(c.dispatchToken);b.error?this.error=b.response:(this.error=null,this.setTemplateData(b.template),this.demoCollections=this.processDemoCollections(b.demoCollections))}}, {key:"setTemplateData",value:function(c){c&&(this.id=c.id,this.name=c.name,this.updatedOn=c.updatedOn,this.ownerWebsiteId=c.ownerWebsiteId,this.collectionConfigs=this.processCollectionConfigs(c.collectionConfigs),this.pageConfigs=this.processPageConfigs(c.pageConfigs),this.customTypes=this.processCustomTypes(c.customTypes),this.layouts=this.processLayouts(c.layouts),this.navigations=c.navigations)}},{key:"processCollectionConfigs",value:function(c){c.products&&(c.products=e({},p.products,c.products), c.products.ordering=b.USER);c=e({},p,c);c=n(c,function(c){c=e({},r,c);!0===c.index?c.folderBehavior=q.INDEX:!0===c.folder&&(c.folderBehavior=q.NONE);return c});var a=c.folders||c.folder;a&&(a.acceptTypes=this.calculateFolderAcceptTypes(c));return c}},{key:"calculateFolderAcceptTypes",value:function(c){var b=["subscription","gallery-block","template-page"];return f(c).filter(function(a){return c[a].folder?!1:-1===b.indexOf(a)}).concat(["link"])}},{key:"processPageConfigs",value:function(c){return n(c, function(c){return e({},s,c)})}},{key:"processCustomTypes",value:function(c){return(void 0===c?[]:c).reduce(function(c,b){c[b.name]=b;return c},{})}},{key:"processDemoCollections",value:function(c){return c||[]}},{key:"processLayouts",value:function(c){return c||{}}}]);return d}();l.exports=h.createStore(d,"TemplateStore")},73:function(l,h,d){var a=d(8)["default"],m=d(5)["default"];h=d(10);var e=d(101),f=d(106),b=d(102);d=function(){function g(){m(this,g);this.templateInstallations={};this.bindListeners({handleLoadSuccess:f.LOAD_SUCCESS, handleLoadFailure:f.LOAD_FAILURE,handleStaticInitialized:b.BOOTSTRAP,handlePreviewSet:f.SET_PREVIEW_INSTALLATION,handleTemplateSet:f.SET_LIVE_INSTALLATION,handleHomepageCollectionIdSet:f.SET_HOMEPAGE_COLLECTION_ID,handleLoadTemplate:e.LOAD_TEMPLATE});this.exportPublicMethods({getHomepageCollectionId:this.getHomepageCollectionId})}a(g,[{key:"getHomepageCollectionId",value:function(){return this.getState().activeInstallation?this.getState().activeInstallation.homepageCollectionId:this.getState().homepageCollectionId}}, {key:"handleStaticInitialized",value:function(c){var b=c.authenticatedAccountWebsiteSettings;this.previewInstallationId=b?b.previewInstallationId:null;this.homepageCollectionId=c.homepageCollectionId;c.templateInstallation?(this.liveInstallationId=c.templateInstallation.id,this.templateInstallations[this.liveInstallationId]=c.templateInstallation):this.liveInstallationId=null;this.siteLayout=c.siteLayout;this.updateInstallationReferences()}},{key:"updateInstallationReferences",value:function(){this.liveInstallation= this.getTemplateInstallation(this.liveInstallationId);this.previewInstallation=null;this.previewInstallationId!==this.liveInstallationId&&(this.previewInstallation=this.getTemplateInstallation(this.previewInstallationId));this.activeInstallation=this.previewInstallation||this.liveInstallation}},{key:"getTemplateInstallation",value:function(c){return!c||!this.templateInstallations[c]?null:this.templateInstallations[c]}},{key:"handleLoadTemplate",value:function(c){this.siteLayout=c.siteLayout}},{key:"handleHomepageCollectionIdSet", value:function(c){c.error||(this.homepageCollectionId=c.homepageCollectionId,this.activeInstallation&&(this.activeInstallation.homepageCollectionId=c.homepageCollectionId))}},{key:"handlePreviewSet",value:function(c){this.previewInstallationId=c;this.updateInstallationReferences()}},{key:"handleTemplateSet",value:function(c){this.liveInstallationId=c;this.previewInstallationId=null;this.updateInstallationReferences()}},{key:"handleLoadSuccess",value:function(c){var b={};c.forEach(function(c){this[c.id]= c},b);this.maintainMissingInstallation(b,this.liveInstallationId);this.maintainMissingInstallation(b,this.previewInstallationId);this.templateInstallations=b;this.updateInstallationReferences()}},{key:"maintainMissingInstallation",value:function(c,b){b&&!c[b]&&(c[b]=this.templateInstallations[b])}},{key:"handleLoadFailure",value:function(){console.error("Unable to load installations")}}]);return g}();l.exports=h.createStore(d,"TemplateInstallationsStore")},101:function(l,h,d){var a=d(8)["default"], m=d(5)["default"];h=d(10);var e=d(284);d=function(){function f(){m(this,f)}a(f,[{key:"loadTemplate",value:function(b){var a=this;e.getTemplate(b).then(function(c){a.dispatch(c.data)},function(c){a.dispatch({error:!0,response:c})})}}]);return f}();l.exports=h.createActions(d)},106:function(l,h,d){var a=d(8)["default"],m=d(5)["default"],e=d(283),f=d(285);h=d(10);var b=d(163),g=d(101);d=function(){function c(){m(this,c)}a(c,[{key:"loadAll",value:function(){var c=this;this.dispatch();return f.loadTemplateInstallations().then(function(b){c.actions.loadSuccess.defer(b.data)}, function(b){c.actions.loadFailure.defer(b.error)})}},{key:"setPreviewInstallation",value:function(c,a,n){var p=this;e.setPreviewInstallation(c,a).then(function(c){g.loadTemplate.defer(n);p.dispatch(a);setTimeout(b.refresh,1E3)},function(c){})}},{key:"setLiveInstallation",value:function(c,a){var n=this;f.setLiveInstallation(c).then(function(e){g.loadTemplate.defer(a);n.dispatch(c);setTimeout(b.refresh,1E3)},function(c){})}},{key:"setHomepageCollectionId",value:function(c){var b=this;return f.setHomepageCollectionId(c).then(function(a){a= {homepageCollectionId:c};b.dispatch(a);return a},function(a){a={homepageCollectionId:c,error:!0};b.dispatch(a);return a})}},{key:"updateInstallation",value:function(c){return f.updateInstallation(c).then(this.actions.loadAll)}},{key:"loadSuccess",value:function(c){this.dispatch(c)}},{key:"loadFailure",value:function(c){this.dispatch(c)}}]);return c}();l.exports=h.createActions(d)},149:function(l,h,d){YUI.add("model",function(a,d){function e(){e.superclass.constructor.apply(this,arguments)}var f=YUI.namespace("Env.Model"), b=a.Lang,g=a.Array,c=a.Object,k="error";a.Model=a.extend(e,a.Base,{idAttribute:"id",_allowAdHocAttrs:!0,_isYUIModel:!0,initializer:function(c){this.changed={};this.lastChange={};this.lists=[]},destroy:function(c,b){var a=this;"function"===typeof c&&(b=c,c=null);a.onceAfter("destroy",function(){function k(e){e||g.each(a.lists.concat(),function(b){b.remove(a,c)});b&&b.apply(null,arguments)}c&&(c.remove||c["delete"])?a.sync("delete",c,k):k()});return e.superclass.destroy.call(a)},generateClientId:function(){f.lastId|| (f.lastId=0);return this.constructor.NAME+"_"+(f.lastId+=1)},getAsHTML:function(c){c=this.get(c);return a.Escape.html(b.isValue(c)?String(c):"")},getAsURL:function(c){c=this.get(c);return encodeURIComponent(b.isValue(c)?String(c):"")},isModified:function(){return this.isNew()||!c.isEmpty(this.changed)},isNew:function(){return!b.isValue(this.get("id"))},load:function(c,b){var a=this;"function"===typeof c&&(b=c,c={});c||(c={});a.sync("read",c,function(e,f){var g={options:c,response:f},d;e?(g.error= e,g.src="load",a.fire(k,g)):(a._loadEvent||(a._loadEvent=a.publish("load",{preventable:!1})),d=g.parsed=a._parse(f),a.setAttrs(d,c),a.changed={},a.fire("load",g));b&&b.apply(null,arguments)});return a},parse:function(c){if("string"===typeof c)try{return a.JSON.parse(c)}catch(b){return this.fire(k,{error:b,response:c,src:"parse"}),null}return c},save:function(c,b){var a=this;"function"===typeof c&&(b=c,c={});c||(c={});a._validate(a.toJSON(),function(e){e?b&&b.call(null,e):a.sync(a.isNew()?"create": "update",c,function(e,f){var g={options:c,response:f},d;e?(g.error=e,g.src="save",a.fire(k,g)):(a._saveEvent||(a._saveEvent=a.publish("save",{preventable:!1})),f&&(d=g.parsed=a._parse(f),a.setAttrs(d,c)),a.changed={},a.fire("save",g));b&&b.apply(null,arguments)})});return a},set:function(c,b,a){var k={};k[c]=b;return this.setAttrs(k,a)},setAttrs:function(b,k){var e=this.idAttribute,g,f,d,m;k=a.merge(k);m=k._transaction={};"id"!==e&&(b=a.merge(b),c.owns(b,e)?b.id=b[e]:c.owns(b,"id")&&(b[e]=b.id)); for(f in b)c.owns(b,f)&&this._setAttr(f,b[f],k);if(!c.isEmpty(m)){e=this.changed;d=this.lastChange={};for(f in m)c.owns(m,f)&&(g=m[f],e[f]=g.newVal,d[f]={newVal:g.newVal,prevVal:g.prevVal,src:g.src||null});k.silent||(this._changeEvent||(this._changeEvent=this.publish("change",{preventable:!1})),k.changed=d,this.fire("change",k))}return this},sync:function(){var c=g(arguments,0,!0).pop();"function"===typeof c&&c()},toJSON:function(){var c=this.getAttrs();delete c.clientId;delete c.destroyed;delete c.initialized; "id"!==this.idAttribute&&delete c.id;return c},undo:function(b,a){var k=this.lastChange,e=this.idAttribute,f={},d;b||(b=c.keys(k));g.each(b,function(b){c.owns(k,b)&&(b=b===e?"id":b,d=!0,f[b]=k[b].prevVal)});return d?this.setAttrs(f,a):this},validate:function(c,b){b&&b()},addAttr:function(c,a,k){var f=this.idAttribute,g;f&&c===f&&(f=this._isLazyAttr("id")||this._getAttrCfg("id"),g=a.value===a.defaultValue?null:a.value,b.isValue(g)||(g=f.value===f.defaultValue?null:f.value,b.isValue(g)||(g=b.isValue(a.defaultValue)? a.defaultValue:f.defaultValue)),a.value=g,f.value!==g&&(f.value=g,this._isLazyAttr("id")?this._state.add("id","lazy",f):this._state.add("id","value",g)));return e.superclass.addAttr.apply(this,arguments)},_parse:function(c){return this.parse(c)},_validate:function(c,a){function e(g){b.isValue(g)?(f.fire(k,{attributes:c,error:g,src:"validate"}),a(g)):a()}var f=this;1===f.validate.length?e(f.validate(c,e)):f.validate(c,e)},_setAttrVal:function(c,b,a,k,f,g){var d=e.superclass._setAttrVal.apply(this, arguments),m=f&&f._transaction,h=g&&g.initializing;d&&(m&&!h)&&(m[c]={newVal:this.get(c),prevVal:a,src:f.src||null});return d}},{NAME:"model",ATTRS:{clientId:{valueFn:"generateClientId",readOnly:!0},id:{value:null}}})},"3.17.2",{requires:["base-build","escape","json-parse"]})},151:function(l,h,d){l.exports={QUEUED:1,PROCESSING:2,READY:3,ERROR:4,DOWNLOAD_ERROR:5,ERROR_TOO_LARGE:6,ERROR_FILE_NOT_FOUND:7,ERROR_UNSUPPORTED_IMAGE_TYPE:8,ERROR_UNSUPPORTED_AUDIO_TYPE:9}},158:function(l,h,d){l.exports={ENABLED:1, DISABLED:2}},163:function(l,h,d){var a=d(8)["default"],m=d(5)["default"];h=d(10);d=function(){function e(){m(this,e);this.generateActions("refresh","setUrl","removeLoadHandler")}a(e,[{key:"addLoadHandler",value:function(a,b){this.dispatch({key:a,callback:b})}}]);return e}();l.exports=h.createActions(d)},175:function(l,h,d){YUI.add("squarespace-model-sync-rest",function(a){function d(){this._ioConfigCache={}}d.prototype={sync:function(e,f,b){a.Lang.isValue(f.timeout)||(f.timeout=1E7);a.ModelSync.REST.prototype.sync.apply(this, arguments)},_storeRequest:function(e,f){this._ioConfigCache[e.id]=a.merge(f,{})},_retrieveAndEvict:function(a){var f=this._ioConfigCache[a];this._ioConfigCache[a]=null;return f},_isCrumbFailure:function(a){return a&&a.crumbFail&&a.crumb},_sendSyncIORequest:function(e){var f=a.ModelSync.REST.prototype._sendSyncIORequest.apply(this,arguments);this._storeRequest(f,e);return f},_onSyncIOEnd:function(e,f){this._retrieveAndEvict(e);a.ModelSync.REST.prototype._onSyncIOEnd.apply(this,arguments)},_onSyncIOSuccess:function(e, f,b){var g=this._retrieveAndEvict(e),c={},k=f.responseText;a.Lang.isValue(k)&&k.trim()&&(c=a.JSON.parse(k));this._isCrumbFailure(c)?(c=c.crumb,a.ModelSync.REST.CSRF_TOKEN=c,a.Env.CSRF_TOKEN=c,g.headers["X-CSRF-Token"]=c,this._sendSyncIORequest(g)):a.ModelSync.REST.prototype._onSyncIOSuccess.apply(this,arguments)},_onSyncIOFailure:function(e,f,b){if(e=b.callback){b={};var g=f.responseText;a.Lang.isValue(g)&&g.trim()&&(b=a.JSON.parse(g));e({code:f.status,msg:f.statusText,responseJSON:b},f)}}};a.mix(d, a.ModelSync.REST,!1,null,1);a.namespace("Squarespace.ModelSync").REST=d},"1.0",{requires:["model-sync-rest"]})},176:function(l,h,d){YUI.add("model-sync-rest",function(a,d){function e(){}var f=a.Lang;e.CSRF_TOKEN=YUI.Env.CSRF_TOKEN;e.EMULATE_HTTP=!1;e.HTTP_HEADERS={Accept:"application/json","Content-Type":"application/json"};e.HTTP_METHODS={create:"POST",read:"GET",update:"PUT","delete":"DELETE"};e.HTTP_TIMEOUT=3E4;e._NON_ATTRS_CFG=["root","url"];e.prototype={root:"",url:"",initializer:function(b){b|| (b={});"root"in b&&(this.root=b.root||"");"url"in b&&(this.url=b.url||"")},getURL:function(b,e){var c=this.root,k=this.url;return this._isYUIModelList?!k?this.model.prototype.root:this._substituteURL(k,a.merge(this.getAttrs(),e)):c&&("create"===b||this.isNew())?c:!k?this._joinURL(this.getAsURL("id")||""):this._substituteURL(k,a.merge(this.getAttrs(),e))},parseIOResponse:function(b){return b.responseText},serialize:function(b){return a.JSON.stringify(this)},sync:function(b,f,c){f||(f={});var k=this.getURL(b, f),d=e.HTTP_METHODS[b],n=a.merge(e.HTTP_HEADERS,f.headers),p=f.timeout||e.HTTP_TIMEOUT;f=f.csrfToken||e.CSRF_TOKEN;var m;"POST"===d||"PUT"===d?m=this.serialize(b):delete n["Content-Type"];if(e.EMULATE_HTTP&&("PUT"===d||"DELETE"===d))n["X-HTTP-Method-Override"]=d,d="POST";if(f&&("POST"===d||"PUT"===d||"DELETE"===d))n["X-CSRF-Token"]=f;this._sendSyncIORequest({action:b,callback:c,entity:m,headers:n,method:d,timeout:p,url:k})},_joinURL:function(b){var a=this.root;if(!a&&!b)return"";"/"===b.charAt(0)&& (b=b.substring(1));return a&&"/"===a.charAt(a.length-1)?a+b+"/":a+"/"+b},_parse:function(b){"function"===typeof this.parseIOResponse&&(b=this.parseIOResponse(b));return this.parse(b)},_sendSyncIORequest:function(b){return a.io(b.url,{arguments:{action:b.action,callback:b.callback,url:b.url},context:this,data:b.entity,headers:b.headers,method:b.method,timeout:b.timeout,on:{start:this._onSyncIOStart,failure:this._onSyncIOFailure,success:this._onSyncIOSuccess,end:this._onSyncIOEnd}})},_substituteURL:function(b, e){if(!b)return"";var c={};a.Object.each(e,function(b,a){if(f.isString(b)||f.isNumber(b))c[a]=encodeURIComponent(b)});return f.sub(b,c)},_onSyncIOEnd:function(b,a){},_onSyncIOFailure:function(b,a,c){(b=c.callback)&&b({code:a.status,msg:a.statusText},a)},_onSyncIOSuccess:function(b,a,c){(b=c.callback)&&b(null,a)},_onSyncIOStart:function(b,a){}};a.namespace("ModelSync").REST=e},"3.17.2",{requires:["model","io-base","json-stringify"]})},272:function(l,h,d){YUI.add("model-list",function(a,d){function e(){e.superclass.constructor.apply(this, arguments)}var f=a.Attribute.prototype,b=a.Lang,g=a.Array;a.ModelList=a.extend(e,a.Base,{model:a.Model,_isYUIModelList:!0,initializer:function(c){c||(c={});var b=this.model=c.model||this.model;"string"===typeof b&&((this.model=a.Object.getValue(a,b.split(".")))||a.error("ModelList: Model class not found: "+b));this.publish("add",{defaultFn:this._defAddFn});this.publish("reset",{defaultFn:this._defResetFn});this.publish("remove",{defaultFn:this._defRemoveFn});this.after("*:idChange",this._afterIdChange); this._clear();c.items&&this.add(c.items,{silent:!0})},destructor:function(){this._clear()},add:function(c,k){var e=c._isYUIModelList;return e||b.isArray(c)?g.map(e?c.toArray():c,function(c,b){var e=k||{};"index"in e&&(e=a.merge(e,{index:e.index+b}));return this._add(c,e)},this):this._add(c,k)},create:function(c,b,e){var f=this;"function"===typeof b&&(e=b,b={});b||(b={});c._isYUIModel||(c=new this.model(c));f.fire("create",a.merge(b,{model:c}));return c.save(b,function(a){a||f.add(c,b);e&&e.apply(null, arguments)})},each:function(c,b){var a=this._items.concat(),e,f,d;e=0;for(d=a.length;e<d;e++)f=a[e],c.call(b||f,f,e,this);return this},filter:function(c,b){var a=[],e=this._items,f,d,g;"function"===typeof c&&(b=c,c={});f=0;for(g=e.length;f<g;++f)d=e[f],b.call(this,d,f,this)&&a.push(d);return c.asList?(e=new this.constructor({model:this.model}),a.length&&e.add(a,{silent:!0}),e):a},get:function(c){return this.attrAdded(c)?f.get.apply(this,arguments):this.invoke("get",c)},getAsHTML:function(c){return this.attrAdded(c)? a.Escape.html(f.get.apply(this,arguments)):this.invoke("getAsHTML",c)},getAsURL:function(c){return this.attrAdded(c)?encodeURIComponent(f.get.apply(this,arguments)):this.invoke("getAsURL",c)},getByClientId:function(c){return this._clientIdMap[c]||null},getById:function(c){return this._idMap[c]||null},invoke:function(c){var b=[this._items,c].concat(g(arguments,1,!0));return g.invoke.apply(g,b)},load:function(c,b){var a=this;"function"===typeof c&&(b=c,c={});c||(c={});this.sync("read",c,function(e, f){var d={options:c,response:f},g;e?(d.error=e,d.src="load",a.fire("error",d)):(a._loadEvent||(a._loadEvent=a.publish("load",{preventable:!1})),g=d.parsed=a._parse(f),a.reset(g,c),a.fire("load",d));b&&b.apply(null,arguments)});return this},map:function(c,b){return g.map(this._items,c,b)},parse:function(c){if("string"===typeof c)try{return a.JSON.parse(c)||[]}catch(b){return this.fire("error",{error:b,response:c,src:"parse"}),null}return c||[]},remove:function(c,a){var e=c._isYUIModelList;return e|| b.isArray(c)?(c=g.map(e?c.toArray():c,function(c){return b.isNumber(c)?this.item(c):c},this),g.map(c,function(c){return this._remove(c,a)},this)):this._remove(c,a)},reset:function(c,b){c||(c=[]);b||(b={});var e=a.merge({src:"reset"},b);c=c._isYUIModelList?c.toArray():g.map(c,function(c){return c._isYUIModel?c:new this.model(c)},this);e.models=c;b.silent?this._defResetFn(e):(this.comparator&&c.sort(a.bind(this._sort,this)),this.fire("reset",e));return this},some:function(c,b){var a=this._items.concat(), e,f,d;e=0;for(d=a.length;e<d;e++)if(f=a[e],c.call(b||f,f,e,this))return!0;return!1},sort:function(c){if(!this.comparator)return this;var b=this._items.concat();c||(c={});b.sort(a.rbind(this._sort,this,c));b=a.merge(c,{models:b,src:"sort"});c.silent?this._defResetFn(b):this.fire("reset",b);return this},sync:function(){var c=g(arguments,0,!0).pop();"function"===typeof c&&c()},toArray:function(){return this._items.concat()},toJSON:function(){return this.map(function(c){return c.toJSON()})},_add:function(c, e){var f;e||(e={});c._isYUIModel||(c=new this.model(c));f=c.get("id");if(this._clientIdMap[c.get("clientId")]||b.isValue(f)&&this._idMap[f])this.fire("error",{error:"Model is already in the list.",model:c,src:"add"});else return f=a.merge(e,{index:"index"in e?e.index:this._findIndex(c),model:c}),e.silent?this._defAddFn(f):this.fire("add",f),c},_attachList:function(c){c.lists.push(this);c.addTarget(this)},_clear:function(){g.each(this._items,this._detachList,this);this._clientIdMap={};this._idMap= {};this._items=[]},_compare:function(c,b){return c<b?-1:c>b?1:0},_detachList:function(c){var b=g.indexOf(c.lists,this);-1<b&&(c.lists.splice(b,1),c.removeTarget(this))},_findIndex:function(c){var b=this._items,a=b.length,e=0,f,d;if(!this.comparator||!a)return a;for(d=this.comparator(c);e<a;)f=e+a>>1,c=b[f],0>this._compare(this.comparator(c),d)?e=f+1:a=f;return e},_parse:function(c){return this.parse(c)},_remove:function(c,e){var f;e||(e={});b.isNumber(c)?(f=c,c=this.item(f)):f=this.indexOf(c);if(-1=== f||!c)this.fire("error",{error:"Model is not in the list.",index:f,model:c,src:"remove"});else return f=a.merge(e,{index:f,model:c}),e.silent?this._defRemoveFn(f):this.fire("remove",f),c},_sort:function(c,b,a){c=this._compare(this.comparator(c),this.comparator(b));return 0===c?c:a&&a.descending?-c:c},_afterIdChange:function(c){var a=c.newVal,e=c.prevVal;c=c.target;if(b.isValue(e))if(this._idMap[e]===c)delete this._idMap[e];else return;else if(-1===this.indexOf(c))return;b.isValue(a)&&(this._idMap[a]= c)},_defAddFn:function(c){var a=c.model,e=a.get("id");this._clientIdMap[a.get("clientId")]=a;b.isValue(e)&&(this._idMap[e]=a);this._attachList(a);this._items.splice(c.index,0,a)},_defRemoveFn:function(c){var a=c.model,e=a.get("id");this._detachList(a);delete this._clientIdMap[a.get("clientId")];b.isValue(e)&&delete this._idMap[e];this._items.splice(c.index,1)},_defResetFn:function(c){"sort"===c.src?this._items=c.models.concat():(this._clear(),c.models.length&&this.add(c.models,{silent:!0}))}},{NAME:"modelList"}); a.augment(e,a.ArrayList)},"3.17.2",{requires:"array-extras array-invoke arraylist base-build escape json-parse model".split(" ")})},283:function(l,h,d){var a=d(31);l.exports={setPreviewInstallation:function(d,e){return a.put("/api/member-website-settings/"+d,{id:d,previewInstallationId:e})}}},284:function(l,h,d){var a=d(31);l.exports={getTemplate:function(d){return a.get("/api/templates/"+d)}}},285:function(l,h,d){var a=d(31),m=d(351);l.exports={loadTemplateInstallations:function(){return a.get("/api/template-installations")}, setLiveInstallation:function(e){return a.post("/api/template/SetTemplate",m.stringify({installationId:e}))},updateInstallation:function(e){return a.put("/api/template-installations/"+e.id,e)},setHomepageCollectionId:function(e){return a.post("/api/template/SetHomepageCollection",m.stringify({collectionId:e}))}}},292:function(l,h,d){YUI.add("datatype-date-format",function(a,d){var e=function(b,a,c){"undefined"===typeof c&&(c=10);for(a+="";parseInt(b,10)<c&&1<c;c/=10)b=a+b;return b.toString()},f={formats:{a:function(b, a){return a.a[b.getDay()]},A:function(b,a){return a.A[b.getDay()]},b:function(b,a){return a.b[b.getMonth()]},B:function(b,a){return a.B[b.getMonth()]},C:function(b){return e(parseInt(b.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(b){return e(parseInt(f.formats.G(b)%100,10),0)},G:function(b){var a=b.getFullYear(),c=parseInt(f.formats.V(b),10);b=parseInt(f.formats.W(b),10);b>c?a++:0===b&&52<=c&&a--;return a},H:["getHours","0"],I:function(b){b=b.getHours()%12;return e(0=== b?12:b,0)},j:function(b){var a=new Date(""+b.getFullYear()+"/1/1 GMT");b=new Date(""+b.getFullYear()+"/"+(b.getMonth()+1)+"/"+b.getDate()+" GMT")-a;b=parseInt(b/6E4/60/24,10)+1;return e(b,0,100)},k:["getHours"," "],l:function(b){b=b.getHours()%12;return e(0===b?12:b," ")},m:function(b){return e(b.getMonth()+1,0)},M:["getMinutes","0"],p:function(b,a){return a.p[12<=b.getHours()?1:0]},P:function(b,a){return a.P[12<=b.getHours()?1:0]},s:function(b,a){return parseInt(b.getTime()/1E3,10)},S:["getSeconds", "0"],u:function(b){b=b.getDay();return 0===b?7:b},U:function(b){var a=parseInt(f.formats.j(b),10);b=6-b.getDay();a=parseInt((a+b)/7,10);return e(a,0)},V:function(b){var a=parseInt(f.formats.W(b),10),c=(new Date(""+b.getFullYear()+"/1/1")).getDay(),a=a+(4<c||1>=c?0:1);53===a&&4>(new Date(""+b.getFullYear()+"/12/31")).getDay()?a=1:0===a&&(a=f.formats.V(new Date(""+(b.getFullYear()-1)+"/12/31")));return e(a,0)},w:"getDay",W:function(b){var a=parseInt(f.formats.j(b),10);b=7-f.formats.u(b);a=parseInt((a+ b)/7,10);return e(a,0,10)},y:function(b){return e(b.getFullYear()%100,0)},Y:"getFullYear",z:function(b){b=b.getTimezoneOffset();var a=e(parseInt(Math.abs(b/60),10),0),c=e(Math.abs(b%60),0);return(0<b?"-":"+")+a+c},Z:function(b){var a=b.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");4<a.length&&(a=f.formats.z(b));return a},"%":function(b){return"%"}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",t:"\t",T:"%H:%M:%S", x:"locale",X:"locale"},format:function(b,d){d=d||{};if(!a.Lang.isDate(b))return a.Lang.isValue(b)?b:"";var c,k;c=d.format||"%Y-%m-%d";k=a.Intl.get("datatype-date-format");for(var m=function(c,b){var a=f.aggregates[b];return"locale"===a?k[b]:a},n=function(c,d){var g=f.formats[d];switch(a.Lang.type(g)){case "string":return b[g]();case "function":return g.call(b,b,k);case "array":if("string"===a.Lang.type(g[0]))return e(b[g[0]](),g[1]);default:return d}};c.match(/%[cDFhnrRtTxX]/);)c=c.replace(/%([cDFhnrRtTxX])/g, m);c=c.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,n);m=n=void 0;return c}};a.mix(a.namespace("Date"),f);a.namespace("DataType");a.DataType.Date=a.Date},"3.17.2",{lang:"ar ar-JO ca ca-ES da da-DK de de-AT de-DE el el-GR en en-AU en-CA en-GB en-IE en-IN en-JO en-MY en-NZ en-PH en-SG en-US es es-AR es-BO es-CL es-CO es-EC es-ES es-MX es-PE es-PY es-US es-UY es-VE fi fi-FI fr fr-BE fr-CA fr-FR hi hi-IN hu id id-ID it it-IT ja ja-JP ko ko-KR ms ms-MY nb nb-NO nl nl-BE nl-NL pl pl-PL pt pt-BR ro ro-RO ru ru-RU sv sv-SE th th-TH tr tr-TR vi vi-VN zh-Hans zh-Hans-CN zh-Hant zh-Hant-HK zh-Hant-TW".split(" ")})}, 304:function(l,h,d){h=d(110);var a=d(23);d=d(305);l.exports={DEFAULT_COLLECTION_CONFIGURATIONS:{page:{collectionType:a.COLLECTION_TYPE_PAGE,typeName:"page",title:"Page",ordering:h.CUSTOM,icon:"page",addText:"Add Block"},"gallery-block":{collectionType:a.GALLERY_BLOCK,typeName:"gallery-block",title:"Gallery Block",ordering:h.USER,acceptTypes:["image","video"]},products:{collectionType:a.PRODUCTS,typeName:"products",title:"Products",pageSize:20,ordering:h.USER,acceptTypes:["store_item"],view:d.PRODUCT_TABLE, icon:"products",addText:"Add Product"},"template-page":{collectionType:a.TEMPLATE_PAGE,title:"Template Page",icon:"projects"},"splash-page":{collectionType:a.SPLASH_PAGE,typeName:"splash-page",title:"Cover Page",ordering:h.CUSTOM,icon:"splash-page"},subscription:{collectionType:a.COLLECTION_TYPE_SUBSCRIPTION,typeName:"subscription",title:"Subscription",ordering:h.CHRONOLOGICAL}},DEFAULT_COLLECTION_CONFIGURATION:{collectionType:a.COLLECTION_TYPE_GENERIC,supported:!0},DEFAULT_TEMPLATE_PAGE_CONFIGURATION:{icon:"template-page", collectionType:a.TEMPLATE_PAGE,supported:!0,folder:!1}}},305:function(l,h,d){l.exports={LIST:"list",GRID:"grid",PRODUCT:"product"}},332:function(l,h,d){YUI.add("datatype-date-math",function(a,d){var e=a.Lang;a.mix(a.namespace("Date"),{isValidDate:function(a){return e.isDate(a)&&isFinite(a)&&"Invalid Date"!=a&&!isNaN(a)&&null!=a?!0:!1},areEqual:function(a,b){return this.isValidDate(a)&&this.isValidDate(b)&&a.getTime()==b.getTime()},isGreater:function(a,b){return this.isValidDate(a)&&this.isValidDate(b)&& a.getTime()>b.getTime()},isGreaterOrEqual:function(a,b){return this.isValidDate(a)&&this.isValidDate(b)&&a.getTime()>=b.getTime()},isInRange:function(a,b,e){return this.isGreaterOrEqual(a,b)&&this.isGreaterOrEqual(e,a)},addDays:function(a,b){return new Date(a.getTime()+864E5*b)},addMonths:function(a,b){var e=a.getFullYear(),c=a.getMonth()+b,e=Math.floor(e+c/12),c=(c%12+12)%12,d=new Date(a.getTime());d.setFullYear(e);d.setMonth(c);return d},addYears:function(a,b){var e=a.getFullYear()+b,c=new Date(a.getTime()); c.setFullYear(e);return c},listOfDatesInMonth:function(a){if(!this.isValidDate(a))return[];var b=this.daysInMonth(a),e=a.getFullYear();a=a.getMonth();for(var c=[],d=1;d<=b;d++)c.push(new Date(e,a,d,12,0,0));return c},daysInMonth:function(a){if(!this.isValidDate(a))return 0;var b=a.getMonth(),e=[31,28,31,30,31,30,31,31,30,31,30,31];if(1!=b)return e[b];a=a.getFullYear();return 0===a%400?29:0===a%100?28:0===a%4?29:28}});a.namespace("DataType");a.DataType.Date=a.Date},"3.17.2",{requires:["yui-base"]})}, 333:function(l,h,d){YUI.add("datatype-date-parse",function(a,d){a.mix(a.namespace("Date"),{parse:function(e){e=new Date(+e||e);return a.Lang.isDate(e)?e:null}});a.namespace("Parsers").date=a.Date.parse;a.namespace("DataType");a.DataType.Date=a.Date},"3.17.2")},481:function(l,h,d){YUI.add("squarespace-mixins-event-list",function(a){a.namespace("Squarespace.Mixins");a.Squarespace.Mixins.EventList=a.Base.create("EventList",a.Base,[],{initializer:function(){a.Do.before(function(d){var e=a.Object.hasKey(d, "upcoming"),f=a.Object.hasKey(d,"past");if(e&&f)return new a.Do.AlterArgs("Parsing calendar-specific response",[[].concat(d.upcoming).concat(d.past)])},this,"parse",this)},getPastEvents:function(){var d=new Date;return this.filter(function(e){e=e.get("structuredContent");if(null===e)return!1;e=a.DataType.Date.parse(e.get("endDate"));return a.DataType.Date.isGreater(d,e)})},getUpcomingEvents:function(){var d=new Date;return this.filter(function(e){e=e.get("structuredContent");if(null===e)return!1; e=a.DataType.Date.parse(e.get("endDate"));return!a.DataType.Date.isGreater(d,e)})}})},"1.0",{requires:["base","datatype-date","event-custom","json"]})},482:function(l,h,d){YUI.add("squarespace-models-audio",function(a){a.namespace("Squarespace.Models");a.Squarespace.Models.Audio=a.Base.create("Audio",a.Squarespace.Models.StructuredContent,[],{},{ATTRS:{_type:{value:"Audio",validator:function(a){return"Audio"===a},readOnly:!0},embed:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString}, audioAssetUrl:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},artistName:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},lengthInMilliSeconds:{value:null,validator:a.Squarespace.AttrValidators.isNullOrNumber},bitRate:{value:null,validator:a.Squarespace.AttrValidators.isNullOrNumber},sampleRate:{value:null,validator:a.Squarespace.AttrValidators.isNullOrNumber}}})},"1.0",{requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})}, 483:function(l,h,d){YUI.add("squarespace-models-calendar-event",function(a){a.namespace("Squarespace.Models");a.Squarespace.Models.CalendarEvent=a.Base.create("CalendarEvent",a.Squarespace.Models.StructuredContent,[],{},{ATTRS:{_type:{value:"CalendarEvent",validator:function(a){return"CalendarEvent"===a},readOnly:!0},startDate:{valueFn:function(){var a=new Date,e=a.getMinutes();a.setSeconds(0);a.setMilliseconds(0);30<=e?(a.addHours(1),a.setMinutes(0)):a.setMinutes(30);return a.getTime()},validator:a.Squarespace.AttrValidators.isNumber}, endDate:{valueFn:function(){var a=new Date(this.get("startDate"));a.addHours(1);return a.getTime()},validator:a.Squarespace.AttrValidators.isNumber}}})},"1.0",{requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})},484:function(l,h,d){YUI.add("squarespace-models-check-in",function(a){a.namespace("Squarespace.Models");a.Squarespace.Models.CheckIn=a.Base.create("CheckIn",a.Squarespace.Models.StructuredContent,[],{},{ATTRS:{_type:{value:"CheckIn",validator:function(a){return"CheckIn"=== a},readOnly:!0},checkinId:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},venueId:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},timeZone:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},venueName:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},address:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},crossStreet:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},city:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString}, state:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},country:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},postalCode:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},categoryId:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},categoryPluralName:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},categoryShortName:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},categoryIcon:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString}}})}, "1.0",{requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})},485:function(l,h,d){var a=d(23),m=d(185);YUI.add("squarespace-models-collection-configuration",function(e){e.namespace("Squarespace.Models");e.Squarespace.Models.CollectionConfiguration=e.Base.create("CollectionConfiguration",e.Model,[],{initializer:function(a){e.Lang.isBoolean(a.index)&&a.index?this.set("folderBehavior",m.INDEX):e.Lang.isBoolean(a.folder)&&a.folder&&this.set("folderBehavior",m.NONE)}}, {ATTRS:{collectionType:{value:a.COLLECTION_TYPE_GENERIC},folder:{value:!1},folderBehavior:{},supported:{value:!0}}})},"1.0",{requires:["base","model"]})},486:function(l,h,d){d(10);var a=d(73),m=d(106),e=d(56),f=d(23),b=d(68),g=d(151),c=d(110);YUI.add("squarespace-models-content-collection",function(d){d.namespace("Squarespace.Models");var h=d.Squarespace.Models.ContentCollection=d.Base.create("Collection",d.Model,[],{initializer:function(c){this.publish("delete");this.items=c?new d.Squarespace.Models.ContentItemList({items:c.items|| [],parent:this,limit:this.get("itemLimit")}):new d.Squarespace.Models.ContentItemList({parent:this,limit:this.get("itemLimit")});this._itemsEventHandle=this.items.after(["load","add","remove"],this._updateItemCount,this);this._syncFolderChange(this.get("folder"));this.after("folderChange",function(c){this._syncFolderChange(c.newVal)})},destructor:function(){this._itemsEventHandle.detach();this._itemsEventHandle=null;this.items.destroy();this.items=null},toDebugString:function(){return d.JSON.stringify(this.getAttrs(["navigationTitle", "urlId","configureUrlId","id"]))},toJSON:function(){var c=this.constructor.superclass.toJSON.call(this);c.items=this.items.toJSON();return c},parse:function(c){c=h.superclass.parse.apply(this,arguments);c.passwordProtected&&(c.password=b.PASSWORD_MASK);return c},sync:function(c,a,b){switch(c){case "create":this._ensureDemoCloneAndSave(b);break;case "delete":this.fire("delete");this._delete(b);break;case "read":this._read(a,b);break;case "update":this._ensureDemoCloneAndSave(b)}},load:function(c,a, b){"function"===typeof c&&(b=a,a=c,c={});if(this._readInProgress)this.onceAfter("load",a,b);else d.Model.prototype.load.call(this,c,a?d.bind(a,b||this):null)},resetToLastRead:function(){this.setAttrs(this._lastReadData)},ensureProcessedItems:function(){var c=function(a){this.items.load({fields:["mediaProcessingState"]},function(){this.items.some(function(c){return c.get("mediaProcessingState")!==g.READY})?d.later(500,this,c,a):a()}.bind(this))}.bind(this);return new d.Promise(function(a){c(a)}.bind(this))}, _syncFolderChange:function(c){c&&this.set("dropdown",!0)},_ensureDemoCloneAndSave:function(c){if(this._shouldCloneCollection()){var a=this.toJSON();delete a.id;this.cloneToNewCollection({silent:!0}).then(d.bind(this._save,this,c,a))}else this._save(c)},_save:function(c,a){a=d.merge(a,this.toJSON());a.collectionId=a.id;delete a.tags;delete a.categories;delete a.mainImage;delete a.iTunesImage;delete a.items;a.metadata&&a.metadata.albumCover&&delete a.metadata.albumCover;var b=d.bind(function(a){d.Data.post({url:"/api/commondata/SaveCollection", data:a,success:function(a){this._lastReadData=d.clone(a);c(null,a)},failure:function(a){c(a,null)}},this)},this);d.Lang.isValue(a.id)&&d.Lang.isNull(a.urlId)?d.Data.post({url:"/api/content-collections/"+a.id+"/generate-url",json:!0,data:{title:a.title,urlId:d.Squarespace.Utils.slugify(3>a.title.length?a.typeName+"-"+a.title:a.title),configureUrlId:d.Squarespace.Utils.slugify(this.get("configureUrlId"))},success:function(c){a.urlId=c.urlId;a.configureUrlId=c.configureUrlId;b(a)}}):b(a)},_delete:function(c){d.Data.post({url:"/api/commondata/RemoveCollection", data:{collectionId:this.get("id")},success:function(a){c(null,a)},failure:function(a){c(a,null)}})},_read:function(a,c){this._readInProgress=!0;d.Data.get({url:"/api/commondata/GetCollection",data:{collectionId:this.get("id")},success:function(a){d.Squarespace.ContentCollectionUtils.usesDisplayIndex(a.ordering)?this._fetchItemCount(a.id).then(function(b){this._readInProgress=!1;a.itemCount=b;this._lastReadData=d.clone(a);c(null,a)}.bind(this)):(this._readInProgress=!1,this._lastReadData=d.clone(a), c(null,a))},failure:function(a){this._readInProgress=!1;c(a,null)}},this)},_updateItemCount:function(){d.Squarespace.ContentCollectionUtils.usesDisplayIndex(this.get("ordering"))&&(this.isNew()?this.set("itemCount",0):this._fetchItemCount(this.get("id")).then(function(a){this.set("itemCount",a)}.bind(this)))},_fetchItemCount:function(a){return new d.Promise(function(c,b){d.Data.get({url:"/api/content-collections/"+a+"/item-count",success:function(a){c(a)},failure:b},this)})},getTemplateConfiguration:function(){var a; a=this.get("typeName");var c=this.get("type");return(a=c===f.TEMPLATE_PAGE?e.getPageConfig(a):e.getCollectionConfig(a))?new d.Squarespace.Models.CollectionConfiguration(a):new d.Squarespace.Models.CollectionConfiguration({collectionType:c||f.COLLECTION_TYPE_GENERIC,ordering:this.get("ordering"),folder:this.get("folder"),supported:!1})},cloneToNewCollection:function(a){return new d.Promise(d.bind(function(c,b){var e=d.Squarespace.Singletons.TemplateNavigationList.getItemByCollectionId(this.get("id")); this._cloneExampleContent(a).then(d.bind(function(a){e.set("collectionId",a);e.save(c)},this))},this))},_cloneExampleContent:function(c){c=c||{};var b=new d.Promise(d.bind(function(b,e){var f=this.get("id");d.Data.post({url:"/api/commondata/CopyCollection",data:{collectionId:this.get("id"),processPointedCollectionItems:!!c.processPointedCollectionItems},success:function(c){this.setAttrs(d.merge({mainImageId:null,mainImage:null},c));var g=c.id;a.getHomepageCollectionId()===f?m.setHomepageCollectionId(g).then(function(a){a.error? e():b(g)}):b(g)}},this)},this));b.then(d.bind(function(){this.fire("clonedExampleContent",{silent:!!c.silent})},this));return b},_shouldCloneCollection:function(){return this.get("isDemoCollection")&&this.get("type")===f.COLLECTION_TYPE_PAGE},deleteTrashItems:function(a){d.Data.del({url:"/api/recycle-bin/collection/"+this.get("id")+"/items",success:function(c){a(c,null)},failure:function(c){a(null,c)}})},getId:function(){return this.get("id")},_set:function(a,c,b){return this.constructor.superclass._set.call(this, a,c,b)}},{ATTRS:{title:{validator:d.Lang.isString},navigationTitle:{validator:d.Lang.isString},websiteId:{},id:{value:null},enabled:{value:!0,validator:d.Lang.isBoolean},deleted:{value:!1,validator:d.Lang.isBoolean},homepage:{validator:d.Lang.isBoolean},starred:{validator:d.Lang.isBoolean},synchronizing:{validator:d.Lang.isBoolean},updatedOn:{},folder:{value:!1},isDemoCollection:{getter:function(){return d.Squarespace.ContentCollectionUtils.isDemoCollectionId(this.get("id"))}},itemCountExceeded:{getter:function(){return this.get("type")== f.PRODUCTS&&this.get("itemCount")>=this.get("maxItemCount")?!0:!1}},itemCount:{validator:d.Lang.isNumber},isEmpty:{getter:function(){return 0===this.items.size()}},maxItemCount:{getter:function(){return this.get("type")==f.PRODUCTS?200:9999}},tags:{value:[],validator:d.Lang.isArray},categories:{value:[],validator:d.Lang.isArray},pageSize:{validator:d.Lang.isNumber,valueFn:function(){if(this.getTemplateConfiguration().get("ordering")===c.CHRONOLOGICAL)return 20}},itemLimit:{value:20,validator:d.Squarespace.AttrValidators.isNumber}, ordering:{validator:function(a){return d.Object.values(c).contains(a)}},type:{validator:function(a){return d.Object.values(f).contains(a)}},typeName:{validator:d.Lang.isString},fullUrl:{validator:d.Lang.isString},urlId:{validator:d.Squarespace.AttrValidators.isNullOrString},configureUrlId:{getter:function(a){a="";d.Lang.isValue(this.get("id"))&&(a=this.get("id")+"-configure");return a}},nextDisplayIndex:{getter:function(){return this.get("itemCount")}},regionName:{value:"default",validator:function(a){return!d.Lang.isString(a)|| 0===a.length?!1:d.Object.keys(e.getState().layouts).contains(a)}},postByEmailAddress:{getter:function(a){return a?a+"@"+Static.SQUARESPACE_CONTEXT.prodDomain:""}}}});d.Squarespace.Models.ContentCollectionList=d.Base.create("Collections",d.ModelList,[],{model:d.Squarespace.Models.ContentCollection,sync:function(a,c,b){"read"==a&&d.Data.get({url:"/api/commondata/GetCollections",success:function(a){b(null,d.Object.values(a.collections))},failure:function(a){b(a,null)}},this)},getCollectionById:function(a, c,b){var e=this.getById(a);e?c.call(b,e):(e=new d.Squarespace.Models.ContentCollection({id:a}),e.load({},function(){this.add(e);c.call(b,e)},this))},getCollectionFromData:function(a,c){if(!a)return null;if(!a.id)throw"getCollectionFromData needs at least an ID in the data to work.";var b=this.getById(a.id);b?c||b.setAttrs(a):b=this.add(new d.Squarespace.Models.ContentCollection(a));return b}});d.Squarespace.Utils.isInDamaskFrame()?d.Squarespace.ContentCollectionCache=d.config.win.top.Y.Squarespace.ContentCollectionCache: d.Squarespace.ContentCollectionCache=new d.Squarespace.Models.ContentCollectionList},"2.0",{requires:"base model model-list promise squarespace-models-collection-configuration squarespace-models-content-item squarespace-models-content-item-list squarespace-util".split(" ")})},487:function(l,h,d){YUI.add("squarespace-models-content-item-list",function(a){a.namespace("Squarespace.Models");var d=a.Squarespace.Models.ContentItemList=a.Base.create("ContentItemList",a.ModelList,[a.Squarespace.Mixins.EventList], {initializer:function(e){this.model=a.Squarespace.Models.ContentItem;e=e||{};(e=e.items)&&this.reset(e)},sync:function(a,d,b){switch(a){case "create":console.error("Squarespace.Models.ContentItemList: Create not implemented.");break;case "delete":console.error("Squarespace.Models.ContentItemList: Create not implemented.");break;case "read":this._read(d,b);break;case "update":console.error("Squarespace.Models.ContentItemList: Create not implemented.")}},load:function(a,f){if(this.get("isChildItemList"))throw"Squarespace.Models.ContentItemList: Child items are loaded with their parent item. Loading them manually is not supported"; d.superclass.load.call(this,a,f)},removeItems:function(e,d){this.remove(e,{source:"bulk-remove"});var b=a.Array.map(e,function(a){var c=a.get("id");a.destroy();return c},this);a.Data.post({url:"/api/commondata/RemoveItems",data:{items:b},success:function(b){this.get("parent").load();a.Lang.isFunction(d)&&d(null,b);this.fire("bulk-remove",e)},failure:function(b){a.Lang.isFunction(d)&&d(b,null)}},this)},moveItems:function(e,d,b){if(this.get("isChildItemList"))throw"Squarespace.Models.ContentItemList: Moving child items is not currently supported."; var g=a.Array.map(e,function(a){return this.remove(this.getById(a.get("id")))},this),c=d.get("id"),k=d.items;k.load(a.bind(function(){k.add(g)},this));var m=a.Array.map(g,function(a){a.set("collectionId",c);a.get("items").each(function(a){a.set("collectionId",c)});return a.get("id")},this);a.Data.post({url:"/api/commondata/MoveItems",data:{toCollectionId:c,items:m},success:function(c){this.get("parent").load();a.Lang.isFunction(b)&&b(null,c);this.fire("move-items",e,d)},failure:function(c){a.Lang.isFunction(b)&& b(c,null)}},this)},reorderItems:function(d,f,b){var g=this.get("parent"),c={};this.get("isChildItemList")?(c.collectionId=g.get("collectionId"),c.parentId=g.get("id")):c.collectionId=g.get("id");var k=1===d.length,m;k?(d=d[0],m=this.indexOf(this.getById(d.get("id"))),this._reorder([d],f),0!==f&&(c.afterId=this.item(f-1).get("id")),c.itemId=d.get("id")):(this._reorder(d,f),0!==f&&(c.afterId=this.item(f-1).get("id")),d=a.Array.map(d,function(a){return a.get("id")},this),c.itemIds=a.JSON.stringify(d)); var h=a.bind(function(c){a.Data.post({url:"/api/commondata/ReorderItems",data:c,success:function(c){k&&(0===m||0===f)&&g.load();a.Lang.isUndefined(c.items)||a.Array.each(c.items,function(a,c){this.getById(a.id).set("displayIndex",a.displayIndex)},this);this.fire("reordered");a.Lang.isFunction(b)&&b(null,c);0<this._reorderQueue.size()&&h(thie._reorderQueue.next())},failure:function(c){a.Lang.isFunction(b)&&b(c,null)}},this)},this);this._reorderQueue||(this._reorderQueue=new a.Queue);this._reorderQueue.add(c); h(this._reorderQueue.next())},_reorder:function(a,d){var b=a.map(function(a){return this.getById(a.get("id"))},this);this.remove(b,{onReorder:!0,source:"reorder"});this.add(b,{onReorder:!0,source:"reorder",index:d})},_read:function(d,f){var b=this.get("parent").get("id");a.Data.get({url:"/api/content-collections/"+b+"/content-items",data:a.merge({limit:this.get("limit")},d),success:function(a){this.set("pagination",{hasNextPage:a.hasNextPage,hasPreviousPage:a.hasPreviousPage,nextPageStart:a.nextPageStart, previousPageStart:a.previousPageStart});f(null,a.results)},failure:function(a){f(a,null)}},this)}},{ATTRS:{parent:{value:null,validator:function(d){return d instanceof a.Squarespace.Models.ContentCollection||d instanceof a.Squarespace.Models.ContentItem}},isChildItemList:{getter:function(){return this.get("parent")instanceof a.Squarespace.Models.ContentItem}},pagination:{value:null},limit:{value:20,validator:a.Squarespace.AttrValidators.isNumber}}})},"1.0",{requires:"base json model-list squarespace-mixins-event-list squarespace-models-content-collection squarespace-models-content-item squarespace-util".split(" ")})}, 488:function(l,h,d){var a=d(158),m=d(151),e=d(99),f=d(350);YUI.add("squarespace-models-content-item",function(b){b.namespace("Squarespace.Models");var d=b.Squarespace.Models.ContentItem=b.Base.create("Item",b.Model,[b.Squarespace.ModelSync.REST],{root:"content-items",url:"content-items/{id}",load:function(){this.get("isGlobalFakeContentItem")&&(this.root="rest/global-content-items/",this.url="rest/global-content-items/{id}");d.superclass.load.apply(this,arguments)},initializer:function(a){this._needsJobListener()&& this._bindJobListener();this._updateNextDisplayIndex();a=this.get("items");a.after(["add","remove"],function(){this._updateNextDisplayIndex()},this);this.items=a;b.Do.after(function(){var a=this.get("collectionId"),c=b.Squarespace.API_ROOT;b.Lang.isValue(a)&&(c+="content-collections/"+a+"/");c+=b.Do.currentRetVal;return new b.Do.AlterReturn("Adding prefix to url.",c)},this,"getURL",this)},destructor:function(){this._jobListener&&(this._jobListener.detach(),this._jobListener=null)},toJSON:function(){var a= d.superclass.toJSON.call(this),e=a.structuredContent;b.Lang.isValue(e)&&(a.structuredContent=e.toJSON());a.items=a.items.toJSON();b.Lang.isObject(a.pushedServices)&&(a.pushedServices=b.Object.keys(a.pushedServices));b.Lang.isObject(a.pendingPushedServices)&&(a.pendingPushedServices=b.Object.keys(a.pendingPushedServices));return a},serialize:function(a){a=this.toJSON();delete a.items;delete a.author;delete a.fullUrl;delete a.assetUrl;delete a.resolved;delete a.postItemInjectCode;delete a.promotedBlock; delete a.promotedBlockType;delete a.nextDisplayIndex;delete a.mediaIsUploading;delete a.hasFileData;delete a.isGlobalFakeContentItem;delete a.childrenGroups;delete a.colorData;return b.JSON.stringify(a)},save:function(a,e){this.isNew()||!b.Lang.isObject(a)||!a.fields?d.superclass.save.call(this,a,e):this._saveFields(a.fields,e)},autoSave:function(a,d){b.Lang.isFunction(a)?(d=a,a={}):b.Lang.isValue(a)||(a={});a.headers=b.merge(a.headers,{"X-AutoSave":!0});this.save(a,d)},like:function(a){b.Data.post({url:this.getURL()+ "/sentiment/like",success:function(d){b.Lang.isFunction(a)&&a(null,d)},failure:function(d){b.Lang.isFunction(a)&&a(d,null)}},this)},dislike:function(a){b.Data.post({url:this.getURL()+"/sentiment/dislike",success:function(d){b.Lang.isFunction(a)&&a(null,d)},failure:function(d){b.Lang.isFunction(a)&&a(d,null)}},this)},clearFileData:function(a){this.setAttrs({systemDataId:null,systemDataOrigin:null,mediaProcessingState:null,systemDataSourceType:null,systemDataVariants:null,filename:null});b.Data.post({url:"/api/commondata/ClearEmbeddedAsset", data:{itemId:this.get("id"),persistTransient:!0===a}})},clearChildGroup:function(a,d){b.Data.post({url:"/api/commondata/ClearChildGroup",data:{childType:a,itemId:this.get("id")},success:function(a){b.Lang.isFunction(d)&&d(null,a)},failure:function(a){b.Lang.isFunction(d)&&d(a,null)}})},createConfiguration:function(a){a=b.merge(a,{model:this,title:"Back",panelPathName:this.get("name")||"newItem"});return new (b.Squarespace.ContentItemEditorFactory.getEditor(this,{variant:b.Squarespace.ContentItemEditorVariants.PANEL}))(a)}, getAssetUrlForFormat:function(a){return b.Lang.sub("{assetUrl}?format={format}",{assetUrl:this.get("assetUrl"),format:a})},getId:function(){return this.get("id")},isLicensedAssetPreview:function(){return b.Lang.isValue(this.get("licensedAssetPreview"))},isLicensedAsset:function(){return b.Lang.isValue(this.get("licensedAssetId"))},_needsJobListener:function(){var a=this.get("mediaProcessingState");return a===m.QUEUED||a===m.PROCESSING},_bindJobListener:function(){Static&&Static.JOB_MANAGER&&(this._jobListener= b.config.win.Static.JOB_MANAGER.on("completed",function(a){var d=this.get("id"),e=a.get("data.contentItemId");a=a.get("data.globalContentItemId");e===d?(this.load(),this._jobListener.detach()):b.Lang.isValue(a)&&a===d&&(b.Data.get({url:"/api/rest/global-content-items/"+a,success:function(a){this.set("assetUrl",a.assetUrl);this.setAttrs(a)}},this),this._jobListener.detach())},this))},_updateNextDisplayIndex:function(){var a=0;this.get("items").each(function(b){b=b.get("displayIndex");b>=a&&(a=b+1)}, this);this._set("nextDisplayIndex",a)},_saveFields:function(a,d){if(1<a.length)throw Error("Saving multiple fields is not currently supported.");var e=a[0],e={field:e,itemId:this.get("id"),value:this.get(e)};b.Data.post({url:"/api/commondata/SaveItemField",data:b.merge({},e),success:function(a){b.Lang.isFunction(d)&&d(null,a.item)},failure:function(a){b.Lang.isFunction(d)&&d.call(a,null)}},this)},_getStructuredContentCtor:function(){switch(this.get("recordType")){case e.AUDIO:return b.Squarespace.Models.Audio; case e.EVENT:return b.Squarespace.Models.CalendarEvent;case e.CHECKIN:return b.Squarespace.Models.CheckIn;case e.EMBED:case e.VIDEO:return b.Squarespace.Models.Embed;case e.INSTAGRAM:return b.Squarespace.Models.Instagram;case e.KBARTICLE:return b.Squarespace.Models.KBArticle;case e.LINK:return b.Squarespace.Models.Link;case e.QUOTE:return b.Squarespace.Models.Quote;case e.STORE_ITEM:return b.Squarespace.Models.StoreItem;case e.TWEET:return b.Squarespace.Models.Tweet;default:return null}}},{ATTRS:{id:{value:null}, collectionId:{value:null},parentId:{value:null},authorId:{valueFn:function(){var a=b.Object.getValue(Static,["SQUARESPACE_CONTEXT","authenticatedAccount"]);return a?a.id:null}},proxyForId:{value:null},recordType:{validator:b.Squarespace.AttrValidators.isValueIn(e),writeOnce:!0},childType:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},addedOn:{valueFn:function(){return(new Date).getTime()},validator:b.Squarespace.AttrValidators.isNumber,writeOnce:"initOnly"},updatedOn:{value:null, validator:b.Squarespace.AttrValidators.isNullOrNumber,writeOnce:"initOnly"},publishOn:{valueFn:function(){return(new Date).getTime()},validator:b.Squarespace.AttrValidators.isNumber},unsaved:{value:null,validator:b.Squarespace.AttrValidators.isNullOrBoolean},urlId:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},title:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},body:{value:null,validator:b.Squarespace.AttrValidators.isNullOrObject},excerpt:{value:null,validator:b.Squarespace.AttrValidators.isNullOrObject}, displayIndex:{value:0,validator:b.Squarespace.AttrValidators.isNumber},starred:{value:!1,validator:b.Squarespace.AttrValidators.isBoolean},passthrough:{value:!1,validator:b.Squarespace.AttrValidators.isBoolean},tags:{value:[],validator:b.Squarespace.AttrValidators.isArray},categories:{value:[],validator:b.Squarespace.AttrValidators.isArray},workflowState:{value:f.DRAFT,validator:b.Squarespace.AttrValidators.isValueIn(f)},systemDataId:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString}, systemDataVariants:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},systemDataOrigin:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},contentType:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},filename:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},dataSize:{value:null,validator:b.Squarespace.AttrValidators.isNullOrNumber},sourceUrl:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},mediaProcessingState:{value:null, validator:b.Squarespace.AttrValidators.isNullOr(b.Squarespace.AttrValidators.isValueIn(m))},mediaFocalPoint:{value:{x:0.5,y:0.5},setter:function(a){if(b.Lang.isString(a)){a=a.split(",");var d=parseFloat(a[0]);a=parseFloat(a[1]);return{x:!isNaN(d)&&1>=d?d:0.5,y:!isNaN(a)&&1>=a?a:0.5}}return a}},colorData:{value:null,validator:b.Squarespace.AttrValidators.isNullOrObject},clickthroughUrl:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},location:{value:null,validator:b.Squarespace.AttrValidators.isNullOrObject}, customContent:{value:null},likeCount:{value:0,validator:b.Squarespace.AttrValidators.isNumber},dislikeCount:{value:0,validator:b.Squarespace.AttrValidators.isNumber},commentCount:{value:0,validator:b.Squarespace.AttrValidators.isNumber},publicCommentCount:{value:0,validator:b.Squarespace.AttrValidators.isNumber},commentState:{valueFn:function(){var c=b.Object.getValue(Static,["SQUARESPACE_CONTEXT","websiteSettings"]),d=c.commentsEnabled;return c.commentEnableByDefault||d?a.ENABLED:a.DISABLED},validator:b.Squarespace.AttrValidators.isValueIn(a)}, commentDisableOn:{valueFn:function(){var a=b.Object.getValue(Static,["SQUARESPACE_CONTEXT","websiteSettings","commentDisableAfterDaysDefault"]);return a?b.Date.addDays(new Date,a).getTime():null},validator:b.Squarespace.AttrValidators.isNullOrNumber},pushedServices:{value:{},validator:b.Squarespace.AttrValidators.isObject},shareStates:{value:[]},structuredContent:{valueFn:function(){var a=this._getStructuredContentCtor();return b.Lang.isNull(a)?null:new a},setter:function(a){if(a instanceof b.Squarespace.Models.StructuredContent)return a; var d=this._getStructuredContentCtor();return b.Lang.isNull(d)?null:new d(a)}},items:{valueFn:function(){return new b.Squarespace.Models.ContentItemList({parent:this})},setter:function(a){var d=this.get("items");return b.Lang.isValue(d)?(d.reset(a),d):a instanceof b.Squarespace.Models.ContentItemList?a:new b.Squarespace.Models.ContentItemList({items:a,parent:this})}},childrenGroups:{value:{},validator:b.Squarespace.AttrValidators.isObject},author:{value:null,validator:b.Squarespace.AttrValidators.isNullOrObject}, fullUrl:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},assetUrl:{value:null,getter:function(a){return b.Squarespace.UrlUtils.isSecure()?b.Squarespace.UrlUtils.securifyURL(a):a},validator:b.Squarespace.AttrValidators.isNulLOrString},resolved:{value:!1,validator:b.Squarespace.AttrValidators.isBoolean},postItemInjectCode:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},promotedBlock:{value:null,validator:b.Squarespace.AttrValidators.isNullOrString},promotedBlockType:{value:null, validator:b.Squarespace.AttrValidators.isNullOrString},nextDisplayIndex:{value:0,validator:b.Squarespace.AttrValidators.isNumber,readOnly:!0},mediaIsUploading:{value:!1,validator:b.Squarespace.AttrValidators.isBoolean},hasFileData:{getter:function(){var a=this.get("mediaProcessingState")==m.QUEUED;return this.get("isGlobalFakeContentItem")?!this.isNew():"USER_UPLOAD"===this.get("systemDataOrigin")&&a?!0:a?!0:b.Lang.isValue(this.get("systemDataId"))}},isGlobalFakeContentItem:{value:!1,validator:b.Squarespace.AttrValidators.isBoolean}, licensedAssetPreview:{value:null,validator:b.Squarespace.AttrValidators.isNullOrObject},licensedAssetId:{value:null,validator:b.Lang.isString},name:{getter:function(){return this.get("id")}},isPusher:{value:!0,readOnly:!0,validator:b.Squarespace.AttrValidators.isBoolean}}})},"1.0",{requires:"base json model squarespace-attr-validators squarespace-model-sync-rest squarespace-models-audio squarespace-models-calendar-event squarespace-models-check-in squarespace-models-content-item-list squarespace-models-embed squarespace-models-instagram squarespace-models-kb-article squarespace-models-link squarespace-models-quote squarespace-models-store-item squarespace-models-tweet squarespace-url-utils squarespace-util".split(" ")})}, 489:function(l,h,d){YUI.add("squarespace-models-embed",function(a){a.namespace("Squarespace.Models");a.Squarespace.Models.Embed=a.Base.create("Embed",a.Squarespace.Models.StructuredContent,[],{},{ATTRS:{_type:{value:"Embed",validator:function(a){return"Embed"===a},readOnly:!0},embed:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},oembed:{value:null,validator:a.Squarespace.AttrValidators.isNullOrObject},overlay:{value:!0,validator:a.Squarespace.AttrValidators.isBoolean}}})},"1.0", {requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})},490:function(l,h,d){YUI.add("squarespace-models-instagram",function(a){a.namespace("Squarespace.Models");a.Squarespace.Models.Instagram=a.Base.create("Instagram",a.Squarespace.Models.StructuredContent,[],{},{ATTRS:{_type:{value:"Instagram",validator:function(a){return"Instagram"===a},readOnly:!0},instagramId:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},timeZone:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString}, imageLowResolutionUrl:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},imageThumbnailUrl:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},imageStandardUrl:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},width:{value:null,validator:a.Squarespace.AttrValidators.isNullOrNumber},height:{value:null,validator:a.Squarespace.AttrValidators.isNullOrNumber},filter:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},userProfilePictureUrl:{value:null, validator:a.Squarespace.AttrValidators.isNullOrString},userAccountName:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},userDisplayName:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString}}})},"1.0",{requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})},491:function(l,h,d){YUI.add("squarespace-models-kb-article",function(a){a.namespace("Squarespace.Models");a.Squarespace.Models.KBArticle=a.Base.create("KBArticle",a.Squarespace.Models.StructuredContent, [],{},{ATTRS:{_type:{value:"KBArticle",validator:function(a){return"KBArticle"===a},readOnly:!0},upVotes:{value:0,validator:a.Squarespace.AttrValidators.isNumber},downVotes:{value:0,validator:a.Squarespace.AttrValidators.isNumber}}})},"1.0",{requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})},492:function(l,h,d){YUI.add("squarespace-models-link",function(a){a.namespace("Squarespace.Models");a.Squarespace.Models.Link=a.Base.create("Link",a.Squarespace.Models.StructuredContent, [],{},{ATTRS:{_type:{value:"Link",validator:function(a){return"Link"===a},readOnly:!0},url:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString}}})},"1.0",{requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})},493:function(l,h,d){YUI.add("squarespace-models-quote",function(a){a.namespace("Squarespace.Models");a.Squarespace.Models.Quote=a.Base.create("Quote",a.Squarespace.Models.StructuredContent,[],{},{ATTRS:{_type:{value:"Quote",validator:function(a){return"Quote"=== a},readOnly:!0},quote:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString}}})},"1.0",{requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})},494:function(l,h,d){var a=d(58);YUI.add("squarespace-models-store-item",function(d){d.namespace("Squarespace.Models");d.Squarespace.Models.StoreItem=d.Base.create("StoreItem",d.Squarespace.Models.StructuredContent,[],{},{ATTRS:{_type:{value:"StoreItem",validator:function(a){return"StoreItem"===a},readOnly:!0}, productType:{value:a.PHYSICAL,validator:d.Squarespace.AttrValidators.isValueIn(a)},priceCents:{value:0,validator:d.Squarespace.AttrValidators.isNumber},salePriceCents:{value:0,validator:d.Squarespace.AttrValidators.isNumber},onSale:{value:!1,validator:d.Squarespace.AttrValidators.isBoolean},variants:{value:[],validator:d.Squarespace.AttrValidators.isArray},originalVariants:{value:[],validator:d.Squarespace.AttrValidators.isArray},variantOptionOrdering:{value:[],validator:d.Squarespace.AttrValidators.isArray}, additionalFieldsFormId:{value:null,validator:d.Squarespace.AttrValidators.isNullOrString},customAddButtonText:{value:"Add to Cart",validator:d.Squarespace.AttrValidators.isString},useCustomAddButtonText:{value:!1,validator:d.Squarespace.AttrValidators.isBoolean},additionalFieldsForm:{value:null}}})},"1.0",{requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})},495:function(l,h,d){YUI.add("squarespace-models-structured-content",function(a){a.namespace("Squarespace.Models"); a.Squarespace.Models.StructuredContent=a.Base.create("StructuredContent",a.Model,[],{},{ATTRS:{_type:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString,writeOnce:"initOnly"}}})},"1.0",{requires:["base","model","squarespace-attr-validators"]})},496:function(l,h,d){YUI.add("squarespace-models-tweet",function(a){a.namespace("Squarespace.Models");a.Squarespace.Models.Tweet=a.Base.create("Tweet",a.Squarespace.Models.StructuredContent,[],{},{ATTRS:{_type:{value:"Tweet",validator:function(a){return"Tweet"=== a},readOnly:!0},tweetId:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},timeZone:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},accountId:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},displayName:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},accountName:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},tweet:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},profileImageUrl:{value:null, validator:a.Squarespace.AttrValidators.isNullOrString},profileImageUrlHttps:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString},userLocation:{value:null,validator:a.Squarespace.AttrValidators.isNullOrString}}})},"1.0",{requires:["base","squarespace-attr-validators","squarespace-models-structured-content"]})},1853:function(l,h,d){YUI.add("squarespace-simple-liking",function(a){var d=a.config.win.Static;a.Squarespace.SimpleLike={TEXT_LIKE_VERB_NONE:"No Likes",TEXT_LIKE_VERB_SINGULAR:"Like", TEXT_LIKE_VERB_PLURAL:"Likes",TEXT_LIKE_ACTIVATED:"You like this",TEXT_LIKE_SUGGEST:"Click to like",attached:!1,attach:function(){if(!this.attached){this.attached=!0;var e;try{localStorage&&((e=a.JSON.parse(localStorage.getItem("squarespace-likes")))||(e={}),localStorage.setItem("squarespace-likes",a.JSON.stringify(e)))}catch(f){e={}}a.delegate("click",function(b){b=b.currentTarget;var d=b.getAttribute("data-item-id");if(d){for(var c=0;5>c;++c)a.Squarespace.SimpleLike.burst(b);if(!b.hasClass("clicked")&& !b.hasClass("float")){c=parseInt(b.getAttribute("data-like-count"),10);b.setAttribute("data-like-count",c+1);a.Squarespace.SimpleLike.renderLikeCount(b);b.addClass("clicked");try{localStorage&&(e[d]=!0,localStorage.setItem("squarespace-likes",a.JSON.stringify(e)))}catch(f){console.warn("Unable to save like to local storage: ",f)}(new a.Squarespace.Models.ContentItem({id:d})).like(function(b,c){c.commited&&console.log("Like was counted!");a.Lang.isValue(b)&&b.crumbFail&&!a.Squarespace.Utils.areCookiesEnabled()&& alert("You need to enable cookies to be able to like something.")})}}},"body",".sqs-simple-like");a.all(".sqs-simple-like").each(function(b){var f=b.getAttribute("data-item-id");f&&(d.SQUARESPACE_CONTEXT.websiteSettings.simpleLikingEnabled||b.remove(),e[f]&&b.addClass("clicked"),a.Squarespace.SimpleLike.renderLikeCount(b))})}},renderLikeCount:function(d){var f=d.getAttribute("data-item-id"),b=d.getAttribute("data-like-count");d=d.one(".like-count");f&&d&&(f="",f=0===b?a.Squarespace.SimpleLike.TEXT_LIKE_VERB_NONE: 1==b?"1 "+a.Squarespace.SimpleLike.TEXT_LIKE_VERB_SINGULAR:b+" "+a.Squarespace.SimpleLike.TEXT_LIKE_VERB_PLURAL,d.setContent(f))},burst:function(d){var f=d.cloneNode(!0);f.one(".like-count")&&f.one(".like-count").remove();var b=d.one(".like-icon");if(!b||"none"===b.getStyle("display"))b=d;f.setStyles({position:"absolute",left:b.getX()+"px",top:b.getY()+"px"});a.one(a.config.doc.body).append(f);d=new a.Anim({node:f,duration:2,easing:a.Easing.easeOut});d.set("to",{curve:a.Squarespace.SimpleLike.randomCurve(f)}); d.on("end",function(){this.get("node").remove()});d.run();f.removeClass("clicked");f.addClass("float")},randomCurve:function(a){var d=[],b=Math.floor(2*Math.random())?1:-1,g=Math.floor(2*Math.random())?1:-1,c=a.getX();a=a.getY();for(var h=0;3>h;++h)c+=Math.floor(30*Math.random())*b,a+=Math.floor(30*Math.random())*g,d.push([c,a]);return d}};a.config.win.Squarespace.onInitialize(a,function(){d.SQUARESPACE_CONTEXT.websiteSettings.simpleLikingEnabled&&a.Squarespace.SimpleLike.attach()})},1,{requires:["anim", "node","json","squarespace-models-content-item"]})}});