Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: tools/perf/page_sets/key_silk_cases/inbox_app.html

Issue 120753003: Add inbox_app to silk page set (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Skip bogus license check Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/page_sets/key_silk_cases.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/key_silk_cases/inbox_app.html
diff --git a/third_party/polymer/platform/platform.js b/tools/perf/page_sets/key_silk_cases/inbox_app.html
similarity index 62%
copy from third_party/polymer/platform/platform.js
copy to tools/perf/page_sets/key_silk_cases/inbox_app.html
index 54f3f748e74307aa007a66329a85ee756411d56b..c9bfe58435efbd0183916b65c437c647cfce8c8c 100644
--- a/third_party/polymer/platform/platform.js
+++ b/tools/perf/page_sets/key_silk_cases/inbox_app.html
@@ -1,4 +1,13 @@
-// Copyright (c) 2012 The Polymer Authors. All rights reserved.
+<!doctype html>
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<html>
+ <head>
+ <title>app-widgets</title>
+ <script>// Copyright (c) 2012 The Polymer Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -32,4 +41,2626 @@ function PointerGestureEvent(a,b){var c=b||{},d=document.createEvent("Event"),e=
if(m(b))throw new Error("DuplicateDefinitionError: a type with name '"+String(b)+"' is already registered");if(!g.prototype)throw new Error("Options missing required prototype property");return g.name=b.toLowerCase(),g.lifecycle=g.lifecycle||{},g.ancestry=c(g.extends),d(g),e(g),k(g.prototype),n(g.name,g),g.ctor=o(g),g.ctor.prototype=g.prototype,g.prototype.constructor=g.ctor,a.ready&&a.upgradeAll(document),g.ctor}function c(a){var b=m(a);return b?c(b.extends).concat([b]):[]}function d(a){for(var b,c=a.extends,d=0;b=a.ancestry[d];d++)c=b.is&&b.tag;a.tag=c||a.name,c&&(a.is=a.name)}function e(a){if(!Object.__proto__){var b=HTMLElement.prototype;if(a.is){var c=document.createElement(a.tag);b=Object.getPrototypeOf(c)}for(var d,e=a.prototype;e&&e!==b;){var d=Object.getPrototypeOf(e);e.__proto__=d,e=d}}a.native=b}function f(a){return g(x(a.tag),a)}function g(b,c){return c.is&&b.setAttribute("is",c.is),b.removeAttribute("unresolved"),h(b,c),b.__upgraded__=!0,a.upgradeSubtree(b),j(b),b}function h(a,b){Object.__proto__?a.__proto__=b.prototype:(i(a,b.prototype,b.native),a.__proto__=b.prototype)}function i(a,b,c){for(var d={},e=b;e!==c&&e!==HTMLUnknownElement.prototype;){for(var f,g=Object.getOwnPropertyNames(e),h=0;f=g[h];h++)d[f]||(Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(e,f)),d[f]=1);e=Object.getPrototypeOf(e)}}function j(a){a.createdCallback&&a.createdCallback()}function k(a){if(!a.setAttribute._polyfilled){var b=a.setAttribute;a.setAttribute=function(a,c){l.call(this,a,c,b)};var c=a.removeAttribute;a.removeAttribute=function(a){l.call(this,a,null,c)},a.setAttribute._polyfilled=!0}}function l(a,b,c){var d=this.getAttribute(a);c.apply(this,arguments);var e=this.getAttribute(a);this.attributeChangedCallback&&e!==d&&this.attributeChangedCallback(a,d,e)}function m(a){return a?w[a.toLowerCase()]:void 0}function n(a,b){w[a]=b}function o(a){return function(){return f(a)}}function p(a,b){var c=m(b||a);return c?new c.ctor:x(a)}function q(a){if(!a.__upgraded__&&a.nodeType===Node.ELEMENT_NODE){var b=a.getAttribute("is")||a.localName,c=m(b);return c&&g(a,c)}}function r(b){var c=y.call(this,b);return a.upgradeAll(c),c}a||(a=window.CustomElements={flags:{}});var s=a.flags,t=Boolean(document.register),u=!s.register&&t;if(u){var v=function(){};a.registry={},a.upgradeElement=v,a.watchShadow=v,a.upgrade=v,a.upgradeAll=v,a.upgradeSubtree=v,a.observeDocument=v,a.upgradeDocument=v,a.takeRecords=v}else{var w={},x=document.createElement.bind(document),y=Node.prototype.cloneNode;document.register=b,document.createElement=p,Node.prototype.cloneNode=r,a.registry=w,a.upgrade=q}a.hasNative=t,a.useNative=u}(window.CustomElements),function(){function a(a){return"link"===a.localName&&a.getAttribute("rel")===b}var b=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none",c={selectors:["link[rel="+b+"]"],map:{link:"parseLink"},parse:function(a){if(!a.__parsed){a.__parsed=!0;var b=a.querySelectorAll(c.selectors);d(b,function(a){c[c.map[a.localName]](a)}),CustomElements.upgradeDocument(a),CustomElements.observeDocument(a)}},parseLink:function(b){a(b)&&this.parseImport(b)},parseImport:function(a){a.content&&c.parse(a.content)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=c}(),function(a){function b(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document);var a=window.Platform&&Platform.endOfMicrotask?Platform.endOfMicrotask:setTimeout;a(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(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState||a.flags.eager)b();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var c=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(c,b)}else b()}(window.CustomElements),function(){var a=document.createElement("style");a.textContent="element {display: none !important;} /* injected by platform.js */";var b=document.querySelector("head");if(b.insertBefore(a,b.firstChild),window.ShadowDOMPolyfill){var c=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],d={};c.forEach(function(a){d[a]=CustomElements[a]}),c.forEach(function(a){CustomElements[a]=function(b){return d[a](wrap(b))}})}}(),function(a){function b(a){f.textContent=d++,e.push(a)}function c(){for(;e.length;)e.shift()()}var d=0,e=[],f=document.createTextNode("");new(window.MutationObserver||JsMutationObserver)(c).observe(f,{characterData:!0}),a.endOfMicrotask=b}(Platform),function(a){a=a||{},a.external=a.external||{};var b={shadow:function(a){return a?a.shadowRoot||a.webkitShadowRoot:void 0},canTarget:function(a){return a&&Boolean(a.elementFromPoint)},targetingShadow:function(a){var b=this.shadow(a);return this.canTarget(b)?b:void 0},olderShadow:function(a){var b=a.olderShadowRoot;if(!b){var c=a.querySelector("shadow");c&&(b=c.olderShadowRoot)}return b},allShadows:function(a){for(var b=[],c=this.shadow(a);c;)b.push(c),c=this.olderShadow(c);return b},searchRoot:function(a,b,c){if(a){var d,e,f=a.elementFromPoint(b,c);for(e=this.targetingShadow(f);e;){if(d=e.elementFromPoint(b,c)){var g=this.targetingShadow(d);return this.searchRoot(g,b,c)||d}e=this.olderShadow(e)}return f}},owner:function(a){for(var b=a;b.parentNode;)b=b.parentNode;return b},findTarget:function(a){var b=a.clientX,c=a.clientY,d=this.owner(a.target);return d.elementFromPoint(b,c)||(d=document),this.searchRoot(d,b,c)}};a.targetFinding=b,a.findTarget=b.findTarget.bind(b),window.PointerEventsPolyfill=a}(window.PointerEventsPolyfill),function(){function a(a){return"body ^^ "+b(a)}function b(a){return'[touch-action="'+a+'"]'}function c(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; touch-action-delay: none; }"}var d=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],e="";d.forEach(function(d){String(d)===d?(e+=b(d)+c(d)+"\n",e+=a(d)+c(d)+"\n"):(e+=d.selectors.map(b)+c(d.rule)+"\n",e+=d.selectors.map(a)+c(d.rule)+"\n")});var f=document.createElement("style");f.textContent=e,document.head.appendChild(f)}(),function(a){function b(a,e){e=e||{};var f=e.buttons;if(void 0===f)switch(e.which){case 1:f=1;break;case 2:f=4;break;case 3:f=2;break;default:f=0}var i;if(c)i=new MouseEvent(a,e);else{i=document.createEvent("MouseEvent");for(var j,k={},l=0;l<g.length;l++)j=g[l],k[j]=e[j]||h[l];i.initMouseEvent(a,k.bubbles,k.cancelable,k.view,k.detail,k.screenX,k.screenY,k.clientX,k.clientY,k.ctrlKey,k.altKey,k.shiftKey,k.metaKey,k.button,k.relatedTarget)}i.__proto__=b.prototype,d||Object.defineProperty(i,"buttons",{get:function(){return f},enumerable:!0});var m=0;return m=e.pressure?e.pressure:f?.5:0,Object.defineProperties(i,{pointerId:{value:e.pointerId||0,enumerable:!0},width:{value:e.width||0,enumerable:!0},height:{value:e.height||0,enumerable:!0},pressure:{value:m,enumerable:!0},tiltX:{value:e.tiltX||0,enumerable:!0},tiltY:{value:e.tiltY||0,enumerable:!0},pointerType:{value:e.pointerType||"",enumerable:!0},hwTimestamp:{value:e.hwTimestamp||0,enumerable:!0},isPrimary:{value:e.isPrimary||!1,enumerable:!0}}),i}var c=!1,d=!1;try{var e=new MouseEvent("click",{buttons:1});c=!0,d=1===e.buttons}catch(f){}var g=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget"],h=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null];b.prototype=Object.create(MouseEvent.prototype),a.PointerEvent||(a.PointerEvent=b)}(window),function(a){function b(){if(c){var a=new Map;return a.pointers=d,a}this.keys=[],this.values=[]}var c=window.Map&&window.Map.prototype.forEach,d=function(){return this.size};b.prototype={set:function(a,b){var c=this.keys.indexOf(a);c>-1?this.values[c]=b:(this.keys.push(a),this.values.push(b))},has:function(a){return this.keys.indexOf(a)>-1},"delete":function(a){var b=this.keys.indexOf(a);b>-1&&(this.keys.splice(b,1),this.values.splice(b,1))},get:function(a){var b=this.keys.indexOf(a);return this.values[b]},clear:function(){this.keys.length=0,this.values.length=0},forEach:function(a,b){this.values.forEach(function(c,d){a.call(b,c,this.keys[d],this)},this)},pointers:function(){return this.keys.length}},a.PointerMap=b}(window.PointerEventsPolyfill),function(a){var b=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which"],c=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,void 0,0,0,0,0,0,0,"",0,!1,"",null,null,0],d={targets:new WeakMap,handledEvents:new WeakMap,pointermap:new a.PointerMap,eventMap:{},eventSources:{},eventSourceList:[],registerSource:function(a,b){var c=b,d=c.events;d&&(d.forEach(function(a){c[a]&&(this.eventMap[a]=c[a].bind(c))},this),this.eventSources[a]=c,this.eventSourceList.push(c))},register:function(a){for(var b,c=this.eventSourceList.length,d=0;c>d&&(b=this.eventSourceList[d]);d++)b.register.call(b,a)},unregister:function(a){for(var b,c=this.eventSourceList.length,d=0;c>d&&(b=this.eventSourceList[d]);d++)b.unregister.call(b,a)},contains:a.external.contains||function(a,b){return a.contains(b)},down:function(a){this.fireEvent("pointerdown",a)},move:function(a){this.fireEvent("pointermove",a)},up:function(a){this.fireEvent("pointerup",a)},enter:function(a){a.bubbles=!1,this.fireEvent("pointerenter",a)},leave:function(a){a.bubbles=!1,this.fireEvent("pointerleave",a)},over:function(a){a.bubbles=!0,this.fireEvent("pointerover",a)},out:function(a){a.bubbles=!0,this.fireEvent("pointerout",a)},cancel:function(a){this.fireEvent("pointercancel",a)},leaveOut:function(a){this.contains(a.target,a.relatedTarget)||this.leave(a),this.out(a)},enterOver:function(a){this.contains(a.target,a.relatedTarget)||this.enter(a),this.over(a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b=a.type,c=this.eventMap&&this.eventMap[b];c&&c(a),this.handledEvents.set(a,!0)}},listen:function(a,b){b.forEach(function(b){this.addEvent(a,b)},this)},unlisten:function(a,b){b.forEach(function(b){this.removeEvent(a,b)},this)},addEvent:a.external.addEvent||function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:a.external.removeEvent||function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){this.captureInfo&&(b.relatedTarget=null);var c=new PointerEvent(a,b);return b.preventDefault&&(c.preventDefault=b.preventDefault),this.targets.set(c,this.targets.get(b)||b.target),c},fireEvent:function(a,b){var c=this.makeEvent(a,b);return this.dispatchEvent(c)},cloneEvent:function(a){for(var d,e={},f=0;f<b.length;f++)d=b[f],e[d]=a[d]||c[f];return a.preventDefault&&(e.preventDefault=function(){a.preventDefault()}),e},getTarget:function(a){return this.captureInfo&&this.captureInfo.id===a.pointerId?this.captureInfo.target:this.targets.get(a)},setCapture:function(a,b){this.captureInfo&&this.releaseCapture(this.captureInfo.id),this.captureInfo={id:a,target:b};var c=new PointerEvent("gotpointercapture",{bubbles:!0});this.implicitRelease=this.releaseCapture.bind(this,a),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease),this.targets.set(c,b),this.asyncDispatchEvent(c)},releaseCapture:function(a){if(this.captureInfo&&this.captureInfo.id===a){var b=new PointerEvent("lostpointercapture",{bubbles:!0}),c=this.captureInfo.target;this.captureInfo=null,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease),this.targets.set(b,c),this.asyncDispatchEvent(b)}},dispatchEvent:a.external.dispatchEvent||function(a){var b=this.getTarget(a);return b?b.dispatchEvent(a):void 0},asyncDispatchEvent:function(a){setTimeout(this.dispatchEvent.bind(this,a),0)}};d.boundHandler=d.eventHandler.bind(d),a.dispatcher=d,a.register=d.register.bind(d),a.unregister=d.unregister.bind(d)}(window.PointerEventsPolyfill),function(a){function b(a,b,c,d){this.addCallback=a.bind(d),this.removeCallback=b.bind(d),this.changedCallback=c.bind(d),g&&(this.observer=new g(this.mutationWatcher.bind(this)))}var c=Array.prototype.forEach.call.bind(Array.prototype.forEach),d=Array.prototype.map.call.bind(Array.prototype.map),e=Array.prototype.slice.call.bind(Array.prototype.slice),f=Array.prototype.filter.call.bind(Array.prototype.filter),g=window.MutationObserver||window.WebKitMutationObserver,h="[touch-action]",i={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};b.prototype={watchSubtree:function(b){a.targetFinding.canTarget(b)&&this.observer.observe(b,i)},enableOnSubtree:function(a){this.watchSubtree(a),a===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(a)},installNewSubtree:function(a){c(this.findElements(a),this.addElement,this)},findElements:function(a){return a.querySelectorAll?a.querySelectorAll(h):[]},removeElement:function(a){this.removeCallback(a)},addElement:function(a){this.addCallback(a)},elementChanged:function(a,b){this.changedCallback(a,b)},concatLists:function(a,b){return a.concat(e(b))},installOnLoad:function(){document.addEventListener("DOMContentLoaded",this.installNewSubtree.bind(this,document))},isElement:function(a){return a.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(a){var b=d(a,this.findElements,this);return b.push(f(a,this.isElement)),b.reduce(this.concatLists,[])},mutationWatcher:function(a){a.forEach(this.mutationHandler,this)},mutationHandler:function(a){if("childList"===a.type){var b=this.flattenMutationTree(a.addedNodes);b.forEach(this.addElement,this);var c=this.flattenMutationTree(a.removedNodes);c.forEach(this.removeElement,this)}else"attributes"===a.type&&this.elementChanged(a.target,a.oldValue)}},g||(b.prototype.watchSubtree=function(){console.warn("PointerEventsPolyfill: MutationObservers not found, touch-action will not be dynamically detected")}),a.Installer=b}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=b.pointermap,d=25,e={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(a){b.listen(a,this.events)},unregister:function(a){b.unlisten(a,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(a){for(var b,c=this.lastTouches,e=a.clientX,f=a.clientY,g=0,h=c.length;h>g&&(b=c[g]);g++){var i=Math.abs(e-b.x),j=Math.abs(f-b.y);if(d>=i&&d>=j)return!0}},prepareEvent:function(a){var c=b.cloneEvent(a),d=c.preventDefault;return c.preventDefault=function(){a.preventDefault(),d()},c.pointerId=this.POINTER_ID,c.isPrimary=!0,c.pointerType=this.POINTER_TYPE,c},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var d=c.has(this.POINTER_ID);d&&this.cancel(a);var e=this.prepareEvent(a);c.set(this.POINTER_ID,a),b.down(e)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var c=this.prepareEvent(a);b.move(c)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var d=c.get(this.POINTER_ID);if(d&&d.button===a.button){var e=this.prepareEvent(a);b.up(e),this.cleanupMouse()}}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var c=this.prepareEvent(a);b.enterOver(c)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var c=this.prepareEvent(a);b.leaveOut(c)}},cancel:function(a){var c=this.prepareEvent(a);b.cancel(c),this.cleanupMouse()},cleanupMouse:function(){c["delete"](this.POINTER_ID)}};a.mouseEvents=e}(window.PointerEventsPolyfill),function(a){var b,c=a.dispatcher,d=a.findTarget,e=a.targetFinding.allShadows.bind(a.targetFinding),f=c.pointermap,g=Array.prototype.map.call.bind(Array.prototype.map),h=2500,i=200,j="touch-action",k="string"==typeof document.head.style.touchAction,l={scrollType:new WeakMap,events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){k?c.listen(a,this.events):b.enableOnSubtree(a)},unregister:function(a){k&&c.unlisten(a,this.events)},elementAdded:function(a){var b=a.getAttribute(j),d=this.touchActionToScrollType(b);d&&(this.scrollType.set(a,d),c.listen(a,this.events),e(a).forEach(function(a){this.scrollType.set(a,d),c.listen(a,this.events)},this))},elementRemoved:function(a){this.scrollType["delete"](a),c.unlisten(a,this.events),e(a).forEach(function(a){this.scrollType["delete"](a),c.unlisten(a,this.events)},this)},elementChanged:function(a,b){var c=a.getAttribute(j),d=this.touchActionToScrollType(c),f=this.touchActionToScrollType(b);d&&f?(this.scrollType.set(a,d),e(a).forEach(function(a){this.scrollType.set(a,d)},this)):f?this.elementRemoved(a):d&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(a){var b=a,c=this.scrollTypes;return"none"===b?"none":b===c.XSCROLLER?"X":b===c.YSCROLLER?"Y":c.SCROLLER.exec(b)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){(0===f.pointers()||1===f.pointers()&&f.has(1))&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(a){a.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(a,i)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},touchToPointer:function(a){var b=c.cloneEvent(a);return b.pointerId=a.identifier+2,b.target=d(b),b.bubbles=!0,b.cancelable=!0,b.detail=this.clickCount,b.button=0,b.buttons=1,b.width=a.webkitRadiusX||a.radiusX||0,b.height=a.webkitRadiusY||a.radiusY||0,b.pressure=a.webkitForce||a.force||.5,b.isPrimary=this.isPrimaryTouch(a),b.pointerType=this.POINTER_TYPE,b},processTouches:function(a,b){var c=a.changedTouches,d=g(c,this.touchToPointer,this);d.forEach(function(b){b.preventDefault=function(){this.scrolling=!1,this.firstXY=null,a.preventDefault()}},this),d.forEach(b,this)},shouldScroll:function(a){if(this.firstXY){var b,c=this.scrollType.get(a.currentTarget);if("none"===c)b=!1;else if("XY"===c)b=!0;else{var d=a.changedTouches[0],e=c,f="Y"===c?"X":"Y",g=Math.abs(d["client"+e]-this.firstXY[e]),h=Math.abs(d["client"+f]-this.firstXY[f]);b=g>=h}return this.firstXY=null,b}},findTouch:function(a,b){for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)if(c.identifier===b)return!0},vacuumTouches:function(a){var b=a.touches;if(f.pointers()>=b.length){var c=[];f.forEach(function(a,d){if(1!==d&&!this.findTouch(b,d-2)){var e=a.out;c.push(this.touchToPointer(e))}},this),c.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a),this.setPrimaryTouch(a.changedTouches[0]),this.dedupSynthMouse(a),this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){f.set(a.pointerId,{target:a.target,out:a,outTarget:a.target});c.over(a),c.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=a,d=f.get(b.pointerId);if(d){var e=d.out,g=d.outTarget;c.move(b),e&&g!==b.target&&(e.relatedTarget=b.target,b.relatedTarget=g,e.target=g,b.target?(c.leaveOut(e),c.enterOver(b)):(b.target=g,b.relatedTarget=null,this.cancelOut(b))),d.out=b,d.outTarget=b.target}},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(c.up(a),c.out(a)),this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){c.cancel(a),c.out(a),this.cleanUpPointer(a)},cleanUpPointer:function(a){f["delete"](a.pointerId),this.removePrimaryPointer(a)},dedupSynthMouse:function(b){var c=a.mouseEvents.lastTouches,d=b.changedTouches[0];if(this.isPrimaryTouch(d)){var e={x:d.clientX,y:d.clientY};c.push(e);var f=function(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}.bind(null,c,e);setTimeout(f,h)}}};k||(b=new a.Installer(l.elementAdded,l.elementRemoved,l.elementChanged,l)),a.touchEvents=l}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=b.pointermap,d=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,e={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(a){b.listen(a,this.events)},unregister:function(a){b.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var c=a;return d&&(c=b.cloneEvent(a),c.pointerType=this.POINTER_TYPES[a.pointerType]),c},cleanup:function(a){c["delete"](a)},MSPointerDown:function(a){c.set(a.pointerId,a);var d=this.prepareEvent(a);b.down(d)},MSPointerMove:function(a){var c=this.prepareEvent(a);b.move(c)},MSPointerUp:function(a){var c=this.prepareEvent(a);b.up(c),this.cleanup(a.pointerId)},MSPointerOut:function(a){var c=this.prepareEvent(a);b.leaveOut(c)},MSPointerOver:function(a){var c=this.prepareEvent(a);b.enterOver(c)},MSPointerCancel:function(a){var c=this.prepareEvent(a);b.cancel(c),this.cleanup(a.pointerId)},MSLostPointerCapture:function(a){var c=b.makeEvent("lostpointercapture",a);b.dispatchEvent(c)},MSGotPointerCapture:function(a){var c=b.makeEvent("gotpointercapture",a);b.dispatchEvent(c)}};a.msEvents=e}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher;if(void 0===window.navigator.pointerEnabled){if(Object.defineProperty(window.navigator,"pointerEnabled",{value:!0,enumerable:!0}),window.navigator.msPointerEnabled){var c=window.navigator.msMaxTouchPoints;Object.defineProperty(window.navigator,"maxTouchPoints",{value:c,enumerable:!0}),b.registerSource("ms",a.msEvents)}else b.registerSource("mouse",a.mouseEvents),void 0!==window.ontouchstart&&b.registerSource("touch",a.touchEvents);b.register(document)}}(window.PointerEventsPolyfill),function(a){function b(a){if(!e.pointermap.has(a))throw new Error("InvalidPointerId")}var c,d,e=a.dispatcher,f=window.navigator;f.msPointerEnabled?(c=function(a){b(a),this.msSetPointerCapture(a)},d=function(a){b(a),this.msReleasePointerCapture(a)}):(c=function(a){b(a),e.setCapture(a,this)},d=function(a){b(a),e.releaseCapture(a,this)}),window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:c},releasePointerCapture:{value:d}})}(window.PointerEventsPolyfill),PointerGestureEvent.prototype.preventTap=function(){this.tapPrevented=!0},function(a){a=a||{},a.utils={LCA:{find:function(a,b){if(a===b)return a;if(a.contains){if(a.contains(b))return a;if(b.contains(a))return b}var c=this.depth(a),d=this.depth(b),e=c-d;for(e>0?a=this.walk(a,e):b=this.walk(b,-e);a&&b&&a!==b;)a=this.walk(a,1),b=this.walk(b,1);return a},walk:function(a,b){for(var c=0;b>c;c++)a=a.parentNode;return a},depth:function(a){for(var b=0;a;)b++,a=a.parentNode;return b}}},a.findLCA=function(b,c){return a.utils.LCA.find(b,c)},window.PointerGestures=a}(window.PointerGestures),function(a){function b(){this.ids=[],this.pointers=[]}b.prototype={set:function(a,b){var c=this.ids.indexOf(a);c>-1?this.pointers[c]=b:(this.ids.push(a),this.pointers.push(b))},has:function(a){return this.ids.indexOf(a)>-1},"delete":function(a){var b=this.ids.indexOf(a);b>-1&&(this.ids.splice(b,1),this.pointers.splice(b,1))},get:function(a){var b=this.ids.indexOf(a);return this.pointers[b]},get size(){return this.pointers.length},clear:function(){this.ids.length=0,this.pointers.length=0}},window.Map&&(b=window.Map),a.PointerMap=b}(window.PointerGestures),function(a){var b=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","screenX","screenY","pageX","pageY","tapPrevented"],c=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],d={handledEvents:new WeakMap,targets:new WeakMap,handlers:{},recognizers:{},events:{},registerRecognizer:function(a,b){var c=b;this.recognizers[a]=c,c.events.forEach(function(a){if(c[a]){this.events[a]=!0;var b=c[a].bind(c);this.addHandler(a,b)}},this)},addHandler:function(a,b){var c=a;this.handlers[c]||(this.handlers[c]=[]),this.handlers[c].push(b)},registerTarget:function(a){this.listen(Object.keys(this.events),a)},unregisterTarget:function(a){this.unlisten(Object.keys(this.events),a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b=a.type,c=this.handlers[b];c&&this.makeQueue(c,a),this.handledEvents.set(a,!0)}},makeQueue:function(a,b){var c=this.cloneEvent(b);setTimeout(this.runQueue.bind(this,a,c),0)},runQueue:function(a,b){this.currentPointerId=b.pointerId;for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)c(b);this.currentPointerId=0},listen:function(a,b){a.forEach(function(a){this.addEvent(a,this.boundHandler,!1,b)},this)},unlisten:function(a){a.forEach(function(a){this.removeEvent(a,this.boundHandler,!1,inTarget)},this)},addEvent:function(a,b,c,d){d.addEventListener(a,b,c)},removeEvent:function(a,b,c,d){d.removeEventListener(a,b,c)},makeEvent:function(a,b){return new PointerGestureEvent(a,b)},cloneEvent:function(a){for(var d,e={},f=0;f<b.length;f++)d=b[f],e[d]=a[d]||c[f];return e},dispatchEvent:function(a,b){var c=b||this.targets.get(a);c&&(c.dispatchEvent(a),a.tapPrevented&&this.preventTap(this.currentPointerId))},asyncDispatchEvent:function(a,b){var c=function(){this.dispatchEvent(a,b)}.bind(this);setTimeout(c,0)},preventTap:function(a){var b=this.recognizers.tap;b&&b.preventTap(a)}};d.boundHandler=d.eventHandler.bind(d),a.dispatcher=d;var e=[],f=!1;a.register=function(b){if(f){var c=window.PointerEventsPolyfill;c&&c.register(b),a.dispatcher.registerTarget(b)}else e.push(b)},document.addEventListener("DOMContentLoaded",function(){f=!0,e.push(document),e.forEach(a.register)})}(window.PointerGestures),function(a){var b=a.dispatcher,c={HOLD_DELAY:200,WIGGLE_THRESHOLD:16,events:["pointerdown","pointermove","pointerup","pointercancel"],heldPointer:null,holdJob:null,pulse:function(){var a=Date.now()-this.heldPointer.timeStamp,b=this.held?"holdpulse":"hold";this.fireHold(b,a),this.held=!0},cancel:function(){clearInterval(this.holdJob),this.held&&this.fireHold("release"),this.held=!1,this.heldPointer=null,this.target=null,this.holdJob=null},pointerdown:function(a){a.isPrimary&&!this.heldPointer&&(this.heldPointer=a,this.target=a.target,this.holdJob=setInterval(this.pulse.bind(this),this.HOLD_DELAY))},pointerup:function(a){this.heldPointer&&this.heldPointer.pointerId===a.pointerId&&this.cancel()},pointercancel:function(){this.cancel()},pointermove:function(a){if(this.heldPointer&&this.heldPointer.pointerId===a.pointerId){var b=a.clientX-this.heldPointer.clientX,c=a.clientY-this.heldPointer.clientY;b*b+c*c>this.WIGGLE_THRESHOLD&&this.cancel()}},fireHold:function(a,c){var d={pointerType:this.heldPointer.pointerType};c&&(d.holdTime=c);var e=b.makeEvent(a,d);b.dispatchEvent(e,this.target),e.tapPrevented&&b.preventTap(this.heldPointer.pointerId)}};b.registerRecognizer("hold",c)}(window.PointerGestures),function(a){var b=a.dispatcher,c=new a.PointerMap,d={events:["pointerdown","pointermove","pointerup","pointercancel"],WIGGLE_THRESHOLD:4,clampDir:function(a){return a>0?1:-1},calcPositionDelta:function(a,b){var c=0,d=0;return a&&b&&(c=b.pageX-a.pageX,d=b.pageY-a.pageY),{x:c,y:d}},fireTrack:function(a,c,d){var e=d,f=this.calcPositionDelta(e.downEvent,c),g=this.calcPositionDelta(e.lastMoveEvent,c);g.x&&(e.xDirection=this.clampDir(g.x)),g.y&&(e.yDirection=this.clampDir(g.y));var h={dx:f.x,dy:f.y,ddx:g.x,ddy:g.y,clientX:c.clientX,clientY:c.clientY,pageX:c.pageX,pageY:c.pageY,screenX:c.screenX,screenY:c.screenY,xDirection:e.xDirection,yDirection:e.yDirection,trackInfo:e.trackInfo,relatedTarget:c.target,pointerType:c.pointerType},i=b.makeEvent(a,h);e.lastMoveEvent=c,b.dispatchEvent(i,e.downTarget)},pointerdown:function(a){if(a.isPrimary&&("mouse"===a.pointerType?1===a.buttons:!0)){var b={downEvent:a,downTarget:a.target,trackInfo:{},lastMoveEvent:null,xDirection:0,yDirection:0,tracking:!1};c.set(a.pointerId,b)}},pointermove:function(a){var b=c.get(a.pointerId);if(b)if(b.tracking)this.fireTrack("track",a,b);else{var d=this.calcPositionDelta(b.downEvent,a),e=d.x*d.x+d.y*d.y;e>this.WIGGLE_THRESHOLD&&(b.tracking=!0,this.fireTrack("trackstart",b.downEvent,b),this.fireTrack("track",a,b))}},pointerup:function(a){var b=c.get(a.pointerId);b&&(b.tracking&&this.fireTrack("trackend",a,b),c.delete(a.pointerId))},pointercancel:function(a){this.pointerup(a)}};b.registerRecognizer("track",d)}(window.PointerGestures),function(a){var b=a.dispatcher,c={MIN_VELOCITY:.5,MAX_QUEUE:4,moveQueue:[],target:null,pointerId:null,events:["pointerdown","pointermove","pointerup","pointercancel"],pointerdown:function(a){a.isPrimary&&!this.pointerId&&(this.pointerId=a.pointerId,this.target=a.target,this.addMove(a))},pointermove:function(a){a.pointerId===this.pointerId&&this.addMove(a)},pointerup:function(a){a.pointerId===this.pointerId&&this.fireFlick(a),this.cleanup()},pointercancel:function(){this.cleanup()},cleanup:function(){this.moveQueue=[],this.target=null,this.pointerId=null},addMove:function(a){this.moveQueue.length>=this.MAX_QUEUE&&this.moveQueue.shift(),this.moveQueue.push(a)},fireFlick:function(a){for(var c,d,e,f,g,h,i,j=a,k=this.moveQueue.length,l=0,m=0,n=0,o=0;k>o&&(i=this.moveQueue[o]);o++)c=j.timeStamp-i.timeStamp,d=j.clientX-i.clientX,e=j.clientY-i.clientY,f=d/c,g=e/c,h=Math.sqrt(f*f+g*g),h>n&&(l=f,m=g,n=h);var p=Math.abs(l)>Math.abs(m)?"x":"y",q=this.calcAngle(l,m);if(Math.abs(n)>=this.MIN_VELOCITY){var r=b.makeEvent("flick",{xVelocity:l,yVelocity:m,velocity:n,angle:q,majorAxis:p,pointerType:a.pointerType});b.dispatchEvent(r,this.target)}},calcAngle:function(a,b){return 180*Math.atan2(b,a)/Math.PI}};b.registerRecognizer("flick",c)}(window.PointerGestures),function(a){var b=a.dispatcher,c=new a.PointerMap,d={events:["pointerdown","pointermove","pointerup","pointercancel","keyup"],pointerdown:function(a){a.isPrimary&&!a.tapPrevented&&c.set(a.pointerId,{target:a.target,x:a.clientX,y:a.clientY})},pointermove:function(a){if(a.isPrimary){var b=c.get(a.pointerId);b&&a.tapPrevented&&c.delete(a.pointerId)}},pointerup:function(d){var e=c.get(d.pointerId);if(e&&!d.tapPrevented){var f=a.findLCA(e.target,d.target);if(f){var g=b.makeEvent("tap",{x:d.clientX,y:d.clientY,detail:d.detail,pointerType:d.pointerType});b.dispatchEvent(g,f)}}c.delete(d.pointerId)},pointercancel:function(a){c.delete(a.pointerId)},keyup:function(a){var c=a.keyCode;if(32===c){var d=a.target;d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||b.dispatchEvent(b.makeEvent("tap",{x:0,y:0,detail:0,pointerType:"unavailable"}),d)}},preventTap:function(a){c.delete(a)}};b.registerRecognizer("tap",d)}(window.PointerGestures),function(){"use strict";function a(a){for(;a.parentNode;)a=a.parentNode;return"function"==typeof a.getElementById?a:null}function b(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=Path.get(d),(this.model instanceof PathObserver||this.model instanceof CompoundPathObserver)&&this.path===l?(this.observer=this.model,this.observer.target=this,this.observer.callback=this.valueChanged):this.observer=new PathObserver(this.model,this.path,this.valueChanged,this),this.valueChanged(this.value)}function c(a,c,d,e){this.conditional="?"==c[c.length-1],this.conditional&&(a.removeAttribute(c),c=c.slice(0,-1)),b.call(this,a,c,d,e)}function d(a){switch(a.type){case"checkbox":return m;
case"radio":case"select-multiple":case"select-one":return"change";default:return"input"}}function e(a,c,e,f){b.call(this,a,c,e,f),this.eventType=d(this.node),this.boundNodeValueChanged=this.nodeValueChanged.bind(this),this.node.addEventListener(this.eventType,this.boundNodeValueChanged,!0)}function f(b){if(b.form)return j(b.form.elements,function(a){return a!=b&&"INPUT"==a.tagName&&"radio"==a.type&&a.name==b.name});var c=a(b);if(!c)return[];var d=c.querySelectorAll('input[type="radio"][name="'+b.name+'"]');return j(d,function(a){return a!=b&&!a.form})}function g(a,b,c){e.call(this,a,"checked",b,c)}function h(a,b,c){e.call(this,a,"value",b,c)}function i(a,b,c,d){e.call(this,a,b,c,d)}var j=Array.prototype.filter.call.bind(Array.prototype.filter),k="__proto__"in{}?function(a){return a}:function(a){var b=a.__proto__;if(!b)return a;var c=Object.create(b);return Object.getOwnPropertyNames(a).forEach(function(b){Object.defineProperty(c,b,Object.getOwnPropertyDescriptor(a,b))}),c};"function"!=typeof document.contains&&(Document.prototype.contains=function(a){return a===this||a.parentNode===this?!0:this.documentElement.contains(a)}),Node.prototype.bind=function(a,b,c){console.error("Unhandled binding to Node: ",this,a,b,c)},Node.prototype.unbind=function(a){this.bindings||(this.bindings={});var b=this.bindings[a];b&&("function"==typeof b.close&&b.close(),this.bindings[a]=void 0)},Node.prototype.unbindAll=function(){if(this.bindings){for(var a=Object.keys(this.bindings),b=0;b<a.length;b++){var c=this.bindings[a[b]];c&&c.close()}this.bindings={}}};var l=Path.get("value");b.prototype={valueChanged:function(a){this.node[this.property]=this.sanitizeBoundValue(a)},sanitizeBoundValue:function(a){return void 0==a?"":String(a)},close:function(){this.closed||(this.observer.close(),this.observer=void 0,this.node=void 0,this.model=void 0,this.closed=!0)},get value(){return this.observer.value},set value(a){this.observer.setValue(a)},reset:function(){this.observer.reset()}},Text.prototype.bind=function(a,c,d){return"textContent"!==a?Node.prototype.bind.call(this,a,c,d):(this.unbind(a),this.bindings[a]=new b(this,"data",c,d))},c.prototype=k({__proto__:b.prototype,valueChanged:function(a){return this.conditional?(a?this.node.setAttribute(this.property,""):this.node.removeAttribute(this.property),void 0):(this.node.setAttribute(this.property,this.sanitizeBoundValue(a)),void 0)}}),Element.prototype.bind=function(a,b,d){return this.unbind(a),this.bindings[a]=new c(this,a,b,d)};var m;!function(){var a=document.createElement("div"),b=a.appendChild(document.createElement("input"));b.setAttribute("type","checkbox");var c,d=0;b.addEventListener("click",function(){d++,c=c||"click"}),b.addEventListener("change",function(){d++,c=c||"change"});var e=document.createEvent("MouseEvent");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),b.dispatchEvent(e),m=1==d?"change":c}(),e.prototype=k({__proto__:b.prototype,nodeValueChanged:function(){this.value=this.node[this.property],this.reset(),this.postUpdateBinding(),Platform.performMicrotaskCheckpoint()},postUpdateBinding:function(){},close:function(){this.closed||(this.node.removeEventListener(this.eventType,this.boundNodeValueChanged,!0),b.prototype.close.call(this))}}),g.prototype=k({__proto__:e.prototype,sanitizeBoundValue:function(a){return Boolean(a)},postUpdateBinding:function(){"INPUT"===this.node.tagName&&"radio"===this.node.type&&f(this.node).forEach(function(a){var b=a.bindings.checked;b&&(b.value=!1)})}}),HTMLInputElement.prototype.bind=function(a,b,c){return"value"!==a&&"checked"!==a?HTMLElement.prototype.bind.call(this,a,b,c):(this.unbind(a),this.removeAttribute(a),this.bindings[a]="value"===a?new e(this,"value",b,c):new g(this,b,c))},HTMLTextAreaElement.prototype.bind=function(a,b,c){return"value"!==a?HTMLElement.prototype.bind.call(this,a,b,c):(this.unbind(a),this.removeAttribute(a),this.bindings[a]=new e(this,a,b,c))},h.prototype=k({__proto__:e.prototype,valueChanged:function(a){var b,c,d=this.node.parentNode instanceof HTMLSelectElement?this.node.parentNode:void 0;d&&d.bindings&&d.bindings.value instanceof i&&(b=d.bindings.value,c=d.value),e.prototype.valueChanged.call(this,a),b&&!b.closed&&d.value!==c&&b.nodeValueChanged()}}),HTMLOptionElement.prototype.bind=function(a,b,c){return"value"!==a?HTMLElement.prototype.bind.call(this,a,b,c):(this.unbind(a),this.removeAttribute(a),this.bindings[a]=new h(this,b,c))},i.prototype=k({__proto__:e.prototype,valueChanged:function(a){function b(){d.node[d.property]=a,d.node[d.property]!=a&&c--&&n(b)}if(this.node[this.property]=a,this.node[this.property]!=a){var c=2,d=this;n(b)}}}),HTMLSelectElement.prototype.bind=function(a,b,c){return"selectedindex"===a&&(a="selectedIndex"),"selectedIndex"!==a&&"value"!==a?HTMLElement.prototype.bind.call(this,a,b,c):(this.unbind(a),this.removeAttribute(a),this.bindings[a]=new i(this,a,b,c))};var n=function(){function a(a){this.nextRunner=a,this.value=!1,this.lastValue=this.value,this.scheduled=[],this.scheduledIds=[],this.running=!1,this.observer=new PathObserver(this,"value",this.run,this)}function b(a){var b=a[e];a[e]||(b=d++,a[e]=b),c.schedule(a,b)}a.prototype={schedule:function(a,b){if(!this.scheduledIds[b]){if(this.running)return this.nextRunner.schedule(a,b);this.scheduledIds[b]=!0,this.scheduled.push(a),this.lastValue===this.value&&(this.value=!this.value)}},run:function(){this.running=!0;for(var a=0;a<this.scheduled.length;a++){var b=this.scheduled[a],c=b[e];this.scheduledIds[c]=!1,"function"==typeof b?b():b.resolve()}this.scheduled=[],this.scheduledIds=[],this.lastValue=this.value,this.running=!1}};var c=new a(new a),d=1,e="__scheduledId__";return b}()}(this),function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a){for(;a.parentNode;)a=a.parentNode;return"function"==typeof a.getElementById?a:null}function d(a){return H[a.tagName]&&a.hasAttribute("template")}function e(a){return"TEMPLATE"==a.tagName||d(a)}function f(a){return I&&"TEMPLATE"==a.tagName}function g(a,b){var c=a.querySelectorAll(J);e(a)&&b(a),C(c,b)}function h(a){function b(a){HTMLTemplateElement.decorate(a)||h(a.content)}g(a,b)}function i(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function j(a){var b=a.ownerDocument;if(!b.defaultView)return b;var c=b.templateContentsOwner_;if(!c){for(c=b.implementation.createHTMLDocument("");c.lastChild;)c.removeChild(c.lastChild);b.templateContentsOwner_=c}return c}function k(a){if(!a.stagingDocument_){var b=a.ownerDocument;b.stagingDocument_||(b.stagingDocument_=b.implementation.createHTMLDocument(""),b.stagingDocument_.stagingDocument_=b.stagingDocument_),a.stagingDocument_=b.stagingDocument_}return a.stagingDocument_}function l(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];G[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function m(a,b,c){var d=a.content;if(c)return d.appendChild(b),void 0;for(var e;e=b.firstChild;)d.appendChild(e)}function n(a){"TEMPLATE"===a.tagName?I||(L?a.__proto__=HTMLTemplateElement.prototype:i(a,HTMLTemplateElement.prototype)):(i(a,HTMLTemplateElement.prototype),Object.defineProperty(a,"content",N))}function o(a){a.setModelFn_||(a.setModelFn_=function(){v(a,a.model,a.prepareBindingFn_)}),K(a.setModelFn_)}function p(a,b,c,d){if(a&&a.length){for(var e,f=a.length,g=0,h=0,i=0;f>h;){if(g=a.indexOf("{{",h),i=0>g?-1:a.indexOf("}}",g+2),0>i){if(!e)return;e.push(a.slice(h));break}e=e||[],e.push(a.slice(h,g));var j=a.slice(g+2,i).trim();e.push(Path.get(j));var k=d&&d(j,b,c);e.push(k),h=i+2}return h===f&&e.push(""),e.hasOnePath=4===e.length,e.isSimplePath=e.hasOnePath&&""==e[0]&&""==e[3],e.combinator=function(a){for(var b=e[0],c=1;c<e.length;c+=3){var d=e.hasOnePath?a:a[(c-1)/3];void 0!==d&&(b+=d),b+=e[c+2]}return b},e}}function q(a,b,c,d,e){var f,g;b.hasOnePath||(f=new CompoundPathObserver(void 0,void 0,b.combinator)),b.isSimplePath||(g=O);for(var h=1;h<b.length;h+=3){var i=(b[h],d),j=b[h],k=b[h+1],l=k&&k(d,c);void 0!==l&&(i=l,j=O),b.hasOnePath?b.isSimplePath?(f=i,g=j):f=new PathObserver(i,j,void 0,void 0,b.combinator):f.addPath(i,j)}b.hasOnePath||f.start();var m=c.bind(a,f,g);e&&e.push(m)}function r(a,b,c,d){for(var e=0;e<a.length;e+=2)q(a[e],a[e+1],b,c,d)}function s(a,c){b(a);for(var d,f=e(a),g=!1,h=!1,i=0;i<a.attributes.length;i++){for(var j=a.attributes[i],k=j.name,l=j.value;"_"===k[0];)k=k.substring(1);f&&(k===F?(g=!0,l=l||"{{}}"):(k===D||k===E)&&(h=!0,l=l||"{{}}"));var m=p(l,k,a,c);m&&(d=d||[],d.push(k,m))}return g&&!h&&(d=d||[],d.push(D,p("{{}}",D,a,c))),d}function t(a,b){if(a.nodeType===Node.ELEMENT_NODE)return s(a,b);if(a.nodeType===Node.TEXT_NODE){var c=p(a.data,"textContent",a,b);if(c)return["textContent",c]}}function u(a,b,c,d,e){if(b&&(b.templateRef&&(HTMLTemplateElement.decorate(a,b.templateRef),d&&a.setBindingDelegate_(d)),b.length&&r(b,a,c,e),b.children))for(var f=0,g=a.firstChild;g;g=g.nextSibling)u(g,b.children[f++],c,d,e)}function v(a,c,d){b(a);var e=t(a,d);e&&r(e,a,c);for(var f=a.firstChild;f;f=f.nextSibling)v(f,c,d)}function w(a,b){var c=b.importNode(a,!1);if(a.isTemplate_)return c;for(var d=a.firstChild;d;d=d.nextSibling)c.appendChild(w(d,b));return c}function x(a,b){var c=t(a,b);e(a)&&(a.isTemplate_=!0,c=c||[],c.templateRef=a);for(var d=a.firstChild,f=0;d;d=d.nextSibling,f++){var g=x(d,b);g&&(c=c||[],c.children=c.children||{},c.children[f]=g)}return c}function y(a,b,c){this.firstNode=a,this.lastNode=b,this.model=c}function z(a,b){if(a.firstChild)for(var c=new y(a.firstChild,a.lastChild,b),d=c.firstNode;d;)d.templateInstance_=c,d=d.nextSibling}function A(a){this.closed=!1,this.templateElement_=a,this.terminators=[],this.iteratedValue=void 0,this.arrayObserver=void 0,this.depsChanged=!1,this.hasRepeat=!1,this.repeatModel=void 0,this.repeatPath=void 0,this.hasBind=!1,this.bindModel=void 0,this.bindPath=void 0,this.hasIf=!1,this.ifModel=void 0,this.ifPath=void 0}var B,C=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.Map&&"function"==typeof a.Map.prototype.forEach?B=a.Map:(B=function(){this.keys=[],this.values=[]},B.prototype={set:function(a,b){var c=this.keys.indexOf(a);0>c?(this.keys.push(a),this.values.push(b)):this.values[c]=b},get:function(a){var b=this.keys.indexOf(a);if(!(0>b))return this.values[b]},"delete":function(a){var b=this.keys.indexOf(a);return 0>b?!1:(this.keys.splice(b,1),this.values.splice(b,1),!0)},forEach:function(a,b){for(var c=0;c<this.keys.length;c++)a.call(b||this,this.values[c],this.keys[c],this)}});"function"!=typeof document.contains&&(Document.prototype.contains=function(a){return a===this||a.parentNode===this?!0:this.documentElement.contains(a)});var D="bind",E="repeat",F="if",G={template:!0,repeat:!0,bind:!0,ref:!0},H={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0,OPTGROUP:!0},I="undefined"!=typeof HTMLTemplateElement,J="template, "+Object.keys(H).map(function(a){return a.toLowerCase()+"[template]"}).join(", "),K=function(){function a(a){this.nextRunner=a,this.value=!1,this.lastValue=this.value,this.scheduled=[],this.scheduledIds=[],this.running=!1,this.observer=new PathObserver(this,"value",this.run,this)}function b(a){var b=a[e];a[e]||(b=d++,a[e]=b),c.schedule(a,b)}a.prototype={schedule:function(a,b){if(!this.scheduledIds[b]){if(this.running)return this.nextRunner.schedule(a,b);this.scheduledIds[b]=!0,this.scheduled.push(a),this.lastValue===this.value&&(this.value=!this.value)}},run:function(){this.running=!0;for(var a=0;a<this.scheduled.length;a++){var b=this.scheduled[a],c=b[e];this.scheduledIds[c]=!1,"function"==typeof b?b():b.resolve()}this.scheduled=[],this.scheduledIds=[],this.lastValue=this.value,this.running=!1}};var c=new a(new a),d=1,e="__scheduledId__";return b}();document.addEventListener("DOMContentLoaded",function(){h(document),Platform.performMicrotaskCheckpoint()},!1),I||(a.HTMLTemplateElement=function(){throw TypeError("Illegal constructor")});var L="__proto__"in{};HTMLTemplateElement.decorate=function(a,c){if(a.templateIsDecorated_)return!1;var e=a;e.templateIsDecorated_=!0;var g=f(e),i=g,k=!g,o=!1;if(!g&&d(e)&&(b(!c),e=l(a),e.templateIsDecorated_=!0,g=f(e),o=!0),!g){n(e);var p=j(e);e.content_=p.createDocumentFragment()}return c?e.instanceRef_=c:k?m(e,a,o):i&&h(e.content),!0},HTMLTemplateElement.bootstrap=h;var M=a.HTMLUnknownElement||HTMLElement,N={get:function(){return this.content_},enumerable:!0,configurable:!0};I||(HTMLTemplateElement.prototype=Object.create(M.prototype),Object.defineProperty(HTMLTemplateElement.prototype,"content",N)),i(HTMLTemplateElement.prototype,{bind:function(a,b,c){return this.iterator_||(this.iterator_=new A(this)),this.bindings=this.bindings||{},"bind"===a?(this.iterator_.hasBind=!0,this.iterator_.bindModel=b,this.iterator_.bindPath=c,this.iterator_.depsChanging||(this.iterator_.depsChanging=!0,K(this.iterator_)),this.bindings.bind=this.iterator_):"repeat"===a?(this.iterator_.hasRepeat=!0,this.iterator_.repeatModel=b,this.iterator_.repeatPath=c,this.iterator_.depsChanging||(this.iterator_.depsChanging=!0,K(this.iterator_)),this.bindings.repeat=this.iterator_):"if"===a?(this.iterator_.hasIf=!0,this.iterator_.ifModel=b,this.iterator_.ifPath=c,this.iterator_.depsChanging||(this.iterator_.depsChanging=!0,K(this.iterator_)),this.bindings.if=this.iterator_):HTMLElement.prototype.bind.call(this,a,b,c)},unbind:function(a){if("bind"===a){if(!this.iterator_)return;return this.iterator_.hasBind=!1,this.iterator_.bindModel=void 0,this.iterator_.bindPath=void 0,this.iterator_.depsChanging||(this.iterator_.depsChanging=!0,K(this.iterator_)),this.bindings.bind=void 0}if("repeat"===a){if(!this.iterator_)return;return this.iterator_.hasRepeat=!1,this.iterator_.repeatModel=void 0,this.iterator_.repeatPath=void 0,this.iterator_.depsChanging||(this.iterator_.depsChanging=!0,K(this.iterator_)),this.bindings.repeat=void 0}if("if"===a){if(!this.iterator_)return;return this.iterator_.hasIf=!1,this.iterator_.ifModel=void 0,this.iterator_.ifPath=void 0,this.iterator_.depsChanging||(this.iterator_.depsChanging=!0,K(this.iterator_)),this.bindings.if=void 0}return HTMLElement.prototype.unbind.call(this,a)},createInstance:function(a,b){var c=this.ref.content,d=c.bindingMap_;d||(d=x(c,this.prepareBindingFn_)||[],c.bindingMap_=d);var e=k(this),f=w(c,e);return u(f,d,a,this.bindingDelegate_,b),z(f,a),f},get model(){return this.model_},set model(a){this.model_=a,o(this)},get bindingDelegate(){return this.bindingDelegate_},setBindingDelegate_:function(a){function b(b){var c=a&&a[b];if("function"==typeof c)return function(){return c.apply(a,arguments)}}this.bindingDelegate_=a,this.prepareBindingFn_=b("prepareBinding"),this.prepareInstanceModelFn_=b("prepareInstanceModel"),this.prepareInstancePositionChangedFn_=b("prepareInstancePositionChanged")},set bindingDelegate(a){this.setBindingDelegate_(a),o(this)},get ref(){var a,b=this.getAttribute("ref");if(b){var d=c(this);d&&(a=d.getElementById(b))}if(a||(a=this.instanceRef_),!a)return this;var e=a.ref;return e?e:a}});var O=Path.get("value");Object.defineProperty(Node.prototype,"templateInstance",{get:function(){var a=this.templateInstance_;return a?a:this.parentNode?this.parentNode.templateInstance:void 0}}),A.prototype={resolve:function(){if(this.depsChanging=!1,this.valueObserver&&(this.valueObserver.close(),this.valueObserver=void 0),!this.hasRepeat&&!this.hasBind)return this.valueChanged(),void 0;var a=this.hasRepeat===!0,b=a?this.repeatModel:this.bindModel,c=a?this.repeatPath:this.bindPath;if(this.hasIf){var d=function(b){var c=b[0],d=b[1];return d?a?c:[c]:void 0};this.valueObserver=new CompoundPathObserver(this.valueChanged,this,d),this.valueObserver.addPath(b,c),this.valueObserver.addPath(this.ifModel,this.ifPath),this.valueObserver.start()}else{var d=this.hasRepeat?void 0:function(a){return[a]};this.valueObserver=new PathObserver(b,c,this.valueChanged,this,d)}this.valueChanged(this.valueObserver.value)},valueChanged:function(a){Array.isArray(a)||(a=void 0);var b=this.iteratedValue;this.unobserve(),this.iteratedValue=a,this.iteratedValue&&(this.arrayObserver=new ArrayObserver(this.iteratedValue,this.handleSplices,this));var c=ArrayObserver.calculateSplices(this.iteratedValue||[],b||[]);c.length&&this.handleSplices(c)},getTerminatorAt:function(a){if(-1==a)return this.templateElement_;var b=this.terminators[2*a];if(b.nodeType!==Node.ELEMENT_NODE||this.templateElement_===b)return b;var c=b.iterator_;return c?c.getTerminatorAt(c.terminators.length/2-1):b},insertInstanceAt:function(a,b,c,d){var e=this.getTerminatorAt(a-1),f=e;b?f=b.lastChild||f:c&&(f=c[c.length-1]||f),this.terminators.splice(2*a,0,f,d);var g=this.templateElement_.parentNode,h=e.nextSibling;if(b)g.insertBefore(b,h);else if(c)for(var i=0;i<c.length;i++)g.insertBefore(c[i],h)},extractInstanceAt:function(a){var b=[],c=this.getTerminatorAt(a-1),d=this.getTerminatorAt(a);b.bound=this.terminators[2*a+1],this.terminators.splice(2*a,2);for(var e=this.templateElement_.parentNode;d!==c;){var f=c.nextSibling;f==d&&(d=c),e.removeChild(f),b.push(f)}return b},getDelegateFn:function(a){return a=a&&a(this.templateElement_),"function"==typeof a?a:null},handleSplices:function(a){if(!this.closed){var b=this.templateElement_;if(!b.parentNode||!b.ownerDocument.defaultView)return this.close(),void 0;void 0===this.instanceModelFn_&&(this.instanceModelFn_=this.getDelegateFn(b.prepareInstanceModelFn_)),void 0===this.instancePositionChangedFn_&&(this.instancePositionChangedFn_=this.getDelegateFn(b.prepareInstancePositionChangedFn_));var c=new B,d=0;a.forEach(function(a){a.removed.forEach(function(b){var e=this.extractInstanceAt(a.index+d);c.set(b,e)},this),d-=a.addedCount},this),a.forEach(function(a){for(var b=a.index;b<a.index+a.addedCount;b++){var d,e=this.iteratedValue[b],f=void 0,g=c.get(e);g?(c.delete(e),d=g.bound):(d=[],this.instanceModelFn_&&(e=this.instanceModelFn_(e)),void 0!==e&&(f=this.templateElement_.createInstance(e,d))),this.insertInstanceAt(b,f,g,d)}},this),c.forEach(function(a){this.closeInstanceBindings(a.bound)},this),this.instancePositionChangedFn_&&this.reportInstancesMoved(a)}},reportInstanceMoved:function(a){var b=this.getTerminatorAt(a-1),c=this.getTerminatorAt(a);if(b!==c){var d=b.nextSibling.templateInstance;this.instancePositionChangedFn_(d,a)}},reportInstancesMoved:function(a){for(var b=0,c=0,d=0;d<a.length;d++){var e=a[d];if(0!=c)for(;b<e.index;)this.reportInstanceMoved(b),b++;else b=e.index;for(;b<e.index+e.addedCount;)this.reportInstanceMoved(b),b++;c+=e.addedCount-e.removed.length}if(0!=c)for(var f=this.terminators.length/2;f>b;)this.reportInstanceMoved(b),b++},closeInstanceBindings:function(a){for(var b=0;b<a.length;b++)a[b].close()},unobserve:function(){this.arrayObserver&&(this.arrayObserver.close(),this.arrayObserver=void 0)},close:function(){if(!this.closed){this.unobserve();for(var a=1;a<this.terminators.length;a+=2)this.closeInstanceBindings(this.terminators[a]);this.terminators.length=0,this.valueObserver&&this.valueObserver.close(),this.valueObserver=void 0,this.templateElement_.iterator_=void 0,this.closed=!0}}},HTMLTemplateElement.forAllTemplatesFrom_=g}(this),function(a){"use strict";function b(a,b){if(!a)throw new Error("ASSERT: "+b)}function c(a){return a>=48&&57>=a}function d(a){return 32===a||9===a||11===a||12===a||160===a||a>=5760&&" ᠎              ".indexOf(String.fromCharCode(a))>0}function e(a){return 10===a||13===a||8232===a||8233===a}function f(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a}function g(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a||a>=48&&57>=a}function h(a){return"this"===a}function i(){for(;Y>X&&d(W.charCodeAt(X));)++X}function j(){var a,b;for(a=X++;Y>X&&(b=W.charCodeAt(X),g(b));)++X;return W.slice(a,X)}function k(){var a,b,c;return a=X,b=j(),c=1===b.length?S.Identifier:h(b)?S.Keyword:"null"===b?S.NullLiteral:"true"===b||"false"===b?S.BooleanLiteral:S.Identifier,{type:c,value:b,range:[a,X]}}function l(){var a,b,c=X,d=W.charCodeAt(X),e=W[X];switch(d){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:return++X,{type:S.Punctuator,value:String.fromCharCode(d),range:[c,X]};default:if(a=W.charCodeAt(X+1),61===a)switch(d){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 124:return X+=2,{type:S.Punctuator,value:String.fromCharCode(d)+String.fromCharCode(a),range:[c,X]};case 33:case 61:return X+=2,61===W.charCodeAt(X)&&++X,{type:S.Punctuator,value:W.slice(c,X),range:[c,X]}}}return b=W[X+1],e===b&&"&|".indexOf(e)>=0?(X+=2,{type:S.Punctuator,value:e+b,range:[c,X]}):"<>=!+-*%&|^/".indexOf(e)>=0?(++X,{type:S.Punctuator,value:e,range:[c,X]}):(s({},V.UnexpectedToken,"ILLEGAL"),void 0)}function m(){var a,d,e;if(e=W[X],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=X,a="","."!==e){for(a=W[X++],e=W[X],"0"===a&&e&&c(e.charCodeAt(0))&&s({},V.UnexpectedToken,"ILLEGAL");c(W.charCodeAt(X));)a+=W[X++];e=W[X]}if("."===e){for(a+=W[X++];c(W.charCodeAt(X));)a+=W[X++];e=W[X]}if("e"===e||"E"===e)if(a+=W[X++],e=W[X],("+"===e||"-"===e)&&(a+=W[X++]),c(W.charCodeAt(X)))for(;c(W.charCodeAt(X));)a+=W[X++];else s({},V.UnexpectedToken,"ILLEGAL");return f(W.charCodeAt(X))&&s({},V.UnexpectedToken,"ILLEGAL"),{type:S.NumericLiteral,value:parseFloat(a),range:[d,X]}}function n(){var a,c,d,f="",g=!1;for(a=W[X],b("'"===a||'"'===a,"String literal must starts with a quote"),c=X,++X;Y>X;){if(d=W[X++],d===a){a="";break}if("\\"===d)if(d=W[X++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===W[X]&&++X;else switch(d){case"n":f+="\n";break;case"r":f+="\r";break;case"t":f+=" ";break;case"b":f+="\b";break;case"f":f+="\f";break;case"v":f+=" ";break;default:f+=d}else{if(e(d.charCodeAt(0)))break;f+=d}}return""!==a&&s({},V.UnexpectedToken,"ILLEGAL"),{type:S.StringLiteral,value:f,octal:g,range:[c,X]}}function o(a){return a.type===S.Identifier||a.type===S.Keyword||a.type===S.BooleanLiteral||a.type===S.NullLiteral}function p(){var a;return i(),X>=Y?{type:S.EOF,range:[X,X]}:(a=W.charCodeAt(X),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(W.charCodeAt(X+1))?m():l():c(a)?m():l())}function q(){var a;return a=$,X=a.range[1],$=p(),X=a.range[1],a}function r(){var a;a=X,$=p(),X=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(c<e.length,"Message reference must be in range"),e[c]});throw d=new Error(f),d.index=X,d.description=f,d}function t(a){s(a,V.UnexpectedToken,a.value)}function u(a){var b=q();(b.type!==S.Punctuator||b.value!==a)&&t(b)}function v(a){return $.type===S.Punctuator&&$.value===a}function w(a){return $.type===S.Keyword&&$.value===a}function x(){var a=[];for(u("[");!v("]");)v(",")?(q(),a.push(null)):(a.push(bb()),v("]")||u(","));return u("]"),Z.createArrayExpression(a)}function y(){var a;return i(),a=q(),a.type===S.StringLiteral||a.type===S.NumericLiteral?Z.createLiteral(a):Z.createIdentifier(a.value)}function z(){var a,b;return a=$,i(),(a.type===S.EOF||a.type===S.Punctuator)&&t(a),b=y(),u(":"),Z.createProperty("init",b,bb())}function A(){var a=[];for(u("{");!v("}");)a.push(z()),v("}")||u(",");return u("}"),Z.createObjectExpression(a)}function B(){var a;return u("("),a=bb(),u(")"),a}function C(){var a,b,c;return v("(")?B():(a=$.type,a===S.Identifier?c=Z.createIdentifier(q().value):a===S.StringLiteral||a===S.NumericLiteral?c=Z.createLiteral(q()):a===S.Keyword?w("this")&&(q(),c=Z.createThisExpression()):a===S.BooleanLiteral?(b=q(),b.value="true"===b.value,c=Z.createLiteral(b)):a===S.NullLiteral?(b=q(),b.value=null,c=Z.createLiteral(b)):v("[")?c=x():v("{")&&(c=A()),c?c:(t(q()),void 0))}function D(){var a=[];if(u("("),!v(")"))for(;Y>X&&(a.push(bb()),!v(")"));)u(",");return u(")"),a}function E(){var a;return a=q(),o(a)||t(a),Z.createIdentifier(a.value)}function F(){return u("."),E()}function G(){var a;return u("["),a=bb(),u("]"),a}function H(){var a,b;for(a=C();v(".")||v("[");)v("[")?(b=G(),a=Z.createMemberExpression("[",a,b)):(b=F(),a=Z.createMemberExpression(".",a,b));return a}function I(){var a,b;return $.type!==S.Punctuator&&$.type!==S.Keyword?b=ab():v("+")||v("-")||v("!")?(a=q(),b=I(),b=Z.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},V.UnexpectedToken):b=ab(),b}function J(a){var b=0;if(a.type!==S.Punctuator&&a.type!==S.Keyword)return 0;switch(a.value){case"||":b=1;break;case"&&":b=2;break;case"==":case"!=":case"===":case"!==":b=6;break;case"<":case">":case"<=":case">=":case"instanceof":b=7;break;case"in":b=7;break;case"+":case"-":b=9;break;case"*":case"/":case"%":b=11}return b}function K(){var a,b,c,d,e,f,g,h;if(g=I(),b=$,c=J(b),0===c)return g;for(b.prec=c,q(),e=I(),d=[g,b,e];(c=J($))>0;){for(;d.length>2&&c<=d[d.length-2].prec;)e=d.pop(),f=d.pop().value,g=d.pop(),a=Z.createBinaryExpression(f,g,e),d.push(a);b=q(),b.prec=c,d.push(b),a=I(),d.push(a)}for(h=d.length-1,a=d[h];h>1;)a=Z.createBinaryExpression(d[h-1].value,d[h-2],a),h-=2;return a}function L(){var a,b,c;return a=K(),v("?")&&(q(),b=L(),u(":"),c=L(),a=Z.createConditionalExpression(a,b,c)),a}function M(){var a,b;return a=q(),a.type!==S.Identifier&&t(a),b=v("(")?D():[],Z.createFilter(a.value,b)}function N(){for(;v("|");)q(),M()}function O(){i(),r();var a=bb();a&&(","===$.value||"in"==$.value&&a.type===U.Identifier?Q(a):(N(),"as"===$.value?P(a):Z.createTopLevel(a))),$.type!==S.EOF&&t($)}function P(a){q();var b=q().value;Z.createAsExpression(a,b)}function Q(a){var b;","===$.value&&(q(),$.type!==S.Identifier&&t($),b=q().value),q();var c=bb();N(),Z.createInExpression(a.name,b,c)}function R(a,b){return Z=b,W=a,X=0,Y=W.length,$=null,_={labelSet:{}},O()}var S,T,U,V,W,X,Y,Z,$,_;S={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},T={},T[S.BooleanLiteral]="Boolean",T[S.EOF]="<end>",T[S.Identifier]="Identifier",T[S.Keyword]="Keyword",T[S.NullLiteral]="Null",T[S.NumericLiteral]="Numeric",T[S.Punctuator]="Punctuator",T[S.StringLiteral]="String",U={ArrayExpression:"ArrayExpression",BinaryExpression:"BinaryExpression",CallExpression:"CallExpression",ConditionalExpression:"ConditionalExpression",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",Identifier:"Identifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ThisExpression:"ThisExpression",UnaryExpression:"UnaryExpression"},V={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"};var ab=H,bb=L;a.esprima={parse:R}}(this),function(a){"use strict";function b(a,b,d,e){var f;try{if(f=c(a),f.scopeIdent&&(d.nodeType!==Node.ELEMENT_NODE||"TEMPLATE"!==d.tagName||"bind"!==b&&"repeat"!==b))throw Error("as and in can only be used within <template bind/repeat>")}catch(g){return console.error("Invalid expression syntax: "+a,g),void 0}return function(a,b){var c=f.getBinding(a,e);return f.scopeIdent&&c&&(b.polymerExpressionScopeIdent_=f.scopeIdent,f.indexIdent&&(b.polymerExpressionIndexIdent_=f.indexIdent)),c}}function c(a){var b=n[a];if(!b){var c=new j;esprima.parse(a,c),b=new k(c),n[a]=b}return b}function d(a){this.value=a}function e(a,b,c){this.delegate=a,this.name=b,this.last=c}function f(a,b){this.object=a,this.property=b}function g(a,b){this.name=a,this.args=[];for(var c=0;c<b.length;c++)this.args[c]=i(b[c])}function h(){throw Error("Not Implemented")}function i(a){return"function"==typeof a?a:a.valueFn()}function j(){this.expression=null,this.filters=[],this.deps={},this.depsList=[],this.currentPath=void 0,this.scopeIdent=void 0,this.indexIdent=void 0}function k(a){if(this.scopeIdent=a.scopeIdent,this.indexIdent=a.indexIdent,!a.expression)throw Error("No expression found.");this.expression=a.expression,i(this.expression),this.paths=a.depsList,this.filters=a.filters}function l(a){return String(a).replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})}function m(){}var n=Object.create(null);d.prototype={valueFn:function(){var a=this.value;return function(){return a}}},e.prototype={getPath:function(){return this.path_||(this.path_=this.last?Path.get(this.last.getPath()+"."+this.name):Path.get(this.name)),this.path_},valueFn:function(){if(!this.valueFn_){var a=this.getPath(),b=this.delegate.deps[a];void 0===b&&(b=this.delegate.deps[a]=this.delegate.depsList.length,this.delegate.depsList.push(a));var c=this.delegate.depsList;this.valueFn_=function(a){return 1===c.length?a:a[b]}}return this.valueFn_},setValue:function(a,b){return this.getPath().setValueFrom(a,b)}},f.prototype={valueFn:function(){var a=this.object,b=this.property;return function(c){return a(c)[b(c)]}},setValue:function(a,b,c){a=this.object(c);var d=this.property(c);return a[d]=b}},g.prototype={transform:function(a,b,c,d,e){var f=d[this.name];if(f)e=void 0;else if(f=e[this.name],!f)return console.error("Cannot find filter: "+this.name),void 0;if(c?f=f.toModel:"function"==typeof f.toDOM&&(f=f.toDOM),"function"!=typeof f)return console.error("No "+(c?"toModel":"toDOM")+" found on"+this.name),void 0;for(var g=[a],h=0;h<this.args.length;h++)g[h+1]=i(this.args[h])(b);return f.apply(e,g)}};var o={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},p={"+":function(a,b){return a+b},"-":function(a,b){return a-b},"*":function(a,b){return a*b},"/":function(a,b){return a/b},"%":function(a,b){return a%b},"<":function(a,b){return b>a},">":function(a,b){return a>b},"<=":function(a,b){return b>=a},">=":function(a,b){return a>=b},"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"===":function(a,b){return a===b},"!==":function(a,b){return a!==b},"&&":function(a,b){return a&&b},"||":function(a,b){return a||b}};j.prototype={createUnaryExpression:function(a,b){if(!o[a])throw Error("Disallowed operator: "+a);return b=i(b),function(c){return o[a](b(c))}},createBinaryExpression:function(a,b,c){if(!p[a])throw Error("Disallowed operator: "+a);return b=i(b),c=i(c),function(d){return p[a](b(d),c(d))}},createConditionalExpression:function(a,b,c){return a=i(a),b=i(b),c=i(c),function(d){return a(d)?b(d):c(d)}},createIdentifier:function(a){var b=new e(this,a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){if(b instanceof e){if("."==a)return new e(this,c.name,b);if(c instanceof d&&Path.get(c.value).valid)return new e(this,c.value,b)}return new f(i(b),i(c))},createLiteral:function(a){return new d(a.value)},createArrayExpression:function(a){for(var b=0;b<a.length;b++)a[b]=i(a[b]);return function(b){for(var c=[],d=0;d<a.length;d++)c.push(a[d](b));return c}},createProperty:function(a,b,c){return{key:b instanceof e?b.name:b.value,value:c}},createObjectExpression:function(a){for(var b=0;b<a.length;b++)a[b].value=i(a[b].value);return function(b){for(var c={},d=0;d<a.length;d++)c[a[d].key]=a[d].value(b);return c}},createFilter:function(a,b){this.filters.push(new g(a,b))},createAsExpression:function(a,b){this.expression=a,this.scopeIdent=b},createInExpression:function(a,b,c){this.expression=c,this.scopeIdent=a,this.indexIdent=b},createTopLevel:function(a){this.expression=a},createThisExpression:h},k.prototype={getBinding:function(a,b){function c(c){return f.getValue(c,b,a)}function d(c){var d;if(1==f.paths.length)d=f.paths[0].getValueFrom(a);else{d=[];for(var e=0;e<f.paths.length;e++)d[e]=f.paths[e].getValueFrom(a)}f.setValue(a,c,d,b,a)}var e=this.paths;if(!e.length)return{value:this.getValue(void 0,b,a)};var f=this;if(1===e.length)return new PathObserver(a,e[0],void 0,void 0,c,d);for(var g=new CompoundPathObserver(void 0,void 0,c,d),h=0;h<e.length;h++)g.addPath(a,e[h]);return g.start(),g},getValue:function(a,b,c){for(var d=i(this.expression)(a),e=0;e<this.filters.length;e++)d=this.filters[e].transform(d,a,!1,b,c);return d},setValue:function(a,b,c,d,e){for(var f=this.filters?this.filters.length:0;f-->0;)b=this.filters[f].transform(b,c,!0,d,e);
return this.expression.setValue?this.expression.setValue(a,b,c):void 0}},m.prototype={styleObject:function(a){var b=[];for(var c in a)b.push(l(c)+": "+a[c]);return b.join("; ")},tokenList:function(a){var b=[];for(var c in a)a[c]&&b.push(c);return b.join(" ")},prepareInstancePositionChanged:function(a){var b=a.polymerExpressionIndexIdent_;if(b)return function(a,c){a.model[b]=c}},prepareBinding:function(a,c,d){return Path.get(a).valid?void 0:b(a,c,d,this)},prepareInstanceModel:function(a){var b=a.polymerExpressionScopeIdent_;if(b){var c=a.templateInstance?a.templateInstance.model:a.model;return function(a){var d=Object.create(c);return d[b]=a,d}}}},a.PolymerExpressions=m}(this),function(a){function b(){e||(e=!0,a.endOfMicrotask(function(){e=!1,logFlags.data&&console.group("Platform.flush()"),a.performMicrotaskCheckpoint(),logFlags.data&&console.groupEnd()}))}var c=document.createElement("style");c.textContent="template {display: none !important;} /* injected by platform.js */";var d=document.querySelector("head");d.insertBefore(c,d.firstChild);var e,f=125;if(window.addEventListener("WebComponentsReady",function(){b(),Observer.hasObjectObserve||(a.flushPoll=setInterval(b,f))}),window.CustomElements&&!CustomElements.useNative){var g=Document.prototype.importNode;Document.prototype.importNode=function(a,b){var c=g.call(this,a,b);return CustomElements.upgradeAll(c),c}}a.flush=b}(window.Platform);
-//# sourceMappingURL=platform.js.map
+//# sourceMappingURL=platform.js.map</script>
+ <meta name="viewport" content="width=device-width, user-scalable=no">
+
+
+
+
+
+
+<!--
+ Copyright 2013 The Polymer Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style
+ license that can be found in the LICENSE file.
+-->
+<script>// Copyright (c) 2012 The Polymer Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// @version: 0.1.1
+Polymer={},"function"==typeof window.Polymer&&(Polymer={}),function(a){function b(a,b){return a&&b&&Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&(Object.defineProperty(a,c,d),"function"==typeof d.value&&(d.value.nom=c))}),a}a.extend=b}(Polymer),function(a){function b(a,b,d){return a?a.stop():a=new c(this),a.go(b,d),a}var c=function(a){this.context=a};c.prototype={go:function(a,b){this.callback=a,this.handle=setTimeout(this.complete.bind(this),b)},stop:function(){this.handle&&(clearTimeout(this.handle),this.handle=null)},complete:function(){this.handle&&(this.stop(),this.callback.call(this.context))}},a.job=b}(Polymer),function(){var a={};HTMLElement.register=function(b,c){a[b]=c},HTMLElement.getPrototypeForTag=function(b){var c=b?a[b]:HTMLElement.prototype;return c||Object.getPrototypeOf(document.createElement(b))};var b=Event.prototype.stopPropagation;Event.prototype.stopPropagation=function(){this.cancelBubble=!0,b.apply(this,arguments)},HTMLImports.importer.preloadSelectors+=", polymer-element link[rel=stylesheet]"}(Polymer),function(a){function b(a){var c=b.caller,g=c.nom,h=c._super;if(h||(g||(g=c.nom=e.call(this,c)),g||console.warn("called super() on a method not installed declaratively (has no .nom property)"),h=d(c,g,f(this))),h){var i=h[g];return i._super||d(i,g,h),i.apply(this,a||[])}}function c(a,b,c){for(;a;){if(a[b]!==c&&a[b])return a;a=f(a)}}function d(a,b,d){return a._super=c(d,b,a),a._super&&(a._super[b].nom=b),a._super}function e(a){for(var b=this.__proto__;b&&b!==HTMLElement.prototype;){for(var c,d=Object.getOwnPropertyNames(b),e=0,f=d.length;f>e&&(c=d[e]);e++){var g=Object.getOwnPropertyDescriptor(b,c);if("function"==typeof g.value&&g.value===a)return c}b=b.__proto__}}function f(a){return a.__proto__}a.super=b}(Polymer),function(a){function b(a,b){var d=typeof b;return b instanceof Date&&(d="date"),c[d](a,b)}var c={string:function(a){return a},date:function(a){return new Date(Date.parse(a)||Date.now())},"boolean":function(a){return""===a?!0:"false"===a?!1:!!a},number:function(a){var b=parseFloat(a);return String(b)===a?b:a},object:function(a,b){if(null===b)return a;try{return JSON.parse(a.replace(/'/g,'"'))}catch(c){return a}},"function":function(a,b){return b}};a.deserializeValue=b}(Polymer),function(a){var b={};b.declaration={},b.instance={},a.api=b}(Polymer),function(a){var b={async:function(a,b,c){Platform.flush(),b=b&&b.length?b:[b];var d=function(){(this[a]||a).apply(this,b)}.bind(this);return c?setTimeout(d,c):requestAnimationFrame(d)},fire:function(a,b,c,d){var e=c||this;return e.dispatchEvent(new CustomEvent(a,{bubbles:void 0!==d?d:!0,detail:b})),b},asyncFire:function(){this.async("fire",arguments)},classFollows:function(a,b,c){b&&b.classList.remove(c),a&&a.classList.add(c)}};b.asyncMethod=b.async,a.api.instance.utils=b}(Polymer),function(a){function b(a){for(;a.parentNode;)a=a.parentNode;return a.host}var c=window.logFlags||{},d="on-",e={EVENT_PREFIX:d,hasEventPrefix:function(a){return a&&"o"===a[0]&&"n"===a[1]&&"-"===a[2]},removeEventPrefix:function(a){return a.slice(f)},addHostListeners:function(){var a=this.eventDelegates;c.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a),this.addNodeListeners(this,a,this.hostEventListener)},addNodeListeners:function(a,b,c){var d;for(var e in b)d||(d=c.bind(this)),this.addNodeListener(a,e,d)},addNodeListener:function(a,b,c){a.addEventListener(b,c)},hostEventListener:function(a){if(!a.cancelBubble){c.events&&console.group("[%s]: hostEventListener(%s)",this.localName,a.type);var b=this.findEventDelegate(a);b&&(c.events&&console.log("[%s] found host handler name [%s]",this.localName,b),this.dispatchMethod(this,b,[a,a.detail,this])),c.events&&console.groupEnd()}},findEventDelegate:function(a){return this.eventDelegates[a.type]},dispatchMethod:function(a,b,d){if(a){c.events&&console.group("[%s] dispatch [%s]",a.localName,b);var e="function"==typeof b?b:a[b];e&&e[d?"apply":"call"](a,d),c.events&&console.groupEnd(),Platform.flush()}},prepareBinding:function(a,d){return e.hasEventPrefix(d)?function(f,g){c.events&&console.log('event: [%s].%s => [%s].%s()"',g.localName,f.localName,a);var h=function(c){var d=b(g);if(d&&d.dispatchMethod){var e=d,h=a;"@"==a[0]&&(e=f,h=Path.get(a.slice(1)).getValueFrom(f)),d.dispatchMethod(e,h,[c,c.detail,g])}},i=e.removeEventPrefix(d);return g.addEventListener(i,h,!1),{close:function(){c.events&&console.log('event.remove: [%s].%s => [%s].%s()"',g.localName,d,f.localName,a),g.removeEventListener(i,h,!1)}}}:void 0}},f=d.length;a.api.instance.events=e}(Polymer),function(a){var b={copyInstanceAttributes:function(){var a=this._instanceAttributes;for(var b in a)this.hasAttribute(b)||this.setAttribute(b,a[b])},takeAttributes:function(){if(this._publishLC)for(var a,b=0,c=this.attributes,d=c.length;(a=c[b])&&d>b;b++)this.attributeToProperty(a.name,a.value)},attributeToProperty:function(b,c){var b=this.propertyForAttribute(b);if(b){if(c&&c.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var b=this._publishLC&&this._publishLC[a];return b},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a,b){return"boolean"===b?a?"":void 0:"object"!==b&&"function"!==b&&void 0!==a?a:void 0},reflectPropertyToAttribute:function(a){var b=typeof this[a],c=this.serializeValue(this[a],b);void 0!==c?this.setAttribute(a,c):"boolean"===b&&this.removeAttribute(a)}};a.api.instance.attributes=b}(Polymer),function(a){function b(a){return new CompoundPathObserver(a.notifyPropertyChanges,a)}function c(a,b,c,e){d.bind&&console.log(f,c.localName||"object",e,a.localName,b);var g=Path.get(e),h=g.getValueFrom(c);return(null===h||void 0===h)&&g.setValueFrom(c,a[b]),PathObserver.defineProperty(a,b,c,e)}var d=window.logFlags||{},e={observeProperties:function(){var a=this._observeNames,c=this._publishNames;if(a&&a.length||c&&c.length){for(var d,e=this._propertyObserver=b(this),f=0,g=a.length;g>f&&(d=a[f]);f++){e.addPath(this,d);var h=Object.getOwnPropertyDescriptor(this.__proto__,d);h&&h.value&&this.observeArrayValue(d,h.value,null)}for(var d,f=0,g=c.length;g>f&&(d=c[f]);f++)this.observe&&void 0!==this.observe[d]||e.addPath(this,d);e.start()}},notifyPropertyChanges:function(a,b,c,d){for(var e,f,g={},h=0,i=c.length;i>h;h++)c[h]&&(e=d[2*h+1],void 0!==this.publish[e]&&this.reflectPropertyToAttribute(e),f=this.observe[e],f&&(this.observeArrayValue(e,a[h],b[h]),g[f]||(g[f]=!0,this.invokeMethod(f,[b[h],a[h],arguments]))))},observeArrayValue:function(a,b,c){var e=this.observe[a];if(e&&(Array.isArray(c)&&(d.observe&&console.log("[%s] observeArrayValue: unregister observer [%s]",this.localName,a),this.unregisterObserver(a+"__array")),Array.isArray(b))){d.observe&&console.log("[%s] observeArrayValue: register observer [%s]",this.localName,a,b);var f=this,g=new ArrayObserver(b,function(a,b){f.invokeMethod(e,[b])});this.registerObserver(a+"__array",g)}},bindProperty:function(a,b,d){return c(this,a,b,d)},unbindAllProperties:function(){this._propertyObserver&&this._propertyObserver.close(),this.unregisterObservers()},unbindProperty:function(a){return this.unregisterObserver(a)},invokeMethod:function(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)},registerObserver:function(a,b){var c=this._observers||(this._observers={});c[a]=b},unregisterObserver:function(a){var b=this._observers;return b&&b[a]?(b[a].close(),b[a]=null,!0):void 0},unregisterObservers:function(){if(this._observers){for(var a,b,c=Object.keys(this._observers),d=0,e=c.length;e>d&&(a=c[d]);d++)b=this._observers[a],b.close();this._observers={}}}},f="[%s]: bindProperties: [%s] to [%s].[%s]";a.api.instance.properties=e}(Polymer),function(a){function b(a){d(a,c)}function c(a){a.unbindAll()}function d(a,b){if(a){b(a);for(var c=a.firstChild;c;c=c.nextSibling)d(c,b)}}var e=window.logFlags||0,f=a.api.instance.events,g=PolymerExpressions.prototype.prepareBinding;PolymerExpressions.prototype.prepareBinding=function(a,b,c){return f.prepareBinding(a,b,c)||g.call(this,a,b,c)};var h=new PolymerExpressions,i={syntax:h,instanceTemplate:function(a){return a.bindingDelegate=this.syntax,a.createInstance(this)},bind:function(a,b,c){this._elementPrepared||this.prepareElement();var d=this.propertyForAttribute(a);if(d){this.unbind(a);var e=this.bindProperty(d,b,c);return e.path=c,this.reflectPropertyToAttribute(d),this.bindings[a]=e}return this.super(arguments)},asyncUnbindAll:function(){this._unbound||(e.unbind&&console.log("[%s] asyncUnbindAll",this.localName),this._unbindAllJob=this.job(this._unbindAllJob,this.unbindAll,0))},unbindAll:function(){if(!this._unbound){this.unbindAllProperties(),this.super();for(var a=this.shadowRoot;a;)b(a),a=a.olderShadowRoot;this._unbound=!0}},cancelUnbindAll:function(a){return this._unbound?(e.unbind&&console.warn("[%s] already unbound, cannot cancel unbindAll",this.localName),void 0):(e.unbind&&console.log("[%s] cancelUnbindAll",this.localName),this._unbindAllJob&&(this._unbindAllJob=this._unbindAllJob.stop()),a||d(this.shadowRoot,function(a){a.cancelUnbindAll&&a.cancelUnbindAll()}),void 0)}},j=/\{\{([^{}]*)}}/;a.bindPattern=j,a.api.instance.mdv=i}(Polymer),function(a){function b(a){return a.hasOwnProperty("PolymerBase")}function c(){}var d=0,e={PolymerBase:!0,job:Polymer.job,"super":Polymer.super,created:function(){},ready:function(){},createdCallback:function(){this.created(),(this.ownerDocument.defaultView||this.alwaysPrepare||d>0)&&this.prepareElement()},prepareElement:function(){this._elementPrepared=!0,this.observeProperties(),this.copyInstanceAttributes(),this.takeAttributes(),this.addHostListeners(),d++,this.parseDeclarations(this.__proto__),d--,this.ready()},enteredViewCallback:function(){this._elementPrepared||this.prepareElement(),this.cancelUnbindAll(!0),this.enteredView&&this.enteredView()},leftViewCallback:function(){this.preventDispose||this.asyncUnbindAll(),this.leftView&&this.leftView()},enteredDocumentCallback:function(){this.enteredViewCallback()},leftDocumentCallback:function(){this.leftViewCallback()},parseDeclarations:function(a){a&&a.element&&(this.parseDeclarations(a.__proto__),a.parseDeclaration.call(this,a.element))},parseDeclaration:function(a){var b=this.fetchTemplate(a);b&&(this.element.hasAttribute("lightdom")?this.lightFromTemplate(b):this.shadowFromTemplate(b))},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemplate:function(a){if(a){var b=(this.shadowRoot,this.createShadowRoot());b.applyAuthorStyles=this.applyAuthorStyles,b.resetStyleInheritance=this.resetStyleInheritance;var c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady(b,a),b}},lightFromTemplate:function(a){if(a){var b=this.instanceTemplate(a);return this.appendChild(b),this.shadowRootReady(this,a),b}},shadowRootReady:function(a){this.marshalNodeReferences(a),PointerGestures.register(a)},marshalNodeReferences:function(a){var b=this.$=this.$||{};if(a)for(var c,d=a.querySelectorAll("[id]"),e=0,f=d.length;f>e&&(c=d[e]);e++)b[c.id]=c},attributeChangedCallback:function(a){"class"!==a&&"style"!==a&&this.attributeToProperty(a,this.getAttribute(a)),this.attributeChanged&&this.attributeChanged.apply(this,arguments)},onMutation:function(a,b){var c=new MutationObserver(function(a){b.call(this,c,a),c.disconnect()}.bind(this));c.observe(a,{childList:!0,subtree:!0})}};c.prototype=e,e.constructor=c,a.Base=c,a.isBase=b,a.api.instance.base=e}(Polymer),function(a){function b(a){return a.__proto__}var c=(window.logFlags||{},"element"),d="controller",e={STYLE_SCOPE_ATTRIBUTE:c,installControllerStyles:function(){var a=this.findStyleController();if(a&&!this.scopeHasElementStyle(a,d)){for(var c=b(this),e="";c&&c.element;)e+=c.element.cssTextForScope(d),c=b(c);if(e){var f=this.element.cssTextToScopeStyle(e,d);Polymer.applyStyleToScope(f,a)}}},findStyleController:function(){if(window.ShadowDOMPolyfill)return wrap(document.head);for(var a=this;a.parentNode;)a=a.parentNode;return a===document?document.head:a},scopeHasElementStyle:function(a,b){var d=c+"="+this.localName+"-"+b;return a.querySelector("style["+d+"]")}};a.api.instance.styles=e}(Polymer),function(a){var b={addResolvePathApi:function(){var a=this.elementPath(),b=this.getAttribute("assetpath")||"",c=this.relPath;this.prototype.resolvePath=function(d){var e=d;if(b){var f=b.slice(0,-1);e=c(f,e)}return a+b+e}},elementPath:function(){return this.urlToPath(HTMLImports.getDocumentUrl(this.ownerDocument))},relPath:function(a,b){for(var c=a.split("/"),d=b.split("/"),e=!1;c.length&&d.length&&c[0]===d[0];)c.shift(),d.shift(),e=!0;if(e)for(var f=0;f<c.length;f++)d.unshift("..");return d.join("/")},urlToPath:function(a){if(a){var b=a.split("/");return b.pop(),b.push(""),b.join("/")}return""}};a.api.declaration.path=b}(Polymer),function(a){function b(a,b){if(a){var d=c(a.textContent),e=a.getAttribute(g);e&&d.setAttribute(g,e),b.appendChild(d)}}function c(a){var b=document.createElement("style");return b.textContent=a,b}function d(a){return a&&a.__resource||""}function e(a,b){return n?n.call(a,b):void 0}var f=(window.logFlags||{},a.api.instance.styles),g=f.STYLE_SCOPE_ATTRIBUTE,h="style",i="[rel=stylesheet]",j="global",k="polymer-scope",l={installSheets:function(){this.cacheSheets(),this.cacheStyles(),this.installLocalSheets(),this.installGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(i),this.sheets.forEach(function(a){a.parentNode&&a.parentNode.removeChild(a)})},cacheStyles:function(){this.styles=this.findNodes(h+"["+k+"]"),this.styles.forEach(function(a){a.parentNode&&a.parentNode.removeChild(a)})},installLocalSheets:function(){var a=this.sheets.filter(function(a){return!a.hasAttribute(k)}),b=this.templateContent();if(b){var e="";a.forEach(function(a){e+=d(a)+"\n"}),e&&b.insertBefore(c(e),b.firstChild)}},findNodes:function(a,b){var c=this.querySelectorAll(a).array(),d=this.templateContent();if(d){var e=d.querySelectorAll(a).array();c=c.concat(e)}return b?c.filter(b):c},templateContent:function(){var a=this.querySelector("template");return a&&templateContent(a)},installGlobalStyles:function(){var a=this.styleForScope(j);b(a,document.head)},cssTextForScope:function(a){var b="",c="["+k+"="+a+"]",f=function(a){return e(a,c)},g=this.sheets.filter(f);g.forEach(function(a){b+=d(a)+"\n\n"});var h=this.styles.filter(f);return h.forEach(function(a){b+=a.textContent+"\n\n"}),b},styleForScope:function(a){var b=this.cssTextForScope(a);return this.cssTextToScopeStyle(b,a)},cssTextToScopeStyle:function(a,b){if(a){var d=c(a);return d.setAttribute(g,this.getAttribute("name")+"-"+b),d}}},m=HTMLElement.prototype,n=m.matches||m.matchesSelector||m.webkitMatchesSelector||m.mozMatchesSelector;a.api.declaration.styles=l,a.applyStyleToScope=b}(Polymer),function(a){var b=a.api.instance.events,c=(window.logFlags||{},{parseHostEvents:function(){var a=this.prototype.eventDelegates;this.addAttributeDelegates(a)},addAttributeDelegates:function(a){for(var c,d=0;c=this.attributes[d];d++)b.hasEventPrefix(c.name)&&(a[b.removeEventPrefix(c.name)]=c.value.replace("{{","").replace("}}","").trim())},event_translations:{webkitanimationstart:"webkitAnimationStart",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitionEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"}});a.api.declaration.events=c}(Polymer),function(a){var b={inferObservers:function(a){var b,c=a.observe;for(var d in a)"Changed"===d.slice(-7)&&(c||(c=a.observe={}),b=d.slice(0,-7),c[b]=c[b]||d)},optimizePropertyMaps:function(a){if(a.observe){var b=a._observeNames=[];for(var c in a.observe)b.push(c)}if(a.publish){var b=a._publishNames=[];for(var c in a.publish)b.push(c)}},publishProperties:function(a,b){var c=a.publish;c&&(this.requireProperties(c,a,b),a._publishLC=this.lowerCaseMap(c))},requireProperties:function(a,b,c){for(var d in a)void 0===b[d]&&void 0===c[d]&&(b[d]=a[d])},lowerCaseMap:function(a){var b={};for(var c in a)b[c.toLowerCase()]=c;return b}};a.api.declaration.properties=b}(Polymer),function(a){var b="attributes",c={inheritAttributesObjects:function(a){this.inheritObject(a,"publishLC"),this.inheritObject(a,"_instanceAttributes")},publishAttributes:function(a,c){var d=this.getAttribute(b);if(d)for(var e,f=a.publish||(a.publish={}),g=d.split(d.indexOf(",")>=0?",":" "),h=0,i=g.length;i>h;h++)e=g[h].trim(),e&&void 0===f[e]&&void 0===c[e]&&(f[e]=null)},accumulateInstanceAttributes:function(){for(var a,b=this.prototype._instanceAttributes,c=this.attributes,d=0,e=c.length;e>d&&(a=c[d]);d++)this.isInstanceAttribute(a.name)&&(b[a.name]=a.value)},isInstanceAttribute:function(a){return!this.blackList[a]&&"on-"!==a.slice(0,3)},blackList:{name:1,"extends":1,constructor:1,noscript:1}};c.blackList[b]=1,a.api.declaration.attributes=c}(Polymer),function(a){function b(a){if(!Object.__proto__){var b=Object.getPrototypeOf(a);a.__proto__=b,d(b)&&(b.__proto__=Object.getPrototypeOf(b))}}var c=a.api,d=a.isBase,e=a.extend,f={register:function(a,b){this.prototype=this.buildPrototype(a,b),this.prototype.element=this,this.desugar(a,b),this.registerPrototype(a,b),this.publishConstructor()},buildPrototype:function(c,d){var e=a.getRegisteredPrototype(c),f=this.generateBasePrototype(d);return this.publishAttributes(e,f),this.publishProperties(e,f),this.inferObservers(e),this.inheritMetaData(e,f),e=this.chainObject(e,f),this.optimizePropertyMaps(e),b(e),e},inheritMetaData:function(a,b){this.inheritObject("observe",a,b),this.inheritObject("publish",a,b),this.inheritObject("_publishLC",a,b),this.inheritObject("_instanceAttributes",a,b),this.inheritObject("eventDelegates",a,b)},desugar:function(a,b){this.accumulateInstanceAttributes(),this.parseHostEvents(),this.installSheets(),this.adjustShadowElement(),this.addResolvePathApi(),window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimStyling(this.templateContent(),a,b),this.prototype.registerCallback&&this.prototype.registerCallback(this)},adjustShadowElement:function(){if(!window.ShadowDOMPolyfill){var a=this.templateContent();if(a)for(var b,c=a.querySelectorAll("shadow"),d=0,e=c.length;e>d&&(b=c[d]);d++)b.children.length||b.appendChild(document.createElement("content"))}},publishConstructor:function(){var a=this.getAttribute("constructor");a&&(window[a]=this.ctor)},generateBasePrototype:function(a){var b=this.findBasePrototype(a);if(!b){var b=HTMLElement.getPrototypeForTag(a);b=this.ensureBaseApi(b),memoizedBases[a]=b}return b},findBasePrototype:function(a){return memoizedBases[a]},ensureBaseApi:function(a){if(!a.PolymerBase){a=Object.create(a);for(var b in c.instance)e(a,c.instance[b])}return a},inheritObject:function(a,b,c){var d=b[a]||{};b[a]=this.chainObject(d,c[a])},registerPrototype:function(a,b){var c={prototype:this.prototype},d=this.findTypeExtension(b);d&&(c.extends=d),this.ctor=document.register(a,c),this.prototype.constructor=this.ctor,HTMLElement.register(a,this.prototype)},findTypeExtension:function(a){if(a&&a.indexOf("-")<0)return a;var b=this.findBasePrototype(a);return b.element?this.findTypeExtension(b.element.extends):void 0}};f.chainObject=Object.__proto__?function(a,b){return a&&b&&a!==b&&(a.__proto__=b),a}:function(a,b){if(a&&b&&a!==b){var c=Object.create(b);a=e(c,a)}return a},memoizedBases={},c.declaration.prototype=f}(Polymer),function(a){function b(a,b){k[a]=b||{},d(a)}function c(a){return k[a]}function d(a){l[a]&&(l[a].registerWhenReady(),delete l[a])}function e(a){n[a]=!0;var b=m[a];b&&(b.forEach(function(a){a.registerWhenReady()}),delete m[a])}function f(a){return n[a]}function g(a){window.HTMLImports&&!HTMLImports.readyTime?addEventListener("HTMLImportsLoaded",a):a()}var h=a.extend,i=a.api.declaration,j=h(Object.create(HTMLElement.prototype),{createdCallback:function(){this.name=this.getAttribute("name"),this.extends=this.getAttribute("extends"),this.registerWhenReady()},registerWhenReady:function(){if(!this.waitingForPrototype(this.name)){var a=this.extends;this.waitingForExtendee(a)||(document.contains(this)?g(function(){this._register(a)}.bind(this)):this._register(a))}},_register:function(a){this.register(this.name,a),e(this.name)},waitingForPrototype:function(a){if(!c(a)){if(l[a]=this,this.hasAttribute("noscript"))if(window.CustomElements&&!CustomElements.useNative)b(a);else{var d=document.createElement("script");d.textContent="Polymer('"+a+"');",this.appendChild(d)}return!0}},waitingForExtendee:function(a){return a&&a.indexOf("-")>=0&&!f(a)?((m[a]=m[a]||[]).push(this),!0):void 0}});Object.keys(i).forEach(function(a){h(j,i[a])});var k={},l={},m={},n={};a.getRegisteredPrototype=c,h(b,a),window.Polymer=b,document.register("polymer-element",{prototype:j})}(Polymer);
+//# sourceMappingURL=polymer.js.map</script>
+<!-- <link rel="import" href="../polymer-dev/polymer.html"> -->
+<!DOCTYPE html>
+
+<script>"use strict";
+
+(function(exports) {
+
+function Animator(delegate) {
+ this.delegate = delegate;
+ this.startTimeStamp = 0;
+ this.request_ = null;
+};
+
+Animator.prototype.scheduleAnimation_ = function() {
+ if (this.request_)
+ return;
+ this.request_ = requestAnimationFrame(this.onAnimation_.bind(this));
+};
+
+Animator.prototype.startAnimation = function() {
+ this.startTimeStamp = 0;
+ this.scheduleAnimation_();
+};
+
+Animator.prototype.stopAnimation = function() {
+ cancelAnimationFrame(this.request_);
+ this.startTimeStamp = 0;
+ this.request_ = null;
+};
+
+Animator.prototype.onAnimation_ = function(timeStamp) {
+ this.request_ = null;
+ if (!this.startTimeStamp)
+ this.startTimeStamp = timeStamp;
+ if (this.delegate.onAnimation(timeStamp))
+ this.scheduleAnimation_();
+};
+
+function VelocityTracker() {
+ this.recentTouchMoves_ = [];
+ this.velocityX = 0;
+ this.velocityY = 0;
+}
+
+VelocityTracker.kTimeWindow = 50;
+
+VelocityTracker.prototype.pruneHistory_ = function(timeStamp) {
+ for (var i = 0; i < this.recentTouchMoves_.length; ++i) {
+ if (this.recentTouchMoves_[i].timeStamp > timeStamp - VelocityTracker.kTimeWindow) {
+ this.recentTouchMoves_ = this.recentTouchMoves_.slice(i);
+ return;
+ }
+ }
+ // All touchmoves are old.
+ this.recentTouchMoves_ = [];
+};
+
+VelocityTracker.prototype.update_ = function(e) {
+ this.pruneHistory_(e.timeStamp);
+ this.recentTouchMoves_.push(e);
+
+ var oldestTouchMove = this.recentTouchMoves_[0];
+
+ var deltaX = e.changedTouches[0].clientX - oldestTouchMove.changedTouches[0].clientX;
+ var deltaY = e.changedTouches[0].clientY - oldestTouchMove.changedTouches[0].clientY;
+ var deltaT = e.timeStamp - oldestTouchMove.timeStamp;
+
+ if (deltaT > 0) {
+ this.velocityX = deltaX / deltaT;
+ this.velocityY = deltaY / deltaT;
+ } else {
+ this.velocityX = 0;
+ this.velocityY = 0;
+ }
+};
+
+VelocityTracker.prototype.onTouchStart = function(e) {
+ this.recentTouchMoves_.push(e);
+ this.velocityX = 0;
+ this.velocityY = 0;
+};
+
+VelocityTracker.prototype.onTouchMove = function(e) {
+ this.update_(e);
+};
+
+VelocityTracker.prototype.onTouchEnd = function(e) {
+ this.update_(e);
+ this.recentTouchMoves_ = [];
+};
+
+function LinearTimingFunction() {
+};
+
+LinearTimingFunction.prototype.scaleTime = function(fraction) {
+ return fraction;
+};
+
+function CubicBezierTimingFunction(spec) {
+ this.map = [];
+ for (var ii = 0; ii <= 100; ii += 1) {
+ var i = ii / 100;
+ this.map.push([
+ 3 * i * (1 - i) * (1 - i) * spec[0] +
+ 3 * i * i * (1 - i) * spec[2] + i * i * i,
+ 3 * i * (1 - i) * (1 - i) * spec[1] +
+ 3 * i * i * (1 - i) * spec[3] + i * i * i
+ ]);
+ }
+};
+
+CubicBezierTimingFunction.prototype.scaleTime = function(fraction) {
+ var fst = 0;
+ while (fst !== 100 && fraction > this.map[fst][0]) {
+ fst += 1;
+ }
+ if (fraction === this.map[fst][0] || fst === 0) {
+ return this.map[fst][1];
+ }
+ var yDiff = this.map[fst][1] - this.map[fst - 1][1];
+ var xDiff = this.map[fst][0] - this.map[fst - 1][0];
+ var p = (fraction - this.map[fst - 1][0]) / xDiff;
+ return this.map[fst - 1][1] + p * yDiff;
+};
+
+var presetTimingFunctions = {
+ 'linear': new LinearTimingFunction(),
+ 'ease': new CubicBezierTimingFunction([0.25, 0.1, 0.25, 1.0]),
+ 'ease-in': new CubicBezierTimingFunction([0.42, 0, 1.0, 1.0]),
+ 'ease-out': new CubicBezierTimingFunction([0, 0, 0.58, 1.0]),
+ 'ease-in-out': new CubicBezierTimingFunction([0.42, 0, 0.58, 1.0]),
+};
+
+function DrawerController(options) {
+ this.velocityTracker = new VelocityTracker();
+ this.animator = new Animator(this);
+
+ this.target = options.target;
+ this.left = options.left;
+ this.right = options.right;
+ this.position = options.position;
+
+ this.width = this.right - this.left;
+ this.curve = presetTimingFunctions[options.curve || 'linear'];
+
+ this.willOpenCallback = options.willOpen;
+ this.didCloseCallback = options.didClose;
+ this.animateCallback = options.onAnimate;
+
+ this.state = DrawerController.kClosed;
+
+ this.defaultAnimationSpeed = (this.right - this.left) / DrawerController.kBaseSettleDurationMS;
+
+ this.onTouchMove = this.onTouchMove.bind(this);
+ this.onTouchEnd = this.onTouchEnd.bind(this);
+
+ this.target.addEventListener('touchstart', this.onTouchStart.bind(this));
+}
+
+DrawerController.kOpened = 'opened';
+DrawerController.kClosed = 'closed';
+DrawerController.kOpening = 'opening';
+DrawerController.kClosing = 'closing';
+DrawerController.kDragging = 'dragging';
+DrawerController.kFlinging = 'flinging';
+
+DrawerController.kBaseSettleDurationMS = 246;
+DrawerController.kMaxSettleDurationMS = 600;
+
+DrawerController.kMinFlingVelocity = 0.4; // Matches Android framework.
+DrawerController.kTouchSlop = 5; // Matches Android framework.
+DrawerController.kTouchSlopSquare = DrawerController.kTouchSlop * DrawerController.kTouchSlop;
+
+DrawerController.prototype.restrictToCurrent = function(offset) {
+ return Math.max(this.left, Math.min(this.position, offset));
+};
+
+DrawerController.prototype.restrictToBounds = function(offset) {
+ return Math.max(this.left, Math.min(this.right, offset));
+};
+
+DrawerController.prototype.onTouchStart = function(e) {
+ this.velocityTracker.onTouchStart(e);
+
+ var touchX = e.changedTouches[0].clientX;
+ var touchY = e.changedTouches[0].clientY;
+
+ if (this.state != DrawerController.kOpened) {
+ if (touchX != this.restrictToCurrent(touchX))
+ return;
+ this.state = DrawerController.kDragging;
+ }
+
+ this.animator.stopAnimation();
+ this.target.addEventListener('touchmove', this.onTouchMove);
+ this.target.addEventListener('touchend', this.onTouchEnd);
+ // TODO(abarth): Handle touchcancel.
+
+ this.startX = touchX;
+ this.startY = touchY;
+ this.startPosition = this.position;
+ this.touchBaseX = Math.min(touchX, this.startPosition);
+};
+
+DrawerController.prototype.onTouchMove = function(e) {
+ this.velocityTracker.onTouchMove(e);
+
+ if (this.state == DrawerController.kOpened) {
+ var deltaX = e.changedTouches[0].clientX - this.startX;
+ var deltaY = e.changedTouches[0].clientY - this.startY;
+
+ if (deltaX * deltaX + deltaY * deltaY < DrawerController.kTouchSlopSquare) {
+ e.preventDefault();
+ return;
+ }
+
+ if (Math.abs(deltaY) > Math.abs(deltaX)) {
+ this.target.removeEventListener('touchmove', this.onTouchMove);
+ this.target.removeEventListener('touchend', this.onTouchEnd);
+ return;
+ }
+
+ this.state = DrawerController.kDragging;
+ }
+
+ e.preventDefault();
+ var touchDeltaX = e.changedTouches[0].clientX - this.touchBaseX;
+ this.position = this.restrictToBounds(this.startPosition + touchDeltaX);
+ this.animateCallback.call(this.target, this.position);
+};
+
+DrawerController.prototype.onTouchEnd = function(e) {
+ this.velocityTracker.onTouchEnd(e);
+ this.target.removeEventListener('touchmove', this.onTouchMove);
+ this.target.removeEventListener('touchend', this.onTouchEnd);
+
+ var velocityX = this.velocityTracker.velocityX;
+ if (Math.abs(velocityX) > DrawerController.kMinFlingVelocity) {
+ this.fling(velocityX);
+ } else if (this.isOpen()) {
+ this.open();
+ } else {
+ this.close();
+ }
+};
+
+DrawerController.prototype.openFraction = function() {
+ var width = this.right - this.left;
+ var offset = this.position - this.left;
+ return offset / width;
+};
+
+DrawerController.prototype.isOpen = function() {
+ return this.openFraction() >= 0.5;
+};
+
+DrawerController.prototype.isOpening = function() {
+ return this.state == DrawerController.kOpening ||
+ (this.state == DrawerController.kFlinging && this.animationVelocityX > 0);
+}
+
+DrawerController.prototype.isClosing = function() {
+ return this.state == DrawerController.kClosing ||
+ (this.state == DrawerController.kFlinging && this.animationVelocityX < 0);
+}
+
+DrawerController.prototype.toggle = function() {
+ if (this.isOpen())
+ this.close();
+ else
+ this.open();
+};
+
+DrawerController.prototype.open = function() {
+ if (!this.position)
+ this.willOpenCallback.call(this.target);
+
+ this.animator.stopAnimation();
+ this.animationDuration = DrawerController.kMaxSettleDurationMS;
+ this.state = DrawerController.kOpening;
+ this.animate();
+};
+
+DrawerController.prototype.close = function() {
+ this.animator.stopAnimation();
+ this.animationDuration = DrawerController.kMaxSettleDurationMS;
+ this.state = DrawerController.kClosing;
+ this.animate();
+};
+
+DrawerController.prototype.fling = function(velocityX) {
+ this.animator.stopAnimation();
+ this.animationVelocityX = velocityX;
+ this.state = DrawerController.kFlinging;
+ this.animate();
+};
+
+DrawerController.prototype.animate = function() {
+ this.positionAnimationBase = this.position;
+ this.animator.startAnimation();
+};
+
+DrawerController.prototype.targetPosition = function(deltaT) {
+ if (this.state == DrawerController.kFlinging)
+ return this.positionAnimationBase + this.animationVelocityX * deltaT;
+ var targetFraction = this.curve.scaleTime(deltaT / this.animationDuration);
+ var animationWidth = this.state == DrawerController.kOpening ?
+ this.width - this.positionAnimationBase : -this.positionAnimationBase;
+ return this.positionAnimationBase + targetFraction * animationWidth;
+};
+
+DrawerController.prototype.onAnimation = function(timeStamp) {
+ var deltaT = timeStamp - this.animator.startTimeStamp;
+ var targetPosition = this.targetPosition(deltaT);
+ this.position = this.restrictToBounds(targetPosition);
+
+ this.animateCallback.call(this.target, this.position);
+
+ if (targetPosition <= this.left && this.isClosing()) {
+ this.state = DrawerController.kClosed;
+ this.didCloseCallback.call(this.target);
+ return false;
+ }
+ if (targetPosition >= this.right && this.isOpening()) {
+ this.state = DrawerController.kOpened;
+ return false;
+ }
+
+ return true;
+};
+
+
+function DismissController(options) {
+ this.velocityTracker = new VelocityTracker();
+ this.animator = new Animator(this);
+
+ this.target = options.target;
+ this.moveCallback = options.onMove;
+ this.dismissCallback = options.onDismiss;
+ this.curve = presetTimingFunctions[options.curve || 'linear'];
+
+ this.position = 0;
+ this.width = 0;
+ this.state = DismissController.kInitial;
+
+ this.target.addEventListener('touchstart', this.onTouchStart.bind(this));
+ this.target.addEventListener('touchmove', this.onTouchMove.bind(this));
+ this.target.addEventListener('touchend', this.onTouchEnd.bind(this));
+ // TODO(abarth): Handle touchcancel.
+}
+
+DismissController.kInitial = 'initial';
+DismissController.kDragging = 'dragging';
+DismissController.kSettling = 'settling';
+DismissController.kFlinging = 'flinging';
+DismissController.kDismissed = 'dismissed';
+
+DismissController.prototype.onTouchStart = function(e) {
+ this.velocityTracker.onTouchStart(e);
+
+ this.state = DismissController.kInitial;
+ this.animator.stopAnimation();
+
+ this.startX = e.changedTouches[0].clientX;
+ this.startY = e.changedTouches[0].clientY;
+ this.startPosition = this.position;
+};
+
+DismissController.prototype.onTouchMove = function(e) {
+ this.velocityTracker.onTouchMove(e);
+
+ if (this.state == DismissController.kScrolling)
+ return;
+
+ if (this.state == DismissController.kInitial) {
+ var deltaX = e.changedTouches[0].clientX - this.startX;
+ var deltaY = e.changedTouches[0].clientY - this.startY;
+
+ if (deltaX * deltaX + deltaY * deltaY < DrawerController.kTouchSlopSquare) {
+ e.preventDefault();
+ return;
+ }
+
+ if (Math.abs(deltaY) > Math.abs(deltaX)) {
+ this.state = DismissController.kScrolling;
+ return;
+ }
+
+ this.state = DismissController.kDragging;
+ this.width = this.target.offsetWidth;
+ }
+
+ e.preventDefault();
+ var deltaX = e.changedTouches[0].clientX - this.startX;
+ this.position = this.startPosition + deltaX;
+ this.moveCallback.call(this.target, this.position);
+};
+
+DismissController.prototype.onTouchEnd = function(e) {
+ this.velocityTracker.onTouchEnd(e);
+
+ if (this.state == DismissController.kDragging) {
+ var velocityX = this.velocityTracker.velocityX;
+ if (Math.abs(velocityX) > DrawerController.kMinFlingVelocity) {
+ this.fling(velocityX);
+ return;
+ }
+
+ var fraction = this.position / this.width;
+ if (fraction > 0.5)
+ this.settle(this.width);
+ else if (fraction < -0.5)
+ this.settle(-this.width);
+ else
+ this.settle(0)
+ }
+};
+
+DismissController.prototype.fling = function(velocityX) {
+ this.animator.stopAnimation();
+ this.animationVelocityX = velocityX;
+ this.basePosition = this.position;
+ this.state = DismissController.kFlinging;
+ this.targetPosition = velocityX < 0 ? -this.width : this.width;
+ this.animator.startAnimation();
+};
+
+DismissController.prototype.settle = function(targetPosition) {
+ this.animator.stopAnimation();
+ this.animationDuration = DrawerController.kBaseSettleDurationMS;
+ this.state = DismissController.kSettling;
+ this.basePosition = this.position;
+ this.targetPosition = targetPosition;
+ this.animator.startAnimation();
+};
+
+DismissController.prototype.computeTargetPosition = function(deltaT) {
+ var approximateTargetPosition = 0;
+ var movingLeftward = false;
+
+ if (this.state == DismissController.kSettling) {
+ var targetFraction = this.curve.scaleTime(deltaT / this.animationDuration);
+ var animationWidth = this.targetPosition - this.basePosition;
+ approximateTargetPosition = this.basePosition + targetFraction * animationWidth;
+ movingLeftward = animationWidth < 0;
+ } else if (this.state == DismissController.kFlinging) {
+ approximateTargetPosition = this.basePosition + this.animationVelocityX * deltaT;
+ movingLeftward = this.animationVelocityX < 0;
+ }
+
+ var lowerBound = -this.width;
+ var upperBound = this.width;
+ if (movingLeftward && this.targetPosition == 0)
+ lowerBound = 0;
+ else if (!movingLeftward && this.targetPosition == 0)
+ upperBound = 0;
+
+ return Math.max(lowerBound, Math.min(upperBound, approximateTargetPosition));
+};
+
+DismissController.prototype.onAnimation = function(timeStamp) {
+ var deltaT = timeStamp - this.animator.startTimeStamp;
+
+ this.position = this.computeTargetPosition(deltaT);
+ this.moveCallback.call(this.target, this.position);
+
+ if (this.position != this.targetPosition)
+ return true;
+
+ if (this.targetPosition == 0) {
+ this.state = DismissController.kInitial;
+ return false;
+ }
+
+ this.state = DismissController.kDismissed;
+ this.dismissCallback.call(this.target, this.targetPosition < 0 ? 'left' : 'right');
+ return false;
+};
+
+exports.DrawerController = DrawerController;
+exports.DismissController = DismissController;
+
+})(window);
+</script>
+<style>
+html {
+ height: 100%;
+}
+body {
+ display: block;
+ height: 100%;
+ margin: 0;
+ background-color: red;
+}
+</style>
+<polymer-element name="app-frame" assetpath="/">
+ <template>
+ <style>
+ :host {
+ display: flex;
+ flex-direction: column;
+ background-color: white;
+ height: 100%;
+ position: relative;
+ overflow: hidden;
+ }
+ </style>
+ <content></content>
+ </template>
+ <script>
+ Polymer('app-frame', {
+ });
+ </script>
+</polymer-element>
+<polymer-element name="app-column" assetpath="/">
+ <template>
+ <style>
+ :host {
+ position: relative;
+ overflow-x: hidden;
+ overflow-y: auto;
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ }
+ </style>
+ <content></content>
+ </template>
+ <script>
+ Polymer('app-column', {
+ });
+ </script>
+</polymer-element>
+<polymer-element name="app-drawer" attributes="active" assetpath="/">
+ <template>
+ <style>
+ #content {
+ display: none;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 300px;
+ bottom: 0;
+ background-color: white;
+ -webkit-transform: translate3d(0,0,0);
+ overflow-y: scroll;
+ }
+ #mask {
+ display: none;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: black;
+ -webkit-transform: translate3d(0,0,0);
+ }
+ </style>
+ <div id="mask"></div>
+ <div id="content">
+ <content></content>
+ </div>
+ </template>
+ <script>
+ Polymer('app-drawer', {
+ active: false,
+ toggle: function() {
+ this.controller.toggle();
+ },
+ enteredView: function() {
+ var content = this.$.content;
+ var mask = this.$.mask;
+ this.controller = new DrawerController({
+ target: this,
+ left: 0,
+ right: 300,
+ position: 0,
+ curve: 'ease-in-out',
+ willOpen: function() {
+ mask.style.display = 'block';
+ content.style.display = 'block';
+ this.active = true;
+ },
+ didClose: function() {
+ mask.style.display = 'none';
+ content.style.display = 'none';
+ this.active = false;
+ },
+ onAnimate: function(position) {
+ // FIXME: We should animate the opacity from zero, but that triggers http://crbug.com/328106
+ mask.style.opacity = ((position + 1) / 300) * 0.2;
+ content.style.WebkitTransform = 'translate3d(' + (position - 300) + 'px,0,0)';
+ },
+ });
+ },
+ });
+ </script>
+</polymer-element>
+<polymer-element name="app-dismissable-item" assetpath="/">
+ <template>
+ <style>
+ :host {
+ display: block;
+ -webkit-transform: translate3d(0,0,0);
+ flex-shrink: 0;
+ }
+ </style>
+ <content></content>
+ </template>
+ <script>
+ Polymer('app-dismissable-item', {
+ enteredView: function() {
+ this.controller = new DismissController({
+ target: this,
+ curve: 'ease-in-out',
+ onMove: function(position) {
+ var width = this.offsetWidth;
+ this.style.opacity = (width - Math.abs(position)) / width;
+ this.style.WebkitTransform = 'translate3d(' + position + 'px,0,0)';
+ },
+ onDismiss: function(direction) {
+ this.remove();
+ },
+ });
+ },
+ });
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<!--
+/**
+ * @module Polymer Elements
+ */
+-->
+<!--
+/**
+ * The polymer-selection element is used to manage selection state. It has no
+ * visual appearance and is typically used in conjuneciton with another element.
+ * For example, <a href="polymer-selector.html">polymer-selector</a>
+ * use a polymer-selection to manage selection.
+ *
+ * To mark an item as selected, call the select(item) method on
+ * polymer-selection. Notice that the item itself is an argument to this method.
+ * The polymer-selection element manages selection state for any given set of
+ * items. When an item is selected, the `polymer-select` event is fired.
+ * The attribute "multi" indicates if multiple items can be selected at once.
+ *
+ * Example:
+ *
+ * <polymer-element name="selection-example">
+ * <template>
+ * <style>
+ * ::-webkit-distributed(> .selected) {
+ * font-weight: bold;
+ * font-style: italic;
+ * }
+ * </style>
+ * <ul on-tap="{{itemTapAction}}">
+ * <content></content>
+ * </ul>
+ * <polymer-selection id="selection" multi on-polymer-select="{{selectAction}}"></polymer-selection>
+ * </template>
+ * <script>
+ * Polymer('selection-example', {
+ * itemTapAction: function(e) {
+ * this.$.selection.select(e.target);
+ * },
+ * selectAction: function(e, detail) {
+ * detail.item.classList.toggle('selected', detail.isSelected);
+ * }
+ * });
+ * </script>
+ * </polymer-element>
+ *
+ * <selection-example>
+ * <li>Red</li>
+ * <li>Green</li>
+ * <li>Blue</li>
+ * </selection-example>
+ *
+ * @class polymer-selection
+ */
+ /**
+ * Fired when an item's selection state is changed. This event is fired both
+ * when an item is selected or deselected. The `isSelected` detail property
+ * contains the selection state.
+ *
+ * @event polymer-select
+ * @param {Object} detail
+ * @param {boolean} detail.isSelected true for selection and false for deselection
+ * @param {Object} detail.item the item element
+ */
+-->
+
+
+<polymer-element name="polymer-selection" attributes="multi" assetpath="bower_components/polymer-selection/">
+ <template>
+ <style>
+ :host {
+ display: none !important;
+ }
+ </style>
+ </template>
+ <script>
+ Polymer('polymer-selection', {
+ /**
+ * If true, multiple selections are allowed.
+ *
+ * @attribute multi
+ * @type boolean
+ * @default false
+ */
+ multi: false,
+ ready: function() {
+ this.clear();
+ },
+ clear: function() {
+ this.selection = [];
+ },
+ /**
+ * Retrieves the selected item(s).
+ * @method getSelection
+ * @returns Returns the selected item(s). If the multi property is true,
+ * getSelection will return an array, otherwise it will return
+ * the selected item or undefined if there is no selection.
+ */
+ getSelection: function() {
+ return this.multi ? this.selection : this.selection[0];
+ },
+ /**
+ * Indicates if a given item is selected.
+ * @method isSelected
+ * @param {any} item The item whose selection state should be checked.
+ * @returns Returns true if `item` is selected.
+ */
+ isSelected: function(item) {
+ return this.selection.indexOf(item) >= 0;
+ },
+ setItemSelected: function(item, isSelected) {
+ if (item !== undefined && item !== null) {
+ if (isSelected) {
+ this.selection.push(item);
+ } else {
+ var i = this.selection.indexOf(item);
+ if (i >= 0) {
+ this.selection.splice(i, 1);
+ }
+ }
+ this.fire("polymer-select", {isSelected: isSelected, item: item});
+ }
+ },
+ /**
+ * Set the selection state for a given `item`. If the multi property
+ * is true, then the selected state of `item` will be toggled; otherwise
+ * the `item` will be selected.
+ * @method select
+ * @param {any} item: The item to select.
+ */
+ select: function(item) {
+ if (this.multi) {
+ this.toggle(item);
+ } else if (this.getSelection() !== item) {
+ this.setItemSelected(this.getSelection(), false);
+ this.setItemSelected(item, true);
+ }
+ },
+ /**
+ * Toggles the selection state for `item`.
+ * @method toggle
+ * @param {any} item: The item to toggle.
+ */
+ toggle: function(item) {
+ this.setItemSelected(item, !this.isSelected(item));
+ }
+ });
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<!--
+/**
+ * @module Polymer Elements
+ */
+/**
+ * polymer-selector is used to manage a list of elements that can be selected.
+ * The attribute "selected" indicates which item element is being selected.
+ * The attribute "multi" indicates if multiple items can be selected at once.
+ * Tapping on the item element would fire "polymer-activate" event. Use
+ * "polymer-select" event to listen for selection changes.
+ *
+ * Example:
+ *
+ * <polymer-selector selected="0">
+ * <div>Item 1</div>
+ * <div>Item 2</div>
+ * <div>Item 3</div>
+ * </polymer-selector>
+ *
+ * polymer-selector is not styled. So one needs to use "polymer-selected" CSS
+ * class to style the selected element.
+ *
+ * <style>
+ * .item.polymer-selected {
+ * background: #eee;
+ * }
+ * </style>
+ * ...
+ * <polymer-selector>
+ * <div class="item">Item 1</div>
+ * <div class="item">Item 2</div>
+ * <div class="item">Item 3</div>
+ * </polymer-selector>
+ *
+ * @class polymer-selector
+ */
+/**
+ * Fired when an item's selection state is changed. This event is fired both
+ * when an item is selected or deselected. The `isSelected` detail property
+ * contains the selection state.
+ *
+ * @event polymer-select
+ * @param {Object} detail
+ * @param {boolean} detail.isSelected true for selection and false for deselection
+ * @param {Object} detail.item the item element
+ */
+/**
+ * Fired when an item element is tapped.
+ *
+ * @event polymer-activate
+ * @param {Object} detail
+ * @param {Object} detail.item the item element
+ */
+-->
+
+
+
+<polymer-element name="polymer-selector" attributes="selected multi valueattr selectedClass selectedProperty selectedItem selectedModel selectedIndex notap target itemsSelector activateEvent" assetpath="bower_components/polymer-selector/">
+ <template>
+ <polymer-selection id="selection" multi="{{multi}}" on-polymer-select="{{selectionSelect}}"></polymer-selection>
+ <content id="items" select="*"></content>
+ </template>
+ <script>
+ Polymer('polymer-selector', {
+ /**
+ * Gets or sets the selected element. Default to use the index
+ * of the item element.
+ *
+ * If you want a specific attribute value of the element to be
+ * used instead of index, set "valueattr" to that attribute name.
+ *
+ * Example:
+ *
+ * <polymer-selector valueattr="label" selected="foo">
+ * <div label="foo"></div>
+ * <div label="bar"></div>
+ * <div label="zot"></div>
+ * </polymer-selector>
+ *
+ * In multi-selection this should be an array of values.
+ *
+ * Example:
+ *
+ * <polymer-selector id="selector" valueattr="label" multi>
+ * <div label="foo"></div>
+ * <div label="bar"></div>
+ * <div label="zot"></div>
+ * </polymer-selector>
+ *
+ * this.$.selector.selected = ['foo', 'zot'];
+ *
+ * @attribute selected
+ * @type Object
+ * @default null
+ */
+ selected: null,
+ /**
+ * If true, multiple selections are allowed.
+ *
+ * @attribute multi
+ * @type boolean
+ * @default false
+ */
+ multi: false,
+ /**
+ * Specifies the attribute to be used for "selected" attribute.
+ *
+ * @attribute valueattr
+ * @type string
+ * @default 'name'
+ */
+ valueattr: 'name',
+ /**
+ * Specifies the CSS class to be used to add to the selected element.
+ *
+ * @attribute selectedClass
+ * @type string
+ * @default 'polymer-selected'
+ */
+ selectedClass: 'polymer-selected',
+ /**
+ * Specifies the property to be used to set on the selected element
+ * to indicate its active state.
+ *
+ * @attribute selectedProperty
+ * @type string
+ * @default 'active'
+ */
+ selectedProperty: 'active',
+ /**
+ * Returns the currently selected element. In multi-selection this returns
+ * an array of selected elements.
+ *
+ * @attribute selectedItem
+ * @type Object
+ * @default null
+ */
+ selectedItem: null,
+ /**
+ * In single selection, this returns the model associated with the
+ * selected element.
+ *
+ * @attribute selectedModel
+ * @type Object
+ * @default null
+ */
+ selectedModel: null,
+ /**
+ * In single selection, this returns the selected index.
+ *
+ * @attribute selectedIndex
+ * @type number
+ * @default -1
+ */
+ selectedIndex: -1,
+ /**
+ * The target element that contains items. If this is not set
+ * polymer-selector is the container.
+ *
+ * @attribute target
+ * @type Object
+ * @default null
+ */
+ target: null,
+ /**
+ * This can be used to query nodes from the target node to be used for
+ * selection items. Note this only works if the 'target' property is set.
+ *
+ * Example:
+ *
+ * <polymer-selector target="{{$.myForm}}" itemsSelector="input[type=radio]"></polymer-selector>
+ * <form id="myForm">
+ * <label><input type="radio" name="color" value="red"> Red</label> <br>
+ * <label><input type="radio" name="color" value="green"> Green</label> <br>
+ * <label><input type="radio" name="color" value="blue"> Blue</label> <br>
+ * <p>color = {{color}}</p>
+ * </form>
+ *
+ * @attribute itemSelector
+ * @type string
+ * @default ''
+ */
+ itemsSelector: '',
+ /**
+ * The event that would be fired from the item element to indicate
+ * it is being selected.
+ *
+ * @attribute activateEvent
+ * @type string
+ * @default 'tap'
+ */
+ activateEvent: 'tap',
+ notap: false,
+ ready: function() {
+ this.activateListener = this.activateHandler.bind(this);
+ this.observer = new MutationObserver(this.updateSelected.bind(this));
+ if (!this.target) {
+ this.target = this;
+ }
+ },
+ get items() {
+ var nodes = this.target !== this ? (this.itemsSelector ?
+ this.target.querySelectorAll(this.itemsSelector) :
+ this.target.children) : this.$.items.getDistributedNodes();
+ return Array.prototype.filter.call(nodes || [], function(n) {
+ return n && n.localName !== 'template';
+ });
+ },
+ targetChanged: function(old) {
+ if (old) {
+ this.removeListener(old);
+ this.observer.disconnect();
+ }
+ if (this.target) {
+ this.addListener(this.target);
+ this.observer.observe(this.target, {childList: true});
+ }
+ },
+ addListener: function(node) {
+ node.addEventListener(this.activateEvent, this.activateListener);
+ },
+ removeListener: function(node) {
+ node.removeEventListener(this.activateEvent, this.activateListener);
+ },
+ get selection() {
+ return this.$.selection.getSelection();
+ },
+ selectedChanged: function() {
+ this.updateSelected();
+ },
+ updateSelected: function() {
+ this.validateSelected();
+ if (this.multi) {
+ this.clearSelection();
+ this.selected && this.selected.forEach(function(s) {
+ this.valueToSelection(s);
+ }, this);
+ } else {
+ this.valueToSelection(this.selected);
+ }
+ },
+ validateSelected: function() {
+ // convert to an array for multi-selection
+ if (this.multi && !Array.isArray(this.selected) &&
+ this.selected !== null && this.selected !== undefined) {
+ this.selected = [this.selected];
+ }
+ },
+ clearSelection: function() {
+ if (this.multi) {
+ this.selection.slice().forEach(function(s) {
+ this.$.selection.setItemSelected(s, false);
+ }, this);
+ } else {
+ this.$.selection.setItemSelected(this.selection, false);
+ }
+ this.selectedItem = null;
+ this.$.selection.clear();
+ },
+ valueToSelection: function(value) {
+ var item = (value === null || value === undefined) ?
+ null : this.items[this.valueToIndex(value)];
+ this.$.selection.select(item);
+ },
+ updateSelectedItem: function() {
+ this.selectedItem = this.selection;
+ },
+ selectedItemChanged: function() {
+ if (this.selectedItem) {
+ var t = this.selectedItem.templateInstance;
+ this.selectedModel = t ? t.model : undefined;
+ } else {
+ this.selectedModel = null;
+ }
+ this.selectedIndex = this.selectedItem ?
+ parseInt(this.valueToIndex(this.selected)) : -1;
+ },
+ valueToIndex: function(value) {
+ // find an item with value == value and return it's index
+ for (var i=0, items=this.items, c; (c=items[i]); i++) {
+ if (this.valueForNode(c) == value) {
+ return i;
+ }
+ }
+ // if no item found, the value itself is probably the index
+ return value;
+ },
+ valueForNode: function(node) {
+ return node[this.valueattr] || node.getAttribute(this.valueattr);
+ },
+ // events fired from <polymer-selection> object
+ selectionSelect: function(e, detail) {
+ this.updateSelectedItem();
+ if (detail.item) {
+ this.applySelection(detail.item, detail.isSelected)
+ }
+ },
+ applySelection: function(item, isSelected) {
+ if (this.selectedClass) {
+ item.classList.toggle(this.selectedClass, isSelected);
+ }
+ if (this.selectedProperty) {
+ item[this.selectedProperty] = isSelected;
+ }
+ },
+ // event fired from host
+ activateHandler: function(e) {
+ if (!this.notap) {
+ var i = this.findDistributedTarget(e.target, this.items);
+ if (i >= 0) {
+ var item = this.items[i];
+ var s = this.valueForNode(item) || i;
+ if (this.multi) {
+ if (this.selected) {
+ this.addRemoveSelected(s);
+ } else {
+ this.selected = [s];
+ }
+ } else {
+ this.selected = s;
+ }
+ this.asyncFire('polymer-activate', {item: item});
+ }
+ }
+ },
+ addRemoveSelected: function(value) {
+ var i = this.selected.indexOf(value);
+ if (i >= 0) {
+ this.selected.splice(i, 1);
+ } else {
+ this.selected.push(value);
+ }
+ this.valueToSelection(value);
+ },
+ findDistributedTarget: function(target, nodes) {
+ // find first ancestor of target (including itself) that
+ // is in nodes, if any
+ while (target && target != this) {
+ var i = Array.prototype.indexOf.call(nodes, target);
+ if (i >= 0) {
+ return i;
+ }
+ target = target.parentNode;
+ }
+ }
+ });
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+
+
+<polymer-element name="polymer-ui-theme-aware" attributes="theme" assetpath="bower_components/polymer-ui-theme-aware/">
+ <script>
+ PolymerUI = {
+ validateTheme: function() {
+ var theme = this.theme;
+ var defaultTheme = this.defaultTheme;
+ if (!theme) {
+ var p = this;
+ while (p && !theme) {
+ theme = p.getAttribute && p.getAttribute('theme');
+ defaultTheme = defaultTheme || p.defaultTheme;
+ p = p.parentNode || p.host;
+ }
+ }
+ this.activeTheme = this.theme || theme || defaultTheme;
+ }
+ };
+ Polymer('polymer-ui-theme-aware', {
+ defaultTheme: '',
+ activeTheme: '',
+ validateTheme: PolymerUI.validateTheme,
+ enteredView: function() {
+ this.validateTheme();
+ },
+ themeChanged: function() {
+ this.activeTheme = this.theme;
+ },
+ activeThemeChanged: function(old) {
+ this.classList.switch(old, this.activeTheme);
+ }
+ });
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<!--
+/**
+ * @module Polymer UI Elements
+ */
+/**
+ * polymer-ui-menu is a polymer-selector with theme propagation. It styles to look like
+ * a menu and should be used in conjunction with polymer-ui-menu-item.
+ *
+ * Example:
+ *
+ * <polymer-ui-menu selected="0">
+ * <polymer-ui-menu-item icon="settings" label="Settings"></polymer-ui-menu-item>
+ * <polymer-ui-menu-item icon="dialog" label="Dialog"></polymer-ui-menu-item>
+ * <polymer-ui-menu-item icon="search" label="Search"></polymer-ui-menu-item>
+ * </polymer-ui-menu>
+ *
+ * The "selectedItem" property returns the currently selected item.
+ *
+ * Example:
+ *
+ * <polymer-ui-menu selected="0" selectedItem="{{item}}">
+ * <polymer-ui-menu-item icon="settings" label="Settings"></polymer-ui-menu-item>
+ * <polymer-ui-menu-item icon="dialog" label="Dialog"></polymer-ui-menu-item>
+ * <polymer-ui-menu-item icon="search" label="Search"></polymer-ui-menu-item>
+ * </polymer-ui-menu>
+ *
+ * <div>selected label: {{item.label}}</div>
+ *
+ * The event "polymer-select" can also be used to listen for selection change.
+ *
+ * Example:
+ *
+ * <polymer-ui-menu selected="0" on-polymer-select="{{selectAction}}">
+ * <polymer-ui-menu-item icon="settings" label="Settings"></polymer-ui-menu-item>
+ * <polymer-ui-menu-item icon="dialog" label="Dialog"></polymer-ui-menu-item>
+ * <polymer-ui-menu-item icon="search" label="Search"></polymer-ui-menu-item>
+ * </polymer-ui-menu>
+ *
+ * ...
+ *
+ * selectAction: function(e, detail) {
+ * if (detail.isSelected) {
+ * var selectedItem = detail.item;
+ * ...
+ * }
+ * }
+ *
+ * @class polymer-ui-menu
+ * @extends polymer-selector
+ */
+-->
+
+
+
+
+<polymer-element name="polymer-ui-menu" extends="polymer-selector" attributes="theme" on-polymer-select="{{selectionChange}}" assetpath="bower_components/polymer-ui-menu/">
+ <template>
+ <style>/*
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+*/
+
+:host {
+ /* technical */
+ display: block;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ /* size */
+ padding: 0.4em;
+ font-weight: bold;
+}
+
+:host(.polymer-ui-light-theme:host) {
+ color: #333333;
+}
+
+:host(.polymer-ui-dark-theme:host) {
+ background: -webkit-linear-gradient(-60deg, #3d3d3d, #353535);
+ background: -moz-linear-gradient(-60deg, #3d3d3d, #353535);
+ background: -ms-linear-gradient(-60deg, #3d3d3d, #353535);
+ color: #ededed;
+}
+</style>
+ <shadow></shadow>
+ </template>
+ <script>
+ Polymer('polymer-ui-menu', {
+ activeTheme: '',
+ validateTheme: PolymerUI.validateTheme,
+ enteredView: function() {
+ this.validateTheme();
+ },
+ themeChanged: function() {
+ this.activeTheme = this.theme;
+ },
+ activeThemeChanged: function(old) {
+ this.classList.switch(old, this.activeTheme);
+ },
+ selectionChange: function(e, detail) {
+ if (detail.isSelected) {
+ var i = detail.item;
+ // find nested selected item
+ while (i.selectedItem) {
+ i = i.selectedItem;
+ }
+ this.selectedItem = i;
+ }
+ }
+ });
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+
+<!--
+/**
+* Polymer UI Elements
+*
+* @module Polymer UI Elements
+*/
+/**
+ * polymer-ui-icon is a 24x24 glyph expressed as a background-image.
+ *
+ * Example:
+ *
+ * <polymer-ui-icon src="star.png"></polymer-ui-icon>
+ *
+ * Optionally can use other size like 32x32 by setting the attribute "size" to "32":
+ *
+ * <polymer-ui-icon src="big_star.png" size="32"></polymer-ui-icon>
+ *
+ * Polymer includes an icon set. The property "icon" can be used
+ * to specify which icon to use.
+ *
+ * Example:
+ *
+ * <polymer-ui-icon icon="menu"></polymer-ui-icon>
+ *
+ * @class polymer-ui-icon
+ */
+-->
+
+
+
+<polymer-element name="polymer-ui-icon" extends="polymer-ui-theme-aware" attributes="src size index icon" assetpath="bower_components/polymer-ui-icon/">
+ <template>
+ <style>/*
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+*/
+
+:host {
+ display: inline-block;
+ vertical-align: middle;
+ cursor: pointer;
+ background-repeat: no-repeat;
+}
+
+:host(.polymer-ui-dark-icon:host, .polymer-ui-light-theme:host) {
+ background-position: -24px 0;
+}
+
+:host(.polymer-ui-light-icon:host, .polymer-ui-dark-theme:host) {
+ background-position: -72px 0;
+}
+
+:host(.polymer-ui-icons:host) {
+ background-image: url(bower_components/polymer-ui-icon/bower_components/polymer-ui-icon/action-icons.png);
+}</style>
+ <content></content>
+ </template>
+ <script>
+ (function() {
+ var icons = [
+ 'drawer',
+ 'menu',
+ 'search',
+ 'dropdown',
+ 'close',
+ 'add',
+ 'trash',
+ 'refresh',
+ 'settings',
+ 'dialoga',
+ 'left',
+ 'right',
+ 'down',
+ 'up',
+ 'grid',
+ 'contact',
+ 'account',
+ 'plus',
+ 'time',
+ 'marker',
+ 'briefcase',
+ 'array',
+ 'columns',
+ 'list',
+ 'modules',
+ 'quilt',
+ 'stream',
+ 'maximize',
+ 'shrink',
+ 'sort',
+ 'shortcut',
+ 'dialog',
+ 'twitter',
+ 'facebook',
+ 'favorite',
+ 'gplus',
+ 'filter',
+ 'tag',
+ 'plusone',
+ 'dots'
+ ];
+ var map = {};
+ icons.forEach(function(name, i) {
+ map[name] = i;
+ });
+ icons = map;
+
+ Polymer('polymer-ui-icon', {
+ /**
+ * The URL of an image for the icon.
+ *
+ * @attribute src
+ * @type string
+ * @default ''
+ */
+ src: '',
+ /**
+ * Specifies the size of the icon.
+ *
+ * @attribute size
+ * @type string
+ * @default 24
+ */
+ size: 24,
+ /**
+ * Specifies the icon from the Polymer icon set.
+ *
+ * @attribute icon
+ * @type string
+ * @default ''
+ */
+ icon: '',
+ bx: 0,
+ by: 0,
+ icons: icons,
+ ready: function() {
+ this.sizeChanged();
+ },
+ sizeChanged: function() {
+ this.style.width = this.style.height = this.size + 'px';
+ },
+ iconChanged: function() {
+ this.index = this.icon in icons ? icons[this.icon] : -1;
+ },
+ indexChanged: function() {
+ this.classList.add('polymer-ui-icons');
+ this.by = -this.size * this.index;
+ this.updateIcon();
+ },
+ srcChanged: function() {
+ this.classList.remove('polymer-ui-icons');
+ this.style.backgroundImage = 'url(' + this.src + ')';
+ this.updateIcon();
+ },
+ activeThemeChanged: function(old) {
+ this.super(arguments);
+ this.style.backgroundPosition = '';
+ this.bx = calcThemeOffset(this.activeTheme, this);
+ this.updateIcon();
+ },
+ updateIcon: function() {
+ if (this.src) {
+ this.style.backgroundPosition = 'center';
+ this.style.backgroundSize = this.size + 'px ' + this.size + 'px';
+ } else {
+ this.style.backgroundPosition = (this.bx + 'px') + ' ' + (this.by + 'px');
+ }
+ }
+ });
+ // memoize offset because getComputedStyle is expensive
+ var themes = {};
+ function calcThemeOffset(theme, node) {
+ if (themes[theme] === undefined) {
+ var bp = getComputedStyle(node).backgroundPosition.split(' ');
+ // support 4 value syntax (https://code.google.com/p/chromium/issues/detail?id=310977)
+ var l = bp.length === 4 ? bp[1] : bp[0];
+ var offset = parseFloat(l);
+ themes[theme] = offset;
+ }
+ return themes[theme];
+ }
+ })();
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Toolkitchen Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<!--
+/**
+ * @module Polymer UI Elements
+ */
+/**
+ * polymer-ui-menu-item is styled to look like a menu item. It should be used
+ * in conjunction with polymer-ui-menu or polymer-ui-sibebar-menu.
+ *
+ * Example:
+ *
+ * <polymer-ui-menu-item icon="settings" label="Settings"></polymer-ui-menu-item>
+ *
+ * @class polymer-ui-menu-item
+ */
+/**
+ * The URL of an image for the icon.
+ *
+ * @attribute src
+ * @type string
+ * @default ''
+ */
+/**
+ * Specifies the icon from the Polymer icon set.
+ *
+ * @attribute icon
+ * @type string
+ * @default ''
+ */
+/**
+ * Specifies the label for the menu item.
+ *
+ * @attribute label
+ * @type string
+ * @default ''
+ */
+/**
+ * Specifies the URL of the link it goes to when tapped on.
+ *
+ * Example:
+ *
+ * <polymer-ui-menu-item icon="favorite" label="Favorite" href="http://www.polymer-project.org/"></polymer-ui-menu-item>
+ *
+ * If you want more control on the link, e.g. specify the target for where to
+ * open the linked document, you can put &lt;a> directly inside the menu-item.
+ *
+ * Example:
+ *
+ * <polymer-ui-menu-item icon="favorite" label="Favorite">
+ * <a href="http://www.polymer-project.org/" target="_self"></a>
+ * </polymer-ui-menu-item>
+ *
+ * @attribute href
+ * @type string
+ * @default ''
+ */
+-->
+
+
+
+
+<polymer-element name="polymer-ui-menu-item" extends="polymer-ui-theme-aware" attributes="src label icon item href" assetpath="bower_components/polymer-ui-menu-item/">
+ <template>
+ <style>/*
+Copyright 2013 The Toolkitchen Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+*/
+
+:host {
+ display: block;
+ position: relative;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ height: 40px;
+ line-height: 35px;
+ font-size: 16px;
+ padding: 0 10px;
+ border: 1px solid transparent;
+ border-radius: 3px;
+ white-space: nowrap;
+ cursor: pointer;
+ opacity: 0.5;
+}
+
+:host(:hover:host) {
+ opacity: 0.9;
+}
+
+:host(.polymer-selected:host, [active]:host) {
+ opacity: 1;
+}
+
+:host(.polymer-ui-light-theme.polymer-selected:host, .polymer-ui-light-theme[active]:host) {
+ background: #f2f2f2;
+ border: 1px solid rgba(0, 0, 0, 0.15);
+}
+
+:host(.polymer-ui-dark-theme:host) {
+ color: #b3b3b3;
+}
+
+:host(.polymer-ui-dark-theme:hover:host) {
+ color: rgba(255, 255, 255, 0.9);
+}
+
+:host(.polymer-ui-dark-theme.polymer-selected:host, .polymer-ui-dark-theme[active]:host) {
+ background-color: #000;
+ border: 1px solid rgba(255, 255, 255, 0.2);
+ color: rgba(255, 255, 255, 0.9);
+}
+
+:host([active].no-active-bg:host) {
+ background-color: transparent;
+ border: 1px solid transparent;
+}
+
+/* icon and label */
+polymer-ui-icon:not([showing]) {
+ display: none !important;
+}
+
+polymer-ui-icon {
+ margin-right: 16px;
+}
+
+#label {
+ vertical-align: middle;
+ padding-right: 20px;
+}
+
+/*@polyfill :host #label > a, #link */
+::content > a, #link {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ margin: -1px;
+}
+
+#link[hidden] {
+ display: none;
+}
+</style>
+ <polymer-ui-icon src="{{src}}" icon="{{icon}}" showing?="{{icon || src}}"></polymer-ui-icon>
+ <span id="label">{{label}}<content></content></span>
+ <a id="link" href="{{href}}" hidden?="{{!href}}"></a>
+ </template>
+ <script>
+ Polymer('polymer-ui-menu-item', {
+ label: '',
+ // calc item's offset middle pos instead of using offsetTop/Height
+ // directly which requires to wait for submenu's collapsing transition to
+ // complete first before it can return the correct pos.
+ getOffsetMiddle: function() {
+ var p = this.parentNode;
+ if (p) {
+ var i = Array.prototype.indexOf.call(p.items, this);
+ var h = this.getItemHeight();
+ return i * h + h/2 + p.items[0].offsetTop;
+ }
+ },
+ getItemHeight: function() {
+ return this.offsetHeight;
+ }
+ });
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<!--
+/**
+ * @module Polymer Elements
+ */
+/**
+ * polymer-media-query can be used to data bind to a CSS media query.
+ * The "query" property is a bare CSS media query.
+ * The "queryMatches" property will be a boolean representing if the page matches that media query.
+ *
+ * polymer-media-query uses media query listeners to dynamically update the "queryMatches" property.
+ * A "polymer-mediachange" event also fires when queryMatches changes.
+ *
+ * Example:
+ *
+ * <polymer-media-query query="max-width: 640px" queryMatches="{{phoneScreen}}"></polymer-media-query>
+ *
+ * @class polymer-media-query
+ */
+-->
+
+
+<polymer-element name="polymer-media-query" attributes="query queryMatches" assetpath="bower_components/polymer-media-query/">
+ <template>
+ <style>
+ :host {
+ display: none;
+ }
+ </style>
+ </template>
+ <script>
+
+ Polymer('polymer-media-query', {
+ /**
+ * The Boolean return value of the media query
+ * @attribute queryMatches
+ * @type Boolean
+ * @default false
+ */
+ queryMatches: false,
+ /**
+ * The CSS media query to evaulate
+ * @attribute query
+ * @type string
+ * @default ''
+ */
+ query: '',
+ ready: function() {
+ this._mqHandler = this.queryHandler.bind(this);
+ this._mq = null;
+ },
+ queryChanged: function() {
+ if (this._mq) {
+ this._mq.removeListener(this._mqHandler);
+ }
+ var query = this.query;
+ if (query[0] !== '(') {
+ query = '(' + this.query + ')';
+ }
+ this._mq = window.matchMedia(query);
+ this._mq.addListener(this._mqHandler);
+ this.queryHandler(this._mq);
+ },
+ queryHandler: function(mq) {
+ this.queryMatches = mq.matches;
+ this.asyncFire('polymer-mediachange', mq);
+ }
+ });
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<!--
+/**
+ * @module Polymer Elements
+ */
+/**
+ * polymer-flex-layout provides a helper to use CSS3 Flexible Boxes. By putting
+ * polymer-flex-layout inside an element it makes the element a flex
+ * container. Use 'flex' attribute to make the flex item flexible.
+ *
+ * Example:
+ *
+ * <div>
+ * <polymer-flex-layout></polymer-flex-layout>
+ * <div>Left</div>
+ * <div flex>Main</div>
+ * <div>Right</div>
+ * </div>
+ *
+ * ---------------------------------
+ * |-------------------------------|
+ * ||Left| Main |Right||
+ * |-------------------------------|
+ * ---------------------------------
+ *
+ * <div>
+ * <polymer-flex-layout vertical></polymer-flex-layout>
+ * <div>Header</div>
+ * <div flex>Body</div>
+ * <div>Footer</div>
+ * </div>
+ *
+ * ----------
+ * ||------||
+ * ||Header||
+ * ||------||
+ * ||Body ||
+ * || ||
+ * || ||
+ * || ||
+ * || ||
+ * || ||
+ * || ||
+ * ||------||
+ * ||Footer||
+ * ||------||
+ * ----------
+ *
+ * @class polymer-flex-layout
+ */
+/**
+ * If true, flex items are aligned vertically.
+ *
+ * @attribute vertical
+ * @type boolean
+ * @default false
+ */
+/**
+ * Defines the default for how flex items are laid out along the cross axis on
+ * the current line. Possible values are 'start', 'center' and 'end'.
+ *
+ * @attribute align
+ * @type string
+ * @default ''
+ */
+/**
+ * Defines how flex items are laid out along the main axis on the current line.
+ * Possible values are 'start', 'center' and 'end'.
+ *
+ * @attribute justify
+ * @type string
+ * @default ''
+ */
+/**
+ * If true, polymer-flex-layout is the flex container.
+ *
+ * Example:
+ *
+ * <polymer-flex-layout isContainer>
+ * <div>Left</div>
+ * <div flex>Main</div>
+ * <div>Right</div>
+ * </polymer-flex-layout>
+ *
+ * ---------------------------------
+ * |-------------------------------|
+ * ||Left| Main |Right||
+ * |-------------------------------|
+ * ---------------------------------
+ *
+ * @attribute isContainer
+ * @type boolean
+ * @default false
+ */
+-->
+
+
+<polymer-element name="polymer-flex-layout" attributes="vertical align justify isContainer" assetpath="bower_components/polymer-flex-layout/">
+ <template>
+ <style polymer-scope="controller">/*
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+*/
+.flexbox, [flexbox], [h-flexbox], [v-flexbox] {
+ display: -webkit-box !important;
+ display: -ms-flexbox !important;
+ display: -moz-flex !important;
+ display: -webkit-flex !important;
+ display: flex !important;
+}
+
+.flexbox.row, [flexbox], [h-flexbox] {
+ -webkit-box-orient: horizontal;
+ -ms-flex-direction: row;
+ -moz-flex-direction: row;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+}
+
+.flexbox.column, [v-flexbox] {
+ -webkit-box-orient: vertical;
+ -ms-flex-direction: column;
+ -moz-flex-direction: column;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+}
+
+.flex, [flex], [fit] {
+ -webkit-box-flex: 1;
+ -ms-flex: 1;
+ -moz-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+}
+
+::-webkit-distributed(.flex),
+::-webkit-distributed([flex]),
+::-webkit-distributed([fit]) {
+ -webkit-box-flex: 1;
+ -ms-flex: 1;
+ -moz-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+}
+
+.flexbox.align-start {
+ -webkit-box-align: start;
+ -ms-flex-align: start;
+ -moz-align-items: flex-start;
+ -webkit-align-items: flex-start;
+ align-items: flex-start;
+}
+
+.flexbox.align-end {
+ -webkit-box-align: end;
+ -ms-flex-align: end;
+ -moz-align-items: flex-end;
+ -webkit-align-items: flex-end;
+ align-items: flex-end;
+}
+
+.flexbox.align-center {
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ -moz-align-items: center;
+ -webkit-align-items: center;
+ align-items: center;
+}
+
+.flexbox.justify-start {
+ -webkit-box-pack: start;
+ -ms-flex-pack: start;
+ -moz-justify-content: flex-start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+}
+
+.flexbox.justify-end {
+ -webkit-box-pack: end;
+ -ms-flex-pack: end;
+ -moz-justify-content: flex-end;
+ -webkit-justify-content: flex-end;
+ justify-content: flex-end;
+}
+
+.flexbox.justify-center {
+ -webkit-box-pack: center;
+ -ms-flex-pack: center;
+ -moz-justify-content: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+
+.flexbox.justify-between {
+ -webkit-box-pack: justify;
+ -ms-flex-pack: justify;
+ -moz-justify-content: space-between;
+ -webkit-justify-content: space-between;
+ justify-content: space-between;
+}
+
+:host(.flexbox:host, [flexbox]:host, [h-flexbox]:host, [v-flexbox]:host) {
+ display: -webkit-box !important;
+ display: -ms-flexbox !important;
+ display: -moz-flex !important;
+ display: -webkit-flex !important;
+ display: flex !important;
+}
+
+:host(.flexbox.row:host, [flexbox]:host, [h-flexbox]:host) {
+ -webkit-box-orient: horizontal;
+ -ms-flex-direction: row;
+ -moz-flex-direction: row;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+}
+
+:host(.flexbox.column:host, [v-flexbox]:host) {
+ -webkit-box-orient: vertical;
+ -ms-flex-direction: column;
+ -moz-flex-direction: column;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+}
+
+:host(.flexbox.align-start:host) {
+ -webkit-box-align: start;
+ -ms-flex-align: start;
+ -moz-align-items: flex-start;
+ -webkit-align-items: flex-start;
+ align-items: flex-start;
+}
+
+:host(.flexbox.align-end:host) {
+ -webkit-box-align: end;
+ -ms-flex-align: end;
+ -moz-align-items: flex-end;
+ -webkit-align-items: flex-end;
+ align-items: flex-end;
+}
+
+:host(.flexbox.align-center:host) {
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ -moz-align-items: center;
+ -webkit-align-items: center;
+ align-items: center;
+}
+
+:host(.flexbox.justify-start:host) {
+ -webkit-box-pack: start;
+ -ms-flex-pack: start;
+ -moz-justify-content: flex-start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+}
+
+:host(.flexbox.justify-end:host) {
+ -webkit-box-pack: end;
+ -ms-flex-pack: end;
+ -moz-justify-content: flex-end;
+ -webkit-justify-content: flex-end;
+ justify-content: flex-end;
+}
+
+:host(.flexbox.justify-center:host) {
+ -webkit-box-pack: center;
+ -ms-flex-pack: center;
+ -moz-justify-content: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+
+:host(.flexbox.justify-between:host) {
+ -webkit-box-pack: justify;
+ -ms-flex-pack: justify;
+ -moz-justify-content: space-between;
+ -webkit-justify-content: space-between;
+ justify-content: space-between;
+}
+</style>
+ <style>/*
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+*/
+.flexbox, [flexbox], [h-flexbox], [v-flexbox] {
+ display: -webkit-box !important;
+ display: -ms-flexbox !important;
+ display: -moz-flex !important;
+ display: -webkit-flex !important;
+ display: flex !important;
+}
+
+.flexbox.row, [flexbox], [h-flexbox] {
+ -webkit-box-orient: horizontal;
+ -ms-flex-direction: row;
+ -moz-flex-direction: row;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+}
+
+.flexbox.column, [v-flexbox] {
+ -webkit-box-orient: vertical;
+ -ms-flex-direction: column;
+ -moz-flex-direction: column;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+}
+
+.flex, [flex], [fit] {
+ -webkit-box-flex: 1;
+ -ms-flex: 1;
+ -moz-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+}
+
+::-webkit-distributed(.flex),
+::-webkit-distributed([flex]),
+::-webkit-distributed([fit]) {
+ -webkit-box-flex: 1;
+ -ms-flex: 1;
+ -moz-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+}
+
+.flexbox.align-start {
+ -webkit-box-align: start;
+ -ms-flex-align: start;
+ -moz-align-items: flex-start;
+ -webkit-align-items: flex-start;
+ align-items: flex-start;
+}
+
+.flexbox.align-end {
+ -webkit-box-align: end;
+ -ms-flex-align: end;
+ -moz-align-items: flex-end;
+ -webkit-align-items: flex-end;
+ align-items: flex-end;
+}
+
+.flexbox.align-center {
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ -moz-align-items: center;
+ -webkit-align-items: center;
+ align-items: center;
+}
+
+.flexbox.justify-start {
+ -webkit-box-pack: start;
+ -ms-flex-pack: start;
+ -moz-justify-content: flex-start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+}
+
+.flexbox.justify-end {
+ -webkit-box-pack: end;
+ -ms-flex-pack: end;
+ -moz-justify-content: flex-end;
+ -webkit-justify-content: flex-end;
+ justify-content: flex-end;
+}
+
+.flexbox.justify-center {
+ -webkit-box-pack: center;
+ -ms-flex-pack: center;
+ -moz-justify-content: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+
+.flexbox.justify-between {
+ -webkit-box-pack: justify;
+ -ms-flex-pack: justify;
+ -moz-justify-content: space-between;
+ -webkit-justify-content: space-between;
+ justify-content: space-between;
+}
+
+:host(.flexbox:host, [flexbox]:host, [h-flexbox]:host, [v-flexbox]:host) {
+ display: -webkit-box !important;
+ display: -ms-flexbox !important;
+ display: -moz-flex !important;
+ display: -webkit-flex !important;
+ display: flex !important;
+}
+
+:host(.flexbox.row:host, [flexbox]:host, [h-flexbox]:host) {
+ -webkit-box-orient: horizontal;
+ -ms-flex-direction: row;
+ -moz-flex-direction: row;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+}
+
+:host(.flexbox.column:host, [v-flexbox]:host) {
+ -webkit-box-orient: vertical;
+ -ms-flex-direction: column;
+ -moz-flex-direction: column;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+}
+
+:host(.flexbox.align-start:host) {
+ -webkit-box-align: start;
+ -ms-flex-align: start;
+ -moz-align-items: flex-start;
+ -webkit-align-items: flex-start;
+ align-items: flex-start;
+}
+
+:host(.flexbox.align-end:host) {
+ -webkit-box-align: end;
+ -ms-flex-align: end;
+ -moz-align-items: flex-end;
+ -webkit-align-items: flex-end;
+ align-items: flex-end;
+}
+
+:host(.flexbox.align-center:host) {
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ -moz-align-items: center;
+ -webkit-align-items: center;
+ align-items: center;
+}
+
+:host(.flexbox.justify-start:host) {
+ -webkit-box-pack: start;
+ -ms-flex-pack: start;
+ -moz-justify-content: flex-start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+}
+
+:host(.flexbox.justify-end:host) {
+ -webkit-box-pack: end;
+ -ms-flex-pack: end;
+ -moz-justify-content: flex-end;
+ -webkit-justify-content: flex-end;
+ justify-content: flex-end;
+}
+
+:host(.flexbox.justify-center:host) {
+ -webkit-box-pack: center;
+ -ms-flex-pack: center;
+ -moz-justify-content: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+
+:host(.flexbox.justify-between:host) {
+ -webkit-box-pack: justify;
+ -ms-flex-pack: justify;
+ -moz-justify-content: space-between;
+ -webkit-justify-content: space-between;
+ justify-content: space-between;
+}
+</style>
+ <content></content>
+ </template>
+ <script>
+ Polymer('polymer-flex-layout', {
+ vertical: false,
+ isContainer: false,
+ layoutContainer: null,
+ enteredView: function() {
+ this.installControllerStyles();
+ this.layoutContainer = this.isContainer ?
+ this : (this.parentNode.host || this.parentNode);
+ this.verticalChanged();
+ this.alignChanged();
+ this.justifyChanged();
+ },
+ leftView: function() {
+ this.layoutContainer = null;
+ },
+ layoutContainerChanged: function(old) {
+ if (old) {
+ old.classList.remove('flexbox');
+ }
+ this.style.display = this.layoutContainer === this ? '' : 'none';
+ if (this.layoutContainer) {
+ this.layoutContainer.classList.add('flexbox');
+ }
+ },
+ switchContainerClass: function(prefix, old, name) {
+ if (this.layoutContainer && name) {
+ this.layoutContainer.classList.switch(
+ prefix + old, prefix + name);
+ }
+ },
+ verticalChanged: function() {
+ if (this.layoutContainer) {
+ this.layoutContainer.classList.toggle('column', this.vertical);
+ }
+ },
+ alignChanged: function(old) {
+ this.switchContainerClass('align-', old, this.align);
+ },
+ justifyChanged: function(old) {
+ this.switchContainerClass('justify-', old, this.justify);
+ }
+ });
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+
+<!--
+/**
+ * @module Polymer UI Elements
+ */
+/**
+ * polymer-ui-toolbar is a horizontal bar containing elements that can perform actions.
+ *
+ * Example:
+ *
+ * <polymer-ui-toolbar>
+ * <polymer-ui-icon-button src="menu.png" on-click="{{menuAction}}"></polymer-ui-icon-button>
+ * <div flex>Title</div>
+ * <polymer-ui-icon-button src="more.png" on-click="{{moreAction}}"></polymer-ui-icon-button>
+ * </polymer-ui-toolbar>
+ *
+ * polymer-ui-toolbar can adopt to smaller screen size. If the attribute "responsive" is set
+ * and the screen size is less than the responsiveWidth (default to 800px), the toolbar will
+ * be moved to the bottom of the page.
+ *
+ * Example:
+ *
+ * <polymer-ui-toolbar>
+ * <polymer-ui-icon-button icon="menu"></polymer-ui-icon-button>
+ * <div flex>Title</div>
+ * <polymer-ui-toolbar responsive>
+ * <polymer-ui-icon-button icon="add"></polymer-ui-icon-button>
+ * <polymer-ui-icon-button icon="trash"></polymer-ui-icon-button>
+ * <polymer-ui-icon-button icon="search"></polymer-ui-icon-button>
+ * </polymer-ui-toolbar>
+ * </polymer-ui-toolbar>
+ *
+ * @class polymer-ui-toolbar
+ */
+-->
+
+
+
+
+
+<polymer-element name="polymer-ui-toolbar" extends="polymer-ui-theme-aware" attributes="responsiveWidth" assetpath="bower_components/polymer-ui-toolbar/">
+ <template>
+ <style>/*
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+*/
+
+:host {
+ /* technical */
+ display: block;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ /* border/shadow */
+ border-bottom: 1px solid rgba(0, 0, 0, 0.15);
+ /* size */
+ height: 60px;
+ font-size: 21px;
+ font-family: 'Helvetica Neue Medium', 'HelveticaNeue-Medium', Helvetica, sans-serif;
+ position: relative;
+}
+
+:host(.polymer-ui-light-theme:host) {
+ background: #f2f2f2 -webkit-linear-gradient(top, rgba(197,197,197,0), rgba(197,197,197,0.15));
+ background: #f2f2f2 -moz-linear-gradient(top, rgba(197,197,197,0), rgba(197,197,197,0.15));
+ background: #f2f2f2 -ms-linear-gradient(top, rgba(197,197,197,0), rgba(197,197,197,0.15));
+ color: #333333;
+}
+
+:host(.polymer-ui-dark-theme:host) {
+ background: #444444 none;
+ color: #f3f3f3;
+}
+
+:host(.narrow-layout[responsive]:host) {
+ position: fixed;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1;
+ border: 0;
+ border-top: 1px solid rgba(0, 0, 0, 0.28);
+}
+
+/* TODO(sorvell): use of !important due to inability to
+ naturally win over an :host style */
+/*@polyfill :host > polymer-ui-icon-button */
+::content > polymer-ui-icon-button {
+ margin: 0px 8px 0 8px !important;
+}
+
+/*@polyfill :host > polymer-ui-menu-button */
+::content > polymer-ui-menu-button {
+ margin: 0px 8px 0 8px !important;
+}
+
+/*@polyfill :host > polymer-ui-toolbar */
+::content > polymer-ui-toolbar {
+ margin: 0;
+}
+
+/*@polyfill :host > polymer-ui-toolbar:not(.narrow-layout) */
+::content > polymer-ui-toolbar:not(.narrow-layout) {
+ border: 0;
+ background: transparent none;
+}
+</style>
+ <polymer-flex-layout align="center"></polymer-flex-layout>
+ <polymer-media-query query="max-width: {{responsiveWidth}}" querymatches="{{queryMatches}}"></polymer-media-query>
+ <content></content>
+ </template>
+ <script>
+ Polymer('polymer-ui-toolbar', {
+ responsiveWidth: '800px',
+ queryMatches: false,
+ defaultTheme: 'polymer-ui-light-theme',
+ queryMatchesChanged: function() {
+ this.classList.toggle('narrow-layout', this.queryMatches);
+ }
+ });
+ </script>
+</polymer-element>
+
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<!--
+/**
+ * @module Polymer UI Elements
+ */
+/**
+ * polymer-ui-icon-button enables you to place an image centered in a button.
+ *
+ * Example:
+ *
+ * <polymer-ui-icon-button src="star.png"></polymer-ui-icon-button>
+ *
+ * Polymer includes an icon set. The property "icon" can be used
+ * to specify which icon to use.
+ *
+ * Example:
+ *
+ * <polymer-ui-icon-button icon="menu"></polymer-ui-icon-button>
+ *
+ * @class polymer-ui-icon-button
+ */
+-->
+
+
+
+<polymer-element name="polymer-ui-icon-button" extends="polymer-ui-theme-aware" attributes="src index icon active" assetpath="bower_components/polymer-ui-icon-button/">
+ <template>
+ <style>/*
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+*/
+:host {
+ display: inline-block;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ width: 38px;
+ height: 38px;
+ background-image: none;
+ border-radius: 2px;
+ padding: 7px;
+ margin: 2px;
+ vertical-align: middle;
+ cursor: pointer;
+}
+
+:host(.outline:host) {
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
+}
+
+:host(:hover:host) {
+ box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.1);
+}
+
+:host(.selected:host) {
+ background-color: rgba(0, 0, 0, 0.05);
+ box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.12);
+}
+
+:host(:active:host, .selected:active:host) {
+ background-color: rgba(0, 0, 0, 0.05);
+ box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.12);
+}
+
+:host(.polymer-ui-dark-theme.outline:host) {
+ background-color: rgba(200, 200, 200, 0.05);
+ box-shadow: 0 0 0 1px rgba(200, 200, 200, 0.1);
+}
+
+:host(.polymer-ui-dark-theme:hover:host) {
+ background-color: rgba(200, 200, 200, 0.05);
+ box-shadow: 0 1px 0 0 rgba(200, 200, 200, 0.12), 0 0 0 1px rgba(200, 200, 200, 0.1);
+}
+
+:host(.polymer-ui-dark-theme.selected:host) {
+ background-color: rgba(220, 220, 220, 0.05);
+ box-shadow: inset 0 1px 0 0 rgba(200, 200, 200, 0.05), 0 0 0 1px rgba(200, 200, 200, 0.12);
+}
+
+:host(.polymer-ui-dark-theme:active:host, .polymer-ui-dark-theme.selected:active:host) {
+ background-color: rgba(200, 200, 200, 0.05);
+ box-shadow: inset 0 1px 0 0 rgba(200, 200, 200, 0.1), 0 0 0 1px rgba(200, 200, 200, 0.12);
+}
+
+polymer-ui-icon {
+ display: block !important;
+}</style>
+ <polymer-ui-icon src="{{src}}" index="{{index}}" icon="{{icon}}"><content></content></polymer-ui-icon>
+ </template>
+ <script>
+ Polymer('polymer-ui-icon-button', {
+ /**
+ * The URL of an image for the icon.
+ *
+ * @attribute src
+ * @type string
+ * @default ''
+ */
+ src: '',
+ /**
+ * If true, border is placed around the button to indicate
+ * active state.
+ *
+ * @attribute active
+ * @type boolean
+ * @default false
+ */
+ active: false,
+ /**
+ * Specifies the icon from the Polymer icon set.
+ *
+ * @attribute icon
+ * @type string
+ * @default ''
+ */
+ icon: '',
+ /**
+ * If a theme is applied that includes an icon set, the index of the
+ * icon to display.
+ *
+ * @attribute index
+ * @type number
+ * @default -1
+ */
+ index: -1,
+ activeChanged: function() {
+ // TODO(sjmiles): sugar this common case
+ this.classList.toggle('selected', this.active);
+ }
+ });
+ </script>
+</polymer-element>
+<style>
+ .message {
+ padding: 20px 10px;
+ background-color: white;
+ border-bottom: 1px solid lightgray;
+ }
+ .messages {
+ background-color: darkgrey;
+ }
+ </style>
+ </head>
+ <body class="polymer-ui-body-text" unresolved="">
+ <app-frame>
+ <polymer-ui-toolbar theme="polymer-ui-light-theme">
+ <polymer-ui-icon-button icon="menu" id="menu-button"></polymer-ui-icon-button>
+ <div flex="">Demo app</div>
+ <polymer-ui-icon-button icon="refresh"></polymer-ui-icon-button>
+ <polymer-ui-icon-button icon="add"></polymer-ui-icon-button>
+ </polymer-ui-toolbar>
+ <app-column>
+ <app-drawer id="nav-drawer">
+ <polymer-ui-menu selected="0" theme="polymer-ui-light-theme" active="false">
+ <polymer-ui-menu-item icon="settings" label="Settings"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="AAAAA"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="BBBBB"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="CCCCC"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="DDDDD"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="EEEEE"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="FFFFF"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="GGGGG"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="HHHHH"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="IIIII"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="JJJJJ"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="KKKKK"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="LLLLL"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="MMMMM"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="NNNNN"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="OOOOO"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="PPPPP"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="QQQQQ"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="RRRRR"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="SSSSS"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="TTTTT"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="UUUUU"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="VVVVV"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="WWWWW"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="XXXXX"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="YYYYY"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="dialog" label="ZZZZZ"></polymer-ui-menu-item>
+ <polymer-ui-menu-item icon="search" label="Search"></polymer-ui-menu-item>
+ </polymer-ui-menu>
+ </app-drawer>
+ </app-column>
+ </app-frame>
+ <script>
+ document.addEventListener('WebComponentsReady', function() {
+ // document.getElementById('menu-button').addEventListener('click', function() {
+ document.getElementById('nav-drawer').toggle();
+ });
+ </script>
+ </body>
+</html>
« no previous file with comments | « tools/perf/page_sets/key_silk_cases.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698