diff --git a/VERSION b/VERSION index 58b3e5ab..dc8579ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0beta7 \ No newline at end of file +1.0beta8 \ No newline at end of file diff --git a/component/core/src/x-tag-core b/component/core/src/x-tag-core index 5bfcd033..43285dd8 160000 --- a/component/core/src/x-tag-core +++ b/component/core/src/x-tag-core @@ -1 +1 @@ -Subproject commit 5bfcd03335743bcfda6ac1c3d0212b0fd0c34d84 +Subproject commit 43285dd856e13a1165f1dece25927fd076d9be6d diff --git a/dist/brick.js b/dist/brick.js index d039217a..741a9191 100644 --- a/dist/brick.js +++ b/dist/brick.js @@ -1,2 +1,2 @@ -window.Platform={};var logFlags={};!function(){function e(e){if(this._element=e,e.className!=this._classCache){if(this._classCache=e.className,!this._classCache)return;var t,n=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(t=0;t>>0)+(t++ +"__")},SideTable.prototype={set:function(t,n){var r=t[this.name];r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0})},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){this.set(e,void 0)}}}(),function(e){function t(e){y.push(e),b||(b=!0,m(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){b=!1;var e=y;y=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=h.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=h.get(n);if(r)for(var o=0;o0){var o=n[r-1],i=f(o,e);if(i)return n[r-1]=i,void 0}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=h.get(e);t||h.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=h.get(e),n=0;n1?E.dom&&console.warn("inserted:",e.localName,"insert/remove count:",e.__inserted):e.enteredDocumentCallback&&(E.dom&&console.log("inserted:",e.localName),e.enteredDocumentCallback())),E.dom&&console.groupEnd())}function l(e){d(e),r(e,function(e){d(e)})}function d(e){(e.leftDocumentCallback||e.__upgraded__&&E.dom)&&(E.dom&&console.log("removed:",e.localName),p(e)||(e.__inserted=(e.__inserted||0)-1,e.__inserted>0&&(e.__inserted=0),e.__inserted<0?E.dom&&console.warn("removed:",e.localName,"insert/remove count:",e.__inserted):e.leftDocumentCallback&&e.leftDocumentCallback()))}function p(e){for(var t=e;t;){if(t==e.ownerDocument)return!0;t=t.parentNode||t.host}}function f(e){if(e.webkitShadowRoot&&!e.webkitShadowRoot.__watched){E.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.webkitShadowRoot;t;)v(t),t=t.olderShadowRoot}}function v(e){e.__watched||(g(e),e.__watched=!0)}function h(e){switch(e.localName){case"style":case"script":case"template":case void 0:return!0}}function m(e){if(E.dom){var t=e[0];if(t&&"childList"===t.type&&t.addedNodes&&t.addedNodes){for(var n=t.addedNodes[0];n&&n!==document&&!n.host;)n=n.parentNode;var r=n&&(n.URL||n._URL||n.host&&n.host.localName)||"";r=r.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,r||"")}e.forEach(function(e){"childList"===e.type&&(L(e.addedNodes,function(e){h(e)||a(e)}),L(e.removedNodes,function(e){h(e)||l(e)}))}),E.dom&&console.groupEnd()}function _(){m(w.takeRecords())}function g(e){w.observe(e,{childList:!0,subtree:!0})}function b(e){g(e)}function y(e){E.dom&&console.group("upgradeDocument: ",(e.URL||e._URL||"").split("/").pop()),a(e),E.dom&&console.groupEnd()}var E=window.logFlags||{},w=new MutationObserver(m),L=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.watchShadow=f,e.upgradeAll=a,e.upgradeSubtree=i,e.observeDocument=b,e.upgradeDocument=y,e.takeRecords=_}(window.CustomElements),function(e){function t(e){return r(e,c)}function n(e){return r(e,u)}function r(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function o(e){return"script"===e.localName}function i(e,t){var n=e;n instanceof Document||(n=document.implementation.createHTMLDocument(c),n.body.innerHTML=e),n._URL=t;var r=n.createElement("base");return r.setAttribute("href",document.baseURI||document.URL),n.head.appendChild(r),window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}e||(e=window.HTMLImports={flags:{}});var a,s=e.xhr,c="import",u="stylesheet",l={documents:{},cache:{},preloadSelectors:["link[rel="+c+"]","element link[rel="+u+"]","template","script[src]:not([type])",'script[src][type="text/javascript"]'].join(","),loader:function(e){return a=new d(l.loaded,e),a.cache=l.cache,a},load:function(e,t){a=l.loader(t),l.preload(e)},preload:function(e){var t=e.querySelectorAll(l.preloadSelectors);t=this.filterMainDocumentNodes(e,t),t=this.extractTemplateNodes(t),a.addNodes(t)},filterMainDocumentNodes:function(e,t){return e===document&&(t=Array.prototype.filter.call(t,function(e){return!o(e)})),t},extractTemplateNodes:function(e){var t=[];return e=Array.prototype.filter.call(e,function(e){if("template"===e.localName){if(e.content){var n=e.content.querySelectorAll("link[rel="+u+"]");n.length&&(t=t.concat(Array.prototype.slice.call(n,0)))}return!1}return!0}),t.length&&(e=e.concat(t)),e},loaded:function(e,r,o){if(t(r)){var a=l.documents[e];a||(a=i(o,e),h.resolvePathsInHTML(a),l.documents[e]=a,l.preload(a)),r.import={href:e,ownerNode:r,content:a},r.content=o=a}r.__resource=o,n(r)&&h.resolvePathsInStylesheet(r)}},d=function(e,t){this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={},this.cache={}};d.prototype={addNodes:function(e){this.inflight+=e.length,m(e,this.require,this),this.checkDone()},require:function(e){var t=h.nodeUrl(e);e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){return this.pending[e]?(this.pending[e].push(t),!0):this.cache[e]?(this.onload(e,t,a.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,t){var n=function(n,r){this.receive(e,t,n,r)}.bind(this);s.load(e,n)},receive:function(e,t,n,r){n||(a.cache[e]=r),a.pending[e].forEach(function(t){n||this.onload(e,t,r),this.tail()},this),a.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}};var p=["href","src","action"],f="["+p.join("],[")+"]",v="{{.*}}",h={nodeUrl:function(e){return h.resolveUrl(h.documentURL,h.hrefOrSrc(e))},hrefOrSrc:function(e){return e.getAttribute("href")||e.getAttribute("src")},documentUrlFromNode:function(e){return h.getDocumentUrl(e.ownerDocument||e)},getDocumentUrl:function(e){var t=e&&(e._URL||e.impl&&e.impl._URL||e.baseURI||e.URL)||"";return t.split("#")[0]},resolveUrl:function(e,t){return this.isAbsUrl(t)?t:this.compressUrl(this.urlToPath(e)+t)},resolveRelativeUrl:function(e,t){return this.isAbsUrl(t)?t:this.makeDocumentRelPath(this.resolveUrl(e,t))},isAbsUrl:function(e){return/(^data:)|(^http[s]?:)|(^\/)/.test(e)},urlToPath:function(e){var t=e.split("/");return t.pop(),t.push(""),t.join("/")},compressUrl:function(e){var t="",n=e.indexOf("?");n>-1&&(t=e.substring(n),e=e.substring(n,0));for(var r,o=e.split("/"),i=0;io;o++)r.unshift("..");var a=r.join("/");return a},resolvePathsInHTML:function(e,t){t=t||h.documentUrlFromNode(e),h.resolveAttributes(e,t),h.resolveStyleElts(e,t);var n=e.querySelectorAll("template");n&&m(n,function(e){e.content&&h.resolvePathsInHTML(e.content,t)})},resolvePathsInStylesheet:function(e){var t=h.nodeUrl(e);e.__resource=h.resolveCssText(e.__resource,t)},resolveStyleElts:function(e,t){var n=e.querySelectorAll("style");n&&m(n,function(e){e.textContent=h.resolveCssText(e.textContent,t)})},resolveCssText:function(e,t){return e.replace(/url\([^)]*\)/g,function(e){var n=e.replace(/["']/g,"").slice(4,-1);return n=h.resolveRelativeUrl(t,n),"url("+n+")"})},resolveAttributes:function(e,t){var n=e&&e.querySelectorAll(f);n&&m(n,function(e){this.resolveNodeAttributes(e,t)},this)},resolveNodeAttributes:function(e,t){p.forEach(function(n){var r=e.attributes[n];if(r&&r.value&&r.value.search(v)<0){var o=h.resolveRelativeUrl(t,r.value);r.value=o}})}};h.documentURL=h.getDocumentUrl(document),h.urlElt=document.createElement("a"),s=s||{async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(t,n,r){var o=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(t+="?"+Math.random()),o.open("GET",t,s.async),o.addEventListener("readystatechange",function(){4===o.readyState&&n.call(r,!s.ok(o)&&o,o.response,t)}),o.send(),o},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};var m=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.path=h,e.xhr=s,e.importer=l,e.getDocumentUrl=h.getDocumentUrl,e.IMPORT_LINK_TYPE=c}(window.HTMLImports),function(e){function t(e){return"link"===e.localName&&e.getAttribute("rel")===i}function n(e){return e.parentNode&&!r(e)&&!o(e)}function r(e){return e.ownerDocument===document||e.ownerDocument.impl===document}function o(e){return e.parentNode&&"element"===e.parentNode.localName}var i="import",a={selectors:["link[rel="+i+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(e){if(!e.__importParsed){e.__importParsed=!0;var t=e.querySelectorAll(a.selectors);s(t,function(e){a[a.map[e.localName]](e)})}},parseLink:function(e){t(e)?e.content&&a.parse(e.content):this.parseGeneric(e)},parseGeneric:function(e){n(e)&&document.head.appendChild(e)},parseScript:function(t){if(n(t)){var r=(t.__resource||t.textContent).trim();if(r){var o=t.__nodeUrl;if(!o){var o=e.path.documentUrlFromNode(t),i="["+Math.floor(1e3*(Math.random()+1))+"]",a=r.match(/Polymer\(['"]([^'"]*)/);i=a&&a[1]||i,o+="/"+i+".js"}r+="\n//# sourceURL="+o+"\n",eval.call(window,r)}}}},s=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.parser=a}(HTMLImports),function(){function e(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),"complete"===document.readyState?e():window.addEventListener("DOMContentLoaded",e)}(),function(){function e(e){return"link"===e.localName&&e.getAttribute("rel")===t}var t=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none",n={selectors:["link[rel="+t+"]"],map:{link:"parseLink"},parse:function(e){if(!e.__parsed){e.__parsed=!0;var t=e.querySelectorAll(n.selectors);r(t,function(e){n[n.map[e.localName]](e)}),CustomElements.upgradeDocument(e),CustomElements.observeDocument(e)}},parseLink:function(t){e(t)&&this.parseImport(t)},parseImport:function(e){e.content&&n.parse(e.content)}},r=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=n}(),function(){function e(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document);var e=window.Platform&&Platform.endOfMicrotask?Platform.endOfMicrotask:setTimeout;e(function(){CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}if("function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),"complete"===document.readyState)e();else{var t=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(t,e)}}(),function(){function e(e){var t=P.call(e);return S[t]||(S[t]=t.match(R)[1].toLowerCase())}function t(n,r){var o=t[r||e(n)];return o?o(n):n}function n(t){return-1==U.indexOf(e(t))?Array.prototype.slice.call(t,0):[t]}function r(e,t){return(t||j).length?n(e.querySelectorAll(t)):[]}function o(e,t){var n={added:[],removed:[]};t.forEach(function(t){t._mutation=!0;for(var r in n)for(var o=e._records["added"==r?"inserted":"removed"],i=t[r+"Nodes"],a=i.length,s=0;a>s&&-1==n[r].indexOf(i[s]);s++)n[r].push(i[s]),o.forEach(function(e){e(i[s],t)})})}function i(n,r,o){var i=e(o);return"object"==i&&"object"==e(n[r])?q.merge(n[r],o):n[r]=t(o,i),n}function a(e,t,n){var r={};for(var o in n)r[o.split(":")[0]]=!0;for(var i in t)r[i.split(":")[0]]||(n[i]=t[i])}function s(e){return e.mixins.forEach(function(t){var n=q.mixins[t];for(var r in n)switch(r){case"lifecycle":case"methods":a(r,n[r],e[r]);break;case"accessors":case"prototype":for(var o in n[r])a(o,n[r],e.accessors);break;case"events":}}),e}function c(e,t){var n=r(this,e.value).filter(function(e){return e==t.target||e.contains?e.contains(t.target):null})[0];return n?e.listener=e.listener.bind(n):null}function u(e){if(e.type.match("touch"))e.target.__touched__=!0;else if(e.target.__touched__&&e.type.match("mouse"))return delete e.target.__touched__,void 0;return!0}function l(e){var t="over"==e;return{attach:"OverflowEvent"in w?"overflowchanged":[],condition:function(n){return n.flow=e,n.type==e+"flow"||0===n.orient&&n.horizontalOverflow==t||1==n.orient&&n.verticalOverflow==t||2==n.orient&&n.horizontalOverflow==t&&n.verticalOverflow==t}}}function d(e,t,n,r){r?t[e]=n[e]:Object.defineProperty(t,e,{writable:!0,enumerable:!0,value:n[e]})}function p(e,t){var n=Object.getOwnPropertyDescriptor(e,"target");for(var r in t)I[r]||d(r,e,t,n);e.baseEvent=t}function f(e,t){return{value:e.boolean?"":t,method:e.boolean&&!t?"removeAttribute":"setAttribute"}}function v(e,t,n,r){var o=f(t,r);e[o.method](n,o.value)}function h(e,t,n,r,o){for(var i=t.property?[e.xtag[t.property]]:t.selector?q.query(e,t.selector):[],a=i.length;a--;)i[a][o](n,r)}function m(e,t,n){e.__view__&&e.__view__.updateBindingValue(e,t,n)}function _(e,t,n,r,o,i){var a=n.split(":"),s=a[0];if("get"==s)a[0]=t,e.prototype[t].get=q.applyPseudos(a.join(":"),r[n],e.pseudos);else if("set"==s){a[0]=t;var c=e.prototype[t].set=q.applyPseudos(a.join(":"),o?function(e){this.xtag._skipSet=!0,this.xtag._skipAttr||v(this,o,i,e),this.xtag._skipAttr&&o.skip&&delete this.xtag._skipAttr,r[n].call(this,o.boolean?!!e:e),m(this,i,e),delete this.xtag._skipSet}:r[n]?function(e){r[n].call(this,e),m(this,i,e)}:null,e.pseudos);o&&(o.setter=c)}else e.prototype[t][n]=r[n]}function g(e,t){e.prototype[t]={};var n=e.accessors[t],r=n.attribute,o=r&&r.name?r.name.toLowerCase():t;r&&(r.key=t,e.attributes[o]=r);for(var i in n)_(e,t,i,n,r,o);if(r){if(!e.prototype[t].get){var a=(r.boolean?"has":"get")+"Attribute";e.prototype[t].get=function(){return this[a](o)}}e.prototype[t].set||(e.prototype[t].set=function(e){v(this,r,o,e),m(this,o,e)})}}function b(e,t,n){e.__tap__||(e.__tap__={click:"mousedown"==n.type},e.__tap__.click?e.addEventListener("click",t.observer):(e.__tap__.scroll=t.observer.bind(e),window.addEventListener("scroll",e.__tap__.scroll,!0),e.addEventListener("touchmove",t.observer),e.addEventListener("touchcancel",t.observer),e.addEventListener("touchend",t.observer))),e.__tap__.click||(e.__tap__.x=n.touches[0].pageX,e.__tap__.y=n.touches[0].pageY)}function y(e,t){e.__tap__&&(e.__tap__.click?e.removeEventListener("click",t.observer):(window.removeEventListener("scroll",e.__tap__.scroll,!0),e.removeEventListener("touchmove",t.observer),e.removeEventListener("touchcancel",t.observer),e.removeEventListener("touchend",t.observer)),delete e.__tap__)}function E(e,t,n){var r=n.changedTouches[0];return r.pageXe.__tap__.x-t.gesture.tolerance&&r.pageYe.__tap__.y-t.gesture.tolerance?!0:void 0}var w=window,L=document,k=function(){},N=function(){return!0},O=/([\w-]+(?:\([^\)]+\))?)/g,A=/(\w*)(?:\(([^\)]*)\))?/,T=/(\d+)/g,C={action:function(e,t){return e.value.match(T).indexOf(String(t.keyCode))>-1==("keypass"==e.name)||null}},M=function(){var e=w.getComputedStyle(L.documentElement,""),t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return{dom:"ms"==t?"MS":t,lowercase:t,css:"-"+t+"-",js:"ms"==t?t:t[0].toUpperCase()+t.substr(1)}}(),D=Element.prototype.matchesSelector||Element.prototype[M.lowercase+"MatchesSelector"],x=w.MutationObserver||w[M.js+"MutationObserver"],S={},P=S.toString,R=/\s([a-zA-Z]+)/;t.object=function(e){var n={};for(var r in e)n[r]=t(e[r]);return n},t.array=function(e){for(var n=e.length,r=new Array(n);n--;)r[n]=t(e[n]);return r};var U=["undefined","null","number","boolean","string","function"],j="",I={};for(var H in document.createEvent("CustomEvent"))I[H]=1;var q={tags:{},defaultOptions:{pseudos:[],mixins:[],events:{},methods:{},accessors:{},lifecycle:{},attributes:{},prototype:{xtag:{get:function(){return this.__xtag__?this.__xtag__:this.__xtag__={data:{}}}}}},register:function(e,t){var r;if("string"==typeof e){r=e.toLowerCase();var o=t.prototype;delete t.prototype;var i=q.tags[r]=s(q.merge({},q.defaultOptions,t));for(var a in i.events)i.events[a]=q.parseEvent(a,i.events[a]);for(a in i.lifecycle)i.lifecycle[a.split(":")[0]]=q.applyPseudos(a,i.lifecycle[a],i.pseudos);for(a in i.methods)i.prototype[a.split(":")[0]]={value:q.applyPseudos(a,i.methods[a],i.pseudos),enumerable:!0};for(a in i.accessors)g(i,a);var c=i.lifecycle.created||i.lifecycle.ready;i.prototype.createdCallback={enumerable:!0,value:function(){var e=this;q.addEvents(this,i.events),i.mixins.forEach(function(t){q.mixins[t].events&&q.addEvents(e,q.mixins[t].events)});var t=c?c.apply(this,n(arguments)):null;for(var r in i.attributes){var o=i.attributes[r],a=this.hasAttribute(r);(a||o.boolean)&&(this[o.key]=o.boolean?a:this.getAttribute(r))}return i.pseudos.forEach(function(t){t.onAdd.call(e,t)}),t}},i.lifecycle.inserted&&(i.prototype.enteredDocumentCallback={value:i.lifecycle.inserted,enumerable:!0}),i.lifecycle.removed&&(i.prototype.leftDocumentCallback={value:i.lifecycle.removed,enumerable:!0}),i.lifecycle.attributeChanged&&(i.prototype.attributeChangedCallback={value:i.lifecycle.attributeChanged,enumerable:!0});var u=i.prototype.setAttribute||HTMLElement.prototype.setAttribute;i.prototype.setAttribute={writable:!0,enumberable:!0,value:function(e,t){var n=i.attributes[e.toLowerCase()];this.xtag._skipAttr||u.call(this,e,n&&n.boolean?"":t),n&&(n.setter&&!this.xtag._skipSet&&(this.xtag._skipAttr=!0,n.setter.call(this,n.boolean?!0:t)),t=n.skip?n.boolean?this.hasAttribute(e):this.getAttribute(e):t,h(this,n,e,n.boolean?"":t,"setAttribute")),delete this.xtag._skipAttr}};var l=i.prototype.removeAttribute||HTMLElement.prototype.removeAttribute;i.prototype.removeAttribute={writable:!0,enumberable:!0,value:function(e){var t=i.attributes[e.toLowerCase()];this.xtag._skipAttr||l.call(this,e),t&&(t.setter&&!this.xtag._skipSet&&(this.xtag._skipAttr=!0,t.setter.call(this,t.boolean?!1:void 0)),h(this,t,e,void 0,"removeAttribute")),delete this.xtag._skipAttr}};var d=o?o:t["extends"]?Object.create(L.createElement(t["extends"]).constructor).prototype:w.HTMLElement.prototype;return L.register(r,{"extends":t["extends"],prototype:Object.create(d,i.prototype)})}},mixins:{},prefix:M,touches:{active:[],changed:[]},captureEvents:["focus","blur","scroll","underflow","overflow","overflowchanged"],customEvents:{overflow:l("over"),underflow:l("under"),animationstart:{attach:[M.dom+"AnimationStart"]},animationend:{attach:[M.dom+"AnimationEnd"]},transitionend:{attach:[M.dom+"TransitionEnd"]},move:{attach:["mousemove","touchmove"],condition:u},enter:{attach:["mouseover","touchenter"],condition:u},leave:{attach:["mouseout","touchleave"],condition:u},tapstart:{observe:{mousedown:L,touchstart:L},condition:u},tapend:{observe:{mouseup:L,touchend:L},condition:u},tapmove:{attach:["tapstart","dragend","touchcancel"],condition:function(e,t){switch(e.type){case"move":return!0;case"dragover":var n=t.lastDrag||{};return t.lastDrag=e,n.pageX!=e.pageX&&n.pageY!=e.pageY||null;case"tapstart":t.touches=t.touches||1,t.move||(t.current=this,t.move=q.addEvents(this,{move:t.listener,dragover:t.listener}),t.tapend=q.addEvent(L,"tapend",t.listener));break;case"tapend":case"dragend":case"touchcancel":t.touches--,t.touches||(q.removeEvents(t.current,t.move||{}),q.removeEvent(L,t.tapend||{}),delete t.lastDrag,delete t.current,delete t.tapend,delete t.move)}}}},pseudos:{keypass:C,keyfail:C,delegate:{action:c},within:{action:c,onAdd:function(e){var t=e.source.condition;t&&(e.source.condition=function(n,r){return q.query(this,e.value).filter(function(e){return e==n.target||e.contains?e.contains(n.target):null})[0]?t.call(this,n,r):null})}},preventable:{action:function(e,t){return!t.defaultPrevented}}},clone:t,typeOf:e,toArray:n,wrap:function(e,t){return function(){var r=n(arguments),o=e.apply(this,r);return o===!1?!1:t.apply(this,"undefined"!=typeof o?n(o):r)}},merge:function(t,n,r){if("string"==e(n))return i(t,n,r);for(var o=1,a=arguments.length;a>o;o++){var s=arguments[o];for(var c in s)i(t,c,s[c])}return t},uid:function(){return Math.random().toString(36).substr(2,10)},query:r,skipTransition:function(e,t,n){var r=M.js+"TransitionProperty";e.style[r]=e.style.transitionProperty="none",q.requestFrame(function(){var o;t&&(o=t.call(n)),q.requestFrame(function(){e.style[r]=e.style.transitionProperty="",o&&q.requestFrame(o)})})},requestFrame:function(){var e=w.requestAnimationFrame||w[M.lowercase+"RequestAnimationFrame"]||function(e){return w.setTimeout(e,20)};return function(t){return e.call(w,t)}}(),matchSelector:function(e,t){return D.call(e,t)},set:function(e,t,n){e[t]=n,window.CustomElements&&CustomElements.upgradeAll(e)},innerHTML:function(e,t){q.set(e,"innerHTML",t)},hasClass:function(e,t){return e.className.split(" ").indexOf(t.trim())>-1},addClass:function(e,t){var n=e.className.trim().split(" ");return t.trim().split(" ").forEach(function(e){~n.indexOf(e)||n.push(e)}),e.className=n.join(" ").trim(),e},removeClass:function(e,t){var n=t.trim().split(" ");return e.className=e.className.trim().split(" ").filter(function(e){return e&&!~n.indexOf(e)}).join(" "),e},toggleClass:function(e,t){return q[q.hasClass(e,t)?"removeClass":"addClass"].call(null,e,t)},queryChildren:function(e,t){var r=e.id,o=e.id=r||"x_"+q.uid(),i="#"+o+" > ";t=i+(t+"").replace(",",","+i,"g");var a=e.parentNode.querySelectorAll(t);return r||e.removeAttribute("id"),n(a)},createFragment:function(e){var t=L.createDocumentFragment();if(e){for(var r=t.appendChild(L.createElement("div")),o=n(e.nodeName?arguments:!(r.innerHTML=e)||r.children),i=o.length,a=0;i>a;)t.insertBefore(o[a++],r);t.removeChild(r)}return t},manipulate:function(e,t){var n=e.nextSibling,r=e.parentNode,o=L.createDocumentFragment(),i=t.call(o.appendChild(e),o)||e;n?r.insertBefore(i,n):r.appendChild(i)},applyPseudos:function(e,t,r,o){var i=t,a={};if(e.match(":"))for(var s=e.match(O),c=s.length;--c;)s[c].replace(A,function(t,u,l){if(!q.pseudos[u])throw"pseudo not found: "+u+" "+s;var d=a[c]=Object.create(q.pseudos[u]);d.key=e,d.name=u,d.value=l,d.arguments=(l||"").split(","),d.action=d.action||N,d.source=o;var p=i;i=function(){var t=n(arguments),r={key:e,name:u,value:l,source:o,listener:p},i=d.action.apply(this,[r].concat(t));return null===i||i===!1?i:r.listener.apply(this,t)},r&&d.onAdd&&(r.getAttribute?d.onAdd.call(r,d):r.push(d))});for(var u in a)a[u].onCompiled&&(i=a[u].onCompiled(i,a[u])||i);return i},removePseudos:function(e,t){t._pseudos.forEach(function(t){t.onRemove&&t.onRemove.call(e,t) -})},parseEvent:function(e,t){var r=e.split(":"),o=r.shift(),i=q.customEvents[o],a=q.merge({type:o,stack:k,condition:N,attach:[],_attach:[],pseudos:"",_pseudos:[],onAdd:k,onRemove:k},i||{});a.attach=n(a.base||a.attach),a.chain=o+(a.pseudos.length?":"+a.pseudos:"")+(r.length?":"+r.join(":"):"");var s=a.condition;a.condition=function(e){return e.touches,e.targetTouches,s.apply(this,n(arguments))};var c=q.applyPseudos(a.chain,t,a._pseudos,a);if(a.stack=function(e){e.touches,e.targetTouches;var t=e.detail||{};return t.__stack__?t.__stack__==c?(e.stopPropagation(),e.cancelBubble=!0,c.apply(this,n(arguments))):void 0:c.apply(this,n(arguments))},a.listener=function(e){var t=n(arguments),r=a.condition.apply(this,t.concat([a]));return r?e.type==o?a.stack.apply(this,t):(q.fireEvent(e.target,o,{baseEvent:e,detail:{__stack__:c}}),void 0):r},a.attach.forEach(function(e){a._attach.push(q.parseEvent(e,a.listener))}),i&&i.observe&&!i.__observing__){i.observer=function(e){var t=a.condition.apply(this,n(arguments).concat([i]));return t?(q.fireEvent(e.target,o,{baseEvent:e}),void 0):t};for(var u in i.observe)q.addEvent(i.observe[u]||document,u,i.observer,!0);i.__observing__=!0}return a},addEvent:function(e,t,n,r){var o="function"==typeof n?q.parseEvent(t,n):n;return o._pseudos.forEach(function(t){t.onAdd.call(e,t)}),o._attach.forEach(function(t){q.addEvent(e,t.type,t)}),o.onAdd.call(e,o,o.listener),e.addEventListener(o.type,o.stack,r||q.captureEvents.indexOf(o.type)>-1),o},addEvents:function(e,t){var n={};for(var r in t)n[r]=q.addEvent(e,r,t[r]);return n},removeEvent:function(e,t,n){n=n||t,n.onRemove.call(e,n,n.listener),q.removePseudos(e,n),n._attach.forEach(function(t){q.removeEvent(e,t)}),e.removeEventListener(n.type,n.stack)},removeEvents:function(e,t){for(var n in t)q.removeEvent(e,t[n])},fireEvent:function(e,t,n,r){var o=L.createEvent("CustomEvent");n=n||{},r&&console.warn("fireEvent has been modified, more info here: "),o.initCustomEvent(t,n.bubbles!==!1,n.cancelable!==!1,n.detail),n.baseEvent&&p(o,n.baseEvent);try{e.dispatchEvent(o)}catch(i){console.warn("This error may have been caused by a change in the fireEvent method, more info here: ",i)}},addObserver:function(e,t,n){e._records||(e._records={inserted:[],removed:[]},x?(e._observer=new x(function(t){o(e,t)}),e._observer.observe(e,{subtree:!0,childList:!0,attributes:!1,characterData:!1})):["Inserted","Removed"].forEach(function(t){e.addEventListener("DOMNode"+t,function(n){n._mutation=!0,e._records[t.toLowerCase()].forEach(function(e){e(n.target,n)})},!1)})),-1==e._records[t].indexOf(n)&&e._records[t].push(n)},removeObserver:function(e,t,n){var r=e._records;r&&n?r[t].splice(r[t].indexOf(n),1):r[t]=[]}},F=0,V=null;L.addEventListener("mousedown",function(e){F++,V=e.target},!0),L.addEventListener("mouseup",function(){F--,V=null},!1);var Y={touches:{configurable:!0,get:function(){return this.__touches__||(this.identifier=0)||(this.__touches__=F?[this]:[])}},targetTouches:{configurable:!0,get:function(){return this.__targetTouches__||(this.__targetTouches__=F&&this.currentTarget&&(this.currentTarget==V||this.currentTarget.contains&&this.currentTarget.contains(V))?[this]:[])}},changedTouches:{configurable:!0,get:function(){return this.touches}}};for(H in Y)UIEvent.prototype[H]=Y[H],Object.defineProperty(UIEvent.prototype,H,Y[H]);var X={value:null,writable:!0,configurable:!0},B={touches:X,targetTouches:X,changedTouches:X};if(w.TouchEvent)for(H in B)w.TouchEvent.prototype[H]=B[H],Object.defineProperty(w.TouchEvent.prototype,H,B[H]);q.customEvents.tap={observe:{mousedown:document,touchstart:document},gesture:{tolerance:8},condition:function(e,t){var n=e.target;switch(e.type){case"touchstart":return n.__tap__&&n.__tap__.click&&y(n,t),b(n,t,e),void 0;case"mousedown":return n.__tap__||b(n,t,e),void 0;case"scroll":case"touchcancel":return y(this,t),void 0;case"touchmove":case"touchend":return this.__tap__&&!E(this,t,e)?(y(this,t),void 0):"touchend"==e.type||null;case"click":return y(this,t),!0}}},"function"==typeof define&&define.amd?define(q):w.xtag=q,L.addEventListener("WebComponentsReady",function(){q.fireEvent(L.body,"DOMComponentsLoaded")})}();!function(){xtag.register("x-appbar",{lifecycle:{created:function(){var e=xtag.queryChildren(this,"header")[0];e||(e=document.createElement("header"),this.appendChild(e)),this.xtag.data.header=e,this.subheading=this.subheading}},accessors:{heading:{attribute:{},get:function(){return this.xtag.data.header.innerHTML},set:function(e){this.xtag.data.header.innerHTML=e}},subheading:{attribute:{},get:function(){return this.getAttribute("subheading")||""},set:function(e){this.xtag.data.header.setAttribute("subheading",e)}}}})}();!function(){function e(e){var t;return 0===e.getUTCHours()?t=new Date(e.valueOf()):(t=new Date,t.setUTCHours(0),t.setUTCFullYear(e.getFullYear()),t.setUTCMonth(e.getMonth()),t.setUTCDate(e.getDate())),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t}function t(e,t){e.appendChild(t)}function n(e){return parseInt(e,10)}function r(e){var t=n(e);return t===e&&!isNaN(t)&&t>=0&&6>=t}function o(e){return e instanceof Date&&!!e.getTime&&!isNaN(e.getTime())}function i(e){return e&&e.isArray?e.isArray():"[object Array]"===Object.prototype.toString.call(e)}function a(e){var t=e.split("."),n=t.shift(),r=document.createElement(n);return r[z]=t.join(" "),r}function s(){var e=document.documentElement,t={left:e.scrollLeft||document.body.scrollLeft||0,top:e.scrollTop||document.body.scrollTop||0,width:e.clientWidth,height:e.clientHeight};return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function u(e){var t=e.getBoundingClientRect(),n=s(),r=n.left,o=n.top;return{left:t.left+r,right:t.right+r,top:t.top+o,bottom:t.bottom+o,width:t.width,height:t.height}}function c(e,t){xtag.addClass(e,t)}function l(e,t){xtag.removeClass(e,t)}function d(e,t){return xtag.hasClass(e,t)}function h(e){return e.getUTCFullYear()}function f(e){return e.getUTCMonth()}function v(e){return e.getUTCDate()}function p(e){return e.getUTCDay()}function m(e,t){var n=e.toString(),r=new Array(t).join("0");return(r+n).substr(-t)}function g(e){return[m(h(e),4),m(f(e)+1,2),m(v(e),2)].join("-")}function b(t){if(o(t))return t;var n=J.exec(t);return n?e(new Date(n[1],n[2]-1,n[3])):null}function _(t){if(o(t))return t;var n=b(t);if(n)return n;var r=Date.parse(t);return isNaN(r)?null:e(new Date(r))}function y(e){var t;if(i(e))t=e.slice(0);else{if(o(e))return[e];if(!("string"==typeof e&&e.length>0))return null;try{if(t=JSON.parse(e),!i(t))return console.warn("invalid list of ranges",e),null}catch(n){var r=_(e);return r?[r]:(console.warn("unable to parse",e,"as JSON or single date"),null)}}for(var a=0;al.valueOf())return console.warn("invalid range",s,": start date is after end date"),null;t[a]=[c,l]}}return t}function w(t,n,r,o){return void 0===n&&(n=h(t)),void 0===r&&(r=f(t)),void 0===o&&(o=v(t)),e(new Date(n,r,o))}function E(e,t,n,r){return w(e,h(e)+t,f(e)+n,v(e)+r)}function x(e,t){t=n(t),r(t)||(t=0);for(var o=0;7>o;o++){if(p(e)===t)return e;e=A(e)}throw"unable to find week start"}function O(e,t){t=n(t),r(t)||(t=6);for(var o=0;7>o;o++){if(p(e)===t)return e;e=N(e)}throw"unable to find week end"}function T(t){return t=new Date(t.valueOf()),t.setUTCDate(1),e(t)}function k(e){return A(E(e,0,1,0))}function N(e){return E(e,0,0,1)}function A(e){return E(e,0,0,-1)}function D(e,t){if(t){t=void 0===t.length?[t]:t;var n=!1;return t.forEach(function(t){2===t.length?L(t[0],t[1],e)&&(n=!0):g(t)===g(e)&&(n=!0)}),n}}function L(e,t,n){return g(e)<=g(n)&&g(n)<=g(t)}function C(e){e.sort(function(e,t){var n=o(e)?e:e[0],r=o(t)?t:t[0];return n.valueOf()-r.valueOf()})}function M(e){var n=a("div.controls"),r=a("span.prev"),o=a("span.next");return r.innerHTML=e.prev,o.innerHTML=e.next,t(n,r),t(n,o),n}function S(e){var t=this;e=e||{},t._span=e.span||1,t._multiple=e.multiple||!1,t._viewDate=t._sanitizeViewDate(e.view,e.chosen),t._chosenRanges=t._sanitizeChosenRanges(e.chosen,e.view),t._firstWeekdayNum=e.firstWeekdayNum||0,t._el=a("div.calendar"),t._labels=F(),t._customRenderFn=null,t._renderRecursionFlag=!1,t.render(!0)}function j(e){e=e.slice(0),C(e);for(var t=[],n=0;n0?t[t.length-1]:null;if(o(u)?r=i=u:(r=u[0],i=u[1]),u=D(r,i)?r:[r,i],o(c))a=s=c;else{if(!c){t.push(u);continue}a=c[0],s=c[1]}if(D(r,[c])||D(A(r),[c])){var l=a.valueOf()i.valueOf()?s:i,h=D(l,d)?l:[l,d];t[t.length-1]=h}else t.push(u)}return t}function R(e,t){var n,r=t.getAttribute("data-date"),o=_(r);d(t,Y)?(e.xtag.dragType=W,n="datetoggleoff"):(e.xtag.dragType=q,n="datetoggleon"),e.xtag.dragStartEl=t,e.xtag.dragAllowTap=!0,e.noToggle||xtag.fireEvent(e,n,{detail:{date:o,iso:r}}),e.setAttribute("active",!0),t.setAttribute("active",!0)}function U(e,t){var n=t.getAttribute("data-date"),r=_(n);t!==e.xtag.dragStartEl&&(e.xtag.dragAllowTap=!1),e.noToggle||(e.xtag.dragType!==q||d(t,Y)?e.xtag.dragType===W&&d(t,Y)&&xtag.fireEvent(e,"datetoggleoff",{detail:{date:r,iso:n}}):xtag.fireEvent(e,"datetoggleon",{detail:{date:r,iso:n}})),e.xtag.dragType&&t.setAttribute("active",!0)}function P(){for(var e=xtag.query(document,"x-calendar"),t=0;t",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}},V=e(new Date),q="add",W="remove",Y="chosen",z="className",J=/(\d{4})[^\d]?(\d{2})[^\d]?(\d{2})/,X=S.prototype;X.makeMonth=function(e){if(!o(e))throw"Invalid view date!";var n=this.firstWeekdayNum,r=this.chosen,i=this.labels,s=f(e),u=x(T(e),n),l=a("div.month"),d=a("div.month-label");d.textContent=i.months[s]+" "+h(e),t(l,d);for(var p=a("div.weekday-labels"),m=0;7>m;m++){var b=(n+m)%7,_=a("span.weekday-label");_.textContent=i.weekdays[b],t(p,_)}t(l,p);for(var y=a("div.week"),w=u,E=42,m=0;E>m;m++){var O=a("span.day");if(O.setAttribute("data-date",g(w)),O.textContent=v(w),f(w)!==s&&c(O,"badmonth"),D(w,r)&&c(O,Y),D(w,V)&&c(O,"today"),t(y,O),w=N(w),0===(m+1)%7){t(l,y),y=a("div.week");var k=f(w)>s||f(w)h(u);if(k)break}}return l},X._sanitizeViewDate=function(e,t){t=void 0===t?this.chosen:t;var n;if(o(e))n=e;else if(o(t))n=t;else if(i(t)&&t.length>0){var r=t[0];n=o(r)?r:r[0]}else n=V;return n},X._sanitizeChosenRanges=function(e,t){t=void 0===t?this.view:t;var n;n=o(e)?[e]:i(e)?e:null!==e&&void 0!==e&&t?[t]:[];var r=j(n);if(!this.multiple&&r.length>0){var a=r[0];return o(a)?[a]:[a[0]]}return r},X.addDate=function(e,t){o(e)&&(t?(this.chosen.push(e),this.chosen=this.chosen):this.chosen=[e])},X.removeDate=function(e){if(o(e))for(var t=this.chosen.slice(0),n=0;nn;n++)t(this.el,this.makeMonth(u)),u=E(u,0,1,0)}this._callCustomRenderer()},X._callCustomRenderer=function(){if(this._customRenderFn){if(this._renderRecursionFlag)throw"Error: customRenderFn causes recursive loop of rendering calendar; make sure your custom rendering function doesn't modify attributes of the x-calendar that would require a re-render!";for(var e=xtag.query(this.el,".day"),t=0;t=0?t:0,this.render(!1)}},view:{attribute:{},get:function(){return this._viewDate},set:function(e){var t=this._sanitizeViewDate(e),n=this._viewDate;this._viewDate=t,this.render(f(n)===f(t)&&h(n)===h(t))}},chosen:{get:function(){return this._chosenRanges},set:function(e){this._chosenRanges=this._sanitizeChosenRanges(e),this.render(!0)}},firstWeekdayNum:{get:function(){return this._firstWeekdayNum},set:function(e){e=n(e),r(e)||(e=0),this._firstWeekdayNum=e,this.render(!1)}},lastWeekdayNum:{get:function(){return(this._firstWeekdayNum+6)%7}},customRenderFn:{get:function(){return this._customRenderFn},set:function(e){this._customRenderFn=e,this.render(!0)}},chosenString:{get:function(){if(this.multiple){for(var e=this.chosen.slice(0),t=0;t0?g(this.chosen[0]):""}},firstVisibleMonth:{get:function(){return T(E(this.view,0,-Math.floor(this.span/2),0))}},lastVisibleMonth:{get:function(){return E(this.firstVisibleMonth,0,Math.max(0,this.span-1),0)}},firstVisibleDate:{get:function(){return x(this.firstVisibleMonth,this.firstWeekdayNum)}},lastVisibleDate:{get:function(){return O(k(this.lastVisibleMonth),this.lastWeekdayNum)}},labels:{get:function(){return this._labels},set:function(e){var t=this.labels;for(var n in t)if(n in e){var r=this._labels[n],o=e[n];if(i(r)){if(!i(o)||r.length!==o.length)throw"invalid label given for '"+n+"': expected array of "+r.length+" labels, got "+JSON.stringify(o);o=o.slice(0);for(var a=0;a0){var t=e.currentTarget;if(t.xtag.dragType)for(var n=e.touches[0],r=xtag.query(t,".day"),o=0;o0){var t=e[0];return o(t)?t:t[0]}return null},set:function(e){var t=this.multiple?y(e):_(e);this.xtag.calObj.chosen=t?t:null,this.xtag.calObj.chosenString?this.setAttribute("chosen",this.xtag.calObj.chosenString):this.removeAttribute("chosen")}},firstWeekdayNum:{attribute:{name:"first-weekday-num"},set:function(e){this.xtag.calObj.firstWeekdayNum=e}},noToggle:{attribute:{"boolean":!0,name:"notoggle"},set:function(e){e&&(this.chosen=null)}},firstVisibleMonth:{get:function(){return this.xtag.calObj.firstVisibleMonth}},lastVisibleMonth:{get:function(){return this.xtag.calObj.lastVisibleMonth}},firstVisibleDate:{get:function(){return this.xtag.calObj.firstVisibleDate}},lastVisibleDate:{get:function(){return this.xtag.calObj.lastVisibleDate}},customRenderFn:{get:function(){return this.xtag.calObj.customRenderFn},set:function(e){this.xtag.calObj.customRenderFn=e}},labels:{get:function(){return JSON.parse(JSON.stringify(this.xtag.calObj.labels))},set:function(e){this.xtag.calObj.labels=e;var t=this.xtag.calObj.labels,n=this.querySelector(".controls > .prev");n&&(n.textContent=t.prev);var r=this.querySelector(".controls > .next");r&&(r.textContent=t.next)}}},methods:{render:function(e){this.xtag.calObj.render(e)},prevMonth:function(){var e=this.xtag.calObj;e.view=E(e.view,0,-1,0)},nextMonth:function(){var e=this.xtag.calObj;e.view=E(e.view,0,1,0)},toggleDateOn:function(e,t){this.xtag.calObj.addDate(e,t),this.chosen=this.chosen},toggleDateOff:function(e){this.xtag.calObj.removeDate(e),this.chosen=this.chosen},toggleDate:function(e,t){this.xtag.calObj.hasChosenDate(e)?this.toggleDateOff(e):this.toggleDateOn(e,t)},hasVisibleDate:function(e,t){return this.xtag.calObj.hasVisibleDate(e,t)}}})}();!function(){function t(t){return JSON.parse(JSON.stringify(t))}function e(t){var e;return 0===t.getUTCHours()?e=new Date(t.valueOf()):(e=new Date,e.setUTCHours(0),e.setUTCFullYear(t.getFullYear()),e.setUTCMonth(t.getMonth()),e.setUTCDate(t.getDate())),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}function n(t){return t instanceof Date&&!!t.getTime&&!isNaN(t.getTime())}function r(t){return t.getUTCFullYear()}function i(t){return t.getUTCMonth()}function o(t){return t.getUTCDate()}function a(t,e){var n=t.toString(),r=new Array(e).join("0");return(r+n).substr(-e)}function s(t){return[a(r(t),4),a(i(t)+1,2),a(o(t),2)].join("-")}function u(t){if(n(t))return t;var r=g.exec(t);return r?e(new Date(r[1],r[2]-1,r[3])):null}function l(t){if(n(t))return t;var r=u(t);if(r)return r;var i=Date.parse(t);return isNaN(i)?null:e(new Date(i))}function c(t){var e=t.polyfill?t.xtag.polyfillInput:t.xtag.dateInput,n=l(e.value);return n?t.removeAttribute("invalid"):t.setAttribute("invalid",!0),!!n}function d(t,e){var n=t.polyfill?t.xtag.polyfillInput:t.xtag.dateInput,r=n.value,i=l(r);t.value=e&&i?i:r}function f(t,e,n){var r=t.submitValue,i=t.value;e();var o=t.submitValue,a=t.value;(r!==o||n&&i!==a)&&xtag.fireEvent(t,"change")}function h(t){var e=t.xtag._labels;return new Array(5).join(e.yearAbbr)+"-"+new Array(3).join(e.monthAbbr)+"-"+new Array(3).join(e.dayAbbr)}var p=13,v=document.createElement("x-calendar").labels,g=/(\d{4})[^\d]?(\d{2})[^\d]?(\d{2})/;xtag.register("x-datepicker",{lifecycle:{created:function(){this.innerHTML="";var e=document.createElement("input");e.setAttribute("type","date"),xtag.addClass(e,"x-datepicker-input"),this.appendChild(e),this.xtag.dateInput=e,this.xtag._labels={yearAbbr:"Y",monthAbbr:"M",dayAbbr:"D"},this.xtag._polyfillCalLabels=t(v),this.xtag.polyfillInput=null,this.xtag.polyfillUI=null,this.polyfill=this.hasAttribute("polyfill")||"date"!==e.type.toLowerCase()}},events:{"datetoggleon:delegate(x-calendar)":function(t){var e=t.currentTarget;if(t.detail&&t.detail.date){var n=l(t.detail.date);f(e,function(){e.value=n?s(n):"",xtag.fireEvent(e,"input")})}},"datetoggleoff:delegate(x-calendar)":function(t){t.currentTarget.value=null},focus:function(t){t.currentTarget.setAttribute("focused",!0)},"blur:delegate(.x-datepicker-input)":function(t){t.currentTarget.removeAttribute("focused")},"blur:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.currentTarget;e.removeAttribute("focused"),f(e,function(){d(e,!0)},!0)},"touchstart:delegate(.x-datepicker-polyfill-input)":function(){this.setAttribute("readonly",!0)},"tapstart:delegate(x-calendar)":function(t){t.preventDefault(),t.baseEvent&&t.baseEvent.preventDefault()},"keypress:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.keyCode,n=t.currentTarget;e===p&&f(n,function(){d(n,!0)},!0)},"input:delegate(.x-datepicker-input)":function(t){var e=t.currentTarget;f(e,function(){d(e,!0),t.stopPropagation(),xtag.fireEvent(e,"input")})},"input:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.currentTarget;f(e,function(){d(e,!1),t.stopPropagation(),xtag.fireEvent(e,"input")})},"change:delegate(.x-datepicker-input)":function(t){t.stopPropagation(),xtag.fireEvent(t.currentTarget,"change")},"change:delegate(.x-datepicker-polyfill-input)":function(t){t.stopPropagation();var e=t.currentTarget;f(e,function(){d(e,!1)})}},accessors:{name:{attribute:{selector:".x-datepicker-input"},set:function(t){var e=this.xtag.dateInput;null===t||void 0===t?e.removeAttribute("name"):e.setAttribute("name",t)}},submitValue:{get:function(){return this.xtag.dateInput.value}},value:{attribute:{skip:!0},get:function(){return this.polyfill?this.xtag.polyfillInput.value:this.xtag.dateInput.value},set:function(t){var e=l(t),n=e?s(e):null,r=this.xtag.dateInput,i=this.xtag.polyfillInput,o=this.xtag.polyfillUI;if(null===t||void 0===t)this.removeAttribute("value"),r.value="",i&&(i.value=""),o&&(o.chosen=null);else{var a,u=n?n:t;i?t!==i.value?(i.value=u,a=u):a=t:a=u,this.setAttribute("value",a),n?(r.value=n,o&&(o.chosen=e,o.view=e)):(r.value="",o&&(o.chosen=null))}c(this)}},polyfill:{attribute:{"boolean":!0},set:function(t){var e=this.xtag.dateInput;if(t){if(e.setAttribute("type","hidden"),e.setAttribute("readonly",!0),!this.xtag.polyfillInput){var n=document.createElement("input");xtag.addClass(n,"x-datepicker-polyfill-input"),n.setAttribute("type","text"),n.setAttribute("placeholder",h(this)),n.value=this.xtag.dateInput.value,this.xtag.polyfillInput=n,this.appendChild(n)}if(this.xtag.polyfillInput.removeAttribute("disabled"),!this.xtag.polyfillUI){var r=document.createElement("x-calendar");xtag.addClass(r,"x-datepicker-polyfill-ui"),r.chosen=this.value,r.view=this.xtag.dateInput.value,r.controls=!0,r.labels=this.xtag._polyfillCalLabels,this.xtag.polyfillUI=r,this.appendChild(r)}}else{"date"!==e.getAttribute("type")&&e.setAttribute("type","date"),e.removeAttribute("readonly");var i=this.xtag.polyfillInput;i&&i.setAttribute("disabled",!0)}}},labels:{get:function(){var e={},n=this.xtag._labels,r=this.xtag._polyfillCalLabels;for(var i in n)e[i]=n[i];for(var i in r)e[i]=r[i];return t(e)},set:function(t){var e=this.xtag.polyfillUI,n=this.xtag.polyfillInput;if(e)e.labels=t,this.xtag._polyfillCalLabels=e.labels;else{var r=this.xtag._polyfillCalLabels;for(var i in r)i in t&&(r[i]=t[i])}var o=this.xtag._labels;for(var i in o)i in t&&(o[i]=t[i]);n&&n.setAttribute("placeholder",h(this))}}}})}();!function(){function t(t,e){this._historyStack=[],this.currIndex=-1,this._itemCap=void 0,this.itemCap=e,this._validatorFn=t?t:function(){return!0}}function e(t){var e=window.getComputedStyle(t),n=xtag.prefix.js+"TransitionDuration";return e.transitionDuration?e.transitionDuration:e[n]}function n(t){if("string"!=typeof t)return 0;var e=/^(\d*\.?\d+)(m?s)$/,n=t.toLowerCase().match(e);if(n){var r=n[1],i=n[2],a=parseFloat(r);if(isNaN(a))throw"value error";if("s"===i)return 1e3*a;if("ms"===i)return a;throw"unit error"}return 0}function r(t,e){return(t%e+e)%e}function i(t){return xtag.queryChildren(t,"x-card")}function a(t,e){var n=i(t);return isNaN(parseInt(e))||0>e||e>=n.length?null:n[e]}function o(t,e){var n=i(t);return n.indexOf(e)}function s(t,r,a,s,u){t.xtag._selectedCard=a;var c=new Date;t.xtag._lastAnimTimestamp=c;var h=function(){c===t.xtag._lastAnimTimestamp&&(l(t),xtag.fireEvent(t,"shuffleend",{detail:{oldCard:r,newCard:a}}))};if(a===r)return h(),void 0;var f=!1,v=!1,p=!1,g=function(){f&&v&&(i(t).forEach(function(t){t.removeAttribute("selected"),t.removeAttribute("leaving")}),r.setAttribute("leaving",!0),a.setAttribute("selected",!0),t.xtag._selectedCard=a,t.selectedIndex=o(t,a),u&&(r.setAttribute("reverse",!0),a.setAttribute("reverse",!0)),xtag.fireEvent(t,"shufflestart",{detail:{oldCard:r,newCard:a}}))},m=function(){p||f&&v&&b()},b=function(){p=!0;var t=!1,i=!1,o=!1,u=function(e){o||(e.target===r?(t=!0,r.removeEventListener("transitionend",u)):e.target===a&&(i=!0,a.removeEventListener("transitionend",u)),t&&i&&(o=!0,h()))};r.addEventListener("transitionend",u),a.addEventListener("transitionend",u);var c=n(e(r)),l=n(e(a)),f=Math.max(c,l),v=1.15,g="none"===s.toLowerCase()?0:Math.ceil(f*v);0===g?(o=!0,r.removeEventListener("transitionend",u),a.removeEventListener("transitionend",u),r.removeAttribute(d),a.removeAttribute(d),h()):(r.removeAttribute(d),a.removeAttribute(d),window.setTimeout(function(){o||(o=!0,r.removeEventListener("transitionend",u),a.removeEventListener("transitionend",u),h())},g))};xtag.skipTransition(r,function(){return r.setAttribute("card-anim-type",s),r.setAttribute(d,!0),f=!0,g(),m},this),xtag.skipTransition(a,function(){return a.setAttribute("card-anim-type",s),a.setAttribute(d,!0),v=!0,g(),m},this)}function u(t,e,n,r,a){var o=t.xtag._selectedCard;if(o===e){var u={detail:{oldCard:o,newCard:e}};return xtag.fireEvent(t,"shufflestart",u),xtag.fireEvent(t,"shuffleend",u),void 0}l(t),void 0===n&&(console.log("defaulting to none transition"),n="none");var c;switch(r){case"forward":c=!1;break;case"reverse":c=!0;break;default:o||(c=!1);var d=i(t);c=d.indexOf(e)0?t.xtag.history&&t.xtag.history.numStates>0?t.xtag.history.currState:e[0]:null),e.forEach(function(t){t.removeAttribute("leaving"),t.removeAttribute(d),t.removeAttribute("card-anim-type"),t.removeAttribute("reverse"),t!==n?t.removeAttribute("selected"):t.setAttribute("selected",!0)}),t.xtag._selectedCard=n,t.selectedIndex=o(t,n)}}var d="_before-animation",h=t.prototype;h.pushState=function(t){if(this.canRedo&&this._historyStack.splice(this.currIndex+1,this._historyStack.length-(this.currIndex+1)),this._historyStack.push(t),this.currIndex=this._historyStack.length-1,this.sanitizeStack(),"none"!==this._itemCap&&this._historyStack.length>this._itemCap){var e=this._historyStack.length;this._historyStack.splice(0,e-this._itemCap),this.currIndex=this._historyStack.length-1}},h.sanitizeStack=function(){for(var t,e=this._validatorFn,n=0;n=t)throw"attempted to set invalid item cap: "+t;this._itemCap=e}}},canUndo:{get:function(){return this.currIndex>0}},canRedo:{get:function(){return this.currIndex=0&&t-1&&this.shuffleTo(r(a+1,e.length),t)},shufflePrev:function(t){t=t?t:"auto";var e=i(this),n=this.xtag._selectedCard,a=e.indexOf(n);a>-1&&this.shuffleTo(r(a-1,e.length),t)},getAllCards:function(){return i(this)},getSelectedCard:function(){return this.xtag._selectedCard},getCardIndex:function(t){return o(this,t)},getCardAt:function(t){return a(this,t)},historyBack:function(t){var e=this.xtag.history;if(e.canUndo){e.backwards();var n=e.currState;n&&u(this,n,this.transitionType,t,!0)}},historyForward:function(t){var e=this.xtag.history;if(e.canRedo){e.forwards();var n=e.currState;n&&u(this,n,this.transitionType,t,!0)}}}}),xtag.register("x-card",{lifecycle:{inserted:function(){var t=this,e=t.parentNode;e&&"x-deck"===e.tagName.toLowerCase()&&(l(e),t.xtag.parentDeck=e,xtag.fireEvent(e,"cardadd",{detail:{card:t}}))},created:function(){var t=this.parentNode;t&&"x-deck"===t.tagName.toLowerCase()&&(this.xtag.parentDeck=t)},removed:function(){var t=this;if(t.xtag.parentDeck){var e=t.xtag.parentDeck;e.xtag.history.sanitizeStack(),l(e),xtag.fireEvent(e,"cardremove",{detail:{card:t}})}}},accessors:{transitionOverride:{attribute:{name:"transition-override"}}},methods:{show:function(){var t=this.parentNode;t===this.xtag.parentDeck&&t.shuffleTo(t.getCardIndex(this))}}})}();!function(){xtag.register("x-flipbox",{lifecycle:{created:function(){this.firstElementChild&&xtag.skipTransition(this.firstElementChild,function(){}),this.lastElementChild&&xtag.skipTransition(this.lastElementChild,function(){}),this.hasAttribute("direction")||(this.xtag._direction="right")}},events:{"transitionend:delegate(*:first-child)":function(t){var e=t.target,n=e.parentNode;"x-flipbox"===n.nodeName.toLowerCase()&&xtag.fireEvent(n,"flipend")},"show:delegate(*:first-child)":function(t){var e=t.target,n=e.parentNode;"x-flipbox"===n.nodeName.toLowerCase()&&(n.flipped=!1)},"show:delegate(*:last-child)":function(t){var e=t.target,n=e.parentNode;"x-flipbox"===n.nodeName.toLowerCase()&&(n.flipped=!0)}},accessors:{direction:{attribute:{},get:function(){return this.xtag._direction},set:function(t){xtag.skipTransition(this.firstElementChild,function(){this.setAttribute("_anim-direction",t)},this),xtag.skipTransition(this.lastElementChild,function(){this.setAttribute("_anim-direction",t)},this),this.xtag._direction=t}},flipped:{attribute:{"boolean":!0}}},methods:{toggle:function(){this.flipped=!this.flipped},showFront:function(){this.flipped=!1},showBack:function(){this.flipped=!0}}})}();!function(){function t(t,e){t.xtag.iconEl.nodeName===o?(e=void 0!==e?e:t.xtag.iconEl.src,e||(t.xtag.iconEl.src=a),t.xtag.iconEl.style.display=e&&e!==a?"":"none"):t.xtag.iconEl.style.display=t.xtag.iconEl.innerHTML?"":"none",t.xtag.contentEl.style.display=t.xtag.contentEl.innerHTML?"":"none"}function e(t){var e=t.xtag.iconEl,n=t.xtag.contentEl;if(n&&e){var r=e.parentNode;if(!r||n.parentNode!==r)throw"invalid parent node of iconbutton's icon / label";switch(t.iconAnchor){case"right":case"bottom":r.insertBefore(n,e);break;default:r.insertBefore(e,n)}}}function n(){xtag.query(document,"x-iconbutton[active]").forEach(function(t){t.removeAttribute("active")})}function r(){xtag.query(document,"x-iconbutton:focus").forEach(function(t){t.blur()})}function i(t){n(t),r()}var a="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",o=document.createElement("img").nodeName,s=function(t){return t.xtag.contentEl.textContent},u=function(t,e){t.xtag.contentEl.textContent=e},c=32,l=13,d=null;xtag.register("x-iconbutton",{lifecycle:{created:function(){var n=this.innerHTML;this.innerHTML="
"+""+"
"+"
",this.xtag.iconEl=this.querySelector(".x-iconbutton-icon"),this.xtag.contentEl=this.querySelector(".x-iconbutton-content"),this.xtag.contentEl.innerHTML=n,this.textGetter||(this.textGetter=s),this.textSetter||(this.textSetter=u),e(this),t(this),this.hasAttribute("tabindex")||this.setAttribute("tabindex",0)},inserted:function(){d||(d={tapend:xtag.addEvent(document,"tapend",i),dragend:xtag.addEvent(document,"dragend",i),keyup:xtag.addEvent(document,"keyup",n)}),e(this),t(this)},removed:function(){if(d&&!document.query("x-calendar")){for(var t in d)xtag.removeEvent(document,t,d[t]);d=null}},attributeChanged:function(){var n=this.iconEl,r=this.contentEl;n.parentNode&&n.parentNode.parentNode===this&&r.parentNode&&r.parentNode.parentNode===this||console.warn("inner DOM of the iconbutton appears to be out of sync; make sure that editing innerHTML or textContent is done through .contentEl, not directly on the iconbutton itself"),e(this),t(this)}},events:{tapstart:function(t){t.currentTarget.setAttribute("active",!0)},keypress:function(t){var e=t.key||t.keyCode;(e===c||e===l)&&t.currentTarget.click()},keydown:function(t){var e=t.key||t.keyCode;(e===c||e===l)&&t.currentTarget.setAttribute("active",!0)}},accessors:{src:{attribute:{},get:function(){return this.xtag.iconEl.getAttribute("src")},set:function(e){this.xtag.iconEl.setAttribute("src",e),this.xtag.iconEl.src=e,t(this,e)}},active:{attribute:{}},iconAnchor:{attribute:{name:"icon-anchor"},set:function(){e(this)}},iconEl:{get:function(){return this.xtag.iconEl}},contentEl:{get:function(){return this.xtag.contentEl}}}})}();!function(){function t(t){var e=t.firstElementChild;if(!e)return{header:null,section:null,footer:null};var n=e.nextElementSibling;return{header:"HEADER"==e.nodeName?e:null,section:"SECTION"==e.nodeName?e:n&&"SECTION"==n.nodeName?n:null,footer:"FOOTER"==t.lastElementChild.nodeName?t.lastElementChild:null}}function e(t,e){var n=e.__layoutScroll__=e.__layoutScroll__||Object.defineProperty(e,"__layoutScroll__",{value:{last:e.scrollTop}}).__layoutScroll__,r=e.scrollTop,i=t.scrollBuffer;return n.max=n.max||Math.max(r+i,i),n.min=n.min||Math.max(r-i,i),n}function n(t,e){t.setAttribute("content-maximizing",null),e.section&&(e.header&&(e.section.style.marginTop="-"+e.header.getBoundingClientRect().height+"px"),e.footer&&(e.section.style.marginBottom="-"+e.footer.getBoundingClientRect().height+"px"))}function r(t,e){t.removeAttribute("content-maximized"),t.removeAttribute("content-maximizing"),e.section&&(e.section.style.marginTop="",e.section.style.marginBottom="")}function i(i){if(!i.currentTarget.hasAttribute("content-maximizing")){var a=i.target,o=i.currentTarget;if(this.scrollhide&&(a.parentNode==o||xtag.matchSelector(a,o.scrollTarget))){var s=a.scrollTop,u=o.scrollBuffer,c=t(o),l=e(o,a);s>l.last?l.min=Math.max(s-u,u):sl.max&&!o.hasAttribute("content-maximized")?n(o,c):s x-slide[selected]")[0]||0;return[e?xtag.query(t,"x-slides > x-slide").indexOf(e):e,t.firstElementChild.children.length-1]}function e(t,e){var n=xtag.toArray(t.firstElementChild.children);n.forEach(function(t){t.removeAttribute("selected")}),n[e||0].setAttribute("selected",!0),t.firstElementChild.style[r]="translate"+(t.getAttribute("orientation")||"x")+"("+(e||0)*(-100/n.length)+"%)"}function n(t){var n=this.firstElementChild;if(n&&n.children.length&&"x-slides"==n.tagName.toLowerCase()){var i=xtag.toArray(n.children),a=100/(i.length||1),o=this.getAttribute("orientation")||"x",s="x"==o?["width","height"]:["height","width"];if(n.style[s[1]]="100%",n.style[s[0]]=100*i.length+"%",n.style[r]="translate"+o+"(0%)",i.forEach(function(t){t.style[s[0]]=a+"%",t.style[s[1]]="100%"}),t){var u=n.querySelector("[selected]");u&&e(this,i.indexOf(u)||0)}}}var r=xtag.prefix.js+"Transform";xtag.register("x-slidebox",{lifecycle:{created:function(){n()}},events:{transitionend:function(t){t.target==this.firstElementChild&&xtag.fireEvent(this,"slideend")},"show:delegate(x-slide)":function(t){var e=t.target;if("x-slides"===e.parentNode.nodeName.toLowerCase()&&"x-slidebox"===e.parentNode.parentNode.nodeName.toLowerCase()){var n=e.parentNode,r=n.parentNode,i=xtag.query(n,"x-slide");r.slideTo(i.indexOf(e))}}},accessors:{orientation:{get:function(){return this.getAttribute("orientation")},set:function(t){var e=this;xtag.skipTransition(e.firstElementChild,function(){e.setAttribute("orientation",t.toLowerCase()),n.call(e,!0)})}}},methods:{slideTo:function(t){e(this,t)},slideNext:function(){var n=t(this);n[0]++,e(this,n[0]>n[1]?0:n[0])},slidePrevious:function(){var n=t(this);n[0]--,e(this,n[0]<0?n[1]:n[0])}}}),xtag.register("x-slide",{lifecycle:{inserted:function(){var t=this.parentNode.parentNode;"x-slidebox"==t.tagName.toLowerCase()&&n.call(t,!0)},created:function(){if(this.parentNode){var t=this.parentNode.parentNode;"x-slidebox"==t.tagName.toLowerCase()&&n.call(t,!0)}}}})}();!function(){function t(t){return!isNaN(parseFloat(t))}function e(e,n){return e.hasAttribute(n)&&t(e.getAttribute(n))}function n(e,n,r,i){if(i=i?i:Math.round,r=t(r)?r:0,!t(e))throw"invalid value "+e;if(!t(n)||0>=+n)throw"invalid step "+n;return i((e-r)/n)*n+r}function r(t,e,r,i){return e>t?e:t>r?Math.max(e,n(r,i,e,Math.floor)):t}function i(t,e,i){var a=n((e-t)/2+t,i,t);return r(a,t,e,i)}function a(t,e){var n=t.min,r=t.max;return(e-n)/(r-n)}function o(t,e){var n=t.min,r=t.max;return(r-n)*e+n}function s(t,e){e=Math.min(Math.max(0,e),1);var i=o(t,e),a=n(i,t.step,t.min);return r(a,t.min,t.max,t.step)}function u(t,e){var n=t.xtag.polyFillSliderThumb;if(n){var r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=a(t,e),s=Math.max(r.width-i.width,0),u=s*o,c=u/r.width;n.style.left=100*c+"%"}}function c(t){u(t,t.value)}function l(t,e){var n=t.xtag.rangeInputEl,r=n.getBoundingClientRect(),i=e-r.left;t.value;var a=s(t,i/r.width);t.value=a,xtag.fireEvent(t,"input"),c(t)}function d(t,e,n){t.xtag.dragInitVal=t.value,l(t,e,n);var r=t.xtag.callbackFns,i=function(t,e){document.body.addEventListener(t,e)};i("mousemove",r.onMouseDragMove),i("touchmove",r.onTouchDragMove),i("mouseup",r.onDragEnd),i("touchend",r.onDragEnd);var a=t.xtag.polyFillSliderThumb;a&&a.setAttribute("active",!0)}function h(t,e,n){l(t,e,n)}function f(t){return{onMouseDragStart:function(e){e.button===g&&(d(t,e.pageX,e.pageY),e.preventDefault())},onTouchDragStart:function(e){var n=e.targetTouches;1===n.length&&(d(t,n[0].pageX,n[0].pageY),e.preventDefault())},onMouseDragMove:function(e){h(t,e.pageX,e.pageY),e.preventDefault()},onTouchDragMove:function(e){var n=e.targetTouches;1===n.length&&(h(t,n[0].pageX,n[0].pageY),e.preventDefault())},onDragEnd:function(e){var n=t.xtag.callbackFns,r=function(t,e){document.body.removeEventListener(t,e)};r("mousemove",n.onMouseDragMove),r("touchmove",n.onTouchDragMove),r("mouseup",n.onDragEnd),r("touchend",n.onDragEnd);var i=t.xtag.polyFillSliderThumb;i&&i.removeAttribute("active"),t.value!==t.xtag.dragInitVal&&xtag.fireEvent(t,"change"),t.xtag.dragInitVal=null,e.preventDefault()},onKeyDown:function(t){var e=t.keyCode;if(e in v){var n=this.value,r=this.min,i=this.max,a=this.step,o=Math.max(0,i-r),s=Math.max(o/10,a);switch(v[e]){case"LEFT_ARROW":case"DOWN_ARROW":this.value=Math.max(n-a,r);break;case"RIGHT_ARROW":case"UP_ARROW":this.value=Math.min(n+a,i);break;case"HOME":this.value=r;break;case"END":this.value=i;break;case"PAGE_DOWN":this.value=Math.max(n-s,r);break;case"PAGE_UP":this.value=Math.min(n+s,i)}this.value!==n&&xtag.fireEvent(this,"change"),t.preventDefault()}}}}var v={33:"PAGE_UP",34:"PAGE_DOWN",35:"END",36:"HOME",37:"LEFT_ARROW",38:"UP_ARROW",39:"RIGHT_ARROW",40:"DOWN_ARROW"},g=0;xtag.register("x-slider",{lifecycle:{created:function(){var t=this;t.xtag.callbackFns=f(t),t.xtag.dragInitVal=null;var n=document.createElement("input");xtag.addClass(n,"input"),n.setAttribute("type","range");var r=e(t,"max")?+t.getAttribute("max"):100,a=e(t,"min")?+t.getAttribute("min"):0,o=e(t,"step")?+t.getAttribute("step"):1;o=o>0?o:1;var s=e(t,"value")?+t.getAttribute("value"):i(a,r,o);n.setAttribute("max",r),n.setAttribute("min",a),n.setAttribute("step",o),n.setAttribute("value",s),t.xtag.rangeInputEl=n,t.appendChild(t.xtag.rangeInputEl),t.xtag.polyFillSliderThumb=null,"range"!==n.type||t.hasAttribute("polyfill")?t.setAttribute("polyfill",!0):t.removeAttribute("polyfill"),c(t)},attributeChanged:function(){c(this)}},events:{"change:delegate(input[type=range])":function(t){t.stopPropagation(),xtag.fireEvent(t.currentTarget,"change")},"input:delegate(input[type=range])":function(t){t.stopPropagation(),xtag.fireEvent(t.currentTarget,"input")},"focus:delegate(input[type=range])":function(t){var e=t.currentTarget;xtag.fireEvent(e,"focus",{},{bubbles:!1})},"blur:delegate(input[type=range])":function(t){var e=t.currentTarget;xtag.fireEvent(e,"blur",{},{bubbles:!1})}},accessors:{polyfill:{attribute:{"boolean":!0},set:function(t){var e=this.xtag.callbackFns;if(t){if(this.setAttribute("tabindex",0),this.xtag.rangeInputEl.setAttribute("tabindex",-1),this.xtag.rangeInputEl.setAttribute("readonly",!0),!this.xtag.polyFillSliderThumb){var n=document.createElement("span");xtag.addClass(n,"slider-thumb"),this.xtag.polyFillSliderThumb=n,this.appendChild(n)}c(this),this.addEventListener("mousedown",e.onMouseDragStart),this.addEventListener("touchstart",e.onTouchDragStart),this.addEventListener("keydown",e.onKeyDown)}else this.removeAttribute("tabindex"),this.xtag.rangeInputEl.removeAttribute("tabindex"),this.xtag.rangeInputEl.removeAttribute("readonly"),this.removeEventListener("mousedown",e.onMouseDragStart),this.removeEventListener("touchstart",e.onTouchDragStart),this.removeEventListener("keydown",e.onKeyDown)}},max:{attribute:{selector:"input[type=range]"},get:function(){return+this.xtag.rangeInputEl.getAttribute("max")}},min:{attribute:{selector:"input[type=range]"},get:function(){return+this.xtag.rangeInputEl.getAttribute("min")}},step:{attribute:{selector:"input[type=range]"},get:function(){return+this.xtag.rangeInputEl.getAttribute("step")}},name:{attribute:{selector:"input[type=range]"},set:function(t){var e=this.xtag.rangeInputEl;null===t||void 0===t?e.removeAttribute("name"):e.setAttribute("name",t)}},value:{attribute:{selector:"input[type=range]"},get:function(){return+this.xtag.rangeInputEl.value},set:function(e){t(e)||(e=i(this.min,this.max,this.step)),e=+e;var a=this.min,o=this.max,s=this.step,u=n(e,s,a),l=r(u,a,o,s);this.xtag.rangeInputEl.value=l,c(this)}},inputElem:{get:function(){return this.xtag.rangeInputEl}}},methods:{}})}();!function(){function t(){var t=document.documentElement,e={left:t.scrollLeft||document.body.scrollLeft||0,top:t.scrollTop||document.body.scrollTop||0,width:t.clientWidth,height:t.clientHeight};return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function e(e){var n=e.getBoundingClientRect(),r=t(),i=r.left,a=r.top;return{left:n.left+i,right:n.right+i,top:n.top+a,bottom:n.bottom+a,width:n.width,height:n.height}}function n(t,e,n){return n.left<=t&&t<=n.right&&n.top<=e&&e<=n.bottom}function r(t){if("x-tabbar"===t.parentNode.nodeName.toLowerCase()){var e=t.targetEvent,n=t.targetSelector?xtag.query(document,t.targetSelector):t.targetElems;n.forEach(function(t){xtag.fireEvent(t,e)})}}xtag.register("x-tabbar",{lifecycle:{created:function(){this.xtag.overallEventToFire="show"}},events:{"tap:delegate(x-tabbar-tab)":function(){var t=xtag.query(this.parentNode,"x-tabbar-tab[selected]");t.length&&t.forEach(function(t){t.removeAttribute("selected")}),this.setAttribute("selected",!0)}},accessors:{tabs:{get:function(){return xtag.queryChildren(this,"x-tabbar-tab")}},targetEvent:{attribute:{name:"target-event"},get:function(){return this.xtag.overallEventToFire},set:function(t){this.xtag.overallEventToFire=t}}},methods:{}}),xtag.register("x-tabbar-tab",{lifecycle:{created:function(){this.xtag.targetSelector=null,this.xtag.overrideTargetElems=null,this.xtag.targetEvent=null}},events:{tap:function(t){var i=t.currentTarget;if(t.changedTouches&&t.changedTouches.length>0){var a=t.changedTouches[0],o=e(i);n(a.pageX,a.pageY,o)&&r(i)}else r(i)}},accessors:{targetSelector:{attribute:{name:"target-selector"},get:function(){return this.xtag.targetSelector},set:function(t){this.xtag.targetSelector=t,t&&(this.xtag.overrideTargetElems=null)}},targetElems:{get:function(){return this.targetSelector?xtag.query(document,this.targetSelector):null!==this.xtag.overrideTargetElems?this.xtag.overrideTargetElems:[]},set:function(t){this.removeAttribute("target-selector"),this.xtag.overrideTargetElems=t}},targetEvent:{attribute:{name:"target-event"},get:function(){if(this.xtag.targetEvent)return this.xtag.targetEvent;if("x-tabbar"===this.parentNode.nodeName.toLowerCase())return this.parentNode.targetEvent;throw"tabbar-tab is missing event to fire"},set:function(t){this.xtag.targetEvent=t}}},methods:{}})}();!function(){function t(t){var e=t.xtag.inputEl.form;e?t.removeAttribute("x-toggle-no-form"):t.setAttribute("x-toggle-no-form",""),t.xtag.scope=t.parentNode?e||document:null}function e(t){var e={},n=t==document?"[x-toggle-no-form]":"";xtag.query(t,"x-toggle[name]"+n).forEach(function(r){var i=r.name;if(i&&!e[i]){var a=xtag.query(t,'x-toggle[name="'+i+'"]'+n),o=a.length>1?"radio":"checkbox";a.forEach(function(t){t.xtag&&t.xtag.inputEl&&(t.type=o)}),e[i]=!0}})}var n=!1;xtag.addEvents(document,{DOMComponentsLoaded:function(){e(document),xtag.toArray(document.forms).forEach(e)},WebComponentsReady:function(){e(document),xtag.toArray(document.forms).forEach(e)},keydown:function(t){n=t.shiftKey},keyup:function(t){n=t.shiftKey},"focus:delegate(x-toggle)":function(){this.setAttribute("focus","")},"blur:delegate(x-toggle)":function(){this.removeAttribute("focus")},"tap:delegate(x-toggle)":function(){if(n&&this.group){var t=this.groupToggles,e=this.xtag.scope.querySelector('x-toggle[group="'+this.group+'"][active]');if(e&&this!=e){var r=this,i=e.checked,a=t.indexOf(this),o=t.indexOf(e),s=Math.min(a,o),u=Math.max(a,o);t.slice(s,u).forEach(function(t){t!=r&&(t.checked=i)})}}},"change:delegate(x-toggle)":function(){var t=this.xtag.scope.querySelector('x-toggle[group="'+this.group+'"][active]');this.checked=n&&t&&this!=t?t.checked:this.xtag.inputEl.checked,this.group&&(this.groupToggles.forEach(function(t){t.active=!1}),this.active=!0)}}),xtag.register("x-toggle",{lifecycle:{created:function(){this.innerHTML='
',this.xtag.inputWrapEl=this.querySelector(".x-toggle-input-wrap"),this.xtag.inputEl=this.xtag.inputWrapEl.querySelector("input"),this.xtag.contentWrapEl=this.querySelector(".x-toggle-content-wrap"),this.xtag.checkEl=this.querySelector(".x-toggle-check"),this.xtag.contentEl=this.querySelector(".x-toggle-content"),this.type="checkbox",t(this);var e=this.getAttribute("name");e&&(this.xtag.inputEl.name=this.getAttribute("name")),this.hasAttribute("checked")&&(this.checked=!0)},inserted:function(){t(this),this.parentNode&&"x-togglegroup"===this.parentNode.nodeName.toLowerCase()&&(this.parentNode.hasAttribute("name")&&(this.name=this.parentNode.getAttribute("name")),this.parentNode.hasAttribute("group")&&(this.group=this.parentNode.getAttribute("group")),this.setAttribute("no-box",!0)),this.name&&e(this.xtag.scope)},removed:function(){e(this.xtag.scope),t(this)}},accessors:{noBox:{attribute:{name:"no-box","boolean":!0},set:function(){}},type:{attribute:{},set:function(t){this.xtag.inputEl.type=t}},label:{attribute:{},get:function(){return this.xtag.contentEl.innerHTML},set:function(t){this.xtag.contentEl.innerHTML=t}},active:{attribute:{"boolean":!0}},group:{attribute:{}},groupToggles:{get:function(){return xtag.query(this.xtag.scope,'x-toggle[group="'+this.group+'"]')}},name:{attribute:{skip:!0},get:function(){return this.getAttribute("name")},set:function(t){null===t?(this.removeAttribute("name"),this.type="checkbox"):this.setAttribute("name",t),this.xtag.inputEl.name=t,e(this.xtag.scope)}},checked:{get:function(){return this.xtag.inputEl.checked},set:function(t){var e=this.name,n="true"===t||t===!0;if(e){var r=this.xtag.scope==document?"[x-toggle-no-form]":"",i='x-toggle[checked][name="'+e+'"]'+r,a=this.xtag.scope.querySelector(i);a&&a.removeAttribute("checked")}this.xtag.inputEl.checked=n,n?this.setAttribute("checked",""):this.removeAttribute("checked")}},value:{attribute:{},get:function(){return this.xtag.inputEl.value},set:function(t){this.xtag.inputEl.value=t}}}})}();!function(){xtag.register("x-togglegroup",{lifecycle:{created:function(){this.options.forEach(function(t){this.name&&(t.name=this.name),this.group&&(t.group=this.group),t.noBox=!0}.bind(this))}},events:{},accessors:{name:{attribute:{selector:"x-toggle"},set:function(t){this.options.forEach(function(e){e.name=t})}},group:{attribute:{selector:"x-toggle"},set:function(t){this.options.forEach(function(e){e.group=t})}},options:{get:function(){return xtag.queryChildren(this,"x-toggle")}}},methods:{}})}();!function(){function t(t){return t in D}function e(){var t=document.documentElement,e={left:t.scrollLeft||document.body.scrollLeft||0,top:t.scrollTop||document.body.scrollTop||0,width:t.clientWidth,height:t.clientHeight};return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function n(t){var n=t.getBoundingClientRect(),r=e(),i=r.left,o=r.top;return{left:n.left+i,right:n.right+i,top:n.top+o,bottom:n.bottom+o,width:n.width,height:n.height}}function r(t,e){var e=void 0!==e?e:n(t);return{x:t.offsetWidth?e.width/t.offsetWidth:1,y:t.offsetHeight?e.height/t.offsetHeight:1}}function i(t,e){if(t.righto||h.bottom>a?u.push(c):s.push(c)}var d=s.length>0?s:u;return d[0].orient}function E(t){t.setAttribute("_force-display",!0)}function w(t){t.removeAttribute("_force-display")}function A(e,n){e.removeAttribute(j);var r=e.xtag.arrowEl,i=[];for(var o in D){r.setAttribute(R,D[o]);var a=T(e,n,o);a&&(E(e),v(e,n)||i.push({orient:o,rect:a}),w(e))}var s=_(e,i);return s||(s="top"),e.setAttribute(j,s),r.setAttribute(R,D[s]),t(s)&&s!==o?T(e,n,s):a}function T(i,o,a,s){if(!i.parentNode)return i.left="",i.top="",null;s=void 0===s?0:s;var u=i.xtag.arrowEl;if(!t(a))return A(i,o);var l=i.offsetParent?i.offsetParent:i.parentNode;s||(i.style.top="",i.style.left="",u.style.top="",u.style.left=""),E(i);var c=e(),h=n(l),g=r(l,h),p=l.clientWidth*g.x,v=l.clientHeight*g.y,_=n(o),C=_.width,k=_.height,N=n(i),S=r(i,N),O=N.width,L=N.height,D=N.width,M=N.height,I=(D-O)/2,R=(M-L)/2,j=u.offsetWidth*S.x,U=u.offsetHeight*S.y,P=45,F=m(j,U,P);j=F.width,U=F.height,"top"===a||"bottom"===a?U/=2:j/=2;var H=y(i,h),q=H.left,V=H.top,W=H.right-O,z=H.bottom-L,B={left:_.left+(C-O)/2,top:_.top+(k-L)/2},Y=B.left,G=B.top;if("top"===a)G=_.top-M-U,z-=U;else if("bottom"===a)G=_.top+k+U,z-=U;else if("left"===a)Y=_.left-D-j,W-=j;else{if("right"!==a)throw"invalid orientation "+a;Y=_.left+C+j,W-=j}var J=b(Y,q,W),X=b(G,V,z);J+=I,X+=R;var K,$,Z=function(t){if(!window.getComputedStyle||t===document||t===document.documentElement)return!1;var e;try{e=window.getComputedStyle(t)}catch(n){return!1}return e&&"fixed"===e.position},Q=d(o,Z);if(Q&&!f(i,Q))K=J-c.left,$=X-c.top,i.setAttribute("_target-fixed",!0);else{var te=x(J,X,window,l,g);K=te.left,$=te.top,i.removeAttribute("_target-fixed")}i.style.top=$+"px",i.style.left=K+"px";var ee,ne,re,ie,oe;"top"===a||"bottom"===a?(ie=(C-j)/2,oe=_.left-J,ee=O-j,ne=O,re="left"):(ie=(k-U)/2,oe=_.top-X,ee=L-U,ne=L,re="top");var ae=b(ie+oe,0,ee),se=ne?ae/ne:0;u.style[re]=100*se+"%";var ue=i.offsetWidth*S.x,le=i.offsetHeight*S.y,ce=l.clientWidth*g.x,he=l.clientHeight*g.y;w(i);var de=2;return de>s&&(O!==ue||L!==le||p!==ce||v!==he)?T(i,o,a,s+1):{left:J,top:X,width:ue,height:le,right:J+ue,bottom:X+le}}function C(t,e){e===t&&console.warn("The tooltip's target element is the tooltip itself! Is this intentional?");var n=t.xtag.arrowEl;n.parentNode||console.warn("The inner component DOM of the tooltip appears to be missing. Make sure to edit tooltip contents through the .contentEl property instead ofdirectly on the x-tooltip to avoid clobbering the component's internals.");var r=t.orientation,i=function(){w(t),t.setAttribute("visible",!0),xtag.fireEvent(t,"tooltipshown",{triggerElem:e})};e?(t.xtag.lastTargetElem=e,xtag.skipTransition(t,function(){return T(t,e,r),i})):(t.style.top="",t.style.left="",n.style.top="",n.style.left="",i())}function k(e){t(e.orientation)&&e.removeAttribute(j),e.hasAttribute("visible")&&(E(e),e.xtag._hideTransitionFlag=!0,e.removeAttribute("visible"))}function N(t){var e=t.xtag.cachedListeners;e.forEach(function(t){t.removeListener()}),t.xtag.cachedListeners=[],O.unregisterTooltip(t.triggerStyle,t)}function S(t,e,n){if(t.parentNode){(void 0===e||null===e)&&(e=t.targetSelector),(void 0===n||null===n)&&(n=t.triggerStyle);var r=p(t,e);-1===r.indexOf(t.xtag.lastTargetElem)&&(t.xtag.lastTargetElem=r.length>0?r[0]:null,T(t,t.xtag.lastTargetElem,t.orientation)),N(t);var i;if(n in L){var o=L[n];i=o(t,e)}else i=h(t,e,n),O.registerTooltip(n,t);i.forEach(function(t){t.attachListener()}),t.xtag.cachedListeners=i,k(t)}}var O,L,D={top:"down",bottom:"up",left:"right",right:"left"},M="_previousSibling",I="_nextSibling",R="arrow-direction",j="_auto-orientation";o.prototype.attachListener=function(){this._attachedFn||(this._attachedFn=xtag.addEvent(this.elem,this.eventType,this.listenerFn))},o.prototype.removeListener=function(){this._attachedFn&&(xtag.removeEvent(this.elem,this.eventType,this._attachedFn),this._attachedFn=null)},a.prototype.destroy=function(){this._cachedListener.removeListener(),this._cachedListener=null,this._tooltips=null},a.prototype.containsTooltip=function(t){return-1!==this._tooltips.indexOf(t)},a.prototype.addTooltip=function(t){this.containsTooltip(t)||this._tooltips.push(t)},a.prototype.removeTooltip=function(t){this.containsTooltip(t)&&this._tooltips.splice(this._tooltips.indexOf(t),1)},Object.defineProperties(a.prototype,{numTooltips:{get:function(){return this._tooltips.length}}}),s.prototype.registerTooltip=function(t,e){if(t in this.eventStructDict){var n=this.eventStructDict[t];n.containsTooltip(e)||n.addTooltip(e)}else this.eventStructDict[t]=new a(t),this.eventStructDict[t].addTooltip(e)},s.prototype.unregisterTooltip=function(t,e){if(t in this.eventStructDict&&this.eventStructDict[t].containsTooltip(e)){var n=this.eventStructDict[t];n.removeTooltip(e),0===n.numTooltips&&(n.destroy(),delete this.eventStructDict[t])}},O=new s,L={custom:function(){return[]},hover:function(t,e){var n=[],r=null,i=200,a=function(){r&&window.clearTimeout(r),r=null},s=g(function(e){a();var n=this,r=e.relatedTarget||e.toElement;f(r,t)||C(t,n)}),u=g(function(e){a();var n=e.relatedTarget||e.toElement;f(n,t)||(r=window.setTimeout(function(){"hover"===t.triggerStyle&&k(t)},i))}),l=c(t,e,"enter",s),h=c(t,e,"leave",u);n.push(l),n.push(h);var d=g(function(e){a();var n=e.relatedTarget||e.toElement,r=t.xtag.lastTargetElem;t.hasAttribute("visible")||!r||f(n,r)||C(t,r)}),p=g(function(e){a();var n=e.relatedTarget||e.toElement,o=t.xtag.lastTargetElem;o&&!f(n,o)&&(r=window.setTimeout(function(){"hover"===t.triggerStyle&&k(t)},i))});return n.push(new o(t,"enter",d)),n.push(new o(t,"leave",p)),n}},xtag.register("x-tooltip",{lifecycle:{created:function(){var t=this;t.xtag.contentEl=document.createElement("div"),t.xtag.arrowEl=document.createElement("span"),xtag.addClass(t.xtag.contentEl,"tooltip-content"),xtag.addClass(t.xtag.arrowEl,"tooltip-arrow"),t.xtag.contentEl.innerHTML=t.innerHTML,t.innerHTML="",t.appendChild(t.xtag.contentEl),t.appendChild(t.xtag.arrowEl),t.xtag._orientation="auto",t.xtag._targetSelector=M,t.xtag._triggerStyle="click";var e=p(t,t.xtag._targetSelector);t.xtag.lastTargetElem=e.length>0?e[0]:null,t.xtag.cachedListeners=[],t.xtag._hideTransitionFlag=!1,t.xtag._skipOuterClick=!1},inserted:function(){S(this,this.xtag._targetSelector,this.xtag._triggerStyle)},removed:function(){N(this)}},events:{transitionend:function(t){var e=t.currentTarget;e.xtag._hideTransitionFlag&&!e.hasAttribute("visible")&&(e.xtag._hideTransitionFlag=!1,xtag.fireEvent(e,"tooltiphidden")),w(e)}},accessors:{orientation:{attribute:{},get:function(){return this.xtag._orientation},set:function(e){e=e.toLowerCase();var n=this.querySelector(".tooltip-arrow"),r=null;t(e)?(r=D[e],n.setAttribute(R,r),this.removeAttribute(j)):n.removeAttribute(R),this.xtag._orientation=e,this.refreshPosition()}},triggerStyle:{attribute:{name:"trigger-style"},get:function(){return this.xtag._triggerStyle},set:function(t){S(this,this.targetSelector,t),this.xtag._triggerStyle=t}},targetSelector:{attribute:{name:"target-selector"},get:function(){return this.xtag._targetSelector},set:function(t){p(this,t),S(this,t,this.triggerStyle),this.xtag._targetSelector=t}},ignoreOuterTrigger:{attribute:{"boolean":!0,name:"ignore-outer-trigger"}},ignoreTooltipPointerEvents:{attribute:{"boolean":!0,name:"ignore-tooltip-pointer-events"}},allowOverflow:{attribute:{"boolean":!0,name:"allow-overflow"},set:function(){this.refreshPosition()}},contentEl:{get:function(){return this.xtag.contentEl},set:function(t){var e=this.xtag.contentEl;xtag.addClass(t,"tooltip-content"),this.replaceChild(t,e),this.xtag.contentEl=t,this.refreshPosition()}},presetTriggerStyles:{get:function(){var t=[];for(var e in L)t.push(e);return t}},targetElems:{get:function(){return p(this,this.targetSelector)}}},methods:{refreshPosition:function(){this.xtag.lastTargetElem&&T(this,this.xtag.lastTargetElem,this.orientation)},show:function(){C(this,this.xtag.lastTargetElem)},hide:function(){k(this)},toggle:function(){this.hasAttribute("visible")?this.hide():this.show()}}})}(); \ No newline at end of file +window.Platform={};var logFlags={};!function(){function e(e){if(this._element=e,e.className!=this._classCache){if(this._classCache=e.className,!this._classCache)return;var t,n=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(t=0;t>>0)+(t++ +"__")},SideTable.prototype={set:function(t,n){var r=t[this.name];r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0})},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){this.set(e,void 0)}}}(),function(e){function t(e){y.push(e),b||(b=!0,m(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){b=!1;var e=y;y=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=h.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=h.get(n);if(r)for(var o=0;o0){var o=n[r-1],i=p(o,e);if(i)return n[r-1]=i,void 0}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=h.get(e);t||h.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=h.get(e),n=0;nn&&(e=t[n]);n++)e();A=[]}function d(e){N?u(function(){f(e)}):f(e)}function f(e){(e.enteredViewCallback||e.__upgraded__&&O.dom)&&(O.dom&&console.group("inserted:",e.localName),h(e)&&(e.__inserted=(e.__inserted||0)+1,e.__inserted<1&&(e.__inserted=1),e.__inserted>1?O.dom&&console.warn("inserted:",e.localName,"insert/remove count:",e.__inserted):e.enteredViewCallback&&(O.dom&&console.log("inserted:",e.localName),e.enteredViewCallback())),O.dom&&console.groupEnd())}function p(e){v(e),r(e,function(e){v(e)})}function v(e){N?u(function(){_removed(e)}):_removed(e)}function v(e){(e.leftViewCallback||e.__upgraded__&&O.dom)&&(O.dom&&console.log("removed:",e.localName),h(e)||(e.__inserted=(e.__inserted||0)-1,e.__inserted>0&&(e.__inserted=0),e.__inserted<0?O.dom&&console.warn("removed:",e.localName,"insert/remove count:",e.__inserted):e.leftViewCallback&&e.leftViewCallback()))}function h(e){for(var t=e,n=window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(document)||document;t;){if(t==n)return!0;t=t.parentNode||t.host}}function m(e){if(e.shadowRoot&&!e.shadowRoot.__watched){O.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)_(t),t=t.olderShadowRoot}}function _(e){e.__watched||(w(e),e.__watched=!0)}function g(e){switch(e.localName){case"style":case"script":case"template":case void 0:return!0}}function b(e){if(O.dom){var t=e[0];if(t&&"childList"===t.type&&t.addedNodes&&t.addedNodes){for(var n=t.addedNodes[0];n&&n!==document&&!n.host;)n=n.parentNode;var r=n&&(n.URL||n._URL||n.host&&n.host.localName)||"";r=r.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,r||"")}e.forEach(function(e){"childList"===e.type&&(T(e.addedNodes,function(e){g(e)||a(e)}),T(e.removedNodes,function(e){g(e)||p(e)}))}),O.dom&&console.groupEnd()}function y(){b(M.takeRecords()),l()}function w(e){M.observe(e,{childList:!0,subtree:!0})}function E(e){w(e)}function L(e){O.dom&&console.group("upgradeDocument: ",(e.URL||e._URL||"").split("/").pop()),a(e),O.dom&&console.groupEnd()}var O=window.logFlags||{},N=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;e.hasPolyfillMutations=N;var k=!1,A=[],M=new MutationObserver(b),T=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.watchShadow=m,e.upgradeAll=a,e.upgradeSubtree=i,e.observeDocument=E,e.upgradeDocument=L,e.takeRecords=y}(window.CustomElements),function(e){function t(e){return r(e,c)}function n(e){return r(e,u)}function r(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function o(e){return"script"===e.localName}function i(e,t){var n=e;n instanceof Document||(n=document.implementation.createHTMLDocument(c),n.body.innerHTML=e),n._URL=t;var r=n.createElement("base");return r.setAttribute("href",document.baseURI||document.URL),n.head.appendChild(r),window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}e||(e=window.HTMLImports={flags:{}});var a,s=e.xhr,c="import",u="stylesheet",l={documents:{},cache:{},preloadSelectors:["link[rel="+c+"]","element link[rel="+u+"]","template","script[src]:not([type])",'script[src][type="text/javascript"]'].join(","),loader:function(e){return a=new d(l.loaded,e),a.cache=l.cache,a},load:function(e,t){a=l.loader(t),l.preload(e)},preload:function(e){var t=e.querySelectorAll(l.preloadSelectors);t=this.filterMainDocumentNodes(e,t),t=this.extractTemplateNodes(t),a.addNodes(t)},filterMainDocumentNodes:function(e,t){return e===document&&(t=Array.prototype.filter.call(t,function(e){return!o(e)})),t},extractTemplateNodes:function(e){var t=[];return e=Array.prototype.filter.call(e,function(e){if("template"===e.localName){if(e.content){var n=e.content.querySelectorAll("link[rel="+u+"]");n.length&&(t=t.concat(Array.prototype.slice.call(n,0)))}return!1}return!0}),t.length&&(e=e.concat(t)),e},loaded:function(e,r,o){if(t(r)){var a=l.documents[e];a||(a=i(o,e),h.resolvePathsInHTML(a),l.documents[e]=a,l.preload(a)),r.import={href:e,ownerNode:r,content:a},r.content=o=a}r.__resource=o,n(r)&&h.resolvePathsInStylesheet(r)}},d=function(e,t){this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={},this.cache={}};d.prototype={addNodes:function(e){this.inflight+=e.length,m(e,this.require,this),this.checkDone()},require:function(e){var t=h.nodeUrl(e);e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){return this.pending[e]?(this.pending[e].push(t),!0):this.cache[e]?(this.onload(e,t,a.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,t){var n=function(n,r){this.receive(e,t,n,r)}.bind(this);s.load(e,n)},receive:function(e,t,n,r){n||(a.cache[e]=r),a.pending[e].forEach(function(t){n||this.onload(e,t,r),this.tail()},this),a.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}};var f=["href","src","action"],p="["+f.join("],[")+"]",v="{{.*}}",h={nodeUrl:function(e){return h.resolveUrl(h.documentURL,h.hrefOrSrc(e))},hrefOrSrc:function(e){return e.getAttribute("href")||e.getAttribute("src")},documentUrlFromNode:function(e){return h.getDocumentUrl(e.ownerDocument||e)},getDocumentUrl:function(e){var t=e&&(e._URL||e.impl&&e.impl._URL||e.baseURI||e.URL)||"";return t.split("#")[0]},resolveUrl:function(e,t){return this.isAbsUrl(t)?t:this.compressUrl(this.urlToPath(e)+t)},resolveRelativeUrl:function(e,t){return this.isAbsUrl(t)?t:this.makeDocumentRelPath(this.resolveUrl(e,t))},isAbsUrl:function(e){return/(^data:)|(^http[s]?:)|(^\/)/.test(e)},urlToPath:function(e){var t=e.split("/");return t.pop(),t.push(""),t.join("/")},compressUrl:function(e){var t="",n=e.indexOf("?");n>-1&&(t=e.substring(n),e=e.substring(n,0));for(var r,o=e.split("/"),i=0;io;o++)r.unshift("..");var a=r.join("/");return a},resolvePathsInHTML:function(e,t){t=t||h.documentUrlFromNode(e),h.resolveAttributes(e,t),h.resolveStyleElts(e,t);var n=e.querySelectorAll("template");n&&m(n,function(e){e.content&&h.resolvePathsInHTML(e.content,t)})},resolvePathsInStylesheet:function(e){var t=h.nodeUrl(e);e.__resource=h.resolveCssText(e.__resource,t)},resolveStyleElts:function(e,t){var n=e.querySelectorAll("style");n&&m(n,function(e){e.textContent=h.resolveCssText(e.textContent,t)})},resolveCssText:function(e,t){return e.replace(/url\([^)]*\)/g,function(e){var n=e.replace(/["']/g,"").slice(4,-1);return n=h.resolveRelativeUrl(t,n),"url("+n+")"})},resolveAttributes:function(e,t){var n=e&&e.querySelectorAll(p);n&&m(n,function(e){this.resolveNodeAttributes(e,t)},this)},resolveNodeAttributes:function(e,t){f.forEach(function(n){var r=e.attributes[n];if(r&&r.value&&r.value.search(v)<0){var o=h.resolveRelativeUrl(t,r.value);r.value=o}})}};h.documentURL=h.getDocumentUrl(document),h.urlElt=document.createElement("a"),s=s||{async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(t,n,r){var o=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(t+="?"+Math.random()),o.open("GET",t,s.async),o.addEventListener("readystatechange",function(){4===o.readyState&&n.call(r,!s.ok(o)&&o,o.response,t)}),o.send(),o},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};var m=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.path=h,e.xhr=s,e.importer=l,e.getDocumentUrl=h.getDocumentUrl,e.IMPORT_LINK_TYPE=c}(window.HTMLImports),function(e){function t(e){return"link"===e.localName&&e.getAttribute("rel")===i}function n(e){return e.parentNode&&!r(e)&&!o(e)}function r(e){return e.ownerDocument===document||e.ownerDocument.impl===document}function o(e){return e.parentNode&&"element"===e.parentNode.localName}var i="import",a={selectors:["link[rel="+i+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(e){if(!e.__importParsed){e.__importParsed=!0;var t=e.querySelectorAll(a.selectors);s(t,function(e){a[a.map[e.localName]](e)})}},parseLink:function(e){t(e)?e.content&&a.parse(e.content):this.parseGeneric(e)},parseGeneric:function(e){n(e)&&document.head.appendChild(e)},parseScript:function(t){if(n(t)){var r=(t.__resource||t.textContent).trim();if(r){var o=t.__nodeUrl;if(!o){var o=e.path.documentUrlFromNode(t),i="["+Math.floor(1e3*(Math.random()+1))+"]",a=r.match(/Polymer\(['"]([^'"]*)/);i=a&&a[1]||i,o+="/"+i+".js"}r+="\n//# sourceURL="+o+"\n",eval.call(window,r)}}}},s=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.parser=a}(HTMLImports),function(){function e(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),"complete"===document.readyState?e():window.addEventListener("DOMContentLoaded",e)}(),function(){function e(e){return"link"===e.localName&&e.getAttribute("rel")===t}var t=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none",n={selectors:["link[rel="+t+"]"],map:{link:"parseLink"},parse:function(e){if(!e.__parsed){e.__parsed=!0;var t=e.querySelectorAll(n.selectors);r(t,function(e){n[n.map[e.localName]](e)}),CustomElements.upgradeDocument(e),CustomElements.observeDocument(e)}},parseLink:function(t){e(t)&&this.parseImport(t)},parseImport:function(e){e.content&&n.parse(e.content)}},r=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=n}(),function(){function e(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document);var e=window.Platform&&Platform.endOfMicrotask?Platform.endOfMicrotask:setTimeout;e(function(){CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}if("function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),"complete"===document.readyState)e();else{var t=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(t,e)}}(),function(){function e(e){var t=P.call(e);return S[t]||(S[t]=t.match(R)[1].toLowerCase())}function t(n,r){var o=t[r||e(n)];return o?o(n):n}function n(t){return-1==U.indexOf(e(t))?Array.prototype.slice.call(t,0):[t]}function r(e,t){return(t||I).length?n(e.querySelectorAll(t)):[]}function o(e,t){var n={added:[],removed:[]};t.forEach(function(t){t._mutation=!0;for(var r in n)for(var o=e._records["added"==r?"inserted":"removed"],i=t[r+"Nodes"],a=i.length,s=0;a>s&&-1==n[r].indexOf(i[s]);s++)n[r].push(i[s]),o.forEach(function(e){e(i[s],t)})})}function i(n,r,o){var i=e(o);return"object"==i&&"object"==e(n[r])?q.merge(n[r],o):n[r]=t(o,i),n}function a(e,t,n){var r={};for(var o in n)r[o.split(":")[0]]=!0;for(var i in t)r[i.split(":")[0]]||(n[i]=t[i])}function s(e){return e.mixins.forEach(function(t){var n=q.mixins[t];for(var r in n)switch(r){case"lifecycle":case"methods":a(r,n[r],e[r]);break;case"accessors":case"prototype":for(var o in n[r])a(o,n[r],e.accessors);break;case"events":}}),e}function c(e,t){var n=r(this,e.value).filter(function(e){return e==t.target||e.contains?e.contains(t.target):null})[0];return n?e.listener=e.listener.bind(n):null}function u(e){if(e.type.match("touch"))e.target.__touched__=!0;else if(e.target.__touched__&&e.type.match("mouse"))return delete e.target.__touched__,void 0;return!0}function l(e){var t="over"==e;return{attach:"OverflowEvent"in E?"overflowchanged":[],condition:function(n){return n.flow=e,n.type==e+"flow"||0===n.orient&&n.horizontalOverflow==t||1==n.orient&&n.verticalOverflow==t||2==n.orient&&n.horizontalOverflow==t&&n.verticalOverflow==t}}}function d(e,t,n,r){r?t[e]=n[e]:Object.defineProperty(t,e,{writable:!0,enumerable:!0,value:n[e]})}function f(e,t){var n=Object.getOwnPropertyDescriptor(e,"target");for(var r in t)j[r]||d(r,e,t,n);e.baseEvent=t}function p(e,t){return{value:e.boolean?"":t,method:e.boolean&&!t?"removeAttribute":"setAttribute"}}function v(e,t,n,r){var o=p(t,r);e[o.method](n,o.value)}function h(e,t,n,r,o){for(var i=t.property?[e.xtag[t.property]]:t.selector?q.query(e,t.selector):[],a=i.length;a--;)i[a][o](n,r)}function m(e,t,n){e.__view__&&e.__view__.updateBindingValue(e,t,n)}function _(e,t,n,r,o,i){var a=n.split(":"),s=a[0];if("get"==s)a[0]=t,e.prototype[t].get=q.applyPseudos(a.join(":"),r[n],e.pseudos);else if("set"==s){a[0]=t;var c=e.prototype[t].set=q.applyPseudos(a.join(":"),o?function(e){this.xtag._skipSet=!0,this.xtag._skipAttr||v(this,o,i,e),this.xtag._skipAttr&&o.skip&&delete this.xtag._skipAttr,r[n].call(this,o.boolean?!!e:e),m(this,i,e),delete this.xtag._skipSet}:r[n]?function(e){r[n].call(this,e),m(this,i,e)}:null,e.pseudos);o&&(o.setter=c)}else e.prototype[t][n]=r[n]}function g(e,t){e.prototype[t]={};var n=e.accessors[t],r=n.attribute,o=r&&r.name?r.name.toLowerCase():t;r&&(r.key=t,e.attributes[o]=r);for(var i in n)_(e,t,i,n,r,o);if(r){if(!e.prototype[t].get){var a=(r.boolean?"has":"get")+"Attribute";e.prototype[t].get=function(){return this[a](o)}}e.prototype[t].set||(e.prototype[t].set=function(e){v(this,r,o,e),m(this,o,e)})}}function b(e,t,n){e.__tap__||(e.__tap__={click:"mousedown"==n.type},e.__tap__.click?e.addEventListener("click",t.observer):(e.__tap__.scroll=t.observer.bind(e),window.addEventListener("scroll",e.__tap__.scroll,!0),e.addEventListener("touchmove",t.observer),e.addEventListener("touchcancel",t.observer),e.addEventListener("touchend",t.observer))),e.__tap__.click||(e.__tap__.x=n.touches[0].pageX,e.__tap__.y=n.touches[0].pageY)}function y(e,t){e.__tap__&&(e.__tap__.click?e.removeEventListener("click",t.observer):(window.removeEventListener("scroll",e.__tap__.scroll,!0),e.removeEventListener("touchmove",t.observer),e.removeEventListener("touchcancel",t.observer),e.removeEventListener("touchend",t.observer)),delete e.__tap__)}function w(e,t,n){var r=n.changedTouches[0];return r.pageXe.__tap__.x-t.gesture.tolerance&&r.pageYe.__tap__.y-t.gesture.tolerance?!0:void 0}var E=window,L=document,O=function(){},N=function(){return!0},k=/([\w-]+(?:\([^\)]+\))?)/g,A=/(\w*)(?:\(([^\)]*)\))?/,M=/(\d+)/g,T={action:function(e,t){return e.value.match(M).indexOf(String(t.keyCode))>-1==("keypass"==e.name)||null}},C=function(){var e=E.getComputedStyle(L.documentElement,""),t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return{dom:"ms"==t?"MS":t,lowercase:t,css:"-"+t+"-",js:"ms"==t?t:t[0].toUpperCase()+t.substr(1)}}(),D=Element.prototype.matchesSelector||Element.prototype[C.lowercase+"MatchesSelector"],x=E.MutationObserver||E[C.js+"MutationObserver"],S={},P=S.toString,R=/\s([a-zA-Z]+)/;t.object=function(e){var n={};for(var r in e)n[r]=t(e[r]);return n},t.array=function(e){for(var n=e.length,r=new Array(n);n--;)r[n]=t(e[n]);return r};var U=["undefined","null","number","boolean","string","function"],I="",j={};for(var H in document.createEvent("CustomEvent"))j[H]=1;var q={tags:{},defaultOptions:{pseudos:[],mixins:[],events:{},methods:{},accessors:{},lifecycle:{},attributes:{},prototype:{xtag:{get:function(){return this.__xtag__?this.__xtag__:this.__xtag__={data:{}}}}}},register:function(e,t){var r;if("string"==typeof e){r=e.toLowerCase();var o=t.prototype;delete t.prototype;var i=q.tags[r]=s(q.merge({},q.defaultOptions,t));for(var a in i.events)i.events[a]=q.parseEvent(a,i.events[a]);for(a in i.lifecycle)i.lifecycle[a.split(":")[0]]=q.applyPseudos(a,i.lifecycle[a],i.pseudos);for(a in i.methods)i.prototype[a.split(":")[0]]={value:q.applyPseudos(a,i.methods[a],i.pseudos),enumerable:!0};for(a in i.accessors)g(i,a);var c=i.lifecycle.created||i.lifecycle.ready;i.prototype.createdCallback={enumerable:!0,value:function(){var e=this;q.addEvents(this,i.events),i.mixins.forEach(function(t){q.mixins[t].events&&q.addEvents(e,q.mixins[t].events)});var t=c?c.apply(this,n(arguments)):null;for(var r in i.attributes){var o=i.attributes[r],a=this.hasAttribute(r);(a||o.boolean)&&(this[o.key]=o.boolean?a:this.getAttribute(r))}return i.pseudos.forEach(function(t){t.onAdd.call(e,t)}),t}},i.lifecycle.inserted&&(i.prototype.enteredViewCallback={value:i.lifecycle.inserted,enumerable:!0}),i.lifecycle.removed&&(i.prototype.leftDocumentCallback={value:i.lifecycle.removed,enumerable:!0}),i.lifecycle.attributeChanged&&(i.prototype.attributeChangedCallback={value:i.lifecycle.attributeChanged,enumerable:!0});var u=i.prototype.setAttribute||HTMLElement.prototype.setAttribute;i.prototype.setAttribute={writable:!0,enumberable:!0,value:function(e,t){var n=i.attributes[e.toLowerCase()];this.xtag._skipAttr||u.call(this,e,n&&n.boolean?"":t),n&&(n.setter&&!this.xtag._skipSet&&(this.xtag._skipAttr=!0,n.setter.call(this,n.boolean?!0:t)),t=n.skip?n.boolean?this.hasAttribute(e):this.getAttribute(e):t,h(this,n,e,n.boolean?"":t,"setAttribute")),delete this.xtag._skipAttr}};var l=i.prototype.removeAttribute||HTMLElement.prototype.removeAttribute;i.prototype.removeAttribute={writable:!0,enumberable:!0,value:function(e){var t=i.attributes[e.toLowerCase()];this.xtag._skipAttr||l.call(this,e),t&&(t.setter&&!this.xtag._skipSet&&(this.xtag._skipAttr=!0,t.setter.call(this,t.boolean?!1:void 0)),h(this,t,e,void 0,"removeAttribute")),delete this.xtag._skipAttr}};var d=o?o:t["extends"]?Object.create(L.createElement(t["extends"]).constructor).prototype:E.HTMLElement.prototype;return L.register(r,{"extends":t["extends"],prototype:Object.create(d,i.prototype)})}},mixins:{},prefix:C,touches:{active:[],changed:[]},captureEvents:["focus","blur","scroll","underflow","overflow","overflowchanged"],customEvents:{overflow:l("over"),underflow:l("under"),animationstart:{attach:[C.dom+"AnimationStart"]},animationend:{attach:[C.dom+"AnimationEnd"]},transitionend:{attach:[C.dom+"TransitionEnd"]},move:{attach:["mousemove","touchmove"],condition:u},enter:{attach:["mouseover","touchenter"],condition:u},leave:{attach:["mouseout","touchleave"],condition:u},tapstart:{observe:{mousedown:L,touchstart:L},condition:u},tapend:{observe:{mouseup:L,touchend:L},condition:u},tapmove:{attach:["tapstart","dragend","touchcancel"],condition:function(e,t){switch(e.type){case"move":return!0;case"dragover":var n=t.lastDrag||{};return t.lastDrag=e,n.pageX!=e.pageX&&n.pageY!=e.pageY||null;case"tapstart":t.touches=t.touches||1,t.move||(t.current=this,t.move=q.addEvents(this,{move:t.listener,dragover:t.listener}),t.tapend=q.addEvent(L,"tapend",t.listener));break;case"tapend":case"dragend":case"touchcancel":t.touches--,t.touches||(q.removeEvents(t.current,t.move||{}),q.removeEvent(L,t.tapend||{}),delete t.lastDrag,delete t.current,delete t.tapend,delete t.move)}}}},pseudos:{keypass:T,keyfail:T,delegate:{action:c},within:{action:c,onAdd:function(e){var t=e.source.condition;t&&(e.source.condition=function(n,r){return q.query(this,e.value).filter(function(e){return e==n.target||e.contains?e.contains(n.target):null})[0]?t.call(this,n,r):null})}},preventable:{action:function(e,t){return!t.defaultPrevented}}},clone:t,typeOf:e,toArray:n,wrap:function(e,t){return function(){var r=n(arguments),o=e.apply(this,r);return o===!1?!1:t.apply(this,"undefined"!=typeof o?n(o):r)}},merge:function(t,n,r){if("string"==e(n))return i(t,n,r);for(var o=1,a=arguments.length;a>o;o++){var s=arguments[o];for(var c in s)i(t,c,s[c])}return t},uid:function(){return Math.random().toString(36).substr(2,10)},query:r,skipTransition:function(e,t,n){var r=C.js+"TransitionProperty";e.style[r]=e.style.transitionProperty="none",q.requestFrame(function(){var o;t&&(o=t.call(n)),q.requestFrame(function(){e.style[r]=e.style.transitionProperty="",o&&q.requestFrame(o)})})},requestFrame:function(){var e=E.requestAnimationFrame||E[C.lowercase+"RequestAnimationFrame"]||function(e){return E.setTimeout(e,20)};return function(t){return e.call(E,t)}}(),matchSelector:function(e,t){return D.call(e,t)},set:function(e,t,n){e[t]=n,window.CustomElements&&CustomElements.upgradeAll(e)},innerHTML:function(e,t){q.set(e,"innerHTML",t)},hasClass:function(e,t){return e.className.split(" ").indexOf(t.trim())>-1},addClass:function(e,t){var n=e.className.trim().split(" ");return t.trim().split(" ").forEach(function(e){~n.indexOf(e)||n.push(e)}),e.className=n.join(" ").trim(),e},removeClass:function(e,t){var n=t.trim().split(" ");return e.className=e.className.trim().split(" ").filter(function(e){return e&&!~n.indexOf(e)}).join(" "),e},toggleClass:function(e,t){return q[q.hasClass(e,t)?"removeClass":"addClass"].call(null,e,t)},queryChildren:function(e,t){var r=e.id,o=e.id=r||"x_"+q.uid(),i="#"+o+" > ";t=i+(t+"").replace(",",","+i,"g");var a=e.parentNode.querySelectorAll(t);return r||e.removeAttribute("id"),n(a)},createFragment:function(e){var t=L.createDocumentFragment();if(e){for(var r=t.appendChild(L.createElement("div")),o=n(e.nodeName?arguments:!(r.innerHTML=e)||r.children),i=o.length,a=0;i>a;)t.insertBefore(o[a++],r);t.removeChild(r)}return t},manipulate:function(e,t){var n=e.nextSibling,r=e.parentNode,o=L.createDocumentFragment(),i=t.call(o.appendChild(e),o)||e;n?r.insertBefore(i,n):r.appendChild(i)},applyPseudos:function(e,t,r,o){var i=t,a={};if(e.match(":"))for(var s=e.match(k),c=s.length;--c;)s[c].replace(A,function(t,u,l){if(!q.pseudos[u])throw"pseudo not found: "+u+" "+s;var d=a[c]=Object.create(q.pseudos[u]);d.key=e,d.name=u,d.value=l,d.arguments=(l||"").split(","),d.action=d.action||N,d.source=o; +var f=i;i=function(){var t=n(arguments),r={key:e,name:u,value:l,source:o,listener:f},i=d.action.apply(this,[r].concat(t));return null===i||i===!1?i:r.listener.apply(this,t)},r&&d.onAdd&&(r.getAttribute?d.onAdd.call(r,d):r.push(d))});for(var u in a)a[u].onCompiled&&(i=a[u].onCompiled(i,a[u])||i);return i},removePseudos:function(e,t){t._pseudos.forEach(function(t){t.onRemove&&t.onRemove.call(e,t)})},parseEvent:function(e,t){var r=e.split(":"),o=r.shift(),i=q.customEvents[o],a=q.merge({type:o,stack:O,condition:N,attach:[],_attach:[],pseudos:"",_pseudos:[],onAdd:O,onRemove:O},i||{});a.attach=n(a.base||a.attach),a.chain=o+(a.pseudos.length?":"+a.pseudos:"")+(r.length?":"+r.join(":"):"");var s=a.condition;a.condition=function(e){return e.touches,e.targetTouches,s.apply(this,n(arguments))};var c=q.applyPseudos(a.chain,t,a._pseudos,a);if(a.stack=function(e){e.touches,e.targetTouches;var t=e.detail||{};return t.__stack__?t.__stack__==c?(e.stopPropagation(),e.cancelBubble=!0,c.apply(this,n(arguments))):void 0:c.apply(this,n(arguments))},a.listener=function(e){var t=n(arguments),r=a.condition.apply(this,t.concat([a]));return r?e.type==o?a.stack.apply(this,t):(q.fireEvent(e.target,o,{baseEvent:e,detail:{__stack__:c}}),void 0):r},a.attach.forEach(function(e){a._attach.push(q.parseEvent(e,a.listener))}),i&&i.observe&&!i.__observing__){i.observer=function(e){var t=a.condition.apply(this,n(arguments).concat([i]));return t?(q.fireEvent(e.target,o,{baseEvent:e}),void 0):t};for(var u in i.observe)q.addEvent(i.observe[u]||document,u,i.observer,!0);i.__observing__=!0}return a},addEvent:function(e,t,n,r){var o="function"==typeof n?q.parseEvent(t,n):n;return o._pseudos.forEach(function(t){t.onAdd.call(e,t)}),o._attach.forEach(function(t){q.addEvent(e,t.type,t)}),o.onAdd.call(e,o,o.listener),e.addEventListener(o.type,o.stack,r||q.captureEvents.indexOf(o.type)>-1),o},addEvents:function(e,t){var n={};for(var r in t)n[r]=q.addEvent(e,r,t[r]);return n},removeEvent:function(e,t,n){n=n||t,n.onRemove.call(e,n,n.listener),q.removePseudos(e,n),n._attach.forEach(function(t){q.removeEvent(e,t)}),e.removeEventListener(n.type,n.stack)},removeEvents:function(e,t){for(var n in t)q.removeEvent(e,t[n])},fireEvent:function(e,t,n,r){var o=L.createEvent("CustomEvent");n=n||{},r&&console.warn("fireEvent has been modified, more info here: "),o.initCustomEvent(t,n.bubbles!==!1,n.cancelable!==!1,n.detail),n.baseEvent&&f(o,n.baseEvent);try{e.dispatchEvent(o)}catch(i){console.warn("This error may have been caused by a change in the fireEvent method, more info here: ",i)}},addObserver:function(e,t,n){e._records||(e._records={inserted:[],removed:[]},x?(e._observer=new x(function(t){o(e,t)}),e._observer.observe(e,{subtree:!0,childList:!0,attributes:!1,characterData:!1})):["Inserted","Removed"].forEach(function(t){e.addEventListener("DOMNode"+t,function(n){n._mutation=!0,e._records[t.toLowerCase()].forEach(function(e){e(n.target,n)})},!1)})),-1==e._records[t].indexOf(n)&&e._records[t].push(n)},removeObserver:function(e,t,n){var r=e._records;r&&n?r[t].splice(r[t].indexOf(n),1):r[t]=[]}},F=0,V=null;L.addEventListener("mousedown",function(e){F++,V=e.target},!0),L.addEventListener("mouseup",function(){F--,V=null},!1);var Y={touches:{configurable:!0,get:function(){return this.__touches__||(this.identifier=0)||(this.__touches__=F?[this]:[])}},targetTouches:{configurable:!0,get:function(){return this.__targetTouches__||(this.__targetTouches__=F&&this.currentTarget&&(this.currentTarget==V||this.currentTarget.contains&&this.currentTarget.contains(V))?[this]:[])}},changedTouches:{configurable:!0,get:function(){return this.touches}}};for(H in Y)UIEvent.prototype[H]=Y[H],Object.defineProperty(UIEvent.prototype,H,Y[H]);var X={value:null,writable:!0,configurable:!0},B={touches:X,targetTouches:X,changedTouches:X};if(E.TouchEvent)for(H in B)E.TouchEvent.prototype[H]=B[H];q.customEvents.tap={observe:{mousedown:document,touchstart:document},gesture:{tolerance:8},condition:function(e,t){var n=e.target;switch(e.type){case"touchstart":return n.__tap__&&n.__tap__.click&&y(n,t),b(n,t,e),void 0;case"mousedown":return n.__tap__||b(n,t,e),void 0;case"scroll":case"touchcancel":return y(this,t),void 0;case"touchmove":case"touchend":return this.__tap__&&!w(this,t,e)?(y(this,t),void 0):"touchend"==e.type||null;case"click":return y(this,t),!0}}},E.xtag=q,"function"==typeof define&&define.amd&&define(q),L.addEventListener("WebComponentsReady",function(){q.fireEvent(L.body,"DOMComponentsLoaded")})}();!function(){xtag.register("x-appbar",{lifecycle:{created:function(){var e=xtag.queryChildren(this,"header")[0];e||(e=document.createElement("header"),this.appendChild(e)),this.xtag.data.header=e,this.subheading=this.subheading}},accessors:{heading:{attribute:{},get:function(){return this.xtag.data.header.innerHTML},set:function(e){this.xtag.data.header.innerHTML=e}},subheading:{attribute:{},get:function(){return this.getAttribute("subheading")||""},set:function(e){this.xtag.data.header.setAttribute("subheading",e)}}}})}();!function(){function e(e){var t;return 0===e.getUTCHours()?t=new Date(e.valueOf()):(t=new Date,t.setUTCHours(0),t.setUTCFullYear(e.getFullYear()),t.setUTCMonth(e.getMonth()),t.setUTCDate(e.getDate())),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t}function t(e,t){e.appendChild(t)}function n(e){return parseInt(e,10)}function r(e){var t=n(e);return t===e&&!isNaN(t)&&t>=0&&6>=t}function o(e){return e instanceof Date&&!!e.getTime&&!isNaN(e.getTime())}function i(e){return e&&e.isArray?e.isArray():"[object Array]"===Object.prototype.toString.call(e)}function a(e){var t=e.split("."),n=t.shift(),r=document.createElement(n);return r[Y]=t.join(" "),r}function s(){var e=document.documentElement,t={left:e.scrollLeft||document.body.scrollLeft||0,top:e.scrollTop||document.body.scrollTop||0,width:e.clientWidth,height:e.clientHeight};return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function u(e){var t=e.getBoundingClientRect(),n=s(),r=n.left,o=n.top;return{left:t.left+r,right:t.right+r,top:t.top+o,bottom:t.bottom+o,width:t.width,height:t.height}}function c(e,t){xtag.addClass(e,t)}function l(e,t){xtag.removeClass(e,t)}function d(e,t){return xtag.hasClass(e,t)}function f(e){return e.getUTCFullYear()}function h(e){return e.getUTCMonth()}function v(e){return e.getUTCDate()}function p(e){return e.getUTCDay()}function m(e,t){var n=e.toString(),r=new Array(t).join("0");return(r+n).substr(-t)}function g(e){return[m(f(e),4),m(h(e)+1,2),m(v(e),2)].join("-")}function b(t){if(o(t))return t;var n=z.exec(t);return n?e(new Date(n[1],n[2]-1,n[3])):null}function _(t){if(o(t))return t;var n=b(t);if(n)return n;var r=Date.parse(t);return isNaN(r)?null:e(new Date(r))}function y(e){var t;if(i(e))t=e.slice(0);else{if(o(e))return[e];if(!("string"==typeof e&&e.length>0))return null;try{if(t=JSON.parse(e),!i(t))return console.warn("invalid list of ranges",e),null}catch(n){var r=_(e);return r?[r]:(console.warn("unable to parse",e,"as JSON or single date"),null)}}for(var a=0;al.valueOf())return console.warn("invalid range",s,": start date is after end date"),null;t[a]=[c,l]}}return t}function w(t,n,r,o){return void 0===n&&(n=f(t)),void 0===r&&(r=h(t)),void 0===o&&(o=v(t)),e(new Date(n,r,o))}function E(e,t,n,r){return w(e,f(e)+t,h(e)+n,v(e)+r)}function x(e,t){t=n(t),r(t)||(t=0);for(var o=0;7>o;o++){if(p(e)===t)return e;e=A(e)}throw"unable to find week start"}function O(e,t){t=n(t),r(t)||(t=6);for(var o=0;7>o;o++){if(p(e)===t)return e;e=k(e)}throw"unable to find week end"}function T(t){return t=new Date(t.valueOf()),t.setUTCDate(1),e(t)}function N(e){return A(E(e,0,1,0))}function k(e){return E(e,0,0,1)}function A(e){return E(e,0,0,-1)}function M(e,t){if(t){t=void 0===t.length?[t]:t;var n=!1;return t.forEach(function(t){2===t.length?L(t[0],t[1],e)&&(n=!0):g(t)===g(e)&&(n=!0)}),n}}function L(e,t,n){return g(e)<=g(n)&&g(n)<=g(t)}function C(e){e.sort(function(e,t){var n=o(e)?e:e[0],r=o(t)?t:t[0];return n.valueOf()-r.valueOf()})}function D(e){var n=a("div.controls"),r=a("span.prev"),o=a("span.next");return r.innerHTML=e.prev,o.innerHTML=e.next,t(n,r),t(n,o),n}function S(e){var t=this;e=e||{},t._span=e.span||1,t._multiple=e.multiple||!1,t._viewDate=t._sanitizeViewDate(e.view,e.chosen),t._chosenRanges=t._sanitizeChosenRanges(e.chosen,e.view),t._firstWeekdayNum=e.firstWeekdayNum||0,t._el=a("div.calendar"),t._labels=H(),t._customRenderFn=null,t._renderRecursionFlag=!1,t.render(!0)}function j(e){e=e.slice(0),C(e);for(var t=[],n=0;n0?t[t.length-1]:null;if(o(u)?r=i=u:(r=u[0],i=u[1]),u=M(r,i)?r:[r,i],o(c))a=s=c;else{if(!c){t.push(u);continue}a=c[0],s=c[1]}if(M(r,[c])||M(A(r),[c])){var l=a.valueOf()i.valueOf()?s:i,f=M(l,d)?l:[l,d];t[t.length-1]=f}else t.push(u)}return t}function R(e,t){var n,r=t.getAttribute("data-date"),o=_(r);d(t,J)?(e.xtag.dragType=W,n="datetoggleoff"):(e.xtag.dragType=q,n="datetoggleon"),e.xtag.dragStartEl=t,e.xtag.dragAllowTap=!0,e.noToggle||xtag.fireEvent(e,n,{detail:{date:o,iso:r}}),e.setAttribute("active",!0),t.setAttribute("active",!0)}function U(e,t){var n=t.getAttribute("data-date"),r=_(n);t!==e.xtag.dragStartEl&&(e.xtag.dragAllowTap=!1),e.noToggle||(e.xtag.dragType!==q||d(t,J)?e.xtag.dragType===W&&d(t,J)&&xtag.fireEvent(e,"datetoggleoff",{detail:{date:r,iso:n}}):xtag.fireEvent(e,"datetoggleon",{detail:{date:r,iso:n}})),e.xtag.dragType&&t.setAttribute("active",!0)}function P(){for(var e=xtag.query(document,"x-calendar"),t=0;t",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}},F=e(new Date),q="add",W="remove",J="chosen",Y="className",z=/(\d{4})[^\d]?(\d{2})[^\d]?(\d{2})/,X=S.prototype;X.makeMonth=function(e){if(!o(e))throw"Invalid view date!";var n=this.firstWeekdayNum,r=this.chosen,i=this.labels,s=h(e),u=x(T(e),n),l=a("div.month"),d=a("div.month-label");d.textContent=i.months[s]+" "+f(e),t(l,d);for(var p=a("div.weekday-labels"),m=0;7>m;m++){var b=(n+m)%7,_=a("span.weekday-label");_.textContent=i.weekdays[b],t(p,_)}t(l,p);for(var y=a("div.week"),w=u,E=42,m=0;E>m;m++){var O=a("span.day");if(O.setAttribute("data-date",g(w)),O.textContent=v(w),h(w)!==s&&c(O,"badmonth"),M(w,r)&&c(O,J),M(w,F)&&c(O,"today"),t(y,O),w=k(w),0===(m+1)%7){t(l,y),y=a("div.week");var N=h(w)>s||h(w)f(u);if(N)break}}return l},X._sanitizeViewDate=function(e,t){t=void 0===t?this.chosen:t;var n;if(o(e))n=e;else if(o(t))n=t;else if(i(t)&&t.length>0){var r=t[0];n=o(r)?r:r[0]}else n=F;return n},X._sanitizeChosenRanges=function(e,t){t=void 0===t?this.view:t;var n;n=o(e)?[e]:i(e)?e:null!==e&&void 0!==e&&t?[t]:[];var r=j(n);if(!this.multiple&&r.length>0){var a=r[0];return o(a)?[a]:[a[0]]}return r},X.addDate=function(e,t){o(e)&&(t?(this.chosen.push(e),this.chosen=this.chosen):this.chosen=[e])},X.removeDate=function(e){if(o(e))for(var t=this.chosen.slice(0),n=0;nn;n++)t(this.el,this.makeMonth(u)),u=E(u,0,1,0)}this._callCustomRenderer()},X._callCustomRenderer=function(){if(this._customRenderFn){if(this._renderRecursionFlag)throw"Error: customRenderFn causes recursive loop of rendering calendar; make sure your custom rendering function doesn't modify attributes of the x-calendar that would require a re-render!";for(var e=xtag.query(this.el,".day"),t=0;t=0?t:0,this.render(!1)}},view:{attribute:{},get:function(){return this._viewDate},set:function(e){var t=this._sanitizeViewDate(e),n=this._viewDate;this._viewDate=t,this.render(h(n)===h(t)&&f(n)===f(t))}},chosen:{get:function(){return this._chosenRanges},set:function(e){this._chosenRanges=this._sanitizeChosenRanges(e),this.render(!0)}},firstWeekdayNum:{get:function(){return this._firstWeekdayNum},set:function(e){e=n(e),r(e)||(e=0),this._firstWeekdayNum=e,this.render(!1)}},lastWeekdayNum:{get:function(){return(this._firstWeekdayNum+6)%7}},customRenderFn:{get:function(){return this._customRenderFn},set:function(e){this._customRenderFn=e,this.render(!0)}},chosenString:{get:function(){if(this.multiple){for(var e=this.chosen.slice(0),t=0;t0?g(this.chosen[0]):""}},firstVisibleMonth:{get:function(){return T(E(this.view,0,-Math.floor(this.span/2),0))}},lastVisibleMonth:{get:function(){return E(this.firstVisibleMonth,0,Math.max(0,this.span-1),0)}},firstVisibleDate:{get:function(){return x(this.firstVisibleMonth,this.firstWeekdayNum)}},lastVisibleDate:{get:function(){return O(N(this.lastVisibleMonth),this.lastWeekdayNum)}},labels:{get:function(){return this._labels},set:function(e){var t=this.labels;for(var n in t)if(n in e){var r=this._labels[n],o=e[n];if(i(r)){if(!i(o)||r.length!==o.length)throw"invalid label given for '"+n+"': expected array of "+r.length+" labels, got "+JSON.stringify(o);o=o.slice(0);for(var a=0;a0){var t=e.currentTarget;if(t.xtag.dragType)for(var n=e.touches[0],r=xtag.query(t,".day"),o=0;o0){var t=e[0];return o(t)?t:t[0]}return null},set:function(e){var t=this.multiple?y(e):_(e);this.xtag.calObj.chosen=t?t:null,this.xtag.calObj.chosenString?this.setAttribute("chosen",this.xtag.calObj.chosenString):this.removeAttribute("chosen")}},firstWeekdayNum:{attribute:{name:"first-weekday-num"},set:function(e){this.xtag.calObj.firstWeekdayNum=e}},noToggle:{attribute:{"boolean":!0,name:"notoggle"},set:function(e){e&&(this.chosen=null)}},firstVisibleMonth:{get:function(){return this.xtag.calObj.firstVisibleMonth}},lastVisibleMonth:{get:function(){return this.xtag.calObj.lastVisibleMonth}},firstVisibleDate:{get:function(){return this.xtag.calObj.firstVisibleDate}},lastVisibleDate:{get:function(){return this.xtag.calObj.lastVisibleDate}},customRenderFn:{get:function(){return this.xtag.calObj.customRenderFn},set:function(e){this.xtag.calObj.customRenderFn=e}},labels:{get:function(){return JSON.parse(JSON.stringify(this.xtag.calObj.labels))},set:function(e){this.xtag.calObj.labels=e;var t=this.xtag.calObj.labels,n=this.querySelector(".controls > .prev");n&&(n.textContent=t.prev);var r=this.querySelector(".controls > .next");r&&(r.textContent=t.next)}}},methods:{render:function(e){this.xtag.calObj.render(e)},prevMonth:function(){var e=this.xtag.calObj;e.view=E(e.view,0,-1,0)},nextMonth:function(){var e=this.xtag.calObj;e.view=E(e.view,0,1,0)},toggleDateOn:function(e,t){this.xtag.calObj.addDate(e,t),this.chosen=this.chosen},toggleDateOff:function(e){this.xtag.calObj.removeDate(e),this.chosen=this.chosen},toggleDate:function(e,t){this.xtag.calObj.hasChosenDate(e)?this.toggleDateOff(e):this.toggleDateOn(e,t)},hasVisibleDate:function(e,t){return this.xtag.calObj.hasVisibleDate(e,t)}}})}();!function(){function t(t){return JSON.parse(JSON.stringify(t))}function e(t){var e;return 0===t.getUTCHours()?e=new Date(t.valueOf()):(e=new Date,e.setUTCHours(0),e.setUTCFullYear(t.getFullYear()),e.setUTCMonth(t.getMonth()),e.setUTCDate(t.getDate())),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}function n(t){return t instanceof Date&&!!t.getTime&&!isNaN(t.getTime())}function r(t){return t.getUTCFullYear()}function i(t){return t.getUTCMonth()}function o(t){return t.getUTCDate()}function a(t,e){var n=t.toString(),r=new Array(e).join("0");return(r+n).substr(-e)}function s(t){return[a(r(t),4),a(i(t)+1,2),a(o(t),2)].join("-")}function u(t){if(n(t))return t;var r=g.exec(t);return r?e(new Date(r[1],r[2]-1,r[3])):null}function l(t){if(n(t))return t;var r=u(t);if(r)return r;var i=Date.parse(t);return isNaN(i)?null:e(new Date(i))}function c(t){var e=t.polyfill?t.xtag.polyfillInput:t.xtag.dateInput,n=l(e.value);return n?t.removeAttribute("invalid"):t.setAttribute("invalid",!0),!!n}function d(t,e){var n=t.polyfill?t.xtag.polyfillInput:t.xtag.dateInput,r=n.value,i=l(r);t.value=e&&i?i:r}function f(t,e,n){var r=t.submitValue,i=t.value;e();var o=t.submitValue,a=t.value;(r!==o||n&&i!==a)&&xtag.fireEvent(t,"change")}function h(t){var e=t.xtag._labels;return new Array(5).join(e.yearAbbr)+"-"+new Array(3).join(e.monthAbbr)+"-"+new Array(3).join(e.dayAbbr)}var v=13,p=document.createElement("x-calendar").labels,g=/(\d{4})[^\d]?(\d{2})[^\d]?(\d{2})/;xtag.register("x-datepicker",{lifecycle:{created:function(){this.innerHTML="";var e=document.createElement("input");e.setAttribute("type","date"),xtag.addClass(e,"x-datepicker-input"),this.appendChild(e),this.xtag.dateInput=e,this.xtag._labels={yearAbbr:"Y",monthAbbr:"M",dayAbbr:"D"},this.xtag._polyfillCalLabels=t(p),this.xtag.polyfillInput=null,this.xtag.polyfillUI=null,this.polyfill=this.hasAttribute("polyfill")||"date"!==e.type.toLowerCase()}},events:{"datetoggleon:delegate(x-calendar)":function(t){var e=t.currentTarget;if(t.detail&&t.detail.date){var n=l(t.detail.date);f(e,function(){e.value=n?s(n):"",xtag.fireEvent(e,"input")})}},"datetoggleoff:delegate(x-calendar)":function(t){t.currentTarget.value=null},focus:function(t){t.currentTarget.setAttribute("focused",!0)},"blur:delegate(.x-datepicker-input)":function(t){t.currentTarget.removeAttribute("focused")},"blur:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.currentTarget;e.removeAttribute("focused"),f(e,function(){d(e,!0)},!0)},"touchstart:delegate(.x-datepicker-polyfill-input)":function(){this.setAttribute("readonly",!0)},"tapstart:delegate(x-calendar)":function(t){t.preventDefault(),t.baseEvent&&t.baseEvent.preventDefault()},"keypress:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.keyCode,n=t.currentTarget;e===v&&f(n,function(){d(n,!0)},!0)},"input:delegate(.x-datepicker-input)":function(t){var e=t.currentTarget;f(e,function(){d(e,!0),t.stopPropagation(),xtag.fireEvent(e,"input")})},"input:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.currentTarget;f(e,function(){d(e,!1),t.stopPropagation(),xtag.fireEvent(e,"input")})},"change:delegate(.x-datepicker-input)":function(t){t.stopPropagation(),xtag.fireEvent(t.currentTarget,"change")},"change:delegate(.x-datepicker-polyfill-input)":function(t){t.stopPropagation();var e=t.currentTarget;f(e,function(){d(e,!1)})}},accessors:{name:{attribute:{selector:".x-datepicker-input"},set:function(t){var e=this.xtag.dateInput;null===t||void 0===t?e.removeAttribute("name"):e.setAttribute("name",t)}},submitValue:{get:function(){return this.xtag.dateInput.value}},value:{attribute:{skip:!0},get:function(){return this.polyfill?this.xtag.polyfillInput.value:this.xtag.dateInput.value},set:function(t){var e=l(t),n=e?s(e):null,r=this.xtag.dateInput,i=this.xtag.polyfillInput,o=this.xtag.polyfillUI;if(null===t||void 0===t)this.removeAttribute("value"),r.value="",i&&(i.value=""),o&&(o.chosen=null);else{var a,u=n?n:t;i?t!==i.value?(i.value=u,a=u):a=t:a=u,this.setAttribute("value",a),n?(r.value=n,o&&(o.chosen=e,o.view=e)):(r.value="",o&&(o.chosen=null))}c(this)}},polyfill:{attribute:{"boolean":!0},set:function(t){var e=this.xtag.dateInput;if(t){if(e.setAttribute("type","hidden"),e.setAttribute("readonly",!0),!this.xtag.polyfillInput){var n=document.createElement("input");xtag.addClass(n,"x-datepicker-polyfill-input"),n.setAttribute("type","text"),n.setAttribute("placeholder",h(this)),n.value=this.xtag.dateInput.value,this.xtag.polyfillInput=n,this.appendChild(n)}if(this.xtag.polyfillInput.removeAttribute("disabled"),!this.xtag.polyfillUI){var r=document.createElement("x-calendar");xtag.addClass(r,"x-datepicker-polyfill-ui"),r.chosen=this.value,r.view=this.xtag.dateInput.value,r.controls=!0,r.labels=this.xtag._polyfillCalLabels,this.xtag.polyfillUI=r,this.appendChild(r)}}else{"date"!==e.getAttribute("type")&&e.setAttribute("type","date"),e.removeAttribute("readonly");var i=this.xtag.polyfillInput;i&&i.setAttribute("disabled",!0)}}},labels:{get:function(){var e={},n=this.xtag._labels,r=this.xtag._polyfillCalLabels;for(var i in n)e[i]=n[i];for(var i in r)e[i]=r[i];return t(e)},set:function(t){var e=this.xtag.polyfillUI,n=this.xtag.polyfillInput;if(e)e.labels=t,this.xtag._polyfillCalLabels=e.labels;else{var r=this.xtag._polyfillCalLabels;for(var i in r)i in t&&(r[i]=t[i])}var o=this.xtag._labels;for(var i in o)i in t&&(o[i]=t[i]);n&&n.setAttribute("placeholder",h(this))}}}})}();!function(){function t(t,e){this._historyStack=[],this.currIndex=-1,this._itemCap=void 0,this.itemCap=e,this._validatorFn=t?t:function(){return!0}}function e(t){var e=window.getComputedStyle(t),n=xtag.prefix.js+"TransitionDuration";return e.transitionDuration?e.transitionDuration:e[n]}function n(t){if("string"!=typeof t)return 0;var e=/^(\d*\.?\d+)(m?s)$/,n=t.toLowerCase().match(e);if(n){var r=n[1],i=n[2],a=parseFloat(r);if(isNaN(a))throw"value error";if("s"===i)return 1e3*a;if("ms"===i)return a;throw"unit error"}return 0}function r(t,e){return(t%e+e)%e}function i(t){return xtag.queryChildren(t,"x-card")}function a(t,e){var n=i(t);return isNaN(parseInt(e))||0>e||e>=n.length?null:n[e]}function o(t,e){var n=i(t);return n.indexOf(e)}function s(t,r,a,s,u){t.xtag._selectedCard=a;var c=new Date;t.xtag._lastAnimTimestamp=c;var h=function(){c===t.xtag._lastAnimTimestamp&&(l(t),xtag.fireEvent(t,"shuffleend",{detail:{oldCard:r,newCard:a}}))};if(a===r)return h(),void 0;var f=!1,v=!1,p=!1,g=function(){f&&v&&(i(t).forEach(function(t){t.removeAttribute("selected"),t.removeAttribute("leaving")}),r.setAttribute("leaving",!0),a.setAttribute("selected",!0),t.xtag._selectedCard=a,t.selectedIndex=o(t,a),u&&(r.setAttribute("reverse",!0),a.setAttribute("reverse",!0)),xtag.fireEvent(t,"shufflestart",{detail:{oldCard:r,newCard:a}}))},m=function(){p||f&&v&&b()},b=function(){p=!0;var t=!1,i=!1,o=!1,u=function(e){o||(e.target===r?(t=!0,r.removeEventListener("transitionend",u)):e.target===a&&(i=!0,a.removeEventListener("transitionend",u)),t&&i&&(o=!0,h()))};r.addEventListener("transitionend",u),a.addEventListener("transitionend",u);var c=n(e(r)),l=n(e(a)),f=Math.max(c,l),v=1.15,g="none"===s.toLowerCase()?0:Math.ceil(f*v);0===g?(o=!0,r.removeEventListener("transitionend",u),a.removeEventListener("transitionend",u),r.removeAttribute(d),a.removeAttribute(d),h()):(r.removeAttribute(d),a.removeAttribute(d),window.setTimeout(function(){o||(o=!0,r.removeEventListener("transitionend",u),a.removeEventListener("transitionend",u),h())},g))};xtag.skipTransition(r,function(){return r.setAttribute("card-anim-type",s),r.setAttribute(d,!0),f=!0,g(),m},this),xtag.skipTransition(a,function(){return a.setAttribute("card-anim-type",s),a.setAttribute(d,!0),v=!0,g(),m},this)}function u(t,e,n,r,a){var o=t.xtag._selectedCard;if(o===e){var u={detail:{oldCard:o,newCard:e}};return xtag.fireEvent(t,"shufflestart",u),xtag.fireEvent(t,"shuffleend",u),void 0}l(t),void 0===n&&(console.log("defaulting to none transition"),n="none");var c;switch(r){case"forward":c=!1;break;case"reverse":c=!0;break;default:o||(c=!1);var d=i(t);c=d.indexOf(e)0?t.xtag.history&&t.xtag.history.numStates>0?t.xtag.history.currState:e[0]:null),e.forEach(function(t){t.removeAttribute("leaving"),t.removeAttribute(d),t.removeAttribute("card-anim-type"),t.removeAttribute("reverse"),t!==n?t.removeAttribute("selected"):t.setAttribute("selected",!0)}),t.xtag._selectedCard=n,t.selectedIndex=o(t,n)}}var d="_before-animation",h=t.prototype;h.pushState=function(t){if(this.canRedo&&this._historyStack.splice(this.currIndex+1,this._historyStack.length-(this.currIndex+1)),this._historyStack.push(t),this.currIndex=this._historyStack.length-1,this.sanitizeStack(),"none"!==this._itemCap&&this._historyStack.length>this._itemCap){var e=this._historyStack.length;this._historyStack.splice(0,e-this._itemCap),this.currIndex=this._historyStack.length-1}},h.sanitizeStack=function(){for(var t,e=this._validatorFn,n=0;n=t)throw"attempted to set invalid item cap: "+t;this._itemCap=e}}},canUndo:{get:function(){return this.currIndex>0}},canRedo:{get:function(){return this.currIndex=0&&t-1&&this.shuffleTo(r(a+1,e.length),t)},shufflePrev:function(t){t=t?t:"auto";var e=i(this),n=this.xtag._selectedCard,a=e.indexOf(n);a>-1&&this.shuffleTo(r(a-1,e.length),t)},getAllCards:function(){return i(this)},getSelectedCard:function(){return this.xtag._selectedCard},getCardIndex:function(t){return o(this,t)},getCardAt:function(t){return a(this,t)},historyBack:function(t){var e=this.xtag.history;if(e.canUndo){e.backwards();var n=e.currState;n&&u(this,n,this.transitionType,t,!0)}},historyForward:function(t){var e=this.xtag.history;if(e.canRedo){e.forwards();var n=e.currState;n&&u(this,n,this.transitionType,t,!0)}}}}),xtag.register("x-card",{lifecycle:{inserted:function(){var t=this,e=t.parentNode;e&&"x-deck"===e.tagName.toLowerCase()&&(l(e),t.xtag.parentDeck=e,xtag.fireEvent(e,"cardadd",{detail:{card:t}}))},created:function(){var t=this.parentNode;t&&"x-deck"===t.tagName.toLowerCase()&&(this.xtag.parentDeck=t)},removed:function(){var t=this;if(t.xtag.parentDeck){var e=t.xtag.parentDeck;e.xtag.history.sanitizeStack(),l(e),xtag.fireEvent(e,"cardremove",{detail:{card:t}})}}},accessors:{transitionOverride:{attribute:{name:"transition-override"}}},methods:{show:function(){var t=this.parentNode;t===this.xtag.parentDeck&&t.shuffleTo(t.getCardIndex(this))}}})}();!function(){xtag.register("x-flipbox",{lifecycle:{created:function(){this.firstElementChild&&xtag.skipTransition(this.firstElementChild,function(){}),this.lastElementChild&&xtag.skipTransition(this.lastElementChild,function(){}),this.hasAttribute("direction")||(this.xtag._direction="right")}},events:{"transitionend:delegate(*:first-child)":function(t){var e=t.target,n=e.parentNode;"x-flipbox"===n.nodeName.toLowerCase()&&xtag.fireEvent(n,"flipend")},"show:delegate(*:first-child)":function(t){var e=t.target,n=e.parentNode;"x-flipbox"===n.nodeName.toLowerCase()&&(n.flipped=!1)},"show:delegate(*:last-child)":function(t){var e=t.target,n=e.parentNode;"x-flipbox"===n.nodeName.toLowerCase()&&(n.flipped=!0)}},accessors:{direction:{attribute:{},get:function(){return this.xtag._direction},set:function(t){xtag.skipTransition(this.firstElementChild,function(){this.setAttribute("_anim-direction",t)},this),xtag.skipTransition(this.lastElementChild,function(){this.setAttribute("_anim-direction",t)},this),this.xtag._direction=t}},flipped:{attribute:{"boolean":!0}}},methods:{toggle:function(){this.flipped=!this.flipped},showFront:function(){this.flipped=!1},showBack:function(){this.flipped=!0}}})}();!function(){function t(t,e){t.xtag.iconEl.nodeName===o?(e=void 0!==e?e:t.xtag.iconEl.src,e||(t.xtag.iconEl.src=a),t.xtag.iconEl.style.display=e&&e!==a?"":"none"):t.xtag.iconEl.style.display=t.xtag.iconEl.innerHTML?"":"none",t.xtag.contentEl.style.display=t.xtag.contentEl.innerHTML?"":"none"}function e(t){var e=t.xtag.iconEl,n=t.xtag.contentEl;if(n&&e){var r=e.parentNode;if(!r||n.parentNode!==r)throw"invalid parent node of iconbutton's icon / label";switch(t.iconAnchor){case"right":case"bottom":r.insertBefore(n,e);break;default:r.insertBefore(e,n)}}}function n(){xtag.query(document,"x-iconbutton[active]").forEach(function(t){t.removeAttribute("active")})}function r(){xtag.query(document,"x-iconbutton:focus").forEach(function(t){t.blur()})}function i(t){n(t),r()}var a="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",o=document.createElement("img").nodeName,s=function(t){return t.xtag.contentEl.textContent},u=function(t,e){t.xtag.contentEl.textContent=e},c=32,l=13,d=null;xtag.register("x-iconbutton",{lifecycle:{created:function(){var n=this.innerHTML;this.innerHTML="
"+""+"
"+"
",this.xtag.iconEl=this.querySelector(".x-iconbutton-icon"),this.xtag.contentEl=this.querySelector(".x-iconbutton-content"),this.xtag.contentEl.innerHTML=n,this.textGetter||(this.textGetter=s),this.textSetter||(this.textSetter=u),e(this),t(this),this.hasAttribute("tabindex")||this.setAttribute("tabindex",0)},inserted:function(){d||(d={tapend:xtag.addEvent(document,"tapend",i),dragend:xtag.addEvent(document,"dragend",i),keyup:xtag.addEvent(document,"keyup",n)}),e(this),t(this)},removed:function(){if(d&&!document.query("x-calendar")){for(var t in d)xtag.removeEvent(document,t,d[t]);d=null}},attributeChanged:function(){var n=this.iconEl,r=this.contentEl;n.parentNode&&n.parentNode.parentNode===this&&r.parentNode&&r.parentNode.parentNode===this||console.warn("inner DOM of the iconbutton appears to be out of sync; make sure that editing innerHTML or textContent is done through .contentEl, not directly on the iconbutton itself"),e(this),t(this)}},events:{tapstart:function(t){t.currentTarget.setAttribute("active",!0)},keypress:function(t){var e=t.key||t.keyCode;(e===c||e===l)&&t.currentTarget.click()},keydown:function(t){var e=t.key||t.keyCode;(e===c||e===l)&&t.currentTarget.setAttribute("active",!0)}},accessors:{src:{attribute:{},get:function(){return this.xtag.iconEl.getAttribute("src")},set:function(e){this.xtag.iconEl.setAttribute("src",e),this.xtag.iconEl.src=e,t(this,e)}},active:{attribute:{}},iconAnchor:{attribute:{name:"icon-anchor"},set:function(){e(this)}},iconEl:{get:function(){return this.xtag.iconEl}},contentEl:{get:function(){return this.xtag.contentEl}}}})}();!function(){function t(t){var e=t.firstElementChild;if(!e)return{header:null,section:null,footer:null};var n=e.nextElementSibling;return{header:"HEADER"==e.nodeName?e:null,section:"SECTION"==e.nodeName?e:n&&"SECTION"==n.nodeName?n:null,footer:"FOOTER"==t.lastElementChild.nodeName?t.lastElementChild:null}}function e(t,e){var n=e.__layoutScroll__=e.__layoutScroll__||Object.defineProperty(e,"__layoutScroll__",{value:{last:e.scrollTop}}).__layoutScroll__,r=e.scrollTop,i=t.scrollBuffer;return n.max=n.max||Math.max(r+i,i),n.min=n.min||Math.max(r-i,i),n}function n(t,e){t.setAttribute("content-maximizing",null),e.section&&(e.header&&(e.section.style.marginTop="-"+e.header.getBoundingClientRect().height+"px"),e.footer&&(e.section.style.marginBottom="-"+e.footer.getBoundingClientRect().height+"px"))}function r(t,e){t.removeAttribute("content-maximized"),t.removeAttribute("content-maximizing"),e.section&&(e.section.style.marginTop="",e.section.style.marginBottom="")}function i(i){if(!i.currentTarget.hasAttribute("content-maximizing")){var a=i.target,o=i.currentTarget;if(this.scrollhide&&(a.parentNode==o||xtag.matchSelector(a,o.scrollTarget))){var s=a.scrollTop,u=o.scrollBuffer,c=t(o),l=e(o,a);s>l.last?l.min=Math.max(s-u,u):sl.max&&!o.hasAttribute("content-maximized")?n(o,c):s x-slide[selected]")[0]||0;return[e?xtag.query(t,"x-slides > x-slide").indexOf(e):e,t.firstElementChild.children.length-1]}function e(t,e){var n=xtag.toArray(t.firstElementChild.children);n.forEach(function(t){t.removeAttribute("selected")}),n[e||0].setAttribute("selected",!0),t.firstElementChild.style[r]="translate"+(t.getAttribute("orientation")||"x")+"("+(e||0)*(-100/n.length)+"%)"}function n(t){var n=this.firstElementChild;if(n&&n.children.length&&"x-slides"==n.tagName.toLowerCase()){var i=xtag.toArray(n.children),a=100/(i.length||1),o=this.getAttribute("orientation")||"x",s="x"==o?["width","height"]:["height","width"];if(n.style[s[1]]="100%",n.style[s[0]]=100*i.length+"%",n.style[r]="translate"+o+"(0%)",i.forEach(function(t){t.style[s[0]]=a+"%",t.style[s[1]]="100%"}),t){var u=n.querySelector("[selected]");u&&e(this,i.indexOf(u)||0)}}}var r=xtag.prefix.js+"Transform";xtag.register("x-slidebox",{lifecycle:{created:function(){n()}},events:{transitionend:function(t){t.target==this.firstElementChild&&xtag.fireEvent(this,"slideend")},"show:delegate(x-slide)":function(t){var e=t.target;if("x-slides"===e.parentNode.nodeName.toLowerCase()&&"x-slidebox"===e.parentNode.parentNode.nodeName.toLowerCase()){var n=e.parentNode,r=n.parentNode,i=xtag.query(n,"x-slide");r.slideTo(i.indexOf(e))}}},accessors:{orientation:{get:function(){return this.getAttribute("orientation")},set:function(t){var e=this;xtag.skipTransition(e.firstElementChild,function(){e.setAttribute("orientation",t.toLowerCase()),n.call(e,!0)})}}},methods:{slideTo:function(t){e(this,t)},slideNext:function(){var n=t(this);n[0]++,e(this,n[0]>n[1]?0:n[0])},slidePrevious:function(){var n=t(this);n[0]--,e(this,n[0]<0?n[1]:n[0])}}}),xtag.register("x-slide",{lifecycle:{inserted:function(){var t=this.parentNode.parentNode;"x-slidebox"==t.tagName.toLowerCase()&&n.call(t,!0)},created:function(){if(this.parentNode){var t=this.parentNode.parentNode;"x-slidebox"==t.tagName.toLowerCase()&&n.call(t,!0)}}}})}();!function(){function t(t){return!isNaN(parseFloat(t))}function e(e,n){return e.hasAttribute(n)&&t(e.getAttribute(n))}function n(e,n,r,i){if(i=i?i:Math.round,r=t(r)?r:0,!t(e))throw"invalid value "+e;if(!t(n)||0>=+n)throw"invalid step "+n;return i((e-r)/n)*n+r}function r(t,e,r,i){return e>t?e:t>r?Math.max(e,n(r,i,e,Math.floor)):t}function i(t,e,i){var a=n((e-t)/2+t,i,t);return r(a,t,e,i)}function a(t,e){var n=t.min,r=t.max;return(e-n)/(r-n)}function o(t,e){var n=t.min,r=t.max;return(r-n)*e+n}function s(t,e){e=Math.min(Math.max(0,e),1);var i=o(t,e),a=n(i,t.step,t.min);return r(a,t.min,t.max,t.step)}function u(t,e){var n=t.xtag.polyFillSliderThumb;if(n){var r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=a(t,e),s=Math.max(r.width-i.width,0),u=s*o,c=u/r.width;n.style.left=100*c+"%"}}function c(t){u(t,t.value)}function l(t,e){var n=t.xtag.rangeInputEl,r=n.getBoundingClientRect(),i=e-r.left;t.value;var a=s(t,i/r.width);t.value=a,xtag.fireEvent(t,"input"),c(t)}function d(t,e,n){t.xtag.dragInitVal=t.value,l(t,e,n);var r=t.xtag.callbackFns,i=function(t,e){document.body.addEventListener(t,e)};i("mousemove",r.onMouseDragMove),i("touchmove",r.onTouchDragMove),i("mouseup",r.onDragEnd),i("touchend",r.onDragEnd);var a=t.xtag.polyFillSliderThumb;a&&a.setAttribute("active",!0)}function h(t,e,n){l(t,e,n)}function f(t){return{onMouseDragStart:function(e){e.button===g&&(d(t,e.pageX,e.pageY),e.preventDefault())},onTouchDragStart:function(e){var n=e.targetTouches;1===n.length&&(d(t,n[0].pageX,n[0].pageY),e.preventDefault())},onMouseDragMove:function(e){h(t,e.pageX,e.pageY),e.preventDefault()},onTouchDragMove:function(e){var n=e.targetTouches;1===n.length&&(h(t,n[0].pageX,n[0].pageY),e.preventDefault())},onDragEnd:function(e){var n=t.xtag.callbackFns,r=function(t,e){document.body.removeEventListener(t,e)};r("mousemove",n.onMouseDragMove),r("touchmove",n.onTouchDragMove),r("mouseup",n.onDragEnd),r("touchend",n.onDragEnd);var i=t.xtag.polyFillSliderThumb;i&&i.removeAttribute("active"),t.value!==t.xtag.dragInitVal&&xtag.fireEvent(t,"change"),t.xtag.dragInitVal=null,e.preventDefault()},onKeyDown:function(t){var e=t.keyCode;if(e in v){var n=this.value,r=this.min,i=this.max,a=this.step,o=Math.max(0,i-r),s=Math.max(o/10,a);switch(v[e]){case"LEFT_ARROW":case"DOWN_ARROW":this.value=Math.max(n-a,r);break;case"RIGHT_ARROW":case"UP_ARROW":this.value=Math.min(n+a,i);break;case"HOME":this.value=r;break;case"END":this.value=i;break;case"PAGE_DOWN":this.value=Math.max(n-s,r);break;case"PAGE_UP":this.value=Math.min(n+s,i)}this.value!==n&&xtag.fireEvent(this,"change"),t.preventDefault()}}}}var v={33:"PAGE_UP",34:"PAGE_DOWN",35:"END",36:"HOME",37:"LEFT_ARROW",38:"UP_ARROW",39:"RIGHT_ARROW",40:"DOWN_ARROW"},g=0;xtag.register("x-slider",{lifecycle:{created:function(){var t=this;t.xtag.callbackFns=f(t),t.xtag.dragInitVal=null;var n=document.createElement("input");xtag.addClass(n,"input"),n.setAttribute("type","range");var r=e(t,"max")?+t.getAttribute("max"):100,a=e(t,"min")?+t.getAttribute("min"):0,o=e(t,"step")?+t.getAttribute("step"):1;o=o>0?o:1;var s=e(t,"value")?+t.getAttribute("value"):i(a,r,o);n.setAttribute("max",r),n.setAttribute("min",a),n.setAttribute("step",o),n.setAttribute("value",s),t.xtag.rangeInputEl=n,t.appendChild(t.xtag.rangeInputEl),t.xtag.polyFillSliderThumb=null,"range"!==n.type||t.hasAttribute("polyfill")?t.setAttribute("polyfill",!0):t.removeAttribute("polyfill"),c(t)},attributeChanged:function(){c(this)}},events:{"change:delegate(input[type=range])":function(t){t.stopPropagation(),xtag.fireEvent(t.currentTarget,"change")},"input:delegate(input[type=range])":function(t){t.stopPropagation(),xtag.fireEvent(t.currentTarget,"input")},"focus:delegate(input[type=range])":function(t){var e=t.currentTarget;xtag.fireEvent(e,"focus",{},{bubbles:!1})},"blur:delegate(input[type=range])":function(t){var e=t.currentTarget;xtag.fireEvent(e,"blur",{},{bubbles:!1})}},accessors:{polyfill:{attribute:{"boolean":!0},set:function(t){var e=this.xtag.callbackFns;if(t){if(this.setAttribute("tabindex",0),this.xtag.rangeInputEl.setAttribute("tabindex",-1),this.xtag.rangeInputEl.setAttribute("readonly",!0),!this.xtag.polyFillSliderThumb){var n=document.createElement("span");xtag.addClass(n,"slider-thumb"),this.xtag.polyFillSliderThumb=n,this.appendChild(n)}c(this),this.addEventListener("mousedown",e.onMouseDragStart),this.addEventListener("touchstart",e.onTouchDragStart),this.addEventListener("keydown",e.onKeyDown)}else this.removeAttribute("tabindex"),this.xtag.rangeInputEl.removeAttribute("tabindex"),this.xtag.rangeInputEl.removeAttribute("readonly"),this.removeEventListener("mousedown",e.onMouseDragStart),this.removeEventListener("touchstart",e.onTouchDragStart),this.removeEventListener("keydown",e.onKeyDown)}},max:{attribute:{selector:"input[type=range]"},get:function(){return+this.xtag.rangeInputEl.getAttribute("max")}},min:{attribute:{selector:"input[type=range]"},get:function(){return+this.xtag.rangeInputEl.getAttribute("min")}},step:{attribute:{selector:"input[type=range]"},get:function(){return+this.xtag.rangeInputEl.getAttribute("step")}},name:{attribute:{selector:"input[type=range]"},set:function(t){var e=this.xtag.rangeInputEl;null===t||void 0===t?e.removeAttribute("name"):e.setAttribute("name",t)}},value:{attribute:{selector:"input[type=range]"},get:function(){return+this.xtag.rangeInputEl.value},set:function(e){t(e)||(e=i(this.min,this.max,this.step)),e=+e;var a=this.min,o=this.max,s=this.step,u=n(e,s,a),l=r(u,a,o,s);this.xtag.rangeInputEl.value=l,c(this)}},inputElem:{get:function(){return this.xtag.rangeInputEl}}},methods:{}})}();!function(){function t(){var t=document.documentElement,e={left:t.scrollLeft||document.body.scrollLeft||0,top:t.scrollTop||document.body.scrollTop||0,width:t.clientWidth,height:t.clientHeight};return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function e(e){var n=e.getBoundingClientRect(),r=t(),i=r.left,a=r.top;return{left:n.left+i,right:n.right+i,top:n.top+a,bottom:n.bottom+a,width:n.width,height:n.height}}function n(t,e,n){return n.left<=t&&t<=n.right&&n.top<=e&&e<=n.bottom}function r(t){if("x-tabbar"===t.parentNode.nodeName.toLowerCase()){var e=t.targetEvent,n=t.targetSelector?xtag.query(document,t.targetSelector):t.targetElems;n.forEach(function(t){xtag.fireEvent(t,e)})}}xtag.register("x-tabbar",{lifecycle:{created:function(){this.xtag.overallEventToFire="show"}},events:{"tap:delegate(x-tabbar-tab)":function(){var t=xtag.query(this.parentNode,"x-tabbar-tab[selected]");t.length&&t.forEach(function(t){t.removeAttribute("selected")}),this.setAttribute("selected",!0)}},accessors:{tabs:{get:function(){return xtag.queryChildren(this,"x-tabbar-tab")}},targetEvent:{attribute:{name:"target-event"},get:function(){return this.xtag.overallEventToFire},set:function(t){this.xtag.overallEventToFire=t}}},methods:{}}),xtag.register("x-tabbar-tab",{lifecycle:{created:function(){this.xtag.targetSelector=null,this.xtag.overrideTargetElems=null,this.xtag.targetEvent=null}},events:{tap:function(t){var i=t.currentTarget;if(t.changedTouches&&t.changedTouches.length>0){var a=t.changedTouches[0],o=e(i);n(a.pageX,a.pageY,o)&&r(i)}else r(i)}},accessors:{targetSelector:{attribute:{name:"target-selector"},get:function(){return this.xtag.targetSelector},set:function(t){this.xtag.targetSelector=t,t&&(this.xtag.overrideTargetElems=null)}},targetElems:{get:function(){return this.targetSelector?xtag.query(document,this.targetSelector):null!==this.xtag.overrideTargetElems?this.xtag.overrideTargetElems:[]},set:function(t){this.removeAttribute("target-selector"),this.xtag.overrideTargetElems=t}},targetEvent:{attribute:{name:"target-event"},get:function(){if(this.xtag.targetEvent)return this.xtag.targetEvent;if("x-tabbar"===this.parentNode.nodeName.toLowerCase())return this.parentNode.targetEvent;throw"tabbar-tab is missing event to fire"},set:function(t){this.xtag.targetEvent=t}}},methods:{}})}();!function(){function t(t){var e=t.xtag.inputEl.form;e?t.removeAttribute("x-toggle-no-form"):t.setAttribute("x-toggle-no-form",""),t.xtag.scope=t.parentNode?e||document:null}function e(t){var e={},n=t==document?"[x-toggle-no-form]":"";xtag.query(t,"x-toggle[name]"+n).forEach(function(r){var i=r.name;if(i&&!e[i]){var a=xtag.query(t,'x-toggle[name="'+i+'"]'+n),o=a.length>1?"radio":"checkbox";a.forEach(function(t){t.xtag&&t.xtag.inputEl&&(t.type=o)}),e[i]=!0}})}var n=!1;xtag.addEvents(document,{DOMComponentsLoaded:function(){e(document),xtag.toArray(document.forms).forEach(e)},WebComponentsReady:function(){e(document),xtag.toArray(document.forms).forEach(e)},keydown:function(t){n=t.shiftKey},keyup:function(t){n=t.shiftKey},"focus:delegate(x-toggle)":function(){this.setAttribute("focus","")},"blur:delegate(x-toggle)":function(){this.removeAttribute("focus")},"tap:delegate(x-toggle)":function(){if(n&&this.group){var t=this.groupToggles,e=this.xtag.scope.querySelector('x-toggle[group="'+this.group+'"][active]');if(e&&this!=e){var r=this,i=e.checked,a=t.indexOf(this),o=t.indexOf(e),s=Math.min(a,o),u=Math.max(a,o);t.slice(s,u).forEach(function(t){t!=r&&(t.checked=i)})}}},"change:delegate(x-toggle)":function(){var t=this.xtag.scope.querySelector('x-toggle[group="'+this.group+'"][active]');this.checked=n&&t&&this!=t?t.checked:this.xtag.inputEl.checked,this.group&&(this.groupToggles.forEach(function(t){t.active=!1}),this.active=!0)}}),xtag.register("x-toggle",{lifecycle:{created:function(){this.innerHTML='
',this.xtag.inputWrapEl=this.querySelector(".x-toggle-input-wrap"),this.xtag.inputEl=this.xtag.inputWrapEl.querySelector("input"),this.xtag.contentWrapEl=this.querySelector(".x-toggle-content-wrap"),this.xtag.checkEl=this.querySelector(".x-toggle-check"),this.xtag.contentEl=this.querySelector(".x-toggle-content"),this.type="checkbox",t(this);var e=this.getAttribute("name");e&&(this.xtag.inputEl.name=this.getAttribute("name")),this.hasAttribute("checked")&&(this.checked=!0)},inserted:function(){t(this),this.parentNode&&"x-togglegroup"===this.parentNode.nodeName.toLowerCase()&&(this.parentNode.hasAttribute("name")&&(this.name=this.parentNode.getAttribute("name")),this.parentNode.hasAttribute("group")&&(this.group=this.parentNode.getAttribute("group")),this.setAttribute("no-box",!0)),this.name&&e(this.xtag.scope)},removed:function(){e(this.xtag.scope),t(this)}},accessors:{noBox:{attribute:{name:"no-box","boolean":!0},set:function(){}},type:{attribute:{},set:function(t){this.xtag.inputEl.type=t}},label:{attribute:{},get:function(){return this.xtag.contentEl.innerHTML},set:function(t){this.xtag.contentEl.innerHTML=t}},active:{attribute:{"boolean":!0}},group:{attribute:{}},groupToggles:{get:function(){return xtag.query(this.xtag.scope,'x-toggle[group="'+this.group+'"]')}},name:{attribute:{skip:!0},get:function(){return this.getAttribute("name")},set:function(t){null===t?(this.removeAttribute("name"),this.type="checkbox"):this.setAttribute("name",t),this.xtag.inputEl.name=t,e(this.xtag.scope)}},checked:{get:function(){return this.xtag.inputEl.checked},set:function(t){var e=this.name,n="true"===t||t===!0;if(e){var r=this.xtag.scope==document?"[x-toggle-no-form]":"",i='x-toggle[checked][name="'+e+'"]'+r,a=this.xtag.scope.querySelector(i);a&&a.removeAttribute("checked")}this.xtag.inputEl.checked=n,n?this.setAttribute("checked",""):this.removeAttribute("checked")}},value:{attribute:{},get:function(){return this.xtag.inputEl.value},set:function(t){this.xtag.inputEl.value=t}}}})}();!function(){xtag.register("x-togglegroup",{lifecycle:{created:function(){this.options.forEach(function(t){this.name&&(t.name=this.name),this.group&&(t.group=this.group),t.noBox=!0}.bind(this))}},events:{},accessors:{name:{attribute:{selector:"x-toggle"},set:function(t){this.options.forEach(function(e){e.name=t})}},group:{attribute:{selector:"x-toggle"},set:function(t){this.options.forEach(function(e){e.group=t})}},options:{get:function(){return xtag.queryChildren(this,"x-toggle")}}},methods:{}})}();!function(){function t(t){return t in M}function e(){var t=document.documentElement,e={left:t.scrollLeft||document.body.scrollLeft||0,top:t.scrollTop||document.body.scrollTop||0,width:t.clientWidth,height:t.clientHeight};return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function n(t){var n=t.getBoundingClientRect(),r=e(),i=r.left,o=r.top;return{left:n.left+i,right:n.right+i,top:n.top+o,bottom:n.bottom+o,width:n.width,height:n.height}}function r(t,e){var e=void 0!==e?e:n(t);return{x:t.offsetWidth?e.width/t.offsetWidth:1,y:t.offsetHeight?e.height/t.offsetHeight:1}}function i(t,e){if(t.righto||d.bottom>a?u.push(c):s.push(c)}var h=s.length>0?s:u;return h[0].orient}function E(t){t.setAttribute("_force-display",!0)}function w(t){t.removeAttribute("_force-display")}function A(e,n){e.removeAttribute(P);var r=e.xtag.arrowEl,i=[];for(var o in M){r.setAttribute(R,M[o]);var a=T(e,n,o);a&&(E(e),v(e,n)||i.push({orient:o,rect:a}),w(e))}var s=_(e,i);return s||(s="top"),e.setAttribute(P,s),r.setAttribute(R,M[s]),t(s)&&s!==o?T(e,n,s):a}function T(i,o,a,s){if(!i.parentNode)return i.left="",i.top="",null;s=void 0===s?0:s;var u=i.xtag.arrowEl;if(!t(a))return A(i,o);var l=i.offsetParent?i.offsetParent:i.parentNode;s||(i.style.top="",i.style.left="",u.style.top="",u.style.left=""),E(i);var c=e(),d=n(l),g=r(l,d),p=l.clientWidth*g.x,v=l.clientHeight*g.y,_=n(o),C=_.width,k=_.height,N=n(i),S=r(i,N),O=N.width,L=N.height,M=N.width,D=N.height,I=(M-O)/2,R=(D-L)/2,P=u.offsetWidth*S.x,j=u.offsetHeight*S.y,U=45,F=m(P,j,U);P=F.width,j=F.height,"top"===a||"bottom"===a?j/=2:P/=2;var H=y(i,d),q=H.left,V=H.top,W=H.right-O,z=H.bottom-L,B={left:_.left+(C-O)/2,top:_.top+(k-L)/2},Y=B.left,J=B.top;if("top"===a)J=_.top-D-j,z-=j;else if("bottom"===a)J=_.top+k+j,z-=j;else if("left"===a)Y=_.left-M-P,W-=P;else{if("right"!==a)throw"invalid orientation "+a;Y=_.left+C+P,W-=P}var G=b(Y,q,W),X=b(J,V,z);G+=I,X+=R;var K,$,Z=function(t){if(!window.getComputedStyle||t===document||t===document.documentElement)return!1;var e;try{e=window.getComputedStyle(t)}catch(n){return!1}return e&&"fixed"===e.position},Q=h(o,Z);if(Q&&!f(i,Q))K=G-c.left,$=X-c.top,i.setAttribute("_target-fixed",!0);else{var te=x(G,X,window,l,g);K=te.left,$=te.top,i.removeAttribute("_target-fixed")}i.style.top=$+"px",i.style.left=K+"px";var ee,ne,re,ie,oe;"top"===a||"bottom"===a?(ie=(C-P)/2,oe=_.left-G,ee=O-P,ne=O,re="left"):(ie=(k-j)/2,oe=_.top-X,ee=L-j,ne=L,re="top");var ae=b(ie+oe,0,ee),se=ne?ae/ne:0;u.style[re]=100*se+"%";var ue=i.offsetWidth*S.x,le=i.offsetHeight*S.y,ce=l.clientWidth*g.x,de=l.clientHeight*g.y;w(i);var he=2;return he>s&&(O!==ue||L!==le||p!==ce||v!==de)?T(i,o,a,s+1):{left:G,top:X,width:ue,height:le,right:G+ue,bottom:X+le}}function C(t,e){e===t&&console.warn("The tooltip's target element is the tooltip itself! Is this intentional?");var n=t.xtag.arrowEl;n.parentNode||console.warn("The inner component DOM of the tooltip appears to be missing. Make sure to edit tooltip contents through the .contentEl property instead ofdirectly on the x-tooltip to avoid clobbering the component's internals.");var r=t.orientation,i=function(){w(t),t.setAttribute("visible",!0),xtag.fireEvent(t,"tooltipshown",{triggerElem:e})};e?(t.xtag.lastTargetElem=e,xtag.skipTransition(t,function(){return T(t,e,r),i})):(t.style.top="",t.style.left="",n.style.top="",n.style.left="",i())}function k(e){t(e.orientation)&&e.removeAttribute(P),e.hasAttribute("visible")&&(E(e),e.xtag._hideTransitionFlag=!0,e.removeAttribute("visible"))}function N(t){var e=t.xtag.cachedListeners;e.forEach(function(t){t.removeListener()}),t.xtag.cachedListeners=[],O.unregisterTooltip(t.triggerStyle,t)}function S(t,e,n){if(t.parentNode){(void 0===e||null===e)&&(e=t.targetSelector),(void 0===n||null===n)&&(n=t.triggerStyle);var r=p(t,e);-1===r.indexOf(t.xtag.lastTargetElem)&&(t.xtag.lastTargetElem=r.length>0?r[0]:null,T(t,t.xtag.lastTargetElem,t.orientation)),N(t);var i;if(n in L){var o=L[n];i=o(t,e)}else i=d(t,e,n),O.registerTooltip(n,t);i.forEach(function(t){t.attachListener()}),t.xtag.cachedListeners=i,k(t)}}var O,L,M={top:"down",bottom:"up",left:"right",right:"left"},D="_previousSibling",I="_nextSibling",R="arrow-direction",P="_auto-orientation";o.prototype.attachListener=function(){this._attachedFn||(this._attachedFn=xtag.addEvent(this.elem,this.eventType,this.listenerFn))},o.prototype.removeListener=function(){this._attachedFn&&(xtag.removeEvent(this.elem,this.eventType,this._attachedFn),this._attachedFn=null)},a.prototype.destroy=function(){this._cachedListener.removeListener(),this._cachedListener=null,this._tooltips=null},a.prototype.containsTooltip=function(t){return-1!==this._tooltips.indexOf(t)},a.prototype.addTooltip=function(t){this.containsTooltip(t)||this._tooltips.push(t)},a.prototype.removeTooltip=function(t){this.containsTooltip(t)&&this._tooltips.splice(this._tooltips.indexOf(t),1)},Object.defineProperties(a.prototype,{numTooltips:{get:function(){return this._tooltips.length}}}),s.prototype.registerTooltip=function(t,e){if(t in this.eventStructDict){var n=this.eventStructDict[t];n.containsTooltip(e)||n.addTooltip(e)}else this.eventStructDict[t]=new a(t),this.eventStructDict[t].addTooltip(e)},s.prototype.unregisterTooltip=function(t,e){if(t in this.eventStructDict&&this.eventStructDict[t].containsTooltip(e)){var n=this.eventStructDict[t];n.removeTooltip(e),0===n.numTooltips&&(n.destroy(),delete this.eventStructDict[t])}},O=new s,L={custom:function(){return[]},hover:function(t,e){var n=[],r=null,i=200,a=function(){r&&window.clearTimeout(r),r=null},s=g(function(e){a();var n=this,r=e.relatedTarget||e.toElement;f(r,t)||C(t,n)}),u=g(function(e){a();var n=e.relatedTarget||e.toElement;f(n,t)||(r=window.setTimeout(function(){"hover"===t.triggerStyle&&k(t)},i))}),l=c(t,e,"enter",s),d=c(t,e,"leave",u);n.push(l),n.push(d);var h=g(function(e){a();var n=e.relatedTarget||e.toElement,r=t.xtag.lastTargetElem;t.hasAttribute("visible")||!r||f(n,r)||C(t,r)}),p=g(function(e){a();var n=e.relatedTarget||e.toElement,o=t.xtag.lastTargetElem;o&&!f(n,o)&&(r=window.setTimeout(function(){"hover"===t.triggerStyle&&k(t)},i))});return n.push(new o(t,"enter",h)),n.push(new o(t,"leave",p)),n}},xtag.register("x-tooltip",{lifecycle:{created:function(){var t=this;t.xtag.contentEl=document.createElement("div"),t.xtag.arrowEl=document.createElement("span"),xtag.addClass(t.xtag.contentEl,"tooltip-content"),xtag.addClass(t.xtag.arrowEl,"tooltip-arrow"),t.xtag.contentEl.innerHTML=t.innerHTML,t.innerHTML="",t.appendChild(t.xtag.contentEl),t.appendChild(t.xtag.arrowEl),t.xtag._orientation="auto",t.xtag._targetSelector=D,t.xtag._triggerStyle="click";var e=p(t,t.xtag._targetSelector);t.xtag.lastTargetElem=e.length>0?e[0]:null,t.xtag.cachedListeners=[],t.xtag._hideTransitionFlag=!1,t.xtag._skipOuterClick=!1},inserted:function(){S(this,this.xtag._targetSelector,this.xtag._triggerStyle)},removed:function(){N(this)}},events:{transitionend:function(t){var e=t.currentTarget;e.xtag._hideTransitionFlag&&!e.hasAttribute("visible")&&(e.xtag._hideTransitionFlag=!1,xtag.fireEvent(e,"tooltiphidden")),w(e)}},accessors:{orientation:{attribute:{},get:function(){return this.xtag._orientation},set:function(e){e=e.toLowerCase();var n=this.querySelector(".tooltip-arrow"),r=null;t(e)?(r=M[e],n.setAttribute(R,r),this.removeAttribute(P)):n.removeAttribute(R),this.xtag._orientation=e,this.refreshPosition()}},triggerStyle:{attribute:{name:"trigger-style"},get:function(){return this.xtag._triggerStyle},set:function(t){S(this,this.targetSelector,t),this.xtag._triggerStyle=t}},targetSelector:{attribute:{name:"target-selector"},get:function(){return this.xtag._targetSelector},set:function(t){p(this,t),S(this,t,this.triggerStyle),this.xtag._targetSelector=t}},ignoreOuterTrigger:{attribute:{"boolean":!0,name:"ignore-outer-trigger"}},ignoreTooltipPointerEvents:{attribute:{"boolean":!0,name:"ignore-tooltip-pointer-events"}},allowOverflow:{attribute:{"boolean":!0,name:"allow-overflow"},set:function(){this.refreshPosition()}},contentEl:{get:function(){return this.xtag.contentEl},set:function(t){var e=this.xtag.contentEl;xtag.addClass(t,"tooltip-content"),this.replaceChild(t,e),this.xtag.contentEl=t,this.refreshPosition()}},presetTriggerStyles:{get:function(){var t=[];for(var e in L)t.push(e);return t}},targetElems:{get:function(){return p(this,this.targetSelector)}}},methods:{refreshPosition:function(){this.xtag.lastTargetElem&&T(this,this.xtag.lastTargetElem,this.orientation)},show:function(){C(this,this.xtag.lastTargetElem)},hide:function(){k(this)},toggle:function(){this.hasAttribute("visible")?this.hide():this.show()}}})}(); \ No newline at end of file diff --git a/dist/calendar/calendar.min.js b/dist/calendar/calendar.min.js index 65f92bbf..43ef1884 100644 --- a/dist/calendar/calendar.min.js +++ b/dist/calendar/calendar.min.js @@ -1 +1 @@ -!function(){function e(e){var t;return 0===e.getUTCHours()?t=new Date(e.valueOf()):(t=new Date,t.setUTCHours(0),t.setUTCFullYear(e.getFullYear()),t.setUTCMonth(e.getMonth()),t.setUTCDate(e.getDate())),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t}function t(e,t){e.appendChild(t)}function n(e){return parseInt(e,10)}function r(e){var t=n(e);return t===e&&!isNaN(t)&&t>=0&&6>=t}function o(e){return e instanceof Date&&!!e.getTime&&!isNaN(e.getTime())}function i(e){return e&&e.isArray?e.isArray():"[object Array]"===Object.prototype.toString.call(e)}function a(e){var t=e.split("."),n=t.shift(),r=document.createElement(n);return r[z]=t.join(" "),r}function s(){var e=document.documentElement,t={left:e.scrollLeft||document.body.scrollLeft||0,top:e.scrollTop||document.body.scrollTop||0,width:e.clientWidth,height:e.clientHeight};return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function u(e){var t=e.getBoundingClientRect(),n=s(),r=n.left,o=n.top;return{left:t.left+r,right:t.right+r,top:t.top+o,bottom:t.bottom+o,width:t.width,height:t.height}}function c(e,t){xtag.addClass(e,t)}function l(e,t){xtag.removeClass(e,t)}function d(e,t){return xtag.hasClass(e,t)}function h(e){return e.getUTCFullYear()}function f(e){return e.getUTCMonth()}function v(e){return e.getUTCDate()}function p(e){return e.getUTCDay()}function m(e,t){var n=e.toString(),r=new Array(t).join("0");return(r+n).substr(-t)}function g(e){return[m(h(e),4),m(f(e)+1,2),m(v(e),2)].join("-")}function b(t){if(o(t))return t;var n=J.exec(t);return n?e(new Date(n[1],n[2]-1,n[3])):null}function _(t){if(o(t))return t;var n=b(t);if(n)return n;var r=Date.parse(t);return isNaN(r)?null:e(new Date(r))}function y(e){var t;if(i(e))t=e.slice(0);else{if(o(e))return[e];if(!("string"==typeof e&&e.length>0))return null;try{if(t=JSON.parse(e),!i(t))return console.warn("invalid list of ranges",e),null}catch(n){var r=_(e);return r?[r]:(console.warn("unable to parse",e,"as JSON or single date"),null)}}for(var a=0;al.valueOf())return console.warn("invalid range",s,": start date is after end date"),null;t[a]=[c,l]}}return t}function w(t,n,r,o){return void 0===n&&(n=h(t)),void 0===r&&(r=f(t)),void 0===o&&(o=v(t)),e(new Date(n,r,o))}function E(e,t,n,r){return w(e,h(e)+t,f(e)+n,v(e)+r)}function x(e,t){t=n(t),r(t)||(t=0);for(var o=0;7>o;o++){if(p(e)===t)return e;e=A(e)}throw"unable to find week start"}function O(e,t){t=n(t),r(t)||(t=6);for(var o=0;7>o;o++){if(p(e)===t)return e;e=N(e)}throw"unable to find week end"}function T(t){return t=new Date(t.valueOf()),t.setUTCDate(1),e(t)}function k(e){return A(E(e,0,1,0))}function N(e){return E(e,0,0,1)}function A(e){return E(e,0,0,-1)}function D(e,t){if(t){t=void 0===t.length?[t]:t;var n=!1;return t.forEach(function(t){2===t.length?L(t[0],t[1],e)&&(n=!0):g(t)===g(e)&&(n=!0)}),n}}function L(e,t,n){return g(e)<=g(n)&&g(n)<=g(t)}function C(e){e.sort(function(e,t){var n=o(e)?e:e[0],r=o(t)?t:t[0];return n.valueOf()-r.valueOf()})}function M(e){var n=a("div.controls"),r=a("span.prev"),o=a("span.next");return r.innerHTML=e.prev,o.innerHTML=e.next,t(n,r),t(n,o),n}function S(e){var t=this;e=e||{},t._span=e.span||1,t._multiple=e.multiple||!1,t._viewDate=t._sanitizeViewDate(e.view,e.chosen),t._chosenRanges=t._sanitizeChosenRanges(e.chosen,e.view),t._firstWeekdayNum=e.firstWeekdayNum||0,t._el=a("div.calendar"),t._labels=F(),t._customRenderFn=null,t._renderRecursionFlag=!1,t.render(!0)}function j(e){e=e.slice(0),C(e);for(var t=[],n=0;n0?t[t.length-1]:null;if(o(u)?r=i=u:(r=u[0],i=u[1]),u=D(r,i)?r:[r,i],o(c))a=s=c;else{if(!c){t.push(u);continue}a=c[0],s=c[1]}if(D(r,[c])||D(A(r),[c])){var l=a.valueOf()i.valueOf()?s:i,h=D(l,d)?l:[l,d];t[t.length-1]=h}else t.push(u)}return t}function R(e,t){var n,r=t.getAttribute("data-date"),o=_(r);d(t,Y)?(e.xtag.dragType=W,n="datetoggleoff"):(e.xtag.dragType=q,n="datetoggleon"),e.xtag.dragStartEl=t,e.xtag.dragAllowTap=!0,e.noToggle||xtag.fireEvent(e,n,{detail:{date:o,iso:r}}),e.setAttribute("active",!0),t.setAttribute("active",!0)}function U(e,t){var n=t.getAttribute("data-date"),r=_(n);t!==e.xtag.dragStartEl&&(e.xtag.dragAllowTap=!1),e.noToggle||(e.xtag.dragType!==q||d(t,Y)?e.xtag.dragType===W&&d(t,Y)&&xtag.fireEvent(e,"datetoggleoff",{detail:{date:r,iso:n}}):xtag.fireEvent(e,"datetoggleon",{detail:{date:r,iso:n}})),e.xtag.dragType&&t.setAttribute("active",!0)}function P(){for(var e=xtag.query(document,"x-calendar"),t=0;t",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}},V=e(new Date),q="add",W="remove",Y="chosen",z="className",J=/(\d{4})[^\d]?(\d{2})[^\d]?(\d{2})/,X=S.prototype;X.makeMonth=function(e){if(!o(e))throw"Invalid view date!";var n=this.firstWeekdayNum,r=this.chosen,i=this.labels,s=f(e),u=x(T(e),n),l=a("div.month"),d=a("div.month-label");d.textContent=i.months[s]+" "+h(e),t(l,d);for(var p=a("div.weekday-labels"),m=0;7>m;m++){var b=(n+m)%7,_=a("span.weekday-label");_.textContent=i.weekdays[b],t(p,_)}t(l,p);for(var y=a("div.week"),w=u,E=42,m=0;E>m;m++){var O=a("span.day");if(O.setAttribute("data-date",g(w)),O.textContent=v(w),f(w)!==s&&c(O,"badmonth"),D(w,r)&&c(O,Y),D(w,V)&&c(O,"today"),t(y,O),w=N(w),0===(m+1)%7){t(l,y),y=a("div.week");var k=f(w)>s||f(w)h(u);if(k)break}}return l},X._sanitizeViewDate=function(e,t){t=void 0===t?this.chosen:t;var n;if(o(e))n=e;else if(o(t))n=t;else if(i(t)&&t.length>0){var r=t[0];n=o(r)?r:r[0]}else n=V;return n},X._sanitizeChosenRanges=function(e,t){t=void 0===t?this.view:t;var n;n=o(e)?[e]:i(e)?e:null!==e&&void 0!==e&&t?[t]:[];var r=j(n);if(!this.multiple&&r.length>0){var a=r[0];return o(a)?[a]:[a[0]]}return r},X.addDate=function(e,t){o(e)&&(t?(this.chosen.push(e),this.chosen=this.chosen):this.chosen=[e])},X.removeDate=function(e){if(o(e))for(var t=this.chosen.slice(0),n=0;nn;n++)t(this.el,this.makeMonth(u)),u=E(u,0,1,0)}this._callCustomRenderer()},X._callCustomRenderer=function(){if(this._customRenderFn){if(this._renderRecursionFlag)throw"Error: customRenderFn causes recursive loop of rendering calendar; make sure your custom rendering function doesn't modify attributes of the x-calendar that would require a re-render!";for(var e=xtag.query(this.el,".day"),t=0;t=0?t:0,this.render(!1)}},view:{attribute:{},get:function(){return this._viewDate},set:function(e){var t=this._sanitizeViewDate(e),n=this._viewDate;this._viewDate=t,this.render(f(n)===f(t)&&h(n)===h(t))}},chosen:{get:function(){return this._chosenRanges},set:function(e){this._chosenRanges=this._sanitizeChosenRanges(e),this.render(!0)}},firstWeekdayNum:{get:function(){return this._firstWeekdayNum},set:function(e){e=n(e),r(e)||(e=0),this._firstWeekdayNum=e,this.render(!1)}},lastWeekdayNum:{get:function(){return(this._firstWeekdayNum+6)%7}},customRenderFn:{get:function(){return this._customRenderFn},set:function(e){this._customRenderFn=e,this.render(!0)}},chosenString:{get:function(){if(this.multiple){for(var e=this.chosen.slice(0),t=0;t0?g(this.chosen[0]):""}},firstVisibleMonth:{get:function(){return T(E(this.view,0,-Math.floor(this.span/2),0))}},lastVisibleMonth:{get:function(){return E(this.firstVisibleMonth,0,Math.max(0,this.span-1),0)}},firstVisibleDate:{get:function(){return x(this.firstVisibleMonth,this.firstWeekdayNum)}},lastVisibleDate:{get:function(){return O(k(this.lastVisibleMonth),this.lastWeekdayNum)}},labels:{get:function(){return this._labels},set:function(e){var t=this.labels;for(var n in t)if(n in e){var r=this._labels[n],o=e[n];if(i(r)){if(!i(o)||r.length!==o.length)throw"invalid label given for '"+n+"': expected array of "+r.length+" labels, got "+JSON.stringify(o);o=o.slice(0);for(var a=0;a0){var t=e.currentTarget;if(t.xtag.dragType)for(var n=e.touches[0],r=xtag.query(t,".day"),o=0;o0){var t=e[0];return o(t)?t:t[0]}return null},set:function(e){var t=this.multiple?y(e):_(e);this.xtag.calObj.chosen=t?t:null,this.xtag.calObj.chosenString?this.setAttribute("chosen",this.xtag.calObj.chosenString):this.removeAttribute("chosen")}},firstWeekdayNum:{attribute:{name:"first-weekday-num"},set:function(e){this.xtag.calObj.firstWeekdayNum=e}},noToggle:{attribute:{"boolean":!0,name:"notoggle"},set:function(e){e&&(this.chosen=null)}},firstVisibleMonth:{get:function(){return this.xtag.calObj.firstVisibleMonth}},lastVisibleMonth:{get:function(){return this.xtag.calObj.lastVisibleMonth}},firstVisibleDate:{get:function(){return this.xtag.calObj.firstVisibleDate}},lastVisibleDate:{get:function(){return this.xtag.calObj.lastVisibleDate}},customRenderFn:{get:function(){return this.xtag.calObj.customRenderFn},set:function(e){this.xtag.calObj.customRenderFn=e}},labels:{get:function(){return JSON.parse(JSON.stringify(this.xtag.calObj.labels))},set:function(e){this.xtag.calObj.labels=e;var t=this.xtag.calObj.labels,n=this.querySelector(".controls > .prev");n&&(n.textContent=t.prev);var r=this.querySelector(".controls > .next");r&&(r.textContent=t.next)}}},methods:{render:function(e){this.xtag.calObj.render(e)},prevMonth:function(){var e=this.xtag.calObj;e.view=E(e.view,0,-1,0)},nextMonth:function(){var e=this.xtag.calObj;e.view=E(e.view,0,1,0)},toggleDateOn:function(e,t){this.xtag.calObj.addDate(e,t),this.chosen=this.chosen},toggleDateOff:function(e){this.xtag.calObj.removeDate(e),this.chosen=this.chosen},toggleDate:function(e,t){this.xtag.calObj.hasChosenDate(e)?this.toggleDateOff(e):this.toggleDateOn(e,t)},hasVisibleDate:function(e,t){return this.xtag.calObj.hasVisibleDate(e,t)}}})}(); \ No newline at end of file +!function(){function e(e){var t;return 0===e.getUTCHours()?t=new Date(e.valueOf()):(t=new Date,t.setUTCHours(0),t.setUTCFullYear(e.getFullYear()),t.setUTCMonth(e.getMonth()),t.setUTCDate(e.getDate())),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t}function t(e,t){e.appendChild(t)}function n(e){return parseInt(e,10)}function r(e){var t=n(e);return t===e&&!isNaN(t)&&t>=0&&6>=t}function o(e){return e instanceof Date&&!!e.getTime&&!isNaN(e.getTime())}function i(e){return e&&e.isArray?e.isArray():"[object Array]"===Object.prototype.toString.call(e)}function a(e){var t=e.split("."),n=t.shift(),r=document.createElement(n);return r[Y]=t.join(" "),r}function s(){var e=document.documentElement,t={left:e.scrollLeft||document.body.scrollLeft||0,top:e.scrollTop||document.body.scrollTop||0,width:e.clientWidth,height:e.clientHeight};return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function u(e){var t=e.getBoundingClientRect(),n=s(),r=n.left,o=n.top;return{left:t.left+r,right:t.right+r,top:t.top+o,bottom:t.bottom+o,width:t.width,height:t.height}}function c(e,t){xtag.addClass(e,t)}function l(e,t){xtag.removeClass(e,t)}function d(e,t){return xtag.hasClass(e,t)}function f(e){return e.getUTCFullYear()}function h(e){return e.getUTCMonth()}function v(e){return e.getUTCDate()}function p(e){return e.getUTCDay()}function m(e,t){var n=e.toString(),r=new Array(t).join("0");return(r+n).substr(-t)}function g(e){return[m(f(e),4),m(h(e)+1,2),m(v(e),2)].join("-")}function b(t){if(o(t))return t;var n=z.exec(t);return n?e(new Date(n[1],n[2]-1,n[3])):null}function _(t){if(o(t))return t;var n=b(t);if(n)return n;var r=Date.parse(t);return isNaN(r)?null:e(new Date(r))}function y(e){var t;if(i(e))t=e.slice(0);else{if(o(e))return[e];if(!("string"==typeof e&&e.length>0))return null;try{if(t=JSON.parse(e),!i(t))return console.warn("invalid list of ranges",e),null}catch(n){var r=_(e);return r?[r]:(console.warn("unable to parse",e,"as JSON or single date"),null)}}for(var a=0;al.valueOf())return console.warn("invalid range",s,": start date is after end date"),null;t[a]=[c,l]}}return t}function w(t,n,r,o){return void 0===n&&(n=f(t)),void 0===r&&(r=h(t)),void 0===o&&(o=v(t)),e(new Date(n,r,o))}function E(e,t,n,r){return w(e,f(e)+t,h(e)+n,v(e)+r)}function x(e,t){t=n(t),r(t)||(t=0);for(var o=0;7>o;o++){if(p(e)===t)return e;e=A(e)}throw"unable to find week start"}function O(e,t){t=n(t),r(t)||(t=6);for(var o=0;7>o;o++){if(p(e)===t)return e;e=k(e)}throw"unable to find week end"}function T(t){return t=new Date(t.valueOf()),t.setUTCDate(1),e(t)}function N(e){return A(E(e,0,1,0))}function k(e){return E(e,0,0,1)}function A(e){return E(e,0,0,-1)}function M(e,t){if(t){t=void 0===t.length?[t]:t;var n=!1;return t.forEach(function(t){2===t.length?L(t[0],t[1],e)&&(n=!0):g(t)===g(e)&&(n=!0)}),n}}function L(e,t,n){return g(e)<=g(n)&&g(n)<=g(t)}function C(e){e.sort(function(e,t){var n=o(e)?e:e[0],r=o(t)?t:t[0];return n.valueOf()-r.valueOf()})}function D(e){var n=a("div.controls"),r=a("span.prev"),o=a("span.next");return r.innerHTML=e.prev,o.innerHTML=e.next,t(n,r),t(n,o),n}function S(e){var t=this;e=e||{},t._span=e.span||1,t._multiple=e.multiple||!1,t._viewDate=t._sanitizeViewDate(e.view,e.chosen),t._chosenRanges=t._sanitizeChosenRanges(e.chosen,e.view),t._firstWeekdayNum=e.firstWeekdayNum||0,t._el=a("div.calendar"),t._labels=H(),t._customRenderFn=null,t._renderRecursionFlag=!1,t.render(!0)}function j(e){e=e.slice(0),C(e);for(var t=[],n=0;n0?t[t.length-1]:null;if(o(u)?r=i=u:(r=u[0],i=u[1]),u=M(r,i)?r:[r,i],o(c))a=s=c;else{if(!c){t.push(u);continue}a=c[0],s=c[1]}if(M(r,[c])||M(A(r),[c])){var l=a.valueOf()i.valueOf()?s:i,f=M(l,d)?l:[l,d];t[t.length-1]=f}else t.push(u)}return t}function R(e,t){var n,r=t.getAttribute("data-date"),o=_(r);d(t,J)?(e.xtag.dragType=W,n="datetoggleoff"):(e.xtag.dragType=q,n="datetoggleon"),e.xtag.dragStartEl=t,e.xtag.dragAllowTap=!0,e.noToggle||xtag.fireEvent(e,n,{detail:{date:o,iso:r}}),e.setAttribute("active",!0),t.setAttribute("active",!0)}function U(e,t){var n=t.getAttribute("data-date"),r=_(n);t!==e.xtag.dragStartEl&&(e.xtag.dragAllowTap=!1),e.noToggle||(e.xtag.dragType!==q||d(t,J)?e.xtag.dragType===W&&d(t,J)&&xtag.fireEvent(e,"datetoggleoff",{detail:{date:r,iso:n}}):xtag.fireEvent(e,"datetoggleon",{detail:{date:r,iso:n}})),e.xtag.dragType&&t.setAttribute("active",!0)}function P(){for(var e=xtag.query(document,"x-calendar"),t=0;t",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}},F=e(new Date),q="add",W="remove",J="chosen",Y="className",z=/(\d{4})[^\d]?(\d{2})[^\d]?(\d{2})/,X=S.prototype;X.makeMonth=function(e){if(!o(e))throw"Invalid view date!";var n=this.firstWeekdayNum,r=this.chosen,i=this.labels,s=h(e),u=x(T(e),n),l=a("div.month"),d=a("div.month-label");d.textContent=i.months[s]+" "+f(e),t(l,d);for(var p=a("div.weekday-labels"),m=0;7>m;m++){var b=(n+m)%7,_=a("span.weekday-label");_.textContent=i.weekdays[b],t(p,_)}t(l,p);for(var y=a("div.week"),w=u,E=42,m=0;E>m;m++){var O=a("span.day");if(O.setAttribute("data-date",g(w)),O.textContent=v(w),h(w)!==s&&c(O,"badmonth"),M(w,r)&&c(O,J),M(w,F)&&c(O,"today"),t(y,O),w=k(w),0===(m+1)%7){t(l,y),y=a("div.week");var N=h(w)>s||h(w)f(u);if(N)break}}return l},X._sanitizeViewDate=function(e,t){t=void 0===t?this.chosen:t;var n;if(o(e))n=e;else if(o(t))n=t;else if(i(t)&&t.length>0){var r=t[0];n=o(r)?r:r[0]}else n=F;return n},X._sanitizeChosenRanges=function(e,t){t=void 0===t?this.view:t;var n;n=o(e)?[e]:i(e)?e:null!==e&&void 0!==e&&t?[t]:[];var r=j(n);if(!this.multiple&&r.length>0){var a=r[0];return o(a)?[a]:[a[0]]}return r},X.addDate=function(e,t){o(e)&&(t?(this.chosen.push(e),this.chosen=this.chosen):this.chosen=[e])},X.removeDate=function(e){if(o(e))for(var t=this.chosen.slice(0),n=0;nn;n++)t(this.el,this.makeMonth(u)),u=E(u,0,1,0)}this._callCustomRenderer()},X._callCustomRenderer=function(){if(this._customRenderFn){if(this._renderRecursionFlag)throw"Error: customRenderFn causes recursive loop of rendering calendar; make sure your custom rendering function doesn't modify attributes of the x-calendar that would require a re-render!";for(var e=xtag.query(this.el,".day"),t=0;t=0?t:0,this.render(!1)}},view:{attribute:{},get:function(){return this._viewDate},set:function(e){var t=this._sanitizeViewDate(e),n=this._viewDate;this._viewDate=t,this.render(h(n)===h(t)&&f(n)===f(t))}},chosen:{get:function(){return this._chosenRanges},set:function(e){this._chosenRanges=this._sanitizeChosenRanges(e),this.render(!0)}},firstWeekdayNum:{get:function(){return this._firstWeekdayNum},set:function(e){e=n(e),r(e)||(e=0),this._firstWeekdayNum=e,this.render(!1)}},lastWeekdayNum:{get:function(){return(this._firstWeekdayNum+6)%7}},customRenderFn:{get:function(){return this._customRenderFn},set:function(e){this._customRenderFn=e,this.render(!0)}},chosenString:{get:function(){if(this.multiple){for(var e=this.chosen.slice(0),t=0;t0?g(this.chosen[0]):""}},firstVisibleMonth:{get:function(){return T(E(this.view,0,-Math.floor(this.span/2),0))}},lastVisibleMonth:{get:function(){return E(this.firstVisibleMonth,0,Math.max(0,this.span-1),0)}},firstVisibleDate:{get:function(){return x(this.firstVisibleMonth,this.firstWeekdayNum)}},lastVisibleDate:{get:function(){return O(N(this.lastVisibleMonth),this.lastWeekdayNum)}},labels:{get:function(){return this._labels},set:function(e){var t=this.labels;for(var n in t)if(n in e){var r=this._labels[n],o=e[n];if(i(r)){if(!i(o)||r.length!==o.length)throw"invalid label given for '"+n+"': expected array of "+r.length+" labels, got "+JSON.stringify(o);o=o.slice(0);for(var a=0;a0){var t=e.currentTarget;if(t.xtag.dragType)for(var n=e.touches[0],r=xtag.query(t,".day"),o=0;o0){var t=e[0];return o(t)?t:t[0]}return null},set:function(e){var t=this.multiple?y(e):_(e);this.xtag.calObj.chosen=t?t:null,this.xtag.calObj.chosenString?this.setAttribute("chosen",this.xtag.calObj.chosenString):this.removeAttribute("chosen")}},firstWeekdayNum:{attribute:{name:"first-weekday-num"},set:function(e){this.xtag.calObj.firstWeekdayNum=e}},noToggle:{attribute:{"boolean":!0,name:"notoggle"},set:function(e){e&&(this.chosen=null)}},firstVisibleMonth:{get:function(){return this.xtag.calObj.firstVisibleMonth}},lastVisibleMonth:{get:function(){return this.xtag.calObj.lastVisibleMonth}},firstVisibleDate:{get:function(){return this.xtag.calObj.firstVisibleDate}},lastVisibleDate:{get:function(){return this.xtag.calObj.lastVisibleDate}},customRenderFn:{get:function(){return this.xtag.calObj.customRenderFn},set:function(e){this.xtag.calObj.customRenderFn=e}},labels:{get:function(){return JSON.parse(JSON.stringify(this.xtag.calObj.labels))},set:function(e){this.xtag.calObj.labels=e;var t=this.xtag.calObj.labels,n=this.querySelector(".controls > .prev");n&&(n.textContent=t.prev);var r=this.querySelector(".controls > .next");r&&(r.textContent=t.next)}}},methods:{render:function(e){this.xtag.calObj.render(e)},prevMonth:function(){var e=this.xtag.calObj;e.view=E(e.view,0,-1,0)},nextMonth:function(){var e=this.xtag.calObj;e.view=E(e.view,0,1,0)},toggleDateOn:function(e,t){this.xtag.calObj.addDate(e,t),this.chosen=this.chosen},toggleDateOff:function(e){this.xtag.calObj.removeDate(e),this.chosen=this.chosen},toggleDate:function(e,t){this.xtag.calObj.hasChosenDate(e)?this.toggleDateOff(e):this.toggleDateOn(e,t)},hasVisibleDate:function(e,t){return this.xtag.calObj.hasVisibleDate(e,t)}}})}(); \ No newline at end of file diff --git a/dist/core/core.min.js b/dist/core/core.min.js index 3ca0a6fb..2ebfb806 100644 --- a/dist/core/core.min.js +++ b/dist/core/core.min.js @@ -1,2 +1,2 @@ -window.Platform={};var logFlags={};!function(){function e(e){if(this._element=e,e.className!=this._classCache){if(this._classCache=e.className,!this._classCache)return;var t,n=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(t=0;t>>0)+(t++ +"__")},SideTable.prototype={set:function(t,n){var r=t[this.name];r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0})},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){this.set(e,void 0)}}}(),function(e){function t(e){y.push(e),b||(b=!0,m(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){b=!1;var e=y;y=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=h.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=h.get(n);if(r)for(var o=0;o0){var o=n[r-1],i=f(o,e);if(i)return n[r-1]=i,void 0}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=h.get(e);t||h.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=h.get(e),n=0;n1?E.dom&&console.warn("inserted:",e.localName,"insert/remove count:",e.__inserted):e.enteredDocumentCallback&&(E.dom&&console.log("inserted:",e.localName),e.enteredDocumentCallback())),E.dom&&console.groupEnd())}function l(e){d(e),r(e,function(e){d(e)})}function d(e){(e.leftDocumentCallback||e.__upgraded__&&E.dom)&&(E.dom&&console.log("removed:",e.localName),p(e)||(e.__inserted=(e.__inserted||0)-1,e.__inserted>0&&(e.__inserted=0),e.__inserted<0?E.dom&&console.warn("removed:",e.localName,"insert/remove count:",e.__inserted):e.leftDocumentCallback&&e.leftDocumentCallback()))}function p(e){for(var t=e;t;){if(t==e.ownerDocument)return!0;t=t.parentNode||t.host}}function f(e){if(e.webkitShadowRoot&&!e.webkitShadowRoot.__watched){E.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.webkitShadowRoot;t;)v(t),t=t.olderShadowRoot}}function v(e){e.__watched||(g(e),e.__watched=!0)}function h(e){switch(e.localName){case"style":case"script":case"template":case void 0:return!0}}function m(e){if(E.dom){var t=e[0];if(t&&"childList"===t.type&&t.addedNodes&&t.addedNodes){for(var n=t.addedNodes[0];n&&n!==document&&!n.host;)n=n.parentNode;var r=n&&(n.URL||n._URL||n.host&&n.host.localName)||"";r=r.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,r||"")}e.forEach(function(e){"childList"===e.type&&(L(e.addedNodes,function(e){h(e)||a(e)}),L(e.removedNodes,function(e){h(e)||l(e)}))}),E.dom&&console.groupEnd()}function _(){m(w.takeRecords())}function g(e){w.observe(e,{childList:!0,subtree:!0})}function b(e){g(e)}function y(e){E.dom&&console.group("upgradeDocument: ",(e.URL||e._URL||"").split("/").pop()),a(e),E.dom&&console.groupEnd()}var E=window.logFlags||{},w=new MutationObserver(m),L=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.watchShadow=f,e.upgradeAll=a,e.upgradeSubtree=i,e.observeDocument=b,e.upgradeDocument=y,e.takeRecords=_}(window.CustomElements),function(e){function t(e){return r(e,c)}function n(e){return r(e,u)}function r(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function o(e){return"script"===e.localName}function i(e,t){var n=e;n instanceof Document||(n=document.implementation.createHTMLDocument(c),n.body.innerHTML=e),n._URL=t;var r=n.createElement("base");return r.setAttribute("href",document.baseURI||document.URL),n.head.appendChild(r),window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}e||(e=window.HTMLImports={flags:{}});var a,s=e.xhr,c="import",u="stylesheet",l={documents:{},cache:{},preloadSelectors:["link[rel="+c+"]","element link[rel="+u+"]","template","script[src]:not([type])",'script[src][type="text/javascript"]'].join(","),loader:function(e){return a=new d(l.loaded,e),a.cache=l.cache,a},load:function(e,t){a=l.loader(t),l.preload(e)},preload:function(e){var t=e.querySelectorAll(l.preloadSelectors);t=this.filterMainDocumentNodes(e,t),t=this.extractTemplateNodes(t),a.addNodes(t)},filterMainDocumentNodes:function(e,t){return e===document&&(t=Array.prototype.filter.call(t,function(e){return!o(e)})),t},extractTemplateNodes:function(e){var t=[];return e=Array.prototype.filter.call(e,function(e){if("template"===e.localName){if(e.content){var n=e.content.querySelectorAll("link[rel="+u+"]");n.length&&(t=t.concat(Array.prototype.slice.call(n,0)))}return!1}return!0}),t.length&&(e=e.concat(t)),e},loaded:function(e,r,o){if(t(r)){var a=l.documents[e];a||(a=i(o,e),h.resolvePathsInHTML(a),l.documents[e]=a,l.preload(a)),r.import={href:e,ownerNode:r,content:a},r.content=o=a}r.__resource=o,n(r)&&h.resolvePathsInStylesheet(r)}},d=function(e,t){this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={},this.cache={}};d.prototype={addNodes:function(e){this.inflight+=e.length,m(e,this.require,this),this.checkDone()},require:function(e){var t=h.nodeUrl(e);e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){return this.pending[e]?(this.pending[e].push(t),!0):this.cache[e]?(this.onload(e,t,a.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,t){var n=function(n,r){this.receive(e,t,n,r)}.bind(this);s.load(e,n)},receive:function(e,t,n,r){n||(a.cache[e]=r),a.pending[e].forEach(function(t){n||this.onload(e,t,r),this.tail()},this),a.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}};var p=["href","src","action"],f="["+p.join("],[")+"]",v="{{.*}}",h={nodeUrl:function(e){return h.resolveUrl(h.documentURL,h.hrefOrSrc(e))},hrefOrSrc:function(e){return e.getAttribute("href")||e.getAttribute("src")},documentUrlFromNode:function(e){return h.getDocumentUrl(e.ownerDocument||e)},getDocumentUrl:function(e){var t=e&&(e._URL||e.impl&&e.impl._URL||e.baseURI||e.URL)||"";return t.split("#")[0]},resolveUrl:function(e,t){return this.isAbsUrl(t)?t:this.compressUrl(this.urlToPath(e)+t)},resolveRelativeUrl:function(e,t){return this.isAbsUrl(t)?t:this.makeDocumentRelPath(this.resolveUrl(e,t))},isAbsUrl:function(e){return/(^data:)|(^http[s]?:)|(^\/)/.test(e)},urlToPath:function(e){var t=e.split("/");return t.pop(),t.push(""),t.join("/")},compressUrl:function(e){var t="",n=e.indexOf("?");n>-1&&(t=e.substring(n),e=e.substring(n,0));for(var r,o=e.split("/"),i=0;io;o++)r.unshift("..");var a=r.join("/");return a},resolvePathsInHTML:function(e,t){t=t||h.documentUrlFromNode(e),h.resolveAttributes(e,t),h.resolveStyleElts(e,t);var n=e.querySelectorAll("template");n&&m(n,function(e){e.content&&h.resolvePathsInHTML(e.content,t)})},resolvePathsInStylesheet:function(e){var t=h.nodeUrl(e);e.__resource=h.resolveCssText(e.__resource,t)},resolveStyleElts:function(e,t){var n=e.querySelectorAll("style");n&&m(n,function(e){e.textContent=h.resolveCssText(e.textContent,t)})},resolveCssText:function(e,t){return e.replace(/url\([^)]*\)/g,function(e){var n=e.replace(/["']/g,"").slice(4,-1);return n=h.resolveRelativeUrl(t,n),"url("+n+")"})},resolveAttributes:function(e,t){var n=e&&e.querySelectorAll(f);n&&m(n,function(e){this.resolveNodeAttributes(e,t)},this)},resolveNodeAttributes:function(e,t){p.forEach(function(n){var r=e.attributes[n];if(r&&r.value&&r.value.search(v)<0){var o=h.resolveRelativeUrl(t,r.value);r.value=o}})}};h.documentURL=h.getDocumentUrl(document),h.urlElt=document.createElement("a"),s=s||{async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(t,n,r){var o=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(t+="?"+Math.random()),o.open("GET",t,s.async),o.addEventListener("readystatechange",function(){4===o.readyState&&n.call(r,!s.ok(o)&&o,o.response,t)}),o.send(),o},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};var m=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.path=h,e.xhr=s,e.importer=l,e.getDocumentUrl=h.getDocumentUrl,e.IMPORT_LINK_TYPE=c}(window.HTMLImports),function(e){function t(e){return"link"===e.localName&&e.getAttribute("rel")===i}function n(e){return e.parentNode&&!r(e)&&!o(e)}function r(e){return e.ownerDocument===document||e.ownerDocument.impl===document}function o(e){return e.parentNode&&"element"===e.parentNode.localName}var i="import",a={selectors:["link[rel="+i+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(e){if(!e.__importParsed){e.__importParsed=!0;var t=e.querySelectorAll(a.selectors);s(t,function(e){a[a.map[e.localName]](e)})}},parseLink:function(e){t(e)?e.content&&a.parse(e.content):this.parseGeneric(e)},parseGeneric:function(e){n(e)&&document.head.appendChild(e)},parseScript:function(t){if(n(t)){var r=(t.__resource||t.textContent).trim();if(r){var o=t.__nodeUrl;if(!o){var o=e.path.documentUrlFromNode(t),i="["+Math.floor(1e3*(Math.random()+1))+"]",a=r.match(/Polymer\(['"]([^'"]*)/);i=a&&a[1]||i,o+="/"+i+".js"}r+="\n//# sourceURL="+o+"\n",eval.call(window,r)}}}},s=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.parser=a}(HTMLImports),function(){function e(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),"complete"===document.readyState?e():window.addEventListener("DOMContentLoaded",e)}(),function(){function e(e){return"link"===e.localName&&e.getAttribute("rel")===t}var t=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none",n={selectors:["link[rel="+t+"]"],map:{link:"parseLink"},parse:function(e){if(!e.__parsed){e.__parsed=!0;var t=e.querySelectorAll(n.selectors);r(t,function(e){n[n.map[e.localName]](e)}),CustomElements.upgradeDocument(e),CustomElements.observeDocument(e)}},parseLink:function(t){e(t)&&this.parseImport(t)},parseImport:function(e){e.content&&n.parse(e.content)}},r=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=n}(),function(){function e(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document);var e=window.Platform&&Platform.endOfMicrotask?Platform.endOfMicrotask:setTimeout;e(function(){CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}if("function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),"complete"===document.readyState)e();else{var t=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(t,e)}}(),function(){function e(e){var t=P.call(e);return S[t]||(S[t]=t.match(R)[1].toLowerCase())}function t(n,r){var o=t[r||e(n)];return o?o(n):n}function n(t){return-1==U.indexOf(e(t))?Array.prototype.slice.call(t,0):[t]}function r(e,t){return(t||j).length?n(e.querySelectorAll(t)):[]}function o(e,t){var n={added:[],removed:[]};t.forEach(function(t){t._mutation=!0;for(var r in n)for(var o=e._records["added"==r?"inserted":"removed"],i=t[r+"Nodes"],a=i.length,s=0;a>s&&-1==n[r].indexOf(i[s]);s++)n[r].push(i[s]),o.forEach(function(e){e(i[s],t)})})}function i(n,r,o){var i=e(o);return"object"==i&&"object"==e(n[r])?q.merge(n[r],o):n[r]=t(o,i),n}function a(e,t,n){var r={};for(var o in n)r[o.split(":")[0]]=!0;for(var i in t)r[i.split(":")[0]]||(n[i]=t[i])}function s(e){return e.mixins.forEach(function(t){var n=q.mixins[t];for(var r in n)switch(r){case"lifecycle":case"methods":a(r,n[r],e[r]);break;case"accessors":case"prototype":for(var o in n[r])a(o,n[r],e.accessors);break;case"events":}}),e}function c(e,t){var n=r(this,e.value).filter(function(e){return e==t.target||e.contains?e.contains(t.target):null})[0];return n?e.listener=e.listener.bind(n):null}function u(e){if(e.type.match("touch"))e.target.__touched__=!0;else if(e.target.__touched__&&e.type.match("mouse"))return delete e.target.__touched__,void 0;return!0}function l(e){var t="over"==e;return{attach:"OverflowEvent"in w?"overflowchanged":[],condition:function(n){return n.flow=e,n.type==e+"flow"||0===n.orient&&n.horizontalOverflow==t||1==n.orient&&n.verticalOverflow==t||2==n.orient&&n.horizontalOverflow==t&&n.verticalOverflow==t}}}function d(e,t,n,r){r?t[e]=n[e]:Object.defineProperty(t,e,{writable:!0,enumerable:!0,value:n[e]})}function p(e,t){var n=Object.getOwnPropertyDescriptor(e,"target");for(var r in t)I[r]||d(r,e,t,n);e.baseEvent=t}function f(e,t){return{value:e.boolean?"":t,method:e.boolean&&!t?"removeAttribute":"setAttribute"}}function v(e,t,n,r){var o=f(t,r);e[o.method](n,o.value)}function h(e,t,n,r,o){for(var i=t.property?[e.xtag[t.property]]:t.selector?q.query(e,t.selector):[],a=i.length;a--;)i[a][o](n,r)}function m(e,t,n){e.__view__&&e.__view__.updateBindingValue(e,t,n)}function _(e,t,n,r,o,i){var a=n.split(":"),s=a[0];if("get"==s)a[0]=t,e.prototype[t].get=q.applyPseudos(a.join(":"),r[n],e.pseudos);else if("set"==s){a[0]=t;var c=e.prototype[t].set=q.applyPseudos(a.join(":"),o?function(e){this.xtag._skipSet=!0,this.xtag._skipAttr||v(this,o,i,e),this.xtag._skipAttr&&o.skip&&delete this.xtag._skipAttr,r[n].call(this,o.boolean?!!e:e),m(this,i,e),delete this.xtag._skipSet}:r[n]?function(e){r[n].call(this,e),m(this,i,e)}:null,e.pseudos);o&&(o.setter=c)}else e.prototype[t][n]=r[n]}function g(e,t){e.prototype[t]={};var n=e.accessors[t],r=n.attribute,o=r&&r.name?r.name.toLowerCase():t;r&&(r.key=t,e.attributes[o]=r);for(var i in n)_(e,t,i,n,r,o);if(r){if(!e.prototype[t].get){var a=(r.boolean?"has":"get")+"Attribute";e.prototype[t].get=function(){return this[a](o)}}e.prototype[t].set||(e.prototype[t].set=function(e){v(this,r,o,e),m(this,o,e)})}}function b(e,t,n){e.__tap__||(e.__tap__={click:"mousedown"==n.type},e.__tap__.click?e.addEventListener("click",t.observer):(e.__tap__.scroll=t.observer.bind(e),window.addEventListener("scroll",e.__tap__.scroll,!0),e.addEventListener("touchmove",t.observer),e.addEventListener("touchcancel",t.observer),e.addEventListener("touchend",t.observer))),e.__tap__.click||(e.__tap__.x=n.touches[0].pageX,e.__tap__.y=n.touches[0].pageY)}function y(e,t){e.__tap__&&(e.__tap__.click?e.removeEventListener("click",t.observer):(window.removeEventListener("scroll",e.__tap__.scroll,!0),e.removeEventListener("touchmove",t.observer),e.removeEventListener("touchcancel",t.observer),e.removeEventListener("touchend",t.observer)),delete e.__tap__)}function E(e,t,n){var r=n.changedTouches[0];return r.pageXe.__tap__.x-t.gesture.tolerance&&r.pageYe.__tap__.y-t.gesture.tolerance?!0:void 0}var w=window,L=document,k=function(){},N=function(){return!0},O=/([\w-]+(?:\([^\)]+\))?)/g,A=/(\w*)(?:\(([^\)]*)\))?/,T=/(\d+)/g,C={action:function(e,t){return e.value.match(T).indexOf(String(t.keyCode))>-1==("keypass"==e.name)||null}},M=function(){var e=w.getComputedStyle(L.documentElement,""),t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return{dom:"ms"==t?"MS":t,lowercase:t,css:"-"+t+"-",js:"ms"==t?t:t[0].toUpperCase()+t.substr(1)}}(),D=Element.prototype.matchesSelector||Element.prototype[M.lowercase+"MatchesSelector"],x=w.MutationObserver||w[M.js+"MutationObserver"],S={},P=S.toString,R=/\s([a-zA-Z]+)/;t.object=function(e){var n={};for(var r in e)n[r]=t(e[r]);return n},t.array=function(e){for(var n=e.length,r=new Array(n);n--;)r[n]=t(e[n]);return r};var U=["undefined","null","number","boolean","string","function"],j="",I={};for(var H in document.createEvent("CustomEvent"))I[H]=1;var q={tags:{},defaultOptions:{pseudos:[],mixins:[],events:{},methods:{},accessors:{},lifecycle:{},attributes:{},prototype:{xtag:{get:function(){return this.__xtag__?this.__xtag__:this.__xtag__={data:{}}}}}},register:function(e,t){var r;if("string"==typeof e){r=e.toLowerCase();var o=t.prototype;delete t.prototype;var i=q.tags[r]=s(q.merge({},q.defaultOptions,t));for(var a in i.events)i.events[a]=q.parseEvent(a,i.events[a]);for(a in i.lifecycle)i.lifecycle[a.split(":")[0]]=q.applyPseudos(a,i.lifecycle[a],i.pseudos);for(a in i.methods)i.prototype[a.split(":")[0]]={value:q.applyPseudos(a,i.methods[a],i.pseudos),enumerable:!0};for(a in i.accessors)g(i,a);var c=i.lifecycle.created||i.lifecycle.ready;i.prototype.createdCallback={enumerable:!0,value:function(){var e=this;q.addEvents(this,i.events),i.mixins.forEach(function(t){q.mixins[t].events&&q.addEvents(e,q.mixins[t].events)});var t=c?c.apply(this,n(arguments)):null;for(var r in i.attributes){var o=i.attributes[r],a=this.hasAttribute(r);(a||o.boolean)&&(this[o.key]=o.boolean?a:this.getAttribute(r))}return i.pseudos.forEach(function(t){t.onAdd.call(e,t)}),t}},i.lifecycle.inserted&&(i.prototype.enteredDocumentCallback={value:i.lifecycle.inserted,enumerable:!0}),i.lifecycle.removed&&(i.prototype.leftDocumentCallback={value:i.lifecycle.removed,enumerable:!0}),i.lifecycle.attributeChanged&&(i.prototype.attributeChangedCallback={value:i.lifecycle.attributeChanged,enumerable:!0});var u=i.prototype.setAttribute||HTMLElement.prototype.setAttribute;i.prototype.setAttribute={writable:!0,enumberable:!0,value:function(e,t){var n=i.attributes[e.toLowerCase()];this.xtag._skipAttr||u.call(this,e,n&&n.boolean?"":t),n&&(n.setter&&!this.xtag._skipSet&&(this.xtag._skipAttr=!0,n.setter.call(this,n.boolean?!0:t)),t=n.skip?n.boolean?this.hasAttribute(e):this.getAttribute(e):t,h(this,n,e,n.boolean?"":t,"setAttribute")),delete this.xtag._skipAttr}};var l=i.prototype.removeAttribute||HTMLElement.prototype.removeAttribute;i.prototype.removeAttribute={writable:!0,enumberable:!0,value:function(e){var t=i.attributes[e.toLowerCase()];this.xtag._skipAttr||l.call(this,e),t&&(t.setter&&!this.xtag._skipSet&&(this.xtag._skipAttr=!0,t.setter.call(this,t.boolean?!1:void 0)),h(this,t,e,void 0,"removeAttribute")),delete this.xtag._skipAttr}};var d=o?o:t["extends"]?Object.create(L.createElement(t["extends"]).constructor).prototype:w.HTMLElement.prototype;return L.register(r,{"extends":t["extends"],prototype:Object.create(d,i.prototype)})}},mixins:{},prefix:M,touches:{active:[],changed:[]},captureEvents:["focus","blur","scroll","underflow","overflow","overflowchanged"],customEvents:{overflow:l("over"),underflow:l("under"),animationstart:{attach:[M.dom+"AnimationStart"]},animationend:{attach:[M.dom+"AnimationEnd"]},transitionend:{attach:[M.dom+"TransitionEnd"]},move:{attach:["mousemove","touchmove"],condition:u},enter:{attach:["mouseover","touchenter"],condition:u},leave:{attach:["mouseout","touchleave"],condition:u},tapstart:{observe:{mousedown:L,touchstart:L},condition:u},tapend:{observe:{mouseup:L,touchend:L},condition:u},tapmove:{attach:["tapstart","dragend","touchcancel"],condition:function(e,t){switch(e.type){case"move":return!0;case"dragover":var n=t.lastDrag||{};return t.lastDrag=e,n.pageX!=e.pageX&&n.pageY!=e.pageY||null;case"tapstart":t.touches=t.touches||1,t.move||(t.current=this,t.move=q.addEvents(this,{move:t.listener,dragover:t.listener}),t.tapend=q.addEvent(L,"tapend",t.listener));break;case"tapend":case"dragend":case"touchcancel":t.touches--,t.touches||(q.removeEvents(t.current,t.move||{}),q.removeEvent(L,t.tapend||{}),delete t.lastDrag,delete t.current,delete t.tapend,delete t.move)}}}},pseudos:{keypass:C,keyfail:C,delegate:{action:c},within:{action:c,onAdd:function(e){var t=e.source.condition;t&&(e.source.condition=function(n,r){return q.query(this,e.value).filter(function(e){return e==n.target||e.contains?e.contains(n.target):null})[0]?t.call(this,n,r):null})}},preventable:{action:function(e,t){return!t.defaultPrevented}}},clone:t,typeOf:e,toArray:n,wrap:function(e,t){return function(){var r=n(arguments),o=e.apply(this,r);return o===!1?!1:t.apply(this,"undefined"!=typeof o?n(o):r)}},merge:function(t,n,r){if("string"==e(n))return i(t,n,r);for(var o=1,a=arguments.length;a>o;o++){var s=arguments[o];for(var c in s)i(t,c,s[c])}return t},uid:function(){return Math.random().toString(36).substr(2,10)},query:r,skipTransition:function(e,t,n){var r=M.js+"TransitionProperty";e.style[r]=e.style.transitionProperty="none",q.requestFrame(function(){var o;t&&(o=t.call(n)),q.requestFrame(function(){e.style[r]=e.style.transitionProperty="",o&&q.requestFrame(o)})})},requestFrame:function(){var e=w.requestAnimationFrame||w[M.lowercase+"RequestAnimationFrame"]||function(e){return w.setTimeout(e,20)};return function(t){return e.call(w,t)}}(),matchSelector:function(e,t){return D.call(e,t)},set:function(e,t,n){e[t]=n,window.CustomElements&&CustomElements.upgradeAll(e)},innerHTML:function(e,t){q.set(e,"innerHTML",t)},hasClass:function(e,t){return e.className.split(" ").indexOf(t.trim())>-1},addClass:function(e,t){var n=e.className.trim().split(" ");return t.trim().split(" ").forEach(function(e){~n.indexOf(e)||n.push(e)}),e.className=n.join(" ").trim(),e},removeClass:function(e,t){var n=t.trim().split(" ");return e.className=e.className.trim().split(" ").filter(function(e){return e&&!~n.indexOf(e)}).join(" "),e},toggleClass:function(e,t){return q[q.hasClass(e,t)?"removeClass":"addClass"].call(null,e,t)},queryChildren:function(e,t){var r=e.id,o=e.id=r||"x_"+q.uid(),i="#"+o+" > ";t=i+(t+"").replace(",",","+i,"g");var a=e.parentNode.querySelectorAll(t);return r||e.removeAttribute("id"),n(a)},createFragment:function(e){var t=L.createDocumentFragment();if(e){for(var r=t.appendChild(L.createElement("div")),o=n(e.nodeName?arguments:!(r.innerHTML=e)||r.children),i=o.length,a=0;i>a;)t.insertBefore(o[a++],r);t.removeChild(r)}return t},manipulate:function(e,t){var n=e.nextSibling,r=e.parentNode,o=L.createDocumentFragment(),i=t.call(o.appendChild(e),o)||e;n?r.insertBefore(i,n):r.appendChild(i)},applyPseudos:function(e,t,r,o){var i=t,a={};if(e.match(":"))for(var s=e.match(O),c=s.length;--c;)s[c].replace(A,function(t,u,l){if(!q.pseudos[u])throw"pseudo not found: "+u+" "+s;var d=a[c]=Object.create(q.pseudos[u]);d.key=e,d.name=u,d.value=l,d.arguments=(l||"").split(","),d.action=d.action||N,d.source=o;var p=i;i=function(){var t=n(arguments),r={key:e,name:u,value:l,source:o,listener:p},i=d.action.apply(this,[r].concat(t));return null===i||i===!1?i:r.listener.apply(this,t)},r&&d.onAdd&&(r.getAttribute?d.onAdd.call(r,d):r.push(d))});for(var u in a)a[u].onCompiled&&(i=a[u].onCompiled(i,a[u])||i);return i},removePseudos:function(e,t){t._pseudos.forEach(function(t){t.onRemove&&t.onRemove.call(e,t) -})},parseEvent:function(e,t){var r=e.split(":"),o=r.shift(),i=q.customEvents[o],a=q.merge({type:o,stack:k,condition:N,attach:[],_attach:[],pseudos:"",_pseudos:[],onAdd:k,onRemove:k},i||{});a.attach=n(a.base||a.attach),a.chain=o+(a.pseudos.length?":"+a.pseudos:"")+(r.length?":"+r.join(":"):"");var s=a.condition;a.condition=function(e){return e.touches,e.targetTouches,s.apply(this,n(arguments))};var c=q.applyPseudos(a.chain,t,a._pseudos,a);if(a.stack=function(e){e.touches,e.targetTouches;var t=e.detail||{};return t.__stack__?t.__stack__==c?(e.stopPropagation(),e.cancelBubble=!0,c.apply(this,n(arguments))):void 0:c.apply(this,n(arguments))},a.listener=function(e){var t=n(arguments),r=a.condition.apply(this,t.concat([a]));return r?e.type==o?a.stack.apply(this,t):(q.fireEvent(e.target,o,{baseEvent:e,detail:{__stack__:c}}),void 0):r},a.attach.forEach(function(e){a._attach.push(q.parseEvent(e,a.listener))}),i&&i.observe&&!i.__observing__){i.observer=function(e){var t=a.condition.apply(this,n(arguments).concat([i]));return t?(q.fireEvent(e.target,o,{baseEvent:e}),void 0):t};for(var u in i.observe)q.addEvent(i.observe[u]||document,u,i.observer,!0);i.__observing__=!0}return a},addEvent:function(e,t,n,r){var o="function"==typeof n?q.parseEvent(t,n):n;return o._pseudos.forEach(function(t){t.onAdd.call(e,t)}),o._attach.forEach(function(t){q.addEvent(e,t.type,t)}),o.onAdd.call(e,o,o.listener),e.addEventListener(o.type,o.stack,r||q.captureEvents.indexOf(o.type)>-1),o},addEvents:function(e,t){var n={};for(var r in t)n[r]=q.addEvent(e,r,t[r]);return n},removeEvent:function(e,t,n){n=n||t,n.onRemove.call(e,n,n.listener),q.removePseudos(e,n),n._attach.forEach(function(t){q.removeEvent(e,t)}),e.removeEventListener(n.type,n.stack)},removeEvents:function(e,t){for(var n in t)q.removeEvent(e,t[n])},fireEvent:function(e,t,n,r){var o=L.createEvent("CustomEvent");n=n||{},r&&console.warn("fireEvent has been modified, more info here: "),o.initCustomEvent(t,n.bubbles!==!1,n.cancelable!==!1,n.detail),n.baseEvent&&p(o,n.baseEvent);try{e.dispatchEvent(o)}catch(i){console.warn("This error may have been caused by a change in the fireEvent method, more info here: ",i)}},addObserver:function(e,t,n){e._records||(e._records={inserted:[],removed:[]},x?(e._observer=new x(function(t){o(e,t)}),e._observer.observe(e,{subtree:!0,childList:!0,attributes:!1,characterData:!1})):["Inserted","Removed"].forEach(function(t){e.addEventListener("DOMNode"+t,function(n){n._mutation=!0,e._records[t.toLowerCase()].forEach(function(e){e(n.target,n)})},!1)})),-1==e._records[t].indexOf(n)&&e._records[t].push(n)},removeObserver:function(e,t,n){var r=e._records;r&&n?r[t].splice(r[t].indexOf(n),1):r[t]=[]}},F=0,V=null;L.addEventListener("mousedown",function(e){F++,V=e.target},!0),L.addEventListener("mouseup",function(){F--,V=null},!1);var Y={touches:{configurable:!0,get:function(){return this.__touches__||(this.identifier=0)||(this.__touches__=F?[this]:[])}},targetTouches:{configurable:!0,get:function(){return this.__targetTouches__||(this.__targetTouches__=F&&this.currentTarget&&(this.currentTarget==V||this.currentTarget.contains&&this.currentTarget.contains(V))?[this]:[])}},changedTouches:{configurable:!0,get:function(){return this.touches}}};for(H in Y)UIEvent.prototype[H]=Y[H],Object.defineProperty(UIEvent.prototype,H,Y[H]);var X={value:null,writable:!0,configurable:!0},B={touches:X,targetTouches:X,changedTouches:X};if(w.TouchEvent)for(H in B)w.TouchEvent.prototype[H]=B[H],Object.defineProperty(w.TouchEvent.prototype,H,B[H]);q.customEvents.tap={observe:{mousedown:document,touchstart:document},gesture:{tolerance:8},condition:function(e,t){var n=e.target;switch(e.type){case"touchstart":return n.__tap__&&n.__tap__.click&&y(n,t),b(n,t,e),void 0;case"mousedown":return n.__tap__||b(n,t,e),void 0;case"scroll":case"touchcancel":return y(this,t),void 0;case"touchmove":case"touchend":return this.__tap__&&!E(this,t,e)?(y(this,t),void 0):"touchend"==e.type||null;case"click":return y(this,t),!0}}},"function"==typeof define&&define.amd?define(q):w.xtag=q,L.addEventListener("WebComponentsReady",function(){q.fireEvent(L.body,"DOMComponentsLoaded")})}(); \ No newline at end of file +window.Platform={};var logFlags={};!function(){function e(e){if(this._element=e,e.className!=this._classCache){if(this._classCache=e.className,!this._classCache)return;var t,n=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(t=0;t>>0)+(t++ +"__")},SideTable.prototype={set:function(t,n){var r=t[this.name];r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0})},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){this.set(e,void 0)}}}(),function(e){function t(e){y.push(e),b||(b=!0,m(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){b=!1;var e=y;y=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=h.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=h.get(n);if(r)for(var o=0;o0){var o=n[r-1],i=p(o,e);if(i)return n[r-1]=i,void 0}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=h.get(e);t||h.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=h.get(e),n=0;nn&&(e=t[n]);n++)e();A=[]}function d(e){N?u(function(){f(e)}):f(e)}function f(e){(e.enteredViewCallback||e.__upgraded__&&O.dom)&&(O.dom&&console.group("inserted:",e.localName),h(e)&&(e.__inserted=(e.__inserted||0)+1,e.__inserted<1&&(e.__inserted=1),e.__inserted>1?O.dom&&console.warn("inserted:",e.localName,"insert/remove count:",e.__inserted):e.enteredViewCallback&&(O.dom&&console.log("inserted:",e.localName),e.enteredViewCallback())),O.dom&&console.groupEnd())}function p(e){v(e),r(e,function(e){v(e)})}function v(e){N?u(function(){_removed(e)}):_removed(e)}function v(e){(e.leftViewCallback||e.__upgraded__&&O.dom)&&(O.dom&&console.log("removed:",e.localName),h(e)||(e.__inserted=(e.__inserted||0)-1,e.__inserted>0&&(e.__inserted=0),e.__inserted<0?O.dom&&console.warn("removed:",e.localName,"insert/remove count:",e.__inserted):e.leftViewCallback&&e.leftViewCallback()))}function h(e){for(var t=e,n=window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(document)||document;t;){if(t==n)return!0;t=t.parentNode||t.host}}function m(e){if(e.shadowRoot&&!e.shadowRoot.__watched){O.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)_(t),t=t.olderShadowRoot}}function _(e){e.__watched||(w(e),e.__watched=!0)}function g(e){switch(e.localName){case"style":case"script":case"template":case void 0:return!0}}function b(e){if(O.dom){var t=e[0];if(t&&"childList"===t.type&&t.addedNodes&&t.addedNodes){for(var n=t.addedNodes[0];n&&n!==document&&!n.host;)n=n.parentNode;var r=n&&(n.URL||n._URL||n.host&&n.host.localName)||"";r=r.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,r||"")}e.forEach(function(e){"childList"===e.type&&(T(e.addedNodes,function(e){g(e)||a(e)}),T(e.removedNodes,function(e){g(e)||p(e)}))}),O.dom&&console.groupEnd()}function y(){b(M.takeRecords()),l()}function w(e){M.observe(e,{childList:!0,subtree:!0})}function E(e){w(e)}function L(e){O.dom&&console.group("upgradeDocument: ",(e.URL||e._URL||"").split("/").pop()),a(e),O.dom&&console.groupEnd()}var O=window.logFlags||{},N=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;e.hasPolyfillMutations=N;var k=!1,A=[],M=new MutationObserver(b),T=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.watchShadow=m,e.upgradeAll=a,e.upgradeSubtree=i,e.observeDocument=E,e.upgradeDocument=L,e.takeRecords=y}(window.CustomElements),function(e){function t(e){return r(e,c)}function n(e){return r(e,u)}function r(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function o(e){return"script"===e.localName}function i(e,t){var n=e;n instanceof Document||(n=document.implementation.createHTMLDocument(c),n.body.innerHTML=e),n._URL=t;var r=n.createElement("base");return r.setAttribute("href",document.baseURI||document.URL),n.head.appendChild(r),window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}e||(e=window.HTMLImports={flags:{}});var a,s=e.xhr,c="import",u="stylesheet",l={documents:{},cache:{},preloadSelectors:["link[rel="+c+"]","element link[rel="+u+"]","template","script[src]:not([type])",'script[src][type="text/javascript"]'].join(","),loader:function(e){return a=new d(l.loaded,e),a.cache=l.cache,a},load:function(e,t){a=l.loader(t),l.preload(e)},preload:function(e){var t=e.querySelectorAll(l.preloadSelectors);t=this.filterMainDocumentNodes(e,t),t=this.extractTemplateNodes(t),a.addNodes(t)},filterMainDocumentNodes:function(e,t){return e===document&&(t=Array.prototype.filter.call(t,function(e){return!o(e)})),t},extractTemplateNodes:function(e){var t=[];return e=Array.prototype.filter.call(e,function(e){if("template"===e.localName){if(e.content){var n=e.content.querySelectorAll("link[rel="+u+"]");n.length&&(t=t.concat(Array.prototype.slice.call(n,0)))}return!1}return!0}),t.length&&(e=e.concat(t)),e},loaded:function(e,r,o){if(t(r)){var a=l.documents[e];a||(a=i(o,e),h.resolvePathsInHTML(a),l.documents[e]=a,l.preload(a)),r.import={href:e,ownerNode:r,content:a},r.content=o=a}r.__resource=o,n(r)&&h.resolvePathsInStylesheet(r)}},d=function(e,t){this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={},this.cache={}};d.prototype={addNodes:function(e){this.inflight+=e.length,m(e,this.require,this),this.checkDone()},require:function(e){var t=h.nodeUrl(e);e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){return this.pending[e]?(this.pending[e].push(t),!0):this.cache[e]?(this.onload(e,t,a.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,t){var n=function(n,r){this.receive(e,t,n,r)}.bind(this);s.load(e,n)},receive:function(e,t,n,r){n||(a.cache[e]=r),a.pending[e].forEach(function(t){n||this.onload(e,t,r),this.tail()},this),a.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}};var f=["href","src","action"],p="["+f.join("],[")+"]",v="{{.*}}",h={nodeUrl:function(e){return h.resolveUrl(h.documentURL,h.hrefOrSrc(e))},hrefOrSrc:function(e){return e.getAttribute("href")||e.getAttribute("src")},documentUrlFromNode:function(e){return h.getDocumentUrl(e.ownerDocument||e)},getDocumentUrl:function(e){var t=e&&(e._URL||e.impl&&e.impl._URL||e.baseURI||e.URL)||"";return t.split("#")[0]},resolveUrl:function(e,t){return this.isAbsUrl(t)?t:this.compressUrl(this.urlToPath(e)+t)},resolveRelativeUrl:function(e,t){return this.isAbsUrl(t)?t:this.makeDocumentRelPath(this.resolveUrl(e,t))},isAbsUrl:function(e){return/(^data:)|(^http[s]?:)|(^\/)/.test(e)},urlToPath:function(e){var t=e.split("/");return t.pop(),t.push(""),t.join("/")},compressUrl:function(e){var t="",n=e.indexOf("?");n>-1&&(t=e.substring(n),e=e.substring(n,0));for(var r,o=e.split("/"),i=0;io;o++)r.unshift("..");var a=r.join("/");return a},resolvePathsInHTML:function(e,t){t=t||h.documentUrlFromNode(e),h.resolveAttributes(e,t),h.resolveStyleElts(e,t);var n=e.querySelectorAll("template");n&&m(n,function(e){e.content&&h.resolvePathsInHTML(e.content,t)})},resolvePathsInStylesheet:function(e){var t=h.nodeUrl(e);e.__resource=h.resolveCssText(e.__resource,t)},resolveStyleElts:function(e,t){var n=e.querySelectorAll("style");n&&m(n,function(e){e.textContent=h.resolveCssText(e.textContent,t)})},resolveCssText:function(e,t){return e.replace(/url\([^)]*\)/g,function(e){var n=e.replace(/["']/g,"").slice(4,-1);return n=h.resolveRelativeUrl(t,n),"url("+n+")"})},resolveAttributes:function(e,t){var n=e&&e.querySelectorAll(p);n&&m(n,function(e){this.resolveNodeAttributes(e,t)},this)},resolveNodeAttributes:function(e,t){f.forEach(function(n){var r=e.attributes[n];if(r&&r.value&&r.value.search(v)<0){var o=h.resolveRelativeUrl(t,r.value);r.value=o}})}};h.documentURL=h.getDocumentUrl(document),h.urlElt=document.createElement("a"),s=s||{async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(t,n,r){var o=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(t+="?"+Math.random()),o.open("GET",t,s.async),o.addEventListener("readystatechange",function(){4===o.readyState&&n.call(r,!s.ok(o)&&o,o.response,t)}),o.send(),o},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};var m=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.path=h,e.xhr=s,e.importer=l,e.getDocumentUrl=h.getDocumentUrl,e.IMPORT_LINK_TYPE=c}(window.HTMLImports),function(e){function t(e){return"link"===e.localName&&e.getAttribute("rel")===i}function n(e){return e.parentNode&&!r(e)&&!o(e)}function r(e){return e.ownerDocument===document||e.ownerDocument.impl===document}function o(e){return e.parentNode&&"element"===e.parentNode.localName}var i="import",a={selectors:["link[rel="+i+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(e){if(!e.__importParsed){e.__importParsed=!0;var t=e.querySelectorAll(a.selectors);s(t,function(e){a[a.map[e.localName]](e)})}},parseLink:function(e){t(e)?e.content&&a.parse(e.content):this.parseGeneric(e)},parseGeneric:function(e){n(e)&&document.head.appendChild(e)},parseScript:function(t){if(n(t)){var r=(t.__resource||t.textContent).trim();if(r){var o=t.__nodeUrl;if(!o){var o=e.path.documentUrlFromNode(t),i="["+Math.floor(1e3*(Math.random()+1))+"]",a=r.match(/Polymer\(['"]([^'"]*)/);i=a&&a[1]||i,o+="/"+i+".js"}r+="\n//# sourceURL="+o+"\n",eval.call(window,r)}}}},s=Array.prototype.forEach.call.bind(Array.prototype.forEach);e.parser=a}(HTMLImports),function(){function e(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),"complete"===document.readyState?e():window.addEventListener("DOMContentLoaded",e)}(),function(){function e(e){return"link"===e.localName&&e.getAttribute("rel")===t}var t=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none",n={selectors:["link[rel="+t+"]"],map:{link:"parseLink"},parse:function(e){if(!e.__parsed){e.__parsed=!0;var t=e.querySelectorAll(n.selectors);r(t,function(e){n[n.map[e.localName]](e)}),CustomElements.upgradeDocument(e),CustomElements.observeDocument(e)}},parseLink:function(t){e(t)&&this.parseImport(t)},parseImport:function(e){e.content&&n.parse(e.content)}},r=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=n}(),function(){function e(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document);var e=window.Platform&&Platform.endOfMicrotask?Platform.endOfMicrotask:setTimeout;e(function(){CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}if("function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e){var t=document.createEvent("HTMLEvents");return t.initEvent(e,!0,!0),t}),"complete"===document.readyState)e();else{var t=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(t,e)}}(),function(){function e(e){var t=P.call(e);return S[t]||(S[t]=t.match(R)[1].toLowerCase())}function t(n,r){var o=t[r||e(n)];return o?o(n):n}function n(t){return-1==U.indexOf(e(t))?Array.prototype.slice.call(t,0):[t]}function r(e,t){return(t||I).length?n(e.querySelectorAll(t)):[]}function o(e,t){var n={added:[],removed:[]};t.forEach(function(t){t._mutation=!0;for(var r in n)for(var o=e._records["added"==r?"inserted":"removed"],i=t[r+"Nodes"],a=i.length,s=0;a>s&&-1==n[r].indexOf(i[s]);s++)n[r].push(i[s]),o.forEach(function(e){e(i[s],t)})})}function i(n,r,o){var i=e(o);return"object"==i&&"object"==e(n[r])?q.merge(n[r],o):n[r]=t(o,i),n}function a(e,t,n){var r={};for(var o in n)r[o.split(":")[0]]=!0;for(var i in t)r[i.split(":")[0]]||(n[i]=t[i])}function s(e){return e.mixins.forEach(function(t){var n=q.mixins[t];for(var r in n)switch(r){case"lifecycle":case"methods":a(r,n[r],e[r]);break;case"accessors":case"prototype":for(var o in n[r])a(o,n[r],e.accessors);break;case"events":}}),e}function c(e,t){var n=r(this,e.value).filter(function(e){return e==t.target||e.contains?e.contains(t.target):null})[0];return n?e.listener=e.listener.bind(n):null}function u(e){if(e.type.match("touch"))e.target.__touched__=!0;else if(e.target.__touched__&&e.type.match("mouse"))return delete e.target.__touched__,void 0;return!0}function l(e){var t="over"==e;return{attach:"OverflowEvent"in E?"overflowchanged":[],condition:function(n){return n.flow=e,n.type==e+"flow"||0===n.orient&&n.horizontalOverflow==t||1==n.orient&&n.verticalOverflow==t||2==n.orient&&n.horizontalOverflow==t&&n.verticalOverflow==t}}}function d(e,t,n,r){r?t[e]=n[e]:Object.defineProperty(t,e,{writable:!0,enumerable:!0,value:n[e]})}function f(e,t){var n=Object.getOwnPropertyDescriptor(e,"target");for(var r in t)j[r]||d(r,e,t,n);e.baseEvent=t}function p(e,t){return{value:e.boolean?"":t,method:e.boolean&&!t?"removeAttribute":"setAttribute"}}function v(e,t,n,r){var o=p(t,r);e[o.method](n,o.value)}function h(e,t,n,r,o){for(var i=t.property?[e.xtag[t.property]]:t.selector?q.query(e,t.selector):[],a=i.length;a--;)i[a][o](n,r)}function m(e,t,n){e.__view__&&e.__view__.updateBindingValue(e,t,n)}function _(e,t,n,r,o,i){var a=n.split(":"),s=a[0];if("get"==s)a[0]=t,e.prototype[t].get=q.applyPseudos(a.join(":"),r[n],e.pseudos);else if("set"==s){a[0]=t;var c=e.prototype[t].set=q.applyPseudos(a.join(":"),o?function(e){this.xtag._skipSet=!0,this.xtag._skipAttr||v(this,o,i,e),this.xtag._skipAttr&&o.skip&&delete this.xtag._skipAttr,r[n].call(this,o.boolean?!!e:e),m(this,i,e),delete this.xtag._skipSet}:r[n]?function(e){r[n].call(this,e),m(this,i,e)}:null,e.pseudos);o&&(o.setter=c)}else e.prototype[t][n]=r[n]}function g(e,t){e.prototype[t]={};var n=e.accessors[t],r=n.attribute,o=r&&r.name?r.name.toLowerCase():t;r&&(r.key=t,e.attributes[o]=r);for(var i in n)_(e,t,i,n,r,o);if(r){if(!e.prototype[t].get){var a=(r.boolean?"has":"get")+"Attribute";e.prototype[t].get=function(){return this[a](o)}}e.prototype[t].set||(e.prototype[t].set=function(e){v(this,r,o,e),m(this,o,e)})}}function b(e,t,n){e.__tap__||(e.__tap__={click:"mousedown"==n.type},e.__tap__.click?e.addEventListener("click",t.observer):(e.__tap__.scroll=t.observer.bind(e),window.addEventListener("scroll",e.__tap__.scroll,!0),e.addEventListener("touchmove",t.observer),e.addEventListener("touchcancel",t.observer),e.addEventListener("touchend",t.observer))),e.__tap__.click||(e.__tap__.x=n.touches[0].pageX,e.__tap__.y=n.touches[0].pageY)}function y(e,t){e.__tap__&&(e.__tap__.click?e.removeEventListener("click",t.observer):(window.removeEventListener("scroll",e.__tap__.scroll,!0),e.removeEventListener("touchmove",t.observer),e.removeEventListener("touchcancel",t.observer),e.removeEventListener("touchend",t.observer)),delete e.__tap__)}function w(e,t,n){var r=n.changedTouches[0];return r.pageXe.__tap__.x-t.gesture.tolerance&&r.pageYe.__tap__.y-t.gesture.tolerance?!0:void 0}var E=window,L=document,O=function(){},N=function(){return!0},k=/([\w-]+(?:\([^\)]+\))?)/g,A=/(\w*)(?:\(([^\)]*)\))?/,M=/(\d+)/g,T={action:function(e,t){return e.value.match(M).indexOf(String(t.keyCode))>-1==("keypass"==e.name)||null}},C=function(){var e=E.getComputedStyle(L.documentElement,""),t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return{dom:"ms"==t?"MS":t,lowercase:t,css:"-"+t+"-",js:"ms"==t?t:t[0].toUpperCase()+t.substr(1)}}(),D=Element.prototype.matchesSelector||Element.prototype[C.lowercase+"MatchesSelector"],x=E.MutationObserver||E[C.js+"MutationObserver"],S={},P=S.toString,R=/\s([a-zA-Z]+)/;t.object=function(e){var n={};for(var r in e)n[r]=t(e[r]);return n},t.array=function(e){for(var n=e.length,r=new Array(n);n--;)r[n]=t(e[n]);return r};var U=["undefined","null","number","boolean","string","function"],I="",j={};for(var H in document.createEvent("CustomEvent"))j[H]=1;var q={tags:{},defaultOptions:{pseudos:[],mixins:[],events:{},methods:{},accessors:{},lifecycle:{},attributes:{},prototype:{xtag:{get:function(){return this.__xtag__?this.__xtag__:this.__xtag__={data:{}}}}}},register:function(e,t){var r;if("string"==typeof e){r=e.toLowerCase();var o=t.prototype;delete t.prototype;var i=q.tags[r]=s(q.merge({},q.defaultOptions,t));for(var a in i.events)i.events[a]=q.parseEvent(a,i.events[a]);for(a in i.lifecycle)i.lifecycle[a.split(":")[0]]=q.applyPseudos(a,i.lifecycle[a],i.pseudos);for(a in i.methods)i.prototype[a.split(":")[0]]={value:q.applyPseudos(a,i.methods[a],i.pseudos),enumerable:!0};for(a in i.accessors)g(i,a);var c=i.lifecycle.created||i.lifecycle.ready;i.prototype.createdCallback={enumerable:!0,value:function(){var e=this;q.addEvents(this,i.events),i.mixins.forEach(function(t){q.mixins[t].events&&q.addEvents(e,q.mixins[t].events)});var t=c?c.apply(this,n(arguments)):null;for(var r in i.attributes){var o=i.attributes[r],a=this.hasAttribute(r);(a||o.boolean)&&(this[o.key]=o.boolean?a:this.getAttribute(r))}return i.pseudos.forEach(function(t){t.onAdd.call(e,t)}),t}},i.lifecycle.inserted&&(i.prototype.enteredViewCallback={value:i.lifecycle.inserted,enumerable:!0}),i.lifecycle.removed&&(i.prototype.leftDocumentCallback={value:i.lifecycle.removed,enumerable:!0}),i.lifecycle.attributeChanged&&(i.prototype.attributeChangedCallback={value:i.lifecycle.attributeChanged,enumerable:!0});var u=i.prototype.setAttribute||HTMLElement.prototype.setAttribute;i.prototype.setAttribute={writable:!0,enumberable:!0,value:function(e,t){var n=i.attributes[e.toLowerCase()];this.xtag._skipAttr||u.call(this,e,n&&n.boolean?"":t),n&&(n.setter&&!this.xtag._skipSet&&(this.xtag._skipAttr=!0,n.setter.call(this,n.boolean?!0:t)),t=n.skip?n.boolean?this.hasAttribute(e):this.getAttribute(e):t,h(this,n,e,n.boolean?"":t,"setAttribute")),delete this.xtag._skipAttr}};var l=i.prototype.removeAttribute||HTMLElement.prototype.removeAttribute;i.prototype.removeAttribute={writable:!0,enumberable:!0,value:function(e){var t=i.attributes[e.toLowerCase()];this.xtag._skipAttr||l.call(this,e),t&&(t.setter&&!this.xtag._skipSet&&(this.xtag._skipAttr=!0,t.setter.call(this,t.boolean?!1:void 0)),h(this,t,e,void 0,"removeAttribute")),delete this.xtag._skipAttr}};var d=o?o:t["extends"]?Object.create(L.createElement(t["extends"]).constructor).prototype:E.HTMLElement.prototype;return L.register(r,{"extends":t["extends"],prototype:Object.create(d,i.prototype)})}},mixins:{},prefix:C,touches:{active:[],changed:[]},captureEvents:["focus","blur","scroll","underflow","overflow","overflowchanged"],customEvents:{overflow:l("over"),underflow:l("under"),animationstart:{attach:[C.dom+"AnimationStart"]},animationend:{attach:[C.dom+"AnimationEnd"]},transitionend:{attach:[C.dom+"TransitionEnd"]},move:{attach:["mousemove","touchmove"],condition:u},enter:{attach:["mouseover","touchenter"],condition:u},leave:{attach:["mouseout","touchleave"],condition:u},tapstart:{observe:{mousedown:L,touchstart:L},condition:u},tapend:{observe:{mouseup:L,touchend:L},condition:u},tapmove:{attach:["tapstart","dragend","touchcancel"],condition:function(e,t){switch(e.type){case"move":return!0;case"dragover":var n=t.lastDrag||{};return t.lastDrag=e,n.pageX!=e.pageX&&n.pageY!=e.pageY||null;case"tapstart":t.touches=t.touches||1,t.move||(t.current=this,t.move=q.addEvents(this,{move:t.listener,dragover:t.listener}),t.tapend=q.addEvent(L,"tapend",t.listener));break;case"tapend":case"dragend":case"touchcancel":t.touches--,t.touches||(q.removeEvents(t.current,t.move||{}),q.removeEvent(L,t.tapend||{}),delete t.lastDrag,delete t.current,delete t.tapend,delete t.move)}}}},pseudos:{keypass:T,keyfail:T,delegate:{action:c},within:{action:c,onAdd:function(e){var t=e.source.condition;t&&(e.source.condition=function(n,r){return q.query(this,e.value).filter(function(e){return e==n.target||e.contains?e.contains(n.target):null})[0]?t.call(this,n,r):null})}},preventable:{action:function(e,t){return!t.defaultPrevented}}},clone:t,typeOf:e,toArray:n,wrap:function(e,t){return function(){var r=n(arguments),o=e.apply(this,r);return o===!1?!1:t.apply(this,"undefined"!=typeof o?n(o):r)}},merge:function(t,n,r){if("string"==e(n))return i(t,n,r);for(var o=1,a=arguments.length;a>o;o++){var s=arguments[o];for(var c in s)i(t,c,s[c])}return t},uid:function(){return Math.random().toString(36).substr(2,10)},query:r,skipTransition:function(e,t,n){var r=C.js+"TransitionProperty";e.style[r]=e.style.transitionProperty="none",q.requestFrame(function(){var o;t&&(o=t.call(n)),q.requestFrame(function(){e.style[r]=e.style.transitionProperty="",o&&q.requestFrame(o)})})},requestFrame:function(){var e=E.requestAnimationFrame||E[C.lowercase+"RequestAnimationFrame"]||function(e){return E.setTimeout(e,20)};return function(t){return e.call(E,t)}}(),matchSelector:function(e,t){return D.call(e,t)},set:function(e,t,n){e[t]=n,window.CustomElements&&CustomElements.upgradeAll(e)},innerHTML:function(e,t){q.set(e,"innerHTML",t)},hasClass:function(e,t){return e.className.split(" ").indexOf(t.trim())>-1},addClass:function(e,t){var n=e.className.trim().split(" ");return t.trim().split(" ").forEach(function(e){~n.indexOf(e)||n.push(e)}),e.className=n.join(" ").trim(),e},removeClass:function(e,t){var n=t.trim().split(" ");return e.className=e.className.trim().split(" ").filter(function(e){return e&&!~n.indexOf(e)}).join(" "),e},toggleClass:function(e,t){return q[q.hasClass(e,t)?"removeClass":"addClass"].call(null,e,t)},queryChildren:function(e,t){var r=e.id,o=e.id=r||"x_"+q.uid(),i="#"+o+" > ";t=i+(t+"").replace(",",","+i,"g");var a=e.parentNode.querySelectorAll(t);return r||e.removeAttribute("id"),n(a)},createFragment:function(e){var t=L.createDocumentFragment();if(e){for(var r=t.appendChild(L.createElement("div")),o=n(e.nodeName?arguments:!(r.innerHTML=e)||r.children),i=o.length,a=0;i>a;)t.insertBefore(o[a++],r);t.removeChild(r)}return t},manipulate:function(e,t){var n=e.nextSibling,r=e.parentNode,o=L.createDocumentFragment(),i=t.call(o.appendChild(e),o)||e;n?r.insertBefore(i,n):r.appendChild(i)},applyPseudos:function(e,t,r,o){var i=t,a={};if(e.match(":"))for(var s=e.match(k),c=s.length;--c;)s[c].replace(A,function(t,u,l){if(!q.pseudos[u])throw"pseudo not found: "+u+" "+s;var d=a[c]=Object.create(q.pseudos[u]);d.key=e,d.name=u,d.value=l,d.arguments=(l||"").split(","),d.action=d.action||N,d.source=o; +var f=i;i=function(){var t=n(arguments),r={key:e,name:u,value:l,source:o,listener:f},i=d.action.apply(this,[r].concat(t));return null===i||i===!1?i:r.listener.apply(this,t)},r&&d.onAdd&&(r.getAttribute?d.onAdd.call(r,d):r.push(d))});for(var u in a)a[u].onCompiled&&(i=a[u].onCompiled(i,a[u])||i);return i},removePseudos:function(e,t){t._pseudos.forEach(function(t){t.onRemove&&t.onRemove.call(e,t)})},parseEvent:function(e,t){var r=e.split(":"),o=r.shift(),i=q.customEvents[o],a=q.merge({type:o,stack:O,condition:N,attach:[],_attach:[],pseudos:"",_pseudos:[],onAdd:O,onRemove:O},i||{});a.attach=n(a.base||a.attach),a.chain=o+(a.pseudos.length?":"+a.pseudos:"")+(r.length?":"+r.join(":"):"");var s=a.condition;a.condition=function(e){return e.touches,e.targetTouches,s.apply(this,n(arguments))};var c=q.applyPseudos(a.chain,t,a._pseudos,a);if(a.stack=function(e){e.touches,e.targetTouches;var t=e.detail||{};return t.__stack__?t.__stack__==c?(e.stopPropagation(),e.cancelBubble=!0,c.apply(this,n(arguments))):void 0:c.apply(this,n(arguments))},a.listener=function(e){var t=n(arguments),r=a.condition.apply(this,t.concat([a]));return r?e.type==o?a.stack.apply(this,t):(q.fireEvent(e.target,o,{baseEvent:e,detail:{__stack__:c}}),void 0):r},a.attach.forEach(function(e){a._attach.push(q.parseEvent(e,a.listener))}),i&&i.observe&&!i.__observing__){i.observer=function(e){var t=a.condition.apply(this,n(arguments).concat([i]));return t?(q.fireEvent(e.target,o,{baseEvent:e}),void 0):t};for(var u in i.observe)q.addEvent(i.observe[u]||document,u,i.observer,!0);i.__observing__=!0}return a},addEvent:function(e,t,n,r){var o="function"==typeof n?q.parseEvent(t,n):n;return o._pseudos.forEach(function(t){t.onAdd.call(e,t)}),o._attach.forEach(function(t){q.addEvent(e,t.type,t)}),o.onAdd.call(e,o,o.listener),e.addEventListener(o.type,o.stack,r||q.captureEvents.indexOf(o.type)>-1),o},addEvents:function(e,t){var n={};for(var r in t)n[r]=q.addEvent(e,r,t[r]);return n},removeEvent:function(e,t,n){n=n||t,n.onRemove.call(e,n,n.listener),q.removePseudos(e,n),n._attach.forEach(function(t){q.removeEvent(e,t)}),e.removeEventListener(n.type,n.stack)},removeEvents:function(e,t){for(var n in t)q.removeEvent(e,t[n])},fireEvent:function(e,t,n,r){var o=L.createEvent("CustomEvent");n=n||{},r&&console.warn("fireEvent has been modified, more info here: "),o.initCustomEvent(t,n.bubbles!==!1,n.cancelable!==!1,n.detail),n.baseEvent&&f(o,n.baseEvent);try{e.dispatchEvent(o)}catch(i){console.warn("This error may have been caused by a change in the fireEvent method, more info here: ",i)}},addObserver:function(e,t,n){e._records||(e._records={inserted:[],removed:[]},x?(e._observer=new x(function(t){o(e,t)}),e._observer.observe(e,{subtree:!0,childList:!0,attributes:!1,characterData:!1})):["Inserted","Removed"].forEach(function(t){e.addEventListener("DOMNode"+t,function(n){n._mutation=!0,e._records[t.toLowerCase()].forEach(function(e){e(n.target,n)})},!1)})),-1==e._records[t].indexOf(n)&&e._records[t].push(n)},removeObserver:function(e,t,n){var r=e._records;r&&n?r[t].splice(r[t].indexOf(n),1):r[t]=[]}},F=0,V=null;L.addEventListener("mousedown",function(e){F++,V=e.target},!0),L.addEventListener("mouseup",function(){F--,V=null},!1);var Y={touches:{configurable:!0,get:function(){return this.__touches__||(this.identifier=0)||(this.__touches__=F?[this]:[])}},targetTouches:{configurable:!0,get:function(){return this.__targetTouches__||(this.__targetTouches__=F&&this.currentTarget&&(this.currentTarget==V||this.currentTarget.contains&&this.currentTarget.contains(V))?[this]:[])}},changedTouches:{configurable:!0,get:function(){return this.touches}}};for(H in Y)UIEvent.prototype[H]=Y[H],Object.defineProperty(UIEvent.prototype,H,Y[H]);var X={value:null,writable:!0,configurable:!0},B={touches:X,targetTouches:X,changedTouches:X};if(E.TouchEvent)for(H in B)E.TouchEvent.prototype[H]=B[H];q.customEvents.tap={observe:{mousedown:document,touchstart:document},gesture:{tolerance:8},condition:function(e,t){var n=e.target;switch(e.type){case"touchstart":return n.__tap__&&n.__tap__.click&&y(n,t),b(n,t,e),void 0;case"mousedown":return n.__tap__||b(n,t,e),void 0;case"scroll":case"touchcancel":return y(this,t),void 0;case"touchmove":case"touchend":return this.__tap__&&!w(this,t,e)?(y(this,t),void 0):"touchend"==e.type||null;case"click":return y(this,t),!0}}},E.xtag=q,"function"==typeof define&&define.amd&&define(q),L.addEventListener("WebComponentsReady",function(){q.fireEvent(L.body,"DOMComponentsLoaded")})}(); \ No newline at end of file diff --git a/dist/datepicker/datepicker.min.js b/dist/datepicker/datepicker.min.js index 04e4758c..b10baaa0 100644 --- a/dist/datepicker/datepicker.min.js +++ b/dist/datepicker/datepicker.min.js @@ -1 +1 @@ -!function(){function t(t){return JSON.parse(JSON.stringify(t))}function e(t){var e;return 0===t.getUTCHours()?e=new Date(t.valueOf()):(e=new Date,e.setUTCHours(0),e.setUTCFullYear(t.getFullYear()),e.setUTCMonth(t.getMonth()),e.setUTCDate(t.getDate())),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}function n(t){return t instanceof Date&&!!t.getTime&&!isNaN(t.getTime())}function r(t){return t.getUTCFullYear()}function i(t){return t.getUTCMonth()}function o(t){return t.getUTCDate()}function a(t,e){var n=t.toString(),r=new Array(e).join("0");return(r+n).substr(-e)}function s(t){return[a(r(t),4),a(i(t)+1,2),a(o(t),2)].join("-")}function u(t){if(n(t))return t;var r=g.exec(t);return r?e(new Date(r[1],r[2]-1,r[3])):null}function l(t){if(n(t))return t;var r=u(t);if(r)return r;var i=Date.parse(t);return isNaN(i)?null:e(new Date(i))}function c(t){var e=t.polyfill?t.xtag.polyfillInput:t.xtag.dateInput,n=l(e.value);return n?t.removeAttribute("invalid"):t.setAttribute("invalid",!0),!!n}function d(t,e){var n=t.polyfill?t.xtag.polyfillInput:t.xtag.dateInput,r=n.value,i=l(r);t.value=e&&i?i:r}function f(t,e,n){var r=t.submitValue,i=t.value;e();var o=t.submitValue,a=t.value;(r!==o||n&&i!==a)&&xtag.fireEvent(t,"change")}function h(t){var e=t.xtag._labels;return new Array(5).join(e.yearAbbr)+"-"+new Array(3).join(e.monthAbbr)+"-"+new Array(3).join(e.dayAbbr)}var p=13,v=document.createElement("x-calendar").labels,g=/(\d{4})[^\d]?(\d{2})[^\d]?(\d{2})/;xtag.register("x-datepicker",{lifecycle:{created:function(){this.innerHTML="";var e=document.createElement("input");e.setAttribute("type","date"),xtag.addClass(e,"x-datepicker-input"),this.appendChild(e),this.xtag.dateInput=e,this.xtag._labels={yearAbbr:"Y",monthAbbr:"M",dayAbbr:"D"},this.xtag._polyfillCalLabels=t(v),this.xtag.polyfillInput=null,this.xtag.polyfillUI=null,this.polyfill=this.hasAttribute("polyfill")||"date"!==e.type.toLowerCase()}},events:{"datetoggleon:delegate(x-calendar)":function(t){var e=t.currentTarget;if(t.detail&&t.detail.date){var n=l(t.detail.date);f(e,function(){e.value=n?s(n):"",xtag.fireEvent(e,"input")})}},"datetoggleoff:delegate(x-calendar)":function(t){t.currentTarget.value=null},focus:function(t){t.currentTarget.setAttribute("focused",!0)},"blur:delegate(.x-datepicker-input)":function(t){t.currentTarget.removeAttribute("focused")},"blur:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.currentTarget;e.removeAttribute("focused"),f(e,function(){d(e,!0)},!0)},"touchstart:delegate(.x-datepicker-polyfill-input)":function(){this.setAttribute("readonly",!0)},"tapstart:delegate(x-calendar)":function(t){t.preventDefault(),t.baseEvent&&t.baseEvent.preventDefault()},"keypress:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.keyCode,n=t.currentTarget;e===p&&f(n,function(){d(n,!0)},!0)},"input:delegate(.x-datepicker-input)":function(t){var e=t.currentTarget;f(e,function(){d(e,!0),t.stopPropagation(),xtag.fireEvent(e,"input")})},"input:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.currentTarget;f(e,function(){d(e,!1),t.stopPropagation(),xtag.fireEvent(e,"input")})},"change:delegate(.x-datepicker-input)":function(t){t.stopPropagation(),xtag.fireEvent(t.currentTarget,"change")},"change:delegate(.x-datepicker-polyfill-input)":function(t){t.stopPropagation();var e=t.currentTarget;f(e,function(){d(e,!1)})}},accessors:{name:{attribute:{selector:".x-datepicker-input"},set:function(t){var e=this.xtag.dateInput;null===t||void 0===t?e.removeAttribute("name"):e.setAttribute("name",t)}},submitValue:{get:function(){return this.xtag.dateInput.value}},value:{attribute:{skip:!0},get:function(){return this.polyfill?this.xtag.polyfillInput.value:this.xtag.dateInput.value},set:function(t){var e=l(t),n=e?s(e):null,r=this.xtag.dateInput,i=this.xtag.polyfillInput,o=this.xtag.polyfillUI;if(null===t||void 0===t)this.removeAttribute("value"),r.value="",i&&(i.value=""),o&&(o.chosen=null);else{var a,u=n?n:t;i?t!==i.value?(i.value=u,a=u):a=t:a=u,this.setAttribute("value",a),n?(r.value=n,o&&(o.chosen=e,o.view=e)):(r.value="",o&&(o.chosen=null))}c(this)}},polyfill:{attribute:{"boolean":!0},set:function(t){var e=this.xtag.dateInput;if(t){if(e.setAttribute("type","hidden"),e.setAttribute("readonly",!0),!this.xtag.polyfillInput){var n=document.createElement("input");xtag.addClass(n,"x-datepicker-polyfill-input"),n.setAttribute("type","text"),n.setAttribute("placeholder",h(this)),n.value=this.xtag.dateInput.value,this.xtag.polyfillInput=n,this.appendChild(n)}if(this.xtag.polyfillInput.removeAttribute("disabled"),!this.xtag.polyfillUI){var r=document.createElement("x-calendar");xtag.addClass(r,"x-datepicker-polyfill-ui"),r.chosen=this.value,r.view=this.xtag.dateInput.value,r.controls=!0,r.labels=this.xtag._polyfillCalLabels,this.xtag.polyfillUI=r,this.appendChild(r)}}else{"date"!==e.getAttribute("type")&&e.setAttribute("type","date"),e.removeAttribute("readonly");var i=this.xtag.polyfillInput;i&&i.setAttribute("disabled",!0)}}},labels:{get:function(){var e={},n=this.xtag._labels,r=this.xtag._polyfillCalLabels;for(var i in n)e[i]=n[i];for(var i in r)e[i]=r[i];return t(e)},set:function(t){var e=this.xtag.polyfillUI,n=this.xtag.polyfillInput;if(e)e.labels=t,this.xtag._polyfillCalLabels=e.labels;else{var r=this.xtag._polyfillCalLabels;for(var i in r)i in t&&(r[i]=t[i])}var o=this.xtag._labels;for(var i in o)i in t&&(o[i]=t[i]);n&&n.setAttribute("placeholder",h(this))}}}})}(); \ No newline at end of file +!function(){function t(t){return JSON.parse(JSON.stringify(t))}function e(t){var e;return 0===t.getUTCHours()?e=new Date(t.valueOf()):(e=new Date,e.setUTCHours(0),e.setUTCFullYear(t.getFullYear()),e.setUTCMonth(t.getMonth()),e.setUTCDate(t.getDate())),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}function n(t){return t instanceof Date&&!!t.getTime&&!isNaN(t.getTime())}function r(t){return t.getUTCFullYear()}function i(t){return t.getUTCMonth()}function o(t){return t.getUTCDate()}function a(t,e){var n=t.toString(),r=new Array(e).join("0");return(r+n).substr(-e)}function s(t){return[a(r(t),4),a(i(t)+1,2),a(o(t),2)].join("-")}function u(t){if(n(t))return t;var r=g.exec(t);return r?e(new Date(r[1],r[2]-1,r[3])):null}function l(t){if(n(t))return t;var r=u(t);if(r)return r;var i=Date.parse(t);return isNaN(i)?null:e(new Date(i))}function c(t){var e=t.polyfill?t.xtag.polyfillInput:t.xtag.dateInput,n=l(e.value);return n?t.removeAttribute("invalid"):t.setAttribute("invalid",!0),!!n}function d(t,e){var n=t.polyfill?t.xtag.polyfillInput:t.xtag.dateInput,r=n.value,i=l(r);t.value=e&&i?i:r}function f(t,e,n){var r=t.submitValue,i=t.value;e();var o=t.submitValue,a=t.value;(r!==o||n&&i!==a)&&xtag.fireEvent(t,"change")}function h(t){var e=t.xtag._labels;return new Array(5).join(e.yearAbbr)+"-"+new Array(3).join(e.monthAbbr)+"-"+new Array(3).join(e.dayAbbr)}var v=13,p=document.createElement("x-calendar").labels,g=/(\d{4})[^\d]?(\d{2})[^\d]?(\d{2})/;xtag.register("x-datepicker",{lifecycle:{created:function(){this.innerHTML="";var e=document.createElement("input");e.setAttribute("type","date"),xtag.addClass(e,"x-datepicker-input"),this.appendChild(e),this.xtag.dateInput=e,this.xtag._labels={yearAbbr:"Y",monthAbbr:"M",dayAbbr:"D"},this.xtag._polyfillCalLabels=t(p),this.xtag.polyfillInput=null,this.xtag.polyfillUI=null,this.polyfill=this.hasAttribute("polyfill")||"date"!==e.type.toLowerCase()}},events:{"datetoggleon:delegate(x-calendar)":function(t){var e=t.currentTarget;if(t.detail&&t.detail.date){var n=l(t.detail.date);f(e,function(){e.value=n?s(n):"",xtag.fireEvent(e,"input")})}},"datetoggleoff:delegate(x-calendar)":function(t){t.currentTarget.value=null},focus:function(t){t.currentTarget.setAttribute("focused",!0)},"blur:delegate(.x-datepicker-input)":function(t){t.currentTarget.removeAttribute("focused")},"blur:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.currentTarget;e.removeAttribute("focused"),f(e,function(){d(e,!0)},!0)},"touchstart:delegate(.x-datepicker-polyfill-input)":function(){this.setAttribute("readonly",!0)},"tapstart:delegate(x-calendar)":function(t){t.preventDefault(),t.baseEvent&&t.baseEvent.preventDefault()},"keypress:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.keyCode,n=t.currentTarget;e===v&&f(n,function(){d(n,!0)},!0)},"input:delegate(.x-datepicker-input)":function(t){var e=t.currentTarget;f(e,function(){d(e,!0),t.stopPropagation(),xtag.fireEvent(e,"input")})},"input:delegate(.x-datepicker-polyfill-input)":function(t){var e=t.currentTarget;f(e,function(){d(e,!1),t.stopPropagation(),xtag.fireEvent(e,"input")})},"change:delegate(.x-datepicker-input)":function(t){t.stopPropagation(),xtag.fireEvent(t.currentTarget,"change")},"change:delegate(.x-datepicker-polyfill-input)":function(t){t.stopPropagation();var e=t.currentTarget;f(e,function(){d(e,!1)})}},accessors:{name:{attribute:{selector:".x-datepicker-input"},set:function(t){var e=this.xtag.dateInput;null===t||void 0===t?e.removeAttribute("name"):e.setAttribute("name",t)}},submitValue:{get:function(){return this.xtag.dateInput.value}},value:{attribute:{skip:!0},get:function(){return this.polyfill?this.xtag.polyfillInput.value:this.xtag.dateInput.value},set:function(t){var e=l(t),n=e?s(e):null,r=this.xtag.dateInput,i=this.xtag.polyfillInput,o=this.xtag.polyfillUI;if(null===t||void 0===t)this.removeAttribute("value"),r.value="",i&&(i.value=""),o&&(o.chosen=null);else{var a,u=n?n:t;i?t!==i.value?(i.value=u,a=u):a=t:a=u,this.setAttribute("value",a),n?(r.value=n,o&&(o.chosen=e,o.view=e)):(r.value="",o&&(o.chosen=null))}c(this)}},polyfill:{attribute:{"boolean":!0},set:function(t){var e=this.xtag.dateInput;if(t){if(e.setAttribute("type","hidden"),e.setAttribute("readonly",!0),!this.xtag.polyfillInput){var n=document.createElement("input");xtag.addClass(n,"x-datepicker-polyfill-input"),n.setAttribute("type","text"),n.setAttribute("placeholder",h(this)),n.value=this.xtag.dateInput.value,this.xtag.polyfillInput=n,this.appendChild(n)}if(this.xtag.polyfillInput.removeAttribute("disabled"),!this.xtag.polyfillUI){var r=document.createElement("x-calendar");xtag.addClass(r,"x-datepicker-polyfill-ui"),r.chosen=this.value,r.view=this.xtag.dateInput.value,r.controls=!0,r.labels=this.xtag._polyfillCalLabels,this.xtag.polyfillUI=r,this.appendChild(r)}}else{"date"!==e.getAttribute("type")&&e.setAttribute("type","date"),e.removeAttribute("readonly");var i=this.xtag.polyfillInput;i&&i.setAttribute("disabled",!0)}}},labels:{get:function(){var e={},n=this.xtag._labels,r=this.xtag._polyfillCalLabels;for(var i in n)e[i]=n[i];for(var i in r)e[i]=r[i];return t(e)},set:function(t){var e=this.xtag.polyfillUI,n=this.xtag.polyfillInput;if(e)e.labels=t,this.xtag._polyfillCalLabels=e.labels;else{var r=this.xtag._polyfillCalLabels;for(var i in r)i in t&&(r[i]=t[i])}var o=this.xtag._labels;for(var i in o)i in t&&(o[i]=t[i]);n&&n.setAttribute("placeholder",h(this))}}}})}(); \ No newline at end of file diff --git a/dist/tooltip/tooltip.min.js b/dist/tooltip/tooltip.min.js index 8e565375..ac185384 100644 --- a/dist/tooltip/tooltip.min.js +++ b/dist/tooltip/tooltip.min.js @@ -1 +1 @@ -!function(){function t(t){return t in D}function e(){var t=document.documentElement,e={left:t.scrollLeft||document.body.scrollLeft||0,top:t.scrollTop||document.body.scrollTop||0,width:t.clientWidth,height:t.clientHeight};return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function n(t){var n=t.getBoundingClientRect(),r=e(),i=r.left,o=r.top;return{left:n.left+i,right:n.right+i,top:n.top+o,bottom:n.bottom+o,width:n.width,height:n.height}}function r(t,e){var e=void 0!==e?e:n(t);return{x:t.offsetWidth?e.width/t.offsetWidth:1,y:t.offsetHeight?e.height/t.offsetHeight:1}}function i(t,e){if(t.righto||h.bottom>a?u.push(c):s.push(c)}var d=s.length>0?s:u;return d[0].orient}function E(t){t.setAttribute("_force-display",!0)}function w(t){t.removeAttribute("_force-display")}function A(e,n){e.removeAttribute(j);var r=e.xtag.arrowEl,i=[];for(var o in D){r.setAttribute(R,D[o]);var a=T(e,n,o);a&&(E(e),v(e,n)||i.push({orient:o,rect:a}),w(e))}var s=_(e,i);return s||(s="top"),e.setAttribute(j,s),r.setAttribute(R,D[s]),t(s)&&s!==o?T(e,n,s):a}function T(i,o,a,s){if(!i.parentNode)return i.left="",i.top="",null;s=void 0===s?0:s;var u=i.xtag.arrowEl;if(!t(a))return A(i,o);var l=i.offsetParent?i.offsetParent:i.parentNode;s||(i.style.top="",i.style.left="",u.style.top="",u.style.left=""),E(i);var c=e(),h=n(l),g=r(l,h),p=l.clientWidth*g.x,v=l.clientHeight*g.y,_=n(o),C=_.width,k=_.height,N=n(i),S=r(i,N),O=N.width,L=N.height,D=N.width,M=N.height,I=(D-O)/2,R=(M-L)/2,j=u.offsetWidth*S.x,U=u.offsetHeight*S.y,P=45,F=m(j,U,P);j=F.width,U=F.height,"top"===a||"bottom"===a?U/=2:j/=2;var H=y(i,h),q=H.left,V=H.top,W=H.right-O,z=H.bottom-L,B={left:_.left+(C-O)/2,top:_.top+(k-L)/2},Y=B.left,G=B.top;if("top"===a)G=_.top-M-U,z-=U;else if("bottom"===a)G=_.top+k+U,z-=U;else if("left"===a)Y=_.left-D-j,W-=j;else{if("right"!==a)throw"invalid orientation "+a;Y=_.left+C+j,W-=j}var J=b(Y,q,W),X=b(G,V,z);J+=I,X+=R;var K,$,Z=function(t){if(!window.getComputedStyle||t===document||t===document.documentElement)return!1;var e;try{e=window.getComputedStyle(t)}catch(n){return!1}return e&&"fixed"===e.position},Q=d(o,Z);if(Q&&!f(i,Q))K=J-c.left,$=X-c.top,i.setAttribute("_target-fixed",!0);else{var te=x(J,X,window,l,g);K=te.left,$=te.top,i.removeAttribute("_target-fixed")}i.style.top=$+"px",i.style.left=K+"px";var ee,ne,re,ie,oe;"top"===a||"bottom"===a?(ie=(C-j)/2,oe=_.left-J,ee=O-j,ne=O,re="left"):(ie=(k-U)/2,oe=_.top-X,ee=L-U,ne=L,re="top");var ae=b(ie+oe,0,ee),se=ne?ae/ne:0;u.style[re]=100*se+"%";var ue=i.offsetWidth*S.x,le=i.offsetHeight*S.y,ce=l.clientWidth*g.x,he=l.clientHeight*g.y;w(i);var de=2;return de>s&&(O!==ue||L!==le||p!==ce||v!==he)?T(i,o,a,s+1):{left:J,top:X,width:ue,height:le,right:J+ue,bottom:X+le}}function C(t,e){e===t&&console.warn("The tooltip's target element is the tooltip itself! Is this intentional?");var n=t.xtag.arrowEl;n.parentNode||console.warn("The inner component DOM of the tooltip appears to be missing. Make sure to edit tooltip contents through the .contentEl property instead ofdirectly on the x-tooltip to avoid clobbering the component's internals.");var r=t.orientation,i=function(){w(t),t.setAttribute("visible",!0),xtag.fireEvent(t,"tooltipshown",{triggerElem:e})};e?(t.xtag.lastTargetElem=e,xtag.skipTransition(t,function(){return T(t,e,r),i})):(t.style.top="",t.style.left="",n.style.top="",n.style.left="",i())}function k(e){t(e.orientation)&&e.removeAttribute(j),e.hasAttribute("visible")&&(E(e),e.xtag._hideTransitionFlag=!0,e.removeAttribute("visible"))}function N(t){var e=t.xtag.cachedListeners;e.forEach(function(t){t.removeListener()}),t.xtag.cachedListeners=[],O.unregisterTooltip(t.triggerStyle,t)}function S(t,e,n){if(t.parentNode){(void 0===e||null===e)&&(e=t.targetSelector),(void 0===n||null===n)&&(n=t.triggerStyle);var r=p(t,e);-1===r.indexOf(t.xtag.lastTargetElem)&&(t.xtag.lastTargetElem=r.length>0?r[0]:null,T(t,t.xtag.lastTargetElem,t.orientation)),N(t);var i;if(n in L){var o=L[n];i=o(t,e)}else i=h(t,e,n),O.registerTooltip(n,t);i.forEach(function(t){t.attachListener()}),t.xtag.cachedListeners=i,k(t)}}var O,L,D={top:"down",bottom:"up",left:"right",right:"left"},M="_previousSibling",I="_nextSibling",R="arrow-direction",j="_auto-orientation";o.prototype.attachListener=function(){this._attachedFn||(this._attachedFn=xtag.addEvent(this.elem,this.eventType,this.listenerFn))},o.prototype.removeListener=function(){this._attachedFn&&(xtag.removeEvent(this.elem,this.eventType,this._attachedFn),this._attachedFn=null)},a.prototype.destroy=function(){this._cachedListener.removeListener(),this._cachedListener=null,this._tooltips=null},a.prototype.containsTooltip=function(t){return-1!==this._tooltips.indexOf(t)},a.prototype.addTooltip=function(t){this.containsTooltip(t)||this._tooltips.push(t)},a.prototype.removeTooltip=function(t){this.containsTooltip(t)&&this._tooltips.splice(this._tooltips.indexOf(t),1)},Object.defineProperties(a.prototype,{numTooltips:{get:function(){return this._tooltips.length}}}),s.prototype.registerTooltip=function(t,e){if(t in this.eventStructDict){var n=this.eventStructDict[t];n.containsTooltip(e)||n.addTooltip(e)}else this.eventStructDict[t]=new a(t),this.eventStructDict[t].addTooltip(e)},s.prototype.unregisterTooltip=function(t,e){if(t in this.eventStructDict&&this.eventStructDict[t].containsTooltip(e)){var n=this.eventStructDict[t];n.removeTooltip(e),0===n.numTooltips&&(n.destroy(),delete this.eventStructDict[t])}},O=new s,L={custom:function(){return[]},hover:function(t,e){var n=[],r=null,i=200,a=function(){r&&window.clearTimeout(r),r=null},s=g(function(e){a();var n=this,r=e.relatedTarget||e.toElement;f(r,t)||C(t,n)}),u=g(function(e){a();var n=e.relatedTarget||e.toElement;f(n,t)||(r=window.setTimeout(function(){"hover"===t.triggerStyle&&k(t)},i))}),l=c(t,e,"enter",s),h=c(t,e,"leave",u);n.push(l),n.push(h);var d=g(function(e){a();var n=e.relatedTarget||e.toElement,r=t.xtag.lastTargetElem;t.hasAttribute("visible")||!r||f(n,r)||C(t,r)}),p=g(function(e){a();var n=e.relatedTarget||e.toElement,o=t.xtag.lastTargetElem;o&&!f(n,o)&&(r=window.setTimeout(function(){"hover"===t.triggerStyle&&k(t)},i))});return n.push(new o(t,"enter",d)),n.push(new o(t,"leave",p)),n}},xtag.register("x-tooltip",{lifecycle:{created:function(){var t=this;t.xtag.contentEl=document.createElement("div"),t.xtag.arrowEl=document.createElement("span"),xtag.addClass(t.xtag.contentEl,"tooltip-content"),xtag.addClass(t.xtag.arrowEl,"tooltip-arrow"),t.xtag.contentEl.innerHTML=t.innerHTML,t.innerHTML="",t.appendChild(t.xtag.contentEl),t.appendChild(t.xtag.arrowEl),t.xtag._orientation="auto",t.xtag._targetSelector=M,t.xtag._triggerStyle="click";var e=p(t,t.xtag._targetSelector);t.xtag.lastTargetElem=e.length>0?e[0]:null,t.xtag.cachedListeners=[],t.xtag._hideTransitionFlag=!1,t.xtag._skipOuterClick=!1},inserted:function(){S(this,this.xtag._targetSelector,this.xtag._triggerStyle)},removed:function(){N(this)}},events:{transitionend:function(t){var e=t.currentTarget;e.xtag._hideTransitionFlag&&!e.hasAttribute("visible")&&(e.xtag._hideTransitionFlag=!1,xtag.fireEvent(e,"tooltiphidden")),w(e)}},accessors:{orientation:{attribute:{},get:function(){return this.xtag._orientation},set:function(e){e=e.toLowerCase();var n=this.querySelector(".tooltip-arrow"),r=null;t(e)?(r=D[e],n.setAttribute(R,r),this.removeAttribute(j)):n.removeAttribute(R),this.xtag._orientation=e,this.refreshPosition()}},triggerStyle:{attribute:{name:"trigger-style"},get:function(){return this.xtag._triggerStyle},set:function(t){S(this,this.targetSelector,t),this.xtag._triggerStyle=t}},targetSelector:{attribute:{name:"target-selector"},get:function(){return this.xtag._targetSelector},set:function(t){p(this,t),S(this,t,this.triggerStyle),this.xtag._targetSelector=t}},ignoreOuterTrigger:{attribute:{"boolean":!0,name:"ignore-outer-trigger"}},ignoreTooltipPointerEvents:{attribute:{"boolean":!0,name:"ignore-tooltip-pointer-events"}},allowOverflow:{attribute:{"boolean":!0,name:"allow-overflow"},set:function(){this.refreshPosition()}},contentEl:{get:function(){return this.xtag.contentEl},set:function(t){var e=this.xtag.contentEl;xtag.addClass(t,"tooltip-content"),this.replaceChild(t,e),this.xtag.contentEl=t,this.refreshPosition()}},presetTriggerStyles:{get:function(){var t=[];for(var e in L)t.push(e);return t}},targetElems:{get:function(){return p(this,this.targetSelector)}}},methods:{refreshPosition:function(){this.xtag.lastTargetElem&&T(this,this.xtag.lastTargetElem,this.orientation)},show:function(){C(this,this.xtag.lastTargetElem)},hide:function(){k(this)},toggle:function(){this.hasAttribute("visible")?this.hide():this.show()}}})}(); \ No newline at end of file +!function(){function t(t){return t in M}function e(){var t=document.documentElement,e={left:t.scrollLeft||document.body.scrollLeft||0,top:t.scrollTop||document.body.scrollTop||0,width:t.clientWidth,height:t.clientHeight};return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function n(t){var n=t.getBoundingClientRect(),r=e(),i=r.left,o=r.top;return{left:n.left+i,right:n.right+i,top:n.top+o,bottom:n.bottom+o,width:n.width,height:n.height}}function r(t,e){var e=void 0!==e?e:n(t);return{x:t.offsetWidth?e.width/t.offsetWidth:1,y:t.offsetHeight?e.height/t.offsetHeight:1}}function i(t,e){if(t.righto||d.bottom>a?u.push(c):s.push(c)}var h=s.length>0?s:u;return h[0].orient}function E(t){t.setAttribute("_force-display",!0)}function w(t){t.removeAttribute("_force-display")}function A(e,n){e.removeAttribute(P);var r=e.xtag.arrowEl,i=[];for(var o in M){r.setAttribute(R,M[o]);var a=T(e,n,o);a&&(E(e),v(e,n)||i.push({orient:o,rect:a}),w(e))}var s=_(e,i);return s||(s="top"),e.setAttribute(P,s),r.setAttribute(R,M[s]),t(s)&&s!==o?T(e,n,s):a}function T(i,o,a,s){if(!i.parentNode)return i.left="",i.top="",null;s=void 0===s?0:s;var u=i.xtag.arrowEl;if(!t(a))return A(i,o);var l=i.offsetParent?i.offsetParent:i.parentNode;s||(i.style.top="",i.style.left="",u.style.top="",u.style.left=""),E(i);var c=e(),d=n(l),g=r(l,d),p=l.clientWidth*g.x,v=l.clientHeight*g.y,_=n(o),C=_.width,k=_.height,N=n(i),S=r(i,N),O=N.width,L=N.height,M=N.width,D=N.height,I=(M-O)/2,R=(D-L)/2,P=u.offsetWidth*S.x,j=u.offsetHeight*S.y,U=45,F=m(P,j,U);P=F.width,j=F.height,"top"===a||"bottom"===a?j/=2:P/=2;var H=y(i,d),q=H.left,V=H.top,W=H.right-O,z=H.bottom-L,B={left:_.left+(C-O)/2,top:_.top+(k-L)/2},Y=B.left,J=B.top;if("top"===a)J=_.top-D-j,z-=j;else if("bottom"===a)J=_.top+k+j,z-=j;else if("left"===a)Y=_.left-M-P,W-=P;else{if("right"!==a)throw"invalid orientation "+a;Y=_.left+C+P,W-=P}var G=b(Y,q,W),X=b(J,V,z);G+=I,X+=R;var K,$,Z=function(t){if(!window.getComputedStyle||t===document||t===document.documentElement)return!1;var e;try{e=window.getComputedStyle(t)}catch(n){return!1}return e&&"fixed"===e.position},Q=h(o,Z);if(Q&&!f(i,Q))K=G-c.left,$=X-c.top,i.setAttribute("_target-fixed",!0);else{var te=x(G,X,window,l,g);K=te.left,$=te.top,i.removeAttribute("_target-fixed")}i.style.top=$+"px",i.style.left=K+"px";var ee,ne,re,ie,oe;"top"===a||"bottom"===a?(ie=(C-P)/2,oe=_.left-G,ee=O-P,ne=O,re="left"):(ie=(k-j)/2,oe=_.top-X,ee=L-j,ne=L,re="top");var ae=b(ie+oe,0,ee),se=ne?ae/ne:0;u.style[re]=100*se+"%";var ue=i.offsetWidth*S.x,le=i.offsetHeight*S.y,ce=l.clientWidth*g.x,de=l.clientHeight*g.y;w(i);var he=2;return he>s&&(O!==ue||L!==le||p!==ce||v!==de)?T(i,o,a,s+1):{left:G,top:X,width:ue,height:le,right:G+ue,bottom:X+le}}function C(t,e){e===t&&console.warn("The tooltip's target element is the tooltip itself! Is this intentional?");var n=t.xtag.arrowEl;n.parentNode||console.warn("The inner component DOM of the tooltip appears to be missing. Make sure to edit tooltip contents through the .contentEl property instead ofdirectly on the x-tooltip to avoid clobbering the component's internals.");var r=t.orientation,i=function(){w(t),t.setAttribute("visible",!0),xtag.fireEvent(t,"tooltipshown",{triggerElem:e})};e?(t.xtag.lastTargetElem=e,xtag.skipTransition(t,function(){return T(t,e,r),i})):(t.style.top="",t.style.left="",n.style.top="",n.style.left="",i())}function k(e){t(e.orientation)&&e.removeAttribute(P),e.hasAttribute("visible")&&(E(e),e.xtag._hideTransitionFlag=!0,e.removeAttribute("visible"))}function N(t){var e=t.xtag.cachedListeners;e.forEach(function(t){t.removeListener()}),t.xtag.cachedListeners=[],O.unregisterTooltip(t.triggerStyle,t)}function S(t,e,n){if(t.parentNode){(void 0===e||null===e)&&(e=t.targetSelector),(void 0===n||null===n)&&(n=t.triggerStyle);var r=p(t,e);-1===r.indexOf(t.xtag.lastTargetElem)&&(t.xtag.lastTargetElem=r.length>0?r[0]:null,T(t,t.xtag.lastTargetElem,t.orientation)),N(t);var i;if(n in L){var o=L[n];i=o(t,e)}else i=d(t,e,n),O.registerTooltip(n,t);i.forEach(function(t){t.attachListener()}),t.xtag.cachedListeners=i,k(t)}}var O,L,M={top:"down",bottom:"up",left:"right",right:"left"},D="_previousSibling",I="_nextSibling",R="arrow-direction",P="_auto-orientation";o.prototype.attachListener=function(){this._attachedFn||(this._attachedFn=xtag.addEvent(this.elem,this.eventType,this.listenerFn))},o.prototype.removeListener=function(){this._attachedFn&&(xtag.removeEvent(this.elem,this.eventType,this._attachedFn),this._attachedFn=null)},a.prototype.destroy=function(){this._cachedListener.removeListener(),this._cachedListener=null,this._tooltips=null},a.prototype.containsTooltip=function(t){return-1!==this._tooltips.indexOf(t)},a.prototype.addTooltip=function(t){this.containsTooltip(t)||this._tooltips.push(t)},a.prototype.removeTooltip=function(t){this.containsTooltip(t)&&this._tooltips.splice(this._tooltips.indexOf(t),1)},Object.defineProperties(a.prototype,{numTooltips:{get:function(){return this._tooltips.length}}}),s.prototype.registerTooltip=function(t,e){if(t in this.eventStructDict){var n=this.eventStructDict[t];n.containsTooltip(e)||n.addTooltip(e)}else this.eventStructDict[t]=new a(t),this.eventStructDict[t].addTooltip(e)},s.prototype.unregisterTooltip=function(t,e){if(t in this.eventStructDict&&this.eventStructDict[t].containsTooltip(e)){var n=this.eventStructDict[t];n.removeTooltip(e),0===n.numTooltips&&(n.destroy(),delete this.eventStructDict[t])}},O=new s,L={custom:function(){return[]},hover:function(t,e){var n=[],r=null,i=200,a=function(){r&&window.clearTimeout(r),r=null},s=g(function(e){a();var n=this,r=e.relatedTarget||e.toElement;f(r,t)||C(t,n)}),u=g(function(e){a();var n=e.relatedTarget||e.toElement;f(n,t)||(r=window.setTimeout(function(){"hover"===t.triggerStyle&&k(t)},i))}),l=c(t,e,"enter",s),d=c(t,e,"leave",u);n.push(l),n.push(d);var h=g(function(e){a();var n=e.relatedTarget||e.toElement,r=t.xtag.lastTargetElem;t.hasAttribute("visible")||!r||f(n,r)||C(t,r)}),p=g(function(e){a();var n=e.relatedTarget||e.toElement,o=t.xtag.lastTargetElem;o&&!f(n,o)&&(r=window.setTimeout(function(){"hover"===t.triggerStyle&&k(t)},i))});return n.push(new o(t,"enter",h)),n.push(new o(t,"leave",p)),n}},xtag.register("x-tooltip",{lifecycle:{created:function(){var t=this;t.xtag.contentEl=document.createElement("div"),t.xtag.arrowEl=document.createElement("span"),xtag.addClass(t.xtag.contentEl,"tooltip-content"),xtag.addClass(t.xtag.arrowEl,"tooltip-arrow"),t.xtag.contentEl.innerHTML=t.innerHTML,t.innerHTML="",t.appendChild(t.xtag.contentEl),t.appendChild(t.xtag.arrowEl),t.xtag._orientation="auto",t.xtag._targetSelector=D,t.xtag._triggerStyle="click";var e=p(t,t.xtag._targetSelector);t.xtag.lastTargetElem=e.length>0?e[0]:null,t.xtag.cachedListeners=[],t.xtag._hideTransitionFlag=!1,t.xtag._skipOuterClick=!1},inserted:function(){S(this,this.xtag._targetSelector,this.xtag._triggerStyle)},removed:function(){N(this)}},events:{transitionend:function(t){var e=t.currentTarget;e.xtag._hideTransitionFlag&&!e.hasAttribute("visible")&&(e.xtag._hideTransitionFlag=!1,xtag.fireEvent(e,"tooltiphidden")),w(e)}},accessors:{orientation:{attribute:{},get:function(){return this.xtag._orientation},set:function(e){e=e.toLowerCase();var n=this.querySelector(".tooltip-arrow"),r=null;t(e)?(r=M[e],n.setAttribute(R,r),this.removeAttribute(P)):n.removeAttribute(R),this.xtag._orientation=e,this.refreshPosition()}},triggerStyle:{attribute:{name:"trigger-style"},get:function(){return this.xtag._triggerStyle},set:function(t){S(this,this.targetSelector,t),this.xtag._triggerStyle=t}},targetSelector:{attribute:{name:"target-selector"},get:function(){return this.xtag._targetSelector},set:function(t){p(this,t),S(this,t,this.triggerStyle),this.xtag._targetSelector=t}},ignoreOuterTrigger:{attribute:{"boolean":!0,name:"ignore-outer-trigger"}},ignoreTooltipPointerEvents:{attribute:{"boolean":!0,name:"ignore-tooltip-pointer-events"}},allowOverflow:{attribute:{"boolean":!0,name:"allow-overflow"},set:function(){this.refreshPosition()}},contentEl:{get:function(){return this.xtag.contentEl},set:function(t){var e=this.xtag.contentEl;xtag.addClass(t,"tooltip-content"),this.replaceChild(t,e),this.xtag.contentEl=t,this.refreshPosition()}},presetTriggerStyles:{get:function(){var t=[];for(var e in L)t.push(e);return t}},targetElems:{get:function(){return p(this,this.targetSelector)}}},methods:{refreshPosition:function(){this.xtag.lastTargetElem&&T(this,this.xtag.lastTargetElem,this.orientation)},show:function(){C(this,this.xtag.lastTargetElem)},hide:function(){k(this)},toggle:function(){this.hasAttribute("visible")?this.hide():this.show()}}})}(); \ No newline at end of file diff --git a/package.json b/package.json index d1908051..8dabef79 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "brick", - "version": "1.0.0-beta7", + "version": "1.0.0-beta8", "description": "UI Web Components for Mobile Web Apps", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "casperjs test --engine=slimerjs $(pwd)/test" }, "repository": { "type": "git",