From 7a6824f552a556a9eb5273e279e8d33f62c35d95 Mon Sep 17 00:00:00 2001 From: Addy Osmani Date: Mon, 5 Aug 2013 15:43:26 +0100 Subject: [PATCH 1/3] Updating to latest official Polymer TodoMVC implementation --- architecture-examples/polymer/app/app.css | 18 +- .../bower_components/director/.bower.json | 13 + .../bower_components/director/.gitignore | 6 + .../bower_components/director/.travis.yml | 12 + .../polymer/bower_components/director/LICENSE | 19 + .../bower_components/director/README.md | 822 ++++++++++++++++++ .../bower_components/director/bin/build | 79 ++ .../director/examples/http.js | 33 + .../director/img/director.png | Bin 0 -> 12856 bytes .../director/img/hashRoute.png | Bin 0 -> 12485 bytes .../bower_components/director/lib/director.js | 6 + .../director/lib/director/browser.js | 297 +++++++ .../director/lib/director/cli.js | 65 ++ .../director/lib/director/http/index.js | 251 ++++++ .../director/lib/director/http/methods.js | 66 ++ .../director/lib/director/http/responses.js | 93 ++ .../director/lib/director/router.js | 797 +++++++++++++++++ .../bower_components/director/package.json | 42 + .../director/test/browser/backend/backend.js | 71 ++ .../test/browser/browserify-harness.html | 24 + .../director/test/browser/helpers/api.js | 77 ++ .../test/browser/html5-routes-harness.html | 23 + .../test/browser/html5-routes-test.js | 660 ++++++++++++++ .../director/test/browser/routes-harness.html | 21 + .../director/test/browser/routes-test.js | 694 +++++++++++++++ .../director/test/server/cli/dispatch-test.js | 55 ++ .../director/test/server/cli/mount-test.js | 30 + .../director/test/server/cli/path-test.js | 39 + .../test/server/core/dispatch-test.js | 113 +++ .../director/test/server/core/insert-test.js | 45 + .../director/test/server/core/mount-test.js | 117 +++ .../director/test/server/core/on-test.js | 38 + .../director/test/server/core/path-test.js | 49 ++ .../test/server/core/regifystring-test.js | 103 +++ .../director/test/server/helpers/index.js | 52 ++ .../director/test/server/helpers/macros.js | 55 ++ .../director/test/server/http/accept-test.js | 88 ++ .../director/test/server/http/attach-test.js | 51 ++ .../director/test/server/http/before-test.js | 38 + .../director/test/server/http/http-test.js | 65 ++ .../director/test/server/http/methods-test.js | 42 + .../test/server/http/responses-test.js | 21 + .../director/test/server/http/stream-test.js | 46 + .../bower_components/polymer/.bower.json | 23 + .../polymer/bower_components/polymer/LICENSE | 27 + .../bower_components/polymer/README.md | 7 + .../bower_components/polymer/bower.json | 15 + .../bower_components/polymer/build.log | 42 + .../bower_components/polymer/component.json | 17 + .../bower_components/polymer/composer.json | 36 + .../bower_components/polymer/package.json | 29 + .../bower_components/polymer/polymer.js | 50 -- .../bower_components/polymer/polymer.min.js | 35 + .../polymer/polymer.native.min.js | 34 + .../polymer/polymer.sandbox.min.js | 35 + .../bower_components/polymer/src/attrs.js | 182 ---- .../bower_components/polymer/src/base.js | 191 ---- .../bower_components/polymer/src/bindMDV.js | 182 ---- .../polymer/src/bindProperties.js | 27 - .../bower_components/polymer/src/boot.js | 20 - .../bower_components/polymer/src/build.js | 8 - .../bower_components/polymer/src/events.js | 276 ------ .../bower_components/polymer/src/job.js | 52 -- .../bower_components/polymer/src/lang.js | 15 - .../bower_components/polymer/src/marshal.js | 22 - .../polymer/src/observeProperties.js | 52 -- .../bower_components/polymer/src/oop.js | 100 --- .../bower_components/polymer/src/path.js | 33 - .../polymer/src/platform.min.js | 34 - .../polymer/src/polymerSyntaxMDV.js | 73 -- .../bower_components/polymer/src/register.js | 186 ---- .../polymer/src/shimStyling.js | 463 ---------- .../bower_components/polymer/src/styling.js | 204 ----- .../polymer/src/trackObservers.js | 55 -- .../todomvc-common/.bower.json | 13 + .../todomvc-common/bower.json | 4 + .../polymer/elements/td-input.html | 22 + .../polymer/elements/td-item.css | 5 + .../polymer/elements/td-item.html | 93 +- .../polymer/elements/td-model.html | 47 +- .../polymer/elements/td-todos.css | 14 +- .../polymer/elements/td-todos.html | 86 +- architecture-examples/polymer/index.html | 31 +- .../lib-elements/flatiron-director.html | 50 +- .../lib-elements/polymer-localstorage.html | 33 +- .../lib-elements/polymer-selection.html | 41 +- .../lib-elements/polymer-selector.html | 160 ++-- 87 files changed, 5881 insertions(+), 2479 deletions(-) create mode 100644 architecture-examples/polymer/bower_components/director/.bower.json create mode 100644 architecture-examples/polymer/bower_components/director/.gitignore create mode 100644 architecture-examples/polymer/bower_components/director/.travis.yml create mode 100644 architecture-examples/polymer/bower_components/director/LICENSE create mode 100644 architecture-examples/polymer/bower_components/director/README.md create mode 100755 architecture-examples/polymer/bower_components/director/bin/build create mode 100644 architecture-examples/polymer/bower_components/director/examples/http.js create mode 100644 architecture-examples/polymer/bower_components/director/img/director.png create mode 100644 architecture-examples/polymer/bower_components/director/img/hashRoute.png create mode 100644 architecture-examples/polymer/bower_components/director/lib/director.js create mode 100644 architecture-examples/polymer/bower_components/director/lib/director/browser.js create mode 100644 architecture-examples/polymer/bower_components/director/lib/director/cli.js create mode 100644 architecture-examples/polymer/bower_components/director/lib/director/http/index.js create mode 100644 architecture-examples/polymer/bower_components/director/lib/director/http/methods.js create mode 100644 architecture-examples/polymer/bower_components/director/lib/director/http/responses.js create mode 100644 architecture-examples/polymer/bower_components/director/lib/director/router.js create mode 100644 architecture-examples/polymer/bower_components/director/package.json create mode 100644 architecture-examples/polymer/bower_components/director/test/browser/backend/backend.js create mode 100644 architecture-examples/polymer/bower_components/director/test/browser/browserify-harness.html create mode 100644 architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js create mode 100644 architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html create mode 100644 architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html create mode 100644 architecture-examples/polymer/bower_components/director/test/browser/routes-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/on-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/path-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/helpers/index.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/before-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/http-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js create mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js create mode 100644 architecture-examples/polymer/bower_components/polymer/.bower.json create mode 100644 architecture-examples/polymer/bower_components/polymer/LICENSE create mode 100644 architecture-examples/polymer/bower_components/polymer/README.md create mode 100644 architecture-examples/polymer/bower_components/polymer/bower.json create mode 100644 architecture-examples/polymer/bower_components/polymer/build.log create mode 100644 architecture-examples/polymer/bower_components/polymer/component.json create mode 100644 architecture-examples/polymer/bower_components/polymer/composer.json create mode 100644 architecture-examples/polymer/bower_components/polymer/package.json delete mode 100644 architecture-examples/polymer/bower_components/polymer/polymer.js create mode 100644 architecture-examples/polymer/bower_components/polymer/polymer.min.js create mode 100644 architecture-examples/polymer/bower_components/polymer/polymer.native.min.js create mode 100644 architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/attrs.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/base.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/bindMDV.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/bindProperties.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/boot.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/build.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/events.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/job.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/lang.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/marshal.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/observeProperties.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/oop.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/path.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/platform.min.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/polymerSyntaxMDV.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/register.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/shimStyling.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/styling.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/src/trackObservers.js create mode 100644 architecture-examples/polymer/bower_components/todomvc-common/.bower.json create mode 100644 architecture-examples/polymer/bower_components/todomvc-common/bower.json create mode 100644 architecture-examples/polymer/elements/td-input.html diff --git a/architecture-examples/polymer/app/app.css b/architecture-examples/polymer/app/app.css index a1986f4733..1442dbb03c 100644 --- a/architecture-examples/polymer/app/app.css +++ b/architecture-examples/polymer/app/app.css @@ -20,14 +20,14 @@ body { font-smoothing: antialiased; } -body > section { - position: relative; - margin: 130px 0 40px 0; +body > header { + padding-top: 22px; + margin-bottom: -5px; } h1 { - position: absolute; - top: -120px; + /* position: absolute; + top: -120px;*/ width: 100%; font-size: 70px; font-weight: bold; @@ -185,6 +185,12 @@ hr { transition-duration: 500ms; } + +/* IE doesn't support the hidden attribute */ +[hidden] { + display: none; +} + @media (min-width: 899px) { /**body*/.learn-bar { width: auto; @@ -193,7 +199,7 @@ hr { /**body*/.learn-bar > .learn { left: 8px; } - /**body*/.learn-bar > section { + /**body*/.learn-bar #todoapp { width: 550px; margin: 130px auto 40px auto; } diff --git a/architecture-examples/polymer/bower_components/director/.bower.json b/architecture-examples/polymer/bower_components/director/.bower.json new file mode 100644 index 0000000000..6a6f639f7c --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/.bower.json @@ -0,0 +1,13 @@ +{ + "name": "director", + "homepage": "https://github.com/flatiron/director", + "version": "1.2.0", + "_release": "1.2.0", + "_resolution": { + "type": "version", + "tag": "v1.2.0", + "commit": "538dee97b0d57163d682a397de674f36af4d16a1" + }, + "_source": "git://github.com/flatiron/director.git", + "_target": "*" +} \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/.gitignore b/architecture-examples/polymer/bower_components/director/.gitignore new file mode 100644 index 0000000000..ff1a80c4eb --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/.gitignore @@ -0,0 +1,6 @@ +/.idea/ +node_modules +npm-debug.log +.DS_Store + +/test/browser/browserified-bundle.js diff --git a/architecture-examples/polymer/bower_components/director/.travis.yml b/architecture-examples/polymer/bower_components/director/.travis.yml new file mode 100644 index 0000000000..2f3b02ef69 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/.travis.yml @@ -0,0 +1,12 @@ +language: node_js + +node_js: + - 0.6 + - 0.8 + - "0.10" + +notifications: + email: + - travis@nodejitsu.com + irc: "irc.freenode.org#nodejitsu" + diff --git a/architecture-examples/polymer/bower_components/director/LICENSE b/architecture-examples/polymer/bower_components/director/LICENSE new file mode 100644 index 0000000000..1f01e2b36c --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Nodejitsu Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/README.md b/architecture-examples/polymer/bower_components/director/README.md new file mode 100644 index 0000000000..522d146c47 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/README.md @@ -0,0 +1,822 @@ + + +# Synopsis +Director is a router. Routing is the process of determining what code to run when a URL is requested. + +# Motivation +A routing library that works in both the browser and node.js environments with as few differences as possible. Simplifies the development of Single Page Apps and Node.js applications. Dependency free (doesn't require jQuery or Express, etc). + +# Status +[![Build Status](https://secure.travis-ci.org/flatiron/director.png?branch=master)](http://travis-ci.org/flatiron/director) + +# Features +* [Client-Side Routing](#client-side) +* [Server-Side HTTP Routing](#http-routing) +* [Server-Side CLI Routing](#cli-routing) + + +# Usage +* [API Documentation](#api-documentation) +* [Frequently Asked Questions](#faq) + + +## Client-side Routing +It simply watches the hash of the URL to determine what to do, for example: + +``` +http://foo.com/#/bar +``` + +Client-side routing (aka hash-routing) allows you to specify some information about the state of the application using the URL. So that when the user visits a specific URL, the application can be transformed accordingly. + + + +Here is a simple example: + +```html + + + + + A Gentle Introduction + + + + + + + +``` + +Director works great with your favorite DOM library, such as jQuery. + +```html + + + + + A Gentle Introduction 2 + + + + + +
Author Name
+
Book1, Book2, Book3
+ + + +``` + +You can find a browser-specific build of `director` [here][1] which has all of the server code stripped away. + + +## Server-Side HTTP Routing + +Director handles routing for HTTP requests similar to `journey` or `express`: + +```js + // + // require the native http module, as well as director. + // + var http = require('http'), + director = require('director'); + + // + // create some logic to be routed to. + // + function helloWorld() { + this.res.writeHead(200, { 'Content-Type': 'text/plain' }) + this.res.end('hello world'); + } + + // + // define a routing table. + // + var router = new director.http.Router({ + '/hello': { + get: helloWorld + } + }); + + // + // setup a server and when there is a request, dispatch the + // route that was requested in the request object. + // + var server = http.createServer(function (req, res) { + router.dispatch(req, res, function (err) { + if (err) { + res.writeHead(404); + res.end(); + } + }); + }); + + // + // You can also do ad-hoc routing, similar to `journey` or `express`. + // This can be done with a string or a regexp. + // + router.get('/bonjour', helloWorld); + router.get(/hola/, helloWorld); + + // + // set the server to listen on port `8080`. + // + server.listen(8080); +``` + +### See Also: + + - Auto-generated Node.js API Clients for routers using [Director-Reflector](http://github.com/flatiron/director-reflector) + - RESTful Resource routing using [restful](http://github.com/flatiron/restful) + - HTML / Plain Text views of routers using [Director-Explorer](http://github.com/flatiron/director-explorer) + + +## CLI Routing + +Director supports Command Line Interface routing. Routes for cli options are based on command line input (i.e. `process.argv`) instead of a URL. + +``` js + var director = require('director'); + + var router = new director.cli.Router(); + + router.on('create', function () { + console.log('create something'); + }); + + router.on(/destroy/, function () { + console.log('destroy something'); + }); + + // You will need to dispatch the cli arguments yourself + router.dispatch('on', process.argv.slice(2).join(' ')); +``` + +Using the cli router, you can dispatch commands by passing them as a string. For example, if this example is in a file called `foo.js`: + +``` bash +$ node foo.js create +create something +$ node foo.js destroy +destroy something +``` + + +# API Documentation + +* [Constructor](#constructor) +* [Routing Table](#routing-table) +* [Adhoc Routing](#adhoc-routing) +* [Scoped Routing](#scoped-routing) +* [Routing Events](#routing-events) +* [Configuration](#configuration) +* [URL Matching](#url-matching) +* [URL Params](#url-params) +* [Route Recursion](#route-recursion) +* [Async Routing](#async-routing) +* [Resources](#resources) +* [History API](#history-api) +* [Instance Methods](#instance-methods) +* [Attach Properties to `this`](#attach-to-this) +* [HTTP Streaming and Body Parsing](#http-streaming-body-parsing) + + +## Constructor + +``` js + var router = Router(routes); +``` + + +## Routing Table + +An object literal that contains nested route definitions. A potentially nested set of key/value pairs. The keys in the object literal represent each potential part of the URL. The values in the object literal contain references to the functions that should be associated with them. *bark* and *meow* are two functions that you have defined in your code. + +``` js + // + // Assign routes to an object literal. + // + var routes = { + // + // a route which assigns the function `bark`. + // + '/dog': bark, + // + // a route which assigns the functions `meow` and `scratch`. + // + '/cat': [meow, scratch] + }; + + // + // Instantiate the router. + // + var router = Router(routes); +``` + + +## Adhoc Routing + +When developing large client-side or server-side applications it is not always possible to define routes in one location. Usually individual decoupled components register their own routes with the application router. We refer to this as _Adhoc Routing._ Lets take a look at the API `director` exposes for adhoc routing: + +**Client-side Routing** + +``` js + var router = new Router().init(); + + router.on('/some/resource', function () { + // + // Do something on `/#/some/resource` + // + }); +``` + +**HTTP Routing** + +``` js + var router = new director.http.Router(); + + router.get(/\/some\/resource/, function () { + // + // Do something on an GET to `/some/resource` + // + }); +``` + + +## Scoped Routing + +In large web appliations, both [Client-side](#client-side) and [Server-side](#http-routing), routes are often scoped within a few individual resources. Director exposes a simple way to do this for [Adhoc Routing](#adhoc-routing) scenarios: + +``` js + var router = new director.http.Router(); + + // + // Create routes inside the `/users` scope. + // + router.path(/\/users\/(\w+)/, function () { + // + // The `this` context of the function passed to `.path()` + // is the Router itself. + // + + this.post(function (id) { + // + // Create the user with the specified `id`. + // + }); + + this.get(function (id) { + // + // Retreive the user with the specified `id`. + // + }); + + this.get(/\/friends/, function (id) { + // + // Get the friends for the user with the specified `id`. + // + }); + }); +``` + + +## Routing Events + +In `director`, a "routing event" is a named property in the [Routing Table](#routing-table) which can be assigned to a function or an Array of functions to be called when a route is matched in a call to `router.dispatch()`. + +* **on:** A function or Array of functions to execute when the route is matched. +* **before:** A function or Array of functions to execute before calling the `on` method(s). + +**Client-side only** + +* **after:** A function or Array of functions to execute when leaving a particular route. +* **once:** A function or Array of functions to execute only once for a particular route. + + +## Configuration + +Given the flexible nature of `director` there are several options available for both the [Client-side](#client-side) and [Server-side](#http-routing). These options can be set using the `.configure()` method: + +``` js + var router = new director.Router(routes).configure(options); +``` + +The `options` are: + +* **recurse:** Controls [route recursion](#route-recursion). Use `forward`, `backward`, or `false`. Default is `false` Client-side, and `backward` Server-side. +* **strict:** If set to `false`, then trailing slashes (or other delimiters) are allowed in routes. Default is `true`. +* **async:** Controls [async routing](#async-routing). Use `true` or `false`. Default is `false`. +* **delimiter:** Character separator between route fragments. Default is `/`. +* **notfound:** A function to call if no route is found on a call to `router.dispatch()`. +* **on:** A function (or list of functions) to call on every call to `router.dispatch()` when a route is found. +* **before:** A function (or list of functions) to call before every call to `router.dispatch()` when a route is found. + +**Client-side only** + +* **resource:** An object to which string-based routes will be bound. This can be especially useful for late-binding to route functions (such as async client-side requires). +* **after:** A function (or list of functions) to call when a given route is no longer the active route. +* **html5history:** If set to `true` and client supports `pushState()`, then uses HTML5 History API instead of hash fragments. See [History API](#history-api) for more information. +* **run_handler_in_init:** If `html5history` is enabled, the route handler by default is executed upon `Router.init()` since with real URIs the router can not know if it should call a route handler or not. Setting this to `false` disables the route handler initial execution. + + +## URL Matching + +``` js + var router = Router({ + // + // given the route '/dog/yella'. + // + '/dog': { + '/:color': { + // + // this function will return the value 'yella'. + // + on: function (color) { console.log(color) } + } + } + }); +``` + +Routes can sometimes become very complex, `simple/:tokens` don't always suffice. Director supports regular expressions inside the route names. The values captured from the regular expressions are passed to your listener function. + +``` js + var router = Router({ + // + // given the route '/hello/world'. + // + '/hello': { + '/(\\w+)': { + // + // this function will return the value 'world'. + // + on: function (who) { console.log(who) } + } + } + }); +``` + +``` js + var router = Router({ + // + // given the route '/hello/world/johny/appleseed'. + // + '/hello': { + '/world/?([^\/]*)\/([^\/]*)/?': function (a, b) { + console.log(a, b); + } + } + }); +``` + + +## URL Parameters + +When you are using the same route fragments it is more descriptive to define these fragments by name and then use them in your [Routing Table](#routing-table) or [Adhoc Routes](#adhoc-routing). Consider a simple example where a `userId` is used repeatedly. + +``` js + // + // Create a router. This could also be director.cli.Router() or + // director.http.Router(). + // + var router = new director.Router(); + + // + // A route could be defined using the `userId` explicitly. + // + router.on(/([\w-_]+)/, function (userId) { }); + + // + // Define a shorthand for this fragment called `userId`. + // + router.param('userId', /([\\w\\-]+)/); + + // + // Now multiple routes can be defined with the same + // regular expression. + // + router.on('/anything/:userId', function (userId) { }); + router.on('/something-else/:userId', function (userId) { }); +``` + + +## Route Recursion + +Can be assigned the value of `forward` or `backward`. The recurse option will determine the order in which to fire the listeners that are associated with your routes. If this option is NOT specified or set to null, then only the listeners associated with an exact match will be fired. + +### No recursion, with the URL /dog/angry + +``` js + var routes = { + '/dog': { + '/angry': { + // + // Only this method will be fired. + // + on: growl + }, + on: bark + } + }; + + var router = Router(routes); +``` + +### Recursion set to `backward`, with the URL /dog/angry + +``` js + var routes = { + '/dog': { + '/angry': { + // + // This method will be fired first. + // + on: growl + }, + // + // This method will be fired second. + // + on: bark + } + }; + + var router = Router(routes).configure({ recurse: 'backward' }); +``` + +### Recursion set to `forward`, with the URL /dog/angry + +``` js + var routes = { + '/dog': { + '/angry': { + // + // This method will be fired second. + // + on: growl + }, + // + // This method will be fired first. + // + on: bark + } + }; + + var router = Router(routes).configure({ recurse: 'forward' }); +``` + +### Breaking out of recursion, with the URL /dog/angry + +``` js + var routes = { + '/dog': { + '/angry': { + // + // This method will be fired first. + // + on: function() { return false; } + }, + // + // This method will not be fired. + // + on: bark + } + }; + + // + // This feature works in reverse with recursion set to true. + // + var router = Router(routes).configure({ recurse: 'backward' }); +``` + + +## Async Routing + +Before diving into how Director exposes async routing, you should understand [Route Recursion](#route-recursion). At it's core route recursion is about evaluating a series of functions gathered when traversing the [Routing Table](#routing-table). + +Normally this series of functions is evaluated synchronously. In async routing, these functions are evaluated asynchronously. Async routing can be extremely useful both on the client-side and the server-side: + +* **Client-side:** To ensure an animation or other async operations (such as HTTP requests for authentication) have completed before continuing evaluation of a route. +* **Server-side:** To ensure arbitrary async operations (such as performing authentication) have completed before continuing the evaluation of a route. + +The method signatures for route functions in synchronous and asynchronous evaluation are different: async route functions take an additional `next()` callback. + +### Synchronous route functions + +``` js + var router = new director.Router(); + + router.on('/:foo/:bar/:bazz', function (foo, bar, bazz) { + // + // Do something asynchronous with `foo`, `bar`, and `bazz`. + // + }); +``` + +### Asynchronous route functions + +``` js + var router = new director.http.Router().configure({ async: true }); + + router.on('/:foo/:bar/:bazz', function (foo, bar, bazz, next) { + // + // Go do something async, and determine that routing should stop + // + next(false); + }); +``` + + +## Resources + +**Available on the Client-side only.** An object literal containing functions. If a host object is specified, your route definitions can provide string literals that represent the function names inside the host object. A host object can provide the means for better encapsulation and design. + +``` js + + var router = Router({ + + '/hello': { + '/usa': 'americas', + '/china': 'asia' + } + + }).configure({ resource: container }).init(); + + var container = { + americas: function() { return true; }, + china: function() { return true; } + }; + +``` + + +## History API + +**Available on the Client-side only.** Director supports using HTML5 History API instead of hash fragments for navigation. To use the API, pass `{html5history: true}` to `configure()`. Use of the API is enabled only if the client supports `pushState()`. + +Using the API gives you cleaner URIs but they come with a cost. Unlike with hash fragments your route URIs must exist. When the client enters a page, say http://foo.com/bar/baz, the web server must respond with something meaningful. Usually this means that your web server checks the URI points to something that, in a sense, exists, and then serves the client the JavaScript application. + +If you're after a single-page application you can not use plain old `` tags for navigation anymore. When such link is clicked, web browsers try to ask for the resource from server which is not of course desired for a single-page application. Instead you need to use e.g. click handlers and call the `setRoute()` method yourself. + + +## Attach Properties To `this` + +Generally, the `this` object bound to route handlers, will contain the request in `this.req` and the response in `this.res`. One may attach additional properties to `this` with the `router.attach` method: + +```js + var director = require('director'); + + var router = new director.http.Router().configure(options); + + // + // Attach properties to `this` + // + router.attach(function () { + this.data = [1,2,3]; + }); + + // + // Access properties attached to `this` in your routes! + // + router.get('/hello', function () { + this.res.writeHead(200, { 'content-type': 'text/plain' }); + + // + // Response will be `[1,2,3]`! + // + this.res.end(this.data); + }); +``` + +This API may be used to attach convenience methods to the `this` context of route handlers. + + +## HTTP Streaming and Body Parsing + +When you are performing HTTP routing there are two common scenarios: + +* Buffer the request body and parse it according to the `Content-Type` header (usually `application/json` or `application/x-www-form-urlencoded`). +* Stream the request body by manually calling `.pipe` or listening to the `data` and `end` events. + +By default `director.http.Router()` will attempt to parse either the `.chunks` or `.body` properties set on the request parameter passed to `router.dispatch(request, response, callback)`. The router instance will also wait for the `end` event before firing any routes. + +**Default Behavior** + +``` js + var director = require('director'); + + var router = new director.http.Router(); + + router.get('/', function () { + // + // This will not work, because all of the data + // events and the end event have already fired. + // + this.req.on('data', function (chunk) { + console.log(chunk) + }); + }); +``` + +In [flatiron][2], `director` is used in conjunction with [union][3] which uses a `BufferedStream` proxy to the raw `http.Request` instance. [union][3] will set the `req.chunks` property for you and director will automatically parse the body. If you wish to perform this buffering yourself directly with `director` you can use a simple request handler in your http server: + +``` js + var http = require('http'), + director = require('director'); + + var router = new director.http.Router(); + + var server = http.createServer(function (req, res) { + req.chunks = []; + req.on('data', function (chunk) { + req.chunks.push(chunk.toString()); + }); + + router.dispatch(req, res, function (err) { + if (err) { + res.writeHead(404); + res.end(); + } + + console.log('Served ' + req.url); + }); + }); + + router.post('/', function () { + this.res.writeHead(200, { 'Content-Type': 'application/json' }) + this.res.end(JSON.stringify(this.req.body)); + }); +``` + +**Streaming Support** + +If you wish to get access to the request stream before the `end` event is fired, you can pass the `{ stream: true }` options to the route. + +``` js + var director = require('director'); + + var router = new director.http.Router(); + + router.get('/', { stream: true }, function () { + // + // This will work because the route handler is invoked + // immediately without waiting for the `end` event. + // + this.req.on('data', function (chunk) { + console.log(chunk); + }); + }); +``` + + +## Instance methods + +### configure(options) +* `options` {Object}: Options to configure this instance with. + +Configures the Router instance with the specified `options`. See [Configuration](#configuration) for more documentation. + +### param(token, matcher) +* token {string}: Named parameter token to set to the specified `matcher` +* matcher {string|Regexp}: Matcher for the specified `token`. + +Adds a route fragment for the given string `token` to the specified regex `matcher` to this Router instance. See [URL Parameters](#url-params) for more documentation. + +### on(method, path, route) +* `method` {string}: Method to insert within the Routing Table (e.g. `on`, `get`, etc.). +* `path` {string}: Path within the Routing Table to set the `route` to. +* `route` {function|Array}: Route handler to invoke for the `method` and `path`. + +Adds the `route` handler for the specified `method` and `path` within the [Routing Table](#routing-table). + +### path(path, routesFn) +* `path` {string|Regexp}: Scope within the Routing Table to invoke the `routesFn` within. +* `routesFn` {function}: Adhoc Routing function with calls to `this.on()`, `this.get()` etc. + +Invokes the `routesFn` within the scope of the specified `path` for this Router instance. + +### dispatch(method, path[, callback]) +* method {string}: Method to invoke handlers for within the Routing Table +* path {string}: Path within the Routing Table to match +* callback {function}: Invoked once all route handlers have been called. + +Dispatches the route handlers matched within the [Routing Table](#routing-table) for this instance for the specified `method` and `path`. + +### mount(routes, path) +* routes {object}: Partial routing table to insert into this instance. +* path {string|Regexp}: Path within the Routing Table to insert the `routes` into. + +Inserts the partial [Routing Table](#routing-table), `routes`, into the Routing Table for this Router instance at the specified `path`. + +## Instance methods (Client-side only) + +### init([redirect]) +* `redirect` {String}: This value will be used if '/#/' is not found in the URL. (e.g., init('/') will resolve to '/#/', init('foo') will resolve to '/#foo'). + +Initialize the router, start listening for changes to the URL. + +### getRoute([index]) +* `index` {Number}: The hash value is divided by forward slashes, each section then has an index, if this is provided, only that section of the route will be returned. + +Returns the entire route or just a section of it. + +### setRoute(route) +* `route` {String}: Supply a route value, such as `home/stats`. + +Set the current route. + +### setRoute(start, length) +* `start` {Number} - The position at which to start removing items. +* `length` {Number} - The number of items to remove from the route. + +Remove a segment from the current route. + +### setRoute(index, value) +* `index` {Number} - The hash value is divided by forward slashes, each section then has an index. +* `value` {String} - The new value to assign the the position indicated by the first parameter. + +Set a segment of the current route. + + +# Frequently Asked Questions + +## What About SEO? + +Is using a Client-side router a problem for SEO? Yes. If advertising is a requirement, you are probably building a "Web Page" and not a "Web Application". Director on the client is meant for script-heavy Web Applications. + +# Licence + +(The MIT License) + +Copyright (c) 2010 Nodejitsu Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +[0]: http://github.com/flatiron/director +[1]: https://github.com/flatiron/director/blob/master/build/director.min.js +[2]: http://github.com/flatiron/flatiron +[3]: http://github.com/flatiron/union diff --git a/architecture-examples/polymer/bower_components/director/bin/build b/architecture-examples/polymer/bower_components/director/bin/build new file mode 100755 index 0000000000..23e8ecff77 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/bin/build @@ -0,0 +1,79 @@ +#!/usr/bin/env node + +var Codesurgeon = require('codesurgeon').Codesurgeon; +var surgeon = new Codesurgeon; + +var path = require('path'); + +var root = path.join(__dirname, '..'); +var lib = path.join(root, 'lib', 'director'); + +// +// Distill and package the browser version. +// +surgeon + // + .configure({ + package: root + '/package.json', + owner: 'Nodejitsu, Inc (Using Codesurgeon).', + noVersion: true + }) + .read( + path.join(lib, 'browser.js') + ) + // + // we want everything so far. specify extract with no + // parameters to get everything into the output buffer. + // + .extract() + // + // clear the input so far, but don't clear the output. + // + .clear('inputs') + // + // read the `router.js` file + // + .read( + path.join(lib, 'router.js') + ) + // + // the current input buffer contains stuff that we dont + // want in the browser build, so let's cherry pick from + // the buffer. + // + .extract( + '_every', + '_flatten', + '_asyncEverySeries', + 'paramifyString', + 'regifyString', + 'terminator', + 'Router.prototype.configure', + 'Router.prototype.param', + 'Router.prototype.on', + 'Router.prototype.dispatch', + 'Router.prototype.invoke', + 'Router.prototype.traverse', + 'Router.prototype.insert', + 'Router.prototype.insertEx', + 'Router.prototype.extend', + 'Router.prototype.runlist', + 'Router.prototype.mount' + ) + // + // wrap everything that is in the current buffer with a + // closure so that we dont get any collisions with other + // libraries + // + .wrap() + // + // write the debuggable version of the file. This file will + // get renamed to include the version from the package.json + // + .write(root + '/build/director.js') + // + // now lets make a minified version for production use. + // + .uglify() + .write(root + '/build/director.min.js') +; diff --git a/architecture-examples/polymer/bower_components/director/examples/http.js b/architecture-examples/polymer/bower_components/director/examples/http.js new file mode 100644 index 0000000000..4e7a1d7208 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/examples/http.js @@ -0,0 +1,33 @@ +var http = require('http'), + director = require('../lib/director'); + +var router = new director.http.Router(); + +var server = http.createServer(function (req, res) { + req.chunks = []; + req.on('data', function (chunk) { + req.chunks.push(chunk.toString()); + }); + + router.dispatch(req, res, function (err) { + if (err) { + res.writeHead(404); + res.end(); + } + + console.log('Served ' + req.url); + }); +}); + +router.get(/foo/, function () { + this.res.writeHead(200, { 'Content-Type': 'text/plain' }); + this.res.end('hello world\n'); +}); + +router.post(/foo/, function () { + this.res.writeHead(200, { 'Content-Type': 'application/json' }); + this.res.end(JSON.stringify(this.req.body)); +}); + +server.listen(8080); +console.log('vanilla http server with director running on 8080'); diff --git a/architecture-examples/polymer/bower_components/director/img/director.png b/architecture-examples/polymer/bower_components/director/img/director.png new file mode 100644 index 0000000000000000000000000000000000000000..ce1a92ae5c718312e566dec1e56ba92835935662 GIT binary patch literal 12856 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�wJImzH*Sc7DqYiRc=SY5Kib4jA@n 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 BG_C*u literal 0 HcmV?d00001 diff --git a/architecture-examples/polymer/bower_components/director/lib/director.js b/architecture-examples/polymer/bower_components/director/lib/director.js new file mode 100644 index 0000000000..f43ae82750 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/lib/director.js @@ -0,0 +1,6 @@ + + + +exports.Router = require('./director/router').Router; +exports.http = require('./director/http'); +exports.cli = require('./director/cli'); diff --git a/architecture-examples/polymer/bower_components/director/lib/director/browser.js b/architecture-examples/polymer/bower_components/director/lib/director/browser.js new file mode 100644 index 0000000000..d5709979e1 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/lib/director/browser.js @@ -0,0 +1,297 @@ + +/* + * browser.js: Browser specific functionality for director. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +if (!Array.prototype.filter) { + Array.prototype.filter = function(filter, that) { + var other = [], v; + for (var i = 0, n = this.length; i < n; i++) { + if (i in this && filter.call(that, v = this[i], i, this)) { + other.push(v); + } + } + return other; + }; +} + +if (!Array.isArray){ + Array.isArray = function(obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; + }; +} + +var dloc = document.location; + +function dlocHashEmpty() { + // Non-IE browsers return '' when the address bar shows '#'; Director's logic + // assumes both mean empty. + return dloc.hash === '' || dloc.hash === '#'; +} + +var listener = { + mode: 'modern', + hash: dloc.hash, + history: false, + + check: function () { + var h = dloc.hash; + if (h != this.hash) { + this.hash = h; + this.onHashChanged(); + } + }, + + fire: function () { + if (this.mode === 'modern') { + this.history === true ? window.onpopstate() : window.onhashchange(); + } + else { + this.onHashChanged(); + } + }, + + init: function (fn, history) { + var self = this; + this.history = history; + + if (!Router.listeners) { + Router.listeners = []; + } + + function onchange(onChangeEvent) { + for (var i = 0, l = Router.listeners.length; i < l; i++) { + Router.listeners[i](onChangeEvent); + } + } + + //note IE8 is being counted as 'modern' because it has the hashchange event + if ('onhashchange' in window && (document.documentMode === undefined + || document.documentMode > 7)) { + // At least for now HTML5 history is available for 'modern' browsers only + if (this.history === true) { + // There is an old bug in Chrome that causes onpopstate to fire even + // upon initial page load. Since the handler is run manually in init(), + // this would cause Chrome to run it twise. Currently the only + // workaround seems to be to set the handler after the initial page load + // http://code.google.com/p/chromium/issues/detail?id=63040 + setTimeout(function() { + window.onpopstate = onchange; + }, 500); + } + else { + window.onhashchange = onchange; + } + this.mode = 'modern'; + } + else { + // + // IE support, based on a concept by Erik Arvidson ... + // + var frame = document.createElement('iframe'); + frame.id = 'state-frame'; + frame.style.display = 'none'; + document.body.appendChild(frame); + this.writeFrame(''); + + if ('onpropertychange' in document && 'attachEvent' in document) { + document.attachEvent('onpropertychange', function () { + if (event.propertyName === 'location') { + self.check(); + } + }); + } + + window.setInterval(function () { self.check(); }, 50); + + this.onHashChanged = onchange; + this.mode = 'legacy'; + } + + Router.listeners.push(fn); + + return this.mode; + }, + + destroy: function (fn) { + if (!Router || !Router.listeners) { + return; + } + + var listeners = Router.listeners; + + for (var i = listeners.length - 1; i >= 0; i--) { + if (listeners[i] === fn) { + listeners.splice(i, 1); + } + } + }, + + setHash: function (s) { + // Mozilla always adds an entry to the history + if (this.mode === 'legacy') { + this.writeFrame(s); + } + + if (this.history === true) { + window.history.pushState({}, document.title, s); + // Fire an onpopstate event manually since pushing does not obviously + // trigger the pop event. + this.fire(); + } else { + dloc.hash = (s[0] === '/') ? s : '/' + s; + } + return this; + }, + + writeFrame: function (s) { + // IE support... + var f = document.getElementById('state-frame'); + var d = f.contentDocument || f.contentWindow.document; + d.open(); + d.write(" + + + + + + + diff --git a/architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js b/architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js new file mode 100644 index 0000000000..d784700aa0 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js @@ -0,0 +1,77 @@ +module("Director.js", { + setup: function() { + window.location.hash = ""; + shared = {}; + // Init needed keys earlier because of in HTML5 mode the route handler + // is executed upon Router.init() and due to that setting shared.fired + // in the param test of createTest is too late + if (HTML5TEST) { + shared.fired = []; + shared.fired_count = 0; + } + }, + teardown: function() { + window.location.hash = ""; + shared = {}; + } +}); + +var shared; + +function createTest(name, config, use, test, initialRoute) { + // We rename to `RouterAlias` for the browserify tests, since we want to be + // sure that no code is depending on `window.Router` being available. + var Router = window.Router || window.RouterAlias; + + if (typeof use === 'function') { + test = use; + use = undefined; + } + + if (HTML5TEST) { + if (use === undefined) { + use = {}; + } + + if (use.run_handler_in_init === undefined) { + use.run_handler_in_init = false; + } + use.html5history = true; + } + + // Because of the use of setTimeout when defining onpopstate + var innerTimeout = HTML5TEST === true ? 500 : 0; + + asyncTest(name, function() { + setTimeout(function() { + var router = new Router(config), + context; + + if (use !== undefined) { + router.configure(use); + } + + router.init(initialRoute); + + setTimeout(function() { + test.call(context = { + router: router, + navigate: function(url, callback) { + if (HTML5TEST) { + router.setRoute(url); + } else { + window.location.hash = url; + } + setTimeout(function() { + callback.call(context); + }, 14); + }, + finish: function() { + router.destroy(); + start(); + } + }) + }, innerTimeout); + }, 14); + }); +}; diff --git a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html b/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html new file mode 100644 index 0000000000..eaf8ffc24b --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html @@ -0,0 +1,23 @@ + + + + + Director HTML5 Tests + + + +

Note: in order to execute HTML5 mode test this file needs to be served with provided nodejs backend. Start the server from director/test/browser/backend and go to http://localhost:8080/ to launch the tests.

+ +
+
+ + + + + + + + + diff --git a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js b/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js new file mode 100644 index 0000000000..628d3c9700 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js @@ -0,0 +1,660 @@ +var browser_history_support = (window.history != null ? window.history.pushState : null) != null; + +createTest('Nested route with the many children as a tokens, callbacks should yield historic params', { + '/a': { + '/:id': { + '/:id': function(a, b) { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, ''), a, b); + } else { + shared.fired.push(location.pathname, a, b); + } + } + } + } +}, function() { + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['/a/b/c', 'b', 'c']); + this.finish(); + }); +}); + +createTest('Nested route with the first child as a token, callback should yield a param', { + '/foo': { + '/:id': { + on: function(id) { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, ''), id); + } else { + shared.fired.push(location.pathname, id); + } + } + } + } +}, function() { + this.navigate('/foo/a', function() { + this.navigate('/foo/b/c', function() { + deepEqual(shared.fired, ['/foo/a', 'a']); + this.finish(); + }); + }); +}); + +createTest('Nested route with the first child as a regexp, callback should yield a param', { + '/foo': { + '/(\\w+)': { + on: function(value) { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, ''), value); + } else { + shared.fired.push(location.pathname, value); + } + } + } + } +}, function() { + this.navigate('/foo/a', function() { + this.navigate('/foo/b/c', function() { + deepEqual(shared.fired, ['/foo/a', 'a']); + this.finish(); + }); + }); +}); + +createTest('Nested route with the several regular expressions, callback should yield a param', { + '/a': { + '/(\\w+)': { + '/(\\w+)': function(a, b) { + shared.fired.push(a, b); + } + } + } +}, function() { + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['b', 'c']); + this.finish(); + }); +}); + +createTest('Single nested route with on member containing function value', { + '/a': { + '/b': { + on: function() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(location.pathname); + } + } + } + } +}, function() { + this.navigate('/a/b', function() { + deepEqual(shared.fired, ['/a/b']); + this.finish(); + }); +}); + +createTest('Single non-nested route with on member containing function value', { + '/a/b': { + on: function() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(location.pathname); + } + } + } +}, function() { + this.navigate('/a/b', function() { + deepEqual(shared.fired, ['/a/b']); + this.finish(); + }); +}); + +createTest('Single nested route with on member containing array of function values', { + '/a': { + '/b': { + on: [function() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(location.pathname); + } + }, + function() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(location.pathname); + } + }] + } + } +}, function() { + this.navigate('/a/b', function() { + deepEqual(shared.fired, ['/a/b', '/a/b']); + this.finish(); + }); +}); + +createTest('method should only fire once on the route.', { + '/a': { + '/b': { + once: function() { + shared.fired_count++; + } + } + } +}, function() { + this.navigate('/a/b', function() { + this.navigate('/a/b', function() { + this.navigate('/a/b', function() { + deepEqual(shared.fired_count, 1); + this.finish(); + }); + }); + }); +}); + +createTest('method should only fire once on the route, multiple nesting.', { + '/a': { + on: function() { shared.fired_count++; }, + once: function() { shared.fired_count++; } + }, + '/b': { + on: function() { shared.fired_count++; }, + once: function() { shared.fired_count++; } + } +}, function() { + this.navigate('/a', function() { + this.navigate('/b', function() { + this.navigate('/a', function() { + this.navigate('/b', function() { + deepEqual(shared.fired_count, 6); + this.finish(); + }); + }); + }); + }); +}); + +createTest('overlapping routes with tokens.', { + '/a/:b/c' : function() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(location.pathname); + } + }, + '/a/:b/c/:d' : function() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(location.pathname); + } + } +}, function() { + this.navigate('/a/b/c', function() { + + this.navigate('/a/b/c/d', function() { + deepEqual(shared.fired, ['/a/b/c', '/a/b/c/d']); + this.finish(); + }); + }); +}); + +// // // +// // // Recursion features +// // // ---------------------------------------------------------- + +createTest('Nested routes with no recursion', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, function() { + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['c']); + this.finish(); + }); +}); + +createTest('Nested routes with backward recursion', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'backward' +}, function() { + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['c', 'b', 'a']); + this.finish(); + }); +}); + +createTest('Breaking out of nested routes with backward recursion', { + '/a': { + '/:b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + return false; + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'backward' +}, function() { + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['c', 'b']); + this.finish(); + }); +}); + +createTest('Nested routes with forward recursion', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'forward' +}, function() { + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['a', 'b', 'c']); + this.finish(); + }); +}); + +createTest('Nested routes with forward recursion, single route with an after event.', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + }, + after: function() { + shared.fired.push('c-after'); + } + }, + on: function b() { + shared.fired.push('b'); + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'forward' +}, function() { + this.navigate('/a/b/c', function() { + this.navigate('/a/b', function() { + deepEqual(shared.fired, ['a', 'b', 'c', 'c-after', 'a', 'b']); + this.finish(); + }); + }); +}); + +createTest('Breaking out of nested routes with forward recursion', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + return false; + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'forward' +}, function() { + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['a', 'b']); + this.finish(); + }); +}); + +// +// ABOVE IS WORKING +// + +// // +// // Special Events +// // ---------------------------------------------------------- + +createTest('All global event should fire after every route', { + '/a': { + on: function a() { + shared.fired.push('a'); + } + }, + '/b': { + '/c': { + on: function a() { + shared.fired.push('a'); + } + } + }, + '/d': { + '/:e': { + on: function a() { + shared.fired.push('a'); + } + } + } +}, { + after: function() { + shared.fired.push('b'); + } +}, function() { + this.navigate('/a', function() { + this.navigate('/b/c', function() { + this.navigate('/d/e', function() { + deepEqual(shared.fired, ['a', 'b', 'a', 'b', 'a']); + this.finish(); + }); + }); + }); + +}); + +createTest('Not found.', { + '/a': { + on: function a() { + shared.fired.push('a'); + } + }, + '/b': { + on: function a() { + shared.fired.push('b'); + } + } +}, { + notfound: function() { + shared.fired.push('notfound'); + } +}, function() { + this.navigate('/c', function() { + this.navigate('/d', function() { + deepEqual(shared.fired, ['notfound', 'notfound']); + this.finish(); + }); + }); +}); + +createTest('On all.', { + '/a': { + on: function a() { + shared.fired.push('a'); + } + }, + '/b': { + on: function a() { + shared.fired.push('b'); + } + } +}, { + on: function() { + shared.fired.push('c'); + } +}, function() { + this.navigate('/a', function() { + this.navigate('/b', function() { + deepEqual(shared.fired, ['a', 'c', 'b', 'c']); + this.finish(); + }); + }); +}); + + +createTest('After all.', { + '/a': { + on: function a() { + shared.fired.push('a'); + } + }, + '/b': { + on: function a() { + shared.fired.push('b'); + } + } +}, { + after: function() { + shared.fired.push('c'); + } +}, function() { + this.navigate('/a', function() { + this.navigate('/b', function() { + deepEqual(shared.fired, ['a', 'c', 'b']); + this.finish(); + }); + }); +}); + +createTest('resource object.', { + '/a': { + '/b/:c': { + on: 'f1' + }, + on: 'f2' + }, + '/d': { + on: ['f1', 'f2'] + } +}, +{ + resource: { + f1: function (name){ + shared.fired.push("f1-" + name); + }, + f2: function (name){ + shared.fired.push("f2"); + } + } +}, function() { + this.navigate('/a/b/c', function() { + this.navigate('/d', function() { + deepEqual(shared.fired, ['f1-c', 'f1-undefined', 'f2']); + this.finish(); + }); + }); +}); + +createTest('argument matching should be case agnostic', { + '/fooBar/:name': { + on: function(name) { + shared.fired.push("fooBar-" + name); + } + } +}, function() { + this.navigate('/fooBar/tesTing', function() { + deepEqual(shared.fired, ['fooBar-tesTing']); + this.finish(); + }); +}); + +createTest('sanity test', { + '/is/:this/:sane': { + on: function(a, b) { + shared.fired.push('yes ' + a + ' is ' + b); + } + }, + '/': { + on: function() { + shared.fired.push('is there sanity?'); + } + } +}, function() { + this.navigate('/is/there/sanity', function() { + deepEqual(shared.fired, ['yes there is sanity']); + this.finish(); + }); +}); + +createTest('`/` route should be navigable from the routing table', { + '/': { + on: function root() { + shared.fired.push('/'); + } + }, + '/:username': { + on: function afunc(username) { + shared.fired.push('/' + username); + } + } +}, function() { + this.navigate('/', function root() { + deepEqual(shared.fired, ['/']); + this.finish(); + }); +}); + +createTest('`/` route should not override a `/:token` route', { + '/': { + on: function root() { + shared.fired.push('/'); + } + }, + '/:username': { + on: function afunc(username) { + shared.fired.push('/' + username); + } + } +}, function() { + this.navigate('/a', function afunc() { + deepEqual(shared.fired, ['/a']); + this.finish(); + }); +}); + +createTest('should accept the root as a token.', { + '/:a': { + on: function root() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(location.pathname); + } + } + } +}, function() { + this.navigate('/a', function root() { + deepEqual(shared.fired, ['/a']); + this.finish(); + }); +}); + +createTest('routes should allow wildcards.', { + '/:a/b*d': { + on: function() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(location.pathname); + } + } + } +}, function() { + this.navigate('/a/bcd', function root() { + deepEqual(shared.fired, ['/a/bcd']); + this.finish(); + }); +}); + +createTest('functions should have |this| context of the router instance.', { + '/': { + on: function root() { + shared.fired.push(!!this.routes); + } + } +}, function() { + this.navigate('/', function root() { + deepEqual(shared.fired, [true]); + this.finish(); + }); +}); + +createTest('setRoute with a single parameter should change location correctly', { + '/bonk': { + on: function() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(window.location.pathname); + } + } + } +}, function() { + var self = this; + this.router.setRoute('/bonk'); + setTimeout(function() { + deepEqual(shared.fired, ['/bonk']); + self.finish(); + }, 14) +}); + +createTest('route should accept _ and . within parameters', { + '/:a': { + on: function root() { + if (!browser_history_support) { + shared.fired.push(location.hash.replace(/^#/, '')); + } else { + shared.fired.push(location.pathname); + } + } + } +}, function() { + this.navigate('/a_complex_route.co.uk', function root() { + deepEqual(shared.fired, ['/a_complex_route.co.uk']); + this.finish(); + }); +}); diff --git a/architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html b/architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html new file mode 100644 index 0000000000..c97c82667a --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html @@ -0,0 +1,21 @@ + + + + + Director Tests + + + +
+
+ + + + + + + + + diff --git a/architecture-examples/polymer/bower_components/director/test/browser/routes-test.js b/architecture-examples/polymer/bower_components/director/test/browser/routes-test.js new file mode 100644 index 0000000000..1cb8d9528d --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/browser/routes-test.js @@ -0,0 +1,694 @@ + +createTest('Nested route with the many children as a tokens, callbacks should yield historic params', { + '/a': { + '/:id': { + '/:id': function(a, b) { + shared.fired.push(location.hash, a, b); + } + } + } +}, function() { + shared.fired = []; + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['#/a/b/c', 'b', 'c']); + this.finish(); + }); +}); + +createTest('Nested route with the first child as a token, callback should yield a param', { + '/foo': { + '/:id': { + on: function(id) { + shared.fired.push(location.hash, id); + } + } + } +}, function() { + shared.fired = []; + this.navigate('/foo/a', function() { + this.navigate('/foo/b/c', function() { + deepEqual(shared.fired, ['#/foo/a', 'a']); + this.finish(); + }); + }); +}); + +createTest('Nested route with the first child as a regexp, callback should yield a param', { + '/foo': { + '/(\\w+)': { + on: function(value) { + shared.fired.push(location.hash, value); + } + } + } +}, function() { + shared.fired = []; + this.navigate('/foo/a', function() { + this.navigate('/foo/b/c', function() { + deepEqual(shared.fired, ['#/foo/a', 'a']); + this.finish(); + }); + }); +}); + +createTest('Nested route with the several regular expressions, callback should yield a param', { + '/a': { + '/(\\w+)': { + '/(\\w+)': function(a, b) { + shared.fired.push(a, b); + } + } + } +}, function() { + shared.fired = []; + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['b', 'c']); + this.finish(); + }); +}); + + + +createTest('Single nested route with on member containing function value', { + '/a': { + '/b': { + on: function() { + shared.fired.push(location.hash); + } + } + } +}, function() { + shared.fired = []; + this.navigate('/a/b', function() { + deepEqual(shared.fired, ['#/a/b']); + this.finish(); + }); +}); + +createTest('Single non-nested route with on member containing function value', { + '/a/b': { + on: function() { + shared.fired.push(location.hash); + } + } +}, function() { + shared.fired = []; + this.navigate('/a/b', function() { + deepEqual(shared.fired, ['#/a/b']); + this.finish(); + }); +}); + +createTest('Single nested route with on member containing array of function values', { + '/a': { + '/b': { + on: [function() { shared.fired.push(location.hash); }, + function() { shared.fired.push(location.hash); }] + } + } +}, function() { + shared.fired = []; + this.navigate('/a/b', function() { + deepEqual(shared.fired, ['#/a/b', '#/a/b']); + this.finish(); + }); +}); + +createTest('method should only fire once on the route.', { + '/a': { + '/b': { + once: function() { + shared.fired++; + } + } + } +}, function() { + shared.fired = 0; + this.navigate('/a/b', function() { + this.navigate('/a/b', function() { + this.navigate('/a/b', function() { + deepEqual(shared.fired, 1); + this.finish(); + }); + }); + }); +}); + +createTest('method should only fire once on the route, multiple nesting.', { + '/a': { + on: function() { shared.fired++; }, + once: function() { shared.fired++; } + }, + '/b': { + on: function() { shared.fired++; }, + once: function() { shared.fired++; } + } +}, function() { + shared.fired = 0; + this.navigate('/a', function() { + this.navigate('/b', function() { + this.navigate('/a', function() { + this.navigate('/b', function() { + deepEqual(shared.fired, 6); + this.finish(); + }); + }); + }); + }); +}); + +createTest('overlapping routes with tokens.', { + '/a/:b/c' : function() { + shared.fired.push(location.hash); + }, + '/a/:b/c/:d' : function() { + shared.fired.push(location.hash); + } +}, function() { + shared.fired = []; + this.navigate('/a/b/c', function() { + + this.navigate('/a/b/c/d', function() { + deepEqual(shared.fired, ['#/a/b/c', '#/a/b/c/d']); + this.finish(); + }); + }); +}); + +// // // +// // // Recursion features +// // // ---------------------------------------------------------- + +createTest('Nested routes with no recursion', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, function() { + shared.fired = []; + + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['c']); + this.finish(); + }); +}); + +createTest('Nested routes with backward recursion', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'backward' +}, function() { + shared.fired = []; + + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['c', 'b', 'a']); + this.finish(); + }); +}); + +createTest('Breaking out of nested routes with backward recursion', { + '/a': { + '/:b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + return false; + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'backward' +}, function() { + shared.fired = []; + + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['c', 'b']); + this.finish(); + }); +}); + +createTest('Nested routes with forward recursion', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'forward' +}, function() { + shared.fired = []; + + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['a', 'b', 'c']); + this.finish(); + }); +}); + +createTest('Nested routes with forward recursion, single route with an after event.', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + }, + after: function() { + shared.fired.push('c-after'); + } + }, + on: function b() { + shared.fired.push('b'); + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'forward' +}, function() { + shared.fired = []; + + this.navigate('/a/b/c', function() { + this.navigate('/a/b', function() { + deepEqual(shared.fired, ['a', 'b', 'c', 'c-after', 'a', 'b']); + this.finish(); + }); + }); +}); + +createTest('Breaking out of nested routes with forward recursion', { + '/a': { + '/b': { + '/c': { + on: function c() { + shared.fired.push('c'); + } + }, + on: function b() { + shared.fired.push('b'); + return false; + } + }, + on: function a() { + shared.fired.push('a'); + } + } +}, { + recurse: 'forward' +}, function() { + shared.fired = []; + + this.navigate('/a/b/c', function() { + deepEqual(shared.fired, ['a', 'b']); + this.finish(); + }); +}); + +// +// ABOVE IS WORKING +// + +// // +// // Special Events +// // ---------------------------------------------------------- + +createTest('All global event should fire after every route', { + '/a': { + on: function a() { + shared.fired.push('a'); + } + }, + '/b': { + '/c': { + on: function a() { + shared.fired.push('a'); + } + } + }, + '/d': { + '/:e': { + on: function a() { + shared.fired.push('a'); + } + } + } +}, { + after: function() { + shared.fired.push('b'); + } +}, function() { + shared.fired = []; + + this.navigate('/a', function() { + this.navigate('/b/c', function() { + this.navigate('/d/e', function() { + deepEqual(shared.fired, ['a', 'b', 'a', 'b', 'a']); + this.finish(); + }); + }); + }); + +}); + +createTest('Not found.', { + '/a': { + on: function a() { + shared.fired.push('a'); + } + }, + '/b': { + on: function a() { + shared.fired.push('b'); + } + } +}, { + notfound: function() { + shared.fired.push('notfound'); + } +}, function() { + shared.fired = []; + + this.navigate('/c', function() { + this.navigate('/d', function() { + deepEqual(shared.fired, ['notfound', 'notfound']); + this.finish(); + }); + }); +}); + +createTest('On all.', { + '/a': { + on: function a() { + shared.fired.push('a'); + } + }, + '/b': { + on: function a() { + shared.fired.push('b'); + } + } +}, { + on: function() { + shared.fired.push('c'); + } +}, function() { + shared.fired = []; + + this.navigate('/a', function() { + this.navigate('/b', function() { + deepEqual(shared.fired, ['a', 'c', 'b', 'c']); + this.finish(); + }); + }); +}); + + +createTest('After all.', { + '/a': { + on: function a() { + shared.fired.push('a'); + } + }, + '/b': { + on: function a() { + shared.fired.push('b'); + } + } +}, { + after: function() { + shared.fired.push('c'); + } +}, function() { + shared.fired = []; + + this.navigate('/a', function() { + this.navigate('/b', function() { + deepEqual(shared.fired, ['a', 'c', 'b']); + this.finish(); + }); + }); +}); + +createTest('resource object.', { + '/a': { + '/b/:c': { + on: 'f1' + }, + on: 'f2' + }, + '/d': { + on: ['f1', 'f2'] + } +}, +{ + resource: { + f1: function (name){ + shared.fired.push("f1-" + name); + }, + f2: function (name){ + shared.fired.push("f2"); + } + } +}, function() { + shared.fired = []; + + this.navigate('/a/b/c', function() { + this.navigate('/d', function() { + deepEqual(shared.fired, ['f1-c', 'f1-undefined', 'f2']); + this.finish(); + }); + }); +}); + +createTest('argument matching should be case agnostic', { + '/fooBar/:name': { + on: function(name) { + shared.fired.push("fooBar-" + name); + } + } +}, function() { + shared.fired = []; + this.navigate('/fooBar/tesTing', function() { + deepEqual(shared.fired, ['fooBar-tesTing']); + this.finish(); + }); +}); + +createTest('sanity test', { + '/is/:this/:sane': { + on: function(a, b) { + shared.fired.push('yes ' + a + ' is ' + b); + } + }, + '/': { + on: function() { + shared.fired.push('is there sanity?'); + } + } +}, function() { + shared.fired = []; + this.navigate('/is/there/sanity', function() { + deepEqual(shared.fired, ['yes there is sanity']); + this.finish(); + }); +}); + +createTest('`/` route should be navigable from the routing table', { + '/': { + on: function root() { + shared.fired.push('/'); + } + }, + '/:username': { + on: function afunc(username) { + shared.fired.push('/' + username); + } + } +}, function() { + shared.fired = []; + this.navigate('/', function root() { + deepEqual(shared.fired, ['/']); + this.finish(); + }); +}); + +createTest('`/` route should not override a `/:token` route', { + '/': { + on: function root() { + shared.fired.push('/'); + } + }, + '/:username': { + on: function afunc(username) { + shared.fired.push('/' + username); + } + } +}, function() { + shared.fired = []; + this.navigate('/a', function afunc() { + deepEqual(shared.fired, ['/a']); + this.finish(); + }); +}); + +createTest('should accept the root as a token.', { + '/:a': { + on: function root() { + shared.fired.push(location.hash); + } + } +}, function() { + shared.fired = []; + this.navigate('/a', function root() { + deepEqual(shared.fired, ['#/a']); + this.finish(); + }); +}); + +createTest('routes should allow wildcards.', { + '/:a/b*d': { + on: function() { + shared.fired.push(location.hash); + } + } +}, function() { + shared.fired = []; + this.navigate('/a/bcd', function root() { + deepEqual(shared.fired, ['#/a/bcd']); + this.finish(); + }); +}); + +createTest('functions should have |this| context of the router instance.', { + '/': { + on: function root() { + shared.fired.push(!!this.routes); + } + } +}, function() { + shared.fired = []; + this.navigate('/', function root() { + deepEqual(shared.fired, [true]); + this.finish(); + }); +}); + +createTest('setRoute with a single parameter should change location correctly', { + '/bonk': { + on: function() { + shared.fired.push(window.location.hash); + } + } +}, function() { + var self = this; + shared.fired = []; + this.router.setRoute('/bonk'); + setTimeout(function() { + deepEqual(shared.fired, ['#/bonk']); + self.finish(); + }, 14) +}); + +createTest('route should accept _ and . within parameters', { + '/:a': { + on: function root() { + shared.fired.push(location.hash); + } + } +}, function() { + shared.fired = []; + this.navigate('/a_complex_route.co.uk', function root() { + deepEqual(shared.fired, ['#/a_complex_route.co.uk']); + this.finish(); + }); +}); + +createTest('initializing with a default route should only result in one route handling', { + '/': { + on: function root() { + if (!shared.init){ + shared.init = 0; + } + shared.init++; + } + }, + '/test': { + on: function root() { + if (!shared.test){ + shared.test = 0; + } + shared.test++; + } + } + }, function() { + this.navigate('/test', function root() { + equal(shared.init, 1); + equal(shared.test, 1); + this.finish(); + }); + }, + null, + '/'); + +createTest('changing the hash twice should call each route once', { + '/hash1': { + on: function root() { + shared.fired.push('hash1'); + } + }, + '/hash2': { + on: function root() { + shared.fired.push('hash2'); + } + } + }, function() { + shared.fired = []; + this.navigate('/hash1', function(){}); + this.navigate('/hash2', function(){ + deepEqual(shared.fired, ['hash1', 'hash2']); + this.finish(); + }); + } +); diff --git a/architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js b/architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js new file mode 100644 index 0000000000..89a88ce262 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js @@ -0,0 +1,55 @@ +/* + * dispatch-test.js: Tests for the core dispatch method. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +vows.describe('director/cli/dispatch').addBatch({ + "An instance of director.cli.Router": { + topic: function () { + var router = new director.cli.Router(), + that = this; + + that.matched = {}; + that.matched['users'] = []; + that.matched['apps'] = [] + + router.on('users create', function () { + that.matched['users'].push('on users create'); + }); + + router.on(/apps (\w+\s\w+)/, function () { + assert.equal(arguments.length, 1); + that.matched['apps'].push('on apps (\\w+\\s\\w+)'); + }); + + return router; + }, + "should have the correct routing table": function (router) { + assert.isObject(router.routes.users); + assert.isObject(router.routes.users.create); + }, + "the dispatch() method": { + "users create": function (router) { + assert.isTrue(router.dispatch('on', 'users create')); + assert.equal(this.matched.users[0], 'on users create'); + }, + "apps foo bar": function (router) { + assert.isTrue(router.dispatch('on', 'apps foo bar')); + assert.equal(this.matched['apps'][0], 'on apps (\\w+\\s\\w+)'); + }, + "not here": function (router) { + assert.isFalse(router.dispatch('on', 'not here')); + }, + "still not here": function (router) { + assert.isFalse(router.dispatch('on', 'still not here')); + } + } + } +}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js b/architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js new file mode 100644 index 0000000000..366aefd06f --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js @@ -0,0 +1,30 @@ +/* + * mount-test.js: Tests for the core mount method. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +vows.describe('director/cli/path').addBatch({ + "An instance of director.cli.Router with routes": { + topic: new director.cli.Router({ + 'apps': function () { + console.log('apps'); + }, + ' users': function () { + console.log('users'); + } + }), + "should create the correct nested routing table": function (router) { + assert.isObject(router.routes.apps); + assert.isFunction(router.routes.apps.on); + assert.isObject(router.routes.users); + assert.isFunction(router.routes.users.on); + } + } +}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js b/architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js new file mode 100644 index 0000000000..8cce0595c7 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js @@ -0,0 +1,39 @@ +/* + * dispatch-test.js: Tests for the core dispatch method. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +vows.describe('director/cli/path').addBatch({ + "An instance of director.cli.Router": { + topic: new director.cli.Router(), + "the path() method": { + "should create the correct nested routing table": function (router) { + function noop () {} + + router.path(/apps/, function () { + router.path(/foo/, function () { + router.on(/bar/, noop); + }); + + router.on(/list/, noop); + }); + + router.on(/users/, noop); + + assert.isObject(router.routes.apps); + assert.isFunction(router.routes.apps.list.on); + assert.isObject(router.routes.apps.foo); + assert.isFunction(router.routes.apps.foo.bar.on); + assert.isFunction(router.routes.users.on); + } + } + } +}).export(module); + diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js new file mode 100644 index 0000000000..e21fd1a36e --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js @@ -0,0 +1,113 @@ +/* + * dispatch-test.js: Tests for the core dispatch method. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +vows.describe('director/core/dispatch').addBatch({ + "An instance of director.Router": { + topic: function () { + var that = this; + that.matched = {}; + that.matched['/'] = []; + that.matched['foo'] = []; + that.matched['f*'] = [] + + var router = new director.Router({ + '/': { + before: function () { that.matched['/'].push('before /') }, + on: function () { that.matched['/'].push('on /') }, + after: function () { that.matched['/'].push('after /') } + }, + '/foo': { + before: function () { that.matched.foo.push('before foo') }, + on: function () { that.matched.foo.push('on foo') }, + after: function () { that.matched.foo.push('after foo') }, + '/bar': { + before: function () { that.matched.foo.push('before foo bar') }, + on: function () { that.matched.foo.push('foo bar') }, + after: function () { that.matched.foo.push('after foo bar') }, + '/buzz': function () { that.matched.foo.push('foo bar buzz') } + } + }, + '/f*': { + '/barbie': function () { that.matched['f*'].push('f* barbie') } + } + }); + + router.configure({ + recurse: 'backward' + }); + + return router; + }, + "should have the correct routing table": function (router) { + assert.isObject(router.routes.foo); + assert.isObject(router.routes.foo.bar); + assert.isObject(router.routes.foo.bar.buzz); + assert.isFunction(router.routes.foo.bar.buzz.on); + }, + "the dispatch() method": { + "/": function (router) { + assert.isTrue(router.dispatch('on', '/')); + assert.isTrue(router.dispatch('on', '/')); + + assert.equal(this.matched['/'][0], 'before /'); + assert.equal(this.matched['/'][1], 'on /'); + assert.equal(this.matched['/'][2], 'after /'); + }, + "/foo/bar/buzz": function (router) { + assert.isTrue(router.dispatch('on', '/foo/bar/buzz')); + + assert.equal(this.matched.foo[0], 'foo bar buzz'); + assert.equal(this.matched.foo[1], 'before foo bar'); + assert.equal(this.matched.foo[2], 'foo bar'); + assert.equal(this.matched.foo[3], 'before foo'); + assert.equal(this.matched.foo[4], 'on foo'); + }, + "/foo/barbie": function (router) { + assert.isTrue(router.dispatch('on', '/foo/barbie')); + assert.equal(this.matched['f*'][0], 'f* barbie'); + }, + "/foo/barbie/": function (router) { + assert.isFalse(router.dispatch('on', '/foo/barbie/')); + }, + "/foo/BAD": function (router) { + assert.isFalse(router.dispatch('on', '/foo/BAD')); + }, + "/bar/bar": function (router) { + assert.isFalse(router.dispatch('on', '/bar/bar')); + }, + "with the strict option disabled": { + topic: function (router) { + return router.configure({ + recurse: 'backward', + strict: false + }); + }, + "should have the proper configuration set": function (router) { + assert.isFalse(router.strict); + }, + "/foo/barbie/": function (router) { + assert.isTrue(router.dispatch('on', '/foo/barbie/')); + assert.equal(this.matched['f*'][0], 'f* barbie'); + }, + "/foo/bar/buzz": function (router) { + assert.isTrue(router.dispatch('on', '/foo/bar/buzz')); + + assert.equal(this.matched.foo[0], 'foo bar buzz'); + assert.equal(this.matched.foo[1], 'before foo bar'); + assert.equal(this.matched.foo[2], 'foo bar'); + assert.equal(this.matched.foo[3], 'before foo'); + assert.equal(this.matched.foo[4], 'on foo'); + }, + } + } + } +}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js new file mode 100644 index 0000000000..29dcbb3577 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js @@ -0,0 +1,45 @@ +/* + * insert-test.js: Tests for inserting routes into a normalized routing table. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +vows.describe('director/core/insert').addBatch({ + "An instance of director.Router": { + topic: new director.Router(), + "the insert() method": { + "'on', ['foo', 'bar']": function (router) { + function route () { } + + router.insert('on', ['foo', 'bar'], route); + assert.strictEqual(router.routes.foo.bar.on, route); + }, + "'on', ['foo', 'bar'] again": function (router) { + function route () { } + + router.insert('on', ['foo', 'bar'], route); + assert.isArray(router.routes.foo.bar.on); + assert.strictEqual(router.routes.foo.bar.on.length, 2); + }, + "'on', ['foo', 'bar'] a third time": function (router) { + function route () { } + + router.insert('on', ['foo', 'bar'], route); + assert.isArray(router.routes.foo.bar.on); + assert.strictEqual(router.routes.foo.bar.on.length, 3); + }, + "'get', ['fizz', 'buzz']": function (router) { + function route () { } + + router.insert('get', ['fizz', 'buzz'], route); + assert.strictEqual(router.routes.fizz.buzz.get, route); + } + } + } +}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js new file mode 100644 index 0000000000..44fd29cc8a --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js @@ -0,0 +1,117 @@ +/* + * mount-test.js: Tests for mounting and normalizing routes into a Router instance. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +function assertRoute (fn, path, route) { + if (path.length === 1) { + return assert.strictEqual(route[path.shift()], fn); + } + + route = route[path.shift()]; + assert.isObject(route); + assertRoute(fn, path, route); +} + +vows.describe('director/core/mount').addBatch({ + "An instance of director.Router": { + "with no preconfigured params": { + topic: new director.Router(), + "the mount() method": { + "should sanitize the routes correctly": function (router) { + function foobar () { } + function foostar () { } + function foobazzbuzz () { } + function foodog () { } + function root () {} + var fnArray = [foobar, foostar]; + + router.mount({ + '/': { + before: root, + on: root, + after: root, + '/nesting': { + on: foobar, + '/deep': foostar + } + }, + '/foo': { + '/bar': foobar, + '/*': foostar, + '/jitsu/then': { + before: foobar + } + }, + '/foo/bazz': { + '/buzz': foobazzbuzz + }, + '/foo/jitsu': { + '/then': fnArray + }, + '/foo/jitsu/then/now': foostar, + '/foo/:dog': foodog + }); + + assertRoute(root, ['on'], router.routes); + assertRoute(root, ['after'], router.routes); + assertRoute(root, ['before'], router.routes); + assertRoute(foobar, ['nesting', 'on'], router.routes); + assertRoute(foostar, ['nesting', 'deep', 'on'], router.routes); + assertRoute(foobar, [ 'foo', 'bar', 'on'], router.routes); + assertRoute(foostar, ['foo', '([_.()!\\ %@&a-zA-Z0-9-]+)', 'on'], router.routes); + assertRoute(fnArray, ['foo', 'jitsu', 'then', 'on'], router.routes); + assertRoute(foobar, ['foo', 'jitsu', 'then', 'before'], router.routes); + assertRoute(foobazzbuzz, ['foo', 'bazz', 'buzz', 'on'], router.routes); + assertRoute(foostar, ['foo', 'jitsu', 'then', 'now', 'on'], router.routes); + assertRoute(foodog, ['foo', '([._a-zA-Z0-9-]+)', 'on'], router.routes); + }, + + "should accept string path": function(router) { + function dogs () { } + + router.mount({ + '/dogs': { + on: dogs + } + }, + '/api'); + + assertRoute(dogs, ['api', 'dogs', 'on'], router.routes); + } + } + }, + "with preconfigured params": { + topic: function () { + var router = new director.Router(); + router.param('city', '([\\w\\-]+)'); + router.param(':country', /([A-Z][A-Za-z]+)/); + router.param(':zip', /([\d]{5})/); + return router; + }, + "should sanitize the routes correctly": function (router) { + function usaCityZip () { } + function countryCityZip () { } + + router.mount({ + '/usa/:city/:zip': usaCityZip, + '/world': { + '/:country': { + '/:city/:zip': countryCityZip + } + } + }); + + assertRoute(usaCityZip, ['usa', '([\\w\\-]+)', '([\\d]{5})', 'on'], router.routes); + assertRoute(countryCityZip, ['world', '([A-Z][A-Za-z]+)', '([\\w\\-]+)', '([\\d]{5})', 'on'], router.routes); + } + } + } +}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/on-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/on-test.js new file mode 100644 index 0000000000..329ee8dfa2 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/core/on-test.js @@ -0,0 +1,38 @@ +/* + * on-test.js: Tests for the on/route method. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +vows.describe('director/core/insert').addBatch({ + "An instance of director.Router": { + topic: new director.Router(), + "the on() method": { + "['foo', 'bar']": function (router) { + function noop () { } + + router.on(['foo', 'bar'], noop); + assert.strictEqual(router.routes.foo.on, noop); + assert.strictEqual(router.routes.bar.on, noop); + }, + "'baz'": function (router) { + function noop () { } + + router.on('baz', noop); + assert.strictEqual(router.routes.baz.on, noop); + }, + "'after', 'baz'": function (router) { + function noop () { } + + router.on('after', 'boo', noop); + assert.strictEqual(router.routes.boo.after, noop); + } + } + } +}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/path-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/path-test.js new file mode 100644 index 0000000000..e038e3c8ed --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/core/path-test.js @@ -0,0 +1,49 @@ +/* + * path-test.js: Tests for the core `.path()` method. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +vows.describe('director/core/path').addBatch({ + "An instance of director.Router": { + topic: function () { + var that = this; + that.matched = {}; + that.matched['foo'] = []; + that.matched['newyork'] = []; + + var router = new director.Router({ + '/foo': function () { that.matched['foo'].push('foo'); } + }); + return router; + }, + "the path() method": { + "should create the correct nested routing table": function (router) { + var that = this; + router.path('/regions', function () { + this.on('/:state', function(country) { + that.matched['newyork'].push('new york'); + }); + }); + + assert.isFunction(router.routes.foo.on); + assert.isObject(router.routes.regions); + assert.isFunction(router.routes.regions['([._a-zA-Z0-9-]+)'].on); + }, + "should dispatch the function correctly": function (router) { + router.dispatch('on', '/regions/newyork') + router.dispatch('on', '/foo'); + assert.equal(this.matched['foo'].length, 1); + assert.equal(this.matched['newyork'].length, 1); + assert.equal(this.matched['foo'][0], 'foo'); + assert.equal(this.matched['newyork'][0], 'new york'); + } + } + } +}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js new file mode 100644 index 0000000000..24cb38facb --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js @@ -0,0 +1,103 @@ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +var callback = function() { + return true; +}; + +var testRoute = function(route, callback) { + var router = new director.Router(); + router.on(route, callback); + + return function(value) { + return router.dispatch('on', value); + }; +}; + +vows.describe('director/core/regifyString').addBatch({ + + 'When using "/home(.*)"': { + topic: function() { + return testRoute('/home(.*)', callback); + }, + + 'Should match "/homepage"': function(result) { + assert.isTrue(result('/homepage')); + }, + + 'Should match "/home/page"': function(result) { + assert.isTrue(result('/home/page')); + }, + + 'Should not match "/foo-bar"': function(result) { + assert.isFalse(result('/foo-bar')); + } + }, + + 'When using "/home.*"': { + topic: function() { + return testRoute('/home.*', callback); + }, + + 'Should match "/homepage"': function(result) { + assert.isTrue(result('/homepage')); + }, + + 'Should match "/home/page"': function(result) { + assert.isTrue(result('/home/page')); + }, + + 'Should not match "/foo-bar"': function(result) { + assert.isFalse(result('/foo-bar')); + } + }, + + 'When using "/home(page[0-9])*"': { + topic: function() { + return testRoute('/home(page[0-9])*', callback); + }, + + 'Should match "/home"': function(result) { + assert.isTrue(result('/home')); + }, + + 'Should match "/homepage0", "/homepage1", etc.': function(result) { + for (i = 0; i < 10; i++) { + assert.isTrue(result('/homepage' + i)); + } + }, + + 'Should not match "/home_page"': function(result) { + assert.isFalse(result('/home_page')); + }, + + 'Should not match "/home/page"': function(result) { + assert.isFalse(result('/home/page')); + } + }, + + 'When using "/home*"': { + topic: function() { + return testRoute('/home*', callback); + }, + + 'Should match "/homepage"': function(result) { + assert.isTrue(result('/homepage')); + }, + + 'Should match "/home_page"': function(result) { + assert.isTrue(result('/home_page')); + }, + + 'Should match "/home-page"': function(result) { + assert.isTrue(result('/home-page')); + }, + + 'Should not match "/home/page"': function(result) { + assert.isFalse(result('/home/page')); + } + } + +}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/helpers/index.js b/architecture-examples/polymer/bower_components/director/test/server/helpers/index.js new file mode 100644 index 0000000000..25630a1e32 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/helpers/index.js @@ -0,0 +1,52 @@ +/* + * index.js: Test helpers for director. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var http = require('http'); + +exports.createServer = function (router) { + return http.createServer(function (req, res) { + router.dispatch(req, res, function (err) { + if (err) { + res.writeHead(404); + res.end(); + } + }); + }); +}; + +exports.handlers = { + respondWithId: function (id) { + this.res.writeHead(200, { 'Content-Type': 'text/plain' }) + this.res.end('hello from (' + id + ')'); + }, + respondWithData: function () { + this.res.writeHead(200, { 'Content-Type': 'application/json' }) + this.res.end(JSON.stringify(this.data)); + }, + respondWithOk: function () { + return function () { + this.res.writeHead(200); + this.res.end('ok'); + }; + }, + streamBody: function () { + var body = '', + res = this.res; + + this.req.on('data', function (chunk) { + body += chunk; + }); + + this.req.on('end', function () { + res.writeHead(200, { 'Content-Type': 'application/json' }); + res.end(body); + }); + } +}; + +exports.macros = require('./macros'); diff --git a/architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js b/architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js new file mode 100644 index 0000000000..3dc18f2e31 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js @@ -0,0 +1,55 @@ +/* + * macros.js: Test macros for director tests. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + request = require('request'); + +exports.assertGet = function(port, uri, expected) { + var context = { + topic: function () { + request({ uri: 'http://localhost:' + port + '/' + uri }, this.callback); + } + }; + + context['should respond with `' + expected + '`'] = function (err, res, body) { + assert.isNull(err); + assert.equal(res.statusCode, 200); + assert.equal(body, expected); + }; + + return context; +}; + +exports.assert404 = function (port, uri) { + return { + topic: function () { + request({ uri: 'http://localhost:' + port + '/' + uri }, this.callback); + }, + "should respond with 404": function (err, res, body) { + assert.isNull(err); + assert.equal(res.statusCode, 404); + } + }; +}; + +exports.assertPost = function(port, uri, expected) { + return { + topic: function () { + request({ + method: 'POST', + uri: 'http://localhost:' + port + '/' + uri, + body: JSON.stringify(expected) + }, this.callback); + }, + "should respond with the POST body": function (err, res, body) { + assert.isNull(err); + assert.equal(res.statusCode, 200); + assert.deepEqual(JSON.parse(body), expected); + } + }; +}; diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js new file mode 100644 index 0000000000..564301fe0c --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js @@ -0,0 +1,88 @@ +/* + * accept-test.js: Tests for `content-type`-based routing + * + * (C) 2012, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + apiEasy = require('api-easy'), + director = require('../../../lib/director'), + helpers = require('../helpers'), + macros = helpers.macros, + handlers = helpers.handlers; + +var PORT = 9067; + +apiEasy.describe('director/http/accept') + .addBatch({ + "An instance of `director.http.Router`": { + "with routes set up": { + topic: function () { + var router = new director.http.Router(); + router.get('/json', { accept: 'application/json' }, handlers.respondWithOk()); + router.get('/txt', { accept: 'text/plain' }, handlers.respondWithOk()); + router.get('/both', { accept: ['text/plain', 'application/json'] }, handlers.respondWithOk()); + router.get('/regex', { accept: /.+\/x\-.+/ }, handlers.respondWithOk()); + + router.get('/weird', { accept: 'application/json' }, function () { + this.res.writeHead(400); + this.res.end(); + }); + + router.get('/weird', handlers.respondWithOk()); + + helpers.createServer(router).listen(PORT, this.callback); + }, + "should be created": function (err) { + assert(!err); + } + } + } + }) + .use('localhost', PORT) + .discuss('with `content-type: application/json`') + .setHeader('content-type', 'application/json') + .get('/json') + .expect(200) + .get('/txt') + .expect(404) + .get('/both') + .expect(200) + .get('/regex') + .expect(404) + .get('/weird') + .expect(400) + .undiscuss() + .next() + .discuss('with `content-type: text/plain`') + .setHeader('content-type', 'text/plain') + .get('/json') + .expect(404) + .get('/txt') + .expect(200) + .get('/both') + .expect(200) + .get('/regex') + .expect(404) + .get('/weird') + .expect(200) + .undiscuss() + .next() + .discuss('with `content-type: application/x-tar-gz`') + .setHeader('content-type', 'application/x-tar-gz`') + .get('/json') + .get('/json') + .expect(404) + .get('/txt') + .expect(404) + .get('/both') + .expect(404) + .get('/regex') + .expect(200) + .get('/weird') + .expect(200) + .undiscuss() + .export(module); + diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js new file mode 100644 index 0000000000..1859b30648 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js @@ -0,0 +1,51 @@ +/* + * attach-test.js: Tests 'router.attach' functionality. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + http = require('http'), + vows = require('vows'), + request = require('request'), + director = require('../../../lib/director'), + helpers = require('../helpers'), + handlers = helpers.handlers, + macros = helpers.macros; + +function assertData(uri) { + return macros.assertGet( + 9091, + uri, + JSON.stringify([1,2,3]) + ); +} + +vows.describe('director/http/attach').addBatch({ + "An instance of director.http.Router": { + "instantiated with a Routing table": { + topic: new director.http.Router({ + '/hello': { + get: handlers.respondWithData + } + }), + "should have the correct routes defined": function (router) { + assert.isObject(router.routes.hello); + assert.isFunction(router.routes.hello.get); + }, + "when passed to an http.Server instance": { + topic: function (router) { + router.attach(function () { + this.data = [1,2,3]; + }); + + helpers.createServer(router) + .listen(9091, this.callback); + }, + "a request to hello": assertData('hello'), + } + } + } +}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/before-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/before-test.js new file mode 100644 index 0000000000..824edc00fe --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/http/before-test.js @@ -0,0 +1,38 @@ +/* + * before-test.js: Tests for running before methods on HTTP server(s). + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + http = require('http'), + vows = require('vows'), + request = require('request'), + director = require('../../../lib/director'), + helpers = require('../helpers'), + handlers = helpers.handlers, + macros = helpers.macros; + +vows.describe('director/http/before').addBatch({ + "An instance of director.http.Router": { + "with ad-hoc routes including .before()": { + topic: function () { + var router = new director.http.Router(); + + router.before('/hello', function () { }); + router.after('/hello', function () { }); + router.get('/hello', handlers.respondWithId); + + return router; + }, + "should have the correct routes defined": function (router) { + assert.isObject(router.routes.hello); + assert.isFunction(router.routes.hello.before); + assert.isFunction(router.routes.hello.after); + assert.isFunction(router.routes.hello.get); + } + } + } +}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/http-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/http-test.js new file mode 100644 index 0000000000..e318fbd7e2 --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/http/http-test.js @@ -0,0 +1,65 @@ +/* + * http-test.js: Tests for basic HTTP server(s). + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + http = require('http'), + vows = require('vows'), + request = require('request'), + director = require('../../../lib/director'), + helpers = require('../helpers'), + handlers = helpers.handlers, + macros = helpers.macros; + +function assertBark(uri) { + return macros.assertGet( + 9090, + uri, + 'hello from (bark)' + ); +} + +vows.describe('director/http').addBatch({ + "An instance of director.http.Router": { + "instantiated with a Routing table": { + topic: new director.http.Router({ + '/hello': { + get: handlers.respondWithId + } + }), + "should have the correct routes defined": function (router) { + assert.isObject(router.routes.hello); + assert.isFunction(router.routes.hello.get); + }, + "when passed to an http.Server instance": { + topic: function (router) { + router.get(/foo\/bar\/(\w+)/, handlers.respondWithId); + router.get(/foo\/update\/(\w+)/, handlers.respondWithId); + router.path(/bar\/bazz\//, function () { + this.get(/(\w+)/, handlers.respondWithId); + }); + router.get(/\/foo\/wild\/(.*)/, handlers.respondWithId); + router.get(/(\/v2)?\/somepath/, handlers.respondWithId); + + helpers.createServer(router) + .listen(9090, this.callback); + }, + "a request to foo/bar/bark": assertBark('foo/bar/bark'), + "a request to foo/update/bark": assertBark('foo/update/bark'), + "a request to bar/bazz/bark": assertBark('bar/bazz/bark'), + "a request to foo/bar/bark?test=test": assertBark('foo/bar/bark?test=test'), + "a request to foo/wild/bark": assertBark('foo/wild/bark'), + "a request to foo/%RT": macros.assert404(9090, 'foo/%RT'), + "a request to /v2/somepath": macros.assertGet( + 9090, + '/v2/somepath', + 'hello from (/v2)' + ) + } + } + } +}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js new file mode 100644 index 0000000000..28758a0b9d --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js @@ -0,0 +1,42 @@ +/* + * methods-test.js: Tests for HTTP methods. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +vows.describe('director/http/methods').addBatch({ + "When using director": { + "an instance of director.http.Router should have all relevant RFC methods": function () { + var router = new director.http.Router(); + director.http.methods.forEach(function (method) { + assert.isFunction(router[method.toLowerCase()]); + }); + }, + "the path() method": { + topic: new director.http.Router(), + "/resource": { + "should insert nested routes correct": function (router) { + function getResource() {} + function modifyResource() {} + + router.path(/\/resource/, function () { + this.get(getResource); + + this.put(/\/update/, modifyResource); + this.post(/create/, modifyResource); + }); + + assert.equal(router.routes.resource.get, getResource); + assert.equal(router.routes.resource.update.put, modifyResource); + assert.equal(router.routes.resource.create.post, modifyResource); + } + } + } + } +}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js new file mode 100644 index 0000000000..589ce595ce --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js @@ -0,0 +1,21 @@ +/* + * responses-test.js: Tests for HTTP responses. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + vows = require('vows'), + director = require('../../../lib/director'); + +vows.describe('director/http/responses').addBatch({ + "When using director.http": { + "it should have the relevant responses defined": function () { + Object.keys(require('../../../lib/director/http/responses')).forEach(function (name) { + assert.isFunction(director.http[name]); + }); + } + } +}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js new file mode 100644 index 0000000000..29835391ae --- /dev/null +++ b/architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js @@ -0,0 +1,46 @@ +/* + * stream-test.js: Tests for streaming HTTP in director. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var assert = require('assert'), + http = require('http'), + vows = require('vows'), + request = require('request'), + director = require('../../../lib/director'), + helpers = require('../helpers'), + macros = helpers.macros, + handlers = helpers.handlers + +vows.describe('director/http/stream').addBatch({ + "An instance of director.http.Router": { + "with streaming routes": { + topic: function () { + var router = new director.http.Router(); + router.post(/foo\/bar/, { stream: true }, handlers.streamBody); + router.path('/a-path', function () { + this.post({ stream: true }, handlers.streamBody); + }); + + return router; + }, + "when passed to an http.Server instance": { + topic: function (router) { + helpers.createServer(router) + .listen(9092, this.callback); + }, + "a POST request to /foo/bar": macros.assertPost(9092, 'foo/bar', { + foo: 'foo', + bar: 'bar' + }), + "a POST request to /a-path": macros.assertPost(9092, 'a-path', { + foo: 'foo', + bar: 'bar' + }) + } + } + } +}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/.bower.json b/architecture-examples/polymer/bower_components/polymer/.bower.json new file mode 100644 index 0000000000..74d0474034 --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/.bower.json @@ -0,0 +1,23 @@ +{ + "name": "polymer", + "description": "Leverage the future of the web platform today.", + "homepage": "http://www.polymer-project.org/", + "keywords": [ + "util", + "client", + "browser" + ], + "author": "Polymer Authors ", + "version": "0.0.20130801", + "main": [ + "polymer.min.js" + ], + "_release": "0.0.20130801", + "_resolution": { + "type": "version", + "tag": "0.0.20130801", + "commit": "79ca6036d943d77335c273a742f9ce649a8bedac" + }, + "_source": "git://github.com/components/polymer.git", + "_target": "*" +} \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/LICENSE b/architecture-examples/polymer/bower_components/polymer/LICENSE new file mode 100644 index 0000000000..92d60b019f --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/LICENSE @@ -0,0 +1,27 @@ +// 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. diff --git a/architecture-examples/polymer/bower_components/polymer/README.md b/architecture-examples/polymer/bower_components/polymer/README.md new file mode 100644 index 0000000000..d608dbdf32 --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/README.md @@ -0,0 +1,7 @@ +Polymer is a new type of library for the web, built on top of Web Components, and designed to leverage the evolving web platform on modern browsers. + +For Docs, License, Tests, and pre-packed downloads, see: +http://www.polymer-project.org/ + +Many thanks to our contributors: +https://github.com/Polymer/platform/contributors diff --git a/architecture-examples/polymer/bower_components/polymer/bower.json b/architecture-examples/polymer/bower_components/polymer/bower.json new file mode 100644 index 0000000000..ec43433231 --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/bower.json @@ -0,0 +1,15 @@ +{ + "name": "polymer", + "description": "Leverage the future of the web platform today.", + "homepage": "http://www.polymer-project.org/", + "keywords": [ + "util", + "client", + "browser" + ], + "author": "Polymer Authors ", + "version": "0.0.20130801", + "main": [ + "polymer.min.js" + ] +} diff --git a/architecture-examples/polymer/bower_components/polymer/build.log b/architecture-examples/polymer/bower_components/polymer/build.log new file mode 100644 index 0000000000..00d605dc2f --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/build.log @@ -0,0 +1,42 @@ +BUILD LOG +--------- +Build Time: 2013-08-01T14:19:08 + +NODEJS INFORMATION +================== +nodejs: v0.10.4 +chai: 1.7.2 +grunt: 0.4.1 +grunt-audit: 0.0.1 +grunt-contrib-uglify: 0.2.2 +grunt-contrib-yuidoc: 0.4.0 +grunt-karma: 0.5.0 +karma: 0.9.7 +karma-chrome-launcher: 0.0.2 +karma-coffee-preprocessor: 0.0.3 +karma-crbot-reporter: 0.0.3 +karma-firefox-launcher: 0.0.3 +karma-html2js-preprocessor: 0.0.2 +karma-jasmine: 0.0.3 +karma-mocha: 0.0.4 +karma-phantomjs-launcher: 0.0.2 +karma-requirejs: 0.0.3 +karma-script-launcher: 0.0.2 +mocha: 1.12.0 + +REPO REVISIONS +============== +polymer: 9c8068f25dbe1cc218079dec1480a716b2f5e816 +platform: 92b34ea333ec8cae2c7fcd395602d949117dc4e1 +ShadowDOM: fd48678e24442ae1b64d9ea7af3977e86c33b0bb +HTMLImports: 26739666016e855f9f5a569203015b081f9f7755 +CustomElements: a800e8ea471d99e38f5f99818566a0cb3cd17daf +PointerEvents: ffafaa3fce93c927f604999f58d61f4e2209e20c +PointerGestures: 84b7b698953dec5d6cfd12f78f220c18fd255eaf +mdv: c126ab89c5b39b8a088d0afac126310d5e8b3e20 + +BUILD HASHES +============ +polymer.min.js: 61432cfb0ca707a10a6708285801dcb321a8f6b9 +polymer.native.min.js: fa292dace6678f6b6f634de512c3e788318300d7 +polymer.sandbox.min.js: 4b62561d01ecb23c9a2325b7b882227fa3f9ff6d \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/component.json b/architecture-examples/polymer/bower_components/polymer/component.json new file mode 100644 index 0000000000..fe25c22aee --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/component.json @@ -0,0 +1,17 @@ +{ + "name": "platform", + "repo": "components/platform", + "description": "Leverage the future of the web platform today.", + "homepage": "http://www.polymer-project.org/", + "keywords": [ + "util", + "client", + "browser" + ], + "author": "Polymer Authors ", + "version": "0.0.20130801", + "main": "polymer.min.js", + "scripts": [ + "polymer.min.js" + ] +} diff --git a/architecture-examples/polymer/bower_components/polymer/composer.json b/architecture-examples/polymer/bower_components/polymer/composer.json new file mode 100644 index 0000000000..d1d73948d3 --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/composer.json @@ -0,0 +1,36 @@ +{ + "name": "components/platform", + "description": "Leverage the future of the web platform today.", + "keywords": ["util", "client", "browser"], + "type": "component", + "homepage": "http://www.polymer-project.org/", + "support": { + "issues": "https://github.com/Polymer/platform/issues", + "source": "https://github.com/Polymer/platform" + }, + "authors": [ + { + "name": "Polymer Authors", + "email": "polymer-dev@googlegroups.com" + } + ], + "extra": { + "component": { + "name": "polymer", + "scripts": [ + "polymer.min.js" + ], + "files": [ + "src/**", + "platform/**", + "polymer.min.js", + "polymer.min.js.map", + "polymer.native.min.js", + "polymer.native.min.js.map" + ], + "shim": { + "exports": "Platform" + } + } + } +} diff --git a/architecture-examples/polymer/bower_components/polymer/package.json b/architecture-examples/polymer/bower_components/polymer/package.json new file mode 100644 index 0000000000..5a9ee5c25d --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/package.json @@ -0,0 +1,29 @@ +{ + "name": "components-polymer", + "description": "Leverage the future of the web platform today.", + "homepage": "http://www.polymer-project.org/", + "keywords": [ + "util", + "client", + "browser" + ], + "author": "Polymer Authors ", + "repository": { + "type": "git", + "url": "git://github.com/Polymer/platform.git" + }, + "main": "polymer.min.js", + "version": "0.0.1", + "devDependencies": { + "mocha": "*", + "chai": "*", + "grunt": "*", + "grunt-contrib-concat": "*", + "grunt-contrib-uglify": "*", + "grunt-contrib-yuidoc": "~0.4.0", + "grunt-karma-0.9.1": "~0.4.3", + "karma-mocha": "*", + "karma-script-launcher": "*", + "karma-crbot-reporter": "*" + } +} diff --git a/architecture-examples/polymer/bower_components/polymer/polymer.js b/architecture-examples/polymer/bower_components/polymer/polymer.js deleted file mode 100644 index 38274ea163..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/polymer.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ - -(function() { - -var thisFile = 'polymer.js'; -var scopeName = 'Polymer'; -var modules = [ - 'src/platform.min.js', - 'src/lang.js', - 'src/oop.js', - 'src/register.js', - 'src/base.js', - 'src/trackObservers.js', - 'src/bindProperties.js', - 'src/bindMDV.js', - 'src/attrs.js', - 'src/marshal.js', - 'src/events.js', - 'src/observeProperties.js', - 'src/styling.js', - 'src/shimStyling.js', - 'src/path.js', - 'src/job.js', - 'src/boot.js' -]; - -// export - -window[scopeName] = { - entryPointName: thisFile, - modules: modules -}; - -// bootstrap - -var script = document.querySelector('script[src*="' + thisFile + '"]'); -var src = script.attributes.src.value; -var basePath = src.slice(0, src.indexOf(thisFile)); - -console.log(src); - -modules.forEach(function(m) { - document.write(''); -}); - -})(); diff --git a/architecture-examples/polymer/bower_components/polymer/polymer.min.js b/architecture-examples/polymer/bower_components/polymer/polymer.min.js new file mode 100644 index 0000000000..19d0fad6d5 --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/polymer.min.js @@ -0,0 +1,35 @@ +// 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. +function PointerGestureEvent(a,b){var c=b||{},d=document.createEvent("Event"),e={bubbles:!0,cancelable:!0};return Object.keys(e).forEach(function(a){a in c&&(e[a]=c[a])}),d.initEvent(a,e.bubbles,e.cancelable),Object.keys(c).forEach(function(a){d[a]=b[a]}),d.preventTap=this.preventTap,d}if(window.Platform=window.Platform||{},window.logFlags=window.logFlags||{},function(a){var b=a.flags||{};location.search.slice(1).split("&").forEach(function(a){a=a.split("="),a[0]&&(b[a[0]]=a[1]||!0)}),b.shadow=(b.shadowdom||b.shadow||b.polyfill||!HTMLElement.prototype.webkitCreateShadowRoot)&&"polyfill",a.flags=b}(Platform),"polyfill"===Platform.flags.shadow){var SideTable;"undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var ShadowDOMPolyfill={};!function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function d(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){switch(c){case"arguments":case"caller":case"length":case"name":case"prototype":case"toString":return}Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function e(a){var b=a.__proto__||Object.getPrototypeOf(a),c=z.get(b);if(c)return c;var d=e(b),f=n(d);return k(b,f,a),f}function f(a,b){i(a,b,!0)}function g(a,b){i(b,a,!1)}function h(a){return/^on[a-z]+$/.test(a)}function i(b,c,d){Object.getOwnPropertyNames(b).forEach(function(e){if(!(e in c)){B&&b.__lookupGetter__(e);var f;try{f=Object.getOwnPropertyDescriptor(b,e)}catch(g){f=C}var i,j;if(d&&"function"==typeof f.value)return c[e]=function(){return this.impl[e].apply(this.impl,arguments)},void 0;var k=h(e);i=k?a.getEventHandlerGetter(e):function(){return this.impl[e]},(f.writable||f.set)&&(j=k?a.getEventHandlerSetter(e):function(a){this.impl[e]=a}),Object.defineProperty(c,e,{get:i,set:j,configurable:f.configurable,enumerable:f.enumerable})}})}function j(a,b,c){var e=a.prototype;k(e,b,c),d(b,a)}function k(a,c,d){var e=c.prototype;b(void 0===z.get(a)),z.set(a,c),f(a,e),d&&g(e,d)}function l(a,b){return z.get(b.prototype)===a}function m(a){var b=Object.getPrototypeOf(a),c=e(b),d=n(c);return k(b,d,a),d}function n(a){function b(b){a.call(this,b)}return b.prototype=Object.create(a.prototype),b.prototype.constructor=b,b}function o(a){return a instanceof A.EventTarget||a instanceof A.Event||a instanceof A.DOMImplementation}function p(a){return a instanceof F||a instanceof E||a instanceof G||a instanceof D}function q(a){if(null===a)return null;b(p(a));var c=y.get(a);if(!c){var d=e(a);c=new d(a),y.set(a,c)}return c}function r(a){return null===a?null:(b(o(a)),a.impl)}function s(a){return a&&o(a)?r(a):a}function t(a){return a&&!o(a)?q(a):a}function u(a,c){null!==c&&(b(p(a)),b(void 0===c||o(c)),y.set(a,c))}function v(a,b,c){Object.defineProperty(a.prototype,b,{get:c,configurable:!0,enumerable:!0})}function w(a,b){v(a,b,function(){return q(this.impl[b])})}function x(a,b){a.forEach(function(a){b.forEach(function(b){a.prototype[b]=function(){var a=q(this);return a[b].apply(a,arguments)}})})}var y=new SideTable,z=new SideTable,A=Object.create(null);Object.getOwnPropertyNames(window);var B=/Firefox/.test(navigator.userAgent),C={get:function(){},set:function(){},configurable:!0,enumerable:!0},D=DOMImplementation,E=Event,F=Node,G=Window;a.assert=b,a.defineGetter=v,a.defineWrapGetter=w,a.forwardMethodsToWrapper=x,a.isWrapperFor=l,a.mixin=c,a.registerObject=m,a.registerWrapper=j,a.rewrap=u,a.unwrap=r,a.unwrapIfNeeded=s,a.wrap=q,a.wrapIfNeeded=t,a.wrappers=A}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){return a instanceof N.ShadowRoot}function c(a){var b=a.localName;return"content"===b||"shadow"===b}function d(a){return!!a.shadowRoot}function e(a){var b;return a.parentNode||(b=a.defaultView)&&M(b)||null}function f(f,g,h){if(h.length)return h.shift();if(b(f))return j(f)||a.getHostForShadowRoot(f);var i=a.eventParentsTable.get(f);if(i){for(var k=1;k=0;b--)if(!c(a[b]))return a[b];return null}function i(d,e){for(var g=[];d;){for(var i=[],j=e,l=void 0;j;){var n=null;if(i.length){if(c(j)&&(n=h(i),k(l))){var o=i[i.length-1];i.push(o)}}else i.push(j);if(m(j,d))return i[i.length-1];b(j)&&i.pop(),l=j,j=f(j,n,g)}d=b(d)?a.getHostForShadowRoot(d):d.parentNode}}function j(b){return a.insertionParentTable.get(b)}function k(a){return j(a)}function l(a){for(var b;b=a.parentNode;)a=b;return a}function m(a,b){return l(a)===l(b)}function n(b,c){if(b===c)return!0;if(b instanceof N.ShadowRoot){var d=a.getHostForShadowRoot(b);return d?n(l(d),c):!1}return!1}function o(a){switch(a){case"DOMAttrModified":case"DOMAttributeNameChanged":case"DOMCharacterDataModified":case"DOMElementNameChanged":case"DOMNodeInserted":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":return!0}return!1}function p(b){if(!P.get(b)){P.set(b,!0),o(b.type)||a.renderAllPending();var c=M(b.target),d=M(b);return q(d,c)}}function q(a,b){var c=g(b);return"load"===a.type&&2===c.length&&c[0].target instanceof N.Document&&c.shift(),X.set(a,c),r(a,c)&&s(a,c)&&t(a,c),T.set(a,w.NONE),R.set(a,null),a.defaultPrevented}function r(a,b){for(var c,d=b.length-1;d>0;d--){var e=b[d].target,f=b[d].currentTarget;if(e!==f&&(c=w.CAPTURING_PHASE,!u(b[d],a,c)))return!1}return!0}function s(a,b){var c=w.AT_TARGET;return u(b[0],a,c)}function t(a,b){for(var c,d=a.bubbles,e=1;e=f;f++){var g=b[f].currentTarget,h=l(g);n(e,h)&&(f!==d||g instanceof N.Node)&&(a[c++]=g)}a.length=c}return a},stopPropagation:function(){U.set(this,!0)},stopImmediatePropagation:function(){U.set(this,!0),V.set(this,!0)}},K(Y,w,document.createEvent("Event"));var Z=y("UIEvent",w),$=y("CustomEvent",w),_={get relatedTarget(){return S.get(this)||M(L(this).relatedTarget)}},ab=J({initMouseEvent:z("initMouseEvent",14)},_),bb=J({initFocusEvent:z("initFocusEvent",5)},_),cb=y("MouseEvent",Z,ab),db=y("FocusEvent",Z,bb),eb=y("MutationEvent",w,{initMutationEvent:z("initMutationEvent",3),get relatedNode(){return M(this.impl.relatedNode)}}),fb=Object.create(null),gb=function(){try{new window.MouseEvent("click")}catch(a){return!1}return!0}();if(!gb){var hb=function(a,b,c){if(c){var d=fb[c];b=J(J({},d),b)}fb[a]=b};hb("Event",{bubbles:!1,cancelable:!1}),hb("CustomEvent",{detail:null},"Event"),hb("UIEvent",{view:null,detail:0},"Event"),hb("MouseEvent",{screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},"UIEvent"),hb("FocusEvent",{relatedTarget:null},"UIEvent")}var ib=window.EventTarget,jb=["addEventListener","removeEventListener","dispatchEvent"];[Node,Window].forEach(function(a){var b=a.prototype;jb.forEach(function(a){Object.defineProperty(b,a+"_",{value:b[a]})})}),C.prototype={addEventListener:function(a,b,c){if(B(b)){var d=new v(a,b,c),e=O.get(this);if(e){for(var f=0;fd;d++)b[d]=f(a[d]);return b.length=e,b}function e(a,b){a.prototype[b]=function(){return d(this.impl[b].apply(this.impl,arguments))}}var f=a.wrap;c.prototype={item:function(a){return this[a]}},b(c.prototype,"item"),a.wrappers.NodeList=c,a.addWrapNodeListMethod=e,a.wrapNodeList=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){j(a instanceof f)}function c(a,b,c,d){if(a.nodeType!==f.DOCUMENT_FRAGMENT_NODE)return a.parentNode&&a.parentNode.removeChild(a),a.parentNode_=b,a.previousSibling_=c,a.nextSibling_=d,c&&(c.nextSibling_=a),d&&(d.previousSibling_=a),[a];for(var e,g=[];e=a.firstChild;)a.removeChild(e),g.push(e),e.parentNode_=b;for(var h=0;he;e++)d.appendChild(m(b[e]));return d}function e(a){for(var b=a.firstChild;b;){j(b.parentNode===a);var c=b.nextSibling,d=m(b),e=d.parentNode;e&&s.call(e,d),b.previousSibling_=b.nextSibling_=b.parentNode_=null,b=c}a.firstChild_=a.lastChild_=null}function f(a){j(a instanceof o),g.call(this,a),this.parentNode_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_=void 0}var g=a.wrappers.EventTarget,h=a.wrappers.NodeList,i=a.defineWrapGetter,j=a.assert,k=a.mixin,l=a.registerWrapper,m=a.unwrap,n=a.wrap,o=window.Node,p=o.prototype.appendChild,q=o.prototype.insertBefore,r=o.prototype.replaceChild,s=o.prototype.removeChild,t=o.prototype.compareDocumentPosition;f.prototype=Object.create(g.prototype),k(f.prototype,{appendChild:function(a){b(a),this.invalidateShadowRenderer();var e=this.lastChild,f=null,g=c(a,this,e,f);return this.lastChild_=g[g.length-1],e||(this.firstChild_=g[0]),p.call(this.impl,d(this,g)),a},insertBefore:function(a,e){if(!e)return this.appendChild(a);b(a),b(e),j(e.parentNode===this),this.invalidateShadowRenderer();var f=e.previousSibling,g=e,h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]);var i=m(e),k=i.parentNode;return k&&q.call(k,d(this,h),i),a},removeChild:function(a){if(b(a),a.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var c=this.firstChild,d=this.lastChild,e=a.nextSibling,f=a.previousSibling,g=m(a),h=g.parentNode;return h&&s.call(h,g),c===a&&(this.firstChild_=e),d===a&&(this.lastChild_=f),f&&(f.nextSibling_=e),e&&(e.previousSibling_=f),a.previousSibling_=a.nextSibling_=a.parentNode_=null,a},replaceChild:function(a,e){if(b(a),b(e),e.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var f=e.previousSibling,g=e.nextSibling;g===a&&(g=a.nextSibling);var h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]),this.lastChild===e&&(this.lastChild_=h[h.length-1]),e.previousSibling_=null,e.nextSibling_=null,e.parentNode_=null;var i=m(e);return i.parentNode&&r.call(i.parentNode,d(this,h),i),e},hasChildNodes:function(){return null===this.firstChild},get parentNode(){return void 0!==this.parentNode_?this.parentNode_:n(this.impl.parentNode)},get firstChild(){return void 0!==this.firstChild_?this.firstChild_:n(this.impl.firstChild)},get lastChild(){return void 0!==this.lastChild_?this.lastChild_:n(this.impl.lastChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_:n(this.impl.nextSibling)},get previousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:n(this.impl.previousSibling)},get parentElement(){for(var a=this.parentNode;a&&a.nodeType!==f.ELEMENT_NODE;)a=a.parentNode;return a},get textContent(){for(var a="",b=this.firstChild;b;b=b.nextSibling)a+=b.textContent;return a},set textContent(a){if(e(this),this.invalidateShadowRenderer(),""!==a){var b=this.impl.ownerDocument.createTextNode(a);this.appendChild(b)}},get childNodes(){for(var a=new h,b=0,c=this.firstChild;c;c=c.nextSibling)a[b++]=c;return a.length=b,a},cloneNode:function(a){if(!this.invalidateShadowRenderer())return n(this.impl.cloneNode(a));var b=n(this.impl.cloneNode(!1));if(a)for(var c=this.firstChild;c;c=c.nextSibling)b.appendChild(c.cloneNode(!0));return b},contains:function(a){if(!a)return!1;if(a===this)return!0;var b=a.parentNode;return b?this.contains(b):!1},compareDocumentPosition:function(a){return t.call(this.impl,m(a))}}),i(f,"ownerDocument"),l(o,f,document.createDocumentFragment()),delete f.prototype.querySelector,delete f.prototype.querySelectorAll,f.prototype=k(Object.create(g.prototype),f.prototype),a.wrappers.Node=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a,c){for(var d,e=a.firstElementChild;e;){if(e.matches(c))return e;if(d=b(e,c))return d;e=e.nextElementSibling}return null}function c(a,b,d){for(var e=a.firstElementChild;e;)e.matches(b)&&(d[d.length++]=e),c(e,b,d),e=e.nextElementSibling;return d}var d={querySelector:function(a){return b(this,a)},querySelectorAll:function(a){return c(this,a,new NodeList)}},e={getElementsByTagName:function(a){return this.querySelectorAll(a)},getElementsByClassName:function(a){return this.querySelectorAll("."+a)},getElementsByTagNameNS:function(a,b){if("*"===a)return this.getElementsByTagName(b);for(var c=new NodeList,d=this.getElementsByTagName(b),e=0,f=0;e";case Node.TEXT_NODE:return c(a.nodeValue);case Node.COMMENT_NODE:return"";default:throw console.error(a),new Error("not implemented")}}function e(a){for(var b="",c=a.firstChild;c;c=c.nextSibling)b+=d(c);return b}function f(a,b,c){var d=c||"div";a.textContent="";var e=n(a.ownerDocument.createElement(d));e.innerHTML=b;for(var f;f=e.firstChild;)a.appendChild(o(f))}function g(a){j.call(this,a)}function h(b){k(g,b,function(){return a.renderAllPending(),this.impl[b]})}function i(b){Object.defineProperty(g.prototype,b,{value:function(){return a.renderAllPending(),this.impl[b].apply(this.impl,arguments)},configurable:!0,enumerable:!0})}var j=a.wrappers.Element,k=a.defineGetter,l=a.mixin,m=a.registerWrapper,n=a.unwrap,o=a.wrap,p=/&|<|"/g,q={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},r=window.HTMLElement;g.prototype=Object.create(j.prototype),l(g.prototype,{get innerHTML(){return e(this)},set innerHTML(a){f(this,a,this.tagName)},get outerHTML(){return d(this)},set outerHTML(a){if(this.invalidateShadowRenderer())throw new Error("not implemented");this.impl.outerHTML=a}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollLeft","scrollTop","scrollWidth"].forEach(h),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(i),m(r,g,document.createElement("b")),a.wrappers.HTMLElement=g,a.getInnerHTML=e,a.setInnerHTML=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLContentElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get select(){return this.getAttribute("select")},set select(a){this.setAttribute("select",a)},setAttribute:function(a,b){c.prototype.setAttribute.call(this,a,b),"select"===String(a).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),f&&e(f,b),a.wrappers.HTMLContentElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLShadowElement;b.prototype=Object.create(c.prototype),d(b.prototype,{invalidateShadowRenderer:function(){c.prototype.invalidateShadowRenderer.call(this,!0)}}),f&&e(f,b),a.wrappers.HTMLShadowElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){if(!a.defaultView)return a;var b=l.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);l.set(a,b)}return b}function c(a){for(var c,d=b(a.ownerDocument),e=d.createDocumentFragment();c=a.firstChild;)e.appendChild(c);return e}function d(a){e.call(this,a)}var e=a.wrappers.HTMLElement,f=a.getInnerHTML,g=a.mixin,h=a.registerWrapper,i=a.setInnerHTML,j=a.wrap,k=new SideTable,l=new SideTable,m=window.HTMLTemplateElement;d.prototype=Object.create(e.prototype),g(d.prototype,{get content(){if(m)return j(this.impl.content);var a=k.get(this);return a||(a=c(this),k.set(this,a)),a},get innerHTML(){return f(this.content)},set innerHTML(a){i(this.content,a),this.invalidateShadowRenderer()}}),m&&h(m,d),a.wrappers.HTMLTemplateElement=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){switch(a.localName){case"content":return new c(a);case"shadow":return new e(a);case"template":return new f(a)}d.call(this,a)}var c=a.wrappers.HTMLContentElement,d=a.wrappers.HTMLElement,e=a.wrappers.HTMLShadowElement,f=a.wrappers.HTMLTemplateElement;a.mixin;var g=a.registerWrapper,h=window.HTMLUnknownElement;b.prototype=Object.create(d.prototype),g(h,b),a.wrappers.HTMLUnknownElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";var b=a.GetElementsByInterface,c=a.ParentNodeInterface,d=a.SelectorsInterface,e=a.mixin,f=a.registerObject,g=f(document.createDocumentFragment());e(g.prototype,c),e(g.prototype,d),e(g.prototype,b);var h=f(document.createTextNode("")),i=f(document.createComment(""));a.wrappers.Comment=i,a.wrappers.DocumentFragment=g,a.wrappers.Text=h}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b=i(a.impl.ownerDocument.createDocumentFragment());c.call(this,b),g(b,this);var d=a.shadowRoot;k.set(this,d),j.set(this,a)}var c=a.wrappers.DocumentFragment,d=a.elementFromPoint,e=a.getInnerHTML,f=a.mixin,g=a.rewrap,h=a.setInnerHTML,i=a.unwrap,j=new SideTable,k=new SideTable;b.prototype=Object.create(c.prototype),f(b.prototype,{get innerHTML(){return e(this)},set innerHTML(a){h(this,a),this.invalidateShadowRenderer()},get olderShadowRoot(){return k.get(this)||null},invalidateShadowRenderer:function(){return j.get(this).invalidateShadowRenderer()},elementFromPoint:function(a,b){return d(this,this.ownerDocument,a,b)},getElementById:function(a){return this.querySelector("#"+a)}}),a.wrappers.ShadowRoot=b,a.getHostForShadowRoot=function(a){return j.get(a)}}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){a.previousSibling_=a.previousSibling,a.nextSibling_=a.nextSibling,a.parentNode_=a.parentNode}function c(a){a.firstChild_=a.firstChild,a.lastChild_=a.lastChild}function d(a){D(a instanceof C);for(var d=a.firstChild;d;d=d.nextSibling)b(d);c(a)}function e(a){var b=F(a);d(a),b.textContent=""}function f(a,c){var e=F(a),f=F(c);f.nodeType===C.DOCUMENT_FRAGMENT_NODE?d(c):(h(c),b(c)),a.lastChild_=a.lastChild,a.lastChild===a.firstChild&&(a.firstChild_=a.firstChild);var g=G(e.lastChild);g&&(g.nextSibling_=g.nextSibling),e.appendChild(f)}function g(a,c){var d=F(a),e=F(c);b(c),c.previousSibling&&(c.previousSibling.nextSibling_=c),c.nextSibling&&(c.nextSibling.previousSibling_=c),a.lastChild===c&&(a.lastChild_=c),a.firstChild===c&&(a.firstChild_=c),d.removeChild(e)}function h(a){var b=F(a),c=b.parentNode;c&&g(G(c),a)}function i(a,b){k(b).push(a),z(a,b);var c=I.get(a);c||I.set(a,c=[]),c.push(b)}function j(a){H.set(a,[])}function k(a){return H.get(a)}function l(a){for(var b=[],c=0,d=a.firstChild;d;d=d.nextSibling)b[c++]=d;return b}function m(a,b,c){for(var d=l(a),e=0;e","+","~"],d=a,e="["+b+"]";return c.forEach(function(a){var b=d.split(a);d=b.map(function(a){var b=a.trim();return b&&c.indexOf(b)<0&&b.indexOf(e)<0&&(a=b.replace(/([^:]*)(:*)(.*)/,"$1"+e+"$2$3")),a}).join(a)}),d},propertiesFromRule:function(a){var b=a.style.cssText;return a.style.content&&!a.style.content.match(/['"]+/)&&(b="content: '"+a.style.content+"';\n"+a.style.cssText.replace(/content:[^;]*;/g,"")),b}},i=/@host[^{]*{(([^}]*?{[^{]*?}[\s\S]*?)+)}/gim,j=/([^{]*)({[\s\S]*?})/gim,k=/(.*)((?:\*)|(?:\:scope))(.*)/,l=/^[.\[:]/,m=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,n=/\/\*\s*@polyfill ([^*]*\*+([^/*][^*]*\*+)*\/)([^{]*?){/gim,o=/::(x-[^\s{,(]*)/gim,p="([>\\s~+[.,{:][\\s\\S]*)?$",q=/@host/gim;if(window.ShadowDOMPolyfill){e("style { display: none !important; }\n");var r=document.querySelector("head");r.insertBefore(f(),r.childNodes[0])}a.ShadowCSS=h}(window.Platform)}else{var SideTable;"undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),function(){window.templateContent=window.templateContent||function(a){return a.content},window.wrap=window.unwrap=function(a){return a};var a=HTMLElement.prototype.webkitCreateShadowRoot;HTMLElement.prototype.webkitCreateShadowRoot=function(){var b=this.webkitShadowRoot,c=a.call(this);return c.olderShadowRoot=b,c.host=this,CustomElements.watchShadow(this),c},Object.defineProperties(HTMLElement.prototype,{shadowRoot:{get:function(){return this.webkitShadowRoot}},createShadowRoot:{value:function(){return this.webkitCreateShadowRoot()}}}),window.templateContent=function(a){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(a),!a.content&&!a._content){for(var b=document.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a._content=b}return a.content||a._content}}()}if(function(a){function b(a){for(var b=a||{},d=1;d",""," "," ShadowDOM Inspector"," "," "," ",'
    ',"
",'
'," ",""].join("\n"),d=[],e=function(){var a=b.document,c=a.querySelector("#crumbs");c.textContent="";for(var e,g=0;e=d[g];g++){var h=a.createElement("a");h.href="#",h.textContent=e.localName,h.idx=g,h.onclick=function(a){for(var b;d.length>this.idx;)b=d.pop();f(b.shadow||b,b),a.preventDefault()},c.appendChild(a.createElement("li")).appendChild(h)}},f=function(a,c){var f=b.document;k=[];var g=c||a;d.push(g),e(),f.body.querySelector("#tree").innerHTML="
"+j(a,a.childNodes)+"
"},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),h={STYLE:1,SCRIPT:1,"#comment":1,TEMPLATE:1},i=function(a){return h[a.nodeName]},j=function(a,b,c){if(i(a))return"";var d=c||"";if(a.localName||11==a.nodeType){var e=a.localName||"shadow-root",f=d+l(a);"content"==e&&(b=a.getDistributedNodes()),f+="
";var h=d+"  ";g(b,function(a){f+=j(a,a.childNodes,h)}),f+=d,{br:1}[e]||(f+="</"+e+">",f+="
")}else{var k=a.textContent.trim();f=k?d+'"'+k+'"'+"
":""}return f},k=[],l=function(a){var b="<",c=a.localName||"shadow-root";return a.webkitShadowRoot||a.shadowRoot?(b+=' ",k.push(a)):b+=c||"shadow-root",a.attributes&&g(a.attributes,function(a){b+=" "+a.name+(a.value?'="'+a.value+'"':"")}),b+=">"};shadowize=function(){var a=Number(this.attributes.idx.value),b=k[a];b?f(b.webkitShadowRoot||b.shadowRoot,b):(console.log("bad shadowize node"),console.dir(this))},a.output=j}(window.Inspector),function(a){"use strict";function b(){function a(a){"splice"===a[0].type&&"splice"===a[1].type&&(b=!0)}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=!1,c=[0];return Array.observe(c,a),c[1]=1,c.length=0,Object.deliverChangeRecords(a),b}function c(a){return+a===a>>>0}function d(a){return+a}function e(a){return a===Object(a)}function f(a,b){return a===b?0!==a||1/a===1/b:K(a)&&K(b)?!0:a!==a&&b!==b}function g(a){return"string"!=typeof a?!1:(a=a.replace(/\s/g,""),""==a?!0:"."==a[0]?!1:S.test(a))}function h(a){var b=T[a];if(b)return b;if(g(a)){var b=new i(a);return T[a]=b,b}}function i(a){return""==a.trim()?this:c(a)?(this.push(String(a)),this):(a.split(/\./).filter(function(a){return a}).forEach(function(a){this.push(a)},this),H&&this.length&&(this.getValueFrom=this.compiledGetValueFromFn()),void 0)}function j(a){for(var b=0;U>b&&a.check();)a.report(),b++}function k(a){for(var b in a)return!1;return!0}function l(a){return k(a.added)&&k(a.removed)&&k(a.changed)}function m(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function n(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function o(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,G){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}p(this),this.connect(),this.sync(!0)}function p(a){W&&(V.push(a),o._allObserversCount++)}function q(a,b,c,d){o.call(this,a,b,c,d)}function r(a,b,c,d){if(!Array.isArray(a))throw Error("Provided object is not an Array");o.call(this,a,b,c,d)}function s(a){this.arr=[],this.callback=a,this.isObserved=!0}function t(a,b,c,d,f){this.value=void 0;var g=h(b);return g?g.length?e(a)?(this.path=g,o.call(this,a,c,d,f),void 0):(this.closed=!0,this.value=void 0,void 0):(this.closed=!0,this.value=a,void 0):(this.closed=!0,this.value=void 0,void 0)}function u(a,b){if("function"==typeof Object.observe){var c=Object.getNotifier(a);return function(d,e){var f={object:a,type:d,name:b};2===arguments.length&&(f.oldValue=e),c.notify(f)}}}function v(a,b,c){for(var d={},e={},f=0;fj;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(d[e+j-1]===a[b+k-1])i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i}function x(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(ab):(e.push(bb),d=g),b--,c--):f==h?(e.push(db),b--,d=h):(e.push(cb),c--,d=i)}else e.push(db),b--;else e.push(cb),c--;return e.reverse(),e}function y(a,b,c){for(var d=0;c>d;d++)if(a[d]!==b[d])return d;return c}function z(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&a[--d]===b[--e];)f++;return f}function A(a,b,c){return{index:a,removed:b,addedCount:c}}function B(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=y(a,d,i)),c==a.length&&f==d.length&&(h=z(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,0==c-b&&0==f-e)return[];if(b==c){for(var j=A(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[A(b,[],c-b)];for(var k=x(w(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;ob||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function D(a,b,c,d){for(var e=A(b,c,d),f=!1,g=0,h=0;h=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.indexi.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.indexh)continue;D(e,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return e}function F(a,b){var c=[];return E(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?(b.removed[0]!==a[b.index]&&c.push(b),void 0):(c=c.concat(B(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)),void 0)}),c}var G=b(),H=!1;try{var I=new Function("","return true;");H=I()}catch(J){}var K=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},L="__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},M="[$_a-zA-Z]",N="[$_a-zA-Z0-9]",O=M+"+"+N+"*",P="(?:[0-9]|[1-9]+[0-9]+)",Q="(?:"+O+"|"+P+")",R="(?:"+Q+")(?:\\."+Q+")*",S=new RegExp("^"+R+"$"),T={};i.prototype=L({__proto__:[],toString:function(){return this.join(".")},getValueFrom:function(a){for(var b=0;ba&&b.anyChanged);o._allObserversCount=V.length,X=!1}}},W&&(a.Platform.clearObservers=function(){V=[]}),q.prototype=L({__proto__:o.prototype,connect:function(){G&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=n(this.object))},check:function(a){var b,c;if(G){if(!a)return!1;c={},b=v(this.object,a,c)}else c=this.oldObject,b=m(this.object,this.oldObject);return l(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){G?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}}),r.prototype=L({__proto__:q.prototype,connect:function(){G&&Array.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=this.object.slice())},check:function(a){var b;if(G){if(!a)return!1;b=F(this.object,a)}else b=B(this.object,0,this.object.length,this.oldObject,0,this.oldObject.length);return b&&b.length?(this.reportArgs=[b],!0):!1}}),r.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;ba&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}},t.prototype=L({__proto__:o.prototype,connect:function(){G&&(this.observedSet=new s(this.boundInternalCallback))},disconnect:function(){this.value=void 0,G&&(this.observedSet.reset(),this.observedSet.cleanup(),this.observedSet=void 0)},check:function(){return this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object),f(this.value,this.oldValue)?!1:(this.reportArgs=[this.value,this.oldValue],!0)},sync:function(a){a&&(this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object)),this.oldValue=this.value}}),t.getValueAtPath=function(a,b){var c=h(b);return c?c.getValueFrom(a):void 0},t.setValueAtPath=function(a,b,c){var d=h(b);d&&d.setValueFrom(a,c)};var _={"new":!0,updated:!0,deleted:!0};t.defineProperty=function(a,b,c){var d=c.object,e=h(c.path),f=u(a,b),g=new t(d,c.path,function(a,b){f&&f("updated",b)});return Object.defineProperty(a,b,{get:function(){return e.getValueFrom(d)},set:function(a){e.setValueFrom(d,a)},configurable:!0}),{close:function(){var c=e.getValueFrom(d);f&&g.deliver(),g.close(),Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}}};var ab=0,bb=1,cb=2,db=3;a.Observer=o,a.Observer.hasObjectObserve=G,a.ArrayObserver=r,a.ArrayObserver.calculateSplices=function(a,b){return B(a,0,a.length,b,0,b.length)},a.ObjectObserver=q,a.PathObserver=t,a.Path=i}("undefined"!=typeof global&&global?global: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 a.ownerDocument.contains(a)}function e(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.observer=new PathObserver(c,d,this.boundValueChanged,this),this.boundValueChanged(this.value)}function f(a,b,c,d){this.conditional="?"==b[b.length-1],this.conditional&&(a.removeAttribute(b),b=b.slice(0,-1)),e.call(this,a,b,c,d)}function g(a){switch(a.type){case"checkbox":return T;case"radio":case"select-multiple":case"select-one":return"change";default:return"input"}}function h(a,b,c,d){e.call(this,a,b,c,d),this.eventType=g(this.node),this.boundNodeValueToModel=this.nodeValueChanged.bind(this),this.node.addEventListener(this.eventType,this.boundNodeValueToModel,!0)}function i(a){if(!d(a))return[];if(a.form)return Q(a.form.elements,function(b){return b!=a&&"INPUT"==b.tagName&&"radio"==b.type&&b.name==a.name});var b=a.ownerDocument.querySelectorAll('input[type="radio"][name="'+a.name+'"]');return Q(b,function(b){return b!=a&&!b.form})}function j(a,b,c){h.call(this,a,"checked",b,c)}function k(a,b,c){h.call(this,a,"selectedIndex",b,c)}function l(a){return $[a.tagName]&&a.hasAttribute("template")}function m(a){return"TEMPLATE"==a.tagName||l(a)}function n(a){return _&&"TEMPLATE"==a.tagName}function o(a,b){var c=a.querySelectorAll(ab);m(a)&&b(a),P(c,b)}function p(a){function b(a){HTMLTemplateElement.decorate(a)||p(a.content)}o(a,b)}function q(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function r(a){if(!a.defaultView)return a;var b=eb.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);eb.set(a,b)}return b}function s(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];Z[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function t(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 u(a){"TEMPLATE"===a.tagName?_||(cb?a.__proto__=HTMLTemplateElement.prototype:q(a,HTMLTemplateElement.prototype)):(q(a,HTMLTemplateElement.prototype),Object.defineProperty(a,"content",ib))}function v(a){var b=lb.get(a);b||(b=function(){H(a,a.model,a.bindingDelegate)},lb.set(a,b)),bb(b)}function w(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.node.inputs.bind(this.property,c,d||"")}function x(a){return 3==a.length&&0==a[0].length&&0==a[2].length}function y(a){if(a&&a.length){for(var b,c=a.length,d=0,e=0,f=0;c>e;){if(d=a.indexOf("{{",e),f=0>d?-1:a.indexOf("}}",d+2),0>f){if(!b)return;b.push(a.slice(e));break}b=b||[],b.push(a.slice(e,d)),b.push(a.slice(d+2,f).trim()),e=f+2}return e===c&&b.push(""),b}}function z(a,b,c,d,e){var f,g=e&&e[X];return g&&"function"==typeof g&&(f=g(c,d,b,a),f&&(c=f,d="value")),a.bind(b,c,d)}function A(a,b,c,d,e){for(var f=0;fc?(this.keys.push(a),this.values.push(b)):this.values[c]=b},get:function(a){var b=this.keys.indexOf(a);return 0>b?void 0: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>>0)+(c++ +"__")},S.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),Node.prototype.bind=function(a,b,c){this.bindings=this.bindings||{};var d=this.bindings[a];return d&&d.close(),d=this.createBinding(a,b,c),this.bindings[a]=d,d?d:(console.error("Unhandled binding to Node: ",this,a,b,c),void 0)},Node.prototype.createBinding=function(){},Node.prototype.unbind=function(a){if(this.bindings){var b=this.bindings[a];b&&(b.close(),delete this.bindings[a])}},Node.prototype.unbindAll=function(){if(this.bindings){for(var a=Object.keys(this.bindings),b=0;be.node.length&&d--?bb(b):e.node[e.property]=c}var c=Number(a);if(c<=this.node.length)return this.node[this.property]=c,void 0;var d=2,e=this;bb(b)}}),HTMLSelectElement.prototype.createBinding=function(a,b,c){return"selectedindex"===a.toLowerCase()?(this.removeAttribute(a),new k(this,b,c)):HTMLElement.prototype.createBinding.call(this,a,b,c)};var U="bind",V="repeat",W="if",X="getBinding",Y="getInstanceModel",Z={template:!0,repeat:!0,bind:!0,ref:!0},$={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0,OPTGROUP:!0},_="undefined"!=typeof HTMLTemplateElement,ab="template, "+Object.keys($).map(function(a){return a.toLowerCase()+"[template]"}).join(", "),bb=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=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(;bb>ab&&d(_.charCodeAt(ab));)++ab}function j(){var a,b;for(a=ab++;bb>ab&&(b=_.charCodeAt(ab),g(b));)++ab;return _.slice(a,ab)}function k(){var a,b,c;return a=ab,b=j(),c=1===b.length?X.Identifier:h(b)?X.Keyword:"null"===b?X.NullLiteral:"true"===b||"false"===b?X.BooleanLiteral:X.Identifier,{type:c,value:b,range:[a,ab]}}function l(){var a,b,c,d,e=ab,f=_.charCodeAt(ab),g=_[ab];switch(f){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++ab,{type:X.Punctuator,value:String.fromCharCode(f),range:[e,ab]};default:if(a=_.charCodeAt(ab+1),61===a)switch(f){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:return ab+=2,{type:X.Punctuator,value:String.fromCharCode(f)+String.fromCharCode(a),range:[e,ab]};case 33:case 61:return ab+=2,61===_.charCodeAt(ab)&&++ab,{type:X.Punctuator,value:_.slice(e,ab),range:[e,ab]}}}return b=_[ab+1],c=_[ab+2],d=_[ab+3],">"===g&&">"===b&&">"===c&&"="===d?(ab+=4,{type:X.Punctuator,value:">>>=",range:[e,ab]}):">"===g&&">"===b&&">"===c?(ab+=3,{type:X.Punctuator,value:">>>",range:[e,ab]}):"<"===g&&"<"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:"<<=",range:[e,ab]}):">"===g&&">"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:">>=",range:[e,ab]}):g===b&&"+-<>&|".indexOf(g)>=0?(ab+=2,{type:X.Punctuator,value:g+b,range:[e,ab]}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ab,{type:X.Punctuator,value:g,range:[e,ab]}):(s({},$.UnexpectedToken,"ILLEGAL"),void 0)}function m(){var a,d,e;if(e=_[ab],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=ab,a="","."!==e){for(a=_[ab++],e=_[ab],"0"===a&&e&&c(e.charCodeAt(0))&&s({},$.UnexpectedToken,"ILLEGAL");c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("."===e){for(a+=_[ab++];c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("e"===e||"E"===e)if(a+=_[ab++],e=_[ab],("+"===e||"-"===e)&&(a+=_[ab++]),c(_.charCodeAt(ab)))for(;c(_.charCodeAt(ab));)a+=_[ab++];else s({},$.UnexpectedToken,"ILLEGAL");return f(_.charCodeAt(ab))&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.NumericLiteral,value:parseFloat(a),range:[d,ab]}}function n(){var a,c,d,f="",g=!1;for(a=_[ab],b("'"===a||'"'===a,"String literal must starts with a quote"),c=ab,++ab;bb>ab;){if(d=_[ab++],d===a){a="";break}if("\\"===d)if(d=_[ab++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===_[ab]&&++ab;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({},$.UnexpectedToken,"ILLEGAL"),{type:X.StringLiteral,value:f,octal:g,range:[c,ab]}}function o(a){return a.type===X.Identifier||a.type===X.Keyword||a.type===X.BooleanLiteral||a.type===X.NullLiteral}function p(){var a;return i(),ab>=bb?{type:X.EOF,range:[ab,ab]}:(a=_.charCodeAt(ab),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(_.charCodeAt(ab+1))?m():l():c(a)?m():l())}function q(){var a;return a=db,ab=a.range[1],db=p(),ab=a.range[1],a}function r(){var a;a=ab,db=p(),ab=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(cab&&(a.push(O()),!v(")"));)u(",");return u(")"),a}function F(){var a;return a=q(),o(a)||t(a),cb.createIdentifier(a.value)}function G(){return u("."),F()}function H(){var a;return u("["),a=P(),u("]"),a}function I(){var a,b,c;for(a=D();v(".")||v("[")||v("(");)v("(")?(b=E(),a=cb.createCallExpression(a,b)):v("[")?(c=H(),a=cb.createMemberExpression("[",a,c)):(c=G(),a=cb.createMemberExpression(".",a,c));return a}function J(){var a;return a=I(),db.type===X.Punctuator&&(v("++")||v("--"))&&s({},$.UnexpectedToken),a}function K(){var a,b;return db.type!==X.Punctuator&&db.type!==X.Keyword?b=J():v("++")||v("--")?s({},$.UnexpectedToken):v("+")||v("-")||v("~")||v("!")?(a=q(),b=K(),b=cb.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},$.UnexpectedToken):b=J(),b}function L(a,b){var c=0;if(a.type!==X.Punctuator&&a.type!==X.Keyword)return 0;switch(a.value){case"||":c=1;break;case"&&":c=2;break;case"|":c=3;break;case"^":c=4;break;case"&":c=5;break;case"==":case"!=":case"===":case"!==":c=6;break;case"<":case">":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function M(){var a,b,c,d,e,f,g,h,i;if(d=eb.allowIn,eb.allowIn=!0,h=K(),b=db,c=L(b,d),0===c)return h;for(b.prec=c,q(),f=K(),e=[h,b,f];(c=L(db,d))>0;){for(;e.length>2&&c<=e[e.length-2].prec;)f=e.pop(),g=e.pop().value,h=e.pop(),a=cb.createBinaryExpression(g,h,f),e.push(a);b=q(),b.prec=c,e.push(b),a=K(),e.push(a)}for(eb.allowIn=d,i=e.length-1,a=e[i];i>1;)a=cb.createBinaryExpression(e[i-1].value,e[i-2],a),i-=2;return a}function N(){var a,b,c,d;return a=M(),v("?")&&(q(),b=eb.allowIn,eb.allowIn=!0,c=O(),eb.allowIn=b,u(":"),d=O(),a=cb.createConditionalExpression(a,c,d)),a}function O(){var a,b,c;return a=db,c=b=N()}function P(){var a;return a=O()}function Q(){return u(";"),cb.createEmptyStatement()}function R(){var a=P();return x(),cb.createExpressionStatement(a)}function S(){var a,b,c,d=db.type;if(d===X.EOF&&t(db),i(),d===X.Punctuator)switch(db.value){case";":return Q();case"(":return R()}return a=P(),a.type===Z.Identifier&&v(":")?(q(),c="$"+a.name,Object.prototype.hasOwnProperty.call(eb.labelSet,c)&&s({},$.Redeclaration,"Label",a.name),eb.labelSet[c]=!0,b=S(),delete eb.labelSet[c],cb.createLabeledStatement(a,b)):(x(),cb.createExpressionStatement(a))}function T(){return db.type===X.Keyword?S():db.type!==X.EOF?S():void 0}function U(){for(var a,b=[];bb>ab&&(a=T(),"undefined"!=typeof a);)b.push(a);return b}function V(){var a;return i(),r(),a=U(),cb.createProgram(a)}function W(a,b){var c;return c=String,"string"==typeof a||a instanceof String||(a=c(a)),cb=b,_=a,ab=0,bb=_.length,db=null,eb={allowIn:!0,labelSet:{}},bb>0&&"undefined"==typeof _[0]&&a instanceof String&&(_=a.valueOf()),V()}var X,Y,Z,$,_,ab,bb,cb,db,eb;X={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},Y={},Y[X.BooleanLiteral]="Boolean",Y[X.EOF]="",Y[X.Identifier]="Identifier",Y[X.Keyword]="Keyword",Y[X.NullLiteral]="Null",Y[X.NumericLiteral]="Numeric",Y[X.Punctuator]="Punctuator",Y[X.StringLiteral]="String",Z={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"},$={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"},a.esprima={parse:W}}(this),function(a){"use strict";function b(a,b,d,e){if(e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.tagName&&("bind"===d||"repeat"===d)){var f,g,h=b.match(r);if(h?(f=h[1],g=h[2]):(h=b.match(s),h&&(f=h[2],g=h[1])),h){var i;if(g=g.trim(),g.match(q))i=new CompoundBinding(function(a){return a.path}),i.bind("path",a,g);else try{i=c(a,g)}catch(j){console.error("Invalid expression syntax: "+g,j)}if(i)return t.set(e,f),i}}}function c(a,b){try{var c=new f;if(esprima.parse(b,c),!c.statements.length&&!c.labeledStatements.length)return;if(!c.labeledStatements.length&&c.statements.length>1)throw Error("Multiple unlabelled statements are not allowed.");var e=c.labeledStatements.length?d(c.labeledStatements):e=c.statements[0],g=[];for(var h in c.deps)g.push(h);if(!g.length)return{value:e({})};for(var i=new CompoundBinding(e),j=0;j>>0)+(c++ +"__")},i.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var j="[$_a-zA-Z]",k="[$_a-zA-Z0-9]",l=j+"+"+k+"*",m="("+l+")",n="(?:[0-9]|[1-9]+[0-9]+)",o="(?:"+l+"|"+n+")",p="(?:"+o+")(?:\\."+o+")*",q=new RegExp("^"+p+"$"),r=new RegExp("^"+m+"\\s* in (.*)$"),s=new RegExp("^(.*) as \\s*"+m+"$"),t=new i;e.prototype={getPath:function(){return this.last?this.last.getPath()+"."+this.name:this.name},valueFn:function(){var a=this.getPath();return this.deps[a]=!0,function(b){return b[a]}}};var u={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},v={"+":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}};f.prototype={getFn:function(a){return a instanceof e?a.valueFn():a},createProgram:function(){},createExpressionStatement:function(a){return this.statements.push(a),a},createLabeledStatement:function(a,b){return this.labeledStatements.push({label:a.getPath(),body:b instanceof e?b.valueFn():b}),b},createUnaryExpression:function(a,b){if(!u[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),function(c){return u[a](b(c))}},createBinaryExpression:function(a,b,c){if(!v[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),c=this.getFn(c),function(d){return v[a](b(d),c(d))}},createConditionalExpression:function(a,b,c){return a=this.getFn(a),b=this.getFn(b),c=this.getFn(c),function(d){return a(d)?b(d):c(d)}},createIdentifier:function(a){var b=new e(this.deps,a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){return new e(this.deps,c.name,b)},createLiteral:function(a){return function(){return a.value}},createArrayExpression:function(a){for(var b=0;be;e++)d.unshift("..");var g=d.join("/");return g},resolvePathsInHTML:function(a,b){b=b||p.documentUrlFromNode(a),p.resolveAttributes(a,b),p.resolveStyleElts(a,b);var c=a.querySelectorAll("template");c&&q(c,function(a){a.content&&p.resolvePathsInHTML(a.content,b)})},resolvePathsInStylesheet:function(a){var b=p.nodeUrl(a);a.__resource=p.resolveCssText(a.__resource,b)},resolveStyleElts:function(a,b){var c=a.querySelectorAll("style");c&&q(c,function(a){a.textContent=p.resolveCssText(a.textContent,b)})},resolveCssText:function(a,b){return a.replace(/url\([^)]*\)/g,function(a){var c=a.replace(/["']/g,"").slice(4,-1);return c=p.resolveUrl(b,c,!0),"url("+c+")"})},resolveAttributes:function(a,b){var c=a&&a.querySelectorAll(n);c&&q(c,function(a){this.resolveNodeAttributes(a,b)},this)},resolveNodeAttributes:function(a,b){m.forEach(function(c){var d=a.attributes[c];if(d&&d.value&&d.value.search(o)<0){var e=p.resolveUrl(b,d.value,!0);d.value=e}})}};h=h||{async:!0,ok:function(a){return a.status>=200&&a.status<300||304===a.status||0===a.status},load:function(b,c,d){var e=new XMLHttpRequest;return(a.flags.debug||a.flags.bust)&&(b+="?"+Math.random()),e.open("GET",b,h.async),e.addEventListener("readystatechange",function(){4===e.readyState&&c.call(d,!h.ok(e)&&e,e.response,b)}),e.send(),e},loadDocument:function(a,b,c){this.load(a,b,c).responseType="document"}};var q=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.path=p,a.xhr=h,a.importer=k,a.getDocumentUrl=p.getDocumentUrl,a.IMPORT_LINK_TYPE=i}(window.HTMLImports),function(a){function b(a){return"link"===a.localName&&a.getAttribute("rel")===f}function c(a){return a.parentNode&&!d(a)&&!e(a)}function d(a){return a.ownerDocument===document||a.ownerDocument.impl===document}function e(a){return a.parentNode&&"element"===a.parentNode.localName}var f="import",g={selectors:["link[rel="+f+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(a){if(!a.__importParsed){a.__importParsed=!0;var b=a.querySelectorAll(g.selectors);h(b,function(a){g[g.map[a.localName]](a)})}},parseLink:function(a){b(a)?a.content&&g.parse(a.content):this.parseGeneric(a)},parseGeneric:function(a){c(a)&&document.head.appendChild(a)},parseScript:function(b){if(c(b)){var d=(b.__resource||b.textContent).trim();if(d){var e=b.__nodeUrl;if(!e){var e=a.path.documentUrlFromNode(b),f="["+Math.floor(1e3*(Math.random()+1))+"]",g=d.match(/Polymer\(['"]([^'"]*)/);f=g&&g[1]||f,e+="/"+f+".js"}d+="\n//# sourceURL="+e+"\n",eval.call(window,d)}}}},h=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.parser=g}(HTMLImports),function(){function a(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState?a():window.addEventListener("DOMContentLoaded",a)}(),function(a){function b(a){u.push(a),t||(t=!0,q(d))}function c(a){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(a)||a}function d(){t=!1;var a=u;u=[],a.sort(function(a,b){return a.uid_-b.uid_});var b=!1;a.forEach(function(a){var c=a.takeRecords();e(a),c.length&&(a.callback_(c,a),b=!0)}),b&&d()}function e(a){a.nodes_.forEach(function(b){var c=p.get(b);c&&c.forEach(function(b){b.observer===a&&b.removeTransientObservers()})})}function f(a,b){for(var c=a;c;c=c.parentNode){var d=p.get(c);if(d)for(var e=0;e0){var e=c[d-1],f=n(e,a);if(f)return c[d-1]=f,void 0}else b(this.observer);c[d]=a},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(a){var b=this.options;b.attributes&&a.addEventListener("DOMAttrModified",this,!0),b.characterData&&a.addEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.addEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(a){var b=this.options;b.attributes&&a.removeEventListener("DOMAttrModified",this,!0),b.characterData&&a.removeEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.removeEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(a){if(a!==this.target){this.addListeners_(a),this.transientObservedNodes.push(a);var b=p.get(a);b||p.set(a,b=[]),b.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[],a.forEach(function(a){this.removeListeners_(a);for(var b=p.get(a),c=0;c1?logFlags.dom&&console.warn("inserted:",a.localName,"insert/remove count:",a.__inserted):a.insertedCallback&&(logFlags.dom&&console.log("inserted:",a.localName),a.insertedCallback())),logFlags.dom&&console.groupEnd())}function k(a){l(a),d(a,function(a){l(a)})}function l(a){(a.removedCallback||a.__upgraded__&&logFlags.dom)&&(logFlags.dom&&console.log("removed:",a.localName),m(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?logFlags.dom&&console.warn("removed:",a.localName,"insert/remove count:",a.__inserted):a.removedCallback&&a.removedCallback()))}function m(a){for(var b=a;b;){if(b==a.ownerDocument)return!0;b=b.parentNode||b.host}}function n(a){if(a.webkitShadowRoot&&!a.webkitShadowRoot.__watched){logFlags.dom&&console.log("watching shadow-root for: ",a.localName);for(var b=a.webkitShadowRoot;b;)o(b),b=b.olderShadowRoot}}function o(a){a.__watched||(t(a),a.__watched=!0)}function p(a){n(a),d(a,function(){n(a)})}function q(a){switch(a.localName){case"style":case"script":case"template":case void 0:return!0}}function r(a){if(logFlags.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(x(a.addedNodes,function(a){q(a)||g(a)}),x(a.removedNodes,function(a){q(a)||k(a)}))}),logFlags.dom&&console.groupEnd()}function s(){r(w.takeRecords())}function t(a){w.observe(a,{childList:!0,subtree:!0})}function u(a){t(a)}function v(a){logFlags.dom&&console.group("upgradeDocument: ",(a.URL||a._URL||"").split("/").pop()),g(a),logFlags.dom&&console.groupEnd()}var w=new MutationObserver(r),x=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.watchShadow=n,a.watchAllShadows=p,a.upgradeAll=g,a.upgradeSubtree=f,a.observeDocument=u,a.upgradeDocument=v,a.takeRecords=s}(window.CustomElements),function(){function parseElementElement(a){var b={name:"","extends":null};takeAttributes(a,b);var c=HTMLElement.prototype;if(b.extends){var d=document.createElement(b.extends);c=d.__proto__||Object.getPrototypeOf(d)}b.prototype=Object.create(c),a.options=b;var e=a.querySelector('script:not([type]),script[type="text/javascript"],scripts');e&&executeComponentScript(e.textContent,a,b.name);var f=document.register(b.name,b);a.ctor=f;var g=a.getAttribute("constructor");g&&(window[g]=f)}function takeAttributes(a,b){for(var c in b){var d=a.attributes[c];d&&(b[c]=d.value)}}function executeComponentScript(inScript,inContext,inName){context=inContext;var owner=context.ownerDocument,url=owner._URL||owner.URL||owner.impl&&(owner.impl._URL||owner.impl.URL),match=url.match(/.*\/([^.]*)[.]?.*$/);if(match){var name=match[1];url+=name!=inName?":"+inName:""}var code="__componentScript('"+inName+"', function(){"+inScript+"});"+"\n//# sourceURL="+url+"\n";eval(code)}function mixin(a,b){a=a||{};try{Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)})}catch(c){}return a}var HTMLElementElement=function(a){return a.register=HTMLElementElement.prototype.register,parseElementElement(a),a};HTMLElementElement.prototype={register:function(a){a&&(this.options.lifecycle=a.lifecycle,a.prototype&&mixin(this.options.prototype,a.prototype))}};var context;window.__componentScript=function(a,b){b.call(context)},window.HTMLElementElement=HTMLElementElement}(),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+"]","element"],map:{link:"parseLink",element:"parseElement"},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)},parseElement:function(a){new HTMLElementElement(a)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=c}(),function(){function a(){setTimeout(function(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))},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();else{var b=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(b,a)}}(),function(){function a(){}var b=document.createElement("style");b.textContent="element {display: none !important;} /* injected by platform.js */";var c=document.querySelector("head");if(c.insertBefore(b,c.firstChild),window.ShadowDOMPolyfill){CustomElements.watchShadow=a,CustomElements.watchAllShadows=a;var d=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],e={};d.forEach(function(a){e[a]=CustomElements[a]}),d.forEach(function(a){CustomElements[a]=function(b){return e[a](wrap(b))}})}}(),function(a){a=a||{};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(document,b,c)}};a.targetFinding=b,a.findTarget=b.findTarget.bind(b),window.PointerEventsPolyfill=a}(window.PointerEventsPolyfill),function(){function a(a){return'[touch-action="'+a+'"]'}function b(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; }"}var c=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],d="";c.forEach(function(c){d+=String(c)===c?a(c)+b(c):c.selectors.map(a)+b(c.rule)});var e=document.createElement("style");e.textContent=d;var f=document.querySelector("head");f.insertBefore(e,f.firstChild)}(),function(a){function b(a,b){var b=b||{},e=b.buttons;if(void 0===e)switch(b.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}var f;if(c)f=new MouseEvent(a,b);else{f=document.createEvent("MouseEvent");var g={bubbles:!1,cancelable:!1,view:null,detail:null,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};Object.keys(g).forEach(function(a){a in b&&(g[a]=b[a])}),f.initMouseEvent(a,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)}d||Object.defineProperty(f,"buttons",{get:function(){return e},enumerable:!0});var h=0;return h=b.pressure?b.pressure:e?.5:0,Object.defineProperties(f,{pointerId:{value:b.pointerId||0,enumerable:!0},width:{value:b.width||0,enumerable:!0},height:{value:b.height||0,enumerable:!0},pressure:{value:h,enumerable:!0},tiltX:{value:b.tiltX||0,enumerable:!0},tiltY:{value:b.tiltY||0,enumerable:!0},pointerType:{value:b.pointerType||"",enumerable:!0},hwTimestamp:{value:b.hwTimestamp||0,enumerable:!0},isPrimary:{value:b.isPrimary||!1,enumerable:!0}}),f}var c=!1,d=!1;try{var e=new MouseEvent("click",{buttons:1});c=!0,d=1===e.buttons}catch(f){}a.PointerEvent||(a.PointerEvent=b)}(window),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},forEach:function(a,b){this.ids.forEach(function(c,d){a.call(b,c,this.pointers[d],this)},this)}},a.PointerMap=window.Map&&Map.prototype.forEach?Map:b}(window.PointerEventsPolyfill),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerEventsPolyfill),function(a){var b={targets:new a.SideTable,handledEvents:new a.SideTable,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)},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){a.target.contains(a.relatedTarget)||this.leave(a),this.out(a)},enterOver:function(a){a.target.contains(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:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){var c=new PointerEvent(a,b);return 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){var b={};for(var c in a)b[c]=a[c];return b},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:function(a){var b=this.getTarget(a);return b?b.dispatchEvent(a):void 0},asyncDispatchEvent:function(a){setTimeout(this.dispatchEvent.bind(this,a),0)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=b.register.bind(b),a.unregister=b.unregister.bind(b)}(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);return 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 a.SideTable,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){null===this.firstTouch&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryTouch:function(a){this.isPrimaryTouch(a)&&(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(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.size>=b.length){var c=[];f.forEach(function(a,d){if(1!==a&&!this.findTouch(b,a-2)){var e=d.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.removePrimaryTouch(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)}),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){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(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={handledEvents:new a.SideTable,targets:new a.SideTable,handlers:{},recognizers:{},events:["pointerdown","pointermove","pointerup","pointerover","pointerout","pointercancel"],registerRecognizer:function(a,b){var c=b; +this.recognizers[a]=c,this.events.forEach(function(a){if(c[a]){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(this.events,a)},unregisterTarget:function(a){this.unlisten(this.events,a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b,c=a.type;(b=this.handlers[c])&&this.makeQueue(b,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){var b={};for(var c in a)b[c]=a[c];return b},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)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=function(b){var c=window.PointerEventsPolyfill;c&&c.register(b),a.dispatcher.registerTarget(b)},b.registerTarget(document)}(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,pointerType:c.pointerType};"trackend"===a&&(h._releaseTarget=c.target);var 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"],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)},preventTap:function(a){c.delete(a)}};b.registerRecognizer("tap",d)}(window.PointerGestures),Polymer={},function(){var a=document.createElement("style");a.textContent="body {opacity: 0;}";var b=document.querySelector("head");b.insertBefore(a,b.firstChild),window.addEventListener("WebComponentsReady",function(){document.body.style.webkitTransition="opacity 0.3s",document.body.style.opacity=1})}(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&&(a[c].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;"_super"in c||(g||(g=e.call(this,c)),g||console.warn("called super() on a method not installed declaratively (has no .nom property)"),d(c,g,f(this)));var h=c._super;if(h){var i=h[g];return"_super"in i||d(i,g,h),i.apply(this,a||[])}}function c(a,b,c){for(;a&&(!a.hasOwnProperty(b)||a[b]===c);)a=f(a);return 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){console.warn("nameInThis called");for(var b=this;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(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}}};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?!1:!0,detail:b})),b},asyncFire:function(){this.asyncMethod("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,b){b.cancelBubble||(b.on=i+b.type,h.events&&console.group("[%s]: listenLocal [%s]",a.localName,b.on),!b.path||window.ShadowDOMPolyfill?d(a,b):c(a,b),h.events&&console.groupEnd())}function c(a,b){var c=null;Array.prototype.some.call(b.path,function(d){return d===a?!0:(c=c===a?c:e(d),c&&f(c,d,b)?!0:void 0)},this)}function d(a,b){h.events&&console.log("event.path() not supported for",b.type);for(var c=b.target,d=null;c&&c!=a;){if(d=d===a?d:e(c),d&&f(d,c,b))return!0;c=c.parentNode}}function e(a){for(;a.parentNode;)a=a.parentNode;return a.host}function f(a,b,c){var d=b.getAttribute&&b.getAttribute(c.on);return d&&g(b,c)&&(h.events&&console.log("[%s] found handler name [%s]",a.localName,d),a.dispatchMethod(b,d,[c,c.detail,b])),c.cancelBubble}function g(a,b){var c=l.get(b);return c||l.set(b,c=[]),c.indexOf(a)<0?(c.push(a),!0):void 0}var h=window.logFlags||{},i="on-",j="eventDelegates",k={EVENT_PREFIX:i,DELEGATES:j,addHostListeners:function(){var a=this[j];h.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a),this.addNodeListeners(this,a,this.hostEventListener)},addInstanceListeners:function(a,b){var c=b.delegates;c&&(h.events&&Object.keys(c).length>0&&console.log("[%s:root] addInstanceListeners:",this.localName,c),this.addNodeListeners(a,c,this.instanceEventListener))},addNodeListeners:function(a,b,c){var d;for(var e in b)d||(d=c.bind(this)),a.addEventListener(e,d)},hostEventListener:function(a){if(!a.cancelBubble){h.events&&console.group("[%s]: hostEventListener(%s)",this.localName,a.type);var b=this.findEventDelegate(a);b&&(h.events&&console.log("[%s] found host handler name [%s]",this.localName,b),this.dispatchMethod(this,b,[a,a.detail,this])),h.events&&console.groupEnd()}},findEventDelegate:function(a){return this[j][a.type]},dispatchMethod:function(a,b,c){if(a){h.events&&console.group("[%s] dispatch [%s]",a.localName,b);var d=this[b];d&&d[c?"apply":"call"](this,c),h.events&&console.groupEnd()}},instanceEventListener:function(a){b(this,a)}},l=new SideTable("handledList");a.api.instance.events=k}(Polymer),function(a){var b="__published",c="__instance_attributes",d={PUBLISHED:b,INSTANCE_ATTRIBUTES:c,copyInstanceAttributes:function(){var a=this[c];for(var b in a)this.setAttribute(b,a[b])},takeAttributes:function(){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.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var c=Object.keys(this[b]);return c[c.map(e).indexOf(a.toLowerCase())]},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a){return"object"!=typeof a&&void 0!==a?a:void 0},propertyToAttribute:function(a){if(Object.keys(this[b]).indexOf(a)>=0){var c=this.serializeValue(this[a]);void 0!==c&&this.setAttribute(a,c)}}},e=String.prototype.toLowerCase.call.bind(String.prototype.toLowerCase);a.api.instance.attributes=d}(Polymer),function(a){function b(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)}function c(a,b,c,d){h.bind&&console.log(o,c.localName||"object",d,a.localName,b);var e=PathObserver.getValueAtPath(c,d);return(null===e||void 0===e)&&PathObserver.setValueAtPath(c,d,a[b]),PathObserver.defineProperty(a,b,{object:c,path:d})}function d(a,b,c){var d=g(a);d[b]=c}function e(a,b){var c=g(a);return c&&c[b]?(c[b].close(),c[b]=null,!0):void 0}function f(a){var b=g(a);Object.keys(b).forEach(function(a){b[a].close(),b[a]=null})}function g(a){var b=l.get(a);return b||l.set(a,b={}),b}var h=window.logFlags||{},i="Changed",j=a.api.instance.attributes.PUBLISHED,k={observeProperties:function(){for(var a,b=this.getCustomPropertyNames(),c=0,d=b.length;d>c&&(a=b[c]);c++)this.observeProperty(a)},getCustomPropertyNames:function(){return this.customPropertyNames},observeProperty:function(a){if(this.shouldObserveProperty(a)){h.watch&&console.log(m,this.localName,a);var b=function(b,c){h.watch&&console.log(n,this.localName,this.id||"",a,this[a],c),this.dispatchPropertyChange(a,c)}.bind(this),c=new PathObserver(this,a,b);d(this,a,c)}},bindProperty:function(a,b,d){return c(this,a,b,d)},unbindProperty:function(a,b){return e(this,a,b)},unbindAllProperties:function(){f(this)},shouldObserveProperty:function(a){return Boolean(this[a+i]||Object.keys(this[j]).indexOf(a)>=0)},dispatchPropertyChange:function(a,c){this.propertyToAttribute(a),b.call(this,a+i,[c])}},l=new SideTable,m="[%s] watching [%s]",n="[%s#%s] watch: [%s] now [%s] was [%s]",o="[%s]: bindProperties: [%s] to [%s].[%s]";a.api.instance.properties=k}(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=new ExpressionSyntax,g={instanceTemplate:function(a){return a.createInstance(this,f)},createBinding:function(a,b,c){var d=this.propertyForAttribute(a);if(d){var e=this.bindProperty(d,b,c);return e.path=c,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(){this._unbound||(this.unbindAllProperties(),this.super(),b(this.shadowRoot),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)}},h=/\{\{([^{}]*)}}/;a.bindPattern=h,a.api.instance.mdv=g}(Polymer),function(a){function b(a){return a.hasOwnProperty("PolymerBase")}function c(){}var d={PolymerBase:!0,job:Polymer.job,"super":Polymer.super,ready:function(){},readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){this.observeProperties(),this.copyInstanceAttributes(),this.takeAttributes(),this.addHostListeners(),this.parseElements(this.__proto__),this.ready()},insertedCallback:function(){this._enteredDocumentCallback()},enteredDocumentCallback:function(){this._enteredDocumentCallback()},_enteredDocumentCallback:function(){this.cancelUnbindAll(!0),this.inserted&&this.inserted(),this.enteredDocument&&this.enteredDocument()},removedCallback:function(){this._leftDocumentCallback()},leftDocumentCallback:function(){this._leftDocumentCallback()},_leftDocumentCallback:function(){this.asyncUnbindAll(),this.removed&&this.removed(),this.leftDocument&&this.leftDocument()},parseElements:function(a){a&&a.element&&(this.parseElements(a.__proto__),a.parseElement.call(this,a.element))},parseElement:function(a){this.shadowFromTemplate(this.fetchTemplate(a))},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemplate:function(a){if(a){this.shadowRoot;var b=this.createShadowRoot();b.applyAuthorStyles=this.applyAuthorStyles,b.resetStyleInheritance=this.resetStyleInheritance;var c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady(b,a),b}},shadowRootReady:function(a,b){this.marshalNodeReferences(a),this.addInstanceListeners(a,b),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){this.attributeToProperty(a,this.getAttribute(a)),this.attributeChanged&&this.attributeChanged.apply(this,arguments)}};c.prototype=d,d.constructor=c,a.Base=c,a.isBase=b,a.api.instance.base=d}(Polymer),function(a){function b(a){return a.__proto__}window.logFlags||{};var c="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);window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimPolyfillDirectives([f],this.localName),Polymer.applyStyleToScope(f,a)}}},scopeHasElementStyle:function(a,b){var d=c+"="+this.localName+"-"+b;return a.querySelector("style["+d+"]")},findStyleController:function(){if(window.ShadowDOMPolyfill)return wrap(document.head);for(var a=this;a.parentNode;)a=a.parentNode;return a===document?document.head:a}};a.api.instance.styles=e}(Polymer),function(a){var b={addResolvePathApi:function(){var a=this.elementPath();this.prototype.resolvePath=function(b){return a+b}},elementPath:function(){return this.urlToPath(HTMLImports.getDocumentUrl(this.ownerDocument))},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}window.logFlags||{};var f=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.installLocalSheets(),this.installGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(i),this.sheets.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 i=this.findNodes(h,f);return i.forEach(function(a){a.parentNode.removeChild(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){function b(a){return a.slice(0,k)==g}function c(a){return a.slice(k)}function d(a){return a.ref?a.ref.content:a.content}var e=a.api.instance.events,f=e.DELEGATES,g=e.EVENT_PREFIX,h=window.logFlags||{},i={inheritDelegates:function(a){this.inheritObject(a,f)},parseHostEvents:function(){var a=this.prototype[f];this.addAttributeDelegates(a)},addAttributeDelegates:function(a){for(var d,e=0;d=this.attributes[e];e++)b(d.name)&&(a[c(d.name)]=d.value)},parseLocalEvents:function(){this.querySelectorAll("template").forEach(function(a){a.delegates={},this.accumulateTemplatedEvents(a,a.delegates),h.events&&console.log("[%s] parseLocalEvents:",this.attributes.name.value,a.delegates)},this)},accumulateTemplatedEvents:function(a,b){if("template"===a.localName){var c=d(a);c&&this.accumulateChildEvents(c,b)}},accumulateChildEvents:function(a,b){a.childNodes.forEach(function(a){this.accumulateEvents(a,b)},this)},accumulateEvents:function(a,b){return this.accumulateAttributeEvents(a,b),this.accumulateChildEvents(a,b),this.accumulateTemplatedEvents(a,b),b},accumulateAttributeEvents:function(a,d){a.attributes&&a.attributes.forEach(function(a){b(a.name)&&this.accumulateEvent(c(a.name),d)},this)},accumulateEvent:function(a,b){a=j[a]||a,b[a]=b[a]||1}},j={webkitanimationstart:"webkitAnimationStart",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitionEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"},k=g.length;i.event_translations=j,a.api.declaration.events=i}(Polymer),function(a){var b=[],c={cacheProperties:function(){this.prototype.customPropertyNames=this.getCustomPropertyNames(this.prototype)},getCustomPropertyNames:function(c){for(var d,e={};c&&!a.isBase(c);){for(var f,g=Object.getOwnPropertyNames(c),h=0,i=g.length;i>h&&(f=g[h]);h++)e[f]=!0,d=!0;c=c.__proto__}return d?Object.keys(e):b}};a.api.declaration.properties=c}(Polymer),function(a){var b=a.api.instance.attributes,c=b.PUBLISHED,d=b.INSTANCE_ATTRIBUTES,e="publish",f="attributes",g={inheritAttributesObjects:function(a){this.inheritObject(a,c),this.inheritObject(a,d)},parseAttributes:function(){this.publishAttributes(this.prototype),this.publishProperties(this.prototype),this.accumulateInstanceAttributes()},publishAttributes:function(a){var b=a[c],d=this.getAttribute(f);if(d){var e=d.split(d.indexOf(",")>=0?",":" ");e.forEach(function(a){a=a.trim(),!a||a in b||(b[a]=null)})}Object.keys(b).forEach(function(c){c in a||(a[c]=b[c])})},publishProperties:function(a){this.publishPublish(a)},publishPublish:function(a){if(a.hasOwnProperty(e)){var b=a[e];b&&(Object.keys(b).forEach(function(c){a[c]=b[c]}),Platform.mixin(a[c],b))}},accumulateInstanceAttributes:function(){var a=this.prototype[d];this.attributes.forEach(function(b){this.isInstanceAttribute(b.name)&&(a[b.name]=b.value)},this)},isInstanceAttribute:function(a){return!this.blackList[a]&&"on-"!==a.slice(0,3)},blackList:{name:1,"extends":1,constructor:1,noscript:1}};g.blackList[f]=1,a.api.declaration.attributes=g}(Polymer),function(a){function b(a,b){h[a]=b||{},g[a]&&g[a].define()}function c(a){return Object.create(HTMLElement.getPrototypeForTag(a))}function d(b){if(!Object.__proto__){var c=Object.getPrototypeOf(b);b.__proto__=c,a.isBase(c)&&(c.__proto__=Object.getPrototypeOf(c))}}var e=Polymer.extend,f=a.api.declaration,g={},h={},i=c();e(i,{readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){var a=this.getAttribute("name");h[a]?this.define():g[a]=this},define:function(){var a=this.getAttribute("name"),b=this.getAttribute("extends");this.prototype=this.generateCustomPrototype(a,b),this.prototype.element=this,this.addResolvePathApi(),d(this.prototype),this.desugar(),window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimStyling(this.templateContent(),a,b),this.register(a),this.publishConstructor()},desugar:function(){this.parseAttributes(),this.parseHostEvents(),this.parseLocalEvents(),this.installSheets(),this.prototype.registerCallback&&this.prototype.registerCallback(this),this.cacheProperties()},generateCustomPrototype:function(a,b){var c=this.generateBasePrototype(b);return this.addNamedApi(c,a)},generateBasePrototype:function(a){var b=c(a);return this.ensureBaseApi(b)},ensureBaseApi:function(b){return b.PolymerBase||(Object.keys(a.api.instance).forEach(function(c){e(b,a.api.instance[c])}),b=Object.create(b)),this.inheritAttributesObjects(b),this.inheritDelegates(b),b},addNamedApi:function(a,b){return e(a,h[b])},inheritObject:function(a,b){a[b]=e({},Object.getPrototypeOf(a)[b])},register:function(a){this.ctor=document.register(a,{prototype:this.prototype}),this.prototype.constructor=this.ctor,HTMLElement.register(a,this.prototype)},publishConstructor:function(){var a=this.getAttribute("constructor");a&&(window[a]=this.ctor)}}),Object.keys(f).forEach(function(a){e(i,f[a])}),document.register("polymer-element",{prototype:i}),e(b,window.Polymer),window.Polymer=b}(Polymer),Polymer.register=function(a){if(a!=window){var b=a.getAttribute("name");throw new Error("Polymer.register is deprecated in declaration of "+b+". Please see http://www.polymer-project.org/getting-started.html")}}; +/* +//@ sourceMappingURL=polymer.min.js.map +*/ \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/polymer.native.min.js b/architecture-examples/polymer/bower_components/polymer/polymer.native.min.js new file mode 100644 index 0000000000..95cf31ab53 --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/polymer.native.min.js @@ -0,0 +1,34 @@ +// 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. +function PointerGestureEvent(a,b){var c=b||{},d=document.createEvent("Event"),e={bubbles:!0,cancelable:!0};return Object.keys(e).forEach(function(a){a in c&&(e[a]=c[a])}),d.initEvent(a,e.bubbles,e.cancelable),Object.keys(c).forEach(function(a){d[a]=b[a]}),d.preventTap=this.preventTap,d}var SideTable;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),function(){window.templateContent=window.templateContent||function(a){return a.content},window.wrap=window.unwrap=function(a){return a};var a=HTMLElement.prototype.webkitCreateShadowRoot;HTMLElement.prototype.webkitCreateShadowRoot=function(){var b=this.webkitShadowRoot,c=a.call(this);return c.olderShadowRoot=b,c.host=this,CustomElements.watchShadow(this),c},Object.defineProperties(HTMLElement.prototype,{shadowRoot:{get:function(){return this.webkitShadowRoot}},createShadowRoot:{value:function(){return this.webkitCreateShadowRoot()}}}),window.templateContent=function(a){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(a),!a.content&&!a._content){for(var b=document.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a._content=b}return a.content||a._content}}(),function(a){function b(a){for(var b=a||{},d=1;d",""," "," ShadowDOM Inspector"," "," "," ",'
    ',"
",'
'," ",""].join("\n"),d=[],e=function(){var a=b.document,c=a.querySelector("#crumbs");c.textContent="";for(var e,g=0;e=d[g];g++){var h=a.createElement("a");h.href="#",h.textContent=e.localName,h.idx=g,h.onclick=function(a){for(var b;d.length>this.idx;)b=d.pop();f(b.shadow||b,b),a.preventDefault()},c.appendChild(a.createElement("li")).appendChild(h)}},f=function(a,c){var f=b.document;k=[];var g=c||a;d.push(g),e(),f.body.querySelector("#tree").innerHTML="
"+j(a,a.childNodes)+"
"},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),h={STYLE:1,SCRIPT:1,"#comment":1,TEMPLATE:1},i=function(a){return h[a.nodeName]},j=function(a,b,c){if(i(a))return"";var d=c||"";if(a.localName||11==a.nodeType){var e=a.localName||"shadow-root",f=d+l(a);"content"==e&&(b=a.getDistributedNodes()),f+="
";var h=d+"  ";g(b,function(a){f+=j(a,a.childNodes,h)}),f+=d,{br:1}[e]||(f+="</"+e+">",f+="
")}else{var k=a.textContent.trim();f=k?d+'"'+k+'"'+"
":""}return f},k=[],l=function(a){var b="<",c=a.localName||"shadow-root";return a.webkitShadowRoot||a.shadowRoot?(b+=' ",k.push(a)):b+=c||"shadow-root",a.attributes&&g(a.attributes,function(a){b+=" "+a.name+(a.value?'="'+a.value+'"':"")}),b+=">"};shadowize=function(){var a=Number(this.attributes.idx.value),b=k[a];b?f(b.webkitShadowRoot||b.shadowRoot,b):(console.log("bad shadowize node"),console.dir(this))},a.output=j}(window.Inspector),function(a){"use strict";function b(){function a(a){"splice"===a[0].type&&"splice"===a[1].type&&(b=!0)}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=!1,c=[0];return Array.observe(c,a),c[1]=1,c.length=0,Object.deliverChangeRecords(a),b}function c(a){return+a===a>>>0}function d(a){return+a}function e(a){return a===Object(a)}function f(a,b){return a===b?0!==a||1/a===1/b:K(a)&&K(b)?!0:a!==a&&b!==b}function g(a){return"string"!=typeof a?!1:(a=a.replace(/\s/g,""),""==a?!0:"."==a[0]?!1:S.test(a))}function h(a){var b=T[a];if(b)return b;if(g(a)){var b=new i(a);return T[a]=b,b}}function i(a){return""==a.trim()?this:c(a)?(this.push(String(a)),this):(a.split(/\./).filter(function(a){return a}).forEach(function(a){this.push(a)},this),H&&this.length&&(this.getValueFrom=this.compiledGetValueFromFn()),void 0)}function j(a){for(var b=0;U>b&&a.check();)a.report(),b++}function k(a){for(var b in a)return!1;return!0}function l(a){return k(a.added)&&k(a.removed)&&k(a.changed)}function m(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function n(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function o(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,G){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}p(this),this.connect(),this.sync(!0)}function p(a){W&&(V.push(a),o._allObserversCount++)}function q(a,b,c,d){o.call(this,a,b,c,d)}function r(a,b,c,d){if(!Array.isArray(a))throw Error("Provided object is not an Array");o.call(this,a,b,c,d)}function s(a){this.arr=[],this.callback=a,this.isObserved=!0}function t(a,b,c,d,f){this.value=void 0;var g=h(b);return g?g.length?e(a)?(this.path=g,o.call(this,a,c,d,f),void 0):(this.closed=!0,this.value=void 0,void 0):(this.closed=!0,this.value=a,void 0):(this.closed=!0,this.value=void 0,void 0)}function u(a,b){if("function"==typeof Object.observe){var c=Object.getNotifier(a);return function(d,e){var f={object:a,type:d,name:b};2===arguments.length&&(f.oldValue=e),c.notify(f)}}}function v(a,b,c){for(var d={},e={},f=0;fj;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(d[e+j-1]===a[b+k-1])i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i}function x(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(ab):(e.push(bb),d=g),b--,c--):f==h?(e.push(db),b--,d=h):(e.push(cb),c--,d=i)}else e.push(db),b--;else e.push(cb),c--;return e.reverse(),e}function y(a,b,c){for(var d=0;c>d;d++)if(a[d]!==b[d])return d;return c}function z(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&a[--d]===b[--e];)f++;return f}function A(a,b,c){return{index:a,removed:b,addedCount:c}}function B(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=y(a,d,i)),c==a.length&&f==d.length&&(h=z(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,0==c-b&&0==f-e)return[];if(b==c){for(var j=A(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[A(b,[],c-b)];for(var k=x(w(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;ob||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function D(a,b,c,d){for(var e=A(b,c,d),f=!1,g=0,h=0;h=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.indexi.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.indexh)continue;D(e,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return e}function F(a,b){var c=[];return E(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?(b.removed[0]!==a[b.index]&&c.push(b),void 0):(c=c.concat(B(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)),void 0)}),c}var G=b(),H=!1;try{var I=new Function("","return true;");H=I()}catch(J){}var K=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},L="__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},M="[$_a-zA-Z]",N="[$_a-zA-Z0-9]",O=M+"+"+N+"*",P="(?:[0-9]|[1-9]+[0-9]+)",Q="(?:"+O+"|"+P+")",R="(?:"+Q+")(?:\\."+Q+")*",S=new RegExp("^"+R+"$"),T={};i.prototype=L({__proto__:[],toString:function(){return this.join(".")},getValueFrom:function(a){for(var b=0;ba&&b.anyChanged);o._allObserversCount=V.length,X=!1}}},W&&(a.Platform.clearObservers=function(){V=[]}),q.prototype=L({__proto__:o.prototype,connect:function(){G&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=n(this.object))},check:function(a){var b,c;if(G){if(!a)return!1;c={},b=v(this.object,a,c)}else c=this.oldObject,b=m(this.object,this.oldObject);return l(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){G?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}}),r.prototype=L({__proto__:q.prototype,connect:function(){G&&Array.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=this.object.slice())},check:function(a){var b;if(G){if(!a)return!1;b=F(this.object,a)}else b=B(this.object,0,this.object.length,this.oldObject,0,this.oldObject.length);return b&&b.length?(this.reportArgs=[b],!0):!1}}),r.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;ba&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}},t.prototype=L({__proto__:o.prototype,connect:function(){G&&(this.observedSet=new s(this.boundInternalCallback))},disconnect:function(){this.value=void 0,G&&(this.observedSet.reset(),this.observedSet.cleanup(),this.observedSet=void 0)},check:function(){return this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object),f(this.value,this.oldValue)?!1:(this.reportArgs=[this.value,this.oldValue],!0)},sync:function(a){a&&(this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object)),this.oldValue=this.value}}),t.getValueAtPath=function(a,b){var c=h(b);return c?c.getValueFrom(a):void 0},t.setValueAtPath=function(a,b,c){var d=h(b);d&&d.setValueFrom(a,c)};var _={"new":!0,updated:!0,deleted:!0};t.defineProperty=function(a,b,c){var d=c.object,e=h(c.path),f=u(a,b),g=new t(d,c.path,function(a,b){f&&f("updated",b)});return Object.defineProperty(a,b,{get:function(){return e.getValueFrom(d)},set:function(a){e.setValueFrom(d,a)},configurable:!0}),{close:function(){var c=e.getValueFrom(d);f&&g.deliver(),g.close(),Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}}};var ab=0,bb=1,cb=2,db=3;a.Observer=o,a.Observer.hasObjectObserve=G,a.ArrayObserver=r,a.ArrayObserver.calculateSplices=function(a,b){return B(a,0,a.length,b,0,b.length)},a.ObjectObserver=q,a.PathObserver=t,a.Path=i}("undefined"!=typeof global&&global?global: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 a.ownerDocument.contains(a)}function e(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.observer=new PathObserver(c,d,this.boundValueChanged,this),this.boundValueChanged(this.value)}function f(a,b,c,d){this.conditional="?"==b[b.length-1],this.conditional&&(a.removeAttribute(b),b=b.slice(0,-1)),e.call(this,a,b,c,d)}function g(a){switch(a.type){case"checkbox":return T;case"radio":case"select-multiple":case"select-one":return"change";default:return"input"}}function h(a,b,c,d){e.call(this,a,b,c,d),this.eventType=g(this.node),this.boundNodeValueToModel=this.nodeValueChanged.bind(this),this.node.addEventListener(this.eventType,this.boundNodeValueToModel,!0)}function i(a){if(!d(a))return[];if(a.form)return Q(a.form.elements,function(b){return b!=a&&"INPUT"==b.tagName&&"radio"==b.type&&b.name==a.name});var b=a.ownerDocument.querySelectorAll('input[type="radio"][name="'+a.name+'"]');return Q(b,function(b){return b!=a&&!b.form})}function j(a,b,c){h.call(this,a,"checked",b,c)}function k(a,b,c){h.call(this,a,"selectedIndex",b,c)}function l(a){return $[a.tagName]&&a.hasAttribute("template")}function m(a){return"TEMPLATE"==a.tagName||l(a)}function n(a){return _&&"TEMPLATE"==a.tagName}function o(a,b){var c=a.querySelectorAll(ab);m(a)&&b(a),P(c,b)}function p(a){function b(a){HTMLTemplateElement.decorate(a)||p(a.content)}o(a,b)}function q(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function r(a){if(!a.defaultView)return a;var b=eb.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);eb.set(a,b)}return b}function s(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];Z[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function t(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 u(a){"TEMPLATE"===a.tagName?_||(cb?a.__proto__=HTMLTemplateElement.prototype:q(a,HTMLTemplateElement.prototype)):(q(a,HTMLTemplateElement.prototype),Object.defineProperty(a,"content",ib))}function v(a){var b=lb.get(a);b||(b=function(){H(a,a.model,a.bindingDelegate)},lb.set(a,b)),bb(b)}function w(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.node.inputs.bind(this.property,c,d||"")}function x(a){return 3==a.length&&0==a[0].length&&0==a[2].length}function y(a){if(a&&a.length){for(var b,c=a.length,d=0,e=0,f=0;c>e;){if(d=a.indexOf("{{",e),f=0>d?-1:a.indexOf("}}",d+2),0>f){if(!b)return;b.push(a.slice(e));break}b=b||[],b.push(a.slice(e,d)),b.push(a.slice(d+2,f).trim()),e=f+2}return e===c&&b.push(""),b}}function z(a,b,c,d,e){var f,g=e&&e[X];return g&&"function"==typeof g&&(f=g(c,d,b,a),f&&(c=f,d="value")),a.bind(b,c,d)}function A(a,b,c,d,e){for(var f=0;fc?(this.keys.push(a),this.values.push(b)):this.values[c]=b},get:function(a){var b=this.keys.indexOf(a);return 0>b?void 0: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>>0)+(c++ +"__")},S.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),Node.prototype.bind=function(a,b,c){this.bindings=this.bindings||{};var d=this.bindings[a];return d&&d.close(),d=this.createBinding(a,b,c),this.bindings[a]=d,d?d:(console.error("Unhandled binding to Node: ",this,a,b,c),void 0)},Node.prototype.createBinding=function(){},Node.prototype.unbind=function(a){if(this.bindings){var b=this.bindings[a];b&&(b.close(),delete this.bindings[a])}},Node.prototype.unbindAll=function(){if(this.bindings){for(var a=Object.keys(this.bindings),b=0;be.node.length&&d--?bb(b):e.node[e.property]=c}var c=Number(a);if(c<=this.node.length)return this.node[this.property]=c,void 0;var d=2,e=this;bb(b)}}),HTMLSelectElement.prototype.createBinding=function(a,b,c){return"selectedindex"===a.toLowerCase()?(this.removeAttribute(a),new k(this,b,c)):HTMLElement.prototype.createBinding.call(this,a,b,c)};var U="bind",V="repeat",W="if",X="getBinding",Y="getInstanceModel",Z={template:!0,repeat:!0,bind:!0,ref:!0},$={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0,OPTGROUP:!0},_="undefined"!=typeof HTMLTemplateElement,ab="template, "+Object.keys($).map(function(a){return a.toLowerCase()+"[template]"}).join(", "),bb=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=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(;bb>ab&&d(_.charCodeAt(ab));)++ab}function j(){var a,b;for(a=ab++;bb>ab&&(b=_.charCodeAt(ab),g(b));)++ab;return _.slice(a,ab)}function k(){var a,b,c;return a=ab,b=j(),c=1===b.length?X.Identifier:h(b)?X.Keyword:"null"===b?X.NullLiteral:"true"===b||"false"===b?X.BooleanLiteral:X.Identifier,{type:c,value:b,range:[a,ab]}}function l(){var a,b,c,d,e=ab,f=_.charCodeAt(ab),g=_[ab];switch(f){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++ab,{type:X.Punctuator,value:String.fromCharCode(f),range:[e,ab]};default:if(a=_.charCodeAt(ab+1),61===a)switch(f){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:return ab+=2,{type:X.Punctuator,value:String.fromCharCode(f)+String.fromCharCode(a),range:[e,ab]};case 33:case 61:return ab+=2,61===_.charCodeAt(ab)&&++ab,{type:X.Punctuator,value:_.slice(e,ab),range:[e,ab]}}}return b=_[ab+1],c=_[ab+2],d=_[ab+3],">"===g&&">"===b&&">"===c&&"="===d?(ab+=4,{type:X.Punctuator,value:">>>=",range:[e,ab]}):">"===g&&">"===b&&">"===c?(ab+=3,{type:X.Punctuator,value:">>>",range:[e,ab]}):"<"===g&&"<"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:"<<=",range:[e,ab]}):">"===g&&">"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:">>=",range:[e,ab]}):g===b&&"+-<>&|".indexOf(g)>=0?(ab+=2,{type:X.Punctuator,value:g+b,range:[e,ab]}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ab,{type:X.Punctuator,value:g,range:[e,ab]}):(s({},$.UnexpectedToken,"ILLEGAL"),void 0)}function m(){var a,d,e;if(e=_[ab],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=ab,a="","."!==e){for(a=_[ab++],e=_[ab],"0"===a&&e&&c(e.charCodeAt(0))&&s({},$.UnexpectedToken,"ILLEGAL");c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("."===e){for(a+=_[ab++];c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("e"===e||"E"===e)if(a+=_[ab++],e=_[ab],("+"===e||"-"===e)&&(a+=_[ab++]),c(_.charCodeAt(ab)))for(;c(_.charCodeAt(ab));)a+=_[ab++];else s({},$.UnexpectedToken,"ILLEGAL");return f(_.charCodeAt(ab))&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.NumericLiteral,value:parseFloat(a),range:[d,ab]}}function n(){var a,c,d,f="",g=!1;for(a=_[ab],b("'"===a||'"'===a,"String literal must starts with a quote"),c=ab,++ab;bb>ab;){if(d=_[ab++],d===a){a="";break}if("\\"===d)if(d=_[ab++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===_[ab]&&++ab;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({},$.UnexpectedToken,"ILLEGAL"),{type:X.StringLiteral,value:f,octal:g,range:[c,ab]}}function o(a){return a.type===X.Identifier||a.type===X.Keyword||a.type===X.BooleanLiteral||a.type===X.NullLiteral}function p(){var a;return i(),ab>=bb?{type:X.EOF,range:[ab,ab]}:(a=_.charCodeAt(ab),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(_.charCodeAt(ab+1))?m():l():c(a)?m():l())}function q(){var a;return a=db,ab=a.range[1],db=p(),ab=a.range[1],a}function r(){var a;a=ab,db=p(),ab=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(cab&&(a.push(O()),!v(")"));)u(",");return u(")"),a}function F(){var a;return a=q(),o(a)||t(a),cb.createIdentifier(a.value)}function G(){return u("."),F()}function H(){var a;return u("["),a=P(),u("]"),a}function I(){var a,b,c;for(a=D();v(".")||v("[")||v("(");)v("(")?(b=E(),a=cb.createCallExpression(a,b)):v("[")?(c=H(),a=cb.createMemberExpression("[",a,c)):(c=G(),a=cb.createMemberExpression(".",a,c));return a}function J(){var a;return a=I(),db.type===X.Punctuator&&(v("++")||v("--"))&&s({},$.UnexpectedToken),a}function K(){var a,b;return db.type!==X.Punctuator&&db.type!==X.Keyword?b=J():v("++")||v("--")?s({},$.UnexpectedToken):v("+")||v("-")||v("~")||v("!")?(a=q(),b=K(),b=cb.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},$.UnexpectedToken):b=J(),b}function L(a,b){var c=0;if(a.type!==X.Punctuator&&a.type!==X.Keyword)return 0;switch(a.value){case"||":c=1;break;case"&&":c=2;break;case"|":c=3;break;case"^":c=4;break;case"&":c=5;break;case"==":case"!=":case"===":case"!==":c=6;break;case"<":case">":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function M(){var a,b,c,d,e,f,g,h,i;if(d=eb.allowIn,eb.allowIn=!0,h=K(),b=db,c=L(b,d),0===c)return h;for(b.prec=c,q(),f=K(),e=[h,b,f];(c=L(db,d))>0;){for(;e.length>2&&c<=e[e.length-2].prec;)f=e.pop(),g=e.pop().value,h=e.pop(),a=cb.createBinaryExpression(g,h,f),e.push(a);b=q(),b.prec=c,e.push(b),a=K(),e.push(a)}for(eb.allowIn=d,i=e.length-1,a=e[i];i>1;)a=cb.createBinaryExpression(e[i-1].value,e[i-2],a),i-=2;return a}function N(){var a,b,c,d;return a=M(),v("?")&&(q(),b=eb.allowIn,eb.allowIn=!0,c=O(),eb.allowIn=b,u(":"),d=O(),a=cb.createConditionalExpression(a,c,d)),a}function O(){var a,b,c;return a=db,c=b=N()}function P(){var a;return a=O()}function Q(){return u(";"),cb.createEmptyStatement()}function R(){var a=P();return x(),cb.createExpressionStatement(a)}function S(){var a,b,c,d=db.type;if(d===X.EOF&&t(db),i(),d===X.Punctuator)switch(db.value){case";":return Q();case"(":return R()}return a=P(),a.type===Z.Identifier&&v(":")?(q(),c="$"+a.name,Object.prototype.hasOwnProperty.call(eb.labelSet,c)&&s({},$.Redeclaration,"Label",a.name),eb.labelSet[c]=!0,b=S(),delete eb.labelSet[c],cb.createLabeledStatement(a,b)):(x(),cb.createExpressionStatement(a))}function T(){return db.type===X.Keyword?S():db.type!==X.EOF?S():void 0}function U(){for(var a,b=[];bb>ab&&(a=T(),"undefined"!=typeof a);)b.push(a);return b}function V(){var a;return i(),r(),a=U(),cb.createProgram(a)}function W(a,b){var c;return c=String,"string"==typeof a||a instanceof String||(a=c(a)),cb=b,_=a,ab=0,bb=_.length,db=null,eb={allowIn:!0,labelSet:{}},bb>0&&"undefined"==typeof _[0]&&a instanceof String&&(_=a.valueOf()),V()}var X,Y,Z,$,_,ab,bb,cb,db,eb;X={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},Y={},Y[X.BooleanLiteral]="Boolean",Y[X.EOF]="",Y[X.Identifier]="Identifier",Y[X.Keyword]="Keyword",Y[X.NullLiteral]="Null",Y[X.NumericLiteral]="Numeric",Y[X.Punctuator]="Punctuator",Y[X.StringLiteral]="String",Z={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"},$={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"},a.esprima={parse:W}}(this),function(a){"use strict";function b(a,b,d,e){if(e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.tagName&&("bind"===d||"repeat"===d)){var f,g,h=b.match(r);if(h?(f=h[1],g=h[2]):(h=b.match(s),h&&(f=h[2],g=h[1])),h){var i;if(g=g.trim(),g.match(q))i=new CompoundBinding(function(a){return a.path}),i.bind("path",a,g);else try{i=c(a,g)}catch(j){console.error("Invalid expression syntax: "+g,j)}if(i)return t.set(e,f),i}}}function c(a,b){try{var c=new f;if(esprima.parse(b,c),!c.statements.length&&!c.labeledStatements.length)return;if(!c.labeledStatements.length&&c.statements.length>1)throw Error("Multiple unlabelled statements are not allowed.");var e=c.labeledStatements.length?d(c.labeledStatements):e=c.statements[0],g=[];for(var h in c.deps)g.push(h);if(!g.length)return{value:e({})};for(var i=new CompoundBinding(e),j=0;j>>0)+(c++ +"__")},i.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var j="[$_a-zA-Z]",k="[$_a-zA-Z0-9]",l=j+"+"+k+"*",m="("+l+")",n="(?:[0-9]|[1-9]+[0-9]+)",o="(?:"+l+"|"+n+")",p="(?:"+o+")(?:\\."+o+")*",q=new RegExp("^"+p+"$"),r=new RegExp("^"+m+"\\s* in (.*)$"),s=new RegExp("^(.*) as \\s*"+m+"$"),t=new i;e.prototype={getPath:function(){return this.last?this.last.getPath()+"."+this.name:this.name},valueFn:function(){var a=this.getPath();return this.deps[a]=!0,function(b){return b[a]}}};var u={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},v={"+":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}};f.prototype={getFn:function(a){return a instanceof e?a.valueFn():a},createProgram:function(){},createExpressionStatement:function(a){return this.statements.push(a),a},createLabeledStatement:function(a,b){return this.labeledStatements.push({label:a.getPath(),body:b instanceof e?b.valueFn():b}),b},createUnaryExpression:function(a,b){if(!u[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),function(c){return u[a](b(c))}},createBinaryExpression:function(a,b,c){if(!v[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),c=this.getFn(c),function(d){return v[a](b(d),c(d))}},createConditionalExpression:function(a,b,c){return a=this.getFn(a),b=this.getFn(b),c=this.getFn(c),function(d){return a(d)?b(d):c(d)}},createIdentifier:function(a){var b=new e(this.deps,a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){return new e(this.deps,c.name,b)},createLiteral:function(a){return function(){return a.value}},createArrayExpression:function(a){for(var b=0;be;e++)d.unshift("..");var g=d.join("/");return g},resolvePathsInHTML:function(a,b){b=b||p.documentUrlFromNode(a),p.resolveAttributes(a,b),p.resolveStyleElts(a,b);var c=a.querySelectorAll("template");c&&q(c,function(a){a.content&&p.resolvePathsInHTML(a.content,b)})},resolvePathsInStylesheet:function(a){var b=p.nodeUrl(a);a.__resource=p.resolveCssText(a.__resource,b)},resolveStyleElts:function(a,b){var c=a.querySelectorAll("style");c&&q(c,function(a){a.textContent=p.resolveCssText(a.textContent,b)})},resolveCssText:function(a,b){return a.replace(/url\([^)]*\)/g,function(a){var c=a.replace(/["']/g,"").slice(4,-1);return c=p.resolveUrl(b,c,!0),"url("+c+")"})},resolveAttributes:function(a,b){var c=a&&a.querySelectorAll(n);c&&q(c,function(a){this.resolveNodeAttributes(a,b)},this)},resolveNodeAttributes:function(a,b){m.forEach(function(c){var d=a.attributes[c];if(d&&d.value&&d.value.search(o)<0){var e=p.resolveUrl(b,d.value,!0);d.value=e}})}};h=h||{async:!0,ok:function(a){return a.status>=200&&a.status<300||304===a.status||0===a.status},load:function(b,c,d){var e=new XMLHttpRequest;return(a.flags.debug||a.flags.bust)&&(b+="?"+Math.random()),e.open("GET",b,h.async),e.addEventListener("readystatechange",function(){4===e.readyState&&c.call(d,!h.ok(e)&&e,e.response,b)}),e.send(),e},loadDocument:function(a,b,c){this.load(a,b,c).responseType="document"}};var q=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.path=p,a.xhr=h,a.importer=k,a.getDocumentUrl=p.getDocumentUrl,a.IMPORT_LINK_TYPE=i}(window.HTMLImports),function(a){function b(a){return"link"===a.localName&&a.getAttribute("rel")===f}function c(a){return a.parentNode&&!d(a)&&!e(a)}function d(a){return a.ownerDocument===document||a.ownerDocument.impl===document}function e(a){return a.parentNode&&"element"===a.parentNode.localName}var f="import",g={selectors:["link[rel="+f+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(a){if(!a.__importParsed){a.__importParsed=!0;var b=a.querySelectorAll(g.selectors);h(b,function(a){g[g.map[a.localName]](a)})}},parseLink:function(a){b(a)?a.content&&g.parse(a.content):this.parseGeneric(a)},parseGeneric:function(a){c(a)&&document.head.appendChild(a)},parseScript:function(b){if(c(b)){var d=(b.__resource||b.textContent).trim();if(d){var e=b.__nodeUrl;if(!e){var e=a.path.documentUrlFromNode(b),f="["+Math.floor(1e3*(Math.random()+1))+"]",g=d.match(/Polymer\(['"]([^'"]*)/);f=g&&g[1]||f,e+="/"+f+".js"}d+="\n//# sourceURL="+e+"\n",eval.call(window,d)}}}},h=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.parser=g}(HTMLImports),function(){function a(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState?a():window.addEventListener("DOMContentLoaded",a)}(),function(a){function b(a){u.push(a),t||(t=!0,q(d))}function c(a){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(a)||a}function d(){t=!1;var a=u;u=[],a.sort(function(a,b){return a.uid_-b.uid_});var b=!1;a.forEach(function(a){var c=a.takeRecords();e(a),c.length&&(a.callback_(c,a),b=!0)}),b&&d()}function e(a){a.nodes_.forEach(function(b){var c=p.get(b);c&&c.forEach(function(b){b.observer===a&&b.removeTransientObservers()})})}function f(a,b){for(var c=a;c;c=c.parentNode){var d=p.get(c);if(d)for(var e=0;e0){var e=c[d-1],f=n(e,a);if(f)return c[d-1]=f,void 0}else b(this.observer);c[d]=a},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(a){var b=this.options;b.attributes&&a.addEventListener("DOMAttrModified",this,!0),b.characterData&&a.addEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.addEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(a){var b=this.options;b.attributes&&a.removeEventListener("DOMAttrModified",this,!0),b.characterData&&a.removeEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.removeEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(a){if(a!==this.target){this.addListeners_(a),this.transientObservedNodes.push(a);var b=p.get(a);b||p.set(a,b=[]),b.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[],a.forEach(function(a){this.removeListeners_(a);for(var b=p.get(a),c=0;c1?logFlags.dom&&console.warn("inserted:",a.localName,"insert/remove count:",a.__inserted):a.insertedCallback&&(logFlags.dom&&console.log("inserted:",a.localName),a.insertedCallback())),logFlags.dom&&console.groupEnd())}function k(a){l(a),d(a,function(a){l(a)})}function l(a){(a.removedCallback||a.__upgraded__&&logFlags.dom)&&(logFlags.dom&&console.log("removed:",a.localName),m(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?logFlags.dom&&console.warn("removed:",a.localName,"insert/remove count:",a.__inserted):a.removedCallback&&a.removedCallback()))}function m(a){for(var b=a;b;){if(b==a.ownerDocument)return!0;b=b.parentNode||b.host}}function n(a){if(a.webkitShadowRoot&&!a.webkitShadowRoot.__watched){logFlags.dom&&console.log("watching shadow-root for: ",a.localName);for(var b=a.webkitShadowRoot;b;)o(b),b=b.olderShadowRoot}}function o(a){a.__watched||(t(a),a.__watched=!0)}function p(a){n(a),d(a,function(){n(a)})}function q(a){switch(a.localName){case"style":case"script":case"template":case void 0:return!0 +}}function r(a){if(logFlags.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(x(a.addedNodes,function(a){q(a)||g(a)}),x(a.removedNodes,function(a){q(a)||k(a)}))}),logFlags.dom&&console.groupEnd()}function s(){r(w.takeRecords())}function t(a){w.observe(a,{childList:!0,subtree:!0})}function u(a){t(a)}function v(a){logFlags.dom&&console.group("upgradeDocument: ",(a.URL||a._URL||"").split("/").pop()),g(a),logFlags.dom&&console.groupEnd()}var w=new MutationObserver(r),x=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.watchShadow=n,a.watchAllShadows=p,a.upgradeAll=g,a.upgradeSubtree=f,a.observeDocument=u,a.upgradeDocument=v,a.takeRecords=s}(window.CustomElements),function(){function parseElementElement(a){var b={name:"","extends":null};takeAttributes(a,b);var c=HTMLElement.prototype;if(b.extends){var d=document.createElement(b.extends);c=d.__proto__||Object.getPrototypeOf(d)}b.prototype=Object.create(c),a.options=b;var e=a.querySelector('script:not([type]),script[type="text/javascript"],scripts');e&&executeComponentScript(e.textContent,a,b.name);var f=document.register(b.name,b);a.ctor=f;var g=a.getAttribute("constructor");g&&(window[g]=f)}function takeAttributes(a,b){for(var c in b){var d=a.attributes[c];d&&(b[c]=d.value)}}function executeComponentScript(inScript,inContext,inName){context=inContext;var owner=context.ownerDocument,url=owner._URL||owner.URL||owner.impl&&(owner.impl._URL||owner.impl.URL),match=url.match(/.*\/([^.]*)[.]?.*$/);if(match){var name=match[1];url+=name!=inName?":"+inName:""}var code="__componentScript('"+inName+"', function(){"+inScript+"});"+"\n//# sourceURL="+url+"\n";eval(code)}function mixin(a,b){a=a||{};try{Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)})}catch(c){}return a}var HTMLElementElement=function(a){return a.register=HTMLElementElement.prototype.register,parseElementElement(a),a};HTMLElementElement.prototype={register:function(a){a&&(this.options.lifecycle=a.lifecycle,a.prototype&&mixin(this.options.prototype,a.prototype))}};var context;window.__componentScript=function(a,b){b.call(context)},window.HTMLElementElement=HTMLElementElement}(),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+"]","element"],map:{link:"parseLink",element:"parseElement"},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)},parseElement:function(a){new HTMLElementElement(a)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=c}(),function(){function a(){setTimeout(function(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))},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();else{var b=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(b,a)}}(),function(){function a(){}var b=document.createElement("style");b.textContent="element {display: none !important;} /* injected by platform.js */";var c=document.querySelector("head");if(c.insertBefore(b,c.firstChild),window.ShadowDOMPolyfill){CustomElements.watchShadow=a,CustomElements.watchAllShadows=a;var d=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],e={};d.forEach(function(a){e[a]=CustomElements[a]}),d.forEach(function(a){CustomElements[a]=function(b){return e[a](wrap(b))}})}}(),function(a){a=a||{};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(document,b,c)}};a.targetFinding=b,a.findTarget=b.findTarget.bind(b),window.PointerEventsPolyfill=a}(window.PointerEventsPolyfill),function(){function a(a){return'[touch-action="'+a+'"]'}function b(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; }"}var c=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],d="";c.forEach(function(c){d+=String(c)===c?a(c)+b(c):c.selectors.map(a)+b(c.rule)});var e=document.createElement("style");e.textContent=d;var f=document.querySelector("head");f.insertBefore(e,f.firstChild)}(),function(a){function b(a,b){var b=b||{},e=b.buttons;if(void 0===e)switch(b.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}var f;if(c)f=new MouseEvent(a,b);else{f=document.createEvent("MouseEvent");var g={bubbles:!1,cancelable:!1,view:null,detail:null,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};Object.keys(g).forEach(function(a){a in b&&(g[a]=b[a])}),f.initMouseEvent(a,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)}d||Object.defineProperty(f,"buttons",{get:function(){return e},enumerable:!0});var h=0;return h=b.pressure?b.pressure:e?.5:0,Object.defineProperties(f,{pointerId:{value:b.pointerId||0,enumerable:!0},width:{value:b.width||0,enumerable:!0},height:{value:b.height||0,enumerable:!0},pressure:{value:h,enumerable:!0},tiltX:{value:b.tiltX||0,enumerable:!0},tiltY:{value:b.tiltY||0,enumerable:!0},pointerType:{value:b.pointerType||"",enumerable:!0},hwTimestamp:{value:b.hwTimestamp||0,enumerable:!0},isPrimary:{value:b.isPrimary||!1,enumerable:!0}}),f}var c=!1,d=!1;try{var e=new MouseEvent("click",{buttons:1});c=!0,d=1===e.buttons}catch(f){}a.PointerEvent||(a.PointerEvent=b)}(window),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},forEach:function(a,b){this.ids.forEach(function(c,d){a.call(b,c,this.pointers[d],this)},this)}},a.PointerMap=window.Map&&Map.prototype.forEach?Map:b}(window.PointerEventsPolyfill),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerEventsPolyfill),function(a){var b={targets:new a.SideTable,handledEvents:new a.SideTable,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)},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){a.target.contains(a.relatedTarget)||this.leave(a),this.out(a)},enterOver:function(a){a.target.contains(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:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){var c=new PointerEvent(a,b);return 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){var b={};for(var c in a)b[c]=a[c];return b},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:function(a){var b=this.getTarget(a);return b?b.dispatchEvent(a):void 0},asyncDispatchEvent:function(a){setTimeout(this.dispatchEvent.bind(this,a),0)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=b.register.bind(b),a.unregister=b.unregister.bind(b)}(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);return 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 a.SideTable,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){null===this.firstTouch&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryTouch:function(a){this.isPrimaryTouch(a)&&(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(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.size>=b.length){var c=[];f.forEach(function(a,d){if(1!==a&&!this.findTouch(b,a-2)){var e=d.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.removePrimaryTouch(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)}),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){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(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={handledEvents:new a.SideTable,targets:new a.SideTable,handlers:{},recognizers:{},events:["pointerdown","pointermove","pointerup","pointerover","pointerout","pointercancel"],registerRecognizer:function(a,b){var c=b;this.recognizers[a]=c,this.events.forEach(function(a){if(c[a]){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(this.events,a)},unregisterTarget:function(a){this.unlisten(this.events,a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b,c=a.type;(b=this.handlers[c])&&this.makeQueue(b,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){var b={};for(var c in a)b[c]=a[c];return b},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)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=function(b){var c=window.PointerEventsPolyfill;c&&c.register(b),a.dispatcher.registerTarget(b)},b.registerTarget(document)}(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,pointerType:c.pointerType};"trackend"===a&&(h._releaseTarget=c.target);var 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"],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)},preventTap:function(a){c.delete(a)}};b.registerRecognizer("tap",d)}(window.PointerGestures),Polymer={},function(){var a=document.createElement("style");a.textContent="body {opacity: 0;}";var b=document.querySelector("head");b.insertBefore(a,b.firstChild),window.addEventListener("WebComponentsReady",function(){document.body.style.webkitTransition="opacity 0.3s",document.body.style.opacity=1})}(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&&(a[c].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;"_super"in c||(g||(g=e.call(this,c)),g||console.warn("called super() on a method not installed declaratively (has no .nom property)"),d(c,g,f(this)));var h=c._super;if(h){var i=h[g];return"_super"in i||d(i,g,h),i.apply(this,a||[])}}function c(a,b,c){for(;a&&(!a.hasOwnProperty(b)||a[b]===c);)a=f(a);return 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){console.warn("nameInThis called");for(var b=this;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(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}}};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?!1:!0,detail:b})),b},asyncFire:function(){this.asyncMethod("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,b){b.cancelBubble||(b.on=i+b.type,h.events&&console.group("[%s]: listenLocal [%s]",a.localName,b.on),!b.path||window.ShadowDOMPolyfill?d(a,b):c(a,b),h.events&&console.groupEnd())}function c(a,b){var c=null;Array.prototype.some.call(b.path,function(d){return d===a?!0:(c=c===a?c:e(d),c&&f(c,d,b)?!0:void 0)},this)}function d(a,b){h.events&&console.log("event.path() not supported for",b.type);for(var c=b.target,d=null;c&&c!=a;){if(d=d===a?d:e(c),d&&f(d,c,b))return!0;c=c.parentNode}}function e(a){for(;a.parentNode;)a=a.parentNode;return a.host}function f(a,b,c){var d=b.getAttribute&&b.getAttribute(c.on);return d&&g(b,c)&&(h.events&&console.log("[%s] found handler name [%s]",a.localName,d),a.dispatchMethod(b,d,[c,c.detail,b])),c.cancelBubble}function g(a,b){var c=l.get(b);return c||l.set(b,c=[]),c.indexOf(a)<0?(c.push(a),!0):void 0}var h=window.logFlags||{},i="on-",j="eventDelegates",k={EVENT_PREFIX:i,DELEGATES:j,addHostListeners:function(){var a=this[j];h.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a),this.addNodeListeners(this,a,this.hostEventListener)},addInstanceListeners:function(a,b){var c=b.delegates;c&&(h.events&&Object.keys(c).length>0&&console.log("[%s:root] addInstanceListeners:",this.localName,c),this.addNodeListeners(a,c,this.instanceEventListener))},addNodeListeners:function(a,b,c){var d;for(var e in b)d||(d=c.bind(this)),a.addEventListener(e,d)},hostEventListener:function(a){if(!a.cancelBubble){h.events&&console.group("[%s]: hostEventListener(%s)",this.localName,a.type);var b=this.findEventDelegate(a);b&&(h.events&&console.log("[%s] found host handler name [%s]",this.localName,b),this.dispatchMethod(this,b,[a,a.detail,this])),h.events&&console.groupEnd()}},findEventDelegate:function(a){return this[j][a.type]},dispatchMethod:function(a,b,c){if(a){h.events&&console.group("[%s] dispatch [%s]",a.localName,b);var d=this[b];d&&d[c?"apply":"call"](this,c),h.events&&console.groupEnd()}},instanceEventListener:function(a){b(this,a)}},l=new SideTable("handledList");a.api.instance.events=k}(Polymer),function(a){var b="__published",c="__instance_attributes",d={PUBLISHED:b,INSTANCE_ATTRIBUTES:c,copyInstanceAttributes:function(){var a=this[c];for(var b in a)this.setAttribute(b,a[b])},takeAttributes:function(){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.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var c=Object.keys(this[b]);return c[c.map(e).indexOf(a.toLowerCase())]},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a){return"object"!=typeof a&&void 0!==a?a:void 0},propertyToAttribute:function(a){if(Object.keys(this[b]).indexOf(a)>=0){var c=this.serializeValue(this[a]);void 0!==c&&this.setAttribute(a,c)}}},e=String.prototype.toLowerCase.call.bind(String.prototype.toLowerCase);a.api.instance.attributes=d}(Polymer),function(a){function b(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)}function c(a,b,c,d){h.bind&&console.log(o,c.localName||"object",d,a.localName,b);var e=PathObserver.getValueAtPath(c,d);return(null===e||void 0===e)&&PathObserver.setValueAtPath(c,d,a[b]),PathObserver.defineProperty(a,b,{object:c,path:d})}function d(a,b,c){var d=g(a);d[b]=c}function e(a,b){var c=g(a);return c&&c[b]?(c[b].close(),c[b]=null,!0):void 0}function f(a){var b=g(a);Object.keys(b).forEach(function(a){b[a].close(),b[a]=null})}function g(a){var b=l.get(a);return b||l.set(a,b={}),b}var h=window.logFlags||{},i="Changed",j=a.api.instance.attributes.PUBLISHED,k={observeProperties:function(){for(var a,b=this.getCustomPropertyNames(),c=0,d=b.length;d>c&&(a=b[c]);c++)this.observeProperty(a)},getCustomPropertyNames:function(){return this.customPropertyNames},observeProperty:function(a){if(this.shouldObserveProperty(a)){h.watch&&console.log(m,this.localName,a);var b=function(b,c){h.watch&&console.log(n,this.localName,this.id||"",a,this[a],c),this.dispatchPropertyChange(a,c)}.bind(this),c=new PathObserver(this,a,b);d(this,a,c)}},bindProperty:function(a,b,d){return c(this,a,b,d)},unbindProperty:function(a,b){return e(this,a,b)},unbindAllProperties:function(){f(this)},shouldObserveProperty:function(a){return Boolean(this[a+i]||Object.keys(this[j]).indexOf(a)>=0)},dispatchPropertyChange:function(a,c){this.propertyToAttribute(a),b.call(this,a+i,[c])}},l=new SideTable,m="[%s] watching [%s]",n="[%s#%s] watch: [%s] now [%s] was [%s]",o="[%s]: bindProperties: [%s] to [%s].[%s]";a.api.instance.properties=k}(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=new ExpressionSyntax,g={instanceTemplate:function(a){return a.createInstance(this,f)},createBinding:function(a,b,c){var d=this.propertyForAttribute(a);if(d){var e=this.bindProperty(d,b,c);return e.path=c,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(){this._unbound||(this.unbindAllProperties(),this.super(),b(this.shadowRoot),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)}},h=/\{\{([^{}]*)}}/;a.bindPattern=h,a.api.instance.mdv=g}(Polymer),function(a){function b(a){return a.hasOwnProperty("PolymerBase")}function c(){}var d={PolymerBase:!0,job:Polymer.job,"super":Polymer.super,ready:function(){},readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){this.observeProperties(),this.copyInstanceAttributes(),this.takeAttributes(),this.addHostListeners(),this.parseElements(this.__proto__),this.ready()},insertedCallback:function(){this._enteredDocumentCallback()},enteredDocumentCallback:function(){this._enteredDocumentCallback()},_enteredDocumentCallback:function(){this.cancelUnbindAll(!0),this.inserted&&this.inserted(),this.enteredDocument&&this.enteredDocument()},removedCallback:function(){this._leftDocumentCallback()},leftDocumentCallback:function(){this._leftDocumentCallback()},_leftDocumentCallback:function(){this.asyncUnbindAll(),this.removed&&this.removed(),this.leftDocument&&this.leftDocument()},parseElements:function(a){a&&a.element&&(this.parseElements(a.__proto__),a.parseElement.call(this,a.element))},parseElement:function(a){this.shadowFromTemplate(this.fetchTemplate(a))},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemplate:function(a){if(a){this.shadowRoot;var b=this.createShadowRoot();b.applyAuthorStyles=this.applyAuthorStyles,b.resetStyleInheritance=this.resetStyleInheritance;var c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady(b,a),b}},shadowRootReady:function(a,b){this.marshalNodeReferences(a),this.addInstanceListeners(a,b),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){this.attributeToProperty(a,this.getAttribute(a)),this.attributeChanged&&this.attributeChanged.apply(this,arguments)}};c.prototype=d,d.constructor=c,a.Base=c,a.isBase=b,a.api.instance.base=d}(Polymer),function(a){function b(a){return a.__proto__}window.logFlags||{};var c="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);window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimPolyfillDirectives([f],this.localName),Polymer.applyStyleToScope(f,a)}}},scopeHasElementStyle:function(a,b){var d=c+"="+this.localName+"-"+b;return a.querySelector("style["+d+"]")},findStyleController:function(){if(window.ShadowDOMPolyfill)return wrap(document.head);for(var a=this;a.parentNode;)a=a.parentNode;return a===document?document.head:a}};a.api.instance.styles=e}(Polymer),function(a){var b={addResolvePathApi:function(){var a=this.elementPath();this.prototype.resolvePath=function(b){return a+b}},elementPath:function(){return this.urlToPath(HTMLImports.getDocumentUrl(this.ownerDocument))},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}window.logFlags||{};var f=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.installLocalSheets(),this.installGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(i),this.sheets.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 i=this.findNodes(h,f);return i.forEach(function(a){a.parentNode.removeChild(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){function b(a){return a.slice(0,k)==g}function c(a){return a.slice(k)}function d(a){return a.ref?a.ref.content:a.content}var e=a.api.instance.events,f=e.DELEGATES,g=e.EVENT_PREFIX,h=window.logFlags||{},i={inheritDelegates:function(a){this.inheritObject(a,f)},parseHostEvents:function(){var a=this.prototype[f];this.addAttributeDelegates(a)},addAttributeDelegates:function(a){for(var d,e=0;d=this.attributes[e];e++)b(d.name)&&(a[c(d.name)]=d.value)},parseLocalEvents:function(){this.querySelectorAll("template").forEach(function(a){a.delegates={},this.accumulateTemplatedEvents(a,a.delegates),h.events&&console.log("[%s] parseLocalEvents:",this.attributes.name.value,a.delegates)},this)},accumulateTemplatedEvents:function(a,b){if("template"===a.localName){var c=d(a);c&&this.accumulateChildEvents(c,b)}},accumulateChildEvents:function(a,b){a.childNodes.forEach(function(a){this.accumulateEvents(a,b)},this)},accumulateEvents:function(a,b){return this.accumulateAttributeEvents(a,b),this.accumulateChildEvents(a,b),this.accumulateTemplatedEvents(a,b),b},accumulateAttributeEvents:function(a,d){a.attributes&&a.attributes.forEach(function(a){b(a.name)&&this.accumulateEvent(c(a.name),d)},this)},accumulateEvent:function(a,b){a=j[a]||a,b[a]=b[a]||1}},j={webkitanimationstart:"webkitAnimationStart",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitionEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"},k=g.length;i.event_translations=j,a.api.declaration.events=i}(Polymer),function(a){var b=[],c={cacheProperties:function(){this.prototype.customPropertyNames=this.getCustomPropertyNames(this.prototype)},getCustomPropertyNames:function(c){for(var d,e={};c&&!a.isBase(c);){for(var f,g=Object.getOwnPropertyNames(c),h=0,i=g.length;i>h&&(f=g[h]);h++)e[f]=!0,d=!0;c=c.__proto__}return d?Object.keys(e):b}};a.api.declaration.properties=c}(Polymer),function(a){var b=a.api.instance.attributes,c=b.PUBLISHED,d=b.INSTANCE_ATTRIBUTES,e="publish",f="attributes",g={inheritAttributesObjects:function(a){this.inheritObject(a,c),this.inheritObject(a,d)},parseAttributes:function(){this.publishAttributes(this.prototype),this.publishProperties(this.prototype),this.accumulateInstanceAttributes()},publishAttributes:function(a){var b=a[c],d=this.getAttribute(f);if(d){var e=d.split(d.indexOf(",")>=0?",":" ");e.forEach(function(a){a=a.trim(),!a||a in b||(b[a]=null)})}Object.keys(b).forEach(function(c){c in a||(a[c]=b[c])})},publishProperties:function(a){this.publishPublish(a)},publishPublish:function(a){if(a.hasOwnProperty(e)){var b=a[e];b&&(Object.keys(b).forEach(function(c){a[c]=b[c]}),Platform.mixin(a[c],b))}},accumulateInstanceAttributes:function(){var a=this.prototype[d];this.attributes.forEach(function(b){this.isInstanceAttribute(b.name)&&(a[b.name]=b.value)},this)},isInstanceAttribute:function(a){return!this.blackList[a]&&"on-"!==a.slice(0,3)},blackList:{name:1,"extends":1,constructor:1,noscript:1}};g.blackList[f]=1,a.api.declaration.attributes=g}(Polymer),function(a){function b(a,b){h[a]=b||{},g[a]&&g[a].define()}function c(a){return Object.create(HTMLElement.getPrototypeForTag(a))}function d(b){if(!Object.__proto__){var c=Object.getPrototypeOf(b);b.__proto__=c,a.isBase(c)&&(c.__proto__=Object.getPrototypeOf(c))}}var e=Polymer.extend,f=a.api.declaration,g={},h={},i=c();e(i,{readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){var a=this.getAttribute("name");h[a]?this.define():g[a]=this},define:function(){var a=this.getAttribute("name"),b=this.getAttribute("extends");this.prototype=this.generateCustomPrototype(a,b),this.prototype.element=this,this.addResolvePathApi(),d(this.prototype),this.desugar(),window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimStyling(this.templateContent(),a,b),this.register(a),this.publishConstructor()},desugar:function(){this.parseAttributes(),this.parseHostEvents(),this.parseLocalEvents(),this.installSheets(),this.prototype.registerCallback&&this.prototype.registerCallback(this),this.cacheProperties()},generateCustomPrototype:function(a,b){var c=this.generateBasePrototype(b);return this.addNamedApi(c,a)},generateBasePrototype:function(a){var b=c(a);return this.ensureBaseApi(b)},ensureBaseApi:function(b){return b.PolymerBase||(Object.keys(a.api.instance).forEach(function(c){e(b,a.api.instance[c])}),b=Object.create(b)),this.inheritAttributesObjects(b),this.inheritDelegates(b),b},addNamedApi:function(a,b){return e(a,h[b])},inheritObject:function(a,b){a[b]=e({},Object.getPrototypeOf(a)[b])},register:function(a){this.ctor=document.register(a,{prototype:this.prototype}),this.prototype.constructor=this.ctor,HTMLElement.register(a,this.prototype)},publishConstructor:function(){var a=this.getAttribute("constructor");a&&(window[a]=this.ctor)}}),Object.keys(f).forEach(function(a){e(i,f[a])}),document.register("polymer-element",{prototype:i}),e(b,window.Polymer),window.Polymer=b}(Polymer),Polymer.register=function(a){if(a!=window){var b=a.getAttribute("name");throw new Error("Polymer.register is deprecated in declaration of "+b+". Please see http://www.polymer-project.org/getting-started.html")}}; +/* +//@ sourceMappingURL=polymer.native.min.js.map +*/ \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js b/architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js new file mode 100644 index 0000000000..387e843dc8 --- /dev/null +++ b/architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js @@ -0,0 +1,35 @@ +// 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. +function PointerGestureEvent(a,b){var c=b||{},d=document.createEvent("Event"),e={bubbles:!0,cancelable:!0};return Object.keys(e).forEach(function(a){a in c&&(e[a]=c[a])}),d.initEvent(a,e.bubbles,e.cancelable),Object.keys(c).forEach(function(a){d[a]=b[a]}),d.preventTap=this.preventTap,d}if(window.Platform=window.Platform||{},window.logFlags=window.logFlags||{},function(a){var b=a.flags||{};location.search.slice(1).split("&").forEach(function(a){a=a.split("="),a[0]&&(b[a[0]]=a[1]||!0)}),b.shadow=(b.shadowdom||b.shadow||b.polyfill||!HTMLElement.prototype.webkitCreateShadowRoot)&&"polyfill",a.flags=b}(Platform),"polyfill"===Platform.flags.shadow){var SideTable;"undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var ShadowDOMPolyfill={};!function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function d(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){switch(c){case"arguments":case"caller":case"length":case"name":case"prototype":case"toString":return}Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function e(a){var b=a.__proto__||Object.getPrototypeOf(a),c=z.get(b);if(c)return c;var d=e(b),f=n(d);return k(b,f,a),f}function f(a,b){i(a,b,!0)}function g(a,b){i(b,a,!1)}function h(a){return/^on[a-z]+$/.test(a)}function i(b,c,d){Object.getOwnPropertyNames(b).forEach(function(e){if(!(e in c)){B&&b.__lookupGetter__(e);var f;try{f=Object.getOwnPropertyDescriptor(b,e)}catch(g){f=C}var i,j;if(d&&"function"==typeof f.value)return c[e]=function(){return this.impl[e].apply(this.impl,arguments)},void 0;var k=h(e);i=k?a.getEventHandlerGetter(e):function(){return this.impl[e]},(f.writable||f.set)&&(j=k?a.getEventHandlerSetter(e):function(a){this.impl[e]=a}),Object.defineProperty(c,e,{get:i,set:j,configurable:f.configurable,enumerable:f.enumerable})}})}function j(a,b,c){var e=a.prototype;k(e,b,c),d(b,a)}function k(a,c,d){var e=c.prototype;b(void 0===z.get(a)),z.set(a,c),f(a,e),d&&g(e,d)}function l(a,b){return z.get(b.prototype)===a}function m(a){var b=Object.getPrototypeOf(a),c=e(b),d=n(c);return k(b,d,a),d}function n(a){function b(b){a.call(this,b)}return b.prototype=Object.create(a.prototype),b.prototype.constructor=b,b}function o(a){return a instanceof A.EventTarget||a instanceof A.Event||a instanceof A.DOMImplementation}function p(a){return a instanceof F||a instanceof E||a instanceof G||a instanceof D}function q(a){if(null===a)return null;b(p(a));var c=y.get(a);if(!c){var d=e(a);c=new d(a),y.set(a,c)}return c}function r(a){return null===a?null:(b(o(a)),a.impl)}function s(a){return a&&o(a)?r(a):a}function t(a){return a&&!o(a)?q(a):a}function u(a,c){null!==c&&(b(p(a)),b(void 0===c||o(c)),y.set(a,c))}function v(a,b,c){Object.defineProperty(a.prototype,b,{get:c,configurable:!0,enumerable:!0})}function w(a,b){v(a,b,function(){return q(this.impl[b])})}function x(a,b){a.forEach(function(a){b.forEach(function(b){a.prototype[b]=function(){var a=q(this);return a[b].apply(a,arguments)}})})}var y=new SideTable,z=new SideTable,A=Object.create(null);Object.getOwnPropertyNames(window);var B=/Firefox/.test(navigator.userAgent),C={get:function(){},set:function(){},configurable:!0,enumerable:!0},D=DOMImplementation,E=Event,F=Node,G=Window;a.assert=b,a.defineGetter=v,a.defineWrapGetter=w,a.forwardMethodsToWrapper=x,a.isWrapperFor=l,a.mixin=c,a.registerObject=m,a.registerWrapper=j,a.rewrap=u,a.unwrap=r,a.unwrapIfNeeded=s,a.wrap=q,a.wrapIfNeeded=t,a.wrappers=A}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){return a instanceof N.ShadowRoot}function c(a){var b=a.localName;return"content"===b||"shadow"===b}function d(a){return!!a.shadowRoot}function e(a){var b;return a.parentNode||(b=a.defaultView)&&M(b)||null}function f(f,g,h){if(h.length)return h.shift();if(b(f))return j(f)||a.getHostForShadowRoot(f);var i=a.eventParentsTable.get(f);if(i){for(var k=1;k=0;b--)if(!c(a[b]))return a[b];return null}function i(d,e){for(var g=[];d;){for(var i=[],j=e,l=void 0;j;){var n=null;if(i.length){if(c(j)&&(n=h(i),k(l))){var o=i[i.length-1];i.push(o)}}else i.push(j);if(m(j,d))return i[i.length-1];b(j)&&i.pop(),l=j,j=f(j,n,g)}d=b(d)?a.getHostForShadowRoot(d):d.parentNode}}function j(b){return a.insertionParentTable.get(b)}function k(a){return j(a)}function l(a){for(var b;b=a.parentNode;)a=b;return a}function m(a,b){return l(a)===l(b)}function n(b,c){if(b===c)return!0;if(b instanceof N.ShadowRoot){var d=a.getHostForShadowRoot(b);return d?n(l(d),c):!1}return!1}function o(a){switch(a){case"DOMAttrModified":case"DOMAttributeNameChanged":case"DOMCharacterDataModified":case"DOMElementNameChanged":case"DOMNodeInserted":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":return!0}return!1}function p(b){if(!P.get(b)){P.set(b,!0),o(b.type)||a.renderAllPending();var c=M(b.target),d=M(b);return q(d,c)}}function q(a,b){var c=g(b);return"load"===a.type&&2===c.length&&c[0].target instanceof N.Document&&c.shift(),X.set(a,c),r(a,c)&&s(a,c)&&t(a,c),T.set(a,w.NONE),R.set(a,null),a.defaultPrevented}function r(a,b){for(var c,d=b.length-1;d>0;d--){var e=b[d].target,f=b[d].currentTarget;if(e!==f&&(c=w.CAPTURING_PHASE,!u(b[d],a,c)))return!1}return!0}function s(a,b){var c=w.AT_TARGET;return u(b[0],a,c)}function t(a,b){for(var c,d=a.bubbles,e=1;e=f;f++){var g=b[f].currentTarget,h=l(g);n(e,h)&&(f!==d||g instanceof N.Node)&&(a[c++]=g)}a.length=c}return a},stopPropagation:function(){U.set(this,!0)},stopImmediatePropagation:function(){U.set(this,!0),V.set(this,!0)}},K(Y,w,document.createEvent("Event"));var Z=y("UIEvent",w),$=y("CustomEvent",w),_={get relatedTarget(){return S.get(this)||M(L(this).relatedTarget)}},ab=J({initMouseEvent:z("initMouseEvent",14)},_),bb=J({initFocusEvent:z("initFocusEvent",5)},_),cb=y("MouseEvent",Z,ab),db=y("FocusEvent",Z,bb),eb=y("MutationEvent",w,{initMutationEvent:z("initMutationEvent",3),get relatedNode(){return M(this.impl.relatedNode)}}),fb=Object.create(null),gb=function(){try{new window.MouseEvent("click")}catch(a){return!1}return!0}();if(!gb){var hb=function(a,b,c){if(c){var d=fb[c];b=J(J({},d),b)}fb[a]=b};hb("Event",{bubbles:!1,cancelable:!1}),hb("CustomEvent",{detail:null},"Event"),hb("UIEvent",{view:null,detail:0},"Event"),hb("MouseEvent",{screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},"UIEvent"),hb("FocusEvent",{relatedTarget:null},"UIEvent")}var ib=window.EventTarget,jb=["addEventListener","removeEventListener","dispatchEvent"];[Node,Window].forEach(function(a){var b=a.prototype;jb.forEach(function(a){Object.defineProperty(b,a+"_",{value:b[a]})})}),C.prototype={addEventListener:function(a,b,c){if(B(b)){var d=new v(a,b,c),e=O.get(this);if(e){for(var f=0;fd;d++)b[d]=f(a[d]);return b.length=e,b}function e(a,b){a.prototype[b]=function(){return d(this.impl[b].apply(this.impl,arguments))}}var f=a.wrap;c.prototype={item:function(a){return this[a]}},b(c.prototype,"item"),a.wrappers.NodeList=c,a.addWrapNodeListMethod=e,a.wrapNodeList=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){j(a instanceof f)}function c(a,b,c,d){if(a.nodeType!==f.DOCUMENT_FRAGMENT_NODE)return a.parentNode&&a.parentNode.removeChild(a),a.parentNode_=b,a.previousSibling_=c,a.nextSibling_=d,c&&(c.nextSibling_=a),d&&(d.previousSibling_=a),[a];for(var e,g=[];e=a.firstChild;)a.removeChild(e),g.push(e),e.parentNode_=b;for(var h=0;he;e++)d.appendChild(m(b[e]));return d}function e(a){for(var b=a.firstChild;b;){j(b.parentNode===a);var c=b.nextSibling,d=m(b),e=d.parentNode;e&&s.call(e,d),b.previousSibling_=b.nextSibling_=b.parentNode_=null,b=c}a.firstChild_=a.lastChild_=null}function f(a){j(a instanceof o),g.call(this,a),this.parentNode_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_=void 0}var g=a.wrappers.EventTarget,h=a.wrappers.NodeList,i=a.defineWrapGetter,j=a.assert,k=a.mixin,l=a.registerWrapper,m=a.unwrap,n=a.wrap,o=window.Node,p=o.prototype.appendChild,q=o.prototype.insertBefore,r=o.prototype.replaceChild,s=o.prototype.removeChild,t=o.prototype.compareDocumentPosition;f.prototype=Object.create(g.prototype),k(f.prototype,{appendChild:function(a){b(a),this.invalidateShadowRenderer();var e=this.lastChild,f=null,g=c(a,this,e,f);return this.lastChild_=g[g.length-1],e||(this.firstChild_=g[0]),p.call(this.impl,d(this,g)),a},insertBefore:function(a,e){if(!e)return this.appendChild(a);b(a),b(e),j(e.parentNode===this),this.invalidateShadowRenderer();var f=e.previousSibling,g=e,h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]);var i=m(e),k=i.parentNode;return k&&q.call(k,d(this,h),i),a},removeChild:function(a){if(b(a),a.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var c=this.firstChild,d=this.lastChild,e=a.nextSibling,f=a.previousSibling,g=m(a),h=g.parentNode;return h&&s.call(h,g),c===a&&(this.firstChild_=e),d===a&&(this.lastChild_=f),f&&(f.nextSibling_=e),e&&(e.previousSibling_=f),a.previousSibling_=a.nextSibling_=a.parentNode_=null,a},replaceChild:function(a,e){if(b(a),b(e),e.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var f=e.previousSibling,g=e.nextSibling;g===a&&(g=a.nextSibling);var h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]),this.lastChild===e&&(this.lastChild_=h[h.length-1]),e.previousSibling_=null,e.nextSibling_=null,e.parentNode_=null;var i=m(e);return i.parentNode&&r.call(i.parentNode,d(this,h),i),e},hasChildNodes:function(){return null===this.firstChild},get parentNode(){return void 0!==this.parentNode_?this.parentNode_:n(this.impl.parentNode)},get firstChild(){return void 0!==this.firstChild_?this.firstChild_:n(this.impl.firstChild)},get lastChild(){return void 0!==this.lastChild_?this.lastChild_:n(this.impl.lastChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_:n(this.impl.nextSibling)},get previousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:n(this.impl.previousSibling)},get parentElement(){for(var a=this.parentNode;a&&a.nodeType!==f.ELEMENT_NODE;)a=a.parentNode;return a},get textContent(){for(var a="",b=this.firstChild;b;b=b.nextSibling)a+=b.textContent;return a},set textContent(a){if(e(this),this.invalidateShadowRenderer(),""!==a){var b=this.impl.ownerDocument.createTextNode(a);this.appendChild(b)}},get childNodes(){for(var a=new h,b=0,c=this.firstChild;c;c=c.nextSibling)a[b++]=c;return a.length=b,a},cloneNode:function(a){if(!this.invalidateShadowRenderer())return n(this.impl.cloneNode(a));var b=n(this.impl.cloneNode(!1));if(a)for(var c=this.firstChild;c;c=c.nextSibling)b.appendChild(c.cloneNode(!0));return b},contains:function(a){if(!a)return!1;if(a===this)return!0;var b=a.parentNode;return b?this.contains(b):!1},compareDocumentPosition:function(a){return t.call(this.impl,m(a))}}),i(f,"ownerDocument"),l(o,f,document.createDocumentFragment()),delete f.prototype.querySelector,delete f.prototype.querySelectorAll,f.prototype=k(Object.create(g.prototype),f.prototype),a.wrappers.Node=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a,c){for(var d,e=a.firstElementChild;e;){if(e.matches(c))return e;if(d=b(e,c))return d;e=e.nextElementSibling}return null}function c(a,b,d){for(var e=a.firstElementChild;e;)e.matches(b)&&(d[d.length++]=e),c(e,b,d),e=e.nextElementSibling;return d}var d={querySelector:function(a){return b(this,a)},querySelectorAll:function(a){return c(this,a,new NodeList)}},e={getElementsByTagName:function(a){return this.querySelectorAll(a)},getElementsByClassName:function(a){return this.querySelectorAll("."+a)},getElementsByTagNameNS:function(a,b){if("*"===a)return this.getElementsByTagName(b);for(var c=new NodeList,d=this.getElementsByTagName(b),e=0,f=0;e";case Node.TEXT_NODE:return c(a.nodeValue);case Node.COMMENT_NODE:return"";default:throw console.error(a),new Error("not implemented")}}function e(a){for(var b="",c=a.firstChild;c;c=c.nextSibling)b+=d(c);return b}function f(a,b,c){var d=c||"div";a.textContent="";var e=n(a.ownerDocument.createElement(d));e.innerHTML=b;for(var f;f=e.firstChild;)a.appendChild(o(f))}function g(a){j.call(this,a)}function h(b){k(g,b,function(){return a.renderAllPending(),this.impl[b]})}function i(b){Object.defineProperty(g.prototype,b,{value:function(){return a.renderAllPending(),this.impl[b].apply(this.impl,arguments)},configurable:!0,enumerable:!0})}var j=a.wrappers.Element,k=a.defineGetter,l=a.mixin,m=a.registerWrapper,n=a.unwrap,o=a.wrap,p=/&|<|"/g,q={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},r=window.HTMLElement;g.prototype=Object.create(j.prototype),l(g.prototype,{get innerHTML(){return e(this)},set innerHTML(a){f(this,a,this.tagName)},get outerHTML(){return d(this)},set outerHTML(a){if(this.invalidateShadowRenderer())throw new Error("not implemented");this.impl.outerHTML=a}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollLeft","scrollTop","scrollWidth"].forEach(h),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(i),m(r,g,document.createElement("b")),a.wrappers.HTMLElement=g,a.getInnerHTML=e,a.setInnerHTML=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLContentElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get select(){return this.getAttribute("select")},set select(a){this.setAttribute("select",a)},setAttribute:function(a,b){c.prototype.setAttribute.call(this,a,b),"select"===String(a).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),f&&e(f,b),a.wrappers.HTMLContentElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLShadowElement;b.prototype=Object.create(c.prototype),d(b.prototype,{invalidateShadowRenderer:function(){c.prototype.invalidateShadowRenderer.call(this,!0)}}),f&&e(f,b),a.wrappers.HTMLShadowElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){if(!a.defaultView)return a;var b=l.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);l.set(a,b)}return b}function c(a){for(var c,d=b(a.ownerDocument),e=d.createDocumentFragment();c=a.firstChild;)e.appendChild(c);return e}function d(a){e.call(this,a)}var e=a.wrappers.HTMLElement,f=a.getInnerHTML,g=a.mixin,h=a.registerWrapper,i=a.setInnerHTML,j=a.wrap,k=new SideTable,l=new SideTable,m=window.HTMLTemplateElement;d.prototype=Object.create(e.prototype),g(d.prototype,{get content(){if(m)return j(this.impl.content);var a=k.get(this);return a||(a=c(this),k.set(this,a)),a},get innerHTML(){return f(this.content)},set innerHTML(a){i(this.content,a),this.invalidateShadowRenderer()}}),m&&h(m,d),a.wrappers.HTMLTemplateElement=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){switch(a.localName){case"content":return new c(a);case"shadow":return new e(a);case"template":return new f(a)}d.call(this,a)}var c=a.wrappers.HTMLContentElement,d=a.wrappers.HTMLElement,e=a.wrappers.HTMLShadowElement,f=a.wrappers.HTMLTemplateElement;a.mixin;var g=a.registerWrapper,h=window.HTMLUnknownElement;b.prototype=Object.create(d.prototype),g(h,b),a.wrappers.HTMLUnknownElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";var b=a.GetElementsByInterface,c=a.ParentNodeInterface,d=a.SelectorsInterface,e=a.mixin,f=a.registerObject,g=f(document.createDocumentFragment());e(g.prototype,c),e(g.prototype,d),e(g.prototype,b);var h=f(document.createTextNode("")),i=f(document.createComment(""));a.wrappers.Comment=i,a.wrappers.DocumentFragment=g,a.wrappers.Text=h}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b=i(a.impl.ownerDocument.createDocumentFragment());c.call(this,b),g(b,this);var d=a.shadowRoot;k.set(this,d),j.set(this,a)}var c=a.wrappers.DocumentFragment,d=a.elementFromPoint,e=a.getInnerHTML,f=a.mixin,g=a.rewrap,h=a.setInnerHTML,i=a.unwrap,j=new SideTable,k=new SideTable;b.prototype=Object.create(c.prototype),f(b.prototype,{get innerHTML(){return e(this)},set innerHTML(a){h(this,a),this.invalidateShadowRenderer()},get olderShadowRoot(){return k.get(this)||null},invalidateShadowRenderer:function(){return j.get(this).invalidateShadowRenderer()},elementFromPoint:function(a,b){return d(this,this.ownerDocument,a,b)},getElementById:function(a){return this.querySelector("#"+a)}}),a.wrappers.ShadowRoot=b,a.getHostForShadowRoot=function(a){return j.get(a)}}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){a.previousSibling_=a.previousSibling,a.nextSibling_=a.nextSibling,a.parentNode_=a.parentNode}function c(a){a.firstChild_=a.firstChild,a.lastChild_=a.lastChild}function d(a){D(a instanceof C);for(var d=a.firstChild;d;d=d.nextSibling)b(d);c(a)}function e(a){var b=F(a);d(a),b.textContent=""}function f(a,c){var e=F(a),f=F(c);f.nodeType===C.DOCUMENT_FRAGMENT_NODE?d(c):(h(c),b(c)),a.lastChild_=a.lastChild,a.lastChild===a.firstChild&&(a.firstChild_=a.firstChild);var g=G(e.lastChild);g&&(g.nextSibling_=g.nextSibling),e.appendChild(f)}function g(a,c){var d=F(a),e=F(c);b(c),c.previousSibling&&(c.previousSibling.nextSibling_=c),c.nextSibling&&(c.nextSibling.previousSibling_=c),a.lastChild===c&&(a.lastChild_=c),a.firstChild===c&&(a.firstChild_=c),d.removeChild(e)}function h(a){var b=F(a),c=b.parentNode;c&&g(G(c),a)}function i(a,b){k(b).push(a),z(a,b);var c=I.get(a);c||I.set(a,c=[]),c.push(b)}function j(a){H.set(a,[])}function k(a){return H.get(a)}function l(a){for(var b=[],c=0,d=a.firstChild;d;d=d.nextSibling)b[c++]=d;return b}function m(a,b,c){for(var d=l(a),e=0;e","+","~"],d=a,e="["+b+"]";return c.forEach(function(a){var b=d.split(a);d=b.map(function(a){var b=a.trim();return b&&c.indexOf(b)<0&&b.indexOf(e)<0&&(a=b.replace(/([^:]*)(:*)(.*)/,"$1"+e+"$2$3")),a}).join(a)}),d},propertiesFromRule:function(a){var b=a.style.cssText;return a.style.content&&!a.style.content.match(/['"]+/)&&(b="content: '"+a.style.content+"';\n"+a.style.cssText.replace(/content:[^;]*;/g,"")),b}},i=/@host[^{]*{(([^}]*?{[^{]*?}[\s\S]*?)+)}/gim,j=/([^{]*)({[\s\S]*?})/gim,k=/(.*)((?:\*)|(?:\:scope))(.*)/,l=/^[.\[:]/,m=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,n=/\/\*\s*@polyfill ([^*]*\*+([^/*][^*]*\*+)*\/)([^{]*?){/gim,o=/::(x-[^\s{,(]*)/gim,p="([>\\s~+[.,{:][\\s\\S]*)?$",q=/@host/gim;if(window.ShadowDOMPolyfill){e("style { display: none !important; }\n");var r=document.querySelector("head");r.insertBefore(f(),r.childNodes[0])}a.ShadowCSS=h}(window.Platform)}else{var SideTable;"undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),function(){window.templateContent=window.templateContent||function(a){return a.content},window.wrap=window.unwrap=function(a){return a};var a=HTMLElement.prototype.webkitCreateShadowRoot;HTMLElement.prototype.webkitCreateShadowRoot=function(){var b=this.webkitShadowRoot,c=a.call(this);return c.olderShadowRoot=b,c.host=this,CustomElements.watchShadow(this),c},Object.defineProperties(HTMLElement.prototype,{shadowRoot:{get:function(){return this.webkitShadowRoot}},createShadowRoot:{value:function(){return this.webkitCreateShadowRoot()}}}),window.templateContent=function(a){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(a),!a.content&&!a._content){for(var b=document.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a._content=b}return a.content||a._content}}()}if(function(a){function b(a){for(var b=a||{},d=1;d",""," "," ShadowDOM Inspector"," "," "," ",'
    ',"
",'
'," ",""].join("\n"),d=[],e=function(){var a=b.document,c=a.querySelector("#crumbs");c.textContent="";for(var e,g=0;e=d[g];g++){var h=a.createElement("a");h.href="#",h.textContent=e.localName,h.idx=g,h.onclick=function(a){for(var b;d.length>this.idx;)b=d.pop();f(b.shadow||b,b),a.preventDefault()},c.appendChild(a.createElement("li")).appendChild(h)}},f=function(a,c){var f=b.document;k=[];var g=c||a;d.push(g),e(),f.body.querySelector("#tree").innerHTML="
"+j(a,a.childNodes)+"
"},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),h={STYLE:1,SCRIPT:1,"#comment":1,TEMPLATE:1},i=function(a){return h[a.nodeName]},j=function(a,b,c){if(i(a))return"";var d=c||"";if(a.localName||11==a.nodeType){var e=a.localName||"shadow-root",f=d+l(a);"content"==e&&(b=a.getDistributedNodes()),f+="
";var h=d+"  ";g(b,function(a){f+=j(a,a.childNodes,h)}),f+=d,{br:1}[e]||(f+="</"+e+">",f+="
")}else{var k=a.textContent.trim();f=k?d+'"'+k+'"'+"
":""}return f},k=[],l=function(a){var b="<",c=a.localName||"shadow-root";return a.webkitShadowRoot||a.shadowRoot?(b+=' ",k.push(a)):b+=c||"shadow-root",a.attributes&&g(a.attributes,function(a){b+=" "+a.name+(a.value?'="'+a.value+'"':"")}),b+=">"};shadowize=function(){var a=Number(this.attributes.idx.value),b=k[a];b?f(b.webkitShadowRoot||b.shadowRoot,b):(console.log("bad shadowize node"),console.dir(this))},a.output=j}(window.Inspector),function(a){"use strict";function b(){function a(a){"splice"===a[0].type&&"splice"===a[1].type&&(b=!0)}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=!1,c=[0];return Array.observe(c,a),c[1]=1,c.length=0,Object.deliverChangeRecords(a),b}function c(a){return+a===a>>>0}function d(a){return+a}function e(a){return a===Object(a)}function f(a,b){return a===b?0!==a||1/a===1/b:K(a)&&K(b)?!0:a!==a&&b!==b}function g(a){return"string"!=typeof a?!1:(a=a.replace(/\s/g,""),""==a?!0:"."==a[0]?!1:S.test(a))}function h(a){var b=T[a];if(b)return b;if(g(a)){var b=new i(a);return T[a]=b,b}}function i(a){return""==a.trim()?this:c(a)?(this.push(String(a)),this):(a.split(/\./).filter(function(a){return a}).forEach(function(a){this.push(a)},this),H&&this.length&&(this.getValueFrom=this.compiledGetValueFromFn()),void 0)}function j(a){for(var b=0;U>b&&a.check();)a.report(),b++}function k(a){for(var b in a)return!1;return!0}function l(a){return k(a.added)&&k(a.removed)&&k(a.changed)}function m(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function n(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function o(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,G){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}p(this),this.connect(),this.sync(!0)}function p(a){W&&(V.push(a),o._allObserversCount++)}function q(a,b,c,d){o.call(this,a,b,c,d)}function r(a,b,c,d){if(!Array.isArray(a))throw Error("Provided object is not an Array");o.call(this,a,b,c,d)}function s(a){this.arr=[],this.callback=a,this.isObserved=!0}function t(a,b,c,d,f){this.value=void 0;var g=h(b);return g?g.length?e(a)?(this.path=g,o.call(this,a,c,d,f),void 0):(this.closed=!0,this.value=void 0,void 0):(this.closed=!0,this.value=a,void 0):(this.closed=!0,this.value=void 0,void 0)}function u(a,b){if("function"==typeof Object.observe){var c=Object.getNotifier(a);return function(d,e){var f={object:a,type:d,name:b};2===arguments.length&&(f.oldValue=e),c.notify(f)}}}function v(a,b,c){for(var d={},e={},f=0;fj;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(d[e+j-1]===a[b+k-1])i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i}function x(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(ab):(e.push(bb),d=g),b--,c--):f==h?(e.push(db),b--,d=h):(e.push(cb),c--,d=i)}else e.push(db),b--;else e.push(cb),c--;return e.reverse(),e}function y(a,b,c){for(var d=0;c>d;d++)if(a[d]!==b[d])return d;return c}function z(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&a[--d]===b[--e];)f++;return f}function A(a,b,c){return{index:a,removed:b,addedCount:c}}function B(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=y(a,d,i)),c==a.length&&f==d.length&&(h=z(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,0==c-b&&0==f-e)return[];if(b==c){for(var j=A(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[A(b,[],c-b)];for(var k=x(w(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;ob||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function D(a,b,c,d){for(var e=A(b,c,d),f=!1,g=0,h=0;h=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.indexi.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.indexh)continue;D(e,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return e}function F(a,b){var c=[];return E(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?(b.removed[0]!==a[b.index]&&c.push(b),void 0):(c=c.concat(B(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)),void 0)}),c}var G=b(),H=!1;try{var I=new Function("","return true;");H=I()}catch(J){}var K=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},L="__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},M="[$_a-zA-Z]",N="[$_a-zA-Z0-9]",O=M+"+"+N+"*",P="(?:[0-9]|[1-9]+[0-9]+)",Q="(?:"+O+"|"+P+")",R="(?:"+Q+")(?:\\."+Q+")*",S=new RegExp("^"+R+"$"),T={};i.prototype=L({__proto__:[],toString:function(){return this.join(".")},getValueFrom:function(a){for(var b=0;ba&&b.anyChanged);o._allObserversCount=V.length,X=!1}}},W&&(a.Platform.clearObservers=function(){V=[]}),q.prototype=L({__proto__:o.prototype,connect:function(){G&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=n(this.object))},check:function(a){var b,c;if(G){if(!a)return!1;c={},b=v(this.object,a,c)}else c=this.oldObject,b=m(this.object,this.oldObject);return l(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){G?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}}),r.prototype=L({__proto__:q.prototype,connect:function(){G&&Array.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=this.object.slice())},check:function(a){var b;if(G){if(!a)return!1;b=F(this.object,a)}else b=B(this.object,0,this.object.length,this.oldObject,0,this.oldObject.length);return b&&b.length?(this.reportArgs=[b],!0):!1}}),r.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;ba&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}},t.prototype=L({__proto__:o.prototype,connect:function(){G&&(this.observedSet=new s(this.boundInternalCallback))},disconnect:function(){this.value=void 0,G&&(this.observedSet.reset(),this.observedSet.cleanup(),this.observedSet=void 0)},check:function(){return this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object),f(this.value,this.oldValue)?!1:(this.reportArgs=[this.value,this.oldValue],!0)},sync:function(a){a&&(this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object)),this.oldValue=this.value}}),t.getValueAtPath=function(a,b){var c=h(b);return c?c.getValueFrom(a):void 0},t.setValueAtPath=function(a,b,c){var d=h(b);d&&d.setValueFrom(a,c)};var _={"new":!0,updated:!0,deleted:!0};t.defineProperty=function(a,b,c){var d=c.object,e=h(c.path),f=u(a,b),g=new t(d,c.path,function(a,b){f&&f("updated",b)});return Object.defineProperty(a,b,{get:function(){return e.getValueFrom(d)},set:function(a){e.setValueFrom(d,a)},configurable:!0}),{close:function(){var c=e.getValueFrom(d);f&&g.deliver(),g.close(),Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}}};var ab=0,bb=1,cb=2,db=3;a.Observer=o,a.Observer.hasObjectObserve=G,a.ArrayObserver=r,a.ArrayObserver.calculateSplices=function(a,b){return B(a,0,a.length,b,0,b.length)},a.ObjectObserver=q,a.PathObserver=t,a.Path=i}("undefined"!=typeof global&&global?global: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 a.ownerDocument.contains(a)}function e(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.observer=new PathObserver(c,d,this.boundValueChanged,this),this.boundValueChanged(this.value)}function f(a,b,c,d){this.conditional="?"==b[b.length-1],this.conditional&&(a.removeAttribute(b),b=b.slice(0,-1)),e.call(this,a,b,c,d)}function g(a){switch(a.type){case"checkbox":return T;case"radio":case"select-multiple":case"select-one":return"change";default:return"input"}}function h(a,b,c,d){e.call(this,a,b,c,d),this.eventType=g(this.node),this.boundNodeValueToModel=this.nodeValueChanged.bind(this),this.node.addEventListener(this.eventType,this.boundNodeValueToModel,!0)}function i(a){if(!d(a))return[];if(a.form)return Q(a.form.elements,function(b){return b!=a&&"INPUT"==b.tagName&&"radio"==b.type&&b.name==a.name});var b=a.ownerDocument.querySelectorAll('input[type="radio"][name="'+a.name+'"]');return Q(b,function(b){return b!=a&&!b.form})}function j(a,b,c){h.call(this,a,"checked",b,c)}function k(a,b,c){h.call(this,a,"selectedIndex",b,c)}function l(a){return $[a.tagName]&&a.hasAttribute("template")}function m(a){return"TEMPLATE"==a.tagName||l(a)}function n(a){return _&&"TEMPLATE"==a.tagName}function o(a,b){var c=a.querySelectorAll(ab);m(a)&&b(a),P(c,b)}function p(a){function b(a){HTMLTemplateElement.decorate(a)||p(a.content)}o(a,b)}function q(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function r(a){if(!a.defaultView)return a;var b=eb.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);eb.set(a,b)}return b}function s(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];Z[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function t(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 u(a){"TEMPLATE"===a.tagName?_||(cb?a.__proto__=HTMLTemplateElement.prototype:q(a,HTMLTemplateElement.prototype)):(q(a,HTMLTemplateElement.prototype),Object.defineProperty(a,"content",ib))}function v(a){var b=lb.get(a);b||(b=function(){H(a,a.model,a.bindingDelegate)},lb.set(a,b)),bb(b)}function w(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.node.inputs.bind(this.property,c,d||"")}function x(a){return 3==a.length&&0==a[0].length&&0==a[2].length}function y(a){if(a&&a.length){for(var b,c=a.length,d=0,e=0,f=0;c>e;){if(d=a.indexOf("{{",e),f=0>d?-1:a.indexOf("}}",d+2),0>f){if(!b)return;b.push(a.slice(e));break}b=b||[],b.push(a.slice(e,d)),b.push(a.slice(d+2,f).trim()),e=f+2}return e===c&&b.push(""),b}}function z(a,b,c,d,e){var f,g=e&&e[X];return g&&"function"==typeof g&&(f=g(c,d,b,a),f&&(c=f,d="value")),a.bind(b,c,d)}function A(a,b,c,d,e){for(var f=0;fc?(this.keys.push(a),this.values.push(b)):this.values[c]=b},get:function(a){var b=this.keys.indexOf(a);return 0>b?void 0: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>>0)+(c++ +"__")},S.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),Node.prototype.bind=function(a,b,c){this.bindings=this.bindings||{};var d=this.bindings[a];return d&&d.close(),d=this.createBinding(a,b,c),this.bindings[a]=d,d?d:(console.error("Unhandled binding to Node: ",this,a,b,c),void 0)},Node.prototype.createBinding=function(){},Node.prototype.unbind=function(a){if(this.bindings){var b=this.bindings[a];b&&(b.close(),delete this.bindings[a])}},Node.prototype.unbindAll=function(){if(this.bindings){for(var a=Object.keys(this.bindings),b=0;be.node.length&&d--?bb(b):e.node[e.property]=c}var c=Number(a);if(c<=this.node.length)return this.node[this.property]=c,void 0;var d=2,e=this;bb(b)}}),HTMLSelectElement.prototype.createBinding=function(a,b,c){return"selectedindex"===a.toLowerCase()?(this.removeAttribute(a),new k(this,b,c)):HTMLElement.prototype.createBinding.call(this,a,b,c)};var U="bind",V="repeat",W="if",X="getBinding",Y="getInstanceModel",Z={template:!0,repeat:!0,bind:!0,ref:!0},$={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0,OPTGROUP:!0},_="undefined"!=typeof HTMLTemplateElement,ab="template, "+Object.keys($).map(function(a){return a.toLowerCase()+"[template]"}).join(", "),bb=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=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(;bb>ab&&d(_.charCodeAt(ab));)++ab}function j(){var a,b;for(a=ab++;bb>ab&&(b=_.charCodeAt(ab),g(b));)++ab;return _.slice(a,ab)}function k(){var a,b,c;return a=ab,b=j(),c=1===b.length?X.Identifier:h(b)?X.Keyword:"null"===b?X.NullLiteral:"true"===b||"false"===b?X.BooleanLiteral:X.Identifier,{type:c,value:b,range:[a,ab]}}function l(){var a,b,c,d,e=ab,f=_.charCodeAt(ab),g=_[ab];switch(f){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++ab,{type:X.Punctuator,value:String.fromCharCode(f),range:[e,ab]};default:if(a=_.charCodeAt(ab+1),61===a)switch(f){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:return ab+=2,{type:X.Punctuator,value:String.fromCharCode(f)+String.fromCharCode(a),range:[e,ab]};case 33:case 61:return ab+=2,61===_.charCodeAt(ab)&&++ab,{type:X.Punctuator,value:_.slice(e,ab),range:[e,ab]}}}return b=_[ab+1],c=_[ab+2],d=_[ab+3],">"===g&&">"===b&&">"===c&&"="===d?(ab+=4,{type:X.Punctuator,value:">>>=",range:[e,ab]}):">"===g&&">"===b&&">"===c?(ab+=3,{type:X.Punctuator,value:">>>",range:[e,ab]}):"<"===g&&"<"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:"<<=",range:[e,ab]}):">"===g&&">"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:">>=",range:[e,ab]}):g===b&&"+-<>&|".indexOf(g)>=0?(ab+=2,{type:X.Punctuator,value:g+b,range:[e,ab]}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ab,{type:X.Punctuator,value:g,range:[e,ab]}):(s({},$.UnexpectedToken,"ILLEGAL"),void 0)}function m(){var a,d,e;if(e=_[ab],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=ab,a="","."!==e){for(a=_[ab++],e=_[ab],"0"===a&&e&&c(e.charCodeAt(0))&&s({},$.UnexpectedToken,"ILLEGAL");c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("."===e){for(a+=_[ab++];c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("e"===e||"E"===e)if(a+=_[ab++],e=_[ab],("+"===e||"-"===e)&&(a+=_[ab++]),c(_.charCodeAt(ab)))for(;c(_.charCodeAt(ab));)a+=_[ab++];else s({},$.UnexpectedToken,"ILLEGAL");return f(_.charCodeAt(ab))&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.NumericLiteral,value:parseFloat(a),range:[d,ab]}}function n(){var a,c,d,f="",g=!1;for(a=_[ab],b("'"===a||'"'===a,"String literal must starts with a quote"),c=ab,++ab;bb>ab;){if(d=_[ab++],d===a){a="";break}if("\\"===d)if(d=_[ab++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===_[ab]&&++ab;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({},$.UnexpectedToken,"ILLEGAL"),{type:X.StringLiteral,value:f,octal:g,range:[c,ab]}}function o(a){return a.type===X.Identifier||a.type===X.Keyword||a.type===X.BooleanLiteral||a.type===X.NullLiteral}function p(){var a;return i(),ab>=bb?{type:X.EOF,range:[ab,ab]}:(a=_.charCodeAt(ab),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(_.charCodeAt(ab+1))?m():l():c(a)?m():l())}function q(){var a;return a=db,ab=a.range[1],db=p(),ab=a.range[1],a}function r(){var a;a=ab,db=p(),ab=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(cab&&(a.push(O()),!v(")"));)u(",");return u(")"),a}function F(){var a;return a=q(),o(a)||t(a),cb.createIdentifier(a.value)}function G(){return u("."),F()}function H(){var a;return u("["),a=P(),u("]"),a}function I(){var a,b,c;for(a=D();v(".")||v("[")||v("(");)v("(")?(b=E(),a=cb.createCallExpression(a,b)):v("[")?(c=H(),a=cb.createMemberExpression("[",a,c)):(c=G(),a=cb.createMemberExpression(".",a,c));return a}function J(){var a;return a=I(),db.type===X.Punctuator&&(v("++")||v("--"))&&s({},$.UnexpectedToken),a}function K(){var a,b;return db.type!==X.Punctuator&&db.type!==X.Keyword?b=J():v("++")||v("--")?s({},$.UnexpectedToken):v("+")||v("-")||v("~")||v("!")?(a=q(),b=K(),b=cb.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},$.UnexpectedToken):b=J(),b}function L(a,b){var c=0;if(a.type!==X.Punctuator&&a.type!==X.Keyword)return 0;switch(a.value){case"||":c=1;break;case"&&":c=2;break;case"|":c=3;break;case"^":c=4;break;case"&":c=5;break;case"==":case"!=":case"===":case"!==":c=6;break;case"<":case">":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function M(){var a,b,c,d,e,f,g,h,i;if(d=eb.allowIn,eb.allowIn=!0,h=K(),b=db,c=L(b,d),0===c)return h;for(b.prec=c,q(),f=K(),e=[h,b,f];(c=L(db,d))>0;){for(;e.length>2&&c<=e[e.length-2].prec;)f=e.pop(),g=e.pop().value,h=e.pop(),a=cb.createBinaryExpression(g,h,f),e.push(a);b=q(),b.prec=c,e.push(b),a=K(),e.push(a)}for(eb.allowIn=d,i=e.length-1,a=e[i];i>1;)a=cb.createBinaryExpression(e[i-1].value,e[i-2],a),i-=2;return a}function N(){var a,b,c,d;return a=M(),v("?")&&(q(),b=eb.allowIn,eb.allowIn=!0,c=O(),eb.allowIn=b,u(":"),d=O(),a=cb.createConditionalExpression(a,c,d)),a}function O(){var a,b,c;return a=db,c=b=N()}function P(){var a;return a=O()}function Q(){return u(";"),cb.createEmptyStatement()}function R(){var a=P();return x(),cb.createExpressionStatement(a)}function S(){var a,b,c,d=db.type;if(d===X.EOF&&t(db),i(),d===X.Punctuator)switch(db.value){case";":return Q();case"(":return R()}return a=P(),a.type===Z.Identifier&&v(":")?(q(),c="$"+a.name,Object.prototype.hasOwnProperty.call(eb.labelSet,c)&&s({},$.Redeclaration,"Label",a.name),eb.labelSet[c]=!0,b=S(),delete eb.labelSet[c],cb.createLabeledStatement(a,b)):(x(),cb.createExpressionStatement(a))}function T(){return db.type===X.Keyword?S():db.type!==X.EOF?S():void 0}function U(){for(var a,b=[];bb>ab&&(a=T(),"undefined"!=typeof a);)b.push(a);return b}function V(){var a;return i(),r(),a=U(),cb.createProgram(a)}function W(a,b){var c;return c=String,"string"==typeof a||a instanceof String||(a=c(a)),cb=b,_=a,ab=0,bb=_.length,db=null,eb={allowIn:!0,labelSet:{}},bb>0&&"undefined"==typeof _[0]&&a instanceof String&&(_=a.valueOf()),V()}var X,Y,Z,$,_,ab,bb,cb,db,eb;X={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},Y={},Y[X.BooleanLiteral]="Boolean",Y[X.EOF]="",Y[X.Identifier]="Identifier",Y[X.Keyword]="Keyword",Y[X.NullLiteral]="Null",Y[X.NumericLiteral]="Numeric",Y[X.Punctuator]="Punctuator",Y[X.StringLiteral]="String",Z={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"},$={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"},a.esprima={parse:W}}(this),function(a){"use strict";function b(a,b,d,e){if(e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.tagName&&("bind"===d||"repeat"===d)){var f,g,h=b.match(r);if(h?(f=h[1],g=h[2]):(h=b.match(s),h&&(f=h[2],g=h[1])),h){var i;if(g=g.trim(),g.match(q))i=new CompoundBinding(function(a){return a.path}),i.bind("path",a,g);else try{i=c(a,g)}catch(j){console.error("Invalid expression syntax: "+g,j)}if(i)return t.set(e,f),i}}}function c(a,b){try{var c=new f;if(esprima.parse(b,c),!c.statements.length&&!c.labeledStatements.length)return;if(!c.labeledStatements.length&&c.statements.length>1)throw Error("Multiple unlabelled statements are not allowed.");var e=c.labeledStatements.length?d(c.labeledStatements):e=c.statements[0],g=[];for(var h in c.deps)g.push(h);if(!g.length)return{value:e({})};for(var i=new CompoundBinding(e),j=0;j>>0)+(c++ +"__")},i.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var j="[$_a-zA-Z]",k="[$_a-zA-Z0-9]",l=j+"+"+k+"*",m="("+l+")",n="(?:[0-9]|[1-9]+[0-9]+)",o="(?:"+l+"|"+n+")",p="(?:"+o+")(?:\\."+o+")*",q=new RegExp("^"+p+"$"),r=new RegExp("^"+m+"\\s* in (.*)$"),s=new RegExp("^(.*) as \\s*"+m+"$"),t=new i;e.prototype={getPath:function(){return this.last?this.last.getPath()+"."+this.name:this.name},valueFn:function(){var a=this.getPath();return this.deps[a]=!0,function(b){return b[a]}}};var u={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},v={"+":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}};f.prototype={getFn:function(a){return a instanceof e?a.valueFn():a},createProgram:function(){},createExpressionStatement:function(a){return this.statements.push(a),a},createLabeledStatement:function(a,b){return this.labeledStatements.push({label:a.getPath(),body:b instanceof e?b.valueFn():b}),b},createUnaryExpression:function(a,b){if(!u[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),function(c){return u[a](b(c))}},createBinaryExpression:function(a,b,c){if(!v[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),c=this.getFn(c),function(d){return v[a](b(d),c(d))}},createConditionalExpression:function(a,b,c){return a=this.getFn(a),b=this.getFn(b),c=this.getFn(c),function(d){return a(d)?b(d):c(d)}},createIdentifier:function(a){var b=new e(this.deps,a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){return new e(this.deps,c.name,b)},createLiteral:function(a){return function(){return a.value}},createArrayExpression:function(a){for(var b=0;be;e++)d.unshift("..");var g=d.join("/");return g},resolvePathsInHTML:function(a,b){b=b||p.documentUrlFromNode(a),p.resolveAttributes(a,b),p.resolveStyleElts(a,b);var c=a.querySelectorAll("template");c&&q(c,function(a){a.content&&p.resolvePathsInHTML(a.content,b)})},resolvePathsInStylesheet:function(a){var b=p.nodeUrl(a);a.__resource=p.resolveCssText(a.__resource,b)},resolveStyleElts:function(a,b){var c=a.querySelectorAll("style");c&&q(c,function(a){a.textContent=p.resolveCssText(a.textContent,b)})},resolveCssText:function(a,b){return a.replace(/url\([^)]*\)/g,function(a){var c=a.replace(/["']/g,"").slice(4,-1);return c=p.resolveUrl(b,c,!0),"url("+c+")"})},resolveAttributes:function(a,b){var c=a&&a.querySelectorAll(n);c&&q(c,function(a){this.resolveNodeAttributes(a,b)},this)},resolveNodeAttributes:function(a,b){m.forEach(function(c){var d=a.attributes[c];if(d&&d.value&&d.value.search(o)<0){var e=p.resolveUrl(b,d.value,!0);d.value=e}})}};h=h||{async:!0,ok:function(a){return a.status>=200&&a.status<300||304===a.status||0===a.status},load:function(b,c,d){var e=new XMLHttpRequest;return(a.flags.debug||a.flags.bust)&&(b+="?"+Math.random()),e.open("GET",b,h.async),e.addEventListener("readystatechange",function(){4===e.readyState&&c.call(d,!h.ok(e)&&e,e.response,b)}),e.send(),e},loadDocument:function(a,b,c){this.load(a,b,c).responseType="document"}};var q=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.path=p,a.xhr=h,a.importer=k,a.getDocumentUrl=p.getDocumentUrl,a.IMPORT_LINK_TYPE=i}(window.HTMLImports),function(a){function b(a){return"link"===a.localName&&a.getAttribute("rel")===f}function c(a){return a.parentNode&&!d(a)&&!e(a)}function d(a){return a.ownerDocument===document||a.ownerDocument.impl===document}function e(a){return a.parentNode&&"element"===a.parentNode.localName}var f="import",g={selectors:["link[rel="+f+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(a){if(!a.__importParsed){a.__importParsed=!0;var b=a.querySelectorAll(g.selectors);h(b,function(a){g[g.map[a.localName]](a)})}},parseLink:function(a){b(a)?a.content&&g.parse(a.content):this.parseGeneric(a)},parseGeneric:function(a){c(a)&&document.head.appendChild(a)},parseScript:function(b){if(c(b)){var d=(b.__resource||b.textContent).trim();if(d){var e=b.__nodeUrl;if(!e){var e=a.path.documentUrlFromNode(b),f="["+Math.floor(1e3*(Math.random()+1))+"]",g=d.match(/Polymer\(['"]([^'"]*)/);f=g&&g[1]||f,e+="/"+f+".js"}d+="\n//# sourceURL="+e+"\n",eval.call(window,d)}}}},h=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.parser=g}(HTMLImports),function(){function a(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState?a():window.addEventListener("DOMContentLoaded",a)}(),function(a){function b(a){u.push(a),t||(t=!0,q(d))}function c(a){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(a)||a}function d(){t=!1;var a=u;u=[],a.sort(function(a,b){return a.uid_-b.uid_});var b=!1;a.forEach(function(a){var c=a.takeRecords();e(a),c.length&&(a.callback_(c,a),b=!0)}),b&&d()}function e(a){a.nodes_.forEach(function(b){var c=p.get(b); +c&&c.forEach(function(b){b.observer===a&&b.removeTransientObservers()})})}function f(a,b){for(var c=a;c;c=c.parentNode){var d=p.get(c);if(d)for(var e=0;e0){var e=c[d-1],f=n(e,a);if(f)return c[d-1]=f,void 0}else b(this.observer);c[d]=a},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(a){var b=this.options;b.attributes&&a.addEventListener("DOMAttrModified",this,!0),b.characterData&&a.addEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.addEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(a){var b=this.options;b.attributes&&a.removeEventListener("DOMAttrModified",this,!0),b.characterData&&a.removeEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.removeEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(a){if(a!==this.target){this.addListeners_(a),this.transientObservedNodes.push(a);var b=p.get(a);b||p.set(a,b=[]),b.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[],a.forEach(function(a){this.removeListeners_(a);for(var b=p.get(a),c=0;c1?logFlags.dom&&console.warn("inserted:",a.localName,"insert/remove count:",a.__inserted):a.insertedCallback&&(logFlags.dom&&console.log("inserted:",a.localName),a.insertedCallback())),logFlags.dom&&console.groupEnd())}function k(a){l(a),d(a,function(a){l(a)})}function l(a){(a.removedCallback||a.__upgraded__&&logFlags.dom)&&(logFlags.dom&&console.log("removed:",a.localName),m(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?logFlags.dom&&console.warn("removed:",a.localName,"insert/remove count:",a.__inserted):a.removedCallback&&a.removedCallback()))}function m(a){for(var b=a;b;){if(b==a.ownerDocument)return!0;b=b.parentNode||b.host}}function n(a){if(a.webkitShadowRoot&&!a.webkitShadowRoot.__watched){logFlags.dom&&console.log("watching shadow-root for: ",a.localName);for(var b=a.webkitShadowRoot;b;)o(b),b=b.olderShadowRoot}}function o(a){a.__watched||(t(a),a.__watched=!0)}function p(a){n(a),d(a,function(){n(a)})}function q(a){switch(a.localName){case"style":case"script":case"template":case void 0:return!0}}function r(a){if(logFlags.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(x(a.addedNodes,function(a){q(a)||g(a)}),x(a.removedNodes,function(a){q(a)||k(a)}))}),logFlags.dom&&console.groupEnd()}function s(){r(w.takeRecords())}function t(a){w.observe(a,{childList:!0,subtree:!0})}function u(a){t(a)}function v(a){logFlags.dom&&console.group("upgradeDocument: ",(a.URL||a._URL||"").split("/").pop()),g(a),logFlags.dom&&console.groupEnd()}var w=new MutationObserver(r),x=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.watchShadow=n,a.watchAllShadows=p,a.upgradeAll=g,a.upgradeSubtree=f,a.observeDocument=u,a.upgradeDocument=v,a.takeRecords=s}(window.CustomElements),function(){function parseElementElement(a){var b={name:"","extends":null};takeAttributes(a,b);var c=HTMLElement.prototype;if(b.extends){var d=document.createElement(b.extends);c=d.__proto__||Object.getPrototypeOf(d)}b.prototype=Object.create(c),a.options=b;var e=a.querySelector('script:not([type]),script[type="text/javascript"],scripts');e&&executeComponentScript(e.textContent,a,b.name);var f=document.register(b.name,b);a.ctor=f;var g=a.getAttribute("constructor");g&&(window[g]=f)}function takeAttributes(a,b){for(var c in b){var d=a.attributes[c];d&&(b[c]=d.value)}}function executeComponentScript(inScript,inContext,inName){context=inContext;var owner=context.ownerDocument,url=owner._URL||owner.URL||owner.impl&&(owner.impl._URL||owner.impl.URL),match=url.match(/.*\/([^.]*)[.]?.*$/);if(match){var name=match[1];url+=name!=inName?":"+inName:""}var code="__componentScript('"+inName+"', function(){"+inScript+"});"+"\n//# sourceURL="+url+"\n";eval(code)}function mixin(a,b){a=a||{};try{Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)})}catch(c){}return a}var HTMLElementElement=function(a){return a.register=HTMLElementElement.prototype.register,parseElementElement(a),a};HTMLElementElement.prototype={register:function(a){a&&(this.options.lifecycle=a.lifecycle,a.prototype&&mixin(this.options.prototype,a.prototype))}};var context;window.__componentScript=function(a,b){b.call(context)},window.HTMLElementElement=HTMLElementElement}(),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+"]","element"],map:{link:"parseLink",element:"parseElement"},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)},parseElement:function(a){new HTMLElementElement(a)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=c}(),function(){function a(){setTimeout(function(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))},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();else{var b=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(b,a)}}(),function(){function a(){}var b=document.createElement("style");b.textContent="element {display: none !important;} /* injected by platform.js */";var c=document.querySelector("head");if(c.insertBefore(b,c.firstChild),window.ShadowDOMPolyfill){CustomElements.watchShadow=a,CustomElements.watchAllShadows=a;var d=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],e={};d.forEach(function(a){e[a]=CustomElements[a]}),d.forEach(function(a){CustomElements[a]=function(b){return e[a](wrap(b))}})}}(),function(a){a=a||{};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(document,b,c)}};a.targetFinding=b,a.findTarget=b.findTarget.bind(b),window.PointerEventsPolyfill=a}(window.PointerEventsPolyfill),function(){function a(a){return'[touch-action="'+a+'"]'}function b(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; }"}var c=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],d="";c.forEach(function(c){d+=String(c)===c?a(c)+b(c):c.selectors.map(a)+b(c.rule)});var e=document.createElement("style");e.textContent=d;var f=document.querySelector("head");f.insertBefore(e,f.firstChild)}(),function(a){function b(a,b){var b=b||{},e=b.buttons;if(void 0===e)switch(b.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}var f;if(c)f=new MouseEvent(a,b);else{f=document.createEvent("MouseEvent");var g={bubbles:!1,cancelable:!1,view:null,detail:null,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};Object.keys(g).forEach(function(a){a in b&&(g[a]=b[a])}),f.initMouseEvent(a,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)}d||Object.defineProperty(f,"buttons",{get:function(){return e},enumerable:!0});var h=0;return h=b.pressure?b.pressure:e?.5:0,Object.defineProperties(f,{pointerId:{value:b.pointerId||0,enumerable:!0},width:{value:b.width||0,enumerable:!0},height:{value:b.height||0,enumerable:!0},pressure:{value:h,enumerable:!0},tiltX:{value:b.tiltX||0,enumerable:!0},tiltY:{value:b.tiltY||0,enumerable:!0},pointerType:{value:b.pointerType||"",enumerable:!0},hwTimestamp:{value:b.hwTimestamp||0,enumerable:!0},isPrimary:{value:b.isPrimary||!1,enumerable:!0}}),f}var c=!1,d=!1;try{var e=new MouseEvent("click",{buttons:1});c=!0,d=1===e.buttons}catch(f){}a.PointerEvent||(a.PointerEvent=b)}(window),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},forEach:function(a,b){this.ids.forEach(function(c,d){a.call(b,c,this.pointers[d],this)},this)}},a.PointerMap=window.Map&&Map.prototype.forEach?Map:b}(window.PointerEventsPolyfill),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerEventsPolyfill),function(a){var b={targets:new a.SideTable,handledEvents:new a.SideTable,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)},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){a.target.contains(a.relatedTarget)||this.leave(a),this.out(a)},enterOver:function(a){a.target.contains(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:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){var c=new PointerEvent(a,b);return 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){var b={};for(var c in a)b[c]=a[c];return b},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:function(a){var b=this.getTarget(a);return b?b.dispatchEvent(a):void 0},asyncDispatchEvent:function(a){setTimeout(this.dispatchEvent.bind(this,a),0)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=b.register.bind(b),a.unregister=b.unregister.bind(b)}(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);return 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 a.SideTable,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){null===this.firstTouch&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryTouch:function(a){this.isPrimaryTouch(a)&&(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(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.size>=b.length){var c=[];f.forEach(function(a,d){if(1!==a&&!this.findTouch(b,a-2)){var e=d.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.removePrimaryTouch(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)}),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){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(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={handledEvents:new a.SideTable,targets:new a.SideTable,handlers:{},recognizers:{},events:["pointerdown","pointermove","pointerup","pointerover","pointerout","pointercancel"],registerRecognizer:function(a,b){var c=b;this.recognizers[a]=c,this.events.forEach(function(a){if(c[a]){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(this.events,a)},unregisterTarget:function(a){this.unlisten(this.events,a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b,c=a.type;(b=this.handlers[c])&&this.makeQueue(b,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){var b={};for(var c in a)b[c]=a[c];return b},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)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=function(b){var c=window.PointerEventsPolyfill;c&&c.register(b),a.dispatcher.registerTarget(b)},b.registerTarget(document)}(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,pointerType:c.pointerType};"trackend"===a&&(h._releaseTarget=c.target);var 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"],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)},preventTap:function(a){c.delete(a)}};b.registerRecognizer("tap",d)}(window.PointerGestures),Polymer={},function(){var a=document.createElement("style");a.textContent="body {opacity: 0;}";var b=document.querySelector("head");b.insertBefore(a,b.firstChild),window.addEventListener("WebComponentsReady",function(){document.body.style.webkitTransition="opacity 0.3s",document.body.style.opacity=1})}(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&&(a[c].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;"_super"in c||(g||(g=e.call(this,c)),g||console.warn("called super() on a method not installed declaratively (has no .nom property)"),d(c,g,f(this)));var h=c._super;if(h){var i=h[g];return"_super"in i||d(i,g,h),i.apply(this,a||[])}}function c(a,b,c){for(;a&&(!a.hasOwnProperty(b)||a[b]===c);)a=f(a);return 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){console.warn("nameInThis called");for(var b=this;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(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}}};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?!1:!0,detail:b})),b},asyncFire:function(){this.asyncMethod("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,b){b.cancelBubble||(b.on=i+b.type,h.events&&console.group("[%s]: listenLocal [%s]",a.localName,b.on),!b.path||window.ShadowDOMPolyfill?d(a,b):c(a,b),h.events&&console.groupEnd())}function c(a,b){var c=null;Array.prototype.some.call(b.path,function(d){return d===a?!0:(c=c===a?c:e(d),c&&f(c,d,b)?!0:void 0)},this)}function d(a,b){h.events&&console.log("event.path() not supported for",b.type);for(var c=b.target,d=null;c&&c!=a;){if(d=d===a?d:e(c),d&&f(d,c,b))return!0;c=c.parentNode}}function e(a){for(;a.parentNode;)a=a.parentNode;return a.host}function f(a,b,c){var d=b.getAttribute&&b.getAttribute(c.on);return d&&g(b,c)&&(h.events&&console.log("[%s] found handler name [%s]",a.localName,d),a.dispatchMethod(b,d,[c,c.detail,b])),c.cancelBubble}function g(a,b){var c=l.get(b);return c||l.set(b,c=[]),c.indexOf(a)<0?(c.push(a),!0):void 0}var h=window.logFlags||{},i="on-",j="eventDelegates",k={EVENT_PREFIX:i,DELEGATES:j,addHostListeners:function(){var a=this[j];h.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a),this.addNodeListeners(this,a,this.hostEventListener)},addInstanceListeners:function(a,b){var c=b.delegates;c&&(h.events&&Object.keys(c).length>0&&console.log("[%s:root] addInstanceListeners:",this.localName,c),this.addNodeListeners(a,c,this.instanceEventListener))},addNodeListeners:function(a,b,c){var d;for(var e in b)d||(d=c.bind(this)),a.addEventListener(e,d)},hostEventListener:function(a){if(!a.cancelBubble){h.events&&console.group("[%s]: hostEventListener(%s)",this.localName,a.type);var b=this.findEventDelegate(a);b&&(h.events&&console.log("[%s] found host handler name [%s]",this.localName,b),this.dispatchMethod(this,b,[a,a.detail,this])),h.events&&console.groupEnd()}},findEventDelegate:function(a){return this[j][a.type]},dispatchMethod:function(a,b,c){if(a){h.events&&console.group("[%s] dispatch [%s]",a.localName,b);var d=this[b];d&&d[c?"apply":"call"](this,c),h.events&&console.groupEnd()}},instanceEventListener:function(a){b(this,a)}},l=new SideTable("handledList");a.api.instance.events=k}(Polymer),function(a){var b="__published",c="__instance_attributes",d={PUBLISHED:b,INSTANCE_ATTRIBUTES:c,copyInstanceAttributes:function(){var a=this[c];for(var b in a)this.setAttribute(b,a[b])},takeAttributes:function(){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.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var c=Object.keys(this[b]);return c[c.map(e).indexOf(a.toLowerCase())]},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a){return"object"!=typeof a&&void 0!==a?a:void 0},propertyToAttribute:function(a){if(Object.keys(this[b]).indexOf(a)>=0){var c=this.serializeValue(this[a]);void 0!==c&&this.setAttribute(a,c)}}},e=String.prototype.toLowerCase.call.bind(String.prototype.toLowerCase);a.api.instance.attributes=d}(Polymer),function(a){function b(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)}function c(a,b,c,d){h.bind&&console.log(o,c.localName||"object",d,a.localName,b);var e=PathObserver.getValueAtPath(c,d);return(null===e||void 0===e)&&PathObserver.setValueAtPath(c,d,a[b]),PathObserver.defineProperty(a,b,{object:c,path:d})}function d(a,b,c){var d=g(a);d[b]=c}function e(a,b){var c=g(a);return c&&c[b]?(c[b].close(),c[b]=null,!0):void 0}function f(a){var b=g(a);Object.keys(b).forEach(function(a){b[a].close(),b[a]=null})}function g(a){var b=l.get(a);return b||l.set(a,b={}),b}var h=window.logFlags||{},i="Changed",j=a.api.instance.attributes.PUBLISHED,k={observeProperties:function(){for(var a,b=this.getCustomPropertyNames(),c=0,d=b.length;d>c&&(a=b[c]);c++)this.observeProperty(a)},getCustomPropertyNames:function(){return this.customPropertyNames},observeProperty:function(a){if(this.shouldObserveProperty(a)){h.watch&&console.log(m,this.localName,a);var b=function(b,c){h.watch&&console.log(n,this.localName,this.id||"",a,this[a],c),this.dispatchPropertyChange(a,c)}.bind(this),c=new PathObserver(this,a,b);d(this,a,c)}},bindProperty:function(a,b,d){return c(this,a,b,d)},unbindProperty:function(a,b){return e(this,a,b)},unbindAllProperties:function(){f(this)},shouldObserveProperty:function(a){return Boolean(this[a+i]||Object.keys(this[j]).indexOf(a)>=0)},dispatchPropertyChange:function(a,c){this.propertyToAttribute(a),b.call(this,a+i,[c])}},l=new SideTable,m="[%s] watching [%s]",n="[%s#%s] watch: [%s] now [%s] was [%s]",o="[%s]: bindProperties: [%s] to [%s].[%s]";a.api.instance.properties=k}(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=new ExpressionSyntax,g={instanceTemplate:function(a){return a.createInstance(this,f)},createBinding:function(a,b,c){var d=this.propertyForAttribute(a);if(d){var e=this.bindProperty(d,b,c);return e.path=c,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(){this._unbound||(this.unbindAllProperties(),this.super(),b(this.shadowRoot),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)}},h=/\{\{([^{}]*)}}/;a.bindPattern=h,a.api.instance.mdv=g}(Polymer),function(a){function b(a){return a.hasOwnProperty("PolymerBase")}function c(){}var d={PolymerBase:!0,job:Polymer.job,"super":Polymer.super,ready:function(){},readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){this.observeProperties(),this.copyInstanceAttributes(),this.takeAttributes(),this.addHostListeners(),this.parseElements(this.__proto__),this.ready()},insertedCallback:function(){this._enteredDocumentCallback()},enteredDocumentCallback:function(){this._enteredDocumentCallback()},_enteredDocumentCallback:function(){this.cancelUnbindAll(!0),this.inserted&&this.inserted(),this.enteredDocument&&this.enteredDocument()},removedCallback:function(){this._leftDocumentCallback()},leftDocumentCallback:function(){this._leftDocumentCallback()},_leftDocumentCallback:function(){this.asyncUnbindAll(),this.removed&&this.removed(),this.leftDocument&&this.leftDocument()},parseElements:function(a){a&&a.element&&(this.parseElements(a.__proto__),a.parseElement.call(this,a.element))},parseElement:function(a){this.shadowFromTemplate(this.fetchTemplate(a))},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemplate:function(a){if(a){this.shadowRoot;var b=this.createShadowRoot();b.applyAuthorStyles=this.applyAuthorStyles,b.resetStyleInheritance=this.resetStyleInheritance;var c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady(b,a),b}},shadowRootReady:function(a,b){this.marshalNodeReferences(a),this.addInstanceListeners(a,b),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){this.attributeToProperty(a,this.getAttribute(a)),this.attributeChanged&&this.attributeChanged.apply(this,arguments)}};c.prototype=d,d.constructor=c,a.Base=c,a.isBase=b,a.api.instance.base=d}(Polymer),function(a){function b(a){return a.__proto__}window.logFlags||{};var c="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);window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimPolyfillDirectives([f],this.localName),Polymer.applyStyleToScope(f,a)}}},scopeHasElementStyle:function(a,b){var d=c+"="+this.localName+"-"+b;return a.querySelector("style["+d+"]")},findStyleController:function(){if(window.ShadowDOMPolyfill)return wrap(document.head);for(var a=this;a.parentNode;)a=a.parentNode;return a===document?document.head:a}};a.api.instance.styles=e}(Polymer),function(a){var b={addResolvePathApi:function(){var a=this.elementPath();this.prototype.resolvePath=function(b){return a+b}},elementPath:function(){return this.urlToPath(HTMLImports.getDocumentUrl(this.ownerDocument))},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}window.logFlags||{};var f=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.installLocalSheets(),this.installGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(i),this.sheets.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 i=this.findNodes(h,f);return i.forEach(function(a){a.parentNode.removeChild(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){function b(a){return a.slice(0,k)==g}function c(a){return a.slice(k)}function d(a){return a.ref?a.ref.content:a.content}var e=a.api.instance.events,f=e.DELEGATES,g=e.EVENT_PREFIX,h=window.logFlags||{},i={inheritDelegates:function(a){this.inheritObject(a,f)},parseHostEvents:function(){var a=this.prototype[f];this.addAttributeDelegates(a)},addAttributeDelegates:function(a){for(var d,e=0;d=this.attributes[e];e++)b(d.name)&&(a[c(d.name)]=d.value)},parseLocalEvents:function(){this.querySelectorAll("template").forEach(function(a){a.delegates={},this.accumulateTemplatedEvents(a,a.delegates),h.events&&console.log("[%s] parseLocalEvents:",this.attributes.name.value,a.delegates)},this)},accumulateTemplatedEvents:function(a,b){if("template"===a.localName){var c=d(a);c&&this.accumulateChildEvents(c,b)}},accumulateChildEvents:function(a,b){a.childNodes.forEach(function(a){this.accumulateEvents(a,b)},this)},accumulateEvents:function(a,b){return this.accumulateAttributeEvents(a,b),this.accumulateChildEvents(a,b),this.accumulateTemplatedEvents(a,b),b},accumulateAttributeEvents:function(a,d){a.attributes&&a.attributes.forEach(function(a){b(a.name)&&this.accumulateEvent(c(a.name),d)},this)},accumulateEvent:function(a,b){a=j[a]||a,b[a]=b[a]||1}},j={webkitanimationstart:"webkitAnimationStart",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitionEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"},k=g.length;i.event_translations=j,a.api.declaration.events=i}(Polymer),function(a){var b=[],c={cacheProperties:function(){this.prototype.customPropertyNames=this.getCustomPropertyNames(this.prototype)},getCustomPropertyNames:function(c){for(var d,e={};c&&!a.isBase(c);){for(var f,g=Object.getOwnPropertyNames(c),h=0,i=g.length;i>h&&(f=g[h]);h++)e[f]=!0,d=!0;c=c.__proto__}return d?Object.keys(e):b}};a.api.declaration.properties=c}(Polymer),function(a){var b=a.api.instance.attributes,c=b.PUBLISHED,d=b.INSTANCE_ATTRIBUTES,e="publish",f="attributes",g={inheritAttributesObjects:function(a){this.inheritObject(a,c),this.inheritObject(a,d)},parseAttributes:function(){this.publishAttributes(this.prototype),this.publishProperties(this.prototype),this.accumulateInstanceAttributes()},publishAttributes:function(a){var b=a[c],d=this.getAttribute(f);if(d){var e=d.split(d.indexOf(",")>=0?",":" ");e.forEach(function(a){a=a.trim(),!a||a in b||(b[a]=null)})}Object.keys(b).forEach(function(c){c in a||(a[c]=b[c])})},publishProperties:function(a){this.publishPublish(a)},publishPublish:function(a){if(a.hasOwnProperty(e)){var b=a[e];b&&(Object.keys(b).forEach(function(c){a[c]=b[c]}),Platform.mixin(a[c],b))}},accumulateInstanceAttributes:function(){var a=this.prototype[d];this.attributes.forEach(function(b){this.isInstanceAttribute(b.name)&&(a[b.name]=b.value)},this)},isInstanceAttribute:function(a){return!this.blackList[a]&&"on-"!==a.slice(0,3)},blackList:{name:1,"extends":1,constructor:1,noscript:1}};g.blackList[f]=1,a.api.declaration.attributes=g}(Polymer),function(a){function b(a,b){h[a]=b||{},g[a]&&g[a].define()}function c(a){return Object.create(HTMLElement.getPrototypeForTag(a))}function d(b){if(!Object.__proto__){var c=Object.getPrototypeOf(b);b.__proto__=c,a.isBase(c)&&(c.__proto__=Object.getPrototypeOf(c))}}var e=Polymer.extend,f=a.api.declaration,g={},h={},i=c();e(i,{readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){var a=this.getAttribute("name");h[a]?this.define():g[a]=this},define:function(){var a=this.getAttribute("name"),b=this.getAttribute("extends");this.prototype=this.generateCustomPrototype(a,b),this.prototype.element=this,this.addResolvePathApi(),d(this.prototype),this.desugar(),window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimStyling(this.templateContent(),a,b),this.register(a),this.publishConstructor()},desugar:function(){this.parseAttributes(),this.parseHostEvents(),this.parseLocalEvents(),this.installSheets(),this.prototype.registerCallback&&this.prototype.registerCallback(this),this.cacheProperties()},generateCustomPrototype:function(a,b){var c=this.generateBasePrototype(b);return this.addNamedApi(c,a)},generateBasePrototype:function(a){var b=c(a);return this.ensureBaseApi(b)},ensureBaseApi:function(b){return b.PolymerBase||(Object.keys(a.api.instance).forEach(function(c){e(b,a.api.instance[c])}),b=Object.create(b)),this.inheritAttributesObjects(b),this.inheritDelegates(b),b},addNamedApi:function(a,b){return e(a,h[b])},inheritObject:function(a,b){a[b]=e({},Object.getPrototypeOf(a)[b])},register:function(a){this.ctor=document.register(a,{prototype:this.prototype}),this.prototype.constructor=this.ctor,HTMLElement.register(a,this.prototype)},publishConstructor:function(){var a=this.getAttribute("constructor");a&&(window[a]=this.ctor)}}),Object.keys(f).forEach(function(a){e(i,f[a])}),document.register("polymer-element",{prototype:i}),e(b,window.Polymer),window.Polymer=b}(Polymer),Polymer.register=function(a){if(a!=window){var b=a.getAttribute("name");throw new Error("Polymer.register is deprecated in declaration of "+b+". Please see http://www.polymer-project.org/getting-started.html")}}; +/* +//@ sourceMappingURL=polymer.sandbox.min.js.map +*/ \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/attrs.js b/architecture-examples/polymer/bower_components/polymer/src/attrs.js deleted file mode 100644 index e9bf4d4edd..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/attrs.js +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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. - */ - -(function() { - - // imports - - var bindPattern = Polymer.bindPattern; - - // constants - - var published$ = '__published'; - var attributes$ = 'attributes'; - var attrProps$ = 'publish'; - //var attrProps$ = 'attributeDefaults'; - - function publishAttributes(element, prototype) { - publishAttributesAttributes(element, prototype); - publishInstanceAttributes(element, prototype); - } - - function publishAttributesAttributes(inElement, inPrototype) { - var published = {}; - // merge attribute names from 'attributes' attribute - var attributes = inElement.getAttribute(attributes$); - if (attributes) { - // attributes='a b c' or attributes='a,b,c' - var names = attributes.split(attributes.indexOf(',') >= 0 ? ',' : ' '); - // record each name for publishing - names.forEach(function(p) { - p = p.trim(); - if (p) { - published[p] = null; - } - }); - } - // our suffix prototype chain (inPrototype is 'own') - var inherited = inElement.options.prototype; - // install 'attributes' as properties on the prototype, but don't - // override - Object.keys(published).forEach(function(p) { - if (!(p in inPrototype) && !(p in inherited)) { - inPrototype[p] = published[p]; - } - }); - // acquire properties published imperatively - var imperative = inPrototype[attrProps$]; - if (imperative) { - // install imperative properties, overriding defaults - Object.keys(imperative).forEach(function(p) { - inPrototype[p] = imperative[p]; - }); - // combine declaratively and imperatively published properties - published = Platform.mixin(published, imperative); - } - // combine with inherited published properties - inPrototype[published$] = Platform.mixin( - {}, - inherited[published$], - published - ); - } - - function publishInstanceAttributes(element, prototype) { - // our suffix prototype chain (prototype is 'own') - var inherited = element.options.prototype; - var attributes = element.attributes; - var a$ = prototype.instanceAttributes = - Object.create(inherited.instanceAttributes || null); - for (var i=0, l=attributes.length, a; (i= 0) { - return; - } - // get original value - var defaultValue = this[name]; - // deserialize Boolean or Number values from attribute - var value = deserializeValue(a.value, defaultValue); - // only act if the value has changed - if (value !== defaultValue) { - // install new value (has side-effects) - this[name] = value; - } - } - }, this); - } - - // return the published property matching name, or undefined - function propertyForAttribute(name) { - // matchable properties must be published - var properties = Object.keys(this[published$]); - // search for a matchable property - return properties[properties.map(lowerCase).indexOf(name.toLowerCase())]; - } - - var lowerCase = String.prototype.toLowerCase.call.bind( - String.prototype.toLowerCase); - - var typeHandlers = { - 'string': function(value) { - return value; - }, - 'date': function(value) { - return new Date(Date.parse(value) || Date.now()); - }, - 'boolean': function(value) { - if (value === '') { - return true; - } - - return value === 'false' ? false : !!value; - }, - 'number': function(value) { - var floatVal = parseFloat(value); - - return (String(floatVal) === value) ? floatVal : value; - }, - 'object': function(value, defaultValue) { - if (!defaultValue) { - return value; - } - - try { - // If the string is an object, we can parse is with the JSON library. - // include convenience replace for single-quotes. If the author omits - // quotes altogether, parse will fail. - return JSON.parse(value.replace(/'/g, '"')); - } catch(e) { - // The object isn't valid JSON, return the raw value - return value; - } - } - }; - - function deserializeValue(value, defaultValue) { - // attempt to infer type from default value - var inferredType = typeof defaultValue; - if (defaultValue instanceof Date) { - inferredType = 'date'; - } - - return typeHandlers[inferredType](value, defaultValue); - } - - // exports - - Polymer.takeAttributes = takeAttributes; - Polymer.publishAttributes = publishAttributes; - Polymer.propertyForAttribute = propertyForAttribute; - Polymer.installInstanceAttributes = installInstanceAttributes; - -})(); diff --git a/architecture-examples/polymer/bower_components/polymer/src/base.js b/architecture-examples/polymer/bower_components/polymer/src/base.js deleted file mode 100644 index b8973c6af6..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/base.js +++ /dev/null @@ -1,191 +0,0 @@ -/* - * 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 - */ - -/** - * Base methods for Polymer elements. - * @class Base - */ - -(function(scope) { - - // imports - - var log = window.logFlags || {}; - - var base = { - /** - * When called in a method, invoke the method's super. - * @method super - * @param {Array} Array of arguments. - */ - super: Polymer.$super, - /** - * True if this object is a Polymer element. - * @property isPolymerElement - * @type boolean - */ - isPolymerElement: true, - /** - * MDV bind. - * @method bind - */ - bind: function() { - Polymer.bind.apply(this, arguments); - }, - /** - * MDV unbind. - * @method unbind - */ - unbind: function() { - Polymer.unbind.apply(this, arguments); - }, - /** - * MDV unbindAll. - * @method unbindAll - */ - unbindAll: function() { - Polymer.unbindAll.apply(this, arguments); - }, - /** - * Ensures MDV bindings persist. - * - * Typically, it's not necessary to call this method. Polymer - * automatically manages bindings when elements are inserted - * and removed from the document. - * - * However, if an element is created and not inserted into the document, - * cancelUnbindAll should be called to ensure bindings remain active. - * Otherwise bindings will be removed so that the element - * may be garbage collected, freeing the memory it uses. Please note that - * if cancelUnbindAll is called and the element is not inserted - * into the document, then unbindAll or asyncUnbindAll must be called - * to dispose of the element. - * - * @method cancelUnbindAll - * @param {Boolean} [preventCascade] If true, cancelUnbindAll will not - * cascade to shadowRoot children. In the case described above, - * and in general in application code, this should not be set to true. - */ - cancelUnbindAll: function(preventCascade) { - Polymer.cancelUnbindAll.apply(this, arguments); - }, - /** - * Schedules MDV bindings to be removed asynchronously. - * - * Typically, it's not necessary to call this method. Polymer - * automatically manages bindings when elements are inserted - * and removed from the document. - * - * However, if an element is created and not inserted into the document, - * cancelUnbindAll should be called to ensure bindings remain active. - * Otherwise bindings will be removed so that the element - * may be garbage collected, freeing the memory it uses. Please note that - * if cancelUnbindAll is called and the element is not inserted - * into the document, then unbindAll or asyncUnbindAll must be called - * to dispose of the element. - * - * @method asyncUnbindAll - */ - asyncUnbindAll: function() { - Polymer.asyncUnbindAll.apply(this, arguments); - }, - /** - * Schedules an async job with timeout and returns a handle. - * @method job - * @param {Polymer.Job} [job] A job handle if re-registering. - * @param {Function} callback Function to invoke. - * @param {number} [wait] Timeout in milliseconds. - * @return {Polymer.Job} A job handle which can be used to - * re-register, cancel or complete a job. - */ - job: function() { - return Polymer.job.apply(this, arguments); - }, - /** - * Invokes a function asynchronously. The context of the callback - * function is bound to 'this' automatically. - * @method asyncMethod - * @param {Function} method - * @param {Object|Array} args - * @param {number} timeout - */ - asyncMethod: function(inMethod, inArgs, inTimeout) { - // when polyfilling Object.observe, ensure changes - // propagate before executing the async method - Platform.flush(); - var args = (inArgs && inArgs.length) ? inArgs : [inArgs]; - var fn = function() { - (this[inMethod] || inMethod).apply(this, args); - }.bind(this); - return inTimeout ? window.setTimeout(fn, inTimeout) : - requestAnimationFrame(fn); - }, - /** - * Invoke a method. - * @method dispatch - * @param {string} methodName A method name. - * @param {Array} arguments - */ - dispatch: function(inMethodName, inArguments) { - if (this[inMethodName]) { - this[inMethodName].apply(this, inArguments); - } - }, - /** - * Fire an event. - * @method fire - * @param {string} type An event name. - * @param detail - * @param {Node} toNode Target node. - */ - fire: function(inType, inDetail, inToNode) { - var node = inToNode || this; - log.events && console.log('[%s]: sending [%s]', node.localName, inType); - node.dispatchEvent( - new CustomEvent(inType, {bubbles: true, detail: inDetail})); - return inDetail; - }, - /** - * Fire an event asynchronously. - * @method asyncFire - * @param {string} type An event name. - * @param detail - * @param {Node} toNode Target node. - */ - asyncFire: function(/*inType, inDetail*/) { - this.asyncMethod("fire", arguments); - }, - /** - * Remove class from old, add class to anew, if they exist - * @param classFollows - * @param anew A node. - * @param old A node - * @param className - */ - classFollows: function(anew, old, className) { - if (old) { - old.classList.remove(className); - } - if (anew) { - anew.classList.add(className); - } - } - }; - - // TODO(sjmiles): backward-compat for deprecated syntax - - base.send = base.fire; - base.asend = base.asyncFire; - - // exports - - scope.base = base; - -})(window.Polymer); diff --git a/architecture-examples/polymer/bower_components/polymer/src/bindMDV.js b/architecture-examples/polymer/bower_components/polymer/src/bindMDV.js deleted file mode 100644 index 6b415128be..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/bindMDV.js +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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. - */ - -(function() { - - // imports - - var log = window.logFlags || {}; - - // use the ExperssionSyntax - var expressionSyntax = new ExpressionSyntax; - - // bind tracking - var bindings = new SideTable(); - - function registerBinding(element, name, path) { - var b$ = bindings.get(element); - if (!b$) { - bindings.set(element, b$ = {}); - } - b$[name.toLowerCase()] = path; - } - - function unregisterBinding(element, name) { - var b$ = bindings.get(element); - if (b$) { - delete b$[name.toLowerCase()]; - } - } - - function overrideBinding(ctor) { - var proto = ctor.prototype; - var originalBind = proto.bind; - var originalUnbind = proto.unbind; - - proto.bind = function(name, model, path) { - originalBind.apply(this, arguments); - // note: must do this last because mdv may unbind before binding - registerBinding(this, name, path); - } - - proto.unbind = function(name) { - originalUnbind.apply(this, arguments); - unregisterBinding(this, name); - } - }; - - [Node, Element, Text, HTMLInputElement].forEach(overrideBinding); - - var emptyBindings = {}; - - function getBindings(element) { - return element && bindings.get(element) || emptyBindings; - } - - function getBinding(element, name) { - return getBindings(element)[name.toLowerCase()]; - } - - // model bindings - function bind(name, model, path) { - var property = Polymer.propertyForAttribute.call(this, name); - if (property) { - registerBinding(this, property, path); - Polymer.registerObserver(this, 'binding', property, - Polymer.bindProperties(this, property, model, path) - ); - } else { - HTMLElement.prototype.bind.apply(this, arguments); - } - } - - function unbind(name) { - if (!Polymer.unregisterObserver(this, 'binding', name)) { - HTMLElement.prototype.unbind.apply(this, arguments); - } - } - - function unbindAll() { - if (!isElementUnbound(this)) { - Polymer.unregisterObserversOfType(this, 'property'); - HTMLElement.prototype.unbindAll.apply(this, arguments); - // unbind shadowRoot, whee - unbindNodeTree(this.webkitShadowRoot, true); - markElementUnbound(this); - } - } - - function unbindNodeTree(node, olderShadows) { - forNodeTree(node, olderShadows, function(n) { - if (n.unbindAll) { - n.unbindAll(); - } - }); - } - - function forNodeTree(node, olderShadows, callback) { - if (!node) { - return; - } - callback(node); - if (olderShadows && node.olderShadowRoot) { - forNodeTree(node.olderShadowRoot, olderShadows, callback); - } - for (var child = node.firstChild; child; child = child.nextSibling) { - forNodeTree(child, olderShadows, callback); - } - } - - // binding state tracking - var unboundTable = new SideTable(); - - function markElementUnbound(element) { - unboundTable.set(element, true); - } - - function isElementUnbound(element) { - return unboundTable.get(element); - } - - // asynchronous binding management - var unbindAllJobTable = new SideTable(); - - function asyncUnbindAll() { - if (!isElementUnbound(this)) { - log.bind && console.log('asyncUnbindAll', this.localName); - unbindAllJobTable.set(this, this.job(unbindAllJobTable.get(this), - this.unbindAll)); - } - } - - function cancelUnbindAll(preventCascade) { - if (isElementUnbound(this)) { - log.bind && console.warn(this.localName, - 'is unbound, cannot cancel unbindAll'); - return; - } - log.bind && console.log('cancelUnbindAll', this.localName); - var unbindJob = unbindAllJobTable.get(this); - if (unbindJob) { - unbindJob.stop(); - unbindAllJobTable.set(this, null); - } - // cancel unbinding our shadow tree iff we're not in the process of - // cascading our tree (as we do, for example, when the element is inserted). - if (!preventCascade) { - forNodeTree(this.webkitShadowRoot, true, function(n) { - if (n.cancelUnbindAll) { - n.cancelUnbindAll(); - } - }); - } - } - - // bind arbitrary html to a model - function parseAndBindHTML(html, model) { - var template = document.createElement('template'); - template.innerHTML = html; - return template.createInstance(model, expressionSyntax); - } - - var mustachePattern = /\{\{([^{}]*)}}/; - - // exports - - Polymer.bind = bind; - Polymer.unbind = unbind; - Polymer.unbindAll = unbindAll; - Polymer.getBinding = getBinding; - Polymer.asyncUnbindAll = asyncUnbindAll; - Polymer.cancelUnbindAll = cancelUnbindAll; - Polymer.isElementUnbound = isElementUnbound; - Polymer.unbindNodeTree = unbindNodeTree; - Polymer.parseAndBindHTML = parseAndBindHTML; - Polymer.bindPattern = mustachePattern; - Polymer.expressionSyntax = expressionSyntax; - -})(); - diff --git a/architecture-examples/polymer/bower_components/polymer/src/bindProperties.js b/architecture-examples/polymer/bower_components/polymer/src/bindProperties.js deleted file mode 100644 index 0531d55554..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/bindProperties.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ -(function() { - - var log = window.logFlags || {}; - - // bind a property in A to a path in B by converting A[property] to a - // getter/setter pair that accesses B[...path...] - function bindProperties(inA, inProperty, inB, inPath) { - log.bind && console.log("[%s]: bindProperties: [%s] to [%s].[%s]", - inB.localName || 'object', inPath, inA.localName, inProperty); - // capture A's value if B's value is null or undefined, - // otherwise use B's value - var v = PathObserver.getValueAtPath(inB, inPath); - if (v === null || v === undefined) { - PathObserver.setValueAtPath(inB, inPath, inA[inProperty]); - } - return PathObserver.defineProperty(inA, inProperty, {object: inB, path: inPath}); - } - - // exports - Polymer.bindProperties = bindProperties; - -})(); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/boot.js b/architecture-examples/polymer/bower_components/polymer/src/boot.js deleted file mode 100644 index 94a434050c..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/boot.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012 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. - */ - -(function(scope) { - -// FOUC prevention tactic -var style = document.createElement('style'); -style.textContent = 'body {opacity: 0;}'; -var head = document.querySelector('head'); -head.insertBefore(style, head.firstChild); - -window.addEventListener('WebComponentsReady', function() { - document.body.style.webkitTransition = 'opacity 0.3s'; - document.body.style.opacity = 1; -}); - -})(); diff --git a/architecture-examples/polymer/bower_components/polymer/src/build.js b/architecture-examples/polymer/bower_components/polymer/src/build.js deleted file mode 100644 index 74b2b702cb..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/build.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - if (!window.Polymer) { - window.Polymer = {}; - } \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/events.js b/architecture-examples/polymer/bower_components/polymer/src/events.js deleted file mode 100644 index 22e19ba0df..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/events.js +++ /dev/null @@ -1,276 +0,0 @@ -/* - * 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. - */ - -(function() { - - // imports - - var log = window.logFlags || {}; - - // - // automagic event mapping - // - - var prefix = "on-"; - - var parseHostEvents = function(inAttributes, inPrototype) { -// inDefinition.eventDelegates = Platform.mixin(inDefinition.eventDelegates, -// parseEvents(inAttributes)); - inPrototype.eventDelegates = parseEvents(inAttributes); - }; - - var parseEvents = function(inAttributes) { - var events = {}; - if (inAttributes) { - for (var i=0, a; a=inAttributes[i]; i++) { - if (a.name.slice(0, prefix.length) == prefix) { - events[a.name.slice(prefix.length)] = a.value; - } - } - } - return events; - }; - - var accumulateEvents = function(inNode, inEvents) { - var events = inEvents || {}; - accumulateNodeEvents(inNode, events); - accumulateChildEvents(inNode, events); - accumulateTemplatedEvents(inNode, events); - return events; - }; - - var accumulateNodeEvents = function(inNode, inEvents) { - var a$ = inNode.attributes; - if (a$) { - for (var i=0, a; (a=a$[i]); i++) { - if (a.name.slice(0, prefix.length) === prefix) { - accumulateEvent(a.name.slice(prefix.length), inEvents); - } - } - } - }; - - var event_translations = { - webkitanimationstart: 'webkitAnimationStart', - webkitanimationend: 'webkitAnimationEnd', - webkittransitionend: 'webkitTransitionEnd', - domfocusout: 'DOMFocusOut', - domfocusin: 'DOMFocusIn' - }; - - var accumulateEvent = function(inName, inEvents) { - var n = event_translations[inName] || inName; - inEvents[n] = 1; - }; - - var accumulateChildEvents = function(inNode, inEvents) { - var cn$ = inNode.childNodes; - for (var i=0, n; (n=cn$[i]); i++) { - // TODO(sjmiles): unify calling convention (.call or not .call) - accumulateEvents(n, inEvents); - //if (n.$protected) { - // accumulateHostEvents.call(n.$protected, inEvents); - //} - } - }; - - var accumulateTemplatedEvents = function(inNode, inEvents) { - if (inNode.localName == 'template') { - var content = getTemplateContent(inNode); - if (content) { - accumulateChildEvents(content, inEvents); - } - } - } - - // TODO(sorvell): Currently in MDV, there is no way to get a template's - // effective content. A template can have a ref property - // that points to the template from which this one has been cloned. - // Remove this when the MDV api is improved - // (https://github.com/polymer-project/mdv/issues/15). - var getTemplateContent = function(inTemplate) { - return inTemplate.ref ? inTemplate.ref.content : inTemplate.content; - } - - var accumulateHostEvents = function(inEvents) { - var events = inEvents || {}; - // specifically search the __proto__ (as opposed to getPrototypeOf) - // __proto__ is simulated on platforms which don't support it naturally - // TODO(sjmiles): we walk the prototype tree to operate on the union of - // eventDelegates maps; it might be better to merge maps when extending - var p = this.__proto__; - while (p && p !== HTMLElement.prototype) { - if (p.hasOwnProperty('eventDelegates')) { - for (var n in p.eventDelegates) { - accumulateEvent(n, events); - } - } - p = p.__proto__; - } - return events; - }; - - - function bindAccumulatedEvents(inNode, inEvents, inListener) { - var fn = inListener.bind(this); - for (var n in inEvents) { - log.events && console.log('[%s] bindAccumulatedEvents: addEventListener("%s", listen)', inNode.localName || 'root', n); - inNode.addEventListener(n, fn); - } - }; - - // host events should be listened for on a host element - function bindAccumulatedHostEvents(inEvents) { - bindAccumulatedEvents.call(this, this, inEvents, listenHost); - } - - // local events should be listened for on a shadowRoot - function bindAccumulatedLocalEvents(inNode, inEvents) { - bindAccumulatedEvents.call(this, inNode, inEvents, listenLocal); - } - - // experimental delegating declarative event handler - - // TODO(sjmiles): - // we wanted to simply look for nearest ancestor - // with a 'controller' property to be WLOG - // but we need to honor ShadowDOM, so we had to - // customize this search - var findController = function(inNode) { - // find the shadow root that contains inNode - var n = inNode; - while (n.parentNode && n.localName !== 'shadow-root') { - n = n.parentNode; - } - return n.host; - }; - - var dispatch = function(inNode, inHandlerName, inArguments) { - if (inNode) { - log.events && console.group('[%s] dispatch [%s]', inNode.localName, inHandlerName); - inNode.dispatch(inHandlerName, inArguments); - log.events && console.groupEnd(); - } - }; - - function listenLocal(inEvent) { - if (inEvent.cancelBubble) { - return; - } - inEvent.on = prefix + inEvent.type; - log.events && console.group("[%s]: listenLocal [%s]", this.localName, - inEvent.on); - if (!inEvent.path || window.ShadowDOMPolyfill) { - listenLocalNoEventPath(inEvent); - } else { - var c = null; - Array.prototype.some.call(inEvent.path, function(t) { - if (t === this) { - return true; - } - c = c === this ? c : findController(t); - if (c) { - if (handleEvent.call(c, t, inEvent)) { - return true; - } - } - }, this); - } - log.events && console.groupEnd(); - } - - - // TODO(sorvell): remove when ShadowDOM polyfill supports event path. - // Note that findController will not return the expected - // controller when when the event target is a distributed node. - // This because we cannot traverse from a composed node to a node - // in shadowRoot. - // This will be addressed via an event path api - // https://www.w3.org/Bugs/Public/show_bug.cgi?id=21066 - function listenLocalNoEventPath(inEvent) { - log.events && console.log('event.path() not supported for', inEvent.type); - var t = inEvent.target, c = null; - while (t && t != this) { - c = c === this ? c : findController(t); - if (c) { - if (handleEvent.call(c, t, inEvent)) { - return; - } - } - t = t.parentNode; - } - } - - function listenHost(inEvent) { - if (inEvent.cancelBubble) { - return; - } - log.events && console.group("[%s]: listenHost [%s]", this.localName, inEvent.type); - handleHostEvent.call(this, this, inEvent); - log.events && console.groupEnd(); - } - - var eventHandledTable = new SideTable('handledList'); - - function getHandledListForEvent(inEvent) { - var handledList = eventHandledTable.get(inEvent); - if (!handledList) { - handledList = []; - eventHandledTable.set(inEvent, handledList); - } - return handledList; - } - - function handleEvent(inNode, inEvent) { - if (inNode.attributes) { - var handledList = getHandledListForEvent(inEvent); - if (handledList.indexOf(inNode) < 0) { - handledList.push(inNode); - var h = inNode.getAttribute(inEvent.on); - if (h) { - log.events && console.log('[%s] found handler name [%s]', this.localName, h); - dispatch(this, h, [inEvent, inEvent.detail, inNode]); - } - } - } - return inEvent.cancelBubble; - }; - - function handleHostEvent(inNode, inEvent) { - var h = findHostHandler.call(inNode, inEvent.type); - if (h) { - log.events && console.log('[%s] found host handler name [%s]', inNode.localName, h); - dispatch(inNode, h, [inEvent, inEvent.detail, inNode]); - } - return inEvent.cancelBubble; - }; - - // find the method name (handler) in eventDelegates mapped to inEventName - var findHostHandler = function(inEventName) { - // TODO(sjmiles): walking the tree again is inefficient; combine with code - // in accumulateHostEvents into something more sane - var p = this; - while (p) { - if (p.hasOwnProperty('eventDelegates')) { - var h = p.eventDelegates[inEventName] - || p.eventDelegates[inEventName.toLowerCase()]; - if (h) { - return h; - } - } - p = p.__proto__; - } - }; - -// exports - -Polymer.parseHostEvents = parseHostEvents; -Polymer.accumulateEvents = accumulateEvents; -Polymer.accumulateHostEvents = accumulateHostEvents; -Polymer.bindAccumulatedHostEvents = bindAccumulatedHostEvents; -Polymer.bindAccumulatedLocalEvents = bindAccumulatedLocalEvents; - -})(); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/job.js b/architecture-examples/polymer/bower_components/polymer/src/job.js deleted file mode 100644 index 25cc2e062d..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/job.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -(function() { - - // usage - - // invoke cb.call(this) in 100ms, unless the job is re-registered, - // which resets the timer - // - // this.myJob = this.job(this.myJob, cb, 100) - // - // returns a job handle which can be used to re-register a job - - var Job = function(inContext) { - this.context = inContext; - }; - Job.prototype = { - go: function(inCallback, inWait) { - this.callback = inCallback; - this.handle = setTimeout(function() { - this.handle = null; - inCallback.call(this.context); - }.bind(this), inWait); - }, - stop: function() { - if (this.handle) { - clearTimeout(this.handle); - this.handle = null; - } - }, - complete: function() { - if (this.handle) { - this.stop(); - this.callback.call(this.context); - } - } - }; - - function job(inJob, inCallback, inWait) { - var job = inJob || new Job(this); - job.stop(); - job.go(inCallback, inWait); - return job; - } - - Polymer.job = job; - -})(); diff --git a/architecture-examples/polymer/bower_components/polymer/src/lang.js b/architecture-examples/polymer/bower_components/polymer/src/lang.js deleted file mode 100644 index 6873e1b523..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/lang.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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. - */ - -(function() { - - var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach); - - // exports - - window.forEach = forEach; - -})(); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/marshal.js b/architecture-examples/polymer/bower_components/polymer/src/marshal.js deleted file mode 100644 index d072f1cb1c..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/marshal.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -// -// reference marshalling -// - -// locate nodes with id and store references to them in this.$ hash -Polymer.marshalNodeReferences = function(inRoot) { - // establish $ instance variable - var $ = this.$ = this.$ || {}; - // populate $ from nodes with ID from the LOCAL tree - if (inRoot) { - var nodes = inRoot.querySelectorAll("[id]"); - forEach(nodes, function(n) { - $[n.id] = n; - }); - } -}; \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/observeProperties.js b/architecture-examples/polymer/bower_components/polymer/src/observeProperties.js deleted file mode 100644 index adb5d56d44..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/observeProperties.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -(function() { - // - // automagic property observation side effects - // this implementation uses MDV polyfill - // - - // imports - var log = window.logFlags || {}; - - var OBSERVE_SUFFIX = 'Changed'; - - function observeProperties() { - for (var p in this) { - observeProperty.call(this, p); - } - } - - function observeProperty(inName) { - if (isObservable.call(this, inName)) { - log.observe && console.log('[' + this.localName + '] watching [' + inName + ']'); - var observer = new PathObserver(this, inName, function(inNew, inOld) { - log.data && console.log('[%s#%s] watch: [%s] now [%s] was [%s]', this.localName, this.node.id || '', inName, this[inName], inOld); - propertyChanged.call(this, inName, inOld); - }.bind(this)); - Polymer.registerObserver(this, 'property', inName, observer); - } - } - - function isObservable(inName) { - return (inName[0] != '_') - && !(inName in Object.prototype) - && Boolean(this[inName + OBSERVE_SUFFIX]); - } - - function propertyChanged(inName, inOldValue) { - //log.data && console.log('[%s#%s] propertyChanged: [%s] now [%s] was [%s]', this.node.localName, this.node.id || '', inName, this[inName], inOldValue); - var fn = inName + OBSERVE_SUFFIX; - if (this[fn]) { - this[fn](inOldValue); - } - } - - // exports - Polymer.observeProperties = observeProperties; - -})(); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/oop.js b/architecture-examples/polymer/bower_components/polymer/src/oop.js deleted file mode 100644 index 4bc6f2fddb..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/oop.js +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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. - */ - (function(scope) { - // super - - // TODO(sjmiles): - // $super must be installed on an instance or prototype chain - // as `super`, and invoked via `this`, e.g. - // `this.super();` - - // will not work if function objects are not unique, for example, - // when using mixins. - // The memoization strategy assumes each function exists on only one - // prototype chain i.e. we use the function object for memoizing) - // perhaps we can bookkeep on the prototype itself instead - function $super(inArgs) { - // since we are thunking a method call, performance is important here: - // memoize all lookups, once memoized the fast path calls no other - // functions - // - // find the caller (cannot be `strict` because of 'caller') - var caller = $super.caller; - // memoization for 'name of method' - var nom = caller.nom; - if (!nom) { - nom = nameInThis.call(this, caller); - } - if (!nom) { - console.warn('called super() on a method not installed declaratively (has no .nom property)'); - } - // super prototype is either cached or we have to find it - // by searching __proto__ (at the 'top') - if (!('_super' in caller)) { - memoizeSuper(caller, nom, Object.getPrototypeOf(this)); - } - // memoized next implementation prototype - var _super = caller._super; - if (!_super) { - // if _super is falsey, there is no super implementation - //console.warn('called $super(' + nom + ') where there is no super implementation'); - } else { - // our super function - var fn = _super[nom]; - // memoize information so 'fn' can call 'super' - if (!('_super' in fn)) { - memoizeSuper(fn, nom, _super); - } - // invoke the inherited method - // if 'fn' is not function valued, this will throw - return fn.apply(this, inArgs || []); - } - }; - - function nextSuper(inProto, inName, inCaller) { - // look for an inherited prototype that implements inName - var proto = inProto; - while (proto && - (!proto.hasOwnProperty(inName) || proto[inName] == inCaller)) { - proto = Object.getPrototypeOf(proto); - } - return proto; - }; - - function memoizeSuper(inMethod, inName, inProto) { - // find and cache next prototype containing inName - // we need the prototype so we can another lookup - // from here - inMethod._super = nextSuper(inProto, inName, inMethod); - if (inMethod._super) { - // _super is a prototype, the actual method is _super[inName] - // tag super method with it's name for further lookups - inMethod._super[inName]._nom = inName; - } - }; - - function nameInThis(inValue) { - console.group('nameInThis'); - var p = this; - while (p && p !== HTMLElement.prototype) { - var n$ = Object.getOwnPropertyNames(p); - for (var i=0, l=n$.length, n; i>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var ShadowDOMPolyfill={};!function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function d(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){switch(c){case"arguments":case"caller":case"length":case"name":case"prototype":case"toString":return}Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function e(a){var b=a.__proto__||Object.getPrototypeOf(a),c=z.get(b);if(c)return c;var d=e(b),f=n(d);return k(b,f,a),f}function f(a,b){i(a,b,!0)}function g(a,b){i(b,a,!1)}function h(a){return/^on[a-z]+$/.test(a)}function i(b,c,d){Object.getOwnPropertyNames(b).forEach(function(e){if(!(e in c)){B&&b.__lookupGetter__(e);var f;try{f=Object.getOwnPropertyDescriptor(b,e)}catch(g){f=C}var i,j;if(d&&"function"==typeof f.value)return c[e]=function(){return this.impl[e].apply(this.impl,arguments)},void 0;var k=h(e);i=k?a.getEventHandlerGetter(e):function(){return this.impl[e]},(f.writable||f.set)&&(j=k?a.getEventHandlerSetter(e):function(a){this.impl[e]=a}),Object.defineProperty(c,e,{get:i,set:j,configurable:f.configurable,enumerable:f.enumerable})}})}function j(a,b,c){var e=a.prototype;k(e,b,c),d(b,a)}function k(a,c,d){var e=c.prototype;b(void 0===z.get(a)),z.set(a,c),f(a,e),d&&g(e,d)}function l(a,b){return z.get(b.prototype)===a}function m(a){var b=Object.getPrototypeOf(a),c=e(b),d=n(c);return k(b,d,a),d}function n(a){function b(b){a.call(this,b)}return b.prototype=Object.create(a.prototype),b.prototype.constructor=b,b}function o(a){return a instanceof A.EventTarget||a instanceof A.Event||a instanceof A.DOMImplementation}function p(a){return a instanceof F||a instanceof E||a instanceof G||a instanceof D}function q(a){if(null===a)return null;b(p(a));var c=y.get(a);if(!c){var d=e(a);c=new d(a),y.set(a,c)}return c}function r(a){return null===a?null:(b(o(a)),a.impl)}function s(a){return a&&o(a)?r(a):a}function t(a){return a&&!o(a)?q(a):a}function u(a,c){null!==c&&(b(p(a)),b(void 0===c||o(c)),y.set(a,c))}function v(a,b,c){Object.defineProperty(a.prototype,b,{get:c,configurable:!0,enumerable:!0})}function w(a,b){v(a,b,function(){return q(this.impl[b])})}function x(a,b){a.forEach(function(a){b.forEach(function(b){a.prototype[b]=function(){var a=q(this);return a[b].apply(a,arguments)}})})}var y=new SideTable,z=new SideTable,A=Object.create(null);Object.getOwnPropertyNames(window);var B=/Firefox/.test(navigator.userAgent),C={get:function(){},set:function(){},configurable:!0,enumerable:!0},D=DOMImplementation,E=Event,F=Node,G=Window;a.assert=b,a.defineGetter=v,a.defineWrapGetter=w,a.forwardMethodsToWrapper=x,a.isWrapperFor=l,a.mixin=c,a.registerObject=m,a.registerWrapper=j,a.rewrap=u,a.unwrap=r,a.unwrapIfNeeded=s,a.wrap=q,a.wrapIfNeeded=t,a.wrappers=A}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){return a instanceof M.ShadowRoot}function c(a){var b=a.localName;return"content"===b||"shadow"===b}function d(a){return!!a.shadowRoot}function e(a){var b;return a.parentNode||(b=a.defaultView)&&L(b)||null}function f(f,g,h){if(h.length)return h.shift();if(b(f))return j(f)||a.getHostForShadowRoot(f);var i=a.eventParentsTable.get(f);if(i){for(var k=1;k=0;b--)if(!c(a[b]))return a[b];return null}function i(d,e){for(var g=[];d;){for(var i=[],j=e,l=void 0;j;){var n=null;if(i.length){if(c(j)&&(n=h(i),k(l))){var o=i[i.length-1];i.push(o)}}else i.push(j);if(m(j,d))return i[i.length-1];b(j)&&i.pop(),l=j,j=f(j,n,g)}d=b(d)?a.getHostForShadowRoot(d):d.parentNode}}function j(b){return a.insertionParentTable.get(b)}function k(a){return j(a)}function l(a){for(var b;b=a.parentNode;)a=b;return a}function m(a,b){return l(a)===l(b)}function n(a){switch(a){case"DOMAttrModified":case"DOMAttributeNameChanged":case"DOMCharacterDataModified":case"DOMElementNameChanged":case"DOMNodeInserted":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":return!0}return!1}function o(b){if(!O.get(b)){O.set(b,!0),n(b.type)||a.renderAllPending();var c=L(b.target),d=L(b);return p(d,c)}}function p(a,b){var c=g(b);return"load"===a.type&&2===c.length&&c[0].target instanceof M.Document&&c.shift(),W.set(a,c),q(a,c)&&r(a,c)&&s(a,c),S.set(a,v.NONE),Q.set(a,null),a.defaultPrevented}function q(a,b){for(var c,d=b.length-1;d>0;d--){var e=b[d].target,f=b[d].currentTarget;if(e!==f&&(c=v.CAPTURING_PHASE,!t(b[d],a,c)))return!1}return!0}function r(a,b){var c=v.AT_TARGET;return t(b[0],a,c)}function s(a,b){for(var c,d=a.bubbles,e=1;e=g;g++)if(d||(d=b[g].currentTarget===e),d){var h=b[g].currentTarget;(g!==f||h instanceof M.Node)&&(a[c++]=h)}a.length=c}return a},stopPropagation:function(){T.set(this,!0)},stopImmediatePropagation:function(){T.set(this,!0),U.set(this,!0)}},J(X,v,document.createEvent("Event"));var Y=x("UIEvent",v),Z=x("CustomEvent",v),$={get relatedTarget(){return R.get(this)||L(K(this).relatedTarget)}},_=I({initMouseEvent:y("initMouseEvent",14)},$),ab=I({initFocusEvent:y("initFocusEvent",5)},$),bb=x("MouseEvent",Y,_),cb=x("FocusEvent",Y,ab),db=x("MutationEvent",v,{initMutationEvent:y("initMutationEvent",3),get relatedNode(){return L(this.impl.relatedNode)}}),eb=Object.create(null),fb=function(){try{new window.MouseEvent("click")}catch(a){return!1}return!0}();if(!fb){var gb=function(a,b,c){if(c){var d=eb[c];b=I(I({},d),b)}eb[a]=b};gb("Event",{bubbles:!1,cancelable:!1}),gb("CustomEvent",{detail:null},"Event"),gb("UIEvent",{view:null,detail:0},"Event"),gb("MouseEvent",{screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},"UIEvent"),gb("FocusEvent",{relatedTarget:null},"UIEvent")}var hb=window.EventTarget,ib=["addEventListener","removeEventListener","dispatchEvent"];[Element,Window,Document].forEach(function(a){var b=a.prototype;ib.forEach(function(a){Object.defineProperty(b,a+"_",{value:b[a]})})}),B.prototype={addEventListener:function(a,b,c){if(A(b)){var d=new u(a,b,c),e=N.get(this);if(e){for(var f=0;fd;d++)b[d]=f(a[d]);return b.length=e,b}function e(a,b){a.prototype[b]=function(){return d(this.impl[b].apply(this.impl,arguments))}}var f=a.wrap;c.prototype={item:function(a){return this[a]}},b(c.prototype,"item"),a.wrappers.NodeList=c,a.addWrapNodeListMethod=e,a.wrapNodeList=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){j(a instanceof f)}function c(a,b,c,d){if(a.nodeType!==f.DOCUMENT_FRAGMENT_NODE)return a.parentNode&&a.parentNode.removeChild(a),a.parentNode_=b,a.previousSibling_=c,a.nextSibling_=d,c&&(c.nextSibling_=a),d&&(d.previousSibling_=a),[a];for(var e,g=[];e=a.firstChild;)a.removeChild(e),g.push(e),e.parentNode_=b;for(var h=0;he;e++)d.appendChild(m(b[e]));return d}function e(a){for(var b=a.firstChild;b;){j(b.parentNode===a);var c=b.nextSibling,d=m(b),e=d.parentNode;e&&s.call(e,d),b.previousSibling_=b.nextSibling_=b.parentNode_=null,b=c}a.firstChild_=a.lastChild_=null}function f(a){j(a instanceof o),g.call(this,a),this.parentNode_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_=void 0}var g=a.wrappers.EventTarget,h=a.wrappers.NodeList,i=a.defineWrapGetter,j=a.assert,k=a.mixin,l=a.registerWrapper,m=a.unwrap,n=a.wrap,o=window.Node,p=o.prototype.appendChild,q=o.prototype.insertBefore,r=o.prototype.replaceChild,s=o.prototype.removeChild,t=o.prototype.compareDocumentPosition;f.prototype=Object.create(g.prototype),k(f.prototype,{appendChild:function(a){b(a),this.invalidateShadowRenderer();var e=this.lastChild,f=null,g=c(a,this,e,f);return this.lastChild_=g[g.length-1],e||(this.firstChild_=g[0]),p.call(this.impl,d(this,g)),a},insertBefore:function(a,e){if(!e)return this.appendChild(a);b(a),b(e),j(e.parentNode===this),this.invalidateShadowRenderer();var f=e.previousSibling,g=e,h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]);var i=m(e),k=i.parentNode;return k&&q.call(k,d(this,h),i),a},removeChild:function(a){if(b(a),a.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var c=this.firstChild,d=this.lastChild,e=a.nextSibling,f=a.previousSibling,g=m(a),h=g.parentNode;return h&&s.call(h,g),c===a&&(this.firstChild_=e),d===a&&(this.lastChild_=f),f&&(f.nextSibling_=e),e&&(e.previousSibling_=f),a.previousSibling_=a.nextSibling_=a.parentNode_=null,a},replaceChild:function(a,e){if(b(a),b(e),e.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var f=e.previousSibling,g=e.nextSibling;g===a&&(g=a.nextSibling);var h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]),this.lastChild===e&&(this.lastChild_=h[h.length-1]),e.previousSibling_=null,e.nextSibling_=null,e.parentNode_=null;var i=m(e);return i.parentNode&&r.call(i.parentNode,d(this,h),i),e},hasChildNodes:function(){return null===this.firstChild},get parentNode(){return void 0!==this.parentNode_?this.parentNode_:n(this.impl.parentNode)},get firstChild(){return void 0!==this.firstChild_?this.firstChild_:n(this.impl.firstChild)},get lastChild(){return void 0!==this.lastChild_?this.lastChild_:n(this.impl.lastChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_:n(this.impl.nextSibling)},get previousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:n(this.impl.previousSibling)},get parentElement(){for(var a=this.parentNode;a&&a.nodeType!==f.ELEMENT_NODE;)a=a.parentNode;return a},get textContent(){for(var a="",b=this.firstChild;b;b=b.nextSibling)a+=b.textContent;return a},set textContent(a){if(e(this),this.invalidateShadowRenderer(),""!==a){var b=this.impl.ownerDocument.createTextNode(a);this.appendChild(b)}},get childNodes(){for(var a=new h,b=0,c=this.firstChild;c;c=c.nextSibling)a[b++]=c;return a.length=b,a},cloneNode:function(a){if(!this.invalidateShadowRenderer())return n(this.impl.cloneNode(a));var b=n(this.impl.cloneNode(!1));if(a)for(var c=this.firstChild;c;c=c.nextSibling)b.appendChild(c.cloneNode(!0));return b},contains:function(a){if(!a)return!1;if(a===this)return!0;var b=a.parentNode;return b?this.contains(b):!1},compareDocumentPosition:function(a){return t.call(this.impl,m(a))}}),i(f,"ownerDocument"),l(o,f,document.createDocumentFragment()),delete f.prototype.querySelector,delete f.prototype.querySelectorAll,f.prototype=k(Object.create(g.prototype),f.prototype),a.wrappers.Node=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a,c){for(var d,e=a.firstElementChild;e;){if(e.matches(c))return e;if(d=b(e,c))return d;e=e.nextElementSibling}return null}function c(a,b,d){for(var e=a.firstElementChild;e;)e.matches(b)&&(d[d.length++]=e),c(e,b,d),e=e.nextElementSibling;return d}var d={querySelector:function(a){return b(this,a)},querySelectorAll:function(a){return c(this,a,new NodeList)}},e={getElementsByTagName:function(a){return this.querySelectorAll(a)},getElementsByClassName:function(a){return this.querySelectorAll("."+a)},getElementsByTagNameNS:function(a,b){if("*"===a)return this.getElementsByTagName(b);for(var c=new NodeList,d=this.getElementsByTagName(b),e=0,f=0;e";case Node.TEXT_NODE:return c(a.nodeValue);case Node.COMMENT_NODE:return"";default:throw console.error(a),new Error("not implemented")}}function e(a){for(var b="",c=a.firstChild;c;c=c.nextSibling)b+=d(c);return b}function f(a,b,c){var d=c||"div";a.textContent="";var e=n(a.ownerDocument.createElement(d));e.innerHTML=b;for(var f;f=e.firstChild;)a.appendChild(o(f))}function g(a){j.call(this,a)}function h(b){k(g,b,function(){return a.renderAllPending(),this.impl[b]})}function i(b){Object.defineProperty(g.prototype,b,{value:function(){return a.renderAllPending(),this.impl[b].apply(this.impl,arguments)},configurable:!0,enumerable:!0})}var j=a.wrappers.Element,k=a.defineGetter,l=a.mixin,m=a.registerWrapper,n=a.unwrap,o=a.wrap,p=/&|<|"/g,q={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},r=window.HTMLElement;g.prototype=Object.create(j.prototype),l(g.prototype,{get innerHTML(){return e(this)},set innerHTML(a){f(this,a,this.tagName)},get outerHTML(){return d(this)},set outerHTML(a){if(this.invalidateShadowRenderer())throw new Error("not implemented");this.impl.outerHTML=a}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollLeft","scrollTop","scrollWidth"].forEach(h),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(i),m(r,g,document.createElement("b")),a.wrappers.HTMLElement=g,a.getInnerHTML=e,a.setInnerHTML=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLContentElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get select(){return this.getAttribute("select")},set select(a){this.setAttribute("select",a)},setAttribute:function(a,b){c.prototype.setAttribute.call(this,a,b),"select"===String(a).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),f&&e(f,b),a.wrappers.HTMLContentElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a),this.olderShadowRoot_=null}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLShadowElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get olderShadowRoot(){return this.olderShadowRoot_},invalidateShadowRenderer:function(){c.prototype.invalidateShadowRenderer.call(this,!0)}}),f&&e(f,b),a.wrappers.HTMLShadowElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){if(!a.defaultView)return a;var b=l.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);l.set(a,b)}return b}function c(a){for(var c,d=b(a.ownerDocument),e=d.createDocumentFragment();c=a.firstChild;)e.appendChild(c);return e}function d(a){e.call(this,a)}var e=a.wrappers.HTMLElement,f=a.getInnerHTML,g=a.mixin,h=a.registerWrapper,i=a.setInnerHTML,j=a.wrap,k=new SideTable,l=new SideTable,m=window.HTMLTemplateElement;d.prototype=Object.create(e.prototype),g(d.prototype,{get content(){if(m)return j(this.impl.content);var a=k.get(this);return a||(a=c(this),k.set(this,a)),a},get innerHTML(){return f(this.content)},set innerHTML(a){i(this.content,a),this.invalidateShadowRenderer()}}),m&&h(m,d),a.wrappers.HTMLTemplateElement=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){switch(a.localName){case"content":return new c(a);case"shadow":return new e(a);case"template":return new f(a)}d.call(this,a)}var c=a.wrappers.HTMLContentElement,d=a.wrappers.HTMLElement,e=a.wrappers.HTMLShadowElement,f=a.wrappers.HTMLTemplateElement;a.mixin;var g=a.registerWrapper,h=window.HTMLUnknownElement;b.prototype=Object.create(d.prototype),g(h,b),a.wrappers.HTMLUnknownElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";var b=a.GetElementsByInterface,c=a.ParentNodeInterface,d=a.SelectorsInterface,e=a.mixin,f=a.registerObject,g=f(document.createDocumentFragment());e(g.prototype,c),e(g.prototype,d),e(g.prototype,b);var h=f(document.createTextNode("")),i=f(document.createComment(""));a.wrappers.Comment=i,a.wrappers.DocumentFragment=g,a.wrappers.Text=h}(this.ShadowDOMPolyfill),function(a){"use strict";function b(b){var d=i(b.impl.ownerDocument.createDocumentFragment());c.call(this,d),g(d,this);var e=b.shadowRoot;a.nextOlderShadowTreeTable.set(this,e),j.set(this,b)}var c=a.wrappers.DocumentFragment,d=a.elementFromPoint,e=a.getInnerHTML,f=a.mixin,g=a.rewrap,h=a.setInnerHTML,i=a.unwrap,j=new SideTable;b.prototype=Object.create(c.prototype),f(b.prototype,{get innerHTML(){return e(this)},set innerHTML(a){h(this,a),this.invalidateShadowRenderer()},invalidateShadowRenderer:function(){return j.get(this).invalidateShadowRenderer()},elementFromPoint:function(a,b){return d(this,this.ownerDocument,a,b)},getElementById:function(a){return this.querySelector("#"+a)}}),a.wrappers.ShadowRoot=b,a.getHostForShadowRoot=function(a){return j.get(a)}}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){a.previousSibling_=a.previousSibling,a.nextSibling_=a.nextSibling,a.parentNode_=a.parentNode}function c(a){a.firstChild_=a.firstChild,a.lastChild_=a.lastChild}function d(a){E(a instanceof D);for(var d=a.firstChild;d;d=d.nextSibling)b(d);c(a)}function e(a){var b=G(a);d(a),b.textContent=""}function f(a,c){var e=G(a),f=G(c);f.nodeType===D.DOCUMENT_FRAGMENT_NODE?d(c):(h(c),b(c)),a.lastChild_=a.lastChild,a.lastChild===a.firstChild&&(a.firstChild_=a.firstChild);var g=H(e.lastChild);g&&(g.nextSibling_=g.nextSibling),e.appendChild(f)}function g(a,c){var d=G(a),e=G(c);b(c),c.previousSibling&&(c.previousSibling.nextSibling_=c),c.nextSibling&&(c.nextSibling.previousSibling_=c),a.lastChild===c&&(a.lastChild_=c),a.firstChild===c&&(a.firstChild_=c),d.removeChild(e)}function h(a){var b=G(a),c=b.parentNode;c&&g(H(c),a)}function i(a,b){k(b).push(a),A(a,b);var c=J.get(a);c||J.set(a,c=[]),c.push(b)}function j(a){I.set(a,[])}function k(a){return I.get(a)}function l(a){for(var b=[],c=0,d=a.firstChild;d;d=d.nextSibling)b[c++]=d;return b}function m(a,b,c){for(var d=l(a),e=0;e>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),function(){window.templateContent=window.templateContent||function(a){return a.content},window.wrap=window.unwrap=function(a){return a},Object.defineProperties(HTMLElement.prototype,{shadowRoot:{get:function(){return this.webkitShadowRoot}},createShadowRoot:{value:function(){return this.webkitCreateShadowRoot()}}}),window.templateContent=function(a){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(a),!a.content&&!a._content){for(var b=document.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a._content=b}return a.content||a._content}}()}if(function(a){function b(a){for(var b=a||{},d=1;d",""," "," ShadowDOM Inspector"," "," "," ",'
    ',"
",'
'," ",""].join("\n"),d=[],e=function(){var a=b.document,c=a.querySelector("#crumbs");c.textContent="";for(var e,g=0;e=d[g];g++){var h=a.createElement("a");h.href="#",h.textContent=e.localName,h.idx=g,h.onclick=function(a){for(var b;d.length>this.idx;)b=d.pop();f(b.shadow||b,b),a.preventDefault()},c.appendChild(a.createElement("li")).appendChild(h)}},f=function(a,c){var f=b.document;k=[];var g=c||a;d.push(g),e(),f.body.querySelector("#tree").innerHTML="
"+j(a,a.childNodes)+"
"},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),h={STYLE:1,SCRIPT:1,"#comment":1,TEMPLATE:1},i=function(a){return h[a.nodeName]},j=function(a,b,c){if(i(a))return"";var d=c||"";if(a.localName||11==a.nodeType){var e=a.localName||"shadow-root",f=d+l(a);"content"==e&&(b=a.getDistributedNodes()),f+="
";var h=d+"  ";g(b,function(a){f+=j(a,a.childNodes,h)}),f+=d,{br:1}[e]||(f+="</"+e+">",f+="
")}else{var k=a.textContent.trim();f=k?d+'"'+k+'"'+"
":""}return f},k=[],l=function(a){var b="<",c=a.localName||"shadow-root";return a.webkitShadowRoot||a.shadowRoot?(b+=' ",k.push(a)):b+=c||"shadow-root",a.attributes&&g(a.attributes,function(a){b+=" "+a.name+(a.value?'="'+a.value+'"':"")}),b+=">"};shadowize=function(){var a=Number(this.attributes.idx.value),b=k[a];b?f(b.webkitShadowRoot||b.shadowRoot,b):(console.log("bad shadowize node"),console.dir(this))},a.output=j}(window.Inspector),function(a){"use strict";function b(){function a(a){"splice"===a[0].type&&"splice"===a[1].type&&(b=!0)}if("function"!=typeof Object.observe&&"function"!=typeof Array.observe)return!1;var b=!1,c=[0];return Array.observe(c,a),c[1]=1,c.length=0,Object.deliverChangeRecords(a),b}function c(a){return+a===a>>>0}function d(a){return+a}function e(a){return a===Object(a)}function f(a,b){return a===b?0!==a||1/a===1/b:O(a)&&O(b)?!0:a!==a&&b!==b}function g(a){return"string"!=typeof a?!1:(a=a.replace(/\s/g,""),""==a?!0:"."==a[0]?!1:W.test(a))}function h(a){return""==a.trim()?this:c(a)?(this.push(String(a)),this):(a.split(/\./).filter(function(a){return a}).forEach(function(a){this.push(a)},this),void 0)}function i(a){for(var b=0;X>b&&a.check();)a.report(),b++}function j(a){for(var b in a)return!1;return!0}function k(a){return j(a.added)&&j(a.removed)&&j(a.changed)}function l(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function m(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function n(a){this.callback=a,this.reporting=!0,K&&(this.boundInternalCallback=this.internalCallback.bind(this)),this.valid=!0,o(this),this.connect(),this.sync(!0)}function o(a){Z&&(Y.push(a),n._allObserversCount++)}function p(a){if(Z)for(var b=0;be;e++){var f='["'+a[e]+'"]';c+=f,b+=" && "+c}return b+=") ",c+='["'+a[d-1]+'"]',b+="return "+c+"; else return undefined;",new Function("obj",b)}function v(a,b){var c=b.toString();return _[c]||(_[c]=u(b)),_[c](a)}function w(b,c,d,f,g){var h=void 0;return c.walkPropertiesFrom(b,function(b,i,j){if(j===c.length)return h=i,void 0;var k=d[j];if(!k||i!==k[0]){if(k)for(var l=0;lj;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(d[e+j-1]===a[b+k-1])i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i}function B(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(bb):(e.push(cb),d=g),b--,c--):f==h?(e.push(eb),b--,d=h):(e.push(db),c--,d=i)}else e.push(eb),b--;else e.push(db),c--;return e.reverse(),e}function C(a,b,c){for(var d=0;c>d;d++)if(a[d]!==b[d])return d;return c}function D(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&a[--d]===b[--e];)f++;return f}function E(a,b,c){return{index:a,removed:b,addedCount:c}}function F(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=C(a,d,i)),c==a.length&&f==d.length&&(h=D(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,0==c-b&&0==f-e)return[];if(b==c){for(var j=E(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[E(b,[],c-b)];for(var k=B(A(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;ob||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function H(a,b,c,d){for(var e=E(b,c,d),f=!1,g=0,h=0;h=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.indexi.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.indexh)continue;H(e,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return e}function J(a,b){var c=[];return I(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?(b.removed[0]!==a[b.index]&&c.push(b),void 0):(c=c.concat(F(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)),void 0)}),c}var K=b(),L=!1;try{var M=new Function("","return true;");L=M()}catch(N){}var O=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},P="__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},Q="[$_a-zA-Z]",R="[$_a-zA-Z0-9]",S=Q+"+"+R+"*",T="(?:[0-9]|[1-9]+[0-9]+)",U="(?:"+S+"|"+T+")",V="(?:"+U+")(?:\\."+U+")*",W=new RegExp("^"+V+"$");h.prototype=P({__proto__:[],toString:function(){return this.join(".")},walkPropertiesFrom:function(a,b,c){for(var d,e=0;ea&&b.anyChanged);n._allObserversCount=Y.length,$=!1}},Z&&(a.Platform.clearObservers=function(){Y=[]}),q.prototype=P({__proto__:n.prototype,connect:function(){K&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){K||(this.oldObject=m(this.object))},check:function(a){var b,c;if(K){if(!a)return!1;c={},b=z(this.object,a,c)}else c=this.oldObject,b=l(this.object,this.oldObject);return k(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){K?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0,this.object=void 0}}),r.prototype=P({__proto__:q.prototype,connect:function(){K&&Array.observe(this.object,this.boundInternalCallback)},sync:function(){K||(this.oldObject=this.object.slice())},check:function(a){var b;if(K){if(!a)return!1;b=J(this.object,a)}else b=F(this.object,0,this.object.length,this.oldObject,0,this.oldObject.length);return b&&b.length?(this.reportArgs=[b],!0):!1}}),r.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e0;){var e=c[d];kb[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function I(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 J(a){"TEMPLATE"===a.tagName?mb||(pb?a.__proto__=HTMLTemplateElement.prototype:F(a,HTMLTemplateElement.prototype)):(F(a,HTMLTemplateElement.prototype),Object.defineProperty(a,"content",ub))}function K(a){var b=xb.get(a);b||(b=function(){Q(a,a.model,a.bindingDelegate)},xb.set(a,b)),ob(b)}function L(a,b){this.type=a,this.value=b}function M(a){for(var b=[],c=a.length,d=0,e=0;c>e;){if(d=a.indexOf("{{",e),0>d){b.push(new L(yb,a.slice(e)));break}if(d>0&&d>e&&b.push(new L(yb,a.slice(e,d))),e=d+2,d=a.indexOf("}}",e),0>d){var f=a.slice(e-2),g=b[b.length-1];g&&g.type==yb?g.value+=f:b.push(new L(yb,f));break}var h=a.slice(e,d).trim();b.push(new L(zb,h)),e=d+2}return b}function N(a,b,c,d,e){var f,g=e&&e[ib];g&&"function"==typeof g&&(f=g(c,d,b,a),f&&(c=f,d="value")),a.bind(b,c,d)}function O(a,b,c,d,e){var f=M(c);if(f.length&&(1!=f.length||f[0].type!=yb)){if(1==f.length&&f[0].type==zb)return N(a,b,d,f[0].value,e),void 0;for(var g=new V,h=0;hc?(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>>0)+(c++ +"__")},_.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),Node.prototype.bind=e,Node.prototype.unbind=f,Node.prototype.unbindAll=g;var ab=new _;h.prototype={dispose:function(){this.model&&"function"==typeof this.model.dispose&&this.model.dispose(),this.observer.close()},set value(a){PathObserver.setValueAtPath(this.model,this.path,a)},reset:function(){this.observer.reset()}},Text.prototype.bind=j,Text.prototype.unbind=k,Text.prototype.unbindAll=l;var bb=new _;n.prototype={add:function(a,b,c,d){a.removeAttribute(b);var e="?"==b[b.length-1];e&&(b=b.slice(0,-1)),this.remove(b);var f=new h(c,d,m(a,b,e));this.bindingMap[b]=f},remove:function(a){var b=this.bindingMap[a];b&&(b.dispose(),delete this.bindingMap[a])},removeAll:function(){Object.keys(this.bindingMap).forEach(function(a){this.remove(a)},this)}},Element.prototype.bind=o,Element.prototype.unbind=p,Element.prototype.unbindAll=q;var cb,db=new _,eb=new _;!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),cb=1==d?"change":c}(),s.prototype={valueChanged:function(a){this.element[this.valueProperty]=this.produceElementValue(a)},updateBinding:function(){this.binding.value=this.element[this.valueProperty],this.binding.reset(),this.postUpdateBinding&&this.postUpdateBinding(),Platform.performMicrotaskCheckpoint()},unbind:function(){this.binding.dispose(),this.element.removeEventListener(r(this.element),this.boundUpdateBinding,!0)}},t.prototype=$({__proto__:s.prototype,produceElementValue:function(a){return String(null==a?"":a)}}),v.prototype=$({__proto__:s.prototype,produceElementValue:function(a){return Boolean(a)},postUpdateBinding:function(){"INPUT"===this.element.tagName&&"radio"===this.element.type&&u(this.element).forEach(function(a){var b=eb.get(a);b&&(b.binding.value=!1)})}}),HTMLInputElement.prototype.bind=w,HTMLInputElement.prototype.unbind=x,HTMLInputElement.prototype.unbindAll=y,z.prototype=$({__proto__:s.prototype,valueChanged:function(a){function b(){a>d.element.length&&c--?ob(b):d.element[d.valueProperty]=a}var a=this.produceElementValue(a);if(a<=this.element.length)return this.element[this.valueProperty]=a,void 0;var c=2,d=this;ob(b)},produceElementValue:function(a){return Number(a)}}),HTMLSelectElement.prototype.bind=w,HTMLSelectElement.prototype.unbind=x,HTMLSelectElement.prototype.unbindAll=y,HTMLTextAreaElement.prototype.bind=w,HTMLTextAreaElement.prototype.unbind=x,HTMLTextAreaElement.prototype.unbindAll=y;var fb="bind",gb="repeat",hb="if",ib="getBinding",jb="getInstanceModel",kb={template:!0,repeat:!0,bind:!0,ref:!0},lb={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0,OPTGROUP:!0},mb="undefined"!=typeof HTMLTemplateElement,nb="template, "+Object.keys(lb).map(function(a){return a.toLowerCase()+"[template]"}).join(", "),ob=function(){function a(){var a=this;this.value=!1;var b=this.value,e=[],f=!1;this.schedule=function(c){return e.indexOf(c)>=0?!0:f?!1:(e.push(c),b===a.value&&(a.value=!a.value),!0)},new PathObserver(this,"value",function(){f=!0;for(var g=0;g=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(;bb>ab&&d(_.charCodeAt(ab));)++ab}function j(){var a,b;for(a=ab++;bb>ab&&(b=_.charCodeAt(ab),g(b));)++ab;return _.slice(a,ab)}function k(){var a,b,c;return a=ab,b=j(),c=1===b.length?X.Identifier:h(b)?X.Keyword:"null"===b?X.NullLiteral:"true"===b||"false"===b?X.BooleanLiteral:X.Identifier,{type:c,value:b,range:[a,ab]}}function l(){var a,b,c,d,e=ab,f=_.charCodeAt(ab),g=_[ab];switch(f){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++ab,{type:X.Punctuator,value:String.fromCharCode(f),range:[e,ab]};default:if(a=_.charCodeAt(ab+1),61===a)switch(f){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:return ab+=2,{type:X.Punctuator,value:String.fromCharCode(f)+String.fromCharCode(a),range:[e,ab]};case 33:case 61:return ab+=2,61===_.charCodeAt(ab)&&++ab,{type:X.Punctuator,value:_.slice(e,ab),range:[e,ab]}}}return b=_[ab+1],c=_[ab+2],d=_[ab+3],">"===g&&">"===b&&">"===c&&"="===d?(ab+=4,{type:X.Punctuator,value:">>>=",range:[e,ab]}):">"===g&&">"===b&&">"===c?(ab+=3,{type:X.Punctuator,value:">>>",range:[e,ab]}):"<"===g&&"<"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:"<<=",range:[e,ab]}):">"===g&&">"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:">>=",range:[e,ab]}):g===b&&"+-<>&|".indexOf(g)>=0?(ab+=2,{type:X.Punctuator,value:g+b,range:[e,ab]}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ab,{type:X.Punctuator,value:g,range:[e,ab]}):(s({},$.UnexpectedToken,"ILLEGAL"),void 0)}function m(){var a,d,e;if(e=_[ab],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=ab,a="","."!==e){for(a=_[ab++],e=_[ab],"0"===a&&e&&c(e.charCodeAt(0))&&s({},$.UnexpectedToken,"ILLEGAL");c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("."===e){for(a+=_[ab++];c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("e"===e||"E"===e)if(a+=_[ab++],e=_[ab],("+"===e||"-"===e)&&(a+=_[ab++]),c(_.charCodeAt(ab)))for(;c(_.charCodeAt(ab));)a+=_[ab++];else s({},$.UnexpectedToken,"ILLEGAL");return f(_.charCodeAt(ab))&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.NumericLiteral,value:parseFloat(a),range:[d,ab]}}function n(){var a,c,d,f="",g=!1;for(a=_[ab],b("'"===a||'"'===a,"String literal must starts with a quote"),c=ab,++ab;bb>ab;){if(d=_[ab++],d===a){a="";break}if("\\"===d)if(d=_[ab++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===_[ab]&&++ab;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({},$.UnexpectedToken,"ILLEGAL"),{type:X.StringLiteral,value:f,octal:g,range:[c,ab]}}function o(a){return a.type===X.Identifier||a.type===X.Keyword||a.type===X.BooleanLiteral||a.type===X.NullLiteral}function p(){var a;return i(),ab>=bb?{type:X.EOF,range:[ab,ab]}:(a=_.charCodeAt(ab),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(_.charCodeAt(ab+1))?m():l():c(a)?m():l())}function q(){var a;return a=db,ab=a.range[1],db=p(),ab=a.range[1],a}function r(){var a;a=ab,db=p(),ab=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(cab&&(a.push(O()),!v(")"));)u(",");return u(")"),a}function F(){var a;return a=q(),o(a)||t(a),cb.createIdentifier(a.value)}function G(){return u("."),F()}function H(){var a;return u("["),a=P(),u("]"),a}function I(){var a,b,c;for(a=D();v(".")||v("[")||v("(");)v("(")?(b=E(),a=cb.createCallExpression(a,b)):v("[")?(c=H(),a=cb.createMemberExpression("[",a,c)):(c=G(),a=cb.createMemberExpression(".",a,c));return a}function J(){var a;return a=I(),db.type===X.Punctuator&&(v("++")||v("--"))&&s({},$.UnexpectedToken),a}function K(){var a,b;return db.type!==X.Punctuator&&db.type!==X.Keyword?b=J():v("++")||v("--")?s({},$.UnexpectedToken):v("+")||v("-")||v("~")||v("!")?(a=q(),b=K(),b=cb.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},$.UnexpectedToken):b=J(),b}function L(a,b){var c=0;if(a.type!==X.Punctuator&&a.type!==X.Keyword)return 0;switch(a.value){case"||":c=1;break;case"&&":c=2;break;case"|":c=3;break;case"^":c=4;break;case"&":c=5;break;case"==":case"!=":case"===":case"!==":c=6;break;case"<":case">":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function M(){var a,b,c,d,e,f,g,h,i;if(d=eb.allowIn,eb.allowIn=!0,h=K(),b=db,c=L(b,d),0===c)return h;for(b.prec=c,q(),f=K(),e=[h,b,f];(c=L(db,d))>0;){for(;e.length>2&&c<=e[e.length-2].prec;)f=e.pop(),g=e.pop().value,h=e.pop(),a=cb.createBinaryExpression(g,h,f),e.push(a);b=q(),b.prec=c,e.push(b),a=K(),e.push(a)}for(eb.allowIn=d,i=e.length-1,a=e[i];i>1;)a=cb.createBinaryExpression(e[i-1].value,e[i-2],a),i-=2;return a}function N(){var a,b,c,d;return a=M(),v("?")&&(q(),b=eb.allowIn,eb.allowIn=!0,c=O(),eb.allowIn=b,u(":"),d=O(),a=cb.createConditionalExpression(a,c,d)),a}function O(){var a,b,c;return a=db,c=b=N()}function P(){var a;return a=O()}function Q(){return u(";"),cb.createEmptyStatement()}function R(){var a=P();return x(),cb.createExpressionStatement(a)}function S(){var a,b,c,d=db.type;if(d===X.EOF&&t(db),i(),d===X.Punctuator)switch(db.value){case";":return Q();case"(":return R()}return a=P(),a.type===Z.Identifier&&v(":")?(q(),c="$"+a.name,Object.prototype.hasOwnProperty.call(eb.labelSet,c)&&s({},$.Redeclaration,"Label",a.name),eb.labelSet[c]=!0,b=S(),delete eb.labelSet[c],cb.createLabeledStatement(a,b)):(x(),cb.createExpressionStatement(a))}function T(){return db.type===X.Keyword?S():db.type!==X.EOF?S():void 0}function U(){for(var a,b=[];bb>ab&&(a=T(),"undefined"!=typeof a);)b.push(a);return b}function V(){var a;return i(),r(),a=U(),cb.createProgram(a)}function W(a,b){var c;return c=String,"string"==typeof a||a instanceof String||(a=c(a)),cb=b,_=a,ab=0,bb=_.length,db=null,eb={allowIn:!0,labelSet:{}},bb>0&&"undefined"==typeof _[0]&&a instanceof String&&(_=a.valueOf()),V()}var X,Y,Z,$,_,ab,bb,cb,db,eb;X={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},Y={},Y[X.BooleanLiteral]="Boolean",Y[X.EOF]="",Y[X.Identifier]="Identifier",Y[X.Keyword]="Keyword",Y[X.NullLiteral]="Null",Y[X.NumericLiteral]="Numeric",Y[X.Punctuator]="Punctuator",Y[X.StringLiteral]="String",Z={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"},$={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"},a.parse=W}),function(a){"use strict";function b(a,b,d,e){if(e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.tagName&&("bind"===d||"repeat"===d)){var f,g,h=b.match(r);if(h?(f=h[1],g=h[2]):(h=b.match(s),h&&(f=h[2],g=h[1])),h){var i;if(g=g.trim(),g.match(q))i=new CompoundBinding(function(a){return a.path}),i.bind("path",a,g);else try{i=c(a,g)}catch(j){console.error("Invalid expression syntax: "+g,j)}if(i)return t.set(e,f),i}}}function c(a,b){try{var c=new f;if(esprima.parse(b,c),!c.statements.length&&!c.labeledStatements.length)return;if(!c.labeledStatements.length&&c.statements.length>1)throw Error("Multiple unlabelled statements are not allowed.");var e=c.labeledStatements.length?d(c.labeledStatements):e=c.statements[0],g=[];for(var h in c.deps)g.push(h);if(!g.length)return{value:e({})};for(var i=new CompoundBinding(e),j=0;j>>0)+(c++ +"__")},i.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var j="[$_a-zA-Z]",k="[$_a-zA-Z0-9]",l=j+"+"+k+"*",m="("+l+")",n="(?:[0-9]|[1-9]+[0-9]+)",o="(?:"+l+"|"+n+")",p="(?:"+o+")(?:\\."+o+")*",q=new RegExp("^"+p+"$"),r=new RegExp("^"+m+"\\s* in (.*)$"),s=new RegExp("^(.*) as \\s*"+m+"$"),t=new i;e.prototype={getPath:function(){return this.last?this.last.getPath()+"."+this.name:this.name},valueFn:function(){var a=this.getPath();return this.deps[a]=!0,function(b){return b[a]}}};var u={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},v={"+":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}};f.prototype={getFn:function(a){return a instanceof e?a.valueFn():a},createProgram:function(){},createExpressionStatement:function(a){return this.statements.push(a),a},createLabeledStatement:function(a,b){return this.labeledStatements.push({label:a.getPath(),body:b instanceof e?b.valueFn():b}),b},createUnaryExpression:function(a,b){if(!u[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),function(c){return u[a](b(c))}},createBinaryExpression:function(a,b,c){if(!v[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),c=this.getFn(c),function(d){return v[a](b(d),c(d))}},createConditionalExpression:function(a,b,c){return a=this.getFn(a),b=this.getFn(b),c=this.getFn(c),function(d){return a(d)?b(d):c(d)}},createIdentifier:function(a){var b=new e(this.deps,a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){return new e(this.deps,c.name,b)},createLiteral:function(a){return function(){return a.value}},createArrayExpression:function(a){for(var b=0;be;e++)d.unshift("..");var g=d.join("/");return g},resolvePathsInHTML:function(a,b){b=b||p.documentUrlFromNode(a),p.resolveAttributes(a,b),p.resolveStyleElts(a,b);var c=a.querySelectorAll("template");c&&q(c,function(a){a.content&&p.resolvePathsInHTML(a.content,b)})},resolvePathsInStylesheet:function(a){var b=p.nodeUrl(a);a.__resource=p.resolveCssText(a.__resource,b)},resolveStyleElts:function(a,b){var c=a.querySelectorAll("style");c&&q(c,function(a){a.textContent=p.resolveCssText(a.textContent,b)})},resolveCssText:function(a,b){return a.replace(/url\([^)]*\)/g,function(a){var c=a.replace(/["']/g,"").slice(4,-1);return c=p.resolveUrl(b,c,!0),"url("+c+")"})},resolveAttributes:function(a,b){var c=a&&a.querySelectorAll(n);c&&q(c,function(a){this.resolveNodeAttributes(a,b)},this)},resolveNodeAttributes:function(a,b){m.forEach(function(c){var d=a.attributes[c];if(d&&d.value&&d.value.search(o)<0){var e=p.resolveUrl(b,d.value,!0);d.value=e}})}};h=h||{async:!0,ok:function(a){return a.status>=200&&a.status<300||304===a.status||0===a.status},load:function(b,c,d){var e=new XMLHttpRequest;(a.flags.debug||a.flags.bust)&&(b+="?"+Math.random()),e.open("GET",b,h.async),e.addEventListener("readystatechange",function(){4===e.readyState&&c.call(d,!h.ok(e)&&e,e.response,b)}),e.send()}};var q=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.xhr=h,a.importer=k,a.getDocumentUrl=p.getDocumentUrl,a.IMPORT_LINK_TYPE=i}(window.HTMLImports),function(a){function b(a){return"link"===a.localName&&a.getAttribute("rel")===f}function c(a){return a.parentNode&&!d(a)&&!e(a)}function d(a){return a.ownerDocument===document||a.ownerDocument.impl===document}function e(a){return a.parentNode&&"element"===a.parentNode.localName}var f="import",g={selectors:["link[rel="+f+"]","link[rel=stylesheet]","style","script"],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(a){if(!a.__importParsed){a.__importParsed=!0;var b=a.querySelectorAll(g.selectors);h(b,function(a){g[g.map[a.localName]](a)})}},parseLink:function(a){b(a)?a.content&&g.parse(a.content):this.parseGeneric(a)},parseGeneric:function(a){c(a)&&document.head.appendChild(a)},parseScript:function(a){if(c(a)){var b=a.__resource||a.textContent;b&&(b+="\n//# sourceURL="+(a.__nodeUrl||"inline["+Math.floor(1e3*(Math.random()+1))+"]")+"\n",eval.call(window,b))}}},h=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.parser=g}(HTMLImports),function(){function a(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState||"interactive"===document.readyState?a():window.addEventListener("DOMContentLoaded",a)}(),function(a){function b(a){u.push(a),t||(t=!0,q(d))}function c(a){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(a)||a}function d(){t=!1;var a=u;u=[],a.sort(function(a,b){return a.uid_-b.uid_});var b=!1;a.forEach(function(a){var c=a.takeRecords();e(a),c.length&&(a.callback_(c,a),b=!0)}),b&&d()}function e(a){a.nodes_.forEach(function(b){var c=p.get(b);c&&c.forEach(function(b){b.observer===a&&b.removeTransientObservers()})})}function f(a,b){for(var c=a;c;c=c.parentNode){var d=p.get(c);if(d)for(var e=0;e0){var e=c[d-1],f=n(e,a);if(f)return c[d-1]=f,void 0}else b(this.observer);c[d]=a},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(a){var b=this.options;b.attributes&&a.addEventListener("DOMAttrModified",this,!0),b.characterData&&a.addEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.addEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(a){var b=this.options;b.attributes&&a.removeEventListener("DOMAttrModified",this,!0),b.characterData&&a.removeEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.removeEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(a){if(a!==this.target){this.addListeners_(a),this.transientObservedNodes.push(a);var b=p.get(a);b||p.set(a,b=[]),b.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[],a.forEach(function(a){this.removeListeners_(a);for(var b=p.get(a),c=0;c1?logFlags.dom&&console.warn("inserted:",a.localName,"insert/remove count:",a.__inserted):a.insertedCallback&&(logFlags.dom&&console.log("inserted:",a.localName),a.insertedCallback())),logFlags.dom&&console.groupEnd())}function j(a){k(a),c(a,function(a){k(a)})}function k(a){(a.removedCallback||a.__upgraded__&&logFlags.dom)&&(logFlags.dom&&console.log("removed:",a.localName),l(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?logFlags.dom&&console.warn("removed:",a.localName,"insert/remove count:",a.__inserted):a.removedCallback&&a.removedCallback()))}function l(a){for(var b=a;b;){if(b==a.ownerDocument)return!0;b=b.parentNode||b.host}}function m(a){a.webkitShadowRoot&&!a.webkitShadowRoot.__watched&&(logFlags.dom&&console.log("watching shadow-root for: ",a.localName),r(a.webkitShadowRoot),a.webkitShadowRoot.__watched=!0)}function n(a){m(a),c(a,function(){m(a)})}function o(a){switch(a.localName){case"style":case"script":case"template":case void 0:return!0}}function p(a){if(logFlags.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(v(a.addedNodes,function(a){o(a)||f(a)}),v(a.removedNodes,function(a){o(a)||j(a)}))}),logFlags.dom&&console.groupEnd()}function q(){p(u.takeRecords())}function r(a){u.observe(a,{childList:!0,subtree:!0})}function s(a){r(a)}function t(a){logFlags.dom&&console.group("upgradeDocument: ",(a.URL||a._URL||"").split("/").pop()),f(a),logFlags.dom&&console.groupEnd()}var u=new MutationObserver(p),v=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.watchShadow=m,a.watchAllShadows=n,a.upgradeAll=f,a.upgradeSubtree=e,a.observeDocument=s,a.upgradeDocument=t,a.takeRecords=q}(window.CustomElements),function(){function parseElementElement(a){var b={name:"","extends":null};takeAttributes(a,b);var c=HTMLElement.prototype;if(b.extends){var d=document.createElement(b.extends);c=d.__proto__||Object.getPrototypeOf(d)}b.prototype=Object.create(c),a.options=b;var e=a.querySelector("script,scripts");e&&executeComponentScript(e.textContent,a,b.name);var f=document.register(b.name,b);a.ctor=f;var g=a.getAttribute("constructor");g&&(window[g]=f)}function takeAttributes(a,b){for(var c in b){var d=a.attributes[c];d&&(b[c]=d.value)}}function executeComponentScript(inScript,inContext,inName){context=inContext;var owner=context.ownerDocument,url=owner._URL||owner.URL||owner.impl&&(owner.impl._URL||owner.impl.URL),match=url.match(/.*\/([^.]*)[.]?.*$/);if(match){var name=match[1];url+=name!=inName?":"+inName:""}var code="__componentScript('"+inName+"', function(){"+inScript+"});"+"\n//# sourceURL="+url+"\n";eval(code)}function mixin(a,b){a=a||{};try{Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)})}catch(c){}return a}var HTMLElementElement=function(a){return a.register=HTMLElementElement.prototype.register,parseElementElement(a),a};HTMLElementElement.prototype={register:function(a){a&&(this.options.lifecycle=a.lifecycle,a.prototype&&mixin(this.options.prototype,a.prototype))}};var context;window.__componentScript=function(a,b){b.call(context)},window.HTMLElementElement=HTMLElementElement}(),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+"]","element"],map:{link:"parseLink",element:"parseElement"},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)},parseElement:function(a){new HTMLElementElement(a)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=c}(),function(){function a(){setTimeout(function(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),CustomElements.ready=!0,CustomElements.readyTime=(new Date).getTime(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))},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();else{var b=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(b,a)}}(),function(){function a(){}var b=document.createElement("style");b.textContent="element {display: none;} /* injected by platform.js */";var c=document.querySelector("head");if(c.insertBefore(b,c.firstChild),window.ShadowDOMPolyfill){CustomElements.watchShadow=a,CustomElements.watchAllShadows=a;var d=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],e={};d.forEach(function(a){e[a]=CustomElements[a]}),d.forEach(function(a){CustomElements[a]=function(b){return e[a](wrap(b))}})}}(),function(a){a=a||{};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},searchRoot:function(a,b,c){if(a){var d,e,f,g=a.elementFromPoint(b,c);for(e=this.targetingShadow(g);e;){if(d=e.elementFromPoint(b,c)){var h=this.targetingShadow(d);return this.searchRoot(h,b,c)||d}f=e.querySelector("shadow"),e=f&&f.olderShadowRoot}return g}},findTarget:function(a){var b=a.clientX,c=a.clientY;return this.searchRoot(document,b,c)}};a.targetFinding=b,a.findTarget=b.findTarget.bind(b),window.PointerEventsPolyfill=a}(window.PointerEventsPolyfill),function(){function a(a){return'[touch-action="'+a+'"]'}function b(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; }"}var c=["none","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["scroll","pan-x pan-y","pan-y pan-x"]}],d="";c.forEach(function(c){d+=String(c)===c?a(c)+b(c):c.selectors.map(a)+b(c.rule)});var e=document.createElement("style");e.textContent=d;var f=document.querySelector("head");f.insertBefore(e,f.firstChild)}(),function(a){function b(a,b){var b=b||{},e=b.buttons;if(void 0===e)switch(b.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}var f;if(c)f=new MouseEvent(a,b);else{f=document.createEvent("MouseEvent");var g={bubbles:!1,cancelable:!1,view:null,detail:null,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};Object.keys(g).forEach(function(a){a in b&&(g[a]=b[a])}),f.initMouseEvent(a,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)}d||Object.defineProperty(f,"buttons",{get:function(){return e},enumerable:!0});var h=0;return h=b.pressure?b.pressure:e?.5:0,Object.defineProperties(f,{pointerId:{value:b.pointerId||0,enumerable:!0},width:{value:b.width||0,enumerable:!0},height:{value:b.height||0,enumerable:!0},pressure:{value:h,enumerable:!0},tiltX:{value:b.tiltX||0,enumerable:!0},tiltY:{value:b.tiltY||0,enumerable:!0},pointerType:{value:b.pointerType||"",enumerable:!0},hwTimestamp:{value:b.hwTimestamp||0,enumerable:!0},isPrimary:{value:b.isPrimary||!1,enumerable:!0}}),f}var c=!1,d=!1;try{var e=new MouseEvent("click",{buttons:1});c=!0,d=1===e.buttons}catch(f){}a.PointerEvent=b}(window),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}},a.PointerMap=b}(window.PointerEventsPolyfill),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerEventsPolyfill),function(a){var b={targets:new a.SideTable,handledEvents:new a.SideTable,scrollType:new a.SideTable,pointermap:new a.PointerMap,events:[],eventMap:{},eventSources:{},registerSource:function(a,b){var c=b,d=c.events;d&&(this.events=this.events.concat(d),d.forEach(function(a){c[a]&&(this.eventMap[a]=c[a].bind(c))},this),this.eventSources[a]=c)},registerTarget:function(a,b){this.scrollType.set(a,b||"none"),this.listen(this.events,a,this.boundHandler)},unregisterTarget:function(a){this.scrollType.set(a,null),this.unlisten(this.events,a,this.boundHandler)},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){a.target.contains(a.relatedTarget)||this.leave(a),this.out(a)},enterOver:function(a){a.target.contains(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,c){a.forEach(function(a){this.addEvent(a,c,!1,b)},this)},unlisten:function(a,b,c){a.forEach(function(a){this.removeEvent(a,c,!1,b)},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){var c=new PointerEvent(a,b);return 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){var b={};for(var c in a)b[c]=a[c];return b},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:function(a){var b=this.getTarget(a);return b?b.dispatchEvent(a):void 0},asyncDispatchEvent:function(a){setTimeout(this.dispatchEvent.bind(this,a),0)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=Array.prototype.forEach.call.bind(Array.prototype.forEach),d=Array.prototype.map.call.bind(Array.prototype.map),e={ATTRIB:"touch-action",SELECTOR:"[touch-action]",EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|scroll$/,OBSERVER_INIT:{subtree:!0,childList:!0,attributes:!0,attributeFilter:["touch-action"]},watchSubtree:function(b){a.targetFinding.canTarget(b)&&h.observe(b,this.OBSERVER_INIT)},enableOnSubtree:function(a){var b=a||document;this.watchSubtree(a),b===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(b)},installNewSubtree:function(a){c(this.findElements(a),this.addElement,this)},findElements:function(a){var b=a||document;return b.querySelectorAll?b.querySelectorAll(this.SELECTOR):[]},touchActionToScrollType:function(a){var b=a;return b===this.EMITTER?"none":b===this.XSCROLLER?"X":b===this.YSCROLLER?"Y":this.SCROLLER.exec(b)?"XY":void 0},removeElement:function(c){b.unregisterTarget(c);var d=a.targetFinding.shadow(c);d&&b.unregisterTarget(d)},addElement:function(c){var d=c.getAttribute&&c.getAttribute(this.ATTRIB),e=this.touchActionToScrollType(d);if(e){b.registerTarget(c,e);var f=a.targetFinding.shadow(c);f&&b.registerTarget(f,e)}},elementChanged:function(a){this.removeElement(a),this.addElement(a)},concatLists:function(a,b){for(var c,d=0,e=b.length;e>d&&(c=b[d]);d++)a.push(c);return a},installOnLoad:function(){document.addEventListener("DOMContentLoaded",this.installNewSubtree.bind(this,document))},flattenMutationTree:function(a){var b=d(a,this.findElements,this);return b.push(a),b.reduce(this.concatLists,[])},mutationWatcher:function(a){a.forEach(this.mutationHandler,this)},mutationHandler:function(a){var b=a;if("childList"===b.type){var c=this.flattenMutationTree(b.addedNodes);c.forEach(this.addElement,this);var d=this.flattenMutationTree(b.removedNodes);d.forEach(this.removeElement,this)}else"attributes"===b.type&&this.elementChanged(b.target)}},f=e.mutationWatcher.bind(e);a.installer=e,a.register=e.enableOnSubtree.bind(e),a.setTouchAction=function(a,c){var d=this.touchActionToScrollType(c);d?b.registerTarget(a,d):b.unregisterTarget(a)}.bind(e);var g=window.MutationObserver||window.WebKitMutationObserver;if(g)var h=new g(f);else e.watchSubtree=function(){console.warn("PointerEventsPolyfill: MutationObservers not found, touch-action will not be dynamically detected")}}(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"],global:["mousedown","mouseup","mouseover","mouseout"],lastTouches:[],mouseHandler:b.eventHandler.bind(b),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);return 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);if(d&&(this.cancel(a),d=!1),!d){var e=this.prepareEvent(a);c.set(this.POINTER_ID,a),b.down(e),b.listen(this.global,document,this.mouseHandler)}}},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),b.unlisten(this.global,document,this.mouseHandler)}};b.listen(["mousemove"],document,b.boundHandler),a.mouseEvents=e}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=a.findTarget,d=b.pointermap,e=b.scrollType,f=Array.prototype.map.call.bind(Array.prototype.map),g=2500,h={events:["touchstart","touchmove","touchend","touchcancel"],POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){null===this.firstTouch&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1)},removePrimaryTouch:function(a){this.isPrimaryTouch(a)&&(this.firstTouch=null,this.firstXY=null)},touchToPointer:function(a){var d=b.cloneEvent(a);return d.pointerId=a.identifier+2,d.target=c(d),d.bubbles=!0,d.cancelable=!0,d.button=0,d.buttons=1,d.width=a.webkitRadiusX||a.radiusX,d.height=a.webkitRadiusY||a.radiusY,d.pressure=a.webkitForce||a.force,d.isPrimary=this.isPrimaryTouch(a),d.pointerType=this.POINTER_TYPE,d},processTouches:function(a,b){var c=a.changedTouches,d=f(c,this.touchToPointer,this);d.forEach(b,this)},shouldScroll:function(a){if(this.firstXY){var b,c=e.get(a.currentTarget);if("none"===c)b=!1;else if("XY"===c)b=!0;else{var d=a.changedTouches[0],f=c,g="Y"===c?"X":"Y",h=Math.abs(d["client"+f]-this.firstXY[f]),i=Math.abs(d["client"+g]-this.firstXY[g]);b=h>=i}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(d.size>=b.length){var c=[];d.ids.forEach(function(a){if(1!==a&&!this.findTouch(b,a-2)){var e=d.get(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.processTouches(a,this.overDown)},overDown:function(a){d.set(a.pointerId,{target:a.target,out:a,outTarget:a.target}),b.over(a),b.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 c=a,e=d.get(c.pointerId);if(e){var f=e.out,g=e.outTarget;b.move(c),f&&g!==c.target&&(f.relatedTarget=c.target,c.relatedTarget=g,f.target=g,c.target?(b.leaveOut(f),b.enterOver(c)):(c.target=g,c.relatedTarget=null,this.cancelOut(c))),e.out=c,e.outTarget=c.target}},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(b.up(a),b.out(a)),this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){b.cancel(a),b.out(a),this.cleanUpPointer(a)},cleanUpPointer:function(a){d.delete(a.pointerId),this.removePrimaryTouch(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,g)}}};a.touchEvents=h}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=b.pointermap,d={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var c=b.cloneEvent(a);return 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=d}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=a.installer;if(void 0===window.navigator.pointerEnabled){if(window.navigator.msPointerEnabled){var d=window.navigator.msMaxTouchPoints;Object.defineProperty(window.navigator,"maxTouchPoints",{value:d,enumerable:!0}),b.registerSource("ms",a.msEvents),b.registerTarget(document)}else b.registerSource("mouse",a.mouseEvents),void 0!==window.ontouchstart&&b.registerSource("touch",a.touchEvents),c.enableOnSubtree(document);Object.defineProperty(window.navigator,"pointerEnabled",{value:!0,enumerable:!0})}}(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)}),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){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(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={handledEvents:new a.SideTable,targets:new a.SideTable,handlers:{},recognizers:{},events:["pointerdown","pointermove","pointerup","pointerover","pointerout","pointercancel"],registerRecognizer:function(a,b){var c=b;this.recognizers[a]=c,this.events.forEach(function(a){if(c[a]){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(this.events,a)},unregisterTarget:function(a){this.unlisten(this.events,a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b,c=a.type;(b=this.handlers[c])&&this.makeQueue(b,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){var b={};for(var c in a)b[c]=a[c];return b},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)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=function(b){var c=window.PointerEventsPolyfill;c&&c.register(b),a.dispatcher.registerTarget(b)},b.registerTarget(document)}(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,pointerType:c.pointerType};"trackend"===a&&(h._releaseTarget=c.target);var 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"],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,pointerType:d.pointerType});b.dispatchEvent(g,f)}}c.delete(d.pointerId)},pointercancel:function(a){c.delete(a.pointerId)},preventTap:function(a){c.delete(a)}};b.registerRecognizer("tap",d)}(window.PointerGestures); -/* -//@ sourceMappingURL=platform.min.js.map -*/ \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/polymerSyntaxMDV.js b/architecture-examples/polymer/bower_components/polymer/src/polymerSyntaxMDV.js deleted file mode 100644 index bf0c5a9a12..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/polymerSyntaxMDV.js +++ /dev/null @@ -1,73 +0,0 @@ -(function(global) { - 'use strict'; - - function Scope() {} - - var bindPattern = /([\w\.\$]*)[\s]+as[\s]+([\w]*)/; - var repeatPattern = /([\w]*)[\s]+in[\s]+([\w\.\$]*)/; - - function createBindRepeatBinding(model, path, name, node) { - var scopeName, scopePath; - var match = path.match(repeatPattern); - if (match) { - scopeName = match[1]; - scopePath = match[2]; - } else { - match = path.match(bindPattern); - if (match) { - scopeName = match[2]; - scopePath = match[1]; - } else { - return; - } - } - var binding = new CompoundBinding(function(values) { - return values['value']; - }); - binding.bind('value', model, scopePath); - templateScopeTable.set(node, { model: model, scope: scopeName }); - return binding; - } - - function createStringIfTruthyBinding(model, className, path) { - var binding = new CompoundBinding(function(values) { - return values['value'] ? className : ''; - }); - - binding.bind('value', model, path); - return binding; - } - - var templateScopeTable = new SideTable; - - HTMLTemplateElement.syntax['Polymer'] = { - getBinding: function(model, path, name, node) { - if (node.nodeType === Node.ELEMENT_NODE && - (name === 'bind' || name === 'repeat') && - node.tagName === 'TEMPLATE') { - return createBindRepeatBinding(model, path, name, node); - } - - // {{ string: path }} - var match = path.match(/([\w]+):[\W]*([\w\.\$]*)/); - if (match) - return createStringIfTruthyBinding(model, match[1], match[2]); - }, - - getInstanceModel: function(template, model) { - var scopeInfo = templateScopeTable.get(template); - if (!scopeInfo) - return model; - - var scope; - if (scopeInfo.model) { // instanceof Scope) { - scope = Object.create(scopeInfo.model); - } else { - scope = new Scope(); - } - - scope[scopeInfo.scope] = model; - return scope; - } - }; -})(this); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/register.js b/architecture-examples/polymer/bower_components/polymer/src/register.js deleted file mode 100644 index 1702180647..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/register.js +++ /dev/null @@ -1,186 +0,0 @@ -/* - * 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. - */ - -(function(scope) { - - // imports - - var log = window.logFlags || {}; - - // api - - function register(inElement, inPrototype) { - // in the main document, parser runs script in tags in the wrong - // context, filter that out here - if (inElement == window) { - return; - } - // catch common mistake of omitting 'this' in call to register - if (!inElement || !(inElement instanceof HTMLElement)) { - throw "First argument to Polymer.register must be an HTMLElement"; - } - // TODO(sjmiles): it's not obvious at this point whether inElement - // will chain to another polymer element, so we just copy base boilerplate - // anyway - // this can result in multiple copies of boilerplate methods on a custom - // element chain, which is inefficient and has ramifications for 'super' - // also, we don't yet support intermediate prototypes in calls to - // HTMLElementElement.prototype.register, so we have to use mixin - var prototype = Platform.mixin({}, scope.base, inPrototype); - // capture defining element - prototype.elementElement = inElement; - // TODO(sorvell): install a helper method this.resolvePath to aid in - // setting resource paths. e.g. - // this.$.image.src = this.resolvePath('images/foo.png') - // Potentially remove when spec bug is addressed. - // https://www.w3.org/Bugs/Public/show_bug.cgi?id=21407 - scope.addResolvePath(prototype, inElement); - // install instance method that closes over 'inElement' - prototype.installTemplate = function() { - this.super(); - staticInstallTemplate.call(this, inElement); - }; - // hint the supercall mechanism - // TODO(sjmiles): make prototype extension api that does this - prototype.installTemplate.nom = 'installTemplate'; - // install callbacks - prototype.readyCallback = readyCallback; - prototype.insertedCallback = insertedCallback; - prototype.removedCallback = removedCallback; - prototype.attributeChangedCallback = attributeChangedCallback; - - // hint super call engine by tagging methods with names - hintSuper(prototype); - // parse declared on-* delegates into imperative form - scope.parseHostEvents(inElement.attributes, prototype); - // parse attribute-attributes - scope.publishAttributes(inElement, prototype); - // install external stylesheets as if they are inline - scope.installSheets(inElement); - scope.shimStyling(inElement); - // invoke element.register - inElement.register({prototype: prototype}); - // logging - logFlags.comps && - console.log("Polymer: element registered" + inElement.options.name); - }; - - function readyCallback() { - // invoke 'installTemplate' closure - this.installTemplate(); - // invoke boilerplate 'instanceReady' - instanceReady.call(this); - }; - - function staticInstallTemplate(inElement) { - var template = inElement.querySelector('template'); - if (template) { - // make a shadow root - var root = this.webkitCreateShadowRoot(); - // TODO(sjmiles): must be settable ex post facto - root.applyAuthorStyles = this.applyAuthorStyles; - // TODO(sjmiles): override createShadowRoot to do this automatically - CustomElements.watchShadow(this); - // TODO(sorvell): host not set per spec; we set it for convenience - // so we can traverse from root to host. - root.host = this; - // parse and apply MDV bindings - // do this before being inserted to avoid {{}} in attribute values - // e.g. to prevent from generating a 404. - root.appendChild(template.createInstance(this, Polymer.expressionSyntax)); - rootCreated.call(this, root); - return root; - } - }; - - function rootCreated(inRoot) { - // to resolve this node synchronously we must process CustomElements - // in the subtree immediately - CustomElements.takeRecords(); - // parse and apply MDV bindings - // locate nodes with id and store references to them in this.$ hash - scope.marshalNodeReferences.call(this, inRoot); - // add local events of interest... - var rootEvents = scope.accumulateEvents(inRoot); - scope.bindAccumulatedLocalEvents.call(this, inRoot, rootEvents); - // set up gestures - PointerGestures.register(inRoot); - PointerEventsPolyfill.setTouchAction(inRoot, - this.getAttribute('touch-action')); - }; - - function instanceReady(inElement) { - // install property observation side effects - // do this first so we can observe changes during initialization - scope.observeProperties.call(this); - // install boilerplate attributes - scope.installInstanceAttributes.call(this); - // process input attributes - scope.takeAttributes.call(this); - // add host-events... - var hostEvents = scope.accumulateHostEvents.call(this); - scope.bindAccumulatedHostEvents.call(this, hostEvents); - // asynchronously unbindAll... will be cancelled if inserted - this.asyncUnbindAll(); - // invoke user 'ready' - if (this.ready) { - this.ready(); - } - }; - - function insertedCallback() { - this.cancelUnbindAll(true); - // invoke user 'inserted' - if (this.inserted) { - this.inserted(); - } - } - - function removedCallback() { - this.asyncUnbindAll(); - // invoke user 'removed' - if (this.removed) { - this.removed(); - } - } - - function attributeChangedCallback() { - if (this.attributeChanged) { - this.attributeChanged.apply(this, arguments); - } - } - - function hintSuper(prototype) { - Object.getOwnPropertyNames(prototype).forEach(function(n) { - var d = Object.getOwnPropertyDescriptor(prototype, n); - if (typeof d.value == 'function') { - d.value.nom = n; - } - }); - } - - // user utility - - function findDistributedTarget(inTarget, inNodes) { - // find first ancestor of target (including itself) that - // is in inNodes, if any - var n = inTarget; - while (n && n != this) { - var i = Array.prototype.indexOf.call(inNodes, n); - if (i >= 0) { - return i; - } - n = n.parentNode; - } - } - - // exports - - scope.register = register; - scope.findDistributedTarget = findDistributedTarget; - scope.instanceReady = instanceReady; - -})(Polymer); diff --git a/architecture-examples/polymer/bower_components/polymer/src/shimStyling.js b/architecture-examples/polymer/bower_components/polymer/src/shimStyling.js deleted file mode 100644 index 9f91351b0b..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/shimStyling.js +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Copyright 2012 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. - */ - -/* - This is a limited shim for shadowDOM css styling. - https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles - - The intention here is to support only the styling features which can be - relatively simply implemented. The goal is to allow users to avoid the - most obvious pitfalls and do so without compromising performance significantly. - For shadowDOM styling that's not covered here, a set of best practices - can be provided that should allow users to accomplish more complex styling. - - The following is a list of specific shadowDOM styling features and a brief - discussion of the approach used to shim. - - Shimmed features: - - * @host: ShadowDOM allows styling of the shadowRoot's host element using the - @host rule. To shim this feature, the @host styles are reformatted and - prefixed with a given scope name and promoted to a document level stylesheet. - For example, given a scope name of .foo, a rule like this: - - @host { - * { - background: red; - } - } - - becomes: - - .foo { - background: red; - } - - * encapsultion: Styles defined within shadowDOM, apply only to - dom inside the shadowDOM. Polymer uses one of two techniques to imlement - this feature. - - By default, rules are prefixed with the host element tag name - as a descendant selector. This ensures styling does not leak out of the 'top' - of the element's shadowDOM. For example, - - div { - font-weight: bold; - } - - becomes: - - x-foo div { - font-weight: bold; - } - - becomes: - - - Alternatively, if Polymer.strictPolyfillStyling is set to true then - selectors are scoped by adding an attribute selector suffix to each - simple selector that contains the host element tag name. Each element - in the element's shadowDOM template is also given the scope attribute. - Thus, these rules match only elements that have the scope attribute. - For example, given a scope name of x-foo, a rule like this: - - div { - font-weight: bold; - } - - becomes: - - div[x-foo] { - font-weight: bold; - } - - Note that elements that are dynamically added to a scope must have the scope - selector added to them manually. - - * ::pseudo: These rules are converted to rules that take advantage of the - pseudo attribute. For example, a shadowRoot like this inside an x-foo - -
Special
- - with a rule like this: - - x-foo::x-special { ... } - - becomes: - - x-foo [pseudo=x-special] { ... } - - Unaddressed shadowDOM styling features: - - * upper/lower bound encapsulation: Styles which are defined outside a - shadowRoot should not cross the shadowDOM boundary and should not apply - inside a shadowRoot. - - This styling behavior is not emulated. Some possible ways to do this that - were rejected due to complexity and/or performance concerns include: (1) reset - every possible property for every possible selector for a given scope name; - (2) re-implement css in javascript. - - As an alternative, users should make sure to use selectors - specific to the scope in which they are working. - - * ::distributed: This behavior is not emulated. It's often not necessary - to style the contents of a specific insertion point and instead, descendants - of the host element can be styled selectively. Users can also create an - extra node around an insertion point and style that node's contents - via descendent selectors. For example, with a shadowRoot like this: - - - - - could become: - - -
- -
- - Note the use of @polyfill in the comment above a shadowDOM specific style - declaration. This is a directive to the styling shim to use the selector - in comments in lieu of the next selector when running under polyfill. -*/ -(function(scope) { - -var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach); -var concat = Array.prototype.concat.call.bind(Array.prototype.concat); -var slice = Array.prototype.slice.call.bind(Array.prototype.slice); - -var stylizer = { - hostRuleRe: /@host[^{]*{(([^}]*?{[^{]*?}[\s\S]*?)+)}/gim, - selectorRe: /([^{]*)({[\s\S]*?})/gim, - hostElementRe: /(.*)((?:\*)|(?:\:scope))(.*)/, - hostFixableRe: /^[.\[:]/, - cssCommentRe: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, - cssPolyfillCommentRe: /\/\*\s*@polyfill ([^*]*\*+([^/*][^*]*\*+)*\/)([^{]*?){/gim, - cssPseudoRe: /::(x-[^\s{,(]*)/gim, - selectorReSuffix: '([>\\s~+\[.,{:][\\s\\S]*)?$', - hostRe: /@host/gim, - cache: {}, - shimStyling: function(element) { - if (window.ShadowDOMPolyfill && element) { - // use caching to make working with styles nodes easier and to facilitate - // lookup of extendee - var name = element.options.name; - stylizer.cacheDefinition(element); - stylizer.shimPolyfillDirectives(element.styles, name); - // find styles and apply shimming... - if (Polymer.strictPolyfillStyling) { - stylizer.applyScopeToContent(element.templateContent, name); - } - stylizer.applyShimming(stylizer.stylesForElement(element), name); - } - }, - // Shim styles to be placed inside a shadowRoot. - // 1. shim @host rules and inherited @host rules - // 2. shim scoping: apply .scoped when available or pseudo-scoping when not - // (e.g. a selector 'div' becomes 'x-foo div') - shimShadowDOMStyling: function(styles, name) { - if (window.ShadowDOMPolyfill) { - stylizer.shimPolyfillDirectives(styles, name); - stylizer.applyShimming(styles, name); - } - }, - applyShimming: function(styles, name) { - var cssText = this.shimAtHost(styles, name); - cssText += this.shimScoping(styles, name); - this.addCssToDocument(cssText); - }, - cacheDefinition: function(element) { - var name = element.options.name; - var template = element.querySelector('template'); - var content = template && templateContent(template); - var styles = content && content.querySelectorAll('style'); - element.styles = styles ? slice(styles) : []; - element.templateContent = content; - stylizer.cache[name] = element; - }, - applyScopeToContent: function(root, name) { - if (root) { - forEach(root.querySelectorAll('*'), function(node) { - node.setAttribute(name, ''); - }); - forEach(root.querySelectorAll('template'), function(template) { - this.applyScopeToContent(templateContent(template), name); - }, this); - } - }, - stylesForElement: function(element) { - var styles = element.styles; - var shadow = element.templateContent && - element.templateContent.querySelector('shadow'); - if (shadow || (element.templateContent === null)) { - var extendee = this.findExtendee(element.options.name); - if (extendee) { - var extendeeStyles = this.stylesForElement(extendee); - styles = concat(slice(extendeeStyles), slice(styles)); - } - } - return styles; - }, - findExtendee: function(name) { - var element = this.cache[name]; - return element && this.cache[element.options.extends]; - }, - /* - * Process styles to convert native ShadowDOM rules that will trip - * up the css parser; we rely on decorating the stylesheet with comments. - * - * For example, we convert this rule: - * - * (comment start) @polyfill @host g-menu-item (comment end) - * shadow::-webkit-distributed(g-menu-item) { - * - * to this: - * - * scopeName g-menu-item { - * - **/ - shimPolyfillDirectives: function(styles, name) { - if (window.ShadowDOMPolyfill) { - if (styles) { - forEach(styles, function(s) { - s.textContent = this.convertPolyfillDirectives(s.textContent, name); - }, this); - } - } - }, - // form: @host { .foo { declarations } } - // becomes: scopeName.foo { declarations } - shimAtHost: function(styles, name) { - if (styles) { - return this.convertAtHostStyles(styles, name); - } - }, - /* Ensure styles are scoped. Pseudo-scoping takes a rule like: - * - * .foo {... } - * - * and converts this to - * - * scopeName .foo { ... } - */ - shimScoping: function(styles, name) { - if (styles) { - return this.convertScopedStyles(styles, name); - } - }, - convertPolyfillDirectives: function(cssText, name) { - var r = '', l = 0, matches, selector; - while (matches=this.cssPolyfillCommentRe.exec(cssText)) { - r += cssText.substring(l, matches.index); - // remove end comment delimiter (*/) - selector = matches[1].slice(0, -2).replace(this.hostRe, name); - r += this.scopeSelector(selector, name) + '{'; - l = this.cssPolyfillCommentRe.lastIndex; - } - r += cssText.substring(l, cssText.length); - return r; - }, - // consider styles that do not include component name in the selector to be - // unscoped and in need of promotion; - // for convenience, also consider keyframe rules this way. - findAtHostRules: function(cssRules, matcher) { - return Array.prototype.filter.call(cssRules, - this.isHostRule.bind(this, matcher)); - }, - isHostRule: function(matcher, cssRule) { - return (cssRule.selectorText && cssRule.selectorText.match(matcher)) || - (cssRule.cssRules && this.findAtHostRules(cssRule.cssRules, matcher).length) || - (cssRule.type == CSSRule.WEBKIT_KEYFRAMES_RULE); - }, - convertAtHostStyles: function(styles, name) { - var cssText = this.stylesToCssText(styles); - var r = '', l=0, matches; - while (matches=this.hostRuleRe.exec(cssText)) { - r += cssText.substring(l, matches.index); - r += this.scopeHostCss(matches[1], name); - l = this.hostRuleRe.lastIndex; - } - r += cssText.substring(l, cssText.length); - var selectorRe = new RegExp('^' + name + this.selectorReSuffix, 'm'); - var cssText = this.rulesToCss(this.findAtHostRules(this.cssToRules(r), - selectorRe)); - return cssText; - }, - scopeHostCss: function(cssText, name) { - var r = '', matches; - while (matches = this.selectorRe.exec(cssText)) { - r += this.scopeHostSelector(matches[1], name) +' ' + matches[2] + '\n\t'; - } - return r; - }, - // supports scopig by name and [is=name] syntax - scopeHostSelector: function(selector, name) { - var r = [], parts = selector.split(','), is = '[is=' + name + ']'; - parts.forEach(function(p) { - p = p.trim(); - // selector: *|:scope -> name - if (p.match(this.hostElementRe)) { - p = p.replace(this.hostElementRe, name + '$1$3, ' + is + '$1$3'); - // selector: .foo -> name.foo, [bar] -> name[bar] - } else if (p.match(this.hostFixableRe)) { - p = name + p + ', ' + is + p; - } - r.push(p); - }, this); - return r.join(', '); - }, - convertScopedStyles: function(styles, name) { - forEach(styles, function(s) { - if (s.parentNode) { - s.parentNode.removeChild(s); - } - }); - var cssText = this.stylesToCssText(styles).replace(this.hostRuleRe, ''); - cssText = this.convertPseudos(cssText); - var rules = this.cssToRules(cssText); - cssText = this.scopeRules(rules, name); - return cssText; - }, - convertPseudos: function(cssText) { - return cssText.replace(this.cssPseudoRe, ' [pseudo=$1]'); - }, - // change a selector like 'div' to 'name div' - scopeRules: function(cssRules, name) { - var cssText = ''; - forEach(cssRules, function(rule) { - if (rule.selectorText && (rule.style && rule.style.cssText)) { - cssText += this.scopeSelector(rule.selectorText, name, - Polymer.strictPolyfillStyling) + ' {\n\t'; - cssText += this.propertiesFromRule(rule) + '\n}\n\n'; - } else if (rule.media) { - cssText += '@media ' + rule.media.mediaText + ' {\n'; - cssText += this.scopeRules(rule.cssRules, name); - cssText += '\n}\n\n'; - } else if (rule.cssText) { - cssText += rule.cssText + '\n\n'; - } - }, this); - return cssText; - }, - propertiesFromRule: function(rule) { - var properties = rule.style.cssText; - // TODO(sorvell): Chrome cssom incorrectly removes quotes from the content - // property. (https://code.google.com/p/chromium/issues/detail?id=247231) - if (rule.style.content && !rule.style.content.match(/['"]+/)) { - properties = 'content: \'' + rule.style.content + '\';\n' + - rule.style.cssText.replace(/content:[^;]*;/g, ''); - } - return properties; - }, - selectorNeedsScoping: function(selector, name) { - var matchScope = '(' + name + '|\\[is=' + name + '\\])'; - var selectorRe = new RegExp('^' + matchScope + this.selectorReSuffix, 'm'); - return !selector.match(selectorRe); - }, - scopeSelector: function(selector, name, strict) { - var r = [], parts = selector.split(','); - parts.forEach(function(p) { - p = p.trim(); - if (this.selectorNeedsScoping(p, name)) { - p = strict ? this.applyStrictSelectorScope(p, name) : - this.applySimpleSelectorScope(p, name); - } - r.push(p); - }, this); - return r.join(', '); - }, - // scope via name and [is=name] - applySimpleSelectorScope: function(selector, name) { - return name + ' ' + selector + ', ' + '[is=' + name + '] ' + selector; - }, - // return a selector with [name] suffix on each simple selector - // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] - applyStrictSelectorScope: function(selector, name) { - var splits = [' ', '>', '+', '~'], - scoped = selector, - attrName = '[' + name + ']'; - splits.forEach(function(sep) { - var parts = scoped.split(sep); - scoped = parts.map(function(p) { - var t = p.trim(); - if (t && (splits.indexOf(t) < 0) && (t.indexOf(attrName) < 0)) { - p = t.replace(/([^:]*)(:*)(.*)/, '$1' + attrName + '$2$3') - } - return p; - }).join(sep); - }); - return scoped; - }, - stylesToCssText: function(styles, preserveComments) { - var cssText = ''; - forEach(styles, function(s) { - cssText += s.textContent + '\n\n'; - }); - // strip comments for easier processing - if (!preserveComments) { - cssText = this.stripCssComments(cssText); - } - return cssText; - }, - stripCssComments: function(cssText) { - return cssText.replace(this.cssCommentRe, ''); - }, - cssToRules: function(cssText) { - var style = document.createElement('style'); - style.textContent = cssText; - document.head.appendChild(style); - var rules = style.sheet.cssRules; - style.parentNode.removeChild(style); - return rules; - }, - rulesToCss: function(cssRules) { - for (var i=0, css=[]; i < cssRules.length; i++) { - css.push(cssRules[i].cssText); - } - return css.join('\n\n'); - }, - addCssToDocument: function(cssText) { - if (cssText) { - this.getSheet().appendChild(document.createTextNode(cssText)); - } - }, - // support for creating @host rules - getSheet: function() { - if (!this.sheet) { - this.sheet = document.createElement("style"); - this.sheet.setAttribute('polymer-polyfill', ''); - } - return this.sheet; - }, - addSheetToDocument: function() { - this.addCssToDocument('style { display: none !important; }\n'); - var head = document.querySelector('head'); - head.insertBefore(this.getSheet(), head.childNodes[0]); - } -}; - -// add polyfill stylesheet to document -if (window.ShadowDOMPolyfill) { - stylizer.addSheetToDocument(); -} - -// exports -Polymer.shimStyling = stylizer.shimStyling; -Polymer.shimShadowDOMStyling = stylizer.shimShadowDOMStyling; -Polymer.shimPolyfillDirectives = stylizer.shimPolyfillDirectives.bind(stylizer); -Polymer.strictPolyfillStyling = false; - -})(window); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/src/styling.js b/architecture-examples/polymer/bower_components/polymer/src/styling.js deleted file mode 100644 index e38836b23c..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/src/styling.js +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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. - */ - -(function() { - - // imports - var log = window.logFlags || {}; - - var doc = wrap(document); - - /** - * Install external stylesheets loaded in elements into the - * element's template. - * @param elementElement The element to style. - */ - function installSheets(elementElement) { - installLocalSheets(elementElement); - installGlobalStyles(elementElement); - } - - /** - * Takes external stylesheets loaded in an element and moves - * their content into a - + diff --git a/architecture-examples/polymer/lib-elements/polymer-selection.html b/architecture-examples/polymer/lib-elements/polymer-selection.html index c956893920..e2992dd72c 100644 --- a/architecture-examples/polymer/lib-elements/polymer-selection.html +++ b/architecture-examples/polymer/lib-elements/polymer-selection.html @@ -8,7 +8,7 @@ * @module Polymer Elements */ --> - + - + diff --git a/architecture-examples/polymer/lib-elements/polymer-selector.html b/architecture-examples/polymer/lib-elements/polymer-selector.html index feb4257f94..bef3ab5ee5 100644 --- a/architecture-examples/polymer/lib-elements/polymer-selector.html +++ b/architecture-examples/polymer/lib-elements/polymer-selector.html @@ -10,31 +10,31 @@ /** * polymer-selector is used to display a list of elements that can be selected. * The attribute "selected" indicates which element is being selected. - * Tapping on the element to change selection would fire "activate" + * Tapping on the element to change selection would fire "polymer-activate" * event. * * Example: * - * - *
Item 1
- *
Item 2
- *
Item 3
- *
+ * + *
Item 1
+ *
Item 2
+ *
Item 3
+ *
* - * polymer-selector is not styled. So one needs to use "selected" CSS class + * polymer-selector is not styled. So one needs to use "selected" CSS class * to style the selected element. * - * - * ... - * - *
Item 1
- *
Item 2
- *
Item 3
- *
+ * + * ... + * + *
Item 1
+ *
Item 2
+ *
Item 3
+ *
* * @class polymer-selector */ @@ -42,18 +42,20 @@ * Fired when an element is selected via tap. * * @event activate - * @param {Object} inDetail - * @param {Object} inDetail.item the selected element + * @param {Object} detail + * @param {Object} detail.item the selected element */ --> - + + - + From aad9dd5de1d08297893285b5a37a86aa7efd814a Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 5 Aug 2013 17:45:06 +0200 Subject: [PATCH 2/3] polymer: bower_components GC --- .../bower_components/director/.bower.json | 13 - .../bower_components/director/.gitignore | 6 - .../bower_components/director/.travis.yml | 12 - .../polymer/bower_components/director/LICENSE | 19 - .../bower_components/director/README.md | 822 ------------------ .../bower_components/director/bin/build | 79 -- .../director/examples/http.js | 33 - .../director/img/director.png | Bin 12856 -> 0 bytes .../director/img/hashRoute.png | Bin 12485 -> 0 bytes .../bower_components/director/lib/director.js | 6 - .../director/lib/director/browser.js | 297 ------- .../director/lib/director/cli.js | 65 -- .../director/lib/director/http/index.js | 251 ------ .../director/lib/director/http/methods.js | 66 -- .../director/lib/director/http/responses.js | 93 -- .../director/lib/director/router.js | 797 ----------------- .../bower_components/director/package.json | 42 - .../director/test/browser/backend/backend.js | 71 -- .../test/browser/browserify-harness.html | 24 - .../director/test/browser/helpers/api.js | 77 -- .../test/browser/html5-routes-harness.html | 23 - .../test/browser/html5-routes-test.js | 660 -------------- .../director/test/browser/routes-harness.html | 21 - .../director/test/browser/routes-test.js | 694 --------------- .../director/test/server/cli/dispatch-test.js | 55 -- .../director/test/server/cli/mount-test.js | 30 - .../director/test/server/cli/path-test.js | 39 - .../test/server/core/dispatch-test.js | 113 --- .../director/test/server/core/insert-test.js | 45 - .../director/test/server/core/mount-test.js | 117 --- .../director/test/server/core/on-test.js | 38 - .../director/test/server/core/path-test.js | 49 -- .../test/server/core/regifystring-test.js | 103 --- .../director/test/server/helpers/index.js | 52 -- .../director/test/server/helpers/macros.js | 55 -- .../director/test/server/http/accept-test.js | 88 -- .../director/test/server/http/attach-test.js | 51 -- .../director/test/server/http/before-test.js | 38 - .../director/test/server/http/http-test.js | 65 -- .../director/test/server/http/methods-test.js | 42 - .../test/server/http/responses-test.js | 21 - .../director/test/server/http/stream-test.js | 46 - .../bower_components/polymer/.bower.json | 23 - .../polymer/bower_components/polymer/LICENSE | 27 - .../bower_components/polymer/README.md | 7 - .../bower_components/polymer/bower.json | 15 - .../bower_components/polymer/build.log | 42 - .../bower_components/polymer/component.json | 17 - .../bower_components/polymer/composer.json | 36 - .../bower_components/polymer/package.json | 29 - .../polymer/polymer.native.min.js | 34 - .../polymer/polymer.sandbox.min.js | 35 - .../todomvc-common/.bower.json | 13 - 53 files changed, 5496 deletions(-) delete mode 100644 architecture-examples/polymer/bower_components/director/.bower.json delete mode 100644 architecture-examples/polymer/bower_components/director/.gitignore delete mode 100644 architecture-examples/polymer/bower_components/director/.travis.yml delete mode 100644 architecture-examples/polymer/bower_components/director/LICENSE delete mode 100644 architecture-examples/polymer/bower_components/director/README.md delete mode 100755 architecture-examples/polymer/bower_components/director/bin/build delete mode 100644 architecture-examples/polymer/bower_components/director/examples/http.js delete mode 100644 architecture-examples/polymer/bower_components/director/img/director.png delete mode 100644 architecture-examples/polymer/bower_components/director/img/hashRoute.png delete mode 100644 architecture-examples/polymer/bower_components/director/lib/director.js delete mode 100644 architecture-examples/polymer/bower_components/director/lib/director/browser.js delete mode 100644 architecture-examples/polymer/bower_components/director/lib/director/cli.js delete mode 100644 architecture-examples/polymer/bower_components/director/lib/director/http/index.js delete mode 100644 architecture-examples/polymer/bower_components/director/lib/director/http/methods.js delete mode 100644 architecture-examples/polymer/bower_components/director/lib/director/http/responses.js delete mode 100644 architecture-examples/polymer/bower_components/director/lib/director/router.js delete mode 100644 architecture-examples/polymer/bower_components/director/package.json delete mode 100644 architecture-examples/polymer/bower_components/director/test/browser/backend/backend.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/browser/browserify-harness.html delete mode 100644 architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html delete mode 100644 architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html delete mode 100644 architecture-examples/polymer/bower_components/director/test/browser/routes-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/on-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/path-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/helpers/index.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/before-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/http-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js delete mode 100644 architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/.bower.json delete mode 100644 architecture-examples/polymer/bower_components/polymer/LICENSE delete mode 100644 architecture-examples/polymer/bower_components/polymer/README.md delete mode 100644 architecture-examples/polymer/bower_components/polymer/bower.json delete mode 100644 architecture-examples/polymer/bower_components/polymer/build.log delete mode 100644 architecture-examples/polymer/bower_components/polymer/component.json delete mode 100644 architecture-examples/polymer/bower_components/polymer/composer.json delete mode 100644 architecture-examples/polymer/bower_components/polymer/package.json delete mode 100644 architecture-examples/polymer/bower_components/polymer/polymer.native.min.js delete mode 100644 architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js delete mode 100644 architecture-examples/polymer/bower_components/todomvc-common/.bower.json diff --git a/architecture-examples/polymer/bower_components/director/.bower.json b/architecture-examples/polymer/bower_components/director/.bower.json deleted file mode 100644 index 6a6f639f7c..0000000000 --- a/architecture-examples/polymer/bower_components/director/.bower.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "director", - "homepage": "https://github.com/flatiron/director", - "version": "1.2.0", - "_release": "1.2.0", - "_resolution": { - "type": "version", - "tag": "v1.2.0", - "commit": "538dee97b0d57163d682a397de674f36af4d16a1" - }, - "_source": "git://github.com/flatiron/director.git", - "_target": "*" -} \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/.gitignore b/architecture-examples/polymer/bower_components/director/.gitignore deleted file mode 100644 index ff1a80c4eb..0000000000 --- a/architecture-examples/polymer/bower_components/director/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.idea/ -node_modules -npm-debug.log -.DS_Store - -/test/browser/browserified-bundle.js diff --git a/architecture-examples/polymer/bower_components/director/.travis.yml b/architecture-examples/polymer/bower_components/director/.travis.yml deleted file mode 100644 index 2f3b02ef69..0000000000 --- a/architecture-examples/polymer/bower_components/director/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js - -node_js: - - 0.6 - - 0.8 - - "0.10" - -notifications: - email: - - travis@nodejitsu.com - irc: "irc.freenode.org#nodejitsu" - diff --git a/architecture-examples/polymer/bower_components/director/LICENSE b/architecture-examples/polymer/bower_components/director/LICENSE deleted file mode 100644 index 1f01e2b36c..0000000000 --- a/architecture-examples/polymer/bower_components/director/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Nodejitsu Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/README.md b/architecture-examples/polymer/bower_components/director/README.md deleted file mode 100644 index 522d146c47..0000000000 --- a/architecture-examples/polymer/bower_components/director/README.md +++ /dev/null @@ -1,822 +0,0 @@ - - -# Synopsis -Director is a router. Routing is the process of determining what code to run when a URL is requested. - -# Motivation -A routing library that works in both the browser and node.js environments with as few differences as possible. Simplifies the development of Single Page Apps and Node.js applications. Dependency free (doesn't require jQuery or Express, etc). - -# Status -[![Build Status](https://secure.travis-ci.org/flatiron/director.png?branch=master)](http://travis-ci.org/flatiron/director) - -# Features -* [Client-Side Routing](#client-side) -* [Server-Side HTTP Routing](#http-routing) -* [Server-Side CLI Routing](#cli-routing) - - -# Usage -* [API Documentation](#api-documentation) -* [Frequently Asked Questions](#faq) - - -## Client-side Routing -It simply watches the hash of the URL to determine what to do, for example: - -``` -http://foo.com/#/bar -``` - -Client-side routing (aka hash-routing) allows you to specify some information about the state of the application using the URL. So that when the user visits a specific URL, the application can be transformed accordingly. - - - -Here is a simple example: - -```html - - - - - A Gentle Introduction - - - - - - - -``` - -Director works great with your favorite DOM library, such as jQuery. - -```html - - - - - A Gentle Introduction 2 - - - - - -
Author Name
-
Book1, Book2, Book3
- - - -``` - -You can find a browser-specific build of `director` [here][1] which has all of the server code stripped away. - - -## Server-Side HTTP Routing - -Director handles routing for HTTP requests similar to `journey` or `express`: - -```js - // - // require the native http module, as well as director. - // - var http = require('http'), - director = require('director'); - - // - // create some logic to be routed to. - // - function helloWorld() { - this.res.writeHead(200, { 'Content-Type': 'text/plain' }) - this.res.end('hello world'); - } - - // - // define a routing table. - // - var router = new director.http.Router({ - '/hello': { - get: helloWorld - } - }); - - // - // setup a server and when there is a request, dispatch the - // route that was requested in the request object. - // - var server = http.createServer(function (req, res) { - router.dispatch(req, res, function (err) { - if (err) { - res.writeHead(404); - res.end(); - } - }); - }); - - // - // You can also do ad-hoc routing, similar to `journey` or `express`. - // This can be done with a string or a regexp. - // - router.get('/bonjour', helloWorld); - router.get(/hola/, helloWorld); - - // - // set the server to listen on port `8080`. - // - server.listen(8080); -``` - -### See Also: - - - Auto-generated Node.js API Clients for routers using [Director-Reflector](http://github.com/flatiron/director-reflector) - - RESTful Resource routing using [restful](http://github.com/flatiron/restful) - - HTML / Plain Text views of routers using [Director-Explorer](http://github.com/flatiron/director-explorer) - - -## CLI Routing - -Director supports Command Line Interface routing. Routes for cli options are based on command line input (i.e. `process.argv`) instead of a URL. - -``` js - var director = require('director'); - - var router = new director.cli.Router(); - - router.on('create', function () { - console.log('create something'); - }); - - router.on(/destroy/, function () { - console.log('destroy something'); - }); - - // You will need to dispatch the cli arguments yourself - router.dispatch('on', process.argv.slice(2).join(' ')); -``` - -Using the cli router, you can dispatch commands by passing them as a string. For example, if this example is in a file called `foo.js`: - -``` bash -$ node foo.js create -create something -$ node foo.js destroy -destroy something -``` - - -# API Documentation - -* [Constructor](#constructor) -* [Routing Table](#routing-table) -* [Adhoc Routing](#adhoc-routing) -* [Scoped Routing](#scoped-routing) -* [Routing Events](#routing-events) -* [Configuration](#configuration) -* [URL Matching](#url-matching) -* [URL Params](#url-params) -* [Route Recursion](#route-recursion) -* [Async Routing](#async-routing) -* [Resources](#resources) -* [History API](#history-api) -* [Instance Methods](#instance-methods) -* [Attach Properties to `this`](#attach-to-this) -* [HTTP Streaming and Body Parsing](#http-streaming-body-parsing) - - -## Constructor - -``` js - var router = Router(routes); -``` - - -## Routing Table - -An object literal that contains nested route definitions. A potentially nested set of key/value pairs. The keys in the object literal represent each potential part of the URL. The values in the object literal contain references to the functions that should be associated with them. *bark* and *meow* are two functions that you have defined in your code. - -``` js - // - // Assign routes to an object literal. - // - var routes = { - // - // a route which assigns the function `bark`. - // - '/dog': bark, - // - // a route which assigns the functions `meow` and `scratch`. - // - '/cat': [meow, scratch] - }; - - // - // Instantiate the router. - // - var router = Router(routes); -``` - - -## Adhoc Routing - -When developing large client-side or server-side applications it is not always possible to define routes in one location. Usually individual decoupled components register their own routes with the application router. We refer to this as _Adhoc Routing._ Lets take a look at the API `director` exposes for adhoc routing: - -**Client-side Routing** - -``` js - var router = new Router().init(); - - router.on('/some/resource', function () { - // - // Do something on `/#/some/resource` - // - }); -``` - -**HTTP Routing** - -``` js - var router = new director.http.Router(); - - router.get(/\/some\/resource/, function () { - // - // Do something on an GET to `/some/resource` - // - }); -``` - - -## Scoped Routing - -In large web appliations, both [Client-side](#client-side) and [Server-side](#http-routing), routes are often scoped within a few individual resources. Director exposes a simple way to do this for [Adhoc Routing](#adhoc-routing) scenarios: - -``` js - var router = new director.http.Router(); - - // - // Create routes inside the `/users` scope. - // - router.path(/\/users\/(\w+)/, function () { - // - // The `this` context of the function passed to `.path()` - // is the Router itself. - // - - this.post(function (id) { - // - // Create the user with the specified `id`. - // - }); - - this.get(function (id) { - // - // Retreive the user with the specified `id`. - // - }); - - this.get(/\/friends/, function (id) { - // - // Get the friends for the user with the specified `id`. - // - }); - }); -``` - - -## Routing Events - -In `director`, a "routing event" is a named property in the [Routing Table](#routing-table) which can be assigned to a function or an Array of functions to be called when a route is matched in a call to `router.dispatch()`. - -* **on:** A function or Array of functions to execute when the route is matched. -* **before:** A function or Array of functions to execute before calling the `on` method(s). - -**Client-side only** - -* **after:** A function or Array of functions to execute when leaving a particular route. -* **once:** A function or Array of functions to execute only once for a particular route. - - -## Configuration - -Given the flexible nature of `director` there are several options available for both the [Client-side](#client-side) and [Server-side](#http-routing). These options can be set using the `.configure()` method: - -``` js - var router = new director.Router(routes).configure(options); -``` - -The `options` are: - -* **recurse:** Controls [route recursion](#route-recursion). Use `forward`, `backward`, or `false`. Default is `false` Client-side, and `backward` Server-side. -* **strict:** If set to `false`, then trailing slashes (or other delimiters) are allowed in routes. Default is `true`. -* **async:** Controls [async routing](#async-routing). Use `true` or `false`. Default is `false`. -* **delimiter:** Character separator between route fragments. Default is `/`. -* **notfound:** A function to call if no route is found on a call to `router.dispatch()`. -* **on:** A function (or list of functions) to call on every call to `router.dispatch()` when a route is found. -* **before:** A function (or list of functions) to call before every call to `router.dispatch()` when a route is found. - -**Client-side only** - -* **resource:** An object to which string-based routes will be bound. This can be especially useful for late-binding to route functions (such as async client-side requires). -* **after:** A function (or list of functions) to call when a given route is no longer the active route. -* **html5history:** If set to `true` and client supports `pushState()`, then uses HTML5 History API instead of hash fragments. See [History API](#history-api) for more information. -* **run_handler_in_init:** If `html5history` is enabled, the route handler by default is executed upon `Router.init()` since with real URIs the router can not know if it should call a route handler or not. Setting this to `false` disables the route handler initial execution. - - -## URL Matching - -``` js - var router = Router({ - // - // given the route '/dog/yella'. - // - '/dog': { - '/:color': { - // - // this function will return the value 'yella'. - // - on: function (color) { console.log(color) } - } - } - }); -``` - -Routes can sometimes become very complex, `simple/:tokens` don't always suffice. Director supports regular expressions inside the route names. The values captured from the regular expressions are passed to your listener function. - -``` js - var router = Router({ - // - // given the route '/hello/world'. - // - '/hello': { - '/(\\w+)': { - // - // this function will return the value 'world'. - // - on: function (who) { console.log(who) } - } - } - }); -``` - -``` js - var router = Router({ - // - // given the route '/hello/world/johny/appleseed'. - // - '/hello': { - '/world/?([^\/]*)\/([^\/]*)/?': function (a, b) { - console.log(a, b); - } - } - }); -``` - - -## URL Parameters - -When you are using the same route fragments it is more descriptive to define these fragments by name and then use them in your [Routing Table](#routing-table) or [Adhoc Routes](#adhoc-routing). Consider a simple example where a `userId` is used repeatedly. - -``` js - // - // Create a router. This could also be director.cli.Router() or - // director.http.Router(). - // - var router = new director.Router(); - - // - // A route could be defined using the `userId` explicitly. - // - router.on(/([\w-_]+)/, function (userId) { }); - - // - // Define a shorthand for this fragment called `userId`. - // - router.param('userId', /([\\w\\-]+)/); - - // - // Now multiple routes can be defined with the same - // regular expression. - // - router.on('/anything/:userId', function (userId) { }); - router.on('/something-else/:userId', function (userId) { }); -``` - - -## Route Recursion - -Can be assigned the value of `forward` or `backward`. The recurse option will determine the order in which to fire the listeners that are associated with your routes. If this option is NOT specified or set to null, then only the listeners associated with an exact match will be fired. - -### No recursion, with the URL /dog/angry - -``` js - var routes = { - '/dog': { - '/angry': { - // - // Only this method will be fired. - // - on: growl - }, - on: bark - } - }; - - var router = Router(routes); -``` - -### Recursion set to `backward`, with the URL /dog/angry - -``` js - var routes = { - '/dog': { - '/angry': { - // - // This method will be fired first. - // - on: growl - }, - // - // This method will be fired second. - // - on: bark - } - }; - - var router = Router(routes).configure({ recurse: 'backward' }); -``` - -### Recursion set to `forward`, with the URL /dog/angry - -``` js - var routes = { - '/dog': { - '/angry': { - // - // This method will be fired second. - // - on: growl - }, - // - // This method will be fired first. - // - on: bark - } - }; - - var router = Router(routes).configure({ recurse: 'forward' }); -``` - -### Breaking out of recursion, with the URL /dog/angry - -``` js - var routes = { - '/dog': { - '/angry': { - // - // This method will be fired first. - // - on: function() { return false; } - }, - // - // This method will not be fired. - // - on: bark - } - }; - - // - // This feature works in reverse with recursion set to true. - // - var router = Router(routes).configure({ recurse: 'backward' }); -``` - - -## Async Routing - -Before diving into how Director exposes async routing, you should understand [Route Recursion](#route-recursion). At it's core route recursion is about evaluating a series of functions gathered when traversing the [Routing Table](#routing-table). - -Normally this series of functions is evaluated synchronously. In async routing, these functions are evaluated asynchronously. Async routing can be extremely useful both on the client-side and the server-side: - -* **Client-side:** To ensure an animation or other async operations (such as HTTP requests for authentication) have completed before continuing evaluation of a route. -* **Server-side:** To ensure arbitrary async operations (such as performing authentication) have completed before continuing the evaluation of a route. - -The method signatures for route functions in synchronous and asynchronous evaluation are different: async route functions take an additional `next()` callback. - -### Synchronous route functions - -``` js - var router = new director.Router(); - - router.on('/:foo/:bar/:bazz', function (foo, bar, bazz) { - // - // Do something asynchronous with `foo`, `bar`, and `bazz`. - // - }); -``` - -### Asynchronous route functions - -``` js - var router = new director.http.Router().configure({ async: true }); - - router.on('/:foo/:bar/:bazz', function (foo, bar, bazz, next) { - // - // Go do something async, and determine that routing should stop - // - next(false); - }); -``` - - -## Resources - -**Available on the Client-side only.** An object literal containing functions. If a host object is specified, your route definitions can provide string literals that represent the function names inside the host object. A host object can provide the means for better encapsulation and design. - -``` js - - var router = Router({ - - '/hello': { - '/usa': 'americas', - '/china': 'asia' - } - - }).configure({ resource: container }).init(); - - var container = { - americas: function() { return true; }, - china: function() { return true; } - }; - -``` - - -## History API - -**Available on the Client-side only.** Director supports using HTML5 History API instead of hash fragments for navigation. To use the API, pass `{html5history: true}` to `configure()`. Use of the API is enabled only if the client supports `pushState()`. - -Using the API gives you cleaner URIs but they come with a cost. Unlike with hash fragments your route URIs must exist. When the client enters a page, say http://foo.com/bar/baz, the web server must respond with something meaningful. Usually this means that your web server checks the URI points to something that, in a sense, exists, and then serves the client the JavaScript application. - -If you're after a single-page application you can not use plain old `` tags for navigation anymore. When such link is clicked, web browsers try to ask for the resource from server which is not of course desired for a single-page application. Instead you need to use e.g. click handlers and call the `setRoute()` method yourself. - - -## Attach Properties To `this` - -Generally, the `this` object bound to route handlers, will contain the request in `this.req` and the response in `this.res`. One may attach additional properties to `this` with the `router.attach` method: - -```js - var director = require('director'); - - var router = new director.http.Router().configure(options); - - // - // Attach properties to `this` - // - router.attach(function () { - this.data = [1,2,3]; - }); - - // - // Access properties attached to `this` in your routes! - // - router.get('/hello', function () { - this.res.writeHead(200, { 'content-type': 'text/plain' }); - - // - // Response will be `[1,2,3]`! - // - this.res.end(this.data); - }); -``` - -This API may be used to attach convenience methods to the `this` context of route handlers. - - -## HTTP Streaming and Body Parsing - -When you are performing HTTP routing there are two common scenarios: - -* Buffer the request body and parse it according to the `Content-Type` header (usually `application/json` or `application/x-www-form-urlencoded`). -* Stream the request body by manually calling `.pipe` or listening to the `data` and `end` events. - -By default `director.http.Router()` will attempt to parse either the `.chunks` or `.body` properties set on the request parameter passed to `router.dispatch(request, response, callback)`. The router instance will also wait for the `end` event before firing any routes. - -**Default Behavior** - -``` js - var director = require('director'); - - var router = new director.http.Router(); - - router.get('/', function () { - // - // This will not work, because all of the data - // events and the end event have already fired. - // - this.req.on('data', function (chunk) { - console.log(chunk) - }); - }); -``` - -In [flatiron][2], `director` is used in conjunction with [union][3] which uses a `BufferedStream` proxy to the raw `http.Request` instance. [union][3] will set the `req.chunks` property for you and director will automatically parse the body. If you wish to perform this buffering yourself directly with `director` you can use a simple request handler in your http server: - -``` js - var http = require('http'), - director = require('director'); - - var router = new director.http.Router(); - - var server = http.createServer(function (req, res) { - req.chunks = []; - req.on('data', function (chunk) { - req.chunks.push(chunk.toString()); - }); - - router.dispatch(req, res, function (err) { - if (err) { - res.writeHead(404); - res.end(); - } - - console.log('Served ' + req.url); - }); - }); - - router.post('/', function () { - this.res.writeHead(200, { 'Content-Type': 'application/json' }) - this.res.end(JSON.stringify(this.req.body)); - }); -``` - -**Streaming Support** - -If you wish to get access to the request stream before the `end` event is fired, you can pass the `{ stream: true }` options to the route. - -``` js - var director = require('director'); - - var router = new director.http.Router(); - - router.get('/', { stream: true }, function () { - // - // This will work because the route handler is invoked - // immediately without waiting for the `end` event. - // - this.req.on('data', function (chunk) { - console.log(chunk); - }); - }); -``` - - -## Instance methods - -### configure(options) -* `options` {Object}: Options to configure this instance with. - -Configures the Router instance with the specified `options`. See [Configuration](#configuration) for more documentation. - -### param(token, matcher) -* token {string}: Named parameter token to set to the specified `matcher` -* matcher {string|Regexp}: Matcher for the specified `token`. - -Adds a route fragment for the given string `token` to the specified regex `matcher` to this Router instance. See [URL Parameters](#url-params) for more documentation. - -### on(method, path, route) -* `method` {string}: Method to insert within the Routing Table (e.g. `on`, `get`, etc.). -* `path` {string}: Path within the Routing Table to set the `route` to. -* `route` {function|Array}: Route handler to invoke for the `method` and `path`. - -Adds the `route` handler for the specified `method` and `path` within the [Routing Table](#routing-table). - -### path(path, routesFn) -* `path` {string|Regexp}: Scope within the Routing Table to invoke the `routesFn` within. -* `routesFn` {function}: Adhoc Routing function with calls to `this.on()`, `this.get()` etc. - -Invokes the `routesFn` within the scope of the specified `path` for this Router instance. - -### dispatch(method, path[, callback]) -* method {string}: Method to invoke handlers for within the Routing Table -* path {string}: Path within the Routing Table to match -* callback {function}: Invoked once all route handlers have been called. - -Dispatches the route handlers matched within the [Routing Table](#routing-table) for this instance for the specified `method` and `path`. - -### mount(routes, path) -* routes {object}: Partial routing table to insert into this instance. -* path {string|Regexp}: Path within the Routing Table to insert the `routes` into. - -Inserts the partial [Routing Table](#routing-table), `routes`, into the Routing Table for this Router instance at the specified `path`. - -## Instance methods (Client-side only) - -### init([redirect]) -* `redirect` {String}: This value will be used if '/#/' is not found in the URL. (e.g., init('/') will resolve to '/#/', init('foo') will resolve to '/#foo'). - -Initialize the router, start listening for changes to the URL. - -### getRoute([index]) -* `index` {Number}: The hash value is divided by forward slashes, each section then has an index, if this is provided, only that section of the route will be returned. - -Returns the entire route or just a section of it. - -### setRoute(route) -* `route` {String}: Supply a route value, such as `home/stats`. - -Set the current route. - -### setRoute(start, length) -* `start` {Number} - The position at which to start removing items. -* `length` {Number} - The number of items to remove from the route. - -Remove a segment from the current route. - -### setRoute(index, value) -* `index` {Number} - The hash value is divided by forward slashes, each section then has an index. -* `value` {String} - The new value to assign the the position indicated by the first parameter. - -Set a segment of the current route. - - -# Frequently Asked Questions - -## What About SEO? - -Is using a Client-side router a problem for SEO? Yes. If advertising is a requirement, you are probably building a "Web Page" and not a "Web Application". Director on the client is meant for script-heavy Web Applications. - -# Licence - -(The MIT License) - -Copyright (c) 2010 Nodejitsu Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -[0]: http://github.com/flatiron/director -[1]: https://github.com/flatiron/director/blob/master/build/director.min.js -[2]: http://github.com/flatiron/flatiron -[3]: http://github.com/flatiron/union diff --git a/architecture-examples/polymer/bower_components/director/bin/build b/architecture-examples/polymer/bower_components/director/bin/build deleted file mode 100755 index 23e8ecff77..0000000000 --- a/architecture-examples/polymer/bower_components/director/bin/build +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env node - -var Codesurgeon = require('codesurgeon').Codesurgeon; -var surgeon = new Codesurgeon; - -var path = require('path'); - -var root = path.join(__dirname, '..'); -var lib = path.join(root, 'lib', 'director'); - -// -// Distill and package the browser version. -// -surgeon - // - .configure({ - package: root + '/package.json', - owner: 'Nodejitsu, Inc (Using Codesurgeon).', - noVersion: true - }) - .read( - path.join(lib, 'browser.js') - ) - // - // we want everything so far. specify extract with no - // parameters to get everything into the output buffer. - // - .extract() - // - // clear the input so far, but don't clear the output. - // - .clear('inputs') - // - // read the `router.js` file - // - .read( - path.join(lib, 'router.js') - ) - // - // the current input buffer contains stuff that we dont - // want in the browser build, so let's cherry pick from - // the buffer. - // - .extract( - '_every', - '_flatten', - '_asyncEverySeries', - 'paramifyString', - 'regifyString', - 'terminator', - 'Router.prototype.configure', - 'Router.prototype.param', - 'Router.prototype.on', - 'Router.prototype.dispatch', - 'Router.prototype.invoke', - 'Router.prototype.traverse', - 'Router.prototype.insert', - 'Router.prototype.insertEx', - 'Router.prototype.extend', - 'Router.prototype.runlist', - 'Router.prototype.mount' - ) - // - // wrap everything that is in the current buffer with a - // closure so that we dont get any collisions with other - // libraries - // - .wrap() - // - // write the debuggable version of the file. This file will - // get renamed to include the version from the package.json - // - .write(root + '/build/director.js') - // - // now lets make a minified version for production use. - // - .uglify() - .write(root + '/build/director.min.js') -; diff --git a/architecture-examples/polymer/bower_components/director/examples/http.js b/architecture-examples/polymer/bower_components/director/examples/http.js deleted file mode 100644 index 4e7a1d7208..0000000000 --- a/architecture-examples/polymer/bower_components/director/examples/http.js +++ /dev/null @@ -1,33 +0,0 @@ -var http = require('http'), - director = require('../lib/director'); - -var router = new director.http.Router(); - -var server = http.createServer(function (req, res) { - req.chunks = []; - req.on('data', function (chunk) { - req.chunks.push(chunk.toString()); - }); - - router.dispatch(req, res, function (err) { - if (err) { - res.writeHead(404); - res.end(); - } - - console.log('Served ' + req.url); - }); -}); - -router.get(/foo/, function () { - this.res.writeHead(200, { 'Content-Type': 'text/plain' }); - this.res.end('hello world\n'); -}); - -router.post(/foo/, function () { - this.res.writeHead(200, { 'Content-Type': 'application/json' }); - this.res.end(JSON.stringify(this.req.body)); -}); - -server.listen(8080); -console.log('vanilla http server with director running on 8080'); diff --git a/architecture-examples/polymer/bower_components/director/img/director.png b/architecture-examples/polymer/bower_components/director/img/director.png deleted file mode 100644 index ce1a92ae5c718312e566dec1e56ba92835935662..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12856 zcma)jbzECPvnVyRI0W~WQV8zuUaYtj*OCw*xE3o8rL+`lDeexzwV_A|6qn!>C|;nr zz0gnIefQma-^(AHv*$N6JG(nOGdnXUT3b^YAD0>z0|NtJRYl__tCfwjod=_}or9B$B=det2Q#CStt7LdpazeItGu0~lZv0a zovxpzo{gWgji@cNv=pO+j~JQ&*v`X>(FY82fr|M^GXJG3hJL<#&CSgC7sSI^lKCG@ z8EI%U%0t}k7zMd_IBj@@co>Cvxp?^ngoTBHjC?%2Jls5d+`N38yuxDqd}2I2jQ{*G zqepYMwHJG-p!CnN&^<|JM-LBIF>Y>eZ*MMdelCc+12?azsOTLHK0Zz~1Sizj#ly;n z(*?@%FA55FP#bqAR}UwM3*#L{D{F|Sha@wa(|=3>?D}uAF3^826MDh8eXLx$dAWG* zrt~jB4UPX96b$}1G}Pmz-T&tIza$LR^L4f3erX4Vc)Hu5H_o2rZYWnVd3QT24~V-S z1OockDr!4IJRndnFsR!oRj zkVimJP?4XXM}(JGkyln!K}cRukw;dEUsyz#SNLDJ3J@Dlu$_y?zi@5QxFUi=0zACJ z0{<=UohX1^(IYF^xjT8;*($k1z>I&VEavpz^CJJ>()%Z_?SH|`Kj)$F-{Nwknc=?M z*#EH6|9XX%p1a3?i!HkIZ^5^7K})+kTCA;Pn&221TxF^XvU)zVJD;7PbjmX~rZse? zHFo{cq}}gTtQJW)c79_RyabZ7Mcw!HQPlr%OVJq+nyN)4oyDj|-ug9$na@;~%{qE+L`whswq#mr8^83dv{l%b(v$(p}~>k()9Q1gD<#i|4ewJrMSGJLX0V# zNbaZdC%6GNQ~0}STy&Sj^zNMsD1t~1JGva*FjbSIoACb;LAQl$6`v}cIJ~`}aPqq&m8yoWo?v9-=!8g7Q{-=BC-L`tSF89fA<9qTZ z&oe{;`@I`e;@-IeE_NLTM%(kT$A`5O0^>0p1P-~a2Dh-9nw3-U-MLNk;}XLr1P8}u zy069GnPK4J;ZbA-p3KZA2Jidt5e`eNy0jiBS;$zl`i$(()*~Q0++1AEU%t>=yg8B% z)=1?xYh0>m*%Rw8yR?ca_-9Ys`=;1&dloY@@;8Iw`fP{#e zJDz(yJXs7RDl(wiHCPrV&E;_`kUU_UvLVu82WRi|OHni%8pfSyy+WJ$gC6NNDtpTr^g^MKg zvOje*=M47B0#;`Bx>dv;sa@do9u7367~)M`*ojU7ZDSLme*P6uEJAt@$u|ECe+vN_ zHEbr>P!n{6OXB=zavLdWVpDN(@e9{WerFtK$O1zm)-;?M6z2J&ktodPjiy8@R^ud4 zVOzZ}#K_EH#iq9ei+!g3Sk|PGCcmppTRkj4>-XSmm`}+V1|TuthQqi165ft4QR~V{ zA1kaGwmYRRPn($Em4MZi*x={=)&AO5Qv$p2LYVZEkF-#zwKKnzFuev1Lu_R%*41=S zTb*7ZlT_h|fRQon03*8@O8)Z;3kzi*P97AnNBDT3l5g_@245$Y z0&0(o$PJD?w|hvn)Js0T-O_1^(rf!u>0M?Zft`v^DgPM!#t7J5y+)(8$s0Q-DZ5L|i-Z7$2k$Ws2%jkq_=)4GXf)UMcz9-kf$^Te6vuO>YEODE7@LyG9Rx zLC8>cem{?TX7xoXaJF!n+BrRDe6Jn2+qPHm0@NRNr+;UeU_o$~#6>^%tAcJX7cWJBm|gC9cc8Lj^VKd23Jcq&-G|E|vt@@(z_Oiw zTfiQ@_jTtz=?T?4YXBxiNwzO->>m!e+gT3TE5zPs*d8b-G#Yc*xfk8R+9`A>k|-_X3^U;EP0x##o^{QU*52=l|>qg zFFfZOw%Aax>ceBq+Emfv4CXrQJf6D5{rGpGA4a%Yq`p2}+_30_|2ljtM`jvyrHIXT zMtl#*vyBoc#KY#($csuw;%PjuVg0H-?3Xa+Y)wsARAP7iJ%#zaGymyIOea(L&rN)Y zPniF%vxRAzzjIi|8;=paIHHc@a>%g((CPri9dv*Pp|i-sVY+M_gs=3(6dc+>-{2%W zd<#^JJ2;6rs|g;{5I(PJYM;&c1S$R{n_7ALAkQom@aWDo3q&zwCX)|>f`We88B)D6 z9oA>;CB6@T7!tU6xv(L1)!NHDz#ac@1h!nIp(}u5NRhnv%WnnFOQ=voW+!g9O4+hnMPO=$Ei$unGN=jX_Xp-DV^R`>1}f`S6~d^m6q+U`4kbuZ($;HUM9 z7#r+SmEZ%;hPj%_)68fhISSK4c(mgT2J4a-(5-C6FU4!;S9khX6y!msy>n&;I^WZ^+Fe!>Z?J0R>;p@~Q%XllgSx2LENXO;;zF#R}DJ~)r zNh>iP z=~@8PUPsagn9wjeUO3&N8$f6iNtHqY-NuIbCE>$r{B@kKmpIDFoLvN)_Bl8ZLGQ-n zh39v?B5xY5u!vLJ=`t2A`%Gj84K6%{&(X9r%(_d3)8xgvYQfsPZi(KK? ziSC(#e+M>9XS|PQaN}c`ZZ%I+R6SzvU^>ft5c|o;vF7?>s$=g4-CRJk0uEKP>}ksE z5G%%Oop7NO2N1xe)hAS+LA9?a`8zB4Suyrtq2-1^UYP!>FSCw|^H&#+7U9GhH@zqCY7xdl|5Yq1i-PQc~F(~|;pcDl_nsO`mr z1aCde^((XqIzsld8eykLTg~mOXa4!jSM#X~XX?TXC$jxTnVrPb5oJ}QLB+Lzg5e)n z>Wfw9*H2ps1C}000SmT%fL@q10vyQD=RD(D!eCUD^pGFzymOkvqkOA=hTuN9F3ih1 zbF-Hyuif9sa^F)uv?IqW&3ngMpgHsA z`HG_U;$cd|8IqmD=acnpqVZ2Ji&dR*w+`N11QsTN9{b;`mSf9wMS1epE8&ZCn0R0o zLuel+*&f+V*6q~>2h^$jopLJ?^+T*|k)W$a3QA`$!55T{>xzuTduS`Y8ni_aSUdrs zM8YEp=ng{zR^T|?&Ee5!^WKYS(VM0{f3WiH%J78vSvXEe&Sok!I@U?;jpJzIWuf$S ze<4FsAX>BR_Yj8EZOTVg#ltWQex~+50~)~3zA@ZXG2kQXu_2E)6>W&+Zyyw?~ zmB*_euG(!CVKBm?cqbW;^r~6QNjeSY$H4~tPR!*(_*hIzdBnn_RQ}B|hI_IPXG93k z<}>Z5-+RHZF$_*5Pv=$(>C+zd?;kX`z!PQOTPV2(pCc?zj^fMvr`d6^rN{|{T7vb2 zb{3$SI#VDs2l_JXXD)z_I*)!%`;TdXmly0VbWhP&RvnBoZdhey2j6w?g&BB8BZ0Qs*t)c5lH0USvqT}CcDEc61W%-^F3 z-7J%=Wgt(B8` z>C-{^3}s5`g~USZI|*@ddf_Prn^{*spDnz93LH&ncn&llDqQK5d=i-H{1LDnTkjtc zp?=GE{*$)MIXxY`MUoR=uhl&GIrsQzZ`ZEV(9p}mn5z z;S$k52xhaW$5x}j!E>V&0mWnjc#8AE;|RtvEp>^giueSW&hSLgdt_+*D?Mw)F^}u( z{oqAmLDEWnU>~=eE>-8KK=$=yL;ITW!!-X$JLHF=%l(c;aSUE=gEv zhA9E%RHxUOaH^jY0HqZOv)3sNcn;v#1CxZYMx!0nrc=iS%*Lc{X1p?k#FAwmqkR}0 zhgyDv7QEM;UXljFnvzvQqMsy)F+Y-q6ALH(j8_XgmhFXt!LtO&Z-a*RmZ=ntz}+Zz zl(O`N4tEZWM|KY4a#KdZ#i@6*zopjF{QmBsq<0R#YODLn#WmD&9x>Q#*7(a{eoIi3 z)6qo9ad05^5=5+>(33z_k@QC;fS41gr4XglDL{i7XE4>80tgksB#3D)G}@A{+2|%W zUgNqj|$pRj|mhGE!`jOMuAuOja(SX+^fR<&l5!L(5H;tGI;kxU3SS zYNbW+l;rIwdha4cY}jN!fz%xeq{U78 zJA2JaAf)L_PT6=#+VW@iLQB{>*69S3vr9`~Au01a0Y8pMiMjPGwEhVDYpt+);2~C& z1T;WR7TC}^E%0XTJuB?|`9dE8chCG@Ov9dq+LhIMc1*89OuOpkdylg}p~F%NvNFIS zi_~FYw(pb%KLn!Hqa)uY*XEb!c6F%~+i*k?3s~%be8ao_uE6mKZi_^&XXd2vOsGX3 z_f#~bcH2i$XhwZ2p>P4&8C25S-hZVo;2c3J{vi5WlqqJ(x2R7fKPe{#PIdpDjIPsT zyOf!kDicCHVoP#;@gESfmWA{XrvT_`zm+3m4IEmqG9j=L)s zw5sDQ+RljTr!}6OK6ai6Anmn=AQuh>sh)1$HTxars|Qj-C3eSE^?&&Y%V^Zl9=jFW^?2Y@e>F06S`0}4M8;pJ(6Xx6dA zbiThBv(n@1_Pg9|@Ym8_A4?NKDn2nU2VD?DJ&MiXu>jB-y$f4&du0O(IrPevyZ!9F zIKTh*<3D>ED-6beojaN2U&a7NBV*6N%S(Q%=~cWfpII$Q=aN~m*o@Ds>&R(YOeFlp z2(NmaXgzSpWz47Qp_6@q^l7uBZ=;WPQu$>}MF00c)DPpg&psEc!sBBV;N@bUCmwVN zad<7L>jI=Udyko!5oC-)>s>E(WVD+K;4hnr@`9BKsSfp?qc6(;Dl+%39z)%4!D{*!m*Byi5g`CW+mIss8qZ4c%Py{b7P z)^weaO)dcj7I&lEL3PCuKM)u+A3&_hdd)+iU#BUfnFrI@v}rXZpO!Ndzq4 z4_Xzwc-1s{MP_q6TN4Bz413duwah$?%_-Nf)C@|Kd`J{YjLp0fv4*w2hO7SJtdBG_ zX6?09O6h)t#$wlVECRMZiVDi=iee(3^8UShd(24O?;K>^5CESOOC{`(Xd`*uM^wt0 z%5sVFAW6F0Ca+qsm$xLvf zJt_&5p|A5yAp?&LIDv3>&NolB_#Gkr$fI0p$Or_E7Hefp6J}E)MRjihggV@$!optY zfx3JZ9NpbVBfkkS25_Q6e_=m-5HIq*ljTB^7!Xw3l$Syfj>E))%nK_p1@Mk>_xJ==JXS!+)$YJg)+CbUe-YBjBwxwR>=e#LO_cEGTGMN(rVJU%tU^EKk( zC@3z=<`9BMMMSXqjBZYOohn&bLeV(Cdu83bRflP3PJJ|{p~C09`z-BZQ{UKq*x@u2 z7ygpDdiS+`omoE+l@rA|x$}fm9^YL06F8UYF_S_DIv5b-YIQ#9zQ4M7`z0eawGZwv zRB5Mf6}UGy6GLt|Hh{AbGkB!Ksik2S%f@7W5V~W3JaZ1yZpJZc)fNkd+fSh+Mz=P( zt{^vW%B3kn>U%bj)I!88po}r+zyUY}z~8%~rYxy0ZO+@5?hQ^Sw6f$y2{4fk`_Pvk z+huI`Y)Q=e!b0E0zlGIJsZT}V9qo07+&h)t56+_T|9#tJ%2z7BdJbwaP63NL8aTdc zJW+tnKkXvVX#;X|pFf=etaFzk5oVr-_OD)m2a~!Tv^)6&%L+d!)*dq4QeX1=5vKoJXJzJz(QwG z%@8=OK2G>~9q*rI0#U)|cq2l9Ph18-8EKi<5nXcP!nEfxY||#y)oT|Or-qZUEC~oqCnlxprJio*o42b~FNlyx<_(aYhdXGkS2qKg(75taa=s5> z_;u00?b0!@^`QH~ai+JC`4py)XA^&#OqM8AEEeiv`v4J+8xT0p7LlUK~1_rG?xjsCvivo27C9ruR={tOt!__>gw`n#_sJ5 zvTKy7#(lg-$6^|1X86&bL^XL%pmobHF0NPZ=*wyD8z+}IP8OX7hYU$s>7{tlrWdmB zr*Q>Y@J2AN$g*mo=C+kBE{R#+`WacERgef+JZ8d_X?>t+%MVI?8#%^IiBKHI~{ z*d7O}-xLu_oKPZ#Rv>fjoq@7kQ2c^J`b zfElS$rrDXSK2v2iLTM%LXrS7}cg?IN@}SkCB5*n4(;VJ#hqiI2xwUCP0TkC;3B6;@ zKalQE^wc(e{0GbNfgnFz`qE1v=kk>mIDu{9En8!?E13Opgg6)W`DZzL?+~&T+FZt7 z!R%;F3s!1YZL$-r&~1ebuP}#aM~pqbaX~^3_&ffK{ayTIy@UPX=ZdUmLk+H=0sLOz zTp$x|MwnXq;3?0ht+XboQ=RKsn>1?Qe)){r_bEMsqZfOMRwFe-g^_c|f8+`N%>K_p z@gZl}On@!nIu~Ukk{1HStg%@aPIqmj2=8jTVz|_@*9i~9g8b&B5O_Ll(fDKh zGN)L&JZ$#Qx9D#Y&#TE-sH@DCyBE7!nXL-2SrWZ>XJ1vnBYJgnacpF0$bsnD#ZCbv zkUK6Zh;VUo8)h0XY67Je>41_Iz1gA2{vLOsVU=~#Y1#v*0t_I!7lzsu`OcZcGl-BU(~-lZ6l6r1IPxs_i|t( znf5m&cQUZtr)u73H2Ja3yjCSzt{bhxm-}Hm9=ko^D8dT8_Pqf8J-WfYW8|Dtvzo65cTn+$W zOuc=vsCPVMVLB$3PNb~jv-Yi#hIOk_`@Ldak zo+=RlQEKH}jf>lF5?(LPV-e6!kByBTF+_uXQy(+?4hl99btPFo$E$u7aiY*d>V^*g zJEBtzA$HgqiVyNkhJDz8nnJFeQ;*dh(cx&bz8Wy0uB@wYi_euFk&z$`-d(<1fU%kS z=aXeOK1`Sz3dep)KB6jaJAvD;ivs zy+N!f)k0-4f$!qmQW$a}@(fjbX|=cIjYLY1geC^FsTuO`XT0)<=$jLzxfv29TI7yQW-Xyg z+ZhVGuT!xz9Irmt^Bw*W3U*L8ruXdOcmg6%Nl~-Z`F&qf`#qK?UtSXxYX)$MW4NM! z8|@m&Mjr-lb%^W^6ity=v@Shev6?c2x^2k? z>SgIMEzWcm<%pOqUFxSF7Jal9Cz{|<@TDqap;Sn-+RO)U}F-8#4!C2e14+k|Vy`ia_A`yZkPCAS|<+KnI#Ye^yp`muqr; zSgl=#!?_Q83FFZCa|&HUqS7NFSp41I>}qS?7pB1dYLhW|rtl|Juy!;17XD8yX@-E=1=}m3ufw`i_nF; zSmC^|rnE^kts+2ql`J`n9oz4&8>{3K&~uukTLQnuAe5Cg}0q~uZF<;X`^ay$KPv%DBCe6Hq=|3~+v3Eu#>+cWSV`Arn zWYh5Wjd0bS2f=dz%~VP-HrO|=>wpuzMRQ=Q^4!Vi{C6eHfTOR@E^ofp8)T}a7F37E zfWNGb6sQVP`;O;>zpGtW$4(yPGh&$Te#)4(T~4Zb={^3G79*+X>r6?<&+$doFN+Ih zs4p6Q#rR3w%>pb3&*Y7Ye|h(q^6~B;7I9iQ)iO?fybs}j zyoE}huK0EU-`}nN%}G{ot@G!wXxv(Sy>7>VN>v|aPMGfbGQMEY*~Ky@36@ds5@|Ne zY8&W({?5Hsh5lpqhfsl<_<`J%*xf4isc?zipZxW4KdqjwpEG5-pKC~~67R{x?ng?> z2m1E}I)t#^q|uIwPz@}QJ#L;XpP2hAwi$i`GQMb zwUk}uk4*t3%@5q{&n~jG@;Ki{8$K~yKlM{8UUA$Q(2WqBZa(gc1=};#$$=u(0KFf~ zE6pgM&+w-MXN0xcW1hhH{b;QpAYeej#T$}&!f5mjOz}MRQ1ach8mLF80b~pc65J?% zak~1!yu8~KHpZz28Hg!@!@gRJmn$ z(EdGL+%LdScj+fP=Q;(lfg~rPvE@=eOnOVvvyVUUAdABTRT3>y%85|ob7q?fCE=V z8eB;FrDU!_MNaN1(=#ttpEQC`J9Z?f3@&30aBX_{JG)Xs^C)mX(|l+*v@yahzXmkn zkYNOhJ$a+J@xDaWMIi;;yO5m2YuwG}US+vh3Ku%Sk}gtaGWk>Csm7r;(EVawq{pGr z)~&Bb0|fHDhbj?(_^?5}Y`<#;}FR4-vCP=9O}WF_e8mdL-2!^)r&~G6p_5e~I{7 zW>0SRnGMK~^G&Q7f3eWu1KxA|_tmsx=nR$Ry(3^XvKWv&g%BuEo+o~>71&p|fcs&cwwJi#*5?)VztT#mzslH*G0LcaG7 zUrOp7(1DU5>x^cv&lhNM?w#Z1QF$$vT~&1GwtL#}x&2enRQh=->7z;_I=s`IsQo;+ z(8jE138AH)0l1g<%a3Ns(E^D)zYbjksW_}zAB)*8m3}x(dRf@g?&pI?$Wk~gCJoLI z5bR@#oLqQI+VLTWGVdyt!K)msNsny+*OS|RLa4s7oC&XzhuNu^4^Cd%$mja&_rCX*_u#+2IXeNsoK zF%YDD%Q@-ymK;N zV9cYwbz~AmUxp0^`j+3_NDTDlYL44Eehb7UEix@W^Iy#g!=M z#@>-Q%}>hmI-;z4!qYj)A^pQN7S7 zF!03^gR7JHq2hTtD$?C&xSa^5o4u4?!o*dpZ?LISb@jHvD3uQ9+!3}3mLP-qHmuWn zZKn96Vzei$#juvAUsLhd^!!e2zQP0%ygh}z0u{=7f+=z9!lsaS%Q2m)xm2)GHK2SMu$F6cIzs?2m#|5HX{ph0Pw(>!{B#k!f zEF;VwOv~;1Wkc@X{4X<&V-z4Zji8F`s`w+)I|fWTc3pbLz2m-tKS<^zHmio>qu~Aa~4d0 z4@K?GZsdAO4XC!=r*m4C`ZX{DQKjynWOwx))KzfZ2cES#!WQ2{8t22}mC{=ml-Po+ zJBOpyc8bDbjn>Yg;ybg#smtoy<3Z16e_KUgQ4#K&>0o^wj5u}gTay+JWQXh4$;KAS z<+DZPd*mTgtV%rH5+eq5k`_>#?+S9+4Pv-q22dJsbx&7sz!WC8DoaZF1qjjgf~{{K z+Cx<)OxGTg{o8y9c6Q0p-6ldlA9fJFoKUao$|=o{!=cQ=G^qQ?N7J{ySp{Tj>Gn9n zB+xvE#uT3>dNU4nvGkDBOPhR_K)v(d9U^DQDwp z{a3kQcI?Z~qU#P4eg@^VGJ>CV?Ho~K_07$*zkASmZ*P7#h?nPw^42FXv3D2b3X*Sg zPWN0j-KMuhNFO!ez73Oc<9>OWDn-86WlPiEAM&n}1?OmD&*Am(>nD-8w;p|{#zq51;)29NG*+Yb=M^xws?0-7Isq*4FC#CcC}#K%21tS3ULr1@d3l zQ~w`T+5ZvbA2r)|2K1jG|19giORxO1w)=ks`Hz*~|Df`Z;_!%-TRa|&{J2=I{Cc~V QyKgyE6*UzqAbq?+1&qfLF8@6;)EQa&UEUv2t)EkrovtaddXDu>Ncg0G`V^s+MZ1huHjg>(?T(k%1|) z4k}o1Bq|~?ftZPuw50D*WgXR~iAY!=)5!z@Z^pF zDqN!(smt?62;iSTA0HiAA8Zc*;W>u@2lUBj_c0ShyrLY5Wa>c#hC=kYCUVKb1!4k1 z-f%2nYy(ORfDu)|-W(8^^Dol}0?#`V=m~^o z0+Ry*Q&SvqEy#upN4@V}$xKYPUv{S}9fbhkkE{R83q4aKULfzg zK)aVhiZf^{1B86HyBLcG6rpAy|8QCJ%JFS�wJImzH*Sc7DqYiRc=SY5Kib4jA@n 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 BG_C*u diff --git a/architecture-examples/polymer/bower_components/director/lib/director.js b/architecture-examples/polymer/bower_components/director/lib/director.js deleted file mode 100644 index f43ae82750..0000000000 --- a/architecture-examples/polymer/bower_components/director/lib/director.js +++ /dev/null @@ -1,6 +0,0 @@ - - - -exports.Router = require('./director/router').Router; -exports.http = require('./director/http'); -exports.cli = require('./director/cli'); diff --git a/architecture-examples/polymer/bower_components/director/lib/director/browser.js b/architecture-examples/polymer/bower_components/director/lib/director/browser.js deleted file mode 100644 index d5709979e1..0000000000 --- a/architecture-examples/polymer/bower_components/director/lib/director/browser.js +++ /dev/null @@ -1,297 +0,0 @@ - -/* - * browser.js: Browser specific functionality for director. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -if (!Array.prototype.filter) { - Array.prototype.filter = function(filter, that) { - var other = [], v; - for (var i = 0, n = this.length; i < n; i++) { - if (i in this && filter.call(that, v = this[i], i, this)) { - other.push(v); - } - } - return other; - }; -} - -if (!Array.isArray){ - Array.isArray = function(obj) { - return Object.prototype.toString.call(obj) === '[object Array]'; - }; -} - -var dloc = document.location; - -function dlocHashEmpty() { - // Non-IE browsers return '' when the address bar shows '#'; Director's logic - // assumes both mean empty. - return dloc.hash === '' || dloc.hash === '#'; -} - -var listener = { - mode: 'modern', - hash: dloc.hash, - history: false, - - check: function () { - var h = dloc.hash; - if (h != this.hash) { - this.hash = h; - this.onHashChanged(); - } - }, - - fire: function () { - if (this.mode === 'modern') { - this.history === true ? window.onpopstate() : window.onhashchange(); - } - else { - this.onHashChanged(); - } - }, - - init: function (fn, history) { - var self = this; - this.history = history; - - if (!Router.listeners) { - Router.listeners = []; - } - - function onchange(onChangeEvent) { - for (var i = 0, l = Router.listeners.length; i < l; i++) { - Router.listeners[i](onChangeEvent); - } - } - - //note IE8 is being counted as 'modern' because it has the hashchange event - if ('onhashchange' in window && (document.documentMode === undefined - || document.documentMode > 7)) { - // At least for now HTML5 history is available for 'modern' browsers only - if (this.history === true) { - // There is an old bug in Chrome that causes onpopstate to fire even - // upon initial page load. Since the handler is run manually in init(), - // this would cause Chrome to run it twise. Currently the only - // workaround seems to be to set the handler after the initial page load - // http://code.google.com/p/chromium/issues/detail?id=63040 - setTimeout(function() { - window.onpopstate = onchange; - }, 500); - } - else { - window.onhashchange = onchange; - } - this.mode = 'modern'; - } - else { - // - // IE support, based on a concept by Erik Arvidson ... - // - var frame = document.createElement('iframe'); - frame.id = 'state-frame'; - frame.style.display = 'none'; - document.body.appendChild(frame); - this.writeFrame(''); - - if ('onpropertychange' in document && 'attachEvent' in document) { - document.attachEvent('onpropertychange', function () { - if (event.propertyName === 'location') { - self.check(); - } - }); - } - - window.setInterval(function () { self.check(); }, 50); - - this.onHashChanged = onchange; - this.mode = 'legacy'; - } - - Router.listeners.push(fn); - - return this.mode; - }, - - destroy: function (fn) { - if (!Router || !Router.listeners) { - return; - } - - var listeners = Router.listeners; - - for (var i = listeners.length - 1; i >= 0; i--) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - } - } - }, - - setHash: function (s) { - // Mozilla always adds an entry to the history - if (this.mode === 'legacy') { - this.writeFrame(s); - } - - if (this.history === true) { - window.history.pushState({}, document.title, s); - // Fire an onpopstate event manually since pushing does not obviously - // trigger the pop event. - this.fire(); - } else { - dloc.hash = (s[0] === '/') ? s : '/' + s; - } - return this; - }, - - writeFrame: function (s) { - // IE support... - var f = document.getElementById('state-frame'); - var d = f.contentDocument || f.contentWindow.document; - d.open(); - d.write(" - - - - - - - diff --git a/architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js b/architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js deleted file mode 100644 index d784700aa0..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js +++ /dev/null @@ -1,77 +0,0 @@ -module("Director.js", { - setup: function() { - window.location.hash = ""; - shared = {}; - // Init needed keys earlier because of in HTML5 mode the route handler - // is executed upon Router.init() and due to that setting shared.fired - // in the param test of createTest is too late - if (HTML5TEST) { - shared.fired = []; - shared.fired_count = 0; - } - }, - teardown: function() { - window.location.hash = ""; - shared = {}; - } -}); - -var shared; - -function createTest(name, config, use, test, initialRoute) { - // We rename to `RouterAlias` for the browserify tests, since we want to be - // sure that no code is depending on `window.Router` being available. - var Router = window.Router || window.RouterAlias; - - if (typeof use === 'function') { - test = use; - use = undefined; - } - - if (HTML5TEST) { - if (use === undefined) { - use = {}; - } - - if (use.run_handler_in_init === undefined) { - use.run_handler_in_init = false; - } - use.html5history = true; - } - - // Because of the use of setTimeout when defining onpopstate - var innerTimeout = HTML5TEST === true ? 500 : 0; - - asyncTest(name, function() { - setTimeout(function() { - var router = new Router(config), - context; - - if (use !== undefined) { - router.configure(use); - } - - router.init(initialRoute); - - setTimeout(function() { - test.call(context = { - router: router, - navigate: function(url, callback) { - if (HTML5TEST) { - router.setRoute(url); - } else { - window.location.hash = url; - } - setTimeout(function() { - callback.call(context); - }, 14); - }, - finish: function() { - router.destroy(); - start(); - } - }) - }, innerTimeout); - }, 14); - }); -}; diff --git a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html b/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html deleted file mode 100644 index eaf8ffc24b..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Director HTML5 Tests - - - -

Note: in order to execute HTML5 mode test this file needs to be served with provided nodejs backend. Start the server from director/test/browser/backend and go to http://localhost:8080/ to launch the tests.

- -
-
- - - - - - - - - diff --git a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js b/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js deleted file mode 100644 index 628d3c9700..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js +++ /dev/null @@ -1,660 +0,0 @@ -var browser_history_support = (window.history != null ? window.history.pushState : null) != null; - -createTest('Nested route with the many children as a tokens, callbacks should yield historic params', { - '/a': { - '/:id': { - '/:id': function(a, b) { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, ''), a, b); - } else { - shared.fired.push(location.pathname, a, b); - } - } - } - } -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['/a/b/c', 'b', 'c']); - this.finish(); - }); -}); - -createTest('Nested route with the first child as a token, callback should yield a param', { - '/foo': { - '/:id': { - on: function(id) { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, ''), id); - } else { - shared.fired.push(location.pathname, id); - } - } - } - } -}, function() { - this.navigate('/foo/a', function() { - this.navigate('/foo/b/c', function() { - deepEqual(shared.fired, ['/foo/a', 'a']); - this.finish(); - }); - }); -}); - -createTest('Nested route with the first child as a regexp, callback should yield a param', { - '/foo': { - '/(\\w+)': { - on: function(value) { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, ''), value); - } else { - shared.fired.push(location.pathname, value); - } - } - } - } -}, function() { - this.navigate('/foo/a', function() { - this.navigate('/foo/b/c', function() { - deepEqual(shared.fired, ['/foo/a', 'a']); - this.finish(); - }); - }); -}); - -createTest('Nested route with the several regular expressions, callback should yield a param', { - '/a': { - '/(\\w+)': { - '/(\\w+)': function(a, b) { - shared.fired.push(a, b); - } - } - } -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['b', 'c']); - this.finish(); - }); -}); - -createTest('Single nested route with on member containing function value', { - '/a': { - '/b': { - on: function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } - } -}, function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['/a/b']); - this.finish(); - }); -}); - -createTest('Single non-nested route with on member containing function value', { - '/a/b': { - on: function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } -}, function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['/a/b']); - this.finish(); - }); -}); - -createTest('Single nested route with on member containing array of function values', { - '/a': { - '/b': { - on: [function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - }, - function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - }] - } - } -}, function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['/a/b', '/a/b']); - this.finish(); - }); -}); - -createTest('method should only fire once on the route.', { - '/a': { - '/b': { - once: function() { - shared.fired_count++; - } - } - } -}, function() { - this.navigate('/a/b', function() { - this.navigate('/a/b', function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired_count, 1); - this.finish(); - }); - }); - }); -}); - -createTest('method should only fire once on the route, multiple nesting.', { - '/a': { - on: function() { shared.fired_count++; }, - once: function() { shared.fired_count++; } - }, - '/b': { - on: function() { shared.fired_count++; }, - once: function() { shared.fired_count++; } - } -}, function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired_count, 6); - this.finish(); - }); - }); - }); - }); -}); - -createTest('overlapping routes with tokens.', { - '/a/:b/c' : function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - }, - '/a/:b/c/:d' : function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } -}, function() { - this.navigate('/a/b/c', function() { - - this.navigate('/a/b/c/d', function() { - deepEqual(shared.fired, ['/a/b/c', '/a/b/c/d']); - this.finish(); - }); - }); -}); - -// // // -// // // Recursion features -// // // ---------------------------------------------------------- - -createTest('Nested routes with no recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c']); - this.finish(); - }); -}); - -createTest('Nested routes with backward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'backward' -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c', 'b', 'a']); - this.finish(); - }); -}); - -createTest('Breaking out of nested routes with backward recursion', { - '/a': { - '/:b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - return false; - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'backward' -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c', 'b']); - this.finish(); - }); -}); - -createTest('Nested routes with forward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['a', 'b', 'c']); - this.finish(); - }); -}); - -createTest('Nested routes with forward recursion, single route with an after event.', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - }, - after: function() { - shared.fired.push('c-after'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - this.navigate('/a/b/c', function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['a', 'b', 'c', 'c-after', 'a', 'b']); - this.finish(); - }); - }); -}); - -createTest('Breaking out of nested routes with forward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - return false; - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['a', 'b']); - this.finish(); - }); -}); - -// -// ABOVE IS WORKING -// - -// // -// // Special Events -// // ---------------------------------------------------------- - -createTest('All global event should fire after every route', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - '/c': { - on: function a() { - shared.fired.push('a'); - } - } - }, - '/d': { - '/:e': { - on: function a() { - shared.fired.push('a'); - } - } - } -}, { - after: function() { - shared.fired.push('b'); - } -}, function() { - this.navigate('/a', function() { - this.navigate('/b/c', function() { - this.navigate('/d/e', function() { - deepEqual(shared.fired, ['a', 'b', 'a', 'b', 'a']); - this.finish(); - }); - }); - }); - -}); - -createTest('Not found.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - notfound: function() { - shared.fired.push('notfound'); - } -}, function() { - this.navigate('/c', function() { - this.navigate('/d', function() { - deepEqual(shared.fired, ['notfound', 'notfound']); - this.finish(); - }); - }); -}); - -createTest('On all.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - on: function() { - shared.fired.push('c'); - } -}, function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, ['a', 'c', 'b', 'c']); - this.finish(); - }); - }); -}); - - -createTest('After all.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - after: function() { - shared.fired.push('c'); - } -}, function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, ['a', 'c', 'b']); - this.finish(); - }); - }); -}); - -createTest('resource object.', { - '/a': { - '/b/:c': { - on: 'f1' - }, - on: 'f2' - }, - '/d': { - on: ['f1', 'f2'] - } -}, -{ - resource: { - f1: function (name){ - shared.fired.push("f1-" + name); - }, - f2: function (name){ - shared.fired.push("f2"); - } - } -}, function() { - this.navigate('/a/b/c', function() { - this.navigate('/d', function() { - deepEqual(shared.fired, ['f1-c', 'f1-undefined', 'f2']); - this.finish(); - }); - }); -}); - -createTest('argument matching should be case agnostic', { - '/fooBar/:name': { - on: function(name) { - shared.fired.push("fooBar-" + name); - } - } -}, function() { - this.navigate('/fooBar/tesTing', function() { - deepEqual(shared.fired, ['fooBar-tesTing']); - this.finish(); - }); -}); - -createTest('sanity test', { - '/is/:this/:sane': { - on: function(a, b) { - shared.fired.push('yes ' + a + ' is ' + b); - } - }, - '/': { - on: function() { - shared.fired.push('is there sanity?'); - } - } -}, function() { - this.navigate('/is/there/sanity', function() { - deepEqual(shared.fired, ['yes there is sanity']); - this.finish(); - }); -}); - -createTest('`/` route should be navigable from the routing table', { - '/': { - on: function root() { - shared.fired.push('/'); - } - }, - '/:username': { - on: function afunc(username) { - shared.fired.push('/' + username); - } - } -}, function() { - this.navigate('/', function root() { - deepEqual(shared.fired, ['/']); - this.finish(); - }); -}); - -createTest('`/` route should not override a `/:token` route', { - '/': { - on: function root() { - shared.fired.push('/'); - } - }, - '/:username': { - on: function afunc(username) { - shared.fired.push('/' + username); - } - } -}, function() { - this.navigate('/a', function afunc() { - deepEqual(shared.fired, ['/a']); - this.finish(); - }); -}); - -createTest('should accept the root as a token.', { - '/:a': { - on: function root() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } -}, function() { - this.navigate('/a', function root() { - deepEqual(shared.fired, ['/a']); - this.finish(); - }); -}); - -createTest('routes should allow wildcards.', { - '/:a/b*d': { - on: function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } -}, function() { - this.navigate('/a/bcd', function root() { - deepEqual(shared.fired, ['/a/bcd']); - this.finish(); - }); -}); - -createTest('functions should have |this| context of the router instance.', { - '/': { - on: function root() { - shared.fired.push(!!this.routes); - } - } -}, function() { - this.navigate('/', function root() { - deepEqual(shared.fired, [true]); - this.finish(); - }); -}); - -createTest('setRoute with a single parameter should change location correctly', { - '/bonk': { - on: function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(window.location.pathname); - } - } - } -}, function() { - var self = this; - this.router.setRoute('/bonk'); - setTimeout(function() { - deepEqual(shared.fired, ['/bonk']); - self.finish(); - }, 14) -}); - -createTest('route should accept _ and . within parameters', { - '/:a': { - on: function root() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } -}, function() { - this.navigate('/a_complex_route.co.uk', function root() { - deepEqual(shared.fired, ['/a_complex_route.co.uk']); - this.finish(); - }); -}); diff --git a/architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html b/architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html deleted file mode 100644 index c97c82667a..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Director Tests - - - -
-
- - - - - - - - - diff --git a/architecture-examples/polymer/bower_components/director/test/browser/routes-test.js b/architecture-examples/polymer/bower_components/director/test/browser/routes-test.js deleted file mode 100644 index 1cb8d9528d..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/routes-test.js +++ /dev/null @@ -1,694 +0,0 @@ - -createTest('Nested route with the many children as a tokens, callbacks should yield historic params', { - '/a': { - '/:id': { - '/:id': function(a, b) { - shared.fired.push(location.hash, a, b); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['#/a/b/c', 'b', 'c']); - this.finish(); - }); -}); - -createTest('Nested route with the first child as a token, callback should yield a param', { - '/foo': { - '/:id': { - on: function(id) { - shared.fired.push(location.hash, id); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/foo/a', function() { - this.navigate('/foo/b/c', function() { - deepEqual(shared.fired, ['#/foo/a', 'a']); - this.finish(); - }); - }); -}); - -createTest('Nested route with the first child as a regexp, callback should yield a param', { - '/foo': { - '/(\\w+)': { - on: function(value) { - shared.fired.push(location.hash, value); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/foo/a', function() { - this.navigate('/foo/b/c', function() { - deepEqual(shared.fired, ['#/foo/a', 'a']); - this.finish(); - }); - }); -}); - -createTest('Nested route with the several regular expressions, callback should yield a param', { - '/a': { - '/(\\w+)': { - '/(\\w+)': function(a, b) { - shared.fired.push(a, b); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['b', 'c']); - this.finish(); - }); -}); - - - -createTest('Single nested route with on member containing function value', { - '/a': { - '/b': { - on: function() { - shared.fired.push(location.hash); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['#/a/b']); - this.finish(); - }); -}); - -createTest('Single non-nested route with on member containing function value', { - '/a/b': { - on: function() { - shared.fired.push(location.hash); - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['#/a/b']); - this.finish(); - }); -}); - -createTest('Single nested route with on member containing array of function values', { - '/a': { - '/b': { - on: [function() { shared.fired.push(location.hash); }, - function() { shared.fired.push(location.hash); }] - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['#/a/b', '#/a/b']); - this.finish(); - }); -}); - -createTest('method should only fire once on the route.', { - '/a': { - '/b': { - once: function() { - shared.fired++; - } - } - } -}, function() { - shared.fired = 0; - this.navigate('/a/b', function() { - this.navigate('/a/b', function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, 1); - this.finish(); - }); - }); - }); -}); - -createTest('method should only fire once on the route, multiple nesting.', { - '/a': { - on: function() { shared.fired++; }, - once: function() { shared.fired++; } - }, - '/b': { - on: function() { shared.fired++; }, - once: function() { shared.fired++; } - } -}, function() { - shared.fired = 0; - this.navigate('/a', function() { - this.navigate('/b', function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, 6); - this.finish(); - }); - }); - }); - }); -}); - -createTest('overlapping routes with tokens.', { - '/a/:b/c' : function() { - shared.fired.push(location.hash); - }, - '/a/:b/c/:d' : function() { - shared.fired.push(location.hash); - } -}, function() { - shared.fired = []; - this.navigate('/a/b/c', function() { - - this.navigate('/a/b/c/d', function() { - deepEqual(shared.fired, ['#/a/b/c', '#/a/b/c/d']); - this.finish(); - }); - }); -}); - -// // // -// // // Recursion features -// // // ---------------------------------------------------------- - -createTest('Nested routes with no recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c']); - this.finish(); - }); -}); - -createTest('Nested routes with backward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'backward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c', 'b', 'a']); - this.finish(); - }); -}); - -createTest('Breaking out of nested routes with backward recursion', { - '/a': { - '/:b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - return false; - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'backward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c', 'b']); - this.finish(); - }); -}); - -createTest('Nested routes with forward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['a', 'b', 'c']); - this.finish(); - }); -}); - -createTest('Nested routes with forward recursion, single route with an after event.', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - }, - after: function() { - shared.fired.push('c-after'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['a', 'b', 'c', 'c-after', 'a', 'b']); - this.finish(); - }); - }); -}); - -createTest('Breaking out of nested routes with forward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - return false; - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['a', 'b']); - this.finish(); - }); -}); - -// -// ABOVE IS WORKING -// - -// // -// // Special Events -// // ---------------------------------------------------------- - -createTest('All global event should fire after every route', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - '/c': { - on: function a() { - shared.fired.push('a'); - } - } - }, - '/d': { - '/:e': { - on: function a() { - shared.fired.push('a'); - } - } - } -}, { - after: function() { - shared.fired.push('b'); - } -}, function() { - shared.fired = []; - - this.navigate('/a', function() { - this.navigate('/b/c', function() { - this.navigate('/d/e', function() { - deepEqual(shared.fired, ['a', 'b', 'a', 'b', 'a']); - this.finish(); - }); - }); - }); - -}); - -createTest('Not found.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - notfound: function() { - shared.fired.push('notfound'); - } -}, function() { - shared.fired = []; - - this.navigate('/c', function() { - this.navigate('/d', function() { - deepEqual(shared.fired, ['notfound', 'notfound']); - this.finish(); - }); - }); -}); - -createTest('On all.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - on: function() { - shared.fired.push('c'); - } -}, function() { - shared.fired = []; - - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, ['a', 'c', 'b', 'c']); - this.finish(); - }); - }); -}); - - -createTest('After all.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - after: function() { - shared.fired.push('c'); - } -}, function() { - shared.fired = []; - - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, ['a', 'c', 'b']); - this.finish(); - }); - }); -}); - -createTest('resource object.', { - '/a': { - '/b/:c': { - on: 'f1' - }, - on: 'f2' - }, - '/d': { - on: ['f1', 'f2'] - } -}, -{ - resource: { - f1: function (name){ - shared.fired.push("f1-" + name); - }, - f2: function (name){ - shared.fired.push("f2"); - } - } -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - this.navigate('/d', function() { - deepEqual(shared.fired, ['f1-c', 'f1-undefined', 'f2']); - this.finish(); - }); - }); -}); - -createTest('argument matching should be case agnostic', { - '/fooBar/:name': { - on: function(name) { - shared.fired.push("fooBar-" + name); - } - } -}, function() { - shared.fired = []; - this.navigate('/fooBar/tesTing', function() { - deepEqual(shared.fired, ['fooBar-tesTing']); - this.finish(); - }); -}); - -createTest('sanity test', { - '/is/:this/:sane': { - on: function(a, b) { - shared.fired.push('yes ' + a + ' is ' + b); - } - }, - '/': { - on: function() { - shared.fired.push('is there sanity?'); - } - } -}, function() { - shared.fired = []; - this.navigate('/is/there/sanity', function() { - deepEqual(shared.fired, ['yes there is sanity']); - this.finish(); - }); -}); - -createTest('`/` route should be navigable from the routing table', { - '/': { - on: function root() { - shared.fired.push('/'); - } - }, - '/:username': { - on: function afunc(username) { - shared.fired.push('/' + username); - } - } -}, function() { - shared.fired = []; - this.navigate('/', function root() { - deepEqual(shared.fired, ['/']); - this.finish(); - }); -}); - -createTest('`/` route should not override a `/:token` route', { - '/': { - on: function root() { - shared.fired.push('/'); - } - }, - '/:username': { - on: function afunc(username) { - shared.fired.push('/' + username); - } - } -}, function() { - shared.fired = []; - this.navigate('/a', function afunc() { - deepEqual(shared.fired, ['/a']); - this.finish(); - }); -}); - -createTest('should accept the root as a token.', { - '/:a': { - on: function root() { - shared.fired.push(location.hash); - } - } -}, function() { - shared.fired = []; - this.navigate('/a', function root() { - deepEqual(shared.fired, ['#/a']); - this.finish(); - }); -}); - -createTest('routes should allow wildcards.', { - '/:a/b*d': { - on: function() { - shared.fired.push(location.hash); - } - } -}, function() { - shared.fired = []; - this.navigate('/a/bcd', function root() { - deepEqual(shared.fired, ['#/a/bcd']); - this.finish(); - }); -}); - -createTest('functions should have |this| context of the router instance.', { - '/': { - on: function root() { - shared.fired.push(!!this.routes); - } - } -}, function() { - shared.fired = []; - this.navigate('/', function root() { - deepEqual(shared.fired, [true]); - this.finish(); - }); -}); - -createTest('setRoute with a single parameter should change location correctly', { - '/bonk': { - on: function() { - shared.fired.push(window.location.hash); - } - } -}, function() { - var self = this; - shared.fired = []; - this.router.setRoute('/bonk'); - setTimeout(function() { - deepEqual(shared.fired, ['#/bonk']); - self.finish(); - }, 14) -}); - -createTest('route should accept _ and . within parameters', { - '/:a': { - on: function root() { - shared.fired.push(location.hash); - } - } -}, function() { - shared.fired = []; - this.navigate('/a_complex_route.co.uk', function root() { - deepEqual(shared.fired, ['#/a_complex_route.co.uk']); - this.finish(); - }); -}); - -createTest('initializing with a default route should only result in one route handling', { - '/': { - on: function root() { - if (!shared.init){ - shared.init = 0; - } - shared.init++; - } - }, - '/test': { - on: function root() { - if (!shared.test){ - shared.test = 0; - } - shared.test++; - } - } - }, function() { - this.navigate('/test', function root() { - equal(shared.init, 1); - equal(shared.test, 1); - this.finish(); - }); - }, - null, - '/'); - -createTest('changing the hash twice should call each route once', { - '/hash1': { - on: function root() { - shared.fired.push('hash1'); - } - }, - '/hash2': { - on: function root() { - shared.fired.push('hash2'); - } - } - }, function() { - shared.fired = []; - this.navigate('/hash1', function(){}); - this.navigate('/hash2', function(){ - deepEqual(shared.fired, ['hash1', 'hash2']); - this.finish(); - }); - } -); diff --git a/architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js b/architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js deleted file mode 100644 index 89a88ce262..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * dispatch-test.js: Tests for the core dispatch method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/cli/dispatch').addBatch({ - "An instance of director.cli.Router": { - topic: function () { - var router = new director.cli.Router(), - that = this; - - that.matched = {}; - that.matched['users'] = []; - that.matched['apps'] = [] - - router.on('users create', function () { - that.matched['users'].push('on users create'); - }); - - router.on(/apps (\w+\s\w+)/, function () { - assert.equal(arguments.length, 1); - that.matched['apps'].push('on apps (\\w+\\s\\w+)'); - }); - - return router; - }, - "should have the correct routing table": function (router) { - assert.isObject(router.routes.users); - assert.isObject(router.routes.users.create); - }, - "the dispatch() method": { - "users create": function (router) { - assert.isTrue(router.dispatch('on', 'users create')); - assert.equal(this.matched.users[0], 'on users create'); - }, - "apps foo bar": function (router) { - assert.isTrue(router.dispatch('on', 'apps foo bar')); - assert.equal(this.matched['apps'][0], 'on apps (\\w+\\s\\w+)'); - }, - "not here": function (router) { - assert.isFalse(router.dispatch('on', 'not here')); - }, - "still not here": function (router) { - assert.isFalse(router.dispatch('on', 'still not here')); - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js b/architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js deleted file mode 100644 index 366aefd06f..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * mount-test.js: Tests for the core mount method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/cli/path').addBatch({ - "An instance of director.cli.Router with routes": { - topic: new director.cli.Router({ - 'apps': function () { - console.log('apps'); - }, - ' users': function () { - console.log('users'); - } - }), - "should create the correct nested routing table": function (router) { - assert.isObject(router.routes.apps); - assert.isFunction(router.routes.apps.on); - assert.isObject(router.routes.users); - assert.isFunction(router.routes.users.on); - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js b/architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js deleted file mode 100644 index 8cce0595c7..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * dispatch-test.js: Tests for the core dispatch method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/cli/path').addBatch({ - "An instance of director.cli.Router": { - topic: new director.cli.Router(), - "the path() method": { - "should create the correct nested routing table": function (router) { - function noop () {} - - router.path(/apps/, function () { - router.path(/foo/, function () { - router.on(/bar/, noop); - }); - - router.on(/list/, noop); - }); - - router.on(/users/, noop); - - assert.isObject(router.routes.apps); - assert.isFunction(router.routes.apps.list.on); - assert.isObject(router.routes.apps.foo); - assert.isFunction(router.routes.apps.foo.bar.on); - assert.isFunction(router.routes.users.on); - } - } - } -}).export(module); - diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js deleted file mode 100644 index e21fd1a36e..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * dispatch-test.js: Tests for the core dispatch method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/core/dispatch').addBatch({ - "An instance of director.Router": { - topic: function () { - var that = this; - that.matched = {}; - that.matched['/'] = []; - that.matched['foo'] = []; - that.matched['f*'] = [] - - var router = new director.Router({ - '/': { - before: function () { that.matched['/'].push('before /') }, - on: function () { that.matched['/'].push('on /') }, - after: function () { that.matched['/'].push('after /') } - }, - '/foo': { - before: function () { that.matched.foo.push('before foo') }, - on: function () { that.matched.foo.push('on foo') }, - after: function () { that.matched.foo.push('after foo') }, - '/bar': { - before: function () { that.matched.foo.push('before foo bar') }, - on: function () { that.matched.foo.push('foo bar') }, - after: function () { that.matched.foo.push('after foo bar') }, - '/buzz': function () { that.matched.foo.push('foo bar buzz') } - } - }, - '/f*': { - '/barbie': function () { that.matched['f*'].push('f* barbie') } - } - }); - - router.configure({ - recurse: 'backward' - }); - - return router; - }, - "should have the correct routing table": function (router) { - assert.isObject(router.routes.foo); - assert.isObject(router.routes.foo.bar); - assert.isObject(router.routes.foo.bar.buzz); - assert.isFunction(router.routes.foo.bar.buzz.on); - }, - "the dispatch() method": { - "/": function (router) { - assert.isTrue(router.dispatch('on', '/')); - assert.isTrue(router.dispatch('on', '/')); - - assert.equal(this.matched['/'][0], 'before /'); - assert.equal(this.matched['/'][1], 'on /'); - assert.equal(this.matched['/'][2], 'after /'); - }, - "/foo/bar/buzz": function (router) { - assert.isTrue(router.dispatch('on', '/foo/bar/buzz')); - - assert.equal(this.matched.foo[0], 'foo bar buzz'); - assert.equal(this.matched.foo[1], 'before foo bar'); - assert.equal(this.matched.foo[2], 'foo bar'); - assert.equal(this.matched.foo[3], 'before foo'); - assert.equal(this.matched.foo[4], 'on foo'); - }, - "/foo/barbie": function (router) { - assert.isTrue(router.dispatch('on', '/foo/barbie')); - assert.equal(this.matched['f*'][0], 'f* barbie'); - }, - "/foo/barbie/": function (router) { - assert.isFalse(router.dispatch('on', '/foo/barbie/')); - }, - "/foo/BAD": function (router) { - assert.isFalse(router.dispatch('on', '/foo/BAD')); - }, - "/bar/bar": function (router) { - assert.isFalse(router.dispatch('on', '/bar/bar')); - }, - "with the strict option disabled": { - topic: function (router) { - return router.configure({ - recurse: 'backward', - strict: false - }); - }, - "should have the proper configuration set": function (router) { - assert.isFalse(router.strict); - }, - "/foo/barbie/": function (router) { - assert.isTrue(router.dispatch('on', '/foo/barbie/')); - assert.equal(this.matched['f*'][0], 'f* barbie'); - }, - "/foo/bar/buzz": function (router) { - assert.isTrue(router.dispatch('on', '/foo/bar/buzz')); - - assert.equal(this.matched.foo[0], 'foo bar buzz'); - assert.equal(this.matched.foo[1], 'before foo bar'); - assert.equal(this.matched.foo[2], 'foo bar'); - assert.equal(this.matched.foo[3], 'before foo'); - assert.equal(this.matched.foo[4], 'on foo'); - }, - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js deleted file mode 100644 index 29dcbb3577..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * insert-test.js: Tests for inserting routes into a normalized routing table. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/core/insert').addBatch({ - "An instance of director.Router": { - topic: new director.Router(), - "the insert() method": { - "'on', ['foo', 'bar']": function (router) { - function route () { } - - router.insert('on', ['foo', 'bar'], route); - assert.strictEqual(router.routes.foo.bar.on, route); - }, - "'on', ['foo', 'bar'] again": function (router) { - function route () { } - - router.insert('on', ['foo', 'bar'], route); - assert.isArray(router.routes.foo.bar.on); - assert.strictEqual(router.routes.foo.bar.on.length, 2); - }, - "'on', ['foo', 'bar'] a third time": function (router) { - function route () { } - - router.insert('on', ['foo', 'bar'], route); - assert.isArray(router.routes.foo.bar.on); - assert.strictEqual(router.routes.foo.bar.on.length, 3); - }, - "'get', ['fizz', 'buzz']": function (router) { - function route () { } - - router.insert('get', ['fizz', 'buzz'], route); - assert.strictEqual(router.routes.fizz.buzz.get, route); - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js deleted file mode 100644 index 44fd29cc8a..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * mount-test.js: Tests for mounting and normalizing routes into a Router instance. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -function assertRoute (fn, path, route) { - if (path.length === 1) { - return assert.strictEqual(route[path.shift()], fn); - } - - route = route[path.shift()]; - assert.isObject(route); - assertRoute(fn, path, route); -} - -vows.describe('director/core/mount').addBatch({ - "An instance of director.Router": { - "with no preconfigured params": { - topic: new director.Router(), - "the mount() method": { - "should sanitize the routes correctly": function (router) { - function foobar () { } - function foostar () { } - function foobazzbuzz () { } - function foodog () { } - function root () {} - var fnArray = [foobar, foostar]; - - router.mount({ - '/': { - before: root, - on: root, - after: root, - '/nesting': { - on: foobar, - '/deep': foostar - } - }, - '/foo': { - '/bar': foobar, - '/*': foostar, - '/jitsu/then': { - before: foobar - } - }, - '/foo/bazz': { - '/buzz': foobazzbuzz - }, - '/foo/jitsu': { - '/then': fnArray - }, - '/foo/jitsu/then/now': foostar, - '/foo/:dog': foodog - }); - - assertRoute(root, ['on'], router.routes); - assertRoute(root, ['after'], router.routes); - assertRoute(root, ['before'], router.routes); - assertRoute(foobar, ['nesting', 'on'], router.routes); - assertRoute(foostar, ['nesting', 'deep', 'on'], router.routes); - assertRoute(foobar, [ 'foo', 'bar', 'on'], router.routes); - assertRoute(foostar, ['foo', '([_.()!\\ %@&a-zA-Z0-9-]+)', 'on'], router.routes); - assertRoute(fnArray, ['foo', 'jitsu', 'then', 'on'], router.routes); - assertRoute(foobar, ['foo', 'jitsu', 'then', 'before'], router.routes); - assertRoute(foobazzbuzz, ['foo', 'bazz', 'buzz', 'on'], router.routes); - assertRoute(foostar, ['foo', 'jitsu', 'then', 'now', 'on'], router.routes); - assertRoute(foodog, ['foo', '([._a-zA-Z0-9-]+)', 'on'], router.routes); - }, - - "should accept string path": function(router) { - function dogs () { } - - router.mount({ - '/dogs': { - on: dogs - } - }, - '/api'); - - assertRoute(dogs, ['api', 'dogs', 'on'], router.routes); - } - } - }, - "with preconfigured params": { - topic: function () { - var router = new director.Router(); - router.param('city', '([\\w\\-]+)'); - router.param(':country', /([A-Z][A-Za-z]+)/); - router.param(':zip', /([\d]{5})/); - return router; - }, - "should sanitize the routes correctly": function (router) { - function usaCityZip () { } - function countryCityZip () { } - - router.mount({ - '/usa/:city/:zip': usaCityZip, - '/world': { - '/:country': { - '/:city/:zip': countryCityZip - } - } - }); - - assertRoute(usaCityZip, ['usa', '([\\w\\-]+)', '([\\d]{5})', 'on'], router.routes); - assertRoute(countryCityZip, ['world', '([A-Z][A-Za-z]+)', '([\\w\\-]+)', '([\\d]{5})', 'on'], router.routes); - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/on-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/on-test.js deleted file mode 100644 index 329ee8dfa2..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/on-test.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * on-test.js: Tests for the on/route method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/core/insert').addBatch({ - "An instance of director.Router": { - topic: new director.Router(), - "the on() method": { - "['foo', 'bar']": function (router) { - function noop () { } - - router.on(['foo', 'bar'], noop); - assert.strictEqual(router.routes.foo.on, noop); - assert.strictEqual(router.routes.bar.on, noop); - }, - "'baz'": function (router) { - function noop () { } - - router.on('baz', noop); - assert.strictEqual(router.routes.baz.on, noop); - }, - "'after', 'baz'": function (router) { - function noop () { } - - router.on('after', 'boo', noop); - assert.strictEqual(router.routes.boo.after, noop); - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/path-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/path-test.js deleted file mode 100644 index e038e3c8ed..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/path-test.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * path-test.js: Tests for the core `.path()` method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/core/path').addBatch({ - "An instance of director.Router": { - topic: function () { - var that = this; - that.matched = {}; - that.matched['foo'] = []; - that.matched['newyork'] = []; - - var router = new director.Router({ - '/foo': function () { that.matched['foo'].push('foo'); } - }); - return router; - }, - "the path() method": { - "should create the correct nested routing table": function (router) { - var that = this; - router.path('/regions', function () { - this.on('/:state', function(country) { - that.matched['newyork'].push('new york'); - }); - }); - - assert.isFunction(router.routes.foo.on); - assert.isObject(router.routes.regions); - assert.isFunction(router.routes.regions['([._a-zA-Z0-9-]+)'].on); - }, - "should dispatch the function correctly": function (router) { - router.dispatch('on', '/regions/newyork') - router.dispatch('on', '/foo'); - assert.equal(this.matched['foo'].length, 1); - assert.equal(this.matched['newyork'].length, 1); - assert.equal(this.matched['foo'][0], 'foo'); - assert.equal(this.matched['newyork'][0], 'new york'); - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js deleted file mode 100644 index 24cb38facb..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js +++ /dev/null @@ -1,103 +0,0 @@ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -var callback = function() { - return true; -}; - -var testRoute = function(route, callback) { - var router = new director.Router(); - router.on(route, callback); - - return function(value) { - return router.dispatch('on', value); - }; -}; - -vows.describe('director/core/regifyString').addBatch({ - - 'When using "/home(.*)"': { - topic: function() { - return testRoute('/home(.*)', callback); - }, - - 'Should match "/homepage"': function(result) { - assert.isTrue(result('/homepage')); - }, - - 'Should match "/home/page"': function(result) { - assert.isTrue(result('/home/page')); - }, - - 'Should not match "/foo-bar"': function(result) { - assert.isFalse(result('/foo-bar')); - } - }, - - 'When using "/home.*"': { - topic: function() { - return testRoute('/home.*', callback); - }, - - 'Should match "/homepage"': function(result) { - assert.isTrue(result('/homepage')); - }, - - 'Should match "/home/page"': function(result) { - assert.isTrue(result('/home/page')); - }, - - 'Should not match "/foo-bar"': function(result) { - assert.isFalse(result('/foo-bar')); - } - }, - - 'When using "/home(page[0-9])*"': { - topic: function() { - return testRoute('/home(page[0-9])*', callback); - }, - - 'Should match "/home"': function(result) { - assert.isTrue(result('/home')); - }, - - 'Should match "/homepage0", "/homepage1", etc.': function(result) { - for (i = 0; i < 10; i++) { - assert.isTrue(result('/homepage' + i)); - } - }, - - 'Should not match "/home_page"': function(result) { - assert.isFalse(result('/home_page')); - }, - - 'Should not match "/home/page"': function(result) { - assert.isFalse(result('/home/page')); - } - }, - - 'When using "/home*"': { - topic: function() { - return testRoute('/home*', callback); - }, - - 'Should match "/homepage"': function(result) { - assert.isTrue(result('/homepage')); - }, - - 'Should match "/home_page"': function(result) { - assert.isTrue(result('/home_page')); - }, - - 'Should match "/home-page"': function(result) { - assert.isTrue(result('/home-page')); - }, - - 'Should not match "/home/page"': function(result) { - assert.isFalse(result('/home/page')); - } - } - -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/helpers/index.js b/architecture-examples/polymer/bower_components/director/test/server/helpers/index.js deleted file mode 100644 index 25630a1e32..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/helpers/index.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * index.js: Test helpers for director. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var http = require('http'); - -exports.createServer = function (router) { - return http.createServer(function (req, res) { - router.dispatch(req, res, function (err) { - if (err) { - res.writeHead(404); - res.end(); - } - }); - }); -}; - -exports.handlers = { - respondWithId: function (id) { - this.res.writeHead(200, { 'Content-Type': 'text/plain' }) - this.res.end('hello from (' + id + ')'); - }, - respondWithData: function () { - this.res.writeHead(200, { 'Content-Type': 'application/json' }) - this.res.end(JSON.stringify(this.data)); - }, - respondWithOk: function () { - return function () { - this.res.writeHead(200); - this.res.end('ok'); - }; - }, - streamBody: function () { - var body = '', - res = this.res; - - this.req.on('data', function (chunk) { - body += chunk; - }); - - this.req.on('end', function () { - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(body); - }); - } -}; - -exports.macros = require('./macros'); diff --git a/architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js b/architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js deleted file mode 100644 index 3dc18f2e31..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * macros.js: Test macros for director tests. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - request = require('request'); - -exports.assertGet = function(port, uri, expected) { - var context = { - topic: function () { - request({ uri: 'http://localhost:' + port + '/' + uri }, this.callback); - } - }; - - context['should respond with `' + expected + '`'] = function (err, res, body) { - assert.isNull(err); - assert.equal(res.statusCode, 200); - assert.equal(body, expected); - }; - - return context; -}; - -exports.assert404 = function (port, uri) { - return { - topic: function () { - request({ uri: 'http://localhost:' + port + '/' + uri }, this.callback); - }, - "should respond with 404": function (err, res, body) { - assert.isNull(err); - assert.equal(res.statusCode, 404); - } - }; -}; - -exports.assertPost = function(port, uri, expected) { - return { - topic: function () { - request({ - method: 'POST', - uri: 'http://localhost:' + port + '/' + uri, - body: JSON.stringify(expected) - }, this.callback); - }, - "should respond with the POST body": function (err, res, body) { - assert.isNull(err); - assert.equal(res.statusCode, 200); - assert.deepEqual(JSON.parse(body), expected); - } - }; -}; diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js deleted file mode 100644 index 564301fe0c..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * accept-test.js: Tests for `content-type`-based routing - * - * (C) 2012, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - apiEasy = require('api-easy'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - macros = helpers.macros, - handlers = helpers.handlers; - -var PORT = 9067; - -apiEasy.describe('director/http/accept') - .addBatch({ - "An instance of `director.http.Router`": { - "with routes set up": { - topic: function () { - var router = new director.http.Router(); - router.get('/json', { accept: 'application/json' }, handlers.respondWithOk()); - router.get('/txt', { accept: 'text/plain' }, handlers.respondWithOk()); - router.get('/both', { accept: ['text/plain', 'application/json'] }, handlers.respondWithOk()); - router.get('/regex', { accept: /.+\/x\-.+/ }, handlers.respondWithOk()); - - router.get('/weird', { accept: 'application/json' }, function () { - this.res.writeHead(400); - this.res.end(); - }); - - router.get('/weird', handlers.respondWithOk()); - - helpers.createServer(router).listen(PORT, this.callback); - }, - "should be created": function (err) { - assert(!err); - } - } - } - }) - .use('localhost', PORT) - .discuss('with `content-type: application/json`') - .setHeader('content-type', 'application/json') - .get('/json') - .expect(200) - .get('/txt') - .expect(404) - .get('/both') - .expect(200) - .get('/regex') - .expect(404) - .get('/weird') - .expect(400) - .undiscuss() - .next() - .discuss('with `content-type: text/plain`') - .setHeader('content-type', 'text/plain') - .get('/json') - .expect(404) - .get('/txt') - .expect(200) - .get('/both') - .expect(200) - .get('/regex') - .expect(404) - .get('/weird') - .expect(200) - .undiscuss() - .next() - .discuss('with `content-type: application/x-tar-gz`') - .setHeader('content-type', 'application/x-tar-gz`') - .get('/json') - .get('/json') - .expect(404) - .get('/txt') - .expect(404) - .get('/both') - .expect(404) - .get('/regex') - .expect(200) - .get('/weird') - .expect(200) - .undiscuss() - .export(module); - diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js deleted file mode 100644 index 1859b30648..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * attach-test.js: Tests 'router.attach' functionality. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - http = require('http'), - vows = require('vows'), - request = require('request'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - handlers = helpers.handlers, - macros = helpers.macros; - -function assertData(uri) { - return macros.assertGet( - 9091, - uri, - JSON.stringify([1,2,3]) - ); -} - -vows.describe('director/http/attach').addBatch({ - "An instance of director.http.Router": { - "instantiated with a Routing table": { - topic: new director.http.Router({ - '/hello': { - get: handlers.respondWithData - } - }), - "should have the correct routes defined": function (router) { - assert.isObject(router.routes.hello); - assert.isFunction(router.routes.hello.get); - }, - "when passed to an http.Server instance": { - topic: function (router) { - router.attach(function () { - this.data = [1,2,3]; - }); - - helpers.createServer(router) - .listen(9091, this.callback); - }, - "a request to hello": assertData('hello'), - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/before-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/before-test.js deleted file mode 100644 index 824edc00fe..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/before-test.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * before-test.js: Tests for running before methods on HTTP server(s). - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - http = require('http'), - vows = require('vows'), - request = require('request'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - handlers = helpers.handlers, - macros = helpers.macros; - -vows.describe('director/http/before').addBatch({ - "An instance of director.http.Router": { - "with ad-hoc routes including .before()": { - topic: function () { - var router = new director.http.Router(); - - router.before('/hello', function () { }); - router.after('/hello', function () { }); - router.get('/hello', handlers.respondWithId); - - return router; - }, - "should have the correct routes defined": function (router) { - assert.isObject(router.routes.hello); - assert.isFunction(router.routes.hello.before); - assert.isFunction(router.routes.hello.after); - assert.isFunction(router.routes.hello.get); - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/http-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/http-test.js deleted file mode 100644 index e318fbd7e2..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/http-test.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * http-test.js: Tests for basic HTTP server(s). - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - http = require('http'), - vows = require('vows'), - request = require('request'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - handlers = helpers.handlers, - macros = helpers.macros; - -function assertBark(uri) { - return macros.assertGet( - 9090, - uri, - 'hello from (bark)' - ); -} - -vows.describe('director/http').addBatch({ - "An instance of director.http.Router": { - "instantiated with a Routing table": { - topic: new director.http.Router({ - '/hello': { - get: handlers.respondWithId - } - }), - "should have the correct routes defined": function (router) { - assert.isObject(router.routes.hello); - assert.isFunction(router.routes.hello.get); - }, - "when passed to an http.Server instance": { - topic: function (router) { - router.get(/foo\/bar\/(\w+)/, handlers.respondWithId); - router.get(/foo\/update\/(\w+)/, handlers.respondWithId); - router.path(/bar\/bazz\//, function () { - this.get(/(\w+)/, handlers.respondWithId); - }); - router.get(/\/foo\/wild\/(.*)/, handlers.respondWithId); - router.get(/(\/v2)?\/somepath/, handlers.respondWithId); - - helpers.createServer(router) - .listen(9090, this.callback); - }, - "a request to foo/bar/bark": assertBark('foo/bar/bark'), - "a request to foo/update/bark": assertBark('foo/update/bark'), - "a request to bar/bazz/bark": assertBark('bar/bazz/bark'), - "a request to foo/bar/bark?test=test": assertBark('foo/bar/bark?test=test'), - "a request to foo/wild/bark": assertBark('foo/wild/bark'), - "a request to foo/%RT": macros.assert404(9090, 'foo/%RT'), - "a request to /v2/somepath": macros.assertGet( - 9090, - '/v2/somepath', - 'hello from (/v2)' - ) - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js deleted file mode 100644 index 28758a0b9d..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * methods-test.js: Tests for HTTP methods. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/http/methods').addBatch({ - "When using director": { - "an instance of director.http.Router should have all relevant RFC methods": function () { - var router = new director.http.Router(); - director.http.methods.forEach(function (method) { - assert.isFunction(router[method.toLowerCase()]); - }); - }, - "the path() method": { - topic: new director.http.Router(), - "/resource": { - "should insert nested routes correct": function (router) { - function getResource() {} - function modifyResource() {} - - router.path(/\/resource/, function () { - this.get(getResource); - - this.put(/\/update/, modifyResource); - this.post(/create/, modifyResource); - }); - - assert.equal(router.routes.resource.get, getResource); - assert.equal(router.routes.resource.update.put, modifyResource); - assert.equal(router.routes.resource.create.post, modifyResource); - } - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js deleted file mode 100644 index 589ce595ce..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * responses-test.js: Tests for HTTP responses. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/http/responses').addBatch({ - "When using director.http": { - "it should have the relevant responses defined": function () { - Object.keys(require('../../../lib/director/http/responses')).forEach(function (name) { - assert.isFunction(director.http[name]); - }); - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js deleted file mode 100644 index 29835391ae..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * stream-test.js: Tests for streaming HTTP in director. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - http = require('http'), - vows = require('vows'), - request = require('request'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - macros = helpers.macros, - handlers = helpers.handlers - -vows.describe('director/http/stream').addBatch({ - "An instance of director.http.Router": { - "with streaming routes": { - topic: function () { - var router = new director.http.Router(); - router.post(/foo\/bar/, { stream: true }, handlers.streamBody); - router.path('/a-path', function () { - this.post({ stream: true }, handlers.streamBody); - }); - - return router; - }, - "when passed to an http.Server instance": { - topic: function (router) { - helpers.createServer(router) - .listen(9092, this.callback); - }, - "a POST request to /foo/bar": macros.assertPost(9092, 'foo/bar', { - foo: 'foo', - bar: 'bar' - }), - "a POST request to /a-path": macros.assertPost(9092, 'a-path', { - foo: 'foo', - bar: 'bar' - }) - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/.bower.json b/architecture-examples/polymer/bower_components/polymer/.bower.json deleted file mode 100644 index 74d0474034..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/.bower.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "polymer", - "description": "Leverage the future of the web platform today.", - "homepage": "http://www.polymer-project.org/", - "keywords": [ - "util", - "client", - "browser" - ], - "author": "Polymer Authors ", - "version": "0.0.20130801", - "main": [ - "polymer.min.js" - ], - "_release": "0.0.20130801", - "_resolution": { - "type": "version", - "tag": "0.0.20130801", - "commit": "79ca6036d943d77335c273a742f9ce649a8bedac" - }, - "_source": "git://github.com/components/polymer.git", - "_target": "*" -} \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/LICENSE b/architecture-examples/polymer/bower_components/polymer/LICENSE deleted file mode 100644 index 92d60b019f..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// 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. diff --git a/architecture-examples/polymer/bower_components/polymer/README.md b/architecture-examples/polymer/bower_components/polymer/README.md deleted file mode 100644 index d608dbdf32..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/README.md +++ /dev/null @@ -1,7 +0,0 @@ -Polymer is a new type of library for the web, built on top of Web Components, and designed to leverage the evolving web platform on modern browsers. - -For Docs, License, Tests, and pre-packed downloads, see: -http://www.polymer-project.org/ - -Many thanks to our contributors: -https://github.com/Polymer/platform/contributors diff --git a/architecture-examples/polymer/bower_components/polymer/bower.json b/architecture-examples/polymer/bower_components/polymer/bower.json deleted file mode 100644 index ec43433231..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/bower.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "polymer", - "description": "Leverage the future of the web platform today.", - "homepage": "http://www.polymer-project.org/", - "keywords": [ - "util", - "client", - "browser" - ], - "author": "Polymer Authors ", - "version": "0.0.20130801", - "main": [ - "polymer.min.js" - ] -} diff --git a/architecture-examples/polymer/bower_components/polymer/build.log b/architecture-examples/polymer/bower_components/polymer/build.log deleted file mode 100644 index 00d605dc2f..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/build.log +++ /dev/null @@ -1,42 +0,0 @@ -BUILD LOG ---------- -Build Time: 2013-08-01T14:19:08 - -NODEJS INFORMATION -================== -nodejs: v0.10.4 -chai: 1.7.2 -grunt: 0.4.1 -grunt-audit: 0.0.1 -grunt-contrib-uglify: 0.2.2 -grunt-contrib-yuidoc: 0.4.0 -grunt-karma: 0.5.0 -karma: 0.9.7 -karma-chrome-launcher: 0.0.2 -karma-coffee-preprocessor: 0.0.3 -karma-crbot-reporter: 0.0.3 -karma-firefox-launcher: 0.0.3 -karma-html2js-preprocessor: 0.0.2 -karma-jasmine: 0.0.3 -karma-mocha: 0.0.4 -karma-phantomjs-launcher: 0.0.2 -karma-requirejs: 0.0.3 -karma-script-launcher: 0.0.2 -mocha: 1.12.0 - -REPO REVISIONS -============== -polymer: 9c8068f25dbe1cc218079dec1480a716b2f5e816 -platform: 92b34ea333ec8cae2c7fcd395602d949117dc4e1 -ShadowDOM: fd48678e24442ae1b64d9ea7af3977e86c33b0bb -HTMLImports: 26739666016e855f9f5a569203015b081f9f7755 -CustomElements: a800e8ea471d99e38f5f99818566a0cb3cd17daf -PointerEvents: ffafaa3fce93c927f604999f58d61f4e2209e20c -PointerGestures: 84b7b698953dec5d6cfd12f78f220c18fd255eaf -mdv: c126ab89c5b39b8a088d0afac126310d5e8b3e20 - -BUILD HASHES -============ -polymer.min.js: 61432cfb0ca707a10a6708285801dcb321a8f6b9 -polymer.native.min.js: fa292dace6678f6b6f634de512c3e788318300d7 -polymer.sandbox.min.js: 4b62561d01ecb23c9a2325b7b882227fa3f9ff6d \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/component.json b/architecture-examples/polymer/bower_components/polymer/component.json deleted file mode 100644 index fe25c22aee..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/component.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "platform", - "repo": "components/platform", - "description": "Leverage the future of the web platform today.", - "homepage": "http://www.polymer-project.org/", - "keywords": [ - "util", - "client", - "browser" - ], - "author": "Polymer Authors ", - "version": "0.0.20130801", - "main": "polymer.min.js", - "scripts": [ - "polymer.min.js" - ] -} diff --git a/architecture-examples/polymer/bower_components/polymer/composer.json b/architecture-examples/polymer/bower_components/polymer/composer.json deleted file mode 100644 index d1d73948d3..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "components/platform", - "description": "Leverage the future of the web platform today.", - "keywords": ["util", "client", "browser"], - "type": "component", - "homepage": "http://www.polymer-project.org/", - "support": { - "issues": "https://github.com/Polymer/platform/issues", - "source": "https://github.com/Polymer/platform" - }, - "authors": [ - { - "name": "Polymer Authors", - "email": "polymer-dev@googlegroups.com" - } - ], - "extra": { - "component": { - "name": "polymer", - "scripts": [ - "polymer.min.js" - ], - "files": [ - "src/**", - "platform/**", - "polymer.min.js", - "polymer.min.js.map", - "polymer.native.min.js", - "polymer.native.min.js.map" - ], - "shim": { - "exports": "Platform" - } - } - } -} diff --git a/architecture-examples/polymer/bower_components/polymer/package.json b/architecture-examples/polymer/bower_components/polymer/package.json deleted file mode 100644 index 5a9ee5c25d..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "components-polymer", - "description": "Leverage the future of the web platform today.", - "homepage": "http://www.polymer-project.org/", - "keywords": [ - "util", - "client", - "browser" - ], - "author": "Polymer Authors ", - "repository": { - "type": "git", - "url": "git://github.com/Polymer/platform.git" - }, - "main": "polymer.min.js", - "version": "0.0.1", - "devDependencies": { - "mocha": "*", - "chai": "*", - "grunt": "*", - "grunt-contrib-concat": "*", - "grunt-contrib-uglify": "*", - "grunt-contrib-yuidoc": "~0.4.0", - "grunt-karma-0.9.1": "~0.4.3", - "karma-mocha": "*", - "karma-script-launcher": "*", - "karma-crbot-reporter": "*" - } -} diff --git a/architecture-examples/polymer/bower_components/polymer/polymer.native.min.js b/architecture-examples/polymer/bower_components/polymer/polymer.native.min.js deleted file mode 100644 index 95cf31ab53..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/polymer.native.min.js +++ /dev/null @@ -1,34 +0,0 @@ -// 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. -function PointerGestureEvent(a,b){var c=b||{},d=document.createEvent("Event"),e={bubbles:!0,cancelable:!0};return Object.keys(e).forEach(function(a){a in c&&(e[a]=c[a])}),d.initEvent(a,e.bubbles,e.cancelable),Object.keys(c).forEach(function(a){d[a]=b[a]}),d.preventTap=this.preventTap,d}var SideTable;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),function(){window.templateContent=window.templateContent||function(a){return a.content},window.wrap=window.unwrap=function(a){return a};var a=HTMLElement.prototype.webkitCreateShadowRoot;HTMLElement.prototype.webkitCreateShadowRoot=function(){var b=this.webkitShadowRoot,c=a.call(this);return c.olderShadowRoot=b,c.host=this,CustomElements.watchShadow(this),c},Object.defineProperties(HTMLElement.prototype,{shadowRoot:{get:function(){return this.webkitShadowRoot}},createShadowRoot:{value:function(){return this.webkitCreateShadowRoot()}}}),window.templateContent=function(a){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(a),!a.content&&!a._content){for(var b=document.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a._content=b}return a.content||a._content}}(),function(a){function b(a){for(var b=a||{},d=1;d",""," "," ShadowDOM Inspector"," "," "," ",'
    ',"
",'
'," ",""].join("\n"),d=[],e=function(){var a=b.document,c=a.querySelector("#crumbs");c.textContent="";for(var e,g=0;e=d[g];g++){var h=a.createElement("a");h.href="#",h.textContent=e.localName,h.idx=g,h.onclick=function(a){for(var b;d.length>this.idx;)b=d.pop();f(b.shadow||b,b),a.preventDefault()},c.appendChild(a.createElement("li")).appendChild(h)}},f=function(a,c){var f=b.document;k=[];var g=c||a;d.push(g),e(),f.body.querySelector("#tree").innerHTML="
"+j(a,a.childNodes)+"
"},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),h={STYLE:1,SCRIPT:1,"#comment":1,TEMPLATE:1},i=function(a){return h[a.nodeName]},j=function(a,b,c){if(i(a))return"";var d=c||"";if(a.localName||11==a.nodeType){var e=a.localName||"shadow-root",f=d+l(a);"content"==e&&(b=a.getDistributedNodes()),f+="
";var h=d+"  ";g(b,function(a){f+=j(a,a.childNodes,h)}),f+=d,{br:1}[e]||(f+="</"+e+">",f+="
")}else{var k=a.textContent.trim();f=k?d+'"'+k+'"'+"
":""}return f},k=[],l=function(a){var b="<",c=a.localName||"shadow-root";return a.webkitShadowRoot||a.shadowRoot?(b+=' ",k.push(a)):b+=c||"shadow-root",a.attributes&&g(a.attributes,function(a){b+=" "+a.name+(a.value?'="'+a.value+'"':"")}),b+=">"};shadowize=function(){var a=Number(this.attributes.idx.value),b=k[a];b?f(b.webkitShadowRoot||b.shadowRoot,b):(console.log("bad shadowize node"),console.dir(this))},a.output=j}(window.Inspector),function(a){"use strict";function b(){function a(a){"splice"===a[0].type&&"splice"===a[1].type&&(b=!0)}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=!1,c=[0];return Array.observe(c,a),c[1]=1,c.length=0,Object.deliverChangeRecords(a),b}function c(a){return+a===a>>>0}function d(a){return+a}function e(a){return a===Object(a)}function f(a,b){return a===b?0!==a||1/a===1/b:K(a)&&K(b)?!0:a!==a&&b!==b}function g(a){return"string"!=typeof a?!1:(a=a.replace(/\s/g,""),""==a?!0:"."==a[0]?!1:S.test(a))}function h(a){var b=T[a];if(b)return b;if(g(a)){var b=new i(a);return T[a]=b,b}}function i(a){return""==a.trim()?this:c(a)?(this.push(String(a)),this):(a.split(/\./).filter(function(a){return a}).forEach(function(a){this.push(a)},this),H&&this.length&&(this.getValueFrom=this.compiledGetValueFromFn()),void 0)}function j(a){for(var b=0;U>b&&a.check();)a.report(),b++}function k(a){for(var b in a)return!1;return!0}function l(a){return k(a.added)&&k(a.removed)&&k(a.changed)}function m(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function n(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function o(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,G){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}p(this),this.connect(),this.sync(!0)}function p(a){W&&(V.push(a),o._allObserversCount++)}function q(a,b,c,d){o.call(this,a,b,c,d)}function r(a,b,c,d){if(!Array.isArray(a))throw Error("Provided object is not an Array");o.call(this,a,b,c,d)}function s(a){this.arr=[],this.callback=a,this.isObserved=!0}function t(a,b,c,d,f){this.value=void 0;var g=h(b);return g?g.length?e(a)?(this.path=g,o.call(this,a,c,d,f),void 0):(this.closed=!0,this.value=void 0,void 0):(this.closed=!0,this.value=a,void 0):(this.closed=!0,this.value=void 0,void 0)}function u(a,b){if("function"==typeof Object.observe){var c=Object.getNotifier(a);return function(d,e){var f={object:a,type:d,name:b};2===arguments.length&&(f.oldValue=e),c.notify(f)}}}function v(a,b,c){for(var d={},e={},f=0;fj;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(d[e+j-1]===a[b+k-1])i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i}function x(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(ab):(e.push(bb),d=g),b--,c--):f==h?(e.push(db),b--,d=h):(e.push(cb),c--,d=i)}else e.push(db),b--;else e.push(cb),c--;return e.reverse(),e}function y(a,b,c){for(var d=0;c>d;d++)if(a[d]!==b[d])return d;return c}function z(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&a[--d]===b[--e];)f++;return f}function A(a,b,c){return{index:a,removed:b,addedCount:c}}function B(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=y(a,d,i)),c==a.length&&f==d.length&&(h=z(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,0==c-b&&0==f-e)return[];if(b==c){for(var j=A(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[A(b,[],c-b)];for(var k=x(w(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;ob||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function D(a,b,c,d){for(var e=A(b,c,d),f=!1,g=0,h=0;h=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.indexi.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.indexh)continue;D(e,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return e}function F(a,b){var c=[];return E(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?(b.removed[0]!==a[b.index]&&c.push(b),void 0):(c=c.concat(B(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)),void 0)}),c}var G=b(),H=!1;try{var I=new Function("","return true;");H=I()}catch(J){}var K=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},L="__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},M="[$_a-zA-Z]",N="[$_a-zA-Z0-9]",O=M+"+"+N+"*",P="(?:[0-9]|[1-9]+[0-9]+)",Q="(?:"+O+"|"+P+")",R="(?:"+Q+")(?:\\."+Q+")*",S=new RegExp("^"+R+"$"),T={};i.prototype=L({__proto__:[],toString:function(){return this.join(".")},getValueFrom:function(a){for(var b=0;ba&&b.anyChanged);o._allObserversCount=V.length,X=!1}}},W&&(a.Platform.clearObservers=function(){V=[]}),q.prototype=L({__proto__:o.prototype,connect:function(){G&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=n(this.object))},check:function(a){var b,c;if(G){if(!a)return!1;c={},b=v(this.object,a,c)}else c=this.oldObject,b=m(this.object,this.oldObject);return l(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){G?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}}),r.prototype=L({__proto__:q.prototype,connect:function(){G&&Array.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=this.object.slice())},check:function(a){var b;if(G){if(!a)return!1;b=F(this.object,a)}else b=B(this.object,0,this.object.length,this.oldObject,0,this.oldObject.length);return b&&b.length?(this.reportArgs=[b],!0):!1}}),r.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;ba&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}},t.prototype=L({__proto__:o.prototype,connect:function(){G&&(this.observedSet=new s(this.boundInternalCallback))},disconnect:function(){this.value=void 0,G&&(this.observedSet.reset(),this.observedSet.cleanup(),this.observedSet=void 0)},check:function(){return this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object),f(this.value,this.oldValue)?!1:(this.reportArgs=[this.value,this.oldValue],!0)},sync:function(a){a&&(this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object)),this.oldValue=this.value}}),t.getValueAtPath=function(a,b){var c=h(b);return c?c.getValueFrom(a):void 0},t.setValueAtPath=function(a,b,c){var d=h(b);d&&d.setValueFrom(a,c)};var _={"new":!0,updated:!0,deleted:!0};t.defineProperty=function(a,b,c){var d=c.object,e=h(c.path),f=u(a,b),g=new t(d,c.path,function(a,b){f&&f("updated",b)});return Object.defineProperty(a,b,{get:function(){return e.getValueFrom(d)},set:function(a){e.setValueFrom(d,a)},configurable:!0}),{close:function(){var c=e.getValueFrom(d);f&&g.deliver(),g.close(),Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}}};var ab=0,bb=1,cb=2,db=3;a.Observer=o,a.Observer.hasObjectObserve=G,a.ArrayObserver=r,a.ArrayObserver.calculateSplices=function(a,b){return B(a,0,a.length,b,0,b.length)},a.ObjectObserver=q,a.PathObserver=t,a.Path=i}("undefined"!=typeof global&&global?global: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 a.ownerDocument.contains(a)}function e(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.observer=new PathObserver(c,d,this.boundValueChanged,this),this.boundValueChanged(this.value)}function f(a,b,c,d){this.conditional="?"==b[b.length-1],this.conditional&&(a.removeAttribute(b),b=b.slice(0,-1)),e.call(this,a,b,c,d)}function g(a){switch(a.type){case"checkbox":return T;case"radio":case"select-multiple":case"select-one":return"change";default:return"input"}}function h(a,b,c,d){e.call(this,a,b,c,d),this.eventType=g(this.node),this.boundNodeValueToModel=this.nodeValueChanged.bind(this),this.node.addEventListener(this.eventType,this.boundNodeValueToModel,!0)}function i(a){if(!d(a))return[];if(a.form)return Q(a.form.elements,function(b){return b!=a&&"INPUT"==b.tagName&&"radio"==b.type&&b.name==a.name});var b=a.ownerDocument.querySelectorAll('input[type="radio"][name="'+a.name+'"]');return Q(b,function(b){return b!=a&&!b.form})}function j(a,b,c){h.call(this,a,"checked",b,c)}function k(a,b,c){h.call(this,a,"selectedIndex",b,c)}function l(a){return $[a.tagName]&&a.hasAttribute("template")}function m(a){return"TEMPLATE"==a.tagName||l(a)}function n(a){return _&&"TEMPLATE"==a.tagName}function o(a,b){var c=a.querySelectorAll(ab);m(a)&&b(a),P(c,b)}function p(a){function b(a){HTMLTemplateElement.decorate(a)||p(a.content)}o(a,b)}function q(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function r(a){if(!a.defaultView)return a;var b=eb.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);eb.set(a,b)}return b}function s(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];Z[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function t(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 u(a){"TEMPLATE"===a.tagName?_||(cb?a.__proto__=HTMLTemplateElement.prototype:q(a,HTMLTemplateElement.prototype)):(q(a,HTMLTemplateElement.prototype),Object.defineProperty(a,"content",ib))}function v(a){var b=lb.get(a);b||(b=function(){H(a,a.model,a.bindingDelegate)},lb.set(a,b)),bb(b)}function w(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.node.inputs.bind(this.property,c,d||"")}function x(a){return 3==a.length&&0==a[0].length&&0==a[2].length}function y(a){if(a&&a.length){for(var b,c=a.length,d=0,e=0,f=0;c>e;){if(d=a.indexOf("{{",e),f=0>d?-1:a.indexOf("}}",d+2),0>f){if(!b)return;b.push(a.slice(e));break}b=b||[],b.push(a.slice(e,d)),b.push(a.slice(d+2,f).trim()),e=f+2}return e===c&&b.push(""),b}}function z(a,b,c,d,e){var f,g=e&&e[X];return g&&"function"==typeof g&&(f=g(c,d,b,a),f&&(c=f,d="value")),a.bind(b,c,d)}function A(a,b,c,d,e){for(var f=0;fc?(this.keys.push(a),this.values.push(b)):this.values[c]=b},get:function(a){var b=this.keys.indexOf(a);return 0>b?void 0: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>>0)+(c++ +"__")},S.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),Node.prototype.bind=function(a,b,c){this.bindings=this.bindings||{};var d=this.bindings[a];return d&&d.close(),d=this.createBinding(a,b,c),this.bindings[a]=d,d?d:(console.error("Unhandled binding to Node: ",this,a,b,c),void 0)},Node.prototype.createBinding=function(){},Node.prototype.unbind=function(a){if(this.bindings){var b=this.bindings[a];b&&(b.close(),delete this.bindings[a])}},Node.prototype.unbindAll=function(){if(this.bindings){for(var a=Object.keys(this.bindings),b=0;be.node.length&&d--?bb(b):e.node[e.property]=c}var c=Number(a);if(c<=this.node.length)return this.node[this.property]=c,void 0;var d=2,e=this;bb(b)}}),HTMLSelectElement.prototype.createBinding=function(a,b,c){return"selectedindex"===a.toLowerCase()?(this.removeAttribute(a),new k(this,b,c)):HTMLElement.prototype.createBinding.call(this,a,b,c)};var U="bind",V="repeat",W="if",X="getBinding",Y="getInstanceModel",Z={template:!0,repeat:!0,bind:!0,ref:!0},$={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0,OPTGROUP:!0},_="undefined"!=typeof HTMLTemplateElement,ab="template, "+Object.keys($).map(function(a){return a.toLowerCase()+"[template]"}).join(", "),bb=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=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(;bb>ab&&d(_.charCodeAt(ab));)++ab}function j(){var a,b;for(a=ab++;bb>ab&&(b=_.charCodeAt(ab),g(b));)++ab;return _.slice(a,ab)}function k(){var a,b,c;return a=ab,b=j(),c=1===b.length?X.Identifier:h(b)?X.Keyword:"null"===b?X.NullLiteral:"true"===b||"false"===b?X.BooleanLiteral:X.Identifier,{type:c,value:b,range:[a,ab]}}function l(){var a,b,c,d,e=ab,f=_.charCodeAt(ab),g=_[ab];switch(f){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++ab,{type:X.Punctuator,value:String.fromCharCode(f),range:[e,ab]};default:if(a=_.charCodeAt(ab+1),61===a)switch(f){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:return ab+=2,{type:X.Punctuator,value:String.fromCharCode(f)+String.fromCharCode(a),range:[e,ab]};case 33:case 61:return ab+=2,61===_.charCodeAt(ab)&&++ab,{type:X.Punctuator,value:_.slice(e,ab),range:[e,ab]}}}return b=_[ab+1],c=_[ab+2],d=_[ab+3],">"===g&&">"===b&&">"===c&&"="===d?(ab+=4,{type:X.Punctuator,value:">>>=",range:[e,ab]}):">"===g&&">"===b&&">"===c?(ab+=3,{type:X.Punctuator,value:">>>",range:[e,ab]}):"<"===g&&"<"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:"<<=",range:[e,ab]}):">"===g&&">"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:">>=",range:[e,ab]}):g===b&&"+-<>&|".indexOf(g)>=0?(ab+=2,{type:X.Punctuator,value:g+b,range:[e,ab]}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ab,{type:X.Punctuator,value:g,range:[e,ab]}):(s({},$.UnexpectedToken,"ILLEGAL"),void 0)}function m(){var a,d,e;if(e=_[ab],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=ab,a="","."!==e){for(a=_[ab++],e=_[ab],"0"===a&&e&&c(e.charCodeAt(0))&&s({},$.UnexpectedToken,"ILLEGAL");c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("."===e){for(a+=_[ab++];c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("e"===e||"E"===e)if(a+=_[ab++],e=_[ab],("+"===e||"-"===e)&&(a+=_[ab++]),c(_.charCodeAt(ab)))for(;c(_.charCodeAt(ab));)a+=_[ab++];else s({},$.UnexpectedToken,"ILLEGAL");return f(_.charCodeAt(ab))&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.NumericLiteral,value:parseFloat(a),range:[d,ab]}}function n(){var a,c,d,f="",g=!1;for(a=_[ab],b("'"===a||'"'===a,"String literal must starts with a quote"),c=ab,++ab;bb>ab;){if(d=_[ab++],d===a){a="";break}if("\\"===d)if(d=_[ab++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===_[ab]&&++ab;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({},$.UnexpectedToken,"ILLEGAL"),{type:X.StringLiteral,value:f,octal:g,range:[c,ab]}}function o(a){return a.type===X.Identifier||a.type===X.Keyword||a.type===X.BooleanLiteral||a.type===X.NullLiteral}function p(){var a;return i(),ab>=bb?{type:X.EOF,range:[ab,ab]}:(a=_.charCodeAt(ab),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(_.charCodeAt(ab+1))?m():l():c(a)?m():l())}function q(){var a;return a=db,ab=a.range[1],db=p(),ab=a.range[1],a}function r(){var a;a=ab,db=p(),ab=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(cab&&(a.push(O()),!v(")"));)u(",");return u(")"),a}function F(){var a;return a=q(),o(a)||t(a),cb.createIdentifier(a.value)}function G(){return u("."),F()}function H(){var a;return u("["),a=P(),u("]"),a}function I(){var a,b,c;for(a=D();v(".")||v("[")||v("(");)v("(")?(b=E(),a=cb.createCallExpression(a,b)):v("[")?(c=H(),a=cb.createMemberExpression("[",a,c)):(c=G(),a=cb.createMemberExpression(".",a,c));return a}function J(){var a;return a=I(),db.type===X.Punctuator&&(v("++")||v("--"))&&s({},$.UnexpectedToken),a}function K(){var a,b;return db.type!==X.Punctuator&&db.type!==X.Keyword?b=J():v("++")||v("--")?s({},$.UnexpectedToken):v("+")||v("-")||v("~")||v("!")?(a=q(),b=K(),b=cb.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},$.UnexpectedToken):b=J(),b}function L(a,b){var c=0;if(a.type!==X.Punctuator&&a.type!==X.Keyword)return 0;switch(a.value){case"||":c=1;break;case"&&":c=2;break;case"|":c=3;break;case"^":c=4;break;case"&":c=5;break;case"==":case"!=":case"===":case"!==":c=6;break;case"<":case">":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function M(){var a,b,c,d,e,f,g,h,i;if(d=eb.allowIn,eb.allowIn=!0,h=K(),b=db,c=L(b,d),0===c)return h;for(b.prec=c,q(),f=K(),e=[h,b,f];(c=L(db,d))>0;){for(;e.length>2&&c<=e[e.length-2].prec;)f=e.pop(),g=e.pop().value,h=e.pop(),a=cb.createBinaryExpression(g,h,f),e.push(a);b=q(),b.prec=c,e.push(b),a=K(),e.push(a)}for(eb.allowIn=d,i=e.length-1,a=e[i];i>1;)a=cb.createBinaryExpression(e[i-1].value,e[i-2],a),i-=2;return a}function N(){var a,b,c,d;return a=M(),v("?")&&(q(),b=eb.allowIn,eb.allowIn=!0,c=O(),eb.allowIn=b,u(":"),d=O(),a=cb.createConditionalExpression(a,c,d)),a}function O(){var a,b,c;return a=db,c=b=N()}function P(){var a;return a=O()}function Q(){return u(";"),cb.createEmptyStatement()}function R(){var a=P();return x(),cb.createExpressionStatement(a)}function S(){var a,b,c,d=db.type;if(d===X.EOF&&t(db),i(),d===X.Punctuator)switch(db.value){case";":return Q();case"(":return R()}return a=P(),a.type===Z.Identifier&&v(":")?(q(),c="$"+a.name,Object.prototype.hasOwnProperty.call(eb.labelSet,c)&&s({},$.Redeclaration,"Label",a.name),eb.labelSet[c]=!0,b=S(),delete eb.labelSet[c],cb.createLabeledStatement(a,b)):(x(),cb.createExpressionStatement(a))}function T(){return db.type===X.Keyword?S():db.type!==X.EOF?S():void 0}function U(){for(var a,b=[];bb>ab&&(a=T(),"undefined"!=typeof a);)b.push(a);return b}function V(){var a;return i(),r(),a=U(),cb.createProgram(a)}function W(a,b){var c;return c=String,"string"==typeof a||a instanceof String||(a=c(a)),cb=b,_=a,ab=0,bb=_.length,db=null,eb={allowIn:!0,labelSet:{}},bb>0&&"undefined"==typeof _[0]&&a instanceof String&&(_=a.valueOf()),V()}var X,Y,Z,$,_,ab,bb,cb,db,eb;X={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},Y={},Y[X.BooleanLiteral]="Boolean",Y[X.EOF]="",Y[X.Identifier]="Identifier",Y[X.Keyword]="Keyword",Y[X.NullLiteral]="Null",Y[X.NumericLiteral]="Numeric",Y[X.Punctuator]="Punctuator",Y[X.StringLiteral]="String",Z={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"},$={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"},a.esprima={parse:W}}(this),function(a){"use strict";function b(a,b,d,e){if(e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.tagName&&("bind"===d||"repeat"===d)){var f,g,h=b.match(r);if(h?(f=h[1],g=h[2]):(h=b.match(s),h&&(f=h[2],g=h[1])),h){var i;if(g=g.trim(),g.match(q))i=new CompoundBinding(function(a){return a.path}),i.bind("path",a,g);else try{i=c(a,g)}catch(j){console.error("Invalid expression syntax: "+g,j)}if(i)return t.set(e,f),i}}}function c(a,b){try{var c=new f;if(esprima.parse(b,c),!c.statements.length&&!c.labeledStatements.length)return;if(!c.labeledStatements.length&&c.statements.length>1)throw Error("Multiple unlabelled statements are not allowed.");var e=c.labeledStatements.length?d(c.labeledStatements):e=c.statements[0],g=[];for(var h in c.deps)g.push(h);if(!g.length)return{value:e({})};for(var i=new CompoundBinding(e),j=0;j>>0)+(c++ +"__")},i.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var j="[$_a-zA-Z]",k="[$_a-zA-Z0-9]",l=j+"+"+k+"*",m="("+l+")",n="(?:[0-9]|[1-9]+[0-9]+)",o="(?:"+l+"|"+n+")",p="(?:"+o+")(?:\\."+o+")*",q=new RegExp("^"+p+"$"),r=new RegExp("^"+m+"\\s* in (.*)$"),s=new RegExp("^(.*) as \\s*"+m+"$"),t=new i;e.prototype={getPath:function(){return this.last?this.last.getPath()+"."+this.name:this.name},valueFn:function(){var a=this.getPath();return this.deps[a]=!0,function(b){return b[a]}}};var u={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},v={"+":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}};f.prototype={getFn:function(a){return a instanceof e?a.valueFn():a},createProgram:function(){},createExpressionStatement:function(a){return this.statements.push(a),a},createLabeledStatement:function(a,b){return this.labeledStatements.push({label:a.getPath(),body:b instanceof e?b.valueFn():b}),b},createUnaryExpression:function(a,b){if(!u[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),function(c){return u[a](b(c))}},createBinaryExpression:function(a,b,c){if(!v[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),c=this.getFn(c),function(d){return v[a](b(d),c(d))}},createConditionalExpression:function(a,b,c){return a=this.getFn(a),b=this.getFn(b),c=this.getFn(c),function(d){return a(d)?b(d):c(d)}},createIdentifier:function(a){var b=new e(this.deps,a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){return new e(this.deps,c.name,b)},createLiteral:function(a){return function(){return a.value}},createArrayExpression:function(a){for(var b=0;be;e++)d.unshift("..");var g=d.join("/");return g},resolvePathsInHTML:function(a,b){b=b||p.documentUrlFromNode(a),p.resolveAttributes(a,b),p.resolveStyleElts(a,b);var c=a.querySelectorAll("template");c&&q(c,function(a){a.content&&p.resolvePathsInHTML(a.content,b)})},resolvePathsInStylesheet:function(a){var b=p.nodeUrl(a);a.__resource=p.resolveCssText(a.__resource,b)},resolveStyleElts:function(a,b){var c=a.querySelectorAll("style");c&&q(c,function(a){a.textContent=p.resolveCssText(a.textContent,b)})},resolveCssText:function(a,b){return a.replace(/url\([^)]*\)/g,function(a){var c=a.replace(/["']/g,"").slice(4,-1);return c=p.resolveUrl(b,c,!0),"url("+c+")"})},resolveAttributes:function(a,b){var c=a&&a.querySelectorAll(n);c&&q(c,function(a){this.resolveNodeAttributes(a,b)},this)},resolveNodeAttributes:function(a,b){m.forEach(function(c){var d=a.attributes[c];if(d&&d.value&&d.value.search(o)<0){var e=p.resolveUrl(b,d.value,!0);d.value=e}})}};h=h||{async:!0,ok:function(a){return a.status>=200&&a.status<300||304===a.status||0===a.status},load:function(b,c,d){var e=new XMLHttpRequest;return(a.flags.debug||a.flags.bust)&&(b+="?"+Math.random()),e.open("GET",b,h.async),e.addEventListener("readystatechange",function(){4===e.readyState&&c.call(d,!h.ok(e)&&e,e.response,b)}),e.send(),e},loadDocument:function(a,b,c){this.load(a,b,c).responseType="document"}};var q=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.path=p,a.xhr=h,a.importer=k,a.getDocumentUrl=p.getDocumentUrl,a.IMPORT_LINK_TYPE=i}(window.HTMLImports),function(a){function b(a){return"link"===a.localName&&a.getAttribute("rel")===f}function c(a){return a.parentNode&&!d(a)&&!e(a)}function d(a){return a.ownerDocument===document||a.ownerDocument.impl===document}function e(a){return a.parentNode&&"element"===a.parentNode.localName}var f="import",g={selectors:["link[rel="+f+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(a){if(!a.__importParsed){a.__importParsed=!0;var b=a.querySelectorAll(g.selectors);h(b,function(a){g[g.map[a.localName]](a)})}},parseLink:function(a){b(a)?a.content&&g.parse(a.content):this.parseGeneric(a)},parseGeneric:function(a){c(a)&&document.head.appendChild(a)},parseScript:function(b){if(c(b)){var d=(b.__resource||b.textContent).trim();if(d){var e=b.__nodeUrl;if(!e){var e=a.path.documentUrlFromNode(b),f="["+Math.floor(1e3*(Math.random()+1))+"]",g=d.match(/Polymer\(['"]([^'"]*)/);f=g&&g[1]||f,e+="/"+f+".js"}d+="\n//# sourceURL="+e+"\n",eval.call(window,d)}}}},h=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.parser=g}(HTMLImports),function(){function a(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState?a():window.addEventListener("DOMContentLoaded",a)}(),function(a){function b(a){u.push(a),t||(t=!0,q(d))}function c(a){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(a)||a}function d(){t=!1;var a=u;u=[],a.sort(function(a,b){return a.uid_-b.uid_});var b=!1;a.forEach(function(a){var c=a.takeRecords();e(a),c.length&&(a.callback_(c,a),b=!0)}),b&&d()}function e(a){a.nodes_.forEach(function(b){var c=p.get(b);c&&c.forEach(function(b){b.observer===a&&b.removeTransientObservers()})})}function f(a,b){for(var c=a;c;c=c.parentNode){var d=p.get(c);if(d)for(var e=0;e0){var e=c[d-1],f=n(e,a);if(f)return c[d-1]=f,void 0}else b(this.observer);c[d]=a},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(a){var b=this.options;b.attributes&&a.addEventListener("DOMAttrModified",this,!0),b.characterData&&a.addEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.addEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(a){var b=this.options;b.attributes&&a.removeEventListener("DOMAttrModified",this,!0),b.characterData&&a.removeEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.removeEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(a){if(a!==this.target){this.addListeners_(a),this.transientObservedNodes.push(a);var b=p.get(a);b||p.set(a,b=[]),b.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[],a.forEach(function(a){this.removeListeners_(a);for(var b=p.get(a),c=0;c1?logFlags.dom&&console.warn("inserted:",a.localName,"insert/remove count:",a.__inserted):a.insertedCallback&&(logFlags.dom&&console.log("inserted:",a.localName),a.insertedCallback())),logFlags.dom&&console.groupEnd())}function k(a){l(a),d(a,function(a){l(a)})}function l(a){(a.removedCallback||a.__upgraded__&&logFlags.dom)&&(logFlags.dom&&console.log("removed:",a.localName),m(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?logFlags.dom&&console.warn("removed:",a.localName,"insert/remove count:",a.__inserted):a.removedCallback&&a.removedCallback()))}function m(a){for(var b=a;b;){if(b==a.ownerDocument)return!0;b=b.parentNode||b.host}}function n(a){if(a.webkitShadowRoot&&!a.webkitShadowRoot.__watched){logFlags.dom&&console.log("watching shadow-root for: ",a.localName);for(var b=a.webkitShadowRoot;b;)o(b),b=b.olderShadowRoot}}function o(a){a.__watched||(t(a),a.__watched=!0)}function p(a){n(a),d(a,function(){n(a)})}function q(a){switch(a.localName){case"style":case"script":case"template":case void 0:return!0 -}}function r(a){if(logFlags.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(x(a.addedNodes,function(a){q(a)||g(a)}),x(a.removedNodes,function(a){q(a)||k(a)}))}),logFlags.dom&&console.groupEnd()}function s(){r(w.takeRecords())}function t(a){w.observe(a,{childList:!0,subtree:!0})}function u(a){t(a)}function v(a){logFlags.dom&&console.group("upgradeDocument: ",(a.URL||a._URL||"").split("/").pop()),g(a),logFlags.dom&&console.groupEnd()}var w=new MutationObserver(r),x=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.watchShadow=n,a.watchAllShadows=p,a.upgradeAll=g,a.upgradeSubtree=f,a.observeDocument=u,a.upgradeDocument=v,a.takeRecords=s}(window.CustomElements),function(){function parseElementElement(a){var b={name:"","extends":null};takeAttributes(a,b);var c=HTMLElement.prototype;if(b.extends){var d=document.createElement(b.extends);c=d.__proto__||Object.getPrototypeOf(d)}b.prototype=Object.create(c),a.options=b;var e=a.querySelector('script:not([type]),script[type="text/javascript"],scripts');e&&executeComponentScript(e.textContent,a,b.name);var f=document.register(b.name,b);a.ctor=f;var g=a.getAttribute("constructor");g&&(window[g]=f)}function takeAttributes(a,b){for(var c in b){var d=a.attributes[c];d&&(b[c]=d.value)}}function executeComponentScript(inScript,inContext,inName){context=inContext;var owner=context.ownerDocument,url=owner._URL||owner.URL||owner.impl&&(owner.impl._URL||owner.impl.URL),match=url.match(/.*\/([^.]*)[.]?.*$/);if(match){var name=match[1];url+=name!=inName?":"+inName:""}var code="__componentScript('"+inName+"', function(){"+inScript+"});"+"\n//# sourceURL="+url+"\n";eval(code)}function mixin(a,b){a=a||{};try{Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)})}catch(c){}return a}var HTMLElementElement=function(a){return a.register=HTMLElementElement.prototype.register,parseElementElement(a),a};HTMLElementElement.prototype={register:function(a){a&&(this.options.lifecycle=a.lifecycle,a.prototype&&mixin(this.options.prototype,a.prototype))}};var context;window.__componentScript=function(a,b){b.call(context)},window.HTMLElementElement=HTMLElementElement}(),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+"]","element"],map:{link:"parseLink",element:"parseElement"},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)},parseElement:function(a){new HTMLElementElement(a)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=c}(),function(){function a(){setTimeout(function(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))},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();else{var b=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(b,a)}}(),function(){function a(){}var b=document.createElement("style");b.textContent="element {display: none !important;} /* injected by platform.js */";var c=document.querySelector("head");if(c.insertBefore(b,c.firstChild),window.ShadowDOMPolyfill){CustomElements.watchShadow=a,CustomElements.watchAllShadows=a;var d=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],e={};d.forEach(function(a){e[a]=CustomElements[a]}),d.forEach(function(a){CustomElements[a]=function(b){return e[a](wrap(b))}})}}(),function(a){a=a||{};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(document,b,c)}};a.targetFinding=b,a.findTarget=b.findTarget.bind(b),window.PointerEventsPolyfill=a}(window.PointerEventsPolyfill),function(){function a(a){return'[touch-action="'+a+'"]'}function b(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; }"}var c=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],d="";c.forEach(function(c){d+=String(c)===c?a(c)+b(c):c.selectors.map(a)+b(c.rule)});var e=document.createElement("style");e.textContent=d;var f=document.querySelector("head");f.insertBefore(e,f.firstChild)}(),function(a){function b(a,b){var b=b||{},e=b.buttons;if(void 0===e)switch(b.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}var f;if(c)f=new MouseEvent(a,b);else{f=document.createEvent("MouseEvent");var g={bubbles:!1,cancelable:!1,view:null,detail:null,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};Object.keys(g).forEach(function(a){a in b&&(g[a]=b[a])}),f.initMouseEvent(a,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)}d||Object.defineProperty(f,"buttons",{get:function(){return e},enumerable:!0});var h=0;return h=b.pressure?b.pressure:e?.5:0,Object.defineProperties(f,{pointerId:{value:b.pointerId||0,enumerable:!0},width:{value:b.width||0,enumerable:!0},height:{value:b.height||0,enumerable:!0},pressure:{value:h,enumerable:!0},tiltX:{value:b.tiltX||0,enumerable:!0},tiltY:{value:b.tiltY||0,enumerable:!0},pointerType:{value:b.pointerType||"",enumerable:!0},hwTimestamp:{value:b.hwTimestamp||0,enumerable:!0},isPrimary:{value:b.isPrimary||!1,enumerable:!0}}),f}var c=!1,d=!1;try{var e=new MouseEvent("click",{buttons:1});c=!0,d=1===e.buttons}catch(f){}a.PointerEvent||(a.PointerEvent=b)}(window),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},forEach:function(a,b){this.ids.forEach(function(c,d){a.call(b,c,this.pointers[d],this)},this)}},a.PointerMap=window.Map&&Map.prototype.forEach?Map:b}(window.PointerEventsPolyfill),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerEventsPolyfill),function(a){var b={targets:new a.SideTable,handledEvents:new a.SideTable,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)},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){a.target.contains(a.relatedTarget)||this.leave(a),this.out(a)},enterOver:function(a){a.target.contains(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:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){var c=new PointerEvent(a,b);return 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){var b={};for(var c in a)b[c]=a[c];return b},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:function(a){var b=this.getTarget(a);return b?b.dispatchEvent(a):void 0},asyncDispatchEvent:function(a){setTimeout(this.dispatchEvent.bind(this,a),0)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=b.register.bind(b),a.unregister=b.unregister.bind(b)}(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);return 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 a.SideTable,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){null===this.firstTouch&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryTouch:function(a){this.isPrimaryTouch(a)&&(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(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.size>=b.length){var c=[];f.forEach(function(a,d){if(1!==a&&!this.findTouch(b,a-2)){var e=d.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.removePrimaryTouch(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)}),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){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(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={handledEvents:new a.SideTable,targets:new a.SideTable,handlers:{},recognizers:{},events:["pointerdown","pointermove","pointerup","pointerover","pointerout","pointercancel"],registerRecognizer:function(a,b){var c=b;this.recognizers[a]=c,this.events.forEach(function(a){if(c[a]){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(this.events,a)},unregisterTarget:function(a){this.unlisten(this.events,a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b,c=a.type;(b=this.handlers[c])&&this.makeQueue(b,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){var b={};for(var c in a)b[c]=a[c];return b},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)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=function(b){var c=window.PointerEventsPolyfill;c&&c.register(b),a.dispatcher.registerTarget(b)},b.registerTarget(document)}(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,pointerType:c.pointerType};"trackend"===a&&(h._releaseTarget=c.target);var 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"],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)},preventTap:function(a){c.delete(a)}};b.registerRecognizer("tap",d)}(window.PointerGestures),Polymer={},function(){var a=document.createElement("style");a.textContent="body {opacity: 0;}";var b=document.querySelector("head");b.insertBefore(a,b.firstChild),window.addEventListener("WebComponentsReady",function(){document.body.style.webkitTransition="opacity 0.3s",document.body.style.opacity=1})}(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&&(a[c].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;"_super"in c||(g||(g=e.call(this,c)),g||console.warn("called super() on a method not installed declaratively (has no .nom property)"),d(c,g,f(this)));var h=c._super;if(h){var i=h[g];return"_super"in i||d(i,g,h),i.apply(this,a||[])}}function c(a,b,c){for(;a&&(!a.hasOwnProperty(b)||a[b]===c);)a=f(a);return 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){console.warn("nameInThis called");for(var b=this;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(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}}};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?!1:!0,detail:b})),b},asyncFire:function(){this.asyncMethod("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,b){b.cancelBubble||(b.on=i+b.type,h.events&&console.group("[%s]: listenLocal [%s]",a.localName,b.on),!b.path||window.ShadowDOMPolyfill?d(a,b):c(a,b),h.events&&console.groupEnd())}function c(a,b){var c=null;Array.prototype.some.call(b.path,function(d){return d===a?!0:(c=c===a?c:e(d),c&&f(c,d,b)?!0:void 0)},this)}function d(a,b){h.events&&console.log("event.path() not supported for",b.type);for(var c=b.target,d=null;c&&c!=a;){if(d=d===a?d:e(c),d&&f(d,c,b))return!0;c=c.parentNode}}function e(a){for(;a.parentNode;)a=a.parentNode;return a.host}function f(a,b,c){var d=b.getAttribute&&b.getAttribute(c.on);return d&&g(b,c)&&(h.events&&console.log("[%s] found handler name [%s]",a.localName,d),a.dispatchMethod(b,d,[c,c.detail,b])),c.cancelBubble}function g(a,b){var c=l.get(b);return c||l.set(b,c=[]),c.indexOf(a)<0?(c.push(a),!0):void 0}var h=window.logFlags||{},i="on-",j="eventDelegates",k={EVENT_PREFIX:i,DELEGATES:j,addHostListeners:function(){var a=this[j];h.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a),this.addNodeListeners(this,a,this.hostEventListener)},addInstanceListeners:function(a,b){var c=b.delegates;c&&(h.events&&Object.keys(c).length>0&&console.log("[%s:root] addInstanceListeners:",this.localName,c),this.addNodeListeners(a,c,this.instanceEventListener))},addNodeListeners:function(a,b,c){var d;for(var e in b)d||(d=c.bind(this)),a.addEventListener(e,d)},hostEventListener:function(a){if(!a.cancelBubble){h.events&&console.group("[%s]: hostEventListener(%s)",this.localName,a.type);var b=this.findEventDelegate(a);b&&(h.events&&console.log("[%s] found host handler name [%s]",this.localName,b),this.dispatchMethod(this,b,[a,a.detail,this])),h.events&&console.groupEnd()}},findEventDelegate:function(a){return this[j][a.type]},dispatchMethod:function(a,b,c){if(a){h.events&&console.group("[%s] dispatch [%s]",a.localName,b);var d=this[b];d&&d[c?"apply":"call"](this,c),h.events&&console.groupEnd()}},instanceEventListener:function(a){b(this,a)}},l=new SideTable("handledList");a.api.instance.events=k}(Polymer),function(a){var b="__published",c="__instance_attributes",d={PUBLISHED:b,INSTANCE_ATTRIBUTES:c,copyInstanceAttributes:function(){var a=this[c];for(var b in a)this.setAttribute(b,a[b])},takeAttributes:function(){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.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var c=Object.keys(this[b]);return c[c.map(e).indexOf(a.toLowerCase())]},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a){return"object"!=typeof a&&void 0!==a?a:void 0},propertyToAttribute:function(a){if(Object.keys(this[b]).indexOf(a)>=0){var c=this.serializeValue(this[a]);void 0!==c&&this.setAttribute(a,c)}}},e=String.prototype.toLowerCase.call.bind(String.prototype.toLowerCase);a.api.instance.attributes=d}(Polymer),function(a){function b(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)}function c(a,b,c,d){h.bind&&console.log(o,c.localName||"object",d,a.localName,b);var e=PathObserver.getValueAtPath(c,d);return(null===e||void 0===e)&&PathObserver.setValueAtPath(c,d,a[b]),PathObserver.defineProperty(a,b,{object:c,path:d})}function d(a,b,c){var d=g(a);d[b]=c}function e(a,b){var c=g(a);return c&&c[b]?(c[b].close(),c[b]=null,!0):void 0}function f(a){var b=g(a);Object.keys(b).forEach(function(a){b[a].close(),b[a]=null})}function g(a){var b=l.get(a);return b||l.set(a,b={}),b}var h=window.logFlags||{},i="Changed",j=a.api.instance.attributes.PUBLISHED,k={observeProperties:function(){for(var a,b=this.getCustomPropertyNames(),c=0,d=b.length;d>c&&(a=b[c]);c++)this.observeProperty(a)},getCustomPropertyNames:function(){return this.customPropertyNames},observeProperty:function(a){if(this.shouldObserveProperty(a)){h.watch&&console.log(m,this.localName,a);var b=function(b,c){h.watch&&console.log(n,this.localName,this.id||"",a,this[a],c),this.dispatchPropertyChange(a,c)}.bind(this),c=new PathObserver(this,a,b);d(this,a,c)}},bindProperty:function(a,b,d){return c(this,a,b,d)},unbindProperty:function(a,b){return e(this,a,b)},unbindAllProperties:function(){f(this)},shouldObserveProperty:function(a){return Boolean(this[a+i]||Object.keys(this[j]).indexOf(a)>=0)},dispatchPropertyChange:function(a,c){this.propertyToAttribute(a),b.call(this,a+i,[c])}},l=new SideTable,m="[%s] watching [%s]",n="[%s#%s] watch: [%s] now [%s] was [%s]",o="[%s]: bindProperties: [%s] to [%s].[%s]";a.api.instance.properties=k}(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=new ExpressionSyntax,g={instanceTemplate:function(a){return a.createInstance(this,f)},createBinding:function(a,b,c){var d=this.propertyForAttribute(a);if(d){var e=this.bindProperty(d,b,c);return e.path=c,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(){this._unbound||(this.unbindAllProperties(),this.super(),b(this.shadowRoot),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)}},h=/\{\{([^{}]*)}}/;a.bindPattern=h,a.api.instance.mdv=g}(Polymer),function(a){function b(a){return a.hasOwnProperty("PolymerBase")}function c(){}var d={PolymerBase:!0,job:Polymer.job,"super":Polymer.super,ready:function(){},readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){this.observeProperties(),this.copyInstanceAttributes(),this.takeAttributes(),this.addHostListeners(),this.parseElements(this.__proto__),this.ready()},insertedCallback:function(){this._enteredDocumentCallback()},enteredDocumentCallback:function(){this._enteredDocumentCallback()},_enteredDocumentCallback:function(){this.cancelUnbindAll(!0),this.inserted&&this.inserted(),this.enteredDocument&&this.enteredDocument()},removedCallback:function(){this._leftDocumentCallback()},leftDocumentCallback:function(){this._leftDocumentCallback()},_leftDocumentCallback:function(){this.asyncUnbindAll(),this.removed&&this.removed(),this.leftDocument&&this.leftDocument()},parseElements:function(a){a&&a.element&&(this.parseElements(a.__proto__),a.parseElement.call(this,a.element))},parseElement:function(a){this.shadowFromTemplate(this.fetchTemplate(a))},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemplate:function(a){if(a){this.shadowRoot;var b=this.createShadowRoot();b.applyAuthorStyles=this.applyAuthorStyles,b.resetStyleInheritance=this.resetStyleInheritance;var c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady(b,a),b}},shadowRootReady:function(a,b){this.marshalNodeReferences(a),this.addInstanceListeners(a,b),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){this.attributeToProperty(a,this.getAttribute(a)),this.attributeChanged&&this.attributeChanged.apply(this,arguments)}};c.prototype=d,d.constructor=c,a.Base=c,a.isBase=b,a.api.instance.base=d}(Polymer),function(a){function b(a){return a.__proto__}window.logFlags||{};var c="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);window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimPolyfillDirectives([f],this.localName),Polymer.applyStyleToScope(f,a)}}},scopeHasElementStyle:function(a,b){var d=c+"="+this.localName+"-"+b;return a.querySelector("style["+d+"]")},findStyleController:function(){if(window.ShadowDOMPolyfill)return wrap(document.head);for(var a=this;a.parentNode;)a=a.parentNode;return a===document?document.head:a}};a.api.instance.styles=e}(Polymer),function(a){var b={addResolvePathApi:function(){var a=this.elementPath();this.prototype.resolvePath=function(b){return a+b}},elementPath:function(){return this.urlToPath(HTMLImports.getDocumentUrl(this.ownerDocument))},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}window.logFlags||{};var f=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.installLocalSheets(),this.installGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(i),this.sheets.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 i=this.findNodes(h,f);return i.forEach(function(a){a.parentNode.removeChild(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){function b(a){return a.slice(0,k)==g}function c(a){return a.slice(k)}function d(a){return a.ref?a.ref.content:a.content}var e=a.api.instance.events,f=e.DELEGATES,g=e.EVENT_PREFIX,h=window.logFlags||{},i={inheritDelegates:function(a){this.inheritObject(a,f)},parseHostEvents:function(){var a=this.prototype[f];this.addAttributeDelegates(a)},addAttributeDelegates:function(a){for(var d,e=0;d=this.attributes[e];e++)b(d.name)&&(a[c(d.name)]=d.value)},parseLocalEvents:function(){this.querySelectorAll("template").forEach(function(a){a.delegates={},this.accumulateTemplatedEvents(a,a.delegates),h.events&&console.log("[%s] parseLocalEvents:",this.attributes.name.value,a.delegates)},this)},accumulateTemplatedEvents:function(a,b){if("template"===a.localName){var c=d(a);c&&this.accumulateChildEvents(c,b)}},accumulateChildEvents:function(a,b){a.childNodes.forEach(function(a){this.accumulateEvents(a,b)},this)},accumulateEvents:function(a,b){return this.accumulateAttributeEvents(a,b),this.accumulateChildEvents(a,b),this.accumulateTemplatedEvents(a,b),b},accumulateAttributeEvents:function(a,d){a.attributes&&a.attributes.forEach(function(a){b(a.name)&&this.accumulateEvent(c(a.name),d)},this)},accumulateEvent:function(a,b){a=j[a]||a,b[a]=b[a]||1}},j={webkitanimationstart:"webkitAnimationStart",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitionEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"},k=g.length;i.event_translations=j,a.api.declaration.events=i}(Polymer),function(a){var b=[],c={cacheProperties:function(){this.prototype.customPropertyNames=this.getCustomPropertyNames(this.prototype)},getCustomPropertyNames:function(c){for(var d,e={};c&&!a.isBase(c);){for(var f,g=Object.getOwnPropertyNames(c),h=0,i=g.length;i>h&&(f=g[h]);h++)e[f]=!0,d=!0;c=c.__proto__}return d?Object.keys(e):b}};a.api.declaration.properties=c}(Polymer),function(a){var b=a.api.instance.attributes,c=b.PUBLISHED,d=b.INSTANCE_ATTRIBUTES,e="publish",f="attributes",g={inheritAttributesObjects:function(a){this.inheritObject(a,c),this.inheritObject(a,d)},parseAttributes:function(){this.publishAttributes(this.prototype),this.publishProperties(this.prototype),this.accumulateInstanceAttributes()},publishAttributes:function(a){var b=a[c],d=this.getAttribute(f);if(d){var e=d.split(d.indexOf(",")>=0?",":" ");e.forEach(function(a){a=a.trim(),!a||a in b||(b[a]=null)})}Object.keys(b).forEach(function(c){c in a||(a[c]=b[c])})},publishProperties:function(a){this.publishPublish(a)},publishPublish:function(a){if(a.hasOwnProperty(e)){var b=a[e];b&&(Object.keys(b).forEach(function(c){a[c]=b[c]}),Platform.mixin(a[c],b))}},accumulateInstanceAttributes:function(){var a=this.prototype[d];this.attributes.forEach(function(b){this.isInstanceAttribute(b.name)&&(a[b.name]=b.value)},this)},isInstanceAttribute:function(a){return!this.blackList[a]&&"on-"!==a.slice(0,3)},blackList:{name:1,"extends":1,constructor:1,noscript:1}};g.blackList[f]=1,a.api.declaration.attributes=g}(Polymer),function(a){function b(a,b){h[a]=b||{},g[a]&&g[a].define()}function c(a){return Object.create(HTMLElement.getPrototypeForTag(a))}function d(b){if(!Object.__proto__){var c=Object.getPrototypeOf(b);b.__proto__=c,a.isBase(c)&&(c.__proto__=Object.getPrototypeOf(c))}}var e=Polymer.extend,f=a.api.declaration,g={},h={},i=c();e(i,{readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){var a=this.getAttribute("name");h[a]?this.define():g[a]=this},define:function(){var a=this.getAttribute("name"),b=this.getAttribute("extends");this.prototype=this.generateCustomPrototype(a,b),this.prototype.element=this,this.addResolvePathApi(),d(this.prototype),this.desugar(),window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimStyling(this.templateContent(),a,b),this.register(a),this.publishConstructor()},desugar:function(){this.parseAttributes(),this.parseHostEvents(),this.parseLocalEvents(),this.installSheets(),this.prototype.registerCallback&&this.prototype.registerCallback(this),this.cacheProperties()},generateCustomPrototype:function(a,b){var c=this.generateBasePrototype(b);return this.addNamedApi(c,a)},generateBasePrototype:function(a){var b=c(a);return this.ensureBaseApi(b)},ensureBaseApi:function(b){return b.PolymerBase||(Object.keys(a.api.instance).forEach(function(c){e(b,a.api.instance[c])}),b=Object.create(b)),this.inheritAttributesObjects(b),this.inheritDelegates(b),b},addNamedApi:function(a,b){return e(a,h[b])},inheritObject:function(a,b){a[b]=e({},Object.getPrototypeOf(a)[b])},register:function(a){this.ctor=document.register(a,{prototype:this.prototype}),this.prototype.constructor=this.ctor,HTMLElement.register(a,this.prototype)},publishConstructor:function(){var a=this.getAttribute("constructor");a&&(window[a]=this.ctor)}}),Object.keys(f).forEach(function(a){e(i,f[a])}),document.register("polymer-element",{prototype:i}),e(b,window.Polymer),window.Polymer=b}(Polymer),Polymer.register=function(a){if(a!=window){var b=a.getAttribute("name");throw new Error("Polymer.register is deprecated in declaration of "+b+". Please see http://www.polymer-project.org/getting-started.html")}}; -/* -//@ sourceMappingURL=polymer.native.min.js.map -*/ \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js b/architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js deleted file mode 100644 index 387e843dc8..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js +++ /dev/null @@ -1,35 +0,0 @@ -// 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. -function PointerGestureEvent(a,b){var c=b||{},d=document.createEvent("Event"),e={bubbles:!0,cancelable:!0};return Object.keys(e).forEach(function(a){a in c&&(e[a]=c[a])}),d.initEvent(a,e.bubbles,e.cancelable),Object.keys(c).forEach(function(a){d[a]=b[a]}),d.preventTap=this.preventTap,d}if(window.Platform=window.Platform||{},window.logFlags=window.logFlags||{},function(a){var b=a.flags||{};location.search.slice(1).split("&").forEach(function(a){a=a.split("="),a[0]&&(b[a[0]]=a[1]||!0)}),b.shadow=(b.shadowdom||b.shadow||b.polyfill||!HTMLElement.prototype.webkitCreateShadowRoot)&&"polyfill",a.flags=b}(Platform),"polyfill"===Platform.flags.shadow){var SideTable;"undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var ShadowDOMPolyfill={};!function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function d(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){switch(c){case"arguments":case"caller":case"length":case"name":case"prototype":case"toString":return}Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function e(a){var b=a.__proto__||Object.getPrototypeOf(a),c=z.get(b);if(c)return c;var d=e(b),f=n(d);return k(b,f,a),f}function f(a,b){i(a,b,!0)}function g(a,b){i(b,a,!1)}function h(a){return/^on[a-z]+$/.test(a)}function i(b,c,d){Object.getOwnPropertyNames(b).forEach(function(e){if(!(e in c)){B&&b.__lookupGetter__(e);var f;try{f=Object.getOwnPropertyDescriptor(b,e)}catch(g){f=C}var i,j;if(d&&"function"==typeof f.value)return c[e]=function(){return this.impl[e].apply(this.impl,arguments)},void 0;var k=h(e);i=k?a.getEventHandlerGetter(e):function(){return this.impl[e]},(f.writable||f.set)&&(j=k?a.getEventHandlerSetter(e):function(a){this.impl[e]=a}),Object.defineProperty(c,e,{get:i,set:j,configurable:f.configurable,enumerable:f.enumerable})}})}function j(a,b,c){var e=a.prototype;k(e,b,c),d(b,a)}function k(a,c,d){var e=c.prototype;b(void 0===z.get(a)),z.set(a,c),f(a,e),d&&g(e,d)}function l(a,b){return z.get(b.prototype)===a}function m(a){var b=Object.getPrototypeOf(a),c=e(b),d=n(c);return k(b,d,a),d}function n(a){function b(b){a.call(this,b)}return b.prototype=Object.create(a.prototype),b.prototype.constructor=b,b}function o(a){return a instanceof A.EventTarget||a instanceof A.Event||a instanceof A.DOMImplementation}function p(a){return a instanceof F||a instanceof E||a instanceof G||a instanceof D}function q(a){if(null===a)return null;b(p(a));var c=y.get(a);if(!c){var d=e(a);c=new d(a),y.set(a,c)}return c}function r(a){return null===a?null:(b(o(a)),a.impl)}function s(a){return a&&o(a)?r(a):a}function t(a){return a&&!o(a)?q(a):a}function u(a,c){null!==c&&(b(p(a)),b(void 0===c||o(c)),y.set(a,c))}function v(a,b,c){Object.defineProperty(a.prototype,b,{get:c,configurable:!0,enumerable:!0})}function w(a,b){v(a,b,function(){return q(this.impl[b])})}function x(a,b){a.forEach(function(a){b.forEach(function(b){a.prototype[b]=function(){var a=q(this);return a[b].apply(a,arguments)}})})}var y=new SideTable,z=new SideTable,A=Object.create(null);Object.getOwnPropertyNames(window);var B=/Firefox/.test(navigator.userAgent),C={get:function(){},set:function(){},configurable:!0,enumerable:!0},D=DOMImplementation,E=Event,F=Node,G=Window;a.assert=b,a.defineGetter=v,a.defineWrapGetter=w,a.forwardMethodsToWrapper=x,a.isWrapperFor=l,a.mixin=c,a.registerObject=m,a.registerWrapper=j,a.rewrap=u,a.unwrap=r,a.unwrapIfNeeded=s,a.wrap=q,a.wrapIfNeeded=t,a.wrappers=A}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){return a instanceof N.ShadowRoot}function c(a){var b=a.localName;return"content"===b||"shadow"===b}function d(a){return!!a.shadowRoot}function e(a){var b;return a.parentNode||(b=a.defaultView)&&M(b)||null}function f(f,g,h){if(h.length)return h.shift();if(b(f))return j(f)||a.getHostForShadowRoot(f);var i=a.eventParentsTable.get(f);if(i){for(var k=1;k=0;b--)if(!c(a[b]))return a[b];return null}function i(d,e){for(var g=[];d;){for(var i=[],j=e,l=void 0;j;){var n=null;if(i.length){if(c(j)&&(n=h(i),k(l))){var o=i[i.length-1];i.push(o)}}else i.push(j);if(m(j,d))return i[i.length-1];b(j)&&i.pop(),l=j,j=f(j,n,g)}d=b(d)?a.getHostForShadowRoot(d):d.parentNode}}function j(b){return a.insertionParentTable.get(b)}function k(a){return j(a)}function l(a){for(var b;b=a.parentNode;)a=b;return a}function m(a,b){return l(a)===l(b)}function n(b,c){if(b===c)return!0;if(b instanceof N.ShadowRoot){var d=a.getHostForShadowRoot(b);return d?n(l(d),c):!1}return!1}function o(a){switch(a){case"DOMAttrModified":case"DOMAttributeNameChanged":case"DOMCharacterDataModified":case"DOMElementNameChanged":case"DOMNodeInserted":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":return!0}return!1}function p(b){if(!P.get(b)){P.set(b,!0),o(b.type)||a.renderAllPending();var c=M(b.target),d=M(b);return q(d,c)}}function q(a,b){var c=g(b);return"load"===a.type&&2===c.length&&c[0].target instanceof N.Document&&c.shift(),X.set(a,c),r(a,c)&&s(a,c)&&t(a,c),T.set(a,w.NONE),R.set(a,null),a.defaultPrevented}function r(a,b){for(var c,d=b.length-1;d>0;d--){var e=b[d].target,f=b[d].currentTarget;if(e!==f&&(c=w.CAPTURING_PHASE,!u(b[d],a,c)))return!1}return!0}function s(a,b){var c=w.AT_TARGET;return u(b[0],a,c)}function t(a,b){for(var c,d=a.bubbles,e=1;e=f;f++){var g=b[f].currentTarget,h=l(g);n(e,h)&&(f!==d||g instanceof N.Node)&&(a[c++]=g)}a.length=c}return a},stopPropagation:function(){U.set(this,!0)},stopImmediatePropagation:function(){U.set(this,!0),V.set(this,!0)}},K(Y,w,document.createEvent("Event"));var Z=y("UIEvent",w),$=y("CustomEvent",w),_={get relatedTarget(){return S.get(this)||M(L(this).relatedTarget)}},ab=J({initMouseEvent:z("initMouseEvent",14)},_),bb=J({initFocusEvent:z("initFocusEvent",5)},_),cb=y("MouseEvent",Z,ab),db=y("FocusEvent",Z,bb),eb=y("MutationEvent",w,{initMutationEvent:z("initMutationEvent",3),get relatedNode(){return M(this.impl.relatedNode)}}),fb=Object.create(null),gb=function(){try{new window.MouseEvent("click")}catch(a){return!1}return!0}();if(!gb){var hb=function(a,b,c){if(c){var d=fb[c];b=J(J({},d),b)}fb[a]=b};hb("Event",{bubbles:!1,cancelable:!1}),hb("CustomEvent",{detail:null},"Event"),hb("UIEvent",{view:null,detail:0},"Event"),hb("MouseEvent",{screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},"UIEvent"),hb("FocusEvent",{relatedTarget:null},"UIEvent")}var ib=window.EventTarget,jb=["addEventListener","removeEventListener","dispatchEvent"];[Node,Window].forEach(function(a){var b=a.prototype;jb.forEach(function(a){Object.defineProperty(b,a+"_",{value:b[a]})})}),C.prototype={addEventListener:function(a,b,c){if(B(b)){var d=new v(a,b,c),e=O.get(this);if(e){for(var f=0;fd;d++)b[d]=f(a[d]);return b.length=e,b}function e(a,b){a.prototype[b]=function(){return d(this.impl[b].apply(this.impl,arguments))}}var f=a.wrap;c.prototype={item:function(a){return this[a]}},b(c.prototype,"item"),a.wrappers.NodeList=c,a.addWrapNodeListMethod=e,a.wrapNodeList=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){j(a instanceof f)}function c(a,b,c,d){if(a.nodeType!==f.DOCUMENT_FRAGMENT_NODE)return a.parentNode&&a.parentNode.removeChild(a),a.parentNode_=b,a.previousSibling_=c,a.nextSibling_=d,c&&(c.nextSibling_=a),d&&(d.previousSibling_=a),[a];for(var e,g=[];e=a.firstChild;)a.removeChild(e),g.push(e),e.parentNode_=b;for(var h=0;he;e++)d.appendChild(m(b[e]));return d}function e(a){for(var b=a.firstChild;b;){j(b.parentNode===a);var c=b.nextSibling,d=m(b),e=d.parentNode;e&&s.call(e,d),b.previousSibling_=b.nextSibling_=b.parentNode_=null,b=c}a.firstChild_=a.lastChild_=null}function f(a){j(a instanceof o),g.call(this,a),this.parentNode_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_=void 0}var g=a.wrappers.EventTarget,h=a.wrappers.NodeList,i=a.defineWrapGetter,j=a.assert,k=a.mixin,l=a.registerWrapper,m=a.unwrap,n=a.wrap,o=window.Node,p=o.prototype.appendChild,q=o.prototype.insertBefore,r=o.prototype.replaceChild,s=o.prototype.removeChild,t=o.prototype.compareDocumentPosition;f.prototype=Object.create(g.prototype),k(f.prototype,{appendChild:function(a){b(a),this.invalidateShadowRenderer();var e=this.lastChild,f=null,g=c(a,this,e,f);return this.lastChild_=g[g.length-1],e||(this.firstChild_=g[0]),p.call(this.impl,d(this,g)),a},insertBefore:function(a,e){if(!e)return this.appendChild(a);b(a),b(e),j(e.parentNode===this),this.invalidateShadowRenderer();var f=e.previousSibling,g=e,h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]);var i=m(e),k=i.parentNode;return k&&q.call(k,d(this,h),i),a},removeChild:function(a){if(b(a),a.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var c=this.firstChild,d=this.lastChild,e=a.nextSibling,f=a.previousSibling,g=m(a),h=g.parentNode;return h&&s.call(h,g),c===a&&(this.firstChild_=e),d===a&&(this.lastChild_=f),f&&(f.nextSibling_=e),e&&(e.previousSibling_=f),a.previousSibling_=a.nextSibling_=a.parentNode_=null,a},replaceChild:function(a,e){if(b(a),b(e),e.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var f=e.previousSibling,g=e.nextSibling;g===a&&(g=a.nextSibling);var h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]),this.lastChild===e&&(this.lastChild_=h[h.length-1]),e.previousSibling_=null,e.nextSibling_=null,e.parentNode_=null;var i=m(e);return i.parentNode&&r.call(i.parentNode,d(this,h),i),e},hasChildNodes:function(){return null===this.firstChild},get parentNode(){return void 0!==this.parentNode_?this.parentNode_:n(this.impl.parentNode)},get firstChild(){return void 0!==this.firstChild_?this.firstChild_:n(this.impl.firstChild)},get lastChild(){return void 0!==this.lastChild_?this.lastChild_:n(this.impl.lastChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_:n(this.impl.nextSibling)},get previousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:n(this.impl.previousSibling)},get parentElement(){for(var a=this.parentNode;a&&a.nodeType!==f.ELEMENT_NODE;)a=a.parentNode;return a},get textContent(){for(var a="",b=this.firstChild;b;b=b.nextSibling)a+=b.textContent;return a},set textContent(a){if(e(this),this.invalidateShadowRenderer(),""!==a){var b=this.impl.ownerDocument.createTextNode(a);this.appendChild(b)}},get childNodes(){for(var a=new h,b=0,c=this.firstChild;c;c=c.nextSibling)a[b++]=c;return a.length=b,a},cloneNode:function(a){if(!this.invalidateShadowRenderer())return n(this.impl.cloneNode(a));var b=n(this.impl.cloneNode(!1));if(a)for(var c=this.firstChild;c;c=c.nextSibling)b.appendChild(c.cloneNode(!0));return b},contains:function(a){if(!a)return!1;if(a===this)return!0;var b=a.parentNode;return b?this.contains(b):!1},compareDocumentPosition:function(a){return t.call(this.impl,m(a))}}),i(f,"ownerDocument"),l(o,f,document.createDocumentFragment()),delete f.prototype.querySelector,delete f.prototype.querySelectorAll,f.prototype=k(Object.create(g.prototype),f.prototype),a.wrappers.Node=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a,c){for(var d,e=a.firstElementChild;e;){if(e.matches(c))return e;if(d=b(e,c))return d;e=e.nextElementSibling}return null}function c(a,b,d){for(var e=a.firstElementChild;e;)e.matches(b)&&(d[d.length++]=e),c(e,b,d),e=e.nextElementSibling;return d}var d={querySelector:function(a){return b(this,a)},querySelectorAll:function(a){return c(this,a,new NodeList)}},e={getElementsByTagName:function(a){return this.querySelectorAll(a)},getElementsByClassName:function(a){return this.querySelectorAll("."+a)},getElementsByTagNameNS:function(a,b){if("*"===a)return this.getElementsByTagName(b);for(var c=new NodeList,d=this.getElementsByTagName(b),e=0,f=0;e";case Node.TEXT_NODE:return c(a.nodeValue);case Node.COMMENT_NODE:return"";default:throw console.error(a),new Error("not implemented")}}function e(a){for(var b="",c=a.firstChild;c;c=c.nextSibling)b+=d(c);return b}function f(a,b,c){var d=c||"div";a.textContent="";var e=n(a.ownerDocument.createElement(d));e.innerHTML=b;for(var f;f=e.firstChild;)a.appendChild(o(f))}function g(a){j.call(this,a)}function h(b){k(g,b,function(){return a.renderAllPending(),this.impl[b]})}function i(b){Object.defineProperty(g.prototype,b,{value:function(){return a.renderAllPending(),this.impl[b].apply(this.impl,arguments)},configurable:!0,enumerable:!0})}var j=a.wrappers.Element,k=a.defineGetter,l=a.mixin,m=a.registerWrapper,n=a.unwrap,o=a.wrap,p=/&|<|"/g,q={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},r=window.HTMLElement;g.prototype=Object.create(j.prototype),l(g.prototype,{get innerHTML(){return e(this)},set innerHTML(a){f(this,a,this.tagName)},get outerHTML(){return d(this)},set outerHTML(a){if(this.invalidateShadowRenderer())throw new Error("not implemented");this.impl.outerHTML=a}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollLeft","scrollTop","scrollWidth"].forEach(h),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(i),m(r,g,document.createElement("b")),a.wrappers.HTMLElement=g,a.getInnerHTML=e,a.setInnerHTML=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLContentElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get select(){return this.getAttribute("select")},set select(a){this.setAttribute("select",a)},setAttribute:function(a,b){c.prototype.setAttribute.call(this,a,b),"select"===String(a).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),f&&e(f,b),a.wrappers.HTMLContentElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLShadowElement;b.prototype=Object.create(c.prototype),d(b.prototype,{invalidateShadowRenderer:function(){c.prototype.invalidateShadowRenderer.call(this,!0)}}),f&&e(f,b),a.wrappers.HTMLShadowElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){if(!a.defaultView)return a;var b=l.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);l.set(a,b)}return b}function c(a){for(var c,d=b(a.ownerDocument),e=d.createDocumentFragment();c=a.firstChild;)e.appendChild(c);return e}function d(a){e.call(this,a)}var e=a.wrappers.HTMLElement,f=a.getInnerHTML,g=a.mixin,h=a.registerWrapper,i=a.setInnerHTML,j=a.wrap,k=new SideTable,l=new SideTable,m=window.HTMLTemplateElement;d.prototype=Object.create(e.prototype),g(d.prototype,{get content(){if(m)return j(this.impl.content);var a=k.get(this);return a||(a=c(this),k.set(this,a)),a},get innerHTML(){return f(this.content)},set innerHTML(a){i(this.content,a),this.invalidateShadowRenderer()}}),m&&h(m,d),a.wrappers.HTMLTemplateElement=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){switch(a.localName){case"content":return new c(a);case"shadow":return new e(a);case"template":return new f(a)}d.call(this,a)}var c=a.wrappers.HTMLContentElement,d=a.wrappers.HTMLElement,e=a.wrappers.HTMLShadowElement,f=a.wrappers.HTMLTemplateElement;a.mixin;var g=a.registerWrapper,h=window.HTMLUnknownElement;b.prototype=Object.create(d.prototype),g(h,b),a.wrappers.HTMLUnknownElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";var b=a.GetElementsByInterface,c=a.ParentNodeInterface,d=a.SelectorsInterface,e=a.mixin,f=a.registerObject,g=f(document.createDocumentFragment());e(g.prototype,c),e(g.prototype,d),e(g.prototype,b);var h=f(document.createTextNode("")),i=f(document.createComment(""));a.wrappers.Comment=i,a.wrappers.DocumentFragment=g,a.wrappers.Text=h}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b=i(a.impl.ownerDocument.createDocumentFragment());c.call(this,b),g(b,this);var d=a.shadowRoot;k.set(this,d),j.set(this,a)}var c=a.wrappers.DocumentFragment,d=a.elementFromPoint,e=a.getInnerHTML,f=a.mixin,g=a.rewrap,h=a.setInnerHTML,i=a.unwrap,j=new SideTable,k=new SideTable;b.prototype=Object.create(c.prototype),f(b.prototype,{get innerHTML(){return e(this)},set innerHTML(a){h(this,a),this.invalidateShadowRenderer()},get olderShadowRoot(){return k.get(this)||null},invalidateShadowRenderer:function(){return j.get(this).invalidateShadowRenderer()},elementFromPoint:function(a,b){return d(this,this.ownerDocument,a,b)},getElementById:function(a){return this.querySelector("#"+a)}}),a.wrappers.ShadowRoot=b,a.getHostForShadowRoot=function(a){return j.get(a)}}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){a.previousSibling_=a.previousSibling,a.nextSibling_=a.nextSibling,a.parentNode_=a.parentNode}function c(a){a.firstChild_=a.firstChild,a.lastChild_=a.lastChild}function d(a){D(a instanceof C);for(var d=a.firstChild;d;d=d.nextSibling)b(d);c(a)}function e(a){var b=F(a);d(a),b.textContent=""}function f(a,c){var e=F(a),f=F(c);f.nodeType===C.DOCUMENT_FRAGMENT_NODE?d(c):(h(c),b(c)),a.lastChild_=a.lastChild,a.lastChild===a.firstChild&&(a.firstChild_=a.firstChild);var g=G(e.lastChild);g&&(g.nextSibling_=g.nextSibling),e.appendChild(f)}function g(a,c){var d=F(a),e=F(c);b(c),c.previousSibling&&(c.previousSibling.nextSibling_=c),c.nextSibling&&(c.nextSibling.previousSibling_=c),a.lastChild===c&&(a.lastChild_=c),a.firstChild===c&&(a.firstChild_=c),d.removeChild(e)}function h(a){var b=F(a),c=b.parentNode;c&&g(G(c),a)}function i(a,b){k(b).push(a),z(a,b);var c=I.get(a);c||I.set(a,c=[]),c.push(b)}function j(a){H.set(a,[])}function k(a){return H.get(a)}function l(a){for(var b=[],c=0,d=a.firstChild;d;d=d.nextSibling)b[c++]=d;return b}function m(a,b,c){for(var d=l(a),e=0;e","+","~"],d=a,e="["+b+"]";return c.forEach(function(a){var b=d.split(a);d=b.map(function(a){var b=a.trim();return b&&c.indexOf(b)<0&&b.indexOf(e)<0&&(a=b.replace(/([^:]*)(:*)(.*)/,"$1"+e+"$2$3")),a}).join(a)}),d},propertiesFromRule:function(a){var b=a.style.cssText;return a.style.content&&!a.style.content.match(/['"]+/)&&(b="content: '"+a.style.content+"';\n"+a.style.cssText.replace(/content:[^;]*;/g,"")),b}},i=/@host[^{]*{(([^}]*?{[^{]*?}[\s\S]*?)+)}/gim,j=/([^{]*)({[\s\S]*?})/gim,k=/(.*)((?:\*)|(?:\:scope))(.*)/,l=/^[.\[:]/,m=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,n=/\/\*\s*@polyfill ([^*]*\*+([^/*][^*]*\*+)*\/)([^{]*?){/gim,o=/::(x-[^\s{,(]*)/gim,p="([>\\s~+[.,{:][\\s\\S]*)?$",q=/@host/gim;if(window.ShadowDOMPolyfill){e("style { display: none !important; }\n");var r=document.querySelector("head");r.insertBefore(f(),r.childNodes[0])}a.ShadowCSS=h}(window.Platform)}else{var SideTable;"undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),function(){window.templateContent=window.templateContent||function(a){return a.content},window.wrap=window.unwrap=function(a){return a};var a=HTMLElement.prototype.webkitCreateShadowRoot;HTMLElement.prototype.webkitCreateShadowRoot=function(){var b=this.webkitShadowRoot,c=a.call(this);return c.olderShadowRoot=b,c.host=this,CustomElements.watchShadow(this),c},Object.defineProperties(HTMLElement.prototype,{shadowRoot:{get:function(){return this.webkitShadowRoot}},createShadowRoot:{value:function(){return this.webkitCreateShadowRoot()}}}),window.templateContent=function(a){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(a),!a.content&&!a._content){for(var b=document.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a._content=b}return a.content||a._content}}()}if(function(a){function b(a){for(var b=a||{},d=1;d",""," "," ShadowDOM Inspector"," "," "," ",'
    ',"
",'
'," ",""].join("\n"),d=[],e=function(){var a=b.document,c=a.querySelector("#crumbs");c.textContent="";for(var e,g=0;e=d[g];g++){var h=a.createElement("a");h.href="#",h.textContent=e.localName,h.idx=g,h.onclick=function(a){for(var b;d.length>this.idx;)b=d.pop();f(b.shadow||b,b),a.preventDefault()},c.appendChild(a.createElement("li")).appendChild(h)}},f=function(a,c){var f=b.document;k=[];var g=c||a;d.push(g),e(),f.body.querySelector("#tree").innerHTML="
"+j(a,a.childNodes)+"
"},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),h={STYLE:1,SCRIPT:1,"#comment":1,TEMPLATE:1},i=function(a){return h[a.nodeName]},j=function(a,b,c){if(i(a))return"";var d=c||"";if(a.localName||11==a.nodeType){var e=a.localName||"shadow-root",f=d+l(a);"content"==e&&(b=a.getDistributedNodes()),f+="
";var h=d+"  ";g(b,function(a){f+=j(a,a.childNodes,h)}),f+=d,{br:1}[e]||(f+="</"+e+">",f+="
")}else{var k=a.textContent.trim();f=k?d+'"'+k+'"'+"
":""}return f},k=[],l=function(a){var b="<",c=a.localName||"shadow-root";return a.webkitShadowRoot||a.shadowRoot?(b+=' ",k.push(a)):b+=c||"shadow-root",a.attributes&&g(a.attributes,function(a){b+=" "+a.name+(a.value?'="'+a.value+'"':"")}),b+=">"};shadowize=function(){var a=Number(this.attributes.idx.value),b=k[a];b?f(b.webkitShadowRoot||b.shadowRoot,b):(console.log("bad shadowize node"),console.dir(this))},a.output=j}(window.Inspector),function(a){"use strict";function b(){function a(a){"splice"===a[0].type&&"splice"===a[1].type&&(b=!0)}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=!1,c=[0];return Array.observe(c,a),c[1]=1,c.length=0,Object.deliverChangeRecords(a),b}function c(a){return+a===a>>>0}function d(a){return+a}function e(a){return a===Object(a)}function f(a,b){return a===b?0!==a||1/a===1/b:K(a)&&K(b)?!0:a!==a&&b!==b}function g(a){return"string"!=typeof a?!1:(a=a.replace(/\s/g,""),""==a?!0:"."==a[0]?!1:S.test(a))}function h(a){var b=T[a];if(b)return b;if(g(a)){var b=new i(a);return T[a]=b,b}}function i(a){return""==a.trim()?this:c(a)?(this.push(String(a)),this):(a.split(/\./).filter(function(a){return a}).forEach(function(a){this.push(a)},this),H&&this.length&&(this.getValueFrom=this.compiledGetValueFromFn()),void 0)}function j(a){for(var b=0;U>b&&a.check();)a.report(),b++}function k(a){for(var b in a)return!1;return!0}function l(a){return k(a.added)&&k(a.removed)&&k(a.changed)}function m(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function n(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function o(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,G){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}p(this),this.connect(),this.sync(!0)}function p(a){W&&(V.push(a),o._allObserversCount++)}function q(a,b,c,d){o.call(this,a,b,c,d)}function r(a,b,c,d){if(!Array.isArray(a))throw Error("Provided object is not an Array");o.call(this,a,b,c,d)}function s(a){this.arr=[],this.callback=a,this.isObserved=!0}function t(a,b,c,d,f){this.value=void 0;var g=h(b);return g?g.length?e(a)?(this.path=g,o.call(this,a,c,d,f),void 0):(this.closed=!0,this.value=void 0,void 0):(this.closed=!0,this.value=a,void 0):(this.closed=!0,this.value=void 0,void 0)}function u(a,b){if("function"==typeof Object.observe){var c=Object.getNotifier(a);return function(d,e){var f={object:a,type:d,name:b};2===arguments.length&&(f.oldValue=e),c.notify(f)}}}function v(a,b,c){for(var d={},e={},f=0;fj;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(d[e+j-1]===a[b+k-1])i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i}function x(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(ab):(e.push(bb),d=g),b--,c--):f==h?(e.push(db),b--,d=h):(e.push(cb),c--,d=i)}else e.push(db),b--;else e.push(cb),c--;return e.reverse(),e}function y(a,b,c){for(var d=0;c>d;d++)if(a[d]!==b[d])return d;return c}function z(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&a[--d]===b[--e];)f++;return f}function A(a,b,c){return{index:a,removed:b,addedCount:c}}function B(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=y(a,d,i)),c==a.length&&f==d.length&&(h=z(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,0==c-b&&0==f-e)return[];if(b==c){for(var j=A(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[A(b,[],c-b)];for(var k=x(w(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;ob||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function D(a,b,c,d){for(var e=A(b,c,d),f=!1,g=0,h=0;h=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.indexi.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.indexh)continue;D(e,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return e}function F(a,b){var c=[];return E(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?(b.removed[0]!==a[b.index]&&c.push(b),void 0):(c=c.concat(B(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)),void 0)}),c}var G=b(),H=!1;try{var I=new Function("","return true;");H=I()}catch(J){}var K=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},L="__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},M="[$_a-zA-Z]",N="[$_a-zA-Z0-9]",O=M+"+"+N+"*",P="(?:[0-9]|[1-9]+[0-9]+)",Q="(?:"+O+"|"+P+")",R="(?:"+Q+")(?:\\."+Q+")*",S=new RegExp("^"+R+"$"),T={};i.prototype=L({__proto__:[],toString:function(){return this.join(".")},getValueFrom:function(a){for(var b=0;ba&&b.anyChanged);o._allObserversCount=V.length,X=!1}}},W&&(a.Platform.clearObservers=function(){V=[]}),q.prototype=L({__proto__:o.prototype,connect:function(){G&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=n(this.object))},check:function(a){var b,c;if(G){if(!a)return!1;c={},b=v(this.object,a,c)}else c=this.oldObject,b=m(this.object,this.oldObject);return l(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){G?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}}),r.prototype=L({__proto__:q.prototype,connect:function(){G&&Array.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=this.object.slice())},check:function(a){var b;if(G){if(!a)return!1;b=F(this.object,a)}else b=B(this.object,0,this.object.length,this.oldObject,0,this.oldObject.length);return b&&b.length?(this.reportArgs=[b],!0):!1}}),r.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;ba&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}},t.prototype=L({__proto__:o.prototype,connect:function(){G&&(this.observedSet=new s(this.boundInternalCallback))},disconnect:function(){this.value=void 0,G&&(this.observedSet.reset(),this.observedSet.cleanup(),this.observedSet=void 0)},check:function(){return this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object),f(this.value,this.oldValue)?!1:(this.reportArgs=[this.value,this.oldValue],!0)},sync:function(a){a&&(this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object)),this.oldValue=this.value}}),t.getValueAtPath=function(a,b){var c=h(b);return c?c.getValueFrom(a):void 0},t.setValueAtPath=function(a,b,c){var d=h(b);d&&d.setValueFrom(a,c)};var _={"new":!0,updated:!0,deleted:!0};t.defineProperty=function(a,b,c){var d=c.object,e=h(c.path),f=u(a,b),g=new t(d,c.path,function(a,b){f&&f("updated",b)});return Object.defineProperty(a,b,{get:function(){return e.getValueFrom(d)},set:function(a){e.setValueFrom(d,a)},configurable:!0}),{close:function(){var c=e.getValueFrom(d);f&&g.deliver(),g.close(),Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}}};var ab=0,bb=1,cb=2,db=3;a.Observer=o,a.Observer.hasObjectObserve=G,a.ArrayObserver=r,a.ArrayObserver.calculateSplices=function(a,b){return B(a,0,a.length,b,0,b.length)},a.ObjectObserver=q,a.PathObserver=t,a.Path=i}("undefined"!=typeof global&&global?global: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 a.ownerDocument.contains(a)}function e(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.observer=new PathObserver(c,d,this.boundValueChanged,this),this.boundValueChanged(this.value)}function f(a,b,c,d){this.conditional="?"==b[b.length-1],this.conditional&&(a.removeAttribute(b),b=b.slice(0,-1)),e.call(this,a,b,c,d)}function g(a){switch(a.type){case"checkbox":return T;case"radio":case"select-multiple":case"select-one":return"change";default:return"input"}}function h(a,b,c,d){e.call(this,a,b,c,d),this.eventType=g(this.node),this.boundNodeValueToModel=this.nodeValueChanged.bind(this),this.node.addEventListener(this.eventType,this.boundNodeValueToModel,!0)}function i(a){if(!d(a))return[];if(a.form)return Q(a.form.elements,function(b){return b!=a&&"INPUT"==b.tagName&&"radio"==b.type&&b.name==a.name});var b=a.ownerDocument.querySelectorAll('input[type="radio"][name="'+a.name+'"]');return Q(b,function(b){return b!=a&&!b.form})}function j(a,b,c){h.call(this,a,"checked",b,c)}function k(a,b,c){h.call(this,a,"selectedIndex",b,c)}function l(a){return $[a.tagName]&&a.hasAttribute("template")}function m(a){return"TEMPLATE"==a.tagName||l(a)}function n(a){return _&&"TEMPLATE"==a.tagName}function o(a,b){var c=a.querySelectorAll(ab);m(a)&&b(a),P(c,b)}function p(a){function b(a){HTMLTemplateElement.decorate(a)||p(a.content)}o(a,b)}function q(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function r(a){if(!a.defaultView)return a;var b=eb.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);eb.set(a,b)}return b}function s(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];Z[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function t(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 u(a){"TEMPLATE"===a.tagName?_||(cb?a.__proto__=HTMLTemplateElement.prototype:q(a,HTMLTemplateElement.prototype)):(q(a,HTMLTemplateElement.prototype),Object.defineProperty(a,"content",ib))}function v(a){var b=lb.get(a);b||(b=function(){H(a,a.model,a.bindingDelegate)},lb.set(a,b)),bb(b)}function w(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.node.inputs.bind(this.property,c,d||"")}function x(a){return 3==a.length&&0==a[0].length&&0==a[2].length}function y(a){if(a&&a.length){for(var b,c=a.length,d=0,e=0,f=0;c>e;){if(d=a.indexOf("{{",e),f=0>d?-1:a.indexOf("}}",d+2),0>f){if(!b)return;b.push(a.slice(e));break}b=b||[],b.push(a.slice(e,d)),b.push(a.slice(d+2,f).trim()),e=f+2}return e===c&&b.push(""),b}}function z(a,b,c,d,e){var f,g=e&&e[X];return g&&"function"==typeof g&&(f=g(c,d,b,a),f&&(c=f,d="value")),a.bind(b,c,d)}function A(a,b,c,d,e){for(var f=0;fc?(this.keys.push(a),this.values.push(b)):this.values[c]=b},get:function(a){var b=this.keys.indexOf(a);return 0>b?void 0: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>>0)+(c++ +"__")},S.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),Node.prototype.bind=function(a,b,c){this.bindings=this.bindings||{};var d=this.bindings[a];return d&&d.close(),d=this.createBinding(a,b,c),this.bindings[a]=d,d?d:(console.error("Unhandled binding to Node: ",this,a,b,c),void 0)},Node.prototype.createBinding=function(){},Node.prototype.unbind=function(a){if(this.bindings){var b=this.bindings[a];b&&(b.close(),delete this.bindings[a])}},Node.prototype.unbindAll=function(){if(this.bindings){for(var a=Object.keys(this.bindings),b=0;be.node.length&&d--?bb(b):e.node[e.property]=c}var c=Number(a);if(c<=this.node.length)return this.node[this.property]=c,void 0;var d=2,e=this;bb(b)}}),HTMLSelectElement.prototype.createBinding=function(a,b,c){return"selectedindex"===a.toLowerCase()?(this.removeAttribute(a),new k(this,b,c)):HTMLElement.prototype.createBinding.call(this,a,b,c)};var U="bind",V="repeat",W="if",X="getBinding",Y="getInstanceModel",Z={template:!0,repeat:!0,bind:!0,ref:!0},$={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0,OPTGROUP:!0},_="undefined"!=typeof HTMLTemplateElement,ab="template, "+Object.keys($).map(function(a){return a.toLowerCase()+"[template]"}).join(", "),bb=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=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(;bb>ab&&d(_.charCodeAt(ab));)++ab}function j(){var a,b;for(a=ab++;bb>ab&&(b=_.charCodeAt(ab),g(b));)++ab;return _.slice(a,ab)}function k(){var a,b,c;return a=ab,b=j(),c=1===b.length?X.Identifier:h(b)?X.Keyword:"null"===b?X.NullLiteral:"true"===b||"false"===b?X.BooleanLiteral:X.Identifier,{type:c,value:b,range:[a,ab]}}function l(){var a,b,c,d,e=ab,f=_.charCodeAt(ab),g=_[ab];switch(f){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++ab,{type:X.Punctuator,value:String.fromCharCode(f),range:[e,ab]};default:if(a=_.charCodeAt(ab+1),61===a)switch(f){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:return ab+=2,{type:X.Punctuator,value:String.fromCharCode(f)+String.fromCharCode(a),range:[e,ab]};case 33:case 61:return ab+=2,61===_.charCodeAt(ab)&&++ab,{type:X.Punctuator,value:_.slice(e,ab),range:[e,ab]}}}return b=_[ab+1],c=_[ab+2],d=_[ab+3],">"===g&&">"===b&&">"===c&&"="===d?(ab+=4,{type:X.Punctuator,value:">>>=",range:[e,ab]}):">"===g&&">"===b&&">"===c?(ab+=3,{type:X.Punctuator,value:">>>",range:[e,ab]}):"<"===g&&"<"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:"<<=",range:[e,ab]}):">"===g&&">"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:">>=",range:[e,ab]}):g===b&&"+-<>&|".indexOf(g)>=0?(ab+=2,{type:X.Punctuator,value:g+b,range:[e,ab]}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ab,{type:X.Punctuator,value:g,range:[e,ab]}):(s({},$.UnexpectedToken,"ILLEGAL"),void 0)}function m(){var a,d,e;if(e=_[ab],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=ab,a="","."!==e){for(a=_[ab++],e=_[ab],"0"===a&&e&&c(e.charCodeAt(0))&&s({},$.UnexpectedToken,"ILLEGAL");c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("."===e){for(a+=_[ab++];c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("e"===e||"E"===e)if(a+=_[ab++],e=_[ab],("+"===e||"-"===e)&&(a+=_[ab++]),c(_.charCodeAt(ab)))for(;c(_.charCodeAt(ab));)a+=_[ab++];else s({},$.UnexpectedToken,"ILLEGAL");return f(_.charCodeAt(ab))&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.NumericLiteral,value:parseFloat(a),range:[d,ab]}}function n(){var a,c,d,f="",g=!1;for(a=_[ab],b("'"===a||'"'===a,"String literal must starts with a quote"),c=ab,++ab;bb>ab;){if(d=_[ab++],d===a){a="";break}if("\\"===d)if(d=_[ab++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===_[ab]&&++ab;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({},$.UnexpectedToken,"ILLEGAL"),{type:X.StringLiteral,value:f,octal:g,range:[c,ab]}}function o(a){return a.type===X.Identifier||a.type===X.Keyword||a.type===X.BooleanLiteral||a.type===X.NullLiteral}function p(){var a;return i(),ab>=bb?{type:X.EOF,range:[ab,ab]}:(a=_.charCodeAt(ab),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(_.charCodeAt(ab+1))?m():l():c(a)?m():l())}function q(){var a;return a=db,ab=a.range[1],db=p(),ab=a.range[1],a}function r(){var a;a=ab,db=p(),ab=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(cab&&(a.push(O()),!v(")"));)u(",");return u(")"),a}function F(){var a;return a=q(),o(a)||t(a),cb.createIdentifier(a.value)}function G(){return u("."),F()}function H(){var a;return u("["),a=P(),u("]"),a}function I(){var a,b,c;for(a=D();v(".")||v("[")||v("(");)v("(")?(b=E(),a=cb.createCallExpression(a,b)):v("[")?(c=H(),a=cb.createMemberExpression("[",a,c)):(c=G(),a=cb.createMemberExpression(".",a,c));return a}function J(){var a;return a=I(),db.type===X.Punctuator&&(v("++")||v("--"))&&s({},$.UnexpectedToken),a}function K(){var a,b;return db.type!==X.Punctuator&&db.type!==X.Keyword?b=J():v("++")||v("--")?s({},$.UnexpectedToken):v("+")||v("-")||v("~")||v("!")?(a=q(),b=K(),b=cb.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},$.UnexpectedToken):b=J(),b}function L(a,b){var c=0;if(a.type!==X.Punctuator&&a.type!==X.Keyword)return 0;switch(a.value){case"||":c=1;break;case"&&":c=2;break;case"|":c=3;break;case"^":c=4;break;case"&":c=5;break;case"==":case"!=":case"===":case"!==":c=6;break;case"<":case">":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function M(){var a,b,c,d,e,f,g,h,i;if(d=eb.allowIn,eb.allowIn=!0,h=K(),b=db,c=L(b,d),0===c)return h;for(b.prec=c,q(),f=K(),e=[h,b,f];(c=L(db,d))>0;){for(;e.length>2&&c<=e[e.length-2].prec;)f=e.pop(),g=e.pop().value,h=e.pop(),a=cb.createBinaryExpression(g,h,f),e.push(a);b=q(),b.prec=c,e.push(b),a=K(),e.push(a)}for(eb.allowIn=d,i=e.length-1,a=e[i];i>1;)a=cb.createBinaryExpression(e[i-1].value,e[i-2],a),i-=2;return a}function N(){var a,b,c,d;return a=M(),v("?")&&(q(),b=eb.allowIn,eb.allowIn=!0,c=O(),eb.allowIn=b,u(":"),d=O(),a=cb.createConditionalExpression(a,c,d)),a}function O(){var a,b,c;return a=db,c=b=N()}function P(){var a;return a=O()}function Q(){return u(";"),cb.createEmptyStatement()}function R(){var a=P();return x(),cb.createExpressionStatement(a)}function S(){var a,b,c,d=db.type;if(d===X.EOF&&t(db),i(),d===X.Punctuator)switch(db.value){case";":return Q();case"(":return R()}return a=P(),a.type===Z.Identifier&&v(":")?(q(),c="$"+a.name,Object.prototype.hasOwnProperty.call(eb.labelSet,c)&&s({},$.Redeclaration,"Label",a.name),eb.labelSet[c]=!0,b=S(),delete eb.labelSet[c],cb.createLabeledStatement(a,b)):(x(),cb.createExpressionStatement(a))}function T(){return db.type===X.Keyword?S():db.type!==X.EOF?S():void 0}function U(){for(var a,b=[];bb>ab&&(a=T(),"undefined"!=typeof a);)b.push(a);return b}function V(){var a;return i(),r(),a=U(),cb.createProgram(a)}function W(a,b){var c;return c=String,"string"==typeof a||a instanceof String||(a=c(a)),cb=b,_=a,ab=0,bb=_.length,db=null,eb={allowIn:!0,labelSet:{}},bb>0&&"undefined"==typeof _[0]&&a instanceof String&&(_=a.valueOf()),V()}var X,Y,Z,$,_,ab,bb,cb,db,eb;X={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},Y={},Y[X.BooleanLiteral]="Boolean",Y[X.EOF]="",Y[X.Identifier]="Identifier",Y[X.Keyword]="Keyword",Y[X.NullLiteral]="Null",Y[X.NumericLiteral]="Numeric",Y[X.Punctuator]="Punctuator",Y[X.StringLiteral]="String",Z={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"},$={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"},a.esprima={parse:W}}(this),function(a){"use strict";function b(a,b,d,e){if(e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.tagName&&("bind"===d||"repeat"===d)){var f,g,h=b.match(r);if(h?(f=h[1],g=h[2]):(h=b.match(s),h&&(f=h[2],g=h[1])),h){var i;if(g=g.trim(),g.match(q))i=new CompoundBinding(function(a){return a.path}),i.bind("path",a,g);else try{i=c(a,g)}catch(j){console.error("Invalid expression syntax: "+g,j)}if(i)return t.set(e,f),i}}}function c(a,b){try{var c=new f;if(esprima.parse(b,c),!c.statements.length&&!c.labeledStatements.length)return;if(!c.labeledStatements.length&&c.statements.length>1)throw Error("Multiple unlabelled statements are not allowed.");var e=c.labeledStatements.length?d(c.labeledStatements):e=c.statements[0],g=[];for(var h in c.deps)g.push(h);if(!g.length)return{value:e({})};for(var i=new CompoundBinding(e),j=0;j>>0)+(c++ +"__")},i.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var j="[$_a-zA-Z]",k="[$_a-zA-Z0-9]",l=j+"+"+k+"*",m="("+l+")",n="(?:[0-9]|[1-9]+[0-9]+)",o="(?:"+l+"|"+n+")",p="(?:"+o+")(?:\\."+o+")*",q=new RegExp("^"+p+"$"),r=new RegExp("^"+m+"\\s* in (.*)$"),s=new RegExp("^(.*) as \\s*"+m+"$"),t=new i;e.prototype={getPath:function(){return this.last?this.last.getPath()+"."+this.name:this.name},valueFn:function(){var a=this.getPath();return this.deps[a]=!0,function(b){return b[a]}}};var u={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},v={"+":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}};f.prototype={getFn:function(a){return a instanceof e?a.valueFn():a},createProgram:function(){},createExpressionStatement:function(a){return this.statements.push(a),a},createLabeledStatement:function(a,b){return this.labeledStatements.push({label:a.getPath(),body:b instanceof e?b.valueFn():b}),b},createUnaryExpression:function(a,b){if(!u[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),function(c){return u[a](b(c))}},createBinaryExpression:function(a,b,c){if(!v[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),c=this.getFn(c),function(d){return v[a](b(d),c(d))}},createConditionalExpression:function(a,b,c){return a=this.getFn(a),b=this.getFn(b),c=this.getFn(c),function(d){return a(d)?b(d):c(d)}},createIdentifier:function(a){var b=new e(this.deps,a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){return new e(this.deps,c.name,b)},createLiteral:function(a){return function(){return a.value}},createArrayExpression:function(a){for(var b=0;be;e++)d.unshift("..");var g=d.join("/");return g},resolvePathsInHTML:function(a,b){b=b||p.documentUrlFromNode(a),p.resolveAttributes(a,b),p.resolveStyleElts(a,b);var c=a.querySelectorAll("template");c&&q(c,function(a){a.content&&p.resolvePathsInHTML(a.content,b)})},resolvePathsInStylesheet:function(a){var b=p.nodeUrl(a);a.__resource=p.resolveCssText(a.__resource,b)},resolveStyleElts:function(a,b){var c=a.querySelectorAll("style");c&&q(c,function(a){a.textContent=p.resolveCssText(a.textContent,b)})},resolveCssText:function(a,b){return a.replace(/url\([^)]*\)/g,function(a){var c=a.replace(/["']/g,"").slice(4,-1);return c=p.resolveUrl(b,c,!0),"url("+c+")"})},resolveAttributes:function(a,b){var c=a&&a.querySelectorAll(n);c&&q(c,function(a){this.resolveNodeAttributes(a,b)},this)},resolveNodeAttributes:function(a,b){m.forEach(function(c){var d=a.attributes[c];if(d&&d.value&&d.value.search(o)<0){var e=p.resolveUrl(b,d.value,!0);d.value=e}})}};h=h||{async:!0,ok:function(a){return a.status>=200&&a.status<300||304===a.status||0===a.status},load:function(b,c,d){var e=new XMLHttpRequest;return(a.flags.debug||a.flags.bust)&&(b+="?"+Math.random()),e.open("GET",b,h.async),e.addEventListener("readystatechange",function(){4===e.readyState&&c.call(d,!h.ok(e)&&e,e.response,b)}),e.send(),e},loadDocument:function(a,b,c){this.load(a,b,c).responseType="document"}};var q=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.path=p,a.xhr=h,a.importer=k,a.getDocumentUrl=p.getDocumentUrl,a.IMPORT_LINK_TYPE=i}(window.HTMLImports),function(a){function b(a){return"link"===a.localName&&a.getAttribute("rel")===f}function c(a){return a.parentNode&&!d(a)&&!e(a)}function d(a){return a.ownerDocument===document||a.ownerDocument.impl===document}function e(a){return a.parentNode&&"element"===a.parentNode.localName}var f="import",g={selectors:["link[rel="+f+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(a){if(!a.__importParsed){a.__importParsed=!0;var b=a.querySelectorAll(g.selectors);h(b,function(a){g[g.map[a.localName]](a)})}},parseLink:function(a){b(a)?a.content&&g.parse(a.content):this.parseGeneric(a)},parseGeneric:function(a){c(a)&&document.head.appendChild(a)},parseScript:function(b){if(c(b)){var d=(b.__resource||b.textContent).trim();if(d){var e=b.__nodeUrl;if(!e){var e=a.path.documentUrlFromNode(b),f="["+Math.floor(1e3*(Math.random()+1))+"]",g=d.match(/Polymer\(['"]([^'"]*)/);f=g&&g[1]||f,e+="/"+f+".js"}d+="\n//# sourceURL="+e+"\n",eval.call(window,d)}}}},h=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.parser=g}(HTMLImports),function(){function a(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState?a():window.addEventListener("DOMContentLoaded",a)}(),function(a){function b(a){u.push(a),t||(t=!0,q(d))}function c(a){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(a)||a}function d(){t=!1;var a=u;u=[],a.sort(function(a,b){return a.uid_-b.uid_});var b=!1;a.forEach(function(a){var c=a.takeRecords();e(a),c.length&&(a.callback_(c,a),b=!0)}),b&&d()}function e(a){a.nodes_.forEach(function(b){var c=p.get(b); -c&&c.forEach(function(b){b.observer===a&&b.removeTransientObservers()})})}function f(a,b){for(var c=a;c;c=c.parentNode){var d=p.get(c);if(d)for(var e=0;e0){var e=c[d-1],f=n(e,a);if(f)return c[d-1]=f,void 0}else b(this.observer);c[d]=a},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(a){var b=this.options;b.attributes&&a.addEventListener("DOMAttrModified",this,!0),b.characterData&&a.addEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.addEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(a){var b=this.options;b.attributes&&a.removeEventListener("DOMAttrModified",this,!0),b.characterData&&a.removeEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.removeEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(a){if(a!==this.target){this.addListeners_(a),this.transientObservedNodes.push(a);var b=p.get(a);b||p.set(a,b=[]),b.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[],a.forEach(function(a){this.removeListeners_(a);for(var b=p.get(a),c=0;c1?logFlags.dom&&console.warn("inserted:",a.localName,"insert/remove count:",a.__inserted):a.insertedCallback&&(logFlags.dom&&console.log("inserted:",a.localName),a.insertedCallback())),logFlags.dom&&console.groupEnd())}function k(a){l(a),d(a,function(a){l(a)})}function l(a){(a.removedCallback||a.__upgraded__&&logFlags.dom)&&(logFlags.dom&&console.log("removed:",a.localName),m(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?logFlags.dom&&console.warn("removed:",a.localName,"insert/remove count:",a.__inserted):a.removedCallback&&a.removedCallback()))}function m(a){for(var b=a;b;){if(b==a.ownerDocument)return!0;b=b.parentNode||b.host}}function n(a){if(a.webkitShadowRoot&&!a.webkitShadowRoot.__watched){logFlags.dom&&console.log("watching shadow-root for: ",a.localName);for(var b=a.webkitShadowRoot;b;)o(b),b=b.olderShadowRoot}}function o(a){a.__watched||(t(a),a.__watched=!0)}function p(a){n(a),d(a,function(){n(a)})}function q(a){switch(a.localName){case"style":case"script":case"template":case void 0:return!0}}function r(a){if(logFlags.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(x(a.addedNodes,function(a){q(a)||g(a)}),x(a.removedNodes,function(a){q(a)||k(a)}))}),logFlags.dom&&console.groupEnd()}function s(){r(w.takeRecords())}function t(a){w.observe(a,{childList:!0,subtree:!0})}function u(a){t(a)}function v(a){logFlags.dom&&console.group("upgradeDocument: ",(a.URL||a._URL||"").split("/").pop()),g(a),logFlags.dom&&console.groupEnd()}var w=new MutationObserver(r),x=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.watchShadow=n,a.watchAllShadows=p,a.upgradeAll=g,a.upgradeSubtree=f,a.observeDocument=u,a.upgradeDocument=v,a.takeRecords=s}(window.CustomElements),function(){function parseElementElement(a){var b={name:"","extends":null};takeAttributes(a,b);var c=HTMLElement.prototype;if(b.extends){var d=document.createElement(b.extends);c=d.__proto__||Object.getPrototypeOf(d)}b.prototype=Object.create(c),a.options=b;var e=a.querySelector('script:not([type]),script[type="text/javascript"],scripts');e&&executeComponentScript(e.textContent,a,b.name);var f=document.register(b.name,b);a.ctor=f;var g=a.getAttribute("constructor");g&&(window[g]=f)}function takeAttributes(a,b){for(var c in b){var d=a.attributes[c];d&&(b[c]=d.value)}}function executeComponentScript(inScript,inContext,inName){context=inContext;var owner=context.ownerDocument,url=owner._URL||owner.URL||owner.impl&&(owner.impl._URL||owner.impl.URL),match=url.match(/.*\/([^.]*)[.]?.*$/);if(match){var name=match[1];url+=name!=inName?":"+inName:""}var code="__componentScript('"+inName+"', function(){"+inScript+"});"+"\n//# sourceURL="+url+"\n";eval(code)}function mixin(a,b){a=a||{};try{Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)})}catch(c){}return a}var HTMLElementElement=function(a){return a.register=HTMLElementElement.prototype.register,parseElementElement(a),a};HTMLElementElement.prototype={register:function(a){a&&(this.options.lifecycle=a.lifecycle,a.prototype&&mixin(this.options.prototype,a.prototype))}};var context;window.__componentScript=function(a,b){b.call(context)},window.HTMLElementElement=HTMLElementElement}(),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+"]","element"],map:{link:"parseLink",element:"parseElement"},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)},parseElement:function(a){new HTMLElementElement(a)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=c}(),function(){function a(){setTimeout(function(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))},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();else{var b=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(b,a)}}(),function(){function a(){}var b=document.createElement("style");b.textContent="element {display: none !important;} /* injected by platform.js */";var c=document.querySelector("head");if(c.insertBefore(b,c.firstChild),window.ShadowDOMPolyfill){CustomElements.watchShadow=a,CustomElements.watchAllShadows=a;var d=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],e={};d.forEach(function(a){e[a]=CustomElements[a]}),d.forEach(function(a){CustomElements[a]=function(b){return e[a](wrap(b))}})}}(),function(a){a=a||{};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(document,b,c)}};a.targetFinding=b,a.findTarget=b.findTarget.bind(b),window.PointerEventsPolyfill=a}(window.PointerEventsPolyfill),function(){function a(a){return'[touch-action="'+a+'"]'}function b(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; }"}var c=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],d="";c.forEach(function(c){d+=String(c)===c?a(c)+b(c):c.selectors.map(a)+b(c.rule)});var e=document.createElement("style");e.textContent=d;var f=document.querySelector("head");f.insertBefore(e,f.firstChild)}(),function(a){function b(a,b){var b=b||{},e=b.buttons;if(void 0===e)switch(b.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}var f;if(c)f=new MouseEvent(a,b);else{f=document.createEvent("MouseEvent");var g={bubbles:!1,cancelable:!1,view:null,detail:null,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};Object.keys(g).forEach(function(a){a in b&&(g[a]=b[a])}),f.initMouseEvent(a,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)}d||Object.defineProperty(f,"buttons",{get:function(){return e},enumerable:!0});var h=0;return h=b.pressure?b.pressure:e?.5:0,Object.defineProperties(f,{pointerId:{value:b.pointerId||0,enumerable:!0},width:{value:b.width||0,enumerable:!0},height:{value:b.height||0,enumerable:!0},pressure:{value:h,enumerable:!0},tiltX:{value:b.tiltX||0,enumerable:!0},tiltY:{value:b.tiltY||0,enumerable:!0},pointerType:{value:b.pointerType||"",enumerable:!0},hwTimestamp:{value:b.hwTimestamp||0,enumerable:!0},isPrimary:{value:b.isPrimary||!1,enumerable:!0}}),f}var c=!1,d=!1;try{var e=new MouseEvent("click",{buttons:1});c=!0,d=1===e.buttons}catch(f){}a.PointerEvent||(a.PointerEvent=b)}(window),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},forEach:function(a,b){this.ids.forEach(function(c,d){a.call(b,c,this.pointers[d],this)},this)}},a.PointerMap=window.Map&&Map.prototype.forEach?Map:b}(window.PointerEventsPolyfill),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerEventsPolyfill),function(a){var b={targets:new a.SideTable,handledEvents:new a.SideTable,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)},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){a.target.contains(a.relatedTarget)||this.leave(a),this.out(a)},enterOver:function(a){a.target.contains(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:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){var c=new PointerEvent(a,b);return 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){var b={};for(var c in a)b[c]=a[c];return b},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:function(a){var b=this.getTarget(a);return b?b.dispatchEvent(a):void 0},asyncDispatchEvent:function(a){setTimeout(this.dispatchEvent.bind(this,a),0)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=b.register.bind(b),a.unregister=b.unregister.bind(b)}(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);return 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 a.SideTable,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){null===this.firstTouch&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryTouch:function(a){this.isPrimaryTouch(a)&&(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(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.size>=b.length){var c=[];f.forEach(function(a,d){if(1!==a&&!this.findTouch(b,a-2)){var e=d.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.removePrimaryTouch(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)}),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){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(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={handledEvents:new a.SideTable,targets:new a.SideTable,handlers:{},recognizers:{},events:["pointerdown","pointermove","pointerup","pointerover","pointerout","pointercancel"],registerRecognizer:function(a,b){var c=b;this.recognizers[a]=c,this.events.forEach(function(a){if(c[a]){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(this.events,a)},unregisterTarget:function(a){this.unlisten(this.events,a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b,c=a.type;(b=this.handlers[c])&&this.makeQueue(b,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){var b={};for(var c in a)b[c]=a[c];return b},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)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=function(b){var c=window.PointerEventsPolyfill;c&&c.register(b),a.dispatcher.registerTarget(b)},b.registerTarget(document)}(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,pointerType:c.pointerType};"trackend"===a&&(h._releaseTarget=c.target);var 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"],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)},preventTap:function(a){c.delete(a)}};b.registerRecognizer("tap",d)}(window.PointerGestures),Polymer={},function(){var a=document.createElement("style");a.textContent="body {opacity: 0;}";var b=document.querySelector("head");b.insertBefore(a,b.firstChild),window.addEventListener("WebComponentsReady",function(){document.body.style.webkitTransition="opacity 0.3s",document.body.style.opacity=1})}(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&&(a[c].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;"_super"in c||(g||(g=e.call(this,c)),g||console.warn("called super() on a method not installed declaratively (has no .nom property)"),d(c,g,f(this)));var h=c._super;if(h){var i=h[g];return"_super"in i||d(i,g,h),i.apply(this,a||[])}}function c(a,b,c){for(;a&&(!a.hasOwnProperty(b)||a[b]===c);)a=f(a);return 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){console.warn("nameInThis called");for(var b=this;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(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}}};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?!1:!0,detail:b})),b},asyncFire:function(){this.asyncMethod("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,b){b.cancelBubble||(b.on=i+b.type,h.events&&console.group("[%s]: listenLocal [%s]",a.localName,b.on),!b.path||window.ShadowDOMPolyfill?d(a,b):c(a,b),h.events&&console.groupEnd())}function c(a,b){var c=null;Array.prototype.some.call(b.path,function(d){return d===a?!0:(c=c===a?c:e(d),c&&f(c,d,b)?!0:void 0)},this)}function d(a,b){h.events&&console.log("event.path() not supported for",b.type);for(var c=b.target,d=null;c&&c!=a;){if(d=d===a?d:e(c),d&&f(d,c,b))return!0;c=c.parentNode}}function e(a){for(;a.parentNode;)a=a.parentNode;return a.host}function f(a,b,c){var d=b.getAttribute&&b.getAttribute(c.on);return d&&g(b,c)&&(h.events&&console.log("[%s] found handler name [%s]",a.localName,d),a.dispatchMethod(b,d,[c,c.detail,b])),c.cancelBubble}function g(a,b){var c=l.get(b);return c||l.set(b,c=[]),c.indexOf(a)<0?(c.push(a),!0):void 0}var h=window.logFlags||{},i="on-",j="eventDelegates",k={EVENT_PREFIX:i,DELEGATES:j,addHostListeners:function(){var a=this[j];h.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a),this.addNodeListeners(this,a,this.hostEventListener)},addInstanceListeners:function(a,b){var c=b.delegates;c&&(h.events&&Object.keys(c).length>0&&console.log("[%s:root] addInstanceListeners:",this.localName,c),this.addNodeListeners(a,c,this.instanceEventListener))},addNodeListeners:function(a,b,c){var d;for(var e in b)d||(d=c.bind(this)),a.addEventListener(e,d)},hostEventListener:function(a){if(!a.cancelBubble){h.events&&console.group("[%s]: hostEventListener(%s)",this.localName,a.type);var b=this.findEventDelegate(a);b&&(h.events&&console.log("[%s] found host handler name [%s]",this.localName,b),this.dispatchMethod(this,b,[a,a.detail,this])),h.events&&console.groupEnd()}},findEventDelegate:function(a){return this[j][a.type]},dispatchMethod:function(a,b,c){if(a){h.events&&console.group("[%s] dispatch [%s]",a.localName,b);var d=this[b];d&&d[c?"apply":"call"](this,c),h.events&&console.groupEnd()}},instanceEventListener:function(a){b(this,a)}},l=new SideTable("handledList");a.api.instance.events=k}(Polymer),function(a){var b="__published",c="__instance_attributes",d={PUBLISHED:b,INSTANCE_ATTRIBUTES:c,copyInstanceAttributes:function(){var a=this[c];for(var b in a)this.setAttribute(b,a[b])},takeAttributes:function(){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.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var c=Object.keys(this[b]);return c[c.map(e).indexOf(a.toLowerCase())]},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a){return"object"!=typeof a&&void 0!==a?a:void 0},propertyToAttribute:function(a){if(Object.keys(this[b]).indexOf(a)>=0){var c=this.serializeValue(this[a]);void 0!==c&&this.setAttribute(a,c)}}},e=String.prototype.toLowerCase.call.bind(String.prototype.toLowerCase);a.api.instance.attributes=d}(Polymer),function(a){function b(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)}function c(a,b,c,d){h.bind&&console.log(o,c.localName||"object",d,a.localName,b);var e=PathObserver.getValueAtPath(c,d);return(null===e||void 0===e)&&PathObserver.setValueAtPath(c,d,a[b]),PathObserver.defineProperty(a,b,{object:c,path:d})}function d(a,b,c){var d=g(a);d[b]=c}function e(a,b){var c=g(a);return c&&c[b]?(c[b].close(),c[b]=null,!0):void 0}function f(a){var b=g(a);Object.keys(b).forEach(function(a){b[a].close(),b[a]=null})}function g(a){var b=l.get(a);return b||l.set(a,b={}),b}var h=window.logFlags||{},i="Changed",j=a.api.instance.attributes.PUBLISHED,k={observeProperties:function(){for(var a,b=this.getCustomPropertyNames(),c=0,d=b.length;d>c&&(a=b[c]);c++)this.observeProperty(a)},getCustomPropertyNames:function(){return this.customPropertyNames},observeProperty:function(a){if(this.shouldObserveProperty(a)){h.watch&&console.log(m,this.localName,a);var b=function(b,c){h.watch&&console.log(n,this.localName,this.id||"",a,this[a],c),this.dispatchPropertyChange(a,c)}.bind(this),c=new PathObserver(this,a,b);d(this,a,c)}},bindProperty:function(a,b,d){return c(this,a,b,d)},unbindProperty:function(a,b){return e(this,a,b)},unbindAllProperties:function(){f(this)},shouldObserveProperty:function(a){return Boolean(this[a+i]||Object.keys(this[j]).indexOf(a)>=0)},dispatchPropertyChange:function(a,c){this.propertyToAttribute(a),b.call(this,a+i,[c])}},l=new SideTable,m="[%s] watching [%s]",n="[%s#%s] watch: [%s] now [%s] was [%s]",o="[%s]: bindProperties: [%s] to [%s].[%s]";a.api.instance.properties=k}(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=new ExpressionSyntax,g={instanceTemplate:function(a){return a.createInstance(this,f)},createBinding:function(a,b,c){var d=this.propertyForAttribute(a);if(d){var e=this.bindProperty(d,b,c);return e.path=c,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(){this._unbound||(this.unbindAllProperties(),this.super(),b(this.shadowRoot),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)}},h=/\{\{([^{}]*)}}/;a.bindPattern=h,a.api.instance.mdv=g}(Polymer),function(a){function b(a){return a.hasOwnProperty("PolymerBase")}function c(){}var d={PolymerBase:!0,job:Polymer.job,"super":Polymer.super,ready:function(){},readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){this.observeProperties(),this.copyInstanceAttributes(),this.takeAttributes(),this.addHostListeners(),this.parseElements(this.__proto__),this.ready()},insertedCallback:function(){this._enteredDocumentCallback()},enteredDocumentCallback:function(){this._enteredDocumentCallback()},_enteredDocumentCallback:function(){this.cancelUnbindAll(!0),this.inserted&&this.inserted(),this.enteredDocument&&this.enteredDocument()},removedCallback:function(){this._leftDocumentCallback()},leftDocumentCallback:function(){this._leftDocumentCallback()},_leftDocumentCallback:function(){this.asyncUnbindAll(),this.removed&&this.removed(),this.leftDocument&&this.leftDocument()},parseElements:function(a){a&&a.element&&(this.parseElements(a.__proto__),a.parseElement.call(this,a.element))},parseElement:function(a){this.shadowFromTemplate(this.fetchTemplate(a))},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemplate:function(a){if(a){this.shadowRoot;var b=this.createShadowRoot();b.applyAuthorStyles=this.applyAuthorStyles,b.resetStyleInheritance=this.resetStyleInheritance;var c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady(b,a),b}},shadowRootReady:function(a,b){this.marshalNodeReferences(a),this.addInstanceListeners(a,b),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){this.attributeToProperty(a,this.getAttribute(a)),this.attributeChanged&&this.attributeChanged.apply(this,arguments)}};c.prototype=d,d.constructor=c,a.Base=c,a.isBase=b,a.api.instance.base=d}(Polymer),function(a){function b(a){return a.__proto__}window.logFlags||{};var c="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);window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimPolyfillDirectives([f],this.localName),Polymer.applyStyleToScope(f,a)}}},scopeHasElementStyle:function(a,b){var d=c+"="+this.localName+"-"+b;return a.querySelector("style["+d+"]")},findStyleController:function(){if(window.ShadowDOMPolyfill)return wrap(document.head);for(var a=this;a.parentNode;)a=a.parentNode;return a===document?document.head:a}};a.api.instance.styles=e}(Polymer),function(a){var b={addResolvePathApi:function(){var a=this.elementPath();this.prototype.resolvePath=function(b){return a+b}},elementPath:function(){return this.urlToPath(HTMLImports.getDocumentUrl(this.ownerDocument))},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}window.logFlags||{};var f=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.installLocalSheets(),this.installGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(i),this.sheets.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 i=this.findNodes(h,f);return i.forEach(function(a){a.parentNode.removeChild(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){function b(a){return a.slice(0,k)==g}function c(a){return a.slice(k)}function d(a){return a.ref?a.ref.content:a.content}var e=a.api.instance.events,f=e.DELEGATES,g=e.EVENT_PREFIX,h=window.logFlags||{},i={inheritDelegates:function(a){this.inheritObject(a,f)},parseHostEvents:function(){var a=this.prototype[f];this.addAttributeDelegates(a)},addAttributeDelegates:function(a){for(var d,e=0;d=this.attributes[e];e++)b(d.name)&&(a[c(d.name)]=d.value)},parseLocalEvents:function(){this.querySelectorAll("template").forEach(function(a){a.delegates={},this.accumulateTemplatedEvents(a,a.delegates),h.events&&console.log("[%s] parseLocalEvents:",this.attributes.name.value,a.delegates)},this)},accumulateTemplatedEvents:function(a,b){if("template"===a.localName){var c=d(a);c&&this.accumulateChildEvents(c,b)}},accumulateChildEvents:function(a,b){a.childNodes.forEach(function(a){this.accumulateEvents(a,b)},this)},accumulateEvents:function(a,b){return this.accumulateAttributeEvents(a,b),this.accumulateChildEvents(a,b),this.accumulateTemplatedEvents(a,b),b},accumulateAttributeEvents:function(a,d){a.attributes&&a.attributes.forEach(function(a){b(a.name)&&this.accumulateEvent(c(a.name),d)},this)},accumulateEvent:function(a,b){a=j[a]||a,b[a]=b[a]||1}},j={webkitanimationstart:"webkitAnimationStart",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitionEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"},k=g.length;i.event_translations=j,a.api.declaration.events=i}(Polymer),function(a){var b=[],c={cacheProperties:function(){this.prototype.customPropertyNames=this.getCustomPropertyNames(this.prototype)},getCustomPropertyNames:function(c){for(var d,e={};c&&!a.isBase(c);){for(var f,g=Object.getOwnPropertyNames(c),h=0,i=g.length;i>h&&(f=g[h]);h++)e[f]=!0,d=!0;c=c.__proto__}return d?Object.keys(e):b}};a.api.declaration.properties=c}(Polymer),function(a){var b=a.api.instance.attributes,c=b.PUBLISHED,d=b.INSTANCE_ATTRIBUTES,e="publish",f="attributes",g={inheritAttributesObjects:function(a){this.inheritObject(a,c),this.inheritObject(a,d)},parseAttributes:function(){this.publishAttributes(this.prototype),this.publishProperties(this.prototype),this.accumulateInstanceAttributes()},publishAttributes:function(a){var b=a[c],d=this.getAttribute(f);if(d){var e=d.split(d.indexOf(",")>=0?",":" ");e.forEach(function(a){a=a.trim(),!a||a in b||(b[a]=null)})}Object.keys(b).forEach(function(c){c in a||(a[c]=b[c])})},publishProperties:function(a){this.publishPublish(a)},publishPublish:function(a){if(a.hasOwnProperty(e)){var b=a[e];b&&(Object.keys(b).forEach(function(c){a[c]=b[c]}),Platform.mixin(a[c],b))}},accumulateInstanceAttributes:function(){var a=this.prototype[d];this.attributes.forEach(function(b){this.isInstanceAttribute(b.name)&&(a[b.name]=b.value)},this)},isInstanceAttribute:function(a){return!this.blackList[a]&&"on-"!==a.slice(0,3)},blackList:{name:1,"extends":1,constructor:1,noscript:1}};g.blackList[f]=1,a.api.declaration.attributes=g}(Polymer),function(a){function b(a,b){h[a]=b||{},g[a]&&g[a].define()}function c(a){return Object.create(HTMLElement.getPrototypeForTag(a))}function d(b){if(!Object.__proto__){var c=Object.getPrototypeOf(b);b.__proto__=c,a.isBase(c)&&(c.__proto__=Object.getPrototypeOf(c))}}var e=Polymer.extend,f=a.api.declaration,g={},h={},i=c();e(i,{readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){var a=this.getAttribute("name");h[a]?this.define():g[a]=this},define:function(){var a=this.getAttribute("name"),b=this.getAttribute("extends");this.prototype=this.generateCustomPrototype(a,b),this.prototype.element=this,this.addResolvePathApi(),d(this.prototype),this.desugar(),window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimStyling(this.templateContent(),a,b),this.register(a),this.publishConstructor()},desugar:function(){this.parseAttributes(),this.parseHostEvents(),this.parseLocalEvents(),this.installSheets(),this.prototype.registerCallback&&this.prototype.registerCallback(this),this.cacheProperties()},generateCustomPrototype:function(a,b){var c=this.generateBasePrototype(b);return this.addNamedApi(c,a)},generateBasePrototype:function(a){var b=c(a);return this.ensureBaseApi(b)},ensureBaseApi:function(b){return b.PolymerBase||(Object.keys(a.api.instance).forEach(function(c){e(b,a.api.instance[c])}),b=Object.create(b)),this.inheritAttributesObjects(b),this.inheritDelegates(b),b},addNamedApi:function(a,b){return e(a,h[b])},inheritObject:function(a,b){a[b]=e({},Object.getPrototypeOf(a)[b])},register:function(a){this.ctor=document.register(a,{prototype:this.prototype}),this.prototype.constructor=this.ctor,HTMLElement.register(a,this.prototype)},publishConstructor:function(){var a=this.getAttribute("constructor");a&&(window[a]=this.ctor)}}),Object.keys(f).forEach(function(a){e(i,f[a])}),document.register("polymer-element",{prototype:i}),e(b,window.Polymer),window.Polymer=b}(Polymer),Polymer.register=function(a){if(a!=window){var b=a.getAttribute("name");throw new Error("Polymer.register is deprecated in declaration of "+b+". Please see http://www.polymer-project.org/getting-started.html")}}; -/* -//@ sourceMappingURL=polymer.sandbox.min.js.map -*/ \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/todomvc-common/.bower.json b/architecture-examples/polymer/bower_components/todomvc-common/.bower.json deleted file mode 100644 index 5f7f85b354..0000000000 --- a/architecture-examples/polymer/bower_components/todomvc-common/.bower.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "todomvc-common", - "version": "0.1.7", - "homepage": "https://github.com/tastejs/todomvc-common", - "_release": "0.1.7", - "_resolution": { - "type": "version", - "tag": "v0.1.7", - "commit": "e5b3251c95f29d872636b761e32a2296dc97c3e0" - }, - "_source": "git://github.com/tastejs/todomvc-common.git", - "_target": "~0.1.4" -} \ No newline at end of file From 300b76cde944bed3a8f1b20e8a6433e9a369b025 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 5 Aug 2013 18:22:45 +0200 Subject: [PATCH 3/3] polymer: code style update --- .../todomvc-common/bower.json | 4 --- .../polymer/elements/td-input.html | 4 +-- .../polymer/elements/td-item.css | 13 ++++---- .../polymer/elements/td-item.html | 10 +++---- .../polymer/elements/td-model.html | 30 ++++++++++--------- .../polymer/elements/td-todos.css | 16 +++++----- .../polymer/elements/td-todos.html | 26 +++++++++------- architecture-examples/polymer/index.html | 16 +++++----- 8 files changed, 60 insertions(+), 59 deletions(-) delete mode 100644 architecture-examples/polymer/bower_components/todomvc-common/bower.json diff --git a/architecture-examples/polymer/bower_components/todomvc-common/bower.json b/architecture-examples/polymer/bower_components/todomvc-common/bower.json deleted file mode 100644 index 0e38dacb14..0000000000 --- a/architecture-examples/polymer/bower_components/todomvc-common/bower.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "todomvc-common", - "version": "0.1.7" -} diff --git a/architecture-examples/polymer/elements/td-input.html b/architecture-examples/polymer/elements/td-input.html index 1c91f9a835..378f1e02ee 100644 --- a/architecture-examples/polymer/elements/td-input.html +++ b/architecture-examples/polymer/elements/td-input.html @@ -4,14 +4,14 @@ var ENTER_KEY = 13; var ESC_KEY = 27; Polymer('td-input', { - keypressAction: function(e, detail, sender) { + keypressAction: function (e, detail, sender) { // Listen for enter on keypress but esc on keyup, because // IE doesn't fire keyup for enter. if (e.keyCode === ENTER_KEY) { this.fire('td-input-commit'); } }, - keyupAction: function(e, detail, sender) { + keyupAction: function (e, detail, sender) { if (e.keyCode === ESC_KEY) { this.fire('td-input-cancel'); } diff --git a/architecture-examples/polymer/elements/td-item.css b/architecture-examples/polymer/elements/td-item.css index c3768aefee..c29937b48d 100644 --- a/architecture-examples/polymer/elements/td-item.css +++ b/architecture-examples/polymer/elements/td-item.css @@ -124,8 +124,7 @@ label { } .destroy:hover { - text-shadow: 0 0 1px #000, - 0 0 10px rgba(199, 107, 107, 0.8); + text-shadow: 0 0 1px #000, 0 0 10px rgba(199, 107, 107, 0.8); -webkit-transform: scale(1.3); -moz-transform: scale(1.3); -ms-transform: scale(1.3); @@ -148,11 +147,11 @@ label { @media screen and (-webkit-min-device-pixel-ratio:0) { .toggle { background: none; - /* - ShadowDOM Polyfill work around for webkit/blink bug - https://code.google.com/p/chromium/issues/detail?id=251510 - */ - background-color: transparent; + /* + ShadowDOM Polyfill work around for webkit/blink bug + https://code.google.com/p/chromium/issues/detail?id=251510 + */ + background-color: transparent; } .toggle { diff --git a/architecture-examples/polymer/elements/td-item.html b/architecture-examples/polymer/elements/td-item.html index ad97216df3..f17ba48f12 100644 --- a/architecture-examples/polymer/elements/td-item.html +++ b/architecture-examples/polymer/elements/td-item.html @@ -10,12 +10,12 @@